|
@@ -13846,6 +13846,8 @@ appFormly.config(function config(formlyConfigProvider) {
|
13846
|
13846
|
$scope.searchField = JSON.parse(x[0]).account;
|
13847
|
13847
|
$scope.requester = JSON.parse(x[0]);
|
13848
|
13848
|
console.log($scope.requester);
|
|
13849
|
+ $scope.refreshArea('');
|
|
13850
|
+ $scope.refresh('');
|
13849
|
13851
|
};
|
13850
|
13852
|
$scope.getMydataone = function (x) {
|
13851
|
13853
|
$scope.searchField = x;
|
|
@@ -13886,15 +13888,25 @@ appFormly.config(function config(formlyConfigProvider) {
|
13886
|
13888
|
});
|
13887
|
13889
|
}
|
13888
|
13890
|
api_user_data
|
13889
|
|
- .fetchDataList("area", {
|
|
13891
|
+ .fetchDataList("branch", {
|
13890
|
13892
|
idx: 0,
|
13891
|
13893
|
sum: 1000,
|
13892
|
13894
|
})
|
13893
|
13895
|
.then(function (response) {
|
13894
|
13896
|
if (response.status == 200) {
|
13895
|
|
- $scope.areas = response.list;
|
|
13897
|
+ $scope.branchs = response.list;
|
13896
|
13898
|
}
|
13897
|
13899
|
});
|
|
13900
|
+ // api_user_data
|
|
13901
|
+ // .fetchDataList("area", {
|
|
13902
|
+ // idx: 0,
|
|
13903
|
+ // sum: 1000,
|
|
13904
|
+ // })
|
|
13905
|
+ // .then(function (response) {
|
|
13906
|
+ // if (response.status == 200) {
|
|
13907
|
+ // $scope.areas = response.list;
|
|
13908
|
+ // }
|
|
13909
|
+ // });
|
13898
|
13910
|
api_wechatfile
|
13899
|
13911
|
.getDictionary(
|
13900
|
13912
|
{
|
|
@@ -13911,9 +13923,26 @@ appFormly.config(function config(formlyConfigProvider) {
|
13911
|
13923
|
$scope.networktypes = response;
|
13912
|
13924
|
}
|
13913
|
13925
|
});
|
13914
|
|
- $scope.requesterAreaid = "";
|
|
13926
|
+ $scope.onChangeBranch = function (item) {
|
|
13927
|
+ delete $scope.requester.place;
|
|
13928
|
+ console.log($scope.requester, 'changeArea');
|
|
13929
|
+ api_user_data
|
|
13930
|
+ .fetchDataList("area", {
|
|
13931
|
+ area: {
|
|
13932
|
+ branch: item.id,
|
|
13933
|
+ },
|
|
13934
|
+ idx: 0,
|
|
13935
|
+ sum: 1000,
|
|
13936
|
+ })
|
|
13937
|
+ .then(function (response) {
|
|
13938
|
+ if (response.status == 200) {
|
|
13939
|
+ $scope.areas = response.list;
|
|
13940
|
+ }
|
|
13941
|
+ });
|
|
13942
|
+ };
|
13915
|
13943
|
$scope.onChange = function (item) {
|
13916
|
|
- $scope.requesterAreaid = item.id;
|
|
13944
|
+ $scope.requester.place = {area: $scope.requester.place.area};
|
|
13945
|
+ console.log($scope.requester, 'changeArea');
|
13917
|
13946
|
api_user_data
|
13918
|
13947
|
.fetchDataList("place", {
|
13919
|
13948
|
place: {
|
|
@@ -13935,6 +13964,7 @@ appFormly.config(function config(formlyConfigProvider) {
|
13935
|
13964
|
$scope.requesterPlaceid = "";
|
13936
|
13965
|
$scope.onChangePlace = function (item) {
|
13937
|
13966
|
$scope.requesterPlaceid = item.id;
|
|
13967
|
+ console.log($scope.requester, 'changePlace');
|
13938
|
13968
|
api_user_data
|
13939
|
13969
|
.fetchDataList("room", {
|
13940
|
13970
|
room: {
|
|
@@ -13951,27 +13981,44 @@ appFormly.config(function config(formlyConfigProvider) {
|
13951
|
13981
|
}
|
13952
|
13982
|
});
|
13953
|
13983
|
};
|
13954
|
|
- $scope.refresh = function (searchVal) {
|
|
13984
|
+ $scope.refreshArea = function (searchVal) {
|
|
13985
|
+ console.log($scope.requester, 'area');
|
13955
|
13986
|
var faildata = {};
|
13956
|
|
- if ($scope.requesterAreaid) {
|
|
13987
|
+ if ($scope.requester.branch) {
|
13957
|
13988
|
faildata = {
|
13958
|
13989
|
idx: 0,
|
13959
|
13990
|
sum: 1000,
|
13960
|
|
- place: {
|
13961
|
|
- areaId: $scope.requesterAreaid,
|
13962
|
|
- place: searchVal,
|
|
13991
|
+ area: {
|
|
13992
|
+ branch: $scope.requester.branch.id,
|
|
13993
|
+ area: searchVal,
|
13963
|
13994
|
selectType: "pinyin_qs",
|
13964
|
13995
|
},
|
13965
|
13996
|
};
|
13966
|
13997
|
} else {
|
|
13998
|
+ return;
|
|
13999
|
+ }
|
|
14000
|
+ api_user_data
|
|
14001
|
+ .fetchDataList("area", faildata)
|
|
14002
|
+ .then(function (response) {
|
|
14003
|
+ $scope.areas = response.list;
|
|
14004
|
+ delete $scope.requester.areaDTO;
|
|
14005
|
+ });
|
|
14006
|
+ };
|
|
14007
|
+ $scope.refresh = function (searchVal) {
|
|
14008
|
+ console.log($scope.requester, 'place');
|
|
14009
|
+ var faildata = {};
|
|
14010
|
+ if ($scope.requester.place && $scope.requester.place.area) {
|
13967
|
14011
|
faildata = {
|
13968
|
14012
|
idx: 0,
|
13969
|
14013
|
sum: 1000,
|
13970
|
14014
|
place: {
|
|
14015
|
+ areaId: $scope.requester.place.area.id,
|
13971
|
14016
|
place: searchVal,
|
13972
|
14017
|
selectType: "pinyin_qs",
|
13973
|
14018
|
},
|
13974
|
14019
|
};
|
|
14020
|
+ } else {
|
|
14021
|
+ return;
|
13975
|
14022
|
}
|
13976
|
14023
|
api_user_data
|
13977
|
14024
|
.fetchDataList("place", faildata)
|
|
@@ -13981,7 +14028,7 @@ appFormly.config(function config(formlyConfigProvider) {
|
13981
|
14028
|
});
|
13982
|
14029
|
};
|
13983
|
14030
|
// 初始化房间号
|
13984
|
|
- $scope.refreshPlace = function () {
|
|
14031
|
+ $scope.refreshRoom = function () {
|
13985
|
14032
|
var faildata = {};
|
13986
|
14033
|
if ($scope.requesterPlaceid) {
|
13987
|
14034
|
faildata = {
|
|
@@ -14197,13 +14244,56 @@ appFormly.config(function config(formlyConfigProvider) {
|
14197
|
14244
|
if ($scope.$parent.$parent.$parent.model.saveAgain) {
|
14198
|
14245
|
if (selectedItem.place && selectedItem.place.id) {
|
14199
|
14246
|
options.model.place.id = selectedItem.place.id;
|
14200
|
|
- options.model.place.area.id =
|
14201
|
|
- selectedItem.place.area.id;
|
|
14247
|
+ options.model.place.area.id = selectedItem.place.area.id;
|
|
14248
|
+ if(selectedItem.branch && selectedItem.branch.id){
|
|
14249
|
+ options.model.branch.id = selectedItem.branch.id;
|
|
14250
|
+ console.log($scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields);
|
|
14251
|
+ let fields = $scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields;
|
|
14252
|
+ for (let i = 0; i < fields.length; i++) {
|
|
14253
|
+ if(fields[i].templateOptions.onlyKey == 'area_start'){
|
|
14254
|
+ // 如果是区域
|
|
14255
|
+ options.templateOptions.UserService.fetchDataList('area', { idx: 0, sum: 1000, area:{branch:options.model.branch.id} }).then(function(response) {
|
|
14256
|
+ if (response.status == 200) {
|
|
14257
|
+ fields[i].templateOptions.options = response.list;
|
|
14258
|
+ }
|
|
14259
|
+ })
|
|
14260
|
+ }else if(fields[i].templateOptions.onlyKey == 'place_start'){
|
|
14261
|
+ // 如果是地点
|
|
14262
|
+ options.templateOptions.UserService.fetchDataList('place', { idx: 0, sum: 1000, place:{area:{id:options.model.area.id}} }).then(function(response) {
|
|
14263
|
+ if (response.status == 200) {
|
|
14264
|
+ fields[i].templateOptions.options = response.list;
|
|
14265
|
+ }
|
|
14266
|
+ })
|
|
14267
|
+ }
|
|
14268
|
+ }
|
|
14269
|
+ }
|
14202
|
14270
|
}
|
14203
|
14271
|
} else {
|
14204
|
14272
|
if (selectedItem.place && selectedItem.place.id) {
|
14205
|
14273
|
options.model.place.id = selectedItem.place.id;
|
14206
|
14274
|
options.model.area.id = selectedItem.place.area.id;
|
|
14275
|
+ if(selectedItem.branch && selectedItem.branch.id){
|
|
14276
|
+ options.model.branch.id = selectedItem.branch.id;
|
|
14277
|
+ console.log($scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields);
|
|
14278
|
+ let fields = $scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields;
|
|
14279
|
+ for (let i = 0; i < fields.length; i++) {
|
|
14280
|
+ if(fields[i].templateOptions.onlyKey == 'area_start'){
|
|
14281
|
+ // 如果是区域
|
|
14282
|
+ options.templateOptions.UserService.fetchDataList('area', { idx: 0, sum: 1000, area:{branch:options.model.branch.id} }).then(function(response) {
|
|
14283
|
+ if (response.status == 200) {
|
|
14284
|
+ fields[i].templateOptions.options = response.list;
|
|
14285
|
+ }
|
|
14286
|
+ })
|
|
14287
|
+ }else if(fields[i].templateOptions.onlyKey == 'place_start'){
|
|
14288
|
+ // 如果是地点
|
|
14289
|
+ options.templateOptions.UserService.fetchDataList('place', { idx: 0, sum: 1000, place:{area:{id:options.model.area.id}} }).then(function(response) {
|
|
14290
|
+ if (response.status == 200) {
|
|
14291
|
+ fields[i].templateOptions.options = response.list;
|
|
14292
|
+ }
|
|
14293
|
+ })
|
|
14294
|
+ }
|
|
14295
|
+ }
|
|
14296
|
+ }
|
14207
|
14297
|
}
|
14208
|
14298
|
}
|
14209
|
14299
|
// if (selectedItem.areaDTO && selectedItem.place.area.id) {
|