Browse Source

调接口

liuxiaona 2 years ago
parent
commit
96a9c28d10

+ 5 - 1
.idea/workspace.xml

@@ -4,6 +4,9 @@
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 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/dialogPublic.vue" beforeDir="false" afterPath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/dialogPublic.vue" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/importCustomer.vue" beforeDir="false" afterPath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/importCustomer.vue" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/importRecordDetial.vue" beforeDir="false" afterPath="$PROJECT_DIR$/project/src/components/marketingGuest/batchAddFriend/addFriend/importRecordDetial.vue" afterDir="false" />
7 10
       <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 11
       <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" />
9 12
     </list>
@@ -25,7 +28,7 @@
25 28
     <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
26 29
     <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
27 30
     <property name="WebServerToolWindowFactoryState" value="false" />
28
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/qwh5" />
31
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../data_center" />
29 32
     <property name="nodejs_package_manager_path" value="npm" />
30 33
     <property name="settings.editor.selected.configurable" value="editor.reader.mode" />
31 34
     <property name="vue.rearranger.settings.migration" value="true" />
@@ -53,6 +56,7 @@
53 56
       <workItem from="1653986566612" duration="2107000" />
54 57
       <workItem from="1654070934388" duration="14000" />
55 58
       <workItem from="1654573024055" duration="23176000" />
59
+      <workItem from="1654653264438" duration="18173000" />
56 60
     </task>
57 61
     <servers />
58 62
   </component>

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

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

+ 26 - 6
project/src/components/marketingGuest/batchAddFriend/addFriend/dialogPublic.vue

@@ -30,10 +30,27 @@ export default {
30 30
   },
31 31
   methods:{
32 32
     save(){
33
-      if(this.type == 'addCustomer'){
33
+      if(this.type == 'remindSingle'){
34 34
         this.addCustomer_notice()
35
+      }else if(this.type == 'allotSingle'){
36
+        if(this.user_id_list && this.user_id_list.length==0){
37
+          this.$message({
38
+            message: '分配人员不能为空',
39
+            type: "warning"
40
+          })
41
+          return
42
+        }
43
+        this.$parent.dialogPublic_allot_single()
44
+      }else if(this.type == 'allotMultiple'){
45
+        if(this.user_id_list && this.user_id_list.length==0){
46
+          this.$message({
47
+            message: '分配人员不能为空',
48
+            type: "warning"
49
+          })
50
+          return
51
+        }
52
+        this.$parent.dialogPublic_allot_multiple()
35 53
       }
36
-
37 54
     },
38 55
     addCustomer_notice(){
39 56
       this.loading = true
@@ -45,11 +62,13 @@ export default {
45 62
           message: res.err,
46 63
           type: "warning"
47 64
         })
48
-        this.dialogVisible = false
49 65
         this.loading = false
50
-        this.$parent.init(1)
51
-        this.$parent.clearuser_ids()
52 66
         this.$loading(this.$loadingConfig).close();
67
+        if(res&&res.errno==0){
68
+          this.dialogVisible = false
69
+          this.$parent.clearuser_ids()
70
+          this.$parent.init(1)
71
+        }
53 72
       }).catch((err) => {
54 73
         this.loading = false
55 74
         this.$message({
@@ -57,7 +76,8 @@ export default {
57 76
           type: "warning"
58 77
         })
59 78
       });
60
-    }
79
+    },
80
+
61 81
   }
62 82
 }
63 83
 </script>

+ 70 - 18
project/src/components/marketingGuest/batchAddFriend/addFriend/importCustomer.vue

@@ -13,14 +13,16 @@
13 13
             <!--:data="xlsxData"-->
14 14
             <el-upload
15 15
               class="upload-demo"
16
-              action="https://jsonplaceholder.typicode.com/posts/"
16
+              action="buchuan"
17 17
               accept=".xlsx,.xls"
18 18
               :limit="1"
19
+              :auto-upload="false"
19 20
               :before-upload="beforeUploadUpload"
20 21
               :on-success="uploadSuccess"
21 22
               :on-error='uploadFail'
22 23
               :on-remove="uploadRemove"
23 24
               :on-exceed="uploadExceed"
25
+              :on-change="changeFile"
24 26
             >
25 27
               <el-button size="small" type="primary">点击上传</el-button>
26 28
             </el-upload>
@@ -68,32 +70,82 @@ export default {
68 70
       afferent_tag_obj: {
69 71
         tag_id_list: []
70 72
       },
71
-      xlsxData:{
72
-        admin_id: this.$cookie.getCookie('admin_id'),
73
-        ttl: this.$cookie.getCookie('ttl'),
74
-        sign: this.$cookie.getCookie('sign'),
75
-        corpid: this.$localSelfStore.getLocal('defaultCorp') && this.$localSelfStore.getLocal('defaultCorp') != 'undefined' ? JSON.parse(this.$localSelfStore.getLocal('defaultCorp')).corpid : '',
76
-        type: 1,//素材类型。1图片 2语音 3视频
77
-      },
78
-      repeatNum:0
73
+      repeatNum:0,
74
+      fileUpload: null
79 75
     }
80 76
   },
81 77
   methods:{
78
+    changeFile(file,fileList){
79
+      console.log(file);
80
+      let test = new FormData()
81
+      test.append('file',file.raw)
82
+      this.fileUpload={
83
+        file:test
84
+      }
85
+      if(file.status == 'ready'){
86
+        // this.fileUpload.append('file',file.raw)
87
+      }else if(file.status == 'fail'){
88
+        this.$message({
89
+          message: '文件上传出错,请重新尝试',
90
+          type: "warning"
91
+        })
92
+      }
93
+    },
82 94
     save(){
83
-      // this.dialogVisible = false
95
+      if(!this.fileUpload){
96
+        this.$message({
97
+          message: '表格不能为空',
98
+          type: "warning"
99
+        })
100
+        return
101
+      }
102
+      if(this.user_id_list&&this.user_id_list.length==0){
103
+        this.$message({
104
+          message: '员工不能为空',
105
+          type: "warning"
106
+        })
107
+        return
108
+      }
109
+      this.$loading(this.$loadingConfig)
110
+      let data = {
111
+        user_id_list:this.user_id_list,
112
+        file:this.fileUpload.file,
113
+        customer_tag_list:this.afferent_tag_obj.tag_id_list
114
+      }
115
+      console.log(data);
116
+      this.$axios.post(this.URL.BASEURL + this.URL.batchAddCustomerImport, data).then((res) => {
117
+        var res = res.data
118
+        this.$message({
119
+          message: res.err,
120
+          type: "warning"
121
+        })
122
+        if(res&&res.errno==0){
123
+          this.dialogVisible = false
124
+        }
84 125
 
85
-      this.$nextTick(()=>{
86
-        this.$refs.dialogPublic.dialogVisible = true
87
-        this.dialogTitle = '提醒'
88
-        this.dialogMsg = `系统检测到导入客户列表中,与已导入客户列表有${this.repeatNum}个重复客户,是否跳过重复客户继续导入?`
126
+        this.$loading(this.$loadingConfig).close();
127
+      }).catch((err) => {
128
+        this.$loading(this.$loadingConfig).close();
129
+        this.$message({
130
+          message: err,
131
+          type: "warning"
132
+        })
133
+      });
134
+    },
135
+    save_bf(){
136
+      // this.dialogVisible = false
89 137
 
90
-      })
138
+      // this.$nextTick(()=>{
139
+      //   this.$refs.dialogPublic.dialogVisible = true
140
+      //   this.dialogTitle = '提醒'
141
+      //   this.dialogMsg = `系统检测到导入客户列表中,与已导入客户列表有${this.repeatNum}个重复客户,是否跳过重复客户继续导入?`
142
+      // })
91 143
     },
92 144
     tagDefine (data) {//标签选择回调
93 145
       if (data.tag_id_list && data.tag_id_list.length != 0) {
94
-        this.tag_info = data.tag_id_list
146
+        this.afferent_tag_obj.tag_id_list = data.tag_id_list
95 147
       } else {
96
-        this.tag_info = []
148
+        this.afferent_tag_obj.tag_id_list = []
97 149
       }
98 150
     },
99 151
     uploadRemove(file, fileList){
@@ -110,7 +162,7 @@ export default {
110 162
       })
111 163
     },
112 164
     uploadSuccess (res, file, fileList) {
113
-      console.log(res, file, fileList)
165
+      // console.log(res, file, fileList)
114 166
       this.$loading(this.$loadingConfig).close()
115 167
 
116 168
       // if (res.errno == 0) {

+ 4 - 3
project/src/components/marketingGuest/batchAddFriend/addFriend/importRecordDetial.vue

@@ -9,7 +9,7 @@
9 9
     </div>
10 10
 
11 11
     <div class="flex-align-center">
12
-      <div>
12
+      <div style="padding-left: 20px">
13 13
         <span class="fWeight600 c-000 f14">共{{allNum?allNum:'0'}}个客户</span>
14 14
         <span class="c-666 lMar10 f14">已添加{{addedNum?addedNum:'0'}}个客户</span>
15 15
       </div>
@@ -126,7 +126,6 @@ export default {
126 126
     init (page, type) {
127 127
       this.page = page ? page : this.page;
128 128
       this.loading = true
129
-      console.log(this.$route.params.id);
130 129
       this.$axios.get(this.URL.BASEURL + this.URL.batchAddCustomerRecordDetail, {
131 130
         params: {
132 131
           record_id:this.$route.params.id,
@@ -139,7 +138,9 @@ export default {
139 138
         var res = res.data
140 139
         this.loading = false
141 140
         if (res && res.errno == 0) {
142
-          this.tableData = res.rst.data;
141
+          this.tableData = res.rst.data.list;
142
+          this.allNum = res.rst.data.total
143
+            this.addedNum = res.rst.data.complete_total
143 144
           this.total = res.rst.pageInfo.total;
144 145
           this.pages = res.rst.pageInfo.pages;
145 146
         } else if (res.errno != 4002) {

+ 101 - 81
project/src/components/marketingGuest/batchAddFriend/addFriend/index.vue

@@ -8,7 +8,7 @@
8 8
         <self-input :hasLabel="false" label_name="电话/备注名" @inputChange='(val)=>{input_keyword = val;init(1)}'></self-input>
9 9
         <el-button class="lMar10" type="primary" plain size="small" @click="$refs.importCustomerRef.dialogVisible = true">导入客户</el-button>
10 10
         <el-button type="primary" plain size="small" @click="$router.push('/importRecord')">导入记录</el-button>
11
-        <el-button type="primary" plain size="small" @click="$refs.settingRef.dialogVisible = true">设置</el-button>
11
+        <el-button type="primary" plain size="small" @click="$refs.settingRef.dialogVisible = true,$refs.settingRef.rebackInfo()">设置</el-button>
12 12
 
13 13
         <el-button v-if="status!==0" type="primary" plain size="small" @click="batchDele()">批量删除</el-button>
14 14
         <el-button v-if="status==1 || status==2" type="primary" plain size="small" @click="batchRemind()">批量提醒</el-button>
@@ -22,10 +22,11 @@
22 22
               :data="tableData"
23 23
               tooltip-effect="dark"
24 24
               style="width: 100%"
25
+              @select="rowSelectClick"
25 26
               @selection-change="handleSelectionChange"
26 27
               v-loading="loading">
27 28
       <el-table-column width="30px" type="selection" v-if="status!==0"></el-table-column>
28
-      <el-table-column label="电话号码" align="center" show-overflow-tooltip>
29
+      <el-table-column label="电话号码" align="center" show-overflow-tooltip min-width="120">
29 30
         <template #header v-if="status!==0">
30 31
           <div class="customTitle" slot="reference">{{pageOptionValue==0?'选择当前页面客户':'选择全部客户'}}<i class="el-icon-arrow-down"></i>
31 32
 <!--            @visible-change="pageOptionValue=''"-->
@@ -103,9 +104,9 @@
103 104
       <el-table-column label="操作" align="center">
104 105
         <template slot-scope="scope">
105 106
           <div style="display: flex;align-items: center;justify-content: center;flex-wrap: wrap">
106
-            <div class="c-00B38A pointer" @click="goDetail(scope.row.id)">详情</div>
107
+            <div v-if="scope.row.add_status==3" class="c-00B38A pointer"  @click="goDetail(scope.row.id)">详情</div>
107 108
             <div class="c-00B38A pointer lMar10" @click="deleCustomer(scope.row.id)">删除</div>
108
-            <div v-if="scope.row.add_status==4" class="lMar10" :class="scope.row.add_status==4 ? 'c-00B38A pointer' : 'c-999 pointer-drop' " @click="scope.row.add_status==4 && allotCustomer(scope.row.id)">分配</div>
109
+            <div v-if="scope.row.add_status==4" class="lMar10" :class="scope.row.add_status==4 ? 'c-00B38A pointer' : 'c-999 pointer-drop' " @click="allotCustomer(scope.row.id)">分配</div>
109 110
             <div v-if="scope.row.add_status==1||scope.row.add_status==2" class="c-00B38A pointer lMar10" @click="remindCustomer(scope.row.user_id,scope.row.add_status)">提醒</div>
110 111
           </div>
111 112
         </template>
@@ -117,7 +118,7 @@
117 118
     </div>
118 119
 
119 120
 <!--    提醒分配等公共弹框-->
120
-    <dialogPublic ref="dialogPublic" :dialogTitle="dialogTitle" :dialogMsg="dialogMsg" type="addCustomer" :user_ids="user_ids"></dialogPublic>
121
+    <dialogPublic ref="dialogPublic" :dialogTitle="dialogTitle" :dialogMsg="dialogMsg" :type="dialogType" :user_ids="user_ids"></dialogPublic>
121 122
     <!--    设置-->
122 123
     <setting ref="settingRef"></setting>
123 124
     <!--    导入客户-->
@@ -170,16 +171,19 @@ export default {
170 171
       page_size: 20,
171 172
       dialogTitle:'',
172 173
       dialogMsg:'',
174
+      dialogType:'',
173 175
       user_id_list:[],
174 176
       noChooseFlag:false,//是否选中电话号码,true,表示没有人
175 177
       time:[],
176
-      user_ids:[],//批量选中的人
177
-      exclude_id_list:[],//批量选中后,删除的人
178
+      user_ids:[],//批量选中的人,user_id
179
+      select_id_list:[],//批量选中的人,id
180
+      exclude_id_list:[],//批量选中后,删除的人,id
178 181
       pageOptionValue:0,
179 182
       pageOptions: [
180 183
         { name: '全部', id: 1 },
181 184
         { name: '当前页面', id: 0 },
182 185
       ],
186
+      allotId:''
183 187
     }
184 188
   },
185 189
   watch:{
@@ -196,34 +200,28 @@ export default {
196 200
 
197 201
     this.height = document.documentElement.clientHeight - 250 > 400 ? document.documentElement.clientHeight - 250 : 400
198 202
     this.init(1)
199
-    this.$nextTick(()=>{
200
-      this.$refs.settingRef.dialogVisible = true
201
-    })
202 203
   },
203 204
   methods:{
204 205
     pageOptionSelect (val) {//选择
205 206
       this.pageOptionValue = val
206
-      console.log(this.pageOptionValue);
207
-      // if (val && val != '') {
208
-      //   this.old_pageOptionValue = val;
209
-      // }
210
-      // this.exclude_multiple_selection = {}
207
+
211 208
       if (this.pageOptionValue == 1) {
212
-        // this.isAll = true
209
+        this.$nextTick(()=>{
210
+          this.tableData.forEach((row) => {
211
+            this.$refs.multipleTable.toggleRowSelection(row, true);
212
+          })
213
+        })
214
+
213 215
       } 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;
216
+        this.$nextTick(()=>{
217
+          this.tableData.forEach((row) => {
218
+            this.$refs.multipleTable.toggleRowSelection(row, false);
219
+          })
220
+        })
221
+
218 222
       }
219
-      // this.tableData.forEach((row) => {
220
-      //   this.$refs.multipleTable.toggleRowSelection(row, true);
221
-      // });
222 223
 
223 224
     },
224
-    clearuser_ids(){ //清空批量选中的人
225
-      this.user_ids = []
226
-    },
227 225
     noChooseCustomeTips(){//没有选择客户提示
228 226
       this.noChooseFlag = false
229 227
       if( this.user_ids&& this.user_ids.length==0){
@@ -234,29 +232,42 @@ export default {
234 232
         this.noChooseFlag = true
235 233
       }
236 234
     },
235
+    rowSelectClick(selection, row){
236
+     if(this.pageOptionValue==1){
237
+       this.exclude_id_list.push(row.id)
238
+     }
239
+    },
237 240
     handleSelectionChange(val){//列表选择人员
238
-      console.log(val);
239 241
       this.user_ids = []
242
+      this.select_id_list = []
240 243
       val.forEach(item=>{
241 244
         this.user_ids.push(item.user_id)
245
+        this.select_id_list.push(item.id)
242 246
       })
243
-
244 247
     },
245 248
     batchDele(){//批量删除
246 249
       this.noChooseCustomeTips()
247 250
       if(this.noChooseFlag){
248 251
         return
249 252
       }
250
-      this.$alert('确定删除选择的客户?', '提示', {
253
+      this.$alert(`确定删除选择的${this.select_id_list&&this.select_id_list.length}个客户?`, '提示', {
251 254
         cancelButtonText: '取消',
252 255
         confirmButtonText: '确定',
253 256
       }).then(()=>{
254
-        this.$message({
255
-          type: 'success',
256
-          message: '删除成功!'
257
-        });
257
+        this.allot_dele_remind_pack('dele',this.pageOptionValue,this.select_id_list,this.exclude_id_list)
258 258
       })
259 259
     },
260
+    deleCustomer(id){//单个删除
261
+      this.$alert('是否确定删除此客户', '提示', {
262
+        cancelButtonText: '取消',
263
+        confirmButtonText: '确定',
264
+      }).then(()=>{
265
+        let ids = []
266
+        ids.push(id)
267
+        this.allot_dele_remind_pack('dele',0,ids)
268
+      })
269
+    },
270
+
260 271
     batchRemind(){//批量提醒
261 272
       this.noChooseCustomeTips()
262 273
       if(this.noChooseFlag){
@@ -266,73 +277,73 @@ export default {
266 277
         cancelButtonText: '取消',
267 278
         confirmButtonText: '确定',
268 279
       }).then(()=>{
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
-        });
280
+        this.allot_dele_remind_pack('remind',this.pageOptionValue,this.select_id_list,this.exclude_id_list)
281
+      })
282
+    },
283
+    remindCustomer(user_id,status){//单个提醒,走的接口二
284
+      this.$nextTick(()=>{
285
+        this.$refs.dialogPublic.dialogVisible = true
286
+        this.dialogType = 'remindSingle'
287
+        this.dialogTitle = '提醒'
288
+        this.dialogMsg = `如果员工长时间未${status == 1 ? '添加客户' : '通过好友申请可再次添加'},可通过企微助手再次提醒员工${status == 1 ? '添加' : '跟进'}客户,是否确认发送?`
289
+        this.user_ids = []
290
+        this.user_ids.push(user_id)
291 291
       })
292 292
     },
293
-    batchAllot(){//批量分配
293
+
294
+    batchAllot(){//批量分配,单个分配
294 295
       this.noChooseCustomeTips()
295 296
       if(this.noChooseFlag){
296 297
         return
297 298
       }
298 299
       this.$nextTick(()=>{
299 300
         this.$refs.dialogPublic.dialogVisible = true
301
+        this.dialogType = 'allotMultiple'
300 302
         this.dialogTitle = '分配'
301 303
         this.dialogMsg = ''
304
+        this.user_id_list = []
302 305
       })
303 306
 
304 307
     },
305
-    goDetail(){
306
-
307
-    },
308
-    allotCustomer(){//单个分配
308
+    allotCustomer(id){//单个分配
309 309
       this.$nextTick(()=>{
310 310
         this.$refs.dialogPublic.dialogVisible = true
311
+        this.dialogType = 'allotSingle'
311 312
         this.dialogTitle = '分配'
312 313
         this.dialogMsg = ''
313 314
         this.user_id_list = []
315
+        this.allotId = id
314 316
       })
317
+    },
315 318
 
319
+    dialogPublic_allot_single(){//单个分配
320
+      let ids = []
321
+      ids.push(this.allotId)
322
+      this.allot_dele_remind_pack('allot',0,ids)
316 323
     },
317
-    remindCustomer(user_id,status){//单个提醒
318
-      this.$nextTick(()=>{
319
-        this.$refs.dialogPublic.dialogVisible = true
320
-        this.dialogTitle = '提醒'
321
-        this.dialogMsg = `如果员工长时间未${status == 1 ? '添加客户' : '通过好友申请可再次添加'},可通过企微助手再次提醒员工${status == 1 ? '添加' : '跟进'}客户,是否确认发送?`
322
-        this.user_ids = []
323
-        this.user_ids.push(user_id)
324
-      })
324
+    dialogPublic_allot_multiple(){//多选分配
325
+      this.allot_dele_remind_pack('allot',this.pageOptionValue,this.select_id_list,this.exclude_id_list)
325 326
     },
326
-    delePack(select_id_list,exclude_id_list){
327
+
328
+    allot_dele_remind_pack(type,select_all,select_id_list,exclude_id_list){//分配,删除,提醒,多选及单个
327 329
       this.loading=true
328
-      this.$axios.post(this.URL.BASEURL + this.URL.batchAddCustomer_delete, {
330
+      let api = ''
331
+      if(type == 'allot'){
332
+        api=this.URL.batchDistributionCustomer
333
+      }else if(type == 'dele'){
334
+        api=this.URL.batchAddCustomer_delete
335
+      }else if(type == 'remind'){
336
+        api=this.URL.batchRemind
337
+      }
338
+      this.$axios.post(this.URL.BASEURL + api, {
329 339
         add_status:this.status==0?'':this.status,
330 340
         keyword:this.input_keyword,
331 341
         start_time: this.time[0],
332 342
         end_time: this.time[1],
333
-        select_all:0,
343
+        select_all:select_all,
334 344
         select_id_list:select_id_list,
335
-        exclude_id_list:exclude_id_list?exclude_id_list:[]
345
+        exclude_id_list:exclude_id_list?exclude_id_list:[],
346
+        user_id_list:this.$refs.dialogPublic.user_id_list
336 347
       }).then((res) => {
337 348
         this.loading = false
338 349
         var res = res.data
@@ -351,16 +362,11 @@ export default {
351 362
         })
352 363
       });
353 364
     },
354
-    deleCustomer(id){//单个删除
355
-      this.$alert('是否确定删除此客户', '提示', {
356
-        cancelButtonText: '取消',
357
-        confirmButtonText: '确定',
358
-      }).then(()=>{
359
-        let ids = []
360
-        ids.push(id)
361
-        this.delePack(ids)
362
-      })
365
+
366
+    goDetail(){
367
+
363 368
     },
369
+
364 370
     init (page, type) {
365 371
       this.page = page ? page : this.page;
366 372
       this.loading = true
@@ -380,6 +386,20 @@ export default {
380 386
           this.tableData = res.rst.data;
381 387
           this.total = res.rst.pageInfo.total;
382 388
           this.pages = res.rst.pageInfo.pages;
389
+
390
+          //重置
391
+          this.user_ids=[]
392
+          this.select_id_list=[]
393
+          this.exclude_id_list=[]
394
+
395
+          if(this.pageOptionValue == 1){
396
+            this.$nextTick(() => {
397
+              this.tableData.forEach((row) => {
398
+                this.$refs.multipleTable.toggleRowSelection(row, true);
399
+              })
400
+            })
401
+          }
402
+
383 403
         } else if (res.errno != 4002) {
384 404
           this.$message({
385 405
             message: res.err,

+ 55 - 19
project/src/components/marketingGuest/batchAddFriend/addFriend/setting.vue

@@ -2,11 +2,10 @@
2 2
     <div class="friend_setting">
3 3
       <el-dialog
4 4
         title="设置"
5
-        v-loading="loading"
6 5
         :visible.sync="dialogVisible"
7 6
         width="40%">
8 7
 
9
-        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
8
+        <el-tabs v-model="activeName" type="card" @tab-click="handleClick" v-loading="loading">
10 9
           <el-tab-pane label="自动提醒" name="first">
11 10
 <!--      未分配提醒      -->
12 11
             <template>
@@ -106,7 +105,7 @@ export default {
106 105
       loading:false,
107 106
       config_list:{
108 107
         assigned:{//未分配配置
109
-          config_id:0,
108
+          config_id:'',
110 109
           type:1,
111 110
           threshold:1,
112 111
           action_time:'09:00:00',
@@ -114,30 +113,28 @@ export default {
114 113
           enable:0
115 114
         },
116 115
         charged:{//未跟进配置
117
-          config_id:0,
116
+          config_id:'',
118 117
           type:2,
119 118
           threshold:1,
120 119
           action_time:"09:00:00",
121 120
           enable:0
122 121
         },
123 122
         auto_recycle:{//未通过提醒
124
-          config_id:0,
123
+          config_id:'',
125 124
           type:3,
126 125
           threshold:1,
127 126
           enable:0
128 127
         }
129
-      },
128
+      }
130 129
     }
131 130
   },
132 131
   watch:{
133 132
     user_id_list(){
134
-      console.log(this.user_id_list);
135 133
       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 134
     }
138 135
   },
139 136
   created(){
140
-    this.rebackInfo()
137
+
141 138
   },
142 139
   methods:{
143 140
     handleClick(){
@@ -155,11 +152,14 @@ export default {
155 152
     },
156 153
 
157 154
     newSetting(){
158
-      this.$loading(this.$loadingConfig)
155
+      this.loading=true
156
+      // this.$loading(this.$loadingConfig)
159 157
       let config_list_finally=[]
158
+      this.config_list.assigned.threshold = this.config_list.assigned.threshold*60
159
+      this.config_list.charged.threshold = this.config_list.charged.threshold*60
160
+      this.config_list.auto_recycle.threshold = this.config_list.auto_recycle.threshold*60
160 161
       config_list_finally.push(this.config_list.assigned,this.config_list.charged,this.config_list.auto_recycle)
161 162
       this.$axios.post(this.URL.BASEURL + this.URL.editConfig, {
162
-        config_id:'',
163 163
         sys_group_id:this.$cookie.getCookie('isSuperManage') == 1 ? sessionStorage.getItem('company_session_defaultCorp_level_1').toString() : '',
164 164
         config_list:config_list_finally
165 165
       }).then((res) => {
@@ -168,10 +168,11 @@ export default {
168 168
           message: res.err,
169 169
           type: "warning"
170 170
         })
171
-        this.$loading(this.$loadingConfig).close()
171
+        // this.$loading(this.$loadingConfig).close()
172
+        this.loading=false
172 173
         this.dialogVisible = false
173 174
       }).catch((err) => {
174
-        this.$loading(this.$loadingConfig).close()
175
+        this.loading=false
175 176
         this.$message({
176 177
           message: err,
177 178
           type: "warning"
@@ -180,15 +181,50 @@ export default {
180 181
     },
181 182
     rebackInfo(){
182 183
       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')) : '',
184
+      this.$axios.get(this.URL.BASEURL + this.URL.setting_rebackInfo, {
185
+        params:{
186
+          sys_group_id:this.$cookie.getCookie('isSuperManage') == 1 ? Number(sessionStorage.getItem('company_session_defaultCorp_level_1')) : '',
187
+        }
185 188
       }).then((res) => {
186
-        this.loading = false
187 189
         var res = res.data
188 190
         if(res&&res.errno==0){
189
-          this.config_list = res.rst
190
-          // this.user_id_list = res.rst.assigned.notice_users.split(',')
191
+          let configData = this.config_list
192
+          configData.assigned = res.rst.assigned
193
+          configData.charged = res.rst.charged
194
+          configData.auto_recycle = res.rst.auto_recycle
195
+
196
+
197
+          if(res.rst.assigned.enable == 1){
198
+            configData.assigned.enable = true
199
+            configData.assigned.threshold = res.rst.assigned.threshold/60
200
+            let users = configData.assigned.notice_users
201
+            if(users.split(',')){
202
+              this.user_id_list = users.split(',')
203
+            }else{
204
+              this.user_id_list.push(users)
205
+            }
206
+          }else{
207
+            configData.assigned.enable = false
208
+          }
209
+
210
+          if(res.rst.charged.enable == 1){
211
+            configData.charged.enable = true
212
+            configData.charged.threshold = res.rst.charged.threshold/60
213
+          }else{
214
+            configData.charged.enable = false
215
+          }
216
+
217
+          if(res.rst.auto_recycle.enable == 1){
218
+            configData.auto_recycle.enable = true
219
+            configData.auto_recycle.threshold = res.rst.auto_recycle.threshold/60
220
+          }else{
221
+            configData.auto_recycle.enable = false
222
+          }
223
+
224
+          this.loading = false
225
+
191 226
         }else{
227
+          this.loading=false
192 228
           this.$message({
193 229
             message: res.err,
194 230
             type: "warning"
@@ -228,7 +264,7 @@ export default {
228 264
 <style lang="scss" scoped>
229 265
 .splitLine{
230 266
   width: 100%;
231
-  border: 1px solid #ddd;
267
+  border-top: 1px solid #ddd;
232 268
   margin: 20px 0;
233 269
 }
234 270
 </style>