From 6f1ad9bcb73a415f1d45f1adc6bdeb3e80ddf95f Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 05 三月 2024 09:33:39 +0800
Subject: [PATCH] mrshi

---
 company/src/components/enterprise/additionSubtractionApplication.vue |   58 ++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 38 insertions(+), 20 deletions(-)

diff --git a/company/src/components/enterprise/additionSubtractionApplication.vue b/company/src/components/enterprise/additionSubtractionApplication.vue
index 2d369a8..1702884 100644
--- a/company/src/components/enterprise/additionSubtractionApplication.vue
+++ b/company/src/components/enterprise/additionSubtractionApplication.vue
@@ -19,8 +19,8 @@
                             v-model="form.applyStartTime"
                             type="date"
                             :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>
@@ -78,7 +78,7 @@
                 <el-table-column
                     prop="currentFee"
                     align="center"
-                    label="褰撳墠璐圭敤(鍏�)">
+                    label="宸蹭骇鐢熻垂鐢�(鍏�)">
                 </el-table-column>
                 <el-table-column
                     prop="fee"
@@ -148,7 +148,7 @@
                 label="璐圭敤">
                 <template slot-scope="{row}">
                     <span v-if="activeName === '0'">{{row.fee}}</span>
-                    <span v-else>-{{row.fee}}</span>
+                    <span v-else>{{row.fee ? '-' + row.fee : ''}}</span>
                 </template>
             </el-table-column>
             <el-table-column
@@ -183,7 +183,8 @@
     import confirmJobType from '@/components/enterprise/confirmJobType'
     import { all } from '@/api/business/solutions'
     import { getDetail } from '@/api/business/insuranceApply'
-    import { create, getChangeCountCyclePriceVO, applyChagneDetailList } from '@/api/business/applyChange'
+    import { create, getChangeCountCyclePriceVO } from '@/api/business/applyChange'
+    import { getDate, compareDates, getTomorrow } from '@/utils/util'
     export default {
         name: 'additionSubtractionApplication',
         extends: BaseOpera,
@@ -266,11 +267,6 @@
             handleClick(e) {
                 this.activeName = e.index
             },
-            getApplyChagneDetailList() {
-                applyChagneDetailList({
-
-                })
-            },
             // 鑾峰彇鎶曚繚璇︽儏
             getDetails() {
                 // findList({ applyId: this.form.id })
@@ -284,16 +280,31 @@
                 getDetail(this.form.id)
                     .then(res => {
                         this.list.push(res)
+                        this.item = res
                         this.endTime = res.endTime
                         this.form.solutionId = res.solutionId
                         this.form.solutionsName = res.solutionsName
                         this.pickerOptions = {
                             disabledDate(time) {
-                                // - 8.64e7
-                                return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date().getTime()
+                                // 褰撳墠鏃ユ湡澶т簬绛変簬鐢熸晥鏃ユ湡骞朵笖鏈�鍚庝竴娆℃搷浣滄椂闂寸瓑浜庣┖
+                                if ([1,3].includes(compareDates(getDate(), res.startTime)) && !res.lastChangeDate) {
+                                    return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(getTomorrow()).getTime()
+                                // 褰撳墠鏃ユ湡灏忎簬鐢熸晥鏃ユ湡骞朵笖鏈�鍚庝竴娆℃搷浣滄椂闂寸瓑浜庣┖
+                                } else if (compareDates(getDate(), res.startTime) === 2 && !res.lastChangeDate) {
+                                    return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(res.startTime).getTime()
+                                // 鏈�鍚庝竴娆℃搷浣滄椂闂存湁鍊�
+                                } else if (res.lastChangeDate) {
+                                    // 褰撳墠鏃ユ湡澶т簬鏈�鍚庝竴娆℃搷浣滄椂闂�
+                                    if ([1,3].includes(compareDates(getDate(), res.lastChangeDate))) {
+                                        return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(getTomorrow()).getTime()
+                                    // 褰撳墠鏃堕棿灏忎簬鏈�鍚庝竴娆℃搷浣滄椂闂�
+                                    } else if (compareDates(getDate(), res.lastChangeDate) === 2) {
+                                        return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(res.lastChangeDate).getTime()
+                                    }
+                                }
                             }
                         };
-                        this.changeSolution1(res.solutionId)
+                        // this.changeSolution1(res.solutionId)
                     })
             },
             getSummaries(param) {
@@ -309,13 +320,15 @@
                             this.form.addDetailList.forEach(item => {
                                 total += item.fee
                             })
+                            sums[index] = total
+                            return
                         } else {
                             this.form.delDetailList.forEach(item => {
                                 total += item.fee
                             })
+                            sums[index] = '-' + total
+                            return
                         }
-                        sums[index] = '-' + total
-                        return
                     }
                 })
                 return sums
@@ -396,10 +409,14 @@
                     this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
                     return
                 }
+                if (!this.form.applyStartTime) {
+                    this.$message.warning('璇峰厛閫夋嫨鎵瑰崟鐢熸晥璧锋湡')
+                    return
+                }
                 if (this.activeName === '0') {
-                    this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.addDetailList, price: this.price, notInInsuranceApplyId: this.form.id })
+                    this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.addDetailList, price: this.price, notInInsuranceApplyId: this.form.id, validTime: this.form.applyStartTime })
                 } else {
-                    this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.delDetailList, price: this.price, insuranceApplyId: this.form.id })
+                    this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.delDetailList, price: this.price, insuranceApplyId: this.form.id, validTime: this.form.applyStartTime })
                 }
             },
             addUser() {
@@ -427,7 +444,9 @@
             // 鍒囨崲鏂规
             changeSolution1(e) {
                 this.company.forEach(item => {
+                    console.log(item.id + '-----' + e)
                     if (item.id === e) {
+                        console.log(item)
                         this.item = item
                     }
                 })
@@ -477,11 +496,11 @@
                     this.$message.warning('璇烽�夋嫨鍛樺伐')
                     return
                 }
-                this.$refs.confirmJobType.open('纭宸ョ', { solutionId: this.form.solutionId })
+                this.$refs.confirmJobType.open('纭宸ョ', { solutionId: this.item.newVersionSolutionId })
             },
             // 鏌ヨ鍏ㄩ儴鏂规
             getCompany() {
-                all({})
+                all({ dataType: 2 })
                     .then(res => {
                         this.company = res
                     })
@@ -514,7 +533,6 @@
                 this.seleData = e.map(item => item.name)
             },
             getValue(list) {
-                console.log(list)
                 if (this.activeName === '0') {
                     this.form.addDetailList.push(...list)
                 } else {

--
Gitblit v1.9.3