EditPayReceive.vue
2.19 KB
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
<template>
<d2-dialog title="提示" :is-visible="payReceiveVisible" class="privacyDailog" width="500px" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px" :isBlock="isBlock" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
</glsx-combi-form>
</d2-dialog>
</template>
<script>
import { createPaymentBill } from '@api/accountManage'
import { Util, deepClone } from '@/common/util'
export default {
name: 'EditPayReceive',
data() {
return {
isBlock: true,
editChildRef: 'editChildRef',
formRules: {
splitExpense: [{ required: true, message: "请选择拆分成本与流量费" }]
},
editData: {
splitExpense: ''
},
editFormData: [
{
label: "请选择拆分成本与流量费",
name: "splitExpense",
type: "radio",
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'optList'
}
],
baseData: {
optList: [{
confId: true,
confLabel: '拆分'
}, {
confId: false,
confLabel: '不拆分'
}]
}
}
},
props: {
payReceiveVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: () => ({})
}
},
mounted() {
this.editFormData[0].optionList = deepClone(this.baseData.optList)
},
methods: {
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
const params = {
id: this.info.id,
splitExpense: this.editData.splitExpense
}
this.loading = true
createPaymentBill(params).then(() => {
this.$message.success("操作成功")
this.$emit('handleConfirm')
}).finally(() => {
this.loading = false
})
}
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style>
.privacyDailog .el-dialog {
min-width: 700px;
}
</style>