leave_approve.vue 11 KB

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