order.vue 4.8 KB

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