leave_approve.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  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. },
  128. close() {
  129. this.show = false
  130. },
  131. pass() {
  132. this.show = true
  133. this.title = '审核意见(通过)'
  134. },
  135. reject() {
  136. this.show = true
  137. this.title = '驳回原因(驳回)'
  138. },
  139. //通过
  140. passSubmit() {
  141. var that = this
  142. if (this.title == '驳回原因(驳回)') {
  143. this.rejectSubmit()
  144. } else {
  145. let that = this
  146. that.show = false
  147. uni.showModal({
  148. content: "是否确定通过?",
  149. showCancel: true,
  150. confirmText: '确定',
  151. success: function(res) {
  152. that.$api.doRequest('post', '/newWorkflow/api/handle', {
  153. approved: true,
  154. taskId: that.dataList.taskId,
  155. auditMind: that.auditMind,
  156. needReapply: false
  157. }).then(res => {
  158. if (res.data.code == 200) {
  159. that.$api.msg('审核成功!')
  160. uni.navigateTo({
  161. url: "/pages/task/my_task"
  162. })
  163. } else {
  164. that.$api.msg('审核失败!')
  165. }
  166. }).catch(res => {
  167. uni.hideLoading()
  168. if (res.message) {
  169. uni.showToast({
  170. title: res.message,
  171. icon: 'none',
  172. duration: 2000
  173. })
  174. } else {
  175. uni.showToast({
  176. title: "系统异常,请联系管理员",
  177. icon: 'none',
  178. duration: 2000
  179. })
  180. }
  181. })
  182. }
  183. })
  184. }
  185. },
  186. //驳回
  187. rejectSubmit() {
  188. if (!this.auditMind) {
  189. this.$api.msg('驳回原因不能为空!')
  190. } else {
  191. this.show = false
  192. let that = this
  193. uni.showModal({
  194. content: "是否确定驳回?",
  195. showCancel: true,
  196. confirmText: '确定',
  197. success: function(res) {
  198. that.$api.doRequest('post', '/newWorkflow/api/handle', {
  199. approved: false,
  200. taskId: that.dataList.taskId,
  201. auditMind: that.auditMind,
  202. needReapply: true
  203. }).then(res => {
  204. if (res.data.code == 200) {
  205. this.$api.msg('驳回成功!')
  206. uni.navigateTo({
  207. url: "/pages/task/my_task"
  208. })
  209. uni.hideLoading()
  210. } else {
  211. this.$api.msg('驳回失败!')
  212. }
  213. })
  214. }
  215. })
  216. }
  217. },
  218. }
  219. }
  220. </script>
  221. <style scoped lang="scss">
  222. .content1 {
  223. margin: 10rpx;
  224. padding-bottom: 224rpx;
  225. .title {
  226. height: 70rpx;
  227. line-height: 60rpx;
  228. font-size: 32rpx;
  229. font-weight: 600;
  230. color: #333333;
  231. border-bottom: 2rpx solid #EEEEEE;
  232. }
  233. }
  234. .uForm {
  235. padding: 0 40rpx;
  236. }
  237. .u-form-item {
  238. padding: 0;
  239. }
  240. .bottom-btn {
  241. width: 100%;
  242. position: fixed;
  243. bottom: 0;
  244. display: flex;
  245. z-index: 2;
  246. left: 0;
  247. background-color: #f8f8f8;
  248. flex-direction: column;
  249. .btn1,
  250. .btn2 {
  251. width: 100%;
  252. margin-bottom: 26rpx;
  253. border-radius: 90rpx;
  254. }
  255. .btn1 {
  256. background: white;
  257. color: #00C265;
  258. }
  259. }
  260. .submit {
  261. width: 50%;
  262. background: #22C572;
  263. border-radius: 10rpx;
  264. }
  265. .part2 {
  266. margin-top: 20rpx;
  267. }
  268. .textarea {
  269. border: 1px solid #ccc;
  270. border-radius: 10rpx;
  271. background-color: #F9F9FA;
  272. height: 100px;
  273. }
  274. .row {
  275. display: flex;
  276. justify-content: space-between;
  277. // border-bottom: 1px solid #EEEEEE;
  278. padding: 21rpx 0;
  279. .right,
  280. input {
  281. font-size: 28rpx;
  282. color: #333333;
  283. }
  284. }
  285. //弹出框
  286. // .popup {
  287. // padding: 30rpx;
  288. // border-radius: 20rpx;
  289. // }
  290. // .rejectInfoCss {
  291. // border: 1px solid #ccc;
  292. // border-radius: 10rpx;
  293. // background-color: #F9F9FA;
  294. // margin: 30rpx;
  295. // overflow-y: auto;
  296. // // height: 300rpx;
  297. // background: red;
  298. // }
  299. .uForm_item {
  300. padding: 20rpx;
  301. background-color: #FFFFFF;
  302. margin: 20rpx;
  303. border-radius: 20rpx;
  304. }
  305. .rejectText {
  306. text-align: center;
  307. }
  308. .topInfo {
  309. height: 210rpx;
  310. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  311. padding: 30rpx;
  312. .topInfo-item {
  313. height: 150rpx;
  314. background-color: #FFFFFF;
  315. border-radius: 20rpx;
  316. padding: 40rpx;
  317. .logo {
  318. width: 40rpx;
  319. height: 40rpx;
  320. margin-top: 8rpx;
  321. }
  322. .infoText {
  323. font-size: 36rpx;
  324. font-weight: 600;
  325. margin-left: 20rpx;
  326. }
  327. .infoData {
  328. color: #878C9C;
  329. font-size: 26rpx;
  330. margin-top: 10rpx;
  331. }
  332. }
  333. }
  334. .shade1 {
  335. position: fixed;
  336. top: 0;
  337. left: 0;
  338. height: 100%;
  339. width: 100%;
  340. background: rgba(0, 0, 0, 0.4);
  341. z-index: 3;
  342. .wrap1 {
  343. position: absolute;
  344. left: 0;
  345. top: 0;
  346. right: 0;
  347. bottom: 0;
  348. margin: auto;
  349. background: #fff;
  350. width: calc(100% - 198rpx);
  351. height: 355px;
  352. border-radius: 20rpx;
  353. .alert-top1 {
  354. padding: 33rpx;
  355. display: flex;
  356. justify-content: center;
  357. align-items: center;
  358. position: relative;
  359. }
  360. .title1 {
  361. font-size: 32rpx;
  362. font-weight: 600;
  363. color: #333333;
  364. }
  365. .close1 {
  366. position: absolute;
  367. right: 33rpx;
  368. }
  369. }
  370. .u-textarea-style1 {
  371. margin: 20rpx;
  372. background: #F9F9FA;
  373. border-radius: 10px;
  374. border: 1px solid #EEEEEE;
  375. padding: 10rpx 20rpx;
  376. height: 230px;
  377. .right-bottom1 {
  378. position: absolute;
  379. right: 20rpx;
  380. bottom: 80px;
  381. color: #AFB3BF;
  382. }
  383. }
  384. .cancel1 {
  385. position: absolute;
  386. display: inline-block;
  387. width: 50%;
  388. text-align: center;
  389. bottom: 0;
  390. padding: 10px;
  391. border-top: 1px solid #eee;
  392. font-size: 34rpx;
  393. }
  394. .confirm1 {
  395. position: absolute;
  396. display: inline-block;
  397. width: 50%;
  398. text-align: center;
  399. bottom: 0;
  400. padding: 10px;
  401. border-top: 1px solid #eee;
  402. font-size: 34rpx;
  403. }
  404. .cancel1 {
  405. left: 0;
  406. border-right: 1px solid #eee;
  407. color: #ff0000;
  408. }
  409. .confirm1 {
  410. right: 0;
  411. color: #22C572;
  412. }
  413. .bottom-btn1 {
  414. width: 100%;
  415. // position: fixed;
  416. bottom: 0;
  417. display: flex;
  418. z-index: 2;
  419. left: 0;
  420. background-color: #f8f8f8;
  421. flex-direction: column;
  422. .btn1,
  423. .btn2 {
  424. width: 100%;
  425. margin-bottom: 26rpx;
  426. border-radius: 90rpx;
  427. }
  428. .btn1 {
  429. background: white;
  430. color: #00C265;
  431. }
  432. }
  433. }
  434. /deep/.u-input__textarea {
  435. height: 300rpx !important;
  436. }
  437. </style>