import Controller from '@ember/controller'; import { inject as service } from '@ember/service'; export default Controller.extend({ accountManagementData : service(), router: service(), queryParams: ['page', 'perPage', 'sort', 'filter'], page: 1, perPage: 10, filter: null, init() { this._super(...arguments); this.table = { mode: "list", model: "account-management", columns: [ { name: 'Customer Name', key: 'customerName', uri: "account-management.detailprofile", editUri: "account-management.edit", }, { name: 'Goverment ID', key: 'governmentIdNo', }, { name: 'Tentative Customer ID', key: 'tentativeCustomerId', }, { name: 'Customer DMS ID', key: 'customerDmsId', }, { name: 'Fixed Customer ID', key: 'fixedCustomerId', }, { name: 'Business Segment', key: 'businessSegment.businessSegmentCode', }, { name: 'Address', key: 'address', }, // { // name: 'Customer Name', // key: 'customerName', // uri: "account-management.detail", // editUri: "account-management.edit" // }, // { // name: 'Prefix', // key: 'prefix', // }, // { // name: 'Suffix', // key: 'suffix', // }, // { // name: 'Tentative Customer ID', // key: 'tentativeCustomerId', // }, // { // name: 'Universal Customer ID', // key: 'universalCustomerId', // }, // { // name: 'Business Segment', // key: 'businessSegment.businessSegmentCode', // }, // { // name: 'Sub Business Segment', // key: 'subBusinessSegment.subBusinessSegmentCode', // }, // { // name: 'Term of Payment', // key: 'termOfPayment', // }, // { // name: 'Customer Type DMS', // key: 'customerTypeDms', // }, // { // name: 'Customer Type HMS', // key: 'customerTypeHms', // }, // { // name: 'Parent Account', // key: 'parentAccount', // }, // { // name: 'Sales Classification', // key: 'salesClassification', // }, // { // name: 'Service Classification', // key: 'serviceClassification', // }, // { // name: 'Spare Parts Classification', // key: 'sparePartsClassification', // }, // { // name: 'UIO Sales', // key: 'uioSales', // }, // { // name: 'UIO Service', // key: 'uioService', // }, // { // name: 'Line of Business', // key: 'lineOfBusiness', // }, // { // name: 'Load', // key: 'load', // }, // { // name: 'Payload', // key: 'payload', // }, // { // name: 'Year Establishment', // key: 'yearEstablishment', // }, // { // name: 'Registration Number', // key: 'registrationNumber', // }, // { // name: 'Why Buy Hino', // key: 'whyBuyHino', // }, // { // name: 'CustomerSize', // key: 'customerSize', // }, // { // name: 'ID Type', // key: 'idType.idTypeCode', // }, // { // name: 'Government ID No', // key: 'governmentIdNo', // }, // { // name: 'Tax Invoice Type', // key: 'taxInvoiceType', // }, // { // name: 'Vat Transaction Code', // key: 'vatTransactionCode', // }, // { // name: 'Reason of Not Service in Hino', // key: 'reasonOfNotServiceInHino', // }, // { // name: 'Reason of Not Service Contract with Hino', // key: 'reasonOfNotServiceContractWithHino', // }, // { // name: 'Reason of Not Buying Hino Parts', // key: 'reasonOfNotBuyingHinoParts', // }, // { // name: 'Reason of Not Sparepart Contract With Hino', // key: 'reasonOfNotSparepartContractWithHino', // }, // { // name: 'Correspondence Equal To', // key: 'correspondenceEqualTo', // }, // { // name: 'Billing Equal To', // key: 'billingEqualTo', // }, // { // name: 'Chief Mechanic', // key: 'chiefMechanic', // }, // { // name: 'Mechanic', // key: 'mechanic', // }, // { // name: 'No of Bay', // key: 'noOfBay', // }, // { // name: 'Operation Distance', // key: 'operationDistance', // }, // { // name: 'Warehouse Head', // key: 'warehouseHead', // }, // { // name: 'Partsman', // key: 'partsman', // }, // { // name: 'Customer DMS ID', // key: 'customerDmsId', // }, // { // name: 'Fixed Customer ID', // key: 'fixedCustomerId', // }, // { // name: 'Address', // key: 'address', // }, // { // name: 'Kontak Utama', // key: 'kontakUtama', // }, // { // name: 'Contact Phone', // key: 'contactPhone', // }, // { // name: 'Nama Dealer', // key: 'namaDealer', // }, // { // name: 'Branch', // key: 'branch', // }, ] }; }, actions : { deleteRow(data) { let result = confirm('Are you sure want to delete this data?'); if (result) { if (data != null) { this.accountManagementData.delete(data).then(() => { this.router.transitionTo('account-management.index'); }); } } }, }, });