Ver código fonte

新增短信,工作日管理修改

seimin 2 anos atrás
pai
commit
9a814b486a

+ 165 - 15
assets/js/controllers/incident/incidentCtrl.js

@@ -301,6 +301,15 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
301 301
                     '</div>'
302 302
             },
303 303
             {
304
+                name: 'visited',
305
+                displayName: '回访状态',
306
+                width: '70',
307
+                enableSorting: false,
308
+                cellTemplate: '<div>' +
309
+                    '<div class="ui-grid-cell-contents" >{{row.entity.visited === 1 ? "已回访" : (row.entity.visited === 0 ? "未回访" : "")}}</div>' +
310
+                    '</div>'
311
+            },
312
+            {
304 313
                 name: '操作',
305 314
                 enableSorting: false,
306 315
                 width: 500,
@@ -952,14 +961,20 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
952 961
             fildata.searchType = $scope.searchstate;
953 962
         }
954 963
         console.log(fildata,78777);
955
-        if(fildata.searchType === 'all'){
956
-            if(fildata.incident&&fildata.incident.selectType){
957
-                fildata.incident.selectType = fildata.incident.selectType.id;
958
-            }
959
-        }else{
960
-            if(fildata.incident&&fildata.incident.selectType){
961
-                delete fildata.incident.selectType;
962
-            }
964
+        // if(fildata.searchType === 'all'){
965
+        //     if(fildata.incident&&fildata.incident.selectType){
966
+        //         fildata.incident.selectType = fildata.incident.selectType.id;
967
+        //     }
968
+        // }else{
969
+        //     if(fildata.incident&&fildata.incident.selectType){
970
+        //         delete fildata.incident.selectType;
971
+        //     }
972
+        // }
973
+        if(fildata.incident&&fildata.incident.selectType){
974
+            fildata.incident.selectType = fildata.incident.selectType.id;
975
+        }
976
+        if(fildata.incident&&fildata.incident.visited){
977
+            fildata.incident.visited = fildata.incident.visited.id;
963 978
         }
964 979
         // /seimin
965 980
         $scope.refreshData('expand-right', fildata);
@@ -2250,7 +2265,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2250 2265
             }
2251 2266
         });
2252 2267
     }
2253
-    // 指派弹窗baba
2268
+    // 指派弹窗
2254 2269
     $scope.toAssign = function (model) {
2255 2270
         console.log(model)
2256 2271
         var modalInstance = $modal.open({
@@ -2395,6 +2410,117 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2395 2410
         });
2396 2411
     }
2397 2412
     
2413
+    // 新增发送短信弹窗 liaomingming
2414
+    $scope.toSms = function (model) {
2415
+        console.log(model)
2416
+        var modalInstance = $modal.open({
2417
+            templateUrl: 'assets/views/incident/tpl/toSms.tpl.html',
2418
+            controller: function ($scope, $modalInstance, api_bpm_domain, modelData, currentUserId, Alert, api_user_data) {
2419
+                console.log(model,loginUser);
2420
+                $scope.assignUser = null;
2421
+                $scope.assignGroup = null;
2422
+                //获取用户
2423
+                $scope.getUsers = function(key = ''){
2424
+                    $scope.user = [];
2425
+                    var postData = postData = {
2426
+                        "idx": 0,
2427
+                        "sum": 10,
2428
+                        user: {
2429
+                            name: key,
2430
+                            roledata: { rolecode: "first-line support" },
2431
+                            selectType: "pinyin_qs"
2432
+                        }
2433
+                    };
2434
+                    api_user_data.fetchDataList('user', postData).then(function (data) {
2435
+                        $scope.user = data.list;
2436
+                    })
2437
+                }
2438
+                //获取组
2439
+                $scope.getGroups = function(){
2440
+                    $scope.user = [];
2441
+                    var postData = postData = {
2442
+                        "idx": 0,
2443
+                        "sum": 100,
2444
+                        group: {
2445
+                            'selectType':'nouser'
2446
+                        }
2447
+                    };
2448
+                    api_user_data.fetchDataList('group', postData).then(function (data) {
2449
+                        $scope.group = data.list;
2450
+                    })
2451
+                }
2452
+                $scope.userOrGroup = 1;
2453
+                $scope.user = [];
2454
+                $scope.group = [];
2455
+                $scope.getUsers();
2456
+                $scope.getGroups();
2457
+                
2458
+                $scope.ok = function () {
2459
+                    if ($scope.userOrGroup == 1 && !$scope.assignUser){
2460
+                        Alert.swal({
2461
+                            title: "操作失败",
2462
+                            text: "请选择处理人!",
2463
+                            type: "error"
2464
+                        });
2465
+                        return;
2466
+                    }
2467
+                    if ($scope.userOrGroup == 2 && !$scope.assignGroup){
2468
+                        Alert.swal({
2469
+                            title: "操作失败",
2470
+                            text: "请选择处理组!",
2471
+                            type: "error"
2472
+                        });
2473
+                        return;
2474
+                    }
2475
+                    return;
2476
+                    api_bpm_domain.delegateTask(model.taskId, {assginee:$scope.assignUser}).then(function (response) {
2477
+                        console.log(response)
2478
+                        if (response.status == 200) {
2479
+                            Alert.swal({
2480
+                                title: "操作成功!",
2481
+                                confirmButtonColor: "#007AFF",
2482
+                                type: "success"
2483
+                            });
2484
+                            $modalInstance.close('success');
2485
+                        } else {
2486
+                            Alert.swal({
2487
+                                title: "操作失败",
2488
+                                text: "操作失败, 请稍后再试!",
2489
+                                type: "error"
2490
+                            });
2491
+                        }
2492
+                    });
2493
+                }
2494
+
2495
+                $scope.cancel = function () {
2496
+                    $modalInstance.dismiss('cancel');
2497
+                }
2498
+            },
2499
+            size: 'sm',
2500
+            resolve: {
2501
+                api_bpm: function () {
2502
+                    return api_bpm;
2503
+                },
2504
+                modelData: function () {
2505
+                    return model;
2506
+                },
2507
+                currentUserId: function () {
2508
+                    return loginUser.id;
2509
+                },
2510
+                Alert: function () {
2511
+                    return SweetAlert;
2512
+                },
2513
+                api_user_data: function () {
2514
+                    return api_user_data;
2515
+                }
2516
+            }
2517
+        });
2518
+        modalInstance.result.then(function (selectedItem) {
2519
+            if (selectedItem == 'success') {
2520
+                $scope.refreshData('expand-right', defaultFilterData);
2521
+            }
2522
+        });
2523
+    }
2398 2524
     // 新增沟通记录弹窗
2399 2525
     $scope.toHandlerLog = function (model) {
2400 2526
         console.log(model)
@@ -2471,7 +2597,7 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2471 2597
                         });
2472 2598
                         return;
2473 2599
                     }
2474
-                    api_bpm_data.getCallRecordId({ano: localStorage.getItem('hk_phone'), bno: $scope.telephone, agentId: $rootScope.user.id}).then(function(response){
2600
+                    api_bpm_data.getCallRecordId({ano: localStorage.getItem('hk_phone') || undefined, bno: $scope.telephone || undefined, agentId: $rootScope.user.id}).then(function(response){
2475 2601
                         console.log(response)
2476 2602
                         if (response.status == 200) {
2477 2603
                             $scope.callId = response.data || undefined;//获取callId
@@ -2741,24 +2867,43 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
2741 2867
         //     $scope.jry_refresh()
2742 2868
         // }, $rootScope.refreshTime);
2743 2869
     }
2744
-    // 是否逾期下拉框选择seimin
2870
+    // 是否逾期下拉框选择
2745 2871
     $scope.selectTypeChange = function(){
2746 2872
         console.log($scope.searchkeys.selectType,66666);
2747 2873
         if(window.sessionStorage.getItem('isGoyuqi') == 'yes'){
2748 2874
             $scope.searchkeys.selectType = {id:'2',name:'是'};
2749
-            // window.sessionStorage.removeItem('isGoyuqi');//seimin
2875
+            // window.sessionStorage.removeItem('isGoyuqi');
2750 2876
         }
2751 2877
         var ids = $scope.searchkeys.selectType.id
2752 2878
         if(defaultFilterData.incident){
2753
-            defaultFilterData.incident.selectType = ids;//seimin
2879
+            defaultFilterData.incident.selectType = ids;
2754 2880
         }else{
2755 2881
             defaultFilterData.incident = {
2756 2882
                 selectType:ids
2757 2883
             };
2758 2884
         }
2759
-        defaultFilterData.searchType = 'all';
2885
+        defaultFilterData.searchType = $scope.searchstate;
2760 2886
         console.log(defaultFilterData,2222)
2761
-        $scope.onChange('all');
2887
+        $scope.onChange($scope.searchstate);
2888
+    }
2889
+    // 是否回访下拉框选择
2890
+    $scope.visited = [
2891
+        {id: 1, name: '已回访'},
2892
+        {id: 0, name: '未回访'}
2893
+    ]
2894
+    $scope.visitedChange = function(){
2895
+        console.log($scope.searchkeys.visited,66666);
2896
+        var ids = $scope.searchkeys.visited.id;
2897
+        if(defaultFilterData.incident){
2898
+            defaultFilterData.incident.visited = ids;
2899
+        }else{
2900
+            defaultFilterData.incident = {
2901
+                visited:ids
2902
+            };
2903
+        }
2904
+        defaultFilterData.searchType = $scope.searchstate;
2905
+        console.log(defaultFilterData,3333)
2906
+        $scope.onChange($scope.searchstate);
2762 2907
     }
2763 2908
     //获取列表数据
2764 2909
     $scope.refreshData = function (style, filterData) {
@@ -3182,6 +3327,10 @@ app.controller('IncidentOperCtrl', ['$rootScope', '$http', '$scope', '$modal', '
3182 3327
     $scope.delSj = function () {
3183 3328
         $scope.colobject.grid.appScope.delSj($scope.item);
3184 3329
     }
3330
+    // 发送短信
3331
+    $scope.toSms = function () {
3332
+        $scope.colobject.grid.appScope.toSms($scope.item);
3333
+    }
3185 3334
     // 新增沟通记录
3186 3335
     $scope.toHandlerLog = function () { //print
3187 3336
         $scope.colobject.grid.appScope.toHandlerLog($scope.item);
@@ -3270,6 +3419,7 @@ app.directive('incidentoperator', function () {
3270 3419
             // '<a ng-click="print()" ng-show="dayin" class="bianjifont" >打印</a>' +
3271 3420
             // '<a ng-click="jry_evaluate()"  ng-show="jry_evaluateShow()" class="luyinfont" >评价</a>' +
3272 3421
             '<a ng-click="record()"  ng-show="{{item.callID}}" class="luyinfont" >录音</a>' +
3422
+            '<a ng-click="toSms()" ng-show="{{item.huifang&&huifang}}" class="assign" >发送短信</a>' +
3273 3423
             '<a ng-click="toHandlerLog()" ng-show="{{item.huifang&&huifang}}" class="assign" >新增沟通记录</a>' +
3274 3424
             // '<a ng-click="rotate()" ng-show="{{item.state.id==4}}" class="rotate" >转派</a>' +
3275 3425
             // '<a ng-click="upgrade()" ng-show="{{up&&item.state.id==4&&item.currentRole!=' + "'incident manager'" + '}}" class="upgrade" >升级</a>' +

+ 54 - 21
assets/js/controllers/system/user/schedulingplan.js

@@ -42,7 +42,7 @@ app.controller("calendarCtrl", function($scope,$rootScope, $filter, $q, $timeout
42 42
         myData.friday == 1 ? $scope.options.selected[4] = workdays.year + '-5' : $scope.options.selected[4] = '';
43 43
         myData.saturday == 1 ? $scope.options.selected[5] = workdays.year + '-6' : $scope.options.selected[5] = '';
44 44
         myData.sunday == 1 ? $scope.options.selected[6] = workdays.year + '-7' : $scope.options.selected[6] = '';
45
-        // console.log($scope.options.selected)
45
+        console.log($scope.options.selected)
46 46
     })
47 47
     $scope.options = {
48 48
         reset: true,
@@ -53,6 +53,27 @@ app.controller("calendarCtrl", function($scope,$rootScope, $filter, $q, $timeout
53 53
         selected: []
54 54
     };
55 55
 
56
+    $scope.saveMonth = function(){
57
+        api_bpm_data.addData('workdayexception', {workdayexception: {list: $scope.arrList}}).then(function(response) {
58
+            if (response.status == 200) {
59
+                SweetAlert.swal({
60
+                    title: "修改成功!",
61
+                    text: "修改排班成功!",
62
+                    type: "success"
63
+                }, function() {
64
+                    $scope.refreshData(workdays);
65
+                });
66
+            } else {
67
+                SweetAlert.swal({
68
+                    title: "修改失败!",
69
+                    text: "修改排班失败!",
70
+                    type: "error"
71
+                });
72
+            }
73
+
74
+        })
75
+    }
76
+
56 77
     $scope.saveweek = function(selected) {
57 78
         var numget = ['2', '2', '2', '2', '2', '2', '2'];
58 79
         var longtime = '';
@@ -117,6 +138,7 @@ app.controller("calendarCtrl", function($scope,$rootScope, $filter, $q, $timeout
117 138
             }
118 139
         }
119 140
         api_bpm_data.fetchDataList('workday', monedata).then(function(response) {
141
+            $scope.arrList = [];
120 142
             var myData = response.list;
121 143
             $scope.selectedDate = [];
122 144
             angular.forEach(myData, function(item) {
@@ -132,6 +154,7 @@ app.controller("calendarCtrl", function($scope,$rootScope, $filter, $q, $timeout
132 154
         $scope.dayFormat = direction === "vertical" ? "EEEE, MMMM d" : "d";
133 155
     };
134 156
     var ischeck = '';
157
+    $scope.arrList = [];
135 158
     $scope.dayClick = function(date) {
136 159
         if($scope.bianji){
137 160
             if ($scope.selectedDate.length == 0) {
@@ -151,31 +174,41 @@ app.controller("calendarCtrl", function($scope,$rootScope, $filter, $q, $timeout
151 174
             console.log(date);
152 175
             // var ymd = [date.getFullYear(), date.getMonth() + 1, date.getDate()].join("-");
153 176
             var ymd =  moment(date.getTime() + 86399999).format('YYYY-MM-DD HH:mm:ss');
154
-            var monedata = {
155
-                "workdayexception": {
177
+            var flagIndex = $scope.arrList.findIndex(v => angular.equals(ymd, v.date));
178
+            if(flagIndex > -1){
179
+                $scope.arrList[flagIndex].isWork = !$scope.arrList[flagIndex].isWork;
180
+            }else{
181
+                $scope.arrList.push({
156 182
                     "date": ymd,
157 183
                     "isWork": ischeck
158
-                }
184
+                });
159 185
             }
186
+            console.log($scope.arrList)
187
+            // var monedata = {
188
+            //     "workdayexception": {
189
+            //         "date": ymd,
190
+            //         "isWork": ischeck
191
+            //     }
192
+            // }
160 193
     
161
-            api_bpm_data.addData('workdayexception', monedata).then(function(response) {
162
-                if (response.status == 200) {
163
-                    SweetAlert.swal({
164
-                        title: "修改成功!",
165
-                        text: "修改排班成功!",
166
-                        type: "success"
167
-                    }, function() {
168
-                        $scope.refreshData(workdays);
169
-                    });
170
-                } else {
171
-                    SweetAlert.swal({
172
-                        title: "修改失败!",
173
-                        text: "修改排班失败!",
174
-                        type: "error"
175
-                    });
176
-                }
194
+            // api_bpm_data.addData('workdayexception', monedata).then(function(response) {
195
+            //     if (response.status == 200) {
196
+            //         SweetAlert.swal({
197
+            //             title: "修改成功!",
198
+            //             text: "修改排班成功!",
199
+            //             type: "success"
200
+            //         }, function() {
201
+            //             $scope.refreshData(workdays);
202
+            //         });
203
+            //     } else {
204
+            //         SweetAlert.swal({
205
+            //             title: "修改失败!",
206
+            //             text: "修改排班失败!",
207
+            //             type: "error"
208
+            //         });
209
+            //     }
177 210
     
178
-            })
211
+            // })
179 212
         }else{
180 213
             SweetAlert.swal({
181 214
                 title: "修改失败",

+ 14 - 0
assets/views/incident/list.html

@@ -272,6 +272,20 @@
272 272
                                 <span class="glyphicon glyphicon-trash"></span>
273 273
                             </button>
274 274
                         </div>
275
+                        <div class="form-group incidentsearch">
276
+                            <div class="control-label pull-left margin-top-5">是否回访:</div>
277
+                            <ui-select style="margin-right:24px;width: 60%;" ng-change="visitedChange()" ng-model="searchkeys.visited" class="pull-right selectzise wt_width1 wt_width3" theme="bootstrap">
278
+                                <ui-select-match placeholder="请选择">
279
+                                    <span ng-bind="$select.selected.name"></span>
280
+                                </ui-select-match>
281
+                                <ui-select-choices repeat="item in visited">
282
+                                    <span ng-bind="item.name"></span>
283
+                                </ui-select-choices>
284
+                             </ui-select>
285
+                             <button style="position:absolute;right:0;padding:2px 4px;" ng-click="searchkeys.visited = undefined" class="btn btn-default">
286
+                                <span class="glyphicon glyphicon-trash"></span>
287
+                            </button>
288
+                        </div>
275 289
                         <!-- <div class='wt_width6' style="">
276 290
                             <span class="panel-title text-dark">至</span>
277 291
                         </div>

+ 61 - 0
assets/views/incident/tpl/toSms.tpl.html

@@ -0,0 +1,61 @@
1
+<!-- 转派 -->
2
+<div class="modal-header">
3
+    <div class="modal-title fontcolor-two fontsizes-14">发送短信
4
+        <button type="button" class="close pull-right" ng-click="cancel()">×</button>
5
+    </div>
6
+</div>
7
+<div class="modal-body center">
8
+    <div class="form-group incidentsearch" style="margin:0 auto;width: 300px;">
9
+        <div class=" input-group" style="margin:8px 0 0;">
10
+            <div class="control-label pull-left margin-top-5 margin-right-5">
11
+                <label class="demoincident">选择处理人/组</label>:</div>
12
+            <div class="pull-left">
13
+                <label>
14
+                    <input type="radio" value="1" ng-model="userOrGroup" name="userOrGroup" style="position:relative;top:2px;">
15
+                    <span>处理人</span>
16
+                </label>
17
+                <label>
18
+                    <input type="radio" value="2" ng-model="userOrGroup" name="userOrGroup" style="position:relative;top:2px;">
19
+                    <span>处理组</span>
20
+                </label>
21
+            </div>
22
+        </div>
23
+    </div>
24
+    <div class="form-group incidentsearch" style="margin:0 auto;width: 300px;" ng-if="userOrGroup == 1">
25
+        <div class=" input-group" style="margin:8px 0 0;">
26
+            <div class="control-label pull-left margin-top-5 margin-right-5">
27
+                <label class="demoincident">处理人</label>:</div>
28
+            <div class="pull-right">
29
+                <ui-select class="pull-left" style="width:230px" ng-model="assignUser" theme="bootstrap">
30
+                    <ui-select-match placeholder="">
31
+                        {{$select.selected.name}}
32
+                    </ui-select-match>
33
+                    <ui-select-choices repeat="item in user | filter:{$:$select.search}" refresh="getUsers($select.search)">
34
+                        <div ng-bind-html="(item.name + '(' + item.account + ')') | highlight: $select.search"></div>
35
+                    </ui-select-choices>
36
+                </ui-select>
37
+            </div>
38
+        </div>
39
+    </div>
40
+    <div class="form-group incidentsearch" style="margin:0 auto;width: 300px;" ng-if="userOrGroup == 2">
41
+        <div class=" input-group" style="margin:8px 0 0;">
42
+            <div class="control-label pull-left margin-top-5 margin-right-5">
43
+                <label class="demoincident">处理组</label>:</div>
44
+            <div class="pull-right">
45
+                <ui-select class="pull-left" style="width:230px" ng-model="assignGroup" theme="bootstrap">
46
+                    <ui-select-match placeholder="">
47
+                        {{$select.selected.groupName}}
48
+                    </ui-select-match>
49
+                    <ui-select-choices repeat="item in group | filter:{$:$select.search}">
50
+                        <div ng-bind-html="item.groupName | highlight: $select.search"></div>
51
+                    </ui-select-choices>
52
+                </ui-select>
53
+            </div>
54
+        </div>
55
+    </div>
56
+    
57
+</div>
58
+<div class="modal-footer modelfooter-hint pointfont">
59
+    <div class="hintfooterleft pull-left" ng-click="ok()" style="cursor: pointer;">确定</div>
60
+    <div class="hintfooterright pull-right" ng-click="cancel()" style="cursor: pointer;">取消</div>
61
+</div>

+ 3 - 0
assets/views/system/user/matrialcalendar.html

@@ -187,4 +187,7 @@ angular.module('app', ['angular-dayparts']).controller('main', function($scope){
187 187
     <div ng-if="calendarView=='week'&&bianji" class="text-center margin-top-30px">
188 188
         <a ng-click="saveweek(options.selected);" class="btn btn-addbutton  addbutton">保存</a>
189 189
     </div>
190
+    <div ng-if="calendarView=='month'&&bianji" class="text-center margin-top-30px">
191
+        <a ng-click="saveMonth();" class="btn btn-addbutton  addbutton">保存</a>
192
+    </div>
190 193
     </div>