freight_settlement_approval.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="container">
  3. <view class="content">
  4. <view class="top">
  5. <view>合同编号</view>
  6. <view>123456796</view>
  7. </view>
  8. <view class="car-container">
  9. <view v-for="(item,index) in list" style="border-bottom: 2rpx solid #EEEEEE;margin-top: 30rpx;">
  10. <view class="car-num title">{{item.carNo}} ({{item.tranCarNo}})</view>
  11. <view class="car-type-item">
  12. <view class="left">装</view>
  13. <view class="textInfo">{{item.loadingWeight}}吨</view>
  14. </view>
  15. <view class="car-type-item">
  16. <view class="center">卸</view>
  17. <view class="textInfo">{{item.unloadingWeight}}吨</view>
  18. </view>
  19. <view class="car-type-item">
  20. <view class="right">结</view>
  21. <view class="textInfo">{{item.settlementWeightchange}}吨</view>
  22. </view>
  23. <view class="car-type-item">
  24. <view class="left">运</view>
  25. <view class="textInfo">{{item.transportPrice}}元/吨</view>
  26. </view>
  27. <view class="car-type-item">
  28. <view class="center">扣</view>
  29. <view class="textInfo">{{item.deductionAmountchange}}元</view>
  30. </view>
  31. <view class="car-type-item">
  32. <view class="right">付</view>
  33. <view class="textInfo">{{item.amountEdPayable}}元</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <u-toast ref="uToast" />
  39. <view style='padding:10px;' class='flex bottom-btn'>
  40. <u-button @click="rejectSubmit()" type="error" class="btn1">驳回</u-button>
  41. <u-button @click="passSubmit()" type="success" class="btn2">通过</u-button>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. currentPage: 1,
  50. pageSize: 10,
  51. list: [],
  52. }
  53. },
  54. onLoad() {
  55. this.getList()
  56. },
  57. methods: {
  58. getList() {
  59. this.$api.doRequest('get', '/tranSettlementReport/selectTranSettlementReport', {
  60. compId: "2710b21efc1e4393930c5dc800010dc4",
  61. currentPage: this.currentPage,
  62. pageSize: this.pageSize,
  63. contractNo: "全部合同"
  64. }).then(res => {
  65. if (res.data.code == 200) {
  66. this.list = res.data.data.records
  67. }
  68. })
  69. },
  70. // 驳回
  71. rejectSubmit() {
  72. var that = this
  73. if (this.list.length == 0) {
  74. this.$api.msg('没有要审核的条目!')
  75. } else {
  76. uni.showModal({
  77. content: "是否确定驳回?",
  78. showCancel: true,
  79. confirmText: '确定',
  80. success: function(res) {
  81. if (res.confirm) {
  82. that.audit(that.list[0], 0, false, true, '已驳回')
  83. }
  84. }
  85. })
  86. }
  87. },
  88. //通过
  89. passSubmit() {
  90. var that = this
  91. if (this.list.length == 0) {
  92. this.$api.msg('没有要审核的条目!')
  93. } else {
  94. uni.showModal({
  95. content: "是否确定通过?",
  96. showCancel: true,
  97. confirmText: '确定',
  98. success: function(res) {
  99. if (res.confirm) {
  100. that.audit(that.list[0], 0, true, 2)
  101. }
  102. }
  103. })
  104. }
  105. },
  106. //审核方法
  107. audit(item, index, status, status2, reason) {
  108. if (index < this.list.length) {
  109. this.$api.doRequest('post', '/workflow/api/handle', {
  110. taskId: item.taskId,
  111. approved: status,
  112. auditMind: reason != undefined ? '已驳回' : '34',
  113. needReapply: status2 != undefined ? true : false,
  114. }).then(res => {
  115. this.audit(this.list[index + 1], index + 1, status)
  116. })
  117. } else {
  118. if (status == true) {
  119. that.$api.msg('通过成功')
  120. this.getList()
  121. } else if (status == false) {
  122. that.$api.msg('驳回成功')
  123. this.getList()
  124. }
  125. }
  126. },
  127. }
  128. }
  129. </script>
  130. <style scoped lang="scss">
  131. .container {
  132. margin: 10rpx;
  133. padding: 20rpx 20rpx 140rpx 20rpx;
  134. // border-radius: 20rpx;
  135. // background: white;
  136. }
  137. .content {
  138. .top {
  139. display: flex;
  140. justify-content: space-between;
  141. border-radius: 20rpx;
  142. background: white;
  143. padding: 30rpx 20rpx;
  144. font-size: 36rpx;
  145. }
  146. .title {
  147. font-size: 28rpx;
  148. font-weight: 600;
  149. color: #333333;
  150. text-align: left;
  151. margin-bottom: 30rpx;
  152. }
  153. .car-container{
  154. padding: 10rpx 20rpx;
  155. border-radius: 20rpx;
  156. background: white;
  157. margin:30rpx 0 ;
  158. // border-bottom: 2rpx solid #EEEEEE;
  159. }
  160. .car-type-item {
  161. display: inline-flex;
  162. // justify-content: center;
  163. width: 33.33%;
  164. margin-bottom: 40rpx ;
  165. }
  166. .title{
  167. font-size: 36rpx;
  168. }
  169. }
  170. .bottom-btn {
  171. width: 100%;
  172. position: fixed;
  173. bottom:0;
  174. display: flex;
  175. z-index: 2;
  176. left: 0;
  177. background-color: #f8f8f8;
  178. flex-direction: column;
  179. .btn1,.btn2{
  180. width: 100%;
  181. margin-bottom: 26rpx;
  182. border-radius: 90rpx;
  183. }
  184. .btn1{
  185. background: white;
  186. color: #00C265;
  187. }
  188. }
  189. .submit {
  190. width: 40%;
  191. background: #22C572;
  192. border-radius: 10rpx;
  193. }
  194. .left{
  195. background: #FEECE6;
  196. color: #FE6430;
  197. }
  198. .center{
  199. background: #EBEEFA;
  200. color: #5C76DF;
  201. }
  202. .right{
  203. background: #E9F8F0 ;
  204. color: #22C572 ;
  205. }
  206. .left,.center,.right{
  207. width: 50rpx;
  208. height: 50rpx;
  209. text-align: center;
  210. line-height: 50rpx;
  211. border-radius: 10rpx;
  212. }
  213. .textInfo{
  214. margin: 6rpx 0 0 10rpx;
  215. }
  216. </style>