|
|
@ -42,6 +42,8 @@ |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
:isOpenSearchTable="true" |
|
|
|
fieldTableColumn="itemCode" |
|
|
|
@success="getList" |
|
|
|
:rules="IssueRequestMainRules" |
|
|
|
:formAllSchemas="IssueRequestMain.allSchemas" |
|
|
@ -57,6 +59,7 @@ |
|
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
@onEnter="onEnter" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
@ -104,14 +107,39 @@ const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
const onEnter = async (field,value) => { |
|
|
|
if (field == 'productionLineCode') { |
|
|
|
//生产线 |
|
|
|
let res = await WorkstationApi.getWorkstationPage({ |
|
|
|
productionLineCode:value, |
|
|
|
pageSize: 20, |
|
|
|
pageNo: 1 |
|
|
|
}) |
|
|
|
if(res&&res.list&&res.list.length>0){ |
|
|
|
const setV = {} |
|
|
|
setV['workStationCode'] = res.list[0].code |
|
|
|
formRef.value.formRef.setValues(setV) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
nextTick(async() => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
if (formField == 'itemCode') { |
|
|
|
row['itemCode'] = val[0]['code'] |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
val.forEach(item=>{ |
|
|
|
let tableForm = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
|
if (tableData.value.length > 0) { |
|
|
|
tableForm.productionLineCode = tableData.value[0].productionLineCode |
|
|
|
tableForm.workStationCode = tableData.value[0].workStationCode |
|
|
|
} |
|
|
|
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])) return |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableForm,...item})) |
|
|
|
newRow['itemCode'] = item['code'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
|