|
|
@ -322,10 +322,15 @@ const submitForm = async (formType, submitData) => { |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
let flag = true |
|
|
|
let currentTime = dayjs().valueOf() |
|
|
|
tableData.value.forEach(item=>{ |
|
|
|
if(item['minProduceDate']&&item['produceDate']<item['minProduceDate']){ |
|
|
|
flag = false |
|
|
|
message.error(`${item['itemCode']}${t('ts.生产日期不能小于')}${formatDate(item['minProduceDate'],'YYYYMMDD')}`) |
|
|
|
message.error(`${item['itemCode']}${t('ts.生产日期不能小于')}${formatDate(item['minProduceDate'],'YYYY-MM-DD')}`) |
|
|
|
} |
|
|
|
if(item['produceDate']>currentTime){ |
|
|
|
flag = false |
|
|
|
message.error(`${item['itemCode']}${t('ts.生产日期不能大于当前系统日期')}`) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(!flag){ |
|
|
@ -428,8 +433,15 @@ const formFormDateChange = (field, val,row, index) => { |
|
|
|
console.log('formFormDateChange',field, val,row, index) |
|
|
|
if(field == 'produceDate'){ |
|
|
|
if(row['minProduceDate']&&val<row['minProduceDate']){ |
|
|
|
message.error(`${row['itemCode']}${t('ts.生产日期不能小于')}${formatDate(row['minProduceDate'],'YYYYMMDD')}`) |
|
|
|
val = row['minProduceDate'] |
|
|
|
message.error(`${row['itemCode']}${t('ts.生产日期不能小于')}${formatDate(row['minProduceDate'],'YYYY-MM-DD')}`) |
|
|
|
// row['produceDate'] = row['minProduceDate'] |
|
|
|
} |
|
|
|
|
|
|
|
let currentTime = dayjs().valueOf() |
|
|
|
if(val>currentTime){ |
|
|
|
val = currentTime |
|
|
|
message.error(`${row['itemCode']}${t('ts.生产日期不能大于当前系统日期')}`) |
|
|
|
// row['produceDate'] = currentTime |
|
|
|
} |
|
|
|
let produceDateStr = formatDate(val,'YYYYMMDD'); |
|
|
|
row.batch = produceDateStr |
|
|
|