look.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view class="container">
  3. <view style='background:#E6F3F9;border-bottom:1px solid #ccc;' class='flex justify-between padding-xl' @click='unfold1()'>
  4. <view style='width:92%;margin-top: -4px;text-align:center;' class='flex justify-between'>
  5. 结算明细
  6. </view>
  7. <view :class="isOpen1 ? 'cuIcon-unfold' : 'cuIcon-right'" ></view>
  8. </view>
  9. <view :class="isOpen1 ? 'content-open' : 'content-close'" class='content1'>
  10. <view class="table u-font-xs">
  11. <view class="tr bg-w">
  12. <view class="th">车牌号</view>
  13. <view class="th">净重(吨)</view>
  14. <view class="th">应收(元)</view>
  15. <view class="th ">已收(元)</view>
  16. <view class="th ">未收(元)</view>
  17. </view>
  18. <view class='tbody'>
  19. <block v-for='(item,index) in contractInfo.taskDTOList' >
  20. <view class="tr" >
  21. <view class="td">{{item.carNo}}</view>
  22. <view class="td">{{item.netWeight}}</view>
  23. <view class="td">{{numFilter(item.sumPrice)}}</view>
  24. <view class="td">{{numFilter(item.sumPrice - item.notPay)}}</view>
  25. <view class="td">{{numFilter(item.notPay)}}</view>
  26. </view>
  27. </block>
  28. <view class="tr" >
  29. <view class="td">合计:</view>
  30. <view class="td">{{contractInfo.sumNet}}</view>
  31. <view class="td">{{numFilter(contractInfo.sumTotal)}}</view>
  32. <view class="td">{{numFilter(contractInfo.payMoney)}}</view>
  33. <view class="td">{{numFilter(contractInfo.notPayMoney)}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- <view class='flex justify-between padding-xs' v-for='item in contractInfo.taskDTOList'>
  38. <view>{{item.carNo}}</view>
  39. <view>{{item.netWeight}}</view>
  40. <view>{{item.sumPrice}}</view>
  41. <view>{{item.sumPrice - item.notPay}}</view>
  42. <view>{{item.notPay}}</view>
  43. </view> -->
  44. </view>
  45. <view style='background:#E6F3F9;border-bottom:1px solid #ccc;' class='flex justify-between padding-xl' @click='unfold2()'>
  46. <view style='width:92%;margin-top: -4px;' class='flex justify-between'>
  47. 平仓明细
  48. </view>
  49. <view :class="isOpen2 ? 'cuIcon-unfold' : 'cuIcon-right'" ></view>
  50. </view>
  51. <view :class="isOpen2 ? 'content-open' : 'content-close'" class='content2'>
  52. <view class="table u-font-xs">
  53. <view class="tr bg-w">
  54. <view class="th">序号</view>
  55. <view class="th">平仓数(吨)</view>
  56. <view class="th">应收(元)</view>
  57. <view class="th ">已收(元)</view>
  58. <view class="th ">未收(元)</view>
  59. </view>
  60. <view class='tbody'>
  61. <block v-for='(item,index) in contractInfo.taskDTOList1' >
  62. <view class="tr" >
  63. <view class="td">{{index+1}}</view>
  64. <view class="td">{{item.closeTon}}</view>
  65. <view class="td">{{numFilter(item.sumPriceClose)}}</view>
  66. <view class="td">{{numFilter(item.sumPriceClose - item.notPayClose)}}</view>
  67. <view class="td">{{numFilter(item.notPayClose)}}</view>
  68. </view>
  69. </block>
  70. <view class="tr" >
  71. <view class="td">合计</view>
  72. <view class="td">{{contractInfo.sumNetClose}}</view>
  73. <view class="td">{{numFilter(contractInfo.sumTotalClose)}}</view>
  74. <view class="td">{{numFilter(contractInfo.payMoneyClose)}}</view>
  75. <view class="td">{{numFilter(contractInfo.notPayMoneyClose)}}</view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. mapState
  85. } from 'vuex';
  86. export default {
  87. data() {
  88. return {
  89. contractInfo: [],
  90. pages:1,//页数
  91. limit:10 ,//每次取条目数
  92. price: 0,
  93. loadStatus:'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  94. isLoadMore:false, //是否加载中
  95. isOpen1:false,
  96. isOpen2:false
  97. };
  98. },
  99. computed: {
  100. ...mapState(['hasLogin','userInfo'])
  101. },
  102. onShow() {
  103. },
  104. //下拉刷新
  105. onPullDownRefresh() {
  106. this.pages = 1
  107. this.isLoadMore = false
  108. this.loadStatus = 'loading'
  109. this.loadData()
  110. },
  111. onLoad(options) {
  112. this.contractNo=options.contractNo
  113. this.loadData()
  114. },
  115. // onPageScroll(e) {
  116. // //兼容iOS端下拉时顶部漂移
  117. // if (e.scrollTop >= 0) {
  118. // this.headerPosition = "fixed";
  119. // } else {
  120. // this.headerPosition = "absolute";
  121. // }
  122. // },
  123. onReachBottom(){ //上拉触底函数
  124. if(!this.isLoadMore){ //此处判断,上锁,防止重复请求
  125. this.isLoadMore=true
  126. this.pages += 1
  127. this.getContractData()
  128. }
  129. },
  130. methods: {
  131. numFilter (value) {
  132. if(!value){
  133. return 0
  134. }
  135. // 截取当前数据到小数点后两位
  136. let realVal = parseFloat(value).toFixed(2)
  137. return realVal
  138. },
  139. unfold1(){
  140. this.isOpen1=!this.isOpen1
  141. },
  142. unfold2(){
  143. this.isOpen2=!this.isOpen2
  144. },
  145. async loadData() {
  146. const that = this
  147. uni.showLoading({
  148. title: '正在加载',
  149. mask:true
  150. })
  151. that.$api.request('contract', 'getContractInfo',{
  152. page: this.pages,
  153. limit:this.limit,
  154. contractNo:that.contractNo
  155. }, failres => {
  156. that.$api.msg(failres.errmsg)
  157. this.isLoadMore = false
  158. this.loadStatus = 'nomore'
  159. if(this.pages>1){this.pages=1}
  160. uni.hideLoading()
  161. uni.stopPullDownRefresh()
  162. }).then(res => {
  163. that.contractInfo = res.data
  164. uni.hideLoading()
  165. uni.stopPullDownRefresh()
  166. })
  167. if (!this.hasLogin) {
  168. uni.showModal({
  169. title: '登录提示',
  170. content: '您尚未登录,是否立即登录?',
  171. showCancel: true,
  172. confirmText: '登录',
  173. success: (e) => {
  174. if (e.confirm) {
  175. uni.navigateTo({
  176. url: '/pages/public/login'
  177. })
  178. }
  179. },
  180. fail: () => {},
  181. complete: () => {}
  182. })
  183. }
  184. },
  185. },
  186. }
  187. </script>
  188. <style scoped>
  189. .padding-xl{
  190. padding:25rpx 50rpx;
  191. }
  192. .content-open{
  193. display:block;
  194. }
  195. .content1,.content2{
  196. padding: 10rpx 18rpx;
  197. }
  198. .content-close{
  199. display:none;
  200. }
  201. .table {
  202. border: 0px solid darkgray;
  203. }
  204. .tr {
  205. display: flex;
  206. width: 100%;
  207. justify-content: center;
  208. height: 3rem;
  209. align-items: center;
  210. }
  211. .td {
  212. width:40%;
  213. justify-content: center;
  214. text-align: center;
  215. }
  216. .bg-w{
  217. background: snow;
  218. }
  219. .bg-g{
  220. background: #E6F3F9;
  221. }
  222. .th {
  223. width: 40%;
  224. justify-content: center;
  225. /* background: #3366FF; */
  226. /* color: #fff; */
  227. display: flex;
  228. height: 3rem;
  229. align-items: center;
  230. border-bottom:1px solid #ccc;
  231. border-top:1px solid #ccc;
  232. text-align:center;
  233. padding:10px;
  234. font-weight:600;
  235. }
  236. .tr .th:first-child{
  237. border-left:1px solid #ccc;
  238. }
  239. .tr .th:last-child{
  240. border-right:1px solid #ccc;
  241. }
  242. .tbody .tr{
  243. border-bottom:1px solid #ccc;
  244. border-left:1px solid #ccc;
  245. border-right:1px solid #ccc;
  246. }
  247. </style>