@axelor/aos-mobile-manufacturing 6.4.2 → 6.5.1
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/README.md +5 -0
- package/lib/api/machine-api.js +6 -26
- package/lib/api/machine-api.js.map +1 -1
- package/lib/api/manufacturing-order-api.js +74 -142
- package/lib/api/manufacturing-order-api.js.map +1 -1
- package/lib/api/operation-order-api.js +90 -120
- package/lib/api/operation-order-api.js.map +1 -1
- package/lib/api/production-file-api.js +7 -19
- package/lib/api/production-file-api.js.map +1 -1
- package/lib/api/waste-product-api.js +18 -22
- package/lib/api/waste-product-api.js.map +1 -1
- package/lib/api/work-center-api.js +6 -26
- package/lib/api/work-center-api.js.map +1 -1
- package/lib/hooks/use-manufacturing-headers.d.ts +1 -0
- package/lib/hooks/use-manufacturing-headers.js +84 -0
- package/lib/hooks/use-manufacturing-headers.js.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/lib/models/index.d.ts +3 -0
- package/lib/models/index.js +21 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/objectFields.d.ts +2 -0
- package/lib/models/objectFields.js +88 -0
- package/lib/models/objectFields.js.map +1 -0
- package/lib/models/searchFields.d.ts +2 -0
- package/lib/models/searchFields.js +24 -0
- package/lib/models/searchFields.js.map +1 -0
- package/lib/models/sortFields.d.ts +2 -0
- package/lib/models/sortFields.js +37 -0
- package/lib/models/sortFields.js.map +1 -0
- package/lib/screens/manufactoringOrder/ManufacturingOrderDetailsScreen.js +1 -7
- package/lib/screens/manufactoringOrder/ManufacturingOrderDetailsScreen.js.map +1 -1
- package/lib/screens/manufactoringOrder/index.d.ts +2 -0
- package/lib/screens/manufactoringOrder/index.js +1 -0
- package/lib/screens/manufactoringOrder/index.js.map +1 -1
- package/lib/screens/manufactoringOrder/producedProduct/ProducedProductListScreen.js +0 -9
- package/lib/screens/manufactoringOrder/producedProduct/ProducedProductListScreen.js.map +1 -1
- package/lib/screens/manufactoringOrder/producedProduct/index.d.ts +1 -0
- package/lib/screens/manufactoringOrder/producedProduct/index.js +1 -0
- package/lib/screens/manufactoringOrder/producedProduct/index.js.map +1 -1
- package/lib/screens/operationOrder/OperationOrderDetailsScreen.js +2 -13
- package/lib/screens/operationOrder/OperationOrderDetailsScreen.js.map +1 -1
- package/lib/screens/operationOrder/index.d.ts +1 -0
- package/lib/screens/operationOrder/index.js +1 -0
- package/lib/screens/operationOrder/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
package/lib/api/machine-api.js
CHANGED
|
@@ -15,33 +15,13 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
const machineFields = ['code', 'name'];
|
|
20
|
-
const createMachineCriteria = searchValue => {
|
|
21
|
-
let criterias = [];
|
|
22
|
-
if (searchValue != null) {
|
|
23
|
-
criterias.push({
|
|
24
|
-
fieldName: 'name',
|
|
25
|
-
operator: 'like',
|
|
26
|
-
value: searchValue,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return criterias;
|
|
30
|
-
};
|
|
18
|
+
import { createStandardSearch, getSearchCriterias, } from '@axelor/aos-mobile-core';
|
|
31
19
|
export async function searchMachineFilter({ searchValue = null }) {
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
operator: 'and',
|
|
39
|
-
criteria: createMachineCriteria(searchValue),
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
fields: machineFields,
|
|
44
|
-
},
|
|
20
|
+
return createStandardSearch({
|
|
21
|
+
model: 'com.axelor.apps.production.db.Machine',
|
|
22
|
+
criteria: [getSearchCriterias('manufacturing_machine', searchValue)],
|
|
23
|
+
fieldKey: 'manufacturing_machine',
|
|
24
|
+
page: 0,
|
|
45
25
|
});
|
|
46
26
|
}
|
|
47
27
|
//# sourceMappingURL=machine-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine-api.js","sourceRoot":"","sources":["../../src/api/machine-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"machine-api.js","sourceRoot":"","sources":["../../src/api/machine-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EAAC,WAAW,GAAG,IAAI,EAAC;IAC5D,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,uCAAuC;QAC9C,QAAQ,EAAE,CAAC,kBAAkB,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC;QACpE,QAAQ,EAAE,uBAAuB;QACjC,IAAI,EAAE,CAAC;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -15,65 +15,42 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { axiosApiProvider } from '@axelor/aos-mobile-core';
|
|
18
|
+
import { axiosApiProvider, createStandardFetch, createStandardSearch, getSearchCriterias, } from '@axelor/aos-mobile-core';
|
|
19
19
|
import ManufacturingOrder from '../types/manufacturing-order';
|
|
20
|
-
const manufacturingOrderFields = [
|
|
21
|
-
'id',
|
|
22
|
-
'manufOrderSeq',
|
|
23
|
-
'statusSelect',
|
|
24
|
-
'prioritySelect',
|
|
25
|
-
'product',
|
|
26
|
-
'qty',
|
|
27
|
-
'unit',
|
|
28
|
-
'clientPartner',
|
|
29
|
-
'saleOrderSet',
|
|
30
|
-
'toConsumeProdProductList',
|
|
31
|
-
'note',
|
|
32
|
-
'moCommentFromSaleOrder',
|
|
33
|
-
'moCommentFromSaleOrderLine',
|
|
34
|
-
'parentMO',
|
|
35
|
-
'wasteProdProductList',
|
|
36
|
-
'wasteStockMove',
|
|
37
|
-
'productionOrderSet',
|
|
38
|
-
'company',
|
|
39
|
-
];
|
|
40
|
-
const sortByFields = [
|
|
41
|
-
'statusSelect',
|
|
42
|
-
'-realStartDateT',
|
|
43
|
-
'plannedStartDateT',
|
|
44
|
-
'manufOrderSeq',
|
|
45
|
-
];
|
|
46
20
|
const createManufOrderCriteria = (companyId, workshopId, searchValue) => {
|
|
47
|
-
let criterias = [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
21
|
+
let criterias = [
|
|
22
|
+
{
|
|
23
|
+
fieldName: 'typeSelect',
|
|
24
|
+
operator: '=',
|
|
25
|
+
value: ManufacturingOrder.type.production,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
operator: 'OR',
|
|
29
|
+
criteria: [
|
|
30
|
+
{
|
|
31
|
+
fieldName: 'statusSelect',
|
|
32
|
+
operator: '=',
|
|
33
|
+
value: ManufacturingOrder.status.Planned,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
fieldName: 'statusSelect',
|
|
37
|
+
operator: '=',
|
|
38
|
+
value: ManufacturingOrder.status.InProgress,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
fieldName: 'statusSelect',
|
|
42
|
+
operator: '=',
|
|
43
|
+
value: ManufacturingOrder.status.StandBy,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
fieldName: 'statusSelect',
|
|
47
|
+
operator: '=',
|
|
48
|
+
value: ManufacturingOrder.status.Finished,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
getSearchCriterias('manufacturing_manufacturingOrder', searchValue),
|
|
53
|
+
];
|
|
77
54
|
if (companyId != null) {
|
|
78
55
|
criterias.push({
|
|
79
56
|
fieldName: 'company.id',
|
|
@@ -81,13 +58,6 @@ const createManufOrderCriteria = (companyId, workshopId, searchValue) => {
|
|
|
81
58
|
value: companyId,
|
|
82
59
|
});
|
|
83
60
|
}
|
|
84
|
-
if (searchValue != null) {
|
|
85
|
-
criterias.push({
|
|
86
|
-
fieldName: 'manufOrderSeq',
|
|
87
|
-
operator: 'like',
|
|
88
|
-
value: searchValue,
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
61
|
if (workshopId != null) {
|
|
92
62
|
criterias.push({
|
|
93
63
|
operator: 'or',
|
|
@@ -108,63 +78,40 @@ const createManufOrderCriteria = (companyId, workshopId, searchValue) => {
|
|
|
108
78
|
return criterias;
|
|
109
79
|
};
|
|
110
80
|
export async function searchManufacturingOrderFilter({ companyId = null, workshopId = null, searchValue = null, page = 0, }) {
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
operator: 'and',
|
|
118
|
-
criteria: createManufOrderCriteria(companyId, workshopId, searchValue),
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
fields: manufacturingOrderFields,
|
|
123
|
-
sortBy: sortByFields,
|
|
124
|
-
limit: 10,
|
|
125
|
-
offset: 10 * page,
|
|
126
|
-
},
|
|
81
|
+
return createStandardSearch({
|
|
82
|
+
model: 'com.axelor.apps.production.db.ManufOrder',
|
|
83
|
+
criteria: createManufOrderCriteria(companyId, workshopId, searchValue),
|
|
84
|
+
fieldKey: 'manufacturing_manufacturingOrder',
|
|
85
|
+
sortKey: 'manufacturing_manufacturingOrder',
|
|
86
|
+
page,
|
|
127
87
|
});
|
|
128
88
|
}
|
|
129
89
|
export async function fetchManufacturingOrder({ manufOrderId }) {
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
},
|
|
90
|
+
return createStandardFetch({
|
|
91
|
+
model: 'com.axelor.apps.production.db.ManufOrder',
|
|
92
|
+
id: manufOrderId,
|
|
93
|
+
fieldKey: 'manufacturing_manufacturingOrder',
|
|
94
|
+
relatedFields: { product: ['name', 'code', 'picture'] },
|
|
136
95
|
});
|
|
137
96
|
}
|
|
138
97
|
export async function fetchManufacturingOrderOfProductionOrder({ productionOrderList, page = 0, }) {
|
|
139
98
|
if (productionOrderList == null) {
|
|
140
99
|
return null;
|
|
141
100
|
}
|
|
142
|
-
return
|
|
143
|
-
.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
_domain: 'self.id IN :productionOrderIds',
|
|
148
|
-
_domainContext: {
|
|
149
|
-
productionOrderIds: productionOrderList.map(productionOrder => productionOrder.id),
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
fields: ['id', 'manufOrderSet'],
|
|
101
|
+
return createStandardSearch({
|
|
102
|
+
model: 'com.axelor.apps.production.db.ProductionOrder',
|
|
103
|
+
domain: 'self.id IN :productionOrderIds',
|
|
104
|
+
domainContext: {
|
|
105
|
+
productionOrderIds: productionOrderList.map(productionOrder => productionOrder.id),
|
|
153
106
|
},
|
|
107
|
+
fieldKey: 'manufacturing_productionOrder',
|
|
108
|
+
page: 0,
|
|
109
|
+
limit: null,
|
|
154
110
|
})
|
|
155
111
|
.then(res => {
|
|
156
112
|
const result = res?.data?.data;
|
|
157
|
-
const manufOrderList = result
|
|
158
|
-
|
|
159
|
-
?.flat(1);
|
|
160
|
-
if (manufOrderList == null) {
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
const manufOrderIds = [];
|
|
164
|
-
manufOrderList.forEach(manufOrder => {
|
|
165
|
-
manufOrderIds.push(manufOrder.id);
|
|
166
|
-
});
|
|
167
|
-
return manufOrderIds;
|
|
113
|
+
const manufOrderList = result?.flatMap(productionOrder => productionOrder?.manufOrderSet);
|
|
114
|
+
return manufOrderList?.map(manufOrder => manufOrder.id);
|
|
168
115
|
})
|
|
169
116
|
.then(manufOrderIds => fetchManufacturingOrderByIds({ manufOrderIds, page }));
|
|
170
117
|
}
|
|
@@ -172,45 +119,30 @@ async function fetchManufacturingOrderByIds({ manufOrderIds, page = 0 }) {
|
|
|
172
119
|
if (manufOrderIds == null) {
|
|
173
120
|
return null;
|
|
174
121
|
}
|
|
175
|
-
return
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
_domainContext: {
|
|
181
|
-
manufOrderIds: manufOrderIds,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
fields: ['id', 'manufOrderSeq', 'statusSelect'],
|
|
185
|
-
sortBy: sortByFields,
|
|
186
|
-
limit: 10,
|
|
187
|
-
offset: 10 * page,
|
|
122
|
+
return createStandardSearch({
|
|
123
|
+
model: 'com.axelor.apps.production.db.ManufOrder',
|
|
124
|
+
domain: 'self.id IN :manufOrderIds',
|
|
125
|
+
domainContext: {
|
|
126
|
+
manufOrderIds: manufOrderIds,
|
|
188
127
|
},
|
|
128
|
+
fieldKey: 'manufacturing_manufacturingOrderShort',
|
|
129
|
+
sortKey: 'manufacturing_manufacturingOrder',
|
|
130
|
+
page,
|
|
189
131
|
});
|
|
190
132
|
}
|
|
191
133
|
export async function fetchChildrenManufacturingOrders({ parentManufOrderId, page = 0, }) {
|
|
192
|
-
return
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
criteria: [
|
|
200
|
-
{
|
|
201
|
-
fieldName: 'parentMO.id',
|
|
202
|
-
operator: '=',
|
|
203
|
-
value: parentManufOrderId,
|
|
204
|
-
},
|
|
205
|
-
],
|
|
206
|
-
},
|
|
207
|
-
],
|
|
134
|
+
return createStandardSearch({
|
|
135
|
+
model: 'com.axelor.apps.production.db.ManufOrder',
|
|
136
|
+
criteria: [
|
|
137
|
+
{
|
|
138
|
+
fieldName: 'parentMO.id',
|
|
139
|
+
operator: '=',
|
|
140
|
+
value: parentManufOrderId,
|
|
208
141
|
},
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
},
|
|
142
|
+
],
|
|
143
|
+
fieldKey: 'manufacturing_manufacturingOrder',
|
|
144
|
+
sortKey: 'manufacturing_manufacturingOrder',
|
|
145
|
+
page,
|
|
214
146
|
});
|
|
215
147
|
}
|
|
216
148
|
export async function updateManufacturingOrderStatus({ manufOrderId, manufOrderVersion, targetStatus, }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manufacturing-order-api.js","sourceRoot":"","sources":["../../src/api/manufacturing-order-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"manufacturing-order-api.js","sourceRoot":"","sources":["../../src/api/manufacturing-order-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAE9D,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE;IACtE,IAAI,SAAS,GAAG;QACd;YACE,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,UAAU;SAC1C;QACD;YACE,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE;gBACR;oBACE,SAAS,EAAE,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C,EAAC,aAAa,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,KAAK,UAAU,4BAA4B,CAAC,EAAC,aAAa,EAAE,IAAI,GAAG,CAAC,EAAC;IACnE,IAAI,aAAa,IAAI,IAAI,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,0CAA0C;QACjD,MAAM,EAAE,2BAA2B;QACnC,aAAa,EAAE;YACb,aAAa,EAAE,aAAa;SAC7B;QACD,QAAQ,EAAE,uCAAuC;QACjD,OAAO,EAAE,kCAAkC;QAC3C,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,EACrD,kBAAkB,EAClB,IAAI,GAAG,CAAC,GACT;IACC,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,0CAA0C;QACjD,QAAQ,EAAE;YACR;gBACE,SAAS,EAAE,aAAa;gBACxB,QAAQ,EAAE,GAAG;gBACb,KAAK,EAAE,kBAAkB;aAC1B;SACF;QACD,QAAQ,EAAE,kCAAkC;QAC5C,OAAO,EAAE,kCAAkC;QAC3C,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAC,EACnD,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb;IACC,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,sBAAsB,YAAY,EAAE;QACzC,IAAI,EAAE;YACJ,OAAO,EAAE,iBAAiB;YAC1B,MAAM,EAAE,YAAY;SACrB;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -15,53 +15,37 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { axiosApiProvider, getNextMonth, getPreviousMonth, } from '@axelor/aos-mobile-core';
|
|
18
|
+
import { axiosApiProvider, createStandardFetch, createStandardSearch, getNextMonth, getPreviousMonth, getSearchCriterias, } from '@axelor/aos-mobile-core';
|
|
19
19
|
import OperationOrder from '../types/operation-order';
|
|
20
|
-
const operationOrderListFields = [
|
|
21
|
-
'id',
|
|
22
|
-
'operationName',
|
|
23
|
-
'statusSelect',
|
|
24
|
-
'priority',
|
|
25
|
-
'workCenter',
|
|
26
|
-
'plannedDuration',
|
|
27
|
-
'manufOrder',
|
|
28
|
-
'machine',
|
|
29
|
-
'plannedStartDateT',
|
|
30
|
-
'plannedEndDateT',
|
|
31
|
-
'realStartDateT',
|
|
32
|
-
'realEndDateT',
|
|
33
|
-
'operationOrderDurationList',
|
|
34
|
-
'realDuration',
|
|
35
|
-
'prodProcessLine',
|
|
36
|
-
];
|
|
37
|
-
const sortByFields = ['manufOrder.manufOrderSeq', 'statusSelect', 'priority'];
|
|
38
20
|
const createOperationOrderCriteria = (manufOrderId, searchValue) => {
|
|
39
|
-
let criterias = [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
21
|
+
let criterias = [
|
|
22
|
+
{
|
|
23
|
+
operator: 'OR',
|
|
24
|
+
criteria: [
|
|
25
|
+
{
|
|
26
|
+
fieldName: 'statusSelect',
|
|
27
|
+
operator: '=',
|
|
28
|
+
value: OperationOrder.status.Planned,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
fieldName: 'statusSelect',
|
|
32
|
+
operator: '=',
|
|
33
|
+
value: OperationOrder.status.InProgress,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
fieldName: 'statusSelect',
|
|
37
|
+
operator: '=',
|
|
38
|
+
value: OperationOrder.status.StandBy,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
fieldName: 'statusSelect',
|
|
42
|
+
operator: '=',
|
|
43
|
+
value: OperationOrder.status.Finished,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
getSearchCriterias('manufacturing_operationOrder', searchValue),
|
|
48
|
+
];
|
|
65
49
|
if (manufOrderId != null) {
|
|
66
50
|
criterias.push({
|
|
67
51
|
fieldName: 'manufOrder.id',
|
|
@@ -69,90 +53,76 @@ const createOperationOrderCriteria = (manufOrderId, searchValue) => {
|
|
|
69
53
|
value: manufOrderId,
|
|
70
54
|
});
|
|
71
55
|
}
|
|
72
|
-
if (searchValue != null) {
|
|
73
|
-
criterias.push({
|
|
74
|
-
fieldName: 'manufOrder.manufOrderSeq',
|
|
75
|
-
operator: 'like',
|
|
76
|
-
value: searchValue,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
56
|
return criterias;
|
|
80
57
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
58
|
+
const createOperationOrderPlanningCriteria = date => {
|
|
59
|
+
const startDate = getPreviousMonth(date).toISOString();
|
|
60
|
+
const endDate = getNextMonth(date).toISOString();
|
|
61
|
+
return [
|
|
62
|
+
{
|
|
63
|
+
operator: 'or',
|
|
64
|
+
criteria: [
|
|
65
|
+
{
|
|
66
|
+
operator: 'and',
|
|
67
|
+
criteria: [
|
|
68
|
+
{
|
|
69
|
+
fieldName: 'plannedStartDateT',
|
|
70
|
+
operator: '>=',
|
|
71
|
+
value: startDate,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
fieldName: 'plannedStartDateT',
|
|
75
|
+
operator: '<=',
|
|
76
|
+
value: endDate,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
operator: 'and',
|
|
82
|
+
criteria: [
|
|
83
|
+
{
|
|
84
|
+
fieldName: 'plannedEndDateT',
|
|
85
|
+
operator: '>=',
|
|
86
|
+
value: startDate,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
fieldName: 'plannedStartDateT',
|
|
90
|
+
operator: '<=',
|
|
91
|
+
value: endDate,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
97
96
|
},
|
|
97
|
+
];
|
|
98
|
+
};
|
|
99
|
+
export async function searchOperationOrderFilter({ manufOrderId = null, searchValue = null, page = 0, }) {
|
|
100
|
+
return createStandardSearch({
|
|
101
|
+
model: 'com.axelor.apps.production.db.OperationOrder',
|
|
102
|
+
criteria: createOperationOrderCriteria(manufOrderId, searchValue),
|
|
103
|
+
fieldKey: 'manufacturing_operationOrder',
|
|
104
|
+
sortKey: 'manufacturing_operationOrder',
|
|
105
|
+
page,
|
|
98
106
|
});
|
|
99
107
|
}
|
|
100
108
|
export async function getPlannedOperationOrder(date) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
criteria: [
|
|
109
|
-
{
|
|
110
|
-
operator: 'and',
|
|
111
|
-
criteria: [
|
|
112
|
-
{
|
|
113
|
-
fieldName: 'plannedStartDateT',
|
|
114
|
-
operator: '>=',
|
|
115
|
-
value: startDate,
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
fieldName: 'plannedStartDateT',
|
|
119
|
-
operator: '<=',
|
|
120
|
-
value: endDate,
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
operator: 'and',
|
|
126
|
-
criteria: [
|
|
127
|
-
{
|
|
128
|
-
fieldName: 'plannedEndDateT',
|
|
129
|
-
operator: '>=',
|
|
130
|
-
value: startDate,
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
fieldName: 'plannedStartDateT',
|
|
134
|
-
operator: '<=',
|
|
135
|
-
value: endDate,
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
fields: operationOrderListFields,
|
|
142
|
-
sortBy: ['plannedStartDateT', 'manufOrder.manufOrderSeq', 'statusSelect'],
|
|
143
|
-
limit: null,
|
|
144
|
-
},
|
|
109
|
+
return createStandardSearch({
|
|
110
|
+
model: 'com.axelor.apps.production.db.OperationOrder',
|
|
111
|
+
criteria: createOperationOrderPlanningCriteria(date),
|
|
112
|
+
fieldKey: 'manufacturing_operationOrder',
|
|
113
|
+
sortKey: 'manufacturing_operationOrderPlanning',
|
|
114
|
+
page: 0,
|
|
115
|
+
limit: null,
|
|
145
116
|
});
|
|
146
117
|
}
|
|
147
118
|
export async function fetchOperationOrder({ operationOrderId }) {
|
|
148
|
-
return
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
},
|
|
119
|
+
return createStandardFetch({
|
|
120
|
+
model: 'com.axelor.apps.production.db.OperationOrder',
|
|
121
|
+
id: operationOrderId,
|
|
122
|
+
fieldKey: 'manufacturing_operationOrder',
|
|
123
|
+
relatedFields: {
|
|
124
|
+
operationOrderDurationList: ['startingDateTime', 'stoppingDateTime'],
|
|
125
|
+
prodProcessLine: ['objectDescriptionList'],
|
|
156
126
|
},
|
|
157
127
|
});
|
|
158
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-order-api.js","sourceRoot":"","sources":["../../src/api/operation-order-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,
|
|
1
|
+
{"version":3,"file":"operation-order-api.js","sourceRoot":"","sources":["../../src/api/operation-order-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,cAAc,MAAM,0BAA0B,CAAC;AAEtD,MAAM,4BAA4B,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE;IACjE,IAAI,SAAS,GAAG;QACd;YACE,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE;gBACR;oBACE,SAAS,EAAE,cAAc;oBACzB,QAAQ,EAAE,GAAG;oBACb,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO;iBACrC;gBACD;oBACE,SAAS,EAAE,cAAc;oBACzB,QAAQ,EAAE,GAAG;oBACb,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,UAAU;iBACxC;gBACD;oBACE,SAAS,EAAE,cAAc;oBACzB,QAAQ,EAAE,GAAG;oBACb,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO;iBACrC;gBACD;oBACE,SAAS,EAAE,cAAc;oBACzB,QAAQ,EAAE,GAAG;oBACb,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,QAAQ;iBACtC;aACF;SACF;QACD,kBAAkB,CAAC,8BAA8B,EAAE,WAAW,CAAC;KAChE,CAAC;IAEF,IAAI,YAAY,IAAI,IAAI,EAAE;QACxB,SAAS,CAAC,IAAI,CAAC;YACb,SAAS,EAAE,eAAe;YAC1B,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,YAAY;SACpB,CAAC,CAAC;KACJ;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,oCAAoC,GAAG,IAAI,CAAC,EAAE;IAClD,MAAM,SAAS,GAAG,gBAA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sC;QAC/C,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EAAC,gBAAgB,EAAC;IAC1D,OAAO,mBAAmB,CAAC;QACzB,KAAK,EAAE,8CAA8C;QACrD,EAAE,EAAE,gBAAgB;QACpB,QAAQ,EAAE,8BAA8B;QACxC,aAAa,EAAE;YACb,0BAA0B,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;YACpE,eAAe,EAAE,CAAC,uBAAuB,CAAC;SAC3C;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAC/C,gBAAgB,EAChB,OAAO,EACP,MAAM,GACP;IACC,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,0BAA0B,gBAAgB,EAAE;QACjD,IAAI,EAAE;YACJ,OAAO;YACP,MAAM;SACP;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
const productionFileFields = ['image', 'description'];
|
|
20
|
-
const sortByFields = ['sequence'];
|
|
18
|
+
import { createStandardSearch } from '@axelor/aos-mobile-core';
|
|
21
19
|
const createProductionFileCriteria = prodProcessLineId => {
|
|
22
20
|
let criterias = [];
|
|
23
21
|
if (prodProcessLineId != null) {
|
|
@@ -30,22 +28,12 @@ const createProductionFileCriteria = prodProcessLineId => {
|
|
|
30
28
|
return criterias;
|
|
31
29
|
};
|
|
32
30
|
export async function searchProductionFile({ prodProcessLineId = null, page = 0, }) {
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
operator: 'and',
|
|
40
|
-
criteria: createProductionFileCriteria(prodProcessLineId),
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
fields: productionFileFields,
|
|
45
|
-
sortBy: sortByFields,
|
|
46
|
-
limit: 10,
|
|
47
|
-
offset: 10 * page,
|
|
48
|
-
},
|
|
31
|
+
return createStandardSearch({
|
|
32
|
+
model: 'com.axelor.apps.production.db.ObjectDescription',
|
|
33
|
+
criteria: createProductionFileCriteria(prodProcessLineId),
|
|
34
|
+
fieldKey: 'manufacturing_productionFile',
|
|
35
|
+
sortKey: 'manufacturing_productionFile',
|
|
36
|
+
page,
|
|
49
37
|
});
|
|
50
38
|
}
|
|
51
39
|
//# sourceMappingURL=production-file-api.js.map
|