vue2-client 1.17.14 → 1.17.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.17.14",
3
+ "version": "1.17.15",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,247 +1,47 @@
1
- <template>
2
- <a-card :bordered="false">
3
- <x-form-table
4
- title="呼叫工单总汇"
5
- ref="xFormTable"
6
- :queryParamsName="queryParamsName"
7
- :fixed-query-form="{
8
- users_f_handler_id: currUser.id,
9
- }"
10
- serviceName="af-telephone"
11
- @toDeal="toDetail"
12
- @updateInfo="updateInfo"
13
- @transfer="transfer"
14
- >
15
- </x-form-table>
16
- <WorkflowDetail
17
- ref="workFlow"
18
- @preClick="preClick"
19
- @success="success"
20
- @nextClick="nextClick"
21
- @x-form-item-emit-func="handleFormItemEvent"
22
- >
23
- </WorkflowDetail>
24
- <a-modal
25
- title="转单"
26
- :visible="chargeVisible"
27
- :confirm-loading="confirmLoading"
28
- @ok="chargeVisibleOk"
29
- @cancel="() => chargeVisible = false"
30
- destroy-on-close
31
- >
32
- <a-select
33
- show-search
34
- placeholder="请选择当前环节处理人"
35
- v-model="optionsValue"
36
- optionFilterProp="children"
37
- style="width: 100%"
38
- >
39
- <a-select-option v-for="item in chargePersonOptions" :key="item.value" :value="item.value">
40
- {{ item.label }}
41
- </a-select-option>
42
- </a-select>
43
- </a-modal>
44
- </a-card>
45
- </template>
46
-
47
1
  <script>
48
2
  import WorkflowDetail from '@vue2-client/pages/WorkflowDetail/WorkflowDetail.vue'
49
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
50
- import { mapState } from 'vuex'
51
- import { commonApi, postByServiceName } from '@/services/api'
52
- import { workFlowViewApi } from '@/services/api/workFlow'
53
- import { runLogic } from '@/services/api/common'
54
3
 
55
4
  export default {
56
- name: 'Apply',
57
- components: {
58
- XFormTable,
59
- WorkflowDetail,
60
- },
61
- // 透传给子组件的方法(目前XFormTable接了)
62
- provide () {
63
- return {
64
- generalFunction: {}
65
- }
66
- },
67
- data () {
68
- return {
69
- // 查询配置文件名
70
- queryParamsName: 'teleProcessCRUD',
71
- // 发起报建弹框控制
72
- applyAddFlag: false,
73
- // 提交加载动画
74
- confirmLoading: false,
75
- refreshFn: null,
76
- chargeVisible: false,
77
- // 环节人员信息
78
- chargePerson: {},
79
- chargePersonOptions: [],
80
- optionsValue: '',
81
- record: {},
82
- define: {},
83
- }
84
- },
85
- computed: {
86
- ...mapState('account', { currUser: 'user' }),
5
+ name: 'WorkFlowDemo',
6
+ components: { WorkflowDetail },
7
+ mounted () {
8
+ this.$refs.workFlow.init({
9
+ workflowId: '3024'
10
+ })
87
11
  },
88
12
  methods: {
89
- success () {
90
- console.log('完工')
91
- },
92
- toDetail (record) {
93
- // 修改第一步的工单
94
- if (record.ws_f_step_id === 1 && record.w_f_state === 0) {
95
- console.log('进入工单详情')
96
- if (record.w_f_workflow_define_name === '报修单处理流程') {
97
- this.$refs.dealOrUpdate.dealOrUpdate(record, '处理工单')
98
- } else if (record.w_f_workflow_define_name === '投诉单处理流程') {
99
- this.$refs.dealComplaint.dealComplaintOrder(record)
100
- } else if (record.w_f_workflow_define_name === '咨询单处理流程') {
101
- this.$refs.dealConsultation.dealConsultationOrder(record)
102
- } else {
103
- this.$message.warn('未知流程类型')
104
- }
105
- } else {
106
- // 进入流程详情
107
- this.$refs.workFlow.init({
108
- workflowId: record.wo_f_workflow_id,
109
- stepId: record.ws_f_step_id
110
- })
111
- }
112
- },
113
- updateInfo (record) {
114
- this.$refs.dealOrUpdate.dealOrUpdate(record, '修改信息')
115
- },
116
- async transfer (record, id) {
117
- this.record = record
118
- console.log('>>>> 转单: ', JSON.stringify(record), JSON.stringify(id))
119
- // 1. 获取当前环节的配置
120
- // const thisNodeId = await postByServiceName(workFlowViewApi.getWorkFlowCurrentSubState, {
121
- // workflowId: record.wo_f_workflow_id
122
- // })
123
- const workFlowDefine = await postByServiceName(workFlowViewApi.getStepNoteAndHandler, {
124
- workflowId: record.wo_f_workflow_id
125
- })
126
- console.log('>>>> workFlowDefine: ', JSON.stringify(workFlowDefine))
127
- const define = workFlowDefine.find(item => item.id === this.record.ws_f_step_id)
128
- this.define = define
129
- if (!define?.properties?.chargePerson) {
130
- this.$message.warn('流程配置错误')
131
- return []
132
- }
133
- console.log('>>>> define: ', JSON.stringify(define))
134
- // 2. 根据 needSelectPerson 判断是否需要选择人员
135
- this.optionsValue = ''
136
- this.chargePersonOptions = []
137
- if (define?.properties?.chargePerson.needSelectPerson) {
138
- // 默认是当初处理人
139
- this.chargePersonOptions = await this.getChangePerson(this.record.ws_f_step_id, define)
140
- const option = this.chargePersonOptions.find(item => item.label === define.handler)
141
- console.log('>>>> option: ', option)
142
- this.optionsValue = option?.value || ''
143
- console.log('>>>> chargePersonOptions: ', JSON.stringify(this.chargePersonOptions))
144
- } else {
145
- // 全部部门
146
- this.chargePersonOptions = await runLogic('getDepartmentByOrgId', {}, 'af-telephone')
147
- }
148
- this.chargeVisible = true
149
- },
150
- async getChangePerson (nodeId, define) {
151
- const chargePerson = define.properties.chargePerson
152
- this.chargePerson = this.normalizeChargePersonFormat(chargePerson)
153
-
154
- if (!chargePerson.needSelectPerson || !chargePerson.personList) return []
155
-
156
- // 获取所有用户信息
157
- const allUser = await postByServiceName(commonApi.getAllUserOptionList, {})
158
-
159
- // 根据配置筛选用户
160
- const options = this.filterUsersByPersonConfig(chargePerson.personList, allUser)
161
-
162
- // 去重处理
163
- return Array.from(new Map(options.map(item => [item.value, item])).values())
164
- },
165
- // 标准化人员配置格式(兼容旧格式)
166
- normalizeChargePersonFormat (chargePerson) {
167
- if (chargePerson.role || chargePerson.department) {
168
- chargePerson.needSelectPerson = true
169
- chargePerson.personList = [{
170
- type: chargePerson.role ? 'role' : 'department',
171
- name: chargePerson.role || chargePerson.department
172
- }]
173
- }
174
- return chargePerson
175
- },
176
-
177
- // 根据人员配置筛选用户
178
- filterUsersByPersonConfig (personList, allUsers) {
179
- return personList.reduce((acc, personItem) => {
180
- let filteredUsers = []
181
-
182
- if (personItem.type === 'role') {
183
- filteredUsers = allUsers.filter(user =>
184
- user.rolestr && user.rolestr.split(',').includes(personItem.name)
185
- ).map(user => ({
186
- label: user.label,
187
- value: user.value
188
- }))
189
- } else if (personItem.type === 'department') {
190
- filteredUsers = allUsers.filter(user =>
191
- user.depname === personItem.name
192
- ).map(user => ({
193
- label: user.label,
194
- value: user.value
195
- }))
196
- }
197
-
198
- return [...acc, ...filteredUsers]
199
- }, [])
200
- },
201
- // 提交转单
202
- chargeVisibleOk () {
203
- console.log('>>>> 转单成功: ', this.optionsValue)
204
- const handler = this.chargePersonOptions.find(item => item.value === this.optionsValue)?.label
205
- if (this.define.handler === handler) {
206
- this.$message.warn('请勿选择当前处理人')
207
- return
208
- }
209
- const param = {
210
- workflowId: this.record.wo_f_workflow_id, // t_workflow -id
211
- stepRecordId: this.record.ws_id, // 步骤id (t_workflow_step -id)
212
- handler: handler, // 人员名称 或者 部门名称
213
- handlerId: this.optionsValue, // 人员id 或者 部门id
214
- ...this.define.properties.chargePerson,
215
- f_operator: this.currUser.name,
216
- oldHandler: this.define.handler,
217
- }
218
- this.confirmLoading = true
219
- runLogic('transfer', param, 'af-telephone').then(res => {
220
- this.$message.success('转单成功')
221
- this.chargeVisible = false
222
- this.$refs.xFormTable.refresh(false)
223
- }).finally(() => {
224
- this.confirmLoading = false
225
- })
226
- },
227
- // 退回的事件处理
228
- preClick (data) {
229
- console.log('退回事件处理', data)
230
- if (data.toStepId === 1) {
231
- this.$refs.workFlow.onClose()
232
- this.$refs.xFormTable.refreshTable(true)
233
- }
234
- },
235
- handleFormItemEvent (func, data, value) {
236
- console.log('打印一下:', func, data, value)
237
- },
238
- nextClick ({ form, formStep, workflowId }) {
239
- console.log('success', form, formStep, workflowId)
240
- this.$refs.xFormTable.refreshTable(true)
241
- },
242
- refresh () {
243
- this.$refs.xFormTable.refreshTable(true)
13
+ /**
14
+ * 流程详情页成功
15
+ * @param note 备注信息
16
+ * @param form 表单信息
17
+ * @param workflowId
18
+ */
19
+ success ({ note, form, workflowId }) {
20
+ console.log('success', note, form, workflowId)
21
+ },
22
+ /**
23
+ * 流程详情页成功
24
+ * @param note 备注信息
25
+ * @param form 表单信息
26
+ * @param workflowId 工作流id
27
+ * @param fromStepId 起ID
28
+ * @param toStepId 往ID
29
+ * @param successStepId 完成步骤id
30
+ * @param successStep 完成步骤名称
31
+ * @param fromStep 起步骤名称
32
+ * @param toStep 往步骤名称
33
+ */
34
+ nextClick ({ note, form, workflowId, fromStepId, toStepId, fromStep, toStep, successStepId, successStep }) {
35
+ console.log('success', note, form, workflowId, fromStepId, toStepId, fromStep, toStep, successStepId, successStep)
244
36
  }
245
37
  }
246
38
  }
247
39
  </script>
40
+
41
+ <template>
42
+ <WorkflowDetail ref="workFlow" @success="success" @nextClick="nextClick"></WorkflowDetail>
43
+ </template>
44
+
45
+ <style scoped lang="less">
46
+
47
+ </style>