| | |
| | | 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> |
| | |
| | | <el-table-column |
| | | prop="currentFee" |
| | | align="center" |
| | | label="当前费用(元)"> |
| | | label="已产生费用(元)"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="fee" |
| | |
| | | <span v-if="item.ortherInfo">{{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" /> |
| | | </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 { 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, selectEmployees, addEmployee, importEmployees, confirmJobType, ApplyChangeUnitDetails1 }, |
| | | data () { |
| | | return { |
| | | form: { |
| | |
| | | applyEndTime: '', |
| | | factory: [] |
| | | }, |
| | | newVersionSolutionId: '', |
| | | pickerOptions: {}, |
| | | price: '', |
| | | endTime: '', // 实际保险生效止期 |
| | |
| | | this.form.addDetailList = [] |
| | | this.form.delDetailList = [] |
| | | this.list = [] |
| | | this.form.factory = [] |
| | | this.form.id = null |
| | | this.item = null |
| | | this.form.solutionId = '' |
| | |
| | | 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(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('操作成功') |
| | | this.$emit('success') |
| | | }).catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }).finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }, |
| | | // 获取投保详情 |
| | | getDetails() { |
| | |
| | | }) |
| | | 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) |
| | |
| | | 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 |
| | | // }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | 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) { |
| | |
| | | this.$message.warning('请选择员工') |
| | | return |
| | | } |
| | | this.$refs.confirmJobType.open('确认工种', { solutionId: this.form.solutionId }) |
| | | this.$refs.confirmJobType.open('确认工种', { solutionId: this.newVersionSolutionId }) |
| | | }, |
| | | // 查询全部方案 |
| | | getCompany() { |
| | |
| | | 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)) |
| | | |
| | | |
| | | arr.forEach(item => { |
| | | item.oldDuId = item.duId |
| | | item.oldDuName = item.duName |