Commit 4fd138a0 by cwq0219

商户管理-财务添加字段

1 parent 43d696c5
...@@ -102,15 +102,15 @@ ...@@ -102,15 +102,15 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="阳光激励费" label="阳光激励费"
prop="incentiveCost" prop="incentiveValue"
> >
<el-input <el-input
size="mini" size="mini"
v-model="form.incentiveCost" v-model="form.incentiveValue"
placeholder="请输入阳光激励费" placeholder="请输入阳光激励费"
class="input-with-select" class="input-with-select"
style="width: 240px;" style="width: 240px;"
@input="handleIncentiveCost" @input="handleincentiveValue"
> >
<el-select <el-select
slot="prepend" slot="prepend"
...@@ -219,7 +219,7 @@ export default { ...@@ -219,7 +219,7 @@ export default {
partnerProfitPer: '', partnerProfitPer: '',
merchantProfitValue: '', merchantProfitValue: '',
incentiveType: 1, incentiveType: 1,
incentiveCost: '' incentiveValue: ''
}, },
adminInfo: { adminInfo: {
name: '', name: '',
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
merchantProfitType: [ merchantProfitType: [
{ required: true, message: '请选择结算比例', trigger: 'change' } { required: true, message: '请选择结算比例', trigger: 'change' }
], ],
incentiveCost: [ incentiveValue: [
{ required: true, message: '请输入阳光激励费', trigger: 'change' } { required: true, message: '请输入阳光激励费', trigger: 'change' }
], ],
partnerProfitType: [ partnerProfitType: [
...@@ -272,7 +272,7 @@ export default { ...@@ -272,7 +272,7 @@ export default {
confLabel: '金额' confLabel: '金额'
}], }],
oldVal: { oldVal: {
incentiveCost: '' incentiveValue: ''
} }
} }
}, },
...@@ -331,63 +331,65 @@ export default { ...@@ -331,63 +331,65 @@ export default {
}) })
}, },
handleIncentiveCost(newVal) { handleincentiveValue(newVal) {
this.form.incentiveCost = this.form.incentiveType === 1 ? limitPrice(newVal, this.oldVal.incentiveCost, 3, 0, 0, 100) : limitPrice(newVal, this.oldVal.incentiveCost, 6, 2) this.form.incentiveValue = this.form.incentiveType === 1 ? limitPrice(newVal, this.oldVal.incentiveValue, 3, 0, 0, 100) : limitPrice(newVal, this.oldVal.incentiveValue, 6, 2)
this.oldVal.incentiveCost = this.form.incentiveCost this.oldVal.incentiveValue = this.form.incentiveValue
}, },
handleChangeType() { handleChangeType() {
this.form.incentiveCost = '' this.form.incentiveValue = ''
this.oldVal.incentiveCost = '' this.oldVal.incentiveValue = ''
}, },
onSubmit() { onSubmit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { // if (valid) {
const form = this.form const form = this.form
const params = { const params = {
merchantId: this.merchantId, merchantId: this.merchantId,
channelType: this.channelType, channelType: this.channelType,
smsCode: form.smsCode smsCode: form.smsCode
} }
if (form.autoFlag) {
params.autoFlag = form.autoFlag
}
if (form.settleTimeType) {
params.settleTimeType = form.settleTimeType
}
if (form.settleAmountType) {
params.settleAmountType = form.settleAmountType
}
if (form.merchantSettleType) {
params.merchantSettleType = form.merchantSettleType
}
if (form.merchantProfitType === 1) { if (form.autoFlag) {
params.merchantProfitValue = form.merchantProfitValue params.autoFlag = form.autoFlag
} else { }
params.merchantProfitValue = -1 if (form.settleTimeType) {
} params.settleTimeType = form.settleTimeType
}
if (form.settleAmountType) {
params.settleAmountType = form.settleAmountType
}
if (form.merchantSettleType) {
params.merchantSettleType = form.merchantSettleType
}
if (form.partnerProfitType === 1) { if (form.merchantProfitType === 1) {
params.partnerProfitPer = form.partnerProfitPer params.merchantProfitValue = form.merchantProfitValue
} else { } else {
params.partnerProfitPer = -1 params.merchantProfitValue = -1
} }
updateRule(params).then((res) => { if (form.partnerProfitType === 1) {
this.$message({ params.partnerProfitPer = form.partnerProfitPer
message: '修改成功',
type: 'success'
})
this.close({ tagName: '/merchantManage' })
this.$router.push({
name: 'merchantManage'
})
})
} else { } else {
console.log('error submit!!') params.partnerProfitPer = -1
return false
} }
if (form.incentiveType) params.incentiveType = form.incentiveType
if (form.incentiveValue) params.incentiveValue = form.incentiveValue
console.log(params)
// updateRule(params).then((res) => {
// this.$message({
// message: '修改成功',
// type: 'success'
// })
// this.close({ tagName: '/merchantManage' })
// this.$router.push({
// name: 'merchantManage'
// })
// })
// } else {
// console.log('error submit!!')
// return false
// }
}) })
}, },
onCancel() { onCancel() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!