diff --git a/@salix/core/src/left-menu/actions.html b/@salix/core/src/left-menu/actions.html index de19f738e4..3daf705512 100644 --- a/@salix/core/src/left-menu/actions.html +++ b/@salix/core/src/left-menu/actions.html @@ -1,5 +1,5 @@ - + diff --git a/@salix/crud/src/client/addresses/index.html b/@salix/crud/src/client/addresses/index.html new file mode 100644 index 0000000000..9a2d9cd507 --- /dev/null +++ b/@salix/crud/src/client/addresses/index.html @@ -0,0 +1,27 @@ + + + Addresses + + + Default + Consignee + Enabled + + + + + + + + Edit + + {{i.consignee}} + {{i.street}} + {{i.city}}, {{i.province}} + {{i.phone}}, {{i.mobile}} + + + + + + \ No newline at end of file diff --git a/@salix/crud/src/client/addresses/index.js b/@salix/crud/src/client/addresses/index.js new file mode 100644 index 0000000000..1745ca5f52 --- /dev/null +++ b/@salix/crud/src/client/addresses/index.js @@ -0,0 +1,32 @@ +import template from './index.html'; +import {module} from '../../module'; + +export const NAME = 'vnClientAddresses'; +export const COMPONENT = { + template: template, + controller: function ($http) + { + this.addresses = [{ + consignee: 'Consignee 1', + street: 'Street', + city: 'City', + postcode: '46600', + province: 'Province', + country: 'Country', + phone: 'XX-XXX-XX-XX', + mobile: 'XX-6XX-XX-XX', + enabled: true + },{ + consignee: 'Consignee 2', + street: 'Street', + city: 'City', + postcode: '46600', + province: 'Province', + country: 'Country', + phone: 'XX-XXX-XX-XX', + mobile: 'XX-6XX-XX-XX', + enabled: true + }]; + }, +}; +module.component(NAME, COMPONENT); diff --git a/@salix/crud/src/client/basic-data/index.js b/@salix/crud/src/client/basic-data/index.js index 980684df4f..75d59cc17d 100644 --- a/@salix/crud/src/client/basic-data/index.js +++ b/@salix/crud/src/client/basic-data/index.js @@ -1,19 +1,14 @@ import template from './index.html'; import {module} from '../../module'; -export const _NAME = 'customerBasicData'; -//export const NAME = module.getName(_NAME); -export const NAME = 'vnCustomerBasicData'; - +export const NAME = 'vnClientBasicData'; export const COMPONENT = { template: template, - controller: function ($http) - { - this.submit = function () - { + controller: function ($http) { + this.submit = function () { $http.post('/client/api/Clients', this.model).then ( - () => console.log ('OK'), - () => console.log ('ER') + (json) => console.log (json.statusText), + (json) => console.error (json.data.error.message) ); }; }, diff --git a/@salix/crud/src/client/client.js b/@salix/crud/src/client/client.js index 3e0e7aa311..b4e35cc0e8 100644 --- a/@salix/crud/src/client/client.js +++ b/@salix/crud/src/client/client.js @@ -1,4 +1,6 @@ -export {NAME as CLIENT_BASIC_DATA_INDEX, - COMPONENT as CLIENT_BASIC_DATA_INDEX_COMPONENT} from './basic-data/index'; export {NAME as CLIENT_INDEX, COMPONENT as CLIENT_INDEX_COMPONENT} from './index/index'; +export {NAME as CLIENT_BASIC_DATA_INDEX, + COMPONENT as CLIENT_BASIC_DATA_INDEX_COMPONENT} from './basic-data/index'; +export {NAME as CLIENT_ADDRESSES, + COMPONENT as CLIENT_ADDRESSES_COMPONENT} from './addresses/index'; diff --git a/@salix/crud/src/client/databasic/databasic.html b/@salix/crud/src/client/databasic/databasic.html deleted file mode 100644 index bf453058b8..0000000000 --- a/@salix/crud/src/client/databasic/databasic.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - Datos básicos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/@salix/crud/src/client/databasic/databasic.js b/@salix/crud/src/client/databasic/databasic.js deleted file mode 100644 index a83180364c..0000000000 --- a/@salix/crud/src/client/databasic/databasic.js +++ /dev/null @@ -1,11 +0,0 @@ -import template from './databasic.html'; -import {module} from '../../module'; - -export const _NAME = 'clientDataBasic'; -//export const NAME = module.getName(_NAME); -export const NAME = "vnClientDataBasic"; - -export const COMPONENT = { - template: template -}; -module.component(NAME, COMPONENT); diff --git a/@salix/crud/src/client/routes.js b/@salix/crud/src/client/routes.js index 1d630f3375..c339a9d607 100644 --- a/@salix/crud/src/client/routes.js +++ b/@salix/crud/src/client/routes.js @@ -1,20 +1,20 @@ -[ - { - url: '/client', - state: 'client', - template: '', - module: 'crud', - description: '', - image: '', - }, - { - url: '/basic-data', - state: 'client.basicdata', - template: '', - module: 'crud', - description: '', - image: '', - } -] +[{ + url: '/client', + state: 'client', + template: '', + module: 'crud', + description: '', + image: '', +},{ + url: '/basic-data', + state: 'client.basicdata', + template: '', + module: 'crud' +},{ + url: '/addresses', + state: 'client.addresses', + template: '', + module: 'crud' +}] diff --git a/services/client/common/models/Address.json b/services/client/common/models/Address.json index a819747b50..01c060a4ba 100644 --- a/services/client/common/models/Address.json +++ b/services/client/common/models/Address.json @@ -11,6 +11,10 @@ "type": "string", "required": "true" }, + "consignee": { + "type": "string", + "required": "true" + }, "city": { "type": "string", "required": "true" @@ -25,8 +29,14 @@ "type": "string", "required": "true" }, + "enabled": { + "type": "boolean" + }, "phone": { "type": "string" + }, + "mobile": { + "type": "string" } } }