Commit 88b6cb9d by liuchenxi

update: 会员标签

parent ada217e9
......@@ -8,7 +8,7 @@
<p class="tip">导购标签排序应用于好办小程序,好办端展示按照排序从上到下展示</p>
</span>
<div class="operation-btn">
<el-button type="primary" class="ghost-btn" @click="importMember">
<el-button v-if="$route.query.type == 'manual'" type="primary" class="ghost-btn" @click="importMember">
<i class="iconfont icon-shangc" />
导入多标签值会员
</el-button>
......@@ -19,7 +19,7 @@
</div>
</div>
<div class="tag-value-wrapper">
<el-table :data="tagValTableData" ref="sortTable" row-class-name="table-row" row-key="tagItemId">
<el-table :data="tagValTableData" v-loading="loading" ref="sortTable" row-class-name="table-row" row-key="tagItemId">
<el-table-column width="40" class-name="tag-cell sort-cell" label-class-name="tag-head">
<template>
<el-tooltip placement="top" content="拖动排序" trigger="hover" effect="dark" popper-class="drag-tooltip">
......@@ -42,7 +42,7 @@
<el-button type="text" size="small" class="m-r-20" @click="toTagDetail(scope.row)">
查看
</el-button>
<el-button type="text" size="small" v-if="getCodeAuth" :limit-code="getCode" class="m-r-20" :disabled="scope.row.status === 5" @click="showImportPop(scope.$index, scope.row)">
<el-button type="text" size="small" v-if="getCodeAuth && $route.query.type == 'manual'" :limit-code="getCode" class="m-r-20" :disabled="scope.row.status === 5" @click="showImportPop(scope.$index, scope.row)">
导入会员
</el-button>
<!-- 删除中的状态 -->
......@@ -176,7 +176,8 @@ export default {
deleteData: {}
},
tableFiledVisible: false,
checkFields: ['cardNo','gradeName','crateCardDateStringFormat','lastCostTimeFormat','costTimes','avgCost','birthdayMDFormat','pointsCurrent','costAll','mainStoreName','openStoreName']
checkFields: ['cardNo','gradeName','crateCardDateStringFormat','lastCostTimeFormat','costTimes','avgCost','birthdayMDFormat','pointsCurrent','costAll','mainStoreName','openStoreName'],
loading: false
};
},
computed: {
......@@ -218,33 +219,55 @@ export default {
// 删除标签值
delTagApi(data) {
const item = data;
const { currentIndex: index, e } = data;
const para = {
itemId: item.tagItemId
};
this.refreshTag.push({
tagItemIndex: index,
tagItemId: item.tagItemId
});
this.tagValTableData[index].showDelPopOver = false;
getRequest('/delTagItem/add', para).then(res => {
const { currentIndex: index, e, memberCount, tagItemId } = data;
// memberCount为0时不加入垃圾桶,直接删除
if (memberCount == 0) {
this.directDelTag(tagItemId);
} else {
this.intoTrash(item, index, e);
}
},
// 加入到垃圾桶
intoTrash(item, index, e) {
const para = {
itemId: item.tagItemId
};
this.refreshTag.push({
tagItemIndex: index,
tagItemId: item.tagItemId
});
this.tagValTableData[index].showDelPopOver = false;
getRequest('/delTagItem/add', para).then(res => {
const { errorCode, result } = res.data;
if (errorCode === 1) {
item.delStatus = 0;
this.$refs.Trash.getTrashList();
this.handleRefreshTag();
this.startAnimation(e)
return;
}
this.$message.error(result)
}).catch(error => {
this.$message.error({
duration: 1000,
message: error.message
});
});
},
// 直接删除标签值
directDelTag(tagItemId) {
console.log(tagItemId);
const para = { tagItemId };
getRequest('/member-tag-value/delTagItem', para).then(res => {
const { errorCode, result } = res.data;
if (errorCode === 1) {
item.delStatus = 0;
this.$refs.Trash.getTrashList();
this.handleRefreshTag();
this.startAnimation(e)
this.$message.success('删除成功');
this.getValueData();
return;
}
this.$message.error(result)
}).catch(error => {
this.$message.error({
duration: 1000,
message: error.message
});
});
})
},
startAnimation(e) {
this.animationPos = {
x: document.body.offsetWidth - e.pageX,
......@@ -258,6 +281,7 @@ export default {
// 获取标签值列表
getValueData() {
this.loading = true;
const para = {
tagId: this.tagId
};
......@@ -291,7 +315,7 @@ export default {
duration: 1000,
message: error.message
});
});
}).finally(() => this.loading = false);
},
// 跳转会员标签人数详情页面
toTagDetail(row){
......
......@@ -111,7 +111,7 @@ export default {
localStorage.setItem('jumpThirdTag', '');
this.$router.push({
path: '/manualTagValueEdit',
query: { tagId: list.tagId }
query: { tagId: list.tagId, type: 'active' }
});
},
deleteActiveTag(list) {
......
......@@ -125,7 +125,7 @@ export default {
localStorage.setItem('jumpThirdTag', '');
this.$router.push({
path: '/manualTagValueEdit',
query: { tagId: list.tagId }
query: { tagId: list.tagId, type: 'manual' }
});
},
deleteHandTag(list) {
......
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