xiuli.gao 2 years ago
parent
commit
2d243dae93

+ 2 - 0
project/src/assets/config/interface_api.js

@@ -48,6 +48,8 @@ var api = {
48 48
   customerOrderList: "/api/customer/customerOrderList",
49 49
   tag_detial_list: "/api/customer/customerDetailTagList",
50 50
   tag_detial_edit: "/api/customer/customerDetailTagUpdate",
51
+  customer_setCustomerTag: "/api/customer/setCustomerTag",
52
+  customer_batchMarkTagResult: "/api/customer/batchMarkTagResult",
51 53
 };
52 54
 
53 55
 export { api };

+ 8 - 5
project/src/components/Index/header.vue

@@ -8,13 +8,13 @@
8 8
       <div class="enterpriseSelect">
9 9
         <div class="enterpriseBox">
10 10
           <div class="enterprise-self">
11
-            <img src="@/assets/img/login_icon.png" alt="">
12
-            <span>酷播文化</span>
11
+            <!-- <img :src="enterprise.corp_square_logo_url" alt=""> -->
12
+            <span>{{enterprise.corp_full_name}}</span>
13 13
           </div>
14 14
           <i :class="['el-icon-caret-bottom',reversalAnimationFlag?'reversalAnimation':'']"></i>
15 15
         </div>
16
-        <el-select class="enterpriseElSelect" v-model="enterprise" size="small" placeholder="请选择" @visible-change="(val)=>{reversalAnimationFlag = val}">
17
-          <el-option v-for="item in enterpriseList" :key="item.value" :label="item.label" :value="item.value">
16
+        <el-select class="enterpriseElSelect" v-model="enterprise.corpid" size="small" placeholder="请选择" @visible-change="(val)=>{reversalAnimationFlag = val}">
17
+          <el-option v-for="item in enterpriseList" :key="item.corpid" :label="item.corp_full_name" :value="item.corpid">
18 18
           </el-option>
19 19
         </el-select>
20 20
       </div>
@@ -89,6 +89,8 @@ export default {
89 89
     }
90 90
   },
91 91
   created () {
92
+    this.enterpriseList = this.$store.state.authorize_corpList;
93
+    this.enterprise = this.$store.state.defaultCorp;
92 94
     this.userInfo = JSON.parse(this.$localSelfStore.getLocal('userInfo'))
93 95
   },
94 96
   methods: {
@@ -193,7 +195,7 @@ export default {
193 195
   transform: rotate(180deg);
194 196
 }
195 197
 .enterpriseSelect {
196
-  width: 170px;
198
+  // width: 170px;
197 199
   height: 34px;
198 200
   border-radius: 4px;
199 201
   border: 1px solid #ffffff;
@@ -210,6 +212,7 @@ export default {
210 212
     padding: 0 7px;
211 213
     i {
212 214
       transition: all 0.5s;
215
+      margin-left: 10px;
213 216
     }
214 217
     .enterprise-self {
215 218
       display: flex;

+ 2 - 2
project/src/components/assembly/editCon.vue

@@ -213,7 +213,7 @@ export default {
213 213
         admin_id: this.$cookie.getCookie('admin_id'),
214 214
         ttl: this.$cookie.getCookie('ttl'),
215 215
         sign: this.$cookie.getCookie('sign'),
216
-        corpid: this.$store.state.corpid,
216
+        corpid: this.$store.state.defaultCorp.corpid,
217 217
         type: 1,//素材类型。1图片 2语音 3视频
218 218
         need_media_id: 0,
219 219
       },
@@ -221,7 +221,7 @@ export default {
221 221
         admin_id: this.$cookie.getCookie('admin_id'),
222 222
         ttl: this.$cookie.getCookie('ttl'),
223 223
         sign: this.$cookie.getCookie('sign'),
224
-        corpid: this.$store.state.corpid,
224
+        corpid: this.$store.state.defaultCorp.corpid,
225 225
         type: 1,//素材类型。1图片 2语音 3视频
226 226
         need_media_id: 1,//是否需要返回media_id.0否 1是
227 227
       },

+ 218 - 0
project/src/components/assembly/tagDialog.vue

@@ -0,0 +1,218 @@
1
+<template>
2
+  <div class="popover_con" v-loading="loading">
3
+    <!-- <div class="condition">
4
+      <label>筛选条件</label>
5
+      <el-radio-group v-model="radio">
6
+        <el-radio :label="1">以下标签满足其中之一</el-radio>
7
+        <el-radio :label="2">以下标签同时满足</el-radio>
8
+        <el-radio :label="3">无任何标签</el-radio>
9
+      </el-radio-group>
10
+    </div> -->
11
+    <div class="self-hint" style="border:none">
12
+      <i class="el-icon-message-solid"></i>
13
+      <span>将给选择的1个客户批量{{tagType==1?'打':'移除'}}标签,请选择标签</span>
14
+    </div>
15
+    <template v-if="radio!=3">
16
+      <div class="self-input">
17
+        <input type="text" v-model="keyword" placeholder="请输入要查找的标签" @input="keyInput">
18
+        <i class="el-icon-search"></i>
19
+      </div>
20
+      <div class="tagGroup self-scrollbar-3">
21
+        <div class="groupItem" v-for="(it) in tagList" :key="it.group_id">
22
+          <div class="groupTitle">{{it.group_name}}:</div>
23
+          <div class="groupBox">
24
+            <div :class="['group',tag_id_list.indexOf(item.tag_id) != -1 ? 'group_active' : ''] " v-for="(item,index) in it.tag_list" :key="index" @click="groupEvent(item)">{{item.tag_name}}</div>
25
+          </div>
26
+        </div>
27
+        <no-data hint="没有搜索到相关标签哦~" v-if="!loading&&tagList&&tagList.length==0"></no-data>
28
+      </div>
29
+    </template>
30
+    <p v-else class="hint">选择无任何标签后,将筛选出没有被打上过任何标签的客户~</p>
31
+    <div class="buttons">
32
+      <el-button type="primary" plain size="mini" @click="$emit('closeTagDialog',[])">取消</el-button>
33
+      <el-button type="primary" size="mini" @click="defineEvent">确定</el-button>
34
+    </div>
35
+  </div>
36
+</template>
37
+<script>
38
+export default {
39
+  props: {
40
+    tagType: {
41
+      type: Number | String,
42
+      default: 1
43
+    }
44
+  },
45
+  data () {
46
+    return {
47
+      loading: false,
48
+      keyword: '',
49
+      radio: 2,
50
+      tagList: [],
51
+      tag_id_list: []
52
+    }
53
+  },
54
+  created () {
55
+    // 没有标签时,请求接口,获取标签
56
+    if (this.tagList.length == 0) {
57
+      this.init()
58
+    }
59
+  },
60
+  methods: {
61
+    keyInput () {
62
+      let tagList = []
63
+      this.old_tag_list.forEach((item) => {
64
+        let obj = JSON.parse(JSON.stringify(item));
65
+        obj.tag_list = []
66
+        item.tag_list.forEach((item1) => {
67
+          if (item1.tag_name.indexOf(this.keyword) != -1) {
68
+            obj.tag_list.push(item1)
69
+          }
70
+        })
71
+        if (obj.tag_list.length != 0) {
72
+          tagList.push(obj)
73
+        }
74
+      });
75
+      this.tagList = tagList
76
+    },
77
+    groupEvent (item) {
78
+      if (this.tag_id_list.indexOf(item.tag_id) == -1) {
79
+        this.tag_name_list.push(item.tag_name)
80
+        this.tag_id_list.push(item.tag_id)
81
+      } else {
82
+        this.tag_id_list = this.tag_id_list.filter((v) => {
83
+          return v != item.tag_id
84
+        })
85
+        this.tag_name_list = this.tag_name_list.filter((v) => {
86
+          return v != item.tag_name
87
+        })
88
+      }
89
+    },
90
+    defineEvent () {
91
+      if (this.tag_id_list.length == 0) {
92
+        this.$message({
93
+          message: '请选择标签',
94
+          type: "warning"
95
+        })
96
+        return
97
+      }
98
+      this.$emit('closeTagDialog', this.tag_id_list)
99
+    },
100
+    init () {
101
+      this.loading = true
102
+      this.$axios.get(this.URL.BASEURL + this.URL.tagList, {}).then((res) => {
103
+        var res = res.data
104
+        this.loading = false
105
+        if (res && res.errno == 0) {
106
+          this.old_tag_list = res.rst;
107
+          this.tagList = res.rst;
108
+          // 回显
109
+          let arr = [];
110
+          this.tagList.forEach((item) => {
111
+            item.tag_list.forEach((it) => {
112
+              if (this.tag_id_list.indexOf(it.tag_id) != -1) {
113
+                arr.push(it.tag_name)
114
+              }
115
+            })
116
+          })
117
+          this.tag_name_list = arr;
118
+        } else if (res.errno != 4002) {
119
+          this.$message({
120
+            message: res.err,
121
+            type: "warning"
122
+          })
123
+        }
124
+      }).catch((err) => {
125
+        this.loading = false
126
+      });
127
+    },
128
+  }
129
+}
130
+</script>
131
+<style lang="scss" scoped>
132
+.popover_con {
133
+  width: 550px;
134
+  padding: 10px 10px 0;
135
+  .condition {
136
+    display: flex;
137
+    align-items: center;
138
+    label {
139
+      color: #898d92;
140
+      font-size: 13px;
141
+      line-height: 17px;
142
+      margin-right: 15px;
143
+    }
144
+    .el-radio-group {
145
+      label {
146
+        color: #383e47;
147
+      }
148
+    }
149
+  }
150
+  .self-input {
151
+    width: 100%;
152
+    height: 34px;
153
+    border-radius: 4px;
154
+    border: 1px solid #00b38a;
155
+    display: flex;
156
+    align-items: center;
157
+    overflow: hidden;
158
+    margin: 20px 0;
159
+    input {
160
+      border: none;
161
+      height: 100%;
162
+      flex: 1;
163
+      padding: 0 20px;
164
+      font-size: 14px;
165
+    }
166
+    i {
167
+      display: block;
168
+      width: 40px;
169
+      text-align: center;
170
+      cursor: pointer;
171
+      font-size: 16px;
172
+      color: #00b38a;
173
+    }
174
+  }
175
+}
176
+.tagGroup {
177
+  height: 300px;
178
+  overflow-y: auto;
179
+  .groupItem {
180
+    margin-bottom: 14px;
181
+    .groupTitle {
182
+      color: #898d92;
183
+      font-size: 13px;
184
+      line-height: 18px;
185
+    }
186
+    .groupBox {
187
+      display: flex;
188
+      flex-wrap: wrap;
189
+      .group {
190
+        height: 25px;
191
+        line-height: 25px;
192
+        font-size: 12px;
193
+        color: #787878;
194
+        background: #f4f4f4;
195
+        border-radius: 4px;
196
+        border: 1px solid #d2d2d2;
197
+        padding: 0 10px;
198
+        margin: 4px 8px 4px 0;
199
+        cursor: pointer;
200
+        &.group_active {
201
+          color: #00b38a;
202
+          border-color: #00b38a;
203
+          background: transparent;
204
+        }
205
+      }
206
+    }
207
+  }
208
+}
209
+.buttons {
210
+  text-align: right;
211
+  padding: 20px 0 10px;
212
+}
213
+.hint {
214
+  font-size: 13px;
215
+  color: #969696;
216
+  margin-top: 20px;
217
+}
218
+</style>

+ 2 - 1
project/src/components/customManage/customerTransfer.vue

@@ -107,7 +107,8 @@
107 107
       </el-table-column>
108 108
       <el-table-column width="160" label="付费情况" align="center">
109 109
         <template slot-scope="scope">
110
-          <div>已付费(<span class="c-00B38A">3次</span>)</div>
110
+          <div v-if="scope.row.pay_num>0">已付费(<span class="c-00B38A">{{scope.row.pay_num}}次</span>)</div>
111
+          <div v-else>未付费</div>
111 112
         </template>
112 113
       </el-table-column>
113 114
       <el-table-column prop="createtime" width="160" label="添加时间" show-overflow-tooltip align="center"></el-table-column>

+ 3 - 3
project/src/components/customManage/lostCustomer.vue

@@ -7,13 +7,13 @@
7 7
         <p>客户流失功能只会记录授权给微伴成员的客户流失信息,未被授权的成员信息将不会展示在列表中。<a href="https://docs.qq.com/doc/p/302c154caadbfb317828a3edf057f06741bdc47d?dver=2.1.27292865" target="_blank" class="c-00B38A">如何添加授权成员?</a></p>
8 8
       </div>
9 9
     </div>
10
-    <div class="remindBox">
10
+    <!-- <div class="remindBox">
11 11
       <h3>被删除提醒</h3>
12 12
       <el-switch v-model="remindValue" active-color="#43B083" inactive-color="#ddd"></el-switch>
13 13
       <label>已开启</label>
14 14
       <p class="hint">开启后,当企业微信被客户删除时,被删除的企业成员将收到一条消息提醒</p>
15
-    </div>
16
-    <div class="screenBox">
15
+    </div> -->
16
+    <div class="screenBox" style="margin-top:10px">
17 17
       <!-- 所属客服 -->
18 18
       <self-customerservice :reset='resetFlag' @customerDefine="(val)=>{user_id_list=val;init(1)}"></self-customerservice>
19 19
       <!-- 流失时间 -->

+ 168 - 23
project/src/components/customManage/manage.vue

@@ -37,18 +37,18 @@
37 37
         <div class="selectCustom">已择0个客户</div>
38 38
       </div>
39 39
       <div class="flex">
40
-        <el-button type="primary" plain size="mini">批量打标签</el-button>
41
-        <el-button type="primary" plain size="mini">批量移除标签</el-button>
40
+        <el-button type="primary" plain size="mini" @click="setCustomerTag(1)">批量打标签</el-button>
41
+        <el-button type="primary" plain size="mini" @click="setCustomerTag(2)">批量移除标签</el-button>
42 42
         <el-button type="primary" plain size="mini">导出Excel</el-button>
43 43
       </div>
44 44
     </div>
45 45
     <!-- table -->
46
-    <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
46
+    <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange" @select-all="handleSelectAll">
47 47
       <el-table-column type="selection" width="55" align="center"></el-table-column>
48 48
       <el-table-column width="200" fixed="left">
49 49
         <template slot-scope="scope" slot="header">
50
-          <div class="customTitle" slot="reference">{{pageOptionValue==2?'选择当前页面客户':'选择全部客户'}}<i class="el-icon-arrow-down"></i>
51
-            <el-select v-model="pageOptionValue" class="customTitleSelect" placeholder="请选择" size="mini">
50
+          <div class="customTitle" slot="reference">{{old_pageOptionValue==2?'选择当前页面客户':'选择全部客户'}}<i class="el-icon-arrow-down"></i>
51
+            <el-select v-model="pageOptionValue" class="customTitleSelect" placeholder="请选择" size="mini" @change="pageOptionSelect" @visible-change="pageOptionValue=''">
52 52
               <el-option v-for="item in pageOptions" :key="item.id" :label="item.name" :value="item.id">
53 53
               </el-option>
54 54
             </el-select>
@@ -84,7 +84,7 @@
84 84
         <template slot-scope="scope">
85 85
           <div class="customerServiceTagBox biaoqian">
86 86
             <div class="customerServiceTag" v-if="scope.row.gender==1||scope.row.gender==2">{{scope.row.gender==1?'男':scope.row.gender==2?'女':''}}</div>
87
-            <div class="customerServiceTag" v-for="(item) in scope.row.tag_list" :key="item">{{item}}</div>
87
+            <div class="customerServiceTag" v-for="(item,index) in scope.row.tag_list" :key="index+'biaoqian'">{{item}}</div>
88 88
           </div>
89 89
         </template>
90 90
       </el-table-column>
@@ -97,7 +97,8 @@
97 97
       </el-table-column>
98 98
       <el-table-column width="160" label="付费情况" align="center">
99 99
         <template slot-scope="scope">
100
-          <div>已付费(<span class="c-00B38A">3次</span>)</div>
100
+          <div v-if="scope.row.pay_num>0">已付费(<span class="c-00B38A">{{scope.row.pay_num}}次</span>)</div>
101
+          <div v-else>未付费</div>
101 102
         </template>
102 103
       </el-table-column>
103 104
       <el-table-column prop="createtime" width="160" label="添加时间" show-overflow-tooltip align="center"></el-table-column>
@@ -107,11 +108,11 @@
107 108
           <div>{{scope.row.add_way}}</div>
108 109
         </template>
109 110
       </el-table-column>
110
-      <el-table-column width="200" label="操作" align="center" fixed="right">
111
+      <el-table-column width="130" label="操作" align="center" fixed="right">
111 112
         <template slot-scope="scope">
112 113
           <div class="flex">
113 114
             <div class="c-00B38A pointer" @click="shieldingEvent(scope.row)">加入黑名单</div>
114
-            <div class="c-00B38A pointer">聊天记录</div>
115
+            <!-- <div class="c-00B38A pointer">聊天记录</div> -->
115 116
             <div class="c-00B38A pointer" @click="showDetial(scope.row)">详情</div>
116 117
           </div>
117 118
         </template>
@@ -126,15 +127,16 @@
126 127
       <shielding-user @cancel='shieldingUserCancel' :shieldingData='shieldingData'></shielding-user>
127 128
     </el-dialog>
128 129
 
129
-    <el-drawer
130
-      :size="drawerSize"
131
-      :visible.sync="detialDrawer"
132
-      :with-header="false">
130
+    <el-drawer :size="drawerSize" :visible.sync="detialDrawer" :with-header="false">
133 131
       <detial @changeDrawerSize="changeDrawerSize" @closeDrawer="closeDrawer" :rowProp="{
134 132
         customer_id:rowPro.customer_id,
135 133
         user_id:rowPro.user_id
136 134
       }" ref="detial"></detial>
137 135
     </el-drawer>
136
+    <!-- 批量打标签 -->
137
+    <el-dialog :title="tagType==1?'批量打标签':'批量移除标签'" :visible.sync="tagVisible" width="600px" center top="15vh">
138
+      <tag-dialog @closeTagDialog="closeTagDialog" :tagType='tagType'></tag-dialog>
139
+    </el-dialog>
138 140
   </div>
139 141
 </template>
140 142
 <script>
@@ -148,23 +150,26 @@ import lossBody from '@/components/assembly/screen/lossBody.vue'
148 150
 import screenPay from '@/components/assembly/screen/pay.vue'
149 151
 import shieldingUser from '@/components/assembly/shieldingUser.vue'
150 152
 import detial from '@/components/detials/index.vue'
153
+import tagDialog from '@/components/assembly/tagDialog.vue'
154
+
151 155
 export default {
152
-  components: { detial, selfInput, selfCustomerservice, enterpriseTag, datePicker, selfChannel, selfGender, lossBody, screenPay, shieldingUser },
156
+  components: { tagDialog, detial, selfInput, selfCustomerservice, enterpriseTag, datePicker, selfChannel, selfGender, lossBody, screenPay, shieldingUser },
153 157
   data () {
154 158
     return {
155
-      drawerSize:'60%',
159
+      drawerSize: '60%',
156 160
       detialDrawer: false,
157 161
       loading: false,
158 162
       page: 1,
159 163
       pages: 0,
160 164
       total: 0,
161
-      page_size: 20,
165
+      page_size: 2,
162 166
       shieldingFlag: false,
163 167
       pageOptions: [
164 168
         { name: '全部', id: 1 },
165 169
         { name: '当前页面', id: 2 },
166 170
       ],
167 171
       pageOptionValue: 2,
172
+      old_pageOptionValue: 2,
168 173
       input_keyword: '',
169 174
       tableData: [],
170 175
       user_id_list: [],//客服user_id列表
@@ -181,12 +186,81 @@ export default {
181 186
       otherData: {},
182 187
       shieldingData: {},//拉黑的数据
183 188
       rowPro: {},//去详情的此条对象
189
+      multipleSelection: {},
190
+      exclude_multiple_selection: {},
191
+      isAll: false,//是否选择全部
192
+      tagVisible: true,
193
+      tagType: 1
184 194
     }
185 195
   },
186 196
   created () {
187 197
     this.init(1)
188 198
   },
189 199
   methods: {
200
+    closeTagDialog (val) {
201
+      if (val && val.length != 0) {
202
+        this.page = page ? page : this.page;
203
+        this.loading = true
204
+        this.$axios.get(this.URL.BASEURL + this.URL.customer_setCustomerTag, {
205
+          params: {
206
+            user_id_list: this.user_id_list,
207
+            customer_name: this.input_keyword,
208
+            add_date_start: this.add_date_start,
209
+            add_date_end: this.add_date_end,
210
+            add_way: this.add_way,
211
+            pay_status: this.pay_status,
212
+            pay_num_min: this.pay_num_min,
213
+            pay_num_max: this.pay_num_max,
214
+            tag_type: this.tag_type,
215
+            tag_id_list: this.tag_id_list,
216
+            loss_status: this.loss_status,
217
+            page: this.page,
218
+            page_size: this.page_size
219
+          }
220
+        }).then((res) => {
221
+          var res = res.data
222
+          this.loading = false
223
+          if (res && res.errno == 0) {
224
+            this.tableData = res.rst.data.list;
225
+            this.otherData = {
226
+              count: res.rst.data.count,
227
+              exclude_count: res.rst.data.exclude_count
228
+            }
229
+            this.total = res.rst.pageInfo.total;
230
+            this.pages = res.rst.pageInfo.pages;
231
+
232
+            // 回显选择
233
+            let page_multiple_data = [];
234
+            if (this.isAll && (!this.multipleSelection[this.page])) {
235
+              page_multiple_data = this.tableData
236
+            } else {
237
+              let multiple_id = this.multipleSelection[this.page] ? this.multipleSelection[this.page].map((v) => {
238
+                return v.user_id + '-' + v.customer_id
239
+              }) : []
240
+              this.tableData.forEach((item) => {
241
+                if (multiple_id.indexOf((item.user_id + '-' + item.customer_id)) != -1) {
242
+                  page_multiple_data.push(item)
243
+                }
244
+              })
245
+            }
246
+            this.$nextTick(() => {
247
+              page_multiple_data.forEach((row) => {
248
+                this.$refs.multipleTable.toggleRowSelection(row, true);
249
+              })
250
+            })
251
+
252
+          } else if (res.errno != 4002) {
253
+            this.$message({
254
+              message: res.err,
255
+              type: "warning"
256
+            })
257
+          }
258
+        }).catch((err) => {
259
+          this.loading = false
260
+        });
261
+      }
262
+      this.tagVisible = false
263
+    },
190 264
     resetEvent () {//重置
191 265
       this.resetFlag = !this.resetFlag
192 266
       this.input_keyword = '';
@@ -278,13 +352,33 @@ export default {
278 352
         this.loading = false
279 353
         if (res && res.errno == 0) {
280 354
           this.tableData = res.rst.data.list;
281
-          console.log(this.tableData);
282 355
           this.otherData = {
283 356
             count: res.rst.data.count,
284 357
             exclude_count: res.rst.data.exclude_count
285 358
           }
286 359
           this.total = res.rst.pageInfo.total;
287 360
           this.pages = res.rst.pageInfo.pages;
361
+
362
+          // 回显选择
363
+          let page_multiple_data = [];
364
+          if (this.isAll && (!this.multipleSelection[this.page])) {
365
+            page_multiple_data = this.tableData
366
+          } else {
367
+            let multiple_id = this.multipleSelection[this.page] ? this.multipleSelection[this.page].map((v) => {
368
+              return v.user_id + '-' + v.customer_id
369
+            }) : []
370
+            this.tableData.forEach((item) => {
371
+              if (multiple_id.indexOf((item.user_id + '-' + item.customer_id)) != -1) {
372
+                page_multiple_data.push(item)
373
+              }
374
+            })
375
+          }
376
+          this.$nextTick(() => {
377
+            page_multiple_data.forEach((row) => {
378
+              this.$refs.multipleTable.toggleRowSelection(row, true);
379
+            })
380
+          })
381
+
288 382
         } else if (res.errno != 4002) {
289 383
           this.$message({
290 384
             message: res.err,
@@ -295,24 +389,75 @@ export default {
295 389
         this.loading = false
296 390
       });
297 391
     },
392
+    setCustomerTag (type) {//批量打标签、移除标签
393
+      //type 操作类型 1添加标签 2移除标签
394
+      let multipleArr = []
395
+      for (var i in this.multipleSelection) {
396
+        multipleArr = multipleArr.concat(this.multipleSelection[1] ? this.multipleSelection[1] : [])
397
+      }
398
+      if (multipleArr.length == 0) {
399
+        this.$message({
400
+          message: '请选择客户!',
401
+          type: "warning"
402
+        })
403
+        return
404
+      }
405
+      this.tagVisible = true;
406
+      this.tagType = type
407
+    },
298 408
     handleCurrentChange (val) {
299 409
       this.init(val)
300 410
     },
301
-    handleSelectionChange () {
302
-
411
+    handleSelectAll (row) {//点击了全选
412
+      if (this.isAll && row.length == 0) {
413
+        this.multipleSelection = {}
414
+        this.exclude_multiple_selection = {}
415
+        this.isAll = false
416
+      }
303 417
     },
304
-
305
-    changeDrawerSize(){
418
+    handleSelectionChange (row) {//点击选择变化
419
+      this.multipleSelection[this.page] = row && row.length != 0 ? row : null;
420
+      if (this.isAll) {//全选状态下被排除的用户
421
+        let page_multiple_data = [];
422
+        let multiple_id = this.multipleSelection[this.page] ? this.multipleSelection[this.page].map((v) => {
423
+          return v.user_id + '-' + v.customer_id
424
+        }) : []
425
+        this.tableData.forEach((item) => {
426
+          if (multiple_id.indexOf((item.user_id + '-' + item.customer_id)) != -1) {
427
+            page_multiple_data.push(item)
428
+          }
429
+        })
430
+        this.exclude_multiple_selection[this.page] = page_multiple_data
431
+      }
432
+    },
433
+    pageOptionSelect (val) {//选择
434
+      if (val && val != '') {
435
+        this.old_pageOptionValue = val;
436
+      }
437
+      this.exclude_multiple_selection = {}
438
+      if (this.pageOptionValue == 1) {
439
+        this.isAll = true
440
+      } else {//选择当前页面
441
+        this.isAll = false
442
+        let current_page_data = this.multipleSelection[this.page];
443
+        this.multipleSelection = {};
444
+        this.multipleSelection[this.page] = current_page_data ? current_page_data : null;
445
+      }
446
+      this.tableData.forEach((row) => {
447
+        this.$refs.multipleTable.toggleRowSelection(row, true);
448
+      });
449
+    },
450
+    changeDrawerSize () {
306 451
       this.drawerSize = this.drawerSize == '100%' ? '60%' : '100%'
307 452
     },
308
-    closeDrawer(){
453
+    closeDrawer () {
309 454
       this.detialDrawer = false
310 455
     },
311 456
     showDetial (row) {
312 457
       this.rowPro = row
313 458
       this.drawerSize = '60%'
314 459
       this.detialDrawer = true
315
-      this.$nextTick(()=>{
460
+      this.$nextTick(() => {
316 461
         this.$refs.detial.acIdx = 0
317 462
         this.$refs.detial.init()
318 463
       })

+ 79 - 0
project/src/components/manage/tagManage.vue

@@ -0,0 +1,79 @@
1
+<template>
2
+  <div v-loading="loading">
3
+    <div class="screenBox">
4
+      <self-input label_name="标签搜索" @inputChange='(val)=>{input_keyword = val;init(1)}'></self-input>
5
+      <div class="reset" @click="resetEvent">重置</div>
6
+    </div>
7
+    <div class="tableInfo">
8
+      <div>
9
+        <div class="flex">
10
+          <div class="totalCustom">共<span>{{total}}</span>个标签</div>
11
+        </div>
12
+      </div>
13
+      <div class="flex">
14
+        <el-button type="primary" size="mini" @click="init(1,'export')">添加标签组</el-button>
15
+      </div>
16
+    </div>
17
+    <div class="tagListBox">
18
+      <div class="tagItemBox">
19
+
20
+      </div>
21
+    </div>
22
+  </div>
23
+</template>
24
+<script>
25
+import selfInput from '@/components/assembly/screen/input.vue'
26
+export default {
27
+  components: { selfInput },
28
+  data () {
29
+    return {
30
+      loading: false,
31
+      total: 0,
32
+      tableData: [],
33
+      resetFlag: false,//重置
34
+      input_keyword: ''
35
+    }
36
+  },
37
+  created () {
38
+    this.init(1)
39
+  },
40
+  methods: {
41
+    resetEvent () {//重置
42
+      this.resetFlag = !this.resetFlag
43
+      this.input_keyword = ''
44
+      this.init()
45
+    },
46
+    init () {
47
+      this.loading = true
48
+      this.$axios.get(this.URL.BASEURL + this.URL.tagList, {
49
+        params: {
50
+          keyword: this.input_keyword
51
+        }
52
+      }).then((res) => {
53
+        var res = res.data
54
+        this.loading = false
55
+        if (res && res.errno == 0) {
56
+          this.tableData = res.rst;
57
+          this.total = this.tableData.length;
58
+        } else if (res.errno != 4002) {
59
+          this.$message({
60
+            message: res.err,
61
+            type: "warning"
62
+          })
63
+        }
64
+      }).catch((err) => {
65
+        this.loading = false
66
+      });
67
+    },
68
+    handleCurrentChange (val) {
69
+      this.init(val)
70
+    },
71
+  }
72
+}
73
+</script>
74
+<style lang="scss" scoped>
75
+@import "@/style/list.scss";
76
+.tableInfo {
77
+  height: 50px;
78
+}
79
+</style>

+ 11 - 0
project/src/router/allRouter.js

@@ -11,6 +11,7 @@ const lostCustomer = () => import(/* webpackChunkName: 'lostCustomer' */ '@/comp
11 11
 const customerTransfer = () => import(/* webpackChunkName: 'customerTransfer' */ '@/components/customManage/customerTransfer.vue')
12 12
 const transferRecord = () => import(/* webpackChunkName: 'transferRecord' */ '@/components/customManage/transferRecord.vue')
13 13
 const authorityManage = () => import(/* webpackChunkName: 'authorityManage' */ '@/components/manage/authorityManage.vue')
14
+const tagManage = () => import(/* webpackChunkName: 'tagManage' */ '@/components/manage/tagManage.vue')
14 15
 
15 16
 
16 17
 export var allRouter = [
@@ -148,6 +149,16 @@ export var allRouter = [
148 149
           isLogin: true,
149 150
           title: '授权管理'
150 151
         }
152
+      },
153
+      {
154
+        path: 'tagManage',
155
+        name: 'tagManage',
156
+        component: tagManage,
157
+        meta: {
158
+          keepAlive: false,
159
+          isLogin: true,
160
+          title: '标签管理'
161
+        }
151 162
       }
152 163
     ]
153 164
   }

+ 1 - 1
project/src/router/navList.js

@@ -64,7 +64,7 @@ var navList = [
64 64
     small_menu: [
65 65
       {
66 66
         viewName: '标签管理',
67
-        path: 'chain',
67
+        path: 'tagManage',
68 68
       },
69 69
     ]
70 70
   },