warehouse_warrant.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  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="status == '已驳回'"
  8. style="height: 40rpx;"></image><!-- 驳回 -->
  9. <image src="../../../static/img/tongguo.png" mode="" v-if="status == '已通过'"
  10. style="height: 40rpx;"></image><!-- 通过 -->
  11. <!-- v-if="status == '审核中' || status == '待决策人审核'" -->
  12. <image src="../../../static/img/daishenhe.png" mode="" style="height: 40rpx;"></image>
  13. <!-- 待审核 -->
  14. </view>
  15. <!-- {{auditList.length > 0 ?auditList[auditList.length - 1].operatorMajorRoleName:""}} -->
  16. <view class="infoText">待决策人审核</view>
  17. </view>
  18. <view class="infoData">{{updateDate}}</view>
  19. </view>
  20. </view>
  21. <view class="content1">
  22. <!-- <view class="title">
  23. 销售外勤 张三
  24. </view> -->
  25. <view class="row">
  26. <view class="left">合计重量(吨)</view>
  27. <view class="right">{{auditInfo.inWarehouseWeightTotal}}</view>
  28. </view>
  29. <view class="row">
  30. <view class="left">合计金额(元)</view>
  31. <view class="right">{{auditInfo.requestFundsTotal}}</view>
  32. </view>
  33. <view class="row">
  34. <view class="left">仓库名称</view>
  35. <view class="right">{{auditInfo.warehouseName}}</view>
  36. </view>
  37. <view class="row">
  38. <view class="left">入库日期</view>
  39. <view class="right">{{auditInfo.issuingTime}}</view>
  40. </view>
  41. <view class="row" style="border-bottom:0">
  42. <view class="left">车数</view>
  43. <view class="right">{{auditInfo.count}}</view>
  44. </view>
  45. </view>
  46. <view class="content1" v-if="url && url != 'ng'">
  47. <view class="title ">
  48. 附件
  49. </view>
  50. <view class="file" @click="openXls">
  51. <image src="../../../static/img/excle.png" mode="" class="img_css"></image>
  52. <text class="text_css">明细.xls</text>
  53. </view>
  54. </view>
  55. <view class="content2">
  56. <view class="title row">
  57. 流程
  58. </view>
  59. <view v-for="(item,index) in auditList" :key='index' class="audit">
  60. <view class="row">
  61. <view class="left">
  62. <view class="item1">
  63. <image :src="src" style="width: 100rpx;height: 100rpx;border-radius: 500%;"></image>
  64. </view>
  65. <view class="item2">
  66. <view class="name">{{item.operatorName ? item.operatorName:item.operatorMajorRoleName}}
  67. </view>
  68. <view class="status">{{item.approved ? "已审核":"待决策人审核"}}</view>
  69. </view>
  70. </view>
  71. <view class="right">
  72. {{item.updateDate}}
  73. </view>
  74. </view>
  75. <view class="row-line" v-if="index!= auditList.length - 1"></view>
  76. </view>
  77. </view>
  78. <view v-if='show' class="shade">
  79. <view class="wrap">
  80. <view class="alert-top">
  81. <view class="title">
  82. {{title}}
  83. </view>
  84. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  85. </view>
  86. <view class="u-textarea-style">
  87. <view class="right-bottom">
  88. {{auditMind.length}}/100个字
  89. </view>
  90. <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  91. maxlength="100" />
  92. </view>
  93. <view @click='close()' class="cancel">取消</view>
  94. <view @click='passSubmit()' class="confirm">确定</view>
  95. </view>
  96. </view>
  97. <u-toast ref="uToast" />
  98. <view style='padding:10px;' class='flex bottom-btn'>
  99. <u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
  100. <u-button @click='pass' type="success" class="btn2">通过</u-button>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. import helper from '@/common/helper.js';
  106. import {
  107. mapState
  108. } from 'vuex';
  109. export default {
  110. data() {
  111. return {
  112. src: '../../../static/img/myimg/LiangShang@2x.png',
  113. isSHowBtn: true,
  114. height: 200,
  115. autoHeight: true,
  116. border: false,
  117. title: '',
  118. show: false,
  119. auditMind: '',
  120. id: "",
  121. currentPage: 1,
  122. pageSize: 100,
  123. List: [],
  124. status: "",
  125. updateDate: "",
  126. warehouseName: "",
  127. everyCheck: '',
  128. auditInfo: {},
  129. id: "",
  130. auditList: [],
  131. url: "11",
  132. }
  133. },
  134. onBackPress(e) {
  135. if (this.everyCheck) {
  136. uni.navigateTo({
  137. url: "/pages/task/my_task"
  138. })
  139. return true;
  140. }
  141. },
  142. onLoad(options) {
  143. this.id = options.id
  144. this.vesselId = options.vesselId
  145. this.everyCheck = uni.getStorageSync("everyTask")
  146. this.isSHowBtn = options.isShowbtn
  147. },
  148. onShow(options) {
  149. this.getList()
  150. },
  151. computed: {
  152. ...mapState(['hasLogin', 'userInfo']),
  153. },
  154. methods: {
  155. openXls() {
  156. if (this.url && this.url != "ng") {
  157. uni.downloadFile({
  158. url: this.url,
  159. success: function(res) {
  160. var filePath = res.tempFilePath;
  161. uni.openDocument({
  162. filePath: filePath,
  163. showMenu: true,
  164. success: function(res) {
  165. console.log('打开文档成功');
  166. }
  167. });
  168. }
  169. });
  170. }
  171. },
  172. getList() {
  173. uni.showLoading({
  174. title: "加载中...",
  175. mask: true
  176. })
  177. // this.$api.doRequest('get', '/warehousingOrder/selectInfo', {
  178. // currentPage: 1,
  179. // pageSize: 100,
  180. // searchType: '2', //searchType:1待审核
  181. // // warehouseName: this.vesselId,
  182. // managementType: 1
  183. // }).then(res1 => {
  184. // uni.hideLoading()
  185. // if (res1.data.code == 200) {
  186. // this.List = res1.data.data.records
  187. // }
  188. // })
  189. // this.$api.doRequest('get', '/paymentManagement/getInfo', {
  190. // id: this.id
  191. // }).then(res => {
  192. // if (res.data.code == 200) {
  193. // uni.showLoading({
  194. // title: "加载中...",
  195. // mask: true
  196. // })
  197. // }
  198. // })
  199. this.$api.doRequest('post', '/warehousingOrder/exportPhone', {
  200. batchId:this.id,searchType: 1,
  201. }).then(res1 => {
  202. if (res1.data.code == 200) {
  203. this.url = res1.data.data
  204. }
  205. })
  206. this.$api.doRequest('post', '/warehousingOrder/exportPhoneData', {searchType: 1,batchId:this.id}).then(res1 => {
  207. if (res1.data.code == 200) {
  208. this.auditInfo = res1.data.data
  209. this.auditInfo.amountIngPayableTotal1 = helper.convertCurrency(this.auditInfo
  210. .amountIngPayableTotal)
  211. uni.hideLoading()
  212. }
  213. })
  214. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  215. businessCode: 'WAREHOUSING-ORDER-APPROVE',
  216. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  217. }).then(res1 => {
  218. this.updateDate = res1.data.data[0].updateDate
  219. this.$api.doRequest('get', '/commonUser/getHis', {
  220. workflowId: res1.data.data[0].id,
  221. businessKey: this.id
  222. }).then(response => {
  223. // uni.hideLoading()
  224. this.auditList = response.data.data
  225. })
  226. })
  227. },
  228. close() {
  229. this.show = false
  230. },
  231. pass() {
  232. this.show = true
  233. this.title = '审核意见(通过)'
  234. },
  235. reject() {
  236. this.show = true
  237. this.title = '驳回原因(驳回)'
  238. },
  239. //驳回
  240. // rejectSubmit() {
  241. // if (!this.auditMind) {
  242. // this.$api.msg('驳回原因不能为空!')
  243. // } else {
  244. // var that = this
  245. // that.show = false
  246. // if (this.List.length > 0) {
  247. // uni.showModal({
  248. // content: "确定驳回付款申请?",
  249. // showCancel: true,
  250. // confirmText: '确定',
  251. // success: function(res) {
  252. // if (res.confirm) {
  253. // that.audit(that.List[0], 0, false, '', '')
  254. // }
  255. // }
  256. // })
  257. // }
  258. // }
  259. // },
  260. //审核确定
  261. passSubmit() {
  262. var that = this
  263. that.show = false
  264. if (this.title == '驳回原因(驳回)') {
  265. // this.rejectSubmit()
  266. if (!that.auditMind) {
  267. this.$api.msg('驳回原因不能为空!')
  268. } else {
  269. uni.showModal({
  270. content: "确定驳回付款申请?",
  271. showCancel: true,
  272. confirmText: '确定',
  273. success: function(res) {
  274. if (res.confirm) {
  275. uni.showLoading({
  276. title: "审核中...",
  277. mask: true
  278. })
  279. var count = 0
  280. // for (let num = 0; num < that.List.length; num++) {
  281. that.$api.doRequest('post', '/workflow/api/handle', {
  282. taskId: that.auditInfo.taskId,
  283. approved: false,
  284. auditMind: that.auditMind ? that.auditMind : "",
  285. needReapply: true
  286. }).then(res => {
  287. // count++
  288. // if (count == that.List.length) {
  289. uni.hideLoading()
  290. that.$api.msg('审核成功!')
  291. setTimeout(function() {
  292. uni.navigateBack();
  293. }, 2000);
  294. // }
  295. })
  296. // }
  297. }
  298. }
  299. })
  300. }
  301. } else {
  302. var that = this
  303. this.show = false
  304. uni.showModal({
  305. content: "确定通过付款申请?",
  306. showCancel: true,
  307. confirmText: '确定',
  308. success: function(res) {
  309. if (res.confirm) {
  310. uni.showLoading({
  311. title: "审核中...",
  312. mask: true
  313. })
  314. // for (let num = 0; num < that.List.length; num++) {
  315. // var tmp = 0
  316. that.$api.doRequest('post', '/workflow/api/handle', {
  317. taskId: that.auditInfo.taskId,
  318. approved: true,
  319. auditMind: that.auditMind ? that.auditMind : "",
  320. needReapply: false
  321. }).then(res => {
  322. // tmp++
  323. // if (tmp == that.List.length) {
  324. uni.hideLoading()
  325. that.$api.msg('审核成功!')
  326. setTimeout(function() {
  327. uni.navigateBack();
  328. }, 2000);
  329. // }
  330. })
  331. // }
  332. }
  333. }
  334. })
  335. }
  336. },
  337. // audit(list, index, status, status2, reason) {
  338. // uni.showLoading({
  339. // title: "审核中"
  340. // })
  341. // if (this.List.length > 0) {
  342. // if (status == true && list.status == "已驳回") {
  343. // this.$api.doRequest('get', '/paymentManagement/api/openAuditFlow', {
  344. // compId: "2710b21efc1e4393930c5dc800010dc4",
  345. // id: list.id
  346. // }).then(res => {
  347. // if (res.data.code == 200) {
  348. // this.audit(this.List[index + 1], index + 1, status, status2, reason)
  349. // }
  350. // })
  351. // } else {
  352. // for (var i = 0; i < this.List.length; i++) {
  353. // this.$api.doRequest('post', '/workflow/api/handle', {
  354. // taskId: this.List[i].taskId,
  355. // approved: status,
  356. // auditMind: this.auditMind ? this.auditMind : "",
  357. // needReapply: status2 ? true : false
  358. // }).then(res => {
  359. // if (res.data.code == 200) {
  360. // uni.hideLoading()
  361. // // this.audit(this.List[index + 1], index + 1, status, status2, reason)
  362. // this.$api.msg('通过成功')
  363. // }else{
  364. // uni.hideLoading()
  365. // this.$api.msg('审核失败')
  366. // }
  367. // })
  368. // }
  369. // }
  370. // } else {
  371. // if (status == true) {
  372. // this.$api.msg('通过成功')
  373. // } else if (status == false) {
  374. // this.$api.msg('驳回成功')
  375. // }
  376. // let that = this
  377. // setTimeout(function() {
  378. // if (that.everyCheck) {
  379. // helper.setAudit(that.list)
  380. // } else {
  381. // uni.navigateBack()
  382. // }
  383. // uni.hideLoading()
  384. // }, 1000);
  385. // }
  386. // },
  387. }
  388. }
  389. </script>
  390. <style scoped lang="scss">
  391. .warp {
  392. margin: 10rpx;
  393. padding: 20rpx 20rpx 240rpx 20rpx;
  394. }
  395. .content1 {
  396. font-size: 28rpx;
  397. color: #333333;
  398. margin-top: 30rpx;
  399. padding: 20rpx;
  400. // .content-item {
  401. border-radius: 20rpx;
  402. background: white;
  403. // padding: 40rpx 20rpx;
  404. // margin-bottom: 30rpx;
  405. // }
  406. // .title {
  407. // font-size: 32rpx;
  408. // font-weight: 600;
  409. // color: #333333;
  410. // margin: 30rpx 0;
  411. // }
  412. // .goodsInfoCss {
  413. // font-size: 28rpx;
  414. // font-weight: 600;
  415. // color: #878C9C;
  416. // margin: 26rpx 10rpx;
  417. // }
  418. // .priceCss {
  419. // font-size: 40rpx;
  420. // margin: 26rpx 10rpx;
  421. // color: #22C572;
  422. // font-weight: 600;
  423. // }
  424. .row {
  425. display: flex;
  426. justify-content: space-between;
  427. border-bottom: 1px solid #EEEEEE;
  428. padding: 20rpx 0;
  429. .right,
  430. input {
  431. font-size: 28rpx;
  432. // color: #333333;
  433. }
  434. }
  435. .img_css {
  436. width: 50rpx;
  437. height: 50rpx;
  438. }
  439. .file {
  440. display: flex;
  441. align-items: center;
  442. margin: 30rpx 0 0 20rpx;
  443. .text_css {
  444. font-size: 30rpx;
  445. margin-left: 20rpx;
  446. }
  447. }
  448. }
  449. .title {
  450. font-size: 34rpx;
  451. font-weight: 700;
  452. // margin-bottom: 20rpx;
  453. height: 70rpx;
  454. border-bottom: 2rpx solid #EEEEEE;
  455. }
  456. .titlerow {
  457. font-size: 34rpx;
  458. font-weight: 700;
  459. // margin-bottom: 20rpx;
  460. // height: 70rpx;
  461. // border-bottom: 2rpx solid #EEEEEE;
  462. }
  463. .content2 {
  464. background: white;
  465. margin: 20rpx 0;
  466. border-radius: 20rpx;
  467. padding: 20rpx;
  468. .row {
  469. display: flex;
  470. justify-content: space-between;
  471. .left {
  472. display: flex;
  473. align-items: center;
  474. .item2 {
  475. margin-left: 20rpx;
  476. .name {
  477. font-size: 32rpx;
  478. font-weight: 800;
  479. }
  480. .status {
  481. color: #6CC48C;
  482. }
  483. }
  484. }
  485. .right {
  486. color: #B0B1B5;
  487. margin-top: 10px;
  488. }
  489. }
  490. .row-line {
  491. width: 1px;
  492. height: 30px;
  493. background: #F2F2F2;
  494. margin: 10rpx 50rpx;
  495. }
  496. .audit {
  497. margin-top: 20rpx;
  498. }
  499. }
  500. .bottom-btn {
  501. width: 100%;
  502. position: fixed;
  503. bottom: 0;
  504. display: flex;
  505. z-index: 2;
  506. left: 0;
  507. background-color: #f8f8f8;
  508. flex-direction: column;
  509. .btn1,
  510. .btn2 {
  511. width: 100%;
  512. margin-bottom: 26rpx;
  513. border-radius: 90rpx;
  514. }
  515. .btn1 {
  516. background: white;
  517. color: #00C265;
  518. }
  519. }
  520. .row1 {
  521. border-bottom: 0 !important;
  522. }
  523. .topInfo {
  524. height: 210rpx;
  525. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  526. padding: 30rpx;
  527. .topInfo-item {
  528. height: 150rpx;
  529. background-color: #FFFFFF;
  530. border-radius: 20rpx;
  531. padding: 40rpx;
  532. .logo {
  533. width: 40rpx;
  534. height: 40rpx;
  535. margin-top: 8rpx;
  536. }
  537. .infoText {
  538. font-size: 36rpx;
  539. font-weight: 600;
  540. margin-left: 20rpx;
  541. }
  542. .infoData {
  543. color: #878C9C;
  544. font-size: 26rpx;
  545. margin-top: 10rpx;
  546. }
  547. }
  548. }
  549. .shade {
  550. position: fixed;
  551. top: 0;
  552. left: 0;
  553. height: 100%;
  554. width: 100%;
  555. background: rgba(0, 0, 0, 0.4);
  556. z-index: 3;
  557. .wrap {
  558. position: absolute;
  559. left: 0;
  560. top: 0;
  561. right: 0;
  562. bottom: 0;
  563. margin: auto;
  564. background: #fff;
  565. width: calc(100% - 198rpx);
  566. height: 700rpx;
  567. border-radius: 20rpx;
  568. .alert-top {
  569. padding: 33rpx;
  570. display: flex;
  571. justify-content: center;
  572. align-items: center;
  573. position: relative;
  574. }
  575. .title {
  576. font-size: 32rpx;
  577. font-weight: 600;
  578. color: #333333;
  579. }
  580. .close {
  581. position: absolute;
  582. right: 33rpx;
  583. }
  584. }
  585. }
  586. .cancel,
  587. .confirm {
  588. position: absolute;
  589. display: inline-block;
  590. width: 50%;
  591. text-align: center;
  592. bottom: 0;
  593. padding: 10px;
  594. border-top: 1px solid #eee;
  595. font-size: 34rpx;
  596. }
  597. .cancel {
  598. left: 0;
  599. border-right: 1px solid #eee;
  600. color: #AFB3BF;
  601. }
  602. .confirm {
  603. right: 0;
  604. color: #22C572;
  605. }
  606. .u-textarea-style {
  607. margin: 20rpx;
  608. background: #F9F9FA;
  609. border-radius: 10px;
  610. border: 1px solid #EEEEEE;
  611. padding: 10rpx 20rpx;
  612. position: relative;
  613. .right-bottom {
  614. position: absolute;
  615. right: 20rpx;
  616. bottom: 20rpx;
  617. color: #AFB3BF;
  618. }
  619. }
  620. /deep/.u-input__textarea {
  621. height: 300rpx !important;
  622. }
  623. </style>