freight_settlement_approval.vue 6.1 KB

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