|
|
@ -167,55 +167,62 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
row['projectCode'] = val[0]['projectCode'] |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
|
setV['asnNumber'] = val[0]['asnNumber'] |
|
|
|
setV['ppNumber'] = val[0]['ppNumber'] |
|
|
|
|
|
|
|
// 获取子表数据 getBomDisassemble |
|
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ |
|
|
|
masterId: val[0]['id'] |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (res) tableData.value = res |
|
|
|
tableData.value.forEach((item) => { |
|
|
|
item.batch = item.toBatch |
|
|
|
item.packingNumber = item.toPackingNumber |
|
|
|
item.containerNumber = item.toContainerNumber |
|
|
|
item.containerNumber = item.toContainerNumber |
|
|
|
item.toLocationGroupCode = null |
|
|
|
item.toWarehouseCode = null |
|
|
|
item.toLocationTypes = null |
|
|
|
item.toLocationCode = null |
|
|
|
// item.fromLocationCode = item.fromLocationCode |
|
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
|
}) |
|
|
|
isShowButton.value = false |
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'supplierCode') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
|
item.tableForm.disabled = true |
|
|
|
if (item.field == 'remark') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'qty') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'reason') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
if(formField == 'purchaseReceiptRecordNumber'){ |
|
|
|
isShowButton.value = false |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
|
setV['asnNumber'] = val[0]['asnNumber'] |
|
|
|
setV['ppNumber'] = val[0]['ppNumber'] |
|
|
|
|
|
|
|
// 获取子表数据 getBomDisassemble |
|
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ |
|
|
|
masterId: val[0]['id'] |
|
|
|
}).then((res) => { |
|
|
|
if (res) tableData.value = res |
|
|
|
tableData.value.forEach((item) => { |
|
|
|
item.batch = item.toBatch |
|
|
|
item.packingNumber = item.toPackingNumber |
|
|
|
item.containerNumber = item.toContainerNumber |
|
|
|
item.containerNumber = item.toContainerNumber |
|
|
|
item.toLocationGroupCode = null |
|
|
|
item.toWarehouseCode = null |
|
|
|
item.toLocationTypes = null |
|
|
|
item.toLocationCode = null |
|
|
|
// item.fromLocationCode = item.fromLocationCode |
|
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
|
}) |
|
|
|
|
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'supplierCode') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
|
item.tableForm.disabled = true |
|
|
|
if (item.field == 'remark') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'qty') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'reason') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
if(formField == 'supplierCode'){ |
|
|
|
isShowButton.value = true |
|
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
|
setV['purchaseReceiptRecordNumber'] = '' |
|
|
|
tableData.value = [] |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
@ -513,6 +520,7 @@ const tableData = ref([]) |
|
|
|
// 添加明细 |
|
|
|
const handleAddTable = () => { |
|
|
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
|
let purchaseReceiptRecordNumber = formRef.value.formRef.formModel.purchaseReceiptRecordNumber |
|
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
|
item.tableForm.disabled = true |
|
|
|
if (item.field == 'remark') { |
|
|
@ -524,8 +532,20 @@ const handleAddTable = () => { |
|
|
|
if (item.field == 'qty') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.tableForm.isInpuFocusShow = true |
|
|
|
if(purchaseReceiptRecordNumber == ''){ |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.tableForm.isInpuFocusShow = true |
|
|
|
} |
|
|
|
if(item.field == 'poLine'){ |
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
} |
|
|
|
if(item.field == 'poLine'){ |
|
|
|
item.tableForm.isInpuFocusShow = true |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -541,7 +561,6 @@ const handleDeleteTable = (item, index, formRef) => { |
|
|
|
}) |
|
|
|
nextTick(() => { |
|
|
|
const setV = {} |
|
|
|
|
|
|
|
setV['purchaseReceiptRecordNumber'] = '' |
|
|
|
setV['supplierCode'] = '' |
|
|
|
formRef.setValues(setV) |
|
|
|