🆕 扫码盘点
This commit is contained in:
parent
d18fbd21e9
commit
6fd544fc02
@ -3652,20 +3652,30 @@
|
|||||||
"description": "审核状态",
|
"description": "审核状态",
|
||||||
"required": false,
|
"required": false,
|
||||||
"in": "query",
|
"in": "query",
|
||||||
"name": "reviewResult",
|
"name": "reviewResults",
|
||||||
"dataType": {
|
"dataType": {
|
||||||
"typeArgs": [],
|
"typeArgs": [
|
||||||
"typeName": "",
|
{
|
||||||
|
"typeArgs": [],
|
||||||
|
"typeName": "string",
|
||||||
|
"isDefsType": false,
|
||||||
|
"templateIndex": -1,
|
||||||
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
|
"enum": [
|
||||||
|
"'WAIT_SCAN'",
|
||||||
|
"'WAIT_SUBMIT'",
|
||||||
|
"'WAIT_REVIEW'",
|
||||||
|
"'PASS'",
|
||||||
|
"'REJECT'"
|
||||||
|
],
|
||||||
|
"typeProperties": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typeName": "Array",
|
||||||
"isDefsType": false,
|
"isDefsType": false,
|
||||||
"templateIndex": -1,
|
"templateIndex": -1,
|
||||||
"compileTemplateKeyword": "#/definitions/",
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
"enum": [
|
"enum": [],
|
||||||
"'PASS'",
|
|
||||||
"'UN_PASS'",
|
|
||||||
"'WAIT_AUDIT'",
|
|
||||||
"'REJECT'",
|
|
||||||
"'WAIT_CHECK'"
|
|
||||||
],
|
|
||||||
"typeProperties": []
|
"typeProperties": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3701,6 +3711,62 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "提交盘点扫码数据",
|
||||||
|
"name": "saveScanData",
|
||||||
|
"method": "post",
|
||||||
|
"path": "/scan-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": "number",
|
||||||
|
"isDefsType": false,
|
||||||
|
"templateIndex": -1,
|
||||||
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
|
"enum": [],
|
||||||
|
"typeProperties": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"required": true,
|
||||||
|
"in": "body",
|
||||||
|
"name": "requestBody",
|
||||||
|
"dataType": {
|
||||||
|
"typeArgs": [
|
||||||
|
{
|
||||||
|
"typeArgs": [],
|
||||||
|
"typeName": "StocktakingScanDetail",
|
||||||
|
"isDefsType": true,
|
||||||
|
"templateIndex": -1,
|
||||||
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
|
"enum": [],
|
||||||
|
"typeProperties": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typeName": "Array",
|
||||||
|
"isDefsType": false,
|
||||||
|
"templateIndex": -1,
|
||||||
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
|
"enum": [],
|
||||||
|
"typeProperties": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -4274,20 +4340,15 @@
|
|||||||
{
|
{
|
||||||
"dataType": {
|
"dataType": {
|
||||||
"typeArgs": [],
|
"typeArgs": [],
|
||||||
"typeName": "",
|
"typeName": "string",
|
||||||
"isDefsType": false,
|
"isDefsType": false,
|
||||||
"templateIndex": -1,
|
"templateIndex": -1,
|
||||||
"compileTemplateKeyword": "#/definitions/",
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
"enum": [
|
"enum": [],
|
||||||
"'NO_ACTION'",
|
|
||||||
"'IGNORE_AND_SAVE'",
|
|
||||||
"'REPLENISH'",
|
|
||||||
"'OTHER'"
|
|
||||||
],
|
|
||||||
"typeProperties": []
|
"typeProperties": []
|
||||||
},
|
},
|
||||||
"name": "handle",
|
"name": "handle",
|
||||||
"description": "处理方式(1-无需处理 2-忽略并修改库存 3-补充库存 4-其他)",
|
"description": "处理摘要",
|
||||||
"required": false
|
"required": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -4339,16 +4400,16 @@
|
|||||||
"templateIndex": -1,
|
"templateIndex": -1,
|
||||||
"compileTemplateKeyword": "#/definitions/",
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
"'WAIT_SCAN'",
|
||||||
|
"'WAIT_SUBMIT'",
|
||||||
|
"'WAIT_REVIEW'",
|
||||||
"'PASS'",
|
"'PASS'",
|
||||||
"'UN_PASS'",
|
"'REJECT'"
|
||||||
"'WAIT_AUDIT'",
|
|
||||||
"'REJECT'",
|
|
||||||
"'WAIT_CHECK'"
|
|
||||||
],
|
],
|
||||||
"typeProperties": []
|
"typeProperties": []
|
||||||
},
|
},
|
||||||
"name": "reviewResult",
|
"name": "reviewResult",
|
||||||
"description": "审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点)",
|
"description": "审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回)",
|
||||||
"required": false
|
"required": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -4561,20 +4622,15 @@
|
|||||||
{
|
{
|
||||||
"dataType": {
|
"dataType": {
|
||||||
"typeArgs": [],
|
"typeArgs": [],
|
||||||
"typeName": "",
|
"typeName": "string",
|
||||||
"isDefsType": false,
|
"isDefsType": false,
|
||||||
"templateIndex": -1,
|
"templateIndex": -1,
|
||||||
"compileTemplateKeyword": "#/definitions/",
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
"enum": [
|
"enum": [],
|
||||||
"'NO_ACTION'",
|
|
||||||
"'IGNORE_AND_SAVE'",
|
|
||||||
"'REPLENISH'",
|
|
||||||
"'OTHER'"
|
|
||||||
],
|
|
||||||
"typeProperties": []
|
"typeProperties": []
|
||||||
},
|
},
|
||||||
"name": "handle",
|
"name": "handle",
|
||||||
"description": "处理方式(1-无需处理 2-忽略并修改库存 3-补充库存 4-其他)",
|
"description": "处理摘要",
|
||||||
"required": false
|
"required": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -4650,16 +4706,16 @@
|
|||||||
"templateIndex": -1,
|
"templateIndex": -1,
|
||||||
"compileTemplateKeyword": "#/definitions/",
|
"compileTemplateKeyword": "#/definitions/",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
"'WAIT_SCAN'",
|
||||||
|
"'WAIT_SUBMIT'",
|
||||||
|
"'WAIT_REVIEW'",
|
||||||
"'PASS'",
|
"'PASS'",
|
||||||
"'UN_PASS'",
|
"'REJECT'"
|
||||||
"'WAIT_AUDIT'",
|
|
||||||
"'REJECT'",
|
|
||||||
"'WAIT_CHECK'"
|
|
||||||
],
|
],
|
||||||
"typeProperties": []
|
"typeProperties": []
|
||||||
},
|
},
|
||||||
"name": "reviewResult",
|
"name": "reviewResult",
|
||||||
"description": "审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点)",
|
"description": "审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回)",
|
||||||
"required": false
|
"required": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -5232,7 +5288,8 @@
|
|||||||
"enum": [
|
"enum": [
|
||||||
"'IN'",
|
"'IN'",
|
||||||
"'OUT'",
|
"'OUT'",
|
||||||
"'OFF'"
|
"'OFF'",
|
||||||
|
"'LOST'"
|
||||||
],
|
],
|
||||||
"typeProperties": []
|
"typeProperties": []
|
||||||
},
|
},
|
||||||
@ -5254,6 +5311,94 @@
|
|||||||
"required": false
|
"required": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "扫码盘点明细表(记录历次盘点扫码的数据)",
|
||||||
|
"name": "StocktakingScanDetail",
|
||||||
|
"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": "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": "updatedTime",
|
||||||
|
"required": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
51
src/api/material/api.d.ts
vendored
51
src/api/material/api.d.ts
vendored
@ -85,8 +85,8 @@ declare namespace material {
|
|||||||
/** 异常原因 */
|
/** 异常原因 */
|
||||||
exception?: string;
|
exception?: string;
|
||||||
|
|
||||||
/** 处理方式(1-无需处理 2-忽略并修改库存 3-补充库存 4-其他) */
|
/** 处理摘要 */
|
||||||
handle?: 'NO_ACTION' | 'IGNORE_AND_SAVE' | 'REPLENISH' | 'OTHER';
|
handle?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number;
|
id?: number;
|
||||||
@ -97,8 +97,13 @@ declare namespace material {
|
|||||||
/** 结果(系统自动生成) */
|
/** 结果(系统自动生成) */
|
||||||
result?: string;
|
result?: string;
|
||||||
|
|
||||||
/** 审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点) */
|
/** 审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回) */
|
||||||
reviewResult?: 'PASS' | 'UN_PASS' | 'WAIT_AUDIT' | 'REJECT' | 'WAIT_CHECK';
|
reviewResult?:
|
||||||
|
| 'WAIT_SCAN'
|
||||||
|
| 'WAIT_SUBMIT'
|
||||||
|
| 'WAIT_REVIEW'
|
||||||
|
| 'PASS'
|
||||||
|
| 'REJECT';
|
||||||
|
|
||||||
/** 盘点审核人 */
|
/** 盘点审核人 */
|
||||||
reviewer?: string;
|
reviewer?: string;
|
||||||
@ -146,8 +151,8 @@ declare namespace material {
|
|||||||
/** 异常原因 */
|
/** 异常原因 */
|
||||||
exception?: string;
|
exception?: string;
|
||||||
|
|
||||||
/** 处理方式(1-无需处理 2-忽略并修改库存 3-补充库存 4-其他) */
|
/** 处理摘要 */
|
||||||
handle?: 'NO_ACTION' | 'IGNORE_AND_SAVE' | 'REPLENISH' | 'OTHER';
|
handle?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number;
|
id?: number;
|
||||||
@ -161,8 +166,13 @@ declare namespace material {
|
|||||||
/** 结果(系统自动生成) */
|
/** 结果(系统自动生成) */
|
||||||
result?: string;
|
result?: string;
|
||||||
|
|
||||||
/** 审核结果(1-通过 2-不通过 3-待审核 4-退回重新盘点 5-待盘点) */
|
/** 审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回) */
|
||||||
reviewResult?: 'PASS' | 'UN_PASS' | 'WAIT_AUDIT' | 'REJECT' | 'WAIT_CHECK';
|
reviewResult?:
|
||||||
|
| 'WAIT_SCAN'
|
||||||
|
| 'WAIT_SUBMIT'
|
||||||
|
| 'WAIT_REVIEW'
|
||||||
|
| 'PASS'
|
||||||
|
| 'REJECT';
|
||||||
|
|
||||||
/** 盘点审核人 */
|
/** 盘点审核人 */
|
||||||
reviewer?: string;
|
reviewer?: string;
|
||||||
@ -232,7 +242,30 @@ declare namespace material {
|
|||||||
materialId?: number;
|
materialId?: number;
|
||||||
|
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
status?: 'IN' | 'OUT' | 'OFF';
|
status?: 'IN' | 'OUT' | 'OFF' | 'LOST';
|
||||||
|
|
||||||
|
/** updatedTime */
|
||||||
|
updatedTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码盘点明细表(记录历次盘点扫码的数据)
|
||||||
|
*/
|
||||||
|
export interface StocktakingScanDetail {
|
||||||
|
/** 申请单id */
|
||||||
|
applyId?: number;
|
||||||
|
|
||||||
|
/** 条码 */
|
||||||
|
barcode?: string;
|
||||||
|
|
||||||
|
/** createdTime */
|
||||||
|
createdTime?: string;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
id?: number;
|
||||||
|
|
||||||
|
/** 物料ID */
|
||||||
|
materialId?: number;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string;
|
updatedTime?: string;
|
||||||
|
@ -7,6 +7,7 @@ import saveApply from './saveApply';
|
|||||||
import detail from './detail';
|
import detail from './detail';
|
||||||
import searchAuditPage from './searchAuditPage';
|
import searchAuditPage from './searchAuditPage';
|
||||||
import auditApply from './auditApply';
|
import auditApply from './auditApply';
|
||||||
|
import saveScanData from './saveScanData';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
searchPage,
|
searchPage,
|
||||||
@ -14,4 +15,5 @@ export default {
|
|||||||
detail,
|
detail,
|
||||||
searchAuditPage,
|
searchAuditPage,
|
||||||
auditApply,
|
auditApply,
|
||||||
|
saveScanData,
|
||||||
};
|
};
|
||||||
|
25
src/api/material/mods/apply/saveScanData.ts
Normal file
25
src/api/material/mods/apply/saveScanData.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* @desc 提交盘点扫码数据
|
||||||
|
*/
|
||||||
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
||||||
|
import type { AxiosResponse } from 'axios';
|
||||||
|
export default async function (
|
||||||
|
/** 申请单ID */
|
||||||
|
applyId: number,
|
||||||
|
|
||||||
|
/** 请求体 */
|
||||||
|
requestBody: Array<material.StocktakingScanDetail>,
|
||||||
|
|
||||||
|
success: (data: void) => void = defaultSuccess,
|
||||||
|
fail: (error: { code: string; error?: string }) => void = defaultError,
|
||||||
|
): Promise<void> {
|
||||||
|
return http({
|
||||||
|
method: 'post',
|
||||||
|
url: `/scan-data/${applyId}`,
|
||||||
|
data: requestBody,
|
||||||
|
})
|
||||||
|
.then((data: AxiosResponse<void, unknown>) => {
|
||||||
|
success(data.data);
|
||||||
|
})
|
||||||
|
.catch((error: { code: string; error?: string }) => fail(error));
|
||||||
|
}
|
@ -16,7 +16,9 @@ export interface Params {
|
|||||||
/** 创建日期 */
|
/** 创建日期 */
|
||||||
createDate?: string;
|
createDate?: string;
|
||||||
/** 审核状态 */
|
/** 审核状态 */
|
||||||
reviewResult?: 'PASS' | 'UN_PASS' | 'WAIT_AUDIT' | 'REJECT' | 'WAIT_CHECK';
|
reviewResults?: Array<
|
||||||
|
'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
||||||
|
>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function (
|
export default async function (
|
||||||
|
27
src/views/stock/component/Stocktaking.vue
Normal file
27
src/views/stock/component/Stocktaking.vue
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<a-row bordered>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-button type="primary" width="90%">开始扫码</a-button>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-input bordered size="large" ref="snInput" placeholder="输入条形码" style="width: 90%" />
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
|
||||||
|
|
||||||
|
<vxe-table border stripe show-overflow ref="applyDetailTableRef" max-height="500" :column-config="{ resizable: true }"
|
||||||
|
:keyboard-config="{ isEsc: true }" size="medium">
|
||||||
|
<vxe-column type="seq" title="序号" width="60"></vxe-column>
|
||||||
|
<vxe-column field="id" title="物料id" :visible="false"></vxe-column>
|
||||||
|
<vxe-column field="name" title="物料名称" />
|
||||||
|
<vxe-column field="code" title="编码" />
|
||||||
|
<vxe-column field="spec" title="规格" />
|
||||||
|
<vxe-column field="type" title="类型" />
|
||||||
|
<vxe-column field="times" title="库存数量" />
|
||||||
|
<vxe-column field="oprator" title="盘点数量" />
|
||||||
|
</vxe-table>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
</script>
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<vxe-column type="seq" title="序号" width="60"></vxe-column>
|
<vxe-column type="seq" title="序号" width="60"></vxe-column>
|
||||||
<vxe-column field="id" title="物料id" :visible="false"></vxe-column>
|
<vxe-column field="id" title="物料id" :visible="false"></vxe-column>
|
||||||
<vxe-column field="barcode" title="物料条码" :edit-render="{ name: 'input', autoFocus: true, immediate: true }" />
|
<vxe-column field="barcode" title="物料条码" />
|
||||||
<vxe-column field="name" title="物料名称" />
|
<vxe-column field="name" title="物料名称" />
|
||||||
<vxe-column field="code" title="编码" />
|
<vxe-column field="code" title="编码" />
|
||||||
<vxe-column field="spec" title="规格" />
|
<vxe-column field="spec" title="规格" />
|
||||||
@ -40,14 +40,19 @@ import { api } from '@/api'
|
|||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
// 父组件数据交互
|
// 父组件数据交互
|
||||||
defineProps(
|
const props = defineProps(
|
||||||
{
|
{
|
||||||
totalValue: {
|
totalValue: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
applyId: {
|
||||||
|
type: Number,
|
||||||
|
required: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
//获取扫码的集合
|
//获取扫码的集合
|
||||||
const getTableData = () => {
|
const getTableData = () => {
|
||||||
const $table = applyDetailTableRef.value
|
const $table = applyDetailTableRef.value
|
||||||
@ -61,7 +66,21 @@ const getTableData = () => {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defineExpose({ getTableData })
|
|
||||||
|
// 获取盘点审核的数据
|
||||||
|
const getApplyData = () => {
|
||||||
|
const $table = applyDetailTableRef.value
|
||||||
|
if ($table) {
|
||||||
|
return $table.getTableData().fullData.map(item => ({
|
||||||
|
applyId: props.applyId,
|
||||||
|
materialId: item.id,
|
||||||
|
barcode: item.barcode
|
||||||
|
}))
|
||||||
|
|
||||||
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({ getTableData,getApplyData })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,8 +53,7 @@ const loadData = async (page = 1, size = 10) => {
|
|||||||
{
|
{
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
taker: userStore.userName,
|
taker: userStore.userName
|
||||||
reviewResult: 'WAIT_CHECK',
|
|
||||||
}, (data) => {
|
}, (data) => {
|
||||||
auditPage.value = data
|
auditPage.value = data
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
@ -12,8 +12,9 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-font type="icon-plus" />
|
<icon-font type="icon-plus" />
|
||||||
</template>
|
</template>
|
||||||
盘点申请
|
申请扫码
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</template>
|
</template>
|
||||||
@ -27,18 +28,31 @@
|
|||||||
{{ record.auditType === 'ALL' ? '全部盘点' : '部分盘点' }}
|
{{ record.auditType === 'ALL' ? '全部盘点' : '部分盘点' }}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'reviewResult'">
|
<template v-if="column.dataIndex === 'reviewResult'">
|
||||||
<template v-if="record.reviewResult === 'WAIT_CHECK'"> 待盘点</template>
|
<template v-if="record.reviewResult === 'WAIT_SCAN'"> 待扫码</template>
|
||||||
<template v-if="record.reviewResult === 'PASS'"> 通过</template>
|
<template v-if="record.reviewResult === 'WAIT_SUBMIT'"> 待提交</template>
|
||||||
<template v-if="record.reviewResult === 'REJECT'"> 拒绝 </template>
|
<template v-if="record.reviewResult === 'WAIT_REVIEW'"> 待审核 </template>
|
||||||
<template v-if="record.reviewResult === 'UN_PASS'"> 未通过</template>
|
<template v-if="record.reviewResult === 'PASS'"> 审核通过</template>
|
||||||
<template v-if="record.reviewResult === 'WAIT_AUDIT'"> 待审核</template>
|
<template v-if="record.reviewResult === 'REJECT'"> 退回</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
<template v-if="column.dataIndex === 'operation'">
|
||||||
<a-button type="link">
|
<a-button type="link" @click="showModal(record.id)" v-if="record.reviewResult === 'WAIT_SCAN'
|
||||||
<template #icon>
|
|| record.reviewResult === 'REJECT'">
|
||||||
|
<template #icon >
|
||||||
<icon-font type="icon-edit" />
|
<icon-font type="icon-edit" />
|
||||||
</template>
|
</template>
|
||||||
盘点作业
|
开始扫码
|
||||||
|
</a-button>
|
||||||
|
<a-button type="link" style="margin-left: 10px" v-if="record.reviewResult === 'WAIT_SUBMIT'">
|
||||||
|
<template #icon>
|
||||||
|
<icon-font type="icon-plus" />
|
||||||
|
</template>
|
||||||
|
生成结果
|
||||||
|
</a-button>
|
||||||
|
<a-button type="link" style="margin-left: 10px" v-if="record.reviewResult === 'WAIT_REVIEW'">
|
||||||
|
<template #icon>
|
||||||
|
<icon-font type="icon-plus" />
|
||||||
|
</template>
|
||||||
|
审核
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@ -47,8 +61,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</page-container>
|
</page-container>
|
||||||
|
|
||||||
|
<!-- 新增申请抽屉 -->
|
||||||
<form-drawer ref="formDrawer" v-model="applyForm" :form-items="items" :config="formConfig"
|
<form-drawer ref="formDrawer" v-model="applyForm" :form-items="items" :config="formConfig"
|
||||||
:disabled-fields=disabledFields @ok="doSave" title="盘点申请" />
|
:disabled-fields=disabledFields @ok="doSave" title="扫码盘点" />
|
||||||
|
<!-- 盘点作业弹窗 -->
|
||||||
|
<a-modal v-model:open="open" title="盘点作业" width="100%" wrap-class-name="full-modal" @ok="handleOk" :confirm-loading="confirmLoading">
|
||||||
|
<scan-form ref="scanFormRef" :apply-id="applyIdRef" :total-value="88"></scan-form>
|
||||||
|
</a-modal>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -60,26 +80,32 @@ import { config, formItems } from './form'
|
|||||||
import { notification } from 'ant-design-vue'
|
import { notification } from 'ant-design-vue'
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
|
import scanForm from '../component/scanForm.vue'
|
||||||
|
|
||||||
|
|
||||||
const searchKey = ref('')
|
const searchKey = ref('')
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
const scanFormRef = ref(); // 盘点作业弹窗组件
|
||||||
|
const confirmLoading = ref(false) // 盘点作业弹窗提交按钮loading
|
||||||
|
// 新增申请表单对象
|
||||||
const applyForm = ref<Partial<material.AuditApplyInfo>>({
|
const applyForm = ref<Partial<material.AuditApplyInfo>>({
|
||||||
auditType: 'ALL',
|
auditType: 'ALL',
|
||||||
applicant: userStore.userName,
|
applicant: userStore.userName,
|
||||||
type: 'AUDIT',
|
type: 'AUDIT',
|
||||||
applyDate: dayjs()+'',
|
applyDate: dayjs() + '',
|
||||||
isConfirm : false,
|
isConfirm: false,
|
||||||
reviewResult: 'WAIT_CHECK'
|
reviewResult: 'WAIT_SCAN'
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//列表数据
|
||||||
const auditPage = ref<IPage<material.ApplyForm>>()
|
const auditPage = ref<IPage<material.ApplyForm>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
|
//新增申请的下拉框选择对象
|
||||||
const materialList = ref<Array<{ value: string | undefined, label: string | undefined }>>([])
|
const materialList = ref<Array<{ value: string | undefined, label: string | undefined }>>([])
|
||||||
const personList = ref<Array<{ value: string | undefined, label: string | undefined }>>([])
|
const personList = ref<Array<{ value: string | undefined, label: string | undefined }>>([])
|
||||||
const required = ref(false)
|
const required = ref(false)
|
||||||
//获取所有物料
|
|
||||||
api.materialApi.material.all((data) => {
|
api.materialApi.material.all((data) => {
|
||||||
materialList.value = data.map(item => {
|
materialList.value = data.map(item => {
|
||||||
return {
|
return {
|
||||||
@ -97,8 +123,7 @@ api.aclApi.user.all((data) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//是否必填
|
||||||
|
|
||||||
const disabledFields = computed(() => {
|
const disabledFields = computed(() => {
|
||||||
if (applyForm.value?.auditType !== 'ALL') {
|
if (applyForm.value?.auditType !== 'ALL') {
|
||||||
required.value = true
|
required.value = true
|
||||||
@ -106,7 +131,7 @@ const disabledFields = computed(() => {
|
|||||||
return applyForm.value?.auditType === 'ALL' ? ['materials'] : []
|
return applyForm.value?.auditType === 'ALL' ? ['materials'] : []
|
||||||
})
|
})
|
||||||
|
|
||||||
//表单
|
//抽屉组件
|
||||||
const formDrawer = ref<typeof FormDrawer>()
|
const formDrawer = ref<typeof FormDrawer>()
|
||||||
const formConfig = computed(() => {
|
const formConfig = computed(() => {
|
||||||
return config
|
return config
|
||||||
@ -123,8 +148,7 @@ const loadData = async (page = 1, size = 10) => {
|
|||||||
{
|
{
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
taker: userStore.userName,
|
reviewResults: [ 'WAIT_SUBMIT', 'WAIT_SCAN', 'WAIT_REVIEW', 'PASS'],
|
||||||
reviewResult: 'WAIT_CHECK',
|
|
||||||
}, (data) => {
|
}, (data) => {
|
||||||
auditPage.value = data
|
auditPage.value = data
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@ -135,6 +159,11 @@ loadData()
|
|||||||
|
|
||||||
//表格列
|
//表格列
|
||||||
const columns = [
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '申请id',
|
||||||
|
dataIndex: 'id',
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '盘点类型',
|
title: '盘点类型',
|
||||||
dataIndex: 'auditType',
|
dataIndex: 'auditType',
|
||||||
@ -179,6 +208,7 @@ const pagination = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 新增申请保存
|
||||||
const doSave = (_data: material.AuditApplyInfo) => {
|
const doSave = (_data: material.AuditApplyInfo) => {
|
||||||
api.materialApi.apply.auditApply(_data, () => {
|
api.materialApi.apply.auditApply(_data, () => {
|
||||||
formDrawer.value?.close()
|
formDrawer.value?.close()
|
||||||
@ -193,4 +223,54 @@ const doSave = (_data: material.AuditApplyInfo) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 盘点作业弹窗相关
|
||||||
|
const open = ref<boolean>(false);
|
||||||
|
const applyIdRef = ref();
|
||||||
|
const showModal = (applyId: number) => {
|
||||||
|
open.value = true;
|
||||||
|
applyIdRef.value = applyId;
|
||||||
|
|
||||||
|
};
|
||||||
|
// 盘点作业提交数据
|
||||||
|
|
||||||
|
|
||||||
|
//关闭弹窗 提交数据
|
||||||
|
const handleOk = (e: MouseEvent) => {
|
||||||
|
confirmLoading.value = true;
|
||||||
|
if(scanFormRef.value){
|
||||||
|
const data = scanFormRef.value.getApplyData();
|
||||||
|
api.materialApi.apply.saveScanData(applyIdRef.value, data, () => {
|
||||||
|
open.value = false;
|
||||||
|
confirmLoading.value = false;
|
||||||
|
loadData(1)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.full-modal {
|
||||||
|
.ant-modal {
|
||||||
|
max-width: 100%;
|
||||||
|
top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-modal-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: calc(100vh);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-modal-body {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user