collection_business_approval.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  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', '/newWorkflow/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. let pcUserInfo = uni.getStorageSync('pcUserInfo')
  280. if(pcUserInfo){
  281. list.compId = pcUserInfo.compId
  282. }
  283. else{
  284. list.compId = '2710b21efc1e4393930c5dc800010dc4'
  285. }
  286. // list.compId = '2710b21efc1e4393930c5dc800010dc4'
  287. // list.publisher = this.userInfo.userName
  288. this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
  289. if (res.data.code == 200) {
  290. this.$api.doRequest('post', '/newWorkflow/api/handle', {
  291. taskId: list.taskId,
  292. approved: false,
  293. auditMind: this.auditMind,
  294. needReapply: true
  295. }).then(res => {
  296. if (res.data.code == 200) {
  297. this.$api.msg('驳回成功!')
  298. this.count++
  299. if (this.everyCheck) {
  300. helper.setAudit(this.list)
  301. }
  302. uni.hideLoading()
  303. if(list.taskTypeKey == '3' || list.taskTypeKey == '4'){
  304. if(this.count == 2){
  305. setTimeout(function() {
  306. uni.hideLoading()
  307. uni.navigateBack()
  308. }, 1000);
  309. }
  310. }else{
  311. setTimeout(function() {
  312. uni.hideLoading()
  313. uni.navigateBack()
  314. }, 1000);
  315. }
  316. }else{
  317. this.$api.msg('驳回失败!')
  318. }
  319. })
  320. }
  321. })
  322. },
  323. check() {
  324. // (1出库2入库3移库4退库并出库)taskTypeKey
  325. if (this.OutList.taskTypeKey == 1 || this.OutList.taskTypeKey == 3) {
  326. if (!this.OutList.grade) {
  327. this.$api.msg('品级不能为空')
  328. return
  329. }
  330. if (!this.OutList.bulkDensity) {
  331. this.$api.msg('容重不能为空')
  332. return
  333. }
  334. if (this.OutList.bulkDensity < 500 || this.OutList.bulkDensity > 1000) {
  335. this.$api.msg('容重输入错误')
  336. return
  337. }
  338. if (String(this.OutList.bulkDensity).indexOf('.') != -1 && String(this.OutList.bulkDensity).length - (
  339. String(this.OutList.bulkDensity).indexOf('.') + 1) > 0) {
  340. this.$api.msg('容重输入错误')
  341. return
  342. }
  343. if (!this.OutList.waterContent) {
  344. this.$api.msg('水分不能为空')
  345. return
  346. }
  347. if (isNaN(this.OutList.waterContent) ||
  348. (String(this.OutList.waterContent).indexOf('.') != -1 &&
  349. String(this.OutList.waterContent).length -
  350. (String(this.OutList.waterContent).indexOf('.') + 1) >
  351. 2) ||
  352. this.OutList.waterContent < 1 ||
  353. this.OutList.waterContent > 40
  354. ) {
  355. this.$api.msg('水分输入错误!')
  356. return
  357. }
  358. if (!this.OutList.unitPrice) {
  359. this.$api.msg('单价不能为空')
  360. return
  361. }
  362. if (isNaN(this.OutList.unitPrice) ||
  363. (String(this.OutList.unitPrice).indexOf('.') != -1 &&
  364. String(this.OutList.unitPrice).length -
  365. (String(this.OutList.unitPrice).indexOf('.') + 1) >
  366. 2) ||
  367. this.OutList.unitPrice < 1 ||
  368. this.OutList.unitPrice > 10000
  369. ) {
  370. this.$api.msg('单价输入错误!')
  371. return
  372. }
  373. }
  374. if (this.OutList.taskTypeKey == 1) {
  375. if (!this.OutList.businessDescribe) {
  376. this.$api.msg('业务描述不能为空')
  377. return
  378. }
  379. if (this.OutList.businessDescribe.length > 150) {
  380. this.$api.msg('业务描述长度错误')
  381. return
  382. }
  383. }
  384. if (this.EnterList.taskTypeKey == 2 && this.EnterList.judge) {
  385. if (!this.EnterList.grade) {
  386. this.$api.msg('品级不能为空')
  387. return
  388. }
  389. if (!this.EnterList.bulkDensity) {
  390. this.$api.msg('容重不能为空')
  391. return
  392. }
  393. if (this.EnterList.bulkDensity < 500 || this.EnterList.bulkDensity > 1000) {
  394. this.$api.msg('容重输入错误')
  395. return
  396. }
  397. if (String(this.EnterList.bulkDensity).indexOf('.') != -1 && String(this.EnterList.bulkDensity)
  398. .length - (
  399. String(this.EnterList.bulkDensity).indexOf('.') + 1) > 0) {
  400. this.$api.msg('容重输入错误')
  401. return
  402. }
  403. if (!this.EnterList.waterContent) {
  404. this.$api.msg('水分不能为空')
  405. return
  406. }
  407. if (isNaN(this.EnterList.waterContent) ||
  408. (String(this.EnterList.waterContent).indexOf('.') != -1 &&
  409. String(this.EnterList.waterContent).length -
  410. (String(this.EnterList.waterContent).indexOf('.') + 1) >
  411. 2) ||
  412. this.EnterList.waterContent < 1 ||
  413. this.EnterList.waterContent > 40
  414. ) {
  415. this.$api.msg('水分输入错误!')
  416. return
  417. }
  418. if (!this.EnterList.unitPrice) {
  419. this.$api.msg('单价不能为空')
  420. return
  421. }
  422. if (isNaN(this.EnterList.unitPrice) ||
  423. (String(this.EnterList.unitPrice).indexOf('.') != -1 &&
  424. String(this.EnterList.unitPrice).length -
  425. (String(this.EnterList.unitPrice).indexOf('.') + 1) >
  426. 2) ||
  427. this.EnterList.unitPrice < 1 ||
  428. this.EnterList.unitPrice > 10000
  429. ) {
  430. this.$api.msg('单价输入错误!')
  431. return
  432. }
  433. if (!this.EnterList.businessDescribe) {
  434. this.$api.msg('业务描述不能为空')
  435. return
  436. }
  437. if (this.EnterList.businessDescribe.length > 150) {
  438. this.$api.msg('业务描述长度错误')
  439. return
  440. }
  441. }
  442. if (this.OutList.taskTypeKey == 3) {
  443. if (!this.EnterList.businessDescribe) {
  444. this.$api.msg('业务描述不能为空')
  445. return
  446. }
  447. if (this.EnterList.businessDescribe.length > 150) {
  448. this.$api.msg('业务描述长度错误')
  449. return
  450. }
  451. }
  452. if (this.retreatList.taskTypeKey == 4 && this.retreatList.judge) {
  453. if (!this.retreatList.grade) {
  454. this.$api.msg('品级不能为空')
  455. return
  456. }
  457. if (!this.retreatList.bulkDensity) {
  458. this.$api.msg('容重不能为空')
  459. return
  460. }
  461. if (this.retreatList.bulkDensity < 500 || this.retreatList.bulkDensity > 1000) {
  462. this.$api.msg('容重输入错误')
  463. return
  464. }
  465. if (String(this.retreatList.bulkDensity).indexOf('.') != -1 && String(this.retreatList.bulkDensity)
  466. .length - (
  467. String(this.retreatList.bulkDensity).indexOf('.') + 1) > 0) {
  468. this.$api.msg('容重输入错误')
  469. return
  470. }
  471. if (!this.retreatList.waterContent) {
  472. this.$api.msg('水分不能为空')
  473. return
  474. }
  475. if (isNaN(this.retreatList.waterContent) ||
  476. (String(this.retreatList.waterContent).indexOf('.') != -1 &&
  477. String(this.retreatList.waterContent).length -
  478. (String(this.retreatList.waterContent).indexOf('.') + 1) >
  479. 2) ||
  480. this.retreatList.waterContent < 1 ||
  481. this.retreatList.waterContent > 40
  482. ) {
  483. this.$api.msg('水分输入错误!')
  484. return
  485. }
  486. if (!this.retreatList.unitPrice) {
  487. this.$api.msg('单价不能为空')
  488. return
  489. }
  490. if (isNaN(this.retreatList.unitPrice) ||
  491. (String(this.retreatList.unitPrice).indexOf('.') != -1 &&
  492. String(this.retreatList.unitPrice).length -
  493. (String(this.retreatList.unitPrice).indexOf('.') + 1) >
  494. 2) ||
  495. this.retreatList.unitPrice < 1 ||
  496. this.retreatList.unitPrice > 10000
  497. ) {
  498. this.$api.msg('单价输入错误!')
  499. return
  500. }
  501. if (!this.EnterList.businessDescribe) {
  502. this.$api.msg('业务描述不能为空')
  503. return
  504. }
  505. if (this.EnterList.businessDescribe.length > 150) {
  506. this.$api.msg('业务描述长度错误')
  507. return
  508. }
  509. }
  510. }
  511. }
  512. }
  513. </script>
  514. <style scoped lang="scss">
  515. .content1 {
  516. margin: 10rpx;
  517. padding-bottom: 224rpx;
  518. .title {
  519. height: 70rpx;
  520. line-height: 60rpx;
  521. font-size: 32rpx;
  522. font-weight: 600;
  523. color: #333333;
  524. border-bottom: 2rpx solid #EEEEEE;
  525. }
  526. }
  527. .uForm {
  528. padding: 0 40rpx;
  529. }
  530. .u-form-item {
  531. padding: 0;
  532. }
  533. .bottom-btn {
  534. width: 100%;
  535. position: fixed;
  536. bottom: 0;
  537. display: flex;
  538. z-index: 2;
  539. left: 0;
  540. background-color: #f8f8f8;
  541. flex-direction: column;
  542. .btn1,
  543. .btn2 {
  544. width: 100%;
  545. margin-bottom: 26rpx;
  546. border-radius: 90rpx;
  547. }
  548. .btn1 {
  549. background: white;
  550. color: #00C265;
  551. }
  552. }
  553. .submit {
  554. width: 50%;
  555. background: #22C572;
  556. border-radius: 10rpx;
  557. }
  558. .part2 {
  559. margin-top: 20rpx;
  560. }
  561. .textarea {
  562. border: 1px solid #ccc;
  563. border-radius: 10rpx;
  564. background-color: #F9F9FA;
  565. height: 100px;
  566. }
  567. .row {
  568. display: flex;
  569. justify-content: space-between;
  570. // border-bottom: 1px solid #EEEEEE;
  571. padding: 21rpx 0;
  572. .right,
  573. input {
  574. font-size: 28rpx;
  575. color: #333333;
  576. }
  577. }
  578. //弹出框
  579. // .popup {
  580. // padding: 30rpx;
  581. // border-radius: 20rpx;
  582. // }
  583. // .rejectInfoCss {
  584. // border: 1px solid #ccc;
  585. // border-radius: 10rpx;
  586. // background-color: #F9F9FA;
  587. // margin: 30rpx;
  588. // overflow-y: auto;
  589. // // height: 300rpx;
  590. // background: red;
  591. // }
  592. .uForm_item {
  593. padding: 20rpx;
  594. background-color: #FFFFFF;
  595. margin: 20rpx;
  596. border-radius: 20rpx;
  597. }
  598. .rejectText {
  599. text-align: center;
  600. }
  601. .topInfo {
  602. height: 210rpx;
  603. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  604. padding: 30rpx;
  605. .topInfo-item {
  606. height: 150rpx;
  607. background-color: #FFFFFF;
  608. border-radius: 20rpx;
  609. padding: 40rpx;
  610. .logo {
  611. width: 40rpx;
  612. height: 40rpx;
  613. margin-top: 8rpx;
  614. }
  615. .infoText {
  616. font-size: 36rpx;
  617. font-weight: 600;
  618. margin-left: 20rpx;
  619. }
  620. .infoData {
  621. color: #878C9C;
  622. font-size: 26rpx;
  623. margin-top: 10rpx;
  624. }
  625. }
  626. }
  627. .shade {
  628. position: fixed;
  629. top: 0;
  630. left: 0;
  631. height: 100%;
  632. width: 100%;
  633. background: rgba(0, 0, 0, 0.4);
  634. z-index: 3;
  635. .wrap {
  636. position: absolute;
  637. left: 0;
  638. top: 0;
  639. right: 0;
  640. bottom: 0;
  641. margin: auto;
  642. background: #fff;
  643. width: calc(100% - 198rpx);
  644. height: 700rpx;
  645. border-radius: 20rpx;
  646. .alert-top {
  647. padding: 33rpx;
  648. display: flex;
  649. justify-content: center;
  650. align-items: center;
  651. position: relative;
  652. }
  653. .title {
  654. font-size: 32rpx;
  655. font-weight: 600;
  656. color: #333333;
  657. }
  658. .close {
  659. position: absolute;
  660. right: 33rpx;
  661. }
  662. }
  663. }
  664. .cancel,
  665. .confirm {
  666. position: absolute;
  667. display: inline-block;
  668. width: 50%;
  669. text-align: center;
  670. bottom: 0;
  671. padding: 10px;
  672. border-top: 1px solid #eee;
  673. font-size: 34rpx;
  674. }
  675. .cancel {
  676. left: 0;
  677. border-right: 1px solid #eee;
  678. color: #AFB3BF;
  679. }
  680. .confirm {
  681. right: 0;
  682. color: #22C572;
  683. }
  684. .u-textarea-style {
  685. margin: 20rpx;
  686. background: #F9F9FA;
  687. border-radius: 10px;
  688. border: 1px solid #EEEEEE;
  689. padding: 10rpx 20rpx;
  690. position: relative;
  691. .right-bottom {
  692. position: absolute;
  693. right: 20rpx;
  694. bottom: 20rpx;
  695. color: #AFB3BF;
  696. }
  697. }
  698. /deep/.u-input__textarea {
  699. height: 300rpx !important;
  700. }
  701. </style>