|
@ -77,6 +77,7 @@ |
|
|
:apiDelete="PurchasereturnRequestDetailApi.deletePurchasereturnRequestDetail" |
|
|
:apiDelete="PurchasereturnRequestDetailApi.deletePurchasereturnRequestDetail" |
|
|
:Echo="Echo" |
|
|
:Echo="Echo" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
|
|
:detailValidate="detailValidate" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
@ -167,6 +168,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
row['projectCode'] = val[0]['projectCode'] |
|
|
row['projectCode'] = val[0]['projectCode'] |
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
|
|
|
if(formField == 'purchaseReceiptRecordNumber'){ |
|
|
|
|
|
isShowButton.value = false |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
@ -176,8 +179,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
// 获取子表数据 getBomDisassemble |
|
|
// 获取子表数据 getBomDisassemble |
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ |
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ |
|
|
masterId: val[0]['id'] |
|
|
masterId: val[0]['id'] |
|
|
}) |
|
|
}).then((res) => { |
|
|
.then((res) => { |
|
|
|
|
|
if (res) tableData.value = res |
|
|
if (res) tableData.value = res |
|
|
tableData.value.forEach((item) => { |
|
|
tableData.value.forEach((item) => { |
|
|
item.batch = item.toBatch |
|
|
item.batch = item.toBatch |
|
@ -191,7 +193,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
// item.fromLocationCode = item.fromLocationCode |
|
|
// item.fromLocationCode = item.fromLocationCode |
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
}) |
|
|
}) |
|
|
isShowButton.value = false |
|
|
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'supplierCode') { |
|
|
if (item.field == 'supplierCode') { |
|
|
item.componentProps.disabled = true |
|
|
item.componentProps.disabled = true |
|
@ -212,10 +214,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
item.tableForm.isInpuFocusShow = false |
|
|
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,9 +535,21 @@ const handleAddTable = () => { |
|
|
if (item.field == 'qty') { |
|
|
if (item.field == 'qty') { |
|
|
item.tableForm.disabled = false |
|
|
item.tableForm.disabled = false |
|
|
} |
|
|
} |
|
|
|
|
|
if(purchaseReceiptRecordNumber == ''){ |
|
|
if (item.field == 'itemCode') { |
|
|
if (item.field == 'itemCode') { |
|
|
item.tableForm.isInpuFocusShow = true |
|
|
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 = () => { |
|
|