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