From 7b336b5d570dece2d283d33221874e8dae1a2118 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 05 三月 2024 14:02:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 company/src/components/enterprise/OperaInsuranceApplyWindow.vue |  150 ++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 108 insertions(+), 42 deletions(-)

diff --git a/company/src/components/enterprise/OperaInsuranceApplyWindow.vue b/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
index 9dbd1e4..6295d2b 100644
--- a/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
+++ b/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
@@ -138,6 +138,8 @@
         <importEmployees ref="importEmployees" @result="getValue" />
         <!--    纭宸ョ    -->
         <confirmJobType ref="confirmJobType" @result="getUser" />
+        <!--    鏌ョ湅璇﹀崟    -->
+        <detailsPolicyholder ref="detailsPolicyholder" @success="successEvent" />
     </GlobalWindow>
 </template>
 
@@ -148,12 +150,14 @@
 import addEmployee from '@/components/enterprise/addEmployee'
 import importEmployees from '@/components/enterprise/importEmployees'
 import confirmJobType from '@/components/enterprise/confirmJobType'
+import detailsPolicyholder from '@/components/business/detailsPolicyholder'
 import { all, getNewVersion } from '@/api/business/solutions'
+import { mapState } from 'vuex'
 import { create, getCountCyclePriceVO, getDetail, findList, updateData } from '@/api/business/insuranceApply'
 export default {
   name: 'OperaInsuranceApplyWindow2',
   extends: BaseOpera,
-  components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType },
+  components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType, detailsPolicyholder },
   data () {
     return {
       form: {
@@ -163,6 +167,7 @@
           applyStartTime: '',
           applyEndTime: ''
       },
+      solutionName: '',
       type: '',
       pickerOptions: {}, // 瀛樻斁picker options鐨勫彉閲�
       price: '',
@@ -187,7 +192,52 @@
           'field.id': 'id'
       })
   },
+    computed: {
+      ...mapState(['userInfo'])
+    },
     methods: {
+      successEvent() {
+          let arr = JSON.parse(JSON.stringify(this.tableData))
+          arr.forEach(item => {
+              item.idcardNo = item.idCard
+          })
+          this.isWorking = true
+          // if (!this.form.id) {
+              create({
+                  applyDetailList: arr,
+                  applyStartTime: this.form.applyStartTime,
+                  applyEndTime: this.form.applyEndTime,
+                  solutionId: this.form.solutionId
+              }).then(() => {
+                  this.visible = false
+                  this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+                  this.$emit('success')
+              })
+                  .catch(e => {
+                      this.$tip.apiFailed(e)
+                  })
+                  .finally(() => {
+                      this.isWorking = false
+                  })
+          // } else {
+          //     updateData({
+          //         id: this.form.id,
+          //         applyDetailList: arr,
+          //         applyStartTime: this.form.applyStartTime,
+          //         applyEndTime: this.form.applyEndTime,
+          //         solutionId: this.form.solutionId
+          //     }).then(() => {
+          //         this.visible = false
+          //         this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+          //         this.$emit('success')
+          //     }).catch(e => {
+          //         this.$tip.apiFailed(e)
+          //     })
+          //         .finally(() => {
+          //             this.isWorking = false
+          //         })
+          // }
+      },
       open (title, target) {
           this.title = title
           this.tableData = []
@@ -277,52 +327,68 @@
                         return
                     }
                     for (let i = 0; i < this.tableData.length; i++) {
-                        console.log(this.tableData[i].worktypeId, this.tableData[i].duId)
+                        console.log(this.tableData[i].worktypeId)
+                        console.log(this.tableData[i].duId)
                         if (!this.tableData[i].worktypeId || !this.tableData[i].duId) {
                             this.$message.warning('璇峰畬鍠勬淳閬e崟浣嶅拰宸ョ淇℃伅')
                             return
                         }
                     }
-                    let arr = JSON.parse(JSON.stringify(this.tableData))
-                    arr.forEach(item => {
-                        item.idcardNo = item.idCard
+
+                    let price = 0
+                    this.tableData.forEach(item => {
+                        price = price + item.fee
                     })
-                    this.isWorking = true
-                    if (!this.form.id) {
-                        create({
-                            applyDetailList: arr,
-                            applyStartTime: this.form.applyStartTime,
-                            applyEndTime: this.form.applyEndTime,
-                            solutionId: this.form.solutionId
-                        }).then(() => {
-                            this.visible = false
-                            this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
-                            this.$emit('success')
-                        })
-                            .catch(e => {
-                                this.$tip.apiFailed(e)
-                            })
-                            .finally(() => {
-                                this.isWorking = false
-                            })
-                    } else {
-                        updateData({
-                            id: this.form.id,
-                            applyDetailList: arr,
-                            applyStartTime: this.form.applyStartTime,
-                            applyEndTime: this.form.applyEndTime,
-                            solutionId: this.form.solutionId
-                        }).then(() => {
-                            this.visible = false
-                            this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
-                            this.$emit('success')
-                        }).catch(e => {
-                            this.$tip.apiFailed(e)
-                        })
-                        .finally(() => {
-                            this.isWorking = false
-                        })
-                    }
+                    this.$refs.detailsPolicyholder.open('鎶曚繚璇︽儏鍗�', {
+                        companyName: this.userInfo.company.name,
+                        solutionName: this.item.name,
+                        applyStartTime: this.form.applyStartTime,
+                        applyEndTime: this.form.applyEndTime,
+                        insureNum: this.tableData.length,
+                        totalPrice: price,
+                        detailList: this.tableData
+                    })
+
+                    // let arr = JSON.parse(JSON.stringify(this.tableData))
+                    // arr.forEach(item => {
+                    //     item.idcardNo = item.idCard
+                    // })
+                    // this.isWorking = true
+                    // if (!this.form.id) {
+                    //     create({
+                    //         applyDetailList: arr,
+                    //         applyStartTime: this.form.applyStartTime,
+                    //         applyEndTime: this.form.applyEndTime,
+                    //         solutionId: this.form.solutionId
+                    //     }).then(() => {
+                    //         this.visible = false
+                    //         this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+                    //         this.$emit('success')
+                    //     })
+                    //         .catch(e => {
+                    //             this.$tip.apiFailed(e)
+                    //         })
+                    //         .finally(() => {
+                    //             this.isWorking = false
+                    //         })
+                    // } else {
+                    //     updateData({
+                    //         id: this.form.id,
+                    //         applyDetailList: arr,
+                    //         applyStartTime: this.form.applyStartTime,
+                    //         applyEndTime: this.form.applyEndTime,
+                    //         solutionId: this.form.solutionId
+                    //     }).then(() => {
+                    //         this.visible = false
+                    //         this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+                    //         this.$emit('success')
+                    //     }).catch(e => {
+                    //         this.$tip.apiFailed(e)
+                    //     })
+                    //     .finally(() => {
+                    //         this.isWorking = false
+                    //     })
+                    // }
 
                 }
             })
@@ -386,7 +452,7 @@
               this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
               return
           }
-          this.$refs.importEmployees.open('涓婁紶鍚嶅崟', { arr: this.tableData, price: this.price })
+          this.$refs.importEmployees.open('涓婁紶鍚嶅崟', { arr: this.tableData, solutionId: this.form.solutionId, type: 1, price: this.price })
       },
       // 鍒囨崲鏂规
       changeSolution(e) {

--
Gitblit v1.9.3