@things-factory/operato-wms 3.7.2 → 3.7.7
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/client/pages/components/select-product-popup.js +5 -1
- package/client/pages/constants/order.js +10 -0
- package/client/pages/inbound/putaway-product.js +162 -139
- package/client/pages/inventory-check/inspecting-product.js +146 -80
- package/client/pages/manifest/create-loading-manifest.js +314 -0
- package/client/pages/manifest/dispatcher-verification-popup.js +86 -0
- package/client/pages/manifest/loading-manifest-detail.js +345 -0
- package/client/pages/manifest/loading-manifest-list.js +305 -0
- package/client/pages/order/arrival-notice/create-arrival-notice.js +8 -1
- package/client/pages/order/goods-received-note/received-note-list.js +138 -6
- package/client/pages/order/release-order/b2b/b2b-order-list.js +45 -5
- package/client/pages/order/release-order/b2b/b2b-order-requests.js +45 -5
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +181 -21
- package/client/pages/order/release-order/bulk-print-packing-list.js +23 -0
- package/client/pages/order/release-order/create-release-order.js +25 -4
- package/client/pages/order/release-order/receive-release-order-request.js +27 -24
- package/client/pages/order/release-order/release-extra-product-popup.js +189 -56
- package/client/pages/order/release-order/release-order-detail.js +292 -71
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +115 -50
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +1 -6
- package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +239 -0
- package/client/pages/order/transport-order/delivery-order-list.js +99 -59
- package/client/pages/outbound/loading-product.js +4 -1
- package/client/pages/outbound/merged-outbound-worksheet.js +39 -1
- package/client/pages/outbound/packing-product.js +4 -1
- package/client/pages/outbound/packing-worksheet-list.js +39 -1
- package/client/pages/outbound/picking-product.js +622 -290
- package/client/pages/outbound/serial-number-popup.js +280 -0
- package/client/pages/outbound/worksheet-picking.js +28 -2
- package/client/pages/report/product-label-report.js +401 -0
- package/client/pages/support/inventory-comparison.js +296 -0
- package/client/pages/vas/print-product-label.js +298 -132
- package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +30 -12
- package/client/pages/vas/reverse-kitting/popup-combination-sets.js +75 -5
- package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +113 -18
- package/client/route.js +23 -0
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +64 -54
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js +34 -9
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +3 -1
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/inventory-comparison/index.js +6 -0
- package/dist-server/graphql/resolvers/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js +78 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/product-label-report.js +56 -0
- package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -0
- package/dist-server/graphql/types/index.js +5 -2
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/inventory-comparison/index.js +13 -0
- package/dist-server/graphql/types/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js +14 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js +18 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +6 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/product-label-report-list.js +14 -0
- package/dist-server/graphql/types/reports/product-label-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/product-label-report.js +16 -0
- package/dist-server/graphql/types/reports/product-label-report.js.map +1 -0
- package/package.json +65 -65
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +75 -65
- package/server/graphql/resolvers/extra/add-release-good-products.ts +57 -15
- package/server/graphql/resolvers/index.ts +3 -1
- package/server/graphql/resolvers/inventory-comparison/index.ts +5 -0
- package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +99 -0
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/product-label-report.ts +56 -0
- package/server/graphql/types/index.ts +5 -2
- package/server/graphql/types/inventory-comparison/index.ts +11 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison-list.ts +8 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison.ts +12 -0
- package/server/graphql/types/reports/index.ts +6 -1
- package/server/graphql/types/reports/product-label-report-list.ts +8 -0
- package/server/graphql/types/reports/product-label-report.ts +10 -0
- package/things-factory.config.js +24 -0
- package/translations/en.json +64 -12
- package/translations/ko.json +50 -1
- package/translations/ms.json +51 -1
- package/translations/zh.json +50 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import '@things-factory/grist-ui'
|
|
2
|
+
|
|
3
|
+
import { css, html, LitElement } from 'lit-element'
|
|
4
|
+
|
|
5
|
+
import { SingleColumnFormStyles } from '@things-factory/form-ui'
|
|
6
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
7
|
+
|
|
8
|
+
class DispatcherVerificationPopup extends localize(i18next)(LitElement) {
|
|
9
|
+
static get styles() {
|
|
10
|
+
return [
|
|
11
|
+
SingleColumnFormStyles,
|
|
12
|
+
css`
|
|
13
|
+
:host {
|
|
14
|
+
padding: 10px;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
overflow-x: overlay;
|
|
18
|
+
background-color: var(--main-section-background-color);
|
|
19
|
+
}
|
|
20
|
+
.button-container {
|
|
21
|
+
padding: var(--button-container-padding);
|
|
22
|
+
margin: var(--button-container-margin);
|
|
23
|
+
text-align: var(--button-container-align);
|
|
24
|
+
background-color: var(--button-container-background);
|
|
25
|
+
height: var(--button-container-height);
|
|
26
|
+
}
|
|
27
|
+
`
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get dispatchmentForm() {
|
|
32
|
+
return this.shadowRoot.querySelector('form[name=dispatchmentForm]')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
return html`
|
|
37
|
+
<form name="dispatchmentForm" class="single-column-form">
|
|
38
|
+
<fieldset>
|
|
39
|
+
<label>${i18next.t('label.dispatcher_name')}</label>
|
|
40
|
+
<input name="dispatcherName" required />
|
|
41
|
+
|
|
42
|
+
<label>${i18next.t('label.dispatcher_identity')}</label>
|
|
43
|
+
<input name="dispatcherIdentity" required />
|
|
44
|
+
</fieldset>
|
|
45
|
+
</form>
|
|
46
|
+
<div class="button-container">
|
|
47
|
+
<mwc-button
|
|
48
|
+
@click="${this._updateManifestDispatchement.bind(this)}"
|
|
49
|
+
label="${`${i18next.t('button.confirm')}`}"
|
|
50
|
+
raised
|
|
51
|
+
></mwc-button>
|
|
52
|
+
</div>
|
|
53
|
+
`
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_updateManifestDispatchement() {
|
|
57
|
+
this._validateDispatchmentUpdate()
|
|
58
|
+
let dispatchment = this._serializeForm(this.dispatchmentForm)
|
|
59
|
+
this.dispatchEvent(
|
|
60
|
+
new CustomEvent('dispatch', {
|
|
61
|
+
detail: {
|
|
62
|
+
dispatcherName: dispatchment.dispatcherName,
|
|
63
|
+
dispatcherIdentity: dispatchment.dispatcherIdentity
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
)
|
|
67
|
+
history.back()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
_serializeForm(form) {
|
|
71
|
+
let obj = {}
|
|
72
|
+
Array.from(form.querySelectorAll('input')).forEach(field => {
|
|
73
|
+
if (!field.hasAttribute('hidden') && field.value) {
|
|
74
|
+
obj[field.name] = field.type === 'checkbox' ? field.checked : field.value
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
return obj
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
_validateDispatchmentUpdate() {
|
|
82
|
+
this.dispatchmentForm.checkValidity()
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
window.customElements.define('dispatcher-verification-popup', DispatcherVerificationPopup)
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import '@things-factory/grist-ui'
|
|
2
|
+
import './dispatcher-verification-popup'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
6
|
+
|
|
7
|
+
import { GhostPrint } from '@operato/ghost-print'
|
|
8
|
+
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
9
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
10
|
+
import { openPopup } from '@things-factory/layout-base'
|
|
11
|
+
import { client, navigate, PageView } from '@things-factory/shell'
|
|
12
|
+
import { CommonButtonStyles } from '@things-factory/styles'
|
|
13
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
14
|
+
|
|
15
|
+
import { MANIFEST_STATUS } from '../constants'
|
|
16
|
+
|
|
17
|
+
class LoadingManifestDetail extends localize(i18next)(PageView) {
|
|
18
|
+
static get styles() {
|
|
19
|
+
return [
|
|
20
|
+
MultiColumnFormStyles,
|
|
21
|
+
css`
|
|
22
|
+
:host {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
overflow-x: auto;
|
|
26
|
+
}
|
|
27
|
+
.container {
|
|
28
|
+
flex: 1;
|
|
29
|
+
display: flex;
|
|
30
|
+
overflow-y: auto;
|
|
31
|
+
min-height: 50vh;
|
|
32
|
+
}
|
|
33
|
+
.grist {
|
|
34
|
+
background-color: var(--main-section-background-color);
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
flex: 1;
|
|
38
|
+
overflow-y: auto;
|
|
39
|
+
}
|
|
40
|
+
data-grist {
|
|
41
|
+
overflow-y: hidden;
|
|
42
|
+
flex: 1;
|
|
43
|
+
}
|
|
44
|
+
h2 {
|
|
45
|
+
padding: var(--subtitle-padding);
|
|
46
|
+
font: var(--subtitle-font);
|
|
47
|
+
color: var(--subtitle-text-color);
|
|
48
|
+
border-bottom: var(--subtitle-border-bottom);
|
|
49
|
+
}
|
|
50
|
+
.grist h2 {
|
|
51
|
+
margin: var(--grist-title-margin);
|
|
52
|
+
border: var(--grist-title-border);
|
|
53
|
+
font: var(--grist-title-font);
|
|
54
|
+
color: var(--secondary-color);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.grist h2 mwc-icon {
|
|
58
|
+
vertical-align: middle;
|
|
59
|
+
margin: var(--grist-title-icon-margin);
|
|
60
|
+
font-size: var(--grist-title-icon-size);
|
|
61
|
+
color: var(--grist-title-icon-color);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
h2 + data-grist {
|
|
65
|
+
padding-top: var(--grist-title-with-grid-padding);
|
|
66
|
+
}
|
|
67
|
+
`
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static get properties() {
|
|
72
|
+
return {
|
|
73
|
+
shippingData: Object,
|
|
74
|
+
shippingGristConfig: Object,
|
|
75
|
+
_manifestNo: String,
|
|
76
|
+
_status: String
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get context() {
|
|
81
|
+
var actions = [
|
|
82
|
+
{
|
|
83
|
+
title: i18next.t('button.back'),
|
|
84
|
+
action: () => navigate('loading_manifest_list'),
|
|
85
|
+
...CommonButtonStyles.back
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
title: i18next.t('button.print'),
|
|
89
|
+
action: this._printManifest.bind(this),
|
|
90
|
+
...CommonButtonStyles.label
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
if (this._status == MANIFEST_STATUS.OPEN.value) {
|
|
95
|
+
actions.push({
|
|
96
|
+
title: i18next.t('button.dispatch'),
|
|
97
|
+
action: this._openDispatcherVerificationPopup.bind(this),
|
|
98
|
+
...CommonButtonStyles.load
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
title: i18next.t('title.manifest'),
|
|
104
|
+
actions
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
get manifestForm() {
|
|
109
|
+
return this.shadowRoot.querySelector('form[name=manifest]')
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
render() {
|
|
113
|
+
return html`
|
|
114
|
+
<div class="form-container">
|
|
115
|
+
<form name="manifest" class="multi-column-form">
|
|
116
|
+
<fieldset>
|
|
117
|
+
<legend>${i18next.t('title.manifest_no')}: ${this._manifestNo}</legend>
|
|
118
|
+
<label>${i18next.t('label.shipping_provider')}</label>
|
|
119
|
+
<input name="shippingProvider" readonly />
|
|
120
|
+
|
|
121
|
+
<label>${i18next.t('label.dispatcher_name')}</label>
|
|
122
|
+
<input name="dispatcherName" readonly />
|
|
123
|
+
|
|
124
|
+
<label>${i18next.t('label.dispatcher_identity')}</label>
|
|
125
|
+
<input name="dispatcherIdentity" readonly />
|
|
126
|
+
|
|
127
|
+
<label>${i18next.t('label.dispatch_at')}</label>
|
|
128
|
+
<input name="dispatchedAt" type="datetime-local" readonly />
|
|
129
|
+
|
|
130
|
+
<label>${i18next.t('label.total_tracking_no')}</label>
|
|
131
|
+
<input name="totalTrackingNo" readonly />
|
|
132
|
+
|
|
133
|
+
<label>${i18next.t('label.status')}</label>
|
|
134
|
+
<input name="status" readonly />
|
|
135
|
+
</fieldset>
|
|
136
|
+
</form>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<div class="container">
|
|
140
|
+
<div class="grist">
|
|
141
|
+
<h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.manifest_items')}</h2>
|
|
142
|
+
|
|
143
|
+
<data-grist
|
|
144
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
145
|
+
.config=${this.shippingGristConfig}
|
|
146
|
+
.data=${this.shippingData}
|
|
147
|
+
></data-grist>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
`
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
pageInitialized() {
|
|
154
|
+
this.shippingGristConfig = {
|
|
155
|
+
list: { fields: ['refNo', 'trackingNo', 'dispatchmentStatus'] },
|
|
156
|
+
pagination: { infinite: true },
|
|
157
|
+
columns: [
|
|
158
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
159
|
+
{
|
|
160
|
+
type: 'string',
|
|
161
|
+
name: 'refNo',
|
|
162
|
+
label: true,
|
|
163
|
+
header: i18next.t('field.order_no'),
|
|
164
|
+
width: 200
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
type: 'string',
|
|
168
|
+
name: 'trackingNo',
|
|
169
|
+
label: true,
|
|
170
|
+
header: i18next.t('field.tracking_no'),
|
|
171
|
+
width: 200
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'string',
|
|
175
|
+
name: 'attentionTo',
|
|
176
|
+
label: true,
|
|
177
|
+
header: i18next.t('field.delivery_to'),
|
|
178
|
+
width: 150
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: 'string',
|
|
182
|
+
name: 'phone',
|
|
183
|
+
label: true,
|
|
184
|
+
header: i18next.t('field.phone'),
|
|
185
|
+
width: 150
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
type: 'string',
|
|
189
|
+
name: 'deliveryAddress',
|
|
190
|
+
label: true,
|
|
191
|
+
header: i18next.t('field.delivery_address'),
|
|
192
|
+
width: 250
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: 'string',
|
|
196
|
+
name: 'postalCode',
|
|
197
|
+
label: true,
|
|
198
|
+
header: i18next.t('field.postal_code'),
|
|
199
|
+
width: 120
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
type: 'string',
|
|
203
|
+
name: 'city',
|
|
204
|
+
label: true,
|
|
205
|
+
header: i18next.t('field.city'),
|
|
206
|
+
width: 120
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
type: 'string',
|
|
210
|
+
name: 'dispatchmentStatus',
|
|
211
|
+
label: true,
|
|
212
|
+
header: i18next.t('field.status'),
|
|
213
|
+
width: 150
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async pageUpdated(changes, lifecycle, before) {
|
|
220
|
+
if (this.active) {
|
|
221
|
+
this._manifestNo = changes.resourceId || this._manifestNo || ''
|
|
222
|
+
await this._fetchManifestDetail()
|
|
223
|
+
this.updateContext()
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
async _fetchManifestDetail() {
|
|
228
|
+
if (!this._manifestNo) return
|
|
229
|
+
|
|
230
|
+
const response = await client.query({
|
|
231
|
+
query: gql`
|
|
232
|
+
query manifest($name: String!) {
|
|
233
|
+
manifest(name: $name) {
|
|
234
|
+
id
|
|
235
|
+
name
|
|
236
|
+
dispatchedAt
|
|
237
|
+
dispatcherName
|
|
238
|
+
dispatcherIdentity
|
|
239
|
+
status
|
|
240
|
+
shippingProvider
|
|
241
|
+
trackingNos {
|
|
242
|
+
trackingNo
|
|
243
|
+
deliveryAddress
|
|
244
|
+
attentionTo
|
|
245
|
+
phone
|
|
246
|
+
postalCode
|
|
247
|
+
city
|
|
248
|
+
refNo
|
|
249
|
+
dispatchmentStatus
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
`,
|
|
254
|
+
variables: { name: this._manifestNo }
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
if (!response.errors) {
|
|
258
|
+
const manifest = response.data.manifest
|
|
259
|
+
|
|
260
|
+
this._status = manifest.status
|
|
261
|
+
this._fillupForm(this.manifestForm, { ...manifest, totalTrackingNo: manifest.trackingNos?.length })
|
|
262
|
+
this.shippingData = { records: manifest.trackingNos }
|
|
263
|
+
this.updateContext()
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
_openDispatcherVerificationPopup() {
|
|
268
|
+
openPopup(
|
|
269
|
+
html`
|
|
270
|
+
<dispatcher-verification-popup
|
|
271
|
+
@dispatch="${e => {
|
|
272
|
+
this._dispatchManifest(e.detail)
|
|
273
|
+
}}"
|
|
274
|
+
></dispatcher-verification-popup>
|
|
275
|
+
`,
|
|
276
|
+
{
|
|
277
|
+
size: 'medium',
|
|
278
|
+
title: `${i18next.t('title.dispatcher_verification')}`
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
async _dispatchManifest(patch) {
|
|
284
|
+
const response = await client.mutate({
|
|
285
|
+
mutation: gql`
|
|
286
|
+
mutation dispatchManifest($name: String!, $patch: ManifestPatch!) {
|
|
287
|
+
dispatchManifest(name: $name, patch: $patch) {
|
|
288
|
+
id
|
|
289
|
+
name
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
`,
|
|
293
|
+
variables: { name: this._manifestNo, patch }
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
if (!response.errors) {
|
|
297
|
+
await this._fetchManifestDetail()
|
|
298
|
+
this._showToast({ message: i18next.t('text.manifest_has_been_dispatched_and_closed') })
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
_printManifest() {
|
|
303
|
+
GhostPrint.print({
|
|
304
|
+
src: `/view_manifest/${this._manifestNo}`,
|
|
305
|
+
pending: 1000,
|
|
306
|
+
onfinish: () => {
|
|
307
|
+
this._showToast({ message: i18next.t('text.document_has_been_generated') })
|
|
308
|
+
}
|
|
309
|
+
})
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
_fillupForm(form, data) {
|
|
313
|
+
for (let key in data) {
|
|
314
|
+
Array.from(form.querySelectorAll('input, textarea, select')).forEach(field => {
|
|
315
|
+
if (field.name === key && field.type === 'checkbox') {
|
|
316
|
+
field.checked = data[key]
|
|
317
|
+
} else if (field.name === key && field.type === 'datetime-local') {
|
|
318
|
+
if (data[key]) {
|
|
319
|
+
const datetime = Number(data[key])
|
|
320
|
+
const timezoneOffset = new Date(datetime).getTimezoneOffset() * 60000
|
|
321
|
+
field.value = new Date(datetime - timezoneOffset).toISOString().slice(0, -1)
|
|
322
|
+
} else {
|
|
323
|
+
field.value = data[key]
|
|
324
|
+
}
|
|
325
|
+
} else if (field.name === key) {
|
|
326
|
+
field.value = data[key]
|
|
327
|
+
}
|
|
328
|
+
})
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
_showToast({ type, message }) {
|
|
333
|
+
document.dispatchEvent(
|
|
334
|
+
new CustomEvent('notify', {
|
|
335
|
+
detail: {
|
|
336
|
+
type,
|
|
337
|
+
message,
|
|
338
|
+
option: { timer: 1000 }
|
|
339
|
+
}
|
|
340
|
+
})
|
|
341
|
+
)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
customElements.define('loading-manifest-detail', LoadingManifestDetail)
|