From d1c205d29b5eacf1de22a7af29329ca370d1c2d3 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 29 十一月 2024 14:50:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1

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

diff --git a/company/src/components/enterprise/reinsurance.vue b/company/src/components/enterprise/reinsurance.vue
index 68651eb..0286f4f 100644
--- a/company/src/components/enterprise/reinsurance.vue
+++ b/company/src/components/enterprise/reinsurance.vue
@@ -102,7 +102,9 @@
                 <el-button type="danger" @click="deleItem">鍒犻櫎</el-button>
             </div>
             <div class="btns_item" v-if="activeName !== '1'">
-                <el-button type="primary" @click="sele">閫夊彇娲鹃仯鍗曚綅</el-button>
+<!--                <el-button type="primary" @click="sele">閫夊彇娲鹃仯鍗曚綅</el-button>-->
+                <el-button type="primary" @click="sele(1)" v-if="item && item.hasDispatchUnit !== 1">閫夊彇娲鹃仯鍗曚綅</el-button>
+                <el-button type="primary" @click="sele(2)" v-if="item && item.hasDispatchUnit === 1">閫夊彇宸ョ</el-button>
             </div>
         </div>
         <el-table
@@ -144,6 +146,7 @@
                 </template>
             </el-table-column>
             <el-table-column
+                v-if="item && item.hasDispatchUnit !== 1"
                 :key="Math.random()"
                 prop="duName"
                 label="娲鹃仯鍗曚綅">
@@ -205,14 +208,15 @@
                 </template>
             </el-table-column>
             <el-table-column
-                    :key="Math.random()"
-                    prop="duName"
-                    label="娲鹃仯鍗曚綅">
+                v-if="item && item.hasDispatchUnit !== 1"
+                :key="Math.random()"
+                prop="duName"
+                label="娲鹃仯鍗曚綅">
             </el-table-column>
             <el-table-column
-                    :key="Math.random()"
-                    prop="workTypeName"
-                    label="鎵�灞炲伐绉�">
+                :key="Math.random()"
+                prop="workTypeName"
+                label="鎵�灞炲伐绉�">
             </el-table-column>
             <el-table-column
                 :key="Math.random()"
@@ -346,7 +350,7 @@
         types: [0]
       }).then(res => {
         res.forEach(item => {
-          item.fee = ''
+          item.fee = item.fee
           item.idCard = item.memberIdcardNo
           item.workTypeName = ''
           item.worktypeId = ''
@@ -409,7 +413,7 @@
       columns.forEach((column, index) => {
         if (index === 0) {
           sums[index] = '鎬讳环'
-        } else if (index === 7) {
+        } else if (this.item && this.item.hasDispatchUnit === 1 && index === 6) {
           let total = 0
           if (this.activeName === '0') {
             this.form.addDetailList.forEach(item => {
@@ -421,14 +425,26 @@
             this.form.delDetailList.forEach(item => {
               total += item.fee
             })
-            // if (total < 0) {
             sums[index] = (total||0).toFixed(2)
-            // } else {
-            //     sums[index] = '-' + total
-            // }
             return
           }
           sums[index] = ''
+        } else if (this.item && this.item.hasDispatchUnit === 0 && index === 7) {
+            let total = 0
+            if (this.activeName === '0') {
+                this.form.addDetailList.forEach(item => {
+                    total += item.fee
+                })
+                sums[index] = total.toFixed(2)
+                return
+            } else {
+                this.form.delDetailList.forEach(item => {
+                    total += item.fee
+                })
+                sums[index] = (total||0).toFixed(2)
+                return
+            }
+            sums[index] = ''
         }
       })
       return sums
@@ -441,7 +457,7 @@
       if (this.activeName === '0') {
         this.seleData.forEach(item => {
           this.form.addDetailList.forEach((row, index) => {
-            if (item === row.name) {
+            if (item === row.idCard) {
               this.form.addDetailList.splice(index, 1)
             }
           })
@@ -449,7 +465,7 @@
       } else {
         this.seleData.forEach(item => {
           this.form.delDetailList.forEach((row, index) => {
-            if (item === row.name) {
+            if (item === row.idCard) {
               this.form.delDetailList.splice(index, 1)
             }
           })
@@ -522,9 +538,9 @@
         return
       }
       if (this.activeName === '0') {
-        this.$refs.addEmployee.open('娣诲姞鍔犱繚鍛樺伐', { arr: this.form.addDetailList, solutionId: this.item.newVersionSolutionId, price: this.price })
+        this.$refs.addEmployee.open('娣诲姞鍔犱繚鍛樺伐', { arr: this.form.addDetailList, solutionId: this.item.newVersionSolutionId, price: this.price, companyId: this.item.hasDispatchUnit === 1 ? '1' : '' })
       } else {
-        this.$refs.addEmployee.open('娣诲姞鍑忎繚鍛樺伐', { arr: this.form.delDetailList, solutionId: this.item.newVersionSolutionId, price: this.reducePrice })
+        this.$refs.addEmployee.open('娣诲姞鍑忎繚鍛樺伐', { arr: this.form.delDetailList, solutionId: this.item.newVersionSolutionId, price: this.reducePrice, companyId: this.item.hasDispatchUnit === 1 ? '1' : '' })
       }
     },
     uploadUser () {
@@ -533,9 +549,9 @@
         return
       }
       if (this.activeName === '0') {
-        this.$refs.importEmployees.open('鍔犱繚鍛樺伐鍚嶅崟', { arr: this.form.addDetailList, type: 1, price: this.price, solutionId: this.item.newVersionSolutionId })
+        this.$refs.importEmployees.open('鍔犱繚鍛樺伐鍚嶅崟', { arr: this.form.addDetailList, type: 1, price: this.price, solutionId: this.item.newVersionSolutionId, hasDispatchUnit: this.item.hasDispatchUnit })
       } else {
-        this.$refs.importEmployees.open('鍑忎繚鍛樺伐鍚嶅崟', { arr: this.form.delDetailList, type: 0, price: this.reducePrice, solutionId: this.item.newVersionSolutionId, insuranceApplyId: this.form.id })
+        this.$refs.importEmployees.open('鍑忎繚鍛樺伐鍚嶅崟', { arr: this.form.delDetailList, type: 0, price: this.reducePrice, solutionId: this.item.newVersionSolutionId, insuranceApplyId: this.form.id, hasDispatchUnit: this.item.hasDispatchUnit })
       }
     },
     // 鍒囨崲鏂规
@@ -560,7 +576,7 @@
       this.seleData.forEach(item => {
         if (this.activeName === '0') {
           this.form.addDetailList.forEach(row => {
-            if (item === row.name) {
+            if (item === row.idCard) {
               row.workTypeName = obj.workTypeName
               row.worktypeId = obj.worktypeId
               row.duName = obj.duName
@@ -569,7 +585,7 @@
           })
         } else {
           this.form.delDetailList.forEach(row => {
-            if (item === row.name) {
+            if (item === row.idCard) {
               row.workTypeName = obj.workTypeName
               row.worktypeId = obj.worktypeId
               row.duName = obj.duName
@@ -582,7 +598,7 @@
       this.$refs.multipleTable.clearSelection()
     },
     // 閫夋嫨鍛樺伐
-    sele () {
+    sele (type) {
       if (!this.form.solutionId) {
         this.$message.warning('璇烽�夋嫨淇濋櫓鏂规')
         return
@@ -591,7 +607,7 @@
         this.$message.warning('璇烽�夋嫨鍛樺伐')
         return
       }
-      this.$refs.confirmJobType.open('纭宸ョ', { solutionId: this.newVersionSolutionId })
+      this.$refs.confirmJobType.open('纭宸ョ', { solutionId: this.newVersionSolutionId, type })
     },
     // 鏌ヨ鍏ㄩ儴鏂规
     getCompany () {
@@ -626,7 +642,7 @@
       return sexAndAge.age
     },
     handleSelectionChange (e) {
-      this.seleData = e.map(item => item.name)
+      this.seleData = e.map(item => item.memberIdcardNo)
     },
     getValue (list) {
       console.log(list)

--
Gitblit v1.9.3