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

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