jiangping
2024-06-20 09da100729793848bc01b51f7b05ca3f1e7ec64f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
    <GlobalWindow
            :title="title"
            width="40%"
            :visible.sync="visible"
            :confirm-working="isWorking"
            @confirm="confirm"
    >
        <el-form ref="form" :model="form" label-width="130px">
            <el-form-item label="填写申请说明">
                <el-input type="textarea" v-model="form.remark"></el-input>
            </el-form-item>
        </el-form>
    </GlobalWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { applyChangeOpt } from '@/api/business/applyChange'
 
export default {
  name: 'add_subtract_return',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      // 表单数据
      form: {
        id: null,
        remark: ''
      }
    }
  },
  created () {
    this.config({
      api: '/business/insurance',
      'field.id': 'id'
    })
  },
  methods: {
    open (title, target) {
      this.title = title
      this.visible = true
      this.$nextTick(() => {
        this.$refs.form.resetFields()
        this.form[this.configData['field.id']] = null
      })
      this.$nextTick(() => {
        for (const key in this.form) {
          this.form[key] = target[key]
        }
      })
    },
    confirm () {
      this.isWorking = true
      applyChangeOpt({ applyId: this.form.id, optIllustration: this.form.remark, optType: 3 })
        .then(res => {
          this.visible = false
          this.$tip.apiSuccess('操作成功')
          this.$emit('success')
        })
        .catch(e => {
          this.$tip.apiFailed(e)
        })
        .finally(() => {
          this.isWorking = false
        })
    }
  }
}
</script>