leave_details.vue 15 KB

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