Browse Source

HL-5724SCP正式环境,供应商发货时,校验填写的生产日期不能大于当前系统日期

hella_online_20240803
wangyufei 2 months ago
parent
commit
6787b94f48
  1. 1
      src/locales/en-US.ts
  2. 1
      src/locales/zh-CN.ts
  3. 18
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue

1
src/locales/en-US.ts

@ -1284,6 +1284,7 @@ export default {
'收货数量不可以大于订单数量!': 'The received quantity cannot exceed the order quantity',
:'Revocation of work report successful',
:'The date of production cannot be less than',
:'The production date cannot be greater than the current system date',
:'Return of invoice',
:'The invoice has been successfully forwarded'
},

1
src/locales/zh-CN.ts

@ -1280,6 +1280,7 @@ export default {
'收货数量不可以大于订单数量!':'收货数量不可以大于订单数量',
:'撤销报工成功',
:'生产日期不能小于',
:'生产日期不能大于当前系统日期',
:'发票回转',
:'发票回转成功'
},

18
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue

@ -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

Loading…
Cancel
Save