vue2-client 1.17.13 → 1.17.14

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.
@@ -1,47 +1,247 @@
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
+
1
47
  <script>
2
48
  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'
3
54
 
4
55
  export default {
5
- name: 'WorkFlowDemo',
6
- components: { WorkflowDetail },
7
- mounted () {
8
- this.$refs.workFlow.init({
9
- workflowId: '3024'
10
- })
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' }),
11
87
  },
12
88
  methods: {
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)
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)
36
244
  }
37
245
  }
38
246
  }
39
247
  </script>
40
-
41
- <template>
42
- <WorkflowDetail ref="workFlow" @success="success" @nextClick="nextClick"></WorkflowDetail>
43
- </template>
44
-
45
- <style scoped lang="less">
46
-
47
- </style>
@@ -189,7 +189,8 @@ export default {
189
189
  // 获取所有步骤
190
190
  getSteps () {
191
191
  return postByServiceName(workFlowViewApi.getStepNoteAndHandler, {
192
- workflowId: this.workflowId
192
+ workflowId: this.workflowId,
193
+ curUserId: String(this.currUser.id)
193
194
  })
194
195
  .then(res => {
195
196
  this.steps = res
@@ -401,6 +401,10 @@ export default {
401
401
  return step.handler === this.currUser.name
402
402
  }
403
403
  if (step.properties.chargePerson.personList && step.properties.chargePerson.personList.length > 0) {
404
+ // 首先判断 是否 isCurrently 的值, 如果存在 isCurrently 使用 isCurrently 进行判断
405
+ if ('isCurrently' in step) {
406
+ return step.isCurrently
407
+ }
404
408
  // 使用some方法判断当前人员是否满足任一条件
405
409
  return step.properties.chargePerson.personList.some(item => {
406
410
  if (item.type === 'role') {
@@ -17,13 +17,21 @@
17
17
  <a-icon type="user" />
18
18
  <span>操作人: <span class="highlight">{{ log.operator }}</span></span>
19
19
  </div>
20
- <div class="log-item" v-if="log.set_handler">
21
- <a-icon type="solution" />
22
- <span>设定下一环节处理者: <span class="highlight">{{ log.set_handler }}</span></span>
20
+ <div v-if="log.operation !== '转单'">
21
+ <div class="log-item" v-if="log.set_handler">
22
+ <a-icon type="solution" />
23
+ <span>设定下一环节处理者: <span class="highlight">{{ log.set_handler }}</span></span>
24
+ </div>
25
+ <div class="log-item" v-if="log.set_deadline">
26
+ <a-icon type="clock-circle" />
27
+ <span>设定下一环节截止时间: <span class="highlight">{{ log.set_deadline }}</span></span>
28
+ </div>
23
29
  </div>
24
- <div class="log-item" v-if="log.set_deadline">
25
- <a-icon type="clock-circle" />
26
- <span>设定下一环节截止时间: <span class="highlight">{{ log.set_deadline }}</span></span>
30
+ <div v-else>
31
+ <div class="log-item" v-if="log.set_handler">
32
+ <a-icon type="solution" />
33
+ <span>转单后处理者: <span class="highlight">{{ log.set_handler }}</span></span>
34
+ </div>
27
35
  </div>
28
36
  <div class="log-item" v-if="log.notes">
29
37
  <a-icon type="message" />
@@ -70,7 +78,7 @@ export default {
70
78
  },
71
79
  methods: {
72
80
  getDesc (desc) {
73
- return desc.replace('&gt;', '>')
81
+ return desc?.replace('&gt;', '>')
74
82
  }
75
83
  }
76
84
  }
@@ -54,8 +54,8 @@ routerResource.example = {
54
54
  path: 'example',
55
55
  name: '示例主页面',
56
56
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo2.vue'),
57
- component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
58
- // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
57
+ // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
58
+ component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
59
59
  // component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
60
60
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
61
61
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
@@ -167,7 +167,7 @@ const loginGuard = (to, form, next, options) => {
167
167
  const login = {
168
168
  f: v4LoginData,
169
169
  jwt: v4LoginData.id,
170
- r: v4LoginData.r
170
+ r: v4LoginData.r || v4LoginData.permissions
171
171
  }
172
172
  Vue.$store.commit('account/setLogin', login)
173
173
  Vue.$store.commit('account/setPermissions', v4LoginData.r)
@@ -1,47 +1,47 @@
1
- import AMapLoader from '@amap/amap-jsapi-loader'
2
- let Amap
3
- async function GetGDMap (secretKey, key) {
4
- if (!Amap) {
5
- window._AMapSecurityConfig = {
6
- securityJsCode: secretKey
7
- }
8
- // 解决高德地图加载报错 ---> 禁止多种API加载方式混用
9
- AMapLoader.reset()
10
- Amap = await AMapLoader.load({
11
- key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
12
- version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
13
- plugins: ['AMap.IndexCluster', 'AMP.MarkerCluster', 'AMap.InfoWindow', 'AMap.HeatMap', 'AMap.HawkEye', 'AMap.DistrictSearch',
14
- 'AMap.ToolBar', 'AMap.Geolocation', 'AMap.MouseTool',
15
- 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.AutoComplete', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
16
- AMapUI: {
17
- version: '1.1', // AMapUI 缺省 1.1
18
- plugins: ['misc/PositionPicker'] // 需要加载的 AMapUI ui插件
19
- }
20
- })
21
- }
22
- return Amap
23
- }
24
-
25
- async function getGDMap (address) {
26
- new (await GetGDMap()).Geocoder({
27
- radius: 500 // 范围,默认:500
28
- }).getLocation(address, function (status, result) {
29
- if (status === 'complete' && result.geocodes.length) {
30
- return ({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
31
- } else {
32
- // eslint-disable-next-line prefer-promise-reject-errors
33
- throw new Error('根据经纬度查询地址失败')
34
- }
35
- })
36
- }
37
-
38
- async function GetLocation (address) {
39
- return new Promise((resolve, reject) => {
40
- try {
41
- resolve(getGDMap(address))
42
- } catch (e) {
43
- reject(e)
44
- }
45
- })
46
- }
47
- export { GetGDMap, GetLocation }
1
+ import AMapLoader from '@amap/amap-jsapi-loader'
2
+ let Amap
3
+ async function GetGDMap (secretKey, key) {
4
+ if (!Amap) {
5
+ window._AMapSecurityConfig = {
6
+ securityJsCode: secretKey
7
+ }
8
+ // 解决高德地图加载报错 ---> 禁止多种API加载方式混用
9
+ AMapLoader.reset()
10
+ Amap = await AMapLoader.load({
11
+ key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
12
+ version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
13
+ plugins: ['AMap.IndexCluster', 'AMP.MarkerCluster', 'AMap.InfoWindow', 'AMap.HeatMap', 'AMap.HawkEye', 'AMap.DistrictSearch',
14
+ 'AMap.ToolBar', 'AMap.Geolocation', 'AMap.MouseTool',
15
+ 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.AutoComplete', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
16
+ AMapUI: {
17
+ version: '1.1', // AMapUI 缺省 1.1
18
+ plugins: ['misc/PositionPicker'] // 需要加载的 AMapUI ui插件
19
+ }
20
+ })
21
+ }
22
+ return Amap
23
+ }
24
+
25
+ async function getGDMap (address) {
26
+ new (await GetGDMap()).Geocoder({
27
+ radius: 500 // 范围,默认:500
28
+ }).getLocation(address, function (status, result) {
29
+ if (status === 'complete' && result.geocodes.length) {
30
+ return ({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
31
+ } else {
32
+ // eslint-disable-next-line prefer-promise-reject-errors
33
+ throw new Error('根据经纬度查询地址失败')
34
+ }
35
+ })
36
+ }
37
+
38
+ async function GetLocation (address) {
39
+ return new Promise((resolve, reject) => {
40
+ try {
41
+ resolve(getGDMap(address))
42
+ } catch (e) {
43
+ reject(e)
44
+ }
45
+ })
46
+ }
47
+ export { GetGDMap, GetLocation }
package/vue.config.js CHANGED
@@ -57,11 +57,11 @@ module.exports = {
57
57
  target: revenue,
58
58
  changeOrigin: true
59
59
  },
60
- '/api/af-apply': {
61
- // pathRewrite: { '^/api/af-apply': '/' },
62
- target: revenue,
63
- changeOrigin: true
64
- },
60
+ // '/api/af-telephone': {
61
+ // pathRewrite: { '^/api/af-telephone': '/' },
62
+ // target: 'http://127.0.0.1:9033',
63
+ // changeOrigin: true
64
+ // },
65
65
  '/api/af-scada': {
66
66
  target: revenue,
67
67
  changeOrigin: true