Commit 351cdf9e by cwq0219

商户管理-财务-分账比例

1 parent dc2ff5e4
...@@ -112,7 +112,6 @@ ...@@ -112,7 +112,6 @@
</el-radio-group> --> </el-radio-group> -->
</el-form-item> </el-form-item>
<div> <div>
<!-- <h4 class="form_gp_title">导流方(4S店)财务对账结算规则</h4> -->
<p class="edit-sub-title">分账比例设置</p> <p class="edit-sub-title">分账比例设置</p>
<div class="account-card-block"> <div class="account-card-block">
<p class="card-title"> <p class="card-title">
...@@ -134,11 +133,11 @@ ...@@ -134,11 +133,11 @@
> >
<p <p
class="account-content p-l-30" class="account-content p-l-30"
v-for="(item, index) in accountSetForm" v-for="(item, index) in accountSetForm.list"
:key="index" :key="index"
> >
<el-form-item <el-form-item
:prop="index + '.goodsType'" :prop="'list.' + index + '.goodsType'"
:rules="{ required: true, message: '请选择分账品类', trigger: 'change'}" :rules="{ required: true, message: '请选择分账品类', trigger: 'change'}"
> >
<span <span
...@@ -166,13 +165,13 @@ ...@@ -166,13 +165,13 @@
:key="subIndex" :key="subIndex"
:label="subItem.goodsTypeName" :label="subItem.goodsTypeName"
:value="subItem.goodsType" :value="subItem.goodsType"
:disabled="accountSetForm.filter(k => k.goodsType !== item.goodsType).map(i => i.goodsType).includes(subItem.goodsType)" :disabled="accountSetForm.list.filter(k => k.goodsType !== item.goodsType).map(i => i.goodsType).includes(subItem.goodsType)"
></el-option> ></el-option>
</el-select> </el-select>
<span v-show="!isFirstSetEdit || index === 0">{{item.goodsTypeName}}</span> <span v-show="!isFirstSetEdit || index === 0">{{item.goodsTypeName}}</span>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:prop="index + '.merchantSettleType'" :prop="'list.' + index + '.merchantSettleType'"
:rules="{ required: true, message: '请选择分账模式', trigger: 'change'}" :rules="{ required: true, message: '请选择分账模式', trigger: 'change'}"
> >
<span <span
...@@ -204,7 +203,7 @@ ...@@ -204,7 +203,7 @@
<span v-show="!isFirstSetEdit">{{merchantSettleTypeList.find(i => i.confId === item.merchantSettleType).confLabel}}</span> <span v-show="!isFirstSetEdit">{{merchantSettleTypeList.find(i => i.confId === item.merchantSettleType).confLabel}}</span>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:prop="index + '.merchantProfitValue'" :prop="'list.' + index + '.merchantProfitValue'"
:rules="[{ required: true, message: '请输入分润比例', trigger: 'change'}, { pattern: /^(([1-9][0-9])|[0-9])$/, message: '请输入小于100正整数', trigger: 'blur' }]" :rules="[{ required: true, message: '请输入分润比例', trigger: 'change'}, { pattern: /^(([1-9][0-9])|[0-9])$/, message: '请输入小于100正整数', trigger: 'blur' }]"
> >
<span <span
...@@ -232,16 +231,18 @@ ...@@ -232,16 +231,18 @@
>%</i></el-input> >%</i></el-input>
<span v-show="!isFirstSetEdit">{{item.merchantProfitValue ? (item.merchantProfitValue + '%') : ''}}</span> <span v-show="!isFirstSetEdit">{{item.merchantProfitValue ? (item.merchantProfitValue + '%') : ''}}</span>
</el-form-item> </el-form-item>
<el-form-item style="width: 3%;"> <el-form-item
v-if="isFirstSetEdit && index !== 0"
style="width: 3%;"
>
<el-button <el-button
v-show="isFirstSetEdit && index !== 0"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleAccountDelete(item, index)" @click="handleAccountDelete(item, index)"
></el-button> ></el-button>
</el-form-item> </el-form-item>
</p> </p>
<el-form-item class="p-l-30"> <el-form-item class="p-l-30" style="width: 63%;">
<el-button <el-button
v-if="isFirstSetEdit" v-if="isFirstSetEdit"
size="small" size="small"
...@@ -249,19 +250,36 @@ ...@@ -249,19 +250,36 @@
@click="handleAccountAdd(item, index)" @click="handleAccountAdd(item, index)"
>+新增分账品类</el-button> >+新增分账品类</el-button>
</el-form-item> </el-form-item>
</el-form> <el-form-item
<!-- <p> prop="incentiveValue"
<span>分账品类 :rules="[{ required: true, message: '请输入激励费', trigger: 'change'}, { pattern: /^(([1-9][0-9])|[0-9])$/, message: '请输入小于100正整数', trigger: 'blur' }]"
<el-tooltip >
popper-class="tooltip-class" <span
effect="dark" class="tips-block"
content="用户支付的款项可按T+1或指定日自动打款给商户。" slot="label"
placement="top" >
<span class="tips-label">激励费</span>
<el-tooltip
popper-class="tooltip-class"
effect="dark"
content="用于激励门店的额外费用"
placement="top"
>
<span class="tips-icon"></span>
</el-tooltip>:
</span>
<el-input
size="small"
v-show="isFirstSetEdit"
v-model="accountSetForm.incentiveValue"
> >
<span class="tips-icon"></span> <i
</el-tooltip>:全部 slot="suffix"
</span> class="suffix"
</p> --> >%</i></el-input>
<span v-show="!isFirstSetEdit">{{accountSetForm.incentiveValue ? (accountSetForm.incentiveValue + '%') : ''}}</span>
</el-form-item>
</el-form>
</div> </div>
<!-- <el-form-item <!-- <el-form-item
label="结算模式" label="结算模式"
...@@ -477,12 +495,15 @@ export default { ...@@ -477,12 +495,15 @@ export default {
merchantSettleType: '1', merchantSettleType: '1',
merchantProfitValue: '' merchantProfitValue: ''
}), }),
accountSetForm: [{ accountSetForm: {
goodsType: '全部', incentiveValue: '',
goodsTypeName: '全部', list: [{
merchantSettleType: '1', goodsType: '全部',
merchantProfitValue: '' goodsTypeName: '全部',
}], merchantSettleType: '1',
merchantProfitValue: ''
}]
},
merchantId: '', merchantId: '',
channelType: '', channelType: '',
contactName: '', contactName: '',
...@@ -581,7 +602,7 @@ export default { ...@@ -581,7 +602,7 @@ export default {
this.baseData.productTypeList = _.cloneDeep(await this.get(BaseData.productType)) this.baseData.productTypeList = _.cloneDeep(await this.get(BaseData.productType))
}, },
handleSelectChange(value, index, currentItem) { handleSelectChange(value, index, currentItem) {
this[currentItem][index].goodsTypeName = this.baseData.productTypeList.find(item => item.goodsType === value).goodsTypeName this[currentItem].list[index].goodsTypeName = this.baseData.productTypeList.find(item => item.goodsType === value).goodsTypeName
}, },
// handleincentiveValue(newVal) { // 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.form.incentiveValue = this.form.incentiveType === 1 ? limitPrice(newVal, this.oldVal.incentiveValue, 3, 0, 0, 100) : limitPrice(newVal, this.oldVal.incentiveValue, 6, 2)
...@@ -603,12 +624,12 @@ export default { ...@@ -603,12 +624,12 @@ export default {
this.isFirstSetEdit = !this.isFirstSetEdit this.isFirstSetEdit = !this.isFirstSetEdit
}, },
handleAccountAdd() { handleAccountAdd() {
var validArr = this.accountSetForm.map((i, index) => index + '.goodsType') var validArr = this.accountSetForm.list.map((i, index) => 'list.' + index + '.goodsType')
var isEmpty = false var isEmpty = false
this.$refs.accountValiteForm.validateField(validArr, valid => { this.$refs.accountValiteForm.validateField(validArr, valid => {
valid && (isEmpty = true) valid && (isEmpty = true)
}) })
!isEmpty && this.accountSetForm.push(_.cloneDeep(this.accountSetStruct)) !isEmpty && this.accountSetForm.list.push(_.cloneDeep(this.accountSetStruct))
}, },
handleAccountDelete(item, index) { handleAccountDelete(item, index) {
this.$confirm('是否删除该品类', '提示', { this.$confirm('是否删除该品类', '提示', {
...@@ -616,7 +637,7 @@ export default { ...@@ -616,7 +637,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.accountSetForm.splice(index, 1) this.accountSetForm.list.splice(index, 1)
}) })
}, },
onSubmit() { onSubmit() {
...@@ -717,14 +738,14 @@ export default { ...@@ -717,14 +738,14 @@ export default {
.p-l-30 { .p-l-30 {
padding-left: 30px; padding-left: 30px;
} }
.tips-icon {
top: 11px;
}
.account-content { .account-content {
.el-form-item { .el-form-item {
width: 31%; width: 30%;
margin-bottom: 16px; margin-bottom: 16px;
} }
.tips-icon {
top: 11px;
}
} }
} }
.block_item { .block_item {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!