Commit fc22c4ff by 无尘

fix: 修改场景人群

parent c93839ca
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-08-27 09:29:13 * @Date: 2020-08-27 09:29:13
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-09-04 10:38:35 * @LastEditTime: 2020-09-04 15:34:02
*/ */
import getFetch from './get-fetch.js'; import getFetch from './get-fetch.js';
...@@ -74,6 +74,13 @@ let api = { ...@@ -74,6 +74,13 @@ let api = {
useFormData: true, useFormData: true,
useIntercept: false useIntercept: false
}, },
delCrowd: {
// 删除
url: '/member-group-del',
method: 'post',
useFormData: true,
useIntercept: false
},
getVisiable: '/member-group-range-view', // 获取可见范围详情 getVisiable: '/member-group-range-view', // 获取可见范围详情
saveVisiable: { saveVisiable: {
// 保存人群场景可见范围 // 保存人群场景可见范围
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-08-28 10:31:09 * @Date: 2020-08-28 10:31:09
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-09-04 10:35:44 * @LastEditTime: 2020-09-04 16:00:39
--> -->
<!-- <!--
<sync-crowd-dialog :brand-id="brandId" @refreshData="refreshData"></sync-crowd-dialog> <sync-crowd-dialog :brand-id="brandId" :total-num="totalNum" @refreshData="refreshData"></sync-crowd-dialog>
import syncCrowdDialog from '@/components/app/my-customer/sync-crowd-dialog.vue'; import syncCrowdDialog from '@/components/app/my-customer/sync-crowd-dialog.vue';
--> -->
<template> <template>
...@@ -46,12 +46,12 @@ ...@@ -46,12 +46,12 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div v-if="tableData.length" class="block common-wrap__page text-right m-t-24"> <div v-if="tableData.length" class="block common-wrap__page text-right m-t-24">
<dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </dm-pagination> <dm-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-size="pageSize" layout="prev, pager, next" :total="total"> </dm-pagination>
</div> </div>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button> <el-button @click="cancel">取消</el-button>
<el-button type="primary" :loading="loadingBtn" @click="submitForm">立即同步</el-button> <el-button type="primary" :loading="loadingBtn" @click="submitForm">立即同步({{multipleSelection.length}}/{{20 - that.totalNum}})</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
...@@ -70,6 +70,10 @@ export default { ...@@ -70,6 +70,10 @@ export default {
brandId: { brandId: {
type: String, type: String,
default: '' default: ''
},
totalNum: {
type: [ String, Number ],
default: '0'
} }
}, },
data() { data() {
...@@ -109,8 +113,8 @@ export default { ...@@ -109,8 +113,8 @@ export default {
showMsg.showmsg('请选择场景人群', 'warning'); showMsg.showmsg('请选择场景人群', 'warning');
return false; return false;
} }
if (that.multipleSelection.length > 20) { if (that.multipleSelection.length > (20 - that.totalNum)) {
showMsg.showmsg('最多可同步20个场景人群', 'warning'); showMsg.showmsg(`最多可同步${20 - that.totalNum}个场景人群`, 'warning');
return false; return false;
} }
that.loadingBtn = true; that.loadingBtn = true;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-08-27 10:16:37 * @Date: 2020-08-27 10:16:37
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-09-04 14:58:27 * @LastEditTime: 2020-09-04 15:44:48
--> -->
<template> <template>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<el-option v-for="item in classifyList" :key="item.sceneCrowdCategoryId" :label="item.sceneCrowdCategoryName" :value="item.sceneCrowdCategoryId"> </el-option> <el-option v-for="item in classifyList" :key="item.sceneCrowdCategoryId" :label="item.sceneCrowdCategoryName" :value="item.sceneCrowdCategoryId"> </el-option>
</el-select> </el-select>
</div> </div>
<div><el-button type="primary" @click="toSync">同步场景人群</el-button></div> <div><el-button :disabled="totalNum >= 20" type="primary" @click="toSync">同步场景人群</el-button></div>
</div> </div>
<div class="crowd-scene-table"> <div class="crowd-scene-table">
<div class="crowd-scene-table_left"> <div class="crowd-scene-table_left">
...@@ -58,12 +58,13 @@ ...@@ -58,12 +58,13 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑可见范围</el-button> <el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑可见范围</el-button>
<el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
<sync-crowd-dialog v-if="showSync" :brand-id="brandId" @refreshData="refreshData"></sync-crowd-dialog> <sync-crowd-dialog v-if="showSync" :total-num="totalNum" :brand-id="brandId" @refreshData="refreshData"></sync-crowd-dialog>
<edit-visiable v-if="showSelectStore" :brand-id="brandId" :set-item-id="setItemId" :set-type="'crowd'" :select-mode="selectMode" :range-data="rangeData" @refreshData="refreshData"></edit-visiable> <edit-visiable v-if="showSelectStore" :brand-id="brandId" :set-item-id="setItemId" :set-type="'crowd'" :select-mode="selectMode" :range-data="rangeData" @refreshData="refreshData"></edit-visiable>
</div> </div>
</template> </template>
...@@ -73,7 +74,7 @@ import commonAlertTip from '@/components/common/common-alert-tip.vue'; ...@@ -73,7 +74,7 @@ import commonAlertTip from '@/components/common/common-alert-tip.vue';
import syncCrowdDialog from '@/components/app/my-customer/sync-crowd-dialog.vue'; import syncCrowdDialog from '@/components/app/my-customer/sync-crowd-dialog.vue';
import editVisiable from '@/components/app/my-customer/edit-visiable.vue'; import editVisiable from '@/components/app/my-customer/edit-visiable.vue';
import fetch from '@/api/my-customer-app.js'; import fetch from '@/api/my-customer-app.js';
const { getGroupData, getClassifyData, getVisiable, postSortGroup } = fetch; const { getGroupData, getClassifyData, getVisiable, postSortGroup, delCrowd } = fetch;
import { _debounce } from '@/common/js/public.js'; import { _debounce } from '@/common/js/public.js';
import showMsg from '@/common/js/showmsg.js'; import showMsg from '@/common/js/showmsg.js';
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
...@@ -95,16 +96,17 @@ export default { ...@@ -95,16 +96,17 @@ export default {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '', wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
tipContent: 'GIC设置场景人群后,好办顾客人群列表最多同步20个人群,次日刷新,每日刷新一次;', tipContent: 'GIC设置场景人群后,好办顾客人群列表最多同步20个人群,次日刷新,每日刷新一次;',
tipTwoContent: 'GIC中设置的场景人群到期后,好办移动端将不再展示该条人群;', tipTwoContent: 'GIC中设置的场景人群到期后,好办移动端将不再展示该条人群;',
searchVal: '', searchVal: '', // 搜索
classifyId: '', classifyId: '', // 选择分类
classifyList: [], classifyList: [], // 分类列表
memberCrowdData: [], // 人群 memberCrowdData: [], // 场景人群列表
loading: false, totalNum: 0, // 获取的列表总数
showSync: false, loading: false, // 列表加载
showSelectStore: false, showSync: false, // 同步弹窗显示
selectMode: '', showSelectStore: false, // 可见范围显示
rangeData: [], selectMode: '', // 选择类型 0:所有; 1:分组; 2:门店
setItemId: '' rangeData: [], // 选择的分组或门店
setItemId: '' // 选中的场景 id
}; };
}, },
// 生命周期 - 挂载完成(访问DOM元素) // 生命周期 - 挂载完成(访问DOM元素)
...@@ -119,6 +121,40 @@ export default { ...@@ -119,6 +121,40 @@ export default {
// methods // methods
methods: { methods: {
/** /**
* @description: 删除标签
* @param {Number} index
* @param {Object} row
*/
toDel(index, row) {
const that = this;
that
.$confirm('是否要删除该场景人群?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.delData(row.sceneCrowdId);
})
.catch(() => {});
},
delData(sceneCrowdId) {
const that = this;
const para = { sceneCrowdId };
delCrowd(para)
.then(res => {
that.getGroupList();
if (res.code == '0000') {
showMsg.showmsg('删除成功', 'success');
}else {
showMsg.showmsg(res.message || '接口异常', 'warning');
}
})
.catch(function(error) {
});
},
/**
* @description: 刷新数据 * @description: 刷新数据
* @param {String} res * @param {String} res
* @returns {Boolean} * @returns {Boolean}
...@@ -128,6 +164,8 @@ export default { ...@@ -128,6 +164,8 @@ export default {
const that = this; const that = this;
that.showSync = false; that.showSync = false;
that.showSelectStore = false; that.showSelectStore = false;
that.searchVal = '';
that.classifyId = '';
that.selectMode = ''; that.selectMode = '';
that.rangeData = []; that.rangeData = [];
if (res == 'close') { if (res == 'close') {
...@@ -260,6 +298,9 @@ export default { ...@@ -260,6 +298,9 @@ export default {
.then(res => { .then(res => {
that.loading = false; that.loading = false;
that.memberCrowdData = res.result || []; that.memberCrowdData = res.result || [];
if (!that.searchVal && !that.classifyId && !!res.result && !!res.result.length) {
that.totalNum = res.result.length;
}
}) })
.catch(function(error) { .catch(function(error) {
that.loading = false; that.loading = false;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-08-27 11:36:51 * @Date: 2020-08-27 11:36:51
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-09-04 10:08:10 * @LastEditTime: 2020-09-04 15:27:32
--> -->
<template> <template>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<el-table <el-table
ref="memberCardData" ref="memberCardData"
:data="memberCardData" :data="memberCardData"
row-key="memberCardId" row-key="id"
v-loading="loadingMember" v-loading="loadingMember"
style="width: 100%"> style="width: 100%">
<el-table-column prop="" label="" width="56" class-name="move-row-cell show-icon"> <el-table-column prop="" label="" width="56" class-name="move-row-cell show-icon">
...@@ -35,9 +35,10 @@ ...@@ -35,9 +35,10 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop=""
label="会员卡名称" label="会员卡名称"
show-overflow-tooltip> show-overflow-tooltip>
<template slot-scope="scope">{{scope.row.name || '--'}}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
<el-table <el-table
ref="serviceNumData" ref="serviceNumData"
:data="serviceNumData" :data="serviceNumData"
row-key="serviceCardId" row-key="id"
v-loading="loadingService" v-loading="loadingService"
style="width: 100%"> style="width: 100%">
<el-table-column prop="" label="" width="56" class-name="move-row-cell show-icon"> <el-table-column prop="" label="" width="56" class-name="move-row-cell show-icon">
...@@ -62,9 +63,10 @@ ...@@ -62,9 +63,10 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop=""
label="服务号名称" label="服务号名称"
show-overflow-tooltip> show-overflow-tooltip>
<template slot-scope="scope">{{scope.row.name || '--'}}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
...@@ -95,8 +97,8 @@ export default { ...@@ -95,8 +97,8 @@ export default {
return { return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '', wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
tipContent: '当商户有多个会员卡和服务号时,会造成单家门店适用于多个会员卡或服务号,即单个顾客会有多个域的身份信息,这容易造成门店成员的困扰。请为以下会员卡和服务号域做权重排序,当顾客有多个域的身份信息时,门店成员将只能看到权重最高域的一个身份信息。', tipContent: '当商户有多个会员卡和服务号时,会造成单家门店适用于多个会员卡或服务号,即单个顾客会有多个域的身份信息,这容易造成门店成员的困扰。请为以下会员卡和服务号域做权重排序,当顾客有多个域的身份信息时,门店成员将只能看到权重最高域的一个身份信息。',
memberCardData: [], // 会员卡 memberCardData: [], // 会员卡列表
serviceNumData: [], // 服务号 serviceNumData: [], // 服务号列表
loadingMember: false, loadingMember: false,
loadingService: false, loadingService: false,
}; };
......
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