From 7accf6baf5f1f614103d060888ed7769253203f4 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Thu, 19 Sep 2024 12:37:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E8=AE=A1=E5=88=92=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E7=BC=96=E8=BE=91=EF=BC=8C=E8=AE=A1=E5=88=92=E6=95=B0?= =?UTF-8?q?=E9=87=8F=EF=BC=9A=E6=98=AF=E5=90=A6=E5=8F=AF=E7=94=A8true?= =?UTF-8?q?=E5=8F=AF=E7=BC=96=E8=BE=91=EF=BC=8Cfalse=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=EF=BC=8C=E5=A4=A7=E4=BA=8E0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.ts | 1 + src/locales/zh-CN.ts | 1 + .../purchasePlanMain/index.vue | 24 +++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) 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 {