@enso-ui/services 4.0.6 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enso-ui/services",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Basic services package",
|
|
5
5
|
"main": "src/bulma/pages/administration/services/Index.vue",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@enso-ui/forms": "^3.0",
|
|
25
25
|
"@enso-ui/tables": "^3.0",
|
|
26
|
-
"@enso-ui/ui": "^
|
|
26
|
+
"@enso-ui/ui": "^6.0",
|
|
27
27
|
"@fortawesome/fontawesome-svg-core": "^1.2.2",
|
|
28
28
|
"@fortawesome/free-solid-svg-icons": "^5.11.2",
|
|
29
29
|
"vue": "^3.0"
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="columns is-centered">
|
|
3
3
|
<div class="column is-three-quarters-desktop is-full-touch">
|
|
4
|
-
<enso-form class="box form-box has-background-light raises-on-hover"
|
|
4
|
+
<enso-form class="box form-box has-background-light raises-on-hover"
|
|
5
|
+
@ready="form = $event.form">
|
|
6
|
+
<template #suppliers>
|
|
7
|
+
<div class="wrapper is-block">
|
|
8
|
+
<div class="columns">
|
|
9
|
+
<div class="column is-6-tablet">
|
|
10
|
+
<form-field :field="form.field('suppliers')"
|
|
11
|
+
:custom-params="$route.params"/>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<supplier v-for="supplier in form.field('suppliers').value"
|
|
15
|
+
:key="supplier.id"
|
|
16
|
+
:supplier="supplier"
|
|
17
|
+
:errors="form.errors"
|
|
18
|
+
@acquisition-price-updated="supplier.cost.acquisitionPrice = $event"/>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
</enso-form>
|
|
5
22
|
</div>
|
|
6
23
|
</div>
|
|
7
24
|
</template>
|
|
8
25
|
|
|
9
|
-
<script>
|
|
10
|
-
import { EnsoForm } from '@enso-ui/forms/bulma';
|
|
26
|
+
<script setup>
|
|
27
|
+
import { EnsoForm, FormField } from '@enso-ui/forms/bulma';
|
|
28
|
+
import { ref } from 'vue';
|
|
29
|
+
import Supplier from './components/Supplier.vue';
|
|
11
30
|
|
|
12
|
-
|
|
13
|
-
name: 'Edit',
|
|
31
|
+
const form = ref(null);
|
|
14
32
|
|
|
15
|
-
components: { EnsoForm },
|
|
16
|
-
};
|
|
17
33
|
</script>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="columns supplier-wrapper">
|
|
3
|
+
<div class="column is-3">
|
|
4
|
+
<div class="field">
|
|
5
|
+
<label class="label">
|
|
6
|
+
{{ i18n('Supplier') }}
|
|
7
|
+
</label>
|
|
8
|
+
<div class="control">
|
|
9
|
+
<input class="input"
|
|
10
|
+
:value="supplier.name"
|
|
11
|
+
readonly>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="column">
|
|
16
|
+
<div class="field">
|
|
17
|
+
<label class="label">
|
|
18
|
+
{{ i18n('Acquisition Price') }}
|
|
19
|
+
</label>
|
|
20
|
+
<div class="control">
|
|
21
|
+
<input class="input"
|
|
22
|
+
:value="supplier.cost.acquisitionPrice"
|
|
23
|
+
v-select-on-focus
|
|
24
|
+
@input="$emit('acquisition-price-updated', $event.target.value);
|
|
25
|
+
clearError('acquisitionPrice');">
|
|
26
|
+
</div>
|
|
27
|
+
<p class="help is-danger"
|
|
28
|
+
v-if="hasError('acquisitionPrice')">
|
|
29
|
+
{{ getError('acquisitionPrice') }}
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="column is-narrow">
|
|
34
|
+
<div class="field">
|
|
35
|
+
<label class="label">
|
|
36
|
+
{{ i18n('Mapped At') }}
|
|
37
|
+
</label>
|
|
38
|
+
<div class="control">
|
|
39
|
+
<input class="input timestamp"
|
|
40
|
+
:value="supplier.cost.createdAt"
|
|
41
|
+
readonly>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="column is-narrow">
|
|
46
|
+
<div class="field">
|
|
47
|
+
<label class="label">
|
|
48
|
+
{{ i18n('Updated At') }}
|
|
49
|
+
</label>
|
|
50
|
+
<div class="control">
|
|
51
|
+
<input class="input timestamp"
|
|
52
|
+
:value="supplier.cost.updatedAt"
|
|
53
|
+
readonly>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import { focus, selectOnFocus } from '@enso-ui/directives';
|
|
62
|
+
import Errors from '@enso-ui/laravel-validation';
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: 'Supplier',
|
|
66
|
+
|
|
67
|
+
directives: { focus, selectOnFocus },
|
|
68
|
+
|
|
69
|
+
inject: ['i18n'],
|
|
70
|
+
|
|
71
|
+
props: {
|
|
72
|
+
errors: {
|
|
73
|
+
type: Errors,
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
index: {
|
|
77
|
+
type: Number,
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
supplier: {
|
|
81
|
+
type: Object,
|
|
82
|
+
required: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
emits: ['acquisition-price-updated', 'part-number-updated'],
|
|
87
|
+
|
|
88
|
+
methods: {
|
|
89
|
+
clearError(field) {
|
|
90
|
+
this.errors.clear(field);
|
|
91
|
+
},
|
|
92
|
+
errorKey(field) {
|
|
93
|
+
return `suppliers.${this.index}.cost.${field}`;
|
|
94
|
+
},
|
|
95
|
+
getError(field) {
|
|
96
|
+
const key = this.errorKey(field);
|
|
97
|
+
|
|
98
|
+
return this.errors.get(key)
|
|
99
|
+
.replace(key, 'field')
|
|
100
|
+
.replace('field field', 'field');
|
|
101
|
+
},
|
|
102
|
+
hasError(field) {
|
|
103
|
+
return this.errors.has(this.errorKey(field));
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<style lang="scss">
|
|
110
|
+
.supplier-wrapper .timestamp {
|
|
111
|
+
width: 7em;
|
|
112
|
+
}
|
|
113
|
+
</style>
|