Browse Source

设置调接口

liuxiaona 2 years ago
parent
commit
4d1518bf19

+ 4 - 11
.idea/workspace.xml

@@ -3,16 +3,9 @@
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="f876064f-ad38-46e7-bf7d-9df623a9178f" name="Changes" comment="">
5 5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/css/app.85dd6470.css" beforeDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/favicon.ico" beforeDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/index.html" beforeDir="false" />
9
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/js/about.76dda73f.js" beforeDir="false" />
10
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/js/about.76dda73f.js.map" beforeDir="false" />
11
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/js/app.58bbdb7e.js" beforeDir="false" />
12
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/js/app.58bbdb7e.js.map" beforeDir="false" />
13
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/js/chunk-vendors.ec43d46e.js" beforeDir="false" />
14
-      <change beforePath="$PROJECT_DIR$/qwh5/dist/js/chunk-vendors.ec43d46e.js.map" beforeDir="false" />
15
-      <change beforePath="$PROJECT_DIR$/qwh5/src/router/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/qwh5/src/router/index.ts" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/project/src/assets/config/interface_api.js" beforeDir="false" afterPath="$PROJECT_DIR$/project/src/assets/config/interface_api.js" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/index.vue" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/setting.vue" beforeDir="false" afterPath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/setting.vue" afterDir="false" />
16 9
     </list>
17 10
     <option name="SHOW_DIALOG" value="false" />
18 11
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -59,7 +52,7 @@
59 52
       <updated>1653986562930</updated>
60 53
       <workItem from="1653986566612" duration="2107000" />
61 54
       <workItem from="1654070934388" duration="14000" />
62
-      <workItem from="1654573024055" duration="15505000" />
55
+      <workItem from="1654573024055" duration="23176000" />
63 56
     </task>
64 57
     <servers />
65 58
   </component>

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

@@ -146,6 +146,7 @@ var api = {
146 146
   batchAddCustomer_delete: "/api/customer/deleteDetail",
147 147
   record_delete: "/api/customer/deleteRecord",
148 148
   batchRemind: "/api/customer/batchRemind",
149
+  setting_rebackInfo: "/api/BatchAddCustomer/configInfo",
149 150
 
150 151
 
151 152
 };

+ 96 - 10
project/src/components/marketingGuest/batchAddFriend/addFriend/index.vue

@@ -26,6 +26,15 @@
26 26
               v-loading="loading">
27 27
       <el-table-column width="30px" type="selection" v-if="status!==0"></el-table-column>
28 28
       <el-table-column label="电话号码" align="center" show-overflow-tooltip>
29
+        <template #header v-if="status!==0">
30
+          <div class="customTitle" slot="reference">{{pageOptionValue==0?'选择当前页面客户':'选择全部客户'}}<i class="el-icon-arrow-down"></i>
31
+<!--            @visible-change="pageOptionValue=''"-->
32
+            <el-select v-model="pageOptionValue" class="customTitleSelect" placeholder="请选择" size="mini" @change="pageOptionSelect" >
33
+              <el-option v-for="item in pageOptions" :key="item.id" :label="item.name" :value="item.id">
34
+              </el-option>
35
+            </el-select>
36
+          </div>
37
+        </template>
29 38
         <template slot-scope="scope">
30 39
           <div>{{scope.row.phone ? scope.row.phone : '-'}}</div>
31 40
         </template>
@@ -129,7 +138,7 @@ export default {
129 138
     return {
130 139
       test:10,
131 140
       loading:false,
132
-      status:0,
141
+      status:1,
133 142
       statusArrs:[
134 143
         {
135 144
           name:'全部',
@@ -165,6 +174,12 @@ export default {
165 174
       noChooseFlag:false,//是否选中电话号码,true,表示没有人
166 175
       time:[],
167 176
       user_ids:[],//批量选中的人
177
+      exclude_id_list:[],//批量选中后,删除的人
178
+      pageOptionValue:0,
179
+      pageOptions: [
180
+        { name: '全部', id: 1 },
181
+        { name: '当前页面', id: 0 },
182
+      ],
168 183
     }
169 184
   },
170 185
   watch:{
@@ -178,10 +193,34 @@ export default {
178 193
     //   this.status = arg
179 194
     //   this.test = arg
180 195
     // })
196
+
181 197
     this.height = document.documentElement.clientHeight - 250 > 400 ? document.documentElement.clientHeight - 250 : 400
182 198
     this.init(1)
199
+    this.$nextTick(()=>{
200
+      this.$refs.settingRef.dialogVisible = true
201
+    })
183 202
   },
184 203
   methods:{
204
+    pageOptionSelect (val) {//选择
205
+      this.pageOptionValue = val
206
+      console.log(this.pageOptionValue);
207
+      // if (val && val != '') {
208
+      //   this.old_pageOptionValue = val;
209
+      // }
210
+      // this.exclude_multiple_selection = {}
211
+      if (this.pageOptionValue == 1) {
212
+        // this.isAll = true
213
+      } else {//选择当前页面
214
+        // this.isAll = false
215
+        // let current_page_data = this.multipleSelection[this.page];
216
+        // this.multipleSelection = {};
217
+        // this.multipleSelection[this.page] = current_page_data ? current_page_data : null;
218
+      }
219
+      // this.tableData.forEach((row) => {
220
+      //   this.$refs.multipleTable.toggleRowSelection(row, true);
221
+      // });
222
+
223
+    },
185 224
     clearuser_ids(){ //清空批量选中的人
186 225
       this.user_ids = []
187 226
     },
@@ -196,10 +235,12 @@ export default {
196 235
       }
197 236
     },
198 237
     handleSelectionChange(val){//列表选择人员
238
+      console.log(val);
199 239
       this.user_ids = []
200 240
       val.forEach(item=>{
201 241
         this.user_ids.push(item.user_id)
202 242
       })
243
+
203 244
     },
204 245
     batchDele(){//批量删除
205 246
       this.noChooseCustomeTips()
@@ -225,10 +266,28 @@ export default {
225 266
         cancelButtonText: '取消',
226 267
         confirmButtonText: '确定',
227 268
       }).then(()=>{
228
-        this.$nextTick(()=>{
229
-          this.$loading(this.$loadingConfig)
230
-          this.$refs.dialogPublic.addCustomer_notice()
231
-        })
269
+        this.$axios.post(this.URL.BASEURL + this.URL.batchRemind, {
270
+          add_status:this.status==0?'':this.status,
271
+          keyword:this.input_keyword,
272
+          start_time: this.time[0],
273
+          end_time: this.time[1],
274
+          select_all:this.pageOptionValue,
275
+          select_id_list:this.user_ids,
276
+          exclude_id_list:this.exclude_id_list
277
+        }).then((res) => {
278
+          var res = res.data
279
+          this.$message({
280
+            message: res.err,
281
+            type: "warning"
282
+          })
283
+
284
+        }).catch((err) => {
285
+          this.loading = false
286
+          this.$message({
287
+            message: err,
288
+            type: "warning"
289
+          })
290
+        });
232 291
       })
233 292
     },
234 293
     batchAllot(){//批量分配
@@ -264,15 +323,42 @@ export default {
264 323
         this.user_ids.push(user_id)
265 324
       })
266 325
     },
267
-    deleCustomer(){//单个删除
326
+    delePack(select_id_list,exclude_id_list){
327
+      this.loading=true
328
+      this.$axios.post(this.URL.BASEURL + this.URL.batchAddCustomer_delete, {
329
+        add_status:this.status==0?'':this.status,
330
+        keyword:this.input_keyword,
331
+        start_time: this.time[0],
332
+        end_time: this.time[1],
333
+        select_all:0,
334
+        select_id_list:select_id_list,
335
+        exclude_id_list:exclude_id_list?exclude_id_list:[]
336
+      }).then((res) => {
337
+        this.loading = false
338
+        var res = res.data
339
+        this.$message({
340
+          message: res.err,
341
+          type: "warning"
342
+        })
343
+        if(res&&res.errno==0){
344
+          this.init(1)
345
+        }
346
+      }).catch((err) => {
347
+        this.loading = false
348
+        this.$message({
349
+          message: err,
350
+          type: "warning"
351
+        })
352
+      });
353
+    },
354
+    deleCustomer(id){//单个删除
268 355
       this.$alert('是否确定删除此客户', '提示', {
269 356
         cancelButtonText: '取消',
270 357
         confirmButtonText: '确定',
271 358
       }).then(()=>{
272
-        this.$message({
273
-          type: 'success',
274
-          message: '删除成功!'
275
-        });
359
+        let ids = []
360
+        ids.push(id)
361
+        this.delePack(ids)
276 362
       })
277 363
     },
278 364
     init (page, type) {

+ 102 - 23
project/src/components/marketingGuest/batchAddFriend/addFriend/setting.vue

@@ -2,6 +2,7 @@
2 2
     <div class="friend_setting">
3 3
       <el-dialog
4 4
         title="设置"
5
+        v-loading="loading"
5 6
         :visible.sync="dialogVisible"
6 7
         width="40%">
7 8
 
@@ -12,26 +13,28 @@
12 13
               <div class="flex-align-center">
13 14
                 <div class="f14 fWeight600 rMar22 c-000">未分配提醒</div>
14 15
                 <el-switch
15
-                  v-model="noAllotVal"
16
+                  v-model="config_list.assigned.enable"
16 17
                   active-color="#13ce66"
17 18
                   inactive-color="#ccc">
18 19
                 </el-switch>
19 20
               </div>
20
-              <div v-if="noAllotVal" class="line40">
21
-                超过 <el-input v-model="overDayVal" size="mini" class="dayIpt" @change="(val)=>val ? overDayVal = val : overDayVal = 1"></el-input> 天,
21
+              <div v-if="config_list.assigned.enable" class="line40">
22
+                超过 <el-input v-model="config_list.assigned.threshold" size="mini" class="dayIpt" @change="(val)=>val ? config_list.assigned.threshold = val : config_list.assigned.threshold = 1"></el-input> 天,
22 23
                 <span class="fWeight600 c-000">客户未分配跟进成员</span>,次日
23 24
                 <el-time-picker
24 25
                   prefix-icon = 'none'
25 26
                   :clearable="false"
26 27
                   size="mini"
27
-                  v-model="nextDayTimeVal"
28
+                  v-model="config_list.assigned.action_time"
29
+                  format="HH:mm:ss"
30
+                  value-format="HH:mm:ss"
28 31
                   :picker-options="{
29 32
                   selectableRange: '00:00:00 - 23:59:59'
30 33
                 }">
31 34
                 </el-time-picker>
32 35
                 提醒管理员分配,
33 36
                 选择接收提醒管理员:
34
-                <self-customerservice title='选择成员' width="180px" :afferent_users='user_id_list' @customerDefine="(val)=>{user_id_list=val;}"></self-customerservice>
37
+                <self-customerservice style="display: inline-block" title='' width="360px" :afferent_users='user_id_list' @customerDefine="(val)=>{user_id_list=val;}"></self-customerservice>
35 38
               </div>
36 39
             </template>
37 40
             <div class="splitLine"></div>
@@ -40,19 +43,21 @@
40 43
               <div class="flex-align-center">
41 44
                 <div class="f14 fWeight600 rMar22 c-000">未跟进提醒</div>
42 45
                 <el-switch
43
-                  v-model="noFollowUpVal"
46
+                  v-model="config_list.charged.enable"
44 47
                   active-color="#13ce66"
45 48
                   inactive-color="#ccc">
46 49
                 </el-switch>
47 50
               </div>
48
-              <div v-if="noFollowUpVal" class="line40">
49
-                超过 <el-input v-model="overDayVal_noFollowUp" size="mini" class="dayIpt" @change="(val)=>val ? overDayVal_noFollowUp = val : overDayVal_noFollowUp = 1"></el-input> 天,
51
+              <div v-if="config_list.charged.enable" class="line40">
52
+                超过 <el-input v-model="config_list.charged.threshold" size="mini" class="dayIpt" @change="(val)=>val ? config_list.charged.threshold = val : config_list.charged.threshold = 1"></el-input> 天,
50 53
                 <span class="fWeight600 c-000">成员未添加客户</span>,次日
51 54
                 <el-time-picker
52 55
                   prefix-icon = 'none'
53 56
                   :clearable="false"
54 57
                   size="mini"
55
-                  v-model="nextDayTimeVal_noFollowUp"
58
+                  v-model="config_list.charged.action_time"
59
+                  format="HH:mm:ss"
60
+                  value-format="HH:mm:ss"
56 61
                   :picker-options="{
57 62
                   selectableRange: '00:00:00 - 23:59:59'
58 63
                 }">
@@ -66,13 +71,13 @@
66 71
             <div class="flex-align-center">
67 72
               <div class="f14 fWeight600 rMar22 c-000">未通过提醒</div>
68 73
               <el-switch
69
-                v-model="noPassVal"
74
+                v-model="config_list.auto_recycle.enable"
70 75
                 active-color="#13ce66"
71 76
                 inactive-color="#ccc">
72 77
               </el-switch>
73 78
             </div>
74
-            <div v-if="noPassVal" class="line40">
75
-              超过 <el-input v-model="overDayVal_noPass" size="mini" class="dayIpt" @change="(val)=>val ? overDayVal_noPass = val : overDayVal_noPass = 1"></el-input> 天,<span class="fWeight600 c-000">客户未通过好友申请</span>,自动转移到待分配
79
+            <div v-if="config_list.auto_recycle.enable" class="line40">
80
+              超过 <el-input v-model="config_list.auto_recycle.threshold" size="mini" class="dayIpt" @change="(val)=>val ? config_list.auto_recycle.threshold = val : config_list.auto_recycle.threshold = 1"></el-input> 天,<span class="fWeight600 c-000">客户未通过好友申请</span>,自动转移到待分配
76 81
             </div>
77 82
           </el-tab-pane>
78 83
         </el-tabs>
@@ -98,32 +103,106 @@ export default {
98 103
       user_id_list:[],
99 104
       dialogVisible:false,
100 105
       activeName:'first',
101
-      noAllotVal:false,
102
-      overDayVal:1,
103
-      adminVal: '',
104
-      nextDayTimeVal:'',
105
-      noFollowUpVal:false,
106
-      overDayVal_noFollowUp:3,
107
-      nextDayTimeVal_noFollowUp:'',
108
-      noPassVal:false,
109
-      overDayVal_noPass:7
106
+      loading:false,
107
+      config_list:{
108
+        assigned:{//未分配配置
109
+          config_id:0,
110
+          type:1,
111
+          threshold:1,
112
+          action_time:'09:00:00',
113
+          notice_users:'',
114
+          enable:0
115
+        },
116
+        charged:{//未跟进配置
117
+          config_id:0,
118
+          type:2,
119
+          threshold:1,
120
+          action_time:"09:00:00",
121
+          enable:0
122
+        },
123
+        auto_recycle:{//未通过提醒
124
+          config_id:0,
125
+          type:3,
126
+          threshold:1,
127
+          enable:0
128
+        }
129
+      },
110 130
     }
111 131
   },
132
+  watch:{
133
+    user_id_list(){
134
+      console.log(this.user_id_list);
135
+      this.config_list.assigned.notice_users = this.user_id_list&&this.user_id_list.length>0 ? (this.user_id_list.length==1?this.user_id_list[0]:this.user_id_list.join()) : ''
136
+      console.log(this.config_list.assigned.notice_users);
137
+    }
138
+  },
139
+  created(){
140
+    this.rebackInfo()
141
+  },
112 142
   methods:{
113 143
     handleClick(){
114 144
 
115 145
     },
116 146
     save(){
117
-      this.dialogVisible = false
118
-      if(this.adminVal == ''){
147
+      if(this.user_id_list&&this.user_id_list.length==0 || this.config_list.assigned.notice_users==''){
119 148
         this.$message({
120 149
           type: 'error',
121 150
           message: '请选择管理员!'
122 151
         });
123 152
         return
124 153
       }
154
+      this.newSetting()
155
+    },
125 156
 
157
+    newSetting(){
158
+      this.$loading(this.$loadingConfig)
159
+      let config_list_finally=[]
160
+      config_list_finally.push(this.config_list.assigned,this.config_list.charged,this.config_list.auto_recycle)
161
+      this.$axios.post(this.URL.BASEURL + this.URL.editConfig, {
162
+        config_id:'',
163
+        sys_group_id:this.$cookie.getCookie('isSuperManage') == 1 ? sessionStorage.getItem('company_session_defaultCorp_level_1').toString() : '',
164
+        config_list:config_list_finally
165
+      }).then((res) => {
166
+        var res = res.data
167
+        this.$message({
168
+          message: res.err,
169
+          type: "warning"
170
+        })
171
+        this.$loading(this.$loadingConfig).close()
172
+        this.dialogVisible = false
173
+      }).catch((err) => {
174
+        this.$loading(this.$loadingConfig).close()
175
+        this.$message({
176
+          message: err,
177
+          type: "warning"
178
+        })
179
+      });
126 180
     },
181
+    rebackInfo(){
182
+      this.loading = true
183
+      this.$axios.post(this.URL.BASEURL + this.URL.editConfig, {
184
+        sys_group_id:this.$cookie.getCookie('isSuperManage') == 1 ? Number(sessionStorage.getItem('company_session_defaultCorp_level_1')) : '',
185
+      }).then((res) => {
186
+        this.loading = false
187
+        var res = res.data
188
+        if(res&&res.errno==0){
189
+          this.config_list = res.rst
190
+          // this.user_id_list = res.rst.assigned.notice_users.split(',')
191
+        }else{
192
+          this.$message({
193
+            message: res.err,
194
+            type: "warning"
195
+          })
196
+        }
197
+
198
+      }).catch((err) => {
199
+        this.loading = false
200
+        this.$message({
201
+          message: err,
202
+          type: "warning"
203
+        })
204
+      });
205
+    }
127 206
 
128 207
   }
129 208
 }