order.vue 5.0 KB

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