@agile-team/wl-skills-kit 2.11.1 → 2.11.3

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.
Files changed (91) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +38 -21
  3. package/bin/wl-skills.js +27 -3
  4. package/files/.wl-skills/docs/jh-pagination.md +505 -505
  5. package/files/.wl-skills/docs/request.md +940 -940
  6. package/files/.wl-skills/docs/validate-exempt.md +113 -0
  7. package/files/.wl-skills/guides/architecture.md +1 -1
  8. package/files/.wl-skills/skills/_compat/headers/cursor-mdc.txt +1 -1
  9. package/files/.wl-skills/skills/_compat/headers/kiro.txt +1 -1
  10. package/files/.wl-skills/skills/_compat/headers/trae.txt +1 -1
  11. package/files/.wl-skills/skills/core/convention-audit/SKILL.md +3 -3
  12. package/files/.wl-skills/skills/core/spec-doc-parse/SKILL.md +332 -332
  13. package/files/.wl-skills/skills/core/spec-doc-parse/USAGE.md +97 -97
  14. package/files/.wl-skills/skills/sync/permission-sync/USAGE.md +107 -107
  15. package/files/.wl-skills/src/components/global/C_ParentView/index.vue +3 -3
  16. package/files/.wl-skills/src/components/global/C_RightToolbar/index.vue +157 -157
  17. package/files/.wl-skills/src/components/global/C_SvgIcon/index.vue +31 -31
  18. package/files/.wl-skills/src/components/global/C_SvgIcon/svgicon.js +10 -10
  19. package/files/.wl-skills/src/components/global/C_TagStatus/README.md +264 -264
  20. package/files/.wl-skills/src/components/global/C_TagStatus/config.ts +192 -192
  21. package/files/.wl-skills/src/components/global/C_TagStatus/index.vue +106 -106
  22. package/files/.wl-skills/src/components/global/C_TagStatus/types.ts +64 -64
  23. package/files/.wl-skills/src/components/global/C_Tree/README.md +153 -153
  24. package/files/.wl-skills/src/components/global/C_Tree/index.scss +42 -42
  25. package/files/.wl-skills/src/components/global/C_Tree/index.vue +78 -78
  26. package/files/.wl-skills/src/components/global/C_Tree/types.ts +59 -59
  27. package/files/.wl-skills/src/components/local/c_formModal/README.md +235 -235
  28. package/files/.wl-skills/src/components/local/c_formModal/data.ts +95 -95
  29. package/files/.wl-skills/src/components/local/c_formModal/index.scss +8 -8
  30. package/files/.wl-skills/src/components/local/c_formModal/index.vue +107 -107
  31. package/files/.wl-skills/src/components/local/c_formSections/data.ts +175 -175
  32. package/files/.wl-skills/src/components/local/c_formSections/index.scss +280 -280
  33. package/files/.wl-skills/src/components/local/c_formSections/index.vue +429 -429
  34. package/files/.wl-skills/src/components/local/c_listModal/data.ts +41 -41
  35. package/files/.wl-skills/src/components/local/c_listModal/index.vue +136 -136
  36. package/files/.wl-skills/src/components/local/c_spliterTitle/index.scss +25 -25
  37. package/files/.wl-skills/src/components/local/c_spliterTitle/index.vue +21 -21
  38. package/files/.wl-skills/src/components/remote/AGGrid/README.md +530 -530
  39. package/files/.wl-skills/src/components/remote/BaseForm/README.md +508 -508
  40. package/files/.wl-skills/src/components/remote/BaseQuery/README.md +865 -865
  41. package/files/.wl-skills/src/components/remote/BaseTable/README.md +941 -941
  42. package/files/.wl-skills/src/components/remote/BaseToolbar/README.md +496 -496
  43. package/files/.wl-skills/src/types/page.ts +24 -24
  44. package/files/.wl-skills/standards/04-coding-basics.md +39 -1
  45. package/files/.wl-skills/standards/09-typescript.md +26 -3
  46. package/files/.wl-skills/standards/12-base-table.md +56 -4
  47. package/files/.wl-skills/standards/13-platform-components.md +1 -0
  48. package/files/.wl-skills/standards/index.md +2 -2
  49. package/files/.wl-skills/templates/README.md +44 -44
  50. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add/api.md +54 -54
  51. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add/data.ts +346 -346
  52. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add/index.scss +1 -1
  53. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add/index.vue +28 -28
  54. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add-form/data.ts +115 -115
  55. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add-form/index.scss +44 -44
  56. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-add-form/index.vue +43 -43
  57. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change/data.ts +338 -338
  58. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change/index.scss +1 -1
  59. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change/index.vue +28 -28
  60. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change-form/data.ts +115 -115
  61. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change-form/index.scss +44 -44
  62. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-apply-change-form/index.vue +43 -43
  63. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-archive/api.md +88 -88
  64. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-archive/data.ts +601 -601
  65. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-archive/index.scss +1 -1
  66. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-archive/index.vue +64 -64
  67. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-detail/api.md +67 -67
  68. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-detail/data.ts +286 -286
  69. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-detail/index.scss +139 -139
  70. package/files/.wl-skills/templates/produce/aiflow/mmwr-customer-detail/index.vue +318 -318
  71. package/files/.wl-skills/templates/produce/aiflow/mmwr-temp-customer-archive/api.md +98 -98
  72. package/files/.wl-skills/templates/produce/aiflow/mmwr-temp-customer-archive/data.ts +543 -543
  73. package/files/.wl-skills/templates/produce/aiflow/mmwr-temp-customer-archive/index.scss +1 -1
  74. package/files/.wl-skills/templates/produce/aiflow/mmwr-temp-customer-archive/index.vue +52 -52
  75. package/files/.wl-skills/templates/sale/demo/add-demo/data.ts +518 -518
  76. package/files/.wl-skills/templates/sale/demo/billet-flame-cut-plan/data.ts +524 -524
  77. package/files/.wl-skills/templates/sale/demo/billet-flame-cut-plan/index.scss +154 -154
  78. package/files/.wl-skills/templates/sale/demo/billet-flame-cut-plan/index.vue +117 -117
  79. package/files/.wl-skills/templates/sale/demo/domestic-trade-order/data.ts +308 -308
  80. package/files/.wl-skills/templates/sale/demo/domestic-trade-order/index.scss +99 -99
  81. package/files/.wl-skills/templates/sale/demo/domestic-trade-order/index.vue +77 -77
  82. package/files/.wl-skills/templates/sale/demo/heat-batch-return/data.ts +367 -367
  83. package/files/.wl-skills/templates/sale/demo/heat-batch-return/index.scss +100 -100
  84. package/files/.wl-skills/templates/sale/demo/heat-batch-return/index.vue +170 -170
  85. package/files/.wl-skills/templates/sale/demo/heat-batch-return/meltDialog.vue +320 -320
  86. package/files/.wl-skills/templates/sale/demo/metallurgical-spec/data.ts +824 -824
  87. package/lib/ast-rules.js +395 -12
  88. package/mcp/config.js +46 -46
  89. package/mcp/registry.js +6 -1
  90. package/mcp/tools/projectTools.js +9 -1
  91. package/package.json +2 -2
@@ -1,346 +1,346 @@
1
- import {
2
- AbstractPageQueryHook,
3
- BaseQueryItemDesc,
4
- ActionButtonDesc,
5
- TableColumnDesc
6
- } from "@/types/page";
7
- import { postAction } from "@jhlc/common-core/src/api/action";
8
- import envConfig from "@jhlc/common-core/src/store/env-config";
9
- import { ElMessage, ElMessageBox } from "element-plus";
10
- import { h, resolveComponent } from "vue";
11
-
12
- // ===== 状态色块渲染 =====
13
- const STATUS_TAG_MAP: Record<string, Record<string, string>> = {
14
- approvalStatus: {
15
- 开立审批中: "",
16
- 审批完成: "success",
17
- 驳回: "danger",
18
- 流程终止: "info"
19
- },
20
- verifyStatus: { 已核实: "success", 未核实: "info" }
21
- };
22
- function renderStatusTag(row: any, field: string) {
23
- const val = row[field];
24
- const typeMap = STATUS_TAG_MAP[field];
25
- if (!typeMap) return val;
26
- const type = Object.prototype.hasOwnProperty.call(typeMap, val)
27
- ? typeMap[val]
28
- : undefined;
29
- if (type === undefined) return val;
30
- return h(
31
- resolveComponent("ElTag") as any,
32
- { type: type || "", effect: "light", size: "small" },
33
- () => val
34
- );
35
- }
36
-
37
- export const API_CONFIG = {
38
- list: "/sale/customerApply/addList",
39
- remove: "/sale/customerApply/remove",
40
- getById: "/sale/customerApply/getById",
41
- save: "/sale/customerApply/save",
42
- update: "/sale/customerApply/update",
43
- submit: "/sale/customerApply/submit",
44
- withdraw: "/sale/customerApply/withdraw",
45
- export: "/sale/customerApply/export"
46
- } as const;
47
-
48
- const OPTS = {
49
- approvalProduct: [
50
- { label: "热轧", value: "热轧" },
51
- { label: "盘元", value: "盘元" },
52
- { label: "冷精", value: "冷精" },
53
- { label: "汽车", value: "汽车" }
54
- ],
55
- applyOrg: [
56
- { label: "不锈鋼接單中心", value: "不锈鋼接單中心" },
57
- {
58
- label: "江阴华新特殊合金材料有限公司",
59
- value: "江阴华新特殊合金材料有限公司"
60
- },
61
- { label: "揉瞒管理中心", value: "揉瞒管理中心" },
62
- { label: "烟台华鑫再生资源有限公司", value: "烟台华鑫再生资源有限公司" }
63
- ],
64
- applyType: [
65
- { label: "新增", value: "新增" },
66
- { label: "变更", value: "变更" }
67
- ],
68
- applyDept: [
69
- { label: "業務管理處", value: "業務管理處" },
70
- { label: "線材銷售部", value: "線材銷售部" },
71
- { label: "無縫管銷售處", value: "無縫管銷售處" },
72
- { label: "華南銷售科", value: "華南銷售科" },
73
- { label: "汽車產業銷售科", value: "汽車產業銷售科" }
74
- ],
75
- applicant: [
76
- { label: "魏子明", value: "魏子明" },
77
- { label: "龚辉鉴", value: "龚辉鉴" },
78
- { label: "宋书迪", value: "宋书迪" },
79
- { label: "李锋", value: "李锋" },
80
- { label: "杨松", value: "杨松" }
81
- ],
82
- approvalStatus: [
83
- { label: "开立审批中", value: "开立审批中" },
84
- { label: "审批完成", value: "审批完成" },
85
- { label: "驳回", value: "驳回" },
86
- { label: "流程终止", value: "流程终止" }
87
- ],
88
- verifyStatus: [
89
- { label: "已核实", value: "已核实" },
90
- { label: "未核实", value: "未核实" }
91
- ]
92
- };
93
-
94
- const FORM_ROUTE = "/aiflow/mmwrCustomerApplyAddForm";
95
-
96
- function navigateToForm(query?: Record<string, string>) {
97
- const router = envConfig()?.router;
98
- if (!router) {
99
- ElMessage.error("路由未初始化,请刷新页面重试");
100
- return;
101
- }
102
- const target: any = { path: FORM_ROUTE };
103
- if (query) target.query = query;
104
- location.href = router.resolve(target).href;
105
- }
106
-
107
- export function createPage() {
108
- const Page = new (class extends AbstractPageQueryHook {
109
- constructor() {
110
- super({ url: { list: API_CONFIG.list, remove: API_CONFIG.remove } });
111
- }
112
-
113
- queryDef(): BaseQueryItemDesc<any>[] {
114
- return [
115
- { name: "customerCode", label: "客户编码", placeholder: "请输入" },
116
- {
117
- name: "approvalProduct",
118
- label: "审批产品别",
119
- component: () => ({ tag: "jh-select", items: OPTS.approvalProduct })
120
- },
121
- {
122
- name: "applyOrg",
123
- label: "申请组织",
124
- component: () => ({ tag: "jh-select", items: OPTS.applyOrg })
125
- },
126
- { name: "customerName", label: "客户名称", placeholder: "请输入" },
127
- {
128
- name: "applyType",
129
- label: "申请类型",
130
- component: () => ({ tag: "jh-select", items: OPTS.applyType })
131
- },
132
- {
133
- name: "applyDept",
134
- label: "申请部门",
135
- component: () => ({ tag: "jh-select", items: OPTS.applyDept })
136
- },
137
- {
138
- name: "applicant",
139
- label: "申请人",
140
- component: () => ({ tag: "jh-select", items: OPTS.applicant })
141
- },
142
- {
143
- name: "approvalStatus",
144
- label: "审批状态",
145
- component: () => ({ tag: "jh-select", items: OPTS.approvalStatus })
146
- },
147
- {
148
- name: "applyDate",
149
- startName: "applyDateStart",
150
- endName: "applyDateEnd",
151
- label: "申请日期",
152
- component: () => ({
153
- tag: "jh-date",
154
- type: "daterange",
155
- rangeSeparator: "至",
156
- showFormat: "YYYY-MM-DD",
157
- valueFormat: "YYYY-MM-DD"
158
- })
159
- },
160
- {
161
- name: "verifyStatus",
162
- label: "核实状态",
163
- component: () => ({ tag: "jh-select", items: OPTS.verifyStatus })
164
- }
165
- ];
166
- }
167
-
168
- toolbarDef(): ActionButtonDesc[] {
169
- return [
170
- {
171
- name: "primary",
172
- label: "新增申请",
173
- onClick: () => navigateToForm()
174
- },
175
- {
176
- label: "提交",
177
- type: "primary",
178
- plain: true,
179
- onClick: () => {
180
- const rows = this.tableRef.value?.getSelectionRows();
181
- if (!rows?.length) {
182
- ElMessage.warning("请先选择数据");
183
- return;
184
- }
185
- const ids = rows.map((r: any) => r.id);
186
- ElMessageBox.confirm("确定提交选中申请?", "提示", { type: "info" })
187
- .then(() => {
188
- postAction(API_CONFIG.submit, { ids }).then(() => {
189
- ElMessage.success("提交成功");
190
- this.select();
191
- });
192
- })
193
- .catch(() => {});
194
- }
195
- },
196
- {
197
- label: "删除",
198
- type: "danger",
199
- plain: true,
200
- onClick: () => {
201
- const rows = this.tableRef.value?.getSelectionRows();
202
- if (!rows?.length) {
203
- ElMessage.warning("请先选择数据");
204
- return;
205
- }
206
- this.removeBatch();
207
- }
208
- },
209
- {
210
- label: "审批驳回",
211
- type: "danger",
212
- plain: true,
213
- onClick: () => {
214
- const rows = this.tableRef.value?.getSelectionRows();
215
- if (!rows?.length) {
216
- ElMessage.warning("请先选择数据");
217
- return;
218
- }
219
- const ids = rows.map((r: any) => r.id);
220
- ElMessageBox.confirm("确定驳回选中申请?", "提示", {
221
- type: "warning"
222
- })
223
- .then(() => {
224
- postAction(API_CONFIG.update, {
225
- ids,
226
- approvalStatus: "驳回"
227
- }).then(() => {
228
- ElMessage.success("已驳回");
229
- this.select();
230
- });
231
- })
232
- .catch(() => {});
233
- }
234
- },
235
- {
236
- label: "审批通过",
237
- type: "success",
238
- plain: true,
239
- onClick: () => {
240
- const rows = this.tableRef.value?.getSelectionRows();
241
- if (!rows?.length) {
242
- ElMessage.warning("请先选择数据");
243
- return;
244
- }
245
- const ids = rows.map((r: any) => r.id);
246
- ElMessageBox.confirm("确定审批通过?", "提示", { type: "success" })
247
- .then(() => {
248
- postAction(API_CONFIG.update, {
249
- ids,
250
- approvalStatus: "审批完成"
251
- }).then(() => {
252
- ElMessage.success("审批通过");
253
- this.select();
254
- });
255
- })
256
- .catch(() => {});
257
- }
258
- },
259
- {
260
- label: "导出",
261
- plain: true,
262
- onClick: () => {
263
- postAction(API_CONFIG.export, this.queryParam.value).then(() => {
264
- ElMessage.success("导出成功");
265
- });
266
- }
267
- }
268
- ];
269
- }
270
-
271
- columnsDef(): TableColumnDesc<any>[] {
272
- return [
273
- { type: "selection" },
274
- { type: "index" },
275
- {
276
- label: "申请编码",
277
- name: "applyCode",
278
- minWidth: 160,
279
- defaultSlot: ({ row }: any) =>
280
- h(
281
- "span",
282
- {
283
- style:
284
- "color:#409eff;cursor:pointer;text-decoration:underline;",
285
- onClick: () => navigateToForm({ id: row.id })
286
- },
287
- row.applyCode
288
- )
289
- },
290
- { label: "申请类型", name: "applyType", minWidth: 100 },
291
- { label: "客户编码", name: "customerCode", minWidth: 120 },
292
- {
293
- label: "客户名称",
294
- name: "customerName",
295
- minWidth: 200,
296
- showOverflowTooltip: true
297
- },
298
- { label: "审批产品别", name: "approvalProduct", minWidth: 100 },
299
- { label: "申请原因", name: "applyReason", minWidth: 120 },
300
- { label: "申请人", name: "applicant", minWidth: 100 },
301
- { label: "申请部门", name: "applyDept", minWidth: 130 },
302
- {
303
- label: "申请组织",
304
- name: "applyOrg",
305
- minWidth: 180,
306
- showOverflowTooltip: true
307
- },
308
- { label: "创建人", name: "creator", minWidth: 100 },
309
- { label: "创建时间", name: "createTime", minWidth: 160 },
310
- {
311
- label: "审批状态",
312
- name: "approvalStatus",
313
- minWidth: 110,
314
- fixed: "right",
315
- defaultSlot: ({ row }: any) => renderStatusTag(row, "approvalStatus")
316
- },
317
- {
318
- label: "核实状态",
319
- name: "verifyStatus",
320
- minWidth: 100,
321
- fixed: "right",
322
- defaultSlot: ({ row }: any) => renderStatusTag(row, "verifyStatus")
323
- },
324
- {
325
- label: "操作",
326
- width: 140,
327
- fixed: "right",
328
- operations: [
329
- {
330
- name: "edit",
331
- label: "编辑",
332
- onClick: (row: any) => navigateToForm({ id: row.id })
333
- },
334
- {
335
- name: "remove",
336
- label: "删除",
337
- onClick: (row: any) => this.remove(row.id)
338
- }
339
- ]
340
- }
341
- ];
342
- }
343
- })();
344
-
345
- return (Page as any).create() as any;
346
- }
1
+ import {
2
+ AbstractPageQueryHook,
3
+ BaseQueryItemDesc,
4
+ ActionButtonDesc,
5
+ TableColumnDesc
6
+ } from "@/types/page";
7
+ import { postAction } from "@jhlc/common-core/src/api/action";
8
+ import envConfig from "@jhlc/common-core/src/store/env-config";
9
+ import { ElMessage, ElMessageBox } from "element-plus";
10
+ import { h, resolveComponent } from "vue";
11
+
12
+ // ===== 状态色块渲染 =====
13
+ const STATUS_TAG_MAP: Record<string, Record<string, string>> = {
14
+ approvalStatus: {
15
+ 开立审批中: "",
16
+ 审批完成: "success",
17
+ 驳回: "danger",
18
+ 流程终止: "info"
19
+ },
20
+ verifyStatus: { 已核实: "success", 未核实: "info" }
21
+ };
22
+ function renderStatusTag(row: any, field: string) {
23
+ const val = row[field];
24
+ const typeMap = STATUS_TAG_MAP[field];
25
+ if (!typeMap) return val;
26
+ const type = Object.prototype.hasOwnProperty.call(typeMap, val)
27
+ ? typeMap[val]
28
+ : undefined;
29
+ if (type === undefined) return val;
30
+ return h(
31
+ resolveComponent("ElTag") as any,
32
+ { type: type || "", effect: "light", size: "small" },
33
+ () => val
34
+ );
35
+ }
36
+
37
+ export const API_CONFIG = {
38
+ list: "/sale/customerApply/addList",
39
+ remove: "/sale/customerApply/remove",
40
+ getById: "/sale/customerApply/getById",
41
+ save: "/sale/customerApply/save",
42
+ update: "/sale/customerApply/update",
43
+ submit: "/sale/customerApply/submit",
44
+ withdraw: "/sale/customerApply/withdraw",
45
+ export: "/sale/customerApply/export"
46
+ } as const;
47
+
48
+ const OPTS = {
49
+ approvalProduct: [
50
+ { label: "热轧", value: "热轧" },
51
+ { label: "盘元", value: "盘元" },
52
+ { label: "冷精", value: "冷精" },
53
+ { label: "汽车", value: "汽车" }
54
+ ],
55
+ applyOrg: [
56
+ { label: "不锈鋼接單中心", value: "不锈鋼接單中心" },
57
+ {
58
+ label: "江阴华新特殊合金材料有限公司",
59
+ value: "江阴华新特殊合金材料有限公司"
60
+ },
61
+ { label: "揉瞒管理中心", value: "揉瞒管理中心" },
62
+ { label: "烟台华鑫再生资源有限公司", value: "烟台华鑫再生资源有限公司" }
63
+ ],
64
+ applyType: [
65
+ { label: "新增", value: "新增" },
66
+ { label: "变更", value: "变更" }
67
+ ],
68
+ applyDept: [
69
+ { label: "業務管理處", value: "業務管理處" },
70
+ { label: "線材銷售部", value: "線材銷售部" },
71
+ { label: "無縫管銷售處", value: "無縫管銷售處" },
72
+ { label: "華南銷售科", value: "華南銷售科" },
73
+ { label: "汽車產業銷售科", value: "汽車產業銷售科" }
74
+ ],
75
+ applicant: [
76
+ { label: "魏子明", value: "魏子明" },
77
+ { label: "龚辉鉴", value: "龚辉鉴" },
78
+ { label: "宋书迪", value: "宋书迪" },
79
+ { label: "李锋", value: "李锋" },
80
+ { label: "杨松", value: "杨松" }
81
+ ],
82
+ approvalStatus: [
83
+ { label: "开立审批中", value: "开立审批中" },
84
+ { label: "审批完成", value: "审批完成" },
85
+ { label: "驳回", value: "驳回" },
86
+ { label: "流程终止", value: "流程终止" }
87
+ ],
88
+ verifyStatus: [
89
+ { label: "已核实", value: "已核实" },
90
+ { label: "未核实", value: "未核实" }
91
+ ]
92
+ };
93
+
94
+ const FORM_ROUTE = "/aiflow/mmwrCustomerApplyAddForm";
95
+
96
+ function navigateToForm(query?: Record<string, string>) {
97
+ const router = envConfig()?.router;
98
+ if (!router) {
99
+ ElMessage.error("路由未初始化,请刷新页面重试");
100
+ return;
101
+ }
102
+ const target: any = { path: FORM_ROUTE };
103
+ if (query) target.query = query;
104
+ location.href = router.resolve(target).href;
105
+ }
106
+
107
+ export function createPage() {
108
+ const Page = new (class extends AbstractPageQueryHook {
109
+ constructor() {
110
+ super({ url: { list: API_CONFIG.list, remove: API_CONFIG.remove } });
111
+ }
112
+
113
+ queryDef(): BaseQueryItemDesc<any>[] {
114
+ return [
115
+ { name: "customerCode", label: "客户编码", placeholder: "请输入" },
116
+ {
117
+ name: "approvalProduct",
118
+ label: "审批产品别",
119
+ component: () => ({ tag: "jh-select", items: OPTS.approvalProduct })
120
+ },
121
+ {
122
+ name: "applyOrg",
123
+ label: "申请组织",
124
+ component: () => ({ tag: "jh-select", items: OPTS.applyOrg })
125
+ },
126
+ { name: "customerName", label: "客户名称", placeholder: "请输入" },
127
+ {
128
+ name: "applyType",
129
+ label: "申请类型",
130
+ component: () => ({ tag: "jh-select", items: OPTS.applyType })
131
+ },
132
+ {
133
+ name: "applyDept",
134
+ label: "申请部门",
135
+ component: () => ({ tag: "jh-select", items: OPTS.applyDept })
136
+ },
137
+ {
138
+ name: "applicant",
139
+ label: "申请人",
140
+ component: () => ({ tag: "jh-select", items: OPTS.applicant })
141
+ },
142
+ {
143
+ name: "approvalStatus",
144
+ label: "审批状态",
145
+ component: () => ({ tag: "jh-select", items: OPTS.approvalStatus })
146
+ },
147
+ {
148
+ name: "applyDate",
149
+ startName: "applyDateStart",
150
+ endName: "applyDateEnd",
151
+ label: "申请日期",
152
+ component: () => ({
153
+ tag: "jh-date",
154
+ type: "daterange",
155
+ rangeSeparator: "至",
156
+ showFormat: "YYYY-MM-DD",
157
+ valueFormat: "YYYY-MM-DD"
158
+ })
159
+ },
160
+ {
161
+ name: "verifyStatus",
162
+ label: "核实状态",
163
+ component: () => ({ tag: "jh-select", items: OPTS.verifyStatus })
164
+ }
165
+ ];
166
+ }
167
+
168
+ toolbarDef(): ActionButtonDesc[] {
169
+ return [
170
+ {
171
+ name: "primary",
172
+ label: "新增申请",
173
+ onClick: () => navigateToForm()
174
+ },
175
+ {
176
+ label: "提交",
177
+ type: "primary",
178
+ plain: true,
179
+ onClick: () => {
180
+ const rows = this.tableRef.value?.getSelectionRows();
181
+ if (!rows?.length) {
182
+ ElMessage.warning("请先选择数据");
183
+ return;
184
+ }
185
+ const ids = rows.map((r: any) => r.id);
186
+ ElMessageBox.confirm("确定提交选中申请?", "提示", { type: "info" })
187
+ .then(() => {
188
+ postAction(API_CONFIG.submit, { ids }).then(() => {
189
+ ElMessage.success("提交成功");
190
+ this.select();
191
+ });
192
+ })
193
+ .catch(() => {});
194
+ }
195
+ },
196
+ {
197
+ label: "删除",
198
+ type: "danger",
199
+ plain: true,
200
+ onClick: () => {
201
+ const rows = this.tableRef.value?.getSelectionRows();
202
+ if (!rows?.length) {
203
+ ElMessage.warning("请先选择数据");
204
+ return;
205
+ }
206
+ this.removeBatch();
207
+ }
208
+ },
209
+ {
210
+ label: "审批驳回",
211
+ type: "danger",
212
+ plain: true,
213
+ onClick: () => {
214
+ const rows = this.tableRef.value?.getSelectionRows();
215
+ if (!rows?.length) {
216
+ ElMessage.warning("请先选择数据");
217
+ return;
218
+ }
219
+ const ids = rows.map((r: any) => r.id);
220
+ ElMessageBox.confirm("确定驳回选中申请?", "提示", {
221
+ type: "warning"
222
+ })
223
+ .then(() => {
224
+ postAction(API_CONFIG.update, {
225
+ ids,
226
+ approvalStatus: "驳回"
227
+ }).then(() => {
228
+ ElMessage.success("已驳回");
229
+ this.select();
230
+ });
231
+ })
232
+ .catch(() => {});
233
+ }
234
+ },
235
+ {
236
+ label: "审批通过",
237
+ type: "success",
238
+ plain: true,
239
+ onClick: () => {
240
+ const rows = this.tableRef.value?.getSelectionRows();
241
+ if (!rows?.length) {
242
+ ElMessage.warning("请先选择数据");
243
+ return;
244
+ }
245
+ const ids = rows.map((r: any) => r.id);
246
+ ElMessageBox.confirm("确定审批通过?", "提示", { type: "success" })
247
+ .then(() => {
248
+ postAction(API_CONFIG.update, {
249
+ ids,
250
+ approvalStatus: "审批完成"
251
+ }).then(() => {
252
+ ElMessage.success("审批通过");
253
+ this.select();
254
+ });
255
+ })
256
+ .catch(() => {});
257
+ }
258
+ },
259
+ {
260
+ label: "导出",
261
+ plain: true,
262
+ onClick: () => {
263
+ postAction(API_CONFIG.export, this.queryParam.value).then(() => {
264
+ ElMessage.success("导出成功");
265
+ });
266
+ }
267
+ }
268
+ ];
269
+ }
270
+
271
+ columnsDef(): TableColumnDesc<any>[] {
272
+ return [
273
+ { type: "selection" },
274
+ { type: "index" },
275
+ {
276
+ label: "申请编码",
277
+ name: "applyCode",
278
+ minWidth: 160,
279
+ defaultSlot: ({ row }: any) =>
280
+ h(
281
+ "span",
282
+ {
283
+ style:
284
+ "color:#409eff;cursor:pointer;text-decoration:underline;",
285
+ onClick: () => navigateToForm({ id: row.id })
286
+ },
287
+ row.applyCode
288
+ )
289
+ },
290
+ { label: "申请类型", name: "applyType", minWidth: 100 },
291
+ { label: "客户编码", name: "customerCode", minWidth: 120 },
292
+ {
293
+ label: "客户名称",
294
+ name: "customerName",
295
+ minWidth: 200,
296
+ showOverflowTooltip: true
297
+ },
298
+ { label: "审批产品别", name: "approvalProduct", minWidth: 100 },
299
+ { label: "申请原因", name: "applyReason", minWidth: 120 },
300
+ { label: "申请人", name: "applicant", minWidth: 100 },
301
+ { label: "申请部门", name: "applyDept", minWidth: 130 },
302
+ {
303
+ label: "申请组织",
304
+ name: "applyOrg",
305
+ minWidth: 180,
306
+ showOverflowTooltip: true
307
+ },
308
+ { label: "创建人", name: "creator", minWidth: 100 },
309
+ { label: "创建时间", name: "createTime", minWidth: 160 },
310
+ {
311
+ label: "审批状态",
312
+ name: "approvalStatus",
313
+ minWidth: 110,
314
+ fixed: "right",
315
+ defaultSlot: ({ row }: any) => renderStatusTag(row, "approvalStatus")
316
+ },
317
+ {
318
+ label: "核实状态",
319
+ name: "verifyStatus",
320
+ minWidth: 100,
321
+ fixed: "right",
322
+ defaultSlot: ({ row }: any) => renderStatusTag(row, "verifyStatus")
323
+ },
324
+ {
325
+ label: "操作",
326
+ width: 140,
327
+ fixed: "right",
328
+ operations: [
329
+ {
330
+ name: "edit",
331
+ label: "编辑",
332
+ onClick: (row: any) => navigateToForm({ id: row.id })
333
+ },
334
+ {
335
+ name: "remove",
336
+ label: "删除",
337
+ onClick: (row: any) => this.remove(row.id)
338
+ }
339
+ ]
340
+ }
341
+ ];
342
+ }
343
+ })();
344
+
345
+ return (Page as any).create() as any;
346
+ }