|
@ -42,6 +42,8 @@ |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="formRef" |
|
|
ref="formRef" |
|
|
|
|
|
:isOpenSearchTable="true" |
|
|
|
|
|
fieldTableColumn="itemCode" |
|
|
@success="getList" |
|
|
@success="getList" |
|
|
:rules="IssueRequestMainRules" |
|
|
:rules="IssueRequestMainRules" |
|
|
:formAllSchemas="IssueRequestMain.allSchemas" |
|
|
:formAllSchemas="IssueRequestMain.allSchemas" |
|
@ -57,6 +59,7 @@ |
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
|
|
|
@onEnter="onEnter" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
@ -104,14 +107,39 @@ const updataTableColumns = (val) => { |
|
|
tableColumns.value = 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 ) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
nextTick(async() => { |
|
|
nextTick(async() => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
|
if (formField == 'itemCode') { |
|
|
if (formField == 'itemCode') { |
|
|
row['itemCode'] = val[0]['code'] |
|
|
val.forEach(item=>{ |
|
|
row['uom'] = val[0]['uom'] |
|
|
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 { |
|
|
} else { |
|
|
row[formField] = val[0][searchField] |
|
|
row[formField] = val[0][searchField] |
|
|
} |
|
|
} |
|
|