|
|
@@ -13,7 +13,7 @@
|
|
|
<a-form :form="form">
|
|
|
|
|
|
<a-form-item label="退款总金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
- <a-input v-decorator="[ 'totalRefundAmount', validatorRules.totalRefundAmount,{initialValue:0}]"
|
|
|
+ <a-input v-decorator="[ 'refundAmount', validatorRules.refundAmount,{initialValue:0}]"
|
|
|
:precision="2"
|
|
|
style="width: 100%"
|
|
|
enterButton="Search"
|
|
|
@@ -95,13 +95,13 @@
|
|
|
},
|
|
|
form: this.$form.createForm(this, {
|
|
|
onValuesChange: (props, fields) => {
|
|
|
- this.service_charge = this.accMul(fields.totalRefundAmount || 0, this.accDiv(this.serviceRate, 100)).toFixed(2)
|
|
|
- this.real_money = this.accSub(fields.totalRefundAmount || 0, this.accMul(fields.totalRefundAmount || 0, this.accDiv(this.serviceRate, 100))).toFixed(2)
|
|
|
+ this.service_charge = this.accMul(fields.refundAmount || 0, this.accDiv(this.serviceRate, 100)).toFixed(2)
|
|
|
+ this.real_money = this.accSub(fields.refundAmount || 0, this.accMul(fields.refundAmount || 0, this.accDiv(this.serviceRate, 100))).toFixed(2)
|
|
|
}
|
|
|
}),
|
|
|
disableSubmit: false,
|
|
|
validatorRules: {
|
|
|
- totalRefundAmount: {
|
|
|
+ refundAmount: {
|
|
|
rules: [{ required: true, message: '请输入充值金额!' }, {
|
|
|
validator: this.checkMoney
|
|
|
}]
|
|
|
@@ -111,7 +111,7 @@
|
|
|
companyId: 0,
|
|
|
url: {
|
|
|
add: '/hlgaccount/hlgAccount/add',
|
|
|
- edit: '/hlgaccount/hlgAccountDetail/edit'
|
|
|
+ refund: '/hlgaccount/hlgAccountDetail/refund'
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -161,6 +161,9 @@
|
|
|
// })
|
|
|
},
|
|
|
close() {
|
|
|
+ this.form.setFieldsValue({
|
|
|
+ refundAmount: ''
|
|
|
+ })
|
|
|
this.$emit('ok')
|
|
|
this.visible = false
|
|
|
},
|
|
|
@@ -169,13 +172,24 @@
|
|
|
if (!err) {
|
|
|
this.confirmLoading = true
|
|
|
this.loading = true
|
|
|
- putAction(this.url.edit, { id: this.id, isDisplay: this.isDisplay }).then(data => {
|
|
|
+ putAction(this.url.refund, {
|
|
|
+ id: this.id,
|
|
|
+ refundAmount: value.refundAmount,
|
|
|
+ isDisplay: this.isDisplay
|
|
|
+ }).then(data => {
|
|
|
this.confirmLoading = false
|
|
|
if (data.success) {
|
|
|
this.$message.info('退款成功')
|
|
|
this.close()
|
|
|
+ } else {
|
|
|
+ this.$error({
|
|
|
+ title: '退款失败',
|
|
|
+ content: data.message,
|
|
|
+ okText: '确定',
|
|
|
+ centered:true
|
|
|
+ })
|
|
|
}
|
|
|
- if (res.code === 510) {
|
|
|
+ if (data.code === 510) {
|
|
|
this.$message.warning(res.message)
|
|
|
}
|
|
|
this.loading = false
|
|
|
@@ -203,11 +217,11 @@
|
|
|
this.serviceRate = data
|
|
|
},
|
|
|
editDisplay(data) {
|
|
|
- this.isDisplay = data.target.value
|
|
|
+ this.isDisplay = data.target.value.toString()
|
|
|
},
|
|
|
inputAll() {
|
|
|
this.form.setFieldsValue({
|
|
|
- totalRefundAmount: this.model.amount - this.model.totalRefundAmount
|
|
|
+ refundAmount: this.model.amount - this.model.totalRefundAmount
|
|
|
})
|
|
|
}
|
|
|
}
|