From c9e639ff2cc7cada70ef837765bf9a95a12e186e Mon Sep 17 00:00:00 2001 From: ruanqi Date: Fri, 7 Mar 2025 16:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com_poReceiving_add_or_update.vue | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/views/modules/material/com_poReceiving_add_or_update.vue b/src/views/modules/material/com_poReceiving_add_or_update.vue index a03b129..61b1d44 100644 --- a/src/views/modules/material/com_poReceiving_add_or_update.vue +++ b/src/views/modules/material/com_poReceiving_add_or_update.vue @@ -616,6 +616,7 @@ }) }, createNewRoll(){ + debugger if(this.dataForm.partNo===''){ this.$alert('请输入物料!', '错误', { confirmButtonText: '确定' @@ -673,11 +674,12 @@ batchNo:this.dataForm.batchNo, wdrNo:this.dataForm.wdrNo, locationID:this.dataForm.locationId, - manufactureDate:this.dataForm.manufactureDate, - expiredDate:this.dataForm.expiredDate, + manufactureDate: this.dayjs(this.dataForm.manufactureDate).format('YYYY-MM-DD'), + expiredDate:this.dayjs(this.dataForm.expiredDate).format('YYYY-MM-DD'), rollNumber:this.rollData.rollNumber, } + console.log(inData) createNewCachRoll(inData).then(({data})=>{ //区分请求成功和失败的状况 if (data && data.code == 0) { @@ -791,24 +793,28 @@ month = '0'+batchNo[1]; } let day = batchNo.substring(2,4); // 解析日期 - let manufactureDate = this.dayjs(year+month+day, 'YYYYDDDHH').toDate(); - console.log(year) - console.log(month) - console.log(day) - console.log(year+month+day) + let manufactureDate = this.dayjs(year+month+day, 'YYYYMMDD').toDate(); + // console.log(year) + // console.log(month) + // console.log(day) + // console.log(year+month+day) + console.log("manufactureDate:"+manufactureDate) if (isNaN(manufactureDate.getTime())) { this.$message.error("生产日期的日期格式不正确") return false } - let expiredDate = this.dayjs(arr[6], 'YYYYDDDHH').toDate(); + let expiredDate = this.dayjs(arr[6], 'YYYYMMDD').toDate(); if (isNaN(expiredDate.getTime())) { this.$message.error("失效日期的日期格式不正确") return false } + console.log("expiredDate:"+expiredDate) this.dataForm.manufactureDate=manufactureDate this.dataForm.expiredDate=expiredDate this.dataForm.batchNo=batchNo; this.scanSerial='' + console.log("manufactureDate:"+this.dataForm.manufactureDate) + console.log("expiredDate:"+this.dataForm.expiredDate) }, }, }