acquisition_settlement_approval.vue 14 KB

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