freight_settlement_approval.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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">{{list[0].updateDate}}</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.settlementWeight}}吨</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.deductionAmount}}元</view>
  46. </view>
  47. <view class="car-type-item">
  48. <view class="right">付</view>
  49. <view class="textInfo">{{item.amountIngPayable}}元</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" hover-class='none'>驳回</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. approveStatus:"",
  70. }
  71. ],
  72. }
  73. },
  74. onLoad() {
  75. this.getList()
  76. },
  77. methods: {
  78. getList() {
  79. this.$api.doRequest('get', '/tranSettlementReport/selectTranSettlementReport', {
  80. compId: "2710b21efc1e4393930c5dc800010dc4",
  81. currentPage: this.currentPage,
  82. pageSize: this.pageSize,
  83. contractNo: "全部合同"
  84. }).then(res => {
  85. if (res.data.code == 200) {
  86. this.list = res.data.data.records
  87. }
  88. })
  89. },
  90. // 驳回
  91. rejectSubmit() {
  92. var that = this
  93. if (this.list.length == 0) {
  94. this.$api.msg('没有要审核的条目!')
  95. } else {
  96. uni.showModal({
  97. content: "是否确定驳回?",
  98. showCancel: true,
  99. confirmText: '确定',
  100. success: function(res) {
  101. if (res.confirm) {
  102. that.audit(that.list[0], 0, false, true, '已驳回')
  103. }
  104. }
  105. })
  106. }
  107. },
  108. //通过
  109. passSubmit() {
  110. var that = this
  111. if (this.list.length == 0) {
  112. this.$api.msg('没有要审核的条目!')
  113. } else {
  114. uni.showModal({
  115. content: "是否确定通过?",
  116. showCancel: true,
  117. confirmText: '确定',
  118. success: function(res) {
  119. if (res.confirm) {
  120. that.audit(that.list[0], 0, true, 2)
  121. }
  122. }
  123. })
  124. }
  125. },
  126. //审核方法
  127. audit(item, index, status, status2, reason) {
  128. if (index < this.list.length) {
  129. this.$api.doRequest('post', '/workflow/api/handle', {
  130. taskId: item.taskId,
  131. approved: status,
  132. auditMind: reason != undefined ? '已驳回' : '34',
  133. needReapply: status2 != undefined ? true : false,
  134. }).then(res => {
  135. this.audit(this.list[index + 1], index + 1, status)
  136. })
  137. } else {
  138. if (status == true) {
  139. this.$api.msg('通过成功')
  140. setTimeout(function() {
  141. uni.navigateBack()
  142. }, 1000);
  143. } else if (status == false) {
  144. this.$api.msg('驳回成功')
  145. setTimeout(function() {
  146. uni.navigateBack()
  147. }, 1000);
  148. }
  149. }
  150. },
  151. }
  152. }
  153. </script>
  154. <style scoped lang="scss">
  155. .container {
  156. margin: 10rpx;
  157. padding: 20rpx 20rpx 230rpx 20rpx;
  158. }
  159. .content {
  160. .top {
  161. display: flex;
  162. justify-content: space-between;
  163. border-radius: 20rpx;
  164. background: white;
  165. padding: 30rpx 20rpx;
  166. font-size: 36rpx;
  167. margin-top: 30rpx;
  168. }
  169. .title {
  170. font-size: 28rpx;
  171. font-weight: 600;
  172. color: #333333;
  173. text-align: left;
  174. margin-bottom: 30rpx;
  175. }
  176. .car-container{
  177. padding: 10rpx 20rpx;
  178. border-radius: 20rpx;
  179. background: white;
  180. margin:30rpx 0 ;
  181. // border-bottom: 2rpx solid #EEEEEE;
  182. }
  183. .car-type-item {
  184. display: inline-flex;
  185. // justify-content: center;
  186. width: 33.33%;
  187. margin-bottom: 40rpx ;
  188. }
  189. .title{
  190. font-size: 36rpx;
  191. }
  192. }
  193. .bottom-btn {
  194. width: 100%;
  195. position: fixed;
  196. bottom:0;
  197. display: flex;
  198. z-index: 2;
  199. left: 0;
  200. background-color: #f8f8f8;
  201. flex-direction: column;
  202. .btn1,.btn2{
  203. width: 100%;
  204. margin-bottom: 26rpx;
  205. border-radius: 90rpx;
  206. }
  207. .btn1{
  208. background: white;
  209. color: #00C265;
  210. }
  211. }
  212. .submit {
  213. width: 40%;
  214. background: #22C572;
  215. border-radius: 10rpx;
  216. }
  217. .left{
  218. background: #FEECE6;
  219. color: #FE6430;
  220. }
  221. .center{
  222. background: #EBEEFA;
  223. color: #5C76DF;
  224. }
  225. .right{
  226. background: #E9F8F0 ;
  227. color: #22C572 ;
  228. }
  229. .left,.center,.right{
  230. width: 50rpx;
  231. height: 50rpx;
  232. text-align: center;
  233. line-height: 50rpx;
  234. border-radius: 10rpx;
  235. }
  236. .textInfo{
  237. margin: 6rpx 0 0 10rpx;
  238. }
  239. .topInfo {
  240. height: 210rpx;
  241. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  242. padding: 30rpx;
  243. .topInfo-item {
  244. height: 158rpx;
  245. background-color: #FFFFFF;
  246. border-radius: 20rpx;
  247. padding: 40rpx;
  248. .logo {
  249. width: 40rpx;
  250. height: 40rpx;
  251. margin-top: 8rpx;
  252. }
  253. .infoText {
  254. font-size: 36rpx;
  255. font-weight: 600;
  256. margin-left: 20rpx;
  257. }
  258. .infoData {
  259. color: #878C9C;
  260. font-size: 26rpx;
  261. margin-top: 10rpx;
  262. }
  263. }
  264. }
  265. </style>