n20-common-lib 2.11.12 → 2.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "2.11.12",
3
+ "version": "2.11.14",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -163,7 +163,7 @@
163
163
  </div>
164
164
  <!-- 审批按钮 -->
165
165
  <div v-if="authList.includes('byAddTask') && !addTaskList.length" class="text-c">
166
- <el-button type="primary" @click="checkFlowFn">{{ '批 准' | $lc }}</el-button>
166
+ <el-button type="primary" @click="showAdvancePop">{{ '批 准' | $lc }}</el-button>
167
167
  <el-button type="primary" @click="approvalToV = true">{{ '批准至' | $lc }}</el-button>
168
168
  <el-button plain @click="rejectToB">{{ '驳回至' | $lc }}</el-button>
169
169
  <el-button plain @click="rejectFn">{{ '驳回至发起人' | $lc }}</el-button>
@@ -177,7 +177,7 @@
177
177
  <el-button v-if="authList.includes('refuse')" plain @click="rejectFn">{{ '拒 绝' | $lc }}</el-button>
178
178
  <el-button v-if="authList.includes('takeOff')" plain @click="qjFn">{{ '请 假' | $lc }}</el-button>
179
179
  <!-- END -->
180
- <el-button v-if="authList.includes('approval')" type="primary" @click="checkFlowFn">{{
180
+ <el-button v-if="authList.includes('approval')" type="primary" @click="showAdvancePop">{{
181
181
  '批 准' | $lc
182
182
  }}</el-button>
183
183
  <el-button v-if="authList.includes('approval') && nextApproval && nextBtn" type="primary" @click="approvalNext">{{
@@ -300,10 +300,22 @@
300
300
  </div>
301
301
  </span>
302
302
  </cl-dialog>
303
+ <!-- 选择审批人 -->
304
+ <cl-dialog
305
+ v-drag
306
+ :visible.sync="setSpr"
307
+ :title="'设置审批节点/审批人' | $lc"
308
+ width="1100px"
309
+ append-to-body
310
+ top="7.5vh"
311
+ >
312
+ <selectSpr :select-spr-list="selectSprList" @close="setSpr = false" @confirm="selectSprListFn" />
313
+ </cl-dialog>
303
314
  </div>
304
315
  </template>
305
316
 
306
317
  <script>
318
+ import selectSpr from './selectSpr.vue'
307
319
  import getJsonc from '../../assets/getJsonc.js'
308
320
  import { closeTagsForBackPage } from '../../plugins/CompatibleOld'
309
321
  import axios from '../../utils/axios'
@@ -329,6 +341,7 @@ if (!window._approvalExtend['addtask.chdUserInfo.extend']) {
329
341
  export default {
330
342
  name: 'ApprovalButtons',
331
343
  components: {
344
+ selectSpr,
332
345
  ClDialog,
333
346
  ClUpload,
334
347
  CarboncopyProp,
@@ -417,6 +430,10 @@ export default {
417
430
  data() {
418
431
  this.msgisSync = !!this.$listeners['update:message']
419
432
  return {
433
+ nextEgwOutgoingNodeId: undefined,
434
+ nextNodeApproveUnos: undefined,
435
+ selectSprList: undefined,
436
+ setSpr: false,
420
437
  requiredC: false,
421
438
  prefixCls,
422
439
  messageIn: '',
@@ -494,6 +511,32 @@ export default {
494
511
  this.getIsShowUploadWidget()
495
512
  },
496
513
  methods: {
514
+ // 查询选择审批人
515
+ async showAdvancePop() {
516
+ try {
517
+ const res = await this.$axios.post('/bems/activiti/admin/todo/showAdvancePop', {
518
+ isAgentcy: this.$route.query.isAgentcy,
519
+ taskId: this.$route.query.taskId
520
+ })
521
+ // 如果返回正常 且有返回值 且showNextEgwOutgoingNodeName跟showNextNodeAssignee有一个为true
522
+ if (res.code === 200 && res.data && (res.data.showNextEgwOutgoingNodeName || res.data.showNextNodeAssignee)) {
523
+ this.setSpr = true
524
+ this.selectSprList = res.data
525
+ } else {
526
+ this.checkFlowFn()
527
+ }
528
+ } catch (error) {
529
+ console.log(error)
530
+ this.checkFlowFn()
531
+ }
532
+ },
533
+ // 选择审批人
534
+ selectSprListFn(data) {
535
+ console.log(data)
536
+ this.nextEgwOutgoingNodeId = data.nextEgwOutgoingNodeId
537
+ this.nextNodeApproveUnos = data.nextNodeApproveUnos
538
+ this.checkFlowFn()
539
+ },
497
540
  async getIsShowUploadWidget() {
498
541
  const { processInstanceId: procInstId, taskId } = this.$route.query
499
542
  const { code, data } = await this.$axios.get(
@@ -548,7 +591,6 @@ export default {
548
591
  }
549
592
  })
550
593
  },
551
-
552
594
  // 换回到发起页
553
595
  goFrom() {
554
596
  let pathname = location.pathname
@@ -562,7 +604,6 @@ export default {
562
604
  closeTagsForBackPage(pathname)
563
605
  })
564
606
  },
565
-
566
607
  // 动态获取按钮
567
608
  getBtns() {
568
609
  if (!this.taskId || !this.showBtn) return false
@@ -653,6 +694,8 @@ export default {
653
694
  }
654
695
  return [
655
696
  {
697
+ nextNodeApproveUnos: this.nextNodeApproveUnos,
698
+ nextEgwOutgoingNodeId: this.nextEgwOutgoingNodeId,
656
699
  isTakeOff: this.isTakeOff,
657
700
  typeCode,
658
701
  taskId,
@@ -810,6 +853,7 @@ export default {
810
853
  this.isTakeOff = '1'
811
854
  this.checkFlowFn()
812
855
  },
856
+
813
857
  async checkFlowFn() {
814
858
  this.isTakeOff = undefined
815
859
  if (this.requiredC && !this.messageC) {
@@ -829,6 +873,8 @@ export default {
829
873
  auditAdvanceDtos: [
830
874
  {
831
875
  isTakeOff: this.isTakeOff,
876
+ nextNodeApproveUnos: this.nextNodeApproveUnos,
877
+ nextEgwOutgoingNodeId: this.nextEgwOutgoingNodeId,
832
878
  appNo,
833
879
  taskId,
834
880
  groupNo,
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <cl-page style="height: 75vh; --table-w: 650px">
3
+ <div class="flex-box" style="height: 100%">
4
+ <el-table
5
+ ref="elTable"
6
+ :data="selectSprList.actNextNodeAssigneeVos"
7
+ row-key="nodeId"
8
+ border
9
+ height="100%"
10
+ style="width: 30%; flex: none"
11
+ @select="sltChange"
12
+ @select-all="sltChange"
13
+ >
14
+ <el-table-column header-align="center" align="center" :label="'节点名称' | $lc">
15
+ <template slot-scope="scope">
16
+ <el-radio v-model="nextEgwOutgoingNodeId" :label="scope.row.nodeId" @change="sltChange(scope.row)">{{
17
+ scope.row.nodeName
18
+ }}</el-radio>
19
+ </template>
20
+ </el-table-column>
21
+ </el-table>
22
+ <div class="flex-column flex-c p-l p-r">
23
+ <i class="el-icon-d-arrow-left m-b"></i>
24
+ <i class="el-icon-d-arrow-right"></i>
25
+ </div>
26
+ <el-table
27
+ ref="personTable"
28
+ :data="nodeTable"
29
+ row-key="uno"
30
+ border
31
+ height="100%"
32
+ style="width: var(--table-w); flex: none"
33
+ @select="personChange"
34
+ @select-all="personChange"
35
+ >
36
+ <el-table-column
37
+ :selectable="handleSelectable"
38
+ :reserve-selection="true"
39
+ type="selection"
40
+ width="46"
41
+ header-align="center"
42
+ align="center"
43
+ />
44
+ <el-table-column prop="uno" :label="'审批人员编号' | $lc" header-align="center" align="center" />
45
+ <el-table-column prop="uname" :label="'审批人员名称' | $lc" header-align="center" align="center" />
46
+ <el-table-column prop="deptName" :label="'审批人员所属部门' | $lc" header-align="center" align="center" />
47
+ </el-table>
48
+ </div>
49
+ <template slot="footer">
50
+ <div class="flex-box m-t m-b" style="margin-left: calc(30% + 50px)">
51
+ <cl-statis-item type="已选合计" :list="[{ label: '笔数', value: personList.length }]" show-w />
52
+ </div>
53
+ <div class="text-c">
54
+ <el-button type="primary" @click="confirmFn">{{ '确定' | $lc }}</el-button>
55
+ <el-button @click="$emit('close')">{{ '取消' | $lc }}</el-button>
56
+ </div>
57
+ </template>
58
+ </cl-page>
59
+ </template>
60
+
61
+ <script>
62
+ import { $lc } from '../../utils/i18n/index'
63
+ import ClPage from '../PageLayout/page.vue'
64
+ import ClStatisItem from '../Statis/statisItem.vue'
65
+ export default {
66
+ components: {
67
+ ClPage,
68
+ ClStatisItem
69
+ },
70
+ props: {
71
+ selectSprList: {
72
+ type: Array,
73
+ default: () => {
74
+ return {
75
+ actNextNodeAssigneeVos: []
76
+ }
77
+ }
78
+ },
79
+ type: {
80
+ type: String,
81
+ default: undefined
82
+ }
83
+ },
84
+ data() {
85
+ return {
86
+ nextEgwOutgoingNodeId: '',
87
+ nodeTable: [],
88
+ selectCheck: true,
89
+ personList: []
90
+ }
91
+ },
92
+ mounted() {
93
+ this.$refs.elTable.clearSelection()
94
+ this.carbonCopyList.forEach((item) => {
95
+ this.$refs.elTable.toggleRowSelection(item, true)
96
+ })
97
+ },
98
+ methods: {
99
+ handleSelectable(row) {
100
+ // 返回 false 禁止选择该行
101
+ return this.selectCheck
102
+ },
103
+ sltChange(row) {
104
+ this.nodeTable = row.actAssigneeVoList
105
+ this.$refs.personTable.clearSelection()
106
+ this.selectCheck = this.selectSprList?.showNextNodeAssignee || false
107
+ },
108
+ personChange(list) {
109
+ this.personList = list
110
+ },
111
+ closeFn(item) {
112
+ this.selectSprList = {
113
+ actNextNodeAssigneeVos: []
114
+ }
115
+ },
116
+ confirmFn() {
117
+ this.$emit('confirm', {
118
+ nextEgwOutgoingNodeId: this.selectSprList?.showNextEgwOutgoingNodeName ? this.nextEgwOutgoingNodeId : undefined,
119
+ nextNodeApproveUnos: this.selectSprList?.showNextNodeAssignee
120
+ ? this.personList.map((item) => item.uno)
121
+ : undefined
122
+ })
123
+ }
124
+ }
125
+ }
126
+ </script>
127
+
128
+ <style></style>
@@ -434,6 +434,7 @@ export default {
434
434
  let approvalData = []
435
435
  data?.forEach((item) => {
436
436
  let _item = {
437
+ isShow: item.isShow, //是否显示
437
438
  endTime: item.endTime || '',
438
439
  assignee: item.assignee,
439
440
  suggestion: item.suggestion,
@@ -477,7 +478,11 @@ export default {
477
478
 
478
479
  approvalData.push(_item)
479
480
  })
480
- return approvalData
481
+ return (
482
+ approvalData?.filter((item) => {
483
+ return item.isShow !== '0'
484
+ }) || []
485
+ )
481
486
  },
482
487
  // 获取数据字典加签备注
483
488
  async getMdmDataDoc() {
@@ -34,9 +34,12 @@
34
34
  }}</span>
35
35
  <el-button type="text" icon="el-icon-full-screen" style="font-size: 16px" @click="scaleReset" />
36
36
  </div>
37
- <el-popover ref="title-pop" v-model="msgV" trigger="manual" placement="top">
37
+ <el-popover ref="title-pop" v-model="msgV" trigger="hover" placement="top">
38
38
  <div class="activiti-msg">
39
39
  <div v-if="assigneeEnd" class="m-t-ss m-b-ss">
40
+ <div class="flex-box flex-r">
41
+ <el-button type="text" @click="uploadList(assigneeEnd)">{{ '导出' | $lc }}</el-button>
42
+ </div>
40
43
  <table cellspacing="0" style="border-collapse: collapse; min-width: 460px">
41
44
  <tr>
42
45
  <td class="text-c">{{ '已审批人' | $lc }}</td>
@@ -128,10 +131,10 @@
128
131
  </div>
129
132
  </el-popover>
130
133
 
131
- <el-popover ref="child-pop" popper-class="n20-approval-child" v-model="childV" trigger="manual" placement="bottom">
132
- <div v-click-outside="clickOut" v-if="childV">
134
+ <el-popover ref="child-pop" v-model="childV" popper-class="n20-approval-child" trigger="manual" placement="bottom">
135
+ <div v-if="childV" v-click-outside="clickOut">
133
136
  <div>{{ childTitle }}</div>
134
- <child :data-pro="childDataPro"></child>
137
+ <child :data-pro="childDataPro" />
135
138
  </div>
136
139
  </el-popover>
137
140
  </div>
@@ -279,6 +282,31 @@ export default {
279
282
  document.body.removeEventListener('click', this.addTaskFn)
280
283
  },
281
284
  methods: {
285
+ // 导出
286
+ uploadList(assigneeEnd) {
287
+ axios
288
+ .post(
289
+ '/bems/activiti/sample/importTaskFlowHistory',
290
+ {
291
+ taskName: '',
292
+ detailList: assigneeEnd.map((item) => {
293
+ return {
294
+ assignee: item.assignee,
295
+ optResult: item.optResult,
296
+ suggestion: item.suggestion,
297
+ endTime: item.endTime
298
+ }
299
+ })
300
+ },
301
+ {
302
+ responseType: 'blob',
303
+ timeout: 600000 // 针对单个请求设置超时时间
304
+ }
305
+ )
306
+ .then((res) => {
307
+ this.$downloadBlob(res, res.name)
308
+ })
309
+ },
282
310
  addTaskFn() {
283
311
  this.addTaskV = false
284
312
  },
@@ -547,6 +575,9 @@ export default {
547
575
  } else if (this.dataPro.taskDefIdMap[id] /*已审批*/) {
548
576
  this.assigneeEnd = this.dataPro.taskDefIdMap[id]
549
577
  this.$nextTick(() => {
578
+ this.assigneeEnd = this.assigneeEnd?.filter((item) => {
579
+ return item.isShow !== '0'
580
+ })
550
581
  this.$refs['title-pop'].doDestroy()
551
582
  this.$refs['title-pop'].referenceElm = ev.currentTarget
552
583
  this.msgV = true
@@ -568,6 +599,9 @@ export default {
568
599
  this.assigneeEnd = list
569
600
  }
570
601
  this.$nextTick(() => {
602
+ this.assigneeEnd = this.assigneeEnd?.filter((item) => {
603
+ return item.isShow !== '0'
604
+ })
571
605
  this.$refs['title-pop'].doDestroy()
572
606
  this.$refs['title-pop'].referenceElm = task
573
607
  this.msgV = true