acquisition_settlement_approval.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  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=""
  13. style="height: 40rpx;"></image><!-- 待审核 -->
  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. // /workflow/query/workflowDefinitions
  251. // /workflow/query/workflowInfo exportPhoneData
  252. this.$api.doRequest('post', '/paymentManagement/exportPhone', {
  253. warehouseName: this.vesselId,
  254. }).then(res1 => {
  255. if (res1.data.code == 200) {
  256. this.url = res1.data.data
  257. // uni.downloadFile({
  258. // url: res1.data.data,
  259. // success: function(res1) {
  260. // var filePath = res1.tempFilePath;
  261. // uni.openDocument({
  262. // filePath: filePath,
  263. // showMenu: true,
  264. // success: function(res1) {
  265. // console.log('打开文档成功');
  266. // }
  267. // });
  268. // }
  269. // });
  270. }
  271. })
  272. this.$api.doRequest('post', '/paymentManagement/exportPhoneData', {
  273. warehouseName: this.vesselId
  274. }).then(res1 => {
  275. if (res1.data.code == 200) {
  276. this.auditInfo = res1.data.data
  277. this.auditInfo.amountIngPayableTotal1 = helper.convertCurrency(this.auditInfo.amountIngPayableTotal)
  278. }
  279. })
  280. this.$api.doRequest('get', '/workflow/query/workflowDefinitions', {
  281. businessCode: 'PAYMENT-MANAGEMENT-APPROVE',
  282. tmpCompId: uni.getStorageSync('pcUserInfo').compId
  283. }).then(res1 => {
  284. this.updateDate = res1.data.data[0].updateDate
  285. // this.$api.doRequest('get', '/workflow/query/workflowInfo', {
  286. // workflowId: res1.data.data[0].id
  287. // }).then(response => {
  288. // this.auditList = response.data.data.steps
  289. // })
  290. uni.showLoading({
  291. title:"加载中...",
  292. mask:true
  293. })
  294. this.$api.doRequest('get', '/commonUser/getHis', {
  295. workflowId: res1.data.data[0].id,
  296. businessKey:this.id
  297. }).then(response => {
  298. uni.hideLoading()
  299. debugger
  300. this.auditList = response.data.data
  301. // for(var i = 0 ; i < response.data.data.length ; i++){
  302. // if(response.data.data[i].approved){
  303. // this.auditList.push(response.data.data[i])
  304. // }
  305. // }
  306. // this.auditList = response.data.data
  307. // this.auditList = response.data.data.steps
  308. })
  309. })
  310. // this.$api.doRequest('get', '/workflow/query/workflowInfo',
  311. // {workflowId:this.id}).then(res1 => {
  312. // })
  313. },
  314. close() {
  315. this.show = false
  316. },
  317. pass() {
  318. this.show = true
  319. this.title = '审核意见(通过)'
  320. },
  321. reject() {
  322. this.show = true
  323. this.title = '驳回原因(驳回)'
  324. },
  325. //驳回
  326. rejectSubmit() {
  327. if (!this.auditMind) {
  328. this.$api.msg('驳回原因不能为空!')
  329. } else {
  330. var that = this
  331. that.show = false
  332. if (this.List.length > 0) {
  333. uni.showModal({
  334. content: "确定驳回付款申请?",
  335. showCancel: true,
  336. confirmText: '确定',
  337. success: function(res) {
  338. if (res.confirm) {
  339. that.audit(that.List[0], 0, false, '', '')
  340. }
  341. }
  342. })
  343. }
  344. }
  345. },
  346. //通過
  347. passSubmit() {
  348. var that = this
  349. if (this.title == '驳回原因(驳回)') {
  350. this.rejectSubmit()
  351. } else {
  352. var that = this
  353. this.show = false
  354. uni.showModal({
  355. content: "确定通过付款申请?",
  356. showCancel: true,
  357. confirmText: '确定',
  358. success: function(res) {
  359. if (res.confirm) {
  360. that.audit(that.List, 0, true)
  361. }
  362. }
  363. })
  364. }
  365. },
  366. audit(list, index, status, status2, reason) {
  367. uni.showLoading({
  368. title: "审核中"
  369. })
  370. if (this.List.length > 0) {
  371. if (status == true && item.status == "已驳回") {
  372. this.$api.doRequest('get', '/paymentManagement/api/openAuditFlow', {
  373. compId: "2710b21efc1e4393930c5dc800010dc4",
  374. id: item.id
  375. }).then(res => {
  376. if (res.data.code == 200) {
  377. this.audit(this.List[index + 1], index + 1, status, status2, reason)
  378. }
  379. })
  380. } else {
  381. for (var i = 0; i < this.List.length; i++) {
  382. this.$api.doRequest('post', '/workflow/api/handle', {
  383. taskId: this.List[i].taskId,
  384. approved: status,
  385. auditMind: this.auditMind ? this.auditMind : "",
  386. needReapply: status2 ? true : false
  387. }).then(res => {
  388. if (res.data.code == 200) {
  389. // this.audit(this.List[index + 1], index + 1, status, status2, reason)
  390. this.$api.msg('通过成功')
  391. }
  392. })
  393. }
  394. }
  395. } else {
  396. if (status == true) {
  397. this.$api.msg('通过成功')
  398. } else if (status == false) {
  399. this.$api.msg('驳回成功')
  400. }
  401. let that = this
  402. setTimeout(function() {
  403. if (that.everyCheck) {
  404. helper.setAudit(that.list)
  405. } else {
  406. uni.navigateBack()
  407. }
  408. uni.hideLoading()
  409. }, 1000);
  410. }
  411. },
  412. }
  413. }
  414. </script>
  415. <style scoped lang="scss">
  416. .warp {
  417. margin: 10rpx;
  418. padding: 20rpx 20rpx 240rpx 20rpx;
  419. }
  420. .content1 {
  421. font-size: 28rpx;
  422. color: #333333;
  423. margin-top: 30rpx;
  424. padding: 20rpx;
  425. // .content-item {
  426. border-radius: 20rpx;
  427. background: white;
  428. // padding: 40rpx 20rpx;
  429. // margin-bottom: 30rpx;
  430. // }
  431. // .title {
  432. // font-size: 32rpx;
  433. // font-weight: 600;
  434. // color: #333333;
  435. // margin: 30rpx 0;
  436. // }
  437. // .goodsInfoCss {
  438. // font-size: 28rpx;
  439. // font-weight: 600;
  440. // color: #878C9C;
  441. // margin: 26rpx 10rpx;
  442. // }
  443. // .priceCss {
  444. // font-size: 40rpx;
  445. // margin: 26rpx 10rpx;
  446. // color: #22C572;
  447. // font-weight: 600;
  448. // }
  449. .row {
  450. display: flex;
  451. justify-content: space-between;
  452. border-bottom: 1px solid #EEEEEE;
  453. padding: 20rpx 0;
  454. .right,
  455. input {
  456. font-size: 28rpx;
  457. // color: #333333;
  458. }
  459. }
  460. .img_css{
  461. width: 50rpx;
  462. height: 50rpx;
  463. }
  464. .file{
  465. display: flex;
  466. align-items: center;
  467. margin: 30rpx 0 0 20rpx;
  468. .text_css{
  469. font-size: 30rpx;
  470. margin-left: 20rpx;
  471. }
  472. }
  473. }
  474. .title{
  475. font-size: 34rpx;
  476. font-weight: 700;
  477. // margin-bottom: 20rpx;
  478. height: 70rpx;
  479. border-bottom: 2rpx solid #EEEEEE;
  480. }
  481. .titlerow{
  482. font-size: 34rpx;
  483. font-weight: 700;
  484. // margin-bottom: 20rpx;
  485. // height: 70rpx;
  486. // border-bottom: 2rpx solid #EEEEEE;
  487. }
  488. .content2 {
  489. background: white;
  490. margin: 20rpx 0;
  491. border-radius: 20rpx;
  492. padding: 20rpx;
  493. .row {
  494. display: flex;
  495. justify-content: space-between;
  496. .left {
  497. display: flex;
  498. align-items: center;
  499. .item2 {
  500. margin-left: 20rpx;
  501. .name {
  502. font-size: 32rpx;
  503. font-weight: 800;
  504. }
  505. .status {
  506. color: #6CC48C;
  507. }
  508. }
  509. }
  510. .right {
  511. color: #B0B1B5;
  512. margin-top: 10px;
  513. }
  514. }
  515. .row-line {
  516. width: 1px;
  517. height: 30px;
  518. background: #F2F2F2;
  519. margin: 10rpx 50rpx;
  520. }
  521. .audit{
  522. margin-top: 20rpx;
  523. }
  524. }
  525. .bottom-btn {
  526. width: 100%;
  527. position: fixed;
  528. bottom: 0;
  529. display: flex;
  530. z-index: 2;
  531. left: 0;
  532. background-color: #f8f8f8;
  533. flex-direction: column;
  534. .btn1,
  535. .btn2 {
  536. width: 100%;
  537. margin-bottom: 26rpx;
  538. border-radius: 90rpx;
  539. }
  540. .btn1 {
  541. background: white;
  542. color: #00C265;
  543. }
  544. }
  545. .row1 {
  546. border-bottom: 0 !important;
  547. }
  548. .topInfo {
  549. height: 210rpx;
  550. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  551. padding: 30rpx;
  552. .topInfo-item {
  553. height: 150rpx;
  554. background-color: #FFFFFF;
  555. border-radius: 20rpx;
  556. padding: 40rpx;
  557. .logo {
  558. width: 40rpx;
  559. height: 40rpx;
  560. margin-top: 8rpx;
  561. }
  562. .infoText {
  563. font-size: 36rpx;
  564. font-weight: 600;
  565. margin-left: 20rpx;
  566. }
  567. .infoData {
  568. color: #878C9C;
  569. font-size: 26rpx;
  570. margin-top: 10rpx;
  571. }
  572. }
  573. }
  574. .shade {
  575. position: fixed;
  576. top: 0;
  577. left: 0;
  578. height: 100%;
  579. width: 100%;
  580. background: rgba(0, 0, 0, 0.4);
  581. z-index: 3;
  582. .wrap {
  583. position: absolute;
  584. left: 0;
  585. top: 0;
  586. right: 0;
  587. bottom: 0;
  588. margin: auto;
  589. background: #fff;
  590. width: calc(100% - 198rpx);
  591. height: 700rpx;
  592. border-radius: 20rpx;
  593. .alert-top {
  594. padding: 33rpx;
  595. display: flex;
  596. justify-content: center;
  597. align-items: center;
  598. position: relative;
  599. }
  600. .title {
  601. font-size: 32rpx;
  602. font-weight: 600;
  603. color: #333333;
  604. }
  605. .close {
  606. position: absolute;
  607. right: 33rpx;
  608. }
  609. }
  610. }
  611. .cancel,
  612. .confirm {
  613. position: absolute;
  614. display: inline-block;
  615. width: 50%;
  616. text-align: center;
  617. bottom: 0;
  618. padding: 10px;
  619. border-top: 1px solid #eee;
  620. font-size: 34rpx;
  621. }
  622. .cancel {
  623. left: 0;
  624. border-right: 1px solid #eee;
  625. color: #AFB3BF;
  626. }
  627. .confirm {
  628. right: 0;
  629. color: #22C572;
  630. }
  631. .u-textarea-style {
  632. margin: 20rpx;
  633. background: #F9F9FA;
  634. border-radius: 10px;
  635. border: 1px solid #EEEEEE;
  636. padding: 10rpx 20rpx;
  637. position: relative;
  638. .right-bottom {
  639. position: absolute;
  640. right: 20rpx;
  641. bottom: 20rpx;
  642. color: #AFB3BF;
  643. }
  644. }
  645. /deep/.u-input__textarea {
  646. height: 300rpx !important;
  647. }
  648. </style>