acquisition_settlement_approval.vue 16 KB

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