Browse Source

渠道活码

liuxiaona 2 years ago
parent
commit
4368f504a2

+ 107 - 0
project/src/components/channelCode/addLimit.vue

@@ -0,0 +1,107 @@
1
+<template>
2
+  <div>
3
+    <el-table v-loading="loading" ref="multipleTable"
4
+              border
5
+              :height='height'
6
+              :data="tableData"
7
+              tooltip-effect="dark"
8
+              :header-cell-style="()=>{return { backgroundColor: '#f9f9f9 !important' }}"
9
+              style="width: 100%">
10
+      <el-table-column label="全部成员" align="center">
11
+        <template slot-scope="scope">
12
+          <div>{{scope.row ? scope.row : '-'}}</div>
13
+        </template>
14
+      </el-table-column>
15
+
16
+      <el-table-column label="操作" align="center">
17
+        <template slot-scope="scope">
18
+          <div class="c-00B38A pointer lMar8">删除</div>
19
+        </template>
20
+      </el-table-column>
21
+    </el-table>
22
+    <div class="pagination" v-show="total>0">
23
+      <el-pagination background :current-page="page" @current-change="handleCurrentChange" layout="prev, pager, next" :page-count='Number(pages)'>
24
+      </el-pagination>
25
+    </div>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+export default {
31
+  name: "addLimit",
32
+  data(){
33
+    return{
34
+      loading: false,
35
+      dataLoading: false,
36
+      page: 1,
37
+      pages: 0,
38
+      total: 0,
39
+      page_size: 20,
40
+      height: '',
41
+      tableData:[]
42
+    }
43
+  },
44
+  watch:{
45
+    'propsData.initFlag'(){
46
+      this.init(1)
47
+    }
48
+  },
49
+  created() {
50
+    this.height = document.documentElement.clientHeight - 300 > 400 ? document.documentElement.clientHeight - 300 : 400
51
+    this.init(1)
52
+  },
53
+  methods:{
54
+    goDataAanlyse(id){
55
+      this.$router.push('/dataAnalyse/'+id)
56
+    },
57
+    init (page, type) {
58
+      if (type != 'export') {
59
+        this.page = page ? page : this.page;
60
+      } else {
61
+        if (this.total == 0) {
62
+          this.$message({
63
+            message: '暂无数据可导出',
64
+            type: "warning"
65
+          })
66
+          return
67
+        }
68
+      }
69
+      this.loading = true
70
+      this.$axios.get(this.URL.BASEURL + this.URL.batchAddCustomer_statistic, {
71
+        params:{
72
+          start_date: '2022-05-14',
73
+          end_date: '2022-06-13',
74
+          page: type == 'export' ? 1 : this.page,
75
+          pagesize: type == 'export' ? this.$store.state.exportNumber : this.page_size,
76
+        }
77
+      }).then((res) => {
78
+        var res = res.data
79
+        this.loading = false
80
+        if (res && res.errno == 0) {
81
+          if (type == 'export') {
82
+            this.exportEvent(res.rst.data)
83
+          } else {
84
+            this.tableData = res.rst.data
85
+            this.total = res.rst.pageInfo.total;
86
+            this.pages = res.rst.pageInfo.pages;
87
+          }
88
+        } else if (res.errno != 4002) {
89
+          this.$message({
90
+            message: res.err,
91
+            type: "warning"
92
+          })
93
+        }
94
+      }).catch((err) => {
95
+        this.loading = false
96
+      });
97
+    },
98
+    handleCurrentChange (val) {
99
+      this.init(val)
100
+    },
101
+  }
102
+}
103
+</script>
104
+
105
+<style scoped>
106
+
107
+</style>

+ 1 - 1
project/src/components/channelCode/codeIndex.vue

@@ -56,7 +56,7 @@ export default {
56 56
       this.customer_val = ''
57 57
     },
58 58
     createdchannel_code(){//新建渠道活码
59
-
59
+      this.$router.push('/createChannelCode')
60 60
     }
61 61
   }
62 62
 }

+ 243 - 0
project/src/components/channelCode/createChannelCode.vue

@@ -0,0 +1,243 @@
1
+<template>
2
+  <div>
3
+    <div class="backBox" @click="$router.go(-1)">
4
+     <div class="back">
5
+       <i class="el-icon-back"></i>
6
+       <span>返回</span>
7
+     </div>
8
+   </div>
9
+
10
+    <div v-if="!loading" class="bg-ffffff createMassMsg" style="padding: 15px 30px;">
11
+      <div class="self-hint" style="margin-top:10px;width:730px">
12
+        <i class="el-icon-message-solid"></i>
13
+        <div>
14
+          <div>1.新建渠道活码最多可发送10条消息(包含1条文字消息和9条附加消息)</div>
15
+          <div>2.附加消息包括图片、连接、小程序</div>
16
+          <div>3.渠道欢迎语将在客户加为好友后20秒内发送,网络延迟可能造成发送失败</div>
17
+        </div>
18
+      </div>
19
+      <div class="line" style="margin-top:20px"></div>
20
+      <h3 class="bigTitle">基础信息</h3>
21
+      <div class="regulations">
22
+        <label><em>*</em>渠道名称</label>
23
+        <el-input placeholder="请输入渠道名称" style="width:300px" v-model.trim="channelName" clearable size="small"></el-input>
24
+      </div>
25
+      <div class="regulations">
26
+        <label><em>*</em>选择分组</label>
27
+        <el-select v-model="group_val" clearable placeholder="请选择">
28
+          <el-option
29
+            v-for="item in groupArrs"
30
+            :key="item.value"
31
+            :label="item.label"
32
+            :value="item.value">
33
+          </el-option>
34
+        </el-select>
35
+        <div class="newGroupCss">新建分组</div>
36
+      </div>
37
+      <div class="regulations">
38
+        <label><em>*</em>使用客服</label>
39
+        <self-customerservice title='' width="300px"
40
+                              :afferent_users='user_id_list'
41
+                              @customerDefine="(val)=>{user_id_list=val;}"></self-customerservice>
42
+      </div>
43
+      <div class="regulations">
44
+        <label><em>*</em>选择标签</label>
45
+        <enterprise-tag title="" width="300px"
46
+                        :afferent_obj='afferent_tag_obj'
47
+                        :reset='resetFlag' @tagDefine="tagDefine" style="margin:0;margin-top: 10px"></enterprise-tag>
48
+      </div>
49
+      <div class="regulations">
50
+        <label><em>*</em>渠道欢迎语</label>
51
+        <edit-con source="welcom"
52
+                  :afferent_content='main_msg_data.content'
53
+                  :afferent_attachments='main_msg_data.attachments'
54
+                  @editContent="(val)=>{main_msg_data.content = val}"
55
+                  @changeAttachment='getAttachment'></edit-con>
56
+      </div>
57
+      <h3 class="bigTitle" style="margin-top:20px">
58
+        分时段欢迎语:
59
+        <el-switch v-model="is_day_parting"
60
+                   @change="switchChange" active-color="#13ce66"
61
+                   inactive-color="#ddd"></el-switch>
62
+      </h3>
63
+      <template v-if="is_day_parting">
64
+        <div class="self-hint" style="margin-top:10px;width:750px;margin-left:70px;margin-top:20px">
65
+          <p>分时段欢迎语 :</p>
66
+          <div>
67
+            <p>1、员工上下班不同时间段可设置不同欢迎语;</p>
68
+            <p>2、分时段之外的时间将发送欢迎语。</p>
69
+          </div>
70
+        </div>
71
+        <div class="regulations regulations2" v-for="(item,index) in timeIntervalList" :key="index+'fenshiduan'">
72
+          <label style="margin-top:30px;text-align:right">时段{{index+1}}:</label>
73
+          <welcom-edit :deleteFlag='timeIntervalList.length==1?false:true'
74
+                       :editInfo="item"
75
+                       @welcomEditCon='(val)=>{getWelcomEdit(val,index)}'
76
+                       @deleteWelcomCon='deleteWelcomCon(index)'></welcom-edit>
77
+        </div>
78
+        <div class="add_welcom_hint" @click="addWelcom">
79
+          <i class="el-icon-circle-plus-outline"></i>
80
+          <span>添加分时段欢迎语</span>
81
+        </div>
82
+      </template>
83
+      <div class="self-hint" style="margin-top:20px;width:750px;margin-left:70px">
84
+        <i class="el-icon-message-solid"></i>
85
+        <div>
86
+          <p>1、新建欢迎语最多可发送1条文字消息和9个附件</p>
87
+          <p>2、文字消息和附件不能同时为空,当两者均填写时用户会收到多条消息</p>
88
+          <p>3、欢迎语将在客户加为好友后20秒内下发,因网络延迟可能造成发送不成功</p>
89
+        </div>
90
+      </div>
91
+      <div class="line" style="margin-top:20px"></div>
92
+      <h3 class="bigTitle" style="margin-top:20px">高级设置: </h3>
93
+      <div class="regulations">
94
+        <label><em>*</em>客户备注</label>
95
+        <template>
96
+          <el-input style="width: 300px"
97
+                    v-if="node_radio==2"
98
+                    placeholder="请输入客户备注"
99
+                    size="small"
100
+                    v-model="customerNote">
101
+            <template slot="prepend">客户昵称-</template>
102
+          </el-input>
103
+          <el-input style="width: 300px"
104
+                    size="small"
105
+                    v-if="node_radio==1"
106
+                    placeholder="请输入客户备注"
107
+                    v-model="customerNote">
108
+            <template slot="append">-客户昵称</template>
109
+          </el-input>
110
+        </template>
111
+       <div style="display: flex;margin-left: 20px">
112
+         <el-radio v-model="node_radio" :label="1">备注在昵称后</el-radio>
113
+         <el-radio v-model="node_radio" :label="2">备注在昵称前</el-radio>
114
+       </div>
115
+      </div>
116
+      <div class="regulations" style="margin-left: 100px">
117
+        <div>示例</div>
118
+        <div class="customerNoteBox">
119
+          <img src="../../assets/img/cs_logo.png" alt="" style="width: 30px;height: 30px;margin-right: 8px">
120
+          <div class="flex-align-center">
121
+            <template v-if="node_radio==2"><span class="c-000">{{customerNote}}</span> -客户昵称</template>
122
+            <template v-if="node_radio==1">客户昵称- <span class="c-000">{{customerNote}}</span></template>
123
+          </div>
124
+        </div>
125
+      </div>
126
+      <div class="regulations">
127
+        <label>客服添加上限</label>
128
+        <el-switch v-model="add_limit"
129
+                   @change="switchLimit" active-color="#13ce66"
130
+                   inactive-color="#ddd"></el-switch>
131
+      </div>
132
+      <template v-if="add_limit">
133
+
134
+
135
+      </template>
136
+
137
+
138
+
139
+
140
+    </div>
141
+  </div>
142
+</template>
143
+
144
+<script>
145
+import selfCustomerservice from '@/components/assembly/screen/customerService.vue'
146
+import enterpriseTag from '@/components/assembly/screen/enterpriseTagFC.vue'
147
+import editCon from '@/components/assembly/editCon.vue'
148
+import welcomEdit from '@/components/assembly/welcom_edit.vue'
149
+export default {
150
+  name: "createChannelCode",
151
+  components:{
152
+    selfCustomerservice,
153
+    enterpriseTag,
154
+    editCon,
155
+    welcomEdit
156
+  },
157
+  data(){
158
+    return{
159
+      loading:false,
160
+      channelName:'',
161
+      is_day_parting: false,
162
+      group_val:0,
163
+      groupArrs:[
164
+        {
165
+          label:'分组一',
166
+          value:0
167
+        }
168
+      ],
169
+
170
+      user_id_list: [],
171
+      afferent_tag_obj: {
172
+        tag_id_list: []
173
+      },
174
+      resetFlag: false,
175
+      main_msg_data: {
176
+        "is_day_parting": 0,
177
+        "weeks": [],
178
+        "start_time": "",
179
+        "end_time": "",
180
+        "content": '',
181
+        "attachments": []
182
+      },
183
+      deleteTimeIntervalList: [],//删除的分时段列表
184
+      timeIntervalList: [],//分时段列表
185
+      customerNote:'',//客户备注
186
+      node_radio:1,
187
+      add_limit:true
188
+    }
189
+  },
190
+  created(){
191
+
192
+  },
193
+  methods:{
194
+    tagDefine (data) {//标签选择回调
195
+      if (data.tag_id_list && data.tag_id_list.length != 0) {
196
+        this.tag_info = data.tag_id_list
197
+      } else {
198
+        this.tag_info = []
199
+      }
200
+    },
201
+    getAttachment (val) {
202
+      this.main_msg_data.attachments = val;
203
+    },
204
+    switchChange () {//分时段开关打开
205
+      if (this.is_day_parting && this.timeIntervalList.length == 0) {
206
+        this.timeIntervalList.push(this.init_welcom_con)
207
+      }
208
+    },
209
+    getWelcomEdit (val, index) {//分时段编辑
210
+      this.$set(this.timeIntervalList, index, val)
211
+    },
212
+    deleteWelcomCon (index) {//删除分时段
213
+      if (this.$route.params.rule_id && this.timeIntervalList[index].msg_id) {//删除的分时段内容
214
+        let obj = JSON.parse(JSON.stringify(this.timeIntervalList[index]))
215
+        obj.operate = 'del';
216
+        this.deleteTimeIntervalList.push(obj)
217
+      }
218
+      this.timeIntervalList.splice(index, 1)
219
+    },
220
+    addWelcom () {//添加分时段
221
+      this.timeIntervalList.push(this.init_welcom_con)
222
+    },
223
+    switchLimit(){
224
+
225
+    }
226
+  }
227
+}
228
+</script>
229
+
230
+<style lang="scss" scoped>
231
+@import "../customOperate/create.scss";
232
+.customerNoteBox{
233
+  display: flex;
234
+  padding:10px;
235
+  border: 1px solid #ddd;
236
+  margin-left: 20px;
237
+}
238
+.newGroupCss{
239
+  color: #00b38a;
240
+  font-size: 14px;
241
+  margin-left: 10px;
242
+}
243
+</style>

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

@@ -40,6 +40,7 @@ const importRecordDetial = () => import(/* webpackChunkName: 'importRecordDetial
40 40
 // const massMsgDetail = () => import(/* webpackChunkName: 'massMsgDetail' */ '@/components/customOperate/massMsgDetail/index.vue')
41 41
 const codeIndex = () => import(/* webpackChunkName: 'codeIndex' */ '@/components/channelCode/codeIndex.vue')
42 42
 const code_dataAnalyse = () => import(/* webpackChunkName: 'dataAnalyse' */ '@/components/channelCode/dataAnalyse.vue')
43
+const createChannelCode = () => import(/* webpackChunkName: 'createChannelCode' */ '@/components/channelCode/createChannelCode.vue')
43 44
 //
44 45
 
45 46
 // name与菜单配置的页面路由一致
@@ -122,6 +123,16 @@ export var allRouter = [
122 123
         }
123 124
       },
124 125
       {
126
+        path: 'createChannelCode',
127
+        name: 'codeIndex',
128
+        component: createChannelCode,
129
+        meta: {
130
+          keepAlive: false,
131
+          isLogin: true,
132
+          title: '新建渠道活码'
133
+        }
134
+      },
135
+      {
125 136
         path: 'importRecord',
126 137
         name: 'batchAddFriend',
127 138
         component: importRecord,