leave_approve.vue 10 KB

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