From b0cc292b988d8e91ba343d39ffd7a3b415de673f Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Wed, 16 Oct 2024 15:56:54 +0800 Subject: [PATCH] =?UTF-8?q?YT-412:=E7=94=9F=E4=BA=A7=E9=80=80=E6=96=99?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=98=8E=E7=BB=86=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=A0=B9=E6=8D=AE=E7=89=A9=E6=96=99=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E5=BA=93=E4=BD=8D=E6=9F=A5=E8=AF=A2=E6=8C=89=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E9=9C=80=E8=A6=81=E8=AE=A9=E5=85=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=89=B9=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionreturnRequestMain/index.vue | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue index 64ad37286..6cf6b59a0 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue @@ -113,6 +113,7 @@ import { getAccessToken } from '@/utils/auth' import { getJmreportBaseUrl } from '@/utils/systemParam' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' +import * as ruleApi from '@/api/wms/rule/index' const { loadStart, loadDone } = usePageLoading() // 生产退料申请 defineOptions({ name: 'ProductionreturnRequestMain' }) @@ -202,7 +203,7 @@ const clearSearchInput = (formField) => { tableData.value = [] } } - +let fromManagementPrecision = ref('') // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { console.log('searchTableSuccess',formField, searchField, val, formRef, type, row) @@ -214,6 +215,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // message.warning(`物料${val[0]['itemCode']}已经存在`) // return // } + val[0]['batche'] let enableBuy = val[0]['enableBuy'] if(tableData.value.length>0){ enableBuy = tableData.value[0]['enableBuy'] @@ -228,7 +230,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => val = val.filter(item=>item['enableBuy']==enableBuy) let messageItemCodes = [] - val.forEach(item=>{ + val.forEach(async item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow['itemCode'] = item['itemCode'] newRow['enableBuy'] = item['enableBuy'] @@ -238,11 +240,33 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // 如果有批次 赋值库存余额批次 无批次 赋值 000000 if (item['batch'] !== '') { newRow['batch'] = item['batch'] - } else { - newRow['batch'] = '000000' + }else{ + const a = new Date(); + newRow['batch'] = a.toISOString().split('T')[0]; // 获取 YYYY-MM-DD 格式的日期 } + + // else { + // newRow['batch'] = '000000' + // } newRow['packUnit'] = item['packUnit'] newRow['packQty'] = item['packQty'] + + //根据来源库位查询管理精度 + row[formField] = val[0][searchField] + await ruleApi.getManagementPrecision({ + itemCodes: [row['itemCode']], + locationCode:val[0]['locationCode'] + }).then((res) => { + fromManagementPrecision.value = res[0].ManagementPrecision + }) + if (fromManagementPrecision.value == 'BY_QUANTITY') { + newRow['batchFormItemType'] = 'FormDate' + newRow['disabled_batch'] = false + } else { + newRow['fromBatchFormItemType'] = '' + newRow['disabled_fromBatch'] = true + } + if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])){ messageItemCodes.push(item['itemCode']) }else{