From 1e72942aa4848ae4835e7f30bb4adc01f9ce5bdc Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 23 二月 2024 11:45:58 +0800
Subject: [PATCH] mrshi

---
 company/src/components/enterprise/OperaInsuranceApplyWindow.vue |   82 ++++++++++++++++++++++++++++------------
 1 files changed, 57 insertions(+), 25 deletions(-)

diff --git a/company/src/components/enterprise/OperaInsuranceApplyWindow.vue b/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
index d31b415..ab34c40 100644
--- a/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
+++ b/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
@@ -25,10 +25,12 @@
                             @change="getTimeVal"
                             v-model="form.applyStartTime"
                             type="date"
+                            class="date_picker"
+                            :clearable="false"
                             :disabled="!form.solutionId"
                             :picker-options="pickerOptions"
-                            value-format="yyyy-MM-dd"
-                            format="yyyy 骞� MM 鏈� dd 鏃�"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            format="yyyy-MM-dd HH:mm:ss"
                             placeholder="閫夋嫨鏃ユ湡">
                         </el-date-picker>
                         <span style="color: #F95601; font-size: 14px;">锛堟鏃ョ敓鏁堟姇淇濊浜�17:30鍓嶆彁浜わ紝瓒呮椂鎻愪氦浠ヤ繚闄╁崟涓哄噯锛�</span>
@@ -39,8 +41,10 @@
                         disabled
                         v-model="form.applyEndTime"
                         type="date"
-                        value-format="yyyy-MM-dd"
-                        format="yyyy 骞� MM 鏈� dd 鏃�"
+                        class="date_picker"
+                        :picker-options="pickerOptions"
+                        value-format="yyyy-MM-dd HH:mm:ss"
+                        format="yyyy-MM-dd HH:mm:ss"
                         placeholder="閫夋嫨鏃ユ湡">
                     </el-date-picker>
                 </el-form-item>
@@ -96,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
@@ -141,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 () {
@@ -189,8 +196,11 @@
           this.form.applyStartTime = ''
           this.form.applyEndTime = ''
           if (target && target.id) {
-              this.form.id = target.id
-              this.getDetails()
+              this.$nextTick(() => {
+                  this.$refs.form.resetFields()
+                  this.form.id = target.id
+                  this.getDetails()
+              })
           } else {
               this.$nextTick(() => {
                   this.$refs.form.resetFields()
@@ -213,7 +223,7 @@
                 })
             getDetail(this.form.id)
                 .then(res => {
-                    this.form.solutionId = res.solutionId
+                    // this.form.solutionId = res.solutionId
                     this.changeSolution1(res.solutionId)
                 })
         },
@@ -313,11 +323,10 @@
                 startDate: time
             }).then(res => {
                 this.price = res.cyclePrice
-                this.form.applyEndTime = res.endDate.substring(0, 10)
+                this.form.applyEndTime = res.endDate
                 this.tableData.forEach(item => {
                     item.fee = res.cyclePrice
                 })
-                console.log(this.tableData)
                 this.$forceUpdate()
             })
         },
@@ -342,7 +351,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();
                     }
                 }
             };
@@ -352,7 +361,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) {
@@ -370,7 +379,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
@@ -384,13 +406,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
             })
@@ -399,9 +425,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.id) {
                        row.workTypeName = obj.workTypeName
                        row.worktypeId = obj.worktypeId
                        row.duName = obj.duName
@@ -456,7 +482,7 @@
           return sexAndAge.age
       },
       handleSelectionChange (e) {
-          this.seleData = e.map(item => item.name)
+          this.seleData = e.map(item => item.id)
       },
       getValue(list) {
           this.tableData.push(...list)
@@ -465,6 +491,12 @@
 }
 </script>
 
+<style>
+    .el-picker-panel__footer .el-button--text.el-picker-panel__link-btn {
+        display: none;
+    }
+</style>
+
 <style lang="scss" scoped>
     .list {
         width: 100%;

--
Gitblit v1.9.3