kz-ui-base 1.0.76 → 1.0.78
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/api/lims/utils/constant.js +4 -2
- package/api/qms/commonQms.js +4 -4
- package/common/src/api/common/common.js +4 -4
- package/common/src/components/base/dialog/editDialog.vue +383 -383
- package/common/src/plugins/index.js +3 -6
- package/common/src/utils/cache/bdCacheOld.js +211 -0
- package/common/src/utils/cache/eamCache.js +4 -6
- package/common/src/utils/cache/fdCacheOld.js +464 -0
- package/common/src/utils/cache/smCacheOld.js +35 -0
- package/common/src/utils/cache/tmCacheOld.js +44 -0
- package/kztool/css/0.1e7abc31.css +1 -0
- package/kztool/kztool.common.0.js +23035 -4174
- package/kztool/kztool.common.1.js +1 -1
- package/kztool/kztool.common.10.js +8 -8
- package/kztool/kztool.common.11.js +9 -1
- package/kztool/kztool.common.12.js +1 -1
- package/kztool/kztool.common.13.js +2 -2
- package/kztool/kztool.common.14.js +1 -1
- package/kztool/kztool.common.15.js +1 -1
- package/kztool/kztool.common.16.js +1 -1
- package/kztool/kztool.common.17.js +1 -1
- package/kztool/kztool.common.18.js +21 -1
- package/kztool/kztool.common.19.js +15 -3
- package/kztool/kztool.common.20.js +1 -1
- package/kztool/kztool.common.21.js +1 -1
- package/kztool/kztool.common.22.js +1 -1
- package/kztool/kztool.common.24.js +1 -1
- package/kztool/kztool.common.25.js +1 -1
- package/kztool/kztool.common.3.js +56 -5
- package/kztool/kztool.common.4.js +9 -1
- package/kztool/kztool.common.6.js +315 -78
- package/kztool/kztool.common.8.js +330 -85
- package/kztool/kztool.common.9.js +35 -27
- package/kztool/kztool.common.js +30802 -8788
- package/kztool/kztool.umd.0.js +23035 -4174
- package/kztool/kztool.umd.1.js +1 -1
- package/kztool/kztool.umd.10.js +8 -8
- package/kztool/kztool.umd.11.js +9 -1
- package/kztool/kztool.umd.12.js +1 -1
- package/kztool/kztool.umd.13.js +2 -2
- package/kztool/kztool.umd.14.js +1 -1
- package/kztool/kztool.umd.15.js +1 -1
- package/kztool/kztool.umd.16.js +1 -1
- package/kztool/kztool.umd.17.js +1 -1
- package/kztool/kztool.umd.18.js +21 -1
- package/kztool/kztool.umd.19.js +15 -3
- package/kztool/kztool.umd.20.js +1 -1
- package/kztool/kztool.umd.21.js +1 -1
- package/kztool/kztool.umd.22.js +1 -1
- package/kztool/kztool.umd.24.js +1 -1
- package/kztool/kztool.umd.25.js +1 -1
- package/kztool/kztool.umd.3.js +56 -5
- package/kztool/kztool.umd.4.js +9 -1
- package/kztool/kztool.umd.6.js +315 -78
- package/kztool/kztool.umd.8.js +330 -85
- package/kztool/kztool.umd.9.js +35 -27
- package/kztool/kztool.umd.js +30802 -8788
- package/kztool/kztool.umd.min.0.js +122 -110
- package/kztool/kztool.umd.min.11.js +1 -1
- package/kztool/kztool.umd.min.18.js +1 -1
- package/kztool/kztool.umd.min.19.js +1 -1
- package/kztool/kztool.umd.min.3.js +2 -2
- package/kztool/kztool.umd.min.4.js +1 -1
- package/kztool/kztool.umd.min.6.js +1 -1
- package/kztool/kztool.umd.min.8.js +1 -1
- package/kztool/kztool.umd.min.9.js +1 -1
- package/kztool/kztool.umd.min.js +434 -138
- package/package.json +1 -1
- package/kztool/css/0.c354e903.css +0 -1
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import {getUrl} from '../../api/common/common';
|
|
3
|
+
|
|
4
|
+
let that = new Vue()
|
|
5
|
+
//import * as cache from '../..plugins/cache'
|
|
6
|
+
|
|
7
|
+
//公共接口
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 工区类型_厂区
|
|
12
|
+
*/
|
|
13
|
+
const WA_TYPE_CODE_PLANT_AREA = "1";
|
|
14
|
+
/**
|
|
15
|
+
* 工区类型_车间
|
|
16
|
+
*/
|
|
17
|
+
const WA_TYPE_CODE_WORKSHOP = "2";
|
|
18
|
+
/**
|
|
19
|
+
* 工区类型_产线
|
|
20
|
+
*/
|
|
21
|
+
const WA_TYPE_CODE_PRODUCTION_LINE = "3";
|
|
22
|
+
/**
|
|
23
|
+
* 工区类型_工段
|
|
24
|
+
*/
|
|
25
|
+
const WA_TYPE_CODE_WORKSHOP_SECTION = "4";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* factory component类型_组织
|
|
29
|
+
* @type {string}
|
|
30
|
+
*/
|
|
31
|
+
export const FACTORY_COMPONENT_SITE = "1";
|
|
32
|
+
/**
|
|
33
|
+
* factory component类型_工区
|
|
34
|
+
* @type {string}
|
|
35
|
+
*/
|
|
36
|
+
export const FACTORY_COMPONENT_WORKAREA = "2";
|
|
37
|
+
/**
|
|
38
|
+
* factory component类型_工作中心
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
export const FACTORY_COMPONENT_WORKCENTER = "3";
|
|
42
|
+
/**
|
|
43
|
+
* factory component类型_作业单元
|
|
44
|
+
* @type {string}
|
|
45
|
+
*/
|
|
46
|
+
export const FACTORY_COMPONENT_WORKUNIT = "4";
|
|
47
|
+
/**
|
|
48
|
+
* factory component类型_仓库
|
|
49
|
+
* @type {string}
|
|
50
|
+
*/
|
|
51
|
+
export const FACTORY_COMPONENT_STORAGEZONE = "5";
|
|
52
|
+
/**
|
|
53
|
+
* factory component类型_库位
|
|
54
|
+
* @type {string}
|
|
55
|
+
*/
|
|
56
|
+
export const FACTORY_COMPONENT_STORAGEUNIT = "6";
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 初始化工厂模块相关缓存
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
export function initFdCache() {
|
|
63
|
+
|
|
64
|
+
getUrl("/fd/fd/getAllSites").then((response) => {
|
|
65
|
+
var data = response.data;
|
|
66
|
+
Vue.prototype.$cache.local.setJSON("sites", data);
|
|
67
|
+
},
|
|
68
|
+
(error) => {
|
|
69
|
+
console.log(error);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
getUrl("/fd/fd/getWorkAreas").then((response) => {
|
|
74
|
+
var data = response.data;
|
|
75
|
+
Vue.prototype.$cache.local.setJSON("workAreas", data);
|
|
76
|
+
},
|
|
77
|
+
(error) => {
|
|
78
|
+
console.log(error);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
getUrl("/fd/fd/getWorkUnits").then((response) => {
|
|
83
|
+
var data = response.data;
|
|
84
|
+
Vue.prototype.$cache.local.setJSON("workUnits", data);
|
|
85
|
+
},
|
|
86
|
+
(error) => {
|
|
87
|
+
console.log(error);
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
getUrl("/fd/fd/getWorkCenters").then((response) => {
|
|
92
|
+
var data = response.data;
|
|
93
|
+
Vue.prototype.$cache.local.setJSON("workCenters", data);
|
|
94
|
+
},
|
|
95
|
+
(error) => {
|
|
96
|
+
console.log(error);
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
getUrl("/fd/fd/getStorageZones").then((response) => {
|
|
101
|
+
var data = response.data;
|
|
102
|
+
Vue.prototype.$cache.local.setJSON("storageZones", data);
|
|
103
|
+
},
|
|
104
|
+
(error) => {
|
|
105
|
+
console.log(error);
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
getUrl("/fd/fd/getStorageUnits").then((response) => {
|
|
110
|
+
var data = response.data;
|
|
111
|
+
Vue.prototype.$cache.local.setJSON("storageUnits", data);
|
|
112
|
+
},
|
|
113
|
+
(error) => {
|
|
114
|
+
console.log(error);
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 获取所有工作中心
|
|
121
|
+
* @param siteId 公司Id 可为空,为空时获取所有公司下数据
|
|
122
|
+
* @param workAreaId 工区Id 可为空
|
|
123
|
+
* @return
|
|
124
|
+
*/
|
|
125
|
+
export function getWorkCenters(siteIdOrNo, workAreaNoOrId = null) {
|
|
126
|
+
var cache = that.$cache.local.getJSON("workCenters");
|
|
127
|
+
if (!cache) return null;
|
|
128
|
+
if (siteIdOrNo != undefined && siteIdOrNo != null) {
|
|
129
|
+
var component = getSiteByIdOrNo(siteIdOrNo);
|
|
130
|
+
if (!component) return null;
|
|
131
|
+
cache = cache.filter(x => x.siteId == component.id);
|
|
132
|
+
}
|
|
133
|
+
if (workAreaNoOrId != undefined && workAreaNoOrId != null) {
|
|
134
|
+
var workAreaCache = getWorkAreas(siteIdOrNo);
|
|
135
|
+
var component = getComponentByIdOrNo(workAreaNoOrId, workAreaCache);
|
|
136
|
+
cache = cache.filter(x => x.parentComponentId == component.id);
|
|
137
|
+
}
|
|
138
|
+
return cache;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* 获取所有作业单元
|
|
143
|
+
* @param siteIdOrNo 组织Id/No 可为空,为空时获取所有公司下数据
|
|
144
|
+
* @param workCenterNoOrId 工作中心Id/No 可为空
|
|
145
|
+
* @param workUnitsIdOrNo 作业单元Id/No 可为空
|
|
146
|
+
* @return
|
|
147
|
+
*/
|
|
148
|
+
export function getWorkUnits(siteIdOrNo, workCenterNoOrId, workUnitsIdOrNo = null) {
|
|
149
|
+
var cache = that.$cache.local.getJSON("workUnits");
|
|
150
|
+
if (!cache) return null;
|
|
151
|
+
if (siteIdOrNo != undefined && siteIdOrNo != null) {
|
|
152
|
+
var site = getSiteByIdOrNo(siteIdOrNo);
|
|
153
|
+
if (!site) return null;
|
|
154
|
+
cache = cache.filter(x => x.siteId == site.id);
|
|
155
|
+
}
|
|
156
|
+
if (workCenterNoOrId != undefined && workCenterNoOrId != null) {
|
|
157
|
+
var workCenterCache = getWorkCenters(siteIdOrNo);
|
|
158
|
+
var component = getComponentByIdOrNo(workCenterNoOrId, workCenterCache);
|
|
159
|
+
cache = cache.filter(x => x.parentComponentId == component.id);
|
|
160
|
+
}
|
|
161
|
+
if (workUnitsIdOrNo != null) {
|
|
162
|
+
let res = getComponentByIdOrNo(workUnitsIdOrNo, cache);
|
|
163
|
+
return res == null ? null : [res];
|
|
164
|
+
}
|
|
165
|
+
return cache;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 获取组织列表
|
|
170
|
+
* @param {string} siteTypeCode 组织类型
|
|
171
|
+
* @returns
|
|
172
|
+
*/
|
|
173
|
+
export function getSites(siteTypeCode) {
|
|
174
|
+
var cache = that.$cache.local.getJSON("sites");
|
|
175
|
+
return cache;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* 获取工区列表
|
|
180
|
+
* @param siteIdOrNo
|
|
181
|
+
* @param {string} waTypeCode 工区类型
|
|
182
|
+
* @param workAreaIdOrNo 工区id/no
|
|
183
|
+
* @returns
|
|
184
|
+
*/
|
|
185
|
+
export function getWorkAreas(siteIdOrNo, waTypeCode, workAreaIdOrNo = null) {
|
|
186
|
+
var cache = that.$cache.local.getJSON("workAreas");
|
|
187
|
+
if (!cache) return null;
|
|
188
|
+
if (siteIdOrNo != undefined && siteIdOrNo != null) {
|
|
189
|
+
var component = getSiteByIdOrNo(siteIdOrNo);
|
|
190
|
+
if (!component) return null;
|
|
191
|
+
cache = cache.filter(x => x.siteId == component.id);
|
|
192
|
+
}
|
|
193
|
+
if (waTypeCode != undefined && waTypeCode != null) {
|
|
194
|
+
cache = cache.filter(x => x.waTypeCode == waTypeCode);
|
|
195
|
+
}
|
|
196
|
+
if (workAreaIdOrNo != null) {
|
|
197
|
+
let res = getComponentByIdOrNo(workAreaIdOrNo, cache);
|
|
198
|
+
return res == null ? null : [res];
|
|
199
|
+
}
|
|
200
|
+
return cache;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* 获取所有厂区
|
|
206
|
+
* @param siteId 公司Id 可为空,为空时获取所有公司下数据
|
|
207
|
+
* @return
|
|
208
|
+
*/
|
|
209
|
+
export function getPlantAreas(siteId) {
|
|
210
|
+
return getWorkAreas(siteId, WA_TYPE_CODE_PLANT_AREA);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 获取所有车间
|
|
215
|
+
* @param siteId 公司Id 可为空,为空时获取所有公司下数据
|
|
216
|
+
* @return
|
|
217
|
+
*/
|
|
218
|
+
export function getWorkshops(siteId) {
|
|
219
|
+
return getWorkAreas(siteId, WA_TYPE_CODE_WORKSHOP);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* 获取所有产线
|
|
224
|
+
* @param siteId 公司Id 可为空,为空时获取所有公司下数据
|
|
225
|
+
*/
|
|
226
|
+
export function getProductionLines(siteId) {
|
|
227
|
+
return getWorkAreas(siteId, WA_TYPE_CODE_PRODUCTION_LINE);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* 获取所有工段
|
|
233
|
+
* @param siteId 公司Id 可为空,为空时获取所有公司下数据
|
|
234
|
+
* @return
|
|
235
|
+
*/
|
|
236
|
+
export function getWorkshopSections(siteId) {
|
|
237
|
+
return getWorkAreas(siteId, WA_TYPE_CODE_WORKSHOP_SECTION);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* 根据组织Id或编号获取名称
|
|
243
|
+
* @param {any} value
|
|
244
|
+
* @returns
|
|
245
|
+
*/
|
|
246
|
+
export function getSiteNameByIdOrNo(value) {
|
|
247
|
+
var cache = that.$cache.local.getJSON("sites");
|
|
248
|
+
return getComponentNameByIdOrNo(value, cache);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* 根据组织Id获取编号
|
|
253
|
+
* @param {any} value
|
|
254
|
+
* @returns
|
|
255
|
+
*/
|
|
256
|
+
export function getSiteNoById(value) {
|
|
257
|
+
var cache = that.$cache.local.getJSON("sites");
|
|
258
|
+
return getComponentNoById(value, cache);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* 根据工区Id或编号获取名称
|
|
263
|
+
* @param {any} value
|
|
264
|
+
* @returns
|
|
265
|
+
*/
|
|
266
|
+
export function getWorkAreaNameByIdOrNo(value) {
|
|
267
|
+
var cache = that.$cache.local.getJSON("workAreas");
|
|
268
|
+
return getComponentNameByIdOrNo(value, cache);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* 根据工作中心Id或编号获取名称
|
|
273
|
+
* @param {any} value
|
|
274
|
+
* @returns
|
|
275
|
+
*/
|
|
276
|
+
export function getWorkCenterNameByIdOrNo(value) {
|
|
277
|
+
var cache = that.$cache.local.getJSON("workCenters");
|
|
278
|
+
return getComponentNameByIdOrNo(value, cache);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* 根据工作中心Id或编号获取对象
|
|
283
|
+
* @param {any} value
|
|
284
|
+
* @returns
|
|
285
|
+
*/
|
|
286
|
+
export function getWorkCenterByIdOrNo(value) {
|
|
287
|
+
let cache = that.$cache.local.getJSON("workCenters");
|
|
288
|
+
return getComponentByIdOrNo(value, cache);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* 根据作业单元Id或编号获取名称
|
|
293
|
+
* @param {any} value
|
|
294
|
+
* @returns
|
|
295
|
+
*/
|
|
296
|
+
export function getWorkUnitNameByIdOrNo(value) {
|
|
297
|
+
var cache = that.$cache.local.getJSON("workUnits");
|
|
298
|
+
return getComponentNameByIdOrNo(value, cache);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export function getStorageZoneNameByIdOrNo(value) {
|
|
302
|
+
return getComponentNameByIdOrNo(value, that.$cache.local.getJSON("storageZones"));
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export function getStorageUnitNameByIdOrNo(value) {
|
|
306
|
+
return getComponentNameByIdOrNo(value, that.$cache.local.getJSON("storageUnits"));
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
*
|
|
311
|
+
* @param {string} value 组织Id或编号
|
|
312
|
+
* @param {any[]} cacheItems 缓存数据
|
|
313
|
+
* @returns 待提取的组织属性数据转换结果
|
|
314
|
+
*/
|
|
315
|
+
export function getComponentPropertyValueByIdOrNo(value, cacheItems, propertyName) {
|
|
316
|
+
if(!value) return value;
|
|
317
|
+
//接收到数组,转换后返回数组
|
|
318
|
+
if(value.constructor === Array){
|
|
319
|
+
let res = [];
|
|
320
|
+
for(var val of value){
|
|
321
|
+
var component = getComponentByIdOrNo(val, cacheItems);
|
|
322
|
+
if (!component) res.push(val);
|
|
323
|
+
res.push(component[propertyName]);
|
|
324
|
+
}
|
|
325
|
+
return res;
|
|
326
|
+
}
|
|
327
|
+
if(value.constructor === String){
|
|
328
|
+
//接收到逗号分隔值,转换后同样用逗号分隔连接
|
|
329
|
+
if(value.indexOf(',') > -1){
|
|
330
|
+
let res = "";
|
|
331
|
+
for(var val of value.split(',')){
|
|
332
|
+
let str = val;
|
|
333
|
+
var component = getComponentByIdOrNo(val, cacheItems);
|
|
334
|
+
if (!component) str = val;
|
|
335
|
+
else str = component[propertyName];
|
|
336
|
+
res = res + str + ",";
|
|
337
|
+
}
|
|
338
|
+
return res.substring(0, res.length - 1);
|
|
339
|
+
}
|
|
340
|
+
else{
|
|
341
|
+
var component = getComponentByIdOrNo(value, cacheItems);
|
|
342
|
+
if (!component) return value;
|
|
343
|
+
return component[propertyName];
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
*
|
|
350
|
+
* @param {string} value 组织Id或编号
|
|
351
|
+
* @param {any[]} cacheItems 缓存数据
|
|
352
|
+
* @returns 组织编号
|
|
353
|
+
*/
|
|
354
|
+
export function getComponentNoById(value, cacheItems) {
|
|
355
|
+
return getComponentPropertyValueByIdOrNo(value, cacheItems, "componentNo");
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export function getComponentNameByIdOrNo(value, cacheItems) {
|
|
359
|
+
return getComponentPropertyValueByIdOrNo(value, cacheItems, "componentName");
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export function getComponentByIdOrNo(value, cacheItems) {
|
|
363
|
+
if (!cacheItems) return null;
|
|
364
|
+
for (var item of cacheItems) {
|
|
365
|
+
if (item.componentNo == value || item.id == value) {
|
|
366
|
+
return item;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return value;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
export function getSiteByIdOrNo(siteIdOrNo) {
|
|
374
|
+
let cache = that.$cache.local.getJSON("sites");
|
|
375
|
+
for (let item of cache) {
|
|
376
|
+
if (item.id == siteIdOrNo || item.componentNo == siteIdOrNo) {
|
|
377
|
+
return item;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export function getStorageZones(siteIdOrNo, storageZoneNoOrId = null) {
|
|
384
|
+
let cache = that.$cache.local.getJSON("storageZones");
|
|
385
|
+
if (!cache) return null;
|
|
386
|
+
if (siteIdOrNo != null) {
|
|
387
|
+
let site = getSiteByIdOrNo(siteIdOrNo);
|
|
388
|
+
if (site == null) return null;
|
|
389
|
+
let siteId = site.id;
|
|
390
|
+
cache = cache.filter(x => x.siteId == siteId);
|
|
391
|
+
}
|
|
392
|
+
if (storageZoneNoOrId != null) {
|
|
393
|
+
cache = cache.filter(x => x.id == storageZoneNoOrId || x.componentNo == storageZoneNoOrId);
|
|
394
|
+
}
|
|
395
|
+
return cache;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* 获取库位
|
|
400
|
+
* @param siteIdOrNo 组织Id 可为空
|
|
401
|
+
* @param storageZoneNoOrId 仓库Id/No 可为空
|
|
402
|
+
* @param storageUnitNoOrId 库位Id/No 可为空
|
|
403
|
+
* @return
|
|
404
|
+
*/
|
|
405
|
+
export function getStorageUnits(siteIdOrNo, storageZoneNoOrId, storageUnitNoOrId = null) {
|
|
406
|
+
let cache = that.$cache.local.getJSON("storageZones");
|
|
407
|
+
if (!cache) return null;
|
|
408
|
+
if (siteIdOrNo != null) {
|
|
409
|
+
let site = getSiteByIdOrNo(siteIdOrNo);
|
|
410
|
+
if (!site) return null;
|
|
411
|
+
cache = cache.filter(x => x.siteId == site.id);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (storageZoneNoOrId != null) {
|
|
415
|
+
let storageZone = getStorageZones(null, storageUnitNoOrId)
|
|
416
|
+
if (!storageZone) return null;
|
|
417
|
+
cache = cache.filter(x => x.parentComponentId == storageZone.id);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
if (storageUnitNoOrId != undefined && storageUnitNoOrId != null) {
|
|
421
|
+
cache = cache.filter(x => x.id == storageUnitNoOrId || x.componentNo == storageUnitNoOrId);
|
|
422
|
+
}
|
|
423
|
+
return cache;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export function getAllSites() {
|
|
427
|
+
return that.$cache.local.getJSON("sites");
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export function getAllWorkAreas() {
|
|
431
|
+
return that.$cache.local.getJSON("workAreas");
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
export function getAllWorkUnits() {
|
|
435
|
+
return that.$cache.local.getJSON("workUnits");
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export function getAllWorkCenters() {
|
|
439
|
+
return that.$cache.local.getJSON("workCenters");
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export function getAllStorageZones() {
|
|
443
|
+
return that.$cache.local.getJSON("storageZones");
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export function getAllStorageUnits() {
|
|
447
|
+
return that.$cache.local.getJSON("storageUnits");
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export function populateSiteNameForEntities(entityList){
|
|
451
|
+
return entityList.map(entity => {
|
|
452
|
+
// if prop name ends with "SiteId", populate siteName
|
|
453
|
+
for(let prop in entity){
|
|
454
|
+
if (prop.endsWith("SiteId")){
|
|
455
|
+
let siteId = entity[prop];
|
|
456
|
+
entity[prop.replace("SiteId", "SiteName")] = getSiteNameByIdOrNo(siteId);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if(entity.siteId && entity.siteId !== '0'){
|
|
460
|
+
entity['siteName'] = getSiteNameByIdOrNo(entity.siteId);
|
|
461
|
+
}
|
|
462
|
+
return entity;
|
|
463
|
+
})
|
|
464
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import {getUrl} from '../../api/common/common';
|
|
3
|
+
import Big from "big.js";
|
|
4
|
+
|
|
5
|
+
let that = new Vue()
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 初始化基础数据模块相关缓存
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export function initSmCache() {
|
|
12
|
+
getUrl("/sm/SmSysSetting/getSmSysSettingAll").then((response) => {
|
|
13
|
+
var data = response.data;
|
|
14
|
+
Vue.prototype.$cache.local.setJSON("smSysSetting", data);
|
|
15
|
+
},
|
|
16
|
+
(error) => {
|
|
17
|
+
console.log(error);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 根据销售系统参数标识获取参数值
|
|
24
|
+
* @param {string} paramCode
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export function getSmSysSettingValueByCode(paramCode) {
|
|
28
|
+
var cache = that.$cache.local.getJSON("smSysSetting");
|
|
29
|
+
if (!cache) return null;
|
|
30
|
+
let item = cache.find(item => item.paramCode == paramCode);
|
|
31
|
+
if (item) {
|
|
32
|
+
return item.paramValue;
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import request from '../request'
|
|
3
|
+
import {
|
|
4
|
+
getUrl
|
|
5
|
+
} from '../../api/common/common';
|
|
6
|
+
let that = new Vue()
|
|
7
|
+
//import * as cache from '../..plugins/cache'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 初始化TM模块相关缓存
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export function initTmCache() {
|
|
14
|
+
|
|
15
|
+
getUrl("/tm/tooling/list").then((response) => {
|
|
16
|
+
var data = response.data;
|
|
17
|
+
Vue.prototype.$cache.local.setJSON("tooling", data);
|
|
18
|
+
},
|
|
19
|
+
(error) => {
|
|
20
|
+
console.log(error);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getToolingIdMap(){
|
|
26
|
+
var cache = that.$cache.local.getJSON("tooling");
|
|
27
|
+
if (!cache) return null;
|
|
28
|
+
let res = {};
|
|
29
|
+
for(let data of cache){
|
|
30
|
+
res[data.id] = data;
|
|
31
|
+
}
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getToolingNoMap(){
|
|
36
|
+
var cache = that.$cache.local.getJSON("tooling");
|
|
37
|
+
if (!cache) return null;
|
|
38
|
+
let res = {};
|
|
39
|
+
for(let data of cache){
|
|
40
|
+
res[data.toolingNo] = data;
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[data-v-8ec6e5aa].el-table .el-table__body-wrapper{overflow-x:auto;overflow-y:auto}.rtdiv[data-v-8ec6e5aa]{height:40px}.dialog-body-wrapper[data-v-8ec6e5aa]{height:100%;margin-top:-20px;width:calc(100% + 40px);-webkit-transform:translate(-20px);transform:translate(-20px);padding:24px 24px 0 24px}.dialog-footer[data-v-8ec6e5aa]{bottom:auto}.el-table th{padding:10px 0}.el-table td{padding:5px 0!important}.el-form--inline .el-form-item{margin-right:8px;margin-bottom:8px}.el-dialog__title{font-size:16px}.sumrow .el-table,::v-deep .sumrow .el-table{overflow:visible!important}.sumrow .el-table{color:#515a6e}.treescroll{width:100%;height:100%;overflow:auto}#table-col .el-date-editor{width:217px}#table-col .el-range-editor{width:100%}.el-form-item__error{z-index:1500}.salesContractStatus-row-bg-color-red{background-color:red!important}.salesContractStatus-row-bg-color-yellow{background-color:#ff0!important}.wrapper-container-supplement[data-v-85286da8]{min-height:415px}.doubleWrapper[data-v-85286da8]{padding:0;margin-bottom:0}.doublemenu[data-v-85286da8]{margin-bottom:10px;padding-left:0!important}
|