vue2-client 1.15.14 → 1.15.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.
@@ -32,26 +32,9 @@
32
32
  >
33
33
  </WorkflowDetail>
34
34
  <address-select ref="addressSelect" @setAddress="setForm"></address-select>
35
- <!-- 协议新增功能 -->
36
- <a-modal
37
- v-model="formAddContractState"
38
- :dialog-style="{ top: '5rem' }"
39
- :z-index="1001"
40
- title="新增"
41
- :destroyOnClose="true"
42
- width="55vw">
43
- <x-add-native-form
44
- ref="xContractForm"
45
- @onSubmit="submitContract"
46
- />
47
- <template #footer>
48
- <a-button key="back" @click="formAddContractState = false">取消</a-button>
49
- <a-button key="submit" type="primary" :loading="submitContractLoading" @click="formContractSubmit">确认</a-button>
50
- </template>
51
- </a-modal>
52
35
  <!-- 协议作废功能 -->
53
36
  <a-modal
54
- v-model="formCancelState"
37
+ v-model="formState"
55
38
  :dialog-style="{ top: '5rem' }"
56
39
  :z-index="1001"
57
40
  title="作废"
@@ -62,55 +45,10 @@
62
45
  @onSubmit="submit"
63
46
  />
64
47
  <template #footer>
65
- <a-button key="back" @click="formCancelState = false">取消</a-button>
48
+ <a-button key="back" @click="formState = false">取消</a-button>
66
49
  <a-button key="submit" type="primary" :loading="submitLoading" @click="formSubmit">确认</a-button>
67
50
  </template>
68
51
  </a-modal>
69
- <a-modal
70
- v-model="formChargeVisible"
71
- :footer="null"
72
- :dialog-style="{ top: '5rem' }"
73
- :bodyStyle="{height:'70vh'}"
74
- :z-index="1001"
75
- title="新增"
76
- width="70%"
77
- :destroyOnClose="true">
78
- <other-charge
79
- :data="chargeData"
80
- @cancel="cancel"
81
- >
82
- </other-charge>
83
- </a-modal>
84
- <!-- 新增/编辑 用户信息 -->
85
- <a-modal
86
- :z-index="1001"
87
- :confirm-loading="confirmLoading"
88
- v-model="formModalVisible"
89
- :dialog-style="{ top: '30px' }"
90
- :bodyStyle="{height:'70vh'}"
91
- :destroy-on-close="true"
92
- :title="formTitle"
93
- @ok="submitAddForm"
94
- width="85vw">
95
- <x-form-group
96
- ref="xFormGroupDemo"
97
- @x-form-item-emit-func="groupFromItemEmitFunc"
98
- >
99
- <template #devices="{data, index}">
100
- <user-devices
101
- @setRef="setRef(`nativeForm-${index}`)"
102
- :ref="`nativeForm-${index}`"
103
- :data="data"></user-devices>
104
- </template>
105
- <template #security="{data, index}">
106
- <user-security
107
- @setRef="setRef1(`nativeForm-${index}`)"
108
- :ref="`nativeForm-${index}`"
109
- :data="data"></user-security>
110
- </template>
111
- </x-form-group>
112
- </a-modal>
113
- <rent-phone @submit="rentPhoneSubmit" ref="rentPhone"></rent-phone>
114
52
  </a-card>
115
53
  </template>
116
54
 
@@ -118,38 +56,22 @@
118
56
  import WorkflowDetail from '@vue2-client/pages/WorkflowDetail/WorkflowDetail.vue'
119
57
  import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
120
58
  import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
121
- import { getConfigByName, getConfigByNameAsync, runLogic } from 'vue2-client/src/services/api/common'
59
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
122
60
  import { mapState } from 'vuex'
123
61
  import AddressSelect from '@vue2-client/pages/addressSelect/index.vue'
124
- import otherCharge from '@/pages/apply/installFunction/otherCharge/index.vue'
125
62
 
126
- import userDevices from '@/pages/apply/userFilesManage/userDevices.vue'
127
- import userSecurity from '@/pages/apply/userFilesManage/userSecurity.vue'
128
- import rentPhone from '@/pages/apply/userFilesManage/rentPhone.vue'
129
- import XFormGroup from '@vue2-client/base-client/components/common/XFormGroup'
130
- import { getRealKeyData } from '@vue2-client/utils/formatter'
131
63
  export default {
132
64
  name: 'Apply',
133
65
  components: {
134
66
  XFormTable,
135
67
  XAddNativeForm,
136
68
  WorkflowDetail,
137
- AddressSelect,
138
- otherCharge,
139
- userDevices,
140
- userSecurity,
141
- rentPhone,
142
- XFormGroup
69
+ AddressSelect
143
70
  },
144
- // 透传给子组件的方法(目前XFormTable接了)
145
71
  provide () {
146
72
  return {
147
73
  generalFunction: {
148
74
  setCancel: this.setCancel,
149
- chargeAdd: this.chargeAdd,
150
- addUser: this.addUser,
151
- editUser: this.editUser,
152
- addContract: this.addContract,
153
75
  }
154
76
  }
155
77
  },
@@ -159,32 +81,9 @@ export default {
159
81
  queryParamsName: 'ApplyProcessCRUD',
160
82
  // 发起报建弹框控制
161
83
  applyAddFlag: false,
162
- // 协议作废
163
- formCancelState: false,
84
+ formState: false,
164
85
  submitLoading: false,
165
- cancelRecord: {},
166
- // 协议新增
167
- formAddContractState: false,
168
- submitContractLoading: false,
169
- // 增值收费新增
170
- formChargeVisible: false,
171
- chargeData: {
172
- f_workflow_id: null,
173
- },
174
- // 提交加载动画
175
- confirmLoading: false,
176
- // 是否显示详情抽屉
177
- formModalVisible: false,
178
- // 表单组title
179
- formTitle: '新建档案',
180
- // 修改备用电话列表
181
- rentPhone: [],
182
- // 是否修改过备用电话标识
183
- isEditRentPhone: false,
184
- // 修改设备列表
185
- editDevices: [],
186
- securityDevices: [],
187
- addressdetail: '',
86
+ cancelRecord: {}
188
87
  }
189
88
  },
190
89
  computed: {
@@ -222,7 +121,8 @@ export default {
222
121
  },
223
122
  toDetail (record, id) {
224
123
  this.$refs.workFlow.init({
225
- workflowId: record.ab_f_workflow_id
124
+ workflowId: record.ab_f_workflow_id,
125
+ stepId: record.ws_f_step_id
226
126
  })
227
127
  },
228
128
  handleFormItemEvent (func, data, value) {
@@ -232,15 +132,7 @@ export default {
232
132
  }
233
133
  },
234
134
  setForm (record) {
235
- if (this.addressdetail == '新增用户') {
236
- const form = {
237
- f_address: record.f_address,
238
- f_address_id: record.f_address_id
239
- }
240
- this.$refs.xFormGroupDemo.getNativeFormRef('t_userinfo')[0].setForm(form)
241
- } else {
242
- this.$refs.workFlow.setFormValue({ address: record.f_address, address_id: record.f_address_id })
243
- }
135
+ this.$refs.workFlow.setFormValue({ address: record.f_address, address_id: record.f_address_id })
244
136
  },
245
137
  nextClick ({ form, formStep, workflowId }) {
246
138
  console.log('success', form, formStep, workflowId)
@@ -261,7 +153,7 @@ export default {
261
153
  // 协议作废
262
154
  setCancel (record) {
263
155
  this.cancelRecord = record
264
- this.formCancelState = true
156
+ this.formState = true
265
157
  this.$nextTick(() => {
266
158
  getConfigByName('setCancelForm', 'af-apply', (config) => {
267
159
  if (this.$refs.xCancelForm) {
@@ -286,8 +178,8 @@ export default {
286
178
  })
287
179
  })
288
180
  },
289
- // 协议作废提交
290
181
  async formSubmit () {
182
+ this.submitLoading = true
291
183
  const formData = await this.$refs.xCancelForm.asyncSubmit()
292
184
  try {
293
185
  await this.submit(formData)
@@ -295,205 +187,18 @@ export default {
295
187
  this.$message.error('表单验证失败,请检查填写内容')
296
188
  } finally {
297
189
  this.submitLoading = false
298
- // 提交成功后刷新表格
299
190
  }
300
191
  },
301
192
  async submit (formData) {
302
- this.submitLoading = true
303
193
  const data = {
304
- realForm: formData.realForm,
305
- cancelRecord: this.cancelRecord,
306
- user: this.currUser.operaInfo,
194
+ ...formData,
307
195
  }
308
- console.log('协议作废参数', data)
309
- await runLogic('setCancelLogic', data, 'af-apply').then(() => {
196
+ console.log('==formData', data)
197
+ await runLogic('暂时没有实现的logic', data, 'af-apply').then(() => {
310
198
  this.$message.success('操作成功')
311
- this.formCancelState = false
312
- })
313
- },
314
- // 增值收费新增
315
- chargeAdd () {
316
- this.chargeData.f_workflow_id = this.$refs.workFlow.workflowId
317
- this.formChargeVisible = true
318
- },
319
- cancel () {
320
- this.formChargeVisible = false
321
- // 需要调用子孙组件的刷新方法
322
- // this.$refs.xFormTable.refreshTable(true)
323
- },
324
- // 新增用户
325
- addUser () {
326
- this.formTitle = '新建档案'
327
- getConfigByNameAsync('addapplyuserinfoFormGroup', 'af-apply').then(res => {
328
- this.formModalVisible = true
329
- this.$nextTick(
330
- () => {
331
- this.$refs.xFormGroupDemo.init({
332
- ...res,
333
- serviceName: 'af-apply',
334
- showLeftTab: true,
335
- businessType: '新增'
336
- })
337
- }
338
- )
199
+ this.formState = false
339
200
  })
340
- },
341
- groupFromItemEmitFunc (func, data) {
342
- console.log('func', func, data)
343
- if (func === 'addRentPhone') {
344
- this.$refs.rentPhone.init({
345
- localVisible: true,
346
- form: {
347
- rentPhone: this.rentPhone.map(item => {
348
- if (item.f_type === null) {
349
- item.f_type = undefined
350
- }
351
- return item
352
- })
353
- }
354
- })
355
- } else if (func === 'selectAddress') {
356
- this.addressdetail = '新增用户'
357
- // 选择地址事件
358
- this.$refs.addressSelect.setFormShow()
359
- }
360
- },
361
- submitAddForm () {
362
- this.confirmLoading = true
363
- this.$refs.xFormGroupDemo.onSubmit().then(res => {
364
- if (this.formTitle === '新建档案') {
365
- res.t_userinfo.f_workflow_id = this.$refs.workFlow.workflowId
366
- res.t_userfiles.f_workflow_id = this.$refs.workFlow.workflowId
367
- res.t_userinfo.f_user_state = '预备'
368
- res.t_userfiles.f_table_state = '待开通'
369
- }
370
- if (res.devices.length > 0) {
371
- res.devices.forEach(row => {
372
- row.f_workflow_id = this.$refs.workFlow.workflowId
373
- })
374
- }
375
- let saveData = Object.assign(res, { divisions: this.divisions })
376
- if (this.formTitle === '编辑档案') {
377
- saveData = Object.assign(saveData, {
378
- f_operator_record: this.currUser.name,
379
- f_operatorid_record: this.currUser.id,
380
- f_orgid_record: this.currUser.orgid,
381
- f_orgname_record: this.currUser.orgs,
382
- f_depid_record: this.currUser.depids,
383
- f_depname_record: this.currUser.dops
384
- })
385
- }
386
- // 备用电话赋值
387
- if (this.isEditRentPhone) {
388
- saveData = Object.assign(saveData, {
389
- rentPhone: this.rentPhone
390
- })
391
- }
392
- runLogic('userFIleSaveLogic', saveData, 'af-revenue').then(() => {
393
- this.confirmLoading = false
394
- this.formModalVisible = false
395
- this.$message.success('操作成功')
396
- }).catch(() => {
397
- this.confirmLoading = false
398
- })
399
- }).catch(() => {
400
- this.confirmLoading = false
401
- })
402
- },
403
- rentPhoneSubmit (phones) {
404
- // 提交过备用电话 视为修改过
405
- this.isEditRentPhone = true
406
- this.rentPhone = phones
407
- this.$refs.rentPhone.init({
408
- localVisible: false
409
- })
410
- },
411
- setRef (refName) {
412
- // 给表单组赋值ref
413
- // 因为提交的时候 表单组需要循环便利 ref 的 提交事件
414
- this.$refs.xFormGroupDemo.setRef(refName, [this.$refs[refName]])
415
- this.$refs[refName].init(this.editDevices)
416
- },
417
- setRef1 (refName) {
418
- // 给表单组赋值ref
419
- // 因为提交的时候 表单组需要循环便利 ref 的 提交事件
420
- this.$refs.xFormGroupDemo.setRef(refName, [this.$refs[refName]])
421
- this.$refs[refName].init(this.securityDevices)
422
- },
423
- // 编辑档案
424
- editUser (record) {
425
- this.formTitle = '编辑档案'
426
- const _record = getRealKeyData(record)
427
- getConfigByNameAsync('addapplyuserinfoFormGroup', 'af-apply').then(configRes => {
428
- runLogic('getFileDetailForEdit', {
429
- f_userinfo_id: _record.f_userinfo_id
430
- }, 'af-revenue').then((res) => {
431
- this.formModalVisible = true
432
- // 组织修改表单
433
- this.$nextTick(
434
- () => {
435
- this.$refs.xFormGroupDemo.init({
436
- ...configRes,
437
- serviceName: 'af-revenue',
438
- showLeftTab: true,
439
- businessType: '编辑',
440
- modifyModelData: res
441
- })
442
- this.editDevices = res.devices
443
- this.securityDevices = res.security
444
- this.rentPhone = res.phones
445
- }
446
- )
447
- })
448
- })
449
- },
450
- // 协议新增
451
- addContract () {
452
- this.formAddContractState = true
453
- this.$nextTick(() => {
454
- getConfigByName('ApplyAddContractForm', 'af-apply', (config) => {
455
- if (this.$refs.xContractForm) {
456
- this.$refs.xContractForm.init({
457
- formItems: config.formJson,
458
- title: '新增补充协议',
459
- businessType: '新增',
460
- showSubmitBtn: false,
461
- ...config
462
- })
463
- } else {
464
- console.error('xCancelForm组件未加载完成')
465
- // 延迟重试
466
- setTimeout(() => {
467
- this.addContract()
468
- }, 100)
469
- }
470
- })
471
- })
472
- },
473
- async formContractSubmit () {
474
- const formData = await this.$refs.xContractForm.asyncSubmit()
475
- try {
476
- await this.submitContract(formData)
477
- } catch (error) {
478
- this.$message.error('表单验证失败,请检查填写内容')
479
- } finally {
480
- this.submitContractLoading = false
481
- // 提交成功后刷新表格
482
- }
483
- },
484
- async submitContract (formData) {
485
- this.submitContractLoading = true
486
- const data = {
487
- realForm: formData.realForm,
488
- workflowId: this.$refs.workFlow.workflowId,
489
- user: this.currUser.operaInfo,
490
- }
491
- console.log('新增协议参数', data)
492
- await runLogic('AddContractLogic', data, 'af-apply').then(() => {
493
- this.$message.success('操作成功')
494
- this.formAddContractState = false
495
- })
496
- },
201
+ }
497
202
  }
498
203
  }
499
204
  </script>
@@ -43,6 +43,8 @@
43
43
  :visible="visible"
44
44
  :taskName="details.f_task_name"
45
45
  :details="details"
46
+ :renderCurrentNode="renderCurrentNode"
47
+ :initStepId="initStepId"
46
48
  @refresh="stepChanged"
47
49
  @success="success"
48
50
  @nextClick="nextClick"
@@ -123,6 +125,7 @@ export default {
123
125
  LeaveMessage,
124
126
  XUploadFilesView
125
127
  },
128
+ props: {},
126
129
  data () {
127
130
  return {
128
131
  // 页面宽度
@@ -142,7 +145,10 @@ export default {
142
145
  messageList: [],
143
146
  messageLoading: true,
144
147
  workflowId: '',
145
- visible: false
148
+ initStepId: null,
149
+ visible: false,
150
+ // 控制流程是否可操作
151
+ renderCurrentNode: true
146
152
  }
147
153
  },
148
154
  expose: ['setFormValue'],
@@ -157,13 +163,13 @@ export default {
157
163
  this.steps !== undefined
158
164
  }
159
165
  },
160
- props: {},
161
166
  mounted () {
162
167
  // this.init()
163
168
  },
164
169
  methods: {
165
170
  // 内部组件更新了当前步骤后的回调
166
171
  stepChanged () {
172
+ this.initStepId = null
167
173
  this.loading = true
168
174
  this.reload()
169
175
  },
@@ -190,6 +196,7 @@ export default {
190
196
  this.fixedQueryForm = {}
191
197
  this.steps = undefined
192
198
  this.messageList = []
199
+ this.currStepId = null
193
200
  },
194
201
  // 获取基础信息
195
202
  getBaseInfo () {
@@ -198,7 +205,12 @@ export default {
198
205
  workflowId: this.workflowId
199
206
  })
200
207
  .then(res => {
201
- res.f_sub_state = this.steps.find(item => item.id === res.f_step_id)?.name
208
+ // 主动传入得优先级较高
209
+ if (this.currStepId) {
210
+ res.f_sub_state = this.steps.find(item => item.id === this.currStepId)?.name
211
+ } else {
212
+ res.f_sub_state = this.steps.find(item => item.id === res.f_step_id)?.name
213
+ }
202
214
  this.details = res
203
215
  }, err => {
204
216
  console.log(err)
@@ -220,9 +232,13 @@ export default {
220
232
  this.fixedAddForm.a_f_workflow_id = this.workflowId
221
233
  },
222
234
  // 初始化两张固定表
223
- async init ({ workflowId, visible = true }) {
235
+ async init ({ workflowId, stepId, renderCurrentNode = true, visible = true }) {
224
236
  this.workflowId = workflowId
237
+ if (stepId) {
238
+ this.initStepId = stepId
239
+ }
225
240
  this.visible = visible
241
+ this.renderCurrentNode = renderCurrentNode
226
242
  await this.reload()
227
243
  },
228
244
  // 切换标签页