Commit ae82abd3 by crushh

Merge branch 'bugfix/上架规则' into master

parents 94ff14f3 3091304d
......@@ -97,6 +97,7 @@
<script>
import request from '@/service/request.js';
import ruleInfo from '@/components/ruleDetail.vue';
// import qs from 'qs';
export default {
name: 'RelatePop',
components: {
......@@ -146,22 +147,46 @@ export default {
getList () {
this.loading = true;
this.tableRadio = '';
request.get('/api-integral-mall/page-rule', { params: this.relateForm }).then(async (res) => {
request.get('/api-integral-mall/page-rule', { params: this.relateForm }).then(res => {
this.tableDate = res.data.result.result || [];
this.totalCount = res.data.result.totalCount;
this.tableDate = this.tableDate.splice(0);
if (this.echoRuleId) this.tableRadio = this.echoRuleId;
this.tableDate.forEach(async item => {
if (item.memberType == 3 && !item.showBack) {
const res = await this.echoData(item.filterJson);
item.showBack = res.data.result;
} else if (item.memberType == 4 && !item.showBack) {
const { storeMode, storeWidgetId } = JSON.parse(item.filterJson);
const res = await this.echoData2(storeWidgetId, storeMode);
const { data: { result: { result } } } = res;
if (result) {
item.showBack = result.map(item => item.name).join(',');
} else {
item.showBack = '所有门店';
}
}
});
}).finally(_ => {
this.loading = false;
});
},
echoData (row) {
echoData (filterJson) { // 取得人群筛选器回显文字
const form = new FormData();
form.append('params', row.filterJson);
form.append('params', filterJson);
form.append('requestProject', 'integral-mall');
form.append('sceneCode', 'member');
return request.post('/api-plug/screening-show-back', form);
},
echoData2 (key, type) { // 取得门店筛选器的文字回显
const form = new FormData();
form.append('key', key);
form.append('selectType', type);
form.append('currentPage', 1);
form.append('pageSize', 20);
return request.post('/api-plug/list-right-data', form);
},
closePop () {
this.tableRadio = '';
this.relateForm = {
......
......@@ -212,30 +212,30 @@ export default {
} else if (this.ruleForm.memberType == 3) {
if (this.hasEditGicPeople) {
this.$refs.peopleFilter.confirmSet().then(async () => {
const res = await this.echoData(this.ruleForm.filterJson);
this.ruleForm.showBack = res.data.result;
// const res = await this.echoData(this.ruleForm.filterJson);
// this.ruleForm.showBack = res.data.result;
this.submitRequest();
});
} else {
const res = await this.echoData(this.ruleForm.filterJson);
this.ruleForm.showBack = res.data.result;
// const res = await this.echoData(this.ruleForm.filterJson);
// this.ruleForm.showBack = res.data.result;
this.submitRequest();
}
} 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: type, storeWidgetId: this.uuid });
// 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();
......
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