From d18fbd21e98b53f1ec35b2434d6ff242ab180de3 Mon Sep 17 00:00:00 2001 From: my_ong <429426262@qq.com> Date: Sat, 7 Dec 2024 21:27:03 +0800 Subject: [PATCH] =?UTF-8?q?:new:=20=E7=9B=98=E7=82=B9=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/acl/mods/user/all.ts | 18 + src/api/acl/mods/user/index.ts | 2 + src/api/api-lock.json | 314 +++++++++++++++++- src/api/material/api.d.ts | 54 ++- src/api/material/mods/apply/auditApply.ts | 22 ++ src/api/material/mods/apply/detail.ts | 2 +- src/api/material/mods/apply/index.ts | 2 + .../material/mods/apply/searchAuditPage.ts | 2 +- src/views/stock/component/applyForm.vue | 6 +- .../stock/report/stocktakingReport-page.vue | 60 +++- src/views/stock/stocktaking/form.ts | 97 ++++++ .../stock/stocktaking/stocktaking-page.vue | 129 ++++++- 12 files changed, 674 insertions(+), 34 deletions(-) create mode 100644 src/api/acl/mods/user/all.ts create mode 100644 src/api/material/mods/apply/auditApply.ts create mode 100644 src/views/stock/stocktaking/form.ts diff --git a/src/api/acl/mods/user/all.ts b/src/api/acl/mods/user/all.ts new file mode 100644 index 0000000..28eca08 --- /dev/null +++ b/src/api/acl/mods/user/all.ts @@ -0,0 +1,18 @@ +/** + * @desc 所有用户 + */ +import { defaultSuccess, defaultError, http } from '@/plugins/axios'; +import type { AxiosResponse } from 'axios'; +export default async function ( + success: (data: Array) => void = defaultSuccess, + fail: (error: { code: string; error?: string }) => void = defaultError, +): Promise { + return http({ + method: 'get', + url: `/user-all`, + }) + .then((data: AxiosResponse, unknown>) => { + success(data.data); + }) + .catch((error: { code: string; error?: string }) => fail(error)); +} diff --git a/src/api/acl/mods/user/index.ts b/src/api/acl/mods/user/index.ts index 7e2e31e..89ba87d 100644 --- a/src/api/acl/mods/user/index.ts +++ b/src/api/acl/mods/user/index.ts @@ -3,6 +3,7 @@ * */ import saveOrUpdateUser from './saveOrUpdateUser'; +import all from './all'; import sexes from './sexes'; import detail from './detail'; import deleteUser from './deleteUser'; @@ -16,6 +17,7 @@ import users from './users'; export default { saveOrUpdateUser, + all, sexes, detail, deleteUser, diff --git a/src/api/api-lock.json b/src/api/api-lock.json index 5aa7359..9dcbb00 100644 --- a/src/api/api-lock.json +++ b/src/api/api-lock.json @@ -1190,6 +1190,32 @@ } ] }, + { + "description": "所有用户", + "name": "all", + "method": "get", + "path": "/user-all", + "response": { + "typeArgs": [ + { + "typeArgs": [], + "typeName": "User", + "isDefsType": true, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + ], + "typeName": "Array", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "parameters": [] + }, { "description": "用户性别", "name": "sexes", @@ -3513,7 +3539,7 @@ }, "parameters": [ { - "description": "类型", + "description": "申请单ID", "required": true, "in": "path", "name": "applyId", @@ -3636,13 +3662,45 @@ "enum": [ "'PASS'", "'UN_PASS'", - "'WAIT'", - "'REJECT'" + "'WAIT_AUDIT'", + "'REJECT'", + "'WAIT_CHECK'" ], "typeProperties": [] } } ] + }, + { + "description": "提交盘点申请单", + "name": "auditApply", + "method": "post", + "path": "/audit-apply", + "response": { + "typeArgs": [], + "typeName": "", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "parameters": [ + { + "required": true, + "in": "body", + "name": "requestBody", + "dataType": { + "typeArgs": [], + "typeName": "AuditApplyInfo", + "isDefsType": true, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + } + ] } ] }, @@ -4283,13 +4341,14 @@ "enum": [ "'PASS'", "'UN_PASS'", - "'WAIT'", - "'REJECT'" + "'WAIT_AUDIT'", + "'REJECT'", + "'WAIT_CHECK'" ], "typeProperties": [] }, "name": "reviewResult", - "description": "审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点)", + "description": "审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点)", "required": false }, { @@ -4422,6 +4481,249 @@ } ] }, + { + "description": "申请单", + "name": "AuditApplyInfo", + "templateArgs": [], + "properties": [ + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "applicant", + "description": "申请人", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "applyDate", + "description": "申请日期", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [ + "'ALL'", + "'PARTIAL'" + ], + "typeProperties": [] + }, + "name": "auditType", + "description": "盘点类型(1: 全盘 2: 部分盘点)", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "createdTime", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "exception", + "description": "异常原因", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [ + "'NO_ACTION'", + "'IGNORE_AND_SAVE'", + "'REPLENISH'", + "'OTHER'" + ], + "typeProperties": [] + }, + "name": "handle", + "description": "处理方式(1-无需处理 2-忽略并修改库存 3-补充库存 4-其他)", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "number", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "id", + "required": false + }, + { + "dataType": { + "typeArgs": [ + { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + ], + "typeName": "Array", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "ids", + "description": "物料ids", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "boolean", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "isConfirm", + "description": "是否确认(0: 未确认 1: 已确认)", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "result", + "description": "结果(系统自动生成)", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [ + "'PASS'", + "'UN_PASS'", + "'WAIT_AUDIT'", + "'REJECT'", + "'WAIT_CHECK'" + ], + "typeProperties": [] + }, + "name": "reviewResult", + "description": "审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点)", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "reviewer", + "description": "盘点审核人", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "taker", + "description": "盘点人", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [ + "'PURCHASE_RECEIPT'", + "'RETURN_RECEIPT'", + "'LOAN_OUT'", + "'AUDIT'" + ], + "typeProperties": [] + }, + "name": "type", + "description": "类型(1: 采购入库申请 2: 归还入库申请 3: 出库外借申请 4: 盘点申请)", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "updatedTime", + "required": false + } + ] + }, { "description": "全局错误", "name": "GlobalError", diff --git a/src/api/material/api.d.ts b/src/api/material/api.d.ts index fc4646e..3b9584f 100644 --- a/src/api/material/api.d.ts +++ b/src/api/material/api.d.ts @@ -97,8 +97,8 @@ declare namespace material { /** 结果(系统自动生成) */ result?: string; - /** 审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点) */ - reviewResult?: 'PASS' | 'UN_PASS' | 'WAIT' | 'REJECT'; + /** 审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点) */ + reviewResult?: 'PASS' | 'UN_PASS' | 'WAIT_AUDIT' | 'REJECT' | 'WAIT_CHECK'; /** 盘点审核人 */ reviewer?: string; @@ -127,6 +127,56 @@ declare namespace material { detailList?: Array; } + /** + * 申请单 + */ + export interface AuditApplyInfo { + /** 申请人 */ + applicant?: string; + + /** 申请日期 */ + applyDate?: string; + + /** 盘点类型(1: 全盘 2: 部分盘点) */ + auditType?: 'ALL' | 'PARTIAL'; + + /** createdTime */ + createdTime?: string; + + /** 异常原因 */ + exception?: string; + + /** 处理方式(1-无需处理 2-忽略并修改库存 3-补充库存 4-其他) */ + handle?: 'NO_ACTION' | 'IGNORE_AND_SAVE' | 'REPLENISH' | 'OTHER'; + + /** id */ + id?: number; + + /** 物料ids */ + ids?: Array; + + /** 是否确认(0: 未确认 1: 已确认) */ + isConfirm?: boolean; + + /** 结果(系统自动生成) */ + result?: string; + + /** 审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点) */ + reviewResult?: 'PASS' | 'UN_PASS' | 'WAIT_AUDIT' | 'REJECT' | 'WAIT_CHECK'; + + /** 盘点审核人 */ + reviewer?: string; + + /** 盘点人 */ + taker?: string; + + /** 类型(1: 采购入库申请 2: 归还入库申请 3: 出库外借申请 4: 盘点申请) */ + type?: 'PURCHASE_RECEIPT' | 'RETURN_RECEIPT' | 'LOAN_OUT' | 'AUDIT'; + + /** updatedTime */ + updatedTime?: string; + } + /** * 物料信息 */ diff --git a/src/api/material/mods/apply/auditApply.ts b/src/api/material/mods/apply/auditApply.ts new file mode 100644 index 0000000..ed61e57 --- /dev/null +++ b/src/api/material/mods/apply/auditApply.ts @@ -0,0 +1,22 @@ +/** + * @desc 提交盘点申请单 + */ +import { defaultSuccess, defaultError, http } from '@/plugins/axios'; +import type { AxiosResponse } from 'axios'; +export default async function ( + /** 请求体 */ + requestBody: material.AuditApplyInfo, + + success: (data: void) => void = defaultSuccess, + fail: (error: { code: string; error?: string }) => void = defaultError, +): Promise { + return http({ + method: 'post', + url: `/audit-apply`, + data: requestBody, + }) + .then((data: AxiosResponse) => { + success(data.data); + }) + .catch((error: { code: string; error?: string }) => fail(error)); +} diff --git a/src/api/material/mods/apply/detail.ts b/src/api/material/mods/apply/detail.ts index 5c4d5e5..9a09381 100644 --- a/src/api/material/mods/apply/detail.ts +++ b/src/api/material/mods/apply/detail.ts @@ -4,7 +4,7 @@ import { defaultSuccess, defaultError, http } from '@/plugins/axios'; import type { AxiosResponse } from 'axios'; export default async function ( - /** 类型 */ + /** 申请单ID */ applyId: number, success: (data: material.ApplyInfo) => void = defaultSuccess, diff --git a/src/api/material/mods/apply/index.ts b/src/api/material/mods/apply/index.ts index a1cb017..ec97d65 100644 --- a/src/api/material/mods/apply/index.ts +++ b/src/api/material/mods/apply/index.ts @@ -6,10 +6,12 @@ import searchPage from './searchPage'; import saveApply from './saveApply'; import detail from './detail'; import searchAuditPage from './searchAuditPage'; +import auditApply from './auditApply'; export default { searchPage, saveApply, detail, searchAuditPage, + auditApply, }; diff --git a/src/api/material/mods/apply/searchAuditPage.ts b/src/api/material/mods/apply/searchAuditPage.ts index 6c6cd0c..dbedfe2 100644 --- a/src/api/material/mods/apply/searchAuditPage.ts +++ b/src/api/material/mods/apply/searchAuditPage.ts @@ -16,7 +16,7 @@ export interface Params { /** 创建日期 */ createDate?: string; /** 审核状态 */ - reviewResult?: 'PASS' | 'UN_PASS' | 'WAIT' | 'REJECT'; + reviewResult?: 'PASS' | 'UN_PASS' | 'WAIT_AUDIT' | 'REJECT' | 'WAIT_CHECK'; } export default async function ( diff --git a/src/views/stock/component/applyForm.vue b/src/views/stock/component/applyForm.vue index 468297c..4e903be 100644 --- a/src/views/stock/component/applyForm.vue +++ b/src/views/stock/component/applyForm.vue @@ -8,9 +8,9 @@ - 采购入库 - 归还入库 - 出库外借 + 采购入库 + 归还入库 + 出库外借 diff --git a/src/views/stock/report/stocktakingReport-page.vue b/src/views/stock/report/stocktakingReport-page.vue index 7a34c95..5c377cb 100644 --- a/src/views/stock/report/stocktakingReport-page.vue +++ b/src/views/stock/report/stocktakingReport-page.vue @@ -12,32 +12,53 @@
- + + +
+ + diff --git a/src/views/stock/stocktaking/form.ts b/src/views/stock/stocktaking/form.ts new file mode 100644 index 0000000..bb133e0 --- /dev/null +++ b/src/views/stock/stocktaking/form.ts @@ -0,0 +1,97 @@ +import { FormItem, FormConfig } from '@/components/form-render/form-render-types' + + +export const config: FormConfig = { + layout: 'horizontal', + colon: true, + hideRequiredMark: false, + labelAlign: 'right', + scrollToFirstError: false, + validateOnRuleChange: true, + labelCol: { + span: 4, + offset: 0, + }, +} + +export const formItems = (materialOptions: Array<{ value: string | undefined, label: string | undefined }>, + required : Ref, + persons: Array<{ value: string | undefined, label: string | undefined }>): FormItem[] => [ + { + group: 'form', + type: 'radio', + config: { + autoLink: true, + hasFeedback: false, + label: '盘点类型', + name: 'auditType', + required: true, + }, + properties: { + size: 'default', + optionType: 'button', + buttonStyle: 'solid', + defaultValue: "ALL", + options: [{ value: "ALL", label: "全部盘点" }, { value: "PARTIAL", label: "部分盘点" }] + }, + rules: [], + }, + { + group: 'form', + type: 'select', + hidden: true, + config: { + autoLink: true, + hasFeedback: false, + label: '物料选择', + name: 'ids', + }, + properties: { + size: 'default', + mode: 'multiple', + required: required.value, + placeholder: '请选择物料', + options: materialOptions, + }, + rules: [], + }, + { + group: 'form', + type: 'select', + config: { + autoLink: true, + hasFeedback: false, + label: '盘点人员', + name: 'taker', + required: true, + }, + properties: { + size: 'default', + type: 'text', + allowClear: false, + bordered: true, + showCount: false, + options: persons, + placeholder: '请输入盘点人员', + }, + rules: [], + }, + { + type: 'select', + group: 'form', + config: { + autoLink: true, + hasFeedback: false, + label: '审核人员', + name: 'reviewer', + required: true, + }, + properties: { + size: 'default', + controls: true, + placeholder: '请填写审核人员', + options: persons, + }, + rules: [], + } + ] diff --git a/src/views/stock/stocktaking/stocktaking-page.vue b/src/views/stock/stocktaking/stocktaking-page.vue index ca7b6f3..8d14056 100644 --- a/src/views/stock/stocktaking/stocktaking-page.vue +++ b/src/views/stock/stocktaking/stocktaking-page.vue @@ -8,7 +8,7 @@ @search="loadData()"> - + @@ -20,32 +20,115 @@
- + + +
+ + +