From 5755f2d92c12956f62144451d87d01bc7e16d3d0 Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Wed, 30 Oct 2024 10:25:47 +0800 Subject: [PATCH] =?UTF-8?q?YT-563=EF=BC=9A=E9=9A=94=E7=A6=BB=E8=BD=AC?= =?UTF-8?q?=E7=BA=BF=E8=BE=B9=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inventorymoveRequestMainHOLDWIP/index.vue | 39 ++++++++++++++++++- .../inventorymoveRequestMain.data.ts | 8 +++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainHOLDWIP/index.vue b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainHOLDWIP/index.vue index 4d9f82d06..0bf4677a0 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainHOLDWIP/index.vue +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainHOLDWIP/index.vue @@ -91,6 +91,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' import {importTemplateHoldOk} from "@/api/wms/inventorymoveRequestMain"; +import * as ruleApi from '@/api/wms/rule/index' const { loadStart, loadDone } = usePageLoading() // 隔离转线边申请HoldtoWipRequestMain // 只有隔离转线边申请在使用的 @@ -288,7 +289,8 @@ InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { const updataTableColumns = (val) => { tableColumns.value = val } - +const fromManagementPrecision = ref('') +const toManagementPrecision = ref('') // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { @@ -310,6 +312,34 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => newRow['toInventoryStatus'] = "OK" //HoldtoWipRequestMain 隔离转线边 tableData.value.push(newRow) }) + }else if(formField == 'toLocationCode'){//到库位代码 + debugger + //从批次 + await ruleApi.getManagementPrecision({ + itemCodes: [row['itemCode']], + locationCode:row['fromLocationCode'] + }).then((res) => { + fromManagementPrecision.value = res[0].ManagementPrecision + }) + + if (fromManagementPrecision.value == 'BY_QUANTITY') {//如果从批次+物料管理精度是按数量 + //到批次 + await ruleApi.getManagementPrecision({ + itemCodes: [row['itemCode']], + locationCode:row['locationCode'] + }).then((res) => { + toManagementPrecision.value = res[0].ManagementPrecision + }) + if (toManagementPrecision.value != 'BY_QUANTITY') {//到批次+物料管理精度非数量需要添加批次 + if(newRow['fromBatch']==''){ + newRow['fromBatch'] = getFormattedDate(); // 获取 YYYYMMDD 格式的日期 + } + newRow['fromBatchFormItemType'] = 'FormDate' + newRow['disabled_fromBatch'] = false + }else { + newRow['fromBatchFormItemType'] = '' + newRow['disabled_fromBatch'] = true + } } else { row[formField] = val[0][searchField] } @@ -708,4 +738,11 @@ onMounted(async () => { importTemplateData.templateUrl = await InventorymoveRequestMainApi.importTemplateExceptMove() }) +const getFormattedDate = () =>{ + const a = new Date(); + const year = a.getFullYear(); + const month = String(a.getMonth() + 1).padStart(2, '0'); + const day = String(a.getDate()).padStart(2, '0'); + return `${year}${month}${day}`; + } diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainHOLDWIP/inventorymoveRequestMain.data.ts b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainHOLDWIP/inventorymoveRequestMain.data.ts index f3fcbde3c..f46e14827 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainHOLDWIP/inventorymoveRequestMain.data.ts +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainHOLDWIP/inventorymoveRequestMain.data.ts @@ -557,11 +557,15 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive( width: 150 }, tableForm: { - disabled: true + disabled: true, + placeholder: '请选择从批次', + valueFormat: 'YYYYMMDD', + format: 'YYYYMMDD', }, form: { componentProps: { - disabled: true + disabled: true, + valueFormat: 'YYYYMMDD', } } },