Commit bbba99be by cwq0219

商户管理-财务-激励费

1 parent 3896f360
......@@ -256,7 +256,7 @@
</el-form-item>
<el-form-item
prop="incentiveValue"
:rules="[{ required: true, message: '请输入激励费', trigger: 'change'}, { pattern: /^(([1-9][0-9])|[0-9])$/, message: '请输入小于100正整数', trigger: 'blur' }]"
:rules="[{ required: true, message: '请输入激励费', trigger: 'change'}]"
>
<span
class="tips-block"
......@@ -276,12 +276,29 @@
size="small"
v-show="isFirstSetEdit"
v-model="accountSetForm.incentiveValue"
placeholder="请输入阳光激励费"
class="input-with-select"
@input="handleincentiveValue"
>
<el-select
slot="prepend"
style="width: 75px;"
v-model="accountSetForm.incentiveType"
@change="handleChangeType"
>
<el-option
v-for="(item, index) in incentiveTypeList"
:key="index"
:value="item.confId"
:label="item.confLabel"
></el-option>
</el-select>
<i
slot="suffix"
class="suffix"
>%</i></el-input>
<span v-show="!isFirstSetEdit">{{accountSetForm.incentiveValue ? (accountSetForm.incentiveValue + '%') : ''}}</span>
>{{accountSetForm.incentiveType === '1' ? '%' : '元'}}</i>
</el-input>
<span v-show="!isFirstSetEdit">{{accountSetForm.incentiveValue ? (accountSetForm.incentiveValue + (accountSetForm.incentiveType === '1' ? '%' : '元')) : ''}}</span>
</el-form-item>
</el-form>
</div>
......@@ -434,9 +451,8 @@
<script>
import _ from 'lodash'
import { mapActions } from 'vuex'
// import { limitPrice } from '@/common/constants'
import { updateRule, sendSms, getAdminInfo, getAccountRule } from '@api/merchant'
import { BaseData, userType, ghUserType } from '@/common/constants.js'
import { BaseData, userType, ghUserType, limitPrice } from '@/common/constants.js'
export default {
name: 'merchantDetail',
data() {
......@@ -483,6 +499,7 @@ export default {
merchantProfitValue: ''
}),
accountSetForm: {
incentiveType: '1',
incentiveValue: '',
list: [{
goodsType: '全部',
......@@ -535,10 +552,10 @@ export default {
productTypeList: [],
userType: userType,
ghUserType: ghUserType
},
oldVal: {
incentiveValue: ''
}
// oldVal: {
// incentiveValue: ''
// }
}
},
// watch: {
......@@ -566,6 +583,7 @@ export default {
this.form.settleTime = res.settleTime
this.accountSetForm.list[0].merchantSettleType = res.merchantSettleType + ''
this.accountSetForm.list[0].merchantProfitValue = res.merchantProfitValue + ''
this.accountSetForm.incentiveType = res.incentiveType + ''
this.accountSetForm.incentiveValue = res.incentiveValue + ''
this.accountSecondSetForm.list[0].partnerProfitPer = res.partnerProfitPer + ''
res.goodsTypeSettleRuleList.forEach((item, index) => {
......@@ -631,14 +649,14 @@ export default {
handleSelectChange(value, index, currentItem) {
this[currentItem].list[index].goodsTypeName = this.baseData.productTypeList.find(item => item.goodsType === value).goodsTypeName
},
// handleincentiveValue(newVal) {
// 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.incentiveValue = this.form.incentiveValue
// },
// handleChangeType() {
// this.form.incentiveValue = ''
// this.oldVal.incentiveValue = ''
// },
handleincentiveValue(newVal) {
this.accountSetForm.incentiveValue = this.accountSetForm.incentiveType === '1' ? limitPrice(newVal, this.oldVal.incentiveValue, 3, 0, 0, 100) : limitPrice(newVal, this.oldVal.incentiveValue, 6, 2)
this.oldVal.incentiveValue = this.accountSetForm.incentiveValue
},
handleChangeType() {
this.accountSetForm.incentiveValue = ''
this.oldVal.incentiveValue = ''
},
// 是否编辑;refs绑定的属性值;当前Form属性值;级联Form属性值;添加对象的属性
handleSetEdit(isEditAttr, refsAttr, formAttr, cascadeChangeAttr, addStructAttr) {
if (this[isEditAttr]) {
......@@ -707,7 +725,7 @@ export default {
// 全部-分账设置
merchantSettleType: this.accountSetForm.list[0].merchantSettleType,
merchantProfitValue: this.accountSetForm.list[0].merchantProfitValue,
incentiveType: 1,
incentiveType: this.accountSetForm.incentiveType,
incentiveValue: this.accountSetForm.incentiveValue,
partnerProfitPer: this.accountSecondSetForm.list[0].partnerProfitPer,
goodsTypeSettleRuleList: []
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!