Commit 26a4843f by 无尘

fix: 修改人群场景

parent 4290a165
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-27 09:29:13
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 16:48:50
* @LastEditTime: 2020-09-04 10:38:35
*/
import getFetch from './get-fetch.js';
......@@ -57,7 +57,7 @@ let api = {
useIntercept: false
},
// 人群场景
getGroupData: '/member-group-list', // 获取人群场景数据
getGroupData: '/member-group-hb-list', // 获取人群场景数据
getClassifyData: '/member-group-category-list', // 获取分类数据
postSortGroup: {
// 排序
......@@ -66,7 +66,7 @@ let api = {
useFormData: true,
useIntercept: false
},
getSyncMemberData: '/member-group-hb-list', // 获取人群场景同步数据
getSyncMemberData: '/member-group-list', // 获取人群场景同步数据
saveSync: {
// 保存同步
url: '/member-group-save',
......@@ -76,7 +76,7 @@ let api = {
},
getVisiable: '/member-group-range-view', // 获取可见范围详情
saveVisiable: {
// 保存可见范围
// 保存人群场景可见范围
url: '/member-group-range-save',
method: 'post',
useFormData: true,
......@@ -94,6 +94,7 @@ let api = {
},
getClerkTag: '/member-tag-list', // 获取导购标签
addClerkTag: '/member-tag-add', // 新增导购标签
getTagDetail: '/member-tag-detail', // 获取标签详情
editClerkTag: '/member-tag-edit', // 编辑导购标签
delClerkTag: {
// 删除导购标签
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 11:22:53
* @LastEditTime: 2020-09-04 10:32:15
-->
<!--
<customer-assign v-if="assignShow" :brand-id="brandId" :clerk-id="clerkId" :search-params="searchInput" :choose-all="selectRadio" :depart-obj="departObj" :multiple-data="multipleSelection" @closeText="closeText" @submitText="submitText"></customer-assign>
......@@ -111,6 +111,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
staffName: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).staffName : '',
dialogVisible: true,
unbindFlag: false,
......@@ -271,7 +272,7 @@ export default {
const that = this;
const para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
wxEnterpriseId: that.wxEnterpriseId,
storeId: that.departObj.storeId
};
getClerkList(para)
......@@ -300,7 +301,7 @@ export default {
const that = this;
const para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
wxEnterpriseId: that.wxEnterpriseId,
storeId: that.departObj.storeId,
clerkId: that.clerkId,
keyword: that.searchParams
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-28 15:24:12
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 15:58:09
* @LastEditTime: 2020-09-04 10:29:25
-->
<!--
门店绑定-选择分组
......@@ -49,6 +49,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
searchSelect: '', // 搜索字段
groupData: [],
groupDataCopy: [],
......@@ -150,7 +151,8 @@ export default {
const that = this;
const para = {
type: that.storeType,
enterpriseId: that.brandId
enterpriseId: that.brandId,
wxEnterpriseId: that.wxEnterpriseId
};
getGroupList(para)
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-28 15:24:42
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 15:58:36
* @LastEditTime: 2020-09-04 10:32:24
-->
<!--
<customer-store :brand-id="brandId" :select-store="selectStore" @checkStoreIds="checkStoreIds"></customer-store>
......@@ -56,6 +56,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
checkAll: false, // 全选
isIndeterminate: false,
searchSelect: '', // 搜索字段
......@@ -132,7 +133,8 @@ export default {
enterpriseId: that.brandId,
type: that.storeType,
pageNum: that.pageNum,
pageSize: that.pageSize
pageSize: that.pageSize,
wxEnterpriseId: that.wxEnterpriseId
};
getStoreList(para)
.then(res => {
......
......@@ -4,11 +4,11 @@
* @Author: 无尘
* @Date: 2020-09-01 17:16:25
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 11:20:52
* @LastEditTime: 2020-09-04 10:32:31
-->
<!--
<edit-tag-dialog :edit-row="editRow" @closeTag="closeTag"></edit-tag-dialog>
<edit-tag-dialog :brand-id="brandId" :edit-row="editRow" @closeTag="closeTag"></edit-tag-dialog>
import editTagDialog from '@/components/app/my-customer/edit-tag-dialog.vue';
-->
<template>
......@@ -20,28 +20,28 @@
:input-width="440"
:input-value.sync="form.tagName"
:holder="'请输入标签名称'"
:get-by-type="'word'"
:get-by-type="'normal'"
:max-length="10">
</limit-input>
</el-form-item>
<el-form-item label="所属分类" prop="classifyId">
<el-select v-model="form.classifyId" placeholder="请选择">
<el-form-item label="所属分类" prop="categoryId">
<el-select v-model="form.categoryId" placeholder="请选择">
<el-option
v-for="item in classOptions"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in tagsClassifyData"
:key="item.categoryId"
:label="item.categoryName"
:value="item.categoryId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="标签值" prop="tagVal">
<el-form-item label="标签值" prop="childList">
<el-tag
:key="index+'tag'"
v-for="(item, index) in form.tagVal"
v-for="(item, index) in form.childList"
closable
:disable-transitions="false"
@close="handleDel(index)">
{{item}}
{{item.tagValue}}
</el-tag>
<div>
<el-input
......@@ -56,7 +56,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" :loading="loadingBtn" @click="submit('tagForm')">确定</el-button>
<el-button type="primary" :loading="loadingBtn" @click="submit('tagForm')">{{form.tagId ? '保存' : '新建'}}</el-button>
</div>
</el-dialog>
</template>
......@@ -67,7 +67,7 @@ import commonAlertTip from '@/components/common/common-alert-tip.vue';
import { _debounce, emojiToStr } from '@/common/js/public.js';
import showMsg from '@/common/js/showmsg.js';
import api from '@/api/my-customer-app.js';
const { addClerkTag } = api;
const { addClerkTag, getTagClassify } = api;
export default {
name: 'TagClassifyDialog',
components: {
......@@ -75,36 +75,41 @@ export default {
commonAlertTip
},
props: {
brandId: {
type: String,
default: ''
},
editRow: {
type: Object,
default() {
return {
tagId: '',
tagName: '',
classifyId: '',
tagVal: []
categoryId: '',
childList: []
};
}
}
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
tipContent: '在好办新建的标签会在GIC虫洞派应用中也会同步创建并消耗license',
classOptions: [],
tagsClassifyData: [],
form: {
tagId: '',
tagName: '',
classifyId: '',
tagVal: []
categoryId: '',
childList: []
},
rules: {
tagName: [
{ required: true, message: '请输入标签名称', trigger: 'blur' },
],
classifyId: [
categoryId: [
{ required: true, message: '请选择所属分类', trigger: 'change' }
],
tagVal: [
childList: [
{ type: 'array', required: true, message: '请添加标签值', trigger: 'change' }
],
},
......@@ -116,6 +121,7 @@ export default {
// 生命周期 - 挂载完成(访问DOM元素)
mounted() {
const that = this;
that.getClassifyList();
if (Object.keys(that.editRow).length) {
that.form = JSON.parse(JSON.stringify(that.editRow));
}
......@@ -128,14 +134,19 @@ export default {
* @author: 无尘
*/
handleDel(index) {
this.form.tagVal.splice(index, 1);
this.form.childList.splice(index, 1);
},
handleInputConfirm() {
const that = this;
let inputValue = emojiToStr(that.inputValue);
if (inputValue) {
that.form.tagVal.push(inputValue);
that.form.childList.push(
{
tagValueId: that.form.tagId,
tagValue: inputValue
}
);
}
that.inputValue = '';
},
......@@ -144,12 +155,12 @@ export default {
*/
cancel() {
const that = this;
that.$emit('closeClassify', 'close');
that.$emit('closeTag', 'close');
},
handleClose() {
const that = this;
that.tableData = [];
that.$emit('closeClassify', 'close');
that.$emit('closeTag', 'close');
},
/**
* @description: 确定保存
......@@ -170,7 +181,9 @@ export default {
const param = {
tagId: that.form.tagId,
tagName: emojiToStr(that.form.tagName),
classifyId: that.form.classifyId
childList: JSON.stringify(that.form.childList),
categoryId: that.form.categoryId,
wxEnterpriseId: that.wxEnterpriseId
};
addClerkTag(param)
.then(res => {
......@@ -178,7 +191,7 @@ export default {
if (res.code == '0000') {
showMsg.showmsg('操作成功', 'success');
that.$refs['tagForm'].resetFields();
that.$emit('closeClassify', that.form.classifyName);
that.$emit('closeTag', 'success');
}else {
showMsg.showmsg(res.message || '未知错误', 'warning');
}
......@@ -186,6 +199,23 @@ export default {
.catch(error => {
that.loadBtn = false;
});
},
/**
* @description: 获取分类数据
*/
getClassifyList() {
const that = this;
const para = {
enterpriseId: that.brandId,
wxEnterpriseId: that.wxEnterpriseId
};
getTagClassify(para)
.then(res => {
that.tagsClassifyData = res.result || [];
})
.catch(function(error) {
});
}
},
watch: {
......
......@@ -4,10 +4,10 @@
* @Author: 无尘
* @Date: 2020-08-28 11:07:46
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 14:23:23
* @LastEditTime: 2020-09-04 10:46:19
-->
<!--
<edit-visiable :brand-id="brandId" @refreshData="refreshData"></edit-visiable>
<edit-visiable :brand-id="brandId" :set-type="setType" :select-mode="selectMode" :range-data="rangeData" @refreshData="refreshData"></edit-visiable>
import editVisiable from '@/components/app/my-customer/edit-visiable.vue';
-->
<template>
......@@ -41,7 +41,7 @@ import customerStoreGroup from '@/components/app/my-customer/customer-store-grou
import customerStore from '@/components/app/my-customer/customer-store.vue';
import commonAlertTip from '@/components/common/common-alert-tip.vue';
import fetch from '@/api/my-customer-app.js';
const { saveVisiable } = fetch;
const { saveVisiable, saveTagVisiable } = fetch;
import { _debounce } from '@/common/js/public';
import showMsg from '@/common/js/showmsg';
export default {
......@@ -63,7 +63,7 @@ export default {
},
selectMode: {
type: [ String, Number ],
default: '0' // 0 全部 1部分分组 2 部分门店
default: '' // 0 全部 1部分分组 2 部分门店
},
rangeData: {
type: [ Object, Array ],
......@@ -74,10 +74,11 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
setVisible: true,
tipContent: '修改后的内容将于次日生效',
formData: {
sendRange: '0',
sendRange: '',
selectList: []
},
selectGroupData: [], // 选择的分组数据
......@@ -157,10 +158,24 @@ export default {
postSave() {
const that = this;
const params = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
storeMode: that.formData.sendRange,
bingRange: that.formData.selectList
};
if (that.setType == 'crowd') {
that.saveCrowd(params);
}else {
that.saveTag(params);
}
},
/**
* @description: 保存人群可见范围
* @param {Object} params
* @author: 无尘
*/
saveCrowd(params) {
const that = this;
saveVisiable(params)
.then(res => {
that.loadingBtn = false;
......@@ -174,6 +189,27 @@ export default {
.catch(function(error) {
that.loadingBtn = false;
});
},
/**
* @description: 保存标签可见范围
* @param {Object} params
* @author: 无尘
*/
saveTag(params) {
const that = this;
saveTagVisiable(params)
.then(res => {
that.loadingBtn = false;
if (res.code == '0000') {
showMsg.showmsg('保存成功', 'success');
that.$emit('refreshData', 'success');
}else {
showMsg.showmsg(res.message || '接口异常', 'warning');
}
})
.catch(function(error) {
that.loadingBtn = false;
});
}
},
watch: {
......
......@@ -3,7 +3,7 @@
* @Author : 无尘
* @Date : 2020-08-13 14:02:22
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 11:20:32
* @LastEditTime: 2020-09-04 10:32:52
* @FilePath : haoban-4\src\components\app\my-customer\store-list.vue
-->
<!--
......@@ -81,6 +81,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
nameVisible: false,
departmentName: this.departObj.departmentName || '',
searchInput: '',
......@@ -158,6 +159,7 @@ export default {
getTableList() {
const that = this;
let para = {
wxEnterpriseId: that.wxEnterpriseId,
departmentId: that.departObj.storeGroupId,
enterpriseId: that.brandId,
searchName: that.searchInput || '', // 搜索字段
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-28 10:31:09
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 14:42:48
* @LastEditTime: 2020-09-04 10:35:44
-->
<!--
<sync-crowd-dialog :brand-id="brandId" @refreshData="refreshData"></sync-crowd-dialog>
......@@ -20,7 +20,7 @@
<div>
<el-input placeholder="请输入人群名称" maxlength="50" v-model="searchVal" style="width: 292px;" prefix-icon="el-icon-search" @keyup.native="value => toInput(value)" clearable @clear="clearInput"></el-input><el-select class="w-165 m-l-10" v-model="classifyId" placeholder="所有分类" @change="changeCondition">
<el-option label="所有分类" value=""></el-option>
<el-option v-for="item in classifyList" :key="item.categoryId" :label="itemcategoryName" :value="item.categoryId"> </el-option>
<el-option v-for="item in classifyList" :key="item.sceneCrowdCategoryId" :label="itemcategoryName" :value="item.sceneCrowdCategoryId"> </el-option>
</el-select>
</div>
</div>
......@@ -30,22 +30,22 @@
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column prop="" label="人群名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.memberGroupName || '--' }}
{{ scope.row.sceneCrowdName || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="所属分类" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.categoryName || '--' }}
{{ scope.row.sceneCrowdCategoryName || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="到期时间">
<template slot-scope="scope">
<div class="color-606266 line-18">{{ scope.row.overTime | timeStampToYmd }} {{ !scope.row.overTime? '--':'' }}</div>
<div class="color-606266 line-18">{{ scope.row.overTime | timeStampToHms }} {{ !scope.row.overTime? '--':'' }}</div>
<div class="color-606266 line-18">{{ scope.row.sceneCrowdExpireTime | timeStampToYmd }} {{ !scope.row.sceneCrowdExpireTime? '--':'' }}</div>
<div class="color-606266 line-18">{{ scope.row.sceneCrowdExpireTime | timeStampToHms }} {{ !scope.row.sceneCrowdExpireTime? '--':'' }}</div>
</template>
</el-table-column>
</el-table>
<div class="block common-wrap__page text-right m-t-24" v-if="tableData.length != 0">
<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>
</div>
</div>
......@@ -74,6 +74,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
dialogVisible: true,
tipContent: '从GIC最多可同步20个场景人群',
searchVal: '',
......@@ -118,8 +119,9 @@ export default {
postAdd() {
const that = this;
const params = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
categoryIds: that.multipleSelection.map(ele => ele.categoryId).join(',')
sceneCrowdCategoryIds: that.multipleSelection.map(ele => ele.sceneCrowdCategoryId).join(',')
};
saveSync(params)
.then(res => {
......@@ -216,6 +218,7 @@ export default {
getGroupClassify() {
const that = this;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId
};
getClassifyData(para)
......@@ -233,14 +236,18 @@ export default {
const that = this;
that.loadingPage = true;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
keyword: that.searchVal,
categoryId: that.classifyId
sceneCrowdCategoryId: that.classifyId,
pageNum: that.currentPage, // 当前页
pageSize: that.pageSize, // 一页显示个数
};
getSyncMemberData(para)
.then(res => {
that.loadingPage = false;
that.tableData = res.result || [];
that.tableData = res.result.result || [];
that.total = res.result.totalCount;
})
.catch(function(error) {
that.loadingPage = false;
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-09-01 13:53:59
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 14:49:43
* @LastEditTime: 2020-09-04 10:33:16
-->
<!--
......@@ -12,21 +12,21 @@
import tagClassifyDialog from '@/components/app/my-customer/tag-classify-dialog.vue';
-->
<template>
<el-dialog :title="form.tagCategoryId ? '编辑分类' : '新建分类'" width="600px" :visible.sync="editVisible" :before-close="handleClose">
<el-dialog :title="form.categoryId ? '编辑分类' : '新建分类'" width="600px" :visible.sync="editVisible" :before-close="handleClose">
<el-form :model="form" :rules="rules" ref="tagForm" label-width="110px">
<el-form-item label="分类名称" prop="tagCategoryName">
<el-form-item label="分类名称" prop="categoryName">
<limit-input
:input-width="440"
:input-value.sync="form.tagCategoryName"
:input-value.sync="form.categoryName"
:holder="'请输入分类名称'"
:get-by-type="'word'"
:get-by-type="'normal'"
:max-length="10">
</limit-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" :loading="loadingBtn" @click="submit('tagForm')">确定</el-button>
<el-button type="primary" :loading="loadingBtn" @click="submit('tagForm')">{{form.categoryId ? '保存' : '新建'}}</el-button>
</div>
</el-dialog>
</template>
......@@ -47,20 +47,21 @@ export default {
type: Object,
default() {
return {
tagCategoryId: '',
tagCategoryName: ''
categoryId: '',
categoryName: ''
};
}
}
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
form: {
tagCategoryId: '',
tagCategoryName: ''
categoryId: '',
categoryName: ''
},
rules: {
tagCategoryName: [
categoryName: [
{ required: true, message: '请输入分类名称', trigger: 'blur' },
]
},
......@@ -106,8 +107,9 @@ export default {
const that = this;
that.loadBtn = true;
const param = {
tagCategoryId: that.form.tagCategoryId,
tagCategoryName: emojiToStr(that.form.tagCategoryName)
wxEnterpriseId: that.wxEnterpriseId,
categoryId: that.form.categoryId,
categoryName: emojiToStr(that.form.categoryName)
};
addClassify(param)
.then(res => {
......@@ -115,7 +117,7 @@ export default {
if (res.code == '0000') {
showMsg.showmsg('操作成功', 'success');
that.$refs['tagForm'].resetFields();
that.$emit('closeClassify', that.form.tagCategoryName);
that.$emit('closeClassify', that.form.categoryName);
}else {
showMsg.showmsg(res.message || '未知错误', 'warning');
}
......
......@@ -4,11 +4,11 @@
* @Author: 无尘
* @Date: 2019-07-29 20:00:00
* @LastEditors: 无尘
* @LastEditTime: 2020-09-01 13:59:40
* @LastEditTime: 2020-09-03 18:02:40
-->
<!--
限制输入框组件
<limitInput
<limit-input-blur
:input-width="500"
:limit-class="'limit-color'"
:disflag='!childItem.fieldEdited'
......@@ -16,7 +16,7 @@
:holder="'请输入详细地址'"
:get-by-type="'word'"
:max-length="40">
</limitInput>
</limit-input-blur>
-->
<template>
<div :class="['input-line-cell', limitClass]" :style="{ width: inputWidth + 'px' }">
......
......@@ -4,11 +4,11 @@
* @Author: 无尘
* @Date: 2018-12-06 13:44:22
* @LastEditors: 无尘
* @LastEditTime: 2020-09-01 14:01:07
* @LastEditTime: 2020-09-03 18:07:27
-->
<!--
限制输入框组件
<limitInput
<limit-input
:input-width="500"
:limit-class="'limit-color'"
:disflag='!childItem.fieldEdited'
......@@ -16,7 +16,7 @@
:holder="'请输入详细地址'"
:get-by-type="'word'"
:max-length="40">
</limitInput>
</limit-input>
import limitInput from '@/components/limit-input.vue';
-->
<template>
......@@ -50,7 +50,7 @@ export default {
// 字或字符判断类型
getByType: {
type: String,
default: 'word' // word: 字, char: 字符
default: 'word' // word: 字, char: 字符, normal: 一个字一个字符都算一个
},
holder: {
......@@ -81,6 +81,10 @@ export default {
let that = this;
that.limitLength = that.maxLength;
that.itemValue = that.inputValue || '';
if (that.getByType == 'normal') {
that.inputNum = that.inputValue.length;
return false;
}
if (that.getByType == 'word') {
that.inputNum = strLength.getZhLen(that.inputValue);
} else {
......@@ -91,10 +95,17 @@ export default {
/**
* @description: 当前函数信息
* @param {String} value
* @returns {Boolean}
* @author: 无尘
*/
toInput: function(value) {
const that = this;
if (that.getByType == 'normal') {
that.itemValue = String(value.target.value).trim();
that.inputNum = that.itemValue.length;
that.$emit('update:inputValue', that.itemValue);
return false;
}
let temp = '';
if (that.getByType == 'word') {
temp = strLength.getByteVal(value.target.value, that.limitLength);
......
......@@ -4,14 +4,14 @@
* @Author: 无尘
* @Date: 2020-08-28 16:51:22
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 15:20:25
* @LastEditTime: 2020-09-04 10:37:03
-->
<template>
<div class="common-app-right">
<div class="common-app-right no-padding">
<div class="clerk-tag-body flex">
<div class="clerk-tag-left border-box">
<div class="clerk-tag-add">
<div class="clerk-tag-add text-center">
<el-button icon="el-icon-plus" @click="toAddCate">新建分类</el-button>
</div>
<tag-classify-list :brand-id="brandId" @refreshClassify="refreshClassify" @changeClass="changeClass"></tag-classify-list>
......@@ -20,10 +20,10 @@
<div class="clerk-tag-search">
<div class="flex flex-space-between">
<div><el-input placeholder="请输入标签名称" maxlength="50" v-model="searchVal" style="width: 298px;" prefix-icon="el-icon-search" @keyup.native="value => toInput(value)" clearable @clear="clearInput"></el-input></div>
<div><el-button type="primary">新建标签</el-button></div>
<div><el-button type="primary" @click="toAddTag">新建标签</el-button></div>
</div>
</div>
<div>
<div class="m-t-20">
<el-table
:data="tagsData"
row-key="memberTagId"
......@@ -55,21 +55,28 @@
</div>
</div>
<tag-classify-dialog v-if="showTagCate" @closeClassify="closeClassify"></tag-classify-dialog>
<edit-tag-dialog v-if="showTagDialog" :edit-row="editRow" @closeTag="closeTag"></edit-tag-dialog>
<edit-visiable v-if="showTagVisiable" :brand-id="brandId" :set-type="'tag'" :select-mode="selectMode" :range-data="rangeData" @refreshData="refreshData"></edit-visiable>
</div>
</template>
<script>
import tagClassifyList from '@/components/app/my-customer/tag-classify-list.vue';
import tagClassifyDialog from '@/components/app/my-customer/tag-classify-dialog.vue';
import editTagDialog from '@/components/app/my-customer/edit-tag-dialog.vue';
import editVisiable from '@/components/app/my-customer/edit-visiable.vue';
import fetch from '@/api/my-customer-app.js';
const { getTagClassify, getClerkTag, sortClerkTag, delClerkTag } = fetch;
const { getTagClassify, getClerkTag, getTagDetail, getTagVisiable, sortClerkTag, delClerkTag } = fetch;
import { _debounce } from '@/common/js/public.js';
import showMsg from '@/common/js/showmsg.js';
import Sortable from 'sortablejs';
export default {
name: 'ClerkTag',
components: {
tagClassifyList
tagClassifyList,
tagClassifyDialog,
editTagDialog,
editVisiable
},
props: {
brandId: {
......@@ -79,13 +86,18 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
currentClassify: '',
tagsClassifyData: [],
tagsData: [],
showTagDialog: false,
showTagVisiable: false,
showTagDialog: false, // 标签
loading: false,
showTagCate: false
showTagCate: false, // 分类
editRow: {},
// 可见范围
showTagVisiable: false, // 可见范围
selectMode: '',
rangeData: []
};
},
// 生命周期 - 挂载完成(访问DOM元素)
......@@ -141,10 +153,12 @@ export default {
}
});
},
setSort() {
setSort(arr) {
const that = this;
const para = {
enterpriseId: that.brandId
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
tagIds: arr.map(ele => ele.tagId).join(',')
};
sortClerkTag(para)
.then(res => {
......@@ -169,32 +183,73 @@ export default {
that.getClassifyList();
},
/**
* 编辑标签
* @description: 添加标签
* @author: 无尘
*/
toAddTag() {
const that = this;
that.showTagDialog = true;
},
/**
* @description: 编辑标签
* @param {Number} index
* @param {Object} row
*/
toEditTag(index, row) {
const that = this;
that.showTagDialog = true;
that.getTagData(row.tagId);
},
closeTag(res) {
const that = this;
that.showTagDialog = false;
if (res == 'close') {
return false;
}
that.getTableList();
},
getTagData(tagId) {
const that = this;
const para = { tagId };
getTagDetail(para)
.then(res => {
that.editRow = res.result || {};
that.showTagDialog = true;
})
.catch(function(error) {
});
},
/**
* 编辑可见范围
* @description: 编辑可见范围
* @param {Number} index
* @param {Object} row
*/
toEditVisiable(index, row) {
const that = this;
that.showTagVisiable = true;
that.getVisiableData(row.tagId);
},
getVisiableData(tagId) {
const that = this;
const para = { tagId };
getTagVisiable(para)
.then(res => {
that.selectMode = res.result.storeMode;
that.rangeData = res.result.bindRange || {};
that.showTagVisiable = true;
})
.catch(function(error) {
});
},
/**
* 编辑后刷新数据
* @description: 编辑后刷新数据
*/
refreshTagData() {
const that = this;
that.getTableList();
},
/**
* 删除标签
* @description: 删除标签
* @param {Number} index
* @param {Object} row
*/
......@@ -228,26 +283,27 @@ export default {
});
},
/**
* 搜索输入
* @description: 搜索输入
*/
toInput: _debounce(function() {
const that = this;
that.getTableList();
}, 500),
/**
* 搜索清除
* @description: 搜索清除
*/
clearInput() {
const that = this;
that.getTableList();
},
/**
* 获取列表数据
* @description: 获取列表数据
*/
getTableList() {
const that = this;
that.loading = true;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
keyword: that.searchVal,
tagCategoryId: that.currentClassify
......@@ -262,11 +318,14 @@ export default {
});
},
/**
* 获取分类数据
* @description: 获取分类数据
*/
getClassifyList() {
const that = this;
const para = {};
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId
};
getTagClassify(para)
.then(res => {
that.tagsClassifyData = res.result || [];
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-27 10:16:37
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 14:43:34
* @LastEditTime: 2020-09-04 10:49:48
-->
<template>
......@@ -16,7 +16,7 @@
<div>
<el-input placeholder="请输入人群名称" maxlength="50" v-model="searchVal" style="width: 408px;" prefix-icon="el-icon-search" @keyup.native="value => toInput(value)" clearable @clear="clearInput"></el-input><el-select class="w-162 m-l-10" v-model="classifyId" placeholder="所有分类" @change="changeCondition">
<el-option label="所有分类" value=""></el-option>
<el-option v-for="item in classifyList" :key="item.categoryId" :label="item.categoryName" :value="item.categoryId"> </el-option>
<el-option v-for="item in classifyList" :key="item.sceneCrowdCategoryId" :label="item.sceneCrowdCategoryName" :value="item.sceneCrowdCategoryId"> </el-option>
</el-select>
</div>
<div><el-button type="primary" @click="toSync">同步场景人群</el-button></div>
......@@ -38,20 +38,20 @@
prop=""
label="人群名称"
show-overflow-tooltip>
<template slot-scope="scope">{{scope.row.memberGroupName || '--'}}</template>
<template slot-scope="scope">{{scope.row.sceneCrowdName || '--'}}</template>
</el-table-column>
<el-table-column
prop=""
label="所属分类"
show-overflow-tooltip>
<template slot-scope="scope">{{scope.row.categoryName || '--'}}</template>
<template slot-scope="scope">{{scope.row.sceneCrowdCategoryName || '--'}}</template>
</el-table-column>
<el-table-column
prop=""
label="到期时间">
<template slot-scope="scope">
<div class="line-18">{{ scope.row.overTime | timeStampToYmd }} {{ scope.row.overTime ? '' : '--'}}</div>
<div class="line-18">{{ scope.row.overTime | timeStampToHms }} {{ scope.row.overTime ? '' : '--'}}</div>
<div class="line-18">{{ scope.row.sceneCrowdExpireTime | timeStampToYmd }} {{ scope.row.sceneCrowdExpireTime ? '' : '--'}}</div>
<div class="line-18">{{ scope.row.sceneCrowdExpireTime | timeStampToHms }} {{ scope.row.sceneCrowdExpireTime ? '' : '--'}}</div>
</template>
</el-table-column>
<el-table-column
......@@ -64,7 +64,7 @@
</div>
</div>
<sync-crowd-dialog v-if="showSync" :brand-id="brandId" @refreshData="refreshData"></sync-crowd-dialog>
<edit-visiable v-if="showSelectStore" :select-mode="selectMode" :range-data="rangeData" :brand-id="brandId" @refreshData="refreshData"></edit-visiable>
<edit-visiable v-if="showSelectStore" :set-type="'crowd'" :select-mode="selectMode" :range-data="rangeData" :brand-id="brandId" @refreshData="refreshData"></edit-visiable>
</div>
</template>
......@@ -73,7 +73,7 @@ import commonAlertTip from '@/components/common/common-alert-tip.vue';
import syncCrowdDialog from '@/components/app/my-customer/sync-crowd-dialog.vue';
import editVisiable from '@/components/app/my-customer/edit-visiable.vue';
import fetch from '@/api/my-customer-app.js';
const { getGroupData, getClassifyData, postSortGroup } = fetch;
const { getGroupData, getClassifyData, getVisiable, postSortGroup } = fetch;
import { _debounce } from '@/common/js/public.js';
import showMsg from '@/common/js/showmsg.js';
import Sortable from 'sortablejs';
......@@ -92,6 +92,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
tipContent: 'GIC设置场景人群后,好办顾客人群列表最多同步20个人群,次日刷新,每日刷新一次;',
tipTwoContent: 'GIC中设置的场景人群到期后,好办移动端将不再展示该条人群;',
searchVal: '',
......@@ -146,9 +147,21 @@ export default {
*/
toEdit(index, row) {
const that = this;
that.showSelectStore = true;
that.getVisiableData(row.sceneCrowdId);
},
getVisiableData(sceneCrowdId) {
const that = this;
const para = { sceneCrowdId };
getVisiable(para)
.then(res => {
that.selectMode = res.result.storeMode;
that.rangeData = res.result.bindRange || {};
that.showSelectStore = true;
})
.catch(function(error) {
});
},
/**
* @description: 搜索输入
*/
......@@ -190,10 +203,12 @@ export default {
}
});
},
setSort() {
setSort(arr) {
const that = this;
const para = {
enterpriseId: that.brandId
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
sceneCrowdIds: arr.map(ele => ele.sceneCrowdId).join(',')
};
postSortGroup(para)
.then(res => {
......@@ -214,6 +229,7 @@ export default {
getGroupClassify() {
const that = this;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId
};
getClassifyData(para)
......@@ -232,9 +248,10 @@ export default {
const that = this;
that.loading = true;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
keyword: that.searchVal,
categoryId: that.classifyId
sceneCrowdCategoryId: that.classifyId
};
getGroupData(para)
.then(res => {
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-27 14:17:07
* @LastEditTime: 2020-09-04 10:09:38
-->
<template>
<div class="app-detail-wrap">
......@@ -207,6 +207,7 @@ export default {
const that = this;
return new Promise((resolve, reject) => {
let para = {
wxEnterpriseId: that.wxEnterpriseId,
storeId: that.storeObj.storeId
};
getAssignStatus(para)
......@@ -381,7 +382,7 @@ export default {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
wxEnterpriseId: that.wxEnterpriseId,
};
getGroupList(para)
.then(async res => {
......@@ -438,6 +439,7 @@ export default {
toGetNavData() {
const that = this;
let params = {
wxEnterpriseId: that.wxEnterpriseId,
departmentId: that.storeObj.storeGroupId
};
getNavChain( params)
......@@ -460,7 +462,7 @@ export default {
const that = this;
const para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
wxEnterpriseId: that.wxEnterpriseId,
storeId: that.storeObj.storeId
};
getClerkList(para)
......@@ -478,7 +480,7 @@ export default {
const that = this;
const para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
wxEnterpriseId: that.wxEnterpriseId,
pageNum: that.currentPage,
pageSize: that.pageSize,
storeId: that.storeObj.storeId,
......
......@@ -4,16 +4,16 @@
* @Author: 无尘
* @Date: 2020-08-27 10:16:37
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 15:51:27
* @LastEditTime: 2020-09-04 10:10:29
-->
<template>
<div class="common-app-right">
<div class="customer-data-body">
<div class="m-b-20">
<div class="m-b-10">
<el-checkbox class="w-195" v-model="customerShowData.allStoreOrder">展示所有门店的订单</el-checkbox>
<div class="font-12 color-909399 set-tip-item">注:保存勾选项后,门店导购和店长可查看顾客在本店以外的消费订单</div>
</div>
<div class="m-b-10">
<div class="m-b-20">
<el-checkbox class="w-195" v-model="customerShowData.shopOrder">展示微商城的订单</el-checkbox>
<div class="font-12 color-909399 set-tip-item">注:保存勾选项后,门店导购和店长可查看顾客在微商城的消费订单</div>
</div>
......@@ -46,6 +46,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
customerShowData: {
allStoreOrder: false,
shopOrder: false,
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-27 10:16:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-28 14:58:52
* @LastEditTime: 2020-09-04 10:10:21
-->
<template>
......@@ -43,6 +43,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
customerShowData: {
mainStoreFlag: false,
minorStoreFlag: false,
......@@ -74,6 +75,7 @@ export default {
setData() {
const that = this;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
mainStoreFlag: that.customerShowData.mainStoreFlag ? 1 : '0',
minorStoreFlag: that.customerShowData.minorStoreFlag ? 1 : '0',
......@@ -100,6 +102,7 @@ export default {
getShowData() {
const that = this;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId
};
getShowSet(para)
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-27 11:36:51
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 16:00:35
* @LastEditTime: 2020-09-04 10:08:10
-->
<template>
......@@ -93,6 +93,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
tipContent: '当商户有多个会员卡和服务号时,会造成单家门店适用于多个会员卡或服务号,即单个顾客会有多个域的身份信息,这容易造成门店成员的困扰。请为以下会员卡和服务号域做权重排序,当顾客有多个域的身份信息时,门店成员将只能看到权重最高域的一个身份信息。',
memberCardData: [], // 会员卡
serviceNumData: [], // 服务号
......@@ -134,6 +135,7 @@ export default {
setSort(arr, data) {
const that = this;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId,
sorts: arr.map(ele => ele.id).join(','),
type: data == 'memberCardData' ? '0' : '1'
......@@ -160,6 +162,7 @@ export default {
that.loadingMember = true;
that.loadingService = true;
const para = {
wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId
};
getMemberData(para)
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-09-03 09:50:19
* @LastEditTime: 2020-09-04 10:07:19
-->
<template>
<div class="my-customer-wrap common-set-wrap">
......@@ -38,8 +38,7 @@ export default {
},
data() {
return {
bgHeight: window.screen.availHeight - 380 + 'px',
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
activeSelTab: '1',
activeTab: '1',
// 面包屑参数
......@@ -205,6 +204,9 @@ export default {
padding: 20px;
box-sizing: border-box;
background: #fff;
&.no-padding {
padding: 0;
}
}
}
}
......
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