collection_business_approval.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <template>
  2. <view class="warp">
  3. <view class="content1">
  4. <view class="top">
  5. <view class="row1">
  6. <view class="left">{{getData.contractNo}}</view>
  7. <view class="right">代收费{{getData.agencyCharge}}元/吨</view>
  8. </view>
  9. <view class ="row2">
  10. {{getData.buyer}}
  11. </view>
  12. </view>
  13. <view class="list">
  14. <view class="list-content" v-for="(item,index) in recordList" :key='index'>
  15. <view class="row1">
  16. {{item.carNo}}
  17. </view>
  18. <view class="row2">
  19. <view class="left">
  20. 净重:{{item.netWeight}}吨
  21. </view>
  22. <view class="right">
  23. 单价:{{item.unitDeduction}}元/吨
  24. </view>
  25. </view>
  26. <view class="row3">
  27. <view class="left">
  28. 应付:{{item.amountNotPayable}}元
  29. </view>
  30. <view class="right">
  31. 应收:{{item.amountNotCollectable}}元
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <u-toast ref="uToast" />
  38. <view style='padding:10px;' class='flex bottom-btn'>
  39. <u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
  40. <u-button @click='pass' type="success" class="btn2">通过</u-button>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import helper from '@/common/helper.js';
  46. import {
  47. mapState
  48. } from 'vuex';
  49. export default {
  50. data() {
  51. return {
  52. everyCheck: '',
  53. recordList:[],
  54. getData:{},
  55. }
  56. },
  57. // onReady() {
  58. // this.$refs.uForm.setRules(this.rules);
  59. // },
  60. onBackPress(e) {
  61. if(this.everyCheck){
  62. uni.navigateTo({
  63. url: "/pages/task/my_task"
  64. })
  65. return true;
  66. }
  67. },
  68. onLoad(options) {
  69. this.id = options.id
  70. this.everyCheck = uni.getStorageSync("everyTask")
  71. this.count=0
  72. this.getList()
  73. },
  74. computed: {
  75. ...mapState(['hasLogin', 'userInfo']),
  76. },
  77. methods: {
  78. getList() {
  79. this.$api.doRequest('get', '/collectionWarehousingRecord/getCollectionWarehousingRecord', {
  80. id: this.id
  81. }).then(res => {
  82. if (res.data.code == 200) {
  83. this.getData = res.data.data
  84. this.$api.doRequest('get', '/collectionWarehousingRecord/selectCollectionWarehousingRecordPage', {
  85. searchType: 2,
  86. compId: this.getData.compId,
  87. contractNo: this.getData.contractNo,
  88. currentPage: 1,
  89. pageSize: 999,
  90. }).then(res => {
  91. if (res.data.code == 200) {
  92. this.recordList = res.data.data.records
  93. }
  94. })
  95. }
  96. })
  97. },
  98. close() {
  99. this.show1 = false
  100. },
  101. pass() {
  102. this.show1 = true
  103. this.title = '审核意见(通过)'
  104. },
  105. reject() {
  106. this.show1 = true
  107. this.title = '驳回原因(驳回)'
  108. },
  109. passSubmit() {
  110. var that = this
  111. if (this.title == '驳回原因(驳回)') {
  112. this.rejectSubmit()
  113. } else {
  114. let that = this
  115. that.show = false
  116. uni.showModal({
  117. content: "是否确定通过?",
  118. showCancel: true,
  119. confirmText: '确定',
  120. success: function(res) {
  121. if (res.confirm) {
  122. that.OutList.inOutFlag = 1
  123. that.EnterList.inOutFlag = 2
  124. if (that.OutList.taskTypeKey == 1) {
  125. that.requestadd(that.OutList)
  126. } else if (that.EnterList.taskTypeKey == 2) {
  127. that.requestadd(that.EnterList)
  128. } else if (
  129. that.OutList.taskTypeKey == 3 ||
  130. that.OutList.taskTypeKey == 4
  131. ) {
  132. that.requestadd(that.OutList, 'repetition')
  133. if (!that.deletetask) {
  134. that.requestadd(that.EnterList, 'repetition')
  135. }
  136. }
  137. if (that.retreatList.taskTypeKey == 1 || that.retreatList.taskTypeKey == 2) {
  138. that.requestadd(that.retreatList)
  139. } else if (that.retreatList.taskTypeKey == 3 || that.retreatList.taskTypeKey ==
  140. 4) {
  141. that.requestadd(that.retreatList, 'repetition')
  142. }
  143. }
  144. }
  145. })
  146. }
  147. },
  148. rejectSubmit() {
  149. // (1出库2入库3移库4退库并出库)
  150. if (!this.auditMind) {
  151. this.$api.msg('驳回原因不能为空!')
  152. } else {
  153. this.show = false
  154. let that = this
  155. uni.showModal({
  156. content: "是否确定驳回?",
  157. showCancel: true,
  158. confirmText: '确定',
  159. success: function(res) {
  160. if (res.confirm) {
  161. if (that.OutList.taskTypeKey == 1) {
  162. that.requestaudit(that.OutList)
  163. } else if (that.OutList.taskTypeKey == 2) {
  164. that.requestaudit(that.OutList)
  165. } else if (
  166. that.OutList.taskTypeKey == 3 ||
  167. that.OutList.taskTypeKey == 4
  168. ) {
  169. that.requestaudit(that.OutList, 'repetition')
  170. if (!that.deletetask) {
  171. that.requestaudit(that.OutList, 'repetition')
  172. }
  173. }
  174. if (that.EnterList.taskTypeKey) {
  175. if (that.EnterList.taskTypeKey == 1 || that.EnterList.taskTypeKey == 2) {
  176. that.requestaudit(that.EnterList)
  177. } else if (that.EnterList.taskTypeKey == 3 || that.EnterList.taskTypeKey ==
  178. 4) {
  179. that.requestaudit(that.EnterList, 'repetition')
  180. }
  181. }
  182. if (that.retreatList.taskTypeKey) {
  183. if (that.retreatList.taskTypeKey == 1 || that.retreatList.taskTypeKey ==
  184. 2) {
  185. that.requestaudit(that.retreatList)
  186. } else if (that.retreatList.taskTypeKey == 3 || that.retreatList
  187. .taskTypeKey == 4) {
  188. that.requestaudit(that.retreatList, 'repetition')
  189. }
  190. }
  191. }
  192. }
  193. })
  194. }
  195. },
  196. requestadd(list, status) {
  197. let that = this
  198. uni.getStorage({
  199. key: 'pcUserInfo',
  200. success(e) {
  201. list.compId = e.data.compId //这就是你想要取的token
  202. uni.showLoading({
  203. title: "审核中"
  204. })
  205. that.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(
  206. res => {
  207. if (res.data.code == 200) {
  208. that.$api.doRequest('post', '/workflow/api/handle', {
  209. taskId: list.taskId,
  210. approved: true,
  211. auditMind: that.auditMind,
  212. needReapply: false
  213. }).then(res => {
  214. if (res.data.code == 200) {
  215. that.$api.msg('审核成功!')
  216. that.count++
  217. if (that.everyCheck) {
  218. helper.setAudit(that.list)
  219. }
  220. } else {
  221. that.$api.msg('审核失败!')
  222. }
  223. if(list.taskTypeKey == '3' || list.taskTypeKey == '4'){
  224. if(that.count == 2){
  225. setTimeout(function() {
  226. uni.hideLoading()
  227. uni.navigateBack()
  228. }, 1000);
  229. }
  230. }else{
  231. setTimeout(function() {
  232. uni.hideLoading()
  233. uni.navigateBack()
  234. }, 1000);
  235. }
  236. }).catch(res => {
  237. uni.hideLoading()
  238. if (res.message) {
  239. uni.showToast({
  240. title: res.message,
  241. icon: 'none',
  242. duration: 2000
  243. })
  244. } else {
  245. uni.showToast({
  246. title: "系统异常,请联系管理员",
  247. icon: 'none',
  248. duration: 2000
  249. })
  250. }
  251. })
  252. } else {
  253. that.$api.msg('审核失败!')
  254. }
  255. }).catch(res => {
  256. uni.hideLoading()
  257. if (res.message) {
  258. uni.showToast({
  259. title: res.message,
  260. icon: 'none',
  261. duration: 2000
  262. })
  263. } else {
  264. uni.showToast({
  265. title: "系统异常,请联系管理员",
  266. icon: 'none',
  267. duration: 2000
  268. })
  269. }
  270. })
  271. }
  272. })
  273. // list.publisher = this.userInfo.userName
  274. },
  275. requestaudit(list, status) {
  276. uni.showLoading({
  277. title: "审核中"
  278. })
  279. list.compId = '2710b21efc1e4393930c5dc800010dc4'
  280. // list.publisher = this.userInfo.userName
  281. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  282. if (res.data.code == 200) {
  283. this.$api.doRequest('post', '/workflow/api/handle', {
  284. taskId: list.taskId,
  285. approved: false,
  286. auditMind: this.auditMind,
  287. needReapply: true
  288. }).then(res => {
  289. if (res.data.code == 200) {
  290. this.$api.msg('驳回成功!')
  291. this.count++
  292. if (this.everyCheck) {
  293. helper.setAudit(this.list)
  294. }
  295. uni.hideLoading()
  296. if(list.taskTypeKey == '3' || list.taskTypeKey == '4'){
  297. if(this.count == 2){
  298. setTimeout(function() {
  299. uni.hideLoading()
  300. uni.navigateBack()
  301. }, 1000);
  302. }
  303. }else{
  304. setTimeout(function() {
  305. uni.hideLoading()
  306. uni.navigateBack()
  307. }, 1000);
  308. }
  309. }else{
  310. this.$api.msg('驳回失败!')
  311. }
  312. })
  313. }
  314. })
  315. },
  316. check() {
  317. // (1出库2入库3移库4退库并出库)taskTypeKey
  318. if (this.OutList.taskTypeKey == 1 || this.OutList.taskTypeKey == 3) {
  319. if (!this.OutList.grade) {
  320. this.$api.msg('品级不能为空')
  321. return
  322. }
  323. if (!this.OutList.bulkDensity) {
  324. this.$api.msg('容重不能为空')
  325. return
  326. }
  327. if (this.OutList.bulkDensity < 500 || this.OutList.bulkDensity > 1000) {
  328. this.$api.msg('容重输入错误')
  329. return
  330. }
  331. if (String(this.OutList.bulkDensity).indexOf('.') != -1 && String(this.OutList.bulkDensity).length - (
  332. String(this.OutList.bulkDensity).indexOf('.') + 1) > 0) {
  333. this.$api.msg('容重输入错误')
  334. return
  335. }
  336. if (!this.OutList.waterContent) {
  337. this.$api.msg('水分不能为空')
  338. return
  339. }
  340. if (isNaN(this.OutList.waterContent) ||
  341. (String(this.OutList.waterContent).indexOf('.') != -1 &&
  342. String(this.OutList.waterContent).length -
  343. (String(this.OutList.waterContent).indexOf('.') + 1) >
  344. 2) ||
  345. this.OutList.waterContent < 1 ||
  346. this.OutList.waterContent > 40
  347. ) {
  348. this.$api.msg('水分输入错误!')
  349. return
  350. }
  351. if (!this.OutList.unitPrice) {
  352. this.$api.msg('单价不能为空')
  353. return
  354. }
  355. if (isNaN(this.OutList.unitPrice) ||
  356. (String(this.OutList.unitPrice).indexOf('.') != -1 &&
  357. String(this.OutList.unitPrice).length -
  358. (String(this.OutList.unitPrice).indexOf('.') + 1) >
  359. 2) ||
  360. this.OutList.unitPrice < 1 ||
  361. this.OutList.unitPrice > 10000
  362. ) {
  363. this.$api.msg('单价输入错误!')
  364. return
  365. }
  366. }
  367. if (this.OutList.taskTypeKey == 1) {
  368. if (!this.OutList.businessDescribe) {
  369. this.$api.msg('业务描述不能为空')
  370. return
  371. }
  372. if (this.OutList.businessDescribe.length > 150) {
  373. this.$api.msg('业务描述长度错误')
  374. return
  375. }
  376. }
  377. if (this.EnterList.taskTypeKey == 2 && this.EnterList.judge) {
  378. if (!this.EnterList.grade) {
  379. this.$api.msg('品级不能为空')
  380. return
  381. }
  382. if (!this.EnterList.bulkDensity) {
  383. this.$api.msg('容重不能为空')
  384. return
  385. }
  386. if (this.EnterList.bulkDensity < 500 || this.EnterList.bulkDensity > 1000) {
  387. this.$api.msg('容重输入错误')
  388. return
  389. }
  390. if (String(this.EnterList.bulkDensity).indexOf('.') != -1 && String(this.EnterList.bulkDensity)
  391. .length - (
  392. String(this.EnterList.bulkDensity).indexOf('.') + 1) > 0) {
  393. this.$api.msg('容重输入错误')
  394. return
  395. }
  396. if (!this.EnterList.waterContent) {
  397. this.$api.msg('水分不能为空')
  398. return
  399. }
  400. if (isNaN(this.EnterList.waterContent) ||
  401. (String(this.EnterList.waterContent).indexOf('.') != -1 &&
  402. String(this.EnterList.waterContent).length -
  403. (String(this.EnterList.waterContent).indexOf('.') + 1) >
  404. 2) ||
  405. this.EnterList.waterContent < 1 ||
  406. this.EnterList.waterContent > 40
  407. ) {
  408. this.$api.msg('水分输入错误!')
  409. return
  410. }
  411. if (!this.EnterList.unitPrice) {
  412. this.$api.msg('单价不能为空')
  413. return
  414. }
  415. if (isNaN(this.EnterList.unitPrice) ||
  416. (String(this.EnterList.unitPrice).indexOf('.') != -1 &&
  417. String(this.EnterList.unitPrice).length -
  418. (String(this.EnterList.unitPrice).indexOf('.') + 1) >
  419. 2) ||
  420. this.EnterList.unitPrice < 1 ||
  421. this.EnterList.unitPrice > 10000
  422. ) {
  423. this.$api.msg('单价输入错误!')
  424. return
  425. }
  426. if (!this.EnterList.businessDescribe) {
  427. this.$api.msg('业务描述不能为空')
  428. return
  429. }
  430. if (this.EnterList.businessDescribe.length > 150) {
  431. this.$api.msg('业务描述长度错误')
  432. return
  433. }
  434. }
  435. if (this.OutList.taskTypeKey == 3) {
  436. if (!this.EnterList.businessDescribe) {
  437. this.$api.msg('业务描述不能为空')
  438. return
  439. }
  440. if (this.EnterList.businessDescribe.length > 150) {
  441. this.$api.msg('业务描述长度错误')
  442. return
  443. }
  444. }
  445. if (this.retreatList.taskTypeKey == 4 && this.retreatList.judge) {
  446. if (!this.retreatList.grade) {
  447. this.$api.msg('品级不能为空')
  448. return
  449. }
  450. if (!this.retreatList.bulkDensity) {
  451. this.$api.msg('容重不能为空')
  452. return
  453. }
  454. if (this.retreatList.bulkDensity < 500 || this.retreatList.bulkDensity > 1000) {
  455. this.$api.msg('容重输入错误')
  456. return
  457. }
  458. if (String(this.retreatList.bulkDensity).indexOf('.') != -1 && String(this.retreatList.bulkDensity)
  459. .length - (
  460. String(this.retreatList.bulkDensity).indexOf('.') + 1) > 0) {
  461. this.$api.msg('容重输入错误')
  462. return
  463. }
  464. if (!this.retreatList.waterContent) {
  465. this.$api.msg('水分不能为空')
  466. return
  467. }
  468. if (isNaN(this.retreatList.waterContent) ||
  469. (String(this.retreatList.waterContent).indexOf('.') != -1 &&
  470. String(this.retreatList.waterContent).length -
  471. (String(this.retreatList.waterContent).indexOf('.') + 1) >
  472. 2) ||
  473. this.retreatList.waterContent < 1 ||
  474. this.retreatList.waterContent > 40
  475. ) {
  476. this.$api.msg('水分输入错误!')
  477. return
  478. }
  479. if (!this.retreatList.unitPrice) {
  480. this.$api.msg('单价不能为空')
  481. return
  482. }
  483. if (isNaN(this.retreatList.unitPrice) ||
  484. (String(this.retreatList.unitPrice).indexOf('.') != -1 &&
  485. String(this.retreatList.unitPrice).length -
  486. (String(this.retreatList.unitPrice).indexOf('.') + 1) >
  487. 2) ||
  488. this.retreatList.unitPrice < 1 ||
  489. this.retreatList.unitPrice > 10000
  490. ) {
  491. this.$api.msg('单价输入错误!')
  492. return
  493. }
  494. if (!this.EnterList.businessDescribe) {
  495. this.$api.msg('业务描述不能为空')
  496. return
  497. }
  498. if (this.EnterList.businessDescribe.length > 150) {
  499. this.$api.msg('业务描述长度错误')
  500. return
  501. }
  502. }
  503. }
  504. }
  505. }
  506. </script>
  507. <style scoped lang="scss">
  508. .content1 {
  509. margin: 10rpx;
  510. padding-bottom: 224rpx;
  511. .title {
  512. height: 70rpx;
  513. line-height: 60rpx;
  514. font-size: 32rpx;
  515. font-weight: 600;
  516. color: #333333;
  517. border-bottom: 2rpx solid #EEEEEE;
  518. }
  519. }
  520. .uForm {
  521. padding: 0 40rpx;
  522. }
  523. .u-form-item {
  524. padding: 0;
  525. }
  526. .bottom-btn {
  527. width: 100%;
  528. position: fixed;
  529. bottom: 0;
  530. display: flex;
  531. z-index: 2;
  532. left: 0;
  533. background-color: #f8f8f8;
  534. flex-direction: column;
  535. .btn1,
  536. .btn2 {
  537. width: 100%;
  538. margin-bottom: 26rpx;
  539. border-radius: 90rpx;
  540. }
  541. .btn1 {
  542. background: white;
  543. color: #00C265;
  544. }
  545. }
  546. .submit {
  547. width: 50%;
  548. background: #22C572;
  549. border-radius: 10rpx;
  550. }
  551. .part2 {
  552. margin-top: 20rpx;
  553. }
  554. .textarea {
  555. border: 1px solid #ccc;
  556. border-radius: 10rpx;
  557. background-color: #F9F9FA;
  558. height: 100px;
  559. }
  560. .row {
  561. display: flex;
  562. justify-content: space-between;
  563. // border-bottom: 1px solid #EEEEEE;
  564. padding: 21rpx 0;
  565. .right,
  566. input {
  567. font-size: 28rpx;
  568. color: #333333;
  569. }
  570. }
  571. //弹出框
  572. // .popup {
  573. // padding: 30rpx;
  574. // border-radius: 20rpx;
  575. // }
  576. // .rejectInfoCss {
  577. // border: 1px solid #ccc;
  578. // border-radius: 10rpx;
  579. // background-color: #F9F9FA;
  580. // margin: 30rpx;
  581. // overflow-y: auto;
  582. // // height: 300rpx;
  583. // background: red;
  584. // }
  585. .uForm_item {
  586. padding: 20rpx;
  587. background-color: #FFFFFF;
  588. margin: 20rpx;
  589. border-radius: 20rpx;
  590. }
  591. .rejectText {
  592. text-align: center;
  593. }
  594. .topInfo {
  595. height: 210rpx;
  596. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  597. padding: 30rpx;
  598. .topInfo-item {
  599. height: 150rpx;
  600. background-color: #FFFFFF;
  601. border-radius: 20rpx;
  602. padding: 40rpx;
  603. .logo {
  604. width: 40rpx;
  605. height: 40rpx;
  606. margin-top: 8rpx;
  607. }
  608. .infoText {
  609. font-size: 36rpx;
  610. font-weight: 600;
  611. margin-left: 20rpx;
  612. }
  613. .infoData {
  614. color: #878C9C;
  615. font-size: 26rpx;
  616. margin-top: 10rpx;
  617. }
  618. }
  619. }
  620. .shade {
  621. position: fixed;
  622. top: 0;
  623. left: 0;
  624. height: 100%;
  625. width: 100%;
  626. background: rgba(0, 0, 0, 0.4);
  627. z-index: 3;
  628. .wrap {
  629. position: absolute;
  630. left: 0;
  631. top: 0;
  632. right: 0;
  633. bottom: 0;
  634. margin: auto;
  635. background: #fff;
  636. width: calc(100% - 198rpx);
  637. height: 700rpx;
  638. border-radius: 20rpx;
  639. .alert-top {
  640. padding: 33rpx;
  641. display: flex;
  642. justify-content: center;
  643. align-items: center;
  644. position: relative;
  645. }
  646. .title {
  647. font-size: 32rpx;
  648. font-weight: 600;
  649. color: #333333;
  650. }
  651. .close {
  652. position: absolute;
  653. right: 33rpx;
  654. }
  655. }
  656. }
  657. .cancel,
  658. .confirm {
  659. position: absolute;
  660. display: inline-block;
  661. width: 50%;
  662. text-align: center;
  663. bottom: 0;
  664. padding: 10px;
  665. border-top: 1px solid #eee;
  666. font-size: 34rpx;
  667. }
  668. .cancel {
  669. left: 0;
  670. border-right: 1px solid #eee;
  671. color: #AFB3BF;
  672. }
  673. .confirm {
  674. right: 0;
  675. color: #22C572;
  676. }
  677. .u-textarea-style {
  678. margin: 20rpx;
  679. background: #F9F9FA;
  680. border-radius: 10px;
  681. border: 1px solid #EEEEEE;
  682. padding: 10rpx 20rpx;
  683. position: relative;
  684. .right-bottom {
  685. position: absolute;
  686. right: 20rpx;
  687. bottom: 20rpx;
  688. color: #AFB3BF;
  689. }
  690. }
  691. /deep/.u-input__textarea {
  692. height: 300rpx !important;
  693. }
  694. </style>