Commit 399260b6 by crushh

update: 会员分组

parent 6c978db5
......@@ -8,7 +8,7 @@ const baseWebpackConfig = require('./webpack.base.conf');
const FriendlyErrorsPlugin = require('@soda/friendly-errors-webpack-plugin');
const portfinder = require('portfinder');
const { port = '8080', publicPath = '/', devServerProxy } = config;
const { port = '8001', publicPath = '/', devServerProxy } = config;
const devWebpackConfig = merge(baseWebpackConfig, {
mode: 'development',
......
......@@ -165,6 +165,9 @@ export default {
} else {
item.showBack = '所有门店';
}
} else if (item.memberType == 2) {
const res = await this.echoData3(item.filterJson);
item.showBack = res.data.result.map(item => item.groupName).join(',');
}
});
}).finally(_ => {
......@@ -187,6 +190,9 @@ export default {
form.append('pageSize', 20);
return request.post('/api-plug/list-right-data', form);
},
echoData3 (val) {
return request.get(`/gic-member-tag-web/member-tag-group/queryGroupByIds?requestProject=memberTag&memberTagGroupIds=${val}`);
},
closePop () {
this.tableRadio = '';
this.relateForm = {
......
......@@ -42,6 +42,9 @@
>
人群筛选器
</el-radio>
<el-radio v-model="ruleForm.memberType" :label="2">
会员分组
</el-radio>
</div>
</el-form-item>
<el-form-item v-show="ruleForm.memberType === 4">
......@@ -66,6 +69,10 @@
@getBackData="getBackData"
@editShow="hasEditGicPeople=true"
/>
<el-form-item v-show="ruleForm.memberType === 2" prop="selectedGroupIds" >
<el-button v-if="!selectedGroupIds" size="small" @click="groupVisible = true">添加分组</el-button>
<gic-new-member-group :visiable.sync="groupVisible" :selectedIds="selectedGroupIds" @change="confirmGroupDialog" />
</el-form-item>
<div>
<el-form-item style="margin-top:50px" v-show="!isDialog">
<el-button
......@@ -94,7 +101,16 @@ export default {
const activityTimeVal = (rule, value, callback) => {
callback(new Error('请填写'));
};
const selectedGroupIdsVal = (rule, value, callback) => {
if (this.ruleForm.memberType === 2 && !this.selectedGroupIds) {
callback(new Error('请选择分组'));
return;
}
callback();
};
return {
groupVisible: false,
selectedGroupIds: '', // 被选中的客户分组id
fixedWidth: document.documentElement.clientWidth - 200,
ruleForm: {
memberType: 4, // 3 人群筛选 4 门店筛选
......@@ -107,6 +123,9 @@ export default {
activityTime: [
{ required: true, message: '请填写', trigger: 'blur', validator: activityTimeVal },
],
selectedGroupIds: [
{ required: true, validator: selectedGroupIdsVal },
],
},
projectName: 'integral-mall',
useId: '',
......@@ -168,6 +187,8 @@ export default {
}
} else if (this.ruleForm.memberType == 4) { // 门店筛选器回显
this.uuid = JSON.parse(this.ruleForm.filterJson).storeWidgetId;
} else if (this.ruleForm.memberType == 2) {
this.selectedGroupIds = this.ruleForm.filterJson;
}
if (this.isCopy) {
this.ruleForm.creatorId = localStorage.getItem('useId');
......@@ -187,6 +208,7 @@ export default {
} else {
data = this.ruleForm;
}
console.log(data);
this.btnLoading = true;
this.$emit('btnLoading');
request.post('/api-integral-mall/add-update-rule', data).then(res => {
......@@ -223,23 +245,16 @@ export default {
}
} else if (this.ruleForm.memberType == 4) {
this.$refs.storeGroup.getStoreConfig().then(async (data) => {
// let type = 0;
// if (data.type != 0) {
// type = 1;
// }
// const res = await this.echoData2(this.uuid, data.type);
// const { data: { result: { result } } } = res;
// console.log(result);
// if (result) {
// this.ruleForm.showBack = result.map(item => item.name).join(',');
// } else {
// this.ruleForm.showBack = '所有门店';
// }
this.ruleForm.filterJson = JSON.stringify({ storeMode: data.type, storeWidgetId: this.uuid });
this.ruleForm.searchJson = '';
this.ruleForm.searchId = this.uuid;
this.submitRequest();
});
} else if (this.ruleForm.memberType == 2) {
this.ruleForm.filterJson = this.selectedGroupIds;
this.ruleForm.searchJson = '';
this.ruleForm.searchId = '';
this.submitRequest();
}
},
echoData (filterJson) { // 取得人群筛选器回显文字
......@@ -257,6 +272,10 @@ export default {
form.append('pageSize', 20);
return request.post('/api-plug/list-right-data', form);
},
/** 客户分组 */
confirmGroupDialog (arr, idStr) {
this.selectedGroupIds = idStr;
},
memberTypeNum () {
request.get('/api-integral-mall/list-rule', { params: { memberType: 3 } }).then(res => {
this.memberTypeTotal = res.data.result.length || 0;
......
......@@ -357,6 +357,9 @@ export default {
case 4:
str = '门店筛选';
break;
case 2:
str = '会员分组';
break;
}
return str;
},
......@@ -400,6 +403,7 @@ export default {
let option = [
{ label: '人群筛选', value: 3 },
{ label: '门店筛选', value: 4 },
{ label: '会员分组', value: 2 },
];
if (this.$store.state.product.ruleMemberFilterClose == 1) {
option = option.filter(item => item.label != '人群筛选');
......
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