Browse Source

供应商发货申请生产日期限制

hella_online_20240828
wangyufei 3 months ago
parent
commit
3acd851ea4
  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

@ -1283,6 +1283,7 @@ export default {
'确认撤销报工吗?': 'Are you sure to cancel the job application?', '确认撤销报工吗?': 'Are you sure to cancel the job application?',
'收货数量不可以大于订单数量!': 'The received quantity cannot exceed the order quantity', '收货数量不可以大于订单数量!': 'The received quantity cannot exceed the order quantity',
:'Revocation of work report successful', :'Revocation of work report successful',
:'The date of production cannot be less than'
}, },

1
src/locales/zh-CN.ts

@ -1279,6 +1279,7 @@ export default {
'确认撤销报工吗?': "确认撤销报工吗?", '确认撤销报工吗?': "确认撤销报工吗?",
'收货数量不可以大于订单数量!':'收货数量不可以大于订单数量', '收货数量不可以大于订单数量!':'收货数量不可以大于订单数量',
:'撤销报工成功', :'撤销报工成功',
:'生产日期不能小于'
}, },
} }

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

@ -208,7 +208,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
newRow['planQty'] = item['planQty'] newRow['planQty'] = item['planQty']
newRow['shippedQty'] = item['shippedQty'] newRow['shippedQty'] = item['shippedQty']
newRow['qty'] = item['planQty'] - item['shippedQty'] newRow['qty'] = item['planQty'] - item['shippedQty']
newRow['produceDate'] = dayjs().valueOf() // newRow['minProduceDate'] = item['minProduceDate'] //
newRow['produceDate'] = dayjs().valueOf() //
let produceDateStr = formatDate(newRow['produceDate'],'YYYYMMDD'); let produceDateStr = formatDate(newRow['produceDate'],'YYYYMMDD');
newRow['batch'] = produceDateStr newRow['batch'] = produceDateStr
newRow['supplierBatch'] = produceDateStr newRow['supplierBatch'] = produceDateStr
@ -289,6 +290,7 @@ const getSearchTableData = async (number,formField,searchField,isAll)=>{
newRow['planQty'] = row['planQty'] newRow['planQty'] = row['planQty']
newRow['shippedQty'] = row['shippedQty'] newRow['shippedQty'] = row['shippedQty']
newRow['qty'] = row['planQty'] - row['shippedQty'] newRow['qty'] = row['planQty'] - row['shippedQty']
newRow['minProduceDate'] = row['minProduceDate'] //
newRow['produceDate'] = dayjs().valueOf() // newRow['produceDate'] = dayjs().valueOf() //
let produceDateStr = formatDate(newRow['produceDate'],'YYYYMMDD'); let produceDateStr = formatDate(newRow['produceDate'],'YYYYMMDD');
newRow['batch'] = produceDateStr newRow['batch'] = produceDateStr
@ -319,6 +321,16 @@ const submitForm = async (formType, submitData) => {
if(data.masterId){ if(data.masterId){
data.id = data.masterId data.id = data.masterId
} }
let flag = true
tableData.value.forEach(item=>{
if(item['minProduceDate']&&item['produceDate']<item['minProduceDate']){
flag = false
message.error(`${item['itemCode']}${t('ts.生产日期不能小于')}${formatDate(item['minProduceDate'],'YYYYMMDD')}`)
}
})
if(!flag){
return
}
data.subList = tableData.value // data.subList = tableData.value //
let isHave = data.subList.some((item) => { let isHave = data.subList.some((item) => {
console.log("CCCCC",item.expireDate) console.log("CCCCC",item.expireDate)
@ -415,6 +427,10 @@ const inputNumberChange = (field, val,row, index) => {
const formFormDateChange = (field, val,row, index) => { const formFormDateChange = (field, val,row, index) => {
console.log('formFormDateChange',field, val,row, index) console.log('formFormDateChange',field, val,row, index)
if(field == 'produceDate'){ if(field == 'produceDate'){
if(row['minProduceDate']&&val<row['minProduceDate']){
message.error(`${row['itemCode']}${t('ts.生产日期不能小于')}${formatDate(row['minProduceDate'],'YYYYMMDD')}`)
val = row['minProduceDate']
}
let produceDateStr = formatDate(val,'YYYYMMDD'); let produceDateStr = formatDate(val,'YYYYMMDD');
row.batch = produceDateStr row.batch = produceDateStr
row.supplierBatch = produceDateStr row.supplierBatch = produceDateStr

Loading…
Cancel
Save