|
@@ -54,23 +54,25 @@
|
|
|
|
|
|
}]);
|
|
}]);
|
|
app.controller('carAddCtrl', ["$scope", "$state", "carService", "msg", function ($scope, $state, carService, msg) {
|
|
app.controller('carAddCtrl', ["$scope", "$state", "carService", "msg", function ($scope, $state, carService, msg) {
|
|
- $scope.vm = { type: 1 };
|
|
|
|
- $scope.vm.begin_addressPick = {
|
|
|
|
|
|
+ $scope.$on('$ionicView.beforeEnter', function (viewResult) {
|
|
|
|
+ $scope.vm = { type: 1 };
|
|
|
|
+ $scope.vm.begin_addressPick = {
|
|
|
|
|
|
- }
|
|
|
|
- $scope.vm.end_addressPick = {
|
|
|
|
|
|
+ }
|
|
|
|
+ $scope.vm.end_addressPick = {
|
|
|
|
|
|
- }
|
|
|
|
- $scope.vm.midway_addressPick = {
|
|
|
|
|
|
+ }
|
|
|
|
+ $scope.vm.midway_addressPick = {
|
|
|
|
|
|
- }
|
|
|
|
- $scope.truckOpt = [];
|
|
|
|
- carService.listTrucks().then(function (result) {
|
|
|
|
- angular.forEach(result.data.data, function (item) {
|
|
|
|
- $scope.truckOpt.push({ id: item.id, name: item.name })
|
|
|
|
|
|
+ }
|
|
|
|
+ $scope.truckOpt = [];
|
|
|
|
+ carService.listTrucks().then(function (result) {
|
|
|
|
+ angular.forEach(result.data.data, function (item) {
|
|
|
|
+ $scope.truckOpt.push({ id: item.id, name: item.name })
|
|
|
|
+ });
|
|
|
|
+ }, function (erro) {
|
|
|
|
+ msg.error(erro.data.message);
|
|
});
|
|
});
|
|
- }, function (erro) {
|
|
|
|
- msg.error(erro.data.message);
|
|
|
|
});
|
|
});
|
|
$scope.save = function () {
|
|
$scope.save = function () {
|
|
$scope.vm.type = 2;
|
|
$scope.vm.type = 2;
|