purchase_settlement_approval.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <view class="top">
  5. <view>合同编号</view>
  6. <view>{{contractNo}}</view>
  7. </view>
  8. <view class="car-container" v-for="(item,index) in list">
  9. <view class="car-num title">{{item.carNo}}({{item.tranCarNo}})</view>
  10. <view class="car-type-item">
  11. <view class="left">净重</view>
  12. <view class="left">{{item.netWeight}}吨</view>
  13. </view>
  14. <view class="car-type-item">
  15. <view class="left">结重</view>
  16. <view class="left">120.4{{item.settlementWeight}}吨</view>
  17. </view>
  18. <view class="car-type-item">
  19. <view class="left">扣款</view>
  20. <view class="left">{{item.deductionAmountchange}}元/吨</view>
  21. </view>
  22. <view class="car-type-item">
  23. <view class="left">应付</view>
  24. <view class="left">{{item.amountIngPayable}}元</view>
  25. </view>
  26. </view>
  27. </view>
  28. <u-toast ref="uToast" />
  29. <view class="bottom-btn">
  30. <u-button type="primary" class="submit" hover-class="none" @click="rejectSubmit()">驳回</u-button>
  31. <u-button type="primary" class="submit" hover-class="none" @click="passSubmit()">通过</u-button>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. id: "",
  40. currentPage:1,
  41. pageSize:10,
  42. list:[],
  43. contractNo:"",
  44. }
  45. },
  46. onLoad(options) {
  47. this.id = options.id
  48. this.getList()
  49. },
  50. methods: {
  51. getList(id) {
  52. this.$api.doRequest('get', '/stockPurchaseReceiptReport/getInfo', {
  53. id: this.id
  54. }).then(res => {
  55. this.contractNo = res.data.data.contractNo
  56. if (res.data.code == 200) {
  57. this.$api.doRequest('get', '/stockPurchaseReceiptReport/selectPurchaseOrder', {
  58. compId: "2710b21efc1e4393930c5dc800010dc4",
  59. currentPage: this.currentPage,
  60. pageSize: this.pageSize,
  61. contractNo: this.contractNo,
  62. }).then(res => {
  63. if (res.data.code == 200) {
  64. this.list = res.data.data.records
  65. }
  66. })
  67. }
  68. })
  69. },
  70. //驳回
  71. rejectSubmit(){
  72. var that = this
  73. if (this.list.length == 0) {
  74. that.$api.msg('没有要审核的条目!')
  75. } else {
  76. // uni.showModal({
  77. // content: "是否确定驳回?",
  78. // success(res) {
  79. // if(res)
  80. // this.audit(this.list[0], 0, false, true, '已驳回')
  81. // }
  82. // })
  83. uni.showModal({
  84. content: "是否确定驳回?",
  85. showCancel: true,
  86. confirmText: '确定',
  87. success: function(res) {
  88. if (res.confirm) {
  89. that.audit(that.list[0], 0, false, true, '已驳回')
  90. }}})
  91. }
  92. },
  93. //通过
  94. passSubmit(){
  95. var that = this
  96. if (this.list.length == 0) {
  97. that.$api.msg('没有要审核的条目!')
  98. } else {
  99. // uni.showModal({
  100. // content: "是否确定通过?",
  101. // success(res) {
  102. // if(res)
  103. // this.audit(this.list[0], 0, true, 2)
  104. // }
  105. // })
  106. uni.showModal({
  107. content: "是否确定通过?",
  108. showCancel: true,
  109. confirmText: '确定',
  110. success: function(res) {
  111. if (res.confirm) {
  112. that.audit(that.list[0], 0, true, 2)
  113. }}})
  114. }
  115. },
  116. //审核方法
  117. audit(item, index, status, status2, reason) {
  118. if (index < this.list.length) {
  119. this.$api.doRequest('post', '/workflow/api/handle', {
  120. taskId: item.taskId,
  121. approved: status,
  122. auditMind: reason != undefined ? '已驳回' : '34',
  123. needReapply: status2 != undefined ? true : false,
  124. }).then(res => {
  125. this.audit(this.list[index + 1], index + 1, status)
  126. })
  127. } else {
  128. if (status == true) {
  129. that.$api.msg('通过成功')
  130. this.getList()
  131. } else if (status == false) {
  132. that.$api.msg('驳回成功')
  133. this.getList()
  134. }
  135. }
  136. },
  137. }
  138. }
  139. </script>
  140. <style scoped lang="scss">
  141. .container {
  142. margin: 10rpx;
  143. padding: 20rpx 20rpx 140rpx 20rpx;
  144. border-radius: 20rpx;
  145. background: white;
  146. }
  147. .content {
  148. .top {
  149. display: flex;
  150. justify-content: space-between;
  151. }
  152. .title {
  153. font-size: 28rpx;
  154. font-weight: 600;
  155. color: #333333;
  156. text-align: left;
  157. }
  158. .car-type-item {
  159. display: inline-flex;
  160. // justify-content: center;
  161. width: 50%;
  162. }
  163. }
  164. .bottom-btn {
  165. width: 92%;
  166. position: fixed;
  167. bottom: 40rpx;
  168. display: flex;
  169. z-index: 2;
  170. }
  171. .submit {
  172. width: 40%;
  173. background: #22C572;
  174. border-radius: 10rpx;
  175. }
  176. </style>