From 1a7d70bd29a40d6b7333ad27284359667f0bfa22 Mon Sep 17 00:00:00 2001 From: my_ong <429426262@qq.com> Date: Mon, 9 Dec 2024 15:56:21 +0800 Subject: [PATCH] =?UTF-8?q?:new:=20=E6=9F=A5=E7=9C=8B=E5=92=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=9B=98=E7=82=B9=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api-lock.json | 384 ++++++++++++++++++ src/api/material/api.d.ts | 72 ++++ src/api/material/mods/apply/applies.ts | 33 -- .../material/mods/apply/getComparisonRes.ts | 21 + src/api/material/mods/apply/index.ts | 4 + .../material/mods/apply/updateReviewResult.ts | 25 ++ src/views/stock/stocktaking/resultForm.vue | 78 ++++ .../stock/stocktaking/stocktaking-page.vue | 61 ++- 8 files changed, 628 insertions(+), 50 deletions(-) delete mode 100644 src/api/material/mods/apply/applies.ts create mode 100644 src/api/material/mods/apply/getComparisonRes.ts create mode 100644 src/api/material/mods/apply/updateReviewResult.ts create mode 100644 src/views/stock/stocktaking/resultForm.vue diff --git a/src/api/api-lock.json b/src/api/api-lock.json index 165ebf6..4b87ae9 100644 --- a/src/api/api-lock.json +++ b/src/api/api-lock.json @@ -3712,6 +3712,94 @@ } ] }, + { + "description": "获取盘点结果数据", + "name": "getComparisonRes", + "method": "get", + "path": "/comparison-result/{applyId}", + "response": { + "typeArgs": [], + "typeName": "ComparisonResDTO", + "isDefsType": true, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "parameters": [ + { + "description": "申请单ID", + "required": true, + "in": "path", + "name": "applyId", + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + } + ] + }, + { + "description": "处理盘点异常数据", + "name": "updateReviewResult", + "method": "put", + "path": "/handle-exceptional-data/{applyId}", + "response": { + "typeArgs": [], + "typeName": "", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "parameters": [ + { + "description": "申请单ID", + "required": true, + "in": "path", + "name": "applyId", + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + }, + { + "required": true, + "in": "body", + "name": "requestBody", + "dataType": { + "typeArgs": [ + { + "typeArgs": [], + "typeName": "StocktakingScanExceptionalData", + "isDefsType": true, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + ], + "typeName": "Array", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + } + ] + }, { "description": "提交盘点扫码数据", "name": "saveScanData", @@ -4780,6 +4868,60 @@ } ] }, + { + "name": "ComparisonResDTO", + "templateArgs": [], + "properties": [ + { + "dataType": { + "typeArgs": [ + { + "typeArgs": [], + "typeName": "StockDetailInfo", + "isDefsType": true, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + ], + "typeName": "Array", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "details", + "description": "库存明细", + "required": false + }, + { + "dataType": { + "typeArgs": [ + { + "typeArgs": [], + "typeName": "StocktakingScanExceptionalData", + "isDefsType": true, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + } + ], + "typeName": "Array", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "exceptionalData", + "description": "差异数据", + "required": false + } + ] + }, { "description": "全局错误", "name": "GlobalError", @@ -5312,6 +5454,97 @@ } ] }, + { + "description": "库存明细", + "name": "StockDetailInfo", + "templateArgs": [], + "properties": [ + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "materialCode", + "description": "物料编码", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "number", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "materialId", + "description": "物料名称", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "materialName", + "description": "物料名称", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "number", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "stockReal", + "description": "实际库存(明细数据中统计来的)", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "number", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "stockTotal", + "description": "在存总数(物料表)", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "number", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "stockTotalScan", + "description": "扫码数量", + "required": false + } + ] + }, { "description": "扫码盘点明细表(记录历次盘点扫码的数据)", "name": "StocktakingScanDetail", @@ -5399,6 +5632,157 @@ "required": false } ] + }, + { + "description": "扫码盘点异常数据表", + "name": "StocktakingScanExceptionalData", + "templateArgs": [], + "properties": [ + { + "dataType": { + "typeArgs": [], + "typeName": "number", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "applyId", + "description": "申请单id", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "barcode", + "description": "条码", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "createdTime", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [ + "'INBOUND'", + "'OUTBOUND'", + "'DISCARD'" + ], + "typeProperties": [] + }, + "name": "exceptionHandle", + "description": "异常处理", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [ + "'SOCK_IN_BUT_SCAN_NOT_EXIST'", + "'SOCK_OUT_BUT_SCAN_EXIST'", + "'SOCK_NOT_EXIST_BUT_SCAN_EXIST'" + ], + "typeProperties": [] + }, + "name": "exceptionReason", + "description": "异常类型", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "number", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "id", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "number", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "materialId", + "description": "物料ID", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "materialName", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "remark", + "description": "备注", + "required": false + }, + { + "dataType": { + "typeArgs": [], + "typeName": "string", + "isDefsType": false, + "templateIndex": -1, + "compileTemplateKeyword": "#/definitions/", + "enum": [], + "typeProperties": [] + }, + "name": "updatedTime", + "required": false + } + ] } ] } diff --git a/src/api/material/api.d.ts b/src/api/material/api.d.ts index 24e6443..1070236 100644 --- a/src/api/material/api.d.ts +++ b/src/api/material/api.d.ts @@ -187,6 +187,17 @@ declare namespace material { updatedTime?: string; } + /** + * ComparisonResDTO + */ + export interface ComparisonResDTO { + /** 库存明细 */ + details?: Array; + + /** 差异数据 */ + exceptionalData?: Array; + } + /** * 物料信息 */ @@ -248,6 +259,29 @@ declare namespace material { updatedTime?: string; } + /** + * 库存明细 + */ + export interface StockDetailInfo { + /** 物料编码 */ + materialCode?: string; + + /** 物料名称 */ + materialId?: number; + + /** 物料名称 */ + materialName?: string; + + /** 实际库存(明细数据中统计来的) */ + stockReal?: number; + + /** 在存总数(物料表) */ + stockTotal?: number; + + /** 扫码数量 */ + stockTotalScan?: number; + } + /** * 扫码盘点明细表(记录历次盘点扫码的数据) */ @@ -270,4 +304,42 @@ declare namespace material { /** updatedTime */ updatedTime?: string; } + + /** + * 扫码盘点异常数据表 + */ + export interface StocktakingScanExceptionalData { + /** 申请单id */ + applyId?: number; + + /** 条码 */ + barcode?: string; + + /** createdTime */ + createdTime?: string; + + /** 异常处理 */ + exceptionHandle?: 'INBOUND' | 'OUTBOUND' | 'DISCARD'; + + /** 异常类型 */ + exceptionReason?: + | 'SOCK_IN_BUT_SCAN_NOT_EXIST' + | 'SOCK_OUT_BUT_SCAN_EXIST' + | 'SOCK_NOT_EXIST_BUT_SCAN_EXIST'; + + /** id */ + id?: number; + + /** 物料ID */ + materialId?: number; + + /** materialName */ + materialName?: string; + + /** 备注 */ + remark?: string; + + /** updatedTime */ + updatedTime?: string; + } } diff --git a/src/api/material/mods/apply/applies.ts b/src/api/material/mods/apply/applies.ts deleted file mode 100644 index c111f48..0000000 --- a/src/api/material/mods/apply/applies.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @desc 分页查询申请单列表 - */ -import { defaultSuccess, defaultError, http } from '@/plugins/axios'; -import type { AxiosResponse } from 'axios'; -import type { IPage } from '@/api/api'; -export interface Params { - /** 类型 */ - type: number; - /** 页码 */ - page?: number; - /** 页面大小 */ - size?: number; - /** 搜索关键词 */ - key?: string; -} - -export default async function ( - params: Params, - success: (data: IPage) => void = defaultSuccess, - fail: (error: { code: string; error?: string }) => void = defaultError, -): Promise { - return http({ - method: 'get', - url: `/apply`, - - params, - }) - .then((data: AxiosResponse, unknown>) => { - success(data.data); - }) - .catch((error: { code: string; error?: string }) => fail(error)); -} diff --git a/src/api/material/mods/apply/getComparisonRes.ts b/src/api/material/mods/apply/getComparisonRes.ts new file mode 100644 index 0000000..590f9d9 --- /dev/null +++ b/src/api/material/mods/apply/getComparisonRes.ts @@ -0,0 +1,21 @@ +/** + * @desc 获取盘点结果数据 + */ +import { defaultSuccess, defaultError, http } from '@/plugins/axios'; +import type { AxiosResponse } from 'axios'; +export default async function ( + /** 申请单ID */ + applyId: string, + + success: (data: material.ComparisonResDTO) => void = defaultSuccess, + fail: (error: { code: string; error?: string }) => void = defaultError, +): Promise { + return http({ + method: 'get', + url: `/comparison-result/${applyId}`, + }) + .then((data: AxiosResponse) => { + success(data.data); + }) + .catch((error: { code: string; error?: string }) => fail(error)); +} diff --git a/src/api/material/mods/apply/index.ts b/src/api/material/mods/apply/index.ts index 78d2c14..479dcb7 100644 --- a/src/api/material/mods/apply/index.ts +++ b/src/api/material/mods/apply/index.ts @@ -7,6 +7,8 @@ import saveApply from './saveApply'; import detail from './detail'; import searchAuditPage from './searchAuditPage'; import auditApply from './auditApply'; +import getComparisonRes from './getComparisonRes'; +import updateReviewResult from './updateReviewResult'; import saveScanData from './saveScanData'; export default { @@ -15,5 +17,7 @@ export default { detail, searchAuditPage, auditApply, + getComparisonRes, + updateReviewResult, saveScanData, }; diff --git a/src/api/material/mods/apply/updateReviewResult.ts b/src/api/material/mods/apply/updateReviewResult.ts new file mode 100644 index 0000000..1c71f37 --- /dev/null +++ b/src/api/material/mods/apply/updateReviewResult.ts @@ -0,0 +1,25 @@ +/** + * @desc 处理盘点异常数据 + */ +import { defaultSuccess, defaultError, http } from '@/plugins/axios'; +import type { AxiosResponse } from 'axios'; +export default async function ( + /** 申请单ID */ + applyId: string, + + /** 请求体 */ + requestBody: Array, + + success: (data: void) => void = defaultSuccess, + fail: (error: { code: string; error?: string }) => void = defaultError, +): Promise { + return http({ + method: 'put', + url: `/handle-exceptional-data/${applyId}`, + data: requestBody, + }) + .then((data: AxiosResponse) => { + success(data.data); + }) + .catch((error: { code: string; error?: string }) => fail(error)); +} diff --git a/src/views/stock/stocktaking/resultForm.vue b/src/views/stock/stocktaking/resultForm.vue new file mode 100644 index 0000000..d129c12 --- /dev/null +++ b/src/views/stock/stocktaking/resultForm.vue @@ -0,0 +1,78 @@ + + diff --git a/src/views/stock/stocktaking/stocktaking-page.vue b/src/views/stock/stocktaking/stocktaking-page.vue index 0cd01a2..84baaae 100644 --- a/src/views/stock/stocktaking/stocktaking-page.vue +++ b/src/views/stock/stocktaking/stocktaking-page.vue @@ -36,13 +36,14 @@