|
|
@ -19,47 +19,47 @@ |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|
|
|
<el-row style="border-top: 1px solid #E0E3EB"> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>返利类型</span> |
|
|
|
<span><span class="icon">*</span>返利类型</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item prop="rebateTypeValue"> |
|
|
|
<el-select v-model="formobj.rebateTypeValue" placeholder="请选择" filterable clearable @change="changeRebateType"> |
|
|
|
<el-option v-for="item in rebateType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>厂家返利名称</span> |
|
|
|
<span><span class="icon">*</span>厂家返利名称</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item><el-input v-model="formobj.rebateName" class="addinputw" placeholder="" clearable></el-input></el-form-item> |
|
|
|
<el-form-item prop="rebateName"><el-input v-model="formobj.rebateName" class="addinputw" placeholder="" clearable></el-input></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>所属年月</span> |
|
|
|
<span><span class="icon">*</span>所属年月</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item><el-date-picker v-model="formobj.palceGenDate" type="month" clearable format="yyyy-MM" value-format="yyyy-MM" placeholder="选择日期"/></el-form-item> |
|
|
|
<el-form-item prop="palceGenDate"><el-date-picker v-model="formobj.palceGenDate" type="month" clearable format="yyyy-MM" value-format="yyyy-MM" placeholder="选择日期"/></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>计算方式</span> |
|
|
|
<span><span class="icon">*</span>计算方式</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item prop="calculationModeValue"> |
|
|
|
<el-select v-model="formobj.calculationModeValue" placeholder="请选择" filterable clearable @change="changeCalculationMode"> |
|
|
|
<el-option v-for="item in calculationMode_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>计算标准 |
|
|
|
<span><span class="icon">*</span>计算标准 |
|
|
|
<span v-if="formobj.calculationModeValue == '比例'">(%)</span> |
|
|
|
<span v-else>(元)</span> |
|
|
|
</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item><el-input v-model="formobj.calculationStandard" @input="estimateRebateInput" @keyup.native="formobj.calculationStandard = getNumber(formobj.calculationStandard, 2)" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
<el-form-item prop="calculationStandard"><el-input v-model="formobj.calculationStandard" @keyup.native="formobj.calculationStandard = getNumber(formobj.calculationStandard, 2)" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title"> |
|
|
@ -97,7 +97,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item> |
|
|
|
<span>{{ formobj.estimateRebate }}</span> |
|
|
|
<span>{{ estimateRebateSum }}</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
@ -143,10 +143,29 @@ export default { |
|
|
|
estimateRebate: '', |
|
|
|
remarks: '' |
|
|
|
}, |
|
|
|
rules: {}, |
|
|
|
rules: { |
|
|
|
rebateTypeValue: [{ required: true, message: '返利类型不能为空', trigger: 'change' }], |
|
|
|
rebateName: [{ required: true, message: '返利名称不能为空', trigger: 'blur' }], |
|
|
|
palceGenDate: [{ required: true, message: '所属年月不能为空', trigger: 'change' }], |
|
|
|
calculationModeValue: [{ required: true, message: '计算方式不能为空', trigger: 'change' }], |
|
|
|
calculationStandard: [{ required: true, message: '计算标准不能为空', trigger: 'blur' }] |
|
|
|
}, |
|
|
|
submitdisabled: false |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
estimateRebateSum() { |
|
|
|
let estimateRebate = '0' |
|
|
|
if (this.formobj.calculationModeKey === '001') { |
|
|
|
// 计算方式为比例时,预计返利 = (厂家结算价 - 运费) * (计算标准 / 100) |
|
|
|
estimateRebate = Math.round(((parseFloat(this.formobj.manufactorSettlementPrice !== '' ? this.formobj.manufactorSettlementPrice : 0) - parseFloat(this.formobj.freight !== '' ? this.formobj.freight : 0)) * (parseFloat(this.formobj.calculationStandard) / 100)) * 100) / 100 |
|
|
|
} else if (this.formobj.calculationModeKey === '002') { |
|
|
|
// 计算方式为固定金额时,预计返利 = 计算标准 |
|
|
|
estimateRebate = this.formobj.calculationStandard |
|
|
|
} |
|
|
|
return estimateRebate |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init() { |
|
|
|
typeValues({ type: 'rebateType' }).then((res) => { |
|
|
@ -178,15 +197,6 @@ export default { |
|
|
|
} |
|
|
|
return val |
|
|
|
}, |
|
|
|
estimateRebateInput() { |
|
|
|
if (this.formobj.calculationModeKey === '001') { |
|
|
|
// 计算方式为比例时,预计返利 = (厂家结算价 - 运费) * (计算标准 / 100) |
|
|
|
this.formobj.estimateRebate = Math.round(((parseFloat(this.formobj.manufactorSettlementPrice !== '' ? this.formobj.manufactorSettlementPrice : 0) - parseFloat(this.formobj.freight !== '' ? this.formobj.freight : 0)) * (parseFloat(this.formobj.calculationStandard) / 100)) * 100) / 100 |
|
|
|
} else if (this.formobj.calculationModeKey === '002') { |
|
|
|
// 计算方式为固定金额时,预计返利 = 计算标准 |
|
|
|
this.formobj.estimateRebate = this.formobj.calculationStandard |
|
|
|
} |
|
|
|
}, |
|
|
|
changeRebateType(value) { |
|
|
|
const choose = this.rebateType_list.filter((item) => item.dictValue === value) |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
@ -210,7 +220,9 @@ export default { |
|
|
|
}) |
|
|
|
this.viewTitle = '【编辑】单车返利' |
|
|
|
req.fetchBySid(row.sid).then((resp) => { |
|
|
|
this.formobj = resp.data |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
} |
|
|
|
}).catch((e) => { |
|
|
|
this.formobj = row |
|
|
|
}) |
|
|
|