diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 9c6aad57a..e571f3bf9 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -691,6 +691,7 @@ export default { 预测日期:'Forecast Date', 订单行:'Order Line', 计划数量:'Planned Quantity', + 计划数量必须大于0:'The number of plans must be greater than 0', 最后更新时间:'Last update time', 最后更新者:'Last Updater', 要货计划:'Demand plan', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index b7920e2d5..c5655b206 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -693,6 +693,7 @@ export default { 预测日期:'预测日期', 订单行:'订单行', 计划数量:'计划数量', + 计划数量必须大于0:'计划数量必须大于0', 最后更新时间:'最后更新时间', 最后更新者:'最后更新者', 要货计划:'要货计划', diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue index 6d0455381..ee6307109 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue @@ -83,7 +83,6 @@ :detailAllSchemas="PurchasePlanDetail.allSchemas" :detailAllSchemasRules="PurchasePlanDetailRules" :apiCreate="PurchasePlanDetailApi.createPurchasePlanDetail" - :apiUpdate="PurchasePlanDetailApi.updatePurchasePlanDetail" :apiPage="PurchasePlanDetailApi.getPurchasePlanDetailPage" :apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail" @searchTableSuccessDetail="searchTableSuccessDetail" @@ -98,6 +97,8 @@ :isOpenSearchTable="true" :mainSubmitCreateApi="true" fieldTableColumn="poLine" + @detailOpenForm="detailOpenForm" + @handleSubmitForm="handleSubmitForm" /> @@ -517,7 +518,26 @@ const getSearchTableData = async (number,formField,searchField)=>{ const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name 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 handleSubmitForm = 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')) + } + + } /** 删除按钮操作 */ const handleDelete = async (id : number) => { try {