feat(worker_basic-data): add new fields
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-03-31 09:18:18 +02:00
parent bb267dad16
commit 443db55f58
6 changed files with 82 additions and 0 deletions

View File

@ -17,6 +17,9 @@
"Department": { "Department": {
"dataSource": "vn" "dataSource": "vn"
}, },
"EducationLevel": {
"dataSource": "vn"
},
"WorkCenter": { "WorkCenter": {
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -0,0 +1,18 @@
{
"name": "EducationLevel",
"base": "VnModel",
"options": {
"mysql": {
"table": "educationLevel"
}
},
"properties": {
"id": {
"id": true,
"type": "Number"
},
"name": {
"type": "String"
}
}
}

View File

@ -34,6 +34,18 @@
}, },
"bossFk": { "bossFk": {
"type" : "Number" "type" : "Number"
},
"maritalStatus": {
"type" : "String"
},
"originCountryFk": {
"type" : "Number"
},
"educationLevelFk": {
"type" : "Number"
},
"SSN": {
"type" : "String"
} }
}, },
"relations": { "relations": {

View File

@ -39,6 +39,42 @@
label="Boss"> label="Boss">
</vn-autocomplete> </vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal>
<vn-autocomplete
disabled="false"
label="Marital status"
data="$ctrl.maritalStatus"
show-field="name"
value-field="code"
ng-model="$ctrl.worker.maritalStatus">
</vn-autocomplete>
<vn-autocomplete
disabled="false"
ng-model="$ctrl.worker.originCountryFk"
url="Countries"
fields="['id', 'country', 'code']"
show-field="country"
value-field="id"
label="Origin country">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
disabled="false"
ng-model="$ctrl.worker.educationLevelFk"
url="EducationLevels"
fields="['id', 'name']"
show-field="name"
value-field="id"
label="Education level">
</vn-autocomplete>
<vn-textfield
vn-one
label="SSN"
ng-model="$ctrl.worker.SSN"
rule>
</vn-textfield>
</vn-horizontal>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-button-bar> <vn-button-bar>

View File

@ -2,6 +2,13 @@ import ngModule from '../module';
import Section from 'salix/components/section'; import Section from 'salix/components/section';
class Controller extends Section { class Controller extends Section {
constructor($element, $) {
super($element, $);
this.maritalStatus = [
{code: 'M', name: this.$t('Married')},
{code: 'S', name: this.$t('Single')}
];
}
onSubmit() { onSubmit() {
return this.$.watcher.submit() return this.$.watcher.submit()
.then(() => this.card.reload()); .then(() => this.card.reload());

View File

@ -0,0 +1,6 @@
Marital status: Estado civil
Origin country: País origen
Education level: Nivel educación
SSN: NSS
Married: Casado
Single: Soltero