|  |  | 
 |  |  |     <GlobalWindow | 
 |  |  |         :title="title" | 
 |  |  |         width="100%" | 
 |  |  |         text="投保申请" | 
 |  |  |         text="批改申请" | 
 |  |  |         :visible.sync="visible" | 
 |  |  |         :confirm-working="isWorking" | 
 |  |  |         @confirm="confirm" | 
 |  |  | 
 |  |  |                 <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> | 
 |  |  | 
 |  |  |                 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"> | 
 |  |  | 
 |  |  |             </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="getValue1" /> | 
 |  |  | 
 |  |  |         <importEmployees ref="importEmployees" @result="getValue" /> | 
 |  |  |         <!--    确认工种    --> | 
 |  |  |         <confirmJobType ref="confirmJobType" @result="getUser" /> | 
 |  |  |         <!--    详单    --> | 
 |  |  |         <ApplyChangeUnitDetails1 ref="ApplyChangeUnitDetails1" @success="success" /> | 
 |  |  |         <!-- 更新派遣单位详情 --> | 
 |  |  |         <OperaApplyChangeUnitDetailWindow ref="OperaApplyChangeUnitDetailWindow" /> | 
 |  |  |     </GlobalWindow> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | 
 |  |  |     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: { | 
 |  |  | 
 |  |  |                 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() { | 
 |  |  |                 findList({ applyId: this.form.id }) | 
 |  |  | 
 |  |  |                         this.form.solutionsName = res.solutionsName | 
 |  |  |                         this.pickerOptions = { | 
 |  |  |                             disabledDate(time) { | 
 |  |  |                                 // - 8.64e7 | 
 |  |  |                                 return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(res.lastChangeDate ? res.lastChangeDate : res.startTime).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) | 
 |  |  | 
 |  |  |                                 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 | 
 |  |  |                         // }) | 
 |  |  |                     } | 
 |  |  |                 }) | 
 |  |  |             }, |