瀏覽代碼

增加系统配置和修复弹屏BUG

seimin 2 年之前
父節點
當前提交
f5668ef665

+ 1 - 1
assets/js/config.router.js

@@ -1843,7 +1843,7 @@ app.config(['$authProvider', '$httpProvider', '$stateProvider', '$urlRouterProvi
1843 1843
             .state('app.system.sysconfig', {
1844 1844
                 url: '/sysconfig',
1845 1845
                 templateUrl: "assets/views/system/sysconfig.html",
1846
-                resolve: loadSequence('jquery-sparkline', 'spin', 'ladda', 'angular-ladda', 'ui.grid', 'sysconfigCtrl'),
1846
+                resolve: loadSequence('jquery-sparkline', 'spin', 'ladda', 'angular-ladda', 'ui.grid', 'ui.select', 'sysconfigCtrl'),
1847 1847
                 title: 'Nav Manager',
1848 1848
                 ncyBreadcrumb: {
1849 1849
                     label: 'User Manager'

+ 4 - 4
assets/js/controllers/mainCtrl.js

@@ -1228,10 +1228,10 @@ app.controller('AppCtrl', ['$rootScope', '$scope', '$state', '$translate', '$loc
1228 1228
                                                             });
1229 1229
                                                             modalInstance.result.then(function(selectedItem) {
1230 1230
                                                                 if (selectedItem) {
1231
-                                                                    if (selectedItem.telephone && !selectedItem.mphone) {
1232
-                                                                        selectedItem.telephone = angular.copy(selectedItem.mphone);
1233
-                                                                        delete selectedItem.mphone;
1234
-                                                                    }
1231
+                                                                    // if (selectedItem.telephone && !selectedItem.mphone) {
1232
+                                                                    //     selectedItem.telephone = angular.copy(selectedItem.mphone);
1233
+                                                                    //     delete selectedItem.mphone;
1234
+                                                                    // }
1235 1235
                                                                     var data = {
1236 1236
                                                                         'requester': selectedItem
1237 1237
                                                                     };

+ 47 - 4
assets/js/controllers/system/sysconfigCtrl.js

@@ -1,5 +1,5 @@
1 1
 "use strict";
2
-app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "$interval", "$modal", "$window", "SweetAlert", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_sysinfo", "api_is_category", function (t, a, n, e, i, s, r, o, l, u, d, c, g, api_is_category) {
2
+app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "$interval", "$modal", "$window", "SweetAlert", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_sysinfo", "api_is_category", "api_wx_role", function (t, a, n, e, i, s, r, o, l, u, d, c, g, api_is_category, api_wx_role) {
3 3
     a.langs = l.getAllLangs(), a.lang = "zh-cn", l.setCurrentLang(a.lang);
4 4
     var f = (t.user, r._, {
5 5
         idx: 0,
@@ -10,6 +10,21 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
10 10
         var v = parseFloat(e.target.value)?parseFloat(e.target.value):0;
11 11
         a.autoCloseIncidentHour.valueconfig  = v > 0 ? v : 0;
12 12
     }
13
+    // 获取角色
14
+    a.roleList = [];
15
+    a.getRoleList = function(integralRole){
16
+        api_wx_role.getWxRole({ "idx": 0, "sum": 1000 }).then(function (data) {
17
+            a.roleList = data.list || [];
18
+            angular.forEach(a.myData, function (v, i) {
19
+                if (v.keyconfig == 'integralRole') {
20
+                    a.integralRole.valueconfig = a.roleList.filter(function (vv) {
21
+                        return v.valueconfig.indexOf(vv.id) > -1;
22
+                    });
23
+                    console.log(a.integralRole.valueconfig)
24
+                }
25
+            })
26
+        });
27
+    }
13 28
     //保存
14 29
     a.savesystem = function () {
15 30
         var arr = {};
@@ -29,6 +44,18 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
29 44
         arr.systemConfiguration.push(a.wxIncidentWithCmdb);//是否需要绑定资产
30 45
         arr.systemConfiguration.push(a.ifWorking);//是否开通上下班
31 46
         arr.systemConfiguration.push(a.integralMechanism);//积分机制
47
+        if(a.integralMechanism.valueconfig == 1){
48
+            if(Array.isArray(a.integralRole.valueconfig)){
49
+                var integralRole = a.myData.find(v => v.keyconfig == 'integralRole');
50
+                arr.systemConfiguration.push(Object.assign({}, integralRole, {valueconfig: a.integralRole.valueconfig.map(v => v.id).toString()}));//积分控制角色 
51
+            }else{
52
+                arr.systemConfiguration.push(a.integralRole);//积分控制角色
53
+            }
54
+        }else{
55
+            var integralRole = a.myData.find(v => v.keyconfig == 'integralRole');
56
+            arr.systemConfiguration.push(Object.assign({}, integralRole, {valueconfig: ''}));//积分控制角色 
57
+            a.integralRole.valueconfig = [];
58
+        }
32 59
         arr.systemConfiguration.push(a.ifRoom);//是否增加房间号选择
33 60
         arr.systemConfiguration.push(a.requesterLgoinType);//保修人登录方式
34 61
         arr.systemConfiguration.push(a.autoCloseIncidentHour);//自动关单小时
@@ -58,6 +85,9 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
58 85
                                   case "integralMechanism": //积分机制
59 86
                                     sessionStorage.setItem("integralMechanism", v.valueconfig);
60 87
                                     break;
88
+                                  case "integralRole": //积分控制角色
89
+                                    sessionStorage.setItem("integralRole", v.valueconfig);
90
+                                    break;
61 91
                                 }
62 92
                             });
63 93
                             o.swal({
@@ -78,8 +108,13 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
78 108
                 })
79 109
             }
80 110
         })
81
-    }, a.ldloading = {}, a.refreshData = function (t, n) {
82
-        a.ldloading[t.replace("-", "_")] = !0, angular.isUndefined(n) && (n = f), a.myData = [], g.fetchDataList("systemConfiguration", n).then(function (n) {
111
+    };
112
+    a.ldloading = {};
113
+    a.refreshData = function (t, n) {
114
+        a.ldloading[t.replace("-", "_")] = !0;
115
+        angular.isUndefined(n) && (n = f);
116
+        a.myData = [];
117
+        g.fetchDataList("systemConfiguration", n).then(function (n) {
83 118
             if (n.status == 200) {
84 119
                 var e = c.stripRestangular(n);
85 120
                 a.myData = e.list, a.ldloading[t.replace("-", "_")] = !1
@@ -88,6 +123,8 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
88 123
                 a.cacheConfig = [];//缓存配置
89 124
                 a.linkConfig = [];//链接配置
90 125
                 a.repairMain = {};//报修主体
126
+
127
+                a.integralRole = {valueconfig:[]};
91 128
                 console.log(a.myData,77777)
92 129
                 angular.forEach(a.myData, function (v, i) {
93 130
                     if (v.keyconfig == 'pwd' || v.keyconfig == 'conversationSeconds' || v.keyconfig == 'formUri' || v.keyconfig == 'localhost' || v.keyconfig == 'verificationPath' || v.keyconfig == 'docpath') {
@@ -120,6 +157,11 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
120 157
                     if (v.keyconfig == 'integralMechanism') {
121 158
                         a.integralMechanism = v;//积分机制
122 159
                     }
160
+                    if (v.keyconfig == 'integralRole') {
161
+                        // a.integralRole = v;//积分控制角色
162
+                        console.log(v);
163
+                        a.getRoleList(v);
164
+                    }
123 165
                     if (v.keyconfig == 'ifRoom') {
124 166
                         a.ifRoom = v;//是否增加房间号选择
125 167
                     }
@@ -137,5 +179,6 @@ app.controller("sysconfigCtrl", ["$rootScope", "$scope", "$state", "$timeout", "
137 179
         }, function () {
138 180
             a.ldloading[t.replace("-", "_")] = !1
139 181
         })
140
-    }, a.refreshData("expand-right", f)
182
+    };
183
+    a.refreshData("expand-right", f);
141 184
 }]);

+ 24 - 1
assets/views/system/sysconfig.html

@@ -171,7 +171,7 @@
171 171
             <div class="panel panel-white">
172 172
                 <div class="panel-hd">其他配置</div>
173 173
             </div>
174
-            <div class="panel-bd">
174
+            <div class="panel-bd" style="padding-bottom:100px;">
175 175
                 <div class="form-group col-sm-6">
176 176
                     <label class="col-sm-4 control-label">
177 177
                         自动关单时间:
@@ -261,6 +261,29 @@
261 261
                         </ul>
262 262
                     </div>
263 263
                 </div>
264
+                <div class="form-group col-sm-6">
265
+                    <label class="col-sm-4 control-label"></label>
266
+                    <div class="col-sm-8"></div>
267
+                </div>
268
+                <div class="form-group col-sm-6" ng-if="integralMechanism.valueconfig == 1">
269
+                    <label class="col-sm-4 control-label">
270
+                        积分控制角色:
271
+                    </label>
272
+                    <div class="col-sm-8">
273
+                        <ui-select ng-model="integralRole.valueconfig" theme="bootstrap" multiple>
274
+                            <ui-select-match placeholder="请选择">
275
+                                {{$item.role}}
276
+                            </ui-select-match>
277
+                            <ui-select-choices repeat="item in roleList">
278
+                                <div ng-bind-html="item.role | highlight: $select.search"></div>
279
+                            </ui-select-choices>
280
+                        </ui-select>
281
+                    </div>
282
+                </div>
283
+                <div class="form-group col-sm-6">
284
+                    <label class="col-sm-4 control-label"></label>
285
+                    <div class="col-sm-8"></div>
286
+                </div>
264 287
             </div>
265 288
             <!-- 保存 -->
266 289
             <div class="form-group margin-bottom-0">