2019-06-06 11:59:11 +00:00
|
|
|
import ngModule from '../../module';
|
2020-03-17 10:17:50 +00:00
|
|
|
import Section from 'salix/components/section';
|
2019-05-28 09:26:54 +00:00
|
|
|
import './style.scss';
|
|
|
|
|
2020-03-17 10:17:50 +00:00
|
|
|
class Controller extends Section {
|
|
|
|
constructor($element, $) {
|
|
|
|
super($element, $);
|
2019-05-28 09:26:54 +00:00
|
|
|
this.filter = {
|
|
|
|
include: {
|
|
|
|
relation: 'dms',
|
|
|
|
scope: {
|
2019-06-06 11:59:11 +00:00
|
|
|
fields: [
|
|
|
|
'dmsTypeFk',
|
|
|
|
'reference',
|
2019-07-19 06:13:52 +00:00
|
|
|
'hardCopyNumber',
|
|
|
|
'workerFk',
|
2019-06-06 11:59:11 +00:00
|
|
|
'description',
|
|
|
|
'hasFile',
|
|
|
|
'file',
|
|
|
|
'created',
|
|
|
|
],
|
2019-05-28 09:26:54 +00:00
|
|
|
include: [{
|
|
|
|
relation: 'dmsType',
|
|
|
|
scope: {
|
|
|
|
fields: ['name']
|
|
|
|
}
|
2020-04-28 12:26:02 +00:00
|
|
|
}, {
|
2019-05-28 09:26:54 +00:00
|
|
|
relation: 'worker',
|
|
|
|
scope: {
|
|
|
|
fields: ['userFk'],
|
|
|
|
include: {
|
|
|
|
relation: 'user',
|
|
|
|
scope: {
|
|
|
|
fields: ['nickname']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-04-28 12:26:02 +00:00
|
|
|
deleteDms(index) {
|
|
|
|
const dmsFk = this.clientDms[index].dmsFk;
|
|
|
|
return this.$http.post(`ClientDms/${dmsFk}/removeFile`)
|
|
|
|
.then(() => {
|
|
|
|
this.$.model.remove(index);
|
|
|
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
2019-05-28 09:26:54 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-17 10:17:50 +00:00
|
|
|
Controller.$inject = ['$element', '$scope'];
|
2019-05-28 09:26:54 +00:00
|
|
|
|
2019-06-06 11:59:11 +00:00
|
|
|
ngModule.component('vnClientDmsIndex', {
|
2019-05-28 09:26:54 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
});
|