import {AlertDialogComponent} from '@eg/share/dialog/alert.component';
import {ServerStoreService} from '@eg/core/server-store.service';
import {PicklistUploadService} from './upload.service';
-import {OrgSelectComponent} from '@eg/share/org-select/org-select.component'
+import {OrgSelectComponent} from '@eg/share/org-select/org-select.component';
const TEMPLATE_SETTING_NAME = 'eg.acq.picklist.upload.templates';
settings: Object = {};
recordType: string;
- selectedQueue: ComboboxEntry;
+ selectedQueue: ComboboxEntry;
activeSelectionListId: number;
@ViewChild('fiscalYearSelector', { static: true })
private fiscalYearSelector: ComboboxComponent;
@ViewChild('selectionListSelector', { static: true })
- private selectionListSelector: ComboboxComponent;
+ private selectionListSelector: ComboboxComponent;
@ViewChild('matchSetSelector', { static: true })
private matchSetSelector: ComboboxComponent;
@ViewChild('mergeProfileSelector', { static: true })
orgOnChange(org: IdlObject) {
- this.orderingAgency = org.id()
+ this.orderingAgency = org.id();
}
loadTemplates() {
s => {
return {id: s.id(), label: s.source()};
});
-
+
case 'providersList':
return (this.vlagent.providersList || []).map(
p => {
return {id: p.id(), label: p.code()};
});
-
+
case 'fiscalYears':
return (this.vlagent.fiscalYears || []).map(
fy => {
case 'matchSets':
list = this.vlagent.matchSets['bib'];
break;
-
+
case 'importItemDefs':
list = this.vlagent.importItemAttrDefs;
break;
}
}
-
+
fileSelected($event) {
this.selectedFile = $event.target.files[0];
}
Boolean(this.selectedProvider) &&
Boolean(this.orderingAgency);
}
-
-
+
upload() {
this.sessionKey = null;
this.isUploading = true;
resolveSelectionList(): Promise<any> {
if (!this.selectedSelectionList) {
- return Promise.resolve()
+ return Promise.resolve();
}
if (this.selectedSelectionList.id) {
- this.activeSelectionListId = this.selectedSelectionList.id
+ this.activeSelectionListId = this.selectedSelectionList.id;
}
if (this.selectedSelectionList.freetext) {
value => this.activeSelectionListId = value
);
}
- return Promise.resolve(this.activeSelectionListId);
+ return Promise.resolve(this.activeSelectionListId);
}
uploadFile(): Promise<any> {
if (this.vlagent.importSelection) {
return Promise.resolve();
}
-
- let spoolType = this.recordType;
+
+ const spoolType = this.recordType;
const vandelayOptions = {
import_no_match: this.importNonMatching,
bib_source: this.selectedBibSource,
create_assets: this.loadItems,
queue_name: this.selectedQueue.label
- }
+ };
const args = {
-
provider: this.selectedProvider,
ordering_agency: this.orderingAgency,
create_po: this.createPurchaseOrder,
fiscal_year: this.selectedFiscalYear,
picklist: this.activeSelectionListId,
vandelay: vandelayOptions
- }
-
+ };
const method = `open-ils.acq.process_upload_records`;
progress => {
const resp = this.evt.parse(progress);
console.log(progress);
- if (resp) { console.error(resp); return reject();}
+ if (resp) { console.error(resp); return reject(); }
if (progress.complete) {
this.uploadProcessing = false;
this.uploadComplete = true;
}
- if (progress.purchase_order) {this.newPO = progress.purchase_order.id();}
+ if (progress.purchase_order) {this.newPO = progress.purchase_order.id(); }
}
);
});
import {PermService} from '@eg/core/perm.service';
import {EventService} from '@eg/core/event.service';
import {ProgressDialogComponent} from '@eg/share/dialog/progress.component';
-import {VandelayImportSelection} from '@eg/staff/cat/vandelay/vandelay.service'
+import {VandelayImportSelection} from '@eg/staff/cat/vandelay/vandelay.service';
@Injectable()
getMatchSets(mtype: string): Promise<IdlObject[]> {
- const mstype = 'biblio'
+ const mstype = 'biblio';
if (this.matchSets[mtype]) {
return Promise.resolve(this.matchSets[mtype]);
const newpicklist = this.idl.create('acqpl');
newpicklist.owner(this.auth.user().id());
newpicklist.name(picklistName);
- newpicklist.org_unit(picklistOrg)
-
+ newpicklist.org_unit(picklistOrg);
+
return new Promise((resolve, reject) => {
this.net.request(
'open-ils.acq', 'open-ils.acq.picklist.create',
});
});
}
-
+
}