supp_clock_details.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. <template>
  2. <view class="warp">
  3. <view class="topInfo">
  4. <view class="topInfo-item">
  5. <view class="flex info">
  6. <view class="logo">
  7. <image src="../../../static/img/reject.png" mode=""
  8. v-if="dataList.status == '补卡失败'" style="height: 40rpx;">
  9. </image><!-- 驳回 -->
  10. <image src="../../../static/img/tongguo.png" mode=""
  11. v-else-if="dataList.status == '补卡成功'"
  12. style="height: 40rpx;"></image><!-- 通过 -->
  13. <image src="../../../static/img/daishenhe.png" mode=""
  14. v-else-if="dataList.approveStatus == '待人事审核'"
  15. style="height: 40rpx;"></image><!-- 待审核 -->
  16. </view>
  17. <view class="infoText" v-if="dataList.approveStatus">{{dataList.approveStatus}}</view>
  18. <view class="infoText" v-else>{{dataList.status}}</view>
  19. </view>
  20. <view class="infoData" v-if="dataList.updateDate">{{dataList.updateDate}}</view>
  21. </view>
  22. </view>
  23. <view class="content1">
  24. <!-- :model="OutList" -->
  25. <u-form ref="uForm">
  26. <u-form-item label="补卡原因" prop="supplementClockType" label-width="140" class="uForm_item">
  27. <u-input input-align="right" disabled v-if="dataList.supplementClockType=='1'" value="上班">上班</u-input>
  28. <u-input input-align="right" disabled v-if="dataList.supplementClockType=='3'" value="下班">下班</u-input>
  29. </u-form-item>
  30. <view class="uForm_item">
  31. <u-form-item label="申请理由" prop="reasonForApplication" label-width="160" label-position="top">
  32. <u-input v-model="dataList.reasonForApplication" input-align="left" placeholder="请输入业务描述"
  33. type="textarea" class="textarea" maxlength="150" />
  34. </u-form-item>
  35. </view>
  36. </u-form>
  37. </view>
  38. <view class="content3">
  39. <view class="titlez rowz">
  40. 流程
  41. </view>
  42. <view v-for="(item,index) in auditList" :key='index' class="audit">
  43. <view class="row" v-if='item.desc!="_PLACEHOLDER_"'>
  44. <view class="left">
  45. <view class="item1">
  46. <view class="item-content">{{item.operatorTitle}}</view>
  47. <view v-if="item.status=='success'" class='status success'>
  48. <u-icon name="checkmark" color="#2979ff" size="24"></u-icon>
  49. </view>
  50. <view v-if="item.status=='error'" class='status error'>
  51. <u-icon name="close" color="rgb(245, 108, 108)" size="24"></u-icon>
  52. </view>
  53. <view v-if="item.status=='question'" class='status question'>
  54. <u-icon name="question" color="#f9ae3d" size="24"></u-icon>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="right">
  59. <view class="right-item">
  60. <view class="item2">
  61. <view class="name">{{item.desc}}
  62. </view>
  63. <!-- <view class='time'>{{item.updateDate}}</view> -->
  64. <view v-if="item.status=='success'" class="status success">
  65. {{item.commonStaffs1?item.staffscontent:item.operatorName}}<text
  66. v-if='!item.commonStaffs1&&index!=0'>已审核</text></view>
  67. <view v-if="item.status=='error'" class="status error">
  68. {{item.commonStaffs1?item.staffscontent:item.operatorName}}<text
  69. v-if='!item.commonStaffs1'>{{item.workflowHistoricTasks ? "已驳回":''}}</text>
  70. </view>
  71. <view v-if="item.status=='question'" class="status question">
  72. {{item.commonStaffs1?item.staffscontent:''}}<text
  73. v-if='!item.commonStaffs1'>未审核</text></view>
  74. <!-- <view class="status success">吕波(已审核)</view> -->
  75. </view>
  76. <view v-if='index==0||item.workflowHistoricTasks&&item.workflowHistoricTasks.length>0'
  77. class='time'>
  78. {{item.updateDate}}
  79. </view>
  80. </view>
  81. <view v-if='item.auditMind' class="right-content">
  82. {{item.auditMind}}
  83. </view>
  84. </view>
  85. <view v-if='item.commonStaffs1' class="right">
  86. <u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28">
  87. </u-icon>
  88. </view>
  89. </view>
  90. <view v-if='item.showflow' style='padding:10px 0 0 50px;'>
  91. <view class='row2'>
  92. <view v-for='item1 in item.commonStaffs1' style='margin:5px;text-align:center;'>
  93. <view class="item-content">
  94. <u-icon v-if='item1.status' name="checkmark" color="#fff" size="14"></u-icon>
  95. <u-icon v-if='!item1.status' name="question" color="#f9ae3d" size="14"></u-icon>
  96. </view>
  97. <view class="name">{{item1.staffName}}</view>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="row-line" v-if="index!= auditList.length - 1&&item.desc!='_PLACEHOLDER_'"></view>
  102. </view>
  103. </view>
  104. <view style='padding:10px;' class='flex bottom-btn'>
  105. <u-button @click='fanHui' type="success" class="btn1" hover-class='none'>返回</u-button>
  106. </view>
  107. </view>
  108. </template>
  109. <script>
  110. import {
  111. mapState
  112. } from 'vuex';
  113. export default {
  114. data() {
  115. return {
  116. id: "",
  117. show: false,
  118. show1: false,
  119. border: false,
  120. rejectInfo: "", //驳回原因
  121. reasonForApplication:'',
  122. supplementClockType:'',
  123. approveStatus:'',
  124. status:'',
  125. updateDate:'',
  126. pcUserInfo :uni.getStorageSync('pcUserInfo'),
  127. auditMind: '',
  128. dataList:{
  129. srcList:[]
  130. },
  131. auditList: [],
  132. auditMind: '',
  133. }
  134. },
  135. // onReady() {
  136. // this.$refs.uForm.setRules(this.rules);
  137. // },
  138. onLoad(options) {
  139. this.id = options.id
  140. this.getList()
  141. },
  142. computed: {
  143. ...mapState(['hasLogin', 'userInfo']),
  144. },
  145. methods: {
  146. getList() {
  147. this.$api.doRequest('get', '/clockInfo/getSuppClock', {
  148. id: this.id
  149. }).then(res => {
  150. if (res.data.code == 200) {
  151. this.dataList = res.data.data
  152. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  153. businessCode: 'BUKA-APPROVE',
  154. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  155. }).then(res1 => {
  156. this.$api.doRequest('get', '/commonUser/getHis', {
  157. workflowId: res1.data.data[0].id,
  158. businessKey: this.id,
  159. // branch:that.list.jointVentureParties?that.list.jointVentureParties:'zt'
  160. }).then(response => {
  161. uni.hideLoading()
  162. for (let i = 0; i < response.data.data.length; i++) {
  163. this.$set(response.data.data[i], 'status', 'question')
  164. // console.log(response.data.data[i].workflowHistoricTasks,i)
  165. if (response.data.data[i].commonStaffs) {
  166. response.data.data[i].showflow = false
  167. response.data.data[i].operatorTitle = response.data.data[i]
  168. .desc.substring(0, 2)
  169. response.data.data[i].operatorName = response.data.data[i]
  170. .desc
  171. response.data.data[i].staffscontent = '共' + response.data
  172. .data[i].commonStaffs.length + '人,当前审核' + response.data
  173. .data[i].workflowHistoricTasks.length + '人'
  174. if (response.data.data[i].workflowHistoricTasks && response
  175. .data.data[i].workflowHistoricTasks.length > 0) {
  176. if (response.data.data[i].workflowHistoricTasks
  177. .length != response.data.data[i].commonStaffs
  178. .length) {
  179. // response.data.data[i].status='question'
  180. this.$set(response.data.data[i], 'status',
  181. 'question')
  182. } else {
  183. this.$set(response.data.data[i], 'status',
  184. 'success')
  185. // response.data.data[i].status='success'
  186. }
  187. response.data.data[i].workflowlen = response.data.data[
  188. i].workflowHistoricTasks.length
  189. var workflowdata = response.data.data[i]
  190. .workflowHistoricTasks
  191. var staffsdata = response.data.data[i].commonStaffs
  192. for (let q = 0; q < staffsdata.length; q++) {
  193. staffsdata[q].status = false
  194. staffsdata[q].staffTitle = staffsdata[q].staffName
  195. for (let k = 0; k < workflowdata.length; k++) {
  196. if (staffsdata[q].staffId == workflowdata[k]
  197. .operatorId) {
  198. staffsdata[q].status = true
  199. }
  200. }
  201. }
  202. }
  203. response.data.data[i].commonStaffs1 = response.data.data[i]
  204. .commonStaffs
  205. } else {
  206. if (response.data.data[i].workflowHistoricTasks && response
  207. .data.data[i].workflowHistoricTasks.length > 0) {
  208. var len = response.data.data[i].workflowHistoricTasks
  209. .length - 1
  210. if (response.data.data[i].workflowHistoricTasks[len]
  211. .approved) {
  212. this.$set(response.data.data[i], 'status',
  213. 'success')
  214. } else {
  215. this.$set(response.data.data[i], 'status', 'error')
  216. }
  217. response.data.data[i].operatorTitle = response.data
  218. .data[i].workflowHistoricTasks[len].operatorName
  219. .substring(response.data.data[i]
  220. .workflowHistoricTasks[0].operatorName.length -
  221. 2)
  222. response.data.data[i].operatorName = response.data
  223. .data[i].workflowHistoricTasks[len].operatorName
  224. var time = new Date(response.data.data[i]
  225. .workflowHistoricTasks[len].claimTime)
  226. .getTime()
  227. response.data.data[i].updateDate = this.$u.timeFormat(
  228. time, 'mm.dd hh:MM')
  229. response.data.data[i].auditMind = response.data.data[i]
  230. .workflowHistoricTasks[len].auditMind
  231. } else {
  232. this.$set(response.data.data[i], 'status', 'question')
  233. // response.data.data[i].status='question'
  234. if (response.data.data[i].desc == '总经理助理审核') {
  235. response.data.data[i].operatorTitle = '总助'
  236. } else if (response.data.data[i].desc == '杜大光审核') {
  237. response.data.data[i].operatorTitle = '大光'
  238. } else {
  239. response.data.data[i].operatorTitle = response.data
  240. .data[i].desc.substring(0, 2)
  241. }
  242. response.data.data[i].operatorName = response.data
  243. .data[i].desc
  244. var time1 = new Date(response.data.data[i].updateDate)
  245. .getTime()
  246. response.data.data[i].updateDate = this.$u.timeFormat(
  247. time1, 'mm.dd hh:MM')
  248. response.data.data[i].auditMind = ''
  249. }
  250. }
  251. }
  252. console.log(response.data.data)
  253. this.auditList = response.data.data
  254. var time2 = new Date(this.dataList.createDate).getTime()
  255. var time3 = this.$u.timeFormat(time2, 'mm.dd hh:MM')
  256. this.auditList.unshift({
  257. operatorTitle: this.dataList.empName.substring(0, 2),
  258. operatorName: this.dataList.empName,
  259. updateDate: time3,
  260. auditMind: '',
  261. desc: '发起申请',
  262. showflow: false,
  263. commonStaffs1: null,
  264. commonStaffs: null,
  265. workflowHistoricTasks: [],
  266. status: 'success'
  267. })
  268. })
  269. })
  270. }
  271. })
  272. },
  273. fanHui() {
  274. uni.navigateBack()
  275. }
  276. }
  277. }
  278. </script>
  279. <style scoped lang="scss">
  280. .warp {
  281. margin: 10rpx;
  282. padding: 20rpx 20rpx 240rpx 20rpx;
  283. }
  284. .content1 {
  285. margin: 10rpx;
  286. .title {
  287. height: 70rpx;
  288. line-height: 60rpx;
  289. font-size: 32rpx;
  290. font-weight: 600;
  291. color: #333333;
  292. border-bottom: 2rpx solid #EEEEEE;
  293. }
  294. }
  295. .uForm {
  296. padding: 0 40rpx;
  297. }
  298. .u-form-item {
  299. padding: 0;
  300. }
  301. .bottom-btn {
  302. width: 100%;
  303. position: fixed;
  304. bottom: 0;
  305. display: flex;
  306. z-index: 2;
  307. left: 0;
  308. background-color: #f8f8f8;
  309. flex-direction: column;
  310. .btn1,
  311. .btn2 {
  312. width: 100%;
  313. margin-bottom: 26rpx;
  314. border-radius: 90rpx;
  315. }
  316. .btn1 {
  317. background: white;
  318. color: #00C265;
  319. }
  320. }
  321. .submit {
  322. width: 50%;
  323. background: #22C572;
  324. border-radius: 10rpx;
  325. }
  326. .part2 {
  327. margin-top: 20rpx;
  328. }
  329. .textarea {
  330. border: 1px solid #ccc;
  331. border-radius: 10rpx;
  332. background-color: #F9F9FA;
  333. height: 100px;
  334. }
  335. .row {
  336. display: flex;
  337. justify-content: space-between;
  338. // border-bottom: 1px solid #EEEEEE;
  339. padding: 21rpx 0;
  340. .right,
  341. input {
  342. font-size: 28rpx;
  343. color: #333333;
  344. }
  345. }
  346. //弹出框
  347. // .popup {
  348. // padding: 30rpx;
  349. // border-radius: 20rpx;
  350. // }
  351. .rejectInfoCss {
  352. border: 1px solid #ccc;
  353. border-radius: 10rpx;
  354. background-color: #F9F9FA;
  355. height: 100px;
  356. margin: 30rpx;
  357. }
  358. .uForm_item {
  359. padding: 20rpx;
  360. background-color: #FFFFFF;
  361. margin: 20rpx 0rpx 0rpx 0rpx;
  362. border-radius: 20rpx;
  363. width: 100%;
  364. }
  365. .rejectText {
  366. text-align: center;
  367. }
  368. .topInfo {
  369. height: 210rpx;
  370. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  371. padding: 30rpx;
  372. .topInfo-item {
  373. height: 150rpx;
  374. background-color: #FFFFFF;
  375. border-radius: 20rpx;
  376. padding: 40rpx;
  377. .logo {
  378. width: 40rpx;
  379. height: 40rpx;
  380. margin-top: 8rpx;
  381. }
  382. .infoText {
  383. font-size: 36rpx;
  384. font-weight: 600;
  385. margin-left: 20rpx;
  386. }
  387. .infoData {
  388. color: #878C9C;
  389. font-size: 26rpx;
  390. margin-top: 10rpx;
  391. }
  392. }
  393. }
  394. .content3 {
  395. background: white;
  396. margin: 20rpx 0;
  397. border-radius: 20rpx;
  398. padding: 20rpx;
  399. .row {
  400. display: flex;
  401. .left {
  402. display: flex;
  403. align-items: center;
  404. .item1 {
  405. position: relative;
  406. .item-content {
  407. background: #617AE0;
  408. width: 44px;
  409. height: 44px;
  410. border-radius: 22px;
  411. line-height: 44px;
  412. text-align: center;
  413. font-size: 15px;
  414. color: #fff;
  415. }
  416. .status {
  417. position: absolute;
  418. border-radius: 50%;
  419. padding: 0px 2px;
  420. right: -3px;
  421. bottom: -3px;
  422. background: #fff;
  423. }
  424. .status.success {
  425. border: 1px solid rgb(60, 156, 255);
  426. }
  427. .status.error {
  428. border: 1px solid rgb(245, 108, 108);
  429. }
  430. .status.question {
  431. border: 1px solid #f9ae3d;
  432. }
  433. }
  434. }
  435. .right {
  436. width: 80%;
  437. // color: #B0B1B5;
  438. margin-top: 10px;
  439. .right-content {
  440. background: #F2F3F7;
  441. margin-left: 10px;
  442. margin-top: 10px;
  443. padding: 10px;
  444. border-radius: 5px;
  445. color: #B0B1B5;
  446. }
  447. .right-item {
  448. display: flex;
  449. justify-content: space-between;
  450. .time {
  451. color: #999;
  452. }
  453. .item2 {
  454. margin-left: 20rpx;
  455. margin-top: -7px;
  456. .name {
  457. font-size: 28rpx;
  458. font-weight: 800;
  459. }
  460. .status.success {
  461. color: #6CC48C;
  462. }
  463. .status.error {
  464. color: rgb(245, 108, 108);
  465. }
  466. .status.question {
  467. color: #f9ae3d;
  468. }
  469. }
  470. }
  471. }
  472. }
  473. .row2 {
  474. display: flex;
  475. .item-content {
  476. background: #22C572;
  477. width: 30px;
  478. height: 30px;
  479. border-radius: 50%;
  480. line-height: 30px;
  481. text-align: center;
  482. font-size: 12px;
  483. color: #fff;
  484. padding: 0 2px;
  485. margin: 0 auto;
  486. }
  487. .status {
  488. position: absolute;
  489. top: 0;
  490. right: 0;
  491. }
  492. }
  493. .row-line {
  494. width: 1px;
  495. height: 40rpx;
  496. background: #F2F2F2;
  497. margin: 10rpx 50rpx;
  498. }
  499. .audit {
  500. margin-top: 20rpx;
  501. }
  502. }
  503. .titlez {
  504. font-size: 17px;
  505. font-weight: 700;
  506. height: 35px;
  507. border-bottom: 1px solid #EEEEEE;
  508. }
  509. .rowz{
  510. display: flex;
  511. justify-content: space-between;
  512. .right,
  513. input {
  514. font-size: 28rpx;
  515. color: #333333;
  516. }
  517. }
  518. .deleteText {
  519. text-align: center;
  520. color: #AFB3BF;
  521. }
  522. </style>