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

---
 company/src/components/enterprise/OperaInsuranceApplyWindow.vue |   69 +++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 19 deletions(-)

diff --git a/company/src/components/enterprise/OperaInsuranceApplyWindow.vue b/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
index 0eaba33..9dbd1e4 100644
--- a/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
+++ b/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
@@ -26,6 +26,7 @@
                             v-model="form.applyStartTime"
                             type="date"
                             class="date_picker"
+                            :clearable="false"
                             :disabled="!form.solutionId"
                             :picker-options="pickerOptions"
                             value-format="yyyy-MM-dd HH:mm:ss"
@@ -99,7 +100,10 @@
             <el-table-column
                 label="骞撮緞">
                 <template slot-scope="{row}">
-                    <span v-if="row.idCard">{{ getAgeByIdCard(row.idCard) }}</span>
+                    <template v-if="item">
+                        <span style="color: red;" v-if="row.idCard && (getAgeByIdCard(row.idCard) < item.minAge || getAgeByIdCard(row.idCard) > item.maxAge)">{{ getAgeByIdCard(row.idCard) }}</span>
+                        <span v-else>{{ getAgeByIdCard(row.idCard) }}</span>
+                    </template>
                 </template>
             </el-table-column>
             <el-table-column
@@ -144,10 +148,10 @@
 import addEmployee from '@/components/enterprise/addEmployee'
 import importEmployees from '@/components/enterprise/importEmployees'
 import confirmJobType from '@/components/enterprise/confirmJobType'
-import { all } from '@/api/business/solutions'
+import { all, getNewVersion } from '@/api/business/solutions'
 import { create, getCountCyclePriceVO, getDetail, findList, updateData } from '@/api/business/insuranceApply'
 export default {
-  name: 'OperaInsuranceApplyWindow',
+  name: 'OperaInsuranceApplyWindow2',
   extends: BaseOpera,
   components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType },
   data () {
@@ -159,6 +163,7 @@
           applyStartTime: '',
           applyEndTime: ''
       },
+      type: '',
       pickerOptions: {}, // 瀛樻斁picker options鐨勫彉閲�
       price: '',
       company: [],
@@ -188,6 +193,9 @@
           this.tableData = []
           this.form.id = null
           this.item = null
+          if (target.type) {
+              this.type = target.type
+          }
           this.form.solutionId = ''
           this.form.applyStartTime = ''
           this.form.applyEndTime = ''
@@ -212,14 +220,21 @@
             findList({ applyId: this.form.id })
                 .then(res => {
                     res.forEach(item => {
+                        console.log(item)
                         item.idCard = item.idcardNo
                         item.fee = ''
+                        if (this.type === 1) {
+                            item.duName = ''
+                            item.duId = ''
+                            item.worktypeId = ''
+                            item.workTypeName = ''
+                        }
                     })
                     this.tableData = res
                 })
             getDetail(this.form.id)
                 .then(res => {
-                    this.form.solutionId = res.solutionId
+                    // this.form.solutionId = res.solutionId
                     this.changeSolution1(res.solutionId)
                 })
         },
@@ -248,7 +263,7 @@
             }
             this.seleData.forEach(item => {
                 this.tableData.forEach((row, index) => {
-                    if (item === row.name) {
+                    if (item === row.idCard) {
                         this.tableData.splice(index, 1)
                     }
                 })
@@ -323,7 +338,6 @@
                 this.tableData.forEach(item => {
                     item.fee = res.cyclePrice
                 })
-                console.log(this.tableData)
                 this.$forceUpdate()
             })
         },
@@ -348,7 +362,7 @@
                         return time.getTime() <= new Date(currentDate.toLocaleString()).getTime() - 8.64e7;
                     } else if (that.item.validType === 0) {
                         // 澶氬皯鏃ュ悗鐢熸晥
-                        return time.getTime() <= new Date(that.getDate(that.item.validTypeNum)).getTime();
+                        return time.getTime() <= new Date(that.getDate(that.item.validTypeNum - 1)).getTime();
                     }
                 }
             };
@@ -358,7 +372,7 @@
                 this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
                 return
             }
-            this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.tableData, price: this.price })
+            this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.tableData, price: this.price, type: 1 })
         },
       addUser() {
           if (!this.form.solutionId) {
@@ -376,7 +390,20 @@
       },
       // 鍒囨崲鏂规
       changeSolution(e) {
-          this.tableData = []
+          if (!this.form.id) {
+              this.tableData = []
+          } else {
+              this.price = ''
+              this.form.applyEndTime = ''
+              this.form.applyStartTime = ''
+              this.tableData.forEach(item => {
+                  item.fee = ''
+                  item.duName = ''
+                  item.duId = ''
+                  item.workTypeName = ''
+                  item.workTypeId = ''
+              })
+          }
           this.company.forEach(item => {
               if (item.id === e) {
                   // this.price = item.price
@@ -390,13 +417,17 @@
       },
         // 鍒囨崲鏂规
         changeSolution1(e) {
-            this.company.forEach(item => {
-                if (item.id === e) {
-                    // this.price = item.price
-                    this.item = item
-                    this.updatePickerOptions()
-                }
-            })
+            getNewVersion(e)
+                .then(res => {
+                    this.form.solutionId = res.id
+                    this.company.forEach(item => {
+                        if (item.id === res.id) {
+                            // this.price = item.price
+                            this.item = item
+                            this.updatePickerOptions()
+                        }
+                    })
+                })
             this.tableData.forEach(item => {
                 item.fee = this.price
             })
@@ -405,9 +436,9 @@
           this.tableData.splice(index, 1)
       },
       getUser(obj) {
-          this.seleData.forEach(item => {
+          this.seleData.forEach(id => {
               this.tableData.forEach(row => {
-                   if (item === row.name) {
+                   if (id === row.idCard) {
                        row.workTypeName = obj.workTypeName
                        row.worktypeId = obj.worktypeId
                        row.duName = obj.duName
@@ -462,7 +493,7 @@
           return sexAndAge.age
       },
       handleSelectionChange (e) {
-          this.seleData = e.map(item => item.name)
+          this.seleData = e.map(item => item.idCard)
       },
       getValue(list) {
           this.tableData.push(...list)

--
Gitblit v1.9.3