sparkles: 提交人工盘点数据
All checks were successful
Release / lint (push) Successful in 37s
Release / Release (push) Successful in 1m56s

This commit is contained in:
my_ong 2025-03-09 20:17:35 +08:00
parent 15cbb02e50
commit 0014b71888
7 changed files with 526 additions and 5 deletions

View File

@ -3771,6 +3771,89 @@
}
]
},
{
"description": "提交人工盘点数据",
"name": "submitManualStock",
"method": "post",
"path": "/manual/audit-apply",
"response": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"required": true,
"in": "body",
"name": "requestBody",
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "ManualStockDetail",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "获取人工盘点数据",
"name": "getManualStock",
"method": "get",
"path": "/manual/data/{applyId}",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "ManualStockDTO",
"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": []
}
}
]
},
{
"description": "提交盘点扫码数据",
"name": "saveScanData",
@ -5503,6 +5586,281 @@
}
]
},
{
"name": "ManualStockDTO",
"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": "code",
"description": "编码",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "manualStock",
"description": "手动核实库存数量",
"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": "msg",
"description": "异常原因",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "name",
"description": "名称",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "price",
"description": "价格",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "spec",
"description": "规格",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "stock",
"description": "库存数量",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "type",
"description": "类型",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "typeName",
"required": false
}
]
},
{
"description": "人工手动核实物料库存明细",
"name": "ManualStockDetail",
"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": "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": "manualStock",
"description": "手动核实库存数量",
"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": "msg",
"description": "异常原因",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "stock",
"description": "库存数量",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "updatedTime",
"required": false
}
]
},
{
"description": "物料信息",
"name": "Material",

View File

@ -185,6 +185,73 @@ declare namespace material {
exceptionalData?: Array<material.StocktakingScanExceptionalData>
}
/**
* ManualStockDTO
*/
export interface ManualStockDTO {
/** 申请id */
applyId?: number
/** 编码 */
code?: string
/** 手动核实库存数量 */
manualStock?: number
/** 物料id */
materialId?: number
/** 异常原因 */
msg?: string
/** 名称 */
name?: string
/** 价格 */
price?: number
/** 规格 */
spec?: string
/** 库存数量 */
stock?: number
/** 类型 */
type?: string
/** typeName */
typeName?: string
}
/**
*
*/
export interface ManualStockDetail {
/** 申请id */
applyId?: number
/** createdTime */
createdTime?: string
/** id */
id?: number
/** 手动核实库存数量 */
manualStock?: number
/** 物料id */
materialId?: number
/** 异常原因 */
msg?: string
/** 库存数量 */
stock?: number
/** updatedTime */
updatedTime?: 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.ManualStockDTO>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/manual/data/${applyId}`,
})
.then((data: AxiosResponse<Array<material.ManualStockDTO>, unknown>) => {
success(data.data)
})
.catch((error: { code: string; error?: string }) => fail(error))
}

View File

@ -9,6 +9,8 @@ import searchAuditPage from './searchAuditPage'
import auditApply from './auditApply'
import getComparisonRes from './getComparisonRes'
import updateReviewResult from './updateReviewResult'
import submitManualStock from './submitManualStock'
import getManualStock from './getManualStock'
import saveScanData from './saveScanData'
import submitReview from './submitReview'
import getWaitScanData from './getWaitScanData'
@ -21,6 +23,8 @@ export default {
auditApply,
getComparisonRes,
updateReviewResult,
submitManualStock,
getManualStock,
saveScanData,
submitReview,
getWaitScanData,

View File

@ -0,0 +1,22 @@
/**
* @desc
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
export default async function (
/** 请求体 */
requestBody: Array<material.ManualStockDetail>,
success: (data: void) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'post',
url: `/manual/audit-apply`,
data: requestBody,
})
.then((data: AxiosResponse<void, unknown>) => {
success(data.data)
})
.catch((error: { code: string; error?: string }) => fail(error))
}

View File

@ -51,7 +51,7 @@
<vxe-column
field="manualStock"
title="手动何时数量"
title="手动核实数量"
:edit-render="{ name: 'input', autoSelect: true }"
keyboard-config="{edit: true, del: true}"
cell-type="number"
@ -60,6 +60,17 @@
<vxe-number-input v-model="row.manualStock" type="integer"></vxe-number-input>
</template>
</vxe-column>
<vxe-column
field="msg"
title="异常原因"
:edit-render="{ name: 'input', autoSelect: true }"
keyboard-config="{edit: true, del: true}"
cell-type="string"
>
<template #edit="{ row }">
<vxe-input v-model="row.msg" placeholder="请输入异常原因" type="text"></vxe-input>
</template>
</vxe-column>
<vxe-column field="oprator" title="操作">
<template #default="{ row }">
@ -78,6 +89,33 @@
import { LabeledValue, DefaultOptionType } from 'ant-design-vue/es/select'
import { SelectHandler } from 'ant-design-vue/es/vc-select/Select'
//
const props = defineProps({
applyId: {
type: Number,
required: false,
default: 0,
},
})
const getTableData = (): Array<material.ManualStockDetail> => {
const $table = tableRef.value
if (!$table) {
return []
}
return $table?.getTableData().fullData.map((item) => {
// id,
return {
materialId: item.id,
stock: item.stock,
manualStock: item.manualStock,
msg: item.msg,
applyId: props.applyId,
}
})
}
defineExpose({ getTableData })
const typeVal = ref('')
const slectedList = ref<number[]>([])
@ -128,11 +166,13 @@
spec: string
type: string
typeName: string
quantity: number
stock: number
manualStock: number
disabled: boolean
checked: boolean
price: number
assignRule: boolean
msg: string
}
// vxe
const tableRef = ref<VxeTableInstance<RowVO>>()
@ -193,10 +233,12 @@
typeName: m.typeName ? m.typeName : '',
type: m.type ? m.type : '',
price: m.price ? m.price : 0,
quantity: 1,
stock: m.stock ? m.stock : 0,
manualStock: 0,
assignRule: m.assignRule ? m.assignRule : false,
disabled: false,
checked: false,
msg: '',
}
const $table = tableRef.value
if ($table) {

View File

@ -132,6 +132,7 @@
const scanFormRef = ref() //
const handleResultRef = ref() //
const confirmLoading = ref(false) // loading
const manualFormRef = ref() //
//
const applyForm = ref<Partial<material.AuditApplyInfo>>({
auditType: 'SCAN',
@ -313,12 +314,18 @@
//
const openManual = ref<boolean>(false)
const showManualModal = (applyId: number) => {
console.log('点击传参' + applyId)
applyIdRef.value = applyId
openManual.value = true
}
const manualHandle = () => {
openManual.value = false
//
if (manualFormRef.value) {
const res: Array<material.ManualStockDetail> = manualFormRef.value.getTableData()
api.materialApi.apply.submitManualStock(res, () => {
openManual.value = false
loadData(1)
})
}
}
//