Commit fe769961 authored by mengwenhao's avatar mengwenhao

fix:合并分支

parents 88349b33 a77afc63
......@@ -78,7 +78,7 @@
</el-table-column>
<el-table-column
align="center"
prop="commission_mode"
prop="good_count"
label="关联商品数"
>
</el-table-column>
......@@ -87,12 +87,26 @@
prop="first_commission_value"
label="一级分销金额"
>
<template #default="scope">
<span>
{{ scope.row.first_commission_value + "%" }}
</span>
</template>
</el-table-column>
<el-table-column
align="center"
prop="second_commission_value"
label="二级分销金额"
>
<template #default="scope">
<span>
{{
scope.row.second_commission_value
? scope.row.second_commission_value + "%"
: "0%"
}}
</span>
</template>
</el-table-column>
<el-table-column
align="center"
......@@ -217,7 +231,8 @@
prop="first_commission_value"
>
<el-input
v-model.number="ruleForm.first_commission_value"
v-model="ruleForm.first_commission_value"
@input="changeValue($event, 'first_commission_value')"
:disabled="shopStart !== 0"
>
<template #append>%</template>
......@@ -228,7 +243,8 @@
prop="second_commission_value"
>
<el-input
v-model.number="ruleForm.second_commission_value"
v-model="ruleForm.second_commission_value"
@input="changeValue($event, 'second_commission_value')"
:disabled="shopStart !== 0"
>
<template #append>%</template>
......@@ -331,17 +347,18 @@
<span class="dialog-footer">
<el-button
type="primary"
@click="cancel"
@click="addList"
v-if="shopStart == 0"
style="width: 150px"
>{{
shopStart == 0 ? "取消" : "返回"
}}</el-button>
>保存</el-button>
<!-- {{
shopStart == 0 ? "返回" : "返回"
}} -->
<el-button
type="primary"
@click="addList"
@click="cancel"
style="width: 150px"
v-if="shopStart == 0"
>确 定</el-button>
>返回</el-button>
</span>
</template>
</el-dialog>
......@@ -376,7 +393,12 @@ export default {
},
data () {
var commission = (rule, value, callback) => {
if (this.ruleForm.first_commission_value + this.ruleForm.second_commission_value > 50 || value > 50) {
if (
this.ruleForm.first_commission_value +
this.ruleForm.second_commission_value >
50 ||
value > 50
) {
callback(new Error("一级佣金与二级佣金之和不可大于50%"));
} else {
callback();
......@@ -423,25 +445,25 @@ export default {
life_account_id: "",
goods_sku_id: "",
start_time: "",
end_time: ""
end_time: "",
},
rules: {
marketing_name: [
{ required: true, message: "请输入活动名称", trigger: "blur" },
{ min: 1, max: 50, message: "长度在 50个字符内", trigger: "blur" }
{ min: 1, max: 50, message: "活动名称不能大于50", trigger: "blur" },
],
first_commission_value: [
{
required: true,
message: "请填写一级佣金",
trigger: "blur"
trigger: "blur",
},
{ type: "number", message: "必须为数值型" },
{ validator: commission }
{ validator: commission },
],
second_commission_value: [
{ type: "number", message: "必须为数值型" },
{ validator: commission }
{ validator: commission },
],
},
allList: [],
......@@ -451,10 +473,15 @@ export default {
endTime: "",
marketing_id: "",
marketing_info: {},
disabled: false
disabled: false,
};
},
methods: {
changeValue (value, level) {
value &&
value.indexOf(".") !== value.length - 1 &&
(this.ruleForm[level] = parseFloat(value));
},
// 查看详情列表
async handleClick (row) {
this.dialogFormVisible = true;
......@@ -493,7 +520,7 @@ export default {
try {
const res = await updateMarketingList({
marketing_id: row.marketing_id,
online_status: type
online_status: type,
});
if (res.code !== 0) {
ElMessage.error(res.reason);
......@@ -518,7 +545,7 @@ export default {
goods_sku_id: "",
online_status: [],
page: 1,
page_size: 20
page_size: 20,
}),
this.$refs[retailActivitie].resetFields();
this.getMarketingList({});
......@@ -576,7 +603,7 @@ export default {
goods_sku_id,
life_account_id,
start_time,
end_time
end_time,
};
try {
// 发请求
......@@ -594,7 +621,7 @@ export default {
async getAllList () {
let all = await getMarketingList({
page: 1,
page_size: this.retailActivitie.count
page_size: this.retailActivitie.count,
});
this.allList = all.result;
},
......@@ -615,7 +642,7 @@ export default {
let {
marketing_name,
first_commission_value,
second_commission_value
second_commission_value,
} = this.ruleForm;
let [start_time, end_time] = this.timeSelect;
if (
......@@ -630,10 +657,10 @@ export default {
let addParams = {
goods_sku_id,
marketing_name,
first_commission_value,
second_commission_value,
first_commission_value: first_commission_value + "",
second_commission_value: second_commission_value + "",
start_time: this.formatTime(start_time),
end_time: this.formatTime(end_time)
end_time: this.formatTime(end_time),
};
try {
const res = await getAddMarketingList(addParams);
......@@ -660,7 +687,7 @@ export default {
second_commission_value: "",
start_time: "",
end_time: "",
goods_sku_id: []
goods_sku_id: [],
}),
(this.timeSelect = []),
(this.goods_list = []),
......@@ -668,7 +695,7 @@ export default {
life_account_id: "",
goods_sku_id: "",
start_time: "",
end_time: ""
end_time: "",
});
},
// 取消
......@@ -676,12 +703,12 @@ export default {
this.dialogFormVisible = false;
this.resetDate();
this.getMarketingList();
}
},
},
created () {
this.getMarketingList();
this.getAllList();
}
},
};
</script>
<style lang="less" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment