From b5999acf891e7218cec2df418bcfe8a6cb34521e Mon Sep 17 00:00:00 2001 From: "YEJIAXING-PC\\lenovo" <591141169@qq.com> Date: Thu, 21 Nov 2024 09:24:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E7=B4=A2=E8=B5=94=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=AE=A1=E6=89=B9=E9=A9=B3=E5=9B=9E=E5=92=8C=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=90=8E=E7=BC=BA=E5=B0=91=E9=87=8D=E6=96=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8A=9F=E8=83=BD=20=20YT-1095?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/inventoryManage/balance/index.vue | 21 +++- .../purchaseClaimRequest/index.vue | 118 ++++++++++-------- 2 files changed, 81 insertions(+), 58 deletions(-) diff --git a/src/views/wms/inventoryManage/balance/index.vue b/src/views/wms/inventoryManage/balance/index.vue index 7817ec0ab..b84a7b5ae 100644 --- a/src/views/wms/inventoryManage/balance/index.vue +++ b/src/views/wms/inventoryManage/balance/index.vue @@ -41,7 +41,7 @@ @@ -266,8 +266,20 @@ const handleSelectionPoint = async () => { }) // window.open(srcPoint.value+'&relateNumber='+rows.join(',')) } + + +const isShowPointBtn = (row) =>{ + if(row.qty>0){ +   return false + }else{ +   return true + } +} + + // 列表-操作按钮 -const butttondata = [ +const butttondata = (row) => { +  return [ // { // label: '标签信息', // name: 'bqxx', @@ -279,10 +291,11 @@ const butttondata = [ // float: 'right', // hasPermi: '' // }, - defaultButtons.mainListPointBtn(null) // 标签打印 + defaultButtons.mainListPointBtn({hide: isShowPointBtn(row)} ) // 标签打印 // defaultButtons.mainListEditBtn({hasPermi:'wms:balance:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'wms:balance:delete'}), // 删除 -] +  ] +} // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { diff --git a/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue index 0e2602641..32ac1a8ea 100644 --- a/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue +++ b/src/views/wms/supplierManage/purchaseClaim/purchaseClaimRequest/index.vue @@ -80,8 +80,8 @@ :apiDelete="PurchaseClaimRequestDetailApi.deletePurchaseClaimRequestDetail" :detailButtonIsShowDelete="false" :detailButtonIsShowAdd="false" - :detailButtonIsShowAddStatusArray="['1','2']" - :isChangeDetailDrawer="['2']" + :detailButtonIsShowAddStatusArray="['1', '2']" + :isChangeDetailDrawer="['2']" @searchTableSuccessDetail="searchTableSuccessDetail" @detailOpenForm="detailOpenForm" /> @@ -96,14 +96,14 @@ :mode="2" :extend="businessType" /> - @@ -154,28 +154,34 @@ const updataTableColumns = (val) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { nextTick(async () => { if (type == 'tableForm') { - if(formField == 'itemCode'){ - let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) - if(itemCodes.length>0){ - itemCodes = itemCodes.map(item=>(item['itemCode'])) + if (formField == 'itemCode') { + let itemCodes = val.filter((item) => + tableData.value.find((item1) => item1['itemCode'] == item['itemCode']) + ) + if (itemCodes.length > 0) { + itemCodes = itemCodes.map((item) => item['itemCode']) message.warning(`物料${itemCodes.join(',')}已经存在`) } - val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) - if(val.length==0){ + val = val.filter( + (item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode']) + ) + if (val.length == 0) { return } - let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) - newVal.forEach(item=>{ + let newVal = val.filter( + (item) => !tableData.value.find((item1) => item1['itemCode'] == item['itemCode']) + ) + newVal.forEach((item) => { let tfk = JSON.parse(JSON.stringify(tableFormKeys)) tfk['itemCode'] = item['itemCode'] tfk['itemName'] = item['itemName'] tfk['uom'] = item['supplierUom'] tableData.value.push(tfk) - }) + }) } - } + } const setV = {} - if(formField === 'supplierCode'){ + if (formField === 'supplierCode') { setV['supplierCode'] = val[0]['code'] setV['supplierName'] = val[0]['name'] tableData.value = [] @@ -192,9 +198,8 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { setV['remark'] = val[0]['remark'] setV['uom'] = val[0]['customerUom'] if (formField == 'itemCode') { - setV['itemName'] = val[0]['itemName'] - setV['uom'] = val[0]['supplierUom'] - + setV['itemName'] = val[0]['itemName'] + setV['uom'] = val[0]['supplierUom'] } formRef.setValues(setV) }) @@ -277,9 +282,14 @@ const butttondata = (row, $index) => { hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchaseClaimRequest:update' }), // 编辑 - defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3']),hasPermi:'wms:purchaseClaimRequest:close'}), // 关闭 - - defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchaseClaimRequest:reAdd'}), // 重新添加 + defaultButtons.mainListCloseBtn({ + hide: isShowMainButton(row, ['1', '2', '3']), + hasPermi: 'wms:purchaseClaimRequest:close' + }), // 关闭 + defaultButtons.mainListReAddBtn({ + hide: isShowMainButton(row, ['4', '5']), + hasPermi: 'wms:purchaseClaimRequest:reAdd' + }) // 重新添加 ] } @@ -291,44 +301,46 @@ const buttonTableClick = async (val, row) => { } else if (val == 'mainPlanSub') { // 提交审批 handleSub(row.masterId) - } - else if (val == 'mainPlanApp') { + } else if (val == 'mainPlanApp') { // 审批通过 handleAgree(row.masterId) - } - else if (val == 'mainPlanTur') { + } else if (val == 'mainPlanTur') { // 审批驳回 handleReject(row.masterId) - } - else if (val == 'delete') { + } else if (val == 'delete') { // 删除 handleDelete(row.masterId) - }else if (val == 'mainClose') { // 关闭 + } else if (val == 'mainClose') { + // 关闭 await message.confirm('确认要关闭吗?') tableObject.loading = true - PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId).then(() => { - message.success(t('common.updateSuccess')) - tableObject.loading = false - buttonBaseClick('refresh',null) - }).catch(err => { - tableObject.loading = false - console.log(err) - }) - } else if (val == 'mainReAdd') { // 重新添加 -    await message.confirm('确认要重新添加吗?') -    tableObject.loading = true -    PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId).then(() => { -      message.success(t('common.updateSuccess')) -      tableObject.loading = false -      buttonBaseClick('refresh',null) -    }).catch(err => { -      tableObject.loading = false -      console.log(err) -    }) -  } + PurchaseClaimRequestMainApi.closePurchaseClaimRequestMain(row.masterId) + .then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + buttonBaseClick('refresh', null) + }) + .catch((err) => { + tableObject.loading = false + console.log(err) + }) + } else if (val == 'mainReAdd') { + // 重新添加 + await message.confirm('确认要重新添加吗?') + tableObject.loading = true + PurchaseClaimRequestMainApi.reAddPurchaseClaimRequestMain(row.masterId) + .then(() => { + message.success(t('common.updateSuccess')) + tableObject.loading = false + buttonBaseClick('refresh', null) + }) + .catch((err) => { + tableObject.loading = false + console.log(err) + }) + } } - /** 提交审批按钮操作 */ const handleSub = async (masterId: number) => { try { @@ -383,20 +395,19 @@ const handleReject = async (masterId: number) => { } } - /** 添加/修改操作 */ const formRef = ref() const openForm = async (type: string, row?: any) => { tableData.value = [] // 重置明细数据 if (row?.id) { - PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => { + PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => { if (item.field == 'supplierCode') { item.componentProps.isSearchList = false item.componentProps.disabled = true } }) } else { - PurchaseClaimRequestMain.allSchemas.formSchema.forEach(item => { + PurchaseClaimRequestMain.allSchemas.formSchema.forEach((item) => { if (item.field == 'supplierCode') { item.componentProps.isSearchList = true item.componentProps.disabled = false @@ -561,7 +572,7 @@ const detailOpenForm = (type, row, masterParmas) => { } } // 审批中的时候详情的编辑提交 -const submitFormDetail =async (formType,data) => { +const submitFormDetail = async (formType, data) => { detailFormRef.value.formLoading = true try { if (formType === 'create') { @@ -577,7 +588,6 @@ const submitFormDetail =async (formType,data) => { } catch { detailFormRef.value.formLoading = false } - } /** 初始化 **/ onMounted(async () => {