|
@ -83,7 +83,6 @@ |
|
|
:detailAllSchemas="PurchasePlanDetail.allSchemas" |
|
|
:detailAllSchemas="PurchasePlanDetail.allSchemas" |
|
|
:detailAllSchemasRules="PurchasePlanDetailRules" |
|
|
:detailAllSchemasRules="PurchasePlanDetailRules" |
|
|
:apiCreate="PurchasePlanDetailApi.createPurchasePlanDetail" |
|
|
:apiCreate="PurchasePlanDetailApi.createPurchasePlanDetail" |
|
|
:apiUpdate="PurchasePlanDetailApi.updatePurchasePlanDetail" |
|
|
|
|
|
:apiPage="PurchasePlanDetailApi.getPurchasePlanDetailPage" |
|
|
:apiPage="PurchasePlanDetailApi.getPurchasePlanDetailPage" |
|
|
:apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail" |
|
|
:apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
@ -98,6 +97,8 @@ |
|
|
:isOpenSearchTable="true" |
|
|
:isOpenSearchTable="true" |
|
|
:mainSubmitCreateApi="true" |
|
|
:mainSubmitCreateApi="true" |
|
|
fieldTableColumn="poLine" |
|
|
fieldTableColumn="poLine" |
|
|
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
|
|
@handleSubmitForm="handleDetailSubmitForm" |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
@ -517,7 +518,26 @@ const getSearchTableData = async (number,formField,searchField)=>{ |
|
|
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name |
|
|
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name |
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
} |
|
|
} |
|
|
|
|
|
const detailOpenForm = (type, row) => { |
|
|
|
|
|
|
|
|
|
|
|
PurchasePlanDetail.allSchemas.formSchema.forEach(item=>{ |
|
|
|
|
|
if(item.field == 'planQty'){ |
|
|
|
|
|
//计划数量 |
|
|
|
|
|
item.componentProps.disabled = row.available=="FALSE" |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
const handleDetailSubmitForm = async (formType, data)=>{ |
|
|
|
|
|
if(formType == 'update'){ |
|
|
|
|
|
if(Number(data.planQty)<=0){ |
|
|
|
|
|
message.error(t('ts.计划数量必须大于0')) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
await PurchasePlanDetailApi.updatePurchasePlanDetail(data) |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
} |
|
|
|
|
|
detailRef.value.submitUpdateList() |
|
|
|
|
|
} |
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
const handleDelete = async (id : number) => { |
|
|
const handleDelete = async (id : number) => { |
|
|
try { |
|
|
try { |
|
@ -865,25 +885,26 @@ const handleSelectionPublish = async ()=>{ |
|
|
|
|
|
|
|
|
// 子表新增/编辑校验 |
|
|
// 子表新增/编辑校验 |
|
|
const detailValidate = async (data) => { |
|
|
const detailValidate = async (data) => { |
|
|
let tag = false |
|
|
return true |
|
|
await PurchaseDetailApi.getPurchaseDetailPageCheckData({ |
|
|
// let tag = false |
|
|
number: data.poNumber, |
|
|
// await PurchaseDetailApi.getPurchaseDetailPageCheckData({ |
|
|
lineNumber: data.poLine |
|
|
// number: data.poNumber, |
|
|
}).then(res => { |
|
|
// lineNumber: data.poLine |
|
|
if(res.list[0].type == 'DISCRETE'){//只有离散单需要这个校验 |
|
|
// }).then(res => { |
|
|
if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) { |
|
|
// if(res.list[0].type == 'DISCRETE'){//只有离散单需要这个校验 |
|
|
message.error(t('ts.要货计划数量不得大于订单数量-已计划数量')) |
|
|
// if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) { |
|
|
tag = false |
|
|
// message.error(t('ts.要货计划数量不得大于订单数量-已计划数量')) |
|
|
} else { |
|
|
// tag = false |
|
|
tag = true |
|
|
// } else { |
|
|
} |
|
|
// tag = true |
|
|
}else{ |
|
|
// } |
|
|
tag = true |
|
|
// }else{ |
|
|
} |
|
|
// tag = true |
|
|
}).catch(err =>{ |
|
|
// } |
|
|
console.log(err); |
|
|
// }).catch(err =>{ |
|
|
}) |
|
|
// console.log(err); |
|
|
return tag |
|
|
// }) |
|
|
|
|
|
// return tag |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 导入 */ |
|
|
/** 导入 */ |
|
|