|
@@ -55,7 +55,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
-import { rechargeRuleDetail, rechargeRuleCreate } from '@/api/rechargeRule'
|
|
|
+import { rechargeRuleDetail, rechargeRuleCreate, rechargeRuleModify } from '@/api/rechargeRule'
|
|
|
export default {
|
|
|
name: 'RechargeEditModal',
|
|
|
mixins: [commonMixin],
|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
form: {
|
|
|
rechargeAmount: undefined, // 充值金额
|
|
|
giveAmount: undefined, // 赠送金额
|
|
|
- remark: undefined// 备注
|
|
|
+ remarks: undefined// 备注
|
|
|
},
|
|
|
// 必填项判断
|
|
|
rules: {
|
|
@@ -96,11 +96,12 @@ export default {
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
if (!_this.form.giveAmount) {
|
|
|
- _this.$message.waining('请输入赠送金额')
|
|
|
+ _this.$message.warning('请输入赠送金额')
|
|
|
return
|
|
|
}
|
|
|
_this.spinning = true
|
|
|
- rechargeRuleCreate(_this.form).then(res => {
|
|
|
+ const ajaxName = _this.itemSn ? rechargeRuleModify : rechargeRuleCreate
|
|
|
+ ajaxName(_this.form).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$emit('ok')
|
|
@@ -118,7 +119,7 @@ export default {
|
|
|
// 获取详情
|
|
|
getDetail () {
|
|
|
const _this = this
|
|
|
- _this.spinning = false
|
|
|
+ _this.spinning = true
|
|
|
rechargeRuleDetail({ sn: _this.itemSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.form = res.data
|
|
@@ -130,7 +131,7 @@ export default {
|
|
|
resetForm (obj) {
|
|
|
this.form.rechargeAmount = undefined
|
|
|
this.form.giveAmount = undefined
|
|
|
- this.form.remark = undefined
|
|
|
+ this.form.remarks = undefined
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
}
|
|
|
},
|
|
@@ -147,7 +148,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
itemSn (newValue, oldValue) {
|
|
|
- if (this.isShow && newValue) {
|
|
|
+ if (newValue) {
|
|
|
this.getDetail()
|
|
|
}
|
|
|
}
|