MrShi
2024-03-08 d2bc6e096f0806b78ea92d4b90a21d3627d406c7
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
73
74
75
76
<template>
    <GlobalWindow
        :title="title"
        width="40%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-ruleForm">
            <el-form-item label="补充说明" prop="supplement">
                <el-input type="textarea" :rows="5" placeholder="请输入" v-model="form.supplement"></el-input>
            </el-form-item>
        </el-form>
    </GlobalWindow>
</template>
 
<script>
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import { supplement } from '@/api/business/settleClaims'
    export default {
        name: 'supplementaryExplanation',
        extends: BaseOpera,
        components: { GlobalWindow },
        data () {
            return {
                form: {
                    id: null,
                    supplement: ''
                },
                rules: {
                    supplement: [
                        { required: true, message: '请输入补充说明' }
                    ]
                }
            }
        },
        methods: {
            open (title, id) {
                this.title = title
                this.form.id = id
                this.form.supplement = ''
                this.visible = true
            },
            confirm() {
                this.$refs.form.validate((valid) => {
                    if (!valid) {
                        return
                    }
                    // 调用新建接口
                    this.isWorking = true
                    supplement({
                        objType: 0,
                        supplement: this.form.supplement,
                        id: this.form.id,
 
                    }).then(() => {
                        this.visible = false
                        this.$tip.apiSuccess('修改成功')
                        this.$emit('success')
                    })
                    .catch(e => {
                        this.$tip.apiFailed(e)
                    })
                    .finally(() => {
                        this.isWorking = false
                    })
                })
            }
        }
    }
</script>
 
<style lang="scss" scoped>
 
</style>