From a4a446d4b16c6077f06430d22233e3e36f8298ec Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 23 Aug 2024 13:09:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E7=94=B3=E8=AF=B7=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/claimAndRefund/receive.js | 8 ++++++ .../picking/apply/component/AddPicking1.vue | 27 +++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/api/claimAndRefund/receive.js b/src/api/claimAndRefund/receive.js index b57fbcd..42a2504 100644 --- a/src/api/claimAndRefund/receive.js +++ b/src/api/claimAndRefund/receive.js @@ -307,6 +307,14 @@ export function getCostBearingApi() { method: 'get', }) } +// 判断工程是否结算 +export function getAgreementInfoByIdApi(data) { + return request({ + url: '/material/select/getAgreementInfoById', + method: 'post', + data + }) +} diff --git a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue index fe95a43..2db75c6 100644 --- a/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue +++ b/src/views/claimAndreturn/picking/apply/component/AddPicking1.vue @@ -82,7 +82,7 @@ ref="deviceTypeCascader" filterable style="width: 240px" - :disabled="isEdit && !isView" + :disabled="(isEdit && !isView) || isCost" > @@ -271,6 +271,7 @@ import { getLeaseApplyListAll, getLeaseApplyAuditListAll, getCostBearingApi, + getAgreementInfoByIdApi, } from '@/api/claimAndRefund/receive' import { getInfo } from '@/api/login' export default { @@ -493,6 +494,7 @@ export default { ], }, costBearingList: [], + isCost: false, } }, mounted() { @@ -569,6 +571,21 @@ export default { projectId: this.queryParams.proId, } const res = await getAgreementInfoById(params) + + console.log(res, '根据工程和单位获取协议id') + + if (res.data.isSlt == 1) { + this.$message.error( + '当前协议下对应的工程已完成结算,不可重复领料!', + ) + this.isCost = true + + if (this.leaseApplyDetails.length > 0) { + this.leaseApplyDetails = [] + } + } else { + this.isCost = false + } if (!(res.data && res.data.agreementId)) { this.$message.error('当前单位和工程未上传') @@ -579,6 +596,12 @@ export default { } else { this.queryParams.agreementId = res.data.agreementId this.queryParams.agreementCode = res.data.agreementCode + + // // 1. 判断当前协议对应的工程是否结算 + + // getAgreementInfoByIdApi({ + // agreementId: res.data.agreementId, + // }) } } }, @@ -729,7 +752,7 @@ export default { } else { this.queryParams.leaseApplyDetails = this.leaseApplyDetails if (this.queryParams.leaseApplyDetails.length == 0) { - this.$message.error('请添加数据') + this.$message.error('请添加机具类型') return } let canSave = true