salix/modules/ticket/front/dms/index/index.js

59 lines
1.7 KiB
JavaScript
Raw Normal View History

import ngModule from '../../module';
2020-03-18 07:35:59 +00:00
import Section from 'salix/components/section';
import './style.scss';
2020-03-18 07:35:59 +00:00
class Controller extends Section {
constructor($element, $) {
super($element, $);
this.filter = {
include: {
relation: 'dms',
scope: {
fields: [
'dmsTypeFk',
'workerFk',
2019-07-19 06:13:52 +00:00
'hardCopyNumber',
'reference',
'description',
'hasFile',
'file',
'created',
],
include: [{
relation: 'dmsType',
scope: {
fields: ['name']
}
},
{
relation: 'worker',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
},
}
}]
},
}
};
}
deleteDms(index) {
const dmsFk = this.ticketDms[index].dmsFk;
this.$http.post(`ticketDms/${dmsFk}/removeFile`)
.then(() => {
this.$.model.remove(index);
this.vnApp.showSuccess(this.$t('Data saved!'));
});
}
}
ngModule.component('vnTicketDmsIndex', {
template: require('./index.html'),
controller: Controller,
});