|
@ -77,6 +77,7 @@ |
|
|
:apiDelete="PurchasereturnRequestDetailApi.deletePurchasereturnRequestDetail" |
|
|
:apiDelete="PurchasereturnRequestDetailApi.deletePurchasereturnRequestDetail" |
|
|
:Echo="Echo" |
|
|
:Echo="Echo" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
|
|
:detailValidate="detailValidate" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
@ -167,55 +168,62 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
row['projectCode'] = val[0]['projectCode'] |
|
|
row['projectCode'] = val[0]['projectCode'] |
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
if(formField == 'purchaseReceiptRecordNumber'){ |
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
isShowButton.value = false |
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
setV[formField] = val[0][searchField] |
|
|
setV['asnNumber'] = val[0]['asnNumber'] |
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
setV['ppNumber'] = val[0]['ppNumber'] |
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
|
|
|
setV['asnNumber'] = val[0]['asnNumber'] |
|
|
// 获取子表数据 getBomDisassemble |
|
|
setV['ppNumber'] = val[0]['ppNumber'] |
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ |
|
|
|
|
|
masterId: val[0]['id'] |
|
|
// 获取子表数据 getBomDisassemble |
|
|
}) |
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ |
|
|
.then((res) => { |
|
|
masterId: val[0]['id'] |
|
|
if (res) tableData.value = res |
|
|
}).then((res) => { |
|
|
tableData.value.forEach((item) => { |
|
|
if (res) tableData.value = res |
|
|
item.batch = item.toBatch |
|
|
tableData.value.forEach((item) => { |
|
|
item.packingNumber = item.toPackingNumber |
|
|
item.batch = item.toBatch |
|
|
item.containerNumber = item.toContainerNumber |
|
|
item.packingNumber = item.toPackingNumber |
|
|
item.containerNumber = item.toContainerNumber |
|
|
item.containerNumber = item.toContainerNumber |
|
|
item.toLocationGroupCode = null |
|
|
item.containerNumber = item.toContainerNumber |
|
|
item.toWarehouseCode = null |
|
|
item.toLocationGroupCode = null |
|
|
item.toLocationTypes = null |
|
|
item.toWarehouseCode = null |
|
|
item.toLocationCode = null |
|
|
item.toLocationTypes = null |
|
|
// item.fromLocationCode = item.fromLocationCode |
|
|
item.toLocationCode = null |
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
// item.fromLocationCode = item.fromLocationCode |
|
|
}) |
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
isShowButton.value = false |
|
|
}) |
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
|
|
if (item.field == 'supplierCode') { |
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
item.componentProps.disabled = true |
|
|
if (item.field == 'supplierCode') { |
|
|
} |
|
|
item.componentProps.disabled = true |
|
|
}) |
|
|
} |
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
}) |
|
|
item.tableForm.disabled = true |
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
if (item.field == 'remark') { |
|
|
item.tableForm.disabled = true |
|
|
item.tableForm.disabled = false |
|
|
if (item.field == 'remark') { |
|
|
} |
|
|
item.tableForm.disabled = false |
|
|
if (item.field == 'qty') { |
|
|
} |
|
|
item.tableForm.disabled = false |
|
|
if (item.field == 'qty') { |
|
|
} |
|
|
item.tableForm.disabled = false |
|
|
if (item.field == 'reason') { |
|
|
} |
|
|
item.tableForm.disabled = false |
|
|
if (item.field == 'reason') { |
|
|
} |
|
|
item.tableForm.disabled = false |
|
|
if (item.field == 'itemCode') { |
|
|
} |
|
|
item.tableForm.isInpuFocusShow = false |
|
|
if (item.field == 'itemCode') { |
|
|
} |
|
|
item.tableForm.isInpuFocusShow = false |
|
|
}) |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch((err) => { |
|
|
}).catch((err) => { |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
}) |
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
if(formField == 'supplierCode'){ |
|
|
|
|
|
isShowButton.value = true |
|
|
|
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
|
|
|
setV['purchaseReceiptRecordNumber'] = '' |
|
|
|
|
|
tableData.value = [] |
|
|
|
|
|
} |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -224,7 +232,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
if(formField == 'poLine'){ |
|
|
if(formField == 'poLine' || formField == 'itemCode'){ |
|
|
console.log(val) |
|
|
console.log(val) |
|
|
setV['poLine'] = val[0]['poLine'] |
|
|
setV['poLine'] = val[0]['poLine'] |
|
|
setV['poNumber'] = val[0]['poNumber'] |
|
|
setV['poNumber'] = val[0]['poNumber'] |
|
@ -397,7 +405,8 @@ const openForm = async (type: string, row?: number) => { |
|
|
if(type == 'create'){ |
|
|
if(type == 'create'){ |
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'supplierCode') { |
|
|
if (item.field == 'supplierCode') { |
|
|
item.componentProps.disabled = false |
|
|
item.componentProps.disabled = true |
|
|
|
|
|
item.componentProps.isSearchList = true |
|
|
} |
|
|
} |
|
|
if(item.field == 'purchaseReceiptRecordNumber'){ |
|
|
if(item.field == 'purchaseReceiptRecordNumber'){ |
|
|
item.componentProps.disabled = true |
|
|
item.componentProps.disabled = true |
|
@ -408,7 +417,8 @@ const openForm = async (type: string, row?: number) => { |
|
|
if(type == 'update'){ |
|
|
if(type == 'update'){ |
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'supplierCode') { |
|
|
if (item.field == 'supplierCode') { |
|
|
item.componentProps.disabled = false |
|
|
item.componentProps.disabled = true |
|
|
|
|
|
item.componentProps.isSearchList = false |
|
|
} |
|
|
} |
|
|
if(item.field == 'purchaseReceiptRecordNumber'){ |
|
|
if(item.field == 'purchaseReceiptRecordNumber'){ |
|
|
item.componentProps.disabled = true |
|
|
item.componentProps.disabled = true |
|
@ -513,6 +523,7 @@ const tableData = ref([]) |
|
|
// 添加明细 |
|
|
// 添加明细 |
|
|
const handleAddTable = () => { |
|
|
const handleAddTable = () => { |
|
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
|
|
|
let purchaseReceiptRecordNumber = formRef.value.formRef.formModel.purchaseReceiptRecordNumber |
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
item.tableForm.disabled = true |
|
|
item.tableForm.disabled = true |
|
|
if (item.field == 'remark') { |
|
|
if (item.field == 'remark') { |
|
@ -524,8 +535,20 @@ const handleAddTable = () => { |
|
|
if (item.field == 'qty') { |
|
|
if (item.field == 'qty') { |
|
|
item.tableForm.disabled = false |
|
|
item.tableForm.disabled = false |
|
|
} |
|
|
} |
|
|
if (item.field == 'itemCode') { |
|
|
if(purchaseReceiptRecordNumber == ''){ |
|
|
item.tableForm.isInpuFocusShow = true |
|
|
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 +564,6 @@ const handleDeleteTable = (item, index, formRef) => { |
|
|
}) |
|
|
}) |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
|
|
|
|
|
|
setV['purchaseReceiptRecordNumber'] = '' |
|
|
setV['purchaseReceiptRecordNumber'] = '' |
|
|
setV['supplierCode'] = '' |
|
|
setV['supplierCode'] = '' |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
@ -565,6 +587,18 @@ const submitForm = async (formType, data) => { |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
|
|
|
let flag = false; |
|
|
|
|
|
data.subList.forEach((item) => { |
|
|
|
|
|
if(item.qty == 0){ |
|
|
|
|
|
message.warning("数量不能为0") |
|
|
|
|
|
flag = true; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(flag){ |
|
|
|
|
|
formRef.value.formLoading = false |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
await PurchasereturnRequestMainApi.createPurchasereturnRequestMain(data) |
|
|
await PurchasereturnRequestMainApi.createPurchasereturnRequestMain(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
} else { |
|
|
} else { |
|
@ -579,6 +613,19 @@ const submitForm = async (formType, data) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 子表新增/编辑校验 |
|
|
|
|
|
const detailValidate = (data) => { |
|
|
|
|
|
let tag = false; |
|
|
|
|
|
if(data.qty <= 0){ |
|
|
|
|
|
message.warning('数量必须大于0') |
|
|
|
|
|
tag = false; |
|
|
|
|
|
return tag; |
|
|
|
|
|
}else { |
|
|
|
|
|
tag = true; |
|
|
|
|
|
return tag; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 导入 */ |
|
|
/** 导入 */ |
|
|
const importFormRef = ref() |
|
|
const importFormRef = ref() |
|
|
const handleImport = () => { |
|
|
const handleImport = () => { |
|
|