Quellcode durchsuchen

快速建单报修人和报修科室联动

seimin vor 11 Monaten
Ursprung
Commit
2483f4f757
2 geänderte Dateien mit 22 neuen und 7 gelöschten Zeilen
  1. 17 2
      assets/js/controllers/mainCtrl.js
  2. 5 5
      assets/views/newOrderSeimin.html

+ 17 - 2
assets/js/controllers/mainCtrl.js

@@ -4941,26 +4941,36 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
4941
           };
4941
           };
4942
           // $scope.jry_deptSearch();
4942
           // $scope.jry_deptSearch();
4943
           // 报修人模糊搜索
4943
           // 报修人模糊搜索
4944
-          $scope.jry_requesterSearch = function (key = "") {
4944
+          $scope.jry_requesterSearch = function (key = "",branchId) {
4945
+            console.log(branchId)
4946
+            if(!branchId){
4947
+              $scope.jry_requesterData = [];
4948
+              return;
4949
+            }
4945
             var postData = {
4950
             var postData = {
4946
               idx: 0,
4951
               idx: 0,
4947
               sum: 10,
4952
               sum: 10,
4948
               user: {
4953
               user: {
4954
+                branch: { id: branchId },
4949
                 name: key,
4955
                 name: key,
4950
                 selectType: "pinyin_all",
4956
                 selectType: "pinyin_all",
4951
                 engineer: undefined,
4957
                 engineer: undefined,
4958
+                dept: $scope.incidentModel ? ($scope.incidentModel.department || undefined) : undefined,
4952
               },
4959
               },
4953
             };
4960
             };
4954
             api_user_data.fetchDataList("user", postData).then(function (data) {
4961
             api_user_data.fetchDataList("user", postData).then(function (data) {
4955
               $scope.jry_requesterData = data.list;
4962
               $scope.jry_requesterData = data.list;
4956
             });
4963
             });
4957
           };
4964
           };
4958
-          $scope.jry_requesterSearch();
4965
+          // $scope.jry_requesterSearch();
4959
           $scope.$watch("incidentModel.requester", function (newVal,oldVal) {
4966
           $scope.$watch("incidentModel.requester", function (newVal,oldVal) {
4960
             if(newVal){
4967
             if(newVal){
4961
               if($scope.modelData && newVal == oldVal){
4968
               if($scope.modelData && newVal == oldVal){
4962
               }else{
4969
               }else{
4963
                 $scope.incidentModel.contacts = newVal.name;
4970
                 $scope.incidentModel.contacts = newVal.name;
4971
+                if(!oldVal){
4972
+                  $scope.incidentModel.department = newVal.dept;
4973
+                }
4964
                 SweetAlert.swal({
4974
                 SweetAlert.swal({
4965
                   title: "提示",
4975
                   title: "提示",
4966
                   text: "是否覆盖联系电话?",
4976
                   text: "是否覆盖联系电话?",
@@ -5089,6 +5099,7 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
5089
             $scope.showUserOrGroup();
5099
             $scope.showUserOrGroup();
5090
             newVal && $scope.jry_areaSearch('',newVal.id);
5100
             newVal && $scope.jry_areaSearch('',newVal.id);
5091
             newVal && $scope.jry_deptSearch('',newVal.id);
5101
             newVal && $scope.jry_deptSearch('',newVal.id);
5102
+            newVal && $scope.jry_requesterSearch('',newVal.id);
5092
           });
5103
           });
5093
           $scope.$watch("incidentModel.area", function (newVal,oldVal) {
5104
           $scope.$watch("incidentModel.area", function (newVal,oldVal) {
5094
             newVal && $scope.jry_placeSearch('',newVal.id);
5105
             newVal && $scope.jry_placeSearch('',newVal.id);
@@ -5298,6 +5309,10 @@ function ($rootScope, $scope, $state, $translate, $localStorage, $cookieStore, $
5298
             if($scope.modelData && newVal == oldVal){
5309
             if($scope.modelData && newVal == oldVal){
5299
 
5310
 
5300
             }else{
5311
             }else{
5312
+              if(newVal && oldVal && newVal.id != oldVal.id){
5313
+                $scope.incidentModel.requester = '';
5314
+              }
5315
+              $scope.jry_requesterSearch('', $scope.incidentModel.branch.id)
5301
               if(newVal){
5316
               if(newVal){
5302
                 if($scope.incidentModel.department){
5317
                 if($scope.incidentModel.department){
5303
                   if($scope.incidentModel.department.place){
5318
                   if($scope.incidentModel.department.place){

+ 5 - 5
assets/views/newOrderSeimin.html

@@ -91,22 +91,22 @@
91
           >
91
           >
92
           <ui-select
92
           <ui-select
93
             class="c_item_value"
93
             class="c_item_value"
94
-            style="min-width: 190px"
94
+            style="min-width: 616px"
95
             ng-model="incidentModel.requester"
95
             ng-model="incidentModel.requester"
96
             theme="bootstrap"
96
             theme="bootstrap"
97
             reset-search-input="false"
97
             reset-search-input="false"
98
           >
98
           >
99
             <ui-select-match allow-clear placeholder="请选择报修人">
99
             <ui-select-match allow-clear placeholder="请选择报修人">
100
               <span
100
               <span
101
-                ng-bind="$select.selected.name + '('+$select.selected.account+')'"
101
+                ng-bind="$select.selected.name + '('+$select.selected.account+')' + '('+($select.selected.dept ? $select.selected.dept.dept : '')+')'"
102
               ></span>
102
               ></span>
103
             </ui-select-match>
103
             </ui-select-match>
104
             <ui-select-choices
104
             <ui-select-choices
105
               repeat="item in jry_requesterData"
105
               repeat="item in jry_requesterData"
106
-              refresh="jry_requesterSearch($select.search)"
106
+              refresh="jry_requesterSearch($select.search,incidentModel.branch.id)"
107
             >
107
             >
108
               <div
108
               <div
109
-                ng-bind-html="(item.name + '('+item.account+')') | highlight: $select.search"
109
+                ng-bind-html="(item.name + '('+item.account+')' + '('+(item.dept ? item.dept.dept : '')+')') | highlight: $select.search"
110
               ></div>
110
               ></div>
111
             </ui-select-choices>
111
             </ui-select-choices>
112
           </ui-select>
112
           </ui-select>
@@ -936,7 +936,7 @@
936
     float: left;
936
     float: left;
937
   }
937
   }
938
   .centerList .c_item.bxr .ui-select-allow-clear {
938
   .centerList .c_item.bxr .ui-select-allow-clear {
939
-    width: 140px;
939
+    min-width: 140px;
940
     overflow: hidden;
940
     overflow: hidden;
941
     text-overflow: ellipsis;
941
     text-overflow: ellipsis;
942
     white-space: nowrap;
942
     white-space: nowrap;