flowStep.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <view class="flowStep u-m-t-20">
  3. <view class="tabsContent">
  4. <u-tabs :list="list" :current="current" @change="change"></u-tabs>
  5. <view class="u-p-l-20 u-p-r-20 time-line-box">
  6. <view class="u-p-l-20 u-p-r-20 u-p-t-20" v-if="current == 0">
  7. <TimeLine :progressList="progressList" :taskInfo="taskInfo"></TimeLine>
  8. <!-- <u-time-line>
  9. <u-time-line-item nodeTop="2" class="u-p-b-20" v-for="item,index in progressList" :key="index">
  10. <template v-slot:node>
  11. <view class="u-node"></view>
  12. </template>
  13. <template v-slot:content>
  14. <view class="u-font-24 content">
  15. <view class="u-order-title u-flex u-m-b-8">
  16. <view class="u-line-1 name">
  17. {{item.nodeName + getCounterSignContent(item.counterSign)}}
  18. </view>
  19. <view class="u-m-l-10">
  20. <u-tag :text="getNodeStatusContent(item.nodeStatus)" mode="light"
  21. size="mini" shape="circle"
  22. :type="getNodeStatusColor(item.nodeStatus)" />
  23. <text
  24. class="u-m-l-10">{{item.startTime?$u.timeFormat(item.startTime, 'mm-dd hh:MM'):''}}</text>
  25. </view>
  26. </view>
  27. <view class="u-flex avatar-box" v-if="item.nodeStatus == 1">
  28. <u-avatar :src="baseURL + taskInfo.headIcon" size="mini" mode="circle"
  29. class="avatar"></u-avatar>
  30. <text class="u-m-l-8">发起人:{{taskInfo.creatorUser}}</text>
  31. </view>
  32. <view class="u-flex approver-list" v-else>
  33. <view class="u-flex approver-list-l">
  34. <view class="u-flex-col approver-list-l-box"
  35. v-for="child,i in item.approver" :key="i">
  36. <u-avatar :src="baseURL + taskInfo.headIcon" size="mini" mode="circle"
  37. class="avatar"></u-avatar>
  38. <u-tag :text="useDefine.getFlowStateContent(child.handleType)"
  39. mode="light" v-if="useDefine.getFlowStateContent(child.handleType)"
  40. class="tag" size="mini"
  41. :border-color="useDefine.getHexColor(useDefine.getFlowStateColor(child.handleType))"
  42. :bg-color="useDefine.getHexColor(useDefine.getFlowStateColor(child.handleType))"
  43. color="#fff" />
  44. <text class="u-m-t-20 u-line-1 approver-user-name">
  45. {{child.userName}}
  46. </text>
  47. </view>
  48. </view>
  49. <view class="u-m-l-20 approver-list-r u-flex" @click="openApprover(item)">
  50. <view class="approver-list-r-box">{{item.approverCount}}</view>
  51. <text class="icon-ym icon-ym-right u-m-r-12"></text>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. </u-time-line-item>
  57. </u-time-line> -->
  58. </view>
  59. <view class="u-p-l-20 u-p-r-20" v-if="current == 1">
  60. 2
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <uni-popup ref="flowStepPopup" background-color="#fff" border-radius="8rpx 8rpx 0 0" :is-mask-click="false">
  66. <view class="flow-popup-content" style="height: 1200rpx;">
  67. <view class="u-flex head-title">
  68. <text class="text">{{popupTitle}}</text>
  69. <text class="text icon-ym icon-ym-fail" @click="popupClose"></text>
  70. </view>
  71. <view class="" v-for="item,index in recordList" :key="index" v-if="recordList.length">
  72. <view class="u-flex u-m-t-20" style="height: 100rpx;">
  73. <view class="u-flex" style="flex: 1;">
  74. <u-avatar :src="baseURL + taskInfo.headIcon" size="mini" mode="circle"
  75. class="avatar"></u-avatar>
  76. <view class="u-m-l-10">
  77. <p>{{item.userName}}</p>
  78. <p style="color: #606266;">
  79. {{item.handleTime?$u.timeFormat(item.handleTime, 'yyyy-mm-dd hh:MM:ss'):''}}
  80. </p>
  81. </view>
  82. </view>
  83. <u-tag :text="useDefine.getFlowStateContent(item.handleType)"
  84. :border-color="useDefine.getHexColor(useDefine.getFlowStateColor(item.handleType))"
  85. :bg-color="useDefine.getHexColor(useDefine.getFlowStateColor(item.handleType))" color="#fff"
  86. size="mini" shape="circle" />
  87. <view class="" v-if="item.handleUserName">
  88. <u-icon name="arrow-rightward" color="#1890ff" class="u-m-l-10 u-m-r-10"></u-icon>
  89. <text class="u-font-24" style="color: #303133;">{{item.handleUserName}}</text>
  90. </view>
  91. </view>
  92. <view class="" style="background-color: #F5F5F5;padding: 20rpx;border-radius: 8rpx;color: #303133;"
  93. v-if="item.signImg || item.fileList.length || item.handleOpinion">
  94. <text class="u-line-2" v-if="item.handleOpinion">{{item.handleOpinion}}</text>
  95. <fileList :fileList="item.fileList" v-if="item.fileList.length"></fileList>
  96. <view class="u-flex" style="height: 88rpx;" v-if="item.signImg">
  97. <view style="width: 60px;">签名:</view>
  98. <JnpfSign v-model="item.signImg" align="left" detailed />
  99. </view>
  100. </view>
  101. </view>
  102. <JnpfEmpty v-else />
  103. </view>
  104. </uni-popup>
  105. </template>
  106. <script>
  107. import fileList from './fileList.vue'
  108. import TimeLine from './TimeLine.vue'
  109. import {
  110. useDefineSetting
  111. } from '@/utils/useDefineSetting';
  112. import {
  113. recordList
  114. } from '@/api/workFlow/flowBefore'
  115. const imgTypeList = ['png', 'jpg', 'jpeg', 'bmp', 'gif']
  116. export default {
  117. components: {
  118. fileList,
  119. TimeLine
  120. },
  121. props: {
  122. progressList: {
  123. type: Array,
  124. default: () => []
  125. },
  126. taskInfo: {
  127. type: Object,
  128. default: () => {}
  129. }
  130. },
  131. data() {
  132. return {
  133. list: [{
  134. name: '流转'
  135. }, {
  136. name: '评论'
  137. }],
  138. current: 0,
  139. value: '',
  140. popupTitle: '',
  141. recordList: [],
  142. nodeId: '',
  143. useDefine: useDefineSetting()
  144. }
  145. },
  146. computed: {
  147. baseURL() {
  148. return this.define.baseURL
  149. }
  150. },
  151. methods: {
  152. openApprover(item) {
  153. this.popupTitle = item.nodeName + this.getCounterSignContent(item.counterSign, item.assigneeType)
  154. this.nodeId = item.nodeId
  155. this.$nextTick(() => {
  156. this.$refs.flowStepPopup.open('bottom')
  157. this.getRecordList()
  158. })
  159. },
  160. getRecordList() {
  161. let data = {
  162. taskId: this.taskInfo.id,
  163. nodeId: this.nodeId
  164. }
  165. recordList(data).then(res => {
  166. let list = res.data || []
  167. list.map(o => {
  168. o.fileList = JSON.parse(o.fileList)
  169. })
  170. this.recordList = list
  171. })
  172. },
  173. getCounterSignContent(counterSign, assigneeType) {
  174. if (assigneeType == 10) return '(逐级审批)';
  175. return counterSign == 0 ? '(或签)' : counterSign == 1 ? '(会签)' : '(依次审批)';
  176. },
  177. popupClose() {
  178. this.$refs.flowStepPopup.close()
  179. },
  180. getNodeStatusContent(status) {
  181. const list = ['', '已提交', '已通过', '已拒绝', '审批中'];
  182. return list[status] || '';
  183. },
  184. getNodeStatusColor(status) {
  185. return status == 1 || status == 2 ? 'success' : status == 3 ? 'error' : 'primary';
  186. },
  187. change(e) {
  188. this.current = e
  189. }
  190. }
  191. }
  192. </script>
  193. <style lang="scss">
  194. .flow-popup-content {
  195. padding: 20rpx;
  196. .head-title {
  197. justify-content: space-between;
  198. color: #333333;
  199. // border-bottom: 1rpx solid #f0f0f0;
  200. }
  201. }
  202. .flowStep {
  203. width: 100%;
  204. .tabsContent {
  205. .time-line-box {
  206. background-color: #fff;
  207. .u-node {
  208. background: #19be6b;
  209. width: 20rpx;
  210. height: 20rpx;
  211. border-radius: 50%;
  212. }
  213. .active {
  214. background: #02a7f0;
  215. }
  216. .content {
  217. .u-order-title {
  218. .name {
  219. flex: 1;
  220. }
  221. }
  222. .avatar-box {
  223. ::v-deep .u-avatar {
  224. width: 2rem !important;
  225. height: 2rem !important;
  226. }
  227. }
  228. .approver-list {
  229. border-radius: 8rpx;
  230. height: 140rpx;
  231. background-color: #F5F5F5;
  232. .approver-list-l {
  233. flex: 1;
  234. .approver-list-l-box {
  235. width: 120rpx;
  236. align-items: center;
  237. position: relative;
  238. .tag {
  239. position: absolute;
  240. top: 50rpx;
  241. }
  242. .approver-user-name {
  243. color: #303133;
  244. width: 120rpx;
  245. text-align: center;
  246. }
  247. }
  248. }
  249. .approver-list-r {
  250. height: 4.375rem;
  251. .approver-list-r-box {
  252. width: 24px;
  253. height: 24px;
  254. margin-right: 10px;
  255. display: flex;
  256. align-items: center;
  257. justify-content: center;
  258. border-radius: 12px;
  259. background-color: #fff;
  260. }
  261. }
  262. }
  263. }
  264. }
  265. .bottom-btn {
  266. background-color: #fff;
  267. width: 100%;
  268. height: 88rpx;
  269. padding: 0 20rpx;
  270. color: #7f7f7f;
  271. .btn {
  272. background-color: #f2f2f2;
  273. border-radius: 8rpx;
  274. height: 60rpx;
  275. padding-left: 10rpx;
  276. width: 100%;
  277. line-height: 60rpx;
  278. }
  279. }
  280. }
  281. }
  282. ::v-deep .u-time-axis-item {
  283. margin-bottom: 0 !important;
  284. }
  285. .timeLine {
  286. width: 100%;
  287. height: 100%;
  288. padding: 20rpx;
  289. .u-time-axis-item {
  290. .u-time-axis-node {
  291. top: 0 !important;
  292. }
  293. }
  294. .timeLine-right {
  295. padding-left: 0;
  296. padding-right: 40rpx !important;
  297. &::before {
  298. left: 670rpx !important;
  299. }
  300. .u-time-axis-item {
  301. .u-time-axis-node {
  302. left: 670rpx !important;
  303. }
  304. }
  305. }
  306. .timeLine-dot {
  307. width: 28rpx;
  308. height: 28rpx;
  309. border: 4rpx solid #FFFFFF;
  310. box-shadow: 0 6rpx 12rpx rgba(2, 7, 28, 0.16);
  311. border-radius: 50%;
  312. }
  313. .timeLine-content {
  314. padding: 0 10rpx;
  315. .timeLine-title {
  316. font-size: 30rpx;
  317. line-height: 36rpx;
  318. .name {
  319. margin-bottom: 6rpx;
  320. }
  321. }
  322. .timeLine-title2 {
  323. margin-top: 6rpx;
  324. background: rgba(255, 255, 255, 0.39);
  325. box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
  326. padding: 10rpx 20rpx;
  327. border-radius: 4px;
  328. }
  329. }
  330. .timeLine-desc {
  331. margin-top: 10rpx;
  332. font-size: 26rpx;
  333. line-height: 36rpx;
  334. color: #909399;
  335. margin-bottom: 10rpx;
  336. }
  337. }
  338. </style>