|  |  |  | 
|---|
|  |  |  | import importEmployees from '@/components/enterprise/importEmployees' | 
|---|
|  |  |  | import confirmJobType from '@/components/enterprise/confirmJobType' | 
|---|
|  |  |  | import { all } from '@/api/business/solutions' | 
|---|
|  |  |  | import { create, getCountCyclePriceVO } from '@/api/business/insuranceApply' | 
|---|
|  |  |  | import { create, getCountCyclePriceVO, getDetail, findList, updateData } from '@/api/business/insuranceApply' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'OperaInsuranceApplyWindow', | 
|---|
|  |  |  | extends: BaseOpera, | 
|---|
|  |  |  | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | id: null, | 
|---|
|  |  |  | ID: null, | 
|---|
|  |  |  | solutionId: '', | 
|---|
|  |  |  | applyStartTime: '', | 
|---|
|  |  |  | applyEndTime: '' | 
|---|
|  |  |  | 
|---|
|  |  |  | this.form.solutionId = '' | 
|---|
|  |  |  | this.form.applyStartTime = '' | 
|---|
|  |  |  | this.form.applyEndTime = '' | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.form.resetFields() | 
|---|
|  |  |  | this.form[this.configData['field.id']] = null | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.visible = true | 
|---|
|  |  |  | if (target && target.id) { | 
|---|
|  |  |  | this.form.id = target.id | 
|---|
|  |  |  | this.getDetails() | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.form.resetFields() | 
|---|
|  |  |  | this.form[this.configData['field.id']] = null | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.getCompany() | 
|---|
|  |  |  | this.visible = true | 
|---|
|  |  |  | this.updatePickerOptions() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 获取投保详情 | 
|---|
|  |  |  | getDetails() { | 
|---|
|  |  |  | findList({ applyId: this.form.id }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | res.forEach(item => { | 
|---|
|  |  |  | item.idCard = item.idcardNo | 
|---|
|  |  |  | item.fee = '' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.tableData = res | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | getDetail(this.form.id) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.form.solutionId = res.solutionId | 
|---|
|  |  |  | this.changeSolution1(res.solutionId) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getSummaries(param) { | 
|---|
|  |  |  | const { columns, data } = param | 
|---|
|  |  |  | const sums = [] | 
|---|
|  |  |  | 
|---|
|  |  |  | item.idcardNo = item.idCard | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.isWorking = true | 
|---|
|  |  |  | create({ | 
|---|
|  |  |  | applyDetailList: arr, | 
|---|
|  |  |  | applyStartTime: this.form.applyStartTime, | 
|---|
|  |  |  | applyEndTime: this.form.applyEndTime, | 
|---|
|  |  |  | solutionId: this.form.solutionId | 
|---|
|  |  |  | }).then(() => { | 
|---|
|  |  |  | this.visible = false | 
|---|
|  |  |  | this.$tip.apiSuccess('操作成功') | 
|---|
|  |  |  | this.$emit('success') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if (!this.form.id) { | 
|---|
|  |  |  | create({ | 
|---|
|  |  |  | applyDetailList: arr, | 
|---|
|  |  |  | applyStartTime: this.form.applyStartTime, | 
|---|
|  |  |  | applyEndTime: this.form.applyEndTime, | 
|---|
|  |  |  | solutionId: this.form.solutionId | 
|---|
|  |  |  | }).then(() => { | 
|---|
|  |  |  | this.visible = false | 
|---|
|  |  |  | this.$tip.apiSuccess('操作成功') | 
|---|
|  |  |  | this.$emit('success') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | updateData({ | 
|---|
|  |  |  | id: this.form.id, | 
|---|
|  |  |  | applyDetailList: arr, | 
|---|
|  |  |  | applyStartTime: this.form.applyStartTime, | 
|---|
|  |  |  | applyEndTime: this.form.applyEndTime, | 
|---|
|  |  |  | solutionId: this.form.solutionId | 
|---|
|  |  |  | }).then(() => { | 
|---|
|  |  |  | this.visible = false | 
|---|
|  |  |  | this.$tip.apiSuccess('操作成功') | 
|---|
|  |  |  | this.$emit('success') | 
|---|
|  |  |  | }).catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 切换方案 | 
|---|
|  |  |  | changeSolution(e) { | 
|---|
|  |  |  | this.tableData = [] | 
|---|
|  |  |  | this.company.forEach(item => { | 
|---|
|  |  |  | if (item.id === e) { | 
|---|
|  |  |  | // this.price = item.price | 
|---|
|  |  |  | 
|---|
|  |  |  | item.fee = this.price | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 切换方案 | 
|---|
|  |  |  | changeSolution1(e) { | 
|---|
|  |  |  | this.company.forEach(item => { | 
|---|
|  |  |  | if (item.id === e) { | 
|---|
|  |  |  | // this.price = item.price | 
|---|
|  |  |  | this.item = item | 
|---|
|  |  |  | this.updatePickerOptions() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.tableData.forEach(item => { | 
|---|
|  |  |  | item.fee = this.price | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | dele(index) { | 
|---|
|  |  |  | this.tableData.splice(index, 1) | 
|---|
|  |  |  | }, | 
|---|