Line 0
Link Here
|
|
|
1 |
<template> |
2 |
<div v-if="!initialized">{{ $__("Loading") }}</div> |
3 |
<div v-else id="vendors_show"> |
4 |
<Toolbar> |
5 |
<ToolbarButton |
6 |
:to="{ name: 'VendorList' }" |
7 |
icon="plus" |
8 |
:title="$__('New vendor')" |
9 |
/> |
10 |
<ToolbarButton |
11 |
:to="{ name: 'VendorList' }" |
12 |
icon="pencil" |
13 |
:title="$__('Edit vendor')" |
14 |
/> |
15 |
<ExternalLinkButton |
16 |
:to="{ |
17 |
path: '/cgi-bin/koha/acqui/parcels.pl', |
18 |
query: { booksellerid: vendor.id }, |
19 |
}" |
20 |
icon="plus" |
21 |
:title="$__('Receive shipments')" |
22 |
/> |
23 |
</Toolbar> |
24 |
<h1> |
25 |
{{ vendor.name }} |
26 |
</h1> |
27 |
<div class="row"> |
28 |
<div class="col-sm-6"> |
29 |
<VendorDetails :vendor="vendor" /> |
30 |
<VendorOrderingInformation :vendor="vendor" /> |
31 |
<VendorInterfaces |
32 |
:vendor="vendor" |
33 |
v-if="vendor.interfaces.length > 0" |
34 |
/> |
35 |
</div> |
36 |
<div class="col-sm-6"> |
37 |
<VendorContacts :vendor="vendor" /> |
38 |
<VendorSubscriptions :vendor="vendor" /> |
39 |
</div> |
40 |
</div> |
41 |
<div |
42 |
class="page-section rows" |
43 |
v-if="vendor.contracts && vendor.contracts.length > 0" |
44 |
> |
45 |
<VendorContracts :vendor="vendor" /> |
46 |
</div> |
47 |
</div> |
48 |
</template> |
49 |
|
50 |
<script> |
51 |
import Toolbar from "../Toolbar.vue" |
52 |
import ToolbarButton from "../ToolbarButton.vue" |
53 |
import { inject } from "vue" |
54 |
import { APIClient } from "../../fetch/api-client.js" |
55 |
import ExternalLinkButton from "../ExternalLinkButton.vue" |
56 |
import VendorDetails from "./VendorDetails.vue" |
57 |
import VendorOrderingInformation from "./VendorOrderingInformation.vue" |
58 |
import VendorInterfaces from "./VendorInterfaces.vue" |
59 |
import VendorContacts from "./VendorContacts.vue" |
60 |
import VendorSubscriptions from "./VendorSubscriptions.vue" |
61 |
import VendorContracts from "./VendorContracts.vue" |
62 |
|
63 |
export default { |
64 |
setup() { |
65 |
const format_date = $date |
66 |
const patron_to_html = $patron_to_html |
67 |
|
68 |
const { setConfirmationDialog, setMessage } = inject("mainStore") |
69 |
|
70 |
// const AVStore = inject("AVStore") |
71 |
// const { get_lib_from_av } = AVStore |
72 |
|
73 |
return { |
74 |
format_date, |
75 |
patron_to_html, |
76 |
// get_lib_from_av, |
77 |
setConfirmationDialog, |
78 |
setMessage, |
79 |
} |
80 |
}, |
81 |
data() { |
82 |
return { |
83 |
vendor: null, |
84 |
initialized: false, |
85 |
} |
86 |
}, |
87 |
beforeRouteEnter(to, from, next) { |
88 |
next(vm => { |
89 |
vm.getVendor(to.params.vendor_id) |
90 |
}) |
91 |
}, |
92 |
methods: { |
93 |
async getVendor(vendor_id) { |
94 |
const client = APIClient.acquisition |
95 |
client.vendors.get(vendor_id).then( |
96 |
vendor => { |
97 |
this.vendor = vendor |
98 |
this.initialized = true |
99 |
}, |
100 |
error => {} |
101 |
) |
102 |
}, |
103 |
}, |
104 |
components: { |
105 |
Toolbar, |
106 |
ToolbarButton, |
107 |
ExternalLinkButton, |
108 |
VendorDetails, |
109 |
VendorOrderingInformation, |
110 |
VendorInterfaces, |
111 |
VendorContacts, |
112 |
VendorSubscriptions, |
113 |
VendorContracts, |
114 |
}, |
115 |
name: "VendorShow", |
116 |
} |
117 |
</script> |
118 |
|
119 |
<style> |
120 |
.vendor_info { |
121 |
display: grid; |
122 |
} |
123 |
</style> |