From 8932133e2ee2e5708e3506bee3d01d59bff5f1d2 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期日, 12 一月 2025 11:30:52 +0800
Subject: [PATCH] bug

---
 company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue |   88 ++++++++++++++++++++++++++++++++------------
 1 files changed, 64 insertions(+), 24 deletions(-)

diff --git a/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue b/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue
index 4940722..2b3f5b0 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
+              })
+            }
           }
         }
       })
@@ -504,14 +544,14 @@
         this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
         return
       }
-      this.$refs.addEmployee.open('娣诲姞鍛樺伐', { arr: this.tableData, price: this.price, solutionId: this.form.solutionId, companyId: this.form.companyId })
+      this.$refs.addEmployee.open('娣诲姞鍛樺伐', { arr: this.tableData, price: this.price, solutionId: this.form.solutionId, hasDispatchUnit: this.item.hasDispatchUnit, companyId: this.userInfo.type === 1 ? this.userInfo.companyId : this.form.companyId })
     },
     uploadUser () {
       if (!this.form.solutionId) {
         this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
         return
       }
-      this.$refs.importEmployees.open('涓婁紶鍚嶅崟', { arr: this.tableData, solutionId: this.form.solutionId, type: 1, price: this.price })
+      this.$refs.importEmployees.open('涓婁紶鍚嶅崟', { arr: this.tableData, solutionId: this.form.solutionId, type: 1, hasDispatchUnit: this.item.hasDispatchUnit, price: this.price })
     },
     // 鍒囨崲鏂规
     changeSolution (e) {
@@ -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