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