Browse Source

隔离退料申请--新增物料类型是否一致判断

hella_online_20240828
wangyufei 3 months ago
parent
commit
ded2c47556
  1. 78
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

78
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

@ -57,7 +57,7 @@
:isBusiness="true" :isBusiness="true"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccessAdd"
@submitForm="submitForm" @submitForm="submitForm"
/> />
@ -172,7 +172,83 @@ const isItemType = async (itemCode, labelTypeParams) => {
if (!isType) labelType.value = labelTypeOld if (!isType) labelType.value = labelTypeOld
return isType return isType
} }
//
const searchTableSuccessAdd = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => {
if (type == 'tableForm') {
//
if(formField == 'itemCode') {
if(tableData.value.find(item1=>item1['itemCode'] == val[0]['itemCode'])){
message.warning(`物料${val[0]['itemCode']}已经存在`)
return
}
let itemRes = await ItembasicApi.getItembasicPage({
pageSize: 10,
pageNo: 1,
code: val[0]['itemCode'],
sort: '',
by: 'ASC',
})
let rowType = ''
if (itemRes.list.length > 0) {
//
if (itemRes.list[0].enableMake == "FALSE") {
rowType = 'cg'
} else {
rowType = 'zz'
}
}
console.log('rowType',rowType)
console.log('tableData',tableData.value)
row['labelType'] = ''
if(tableData.value.find(item=>item['labelType']&&item['labelType']!=rowType)){
message.warning('当前物料可制造与其他数据不一致,请重新选择!')
}else {
row['labelType'] = rowType
row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = Number(val[0]['qty'])
row['packUnit'] = val[0]['packUnit']
row['packQty'] = val[0]['packQty']
// HL-4885 @ @
// tableform
// ProductionreturnRequestDetail.allSchemas.tableFormColumns.forEach(item => {
// if(item.field == 'qty' && Number(val[0]['qty'])>item.tableForm.min) {
// item.tableForm.max = Number(val[0]['qty'])
// }
// // if(item.field == 'batch') {
// // item.tableForm.disabled = false
// // }
// })
}
} else if(formField == 'workStationCode') {
val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['workStationCode'] = item['code']
newRow['fromLocationCode'] = item['rawLocationCode']
newRow['checkId'] = item['id']
tableData.value.push(newRow)
})
}
// else if(formField == 'packUnit') {
// row['packUnit'] = val[0]['packUnit']
// row['packQty'] = val[0]['packQty']
// }
else {
row[formField] = val[0][searchField]
}
} else {
const setV = {}
setV[formField] = val[0][searchField]
tableData.value = [] //
formRef.setValues(setV)
}
})
}
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(async () => { nextTick(async () => {

Loading…
Cancel
Save