@things-factory/operato-wms 4.3.324 → 4.3.326
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/order/release-order/create-release-order.js +55 -51
- package/client/pages/order/release-order/release-order-detail.js +31 -74
- package/client/pages/order/vas-order/popup/vas-create-popup.js +1 -1
- package/client/pages/order/vas-order/popup/vas-target-product-popup.js +1 -1
- package/dist-server/graphql/resolvers/reports/shortage-report.js +1 -1
- package/package.json +4 -4
- package/server/graphql/resolvers/reports/shortage-report.ts +1 -1
|
@@ -1228,7 +1228,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
1228
1228
|
name: 'remark',
|
|
1229
1229
|
header: i18next.t('field.remark'),
|
|
1230
1230
|
record: { editable: true },
|
|
1231
|
-
width:
|
|
1231
|
+
width: 400
|
|
1232
1232
|
}
|
|
1233
1233
|
]
|
|
1234
1234
|
}
|
|
@@ -2298,12 +2298,14 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
2298
2298
|
mutation: gql`
|
|
2299
2299
|
mutation (
|
|
2300
2300
|
$releaseGood: NewReleaseGood
|
|
2301
|
+
$orderVasPatch: [OrderVasPatch!]!
|
|
2301
2302
|
$shippingOrder: ShippingOrderPatch
|
|
2302
2303
|
$shippingOrderInfo: ShippingOrderInfoPatch
|
|
2303
2304
|
$attachments: [Upload!]
|
|
2304
2305
|
) {
|
|
2305
2306
|
generateReleaseGood(
|
|
2306
2307
|
releaseGood: $releaseGood
|
|
2308
|
+
orderVasPatch: $orderVasPatch
|
|
2307
2309
|
shippingOrder: $shippingOrder
|
|
2308
2310
|
shippingOrderInfo: $shippingOrderInfo
|
|
2309
2311
|
attachments: $attachments
|
|
@@ -2318,9 +2320,9 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
2318
2320
|
...releaseGood,
|
|
2319
2321
|
partnerBizplaceId: this._bizplaceId
|
|
2320
2322
|
},
|
|
2323
|
+
orderVasPatch: await this.getVasOrderPatch(),
|
|
2321
2324
|
shippingOrder: this._exportOption ? this._serializeForm(this.exportInfoForm) : null,
|
|
2322
2325
|
shippingOrderInfo: shippingOrderInfo ? shippingOrderInfo : null,
|
|
2323
|
-
orderVas: null,
|
|
2324
2326
|
attachments: this._document?.files ? this._document.files : undefined
|
|
2325
2327
|
},
|
|
2326
2328
|
context: { hasUpload: true }
|
|
@@ -2337,7 +2339,7 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
2337
2339
|
this._recallInput.checked = false
|
|
2338
2340
|
|
|
2339
2341
|
// create order Vas
|
|
2340
|
-
await this.createVasOrder(response.data.generateReleaseGood)
|
|
2342
|
+
//await this.createVasOrder(response.data.generateReleaseGood)
|
|
2341
2343
|
// await this.createOrderVas(response.data.generateReleaseGood)
|
|
2342
2344
|
|
|
2343
2345
|
navigate(`release_order_detail/${response.data.generateReleaseGood.name}`)
|
|
@@ -2375,57 +2377,59 @@ class CreateReleaseOrder extends localize(i18next)(PageView) {
|
|
|
2375
2377
|
}
|
|
2376
2378
|
}
|
|
2377
2379
|
|
|
2378
|
-
async
|
|
2380
|
+
async getVasOrderPatch() {
|
|
2379
2381
|
let orderVasPatch = []
|
|
2380
|
-
orderVasPatch = this.vasGrist.dirtyData.records
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
}
|
|
2413
|
-
})
|
|
2414
|
-
|
|
2415
|
-
const response = await client.mutate({
|
|
2416
|
-
mutation: gql`
|
|
2417
|
-
mutation editVas($orderVasPatch: [OrderVasPatch], $orderVasItemPatch: [OrderVasItemPatch], $orderNo: String) {
|
|
2418
|
-
editVas(orderVasPatch: $orderVasPatch, orderVasItemPatch: $orderVasItemPatch, orderNo: $orderNo)
|
|
2382
|
+
orderVasPatch = this.vasGrist.dirtyData.records
|
|
2383
|
+
.filter(p => p.product)
|
|
2384
|
+
.map(ov => {
|
|
2385
|
+
return {
|
|
2386
|
+
bizplace: { id: this._bizplaceId },
|
|
2387
|
+
batchId: ov.batchId,
|
|
2388
|
+
qty: ov.qty,
|
|
2389
|
+
product: { id: ov.product.id, name: ov.product.name },
|
|
2390
|
+
name: `${ov.batchId} (${ov.sku})- ${new Date().toISOString()}`,
|
|
2391
|
+
productName: ov.productName,
|
|
2392
|
+
productDetail: ov.productDetail
|
|
2393
|
+
? { id: ov.productDetail.id, name: ov.productDetail.name }
|
|
2394
|
+
: { id: ov.productDetailId },
|
|
2395
|
+
status: 'PENDING',
|
|
2396
|
+
packingType: ov.packingType,
|
|
2397
|
+
uom: ov.uom,
|
|
2398
|
+
uomValue: ov.uomValue,
|
|
2399
|
+
newProduct: ov.newProductId,
|
|
2400
|
+
newProductDetail: ov.newProductDetailId,
|
|
2401
|
+
newPackingType: ov.newPackingType,
|
|
2402
|
+
newUom: ov.newUom,
|
|
2403
|
+
newUomValue: ov.newUomValue,
|
|
2404
|
+
outputQty: ov.outputQty ? ov.outputQty : ov.qty,
|
|
2405
|
+
remark: ov.remark,
|
|
2406
|
+
orderVasItemsPatch: this.vasGrist.dirtyData.records.reduce((acc, cur) => {
|
|
2407
|
+
if (cur.vasGristId === ov.vasGristId) {
|
|
2408
|
+
return [...acc, { vas: { id: cur.vas.id, name: cur.vas.name }, vasQty: cur.vasQty, cuFlag: '+' }]
|
|
2409
|
+
} else {
|
|
2410
|
+
return acc
|
|
2411
|
+
}
|
|
2412
|
+
}, []),
|
|
2413
|
+
cuFlag: '+'
|
|
2419
2414
|
}
|
|
2420
|
-
|
|
2421
|
-
variables: {
|
|
2422
|
-
orderVasPatch: orderVasPatch,
|
|
2423
|
-
orderNo: releaseGood.name
|
|
2424
|
-
}
|
|
2425
|
-
})
|
|
2415
|
+
})
|
|
2426
2416
|
|
|
2427
|
-
|
|
2428
|
-
|
|
2417
|
+
return orderVasPatch
|
|
2418
|
+
|
|
2419
|
+
// const response = await client.mutate({
|
|
2420
|
+
// mutation: gql`
|
|
2421
|
+
// mutation editVas($orderVasPatch: [OrderVasPatch], $orderVasItemPatch: [OrderVasItemPatch], $orderNo: String) {
|
|
2422
|
+
// editVas(orderVasPatch: $orderVasPatch, orderVasItemPatch: $orderVasItemPatch, orderNo: $orderNo)
|
|
2423
|
+
// }
|
|
2424
|
+
// `,
|
|
2425
|
+
// variables: {
|
|
2426
|
+
// orderVasPatch: orderVasPatch,
|
|
2427
|
+
// orderNo: releaseGood.name
|
|
2428
|
+
// }
|
|
2429
|
+
// })
|
|
2430
|
+
|
|
2431
|
+
// if (!response.errors) {
|
|
2432
|
+
// }
|
|
2429
2433
|
}
|
|
2430
2434
|
|
|
2431
2435
|
async _executeRelatedTrxs() {
|
|
@@ -12,26 +12,14 @@ import '../../order/vas-order/popup/vas-target-product-popup'
|
|
|
12
12
|
import '../../order/vas-order/popup/select-vas-popup'
|
|
13
13
|
|
|
14
14
|
import gql from 'graphql-tag'
|
|
15
|
-
import {
|
|
16
|
-
css,
|
|
17
|
-
html
|
|
18
|
-
} from 'lit-element'
|
|
15
|
+
import { css, html } from 'lit-element'
|
|
19
16
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
20
17
|
|
|
21
18
|
import { getCodeByName } from '@things-factory/code-base'
|
|
22
19
|
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
23
|
-
import {
|
|
24
|
-
i18next,
|
|
25
|
-
localize
|
|
26
|
-
} from '@things-factory/i18n-base'
|
|
20
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
27
21
|
import { openPopup } from '@things-factory/layout-base'
|
|
28
|
-
import {
|
|
29
|
-
client,
|
|
30
|
-
CustomAlert,
|
|
31
|
-
navigate,
|
|
32
|
-
PageView,
|
|
33
|
-
store
|
|
34
|
-
} from '@things-factory/shell'
|
|
22
|
+
import { client, CustomAlert, navigate, PageView, store } from '@things-factory/shell'
|
|
35
23
|
import { CommonButtonStyles } from '@things-factory/styles'
|
|
36
24
|
import { isMobileDevice } from '@things-factory/utils'
|
|
37
25
|
|
|
@@ -947,7 +935,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
947
935
|
]
|
|
948
936
|
|
|
949
937
|
if (cancelOrderStatus.indexOf(this._status) >= 0) {
|
|
950
|
-
if ((this.vasData?.records?.length > 0 && this._status !== 'LOADING')|| this.vasData?.records?.length == 0) {
|
|
938
|
+
if ((this.vasData?.records?.length > 0 && this._status !== 'LOADING') || this.vasData?.records?.length == 0) {
|
|
951
939
|
actions.push({
|
|
952
940
|
title: i18next.t('button.cancel_order'),
|
|
953
941
|
action: this._submitCancellationReleaseOrder.bind(this),
|
|
@@ -1342,7 +1330,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1342
1330
|
name: 'remark',
|
|
1343
1331
|
header: i18next.t('field.remark'),
|
|
1344
1332
|
record: { editable: true },
|
|
1345
|
-
width:
|
|
1333
|
+
width: 400
|
|
1346
1334
|
}
|
|
1347
1335
|
]
|
|
1348
1336
|
}
|
|
@@ -2178,13 +2166,10 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
2178
2166
|
status: record.status,
|
|
2179
2167
|
cuFlag: 'M',
|
|
2180
2168
|
__dirty__: 'M',
|
|
2181
|
-
__dirtyfields__:
|
|
2182
|
-
record.
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
productSKU: { before: record.productSKU, after: d.productSKU }
|
|
2186
|
-
// qty: { before: record.qty, after: d.qty }
|
|
2187
|
-
}
|
|
2169
|
+
__dirtyfields__: {
|
|
2170
|
+
productSKU: { before: record.productSKU, after: d.productSKU }
|
|
2171
|
+
// qty: { before: record.qty, after: d.qty }
|
|
2172
|
+
}
|
|
2188
2173
|
|
|
2189
2174
|
// group: ++group
|
|
2190
2175
|
}
|
|
@@ -2242,10 +2227,7 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
2242
2227
|
newProductDetailId: e.detail.productDetailId,
|
|
2243
2228
|
cuFlag: 'M',
|
|
2244
2229
|
__dirty__: 'M',
|
|
2245
|
-
__dirtyfields__:
|
|
2246
|
-
record.__dirtyfields__ !== {}
|
|
2247
|
-
? { ...record.__dirtyfields__, newSku: { before: record.newSku, after: e.detail.product.sku } }
|
|
2248
|
-
: { newSku: { before: record.newSku, after: e.detail.product.sku } }
|
|
2230
|
+
__dirtyfields__: { newSku: { before: record.newSku, after: e.detail.product.sku } }
|
|
2249
2231
|
}
|
|
2250
2232
|
// for (let i = 0; i < e.detail.multipleProducts.length; i++) {
|
|
2251
2233
|
// newRecords.push(e.detail.multipleProducts[i])
|
|
@@ -2322,31 +2304,17 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
2322
2304
|
vasQty: this.vasGrist.dirtyData.records[firstIndex].qty,
|
|
2323
2305
|
cuFlag: '+',
|
|
2324
2306
|
__dirty__: '+',
|
|
2325
|
-
__dirtyfields__:
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
after: this.vasGrist.dirtyData.records[firstIndex].qty
|
|
2337
|
-
}
|
|
2338
|
-
}
|
|
2339
|
-
: {
|
|
2340
|
-
productSKU: {
|
|
2341
|
-
before: this.vasGrist.dirtyData.records[firstIndex].productSKU,
|
|
2342
|
-
after: e.detail[i].productSKU
|
|
2343
|
-
},
|
|
2344
|
-
vas: { before: this.vasGrist.dirtyData.records[firstIndex].vas, after: e.detail[i] },
|
|
2345
|
-
vasQty: {
|
|
2346
|
-
before: 0,
|
|
2347
|
-
after: this.vasGrist.dirtyData.records[firstIndex].qty
|
|
2348
|
-
}
|
|
2349
|
-
}
|
|
2307
|
+
__dirtyfields__: {
|
|
2308
|
+
productSKU: {
|
|
2309
|
+
before: this.vasGrist.dirtyData.records[firstIndex].productSKU,
|
|
2310
|
+
after: e.detail[i].productSKU
|
|
2311
|
+
},
|
|
2312
|
+
vas: { before: this.vasGrist.dirtyData.records[firstIndex].vas, after: e.detail[i] },
|
|
2313
|
+
vasQty: {
|
|
2314
|
+
before: 0,
|
|
2315
|
+
after: this.vasGrist.dirtyData.records[firstIndex].qty
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2350
2318
|
})
|
|
2351
2319
|
} else {
|
|
2352
2320
|
newRecords.push({
|
|
@@ -2359,23 +2327,13 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
2359
2327
|
},
|
|
2360
2328
|
cuFlag: '+',
|
|
2361
2329
|
__dirty__: '+',
|
|
2362
|
-
__dirtyfields__:
|
|
2363
|
-
this.vasGrist.dirtyData.records[firstIndex].
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
after: this.vasGrist.dirtyData.records[firstIndex].qty
|
|
2370
|
-
}
|
|
2371
|
-
}
|
|
2372
|
-
: {
|
|
2373
|
-
vas: { before: this.vasGrist.dirtyData.records[firstIndex].vas, after: e.detail[i] },
|
|
2374
|
-
vasQty: {
|
|
2375
|
-
before: 0,
|
|
2376
|
-
after: this.vasGrist.dirtyData.records[firstIndex].qty
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2330
|
+
__dirtyfields__: {
|
|
2331
|
+
vas: { before: this.vasGrist.dirtyData.records[firstIndex].vas, after: e.detail[i] },
|
|
2332
|
+
vasQty: {
|
|
2333
|
+
before: 0,
|
|
2334
|
+
after: this.vasGrist.dirtyData.records[firstIndex].qty
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2379
2337
|
})
|
|
2380
2338
|
}
|
|
2381
2339
|
}
|
|
@@ -3173,14 +3131,13 @@ class ReleaseOrderDetail extends connect(store)(localize(i18next)(PageView)) {
|
|
|
3173
3131
|
|
|
3174
3132
|
const response = await client.mutate({
|
|
3175
3133
|
mutation: gql`
|
|
3176
|
-
mutation editVas($orderVasPatch: [OrderVasPatch]
|
|
3177
|
-
editVas(orderVasPatch: $orderVasPatch, orderVasItemPatch: $orderVasItemPatch
|
|
3134
|
+
mutation editVas($orderVasPatch: [OrderVasPatch!]!, $orderVasItemPatch: [OrderVasItemPatch!]) {
|
|
3135
|
+
editVas(orderVasPatch: $orderVasPatch, orderVasItemPatch: $orderVasItemPatch)
|
|
3178
3136
|
}
|
|
3179
3137
|
`,
|
|
3180
3138
|
variables: {
|
|
3181
3139
|
orderVasPatch: orderVasPatch,
|
|
3182
|
-
orderVasItemPatch: orderVasItemPatch
|
|
3183
|
-
orderNo: this._releaseOrderNo
|
|
3140
|
+
orderVasItemPatch: orderVasItemPatch
|
|
3184
3141
|
}
|
|
3185
3142
|
})
|
|
3186
3143
|
|
|
@@ -70,7 +70,7 @@ exports.shortageReport = {
|
|
|
70
70
|
on op.product_id = src.product_id
|
|
71
71
|
where drg.status = 'DRAFT'
|
|
72
72
|
and drg.domain_id = $1
|
|
73
|
-
and coalesce(src.av_qty - op.release_qty,0)
|
|
73
|
+
and coalesce(src.av_qty - op.release_qty,0) <= 0
|
|
74
74
|
and drg.created_at >= $2
|
|
75
75
|
and drg.created_at <= $3
|
|
76
76
|
${roFilter}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-wms",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.326",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@things-factory/print-ui": "^4.3.281",
|
|
92
92
|
"@things-factory/product-base": "^4.3.318",
|
|
93
93
|
"@things-factory/resource-ui": "^4.3.281",
|
|
94
|
-
"@things-factory/sales-ui": "^4.3.
|
|
94
|
+
"@things-factory/sales-ui": "^4.3.326",
|
|
95
95
|
"@things-factory/scene-data-transform": "^4.3.281",
|
|
96
96
|
"@things-factory/scene-excel": "^4.3.281",
|
|
97
97
|
"@things-factory/scene-firebase": "^4.3.281",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@things-factory/transport-base": "^4.3.301",
|
|
109
109
|
"@things-factory/tutorial-ui": "^4.3.281",
|
|
110
110
|
"@things-factory/warehouse-base": "^4.3.318",
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.326"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@things-factory/builder": "^4.3.281",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"cypress-localstorage-commands": "^1.6.1",
|
|
118
118
|
"eslint-plugin-cypress": "^2.12.1"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "9cf676447c169fe7bff053c193ed30962ad177cc"
|
|
121
121
|
}
|
|
@@ -80,7 +80,7 @@ export const shortageReport = {
|
|
|
80
80
|
on op.product_id = src.product_id
|
|
81
81
|
where drg.status = 'DRAFT'
|
|
82
82
|
and drg.domain_id = $1
|
|
83
|
-
and coalesce(src.av_qty - op.release_qty,0)
|
|
83
|
+
and coalesce(src.av_qty - op.release_qty,0) <= 0
|
|
84
84
|
and drg.created_at >= $2
|
|
85
85
|
and drg.created_at <= $3
|
|
86
86
|
${roFilter}
|