hrp-ui-base 1.0.1 → 1.0.2

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 (190) hide show
  1. package/dist/components.cjs +1 -1
  2. package/dist/components.es.js +4 -4
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.es.js +83 -67
  5. package/dist/style.css +1 -1
  6. package/package.json +15 -4
  7. package/packages/approval-process/.eslintrc +7 -0
  8. package/packages/approval-process/README.md +130 -0
  9. package/packages/approval-process/index.ts +65 -0
  10. package/packages/approval-process/package.json +17 -0
  11. package/packages/approval-process/packages/components/choose-member/BO/departBo.ts +8 -0
  12. package/packages/approval-process/packages/components/choose-member/BO/memberBo.ts +14 -0
  13. package/packages/approval-process/packages/components/choose-member/BO/role.svg +1 -0
  14. package/packages/approval-process/packages/components/choose-member/BO/roleBo.ts +16 -0
  15. package/packages/approval-process/packages/components/choose-member/index.vue +497 -0
  16. package/packages/approval-process/packages/components/choose-member/styles/common.scss +134 -0
  17. package/packages/approval-process/packages/components/comment/assets/avatar.svg +1 -0
  18. package/packages/approval-process/packages/components/comment/assets/download.svg +4 -0
  19. package/packages/approval-process/packages/components/comment/assets/mp3.svg +11 -0
  20. package/packages/approval-process/packages/components/comment/assets/mp4.svg +11 -0
  21. package/packages/approval-process/packages/components/comment/assets/other.svg +11 -0
  22. package/packages/approval-process/packages/components/comment/assets/pdf.svg +11 -0
  23. package/packages/approval-process/packages/components/comment/assets/ppt.svg +11 -0
  24. package/packages/approval-process/packages/components/comment/assets/preview.svg +4 -0
  25. package/packages/approval-process/packages/components/comment/assets/remove.png +0 -0
  26. package/packages/approval-process/packages/components/comment/assets/word.svg +11 -0
  27. package/packages/approval-process/packages/components/comment/assets/xls.svg +11 -0
  28. package/packages/approval-process/packages/components/comment/index.vue +843 -0
  29. package/packages/approval-process/packages/components/comment/modules/previewMp.vue +54 -0
  30. package/packages/approval-process/packages/components/comment/styles/comment-style.scss +304 -0
  31. package/packages/approval-process/packages/components/image-cropper/index.vue +202 -0
  32. package/packages/approval-process/packages/components/sign/index.vue +766 -0
  33. package/packages/approval-process/packages/components/sign/modules/full-screen-sign.vue +20 -0
  34. package/packages/approval-process/packages/components/urge-dialog/index.vue +121 -0
  35. package/packages/approval-process/packages/components/vue-esign/index.vue +289 -0
  36. package/packages/approval-process/packages/flow/approve-component/approve-success.vue +82 -0
  37. package/packages/approval-process/packages/flow/approve-component/route-params-error.vue +49 -0
  38. package/packages/approval-process/packages/flow/approve-component/submit-success.vue +59 -0
  39. package/packages/approval-process/packages/flow/examine-approve-itr.vue +978 -0
  40. package/packages/approval-process/packages/flow/examine-approve.vue +1065 -0
  41. package/packages/approval-process/packages/flow/form-component/associated-approval-form/README.md +38 -0
  42. package/packages/approval-process/packages/flow/form-component/associated-approval-form/assets/avatar.svg +1 -0
  43. package/packages/approval-process/packages/flow/form-component/associated-approval-form/index.vue +159 -0
  44. package/packages/approval-process/packages/flow/form-component/associated-approval-form/modules/associated-approval-form-mobile.vue +297 -0
  45. package/packages/approval-process/packages/flow/form-component/associated-approval-form/modules/associated-approval-form-pc.vue +314 -0
  46. package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/curd-area-mobile.scss +110 -0
  47. package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/curd-area.scss +96 -0
  48. package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/out-put.scss +48 -0
  49. package/packages/approval-process/packages/flow/form-component/show-sign.vue +27 -0
  50. package/packages/approval-process/packages/flow/styles/common.scss +134 -0
  51. package/packages/approval-process/packages/flow/styles/examine-approve-pc.scss +465 -0
  52. package/packages/approval-process/packages/flow/styles/examine-approve-phone.scss +293 -0
  53. package/packages/approval-process/packages/flow/styles/submit-approve-pc.scss +379 -0
  54. package/packages/approval-process/packages/flow/styles/submit-approve-phone.scss +337 -0
  55. package/packages/approval-process/packages/flow/submit-approve-itr.vue +623 -0
  56. package/packages/approval-process/packages/flow/submit-approve.vue +628 -0
  57. package/packages/approval-process/packages/flow/systemCom/BO/departBo.ts +8 -0
  58. package/packages/approval-process/packages/flow/systemCom/BO/memberBo.ts +14 -0
  59. package/packages/approval-process/packages/flow/systemCom/BO/role.svg +1 -0
  60. package/packages/approval-process/packages/flow/systemCom/BO/roleBo.ts +16 -0
  61. package/packages/approval-process/packages/flow/systemCom/choose-depart.vue +399 -0
  62. package/packages/approval-process/packages/flow/systemCom/choose-member-phone.vue +515 -0
  63. package/packages/approval-process/packages/flow/systemCom/choose-member.vue +565 -0
  64. package/packages/approval-process/packages/flow/systemCom/choose-role.vue +301 -0
  65. package/packages/approval-process/packages/styles/common.scss +134 -0
  66. package/packages/approval-process/packages/styles/flex-common.scss +118 -0
  67. package/packages/approval-process/packages/styles/flexCommon.scss +73 -0
  68. package/packages/approval-process/packages/styles/main.css +216 -0
  69. package/packages/approval-process/packages/styles/router-page.scss +371 -0
  70. package/packages/approval-process/packages/styles/style-set.ts +207 -0
  71. package/packages/approval-process/packages/types.d.ts +4 -0
  72. package/packages/approval-process/packages/utils/base.ts +15 -0
  73. package/packages/approval-process/packages/utils/crypto.ts +67 -0
  74. package/packages/approval-process/packages/utils/ddUtils.ts +56 -0
  75. package/packages/approval-process/packages/utils/debounce.ts +36 -0
  76. package/packages/approval-process/packages/utils/des.js +1107 -0
  77. package/packages/approval-process/packages/utils/download.ts +38 -0
  78. package/packages/approval-process/packages/utils/editor.ts +37 -0
  79. package/packages/approval-process/packages/utils/getEnv.ts +36 -0
  80. package/packages/approval-process/packages/utils/os.ts +20 -0
  81. package/packages/approval-process/packages/utils/path-util.ts +31 -0
  82. package/packages/approval-process/packages/utils/routerUtil.ts +304 -0
  83. package/packages/approval-process/packages/utils/string-utils.ts +13 -0
  84. package/packages/approval-process/packages/utils/throttle.ts +44 -0
  85. package/packages/approval-process/packages/utils/validate.ts +92 -0
  86. package/packages/approval-process/packages/utils/ws.ts +218 -0
  87. package/packages/approval-process/tsconfig.json +72 -0
  88. package/packages/approval-process/vite.config.ts +56 -0
  89. package/src/api/bms/flow/FlowCommentController.ts +50 -0
  90. package/src/api/bms/flow/FlowInstanceController.ts +167 -0
  91. package/src/api/bms/flow/FlowProcessController.ts +55 -0
  92. package/src/api/bms/flow/FlowSheetController.ts +27 -0
  93. package/src/api/bms/flow/FlowSignController.ts +76 -0
  94. package/src/api/bms/flow/bo/AssociatedApprovalBO.ts +15 -0
  95. package/src/api/bms/flow/bo/AssociatedApprovalVO.ts +35 -0
  96. package/src/api/bms/flow/bo/AuditBaseInfo.ts +39 -0
  97. package/src/api/bms/flow/bo/ButtonVo.ts +7 -0
  98. package/src/api/bms/flow/bo/DingCallbackBo.ts +13 -0
  99. package/src/api/bms/flow/bo/FlowCommentBO.ts +12 -0
  100. package/src/api/bms/flow/bo/FlowCommentVO.ts +23 -0
  101. package/src/api/bms/flow/bo/FlowInstanceBO.ts +14 -0
  102. package/src/api/bms/flow/bo/FlowNodeVO.ts +24 -0
  103. package/src/api/bms/flow/bo/FlowNoticeBO.ts +17 -0
  104. package/src/api/bms/flow/bo/FlowProcessBO.ts +13 -0
  105. package/src/api/bms/flow/bo/FlowProcessVO.ts +9 -0
  106. package/src/api/bms/flow/bo/FlowReplyVO.ts +23 -0
  107. package/src/api/bms/flow/bo/FlowSheetVO.ts +16 -0
  108. package/src/api/bms/flow/bo/InstanceBackBO.ts +9 -0
  109. package/src/api/bms/flow/bo/InstanceNodeBO.ts +13 -0
  110. package/src/api/bms/flow/bo/InstanceNodeVO.ts +21 -0
  111. package/src/api/bms/flow/bo/NodeShowVo.ts +19 -0
  112. package/src/api/bms/flow/bo/ReviewBO.ts +11 -0
  113. package/src/api/bms/flow/bo/SheetSearchBO.ts +11 -0
  114. package/src/api/bms/flow/bo/SystemVO.ts +7 -0
  115. package/src/api/bms/flow/bo/TransmitBO.ts +9 -0
  116. package/src/api/bms/flow/bo/UrgeFlowBO.ts +7 -0
  117. package/src/api/bms/flow/bo/UserBaseInfoVo.ts +13 -0
  118. package/src/api/bms/flow/bo/UserInfoVo.ts +44 -0
  119. package/src/api/bms/flow/bo/UserResultVo.ts +17 -0
  120. package/src/api/bms/flow/bo/ValueMapBo.ts +7 -0
  121. package/src/api/bms/home/HomeController.ts +106 -0
  122. package/src/api/bms/home/bo/CollectedMenuBo.ts +9 -0
  123. package/src/api/bms/home/bo/DeptBaseVo.ts +9 -0
  124. package/src/api/bms/home/bo/DomainVO.ts +13 -0
  125. package/src/api/bms/home/bo/FunPermission.ts +17 -0
  126. package/src/api/bms/home/bo/GroupVO.ts +10 -0
  127. package/src/api/bms/home/bo/HomeMenu.ts +22 -0
  128. package/src/api/bms/home/bo/HomeMenuVo.ts +11 -0
  129. package/src/api/bms/home/bo/PersonalizationBo.ts +17 -0
  130. package/src/api/bms/home/bo/PersonalizationVo.ts +19 -0
  131. package/src/api/bms/home/bo/PhoneMenu.ts +14 -0
  132. package/src/api/bms/home/bo/SearchMenuVo.ts +10 -0
  133. package/src/api/bms/home/bo/UserBaseInfoVo.ts +11 -0
  134. package/src/api/hrms/dept/bo/DeptBaseVo.ts +6 -0
  135. package/src/api/hrms/dept/bo/DeptTreeVo.ts +23 -0
  136. package/src/api/hrms/dept/bo/DeptUserVo.ts +9 -0
  137. package/src/api/hrms/dept/bo/DeptUsersVo.ts +10 -0
  138. package/src/api/hrms/dept/bo/DeptVo.ts +19 -0
  139. package/src/api/hrms/dept/bo/UserBaseInfoVo.ts +8 -0
  140. package/src/api/hrms/dept/deptController.ts +100 -0
  141. package/src/api/hrms/role/bo/RoleBaseVo.ts +6 -0
  142. package/src/api/hrms/role/bo/RoleGroupVo.ts +11 -0
  143. package/src/api/hrms/role/bo/RoleVo.ts +22 -0
  144. package/src/api/hrms/role/roleController.ts +19 -0
  145. package/src/api/hrms/user/bo/UserBaseInfoVo.ts +11 -0
  146. package/src/api/hrms/user/bo/UserCardVO.ts +14 -0
  147. package/src/api/hrms/user/bo/UserDeptBO.ts +13 -0
  148. package/src/api/hrms/user/bo/UserRoleBO.ts +11 -0
  149. package/src/api/hrms/user/bo/UserVO.ts +23 -0
  150. package/src/api/hrms/user/userController.ts +86 -0
  151. package/src/api/work-order-pc/flow/Bo/ValueMapBo.ts +7 -0
  152. package/src/api/work-order-pc/flow/ItrFlowProcessController.ts +42 -0
  153. package/src/api/work-order-pc/flow/Vo/FlowNodeVO.ts +24 -0
  154. package/src/api/work-order-pc/flow/Vo/UserInfoVo.ts +44 -0
  155. package/src/assets/process/agree.png +0 -0
  156. package/src/assets/process/defaultAvatar.png +0 -0
  157. package/src/assets/process/drawer/departManagerJump.png +0 -0
  158. package/src/assets/process/drawer/manyLevel1close.svg +10 -0
  159. package/src/assets/process/drawer/manyLevel1open.svg +7 -0
  160. package/src/assets/process/drawer/manyLevel2close.svg +7 -0
  161. package/src/assets/process/drawer/manyLevel2open.svg +7 -0
  162. package/src/assets/process/inProcess.png +0 -0
  163. package/src/assets/process/manyPeople.png +0 -0
  164. package/src/assets/process/manyPeople2.png +0 -0
  165. package/src/assets/process/reject.png +0 -0
  166. package/src/assets/process/revoke.png +0 -0
  167. package/src/components/annex-img-upload/index.vue +4 -4
  168. package/src/components/annex-img-upload/modules/previewMp.vue +1 -1
  169. package/src/components/annex-upload/index.vue +4 -4
  170. package/src/components/annex-upload/modules/previewMp.vue +1 -1
  171. package/src/components/annex-upload-weijian/index.vue +4 -4
  172. package/src/components/annex-upload-weijian/modules/previewMp.vue +1 -1
  173. package/src/components/list-search-content/components/search-date-range.vue +1 -1
  174. package/src/components/list-search-content/components/search-date-time-range.vue +1 -1
  175. package/src/components/list-search-content/components/search-date.vue +1 -1
  176. package/src/components/list-search-content/components/search-input-number.vue +1 -1
  177. package/src/components/list-search-content/components/search-input.vue +1 -1
  178. package/src/components/list-search-content/components/search-multiple_select.vue +1 -1
  179. package/src/components/list-search-content/components/search-select.vue +1 -1
  180. package/src/components/list-search-content/index.vue +6 -6
  181. package/src/components/list-search-content/modules/add-views-package-dialog.vue +3 -3
  182. package/src/components/list-search-content/modules/search-condition-area.vue +2 -2
  183. package/src/components/list-search-content/modules/views-package-manage-dialog.vue +5 -5
  184. package/src/index.ts +1 -0
  185. package/src/utils/dd-utils.ts +1 -1
  186. package/src/utils/get-dict.ts +2 -2
  187. package/src/utils/permit-utils.ts +2 -2
  188. package/src/api/bms/dict/bo/TotalDictSearchBO.ts +0 -8
  189. package/src/api/bms/file/FileExportController.ts +0 -18
  190. package/src/api/bms/file/bo/FileExportVO.ts +0 -17
@@ -0,0 +1,978 @@
1
+ <!-- 审批页面 适配移动端并且要有插槽,同时对插槽的数据可以进行读取 -->
2
+ <template>
3
+ <div class="examine-big-box">
4
+ <div class="page-box" v-if="!haveSubmit">
5
+ <!-- 顶部标题状态id部门等信息 -->
6
+ <div class="page-inner-box"
7
+ :style="(((buttonList && Array.isArray(buttonList) && buttonList.length > 0) || formBaseInfo.ifUrging) ? { height: 'calc(100% - 80px)' } : { height: '100%' })">
8
+ <div class="inner-page-top-box" v-if="props.taskId && props.taskId !== 'importData'">
9
+ <div class="inner-page-top-dept-top flex-row-start-center">
10
+ <el-icon style="font-size: 16px;cursor: pointer;" @click="backList">
11
+ <ArrowLeft />
12
+ </el-icon>
13
+ <div class="submit-back" @click="backList">返回</div>
14
+ <div class="inner-page-divide"></div>
15
+ <div class="inner-page-top-dept-title">{{ props.formTitle ? props.formTitle : '审批单' }}
16
+ </div>
17
+ </div>
18
+ <div class="inner-page-top-header-box flex-column-start">
19
+ <!-- 头像以及标题部分 -->
20
+ <div class="top-header-name-left flex-row-start-center">
21
+ <img :src="formBaseInfo.formUserAvatar" alt="头像" v-if="formBaseInfo.formUserAvatar">
22
+ <img src="hrp-ui-base/assets/process/defaultAvatar.png" alt="" v-else>
23
+ <div class="top-header-name-left-name">{{ formBaseInfo.formUser }}提交的{{ props.formTitle ? props.formTitle
24
+ : '' }}</div>
25
+ </div>
26
+ <div class="header-status-box flex-row-start">
27
+
28
+ <div class="flex-column-start header-statu-item">
29
+ <div class="header-item-name">当前状态</div>
30
+ <div class="header-item-button-value" :style="formBaseInfo.nodeStatus == '审批中' || formBaseInfo.nodeStatus == '已被拒'
31
+ ?
32
+ {
33
+ 'background-color': 'rgba(255, 146, 0, .12)',
34
+ 'color': '#ff9200'
35
+ } : {
36
+ 'background-color': 'rgba(0,176,66,.12)',
37
+ 'color': '#00b042'
38
+ }">{{ formBaseInfo.nodeStatus }}</div>
39
+ </div>
40
+
41
+ <div class="flex-column-start header-statu-item">
42
+ <div class="header-item-name">发起人</div>
43
+ <el-tooltip effect="dark" :content="formBaseInfo.formUser" placement="left">
44
+ <div class="header-item-value "> {{ formBaseInfo.formUser + (formBaseInfo.agentUserName ? '(由' +
45
+ formBaseInfo.agentUserName + '代提交)' : '') }}</div>
46
+ </el-tooltip>
47
+ </div>
48
+
49
+ <div class="flex-column-start header-statu-item">
50
+ <div class="header-item-name">表单id</div>
51
+
52
+ <el-tooltip effect="dark" :content="props.formId" placement="left">
53
+ <div class="header-item-value ">{{ props.formId }}</div>
54
+ </el-tooltip>
55
+
56
+ </div>
57
+ <!-- 单据打印 -->
58
+ <div style="position: absolute;right: 0;top: 0;"
59
+ v-if="props.showPrint && formBaseInfo.nodeStatus === '已通过'">
60
+ <el-button type="primary" @click="openOrderPrint" icon="Printer">单据打印</el-button>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ <div class="inner-page-box">
66
+ <!-- 中部表单盒子 -->
67
+ <div class="inner-page-item">
68
+ <div class="formBox">
69
+ <slot></slot>
70
+ </div>
71
+ </div>
72
+ <!-- 审批流盒子 -->
73
+ <div class="process-box" v-if="props.taskId && props.taskId !== 'importData'">
74
+ <div class="inner-page-item-header" @click="ceshiactive">审批进度</div>
75
+ <div class="processBox">
76
+ <el-timeline>
77
+ <el-timeline-item v-for="(item, index) in activities" :key="index"
78
+ :type="item.nodeStatus ? 'primary' : 'info'" size="large">
79
+ <div class="timeLineTtem flexRowStart" style="flex-wrap: nowrap;">
80
+ <div style="min-width:40px;width:40px;min-height:40px;height:40px;margin-right: 12px;">
81
+ <img :src="item.userList[0].avatar" alt="头像"
82
+ v-if="item.userList && Array.isArray(item.userList) && item.userList.length == 1 && item.userList[0].avatar">
83
+ <img src="hrp-ui-base/assets/process/defaultAvatar.png" alt="头像"
84
+ v-else-if="item.userList && Array.isArray(item.userList) && item.userList.length == 1 && !item.userList[0].avatar">
85
+ <div class="flexRowAroundWrap imgbox" v-else>
86
+ <img src="hrp-ui-base/assets/process/manyPeople2.png" alt="头像"
87
+ style="margin-right: 0;width: 35px;height: 25px;" />
88
+ </div>
89
+ </div>
90
+
91
+ <div class="flexColumnStart porcessTime">
92
+ <div class="flexRowStart" style="align-items: center;">
93
+ <div class="porcessTimeNodeNameBig">{{ item.nodeName }}</div>
94
+ <!-- 节点状态 节点长度为1时 -->
95
+ <div class="porcessTimeNodeName"
96
+ v-if="item.userList && Array.isArray(item.userList) && item.userList.length == 1"
97
+ :style="item.userList[0].result == '同意' ? { color: '#66bc5c', 'font-weight': 600 } : { color: '#9b9b9b' }">
98
+ {{ item.userList[0].result ? item.userList[0].result : '待处理' }}
99
+ </div>
100
+ <!-- 节点状态 节点长度>1时 -->
101
+ <div class="porcessTimeNodeName"
102
+ v-if="item.userList && Array.isArray(item.userList) && item.userList.length > 1"
103
+ :style="item.nodeStatus == '已完成' ? { color: '#66bc5c', 'font-weight': 600 } : { color: '#9b9b9b' }">
104
+ {{ item.nodeStatus ? item.nodeStatus : '待处理' }}
105
+ </div>
106
+ <!-- 选择执行人按钮 只在第一个审批人节点且满足条件时显示 -->
107
+ <el-button
108
+ v-if="props.showExecutorSelector && item.nodeType === 'Approver' && activities.findIndex(a => a.nodeType === 'Approver') === index"
109
+ type="primary"
110
+ size="small"
111
+ plain
112
+ @click="handleSelectExecutor"
113
+ style="margin-left: 12px;">
114
+ 选择执行人
115
+ </el-button>
116
+ </div>
117
+ <div class="flexRowStart " style="width:100%">
118
+ <!-- 审批人的名字 或 N位审批人 -->
119
+ <div class="porcessTimeName flexRowStart" style="width: max-content;">
120
+ {{
121
+ item.userList && Array.isArray(item.userList) &&
122
+ item.userList.length > 1 ? item.userList.length + '位' + (item.nodeType ==
123
+ 'Approver' ? '审批人' : item.nodeType == 'Ccto' ? '抄送人' : item.nodeType ==
124
+ 'Executor' ? '执行人' : '') : item.userList && Array.isArray(item.userList) &&
125
+ item.userList.length > 0 ?
126
+ item.userList[0].userName :
127
+ ''
128
+ }}
129
+ </div>
130
+ <div class="porcessTimeNodeStatus" :style="{ color: '#ff9200' }"
131
+ v-if="item.userList && item.userList.length > 1 && item.multipleAuditType && (item.nodeType == 'Approver' || item.nodeType == 'Executor')">
132
+ {{
133
+ '(' + item.multipleAuditType + ')' }}</div>
134
+ </div>
135
+ <!-- 当节点长度>1 时的 审批处理时间 -->
136
+ <div class="porcessTimeTime" v-if="!(item.userList && item.userList.length > 1) && item.nodeTime">
137
+ {{ item.nodeTime }}</div>
138
+
139
+
140
+ <!-- 节点状态 节点长度为0时 无审批处理人 -->
141
+ <div class="porcessTimeNodeName"
142
+ v-if="(!item.userList) || (item.userList && Array.isArray(item.userList) && item.userList.length == 0)">
143
+ {{ "当前节点暂无处理人" }}
144
+ </div>
145
+
146
+ <div class="porcessTimeNodeName"
147
+ v-if="item.userList && Array.isArray(item.userList) && item.userList.length == 1 && item.userList[0].comments">
148
+ {{
149
+ item.userList[0].comments ? '审批意见:' + item.userList[0].comments : '审批意见:-' }}</div>
150
+ <div class="porcessTimeNodeName"
151
+ v-if="item.userList && Array.isArray(item.userList) && item.userList.length == 1 && item.userList[0].operation"
152
+ style="color:red">
153
+ {{
154
+ item.userList[0].operation ? item.userList[0].operation : '-' }}</div>
155
+ <ShowSign :src="item.userList[0].signatureUrl" :preview-src-list="[item.userList[0].signatureUrl]"
156
+ fit="cover"
157
+ v-if="item.userList && Array.isArray(item.userList) && item.userList.length == 1 && item.userList[0].signatureUrl">
158
+ </ShowSign>
159
+
160
+ <!-- 子节点 -->
161
+ <div class="sonItemBox flexColumnStart"
162
+ v-if="item.userList && Array.isArray(item.userList) && item.userList.length > 1">
163
+ <div class="sonItem flexRowStart" v-for="(sonItem, sonIndex) in item.userList" :key="sonIndex"
164
+ style="flex-wrap: nowarp;width: 100%;">
165
+ <div>
166
+ <img :src="sonItem.avatar" alt="头像" v-if="sonItem.avatar">
167
+ <img src="hrp-ui-base/assets/process/defaultAvatar.png" alt="头像" v-else>
168
+ </div>
169
+ <div class="flexColumnStart porcessTime">
170
+ <div class="flexRowStartCenter">
171
+ <div class="porcessTimeName flexRowStart" style="width:max-content;margin-right: 8px;">{{
172
+ sonItem.userName }}</div>
173
+ <div class="porcessTimeNodeName"
174
+ :style="sonItem.result == '同意' ? { color: '#66bc5c' } : sonItem.result == '拒绝' ? { color: '#f89898' } : { color: '#9b9b9b' }">
175
+ {{ sonItem.result ? sonItem.result : '待处理' }}</div>
176
+ </div>
177
+ <div class="porcessTimeTime" v-if="sonItem.submitTime">{{
178
+ sonItem.submitTime }}
179
+ </div>
180
+
181
+ <div class="porcessTimeNodeName" v-if="sonItem.comments">
182
+ {{ '审批意见:' + sonItem.comments }}</div>
183
+ <div class="porcessTimeNodeName" v-if="sonItem.operation" style="color:red">
184
+ {{ sonItem.operation }}</div>
185
+ <ShowSign :src="sonItem.signatureUrl" :preview-src-list="[sonItem.signatureUrl]"
186
+ fit="contain" v-if="sonItem && sonItem.signatureUrl" style="margin-left: 0;">
187
+ </ShowSign>
188
+ </div>
189
+
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </div>
194
+ </el-timeline-item>
195
+ </el-timeline>
196
+
197
+ </div>
198
+ </div>
199
+ <!-- 评论功能 -->
200
+ <CommentAreaComponent ref="CommentAreaComponentRef" :formId="props.formId" v-show="formBaseInfo.ifComment">
201
+ </CommentAreaComponent>
202
+ <!-- <div style="height:80px" v-if="((formBaseInfo.auditorStatus ||formBaseInfo.ifUrging ) && props.taskId && props.taskId !== 'importData' && !haveSubmit)"></div> -->
203
+ </div>
204
+ </div>
205
+
206
+ <div class="submit-button-box"
207
+ v-if="((formBaseInfo.auditorStatus || formBaseInfo.ifUrging) && props.taskId && props.taskId !== 'importData' && !haveSubmit)">
208
+ <div class="audit-button-agree-refuse-box" style="width:150px">
209
+ <!-- 审批人 -->
210
+ <el-button type="primary" size="default" @click="openDialog('1')"
211
+ v-if="((formBaseInfo.nodeType == 'Approver' || formBaseInfo.nodeType == 'Executor' || formBaseInfo.nodeType == 'Create') && buttonList.some(item => item.buttonType == '同意' || item.buttonType == 'agree'))">{{
212
+ buttonList.find((item: any) => item.buttonType === '同意' || item.buttonType === 'agree')?.buttonShowName
213
+ }}</el-button>
214
+ <el-button size="default" @click="openDialog('2')"
215
+ v-if="formBaseInfo.nodeType == 'Approver' && buttonList.some(item => item.buttonType === '拒绝')">{{
216
+ buttonList.find((item: any) => { return item.buttonType === '拒绝' })?.buttonShowName
217
+ }}</el-button>
218
+ </div>
219
+ <div class="audit-button-left-box">
220
+ <!-- 催办 -->
221
+ <div class="column-button-item" v-if="formBaseInfo.ifUrging" @click="openUrgeDialog">
222
+ <el-icon size="30">
223
+ <Bell />
224
+ </el-icon>
225
+ <span>催办</span>
226
+ </div>
227
+ <!-- 撤销 -->
228
+ <div class="column-button-item" @click="buttonRevoke"
229
+ v-if="buttonList.some(item => item.buttonType === 'revoke')">
230
+ <el-icon size="30">
231
+ <RefreshLeft />
232
+ </el-icon>
233
+ <span>{{buttonList.find((item: any) => {
234
+ return item.buttonType === 'revoke'
235
+ })?.buttonShowName }}</span>
236
+ </div>
237
+ <!-- 转交 -->
238
+ <div class="column-button-item" @click="openDialog('3')"
239
+ v-if="((formBaseInfo.nodeType == 'Approver' || formBaseInfo.nodeType == 'Executor') && buttonList.some(item => item.buttonType === '转交'))">
240
+ <el-icon size="30">
241
+ <Avatar />
242
+ </el-icon>
243
+ <span>{{buttonList.find((item: any) => {
244
+ return item.buttonType === '转交'
245
+ })?.buttonShowName
246
+ }}</span>
247
+ </div>
248
+ <!-- 退回 -->
249
+ <div class="column-button-item" @click="openDialog('4')"
250
+ v-if="((formBaseInfo.nodeType == 'Approver' || formBaseInfo.nodeType == 'Executor') && buttonList.some(item => item.buttonType === '退回'))">
251
+ <el-icon size="30">
252
+ <Back />
253
+ </el-icon>
254
+ <span>{{buttonList.find((item: any) => {
255
+ return item.buttonType === '退回'
256
+ })?.buttonShowName
257
+ }}</span>
258
+ </div>
259
+
260
+
261
+
262
+
263
+ </div>
264
+ </div>
265
+
266
+ </div>
267
+
268
+ <ApproveSuccess v-if="haveSubmit" @next="nextAudit" @backList="backList"></ApproveSuccess>
269
+ <!-- centerDialogVisible -->
270
+ <el-dialog v-model="centerDialogVisible" :width="isPc ? '40%' : '800'" center
271
+ :style="isPc ? { width: '800px' } : { width: '200px' }" :title="'审批'"
272
+ v-if="isPc && currentPageWidth && currentPageWidth >= 800">
273
+ <div class="flexColumnStart processPcAuditCurrentPageBox">
274
+ <div v-if="dialogType == '3'">{{ '转交对象' }}</div>
275
+ <ChooseMember v-model="transmittedObj" :multiple="false" v-if="dialogType == '3'"></ChooseMember>
276
+ <div v-if="dialogType == '4'">{{ '退回节点' }}</div>
277
+ <div v-if="dialogType == '4'">
278
+ <div class="my-2 flex items-center text-sm">
279
+ <el-radio-group v-model="backTaskId" class=" ml-4 flexColumnStart">
280
+ <el-radio :value="item.nodeId" size="default" v-for="(item, index) in finishTaskList" :key="item.nodeId"
281
+ :label="item.nodeId" style="margin-top:8px">
282
+ <div class="flexRowStartCenter">
283
+ <div>{{ item.nodeName ? item.nodeName : "-" }}</div>
284
+ <div v-if="item.userList && Array.isArray(item.userList) && item.userList.length == 1"
285
+ style="width:30px;height: 30px;margin: 0 18px;"><img :src="item.userList[0].avatar"
286
+ style="width:30px;height: 30px;border-radius: 8px;" alt=""></div>
287
+
288
+ <div v-if="item.userList && Array.isArray(item.userList) && item.userList.length > 1"
289
+ style="width:30px;height: 30px;margin:0 18px;"><img src="hrp-ui-base/assets/process/manyPeople2.png"
290
+ style="width: 35px;height: 25px;border-radius: 8px;" alt=""></div>
291
+ <div>{{ getNames(item.userList) }}</div>
292
+ <div v-if="item.userList && Array.isArray(item.userList) && item.userList.length > 1"
293
+ style="margin-left:18px">{{ '多人审批方式:' + item.multipleAuditType }}</div>
294
+ </div>
295
+ </el-radio>
296
+ </el-radio-group>
297
+ </div>
298
+ </div>
299
+ <div>{{ dialogType == '3' ? '转交理由' : dialogType == '4' ? '退回意见' : '审批意见' }}</div>
300
+ <el-input v-model="textarea" type="textarea" placeholder="请输入..." style="width:100%" autosize maxlength="200"
301
+ show-word-limit />
302
+ <div v-if="props.formBaseInfo && props.formBaseInfo.ifSignature">签名:</div>
303
+ <SignConmpent v-model="uploadImg" v-if="props.formBaseInfo && props.formBaseInfo.ifSignature"
304
+ @uploadUploadImgId="uploadUploadImgId" :uploadImgId="uploadImgId">
305
+ </SignConmpent>
306
+ </div>
307
+ <template #footer>
308
+ <span class="dialog-footer">
309
+ <el-button @click="centerDialogVisible = false">取消</el-button>
310
+ <el-button type="primary" @click="submitResult">
311
+ 确认
312
+ </el-button>
313
+ </span>
314
+ </template>
315
+ </el-dialog>
316
+ <van-popup v-model:show="centerDialogVisible" position="bottom"
317
+ :style="{ height: '80%', padding: '20px', width: '100%' }"
318
+ v-if="!isPc || !currentPageWidth || currentPageWidth < 800">
319
+ <div class="popupBody">
320
+
321
+ <div class="flexColumnStart popupContent">
322
+ <div v-if="dialogType == '3'">{{ '转交对象' }}</div>
323
+ <ChooseMemberPhone v-model="transmittedObj" :multiple="false" v-if="dialogType == '3'" :posBottom="0">
324
+ </ChooseMemberPhone>
325
+ <div v-if="dialogType == '4'">{{ '退回节点' }}</div>
326
+ <div v-if="dialogType == '4'">
327
+ <div class="my-2 flex items-center text-sm">
328
+ <el-radio-group v-model="backTaskId" class=" ml-4 flexColumnStart">
329
+ <el-radio :value="item.nodeId" size="default" v-for="(item, index) in finishTaskList" :key="item.nodeId"
330
+ :label="item.nodeId" style="margin-top:8px">
331
+ <div class="flexRowStartCenter">
332
+ <div>{{ item.nodeType ? item.nodeType == 'Approver' ? '审批人节点' : item.nodeType ==
333
+ 'Executor'
334
+ ?
335
+ '执行人节点' : item.nodeType == 'Ccto' ? '抄送人节点' : item.nodeType == 'Create' ? '再次提交' :
336
+ item.nodeType : '' }}</div>
337
+ <div v-if="item.userList && Array.isArray(item.userList) && item.userList.length == 1"
338
+ style="width:30px;height: 30px;margin: 0 18px;"><img :src="item.userList[0].avatar"
339
+ style="width:30px;height: 30px;border-radius: 8px;" alt=""></div>
340
+
341
+ <div v-if="item.userList && Array.isArray(item.userList) && item.userList.length > 1"
342
+ style="width:30px;height: 30px;margin:0 18px;"><img src="hrp-ui-base/assets/process/manyPeople2.png"
343
+ style="width: 35px;height: 25px;border-radius: 8px;" alt=""></div>
344
+ <div>{{ getNames(item.userList) }}</div>
345
+ <div v-if="item.userList && Array.isArray(item.userList) && item.userList.length > 1"
346
+ style="margin-left:18px">{{ '多人审批方式:' + item.multipleAuditType }}</div>
347
+ </div>
348
+ </el-radio>
349
+ </el-radio-group>
350
+ </div>
351
+ </div>
352
+ <div>{{ dialogType == '3' ? '转交理由' : dialogType == '4' ? '退回意见' : '审批意见' }}</div>
353
+ <el-input v-model="textarea" type="textarea" placeholder="请输入..." style="width:100%" autosize maxlength="200"
354
+ show-word-limit />
355
+ <div v-if="props.formBaseInfo && props.formBaseInfo.ifSignature">签名:</div>
356
+ <SignConmpent v-model="uploadImg" v-if="props.formBaseInfo && props.formBaseInfo.ifSignature"
357
+ @uploadUploadImgId="uploadUploadImgId" :uploadImgId="uploadImgId">
358
+ </SignConmpent>
359
+ <div class="blankBox"></div>
360
+ </div>
361
+ <div class="popupbuttonBox flexRowCenter">
362
+ <el-button @click="centerDialogVisible = false" size="large" style="width:48%">取消</el-button>
363
+ <el-button type="primary" @click="submitResult" size="large" style="width:48%">
364
+ 确认
365
+ </el-button>
366
+ </div>
367
+ </div>
368
+ </van-popup>
369
+ <UrgeDialog ref="UrgeDialogRef" @success="urgeDialogSuccess" :title="formBaseInfo.formUser + '提交的' + (props.formTitle ? props.formTitle
370
+ : '')"></UrgeDialog>
371
+
372
+ <!-- 选择执行人弹窗 -->
373
+ <el-dialog
374
+ v-model="showExecutorDialog"
375
+ title="选择执行人"
376
+ width="600px"
377
+ append-to-body>
378
+ <ChooseMember v-model="selectedExecutor" :multiple="false"></ChooseMember>
379
+ <template #footer>
380
+ <span class="dialog-footer">
381
+ <el-button @click="cancelSelectExecutor">取消</el-button>
382
+ <el-button type="primary" @click="confirmSelectExecutor">确认</el-button>
383
+ </span>
384
+ </template>
385
+ </el-dialog>
386
+ </div>
387
+ </template>
388
+ <script lang="ts" setup>
389
+ import { onMounted, ref, watch, onActivated, PropType } from "vue";
390
+ import { MoreFilled } from '@element-plus/icons-vue'
391
+ import { ElLoading, ElMessage } from "element-plus";
392
+ import { IsPhone } from '../utils/getEnv'
393
+ import ApproveSuccess from "./approve-component/approve-success.vue"
394
+ import _ from "lodash"
395
+ // import RouteParamsError from "./approve-component/route-params-error.vue"
396
+ import SignConmpent from "../components/sign/index.vue"
397
+ import ShowSign from './form-component/show-sign.vue'
398
+ import ChooseMember from './systemCom/choose-member.vue'
399
+ import ChooseMemberPhone from './systemCom/choose-member-phone.vue'
400
+ import UrgeDialog from "../components/urge-dialog/index.vue"
401
+ // import { StorageEnum } from "../enum/system/StorageEnum";
402
+ import throttle from "../utils/throttle";
403
+ // import { getUploadFileMsg } from '../utils/base'
404
+ import CommentAreaComponent from "../components/comment/index.vue"
405
+ /** controller 以及 bo */
406
+ import FlowInstanceController from "hrp-ui-base/api/bms/flow/FlowInstanceController";
407
+ // bo
408
+ import NodeShowVo from "hrp-ui-base/api/bms/flow/bo/NodeShowVo";
409
+ import ReviewBO from "hrp-ui-base/api/bms/flow/bo/ReviewBO";
410
+ import TransmitBO from "hrp-ui-base/api/bms/flow/bo/TransmitBO";
411
+ import InstanceBackBO from "hrp-ui-base/api/bms/flow/bo/InstanceBackBO";
412
+ import AuditBaseInfo from "hrp-ui-base/api/bms/flow/bo/AuditBaseInfo";
413
+ import UserBaseInfoVo from "hrp-ui-base/api/bms/flow/bo/UserBaseInfoVo";
414
+
415
+ const props = defineProps({
416
+ // 流程节点信息
417
+ 'activities': {
418
+ type: Array as PropType<any>,
419
+ required: false,
420
+ default: () => { return {} }
421
+ },
422
+ // 节点任务id
423
+ 'taskId': {
424
+ type: String,
425
+ required: false,
426
+ default: ''
427
+ },
428
+ // 表单id
429
+ 'formId': {
430
+ type: String,
431
+ required: true,
432
+ default: ''
433
+ },
434
+ // 表单内展示的基础信息
435
+ 'formBaseInfo': {
436
+ type: Object as PropType<AuditBaseInfo>,
437
+ required: false,
438
+ default: () => { return {} }
439
+ },
440
+ // 表单提交的原始数据
441
+ 'oldRuleForm': {
442
+ type: Object as PropType<any>,
443
+ required: false,
444
+ default: () => { return {} }
445
+ },
446
+ // 表单提交的最新数据
447
+ 'ruleForm': {
448
+ type: Object as PropType<any>,
449
+ required: false,
450
+ default: () => { return {} }
451
+ },
452
+ // 当前页面是否经过了表单校验可以提交
453
+ 'canSubmit': {
454
+ type: Boolean,
455
+ required: true,
456
+ default: false
457
+ },
458
+ // 当前的表单的标题
459
+ 'formTitle': {
460
+ type: String,
461
+ required: false,
462
+ default: ''
463
+ },
464
+ // 当前是否可以编辑
465
+ 'canEdit': {
466
+ type: Boolean,
467
+ required: true,
468
+ default: false
469
+ },
470
+ // 提交的审批节点列表信息
471
+ 'submitProcess': {
472
+ type: Function as PropType<() => Promise<any>>,
473
+ required: true,
474
+ default: () => { }
475
+ },
476
+ // 返回跳转的列表地址
477
+ "listPath": {
478
+ type: String,
479
+ required: false,
480
+ default: ''
481
+ },
482
+ //是否展示单据打印按钮
483
+ "showPrint": {
484
+ type: Boolean,
485
+ required: false,
486
+ default: false
487
+ },
488
+ //是否显示选择执行人按钮
489
+ "showExecutorSelector": {
490
+ type: Boolean,
491
+ required: false,
492
+ default: false
493
+ }
494
+
495
+ })
496
+
497
+ // validateForm 校验表单的回调 backList 返回列表的方法 nextAudit 跳转下一条的回调
498
+ const emits = defineEmits(['validateForm', 'backList', 'nextAudit', 'openOrderPrint', 'selectExecutor'])
499
+ const nextAudit = (data: any) => {
500
+ emits('nextAudit', data)
501
+ }
502
+
503
+
504
+ const buttonList = ref<{ buttonShowName: string; buttonType: string }[]>([])
505
+ const haveSubmit = ref(false)
506
+ const formBaseInfo = ref<AuditBaseInfo>(new AuditBaseInfo())
507
+ let isPc = !IsPhone()
508
+ // const token111 = localStorage.getItem(StorageEnum.登录鉴权)
509
+ const currentPageWidth = ref<number>()
510
+ const activeName = ref('评论')
511
+ // 1 同意弹窗 2 拒绝弹窗 3 转交弹窗 4 退回弹窗 5加签弹窗
512
+ const dialogType = ref('1')
513
+ const centerDialogVisible = ref(false)
514
+ const textarea = ref('')
515
+ const uploadImg = ref<string>('')
516
+ const uploadImgId = ref<string>('')
517
+ const uploadUploadImgId = (str: string) => {
518
+ uploadImgId.value = str
519
+ }
520
+ // 获取的已完成任务的节点
521
+ const finishTaskList = ref<NodeShowVo[]>([])
522
+ // 退回节点选择
523
+ const backTaskId = ref<string>('')
524
+ // 选择转交人
525
+ const transmittedObj = ref<any>([])
526
+ // 用数组换名字
527
+ const getNames = (list: any[]) => {
528
+ if (list && Array.isArray(list) && list.length > 0) {
529
+ let str = ''
530
+ list.forEach((item, index) => {
531
+ if (index == (list.length - 1)) {
532
+ str += item.userName
533
+ } else {
534
+ str += item.userName + ','
535
+ }
536
+ })
537
+
538
+ if (list.length == 1) {
539
+ return str
540
+ } else {
541
+ return str
542
+ }
543
+ }
544
+ }
545
+ const openDialog = async (type: string) => {
546
+ // 1 同意弹窗 2 拒绝弹窗 3 转交弹窗 4 退回弹窗 5加签弹窗
547
+ emits('validateForm', type)
548
+ dialogType.value = type
549
+ textarea.value = type == '1' ? props.formBaseInfo.nodeType === 'Executor' ? '已执行' : '同意' : type == '2' ? '拒绝' : type == '3' ? '转交' : type == '4' ? '退回' : type == '5' ? '加签' : ''
550
+ // centerDialogVisible.value = true
551
+ if (type == '4') {
552
+ const loadingInstance = ElLoading.service({
553
+ lock: true,
554
+ text: '加载中...',
555
+ });
556
+ await FlowInstanceController.getFinishNodeList(props.formId).then(data => {
557
+ if (data.res && data.code == 200) {
558
+ finishTaskList.value = data.res
559
+ }
560
+ // else {
561
+ // ElMessage({
562
+ // message: '获取已完成节点列表失败',
563
+ // type: 'error'
564
+ // })
565
+ // }
566
+ }).finally(() => {
567
+ loadingInstance.close();
568
+ })
569
+ }
570
+ if (props.canSubmit) {
571
+ centerDialogVisible.value = true
572
+ }
573
+ }
574
+ // 审批弹窗确定按钮触发的功能
575
+ const handleSubmit = async (obj: any, successMessage: string, apiFunc: Function) => {
576
+ const loadingInstance = ElLoading.service({
577
+ lock: true,
578
+ text: '加载中...',
579
+ });
580
+
581
+ try {
582
+ const data = await apiFunc(obj);
583
+ if (data.code === 200) {
584
+ ElMessage({ message: successMessage, type: 'success' });
585
+ centerDialogVisible.value = false;
586
+ textarea.value = '';
587
+ haveSubmit.value = true;
588
+ }
589
+ } finally {
590
+ loadingInstance.close();
591
+ }
592
+ };
593
+
594
+ const checkFormChanges = () => {
595
+ for (let j in props.oldRuleForm) {
596
+ for (let i in props.ruleForm) {
597
+ if (i === j) {
598
+ if (typeof props.ruleForm[i] === 'string' || typeof props.ruleForm[i] === 'number' || props.ruleForm[i] === null || props.ruleForm[i] === undefined) {
599
+ if (props.ruleForm[i] !== props.oldRuleForm[j]) return true;
600
+ } else if (Array.isArray(props.ruleForm[i])) {
601
+ const arr1 = JSON.parse(JSON.stringify(props.ruleForm[i])).sort();
602
+ const arr2 = JSON.parse(JSON.stringify(props.oldRuleForm[i])).sort();
603
+ if (JSON.stringify(arr1) !== JSON.stringify(arr2)) return true;
604
+ } else if (_.isObject(props.ruleForm[i]) && _.isObject(props.oldRuleForm[i])) {
605
+ if (!_.isEqual(props.ruleForm[i], props.oldRuleForm[i])) return true;
606
+ } else {
607
+ console.log('比较ruleForm 跟 oldRuleForm 发现其他情况', props.ruleForm[i], props.oldRuleForm[j]);
608
+ return true;
609
+ }
610
+ }
611
+ }
612
+ }
613
+ return false;
614
+ };
615
+
616
+ const submitResult = new throttle().use(async () => {
617
+ // 表单验证
618
+ if (!textarea.value) {
619
+ ElMessage({ message: '请输入审批意见', type: 'error' });
620
+ return;
621
+ }
622
+ if (!uploadImg.value && props.formBaseInfo?.ifSignature && !uploadImgId.value) {
623
+ ElMessage({ message: '请进行签字或对签字进行确认保存', type: 'warning' });
624
+ return;
625
+ }
626
+ if (dialogType.value === '3' && (!transmittedObj.value || transmittedObj.value.length < 1)) {
627
+ ElMessage({ message: '请选择转交对象后在进行转交操作', type: 'warning' });
628
+ return;
629
+ }
630
+ if (dialogType.value === '4' && !backTaskId.value) {
631
+ ElMessage({ message: '请选择退回节点后在进行转交操作', type: 'warning' });
632
+ return;
633
+ }
634
+ const havaRuleFormChange = checkFormChanges();
635
+ console.log('props.ruleForm', havaRuleFormChange)
636
+
637
+ let saveSuccess = false;
638
+
639
+ if (havaRuleFormChange) {
640
+ if (dialogType.value === '1' || dialogType.value === '2') {
641
+ const result = await props.submitProcess();
642
+ if (result === 'success') saveSuccess = true;
643
+ } else {
644
+ saveSuccess = true;
645
+ }
646
+ }
647
+
648
+ if (!havaRuleFormChange || saveSuccess) {
649
+ switch (dialogType.value) {
650
+ case '1':
651
+ case '2':
652
+ await handleSubmit(
653
+ {
654
+ nodeId: props.taskId,
655
+ comment: textarea.value,
656
+ result: dialogType.value === '1' ? 'agree' : 'refuse',
657
+ signatureUrl: props.formBaseInfo?.ifSignature && uploadImgId.value !== undefined ? uploadImgId.value : ""
658
+ },
659
+ '审批成功',
660
+ FlowInstanceController.submitReview
661
+ );
662
+ break;
663
+
664
+ case '3':
665
+ await handleSubmit(
666
+ {
667
+ nodeId: props.taskId,
668
+ comment: textarea.value,
669
+ takeOverUserId: transmittedObj.value[0].userId
670
+ },
671
+ '转交成功',
672
+ FlowInstanceController.transmittedHandleNode
673
+ );
674
+ break;
675
+
676
+ case '4':
677
+ await handleSubmit(
678
+ {
679
+ nodeId: props.taskId,
680
+ comment: textarea.value,
681
+ backNodeId: backTaskId.value
682
+ },
683
+ '退回成功',
684
+ FlowInstanceController.instanceBack
685
+ );
686
+ break;
687
+ }
688
+ }
689
+ }, 1000, true);
690
+ // 当发起人重新提交
691
+ const buttonSubmit = async () => {
692
+ let havaRuleFormChange = false
693
+ console.log('props.ruleForm', props.oldRuleForm)
694
+ console.log('props.ruleForm', props.ruleForm)
695
+ for (let j in props.oldRuleForm) {
696
+ for (let i in props.ruleForm) {
697
+ if (i == j) {
698
+ if (typeof props.ruleForm[i] == 'string' || typeof props.ruleForm[i] == 'number' || props.ruleForm[i] === null || props.ruleForm[i] === undefined) {
699
+ if (props.ruleForm[i] !== props.oldRuleForm[j]) {
700
+ havaRuleFormChange = true
701
+ }
702
+ } else if (Array.isArray(props.ruleForm[i])) {
703
+ let arr1 = JSON.parse(JSON.stringify(props.ruleForm[i]))
704
+ let arr2 = JSON.parse(JSON.stringify(props.oldRuleForm[i]))
705
+ let str1 = JSON.stringify(arr1.sort())
706
+ let str2 = JSON.stringify(arr2.sort())
707
+ if (str1 != str2) {
708
+ havaRuleFormChange = true
709
+ }
710
+ } else if (Object.prototype.toString.call(props.ruleForm[i]) === '[object Object]' && Object.prototype.toString.call(props.oldRuleForm[i]) === '[object Object]') {
711
+ for (let m in props.ruleForm[i]) {
712
+ let currenKeyHave = false
713
+ let havaFindObjectDiffInner = false
714
+ for (let n in props.oldRuleForm[i]) {
715
+ if (m == n) {
716
+ currenKeyHave = true
717
+ if (props.ruleForm[i][m] !== props.oldRuleForm[j][n]) {
718
+ havaFindObjectDiffInner = true
719
+ break;
720
+ }
721
+ }
722
+ }
723
+ if (!currenKeyHave || havaFindObjectDiffInner) {
724
+ havaRuleFormChange = true
725
+ break;
726
+ }
727
+ }
728
+ } else {
729
+ console.log('比较ruleForm 跟 oldRuleForm 发现其他情况', props.ruleForm[i], props.oldRuleForm[j])
730
+ havaRuleFormChange = true
731
+ }
732
+ }
733
+ if (havaRuleFormChange) break
734
+ }
735
+ if (havaRuleFormChange) break
736
+ }
737
+ let saveSuccess = false
738
+ if (havaRuleFormChange) {
739
+ await props.submitProcess().then((data: any) => {
740
+ console.error(data)
741
+ if (data == 'success') {
742
+ saveSuccess = true
743
+ }
744
+ })
745
+ }
746
+ if (!havaRuleFormChange || saveSuccess) {
747
+ const loadingInstance = ElLoading.service({
748
+ lock: true,
749
+ text: '加载中...',
750
+ });
751
+ let obj: ReviewBO = {
752
+ "nodeId": props.taskId,
753
+ "comment": '提交',
754
+ "result": 'agree',
755
+ "signatureUrl": ''
756
+ }
757
+
758
+ FlowInstanceController.submitReview(obj).then((data) => {
759
+ console.log(data)
760
+ if (data.code == 200) {
761
+ ElMessage({ message: '提交成功', type: 'success' })
762
+ centerDialogVisible.value = false
763
+ textarea.value = ''
764
+ haveSubmit.value = true
765
+ }
766
+ }).finally(() => {
767
+ loadingInstance.close()
768
+ })
769
+
770
+ }
771
+
772
+ }
773
+ watch(() => { return props.canSubmit }, (newVal) => {
774
+ if (newVal) {
775
+ centerDialogVisible.value = true
776
+ } else {
777
+ centerDialogVisible.value = false
778
+ }
779
+ }, { deep: true })
780
+ const handleTabClick = () => {
781
+ console.log(1)
782
+ }
783
+
784
+
785
+ const activities = ref<any[]>([])
786
+ const ceshiactive = () => {
787
+ console.log(activities.value)
788
+ }
789
+
790
+ // 若有处理中,则取第一个处理中的节点类型,若没有处理中,则取第一个待处理的节点
791
+ const currentNodeType = ref<string>('Ccto')
792
+ const getCurrentNodeType = () => {
793
+ let haveFindProcessing = false
794
+ let findNodeTypeProcessing = ''
795
+ let haveFindPending = false
796
+ let findNodeTypePending = ''
797
+
798
+ for (let i = 0; i < activities.value.length; i++) {
799
+ if (activities.value[i].nodeStatus == '处理中') {
800
+ haveFindProcessing = true
801
+ findNodeTypeProcessing = activities.value[i].nodeType
802
+ break
803
+ }
804
+ }
805
+ for (let i = 0; i < activities.value.length; i++) {
806
+ if (activities.value[i].nodeStatus == '待处理') {
807
+ haveFindPending = true
808
+ findNodeTypePending = activities.value[i].nodeType
809
+ break
810
+ }
811
+ }
812
+ if (haveFindProcessing && findNodeTypeProcessing) {
813
+ currentNodeType.value = findNodeTypeProcessing
814
+ } else if (haveFindPending && findNodeTypePending) {
815
+ currentNodeType.value = findNodeTypePending
816
+ } else {
817
+ console.error('467行,当前未寻找到待处理或者处理中数据')
818
+ currentNodeType.value = 'Ccto'
819
+ }
820
+ }
821
+ // button 处理事件
822
+
823
+ const buttonNotUse = () => {
824
+ ElMessage({ message: '功能正在开发中', type: 'error' })
825
+ }
826
+ // 撤销
827
+ const buttonRevoke = () => {
828
+ const loadingInstance = ElLoading.service({
829
+ lock: true,
830
+ text: '加载中...',
831
+ });
832
+ FlowInstanceController.revokeInstance(props.taskId).then(data => {
833
+ if (data.code == 200) {
834
+ ElMessage({
835
+ message: '撤销成功',
836
+ type: 'success'
837
+ })
838
+ haveSubmit.value = true
839
+ }
840
+ }).finally(() => {
841
+ loadingInstance.close()
842
+ })
843
+ }
844
+ watch(() => { return props.activities }, () => {
845
+ activities.value = props.activities
846
+ }, { deep: true, immediate: true })
847
+ watch(() => { return props.formBaseInfo }, () => {
848
+ formBaseInfo.value = props.formBaseInfo
849
+ buttonList.value = props.formBaseInfo.buttonList && Array.isArray(props.formBaseInfo.buttonList) ? props.formBaseInfo.buttonList : []
850
+ uploadImg.value = props.formBaseInfo.signatureHistoryUrl ? props.formBaseInfo.signatureHistoryUrl : ''
851
+ uploadImgId.value = props.formBaseInfo.fileId ? props.formBaseInfo.fileId : ''
852
+ if (props.formId) {
853
+
854
+ setCommentProps()
855
+ }
856
+ }, { deep: true, immediate: true })
857
+
858
+ onMounted(() => {
859
+ currentPageWidth.value = window.innerWidth
860
+ window.addEventListener("resize", () => {
861
+ console.log(window.innerWidth)
862
+ currentPageWidth.value = window.innerWidth
863
+ })
864
+
865
+ console.log(isPc, props.taskId, props.formId)
866
+ })
867
+
868
+ // 评论区域ref
869
+ const CommentAreaComponentRef = ref()
870
+ // 设置评论的必要参数
871
+ const setCommentProps = () => {
872
+ CommentAreaComponentRef.value?.setCommentProps({
873
+ formId: props.formId
874
+ })
875
+ }
876
+ /** 催办 */
877
+ const UrgeDialogRef = ref()
878
+ const openUrgeDialog = () => {
879
+ UrgeDialogRef.value?.open(props.formId, props.taskId)
880
+ }
881
+ const urgeDialogSuccess = () => {
882
+ console.log("催办成功的回调")
883
+ }
884
+ //进入页面后关闭弹框
885
+ onActivated(() => {
886
+ haveSubmit.value = false
887
+ })
888
+ // 返回列表
889
+ const backList = () => {
890
+ emits('backList')
891
+ }
892
+ //单据打印按钮
893
+ const openOrderPrint = () => {
894
+ emits('openOrderPrint')
895
+ }
896
+ //选择执行人按钮
897
+ const showExecutorDialog = ref(false)
898
+ const selectedExecutor = ref<any>([])
899
+
900
+ const handleSelectExecutor = () => {
901
+ showExecutorDialog.value = true
902
+ }
903
+
904
+ // 确认选择执行人
905
+ const confirmSelectExecutor = () => {
906
+ if (!selectedExecutor.value || selectedExecutor.value.length === 0) {
907
+ ElMessage.warning('请选择执行人');
908
+ return;
909
+ }
910
+
911
+ const executorInfo = {
912
+ userId: selectedExecutor.value[0].userId,
913
+ userName: selectedExecutor.value[0].userName
914
+ };
915
+
916
+ emits('selectExecutor', executorInfo);
917
+ showExecutorDialog.value = false;
918
+ selectedExecutor.value = [];
919
+ }
920
+
921
+ // 取消选择执行人
922
+ const cancelSelectExecutor = () => {
923
+ showExecutorDialog.value = false;
924
+ selectedExecutor.value = [];
925
+ }
926
+ </script>
927
+ <style lang="scss" scoped>
928
+ @use './styles/common.scss';
929
+ @use './styles/examine-approve-pc.scss';
930
+ @use './styles/examine-approve-phone.scss';
931
+
932
+ .popupBody {
933
+ position: relative;
934
+ height: 100%;
935
+ width: 100%;
936
+ overflow-y: hidden;
937
+ }
938
+
939
+ .popupContent {
940
+ overflow-y: auto;
941
+ height: 100%;
942
+ width: 100%;
943
+
944
+ .blankBox {
945
+ height: 60px;
946
+ width: 100%;
947
+ min-height: 60px;
948
+ max-height: 60px;
949
+ }
950
+ }
951
+
952
+ .popupbuttonBox {
953
+ padding-top: 8px;
954
+ margin-top: 18px;
955
+ position: absolute;
956
+ bottom: 0;
957
+ border-top: 1px solid #e4e7ed;
958
+ width: 100%;
959
+ height: 50px;
960
+ box-shadow: 0px 0px 12px #90939930;
961
+ background: #fff;
962
+ }
963
+
964
+ .processPcAuditCurrentPageBox {
965
+ .el-textarea__inner {
966
+ height: 37px;
967
+ min-height: 37px !important;
968
+ }
969
+ }
970
+ </style>
971
+ <style lang="scss">
972
+ .processPcAuditCurrentPageBox {
973
+ .el-textarea__inner {
974
+ height: 37px;
975
+ min-height: 37px !important;
976
+ }
977
+ }
978
+ </style>