Commit fe769961 authored by mengwenhao's avatar mengwenhao

fix:合并分支

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