@qqt-product/system 0.0.2 → 0.0.16

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 (105) hide show
  1. package/dist/index.es.js +53240 -10634
  2. package/dist/index.umd.js +94 -21
  3. package/dist/lib/components/QAccountList/src/QAccountCreate.vue.d.ts +2878 -0
  4. package/dist/lib/components/QAccountList/src/QAccountDetail.vue.d.ts +2871 -0
  5. package/dist/lib/components/QAccountList/src/QAccountEdit.vue.d.ts +2878 -0
  6. package/dist/lib/components/QAccountList/src/QAccountList.vue.d.ts +23 -4
  7. package/dist/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue.d.ts +9 -4
  8. package/dist/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue.d.ts +9 -4
  9. package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordDetail.vue.d.ts +2864 -0
  10. package/dist/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue.d.ts +2 -3
  11. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsDetail.vue.d.ts +2864 -0
  12. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue.d.ts +2876 -0
  13. package/dist/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue.d.ts +29 -14
  14. package/dist/lib/components/QI18nList/src/QI18nList.vue.d.ts +2 -6
  15. package/dist/lib/components/QImChatGroupList/src/QImChatGroupList.vue.d.ts +5 -8
  16. package/dist/lib/components/QMqRecordList/src/QMqRecordList.vue.d.ts +9 -4
  17. package/dist/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue.d.ts +2872 -0
  18. package/dist/lib/components/QPermissionDataList/src/QPermissionDataList.vue.d.ts +126 -0
  19. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue.d.ts +2864 -0
  20. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue.d.ts +2887 -0
  21. package/dist/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue.d.ts +25 -5
  22. package/dist/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.d.ts +7 -0
  23. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue.d.ts +221 -28
  24. package/dist/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue.d.ts +45 -0
  25. package/dist/lib/components/QQuartzJobList/src/QQuartzJobList.vue.d.ts +24 -5
  26. package/dist/lib/components/QRoleList/src/QRoleList.vue.d.ts +23 -7
  27. package/dist/lib/components/QRoleList/src/useConfigData.d.ts +1 -11
  28. package/dist/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue.d.ts +7 -3
  29. package/dist/lib/components/QUsageList/src/QUsageList.vue.d.ts +15 -35
  30. package/dist/lib/components/QUsageList/src/useConfigData.d.ts +111 -10
  31. package/dist/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue.d.ts +25 -0
  32. package/dist/lib/components/QcustomConfigEdit/component/regexComponent.d.ts +9 -10
  33. package/dist/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue.d.ts +1209 -0
  34. package/dist/lib/components/QcustomConfigEdit/src/useConfigData.d.ts +1 -1
  35. package/dist/lib/components/QcustomConfigList/src/QcustomConfigList.vue.d.ts +8 -7
  36. package/dist/lib/components/QsysConfigList/src/QsysConfigList.vue.d.ts +2 -3
  37. package/dist/lib/components/index.d.ts +2 -2
  38. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesDetail.vue.d.ts +2863 -0
  39. package/dist/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue.d.ts +2872 -0
  40. package/dist/lib/components/integratedNodesList/src/index.vue.d.ts +8 -11
  41. package/dist/lib/components/integratedReportSearchList/src/index.vue.d.ts +16 -10
  42. package/dist/lib/components/loginAbnormalLogList/src/index.vue.d.ts +2 -9
  43. package/dist/lib/components/loginLogList/src/index.vue.d.ts +2 -8
  44. package/dist/lib/components/loginSupplierLogList/src/index.vue.d.ts +2 -12
  45. package/dist/lib/components/operateLogList/src/index.vue.d.ts +2 -13
  46. package/dist/style.css +1 -1
  47. package/dist/vite-env.d.ts +13 -13
  48. package/package.json +13 -11
  49. package/src/lib/components/QAccountList/src/QAccountCreate.vue +272 -0
  50. package/src/lib/components/QAccountList/src/QAccountDetail.vue +82 -14
  51. package/src/lib/components/QAccountList/src/QAccountEdit.vue +65 -33
  52. package/src/lib/components/QAccountList/src/QAccountList.vue +532 -530
  53. package/src/lib/components/QBackgroundFileTaskList/src/QBackgroundFileTaskList.vue +143 -137
  54. package/src/lib/components/QElsEmailSendLogList/src/QElsEmailSendLogList.vue +172 -166
  55. package/src/lib/components/QElsMsgRecordList/src/QElsMsgRecordList.vue +123 -124
  56. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsEdit.vue +66 -18
  57. package/src/lib/components/QElsTenantPortalNewsList/src/QElsTenantPortalNewsList.vue +151 -122
  58. package/src/lib/components/QI18nList/src/QI18nList.vue +365 -361
  59. package/src/lib/components/QImChatGroupList/src/QImChatGroupList.vue +103 -94
  60. package/src/lib/components/QMqRecordList/src/QMqRecordList.vue +109 -105
  61. package/src/lib/components/QPermissionDataList/src/QPermissionDataAuth.vue +3 -3
  62. package/src/lib/components/QPermissionDataList/src/QPermissionDataEdit.vue +218 -221
  63. package/src/lib/components/QPermissionDataList/src/QPermissionDataList.vue +110 -117
  64. package/src/lib/components/QPermissionDataList/src/form.vue +109 -109
  65. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeDetail.vue +1 -1
  66. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeEdit.vue +120 -32
  67. package/src/lib/components/QPurchaseNoticeList/src/QPurchaseNoticeList.vue +189 -163
  68. package/src/lib/components/QPurchaseNoticeList/src/use-field-select-modal-hook.ts +84 -0
  69. package/src/lib/components/QPurchaseNoticeList/src/useConfigData.ts +22 -22
  70. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateList.vue +134 -85
  71. package/src/lib/components/QPurchaseNoticeTemplateList/src/QPurchaseNoticeTemplateModal.vue +91 -0
  72. package/src/lib/components/QQuartzJobList/src/QQuartzJobList.vue +276 -263
  73. package/src/lib/components/QRoleList/src/QRoleList.vue +332 -288
  74. package/src/lib/components/QRoleList/src/useConfigData.ts +1 -6
  75. package/src/lib/components/QSupplierAccountList/src/QSupplierAccountList.vue +304 -302
  76. package/src/lib/components/QUsageList/src/QUsageList.vue +287 -82
  77. package/src/lib/components/QUsageList/src/useConfigData.ts +147 -13
  78. package/src/lib/components/QcustomConfigEdit/component/AddDictCodeModal.vue +140 -140
  79. package/src/lib/components/QcustomConfigEdit/component/regexComponent.tsx +28 -28
  80. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigEdit.vue +130 -42
  81. package/src/lib/components/QcustomConfigEdit/src/QcustomConfigRender.tsx +2 -2
  82. package/src/lib/components/QcustomConfigEdit/src/useConfigData.ts +2 -2
  83. package/src/lib/components/QcustomConfigEdit/src/useConstant.ts +12 -12
  84. package/src/lib/components/QcustomConfigList/src/QcustomConfigList.vue +276 -268
  85. package/src/lib/components/QcustomConfigList/src/useConfigData.ts +1 -1
  86. package/src/lib/components/QsysConfigList/src/QsysConfigList.vue +124 -125
  87. package/src/lib/components/index.ts +78 -78
  88. package/src/lib/components/integratedNodesList/src/QIntegratedNodesEdit.vue +2 -10
  89. package/src/lib/components/integratedNodesList/src/index.vue +130 -136
  90. package/src/lib/components/integratedReportList/src/index.vue +55 -30
  91. package/src/lib/components/integratedReportSearchList/src/index.vue +106 -66
  92. package/src/lib/components/loginAbnormalLogList/src/index.vue +43 -50
  93. package/src/lib/components/loginLogList/src/index.vue +51 -57
  94. package/src/lib/components/loginSupplierLogList/src/index.vue +53 -63
  95. package/src/lib/components/operateLogList/src/index.vue +46 -57
  96. package/src/vite-env.d.ts +13 -13
  97. package/tsconfig.json +24 -24
  98. package/vite.config.ts +1 -1
  99. package/dist/lib/components/QCompanyermissionList/src/form.vue.d.ts +0 -80
  100. package/dist/lib/components/QCompanyermissionList/src/types.d.ts +0 -44
  101. package/dist/lib/components/integratedReportList/src/index.vue.d.ts +0 -70
  102. package/src/lib/components/QCompanyermissionList/src/editTree.vue +0 -291
  103. package/src/lib/components/QCompanyermissionList/src/form.vue +0 -238
  104. package/src/lib/components/QCompanyermissionList/src/index.vue +0 -309
  105. package/src/lib/components/QCompanyermissionList/src/types.ts +0 -44
@@ -1,530 +1,532 @@
1
- <template>
2
- <div style="height: 100%">
3
- <q-list-layout ref="listLayoutRef" v-if="!showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
4
-
5
- <!--工作交接-->
6
- <vxe-modal v-model="deliverToShow" title="工作转交" type="confirm" :showFooter="false">
7
- <vxe-form title-colon title-align="right" title-width="160" :data="deliverToFrom" :rules="deliverToFromRule" @submit="deliverTosubmitEvent">
8
- <vxe-form-gather span="24">
9
- <vxe-form-item title="转交人" field="realname" span="24">
10
- <template #default="{ data }">
11
- <vxe-input :disabled="true" v-model="data.realname" type="text" placeholder="请输入转交人"></vxe-input>
12
- </template>
13
- </vxe-form-item>
14
-
15
- <vxe-form-item title="接收人" field="receiveId" span="24">
16
- <template #default="{ data }">
17
- <a-select :filter-option="filterOption" placeholder="请选择接收人" v-model:value="data.receiveId" :options="subAccountList"></a-select>
18
- </template>
19
- </vxe-form-item>
20
- <vxe-form-item title="转交内容" field="businessDeliverToType" span="24">
21
- <template #default="{ data }">
22
- <q-select mode="multiple" style="width: 200px" v-model:value="data.businessDeliverToType" dict-code="businessDeliverToType" placeholder="请输入转交内容"></q-select>
23
- </template>
24
- </vxe-form-item>
25
-
26
- <vxe-form-item align="center" span="24">
27
- <template #default>
28
- <vxe-button content="取消" @click="deliverToShow = false"></vxe-button>
29
- <vxe-button type="submit" status="primary" content="保存"></vxe-button>
30
- </template>
31
- </vxe-form-item>
32
- </vxe-form-gather>
33
- </vxe-form>
34
- </vxe-modal>
35
- <!--更改密码-->
36
- <vxe-modal v-model="passwordModalShow" title="重新设定密码">
37
- <template #default>
38
- <vxe-form ref="passwordRef" title-colon title-align="right" title-width="160" :data="passwordModalForm" :rules="passwordModalFormRule">
39
- <vxe-form-gather span="24">
40
- <vxe-form-item title="ELS账号" field="elsAccount" span="24">
41
- <template #default="{ data }">
42
- <vxe-input :disabled="true" v-model="data.elsAccount" type="text" placeholder="请输入ELS账号" clearable></vxe-input>
43
- </template>
44
- </vxe-form-item>
45
- <vxe-form-item title="子账号" field="subAccount" span="24">
46
- <template #default="{ data }">
47
- <vxe-input :disabled="true" v-model="data.subAccount" type="text" placeholder="请输入子账号" clearable></vxe-input>
48
- </template>
49
- </vxe-form-item>
50
- <vxe-form-item title="登录密码" field="password" span="24">
51
- <template #default="{ data }">
52
- <vxe-input v-model="data.password" type="text" placeholder="请输入登录密码" clearable></vxe-input>
53
- </template>
54
- </vxe-form-item>
55
- <vxe-form-item title="确认密码" field="confirmpassword" span="24">
56
- <template #default="{ data }">
57
- <vxe-input v-model="data.confirmpassword" type="text" placeholder="请输入确认密码" clearable></vxe-input>
58
- </template>
59
- </vxe-form-item>
60
- <vxe-form-item align="center" span="24">
61
- <template #default>
62
- <vxe-button content="取消" @click="passwordModalShow = false"></vxe-button>
63
- <vxe-button @click="passwordModalHandle('confirm')" content="保存"></vxe-button>
64
- </template>
65
- </vxe-form-item>
66
- </vxe-form-gather>
67
- </vxe-form>
68
- </template>
69
- </vxe-modal>
70
- </div>
71
- </template>
72
-
73
- <script lang="ts">
74
- //JS
75
- import { defineComponent, reactive, toRefs, inject, ref, nextTick } from 'vue'
76
- //hook
77
- import { useConfigData } from './useConfigData'
78
-
79
- //ts
80
- import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
81
- import { Modal, message } from '@qqt-product/ui'
82
- import { GlobalListPageLayoutTypes } from '@qqt-product/ui'
83
-
84
- export default defineComponent({
85
- name: 'QAccountList',
86
- props: {
87
- userInfo: {
88
- type: Object,
89
- defalut: () => {
90
- return {}
91
- },
92
- },
93
- },
94
- emits: ['create', 'edit', 'detail'],
95
- setup(props, { emit }) {
96
- //data
97
- const qHttp = inject(INJECT_HTTP) as HttpClient
98
- const listLayoutRef = ref()
99
- const pageData = reactive({
100
- statusConfig: {
101
- show: false,
102
- },
103
- optColumn: {
104
- attrs: {},
105
- extend: {},
106
- optColumnList: [
107
- {
108
- type: 'edit',
109
- title: '编辑',
110
- authorityCode: 'elsSubAccount#ElsSubAccount:edit',
111
- click({ row, $rowIndex, column, $columnIndex }: GlobalListPageLayoutTypes.ListOptionsEventParams) {
112
- const payload = {
113
- row,
114
- $rowIndex,
115
- column,
116
- $columnIndex,
117
- }
118
- emit('edit', payload)
119
- },
120
- },
121
- {
122
- authorityCode: 'elsSubAccount#ElsSubAccount:view',
123
- type: 'view',
124
- title: '查看',
125
- click({ row, $rowIndex, column, $columnIndex }: GlobalListPageLayoutTypes.ListOptionsEventParams) {
126
- const payload = {
127
- row,
128
- $rowIndex,
129
- column,
130
- $columnIndex,
131
- }
132
- emit('detail', payload)
133
- },
134
- },
135
- { authorityCode: 'elsSubAccount#ElsSubAccount:deliverTo', type: 'stop', title: '工作转交', click: deliverTo },
136
- { authorityCode: 'elsSubAccount#ElsSubAccount:changPassword', type: 'change', title: '更改密码', click: handleChangePassword },
137
- { authorityCode: 'elsSubAccount#ElsSubAccount:frozenBatch', type: 'frozen', title: '冻结/解冻', click: handleFrozen },
138
- ],
139
- },
140
- buttonConfig: {
141
- attrs: {},
142
- extend: {},
143
- buttons: [
144
- {
145
- authorityCode: 'elsSubAccount#ElsSubAccount:add',
146
- label: '新增',
147
- icon: {
148
- type: 'icon-Q-add',
149
- },
150
- attrs: {
151
- type: 'primary',
152
- },
153
- click({ row, $rowIndex, column, $columnIndex }: GlobalListPageLayoutTypes.ListOptionsEventParams) {
154
- const payload = {
155
- row,
156
- $rowIndex,
157
- column,
158
- $columnIndex,
159
- }
160
- emit('create', payload)
161
- },
162
- },
163
- { authorityCode: 'elsSubAccount#ElsSubAccount:getDataByErp', label: '获取ERP数据', click: getDataByErp },
164
- { authorityCode: 'elsSubAccount#ElsSubAccount:pushDataToErp', label: '推送到ERP', click: pushDataToERP },
165
- { authorityCode: 'elsSubAccount#ElsSubAccount:pushDataToMall', label: '推送到商城', click: pushDataToMall },
166
- {
167
- label: '列自定义',
168
- icon: {
169
- type: 'icon-Q-setting',
170
- },
171
- type: 'setting',
172
- },
173
- {
174
- authorityCode: 'elsSubAccount#ElsSubAccount:import',
175
- label: '导入',
176
- icon: {
177
- type: 'icon-Q-import',
178
- },
179
- type: 'import',
180
- },
181
- {
182
- authorityCode: 'elsSubAccount#ElsSubAccount:export',
183
- label: '导出',
184
- icon: {
185
- type: 'icon-Q-export',
186
- },
187
- type: 'export',
188
- },
189
- {
190
- label: '帮助说明',
191
- icon: {
192
- type: 'icon-Q-help-text',
193
- },
194
- type: 'help-text',
195
- },
196
- {
197
- label: '附件说明',
198
- icon: {
199
- type: 'icon-Q-attachment-text',
200
- },
201
- type: 'attachment-text',
202
- },
203
- ],
204
- },
205
- queryConfig: {
206
- attrs: {},
207
- extend: {},
208
- form: [
209
- {
210
- type: 'input',
211
- label: '姓名',
212
- fieldName: 'i18nKey',
213
- placeholder: '请输入姓名',
214
- },
215
- {
216
- type: 'input',
217
- label: '子账号',
218
- fieldName: 'chinese',
219
- placeholder: '请输入子账号',
220
- },
221
- ],
222
- formState: {},
223
- },
224
- pagerConfig: {},
225
- })
226
- const passwordModalFormRule = ref({
227
- password: [
228
- { required: true, message: '请输入登录密码' },
229
- {
230
- validator: validateToNextPassword,
231
- },
232
- ],
233
- confirmpassword: [
234
- { required: true, message: '请输入确认密码' },
235
- {
236
- validator: compareToFirstPassword,
237
- },
238
- ],
239
- })
240
- //data-hook
241
- const { passwordRef, passwordModalForm, passwordModalShow, showEditPage, apiUrls, deliverToShow, deliverToFrom, subAccountList, deliverToFromRule } = useConfigData()
242
- const { userInfo } = toRefs(props)
243
-
244
- //methods
245
-
246
- function getDataByErp() {
247
- listLayoutRef.value.loading = true
248
- qHttp
249
- .get({
250
- url: apiUrls.value.getDataByErpUrl,
251
- })
252
- .then((res) => {
253
- listLayoutRef.value.loading = false
254
- if (res.success) {
255
- // this.$message.success(res.message)
256
- message.success('操作成功')
257
- } else {
258
- // this.$message.warning(res.message)
259
- message.warning('操作失败')
260
- }
261
- })
262
- .catch(() => {
263
- listLayoutRef.value.loading = false
264
- })
265
- }
266
-
267
- function pushDataToERP() {
268
- let checkRow = listLayoutRef.value.gridInstance.getCheckboxRecords() || []
269
- if (!checkRow.length) {
270
- message.warning('请至少选择一行')
271
- return
272
- }
273
- let ids = checkRow.map((row: MapObjectNoneType) => row.id).join(',')
274
- listLayoutRef.value.loading = true
275
- qHttp
276
- .get({
277
- url: apiUrls.value.pushDataToERPUrl,
278
- params: {
279
- ids,
280
- },
281
- })
282
- .then((res) => {
283
- listLayoutRef.value.loading = false
284
- if (res.success) {
285
- // this.$message.success(res.message)
286
- message.success('操作成功')
287
- } else {
288
- // this.$message.warning(res.message)
289
- message.warning('操作失败')
290
- }
291
- })
292
- .catch(() => {
293
- listLayoutRef.value.loading = false
294
- })
295
- }
296
-
297
- function pushDataToMall() {
298
- let checkRow = listLayoutRef.value.gridInstance.getCheckboxRecords() || []
299
- if (!checkRow.length) {
300
- message.warning('请至少选择一行')
301
- return
302
- }
303
- let ids = checkRow.map((row: MapObjectNoneType) => row.id).join(',')
304
- listLayoutRef.value.loading = true
305
- qHttp
306
- .get({
307
- url: apiUrls.value.pushDataToMallUrl,
308
- params: {
309
- ids,
310
- },
311
- })
312
- .then((res) => {
313
- listLayoutRef.value.loading = false
314
- if (res.success) {
315
- // this.$message.success(res.message)
316
- message.success(res.message)
317
- } else {
318
- // this.$message.warning(res.message)
319
- message.warning(res.message)
320
- }
321
- })
322
- .catch(() => {
323
- listLayoutRef.value.loading = false
324
- })
325
- }
326
-
327
- function handleFrozen({ row = {} as MapObjectNoneType }) {
328
- let id = row.id
329
- let status = row.status
330
- let subAccount = row.subAccount
331
-
332
- let messages = '冻结'
333
- if ('admin' == subAccount) {
334
- const t = '管理员账号不允许此操作!'
335
- message.warning(t)
336
- return
337
- }
338
- if ('1' == status) {
339
- status = '2'
340
- } else {
341
- status = '1'
342
- messages = '解冻'
343
- }
344
- const c = '确认'
345
- const t = '是否'
346
- const d = '选中数据?'
347
- Modal.confirm({
348
- title: c + messages,
349
- content: t + messages + d + '?',
350
- onOk: function () {
351
- qHttp
352
- .put({
353
- url: '/account/elsSubAccount/frozenBatch',
354
- data: { ids: id, status: status },
355
- })
356
- .then((res) => {
357
- if (res.success) {
358
- message.success(res.message)
359
- listLayoutRef.value.fetchListData()
360
- } else {
361
- message.warning(res.message)
362
- }
363
- })
364
- },
365
- })
366
- }
367
-
368
- // 获取配置项分类
369
- const getConfigurationItemClassificationList = () => {
370
- let postData = {
371
- pageSize: '100000',
372
- }
373
- qHttp.get({ url: '/account/elsSubAccount/list', params: postData }).then((res) => {
374
- if (res && res.success) {
375
- subAccountList.value = res.result.records.map((val: MapObjectNoneType) => {
376
- return { value: val.id, label: val.realname }
377
- })
378
- }
379
- })
380
- }
381
- getConfigurationItemClassificationList()
382
-
383
- function deliverTo({ row = {} as MapObjectNoneType }) {
384
- deliverToFrom.value = {
385
- ...row,
386
- }
387
- nextTick(() => {
388
- deliverToShow.value = true
389
- })
390
- }
391
-
392
- function deliverToHandle() {
393
- console.log(123)
394
- }
395
- function filterOption(input: MapObjectNoneType, option: MapObjectNoneType) {
396
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
397
- }
398
-
399
- function deliverTosubmitEvent() {
400
- let params = { sourceAccountId: deliverToFrom.value.id, targetAccountId: deliverToFrom.value.receiveId, businessDeliverToType: deliverToFrom.value.businessDeliverToType }
401
-
402
- const t = '工作转交确认'
403
- const c = '确认是否进行工作转交?'
404
- Modal.confirm({
405
- title: t,
406
- content: c,
407
- onOk: function () {
408
- listLayoutRef.value.loading = true
409
- qHttp
410
- .get({
411
- url: '/account/elsSubAccount/deliverTo',
412
- params,
413
- })
414
- .then((res) => {
415
- listLayoutRef.value.loading = true
416
- if (res.success) {
417
- message.success(res.message)
418
- deliverToFrom.value = {}
419
- listLayoutRef.value.fetchListData()
420
- } else {
421
- message.warning(res.message)
422
- }
423
- })
424
- .finally(() => {
425
- deliverToShow.value = false
426
- })
427
- },
428
- })
429
- }
430
-
431
- function handleChangePassword({ row = {} as MapObjectNoneType }) {
432
- passwordModalForm.value = row
433
- nextTick(() => {
434
- passwordModalShow.value = true
435
- })
436
- }
437
-
438
- function passwordModalHandle(handleType: string) {
439
- if (handleType == 'confirm') {
440
- nextTick(() => {
441
- passwordRef.value.validate((res: MapObjectNoneType) => {
442
- if (!res) {
443
- if (passwordModalForm.value.confirmpassword != passwordModalForm.value.password) {
444
- message.warning('两次输入的密码不一致')
445
- return
446
- }
447
- qHttp
448
- .put({
449
- url: '/account/elsSubAccount/changPassword',
450
- data: {
451
- ...passwordModalForm.value,
452
- },
453
- })
454
- .then((res) => {
455
- if (res.success) {
456
- // this.$message.success(res.message)
457
- listLayoutRef.value.fetchListData()
458
- message.success('操作成功')
459
- } else {
460
- // this.$message.warning(res.message)
461
- message.warning('操作失败')
462
- }
463
- })
464
- .finally(() => {
465
- passwordModalShow.value = false
466
- })
467
- }
468
- })
469
- })
470
- }
471
- }
472
-
473
- async function validateToNextPassword(ErrMap: MapObjectNoneType) {
474
- // const form = passwordModalForm.value
475
- let EmessTxt = ''
476
- if (ErrMap.itemValue) {
477
- let params = {
478
- elsAccount: userInfo.value?.userInfo?.elsAccount,
479
- password: ErrMap.itemValue,
480
- }
481
- let curMess = await qHttp
482
- .get({
483
- url: '/account/noToken/pwdRuleCheck',
484
- params,
485
- })
486
- .then((res) => {
487
- if (res.success) {
488
- if (res.message) {
489
- EmessTxt = res.message ? res.message : ''
490
- return EmessTxt
491
- }
492
- }
493
- })
494
- if (curMess) {
495
- message.error(curMess)
496
-
497
- return Promise.reject(curMess)
498
- }
499
- }
500
- }
501
-
502
- function compareToFirstPassword(ErrMap: MapObjectNoneType) {
503
- const form = passwordModalForm.value
504
- if (ErrMap.itemValue && ErrMap.itemValue !== form.password) {
505
- return new Error(' 登录密码与确认密码不一致')
506
- }
507
- }
508
-
509
- return {
510
- passwordModalFormRule,
511
- passwordModalForm,
512
- passwordModalShow,
513
- deliverTosubmitEvent,
514
- deliverToFromRule,
515
- filterOption,
516
- subAccountList,
517
- deliverToFrom,
518
- deliverToHandle,
519
- deliverToShow,
520
- listLayoutRef,
521
- showEditPage,
522
- apiUrls,
523
- pageData,
524
- passwordModalHandle,
525
- passwordRef,
526
- }
527
- },
528
- })
529
- </script>
530
- <style scoped></style>
1
+ <template>
2
+ <div style="height: 100%">
3
+ <q-list-layout ref="listLayoutRef" v-if="!showEditPage" :pageData="pageData" :apiUrls="apiUrls" />
4
+
5
+ <!--工作交接-->
6
+ <vxe-modal v-model="deliverToShow" title="工作转交" type="confirm" :showFooter="false">
7
+ <vxe-form title-colon title-align="right" title-width="160" :data="deliverToFrom" :rules="deliverToFromRule" @submit="deliverTosubmitEvent">
8
+ <vxe-form-gather span="24">
9
+ <vxe-form-item title="转交人" field="realname" span="24">
10
+ <template #default="{ data }">
11
+ <vxe-input :disabled="true" v-model="data.realname" type="text" placeholder="请输入转交人"></vxe-input>
12
+ </template>
13
+ </vxe-form-item>
14
+
15
+ <vxe-form-item title="接收人" field="receiveId" span="24">
16
+ <template #default="{ data }">
17
+ <a-select :placeholder="'姓名'" v-model:value="data.receiveId" :filter-option="filterOption" show-search allow-clear :options="subAccountList"> </a-select>
18
+ </template>
19
+ </vxe-form-item>
20
+ <vxe-form-item title="转交内容" field="businessDeliverToType" span="24">
21
+ <template #default="{ data }">
22
+ <q-select mode="multiple" style="width: 200px" v-model:value="data.businessDeliverToType" dict-code="businessDeliverToType" placeholder="请输入转交内容"></q-select>
23
+ </template>
24
+ </vxe-form-item>
25
+
26
+ <vxe-form-item align="center" span="24">
27
+ <template #default>
28
+ <vxe-button content="取消" @click="deliverToShow = false"></vxe-button>
29
+ <vxe-button type="submit" status="primary" content="保存"></vxe-button>
30
+ </template>
31
+ </vxe-form-item>
32
+ </vxe-form-gather>
33
+ </vxe-form>
34
+ </vxe-modal>
35
+ <!--更改密码-->
36
+ <vxe-modal v-model="passwordModalShow" title="重新设定密码">
37
+ <template #default>
38
+ <vxe-form ref="passwordRef" title-colon title-align="right" title-width="160" :data="passwordModalForm" :rules="passwordModalFormRule">
39
+ <vxe-form-gather span="24">
40
+ <vxe-form-item title="ELS账号" field="elsAccount" span="24">
41
+ <template #default="{ data }">
42
+ <vxe-input :disabled="true" v-model="data.elsAccount" type="text" placeholder="请输入ELS账号" clearable></vxe-input>
43
+ </template>
44
+ </vxe-form-item>
45
+ <vxe-form-item title="子账号" field="subAccount" span="24">
46
+ <template #default="{ data }">
47
+ <vxe-input :disabled="true" v-model="data.subAccount" type="text" placeholder="请输入子账号" clearable></vxe-input>
48
+ </template>
49
+ </vxe-form-item>
50
+ <vxe-form-item title="登录密码" field="password" span="24">
51
+ <template #default="{ data }">
52
+ <vxe-input v-model="data.password" type="text" placeholder="请输入登录密码" clearable></vxe-input>
53
+ </template>
54
+ </vxe-form-item>
55
+ <vxe-form-item title="确认密码" field="confirmpassword" span="24">
56
+ <template #default="{ data }">
57
+ <vxe-input v-model="data.confirmpassword" type="text" placeholder="请输入确认密码" clearable></vxe-input>
58
+ </template>
59
+ </vxe-form-item>
60
+ <vxe-form-item align="center" span="24">
61
+ <template #default>
62
+ <vxe-button content="取消" @click="passwordModalShow = false"></vxe-button>
63
+ <vxe-button @click="passwordModalHandle('confirm')" content="保存"></vxe-button>
64
+ </template>
65
+ </vxe-form-item>
66
+ </vxe-form-gather>
67
+ </vxe-form>
68
+ </template>
69
+ </vxe-modal>
70
+ </div>
71
+ </template>
72
+
73
+ <script lang="ts">
74
+ //JS
75
+ import { defineComponent, reactive, toRefs, inject, ref, nextTick } from 'vue'
76
+ //hook
77
+ import { useConfigData } from './useConfigData'
78
+
79
+ //ts
80
+ import { INJECT_HTTP, HttpClient, MapObjectNoneType } from '../../../utils/global.types'
81
+ import { Modal, message } from '@qqt-product/ui'
82
+ import type { GlobalListPageLayoutTypes } from '@qqt-product/ui'
83
+
84
+ export default defineComponent({
85
+ name: 'QAccountList',
86
+ props: {
87
+ userInfo: {
88
+ type: Object,
89
+ defalut: () => {
90
+ return {}
91
+ },
92
+ },
93
+ },
94
+ emits: ['create', 'edit', 'detail'],
95
+ setup(props, { emit }) {
96
+ //data
97
+ const qHttp = inject(INJECT_HTTP) as HttpClient
98
+ const listLayoutRef = ref()
99
+ const pageData = reactive({
100
+ statusConfig: {
101
+ show: false,
102
+ },
103
+ optionConfig: {
104
+ attrs: {},
105
+ extend: {},
106
+ options: [
107
+ {
108
+ type: 'edit',
109
+ title: '编辑',
110
+ authorityCode: 'elsSubAccount#ElsSubAccount:edit',
111
+ click({ row, $rowIndex, column, $columnIndex }: GlobalListPageLayoutTypes.ListOptionsEventParams) {
112
+ const payload = {
113
+ row,
114
+ $rowIndex,
115
+ column,
116
+ $columnIndex,
117
+ }
118
+ emit('edit', payload)
119
+ },
120
+ },
121
+ {
122
+ authorityCode: 'elsSubAccount#ElsSubAccount:view',
123
+ type: 'view',
124
+ title: '查看',
125
+ click({ row, $rowIndex, column, $columnIndex }: GlobalListPageLayoutTypes.ListOptionsEventParams) {
126
+ const payload = {
127
+ row,
128
+ $rowIndex,
129
+ column,
130
+ $columnIndex,
131
+ }
132
+ emit('detail', payload)
133
+ },
134
+ },
135
+ { authorityCode: 'elsSubAccount#ElsSubAccount:deliverTo', type: 'stop', title: '工作转交', click: deliverTo },
136
+ { authorityCode: 'elsSubAccount#ElsSubAccount:changPassword', type: 'change', title: '更改密码', click: handleChangePassword },
137
+ { authorityCode: 'elsSubAccount#ElsSubAccount:frozenBatch', type: 'frozen', title: '冻结/解冻', click: handleFrozen },
138
+ ],
139
+ },
140
+ buttonConfig: {
141
+ attrs: {},
142
+ extend: {},
143
+ buttons: [
144
+ {
145
+ authorityCode: 'elsSubAccount#ElsSubAccount:add',
146
+ label: '新增',
147
+ icon: {
148
+ type: 'icon-Q-add',
149
+ },
150
+ attrs: {
151
+ type: 'primary',
152
+ },
153
+ click({ row, $rowIndex, column, $columnIndex }: GlobalListPageLayoutTypes.ListOptionsEventParams) {
154
+ const payload = {
155
+ row,
156
+ $rowIndex,
157
+ column,
158
+ $columnIndex,
159
+ }
160
+ emit('create', payload)
161
+ },
162
+ },
163
+ { authorityCode: 'elsSubAccount#ElsSubAccount:getDataByErp', label: '获取ERP数据', click: getDataByErp },
164
+ { authorityCode: 'elsSubAccount#ElsSubAccount:pushDataToErp', label: '推送到ERP', click: pushDataToERP },
165
+ { authorityCode: 'elsSubAccount#ElsSubAccount:pushDataToMall', label: '推送到商城', click: pushDataToMall },
166
+ {
167
+ label: '列自定义',
168
+ icon: {
169
+ type: 'icon-Q-setting',
170
+ },
171
+ type: 'setting',
172
+ },
173
+ {
174
+ authorityCode: 'elsSubAccount#ElsSubAccount:import',
175
+ label: '导入',
176
+ args: {
177
+ url: 'base/excelHeader/getConfig/elsSubAccountExcel', // 原来的 importExcelUrl
178
+ excelCode: 'elsSubAccountExcel', // excelCode
179
+ },
180
+ icon: {
181
+ type: 'icon-Q-import',
182
+ },
183
+ type: 'import',
184
+ },
185
+ {
186
+ authorityCode: 'elsSubAccount#ElsSubAccount:export',
187
+ label: '导出',
188
+ args: {
189
+ url: '/account/elsSubAccount/exportXls', // 原来的 exportXlsUrl
190
+ },
191
+ icon: {
192
+ type: 'icon-Q-export',
193
+ },
194
+ type: 'export',
195
+ },
196
+ {
197
+ label: '帮助说明',
198
+ icon: {
199
+ type: 'icon-Q-help-text',
200
+ },
201
+ type: 'help-text',
202
+ },
203
+ {
204
+ label: '附件说明',
205
+ icon: {
206
+ type: 'icon-Q-attachment-text',
207
+ },
208
+ type: 'attachment-text',
209
+ },
210
+ ],
211
+ },
212
+ queryConfig: {
213
+ attrs: {},
214
+ extend: {},
215
+ form: [
216
+ {
217
+ type: 'input',
218
+ label: '姓名',
219
+ fieldName: 'realname',
220
+ placeholder: '请输入姓名',
221
+ },
222
+ {
223
+ type: 'input',
224
+ label: '子账号',
225
+ fieldName: 'subAccount',
226
+ placeholder: '请输入子账号',
227
+ },
228
+ ],
229
+ },
230
+ pagerConfig: {},
231
+ })
232
+ const passwordModalFormRule = ref({
233
+ password: [
234
+ { required: true, message: '请输入登录密码' },
235
+ {
236
+ validator: validateToNextPassword,
237
+ },
238
+ ],
239
+ confirmpassword: [
240
+ { required: true, message: '请输入确认密码' },
241
+ {
242
+ validator: compareToFirstPassword,
243
+ },
244
+ ],
245
+ })
246
+ //data-hook
247
+ const { passwordRef, passwordModalForm, passwordModalShow, showEditPage, apiUrls, deliverToShow, deliverToFrom, subAccountList, deliverToFromRule } = useConfigData()
248
+ const { userInfo } = toRefs(props)
249
+
250
+ //methods
251
+
252
+ function getDataByErp() {
253
+ listLayoutRef.value.loading = true
254
+ qHttp
255
+ .get({
256
+ url: apiUrls.value.getDataByErpUrl,
257
+ })
258
+ .then((res) => {
259
+ listLayoutRef.value.loading = false
260
+ if (res.success) {
261
+ // this.$message.success(res.message)
262
+ message.success('操作成功')
263
+ } else {
264
+ // this.$message.warning(res.message)
265
+ message.warning('操作失败')
266
+ }
267
+ })
268
+ .catch(() => {
269
+ listLayoutRef.value.loading = false
270
+ })
271
+ }
272
+
273
+ function pushDataToERP() {
274
+ let checkRow = listLayoutRef.value.gridInstance.getCheckboxRecords() || []
275
+ if (!checkRow.length) {
276
+ message.warning('请至少选择一行')
277
+ return
278
+ }
279
+ let ids = checkRow.map((row: MapObjectNoneType) => row.id).join(',')
280
+ listLayoutRef.value.loading = true
281
+ qHttp
282
+ .get({
283
+ url: apiUrls.value.pushDataToERPUrl,
284
+ params: {
285
+ ids,
286
+ },
287
+ })
288
+ .then((res) => {
289
+ listLayoutRef.value.loading = false
290
+ if (res.success) {
291
+ // this.$message.success(res.message)
292
+ message.success('操作成功')
293
+ } else {
294
+ // this.$message.warning(res.message)
295
+ message.warning('操作失败')
296
+ }
297
+ })
298
+ .catch(() => {
299
+ listLayoutRef.value.loading = false
300
+ })
301
+ }
302
+
303
+ function pushDataToMall() {
304
+ let checkRow = listLayoutRef.value.gridInstance.getCheckboxRecords() || []
305
+ if (!checkRow.length) {
306
+ message.warning('请至少选择一行')
307
+ return
308
+ }
309
+ let ids = checkRow.map((row: MapObjectNoneType) => row.id).join(',')
310
+ listLayoutRef.value.loading = true
311
+ qHttp
312
+ .get({
313
+ url: apiUrls.value.pushDataToMallUrl,
314
+ params: {
315
+ ids,
316
+ },
317
+ })
318
+ .then((res) => {
319
+ listLayoutRef.value.loading = false
320
+ if (res.success) {
321
+ // this.$message.success(res.message)
322
+ message.success(res.message)
323
+ } else {
324
+ // this.$message.warning(res.message)
325
+ message.warning(res.message)
326
+ }
327
+ })
328
+ .catch(() => {
329
+ listLayoutRef.value.loading = false
330
+ })
331
+ }
332
+
333
+ function handleFrozen({ row = {} as MapObjectNoneType }) {
334
+ let id = row.id
335
+ let status = row.status
336
+ let subAccount = row.subAccount
337
+
338
+ let messages = '冻结'
339
+ if ('admin' == subAccount) {
340
+ const t = '管理员账号不允许此操作!'
341
+ message.warning(t)
342
+ return
343
+ }
344
+ if ('1' == status) {
345
+ status = '2'
346
+ } else {
347
+ status = '1'
348
+ messages = '解冻'
349
+ }
350
+ const c = '确认'
351
+ const t = '是否'
352
+ const d = '选中数据?'
353
+ Modal.confirm({
354
+ title: c + messages,
355
+ content: t + messages + d + '?',
356
+ onOk: function () {
357
+ qHttp
358
+ .put({
359
+ url: '/account/elsSubAccount/frozenBatch',
360
+ data: { ids: id, status: status },
361
+ })
362
+ .then((res) => {
363
+ if (res.success) {
364
+ message.success(res.message)
365
+ listLayoutRef.value.fetchListData()
366
+ } else {
367
+ message.warning(res.message)
368
+ }
369
+ })
370
+ },
371
+ })
372
+ }
373
+
374
+ // 获取配置项分类
375
+ const getConfigurationItemClassificationList = () => {
376
+ let postData = {
377
+ pageSize: '100000',
378
+ }
379
+ qHttp.get({ url: '/account/elsSubAccount/list', params: postData }).then((res) => {
380
+ if (res && res.success) {
381
+ subAccountList.value = res.result.records.map((val: MapObjectNoneType) => {
382
+ return { value: val.id, label: val.realname }
383
+ })
384
+ }
385
+ })
386
+ }
387
+ getConfigurationItemClassificationList()
388
+
389
+ function deliverTo({ row = {} as MapObjectNoneType }) {
390
+ deliverToFrom.value = {
391
+ ...row,
392
+ }
393
+ nextTick(() => {
394
+ deliverToShow.value = true
395
+ })
396
+ }
397
+
398
+ function deliverToHandle() {
399
+ console.log(123)
400
+ }
401
+ function filterOption(input: MapObjectNoneType, option: MapObjectNoneType) {
402
+ return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
403
+ }
404
+
405
+ function deliverTosubmitEvent() {
406
+ let params = { sourceAccountId: deliverToFrom.value.id, targetAccountId: deliverToFrom.value.receiveId, businessDeliverToType: deliverToFrom.value.businessDeliverToType }
407
+
408
+ const t = '工作转交确认'
409
+ const c = '确认是否进行工作转交?'
410
+ Modal.confirm({
411
+ title: t,
412
+ content: c,
413
+ onOk: function () {
414
+ listLayoutRef.value.loading = true
415
+ qHttp
416
+ .get({
417
+ url: '/account/elsSubAccount/deliverTo',
418
+ params,
419
+ })
420
+ .then((res) => {
421
+ listLayoutRef.value.loading = true
422
+ if (res.success) {
423
+ message.success(res.message)
424
+ deliverToFrom.value = {}
425
+ listLayoutRef.value.fetchListData()
426
+ } else {
427
+ message.warning(res.message)
428
+ }
429
+ })
430
+ .finally(() => {
431
+ deliverToShow.value = false
432
+ })
433
+ },
434
+ })
435
+ }
436
+
437
+ function handleChangePassword({ row = {} as MapObjectNoneType }) {
438
+ passwordModalForm.value = row
439
+ nextTick(() => {
440
+ passwordModalShow.value = true
441
+ })
442
+ }
443
+
444
+ function passwordModalHandle(handleType: string) {
445
+ if (handleType == 'confirm') {
446
+ nextTick(() => {
447
+ passwordRef.value.validate((res: MapObjectNoneType) => {
448
+ if (!res) {
449
+ if (passwordModalForm.value.confirmpassword != passwordModalForm.value.password) {
450
+ message.warning('两次输入的密码不一致')
451
+ return
452
+ }
453
+ qHttp
454
+ .put({
455
+ url: '/account/elsSubAccount/changPassword',
456
+ data: {
457
+ ...passwordModalForm.value,
458
+ },
459
+ })
460
+ .then((res) => {
461
+ if (res.success) {
462
+ // this.$message.success(res.message)
463
+ listLayoutRef.value.fetchListData()
464
+ message.success('操作成功')
465
+ } else {
466
+ // this.$message.warning(res.message)
467
+ message.warning('操作失败')
468
+ }
469
+ })
470
+ .finally(() => {
471
+ passwordModalShow.value = false
472
+ })
473
+ }
474
+ })
475
+ })
476
+ }
477
+ }
478
+
479
+ async function validateToNextPassword(ErrMap: MapObjectNoneType) {
480
+ // const form = passwordModalForm.value
481
+ let EmessTxt = ''
482
+ if (ErrMap.itemValue) {
483
+ let params = {
484
+ elsAccount: userInfo.value?.userInfo?.elsAccount,
485
+ password: ErrMap.itemValue,
486
+ }
487
+ let curMess = await qHttp
488
+ .get({
489
+ url: '/account/noToken/pwdRuleCheck',
490
+ params,
491
+ })
492
+ .then((res) => {
493
+ EmessTxt = res.message ? res.message : ''
494
+ return EmessTxt
495
+ })
496
+ if (curMess) {
497
+ // message.error(curMess)
498
+
499
+ return Promise.reject(new Error(EmessTxt))
500
+ }
501
+ }
502
+ }
503
+
504
+ function compareToFirstPassword(ErrMap: MapObjectNoneType) {
505
+ const form = passwordModalForm.value
506
+ if (ErrMap.itemValue && ErrMap.itemValue !== form.password) {
507
+ return new Error(' 登录密码与确认密码不一致')
508
+ }
509
+ }
510
+
511
+ return {
512
+ passwordModalFormRule,
513
+ passwordModalForm,
514
+ passwordModalShow,
515
+ deliverTosubmitEvent,
516
+ deliverToFromRule,
517
+ filterOption,
518
+ subAccountList,
519
+ deliverToFrom,
520
+ deliverToHandle,
521
+ deliverToShow,
522
+ listLayoutRef,
523
+ showEditPage,
524
+ apiUrls,
525
+ pageData,
526
+ passwordModalHandle,
527
+ passwordRef,
528
+ }
529
+ },
530
+ })
531
+ </script>
532
+ <style scoped></style>