@kengic/uni 0.6.2 → 0.6.3-beta.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/dist/api/WMS/Controllers/CommonController/GetLatestApkVersion.ts +28 -28
- package/dist/api/WMS/Controllers/CommonController/index.ts +1 -1
- package/dist/api/WMS/Controllers/LoginController/GetUserInfo.ts +28 -0
- package/dist/api/WMS/Controllers/LoginController/Logout.ts +28 -28
- package/dist/api/WMS/Controllers/LoginController/index.ts +2 -1
- package/dist/api/WMS/Controllers/WhController/ListVO.ts +95 -92
- package/dist/api/WMS/Controllers/WhController/index.ts +1 -1
- package/dist/api/WMS/Controllers/index.ts +3 -3
- package/dist/api/WMS/index.ts +2 -2
- package/dist/api/WMS/models.ts +237 -192
- package/dist/api/api.ts +1 -1
- package/dist/api/def.ts +1 -1
- package/dist/api/index.ts +2 -2
- package/dist/component/KgStation/KgStation.vue +197 -0
- package/dist/component/KgStation/index.hooks.ts +61 -0
- package/dist/component/KgStation/index.store.ts +111 -0
- package/dist/component/KgStation/index.ts +4 -0
- package/dist/component/KgTabBar/KgTabBar.vue +2 -2
- package/dist/component/KgWarehouse/KgWarehouse.vue +47 -30
- package/dist/component/KgWarehouse/index.hooks.ts +24 -1
- package/dist/component/KgWarehouse/index.store.ts +8 -8
- package/dist/component/index.ts +1 -0
- package/dist/service/http-client.ts +4 -0
- package/dist/store/app.store.ts +68 -49
- package/dist/uni/uni-ui/uni-card/uni-card.vue +10 -2
- package/dist/uni/uni-ui/uni-data-select/uni-data-select.vue +22 -17
- package/dist/uni/uni-ui/uni-easyinput/uni-easyinput.vue +35 -33
- package/dist/uni/uni-ui/uni-icons/uni-icons.vue +22 -13
- package/dist/uni/uni-ui/uni-icons/uniicons.css +32 -31
- package/dist/uni/uni-ui/uni-icons/uniicons.ttf +0 -0
- package/dist/uni/uni-ui/uni-icons/uniicons_file.ts +664 -0
- package/dist/uni/uni-ui/uni-icons/uniicons_file_vue.js +649 -0
- package/dist/uni/uni-ui/uni-list-item/uni-list-item.vue +507 -503
- package/dist/uni/uni-ui/uni-popup-dialog/keypress.js +42 -42
- package/dist/uni/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +12 -7
- package/dist/uni/uni-ui/uni-rate/uni-rate.vue +1 -2
- package/dist/util/kg.ts +33 -7
- package/package.json +5 -4
package/dist/api/WMS/models.ts
CHANGED
|
@@ -1,192 +1,237 @@
|
|
|
1
|
-
export class IPage<T0> {
|
|
2
|
-
/** Current. */
|
|
3
|
-
public current?: number | null;
|
|
4
|
-
/** Pages. */
|
|
5
|
-
public pages?: number | null;
|
|
6
|
-
/** Records. */
|
|
7
|
-
public records?: Array<T0> | null;
|
|
8
|
-
/** Size. */
|
|
9
|
-
public size?: number | null;
|
|
10
|
-
/** Total. */
|
|
11
|
-
public total?: number | null;
|
|
12
|
-
|
|
13
|
-
public constructor(obj?: IPage<T0>) {
|
|
14
|
-
keys(obj ?? {}).forEach((key: PropertyKey) => {
|
|
15
|
-
switch (key) {
|
|
16
|
-
case 'current':
|
|
17
|
-
case 'pages':
|
|
18
|
-
case 'records':
|
|
19
|
-
case 'size':
|
|
20
|
-
case 'total':
|
|
21
|
-
Reflect.set(this, key, Reflect.get(obj ?? {}, key));
|
|
22
|
-
break;
|
|
23
|
-
default:
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** 用户. */
|
|
31
|
-
export class SysUser {
|
|
32
|
-
/** Activiti Sync. */
|
|
33
|
-
public activitiSync?: number | null;
|
|
34
|
-
/** 头像. */
|
|
35
|
-
public avatar?: string | null;
|
|
36
|
-
/** Birthday. */
|
|
37
|
-
public birthday?: string | null;
|
|
38
|
-
/** Client Id. */
|
|
39
|
-
public clientId?: string | null;
|
|
40
|
-
/** Create By. */
|
|
41
|
-
public createBy?: string | null;
|
|
42
|
-
/** Create Time. */
|
|
43
|
-
public createTime?: string | null;
|
|
44
|
-
/** Del Flag. */
|
|
45
|
-
public delFlag?: number | null;
|
|
46
|
-
/** Depart Ids. */
|
|
47
|
-
public departIds?: string | null;
|
|
48
|
-
/** 邮件. */
|
|
49
|
-
public email?: string | null;
|
|
50
|
-
/** Home Path. */
|
|
51
|
-
public homePath?: string | null;
|
|
52
|
-
/** Id. */
|
|
53
|
-
public id?: string | null;
|
|
54
|
-
/** Org Code. */
|
|
55
|
-
public orgCode?: string | null;
|
|
56
|
-
/** Org Code Txt. */
|
|
57
|
-
public orgCodeTxt?: string | null;
|
|
58
|
-
/** Password. */
|
|
59
|
-
public password?: string | null;
|
|
60
|
-
/** 电话. */
|
|
61
|
-
public phone?: string | null;
|
|
62
|
-
/** Post. */
|
|
63
|
-
public post?: string | null;
|
|
64
|
-
/** 姓名. */
|
|
65
|
-
public realname?: string | null;
|
|
66
|
-
/** Rel Tenant Ids. */
|
|
67
|
-
public relTenantIds?: string | null;
|
|
68
|
-
/** Salt. */
|
|
69
|
-
public salt?: string | null;
|
|
70
|
-
/** Sex. */
|
|
71
|
-
public sex?: number | null;
|
|
72
|
-
/** 状态. */
|
|
73
|
-
public status?: number | null;
|
|
74
|
-
/** Telephone. */
|
|
75
|
-
public telephone?: string | null;
|
|
76
|
-
/** Update By. */
|
|
77
|
-
public updateBy?: string | null;
|
|
78
|
-
/** Update Time. */
|
|
79
|
-
public updateTime?: string | null;
|
|
80
|
-
/** User Identity. */
|
|
81
|
-
public userIdentity?: number | null;
|
|
82
|
-
/** 账号. */
|
|
83
|
-
public username?: string | null;
|
|
84
|
-
/** 工号. */
|
|
85
|
-
public workNo?: string | null;
|
|
86
|
-
|
|
87
|
-
public constructor(obj?: SysUser) {
|
|
88
|
-
keys(obj ?? {}).forEach((key: PropertyKey) => {
|
|
89
|
-
switch (key) {
|
|
90
|
-
case 'activitiSync':
|
|
91
|
-
case 'avatar':
|
|
92
|
-
case 'birthday':
|
|
93
|
-
case 'clientId':
|
|
94
|
-
case 'createBy':
|
|
95
|
-
case 'createTime':
|
|
96
|
-
case 'delFlag':
|
|
97
|
-
case 'departIds':
|
|
98
|
-
case 'email':
|
|
99
|
-
case 'homePath':
|
|
100
|
-
case 'id':
|
|
101
|
-
case 'orgCode':
|
|
102
|
-
case 'orgCodeTxt':
|
|
103
|
-
case 'password':
|
|
104
|
-
case 'phone':
|
|
105
|
-
case 'post':
|
|
106
|
-
case 'realname':
|
|
107
|
-
case 'relTenantIds':
|
|
108
|
-
case 'salt':
|
|
109
|
-
case 'sex':
|
|
110
|
-
case 'status':
|
|
111
|
-
case 'telephone':
|
|
112
|
-
case 'updateBy':
|
|
113
|
-
case 'updateTime':
|
|
114
|
-
case 'userIdentity':
|
|
115
|
-
case 'username':
|
|
116
|
-
case 'workNo':
|
|
117
|
-
Reflect.set(this, key, Reflect.get(obj ?? {}, key));
|
|
118
|
-
break;
|
|
119
|
-
default:
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
export class
|
|
128
|
-
/**
|
|
129
|
-
public
|
|
130
|
-
/**
|
|
131
|
-
public
|
|
132
|
-
/**
|
|
133
|
-
public
|
|
134
|
-
/**
|
|
135
|
-
public
|
|
136
|
-
/**
|
|
137
|
-
public
|
|
138
|
-
/**
|
|
139
|
-
public
|
|
140
|
-
/**
|
|
141
|
-
public
|
|
142
|
-
/**
|
|
143
|
-
public
|
|
144
|
-
/**
|
|
145
|
-
public
|
|
146
|
-
|
|
147
|
-
public
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
case '
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
1
|
+
export class IPage<T0> {
|
|
2
|
+
/** Current. */
|
|
3
|
+
public current?: number | null;
|
|
4
|
+
/** Pages. */
|
|
5
|
+
public pages?: number | null;
|
|
6
|
+
/** Records. */
|
|
7
|
+
public records?: Array<T0> | null;
|
|
8
|
+
/** Size. */
|
|
9
|
+
public size?: number | null;
|
|
10
|
+
/** Total. */
|
|
11
|
+
public total?: number | null;
|
|
12
|
+
|
|
13
|
+
public constructor(obj?: IPage<T0>) {
|
|
14
|
+
keys(obj ?? {}).forEach((key: PropertyKey) => {
|
|
15
|
+
switch (key) {
|
|
16
|
+
case 'current':
|
|
17
|
+
case 'pages':
|
|
18
|
+
case 'records':
|
|
19
|
+
case 'size':
|
|
20
|
+
case 'total':
|
|
21
|
+
Reflect.set(this, key, Reflect.get(obj ?? {}, key));
|
|
22
|
+
break;
|
|
23
|
+
default:
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** 用户. */
|
|
31
|
+
export class SysUser {
|
|
32
|
+
/** Activiti Sync. */
|
|
33
|
+
public activitiSync?: number | null;
|
|
34
|
+
/** 头像. */
|
|
35
|
+
public avatar?: string | null;
|
|
36
|
+
/** Birthday. */
|
|
37
|
+
public birthday?: string | null;
|
|
38
|
+
/** Client Id. */
|
|
39
|
+
public clientId?: string | null;
|
|
40
|
+
/** Create By. */
|
|
41
|
+
public createBy?: string | null;
|
|
42
|
+
/** Create Time. */
|
|
43
|
+
public createTime?: string | null;
|
|
44
|
+
/** Del Flag. */
|
|
45
|
+
public delFlag?: number | null;
|
|
46
|
+
/** Depart Ids. */
|
|
47
|
+
public departIds?: string | null;
|
|
48
|
+
/** 邮件. */
|
|
49
|
+
public email?: string | null;
|
|
50
|
+
/** Home Path. */
|
|
51
|
+
public homePath?: string | null;
|
|
52
|
+
/** Id. */
|
|
53
|
+
public id?: string | null;
|
|
54
|
+
/** Org Code. */
|
|
55
|
+
public orgCode?: string | null;
|
|
56
|
+
/** Org Code Txt. */
|
|
57
|
+
public orgCodeTxt?: string | null;
|
|
58
|
+
/** Password. */
|
|
59
|
+
public password?: string | null;
|
|
60
|
+
/** 电话. */
|
|
61
|
+
public phone?: string | null;
|
|
62
|
+
/** Post. */
|
|
63
|
+
public post?: string | null;
|
|
64
|
+
/** 姓名. */
|
|
65
|
+
public realname?: string | null;
|
|
66
|
+
/** Rel Tenant Ids. */
|
|
67
|
+
public relTenantIds?: string | null;
|
|
68
|
+
/** Salt. */
|
|
69
|
+
public salt?: string | null;
|
|
70
|
+
/** Sex. */
|
|
71
|
+
public sex?: number | null;
|
|
72
|
+
/** 状态. */
|
|
73
|
+
public status?: number | null;
|
|
74
|
+
/** Telephone. */
|
|
75
|
+
public telephone?: string | null;
|
|
76
|
+
/** Update By. */
|
|
77
|
+
public updateBy?: string | null;
|
|
78
|
+
/** Update Time. */
|
|
79
|
+
public updateTime?: string | null;
|
|
80
|
+
/** User Identity. */
|
|
81
|
+
public userIdentity?: number | null;
|
|
82
|
+
/** 账号. */
|
|
83
|
+
public username?: string | null;
|
|
84
|
+
/** 工号. */
|
|
85
|
+
public workNo?: string | null;
|
|
86
|
+
|
|
87
|
+
public constructor(obj?: SysUser) {
|
|
88
|
+
keys(obj ?? {}).forEach((key: PropertyKey) => {
|
|
89
|
+
switch (key) {
|
|
90
|
+
case 'activitiSync':
|
|
91
|
+
case 'avatar':
|
|
92
|
+
case 'birthday':
|
|
93
|
+
case 'clientId':
|
|
94
|
+
case 'createBy':
|
|
95
|
+
case 'createTime':
|
|
96
|
+
case 'delFlag':
|
|
97
|
+
case 'departIds':
|
|
98
|
+
case 'email':
|
|
99
|
+
case 'homePath':
|
|
100
|
+
case 'id':
|
|
101
|
+
case 'orgCode':
|
|
102
|
+
case 'orgCodeTxt':
|
|
103
|
+
case 'password':
|
|
104
|
+
case 'phone':
|
|
105
|
+
case 'post':
|
|
106
|
+
case 'realname':
|
|
107
|
+
case 'relTenantIds':
|
|
108
|
+
case 'salt':
|
|
109
|
+
case 'sex':
|
|
110
|
+
case 'status':
|
|
111
|
+
case 'telephone':
|
|
112
|
+
case 'updateBy':
|
|
113
|
+
case 'updateTime':
|
|
114
|
+
case 'userIdentity':
|
|
115
|
+
case 'username':
|
|
116
|
+
case 'workNo':
|
|
117
|
+
Reflect.set(this, key, Reflect.get(obj ?? {}, key));
|
|
118
|
+
break;
|
|
119
|
+
default:
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** 用户仓库. */
|
|
127
|
+
export class SysUserWarehouseDTO {
|
|
128
|
+
/** 是否是默认的仓库. */
|
|
129
|
+
public default_flag?: number | null;
|
|
130
|
+
/** 主键. */
|
|
131
|
+
public id?: string | null;
|
|
132
|
+
/** 创建日期. */
|
|
133
|
+
public ins_dt?: string | null;
|
|
134
|
+
/** 创建用户. */
|
|
135
|
+
public ins_usr_id?: string | null;
|
|
136
|
+
/** 更新用户. */
|
|
137
|
+
public mod_usr_id?: string | null;
|
|
138
|
+
/** 更新日期. */
|
|
139
|
+
public moddte?: string | null;
|
|
140
|
+
/** 用户ID. */
|
|
141
|
+
public user_id?: string | null;
|
|
142
|
+
/** 仓库描述. */
|
|
143
|
+
public wh_dsc?: string | null;
|
|
144
|
+
/** 仓库编号. */
|
|
145
|
+
public wh_id?: string | null;
|
|
146
|
+
|
|
147
|
+
public constructor(obj?: SysUserWarehouseDTO) {
|
|
148
|
+
keys(obj ?? {}).forEach((key: PropertyKey) => {
|
|
149
|
+
switch (key) {
|
|
150
|
+
case 'default_flag':
|
|
151
|
+
case 'id':
|
|
152
|
+
case 'ins_dt':
|
|
153
|
+
case 'ins_usr_id':
|
|
154
|
+
case 'mod_usr_id':
|
|
155
|
+
case 'moddte':
|
|
156
|
+
case 'user_id':
|
|
157
|
+
case 'wh_dsc':
|
|
158
|
+
case 'wh_id':
|
|
159
|
+
Reflect.set(this, key, Reflect.get(obj ?? {}, key));
|
|
160
|
+
break;
|
|
161
|
+
default:
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** 仓库数据传输对象 */
|
|
169
|
+
export class WhDTO {
|
|
170
|
+
/** 是否可用 */
|
|
171
|
+
public activeFlg?: number | null;
|
|
172
|
+
/** 地址编号 */
|
|
173
|
+
public adrId?: string | null;
|
|
174
|
+
/** 地址名 */
|
|
175
|
+
public adrnam?: string | null;
|
|
176
|
+
/** 公司代码 */
|
|
177
|
+
public comCod?: string | null;
|
|
178
|
+
/** 默认仓库 */
|
|
179
|
+
public defWhFlg?: number | null;
|
|
180
|
+
/** 主键. */
|
|
181
|
+
public id?: string | null;
|
|
182
|
+
/** 所属地/国编号 */
|
|
183
|
+
public orgcod?: string | null;
|
|
184
|
+
/** 永久调整托盘 */
|
|
185
|
+
public permAdjLod?: string | null;
|
|
186
|
+
/** 永久调整箱 */
|
|
187
|
+
public permAdjSub?: string | null;
|
|
188
|
+
/** 永久创建托盘 */
|
|
189
|
+
public permCreLod?: string | null;
|
|
190
|
+
/** 永久创建箱 */
|
|
191
|
+
public permCreSub?: string | null;
|
|
192
|
+
/** 版本 */
|
|
193
|
+
public version?: number | null;
|
|
194
|
+
/** 仓库名称 */
|
|
195
|
+
public whDsc?: string | null;
|
|
196
|
+
/** 仓库编号 */
|
|
197
|
+
public whId?: string | null;
|
|
198
|
+
|
|
199
|
+
public constructor(obj?: WhDTO) {
|
|
200
|
+
keys(obj ?? {}).forEach((key: PropertyKey) => {
|
|
201
|
+
switch (key) {
|
|
202
|
+
case 'activeFlg':
|
|
203
|
+
case 'adrId':
|
|
204
|
+
case 'adrnam':
|
|
205
|
+
case 'comCod':
|
|
206
|
+
case 'defWhFlg':
|
|
207
|
+
case 'id':
|
|
208
|
+
case 'orgcod':
|
|
209
|
+
case 'permAdjLod':
|
|
210
|
+
case 'permAdjSub':
|
|
211
|
+
case 'permCreLod':
|
|
212
|
+
case 'permCreSub':
|
|
213
|
+
case 'version':
|
|
214
|
+
case 'whDsc':
|
|
215
|
+
case 'whId':
|
|
216
|
+
Reflect.set(this, key, Reflect.get(obj ?? {}, key));
|
|
217
|
+
break;
|
|
218
|
+
default:
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* 获取对象的属性名数组.
|
|
227
|
+
* @param obj 对象.
|
|
228
|
+
*/
|
|
229
|
+
export function keys<C extends object>(obj: C): Array<keyof C> {
|
|
230
|
+
const type = typeof obj;
|
|
231
|
+
|
|
232
|
+
if (!(obj != null && (type === 'object' || type === 'function'))) {
|
|
233
|
+
return [];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return Reflect.ownKeys(obj) as Array<keyof C>;
|
|
237
|
+
}
|
package/dist/api/api.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { WMSAPI as WMS } from './WMS';
|
|
1
|
+
export { WMSAPI as WMS } from './WMS';
|
package/dist/api/def.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { WMSDEF as WMS } from './WMS';
|
|
1
|
+
export { WMSDEF as WMS } from './WMS';
|
package/dist/api/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as API from './api';
|
|
2
|
-
export * as DEF from './def';
|
|
1
|
+
export * as API from './api';
|
|
2
|
+
export * as DEF from './def';
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UniPopup ref="popupRef" :type="'dialog'">
|
|
3
|
+
<UniPopupDialog :before-close="true" title="选择工作站" @close="onClose" @confirm="onOk">
|
|
4
|
+
<div class="row">
|
|
5
|
+
<div class="label">工作站:</div>
|
|
6
|
+
<div class="value">
|
|
7
|
+
<UniDataSelect :localdata="stationDatas" v-model="currentDevcod" :clear="true" />
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="row">
|
|
11
|
+
<div class="label">工作区:</div>
|
|
12
|
+
<div class="value">
|
|
13
|
+
<UniDataSelect :localdata="areaDatas" v-model="currentHmewrkare" :clear="true" />
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</UniPopupDialog>
|
|
17
|
+
</UniPopup>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
import { UniDataSelect, UniPopup, UniPopupDialog } from '../../uni';
|
|
22
|
+
import { computed, ref, watch } from 'vue';
|
|
23
|
+
import { useKgStation } from './index.hooks';
|
|
24
|
+
import { WorkstationDTO } from './index.store';
|
|
25
|
+
|
|
26
|
+
const emit = defineEmits(['ok']);
|
|
27
|
+
|
|
28
|
+
const kgStation = useKgStation();
|
|
29
|
+
|
|
30
|
+
//region DATA
|
|
31
|
+
// ----------------------------------------------------------------------------------------------------
|
|
32
|
+
const popupRef = ref<any>(null);
|
|
33
|
+
|
|
34
|
+
/** 当前选择的工作站编号. */
|
|
35
|
+
const currentDevcod = ref<string>('');
|
|
36
|
+
|
|
37
|
+
/** 当前选择的工作区编号. */
|
|
38
|
+
const currentHmewrkare = ref<string>('');
|
|
39
|
+
|
|
40
|
+
/** 所有工作站. */
|
|
41
|
+
const stations = ref<Array<WorkstationDTO>>([]);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 工作站下拉列表.
|
|
45
|
+
*/
|
|
46
|
+
const stationDatas = computed<Array<{ value: string; text: string }>>(() =>
|
|
47
|
+
stations.value.map((i) => ({ text: i.devcodDsc ?? '', value: i.devcod ?? '' })),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 工作区下拉列表.
|
|
52
|
+
*/
|
|
53
|
+
const areaDatas = computed<Array<{ value: string; text: string }>>(
|
|
54
|
+
() =>
|
|
55
|
+
stations.value
|
|
56
|
+
.find((i) => i.devcod === currentDevcod.value)
|
|
57
|
+
?.workstationAreas?.map((i) => ({
|
|
58
|
+
text: i.wrkare ?? '',
|
|
59
|
+
value: i.wrkareDsc ?? '',
|
|
60
|
+
})) ?? [],
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// ----------------------------------------------------------------------------------------------------
|
|
64
|
+
//endregion
|
|
65
|
+
|
|
66
|
+
//region WATCH
|
|
67
|
+
// ----------------------------------------------------------------------------------------------------
|
|
68
|
+
watch(currentDevcod, (value) => {
|
|
69
|
+
// 当清空「当前选择的工作站编号」时, 也清空「当前选择的工作区编号」,
|
|
70
|
+
if (!value) {
|
|
71
|
+
currentHmewrkare.value = '';
|
|
72
|
+
} else {
|
|
73
|
+
// 当「当前选择的工作站编号」变更时, 选择它的默认的工作区,
|
|
74
|
+
const currentStation = stations.value.find((i) => i.devcod === currentDevcod.value);
|
|
75
|
+
if (currentStation) {
|
|
76
|
+
currentHmewrkare.value = currentStation.hmewrkare ?? '';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
// ----------------------------------------------------------------------------------------------------
|
|
81
|
+
//endregion
|
|
82
|
+
|
|
83
|
+
//region FUNCTION
|
|
84
|
+
// ----------------------------------------------------------------------------------------------------
|
|
85
|
+
/**
|
|
86
|
+
* 取消.
|
|
87
|
+
*/
|
|
88
|
+
function onClose() {
|
|
89
|
+
popupRef.value?.close();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 确定.
|
|
94
|
+
*/
|
|
95
|
+
function onOk() {
|
|
96
|
+
const currentStation = stations.value.find((i) => i.devcod === currentDevcod.value);
|
|
97
|
+
if (currentStation) {
|
|
98
|
+
currentStation.hmewrkare = currentHmewrkare.value;
|
|
99
|
+
kgStation.store.setStation(currentStation);
|
|
100
|
+
} else {
|
|
101
|
+
kgStation.store.setStation(null);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
popupRef.value?.close();
|
|
105
|
+
emit('ok');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** 打开弹窗. */
|
|
109
|
+
function open() {
|
|
110
|
+
popupRef.value?.open();
|
|
111
|
+
|
|
112
|
+
currentDevcod.value = kgStation.station.value?.devcod ?? '';
|
|
113
|
+
currentHmewrkare.value = kgStation.station.value?.hmewrkare ?? '';
|
|
114
|
+
|
|
115
|
+
requestStations();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 获取所有工作站.
|
|
120
|
+
*/
|
|
121
|
+
async function requestStations(): Promise<void> {
|
|
122
|
+
try {
|
|
123
|
+
// TODO 调用接口获取所有工作站
|
|
124
|
+
stations.value = [
|
|
125
|
+
{
|
|
126
|
+
whId: 'WMD1',
|
|
127
|
+
devcod: 'AAA',
|
|
128
|
+
devcodDsc: 'AAA',
|
|
129
|
+
hmewrkare: 'A111',
|
|
130
|
+
workstationAreas: [
|
|
131
|
+
{ wrkare: 'A111', wrkareDsc: 'A111' },
|
|
132
|
+
{ wrkare: 'A222', wrkareDsc: 'A222' },
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
whId: 'WMD1',
|
|
137
|
+
devcod: 'BBB',
|
|
138
|
+
devcodDsc: 'BBB',
|
|
139
|
+
hmewrkare: 'B222',
|
|
140
|
+
workstationAreas: [
|
|
141
|
+
{ wrkare: 'B111', wrkareDsc: 'B111' },
|
|
142
|
+
{ wrkare: 'B222', wrkareDsc: 'B222' },
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
} catch (e) {
|
|
147
|
+
console.error(e);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// ----------------------------------------------------------------------------------------------------
|
|
151
|
+
//endregion
|
|
152
|
+
|
|
153
|
+
defineExpose({ open });
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<style scoped>
|
|
157
|
+
:deep(.uni-popup-dialog) {
|
|
158
|
+
font-size: 13px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:deep(.uni-popup-dialog) .uni-select {
|
|
162
|
+
padding-right: 4px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:deep(.uni-popup-dialog) .uni-label-pointer {
|
|
166
|
+
width: 100%;
|
|
167
|
+
margin: 0 !important;
|
|
168
|
+
padding: 12px 0 !important;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:deep(.uni-popup-dialog) .uni-dialog-content {
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
align-items: flex-start;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:deep(.uni-popup-dialog) .uni-dialog-content > .row {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
margin-bottom: 6px;
|
|
180
|
+
width: 100%;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:deep(.uni-popup-dialog) .uni-dialog-content > .row:last-child {
|
|
184
|
+
margin-bottom: 0px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:deep(.uni-popup-dialog) .uni-dialog-content > .row > .label {
|
|
188
|
+
width: 80px;
|
|
189
|
+
text-align: right;
|
|
190
|
+
margin-right: 6px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:deep(.uni-popup-dialog) .uni-dialog-content > .row > .value {
|
|
194
|
+
flex: 1;
|
|
195
|
+
min-width: 0;
|
|
196
|
+
}
|
|
197
|
+
</style>
|