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