From 50fb58286ed3b718c39a97e0987ee7561a295651 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 04 七月 2025 17:56:41 +0800
Subject: [PATCH] git ch

---
 company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue |   92 +++++++++++++++++++++++++++++++++-------------
 1 files changed, 66 insertions(+), 26 deletions(-)

diff --git a/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue b/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue
index 4940722..d1aaeef 100644
--- a/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue
+++ b/company/src/components/enterprise/OperaInsuranceApplyAddWindow.vue
@@ -10,7 +10,7 @@
     <div class="list">
       <el-form :inline="true" ref="form" :model="form" :rules="rules" class="demo-form-inline">
         <el-form-item label="淇濋櫓鏂规" prop="solutionId">
-          <el-select v-model="form.solutionId" filterable @change="changeSolution" placeholder="璇烽�夋嫨">
+          <el-select v-model="form.solutionId" :disabled="title === '缁繚'" filterable @change="changeSolution" placeholder="璇烽�夋嫨">
             <el-option
                 v-for="item in company"
                 :key="item.id"
@@ -331,7 +331,7 @@
     },
     // 鑾峰彇鎶曚繚璇︽儏
     getDetails () {
-      findList({ applyId: this.form.id })
+      findList({ applyId: this.form.id, applyStatus: 1 })
         .then(res => {
           res.forEach(item => {
             console.log(item)
@@ -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.showCompany.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.showCompany.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