bug: 展示数量和需要扫码的物料
All checks were successful
Release / lint (push) Successful in 29s
Release / Release (push) Successful in 1m19s

This commit is contained in:
my_ong 2024-12-12 12:35:18 +08:00
parent 2899f7f857
commit 861b77aa93
7 changed files with 139 additions and 10 deletions

View File

@ -5,30 +5,27 @@
"origins": [
{
"name": "auth",
"originUrl": "http://127.0.0.1:7777/v3/api-docs/auth",
"originUrl": "http://127.0.0.1:8888/v3/api-docs/auth",
"originType": "SwaggerV3",
"usingOperationId": true
},
{
"name": "acl",
"originUrl": "http://127.0.0.1:7777/v3/api-docs/acl",
"originUrl": "http://127.0.0.1:8888/v3/api-docs/acl",
"originType": "SwaggerV3",
"usingOperationId": true
},
{
"name": "dictionary",
"originUrl": "http://127.0.0.1:7777/v3/api-docs/dictionary",
"originUrl": "http://127.0.0.1:8888/v3/api-docs/dictionary",
"originType": "SwaggerV3",
"usingOperationId": true
},
{
"name": "material",
"originUrl": "http://127.0.0.1:7777/v3/api-docs/material",
"originUrl": "http://127.0.0.1:8888/v3/api-docs/material",
"originType": "SwaggerV3",
"usingOperationId": true
}
]
}

View File

@ -3857,6 +3857,48 @@
}
}
]
},
{
"description": "获取盘点的待扫码信息",
"name": "getWaitScanData",
"method": "get",
"path": "/wait-scan-data/{applyId}",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "WaitScanInfo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"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": []
}
}
]
}
]
},
@ -5637,7 +5679,7 @@
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": ["'INBOUND'", "'OUTBOUND'", "'DISCARD'"],
"enum": ["'MARK_LOST'", "'MARK_KEEP'", "'MARK_RETURN'", "'MARK_DISCARD'", "'MARK_NEW'"],
"typeProperties": []
},
"name": "exceptionHandle",
@ -5726,6 +5768,40 @@
"required": false
}
]
},
{
"name": "WaitScanInfo",
"templateArgs": [],
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "count",
"description": "物料数量",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "materialName",
"description": "物料名称",
"required": false
}
]
}
]
}

View File

@ -311,7 +311,7 @@ declare namespace material {
createdTime?: string
/** 异常处理 */
exceptionHandle?: 'INBOUND' | 'OUTBOUND' | 'DISCARD'
exceptionHandle?: 'MARK_LOST' | 'MARK_KEEP' | 'MARK_RETURN' | 'MARK_DISCARD' | 'MARK_NEW'
/** 异常类型 */
exceptionReason?: 'SOCK_IN_BUT_SCAN_NOT_EXIST' | 'SOCK_OUT_BUT_SCAN_EXIST' | 'SOCK_NOT_EXIST_BUT_SCAN_EXIST'
@ -331,4 +331,15 @@ declare namespace material {
/** updatedTime */
updatedTime?: string
}
/**
* WaitScanInfo
*/
export interface WaitScanInfo {
/** 物料数量 */
count?: number
/** 物料名称 */
materialName?: string
}
}

View File

@ -0,0 +1,21 @@
/**
* @desc
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
export default async function (
/** 申请单ID */
applyId: number,
success: (data: Array<material.WaitScanInfo>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/wait-scan-data/${applyId}`,
})
.then((data: AxiosResponse<Array<material.WaitScanInfo>, unknown>) => {
success(data.data)
})
.catch((error: { code: string; error?: string }) => fail(error))
}

View File

@ -11,6 +11,7 @@ import getComparisonRes from './getComparisonRes'
import updateReviewResult from './updateReviewResult'
import saveScanData from './saveScanData'
import submitReview from './submitReview'
import getWaitScanData from './getWaitScanData'
export default {
searchPage,
@ -22,4 +23,5 @@ export default {
updateReviewResult,
saveScanData,
submitReview,
getWaitScanData,
}

View File

@ -10,6 +10,7 @@
style="margin-top: 20px; margin-bottom: 20px"
@press-enter="autoInsertOneRow"
/>
<slot></slot>
<a-row style="margin-bottom: 20px">
<a-col :span="12">
<a-statistic title="扫码合计" :value="totalValue" style="margin-right: 50px" />

View File

@ -90,8 +90,13 @@
wrap-class-name="full-modal"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="cancel"
>
<scan-form ref="scanFormRef" :apply-id="applyIdRef" :total-value="88"></scan-form>
<scan-form ref="scanFormRef" :apply-id="applyIdRef" :total-value="totalValue">
<p>
{{ msg }}
</p>
</scan-form>
</a-modal>
<!-- 盘点结果弹窗 -->
<a-modal
@ -131,6 +136,8 @@
confirm: false,
reviewResult: 'WAIT_SCAN',
})
const msg = ref()
const totalValue = ref(0) //
//
const auditPage = ref<IPage<material.ApplyForm>>()
@ -259,6 +266,15 @@
const showModal = (applyId: number) => {
open.value = true
applyIdRef.value = applyId
let m = '需要扫码的物料: '
//
api.materialApi.apply.getWaitScanData(applyId, (data) => {
const m = `需要扫码的物料: ${data.map((item) => item.materialName).join(', ') || '无'}`
data.forEach((item) => (totalValue.value += item.count || 0))
msg.value = m
})
window.console.log(m)
msg.value = m
}
//
@ -274,6 +290,11 @@
})
}
}
//
const cancel = () => {
totalValue.value = 0
msg.value = ''
}
//
const openResult = ref<boolean>(false)