|  |  |  | 
|---|
|  |  |  | <GlobalWindow | 
|---|
|  |  |  | :title="title" | 
|---|
|  |  |  | width="100%" | 
|---|
|  |  |  | :text="`${type === 1 ? '完成理算' : '完成核赔'}`" | 
|---|
|  |  |  | :text="`${title === '修改金额' ? '提交' : type === 1 ? '完成理算' : '完成核赔'}`" | 
|---|
|  |  |  | :visible.sync="visible" | 
|---|
|  |  |  | :confirm-working="isWorking" | 
|---|
|  |  |  | @confirm="confirm" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <div class="box"> | 
|---|
|  |  |  | <el-form :model="form" ref="ruleForm" label-width="150px" class="demo-ruleForm"> | 
|---|
|  |  |  | <el-form :model="form" ref="form" :rules="rules" label-width="150px" class="demo-ruleForm"> | 
|---|
|  |  |  | <div class="box_item"> | 
|---|
|  |  |  | <div class="box_item_desc">主要赔付项</div> | 
|---|
|  |  |  | <div class="box_item_list"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <span>¥{{totalPrice}}</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <el-form-item label="修改说明" prop="describe" v-if="title === '修改金额'"> | 
|---|
|  |  |  | <el-input v-model="form.describe" placeholder="请输入" type="textarea" row="5"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | </el-form> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </GlobalWindow> | 
|---|
|  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import BaseOpera from '@/components/base/BaseOpera' | 
|---|
|  |  |  | import GlobalWindow from '@/components/common/GlobalWindow' | 
|---|
|  |  |  | import { compensation, getCompensation, nuclearCompensation } from '@/api/business/settleRisk' | 
|---|
|  |  |  | import { compensation, getCompensation, nuclearCompensation, updFee } from '@/api/business/settleRisk' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'acceptance', | 
|---|
|  |  |  | extends: BaseOpera, | 
|---|
|  |  |  | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | id: null | 
|---|
|  |  |  | id: null, | 
|---|
|  |  |  | describe: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | rules: { | 
|---|
|  |  |  | describe: [ | 
|---|
|  |  |  | { required: true, message: '修改说明不能为空', trigger: 'blur' } | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | type: '', | 
|---|
|  |  |  | list1: [], | 
|---|
|  |  |  | 
|---|
|  |  |  | this.type = type | 
|---|
|  |  |  | this.title = title | 
|---|
|  |  |  | this.form.id = id | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.form.resetFields(); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | getCompensation({ type, id: this.form.id }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | res.forEach(item => { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.totalPrice = price | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | confirm() { | 
|---|
|  |  |  | this.$refs.form.validate((valid) => { | 
|---|
|  |  |  | if (valid) { | 
|---|
|  |  |  | let arr = [...this.list1, ...this.list2] | 
|---|
|  |  |  | for (let i = 0; i < arr.length; i++) { | 
|---|
|  |  |  | if (!arr[i].fee && arr[i].fee !== 0) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.isWorking = true | 
|---|
|  |  |  | let compensationJson = JSON.stringify(arr) | 
|---|
|  |  |  | if (this.title === '修改金额') { | 
|---|
|  |  |  | updFee({ id: this.form.id, compensationJson, describe: this.form.describe }) | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.visible = false | 
|---|
|  |  |  | this.$tip.apiSuccess('操作成功') | 
|---|
|  |  |  | this.$emit('success') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (this.type === 1) { | 
|---|
|  |  |  | compensation({ id: this.form.id, compensationJson }) | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.isWorking = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|