From 1e5e95882179c510f337fa4f9d601205f0029fc9 Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Fri, 18 Oct 2024 14:39:41 +0800 Subject: [PATCH] =?UTF-8?q?YT-412:=E7=94=9F=E4=BA=A7=E9=80=80=E6=96=99?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=B2=A1=E6=9C=89=E6=89=B9=E6=AC=A1=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96YYYYMMDD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionreturnRequestMain/index.vue | 17 ++++++++++++----- .../productionreturnRequestMain.data.ts | 5 ----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue index 6cf6b59a0..55baaee6a 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue @@ -238,11 +238,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => newRow['inventoryStatus'] = item['inventoryStatus'] newRow['qty'] = item['qty'] // 如果有批次 赋值库存余额批次 无批次 赋值 000000 - if (item['batch'] !== '') { + if (item['batch'] != '') { newRow['batch'] = item['batch'] }else{ - const a = new Date(); - newRow['batch'] = a.toISOString().split('T')[0]; // 获取 YYYY-MM-DD 格式的日期 + newRow['batch'] = getFormattedDate(); // 获取 YYYYMMDD 格式的日期 } // else { @@ -263,8 +262,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => newRow['batchFormItemType'] = 'FormDate' newRow['disabled_batch'] = false } else { - newRow['fromBatchFormItemType'] = '' - newRow['disabled_fromBatch'] = true + newRow['batchFormItemType'] = '' + newRow['disabled_batch'] = true } if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])){ @@ -913,4 +912,12 @@ onMounted(async () => { getList() importTemplateData.templateUrl = await ProductionreturnRequestMainApi.importTemplate() }) + +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/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts index 1ea152690..45c155ce0 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts @@ -1483,11 +1483,6 @@ export const ProductionreturnRequestDetailLabel = useCrudSchemas(reactive