Lines 11-16
Link Here
|
11 |
@change="selectFile($event)" |
11 |
@change="selectFile($event)" |
12 |
:id="`import_file`" |
12 |
:id="`import_file`" |
13 |
:name="`import_file`" |
13 |
:name="`import_file`" |
|
|
14 |
required |
14 |
/> |
15 |
/> |
15 |
</span> |
16 |
</span> |
16 |
<ol> |
17 |
<ol> |
Lines 18-28
Link Here
|
18 |
{{ $__("File name") }}: |
19 |
{{ $__("File name") }}: |
19 |
<span>{{ file.filename }}</span> |
20 |
<span>{{ file.filename }}</span> |
20 |
</li> |
21 |
</li> |
21 |
<li v-show="file.file_type"> |
|
|
22 |
{{ $__("File type") }}: |
23 |
<span>{{ file.file_type }}</span> |
24 |
</li> |
25 |
</ol> |
22 |
</ol> |
|
|
23 |
<fieldset id="package_list"> |
24 |
{{ $__("To the following local package") }}: |
25 |
<v-select |
26 |
v-model="package_id" |
27 |
label="name" |
28 |
:reduce="p => p.package_id" |
29 |
:options="packages" |
30 |
:clearable="false" |
31 |
:required="!package_id" |
32 |
> |
33 |
<template #search="{ attributes, events }"> |
34 |
<input |
35 |
:required="!package_id" |
36 |
class="vs__search" |
37 |
v-bind="attributes" |
38 |
v-on="events" |
39 |
/> |
40 |
</template> |
41 |
</v-select> |
42 |
<span class="required">{{ $__("Required") }}</span> |
43 |
</fieldset> |
26 |
</div> |
44 |
</div> |
27 |
<fieldset class="action"> |
45 |
<fieldset class="action"> |
28 |
<ButtonSubmit /> |
46 |
<ButtonSubmit /> |
Lines 46-53
export default {
Link Here
|
46 |
filename: null, |
64 |
filename: null, |
47 |
file_content: null, |
65 |
file_content: null, |
48 |
}, |
66 |
}, |
|
|
67 |
packages: [], |
68 |
package_id: null, |
49 |
} |
69 |
} |
50 |
}, |
70 |
}, |
|
|
71 |
beforeCreate() { |
72 |
const client = APIClient.erm |
73 |
client.localPackages.getAll().then( |
74 |
packages => { |
75 |
this.packages = packages |
76 |
this.initialized = true |
77 |
}, |
78 |
error => {} |
79 |
) |
80 |
}, |
51 |
methods: { |
81 |
methods: { |
52 |
selectFile(e) { |
82 |
selectFile(e) { |
53 |
let files = e.target.files |
83 |
let files = e.target.files |
Lines 63-70
export default {
Link Here
|
63 |
}, |
93 |
}, |
64 |
addDocument(e) { |
94 |
addDocument(e) { |
65 |
e.preventDefault() |
95 |
e.preventDefault() |
|
|
96 |
|
66 |
const client = APIClient.erm |
97 |
const client = APIClient.erm |
67 |
client.localTitles.import_kbart(this.file).then( |
98 |
const importData = { |
|
|
99 |
file: this.file, |
100 |
package_id: this.package_id, |
101 |
} |
102 |
client.localTitles.import_kbart(importData).then( |
68 |
success => { |
103 |
success => { |
69 |
let message = "" |
104 |
let message = "" |
70 |
if (success.job_ids) { |
105 |
if (success.job_ids) { |
Lines 108-113
export default {
Link Here
|
108 |
file_type: null, |
143 |
file_type: null, |
109 |
file_content: null, |
144 |
file_content: null, |
110 |
} |
145 |
} |
|
|
146 |
this.package_id = null |
111 |
}, |
147 |
}, |
112 |
}, |
148 |
}, |
113 |
components: { |
149 |
components: { |
114 |
- |
|
|