From 30cfb2b836a8a3d609518cc295753b58b17a9bc7 Mon Sep 17 00:00:00 2001 From: MrShi <1878285526@qq.com> Date: 星期五, 15 十一月 2024 09:15:29 +0800 Subject: [PATCH] 优化 --- company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue | 84 +++++++++++++++++++++++++++++++----------- 1 files changed, 62 insertions(+), 22 deletions(-) diff --git a/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue b/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue index 4940722..1986625 100644 --- a/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue +++ b/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue @@ -426,28 +426,68 @@ price = price + item.fee }) // } - if (!this.form.companyId) { - this.$refs.detailsPolicyholder.open('鎶曚繚璇︽儏鍗�', { - companyName: this.userInfo.company.name, - solutionName: this.item.name, - solutionType: this.item.type, - applyStartTime: this.form.applyStartTime, - applyEndTime: this.form.applyEndTime, - insureNum: this.tableData.length, - totalPrice: price, - detailList: this.tableData - }) + const endTime = Number(this.item.correctWarnTime.split(':')[0] + this.item.correctWarnTime.split(':')[1]) + const now = new Date(); + const hours = now.getHours(); + const minutes = now.getMinutes(); + const date = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`; + const startTime = Number(date.split(':')[0] + date.split(':')[1]) + if (startTime > endTime) { + this.$confirm('鎮ㄥ凡瓒呰繃褰撳ぉ鏈�鏅氭壒鏀规椂闂达紝淇濆崟瀹為檯鐢熸晥鏃堕棿浠ヤ繚闄╁叕鍙稿鏍镐负鍑嗭紒', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + if (!this.form.companyId) { + this.$refs.detailsPolicyholder.open('鎶曚繚璇︽儏鍗�', { + companyName: this.userInfo.company.name, + solutionName: this.item.name, + solutionType: this.item.type, + applyStartTime: this.form.applyStartTime, + applyEndTime: this.form.applyEndTime, + insureNum: this.tableData.length, + totalPrice: price, + detailList: this.tableData + }) + } else { + this.$refs.detailsPolicyholder.open('鎶曚繚璇︽儏鍗�', { + companyName: this.form.companyName, + solutionName: this.item.name, + solutionType: this.item.type, + applyStartTime: this.form.applyStartTime, + applyEndTime: this.form.applyEndTime, + insureNum: this.tableData.length, + totalPrice: price, + detailList: this.tableData + }) + } + }).catch(() => { + + }); } else { - this.$refs.detailsPolicyholder.open('鎶曚繚璇︽儏鍗�', { - companyName: this.form.companyName, - solutionName: this.item.name, - solutionType: this.item.type, - applyStartTime: this.form.applyStartTime, - applyEndTime: this.form.applyEndTime, - insureNum: this.tableData.length, - totalPrice: price, - detailList: this.tableData - }) + if (!this.form.companyId) { + this.$refs.detailsPolicyholder.open('鎶曚繚璇︽儏鍗�', { + companyName: this.userInfo.company.name, + solutionName: this.item.name, + solutionType: this.item.type, + applyStartTime: this.form.applyStartTime, + applyEndTime: this.form.applyEndTime, + insureNum: this.tableData.length, + totalPrice: price, + detailList: this.tableData + }) + } else { + this.$refs.detailsPolicyholder.open('鎶曚繚璇︽儏鍗�', { + companyName: this.form.companyName, + solutionName: this.item.name, + solutionType: this.item.type, + applyStartTime: this.form.applyStartTime, + applyEndTime: this.form.applyEndTime, + insureNum: this.tableData.length, + totalPrice: price, + detailList: this.tableData + }) + } } } }) @@ -595,7 +635,7 @@ }, // 鏌ヨ鍏ㄩ儴鏂规 getCompany () { - getUseList(this.form.companyId, 2) + getUseList(this.form.companyId ? this.form.companyId : this.userInfo.companyId, 2) .then(res => { this.company = res }) -- Gitblit v1.9.3