7489-testToMaster #2515

Merged
alexm merged 329 commits from 7489-testToMaster into master 2024-05-28 05:30:19 +00:00
6 changed files with 5 additions and 135 deletions
Showing only changes of commit 50ea41f99a - Show all commits

View File

@ -81,15 +81,9 @@
ng-model="$ctrl.worker.SSN" ng-model="$ctrl.worker.SSN"
rule> rule>
</vn-textfield> </vn-textfield>
<!-- <vn-autocomplete <vn-input-number
ng-if="$ctrl.$.locker" min="0"
label="Locker" ng-model="$ctrl.$.locker"
data="$ctrl.$.locker.data"
show-field="code"
value-field="id"
ng-model="$ctrl.worker.locker.id">
</vn-autocomplete> -->
<!-- {{$ctrl.$.locker}} -->
</vn-horizontal> </vn-horizontal>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>

View File

@ -8,23 +8,9 @@ class Controller extends Section {
{code: 'M', name: this.$t('Married')}, {code: 'M', name: this.$t('Married')},
{code: 'S', name: this.$t('Single')} {code: 'S', name: this.$t('Single')}
]; ];
// this.$.lockerFilter = {workerFk: null};
} }
// get worker() {
// return this._worker;
// }
// set worker(value) {
// this._worker = value;
// console.log('VALUE', value);
// if (value)
// this.$.lockerFilter = {where: {AND: [{workerFk: null}, {gender: value.sex}]}};
// // this.$.locker.refresh();
// }
onSubmit() { onSubmit() {
console.log(this.worker);
console.log(this.$.watcher.orgData);
// if(this.$.worker.locker.id != )
return this.$.watcher.submit() return this.$.watcher.submit()
.then(() => this.card.reload()); .then(() => this.card.reload());
} }

View File

@ -1,50 +0,0 @@
<div class="vn-w-md" ng-show="$ctrl.currentPDA">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield
label="Current PDA"
ng-model="$ctrl.currentPDA.description"
disabled="true">
<append>
<vn-icon-button
icon="delete"
vn-tooltip="Deallocate PDA"
ng-click="$ctrl.deallocatePDA()"
vn-acl="hr, productionAssi">
</vn-icon-button>
</append>
</vn-textfield>
</vn-horizontal>
</vn-card>
</div>
<form name="form" ng-show="!$ctrl.currentPDA" ng-submit="$ctrl.allocatePDA()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-autocomplete
vn-acl="hr, productionAssi"
ng-model="$ctrl.newPDA"
url="DeviceProductions"
fields="['id', 'modelFk', 'serialNumber']"
where="{'stateFk': 'idle'}"
label="New PDA"
order="id"
value-field="id"
show-field="serialNumber">
<tpl-item>
<div>
ID: {{id}}
</div>
<div class="text-caption text-grey">
{{modelFk}}, {{serialNumber}}
</div>
</tpl-item>
</vn-autocomplete>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!$ctrl.newPDA"
label="Assign">
</vn-submit>
</vn-button-bar>
</form>

View File

@ -1,53 +0,0 @@
import ngModule from '../module';
import Section from 'salix/components/section';
import './style.scss';
class Controller extends Section {
constructor($element, $) {
super($element, $);
const filter = {
where: {userFk: this.$params.id},
include: {relation: 'deviceProduction'}
};
this.$http.get('DeviceProductionUsers', {filter}).
then(res => {
if (res.data && res.data.length > 0)
this.setCurrentPDA(res.data[0]);
});
}
deallocatePDA() {
this.$http.post(`Workers/${this.$params.id}/deallocatePDA`, {pda: this.currentPDA.deviceProductionFk})
.then(() => {
this.vnApp.showSuccess(this.$t('PDA deallocated'));
delete this.currentPDA;
});
}
allocatePDA() {
this.$http.post(`Workers/${this.$params.id}/allocatePDA`, {pda: this.newPDA})
.then(res => {
if (res.data)
this.setCurrentPDA(res.data);
this.vnApp.showSuccess(this.$t('PDA allocated'));
delete this.newPDA;
});
}
setCurrentPDA(data) {
this.currentPDA = data;
this.currentPDA.description = [];
this.currentPDA.description.push(`ID: ${this.currentPDA.deviceProductionFk}`);
this.currentPDA.description.push(`${this.$t('Model')}: ${this.currentPDA.deviceProduction.modelFk}`);
this.currentPDA.description.push(`${this.$t('Serial Number')}: ${this.currentPDA.deviceProduction.serialNumber}`);
this.currentPDA.description = this.currentPDA.description.join(' ');
}
}
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnWorkerPda', {
template: require('./index.html'),
controller: Controller,
});

View File

@ -1,6 +0,0 @@
@import "./variables";
.text-grey {
color: $color-font-light;
}

View File

@ -58,9 +58,8 @@
phone-number="worker.client.phone" phone-number="worker.client.phone"
></vn-link-phone> ></vn-link-phone>
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value label="Locker"
label="Locker" value="{{worker.locker.code}}"
value="{{worker.locker.code}}"
> >
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>