seimin пре 2 година
родитељ
комит
6144b043cf

+ 53 - 1
assets/js/controllers/customform/customformCtrl.js

@@ -13750,6 +13750,7 @@ appFormly.config(function config(formlyConfigProvider) {
13750
                 $scope.title = "新增报修人";
13750
                 $scope.title = "新增报修人";
13751
                 $scope.requester = {};
13751
                 $scope.requester = {};
13752
                 $scope.searchData = {};
13752
                 $scope.searchData = {};
13753
+                $scope.isRoom = sessionStorage.getItem('ifRoom') == 1;
13753
                 if (angular.isDefined($stateParams.model) && $stateParams.model != "") {
13754
                 if (angular.isDefined($stateParams.model) && $stateParams.model != "") {
13754
                   var paramsModel = JSON.parse($stateParams.model)
13755
                   var paramsModel = JSON.parse($stateParams.model)
13755
                   //来电-添加报修人-回显电话
13756
                   //来电-添加报修人-回显电话
@@ -13862,6 +13863,26 @@ appFormly.config(function config(formlyConfigProvider) {
13862
                       }
13863
                       }
13863
                     });
13864
                     });
13864
                 };
13865
                 };
13866
+                // 修改地点
13867
+                $scope.requesterPlaceid = "";
13868
+                $scope.onChangePlace = function (item) {
13869
+                  $scope.requesterPlaceid = item.id;
13870
+                  api_user_data
13871
+                    .fetchDataList("room", {
13872
+                      room: {
13873
+                        place: {
13874
+                          id: item.id,
13875
+                        },
13876
+                      },
13877
+                      idx: 0,
13878
+                      sum: 1000,
13879
+                    })
13880
+                    .then(function (response) {
13881
+                      if (response.status == 200) {
13882
+                        $scope.rooms = response.list;
13883
+                      }
13884
+                    });
13885
+                };
13865
                 $scope.refresh = function (searchVal) {
13886
                 $scope.refresh = function (searchVal) {
13866
                   var faildata = {};
13887
                   var faildata = {};
13867
                   if ($scope.requesterAreaid) {
13888
                   if ($scope.requesterAreaid) {
@@ -13891,6 +13912,32 @@ appFormly.config(function config(formlyConfigProvider) {
13891
                       delete $scope.requester.placeDTO;
13912
                       delete $scope.requester.placeDTO;
13892
                     });
13913
                     });
13893
                 };
13914
                 };
13915
+                // 初始化房间号
13916
+                $scope.refreshPlace = function () {
13917
+                  var faildata = {};
13918
+                  if ($scope.requesterPlaceid) {
13919
+                    faildata = {
13920
+                      idx: 0,
13921
+                      sum: 1000,
13922
+                      room: {
13923
+                        place: {id:$scope.requesterPlaceid},
13924
+                      },
13925
+                    };
13926
+                  } else {
13927
+                    faildata = {
13928
+                      idx: 0,
13929
+                      sum: 1000,
13930
+                      room: {
13931
+                        place: {id:$scope.requesterPlaceid},
13932
+                      },
13933
+                    };
13934
+                  }
13935
+                  api_user_data
13936
+                    .fetchDataList("room", faildata)
13937
+                    .then(function (response) {
13938
+                      $scope.rooms = response.list;
13939
+                    });
13940
+                };
13894
                 $scope.refreshDepts = function (key) {
13941
                 $scope.refreshDepts = function (key) {
13895
                   var filterData = {
13942
                   var filterData = {
13896
                     idx: 0,
13943
                     idx: 0,
@@ -13970,7 +14017,7 @@ appFormly.config(function config(formlyConfigProvider) {
13970
                             newObj;
14017
                             newObj;
13971
                         }
14018
                         }
13972
                       }
14019
                       }
13973
-                    ); //lmm
14020
+                    );
13974
                     console.log($scope.requester);
14021
                     console.log($scope.requester);
13975
                     $modalInstance.close($scope.requester);
14022
                     $modalInstance.close($scope.requester);
13976
                   }
14023
                   }
@@ -14097,6 +14144,9 @@ appFormly.config(function config(formlyConfigProvider) {
14097
                       if (selectedItem.houseNumber) {
14144
                       if (selectedItem.houseNumber) {
14098
                         options.model.houseNumber = selectedItem.houseNumber;
14145
                         options.model.houseNumber = selectedItem.houseNumber;
14099
                       }
14146
                       }
14147
+                      if (selectedItem.room) {
14148
+                        options.model.room.id = selectedItem.room.id;
14149
+                      }
14100
                       // if (selectedItem.id) {
14150
                       // if (selectedItem.id) {
14101
                       options.model.account = selectedItem.account;
14151
                       options.model.account = selectedItem.account;
14102
                       // 找到表单报修人组件,并使用组件内部方法重新获取增加报修人后的报修人下拉选项
14152
                       // 找到表单报修人组件,并使用组件内部方法重新获取增加报修人后的报修人下拉选项
@@ -20742,6 +20792,8 @@ appFormly.controller("CustomformCtrl", [
20742
     var formKey = "";
20792
     var formKey = "";
20743
     var pdKey = "";
20793
     var pdKey = "";
20744
     var modelWatch = "";
20794
     var modelWatch = "";
20795
+    // 房间号是否显示
20796
+    vm.model.isRoom = sessionStorage.getItem('ifRoom') == 1;
20745
     if (angular.isDefined($stateParams.model) && $stateParams.model != "") {
20797
     if (angular.isDefined($stateParams.model) && $stateParams.model != "") {
20746
       modelWatch = JSON.parse($stateParams.model);
20798
       modelWatch = JSON.parse($stateParams.model);
20747
       // console.log("modelWatch:"+ JSON.stringify(modelWatch));
20799
       // console.log("modelWatch:"+ JSON.stringify(modelWatch));

+ 16 - 19
assets/js/controllers/loginCtrl.js

@@ -24,25 +24,22 @@ app.controller('LoginCtrl', ['$rootScope', '$scope', '$state', '$translate', '$l
24
                     if (res.status == 200) {
24
                     if (res.status == 200) {
25
                         //存储报修主体到缓存
25
                         //存储报修主体到缓存
26
                         var list = res.list;
26
                         var list = res.list;
27
-                        var repairMain = list.find((v) => v.keyconfig == "repairMain"); //报修主体
28
-                        var incidentWithConsumable = list.find(
29
-                        (v) => v.keyconfig == "incidentWithConsumable"
30
-                        ); //是否绑定耗材
31
-                        var wxIncidentWithCmdb = list.find(
32
-                        (v) => v.keyconfig == "wxIncidentWithCmdb"
33
-                        ); //是否绑定资产
34
-                        sessionStorage.setItem(
35
-                        "repair_main",
36
-                        JSON.stringify(repairMain)
37
-                        );
38
-                        sessionStorage.setItem(
39
-                        "incidentWithConsumable",
40
-                        incidentWithConsumable.valueconfig
41
-                        );
42
-                        sessionStorage.setItem(
43
-                        "wxIncidentWithCmdb",
44
-                        wxIncidentWithCmdb.valueconfig
45
-                        );
27
+                        list.forEach(v => {
28
+                            switch (v.keyconfig) {
29
+                              case "repairMain": //报修主体
30
+                                sessionStorage.setItem("repair_main", JSON.stringify(v));
31
+                                break;
32
+                              case "incidentWithConsumable": //是否绑定耗材
33
+                                sessionStorage.setItem("incidentWithConsumable", v.valueconfig);
34
+                                break;
35
+                              case "wxIncidentWithCmdb": //是否绑定资产
36
+                                sessionStorage.setItem("wxIncidentWithCmdb", v.valueconfig);
37
+                                break;
38
+                              case "ifRoom": //是否增加房间号选择
39
+                                sessionStorage.setItem("ifRoom", v.valueconfig);
40
+                                break;
41
+                            }
42
+                        });
46
                     }
43
                     }
47
                 })
44
                 })
48
                 .catch(function (err) {
45
                 .catch(function (err) {

+ 2 - 1
assets/js/controllers/system/systemFormCtrl.js

@@ -478,7 +478,8 @@ sysFormly.controller('SystemformCtrl', ['$rootScope', '$scope', '$parse', '$filt
478
                             id: data.incident.departmentDTO.id
478
                             id: data.incident.departmentDTO.id
479
                         },
479
                         },
480
                         'sourceType': data.incident.sourceType,
480
                         'sourceType': data.incident.sourceType,
481
-                        'fileUrl': data.incident.fileUrl
481
+                        'fileUrl': data.incident.fileUrl,
482
+                        room:data.incident.room
482
                     },
483
                     },
483
                     'requestershow': data.incident.requester,
484
                     'requestershow': data.incident.requester,
484
                     'flow': data.incident.id
485
                     'flow': data.incident.id

+ 15 - 1
assets/views/customform/tpl/modal-add-callrequester.html

@@ -79,7 +79,7 @@
79
             <div class="margin-bottom-15 anline">
79
             <div class="margin-bottom-15 anline">
80
                 <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">地点:</div>
80
                 <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">地点:</div>
81
                 <div class="pull-right openaddinput">
81
                 <div class="pull-right openaddinput">
82
-                    <ui-select ng-model="requester.place" theme="bootstrap">
82
+                    <ui-select ng-model="requester.place" theme="bootstrap" ng-change="onChangePlace(requester.place)">
83
                         <ui-select-match placeholder="地点">
83
                         <ui-select-match placeholder="地点">
84
                             {{$select.selected.place}}
84
                             {{$select.selected.place}}
85
                         </ui-select-match>
85
                         </ui-select-match>
@@ -90,6 +90,20 @@
90
 
90
 
91
                 </div>
91
                 </div>
92
             </div>
92
             </div>
93
+            <div class="margin-bottom-15 anline" ng-if="isRoom">
94
+                <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">房间号:</div>
95
+                <div class="pull-right openaddinput">
96
+                    <ui-select ng-model="requester.room" theme="bootstrap">
97
+                        <ui-select-match placeholder="房间号">
98
+                            {{$select.selected.room}}
99
+                        </ui-select-match>
100
+                        <ui-select-choices repeat="item in rooms" refresh="refreshPlace()">
101
+                            <div ng-bind-html="item.room | highlight: $select.search"></div>
102
+                        </ui-select-choices>
103
+                    </ui-select>
104
+
105
+                </div>
106
+            </div>
93
             <div class="margin-bottom-15 anline">
107
             <div class="margin-bottom-15 anline">
94
                 <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">详细地址:</div>
108
                 <div class="pull-left openaddlable control-label fontcolor-two fontsizes-14">详细地址:</div>
95
                 <div class="pull-right openaddinput">
109
                 <div class="pull-right openaddinput">