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