k94314517
2025-05-26 da2f967549510050954682c0372927647257fb11
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
    <GlobalWindow
        :title="title"
        width="500px"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <el-form ref="form" :model="form" :rules="rules" label-width="90px" inline>
            <el-form-item label="开户银行" prop="receiveBank">
                <el-input v-model="form.receiveBank" style="width: 100%;" placeholder="请输入"></el-input>
            </el-form-item>
            <el-form-item label="账号" prop="receiveAccount">
                <el-input v-model="form.receiveAccount" placeholder="请输入"></el-input>
            </el-form-item>
            <el-form-item label="户名" prop="receiveUserName">
                <el-input v-model="form.receiveUserName" placeholder="请输入"></el-input>
            </el-form-item>
        </el-form>
    </GlobalWindow>
</template>
 
<script>
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import { updReceiveInfo } from '@/api/business/settleRisk'
    export default {
        name: 'paymentInformation',
        extends: BaseOpera,
        components: { GlobalWindow },
        data () {
            return {
                form: {
                    id: null,
                    receiveBank: '',
                    receiveAccount: '',
                    receiveUserName: ''
                },
                rules: {
                    receiveBank: [
                        { required: true, message: '不能为空', trigger: 'blur' }
                    ],
                    receiveAccount: [
                        { required: true, message: '不能为空', trigger: 'blur' }
                    ],
                    receiveUserName: [
                        { required: true, message: '不能为空', trigger: 'blur' }
                    ]
                }
            }
        },
        methods: {
            open (title, target) {
                this.title = title
                this.visible = true
                // 新建
                if (target == null) {
                    this.$nextTick(() => {
                        this.$refs.form.resetFields()
                        this.form[this.configData['field.id']] = null
                    })
                    return
                }
                // 编辑
                this.$nextTick(() => {
                    for (const key in this.form) {
                        this.form[key] = target[key]
                    }
                })
            },
            confirm() {
                this.$refs.form.validate((valid) => {
                    if (valid) {
                        this.isWorking = true
                        updReceiveInfo(this.form)
                            .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>