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
|
@@ -66,10 +66,9 @@ export default {
|
|
|
66
66
|
// user cache
|
|
67
67
|
getUrl("/system/user/getAll").then(
|
|
68
68
|
(response) => {
|
|
69
|
+
console.log(response);
|
|
69
70
|
var data = response.data;
|
|
70
|
-
|
|
71
|
-
console.error("Error saving user data:", err);
|
|
72
|
-
});
|
|
71
|
+
Vue.prototype.$cache.local.setJSON("user", data);
|
|
73
72
|
},
|
|
74
73
|
(error) => {
|
|
75
74
|
console.log(error);
|
|
@@ -79,9 +78,7 @@ export default {
|
|
|
79
78
|
getUrl("/system/dept/getAll").then(
|
|
80
79
|
(response) => {
|
|
81
80
|
var data = response.data;
|
|
82
|
-
|
|
83
|
-
console.error("Error saving dept data:", err);
|
|
84
|
-
});
|
|
81
|
+
Vue.prototype.$cache.local.setJSON("dept", data);
|
|
85
82
|
},
|
|
86
83
|
(error) => {
|
|
87
84
|
console.log(error);
|
|
@@ -0,0 +1,211 @@
|
|
|
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
|
+
*/
|
|
12
|
+
export function initBdCache() {
|
|
13
|
+
|
|
14
|
+
getUrl("/bd/ItemClass/getItemClassAll").then((response) => {
|
|
15
|
+
var data = response.data;
|
|
16
|
+
Vue.prototype.$cache.local.setJSON("itemClass", data);
|
|
17
|
+
},
|
|
18
|
+
(error) => {
|
|
19
|
+
console.log(error);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
getUrl("/bd/itemCategory/getItemCategoryAll").then((response) => {
|
|
24
|
+
var data = response.data;
|
|
25
|
+
Vue.prototype.$cache.local.setJSON("itemCategory", data);
|
|
26
|
+
},
|
|
27
|
+
(error) => {
|
|
28
|
+
console.log(error);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
getUrl("/bd/ProductLine/getProductLineAll").then((response) => {
|
|
33
|
+
var data = response.data;
|
|
34
|
+
Vue.prototype.$cache.local.setJSON("itemLine", data);
|
|
35
|
+
},
|
|
36
|
+
(error) => {
|
|
37
|
+
console.log(error);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
getUrl("/bd/currency/listAll").then((response) => {
|
|
42
|
+
var data = response.data;
|
|
43
|
+
Vue.prototype.$cache.local.setJSON("currency", data);
|
|
44
|
+
},
|
|
45
|
+
(error) => {
|
|
46
|
+
console.log(error);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
getUrl("/bd/bd/listScale").then((response) => {
|
|
51
|
+
var data = response.data;
|
|
52
|
+
Vue.prototype.$cache.local.setJSON("scales", data);
|
|
53
|
+
},
|
|
54
|
+
(error) => {
|
|
55
|
+
console.log(error);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function getCurrencyNameByIdOrNo(value) {
|
|
61
|
+
let cache = that.$cache.local.getJSON("currency");
|
|
62
|
+
return getComponentNameByIdOrNo(value, cache, "currencyName", "currencyNo");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function getCurrencyByNo(currencyNo) {
|
|
66
|
+
let cache = that.$cache.local.getJSON("currency");
|
|
67
|
+
if (cache) {
|
|
68
|
+
return cache.find((item) => item.currencyNo === currencyNo);
|
|
69
|
+
} else {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 根据存货分类Id或编号获取名称
|
|
76
|
+
* @param {any} value
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
export function getItemClassNameByIdOrNo(value) {
|
|
80
|
+
var cache = that.$cache.local.getJSON("itemClass");
|
|
81
|
+
return getComponentNameByIdOrNo(value, cache, "itemClassName", "itemClassNo");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 根据物料种类Id或编号获取名称
|
|
86
|
+
* @param {any} value
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
export function getItemCategoryNameByIdOrNo(value) {
|
|
90
|
+
var cache = that.$cache.local.getJSON("itemCategory");
|
|
91
|
+
return getComponentNameByIdOrNo(value, cache, "itemCategoryName", "itemCategoryNo");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 根据产品线Id或编号获取名称
|
|
96
|
+
* @param {any} value
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
export function geProductLineNameByIdOrNo(value) {
|
|
100
|
+
var cache = that.$cache.local.getJSON("itemLine");
|
|
101
|
+
return getComponentNameByIdOrNo(value, cache, "productLineName", "productLineNo");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function getComponentNameByIdOrNo(value, cacheItems, nameField, noField) {
|
|
105
|
+
var component = getComponentByIdOrNo(value, cacheItems, noField);
|
|
106
|
+
if (!component) return value;
|
|
107
|
+
return component[nameField];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function getComponentByIdOrNo(value, cacheItems, noField) {
|
|
111
|
+
if (!cacheItems) return null;
|
|
112
|
+
for (var item of cacheItems) {
|
|
113
|
+
if (item[noField] == value || item.id == value) {
|
|
114
|
+
return item;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function getAllItemClass() {
|
|
121
|
+
return that.$cache.local.getJSON("itemClass");
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function getAllItemCategory() {
|
|
125
|
+
return that.$cache.local.getJSON("itemCategory");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function getAllProductLine() {
|
|
129
|
+
return that.$cache.local.getJSON("itemLine");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
export function getUomScaleByUomNo(uomNo) {
|
|
134
|
+
let scaleVO = that.$cache.local.getJSON("scales").find((item) => item.uomNo === uomNo);
|
|
135
|
+
if (scaleVO != null) {
|
|
136
|
+
return {
|
|
137
|
+
scale: Number(scaleVO.uomScale),
|
|
138
|
+
roundingTypeCode: scaleVO.priceRoundingTypeCode
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function getPriceScaleByCurrencyId(currencyId) {
|
|
146
|
+
let scaleVO = that.$cache.local.getJSON("scales").find((item) => item.currencyId === currencyId);
|
|
147
|
+
if (scaleVO != null) {
|
|
148
|
+
return {
|
|
149
|
+
scale: Number(scaleVO.priceScale),
|
|
150
|
+
roundingTypeCode: scaleVO.priceRoundingTypeCode
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function getAmountScaleByCurrencyId(currencyId) {
|
|
157
|
+
let scaleVO = that.$cache.local.getJSON("scales").find((item) => item.currencyId === currencyId);
|
|
158
|
+
if (scaleVO != null) {
|
|
159
|
+
return {
|
|
160
|
+
scale: Number(scaleVO.amountScale),
|
|
161
|
+
roundingTypeCode: scaleVO.priceRoundingTypeCode
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function formatByUomCode(val, uomCode){
|
|
168
|
+
let scaleVo = getUomScaleByUomNo(uomCode);
|
|
169
|
+
if(scaleVo != null){
|
|
170
|
+
let scale = scaleVo.scale;
|
|
171
|
+
return Math.round(val * Math.pow(10, scale)) / Math.pow(10, scale);
|
|
172
|
+
}else{
|
|
173
|
+
// throw error
|
|
174
|
+
console.error(options.component, "未找到相关 uomNo 为", uomCode, "的单位精度信息");
|
|
175
|
+
return val;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function formatPriceByCurrencyId(val, currencyId){
|
|
180
|
+
let scaleVo = getPriceScaleByCurrencyId(currencyId);
|
|
181
|
+
if(scaleVo != null){
|
|
182
|
+
let scale = scaleVo.scale;
|
|
183
|
+
if(scaleVo.roundingTypeCode === "1") { //四舍五入
|
|
184
|
+
return Math.round(val * Math.pow(10, scale)) / Math.pow(10, scale);
|
|
185
|
+
}else{
|
|
186
|
+
//四舍六入五成双
|
|
187
|
+
return val.toFixed(scale);
|
|
188
|
+
}
|
|
189
|
+
}else{
|
|
190
|
+
// throw error
|
|
191
|
+
console.error(options.component, "未找到相关 currencyId 为", currencyId, "的单位精度信息");
|
|
192
|
+
return val;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function formatAmountByCurrencyId(val, currencyId){
|
|
197
|
+
let scaleVo = getAmountScaleByCurrencyId(currencyId);
|
|
198
|
+
if(scaleVo != null){
|
|
199
|
+
let scale = scaleVo.scale;
|
|
200
|
+
if(scaleVo.roundingTypeCode === "1") { //四舍五入
|
|
201
|
+
return Math.round(val * Math.pow(10, scale)) / Math.pow(10, scale);
|
|
202
|
+
}else{
|
|
203
|
+
//四舍六入五成双
|
|
204
|
+
return val.toFixed(scale);
|
|
205
|
+
}
|
|
206
|
+
}else{
|
|
207
|
+
// throw error
|
|
208
|
+
console.error(options.component, "未找到相关 currencyId 为", currencyId, "的单位精度信息");
|
|
209
|
+
return val;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -108,9 +108,8 @@ export function initEamCache() {
|
|
|
108
108
|
}
|
|
109
109
|
})
|
|
110
110
|
}*/
|
|
111
|
-
export
|
|
112
|
-
|
|
113
|
-
return user;
|
|
111
|
+
export function getUserOptions() {
|
|
112
|
+
return that.$cache.local.getJSON("user");
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
export function getAssetCategoryOptions() {
|
|
@@ -131,9 +130,8 @@ export function getTaskOwnershipTree() {
|
|
|
131
130
|
})
|
|
132
131
|
return result
|
|
133
132
|
}
|
|
134
|
-
export
|
|
135
|
-
|
|
136
|
-
return dept;
|
|
133
|
+
export function getDeptOptions() {
|
|
134
|
+
return that.$cache.local.getJSON("dept");
|
|
137
135
|
}
|
|
138
136
|
export function getDeptTree() {
|
|
139
137
|
return store.state.eam.deptTreeOptions;
|