leave_approve.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  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 v-if='show' class="shade1">
  50. <view class="wrap1">
  51. <view class="alert-top1">
  52. <view class="title1">
  53. {{title}}
  54. </view>
  55. <u-icon name="close" class="close1" color="#8890B1" @click="close()"></u-icon>
  56. </view>
  57. <view class="u-textarea-style1">
  58. <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  59. maxlength="100" />
  60. <view class="right-bottom1">
  61. {{auditMind.length}}/100个字
  62. </view>
  63. </view>
  64. <view @click='close()' class="cancel1">取消</view>
  65. <view @click='passSubmit()' class="confirm1">确定</view>
  66. </view>
  67. </view>
  68. <u-toast ref="uToast" />
  69. <view style='padding:10px;' class='flex bottom-btn'>
  70. <u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
  71. <u-button @click='pass' type="success" class="btn2">通过</u-button>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import helper from '@/common/helper.js';
  77. import {
  78. mapState
  79. } from 'vuex';
  80. export default {
  81. data() {
  82. return {
  83. everyCheck: '',
  84. height: 200,
  85. autoHeight: true,
  86. border: false,
  87. id: "",
  88. show: false,
  89. auditMind: '',
  90. leaveType:'',
  91. reasonForLeave:'',
  92. startDate:'',
  93. endDate:'',
  94. leaveDuration:'',
  95. leaveType:'',
  96. approveStatus:'',
  97. status:'',
  98. updateDate:'',
  99. dataList:{},
  100. }
  101. },
  102. onBackPress(e) {
  103. if (this.everyCheck) {
  104. uni.navigateTo({
  105. url: "/pages/task/my_task"
  106. })
  107. return true;
  108. }
  109. },
  110. onLoad(options) {
  111. this.id = options.id
  112. this.everyCheck = uni.getStorageSync("everyTask")
  113. this.getList()
  114. },
  115. computed: {
  116. ...mapState(['hasLogin', 'userInfo']),
  117. },
  118. methods: {
  119. getList() {
  120. this.$api.doRequest('get', '/leaveInfo/getLeaveInfo', {
  121. id: this.id
  122. }).then(res => {
  123. if (res.data.code == 200) {
  124. this.dataList = res.data.data
  125. }
  126. })
  127. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  128. businessCode: 'QINGJIA-APPROVE',
  129. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  130. }).then(res1 => {
  131. this.$api.doRequest('get', '/commonUser/getHis', {
  132. workflowId: res1.data.data[0].id,
  133. businessKey: this.id
  134. }).then(response => {})})
  135. },
  136. close() {
  137. this.show = false
  138. },
  139. pass() {
  140. this.show = true
  141. this.title = '审核意见(通过)'
  142. },
  143. reject() {
  144. this.show = true
  145. this.title = '驳回原因(驳回)'
  146. },
  147. //通过
  148. passSubmit() {
  149. var that = this
  150. if (this.title == '驳回原因(驳回)') {
  151. this.rejectSubmit()
  152. } else {
  153. let that = this
  154. that.show = false
  155. uni.showModal({
  156. content: "是否确定通过?",
  157. showCancel: true,
  158. confirmText: '确定',
  159. success: function(res) {
  160. that.$api.doRequest('post', '/newWorkflow/api/handle', {
  161. approved: true,
  162. taskId: that.dataList.taskId,
  163. auditMind: that.auditMind,
  164. needReapply: false
  165. }).then(res => {
  166. if (res.data.code == 200) {
  167. that.$api.msg('审核成功!')
  168. uni.navigateTo({
  169. url: "/pages/task/my_task"
  170. })
  171. } else {
  172. that.$api.msg('审核失败!')
  173. }
  174. }).catch(res => {
  175. uni.hideLoading()
  176. if (res.message) {
  177. uni.showToast({
  178. title: res.message,
  179. icon: 'none',
  180. duration: 2000
  181. })
  182. } else {
  183. uni.showToast({
  184. title: "系统异常,请联系管理员",
  185. icon: 'none',
  186. duration: 2000
  187. })
  188. }
  189. })
  190. }
  191. })
  192. }
  193. },
  194. //驳回
  195. rejectSubmit() {
  196. if (!this.auditMind) {
  197. this.$api.msg('驳回原因不能为空!')
  198. } else {
  199. this.show = false
  200. let that = this
  201. uni.showModal({
  202. content: "是否确定驳回?",
  203. showCancel: true,
  204. confirmText: '确定',
  205. success: function(res) {
  206. that.$api.doRequest('post', '/newWorkflow/api/handle', {
  207. approved: false,
  208. taskId: that.dataList.taskId,
  209. auditMind: that.auditMind,
  210. needReapply: true
  211. }).then(res => {
  212. if (res.data.code == 200) {
  213. this.$api.msg('驳回成功!')
  214. uni.navigateTo({
  215. url: "/pages/task/my_task"
  216. })
  217. uni.hideLoading()
  218. } else {
  219. this.$api.msg('驳回失败!')
  220. }
  221. })
  222. }
  223. })
  224. }
  225. },
  226. }
  227. }
  228. </script>
  229. <style scoped lang="scss">
  230. .content1 {
  231. margin: 10rpx;
  232. padding-bottom: 224rpx;
  233. .title {
  234. height: 70rpx;
  235. line-height: 60rpx;
  236. font-size: 32rpx;
  237. font-weight: 600;
  238. color: #333333;
  239. border-bottom: 2rpx solid #EEEEEE;
  240. }
  241. }
  242. .uForm {
  243. padding: 0 40rpx;
  244. }
  245. .u-form-item {
  246. padding: 0;
  247. }
  248. .bottom-btn {
  249. width: 100%;
  250. position: fixed;
  251. bottom: 0;
  252. display: flex;
  253. z-index: 2;
  254. left: 0;
  255. background-color: #f8f8f8;
  256. flex-direction: column;
  257. .btn1,
  258. .btn2 {
  259. width: 100%;
  260. margin-bottom: 26rpx;
  261. border-radius: 90rpx;
  262. }
  263. .btn1 {
  264. background: white;
  265. color: #00C265;
  266. }
  267. }
  268. .submit {
  269. width: 50%;
  270. background: #22C572;
  271. border-radius: 10rpx;
  272. }
  273. .part2 {
  274. margin-top: 20rpx;
  275. }
  276. .textarea {
  277. border: 1px solid #ccc;
  278. border-radius: 10rpx;
  279. background-color: #F9F9FA;
  280. height: 100px;
  281. }
  282. .row {
  283. display: flex;
  284. justify-content: space-between;
  285. // border-bottom: 1px solid #EEEEEE;
  286. padding: 21rpx 0;
  287. .right,
  288. input {
  289. font-size: 28rpx;
  290. color: #333333;
  291. }
  292. }
  293. //弹出框
  294. // .popup {
  295. // padding: 30rpx;
  296. // border-radius: 20rpx;
  297. // }
  298. // .rejectInfoCss {
  299. // border: 1px solid #ccc;
  300. // border-radius: 10rpx;
  301. // background-color: #F9F9FA;
  302. // margin: 30rpx;
  303. // overflow-y: auto;
  304. // // height: 300rpx;
  305. // background: red;
  306. // }
  307. .uForm_item {
  308. padding: 20rpx;
  309. background-color: #FFFFFF;
  310. margin: 20rpx;
  311. border-radius: 20rpx;
  312. }
  313. .rejectText {
  314. text-align: center;
  315. }
  316. .topInfo {
  317. height: 210rpx;
  318. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  319. padding: 30rpx;
  320. .topInfo-item {
  321. height: 150rpx;
  322. background-color: #FFFFFF;
  323. border-radius: 20rpx;
  324. padding: 40rpx;
  325. .logo {
  326. width: 40rpx;
  327. height: 40rpx;
  328. margin-top: 8rpx;
  329. }
  330. .infoText {
  331. font-size: 36rpx;
  332. font-weight: 600;
  333. margin-left: 20rpx;
  334. }
  335. .infoData {
  336. color: #878C9C;
  337. font-size: 26rpx;
  338. margin-top: 10rpx;
  339. }
  340. }
  341. }
  342. .shade1 {
  343. position: fixed;
  344. top: 0;
  345. left: 0;
  346. height: 100%;
  347. width: 100%;
  348. background: rgba(0, 0, 0, 0.4);
  349. z-index: 3;
  350. .wrap1 {
  351. position: absolute;
  352. left: 0;
  353. top: 0;
  354. right: 0;
  355. bottom: 0;
  356. margin: auto;
  357. background: #fff;
  358. width: calc(100% - 198rpx);
  359. height: 355px;
  360. border-radius: 20rpx;
  361. .alert-top1 {
  362. padding: 33rpx;
  363. display: flex;
  364. justify-content: center;
  365. align-items: center;
  366. position: relative;
  367. }
  368. .title1 {
  369. font-size: 32rpx;
  370. font-weight: 600;
  371. color: #333333;
  372. }
  373. .close1 {
  374. position: absolute;
  375. right: 33rpx;
  376. }
  377. }
  378. .u-textarea-style1 {
  379. margin: 20rpx;
  380. background: #F9F9FA;
  381. border-radius: 10px;
  382. border: 1px solid #EEEEEE;
  383. padding: 10rpx 20rpx;
  384. height: 230px;
  385. .right-bottom1 {
  386. position: absolute;
  387. right: 20rpx;
  388. bottom: 80px;
  389. color: #AFB3BF;
  390. }
  391. }
  392. .cancel1 {
  393. position: absolute;
  394. display: inline-block;
  395. width: 50%;
  396. text-align: center;
  397. bottom: 0;
  398. padding: 10px;
  399. border-top: 1px solid #eee;
  400. font-size: 34rpx;
  401. }
  402. .confirm1 {
  403. position: absolute;
  404. display: inline-block;
  405. width: 50%;
  406. text-align: center;
  407. bottom: 0;
  408. padding: 10px;
  409. border-top: 1px solid #eee;
  410. font-size: 34rpx;
  411. }
  412. .cancel1 {
  413. left: 0;
  414. border-right: 1px solid #eee;
  415. color: #ff0000;
  416. }
  417. .confirm1 {
  418. right: 0;
  419. color: #22C572;
  420. }
  421. .bottom-btn1 {
  422. width: 100%;
  423. // position: fixed;
  424. bottom: 0;
  425. display: flex;
  426. z-index: 2;
  427. left: 0;
  428. background-color: #f8f8f8;
  429. flex-direction: column;
  430. .btn1,
  431. .btn2 {
  432. width: 100%;
  433. margin-bottom: 26rpx;
  434. border-radius: 90rpx;
  435. }
  436. .btn1 {
  437. background: white;
  438. color: #00C265;
  439. }
  440. }
  441. }
  442. /deep/.u-input__textarea {
  443. height: 300rpx !important;
  444. }
  445. </style>