Commit 7fbe6c02 by 无尘

fix: 修改选择商户和人群

parent 10d18ac8
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-27 09:29:13
* @LastEditors: 无尘
* @LastEditTime: 2020-09-01 11:41:14
* @LastEditTime: 2020-09-03 14:47:48
*/
import getFetch from './get-fetch.js';
......@@ -57,42 +57,44 @@ let api = {
useIntercept: false
},
// 人群场景
getGroupData: '', // 获取人群场景数据
getClassifyData: '', // 获取分类数据
getGroupData: '/member-group-list', // 获取人群场景数据
getClassifyData: '/member-group-category-list', // 获取分类数据
postSortGroup: {
// 排序
url: '/',
url: '/member-group-sort',
method: 'post',
useFormData: true,
useIntercept: false
},
getSyncMemberData: '', // 获取人群场景同步数据
getSyncMemberData: '/member-group-hb-list', // 获取人群场景同步数据
saveSync: {
// 保存同步
url: '/',
url: '/member-group-save',
method: 'post',
useFormData: true,
useIntercept: false
},
getVisiable: '/member-group-range-view', // 获取可见范围详情
saveVisiable: {
// 保存同步
url: '/',
// 保存可见范围
url: '/member-group-range-save',
method: 'post',
useFormData: true,
useIntercept: false
},
// 导购标签
getTagClassify: '', // 获取导购标签分类
addClassify: '', // 新增分类
getTagClassify: '/tagCategoryList', // 获取导购标签分类
addClassify: '/tag-category-add', // 新增分类
delClassify: {
// 删除分类
url: '/',
url: '/tag-category-del',
method: 'post',
useFormData: true,
useIntercept: false
},
getClerkTag: '', // 获取导购标签
addClerkTag: '', // 新增导购标签
getClerkTag: '/member-tag-list', // 获取导购标签
addClerkTag: '/member-tag-add', // 新增导购标签
editClerkTag: '/member-tag-edit', // 编辑导购标签
delClerkTag: {
// 删除导购标签
url: '/',
......@@ -100,6 +102,21 @@ let api = {
useFormData: true,
useIntercept: false
},
sortClerkTag: {
// 导购标签排序
url: '/',
method: 'post',
useFormData: true,
useIntercept: false
},
getTagVisiable: '/member-tag-range-view', // 获取可见范围详情
saveTagVisiable: {
// 保存可见范围
url: '/member-tag-range-save',
method: 'post',
useFormData: true,
useIntercept: false
},
};
api = getFetch(api, '/hb-manage-web');
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-08-28 16:11:02
* @LastEditTime: 2020-09-03 11:22:53
-->
<!--
<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>
......@@ -140,7 +140,7 @@ export default {
},
methods: {
/**
* 单个值改变
* @description: 单个值改变
* @param {Boolean} e
* @param {Object} item
*/
......@@ -165,7 +165,7 @@ export default {
});
},
/**
* 手动分配选择
* @description: 手动分配选择
* @param {Boolean} e
*/
async changeHand(e) {
......@@ -179,14 +179,14 @@ export default {
}
},
/**
* 手动值改变,计算总数
* @description: 手动值改变,计算总数
*/
handleChange() {
const that = this;
that.totalCalc();
},
/**
* 手动值改变,计算总数
* @description: 手动值改变,计算总数
* @param {Object} e
* @param {Object} item
*/
......@@ -208,7 +208,7 @@ export default {
that.totalPeople = num;
},
/**
* 单选
* @description: 单选
* @param {Array} value
*/
async handleCheckedChange(value) {
......@@ -226,7 +226,7 @@ export default {
}
},
/**
* 全选
* @description: 全选
* @param {Array} value
*/
async handleCheckAllChange(value) {
......@@ -265,7 +265,7 @@ export default {
});
},
/**
* 获取导购
* @description: 获取导购
*/
getClerkData() {
const that = this;
......@@ -294,7 +294,7 @@ export default {
});
},
/**
* 获取会员数量
* @description: 获取会员数量
*/
getMemberData() {
const that = this;
......@@ -335,7 +335,7 @@ export default {
that.$emit('closeText');
},
/**
* 保存
* @description: 保存
*/
submitForm: _debounce(function() {
const that = this;
......@@ -372,7 +372,7 @@ export default {
});
},
/**
* 设置人数和获取数量判断
* @description: 设置人数和获取数量判断
*/
setNum() {
const that = this;
......
......@@ -4,11 +4,11 @@
* @Author: 无尘
* @Date: 2020-08-28 15:24:12
* @LastEditors: 无尘
* @LastEditTime: 2020-08-28 16:11:15
* @LastEditTime: 2020-09-03 14:17:26
-->
<!--
门店绑定-选择分组
<customer-store-group :company-id="companyId" :select-group="selectGroup" @checkGroupIds="checkGroupIds"></customer-store-group>
<customer-store-group :brand-id="brandId" :select-group="selectGroup" @checkGroupIds="checkGroupIds"></customer-store-group>
import customerStoreGroup from '@/components/app/my-customer/customer-store-group.vue';
-->
<template>
......@@ -32,7 +32,7 @@ const { getGroupList } = fetch;
export default {
name: 'CustomerStoreGroup',
props: {
companyId: {
brandId: {
type: String,
default: ''
},
......@@ -60,7 +60,7 @@ export default {
},
mounted() {
const that = this;
if (that.companyId) {
if (that.brandId) {
that.getGroup();
}
if (that.selectGroup.length) {
......@@ -75,7 +75,7 @@ export default {
},
methods: {
/**
* 过滤搜索
* @description: 过滤搜索
* @param {String} value
* @param {Object} data
* @returns {Boolean}
......@@ -85,7 +85,7 @@ export default {
return data.label.indexOf(value) !== -1;
},
/**
* 输入
* @description: 输入
* @param {Object} e
* @param {String} value
* @returns {Boolean}
......@@ -97,14 +97,14 @@ export default {
}
}, 200),
/**
* 清空
* @description: 清空
* @returns {Boolean}
*/
clearSearch() {
return false;
},
/**
* 选择 tree 节点,获取选择节点信息
* @description: 选择 tree 节点,获取选择节点信息
* @param {Object} e
* @param {Array} checkedKeys
*/
......@@ -144,13 +144,13 @@ export default {
},
/**
* 获取门店分组
* @description: 获取门店分组
*/
getGroup() {
const that = this;
const para = {
type: that.storeType,
enterpriseId: that.companyId
enterpriseId: that.brandId
};
getGroupList(para)
......@@ -166,9 +166,7 @@ export default {
// 存一份数据自己搜索
// console.log(that.groupData)
that.groupDataCopy = JSON.parse(JSON.stringify(res.result));
that.$nextTick(()=>{
that.setSelectCheck();
});
})
.catch(function(error) {
......@@ -191,7 +189,7 @@ export default {
});
}
},
companyId(val) {
brandId(val) {
const that = this;
if (!!val) {
that.getGroup();
......
......@@ -4,10 +4,10 @@
* @Author: 无尘
* @Date: 2020-08-28 15:24:42
* @LastEditors: 无尘
* @LastEditTime: 2020-08-31 10:47:30
* @LastEditTime: 2020-09-03 14:18:01
-->
<!--
<customer-store :company-id="companyId" :select-store="selectStore" @checkStoreIds="checkStoreIds"></customer-store>
<customer-store :brand-id="brandId" :select-store="selectStore" @checkStoreIds="checkStoreIds"></customer-store>
import customerStore from '@/components/app/my-customer/customer-store.vue';
-->
<template>
......@@ -39,7 +39,7 @@ const { getStoreList } = fetch;
export default {
name: 'CustomerStore',
props: {
companyId: {
brandId: {
type: String,
default: ''
},
......@@ -68,7 +68,7 @@ export default {
const that = this;
that.stores = [];
that.storesCopy = [];
if (!!that.companyId) {
if (!!that.brandId) {
that.pageNum = 1;
that.getStoreData();
}
......@@ -81,7 +81,7 @@ export default {
methods: {
/**
* 选择改变
* @description: 选择改变
* @param {Array} value
*/
handleStoresChange(value) {
......@@ -95,7 +95,7 @@ export default {
that.$emit('checkStoreIds', JSON.parse(JSON.stringify(arr)));
},
/**
* 输入
* @description: 输入
* @param {Object} e
* @param {String} value
*/
......@@ -109,7 +109,7 @@ export default {
}, 500),
/**
* 清空
* @description: 清空
*/
clearSearch() {
const that = this;
......@@ -119,13 +119,13 @@ export default {
},
/**
* 获取门店
* @description: 获取门店
*/
getStoreData() {
const that = this;
const para = {
search: that.searchSelect,
enterpriseId: that.companyId,
enterpriseId: that.brandId,
type: that.storeType,
pageNum: that.pageNum,
pageSize: that.pageSize
......@@ -162,7 +162,7 @@ export default {
that.dailyRuleForm.stores = [];
}
},
companyId(val) {
brandId(val) {
const that = this;
if (!!val) {
that.pageNum = 1;
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-09-01 17:16:25
* @LastEditors: 无尘
* @LastEditTime: 2020-09-02 09:25:44
* @LastEditTime: 2020-09-03 11:20:52
-->
<!--
......@@ -140,7 +140,7 @@ export default {
that.inputValue = '';
},
/**
* 关闭弹窗
* @description: 关闭弹窗
*/
cancel() {
const that = this;
......@@ -152,7 +152,7 @@ export default {
that.$emit('closeClassify', 'close');
},
/**
* 确定保存
* @description: 确定保存
* @param {String} formName
* @returns {Boolean}
*/
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-28 11:07:46
* @LastEditors: 无尘
* @LastEditTime: 2020-08-28 16:11:43
* @LastEditTime: 2020-09-03 14:23:23
-->
<!--
<edit-visiable :brand-id="brandId" @refreshData="refreshData"></edit-visiable>
......@@ -13,7 +13,7 @@
<template>
<el-dialog width="554px" title="编辑可见范围" :visible.sync="setVisible" append-to-body :before-close="handleClose">
<div class="bind-store-body">
<div class="edit-visiable-tip">
<div class="edit-visiable-tip m-b-20">
<common-alert-tip :width="'100%'" :tip-content="tipContent"></common-alert-tip>
</div>
<div class="el-form-item el-form-item--large">
......@@ -25,14 +25,14 @@
<el-radio class="m-l-40 m-r-8" v-model="formData.sendRange" label="1" @change="changeRange">选择分组</el-radio>
<el-radio class="m-l-40 m-r-8" v-model="formData.sendRange" label="2" @change="changeRange">选择门店</el-radio>
<div v-if="(formData.sendRange == '1' || formData.sendRange == '2') && !formData.selectList.length || String(formData.sendRange) == 'null' || formData.sendRange === ''" class="el-form-item__error">请选择绑定门店</div>
<customer-store-group v-if="formData.sendRange == '1'" :company-id="enterpriseId" :select-group="selectGroupData" @checkGroupIds="checkGroupIds"></customer-store-group>
<customer-store v-if="formData.sendRange == '2'" :company-id="enterpriseId" :select-store="selectStoreData" @checkStoreIds="checkStoreIds"></customer-store>
<customer-store-group v-if="formData.sendRange == '1'" :brand-id="brandId" :select-group="selectGroupData" @checkGroupIds="checkGroupIds"></customer-store-group>
<customer-store v-if="formData.sendRange == '2'" :brand-id="brandId" :select-store="selectStoreData" @checkStoreIds="checkStoreIds"></customer-store>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click.stop="cancel">取消</el-button>
<el-button type="primary" :loading="loadingBtn" @click.stop="submitForm">确定</el-button>
<el-button type="primary" :loading="loadingBtn" @click.stop="submitForm">保存</el-button>
</div>
</el-dialog>
</template>
......@@ -52,11 +52,12 @@ export default {
commonAlertTip
},
props: {
isSelectAll: {
type: [ String, Number ],
default: '0' // 0 没有绑定, 1 被绑定,禁用选择所有门店
// crowd: 场景人群; tag: 导购标签
setType: {
type: String,
default: ''
},
enterpriseId: {
brandId: {
type: String,
default: ''
},
......@@ -93,7 +94,7 @@ export default {
},
methods: {
/**
* 改变选择范围
* @description: 改变选择范围
* @param {String} e
*/
changeRange(e) {
......@@ -102,25 +103,25 @@ export default {
that.formData.selectList = [];
},
/**
* 关闭弹窗
* @description: 关闭弹窗
* @param {Function} done
*/
handleClose(done) {
const that = this;
done();
that.$emit('closeSet', 'close');
that.$emit('refreshData', 'close');
that.selectGroupData = [];
that.selectStoreData = [];
},
cancel() {
const that = this;
that.$emit('closeSet', 'close');
that.$emit('refreshData', 'close');
that.selectGroupData = [];
that.selectStoreData = [];
},
/**
* 每次选择分组
* @description: 每次选择分组
* @param {Array} nodes
*/
checkGroupIds: function(nodes) {
......@@ -128,7 +129,7 @@ export default {
that.formData.selectList = JSON.parse(JSON.stringify(nodes));
},
/**
* 每次选择门店
* @description: 每次选择门店
* @param {Array} nodes
*/
checkStoreIds: function(nodes) {
......@@ -136,7 +137,7 @@ export default {
that.formData.selectList = JSON.parse(JSON.stringify(nodes));
},
/**
* 确定
* @description: 确定
* @returns {Boolean}
*/
submitForm: _debounce(function() {
......@@ -156,14 +157,16 @@ export default {
postSave() {
const that = this;
const params = {
enterpriseId: that.brandId
enterpriseId: that.brandId,
storeMode: that.formData.sendRange,
bingRange: that.formData.selectList
};
saveVisiable(params)
.then(res => {
that.loadingBtn = false;
if (res.code == '0000') {
showMsg.showmsg('编辑成功', 'success');
that.$emit('closeSet', 'success');
showMsg.showmsg('保存成功', 'success');
that.$emit('refreshData', 'success');
}else {
showMsg.showmsg(res.message || '接口异常', 'warning');
}
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-14 16:51:07
* @LastEditors: 无尘
* @LastEditTime: 2020-08-28 16:11:55
* @LastEditTime: 2020-09-03 11:19:46
-->
<!--
<org-tree v-if="item.children.length" :item-data="item.children" @getSelectData="getSelectData"></org-tree>
......@@ -87,7 +87,7 @@ export default {
},
methods: {
/**
* 获取选中部门/门店数据
* @description: 获取选中部门/门店数据
* @param {Object} obj
*/
getSelectData(obj) {
......@@ -96,7 +96,7 @@ export default {
that.$emit('getSelectData', obj);
},
/**
* 展开或者关闭下级
* @description: 展开或者关闭下级
* @param {Object} item
*/
async toggleExpand(item) {
......
......@@ -3,7 +3,7 @@
* @Author : 无尘
* @Date : 2020-08-13 14:02:22
* @LastEditors: 无尘
* @LastEditTime: 2020-08-28 16:12:10
* @LastEditTime: 2020-09-03 11:20:32
* @FilePath : haoban-4\src\components\app\my-customer\store-list.vue
-->
<!--
......@@ -107,7 +107,7 @@ export default {
},
methods: {
/**
* 查看会员
* @description: 查看会员
* @param {Object} item
*/
showMember(item) {
......@@ -115,14 +115,17 @@ export default {
that.$emit('getStore', item);
},
/**
* 输入
* @description: 输入
*/
toInput: _debounce(function() {
const that = this;
that.currentPage = 1;
that.getTableList();
}, 500),
// 搜索清除
/**
* @description: 搜索清除
* @author: 无尘
*/
clearInput() {
const that = this;
that.currentPage = 1;
......@@ -130,7 +133,7 @@ export default {
},
/**
* 分页---页码变化
* @description:分页---页码变化
* @param {Number} val
*/
handleSizeChange(val) {
......@@ -141,7 +144,7 @@ export default {
},
/**
* 分页---当前页变化
* @description: 分页---当前页变化
* @param {Number} val
*/
handleCurrentChange(val) {
......@@ -150,7 +153,7 @@ export default {
that.getTableList();
},
/**
* 获取列表数据
* @description: 获取列表数据
*/
getTableList() {
const that = this;
......
......@@ -4,23 +4,23 @@
* @Author: 无尘
* @Date: 2020-08-28 10:31:09
* @LastEditors: 无尘
* @LastEditTime: 2020-08-28 16:12:21
* @LastEditTime: 2020-09-03 14:42:48
-->
<!--
<sync-crowd-dialog :brand-id="brandId" @refreshData="refreshData"></sync-crowd-dialog>
import syncCrowdDialog from '@/components/app/my-customer/sync-crowd-dialog.vue';
-->
<template>
<el-dialog title="同步场景人群" :visible.sync="dialogVisible" width="995px" :before-close="handleClose">
<div class="sync-tip">
<el-dialog title="同步场景人群" :visible.sync="dialogVisible" width="726px" :before-close="handleClose">
<div class="sync-tip m-b-20">
<common-alert-tip :width="'100%'" :tip-content="tipContent"></common-alert-tip>
</div>
<div class="sync-search">
<div class="flex flex-space-between">
<div>
<el-input placeholder="请输入人群名称" maxlength="50" v-model="searchVal" class="w-264" style="width: 217px;" prefix-icon="el-icon-search" @keyup.native="value => toInput(value)" clearable @clear="clearInput"></el-input><el-select class="w-168 m-l-10" v-model="classifyName" placeholder="所有分类" @change="changeCondition">
<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" :label="item" :value="item"> </el-option>
<el-option v-for="item in classifyList" :key="item.categoryId" :label="itemcategoryName" :value="item.categoryId"> </el-option>
</el-select>
</div>
</div>
......@@ -30,18 +30,18 @@
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column prop="" label="人群名称" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.name || '--' }}
{{ scope.row.memberGroupName || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="所属分类" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.classifyName || '--' }}
{{ scope.row.categoryName || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="到期时间">
<template slot-scope="scope">
<div class="color-606266 line-18">{{ scope.row.createTime | timeStampToYmd }}</div>
<div class="color-606266 line-18">{{ scope.row.createTime | timeStampToHms }}</div>
<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>
</template>
</el-table-column>
</el-table>
......@@ -77,7 +77,7 @@ export default {
dialogVisible: true,
tipContent: '从GIC最多可同步20个场景人群',
searchVal: '',
classifyName: '',
classifyId: '',
classifyList: [],
// 分页参数
loadingPage: false,
......@@ -91,11 +91,14 @@ export default {
},
mounted() {
const that = this;
that.getTableList();
if (that.brandId) {
that.getTableList();
that.getGroupClassify();
}
},
methods: {
/**
* 确定保存
* @description: 确定保存
* @param {String} form
* @returns {Boolean}
*/
......@@ -115,13 +118,15 @@ export default {
postAdd() {
const that = this;
const params = {
enterpriseId: that.brandId
enterpriseId: that.brandId,
categoryIds: that.multipleSelection.map(ele => ele.categoryId).join(',')
};
saveSync(params)
.then(res => {
that.loadingBtn = false;
if (res.code == '0000') {
showMsg.showmsg('同步成功', 'success');
that.clearData();
that.$emit('refreshData', 'success');
}else {
showMsg.showmsg(res.message || '接口异常', 'warning');
......@@ -132,7 +137,7 @@ export default {
});
},
/**
* 表格---多选
* @description: 表格---多选
* @param {Array} val
*/
handleSelectionChange(val) {
......@@ -140,19 +145,28 @@ export default {
that.multipleSelection = val;
},
/**
* 关闭
* @description: 关闭
*/
cancel() {
const that = this;
that.$emit('closeTable', 'close');
that.clearData();
that.$emit('refreshData', 'close');
},
handleClose() {
const that = this;
that.clearData();
that.$emit('refreshData', 'close');
},
clearData() {
const that = this;
that.tableData = [];
that.$emit('closeTable', 'close');
that.multipleSelection = [];
that.searchVal = '';
that.classifyId = '';
that.classifyList = [];
},
/**
* 搜索输入
* @description: 搜索输入
*/
toInput: _debounce(function() {
const that = this;
......@@ -160,7 +174,7 @@ export default {
that.getTableList();
}, 500),
/**
* 搜索清除
* @description: 搜索清除
*/
clearInput() {
const that = this;
......@@ -168,7 +182,7 @@ export default {
that.getTableList();
},
/**
* 条件
* @description: 条件
*/
changeCondition() {
const that = this;
......@@ -177,7 +191,7 @@ export default {
},
/**
* 分页---页码变化
* @description: 分页---页码变化
* @param {Number} val
*/
handleSizeChange(val) {
......@@ -188,7 +202,7 @@ export default {
},
/**
* 分页---当前页变化
* @description: 分页---当前页变化
* @param {Number} val
*/
handleCurrentChange(val) {
......@@ -197,7 +211,7 @@ export default {
that.getTableList();
},
/**
* 获取分类
* @description: 获取分类
*/
getGroupClassify() {
const that = this;
......@@ -213,24 +227,34 @@ export default {
});
},
/**
* 获取列表数据
* @description: 获取列表数据
*/
getTableList() {
const that = this;
let para = {
enterpriseId: that.brandId
that.loadingPage = true;
const para = {
enterpriseId: that.brandId,
keyword: that.searchVal,
categoryId: that.classifyId
};
getSyncMemberData(para)
.then(res => {
that.loadingPage = false;
that.tableData = res.result || [];
})
.catch(function(error) {
that.loadingPage = false;
});
}
},
watch: {
brandId(val) {
const that = this;
if (val) {
that.getTableList();
that.getGroupClassify();
}
}
}
};
</script>
......@@ -238,4 +262,7 @@ export default {
.line-18 {
line-height: 18px;
}
.w-165 {
width: 165px;
}
</style>
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-09-01 13:53:59
* @LastEditors: 无尘
* @LastEditTime: 2020-09-01 17:23:01
* @LastEditTime: 2020-09-03 14:49:43
-->
<!--
......@@ -12,12 +12,12 @@
import tagClassifyDialog from '@/components/app/my-customer/tag-classify-dialog.vue';
-->
<template>
<el-dialog :title="form.classifyId ? '编辑分类' : '新建分类'" width="600px" :visible.sync="editVisible" :before-close="handleClose">
<el-dialog :title="form.tagCategoryId ? '编辑分类' : '新建分类'" width="600px" :visible.sync="editVisible" :before-close="handleClose">
<el-form :model="form" :rules="rules" ref="tagForm" label-width="110px">
<el-form-item label="分类名称" prop="classifyName">
<el-form-item label="分类名称" prop="tagCategoryName">
<limit-input
:input-width="440"
:input-value.sync="form.classifyName"
:input-value.sync="form.tagCategoryName"
:holder="'请输入分类名称'"
:get-by-type="'word'"
:max-length="10">
......@@ -47,8 +47,8 @@ export default {
type: Object,
default() {
return {
classifyId: '',
classifyName: ''
tagCategoryId: '',
tagCategoryName: ''
};
}
}
......@@ -56,11 +56,11 @@ export default {
data() {
return {
form: {
classifyId: '',
classifyName: ''
tagCategoryId: '',
tagCategoryName: ''
},
rules: {
classifyName: [
tagCategoryName: [
{ required: true, message: '请输入分类名称', trigger: 'blur' },
]
},
......@@ -78,7 +78,7 @@ export default {
// methods
methods: {
/**
* 关闭
* @description: 关闭
*/
cancel() {
const that = this;
......@@ -90,7 +90,7 @@ export default {
that.$emit('closeClassify', 'close');
},
/**
* 确定保存
* @description: 确定保存
* @param {String} formName
* @returns {Boolean}
*/
......@@ -106,8 +106,8 @@ export default {
const that = this;
that.loadBtn = true;
const param = {
classifyId: that.form.classifyId,
classifyName: emojiToStr(that.form.classifyName)
tagCategoryId: that.form.tagCategoryId,
tagCategoryName: emojiToStr(that.form.tagCategoryName)
};
addClassify(param)
.then(res => {
......@@ -115,7 +115,7 @@ export default {
if (res.code == '0000') {
showMsg.showmsg('操作成功', 'success');
that.$refs['tagForm'].resetFields();
that.$emit('closeClassify', that.form.classifyName);
that.$emit('closeClassify', that.form.tagCategoryName);
}else {
showMsg.showmsg(res.message || '未知错误', 'warning');
}
......
......@@ -4,17 +4,17 @@
* @Author: 无尘
* @Date: 2020-09-01 11:09:16
* @LastEditors: 无尘
* @LastEditTime: 2020-09-02 12:19:28
* @LastEditTime: 2020-09-03 15:24:17
-->
<!--
<tag-classify-list :brand-id="brandId" @refreshClassify="refreshClassify"></tag-classify-list>
<tag-classify-list :brand-id="brandId" @refreshClassify="refreshClassify" @changeClass="changeClass"></tag-classify-list>
import tagClassifyList from '@/components/app/my-customer/tag-classify-list.vue';
-->
<template>
<div>
<ul class="tag-classify-body">
<li :class="['tag-classify-item', { active: currentClassifyId == item.classifyId }]" v-for="(item, index) in tagList" :key="item.classifyId+index" @click="changeClassify(index, item)">
<span class="tag-classify-name">{{ item.classifyName }}</span>
<li :class="['tag-classify-item', { active: currentClassifyId == item.tagCategoryId }]" v-for="(item, index) in tagList" :key="item.tagCategoryId+index" @click="changeClassify(index, item)">
<span class="tag-classify-name">{{ item.tagCategoryName }}</span>
<el-dropdown placement="bottom-start">
<i class="iconfont icongengduo edit-icon"></i>
<el-dropdown-menu slot="dropdown">
......@@ -25,16 +25,21 @@
</li>
<li v-if="tagList.length == 0" class="no-data" >暂无数据</li>
</ul>
<tag-classify-dialog v-if="showTagClass" :edit-row="editRow" @closeClassify="closeClassify"></tag-classify-dialog>
</div>
</template>
<script>
import tagClassifyDialog from '@/components/app/my-customer/tag-classify-dialog.vue';
import showMsg from '@/common/js/showmsg.js';
import api from '@/api/my-customer-app.js';
const { delClassify } = api;
export default {
name: 'TagClassify',
components: {
tagClassifyDialog
},
props: {
tagList: {
type: Array,
......@@ -47,7 +52,8 @@ export default {
},
data() {
return {
editRow: {},
showTagClass: false
};
},
methods: {
......@@ -67,7 +73,23 @@ export default {
* @author: 无尘
*/
toEditClassify(index, row) {
this.$emit('edit-role', row);
const that = this;
that.editRow = row;
that.showTagClass = true;
},
/**
* @description: 关闭分类弹窗
* @param {String} res
* @return {Boolean}
* @author: 无尘
*/
closeClassify(res) {
const that = this;
that.showTagClass = false;
if (res == 'close') {
return false;
}
that.editRow.tagCategoryName = res;
},
/**
* @description: 删除分类
......@@ -84,13 +106,13 @@ export default {
type: 'warning'
})
.then(() => {
that.delTagData(row.classifyId);
that.delTagData(row.tagCategoryId);
})
.catch(() => {});
},
delTagData(classifyId) {
delTagData(tagCategoryId) {
const that = this;
const para = { classifyId };
const para = { tagCategoryId };
delClassify(para)
.then(res => {
that.$emit('refreshClassify');
......
......@@ -3,7 +3,7 @@
* @Author : 无尘
* @Date : 2020-02-13 14:02:40
* @LastEditors: 无尘
* @LastEditTime: 2020-08-27 19:51:06
* @LastEditTime: 2020-09-03 13:57:21
* @FilePath : j:\公司\haoban-4\src\components\common\common-alert-tip.vue
-->
<!--
......@@ -20,6 +20,9 @@
<span class="el-alert__title color-606266 font-13">
{{tipContent}}
</span>
<div v-if="tipTwoContent" class="el-alert__title color-606266 font-13">
{{tipTwoContent}}
</div>
</div>
</div>
</div>
......@@ -38,6 +41,10 @@ export default {
tipContent: {
type: String,
default: ''
},
tipTwoContent: {
type: String,
default: ''
}
},
data() {
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-28 16:51:22
* @LastEditors: 无尘
* @LastEditTime: 2020-09-02 09:23:02
* @LastEditTime: 2020-09-03 15:20:25
-->
<template>
......@@ -12,9 +12,9 @@
<div class="clerk-tag-body flex">
<div class="clerk-tag-left border-box">
<div class="clerk-tag-add">
<el-button icon="el-icon-plus">新建分类</el-button>
<el-button icon="el-icon-plus" @click="toAddCate">新建分类</el-button>
</div>
<tag-classify-list :brand-id="brandId" @refreshClassify="refreshClassify" @changeClass="changeClass"></tag-classify-list>
</div>
<div class="clerk-tag-right p-20 border-box">
<div class="clerk-tag-search">
......@@ -26,17 +26,20 @@
<div>
<el-table
:data="tagsData"
row-key="memberTagId"
v-loading="loading"
ref="tagsData"
style="width: 100%">
<el-table-column prop="" label="" width="100" class-name="move-row-cell">
<el-table-column prop="" label="" width="56" class-name="move-row-cell">
<template>
<span class="font-22 iconfont icontuozhuaiopen color-c4c6cf" style="cursor: move;"></span>
<span class="font-22 iconfont icontuozhuaiopen color-c0c4cc" style="cursor: move;"></span>
</template>
</el-table-column>
<el-table-column
prop=""
label="标签名称"
show-overflow-tooltip>
<template slot-scope="scope">{{scope.row.name || '--'}}</template>
<template slot-scope="scope">{{scope.row.memberTagName || '--'}}</template>
</el-table-column>
<el-table-column
prop=""
......@@ -51,24 +54,38 @@
</div>
</div>
</div>
<tag-classify-dialog v-if="showTagCate" @closeClassify="closeClassify"></tag-classify-dialog>
</div>
</template>
<script>
import tagClassifyList from '@/components/app/my-customer/tag-classify-list.vue';
import fetch from '@/api/my-customer-app.js';
const { getTagClassify, getClerkTag, delClerkTag } = fetch;
const { getTagClassify, getClerkTag, 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: {},
components: {
tagClassifyList
},
props: {
brandId: {
type: String,
default: ''
}
},
data() {
return {
currentClassify: '',
tagsClassifyData: [],
tagsData: [],
showTagDialog: false,
showTagVisiable: false
showTagVisiable: false,
loading: false,
showTagCate: false
};
},
// 生命周期 - 挂载完成(访问DOM元素)
......@@ -79,6 +96,79 @@ export default {
// methods
methods: {
/**
* @description: 选择分类
* @param {Object} row
* @author: 无尘
*/
changeClass(row) {
const that = this;
that.currentClassify = row.tagCategoryId;
that.getTableList();
},
/**
* @description: 新增分类
* @author: 无尘
*/
toAddCate() {
const that = this;
that.showTagCate = true;
},
closeClassify(res) {
const that = this;
that.showTagCate = false;
if (res == 'close') {
return false;
}
that.getClassifyList();
},
/**
* @description: 拖拽排序
* @param {String} data
* @author: 无尘
*/
rowDrop(data) {
const tbody = this.$refs[data].$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0];
const that = this;
Sortable.create(tbody, {
onEnd({ newIndex, oldIndex }) {
if (newIndex == oldIndex) {
return false;
}
let arr = JSON.parse(JSON.stringify(that[data]));
const currRow = arr.splice(oldIndex, 1)[0];
arr.splice(newIndex, 0, currRow);
that.setSort(arr);
}
});
},
setSort() {
const that = this;
const para = {
enterpriseId: that.brandId
};
sortClerkTag(para)
.then(res => {
that.getGroupList();
if (res.code == '0000') {
showMsg.showmsg('操作成功', 'success');
}else {
showMsg.showmsg(res.message || '接口异常', 'warning');
}
})
.catch(function(error) {
});
},
/**
* @description: 刷新分类列表
* @param {String} res
* @author: 无尘
*/
refreshClassify(res) {
const that = this;
that.getClassifyList();
},
/**
* 编辑标签
* @param {Number} index
* @param {Object} row
......@@ -157,13 +247,18 @@ export default {
getTableList() {
const that = this;
that.loading = true;
const para = {};
const para = {
enterpriseId: that.brandId,
keyword: that.searchVal,
tagCategoryId: that.currentClassify
};
getClerkTag(para)
.then(res => {
that.loading = false;
that.tagsData = res.result || [];
})
.catch(function(error) {
that.loading = false;
});
},
/**
......@@ -171,13 +266,12 @@ export default {
*/
getClassifyList() {
const that = this;
that.loading = true;
const para = {};
getTagClassify(para)
.then(res => {
that.tagsClassifyData = res.result || [];
if (res.result && res.result.length) {
that.currentClassify = res.result[0].classifyId;
that.currentClassify = that.currentClassify ? that.currentClassify : res.result[0].classifyId;
that.getTableList();
}
})
......
......@@ -4,28 +4,30 @@
* @Author: 无尘
* @Date: 2020-08-27 10:16:37
* @LastEditors: 无尘
* @LastEditTime: 2020-09-02 18:02:15
* @LastEditTime: 2020-09-03 14:43:34
-->
<template>
<div class="common-app-right">
<div class="crowd-scene-tip">
<common-alert-tip :width="'100%'" :tip-content="tipContent"></common-alert-tip>
<div class="crowd-scene-tip m-b-20">
<common-alert-tip :width="'100%'" :tip-content="tipContent" :tip-two-content="tipTwoContent"></common-alert-tip>
</div>
<div class="crowd-scene-search flex flex-space-between">
<div class="crowd-scene-search flex flex-space-between m-b-20">
<div>
<el-input placeholder="请输入人群名称" maxlength="50" v-model="searchVal" class="w-264" style="width: 217px;" prefix-icon="el-icon-search" @keyup.native="value => toInput(value)" clearable @clear="clearInput"></el-input><el-select class="w-168 m-l-10" v-model="classifyName" placeholder="所有分类" @change="changeCondition">
<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" :label="item" :value="item"> </el-option>
<el-option v-for="item in classifyList" :key="item.categoryId" :label="item.categoryName" :value="item.categoryId"> </el-option>
</el-select>
</div>
<div><el-button type="primary" @click="toSync">同步场景人群</el-button></div>
</div>
<div class="crowd-scene-table flex">
<div class="crowd-scene-table">
<div class="crowd-scene-table_left">
<el-table
:data="memberCrowdData"
v-loading="loading"
ref="memberCrowdData"
row-key="memberGroupId"
style="width: 100%">
<el-table-column prop="" label="" width="56" class-name="move-row-cell">
<template>
......@@ -36,36 +38,20 @@
prop=""
label="人群名称"
show-overflow-tooltip>
<template slot-scope="scope">{{scope.row.name || '--'}}</template>
<template slot-scope="scope">{{scope.row.memberGroupName || '--'}}</template>
</el-table-column>
<el-table-column
prop=""
label="所属分类"
show-overflow-tooltip>
<template slot-scope="scope">{{scope.row.classifyName || '--'}}</template>
<template slot-scope="scope">{{scope.row.categoryName || '--'}}</template>
</el-table-column>
<el-table-column
prop=""
label="到期时间">
<template slot-scope="scope">
<div class="line-18">{{ scope.row.effectiveDate | timeStampToYmd }} {{scope.row.effectiveDate ? scope.row.effectiveDate : '--'}}</div>
<div class="line-18">{{ scope.row.effectiveDate | timeStampToHms }} {{scope.row.effectiveDate ? scope.row.effectiveDate : '--'}}</div>
</template>
</el-table-column>
<el-table-column>
<template slot="header">
<el-tooltip class="item" effect="dark" placement="right">
<div slot="content">
排序越靠上的权重越高,当一家门店拥有多个会员卡时,优先展示排序最靠上的会员卡
</div>
<span class="common-bottom-border">排序</span>
</el-tooltip>
</template>
<template slot-scope="scope">
<i :class="['icon-color', 'el-icon-upload2', scope.$index == 0 ? 'disable' : '']" @click="toTop(scope.$index, scope.row, memberCrowdData)"></i>
<i :class="['icon-color', 'el-icon-back', 'icon-to-pre', scope.$index == 0 ? 'disable' : '']" @click="toPre(scope.$index, scope.row, memberCrowdData)"></i>
<i :class="['icon-color', 'el-icon-back', 'icon-to-next', scope.$index == memberCrowdData.length - 1 ? 'disable' : '']" @click="toNext(scope.$index, scope.row, memberCrowdData)"></i>
<i :class="['icon-color', 'el-icon-download', scope.$index == memberCrowdData.length - 1 ? 'disable' : '']" @click="toBottom(scope.$index, scope.row, memberCrowdData)"></i>
<div class="line-18">{{ scope.row.overTime | timeStampToYmd }} {{ scope.row.overTime ? '' : '--'}}</div>
<div class="line-18">{{ scope.row.overTime | timeStampToHms }} {{ scope.row.overTime ? '' : '--'}}</div>
</template>
</el-table-column>
<el-table-column
......@@ -77,11 +63,15 @@
</el-table>
</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>
</div>
</template>
<script>
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;
import { _debounce } from '@/common/js/public.js';
......@@ -89,7 +79,11 @@ import showMsg from '@/common/js/showmsg.js';
import Sortable from 'sortablejs';
export default {
name: 'CrowdScenePage',
components: { commonAlertTip },
components: {
commonAlertTip,
syncCrowdDialog,
editVisiable
},
props: {
brandId: {
type: String,
......@@ -98,13 +92,17 @@ export default {
},
data() {
return {
tipContent: 'GIC设置场景人群后,好办顾客人群列表最多同步20个人群,次日刷新,每日刷新一次;<br/> GIC中设置的场景人群到期后,好办移动端将不再展示该条人群;',
tipContent: 'GIC设置场景人群后,好办顾客人群列表最多同步20个人群,次日刷新,每日刷新一次;',
tipTwoContent: 'GIC中设置的场景人群到期后,好办移动端将不再展示该条人群;',
searchVal: '',
classifyName: '',
classifyId: '',
classifyList: [],
memberCrowdData: [], // 人群
loading: false,
showSync: false,
showSelectStore: false
showSelectStore: false,
selectMode: '',
rangeData: []
};
},
// 生命周期 - 挂载完成(访问DOM元素)
......@@ -118,14 +116,31 @@ export default {
// methods
methods: {
/**
* 同步
* @description: 刷新数据
* @param {String} res
* @returns {Boolean}
* @author: 无尘
*/
refreshData(res) {
const that = this;
that.showSync = false;
that.showSelectStore = false;
that.selectMode = '';
that.rangeData = [];
if (res == 'close') {
return false;
}
that.getGroupList();
},
/**
* @description: 同步
*/
toSync() {
const that = this;
that.showSync = true;
},
/**
* 编辑可见范围
* @description: 编辑可见范围
* @param {Number} index
* @param {Object} row
*/
......@@ -135,27 +150,24 @@ export default {
},
/**
* 搜索输入
* @description: 搜索输入
*/
toInput: _debounce(function() {
const that = this;
that.currentPage = 1;
that.getGroupList();
}, 500),
/**
* 搜索清除
* @description: 搜索清除
*/
clearInput() {
const that = this;
that.currentPage = 1;
that.getGroupList();
},
/**
* 条件
* @description: 条件
*/
changeCondition() {
const that = this;
that.currentPage = 1;
that.getGroupList();
},
/**
......@@ -197,7 +209,7 @@ export default {
});
},
/**
* 获取分类
* @description: 获取分类
*/
getGroupClassify() {
const that = this;
......@@ -218,15 +230,19 @@ export default {
*/
getGroupList() {
const that = this;
that.loading = true;
const para = {
enterpriseId: that.brandId
enterpriseId: that.brandId,
keyword: that.searchVal,
categoryId: that.classifyId
};
getGroupData(para)
.then(res => {
that.loading = false;
that.memberCrowdData = res.result || [];
})
.catch(function(error) {
that.loading = false;
});
}
},
......@@ -234,8 +250,11 @@ export default {
brandId(val) {
const that = this;
if (val) {
that.getMemberCrad();
that.getServiceNum();
that.searchVal = '';
that.classifyId = '';
that.classifyList = [];
that.getGroupClassify();
that.getGroupList();
}
}
}
......@@ -247,14 +266,10 @@ export default {
padding-bottom: 2px;
border-bottom: 1px dashed #2f54eb;
}
.dcrowd-scene-table {
i.icon-color {
color: #606266;
}
i.disable {
color: #909399;
cursor: not-allowed;
}
.w-162 {
width: 162px;
}
.crowd-scene-table {
.line-18 {
line-height: 18px;
}
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-08-27 10:16:37
* @LastEditors: 无尘
* @LastEditTime: 2020-09-01 17:57:48
* @LastEditTime: 2020-09-03 10:07:59
-->
<template>
<div class="common-app-right">
......@@ -18,9 +18,9 @@
</div>
<div class="m-b-20">
<el-tooltip class="item" effect="dark" content="勾选后将会在“顾客详情页”进行显示" placement="top-start"> <span class="font-14 color-606266 m-r-20 common-bottom-border">导购联系顾客方式</span></el-tooltip>
<el-checkbox v-model="myCustomData.allowGuideMobile">电话</el-checkbox>
<el-checkbox v-model="myCustomData.allowGuideMessage">短信</el-checkbox>
<el-checkbox v-model="myCustomData.allowGuideOnlineChat">添加会员/发消息</el-checkbox>
<el-checkbox v-model="customerShowData.allowGuideOnlineChat">添加会员/发消息</el-checkbox>
<el-checkbox v-model="customerShowData.allowGuideMobile">电话</el-checkbox>
<el-checkbox v-model="customerShowData.allowGuideMessage">短信</el-checkbox>
</div>
<div class="m-t-46">
<el-button type="primary" :loading="loading" @click="submit()">保存</el-button>
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-31 14:35:56
* @LastEditTime: 2020-09-03 15:29:56
-->
<template>
<div class="my-customer-wrap common-set-wrap">
......@@ -24,7 +24,7 @@
<span class="font-14 color-606266 merchant-name-span">{{ enterpriseObj.enterpriseName || '--' }}</span><el-tag class="m-l-10" size="mini" type="danger">{{ enterpriseObj.versionName || '4.0'}}</el-tag>
</div>
<div class="auth-merchant-name flex">
<span class="font-14 color-606266 merchant-name-span">{{ enterpriseObj.brandName || '--' }}</span>
<span class="font-14 color-606266 merchant-name-span">{{ enterpriseObj.companyName || '--' }}</span>
</div>
</div>
</div>
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-31 14:29:06
* @LastEditTime: 2020-09-03 15:29:28
-->
<template>
<div class="my-customer-wrap common-set-wrap">
......@@ -38,7 +38,7 @@
<span class="gic-name">{{ scope.row.enterpriseName || '--' }}</span><span class="gic-version">{{ scope.row.version || '--' }}</span>
</div>
<div class="cell-info-name flex font-14 color-303133">
<span class="gic-name">{{ scope.row.brandName || '--' }}</span>
<span class="gic-name">{{ scope.row.companyName || '--' }}</span>
</div>
</div>
</div>
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-31 16:36:53
* @LastEditTime: 2020-09-03 15:30:54
-->
<template>
<div class="my-customer-wrap common-set-wrap">
......@@ -30,7 +30,7 @@
<div class="flex flex-space-between">
<div style="line-height: 26px;">
<span class="block text-ellipsis">{{ item.enterpriseName || '--' }}</span>
<div class="text-ellipsis font-12 color-909399">{{ item.brandName || '--' }}</div>
<div class="text-ellipsis font-12 color-909399">{{ item.companyName || '--' }}</div>
</div>
<span v-if="item.enterpriseId == authForm.enterpriseId" class="font-12 color-2f54eb el-icon-check flex-align-center" style="display:flex;"></span>
</div>
......
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