|
|
@ -43,6 +43,8 @@ |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
:isOpenSearchTable="true" |
|
|
|
fieldTableColumn="itemCode" |
|
|
|
@success="getList" |
|
|
|
:rules="DeliverRequestMainRules" |
|
|
|
:formAllSchemas="DeliverRequestMain.allSchemas" |
|
|
@ -119,9 +121,18 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
nextTick(() => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
if(formField == 'itemCode') { |
|
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
|
row['uom'] = val[0]['customerUom'] |
|
|
|
}else { |
|
|
|
const tableFormKeys = {} |
|
|
|
DeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
console.log('tableData.value',tableData.value) |
|
|
|
val.forEach(item=>{ |
|
|
|
if(tableData.value.find(item1=>item1['id'] == item['id'])) return |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
|
newRow['uom'] = item['customerUom'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
|
} else { |
|
|
@ -129,54 +140,54 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if(formField == 'deliverPlanNumber') { |
|
|
|
setV['deliverPlanNumber'] = val[0]['number'] |
|
|
|
if(setV['deliverPlanNumber'] != null){ |
|
|
|
isShowButton.value = false |
|
|
|
} |
|
|
|
// if(setV['deliverPlanNumber'] != null){ |
|
|
|
// isShowButton.value = false |
|
|
|
// } |
|
|
|
setV['customerCode'] = val[0]['customerCode'] |
|
|
|
// 获取子表数据 getBomDisassemble |
|
|
|
DeliverPlanDetailApi.selectDetailByMasterID(val[0]['id']) |
|
|
|
.then(res => { |
|
|
|
res.forEach(item => { |
|
|
|
item.qty = item.planQty |
|
|
|
}) |
|
|
|
if (res) tableData.value = res |
|
|
|
// 修改 tableform 属性 |
|
|
|
DeliverRequestDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
if(item.field == 'itemCode') { |
|
|
|
item.isInpuFocusShow = false |
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
item.tableForm.disabled = true |
|
|
|
} |
|
|
|
if(item.field == 'uom') { |
|
|
|
item.tableForm.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
// 修改 tableform 属性 |
|
|
|
if(formField == 'customerCode'){ |
|
|
|
console.log(1111,val); |
|
|
|
customerCode.value = val[0]['code'] |
|
|
|
console.log(11112,customerCode.value); |
|
|
|
} |
|
|
|
DeliverRequestMain.allSchemas.tableFormColumns.map(item => { |
|
|
|
if(item.field == 'customerDockCode') { |
|
|
|
item.tableForm.searchCondition = [ |
|
|
|
{ |
|
|
|
key: 'customerCode', |
|
|
|
value: customerCode.value , |
|
|
|
isMainValue: true |
|
|
|
}] |
|
|
|
item.form.componentProps.searchCondition = [ |
|
|
|
{ |
|
|
|
key: 'customerCode', |
|
|
|
value: customerCode.value , |
|
|
|
isMainValue: true |
|
|
|
}]} |
|
|
|
else { |
|
|
|
delete item.tableForm.searchCondition |
|
|
|
delete item.form.componentProps.searchCondition |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
// DeliverPlanDetailApi.selectDetailByMasterID(val[0]['id']) |
|
|
|
// .then(res => { |
|
|
|
// res.forEach(item => { |
|
|
|
// item.qty = item.planQty |
|
|
|
// }) |
|
|
|
// if (res) tableData.value = res |
|
|
|
// // 修改 tableform 属性 |
|
|
|
// DeliverRequestDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
// if(item.field == 'itemCode') { |
|
|
|
// item.isInpuFocusShow = false |
|
|
|
// item.tableForm.isInpuFocusShow = false |
|
|
|
// item.tableForm.disabled = true |
|
|
|
// } |
|
|
|
// if(item.field == 'uom') { |
|
|
|
// item.tableForm.disabled = true |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// // 修改 tableform 属性 |
|
|
|
// if(formField == 'customerCode'){ |
|
|
|
// console.log(1111,val); |
|
|
|
// customerCode.value = val[0]['code'] |
|
|
|
// console.log(11112,customerCode.value); |
|
|
|
// } |
|
|
|
// DeliverRequestMain.allSchemas.tableFormColumns.map(item => { |
|
|
|
// if(item.field == 'customerDockCode') { |
|
|
|
// item.tableForm.searchCondition = [ |
|
|
|
// { |
|
|
|
// key: 'customerCode', |
|
|
|
// value: customerCode.value , |
|
|
|
// isMainValue: true |
|
|
|
// }] |
|
|
|
// item.form.componentProps.searchCondition = [ |
|
|
|
// { |
|
|
|
// key: 'customerCode', |
|
|
|
// value: customerCode.value , |
|
|
|
// isMainValue: true |
|
|
|
// }]} |
|
|
|
// else { |
|
|
|
// delete item.tableForm.searchCondition |
|
|
|
// delete item.form.componentProps.searchCondition |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
if(formField == 'itemCode'){ |
|
|
|
console.log( val[0]); |
|
|
|
row['uom'] = val[0]['customerUom'] |
|
|
|