jiangping
2024-02-01 d4920f7a0b3146a2218a210d3f93b655ff010eb3
company/src/components/business/OperaSettleClaimsCheckWindow.vue
@@ -6,92 +6,51 @@
        :confirm-working="isWorking"
        @confirm="confirm"
    >
            <div v-if="visible1==true" class="form">
                <div class="form_item">
                    <div class="form_item_label">
                        <span>*</span>报案号:
                    </div>
                    <div class="form_item_val">
                        <input type="text" v-model="form.reportNum" placeholder="请输入">
                    </div>
                </div>
            </div>
            <div  v-if="visible2==true" class="form">
                <div class="form_item">
                    <div class="form_item_label">
                        <span>*</span>处理进展:
                    </div>
                    <div class="form_item_val">
                        <textarea v-model="form.bizInfo" placeholder="请输入"></textarea>
                    </div>
                </div>
            </div>
            <div  v-if="visible3==true" class="form">
                <div class="form_item">
                    <div class="form_item_label">
                        <span>*</span>填写撤销说明:
                    </div>
                    <div class="form_item_val">
                        <textarea v-model="form.backInfo" placeholder="请输入"></textarea>
                    </div>
                </div>
            </div>
            <div  v-if="visible4==true" class="form">
                <div class="form_item">
                    <div class="form_item_label">
                        <span>*</span>结案内容:
                    </div>
                    <div class="form_item_val">
                        <textarea v-model="form.doneInfo" placeholder="请输入"></textarea>
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label">
                         医疗理赔:
                    </div>
                    <div class="form_item_val">
                        <input v-model="form.ylClaimAccount" placeholder="请输入" />
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label">
                        误工理赔:
                    </div>
                    <div class="form_item_val">
                        <input v-model="form.wgClaimAccount" placeholder="请输入" />
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label">
                        伤残理赔:
                    </div>
                    <div class="form_item_val">
                        <input v-model="form.scClaimAccount" placeholder="请输入" />
                    </div>
                </div>
                <div class="form_item">
                    <div class="form_item_label">
                         死亡理赔:
                    </div>
                    <div class="form_item_val">
                        <input v-model="form.swClaimAccount" placeholder="请输入" />
                    </div>
                </div>
            </div>
              <el-form v-if="visible1==true" :model="form" ref="form1" :rules="rules1" style="width: 100%;">
                <el-form-item label="报案号:" prop="reportNum">
                  <el-input v-model="form.reportNum" placeholder="请输入" v-trim/>
                </el-form-item>
              </el-form>
              <el-form v-if="visible2==true" :model="form" ref="form2" :rules="rules2" style="width: 100%;">
                <el-form-item label="处理进展:" prop="bizInfo">
                  <el-input type="textarea" v-model="form.bizInfo" placeholder="请输入" v-trim/>
                </el-form-item>
              </el-form>
              <el-form v-if="visible3==true" :model="form" ref="form3" :rules="rules3" style="width: 100%;">
                <el-form-item label="撤销说明:" prop="backInfo">
                  <el-input type="textarea" v-model="form.backInfo" placeholder="请输入" v-trim/>
                </el-form-item>
              </el-form>
              <el-form v-if="visible4==true" :model="form" ref="form4" :rules="rules4" style="width: 100%;">
                <el-form-item label="结案内容:" prop="doneInfo">
                  <el-input type="textarea" v-model="form.doneInfo" @change="changeAccount" placeholder="请输入" v-trim/>
                </el-form-item>
                <el-form-item label="医疗理赔(元):" prop="ylClaimAccount">
                  <el-input type="number" v-model="form.ylClaimAccount"  @change="changeAccount" placeholder="请输入" v-trim/>
                </el-form-item>
                <el-form-item label="误工理赔(元):" prop="wgClaimAccount">
                  <el-input type="number" v-model="form.wgClaimAccount" @change="changeAccount"  placeholder="请输入" v-trim/>
                </el-form-item>
                <el-form-item label="伤残理赔(元):" prop="scClaimAccount">
                  <el-input type="number" v-model="form.scClaimAccount" @change="changeAccount"  placeholder="请输入" v-trim/>
                </el-form-item>
                <el-form-item label="死亡理赔(元):" prop="swClaimAccount">
                  <el-input type="number" v-model="form.swClaimAccount"  @change="changeAccount"  placeholder="请输入" v-trim/>
                </el-form-item>
                <el-form-item label="总金额:"  >
                  <el-input type="number" readonly v-model="form.totalAccount" placeholder="请输入" v-trim/>
                </el-form-item>
              </el-form>
            <div v-if="visible5 ==true"  class="form">
                <div class="form_span" v-for="(item,index) in remarkLogList" :key="index">
                    <span>理赔员-{{ item.creatorName }} {{item.createDate }}</span>
                    <span>{{item.content }}</span>
                </div>
                <div class="form_item">
                    <div class="form_item_label">
                        <span>*</span>填写备注标签:
                    </div>
                    <div class="form_item_val">
                        <textarea v-model="form.remarkInfo" placeholder="请输入"></textarea>
                    </div>
                </div>
                <el-form :model="form" ref="form5" :rules="rules5" style="width: 100%;">
                  <el-form-item label="填写备注标签:" prop="remarkInfo">
                    <el-input type="textarea" v-model="form.remarkInfo" placeholder="请输入" v-trim/>
                  </el-form-item>
                </el-form>
            </div>
      <template v-slot:footer>
        <el-button type="primary" @click="doSubmit">确定</el-button>
@@ -101,155 +60,220 @@
</template>
<script>
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import {addCode, back, dealBiz,doneCommit, remark} from "@/api/business/settleClaims";
    export default {
        name: 'OperaSettleClaimsCheckWindow',
        extends: BaseOpera,
        components: { GlobalWindow },
        data () {
            return {
              remarkLogList:[],
              type:0,
                // 表单数据
              form: {
                id: null,
                checkInfo: null,
                bizInfo: null,
                doneInfo: null,
                backInfo: null,
                remarkInfo: null,
                ylClaimAccount: null,
                wgClaimAccount: null,
                swClaimAccount: null,
                scClaimAccount: null,
                reportNum: null,
              },
              model:{},
                activeName: 'first',
                reverse: true,
                tableData: [],
                visible1: false,
                visible2: false,
                visible3: false,
                visible4: false,
                visible5: false
            }
        },
        created () {
            this.config({
                api: '/business/settleClaims',
                'field.id': 'id'
            })
        },
        methods: {
          open(title,target,target1,type){
            this.model ={}
            this.model = target
            this.title=title
            this.visible=true
            this.type=type
            this.remarkLogList= target1
            this.visible1=false,
            this.visible2= false,
            this.visible3=false,
            this. visible4= false,
            this. visible5= false
            this.form=target
            this. form= {
              id: null,
               checkInfo: null,
              doneInfo: null,
              remarkInfo: null,
              bizInfo: null,
              backInfo: null,
              ylClaimAccount: null,
              wgClaimAccount: null,
              swClaimAccount: null,
              scClaimAccount: null,
               reportNum: null,
            }
            if(type==1){
              this.visible1=true
            }
            if(type==2){
              this.visible2=true
            }
            if(type==3){
              this.visible3=true
            }
            if(type==4){
              this.visible4=true
            }
            if(type==5){
              this.visible5=true
            }
       },
            doSubmit(type) {
              var that =this
              if(this.type ===5){
                // this.isWorking = true
                remark({id:that.model.id,checkInfo:that.form.remarkInfo})
                    .then(response => {
                      this.visible=false
                      this.$emit('success')
                    }).catch(err => {
                  this.$tip.apiFailed(err)
                })
              }else if(this.type === 4){
                // this.isWorking = true
                doneCommit({id: that.model.id, checkInfo: that.form.doneInfo,
                  ylClaimAccount: that.form.ylClaimAccount,
                  wgClaimAccount: that.form.wgClaimAccount,
                  swClaimAccount: that.form.swClaimAccount,
                  scClaimAccount: that.form.scClaimAccount})
                    .then(response => {
                      this.visible=false
                      this.$emit('success')
                    }).catch(err => {
                  this.$tip.apiFailed(err)
                })
              }else if(this.type===2){
                //理赔处理
                dealBiz({ id: that.model.id, checkInfo:that.form.bizInfo })
                    .then(response => {
                      this.visible=false
                      this.$emit('success')
                    }).catch(err => {
                  console.log(err)
                  this.$tip.apiFailed(err)
                }).finally(() => {
                  this.isWorking = false
                })
              }else if(this.type===3){
                //理赔处理
                back({ id: that.model.id, checkInfo:that.form.backInfo })
                    .then(response => {
                      this.visible=false
                      this.$emit('success')
                    }).catch(err => {
                  console.log(err)
                  this.$tip.apiFailed(err)
                }).finally(() => {
                  this.isWorking = false
                })
              }else if(this.type===1){
                //添加备案号
                addCode({ id: that.model.id, reportNum:that.form.reportNum })
                    .then(response => {
                      this.visible=false
                      this.$emit('success')
                    }).catch(err => {
                      console.log(err)
                      this.$tip.apiFailed(err)
                    }).finally(() => {
                      this.isWorking = false
                    })
              }
            }
        }
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { addCode, back, dealBiz, doneCommit, remark } from '@/api/business/settleClaims'
export default {
  name: 'OperaSettleClaimsCheckWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      remarkLogList: [],
      type: 0,
      // 表单数据
      form: {
        id: null,
        checkInfo: null,
        bizInfo: null,
        doneInfo: null,
        backInfo: null,
        remarkInfo: null,
        ylClaimAccount: 0,
        wgClaimAccount: 0,
        swClaimAccount: 0,
        scClaimAccount: 0,
        reportNum: null,
        totalAccount:0
      },
      model: {},
      activeName: 'first',
      reverse: true,
      tableData: [],
      visible1: false,
      visible2: false,
      visible3: false,
      visible4: false,
      visible5: false,
      rules1: {
        reportNum: [
          { required: true, message: '请输入' }
        ]
      },
      rules2: {
        bizInfo: [
          { required: true, message: '请输入' }
        ]
      },
      rules3: {
        backInfo: [
          { required: true, message: '请输入' }
        ]
      },
      rules5: {
        remarkInfo: [
          { required: true, message: '请输入' }
        ]
      },
      rules4: {
        doneInfo: [
          { required: true, message: '请输入' }
        ]
      }
    }
  },
  created () {
    this.config({
      api: '/business/settleClaims',
      'field.id': 'id'
    })
  },
  methods: {
    open (title, target, target1, type) {
      this.model = {}
      this.model = target
      this.title = title
      this.visible = true
      this.type = type
      this.remarkLogList = target1
      this.visible1 = false,
      this.visible2 = false,
      this.visible3 = false,
      this.visible4 = false,
      this.visible5 = false
      this.form = target
      this.form = {
        id: null,
        checkInfo: null,
        doneInfo: null,
        remarkInfo: null,
        bizInfo: null,
        backInfo: null,
        ylClaimAccount: 0,
        wgClaimAccount: 0,
        swClaimAccount: 0,
        scClaimAccount: 0,
        reportNum: null,
        totalAccount:0
      }
      if (type == 1) {
        this.visible1 = true
      }
      if (type == 2) {
        this.visible2 = true
      }
      if (type == 3) {
        this.visible3 = true
      }
      if (type == 4) {
        this.visible4 = true
      }
      if (type == 5) {
        this.visible5 = true
      }
    },
     changeAccount(){
       this.form.swClaimAccount = parseFloat(this.form.swClaimAccount).toFixed(2)
       this.form.scClaimAccount = parseFloat(this.form.scClaimAccount).toFixed(2)
       this.form.wgClaimAccount = parseFloat(this.form.wgClaimAccount).toFixed(2)
       this.form.ylClaimAccount = parseFloat(this.form.ylClaimAccount).toFixed(2)
      this.form.totalAccount = parseFloat( this.form.scClaimAccount || 0) + parseFloat( this.form.swClaimAccount || 0)
         + parseFloat( this.form.wgClaimAccount|| 0)
         + parseFloat( this.form.ylClaimAccount|| 0)
     },
    doSubmit (type) {
      var that = this
      if (this.type === 5) {
        this.$refs.form5.validate((valid) => {
          // debugger
          if (!valid) {
            return
          }
          remark({ id: that.model.id, checkInfo: that.form.remarkInfo })
            .then(response => {
              this.visible = false
              this.$emit('success')
            }).catch(err => {
              this.$tip.apiFailed(err)
            })
        })
      } else if (this.type === 4) {
        this.$refs.form4.validate((valid) => {
          // debugger
          if (!valid) {
            return
          }
          doneCommit({
            id: that.model.id,
            checkInfo: that.form.doneInfo,
            ylClaimAccount: that.form.ylClaimAccount,
            wgClaimAccount: that.form.wgClaimAccount,
            swClaimAccount: that.form.swClaimAccount,
            scClaimAccount: that.form.scClaimAccount
          }).then(response => {
            this.visible = false
            this.$emit('success')
          }).catch(err => {
            this.$tip.apiFailed(err)
          })
        })
      } else if (this.type === 2) {
        this.$refs.form2.validate((valid) => {
          // debugger
          if (!valid) {
            return
          }
          // 理赔处理
          dealBiz({ id: that.model.id, checkInfo: that.form.bizInfo })
            .then(response => {
              this.visible = false
              this.$emit('success')
            }).catch(err => {
              console.log(err)
              this.$tip.apiFailed(err)
            }).finally(() => {
              this.isWorking = false
            })
        })
      } else if (this.type === 3) {
        this.$refs.form3.validate((valid) => {
          // debugger
          if (!valid) {
            return
          }
          back({ id: that.model.id, checkInfo: that.form.backInfo })
            .then(response => {
              this.visible = false
              this.$emit('success')
            }).catch(err => {
              console.log(err)
              this.$tip.apiFailed(err)
            }).finally(() => {
              this.isWorking = false
            })
        })
      } else if (this.type === 1) {
        // 添加备案号
        this.$refs.form1.validate((valid) => {
          // debugger
          if (!valid) {
            return
          }
          addCode({ id: that.model.id, reportNum: that.form.reportNum })
            .then(response => {
              this.visible = false
              this.$emit('success')
            }).catch(err => {
              console.log(err)
              this.$tip.apiFailed(err)
            }).finally(() => {
              this.isWorking = false
            })
        })
      }
    }
  }
}
</script>
<style>
    .v-modal {