From 09da100729793848bc01b51f7b05ca3f1e7ec64f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 20 六月 2024 14:05:35 +0800
Subject: [PATCH] 提交一把

---
 company/src/components/enterprise/factoryChange.vue |  155 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 121 insertions(+), 34 deletions(-)

diff --git a/company/src/components/enterprise/factoryChange.vue b/company/src/components/enterprise/factoryChange.vue
index cf2bfb7..a294193 100644
--- a/company/src/components/enterprise/factoryChange.vue
+++ b/company/src/components/enterprise/factoryChange.vue
@@ -2,7 +2,7 @@
     <GlobalWindow
         :title="title"
         width="100%"
-        text="鎶曚繚鐢宠"
+        text="鎵规敼鐢宠"
         :visible.sync="visible"
         :confirm-working="isWorking"
         @confirm="confirm"
@@ -16,10 +16,10 @@
                     <div style="display: flex; flex-direction: column;">
                         <el-date-picker
                             v-model="form.applyStartTime"
-                            type="datetime"
+                            type="date"
                             :picker-options="pickerOptions"
-                            value-format="yyyy-MM-dd hh:mm:ss"
-                            format="yyyy-MM-dd hh:mm:ss"
+                            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>
@@ -28,7 +28,7 @@
                 <el-form-item label="鎶曚繚骞撮緞" v-if="item">
                     <span>{{item.minAge}} 鑷� {{item.maxAge}}</span>
                 </el-form-item>
-                <el-form-item label="璐圭敤" v-if="item">
+                <el-form-item label="璐圭敤" v-if="item&& item.type==0">
                     <span>{{item.price}}鍏�</span>
                     <span v-if="item.timeUnit === 0">/澶�</span>
                     <span v-if="item.timeUnit === 1">/鍗婃湀</span>
@@ -69,15 +69,16 @@
                     align="center"
                     label="鎶曚繚浜烘暟">
                 </el-table-column>
+              <el-table-column prop="guaranteeNum"  align="center" label="鍦ㄤ繚浜烘暟" ></el-table-column>
                 <el-table-column
                     prop="serviceDays"
                     align="center"
-                    label="鍦ㄤ繚鏃堕暱锛堝ぉ锛�">
+                    label="淇濆崟鏃堕暱锛堝ぉ锛�">
                 </el-table-column>
                 <el-table-column
                     prop="currentFee"
                     align="center"
-                    label="褰撳墠璐圭敤(鍏�)">
+                    label="宸蹭骇鐢熻垂鐢�(鍏�)">
                 </el-table-column>
                 <el-table-column
                     prop="fee"
@@ -134,6 +135,14 @@
                 prop="workTypeName"
                 label="鍙樻洿鍚庢墍灞炲伐绉�">
             </el-table-column>
+          <el-table-column
+              prop="remark"
+              align="center"
+              label="澶囨敞">
+            <template slot-scope="{row}">
+              <el-input v-model="row.remark" placeholder="璇疯緭鍏�"></el-input>
+            </template>
+          </el-table-column>
             <el-table-column
                 label="鎿嶄綔">
                 <template slot-scope="scope">
@@ -142,18 +151,22 @@
             </el-table-column>
         </el-table>
         <div class="info" v-if="item">
-            <span v-if="item.specialAgreement">{{item.specialAgreement}}</span>
-            <span v-if="item.specialInfo">{{item.specialInfo}}</span>
-            <span v-if="item.ortherInfo">{{item.ortherInfo}}</span>
+          <span v-if="item.specialAgreement" v-html="item.specialAgreement"></span>
+          <span v-if="item.specialInfo" v-html="item.specialInfo"> </span>
+          <span v-if="item.ortherInfo" v-html="item.ortherInfo"> </span>
         </div>
         <!--    閫夋嫨鍛樺伐    -->
-        <selectEmployees ref="selectEmployees" @result="getValue" />
+        <selectEmployees ref="selectEmployees" @result="getValue1" />
         <!--    娣诲姞鍛樺伐    -->
         <addEmployee ref="addEmployee" @result="getValue" />
         <!--    瀵煎叆鍚嶅崟    -->
         <importEmployees ref="importEmployees" @result="getValue" />
         <!--    纭宸ョ    -->
         <confirmJobType ref="confirmJobType" @result="getUser" />
+        <!--    璇﹀崟    -->
+        <ApplyChangeUnitDetails1 ref="ApplyChangeUnitDetails1" @success="success" />
+        <!-- 鏇存柊娲鹃仯鍗曚綅璇︽儏 -->
+        <OperaApplyChangeUnitDetailWindow ref="OperaApplyChangeUnitDetailWindow" />
     </GlobalWindow>
 </template>
 
@@ -164,13 +177,16 @@
     import addEmployee from '@/components/enterprise/addEmployee'
     import importEmployees from '@/components/enterprise/importEmployees'
     import confirmJobType from '@/components/enterprise/confirmJobType'
+    import ApplyChangeUnitDetails1 from '@/components/business/ApplyChangeUnitDetails1'
+    import OperaApplyChangeUnitDetailWindow from '@/components/business/OperaApplyChangeUnitDetailWindow'
     import { all } from '@/api/business/solutions'
     import { getDetail, findList } from '@/api/business/insuranceApply'
     import { create } from '@/api/business/applyChange'
+    import { getDate, compareDates, getTomorrow } from '@/utils/util'
     export default {
         name: 'factoryChange',
         extends: BaseOpera,
-        components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType },
+        components: { GlobalWindow, OperaApplyChangeUnitDetailWindow, selectEmployees, addEmployee, importEmployees, confirmJobType, ApplyChangeUnitDetails1 },
         data () {
             return {
                 form: {
@@ -181,6 +197,7 @@
                     applyEndTime: '',
                     factory: []
                 },
+                newVersionSolutionId: '',
                 pickerOptions: {},
                 price: '',
                 endTime: '',    // 	瀹為檯淇濋櫓鐢熸晥姝㈡湡
@@ -208,6 +225,7 @@
                 this.form.addDetailList = []
                 this.form.delDetailList = []
                 this.list = []
+                this.form.factory = []
                 this.form.id = null
                 this.item = null
                 this.form.solutionId = ''
@@ -229,6 +247,27 @@
                 this.getCompany()
                 this.visible = true
                 // this.updatePickerOptions()
+            },
+            success() {
+                this.form.factory.forEach(item => {
+                    item.idcardNo = item.idCard
+                })
+                this.isWorking = true
+                create({
+                    applyId: this.form.id,
+                    changeDetailList: this.form.factory,
+                    validTime: this.form.applyStartTime,
+                    type: 1
+                }).then(res => {
+                    this.visible = false
+                    this.$refs.OperaApplyChangeUnitDetailWindow.open('鏇存崲娲鹃仯鍗曚綅璇︽儏', { applyId: this.form.id, id: res })
+                    this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+                    // this.$emit('success')
+                }).catch(e => {
+                    this.$tip.apiFailed(e)
+                }).finally(() => {
+                    this.isWorking = false
+                })
             },
             // 鑾峰彇鎶曚繚璇︽儏
             getDetails() {
@@ -252,14 +291,30 @@
                     })
                 getDetail(this.form.id)
                     .then(res => {
+                        console.log(res)
                         this.list.push(res)
                         this.endTime = res.endTime
                         this.form.solutionId = res.solutionId
+                        this.newVersionSolutionId = res.newVersionSolutionId
                         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)
@@ -291,28 +346,29 @@
                                 return
                             }
                         }
-                        this.form.factory.forEach(item => {
-                            item.idcardNo = item.idCard
-                        })
+                        this.$refs.ApplyChangeUnitDetails1.open('鏇存崲娲鹃仯鍗曚綅璇﹀崟', this.form.factory, {...this.list[0], applyStartTime: this.form.applyStartTime})
+                        // this.form.factory.forEach(item => {
+                        //     item.idcardNo = item.idCard
+                        // })
                         // let arr = JSON.parse(JSON.stringify(this.form.factory))
                         // arr.forEach(item => {
                         //     item.idcardNo = item.idCard
                         // })
-                        this.isWorking = true
-                        create({
-                            applyId: this.form.id,
-                            changeDetailList: this.form.factory,
-                            validTime: this.form.applyStartTime,
-                            type: 1
-                        }).then(() => {
-                            this.visible = false
-                            this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
-                            this.$emit('success')
-                        }).catch(e => {
-                            this.$tip.apiFailed(e)
-                        }).finally(() => {
-                            this.isWorking = false
-                        })
+                        // this.isWorking = true
+                        // create({
+                        //     applyId: this.form.id,
+                        //     changeDetailList: this.form.factory,
+                        //     validTime: this.form.applyStartTime,
+                        //     type: 1
+                        // }).then(() => {
+                        //     this.visible = false
+                        //     this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+                        //     this.$emit('success')
+                        // }).catch(e => {
+                        //     this.$tip.apiFailed(e)
+                        // }).finally(() => {
+                        //     this.isWorking = false
+                        // })
                     }
                 })
             },
@@ -321,7 +377,11 @@
                     this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
                     return
                 }
-                this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.delDetailList, price: this.price, insuranceApplyId: this.form.id })
+                if (!this.form.applyStartTime) {
+                    this.$message.warning('璇峰厛閫夋嫨鎵瑰崟鐢熸晥璧锋湡')
+                    return
+                }
+                this.$refs.selectEmployees.open('閫夊彇鍛樺伐', { arr: this.form.delDetailList, price: this.price, insuranceApplyId: this.form.id, validTime: this.form.applyStartTime })
             },
             addUser() {
                 if (!this.form.solutionId) {
@@ -376,7 +436,7 @@
                     this.$message.warning('璇烽�夋嫨鍛樺伐')
                     return
                 }
-                this.$refs.confirmJobType.open('纭宸ョ', { solutionId: this.form.solutionId })
+                this.$refs.confirmJobType.open('纭宸ョ', { solutionId: this.newVersionSolutionId })
             },
             // 鏌ヨ鍏ㄩ儴鏂规
             getCompany() {
@@ -412,6 +472,33 @@
             handleSelectionChange (e) {
                 this.seleData = e.map(item => item.memberName)
             },
+            // 閫夊彇鍛樺伐
+            getValue1 (list) {
+                let arr = JSON.parse(JSON.stringify(list))
+
+                arr.forEach(item => {
+                    item.oldDuId = item.duId
+                    item.oldDuName = item.duName
+                    item.oldWorkTypeName = item.workTypeName
+                    item.oldWorktypeId = item.worktypeId
+
+                    item.duId = ''
+                    item.duName = ''
+                    item.workTypeName = ''
+                    item.worktypeId = ''
+                })
+
+                for (let a = 0; a < arr.length; a++) {
+                    for (let b = 0; b < this.form.factory.length; b++) {
+                        if (arr[a].id === this.form.factory[b].id) {
+                            this.$message.warning(`${arr[a].companyName}鍛樺伐閲嶅锛乣)
+                            return
+                        }
+                    }
+                }
+
+                this.form.factory.push(...arr)
+            },
             getValue(list) {
                 let arr = JSON.parse(JSON.stringify(list))
 

--
Gitblit v1.9.3