diff --git a/@salix/crud/src/client/addresses-data-create/index.html b/@salix/crud/src/client/addresses-data-create/index.html new file mode 100644 index 0000000000..4ec22b2ab4 --- /dev/null +++ b/@salix/crud/src/client/addresses-data-create/index.html @@ -0,0 +1,33 @@ +
+ + + + Consignatario + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/@salix/crud/src/client/addresses-data-create/index.js b/@salix/crud/src/client/addresses-data-create/index.js new file mode 100644 index 0000000000..8722ab58f2 --- /dev/null +++ b/@salix/crud/src/client/addresses-data-create/index.js @@ -0,0 +1,32 @@ +import template from './index.html'; +import {module} from '../../module'; + +export const NAME = 'vnClientAddressesDataCreate'; +export const COMPONENT = { + template: template, + controllerAs: 'addressData', + controller: function($http) + { + this.address = {}; + + $http.get('/client/api/Agencies').then( + json => this.agencies = json.data, + json => console.error(json.data.error.message) + ); + + $http.get('/client/api/Provinces').then( + json => this.provinces = json.data, + json => console.error(json.data.error.message) + ); + + this.submit = function(){ + $http.post('/client/api/Addresses', this.address).then( + json => console.log(json.statusText), + json => console.error(json.data.error.message) + ); + } + } +} + +COMPONENT.controller.$inject = ['$http']; +module.component(NAME, COMPONENT); diff --git a/@salix/crud/src/client/addresses-data/index.html b/@salix/crud/src/client/addresses-data-edit/index.html similarity index 100% rename from @salix/crud/src/client/addresses-data/index.html rename to @salix/crud/src/client/addresses-data-edit/index.html diff --git a/@salix/crud/src/client/addresses-data/index.js b/@salix/crud/src/client/addresses-data-edit/index.js similarity index 74% rename from @salix/crud/src/client/addresses-data/index.js rename to @salix/crud/src/client/addresses-data-edit/index.js index 1980a72ad2..7883fd0b04 100644 --- a/@salix/crud/src/client/addresses-data/index.js +++ b/@salix/crud/src/client/addresses-data-edit/index.js @@ -1,13 +1,13 @@ import template from './index.html'; import {module} from '../../module'; -export const NAME = 'vnClientAddressesData'; +export const NAME = 'vnClientAddressesDataEdit'; export const COMPONENT = { template: template, controllerAs: 'addressData', controller: function($http,$stateParams) { - this.address = {} + this.address = {}; $http.get(`/client/api/Addresses/${$stateParams.addressId}`).then( json => this.address = json.data, json => console.error(json.data.error.message) @@ -24,23 +24,13 @@ export const COMPONENT = { ); this.submit = function(){ - if($stateParams.addressId){ $http.put('/client/api/Addresses', this.address).then( json => console.log(json.statusText), json => console.error(json.data.error.message) ); } - else{ - $http.post('/client/api/Addresses', this.address).then( - json => console.log(json.statusText), - json => console.error(json.data.error.message) - ); - } - }; - } - -}; +} COMPONENT.controller.$inject = ['$http' , '$stateParams']; module.component(NAME, COMPONENT); diff --git a/@salix/crud/src/client/addresses/index.html b/@salix/crud/src/client/addresses/index.html index 6c172b366e..aa605c131c 100644 --- a/@salix/crud/src/client/addresses/index.html +++ b/@salix/crud/src/client/addresses/index.html @@ -3,7 +3,7 @@ Consignatario - + @@ -14,11 +14,10 @@
{{i.city}}, {{i.province}}
{{i.phone}}, {{i.mobile}}
- +
- diff --git a/@salix/crud/src/client/client.js b/@salix/crud/src/client/client.js index 366853b425..ff5b8c6715 100644 --- a/@salix/crud/src/client/client.js +++ b/@salix/crud/src/client/client.js @@ -20,5 +20,7 @@ export {NAME as CLIENT_ITEM, COMPONENT as CLIENT_ITEM_COMPONENT} from './index/item-client'; export {NAME as CLIENT_CREATE, COMPONENT as CLIENT_CREATE_COMPONENT} from './create/index'; -export {NAME as CLIENT_ADDRESSES_DATA_INDEX, - COMPONENT as CLIENT_ADDRESSES_DATA_INDEX_COMPONENT} from './addresses-data/index'; +export {NAME as CLIENT_ADDRESSES_DATA_CREATE_INDEX, + COMPONENT as CLIENT_ADDRESSES_DATA_CREATE_INDEX_COMPONENT} from './addresses-data-create/index'; +export {NAME as CLIENT_ADDRESSES_DATA_EDIT_INDEX, + COMPONENT as CLIENT_ADDRESSES_DATA_EDIT_INDEX_COMPONENT} from './addresses-data-edit/index'; diff --git a/@salix/crud/src/client/routes.js b/@salix/crud/src/client/routes.js index 293a493589..46781d34e9 100644 --- a/@salix/crud/src/client/routes.js +++ b/@salix/crud/src/client/routes.js @@ -62,13 +62,13 @@ }, { url: "/address/create", - state: "clientCard.addressCreate", - component: "vn-client-addresses-data" + state: "clientCard.addressDataCreate", + component: "vn-client-addresses-data-create" }, { url: "/address/:addressId", - state: "clientCard.addressEdit", - component: "vn-client-addresses-data" + state: "clientCard.addressDataEdit", + component: "vn-client-addresses-data-edit" }, ] diff --git a/services/nginx/logs/error.log b/services/nginx/logs/error.log index 05a8df933b..8d7b83b246 100644 --- a/services/nginx/logs/error.log +++ b/services/nginx/logs/error.log @@ -41,3 +41,5 @@ 2017/01/10 10:51:29 [notice] 7236#9764: signal process started 2017/01/10 10:54:19 [notice] 11368#8376: signal process started 2017/01/10 12:26:32 [notice] 6916#8152: signal process started +2017/01/11 14:07:56 [notice] 9308#5756: signal process started +2017/01/11 14:08:53 [notice] 8600#6600: signal process started