@things-factory/operato-wms 4.3.592 → 4.3.595
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/list-view/product-list-view.js +378 -0
- package/client/pages/constants/picking-standard.js +1 -0
- package/client/pages/constants/worksheet.js +12 -0
- package/client/pages/inventory-check/cycle-count-inventory-details-popup.js +12 -12
- package/client/pages/inventory-check/cycle-count-report.js +181 -91
- package/client/pages/inventory-check/inspecting-product.js +56 -12
- package/client/pages/order/release-order/b2b/b2b-order-list.js +91 -39
- package/client/pages/outbound/generate-worksheet-popup.js +188 -25
- package/client/pages/outbound/loading-v2/delivery-order-info.js +205 -0
- package/client/pages/outbound/loading-v2/load-by-qty.js +151 -0
- package/client/pages/outbound/loading-v2/loading-execution-base.js +514 -0
- package/client/pages/outbound/loading-v2/loading-execution.js +392 -0
- package/client/pages/outbound/loading-v2/loading.js +419 -0
- package/client/pages/outbound/loading-v2/release-good-info.js +93 -0
- package/client/pages/outbound/loading-v2/show-my-loading-worksheet-list-popup.js +93 -0
- package/client/pages/outbound/loading-v2/warehouse-return-popup.js +194 -0
- package/client/pages/outbound/picking-v2/issue-details-popup.js +163 -0
- package/client/pages/outbound/picking-v2/picking-execution-base.js +482 -0
- package/client/pages/outbound/picking-v2/picking-execution.js +379 -0
- package/client/pages/outbound/picking-v2/picking.js +387 -0
- package/client/pages/outbound/picking-v2/report-issue-popup.js +139 -0
- package/client/pages/outbound/picking-v2/scan-bin-no-popup.js +126 -0
- package/client/pages/outbound/picking-v2/worksheet-info.js +200 -0
- package/client/pages/outbound/select-operator-popup.js +6 -3
- package/client/pages/outbound/show-my-worksheet-list-popup.js +6 -2
- package/client/pages/outbound/worksheet-zone-picking.js +507 -0
- package/client/pages/outbound/zone-worksheet.js +574 -0
- package/client/route.js +15 -0
- package/dist-server/graphql/resolvers/index.js +11 -2
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/outbound/complete-load.js +96 -0
- package/dist-server/graphql/resolvers/outbound/complete-load.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/find-loadable-release-good.js +58 -0
- package/dist-server/graphql/resolvers/outbound/find-loadable-release-good.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/get-delivery-orders.js +29 -0
- package/dist-server/graphql/resolvers/outbound/get-delivery-orders.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/get-loading-task.js +86 -0
- package/dist-server/graphql/resolvers/outbound/get-loading-task.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/index.js +16 -0
- package/dist-server/graphql/resolvers/outbound/index.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/load-by-qty.js +112 -0
- package/dist-server/graphql/resolvers/outbound/load-by-qty.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js +122 -0
- package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/my-loading-assignment-status.js +32 -0
- package/dist-server/graphql/resolvers/outbound/my-loading-assignment-status.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/sort-item.js +65 -0
- package/dist-server/graphql/resolvers/outbound/sort-item.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/undo-load.js +72 -0
- package/dist-server/graphql/resolvers/outbound/undo-load.js.map +1 -0
- package/dist-server/graphql/resolvers/outbound/warehouse-return.js +101 -0
- package/dist-server/graphql/resolvers/outbound/warehouse-return.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/cycle-count-report.js +119 -86
- package/dist-server/graphql/resolvers/reports/cycle-count-report.js.map +1 -1
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +53 -25
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -1
- package/dist-server/graphql/resolvers/zone-worksheet/activate-zone-worksheet.js +91 -0
- package/dist-server/graphql/resolvers/zone-worksheet/activate-zone-worksheet.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/assign-sorter.js +36 -0
- package/dist-server/graphql/resolvers/zone-worksheet/assign-sorter.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/generate-zone-worksheet.js +103 -0
- package/dist-server/graphql/resolvers/zone-worksheet/generate-zone-worksheet.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/get-zone-picking-task.js +98 -0
- package/dist-server/graphql/resolvers/zone-worksheet/get-zone-picking-task.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/index.js +12 -0
- package/dist-server/graphql/resolvers/zone-worksheet/index.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/zone-picking.js +327 -0
- package/dist-server/graphql/resolvers/zone-worksheet/zone-picking.js.map +1 -0
- package/dist-server/graphql/resolvers/zone-worksheet/zone-worksheet.js +146 -0
- package/dist-server/graphql/resolvers/zone-worksheet/zone-worksheet.js.map +1 -0
- package/dist-server/graphql/types/index.js +11 -3
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/outbound/delivery-order-info-list.js +14 -0
- package/dist-server/graphql/types/outbound/delivery-order-info-list.js.map +1 -0
- package/dist-server/graphql/types/outbound/index.js +23 -0
- package/dist-server/graphql/types/outbound/index.js.map +1 -0
- package/dist-server/graphql/types/outbound/loading-assignment.js +15 -0
- package/dist-server/graphql/types/outbound/loading-assignment.js.map +1 -0
- package/dist-server/graphql/types/outbound/loading-worksheet-type.js +25 -0
- package/dist-server/graphql/types/outbound/loading-worksheet-type.js.map +1 -0
- package/dist-server/graphql/types/reports/cycle-count-report.js +2 -0
- package/dist-server/graphql/types/reports/cycle-count-report.js.map +1 -1
- package/dist-server/graphql/types/reports/index.js +1 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/zone-worksheet/index.js +22 -0
- package/dist-server/graphql/types/zone-worksheet/index.js.map +1 -0
- package/dist-server/graphql/types/zone-worksheet/zone-picking-worksheet.js +18 -0
- package/dist-server/graphql/types/zone-worksheet/zone-picking-worksheet.js.map +1 -0
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview-list.js +13 -0
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview-list.js.map +1 -0
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview.js +16 -0
- package/dist-server/graphql/types/zone-worksheet/zone-worksheet-overview.js.map +1 -0
- package/helps/release-note.md +20 -12
- package/package.json +8 -8
- package/server/graphql/resolvers/index.ts +11 -2
- package/server/graphql/resolvers/outbound/complete-load.ts +126 -0
- package/server/graphql/resolvers/outbound/find-loadable-release-good.ts +61 -0
- package/server/graphql/resolvers/outbound/get-delivery-orders.ts +32 -0
- package/server/graphql/resolvers/outbound/get-loading-task.ts +105 -0
- package/server/graphql/resolvers/outbound/index.ts +26 -0
- package/server/graphql/resolvers/outbound/load-by-qty.ts +176 -0
- package/server/graphql/resolvers/outbound/loading-worksheet-v2.ts +131 -0
- package/server/graphql/resolvers/outbound/my-loading-assignment-status.ts +35 -0
- package/server/graphql/resolvers/outbound/sort-item.ts +81 -0
- package/server/graphql/resolvers/outbound/undo-load.ts +83 -0
- package/server/graphql/resolvers/outbound/warehouse-return.ts +129 -0
- package/server/graphql/resolvers/reports/cycle-count-report.ts +125 -87
- package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +77 -35
- package/server/graphql/resolvers/zone-worksheet/activate-zone-worksheet.ts +124 -0
- package/server/graphql/resolvers/zone-worksheet/assign-sorter.ts +49 -0
- package/server/graphql/resolvers/zone-worksheet/generate-zone-worksheet.ts +133 -0
- package/server/graphql/resolvers/zone-worksheet/get-zone-picking-task.ts +118 -0
- package/server/graphql/resolvers/zone-worksheet/index.ts +20 -0
- package/server/graphql/resolvers/zone-worksheet/zone-picking.ts +458 -0
- package/server/graphql/resolvers/zone-worksheet/zone-worksheet.ts +183 -0
- package/server/graphql/types/index.ts +11 -3
- package/server/graphql/types/outbound/delivery-order-info-list.ts +8 -0
- package/server/graphql/types/outbound/index.ts +22 -0
- package/server/graphql/types/outbound/loading-assignment.ts +9 -0
- package/server/graphql/types/outbound/loading-worksheet-type.ts +20 -0
- package/server/graphql/types/reports/cycle-count-report.ts +2 -0
- package/server/graphql/types/reports/index.ts +3 -9
- package/server/graphql/types/zone-worksheet/index.ts +21 -0
- package/server/graphql/types/zone-worksheet/zone-picking-worksheet.ts +12 -0
- package/server/graphql/types/zone-worksheet/zone-worksheet-overview-list.ts +7 -0
- package/server/graphql/types/zone-worksheet/zone-worksheet-overview.ts +10 -0
- package/things-factory.config.js +16 -0
- package/translations/en.json +31 -1
- package/translations/ko.json +28 -0
- package/translations/ms.json +30 -2
- package/translations/zh.json +28 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
import { html, css, LitElement } from 'lit-element'
|
|
4
|
+
import { PageView, client, store, CustomAlert } from '@things-factory/shell'
|
|
5
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
6
|
+
import { ScrollbarStyles } from '@things-factory/styles'
|
|
7
|
+
import { showToast } from '../../../util'
|
|
8
|
+
import '../../components/list-view/product-list-view'
|
|
9
|
+
|
|
10
|
+
class WarehouseReturnPopup extends localize(i18next)(LitElement) {
|
|
11
|
+
static get properties() {
|
|
12
|
+
return {
|
|
13
|
+
_data: Object,
|
|
14
|
+
_releaseGoodNo: String
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static get styles() {
|
|
19
|
+
return [
|
|
20
|
+
ScrollbarStyles,
|
|
21
|
+
css`
|
|
22
|
+
:host {
|
|
23
|
+
padding: 12px;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
background-color: var(--main-section-background-color);
|
|
28
|
+
position: relative; /* Ensure the host element is positioned */
|
|
29
|
+
}
|
|
30
|
+
.content {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
flex: 1;
|
|
34
|
+
overflow: auto;
|
|
35
|
+
}
|
|
36
|
+
.button-container {
|
|
37
|
+
position: absolute;
|
|
38
|
+
bottom: 12px;
|
|
39
|
+
right: 12px;
|
|
40
|
+
display: flex;
|
|
41
|
+
gap: 8px;
|
|
42
|
+
}
|
|
43
|
+
.tab-info {
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
color: #f3f2f7;
|
|
47
|
+
background-color: #007e7f;
|
|
48
|
+
padding: 10px;
|
|
49
|
+
}
|
|
50
|
+
.text-center {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
}
|
|
54
|
+
.text-14 {
|
|
55
|
+
font-size: 14px !important;
|
|
56
|
+
line-height: 1.5 !important;
|
|
57
|
+
}
|
|
58
|
+
.font-bold {
|
|
59
|
+
font-weight: bold !important;
|
|
60
|
+
}
|
|
61
|
+
`
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
get returnConfig() {
|
|
66
|
+
return {
|
|
67
|
+
selectable: true,
|
|
68
|
+
columnLeft: {
|
|
69
|
+
size: 8,
|
|
70
|
+
fields: [
|
|
71
|
+
{
|
|
72
|
+
type: 'row',
|
|
73
|
+
content: [
|
|
74
|
+
{
|
|
75
|
+
header: 'Product Name',
|
|
76
|
+
field: 'productName',
|
|
77
|
+
type: 'string',
|
|
78
|
+
style: '-webkit-line-clamp: 2;'
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{ type: 'row', content: [{ header: 'SKU No.', field: 'productSku', type: 'string' }] },
|
|
83
|
+
{
|
|
84
|
+
type: 'row',
|
|
85
|
+
content: [
|
|
86
|
+
{ header: 'Exp Date', field: 'expirationDate', type: 'string' },
|
|
87
|
+
{ header: 'Batch No.', field: 'relatedOrderInv.batchId', type: 'string' }
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{ type: 'row', content: [{ header: 'Packing Type', field: 'relatedOrderInv.packingType', type: 'string' }] }
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
columnRight: {
|
|
94
|
+
size: 4,
|
|
95
|
+
fields: [
|
|
96
|
+
{
|
|
97
|
+
type: 'row',
|
|
98
|
+
content: [{ header: 'Total Qty.', field: 'sortedQty', type: 'string' }]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'editableValueBox',
|
|
102
|
+
content: { header: 'Return Qty.', field: 'returnQty', type: 'string' }
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
get dirtyData() {
|
|
110
|
+
return this.shadowRoot.querySelector('product-list-view').data
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get returnData() {
|
|
114
|
+
return this.shadowRoot.querySelector('product-list-view')
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
render() {
|
|
118
|
+
return html`
|
|
119
|
+
<!-- Content Section -->
|
|
120
|
+
<div class="tab-info text-center">
|
|
121
|
+
<label class="text-14 font-bold"> Total SKU: ${this._getTotalSku()}</label>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="content">
|
|
124
|
+
<product-list-view .config=${this.returnConfig} .data=${this._data}></product-list-view>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="button-container">
|
|
127
|
+
<mwc-button raised @click=${e => this.confirm(e)}>${i18next.t('button.confirm')}</mwc-button>
|
|
128
|
+
<mwc-button outlined @click=${e => this.closePopup(e)}>${i18next.t('button.back')}</mwc-button>
|
|
129
|
+
</div>
|
|
130
|
+
<!-- Content Section End -->
|
|
131
|
+
`
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async confirm(e) {
|
|
135
|
+
try {
|
|
136
|
+
const result = await CustomAlert({
|
|
137
|
+
title: i18next.t('title.are_you_sure'),
|
|
138
|
+
text: i18next.t('text.proceed_with_warehouse_return'),
|
|
139
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
140
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
if (result.value) {
|
|
144
|
+
let updatedData = this.dirtyData.map(data => {
|
|
145
|
+
const qty = Number(data.returnQty)
|
|
146
|
+
if (isNaN(qty) || qty <= 0) {
|
|
147
|
+
throw new Error(
|
|
148
|
+
`Oops! Invalid quantity. Please enter a number greater than 0.`
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
...data,
|
|
153
|
+
returnQty: data.returnQty
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
let returnData = updatedData.filter(data => this.returnData.selectedItems.includes(data.id))
|
|
158
|
+
|
|
159
|
+
if (returnData.length < 1) returnData = updatedData
|
|
160
|
+
|
|
161
|
+
const response = await client.mutate({
|
|
162
|
+
mutation: gql`
|
|
163
|
+
mutation warehouseReturn($releaseGoodNo: String!, $worksheetDetails: [Object!]) {
|
|
164
|
+
warehouseReturn(releaseGoodNo: $releaseGoodNo, worksheetDetails: $worksheetDetails) {
|
|
165
|
+
id
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`,
|
|
169
|
+
variables: {
|
|
170
|
+
releaseGoodNo: this._releaseGoodNo,
|
|
171
|
+
worksheetDetails: returnData
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
if (!response.errors) {
|
|
176
|
+
this.dispatchEvent(new CustomEvent('warehouse-return', { detail: { success: true } }))
|
|
177
|
+
history.back()
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
} catch (e) {
|
|
181
|
+
showToast(e)
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
_getTotalSku() {
|
|
186
|
+
return this._data.length || 0
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async closePopup(e) {
|
|
190
|
+
history.back()
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
window.customElements.define('warehouse-return-popup', WarehouseReturnPopup)
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
3
|
+
import { client, CustomAlert } from '@things-factory/shell'
|
|
4
|
+
import { css, html, LitElement } from 'lit-element'
|
|
5
|
+
import { SingleColumnFormStyles } from '@things-factory/form-ui'
|
|
6
|
+
import { showToast } from '../../../util'
|
|
7
|
+
|
|
8
|
+
class IssueDetailsPopup extends localize(i18next)(LitElement) {
|
|
9
|
+
static get properties() {
|
|
10
|
+
return {
|
|
11
|
+
data: Object
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static get styles() {
|
|
16
|
+
return [
|
|
17
|
+
SingleColumnFormStyles,
|
|
18
|
+
css`
|
|
19
|
+
:host {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
background-color: var(--main-section-background-color);
|
|
24
|
+
}
|
|
25
|
+
.color-teal {
|
|
26
|
+
color: #007e7f;
|
|
27
|
+
}
|
|
28
|
+
.font-bold {
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
}
|
|
31
|
+
.container {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
width: auto;
|
|
35
|
+
margin: 20px;
|
|
36
|
+
height: 100vh;
|
|
37
|
+
}
|
|
38
|
+
.button-container {
|
|
39
|
+
justify-self: center;
|
|
40
|
+
}
|
|
41
|
+
.title {
|
|
42
|
+
grid-column: span 3;
|
|
43
|
+
font-size: 12px;
|
|
44
|
+
color: #3a5877;
|
|
45
|
+
align-self: start;
|
|
46
|
+
}
|
|
47
|
+
.description {
|
|
48
|
+
grid-column: span 9;
|
|
49
|
+
display: -webkit-box;
|
|
50
|
+
-webkit-line-clamp: 2;
|
|
51
|
+
-webkit-box-orient: vertical;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
color: #3a5877;
|
|
55
|
+
align-self: start;
|
|
56
|
+
}
|
|
57
|
+
.text-left {
|
|
58
|
+
text-align: left !important;
|
|
59
|
+
}
|
|
60
|
+
.mt-5px {
|
|
61
|
+
margin-top: 5px;
|
|
62
|
+
}
|
|
63
|
+
.info {
|
|
64
|
+
display: grid;
|
|
65
|
+
grid-template-columns: repeat(12, 1fr);
|
|
66
|
+
grid-gap: 8px;
|
|
67
|
+
color: #3a5877;
|
|
68
|
+
padding: 0 0 12px 0;
|
|
69
|
+
margin: 0 0 12px 0;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
}
|
|
72
|
+
.info input,
|
|
73
|
+
.info textarea {
|
|
74
|
+
grid-column: span 12;
|
|
75
|
+
}
|
|
76
|
+
.info label {
|
|
77
|
+
text-transform: capitalize;
|
|
78
|
+
}
|
|
79
|
+
[danger] {
|
|
80
|
+
--mdc-theme-primary: var(--mdc-danger-button-primary-color);
|
|
81
|
+
}
|
|
82
|
+
[raised] {
|
|
83
|
+
width: 100%;
|
|
84
|
+
margin-top: 10px;
|
|
85
|
+
}
|
|
86
|
+
[back-button] {
|
|
87
|
+
--mdc-theme-primary: var(--main-section-background-color);
|
|
88
|
+
border: solid 1px #007e7f;
|
|
89
|
+
border-radius: 4px;
|
|
90
|
+
}
|
|
91
|
+
`
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
render() {
|
|
96
|
+
return html`
|
|
97
|
+
<div class="container">
|
|
98
|
+
<div class="info">
|
|
99
|
+
<label class="title font-bold">SKU No.</label>
|
|
100
|
+
<label class="description">: ${this.data.inventory.product.sku}</label>
|
|
101
|
+
<label class="mt-5px text-left title font-bold">${i18next.t('label.issue_type')}</label>
|
|
102
|
+
<input name="issue" readonly value=${this.data.transactionType} />
|
|
103
|
+
<label class="mt-5px text-left title font-bold">${i18next.t('label.details')} (Optional)</label>
|
|
104
|
+
<textarea name="details" rows="12" readonly>${this.data.details}</textarea>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="button-container">
|
|
107
|
+
${this.data.status === 'PENDING'
|
|
108
|
+
? html`<mwc-button
|
|
109
|
+
raised
|
|
110
|
+
danger
|
|
111
|
+
@click="${e => {
|
|
112
|
+
this._cancelIssue(e)
|
|
113
|
+
}}"
|
|
114
|
+
label="${i18next.t('button.cancel')}"
|
|
115
|
+
></mwc-button>`
|
|
116
|
+
: ''}
|
|
117
|
+
<mwc-button
|
|
118
|
+
raised
|
|
119
|
+
back-button
|
|
120
|
+
@click="${e => {
|
|
121
|
+
this._back(e)
|
|
122
|
+
}}"
|
|
123
|
+
><label class="color-teal">${i18next.t('button.back')}</label></mwc-button
|
|
124
|
+
>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
`
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async _cancelIssue(e) {
|
|
131
|
+
try {
|
|
132
|
+
const result = await CustomAlert({
|
|
133
|
+
title: i18next.t('title.are_you_sure'),
|
|
134
|
+
text: i18next.t('text.proceed_cancel'),
|
|
135
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
136
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
if (result.value) {
|
|
140
|
+
const response = await client.mutate({
|
|
141
|
+
mutation: gql`
|
|
142
|
+
mutation cancelInventoryChanges($inventoryChangeId: String!) {
|
|
143
|
+
cancelInventoryChanges(inventoryChangeId: $inventoryChangeId)
|
|
144
|
+
}
|
|
145
|
+
`,
|
|
146
|
+
variables: { inventoryChangeId: this.data.id }
|
|
147
|
+
})
|
|
148
|
+
if (!response.error) {
|
|
149
|
+
showToast({type: 'success', message: 'Issue cancelled succesfully'})
|
|
150
|
+
this.dispatchEvent(new CustomEvent('submit', { detail: this.data.id }))
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {
|
|
154
|
+
showToast(e)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
_back(e) {
|
|
159
|
+
history.back()
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
window.customElements.define('issue-details-popup', IssueDetailsPopup)
|