order.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view>
  3. <view class="tab" style="height: 110px;">
  4. <u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
  5. <view style="display: flex;margin-top: 10px;">
  6. <u--input placeholder="选择日期" border="surround" v-model="param.declTime" clearable readonly>
  7. <text @click="show=!show" slot="suffix">选择</text>
  8. </u--input>
  9. <view class="reset_btn" @click="cleanDate">重置</view>
  10. </view>
  11. <u-calendar :show="show" minDate="2024-01-01" maxDate="2099-12-30" title="选择日期" @confirm="confirm"
  12. @close="show=false"></u-calendar>
  13. </view>
  14. <view class="goodsList" >
  15. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  16. <view class="title">{{ item.shopName }}
  17. <view v-if="item.hzsConfirmStatus==0">
  18. <view class="state">
  19. <text class="icon">&#xe830;</text>
  20. <text>未确认</text>
  21. </view>
  22. </view>
  23. <view v-else>
  24. <view class="state" v-if="item.finishStatus == 1">
  25. <text class="icon">&#xe830;</text>
  26. <text>已结算</text>
  27. </view>
  28. <view class="state" v-else>
  29. <text class="icon">&#xe830;</text>
  30. <text>未结算</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="con">
  35. <view class="productName omit" style="font-size: 16px;">{{ item.goodsNames }}</view>
  36. <view class="desc omit">
  37. <text>
  38. {{ item.fieldName }}</text>
  39. </view>
  40. <view class="desc">
  41. <text>重量 {{ item.sumGrossWt }}</text>
  42. <text>| 车辆 {{ item.veNo }}</text>
  43. <text v-if="item.orderCount"> | 订单 {{ item.orderCount }}</text>
  44. </view>
  45. <view class="price"> ¥ {{ item.sumAmt }}</view>
  46. </view>
  47. <view class="clear"></view>
  48. <view class="op">
  49. <view class="date">申报时间 {{ item.declTime.substr(0,16) }}</view>
  50. <template>
  51. <view class="an detail_btn" @click.stop="detail(item)">边民订单</view>
  52. </template>
  53. </view>
  54. </view>
  55. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  56. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. tab: [{
  65. name: '全部',
  66. finishStatus: '', //订单完成状态
  67. resaleStatus: '' //订单转售状态
  68. },
  69. {
  70. name: '未确认',
  71. finishStatus: 0,
  72. hzsConfirmStatus:0
  73. },
  74. {
  75. name: '未结算',
  76. finishStatus: 0,
  77. hzsConfirmStatus:1
  78. },
  79. {
  80. name: '已结算',
  81. finishStatus: 1,
  82. hzsConfirmStatus:1
  83. },
  84. ],
  85. show: false,
  86. param: {
  87. pageNo: 1,
  88. pageSize: 10,
  89. declTime: '',
  90. sortType:25
  91. },
  92. list: [],
  93. loadMore: true,
  94. id: '',
  95. flag: '',
  96. };
  97. },
  98. onLoad() {
  99. this.getData()
  100. },
  101. onShow() {},
  102. methods: {
  103. cleanDate() {
  104. this.param.declTime = '';
  105. this.param.pageNo = 1;
  106. this.getData()
  107. },
  108. confirm(days) {
  109. this.param.declTime = days[0];
  110. this.show = false;
  111. this.getData()
  112. },
  113. getData() {
  114. this.http.request({
  115. url: '/level-one-server/app/HtTradeSettlement/getList',
  116. loading: 'false',
  117. data: this.param,
  118. success: res => {
  119. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  120. if (res.data.data) {
  121. this.list.push(...res.data.data);
  122. }
  123. if (this.param.pageNo == 1 && res.data.data&&res.data.data.length==0) {
  124. this.list = []
  125. }
  126. }
  127. });
  128. },
  129. // 点击tab切换
  130. click(e) {
  131. this.param.finishStatus = e.finishStatus;
  132. this.getData();
  133. },
  134. detail(item) {
  135. uni.navigateTo({
  136. url: '/pages/market/one/cooperative/peopleOrders?mainId=' + item.id+'&goodsName='+item.goodsNames+'&veNo='+item.veNo+'&declTime='+item.declTime+'&sumGrossWt='+item.sumGrossWt
  137. });
  138. },
  139. },
  140. //下拉刷新
  141. onPullDownRefresh() {
  142. this.param.pageNo=1;
  143. this.param.declTime='';
  144. setTimeout(() => {
  145. this.getData();
  146. uni.stopPullDownRefresh();
  147. }, 1000);
  148. },
  149. //上拉加载
  150. onReachBottom() {
  151. if (this.loadMore) {
  152. this.param.pageNo++;
  153. this.getData();
  154. }
  155. }
  156. };
  157. </script>
  158. <style lang="scss">
  159. page {
  160. background-color: $pg;
  161. }
  162. .state {
  163. margin-right: -70px;
  164. }
  165. .goodsList{
  166. .item{
  167. .con{
  168. width: 90%;
  169. .desc{
  170. uni-text{
  171. padding-right: 5px;
  172. }
  173. }
  174. }
  175. }
  176. }
  177. .tab {
  178. .reset_btn {
  179. line-height: 35px;
  180. padding: 0 15px;
  181. border: 1px solid #e2e2e2;
  182. border-radius: 8px;
  183. margin-left: 10px;
  184. background: #e2e2e2
  185. }
  186. }
  187. .detail_btn {
  188. border: 1px solid;
  189. padding: 4px 7px;
  190. border-radius: 6px;
  191. background: #2f64c3;
  192. color: #ffff;
  193. }
  194. </style>