|
|
@ -42,6 +42,8 @@ |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
:isOpenSearchTable="true" |
|
|
|
fieldTableColumn="itemCode" |
|
|
|
@success="getList" |
|
|
|
:rules="UnplannedreceiptRequestMainRules" |
|
|
|
:formAllSchemas="UnplannedreceiptRequestMain.allSchemas" |
|
|
@ -195,19 +197,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
if(formField == 'toLocationCode'){ |
|
|
|
row['toLocationCode'] = val[0]['code'] |
|
|
|
} else if(formField == 'itemCode'){ |
|
|
|
const isType = await isItemType(val[0]['code'], labelType.value) |
|
|
|
if(!isType){ |
|
|
|
message.warning('当前物料可制造与其他数据不一致,请重新选择!') |
|
|
|
} else { |
|
|
|
row['itemCode'] = val[0]['code'] |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
// 有效期 \ 过期日期 |
|
|
|
row['validityDays'] = val[0]['validityDays'] |
|
|
|
// StdcostpriceApi.queryStdcostpriceByItemCode({"itemCode":val[0]['code']}) |
|
|
|
// .then(res => { |
|
|
|
// row['singlePrice'] = res.price |
|
|
|
// }) |
|
|
|
if(val.length==0){ |
|
|
|
return |
|
|
|
} |
|
|
|
const enableBuy = val[0]['enableBuy'] |
|
|
|
let newVal = val.filter(item=>item.enableBuy==enableBuy) |
|
|
|
if(newVal.length<val.length){ |
|
|
|
message.warning('不能同时选择可制造和可采购的物料') |
|
|
|
} |
|
|
|
newVal.forEach(item=>{ |
|
|
|
let tfk = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
|
tfk.batch = formatTime(new Date(), 'yyyyMMdd') |
|
|
|
//生产日期 到货日期 默认当天 |
|
|
|
tfk['produceDate'] = dayjs().valueOf() |
|
|
|
tfk['arriveDate'] = dayjs().valueOf() |
|
|
|
tfk['itemCode'] = item['code'] |
|
|
|
tfk['uom'] = item['uom'] |
|
|
|
tfk['validityDays'] = item['validityDays'] |
|
|
|
tableData.value.push(tfk) |
|
|
|
}) |
|
|
|
} else if(formField === 'costcentreCode'){ |
|
|
|
row['costcentreCode'] = val[0]['costcentreCode'] |
|
|
|
} else if(formField === 'qadProjectCode'){ |
|
|
|