hino / app / controllers / approval-log / index.js
index.js
Raw
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default Controller.extend({
	approvalLogData : service(),
	router: service(),
	queryParams: ['page', 'perPage', 'sort', 'filter'],
	page: 1,
	perPage: 10,
	filter: null,
	init() {
		this._super(...arguments);
		this.table = {
			mode: "list",
			model: "approval-log",
			columns: [
			{
				name: 'Document Type Code',
				key: 'documentTypeCode',
				uri: "approval-log.detail",
				editUri: "approval-log.edit"
			},
			{
				name: 'Document Type Description',
				key: 'documentTypeDescription',
			},
			{
				name: 'Approval Code',
				key: 'approvalCode',
			},
			{
				name: 'Approval Name',
				key: 'approvalName',
			},
			{
				name: 'Sync Target',
				key: 'syncTarget',
			},
			{
				name: 'Transaction Id',
				key: 'transactionId',
			},
			{
				name: 'Source System No',
				key: 'sourceSystemNo',
			},
			{
				name: 'Request No',
				key: 'requestNo',
			},
			{
				name: 'Approval Inbox Status',
				key: 'approvalInboxStatus',
			},
			{
				name: 'Notes',
				key: 'notes',
			},
			{
				name: 'Action',
				key: 'action',
			},
			{
				name: 'Validation Message',
				key: 'validationMessage',
			},
			] 
		};
	},
	actions : {
		deleteRow(data) {
			let result = confirm('Are you sure want to delete this data?');
			if (result) {
				if (data != null) {
					this.approvalLogData.delete(data).then(() => {
						this.router.transitionTo('approval-log.index');
					});
				}
			}
		},
	},
});