cooperation.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <view>
  3. <view class="tab">
  4. <u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
  5. </view>
  6. <view class="goodsList">
  7. <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
  8. <view class="title">
  9. {{ item.enterpriseName }}
  10. <view class="state" v-if="item.peopleConfirmStatus == 0">
  11. <text class="icon">&#xe830;</text>
  12. <text>未确认</text>
  13. </view>
  14. <view class="state" v-if="item.peopleConfirmStatus == 1 && item.apply == 0">
  15. <text class="icon" style="color: #13ce66">&#xe830;</text>
  16. <text>已确认</text>
  17. </view>
  18. <view class="state" v-if="item.resaleStatus == 1">
  19. <text class="icon" style="color: #13ce66">&#xe830;</text>
  20. <text>已转售</text>
  21. </view>
  22. <view class="state" v-if="item.finishStatus == 3">
  23. <text class="icon" style="color: #f44336">&#xe622;</text>
  24. <text>已取消</text>
  25. </view>
  26. </view>
  27. <image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
  28. <view class="con">
  29. <view class="productName omit">{{ item.goodsNames }}</view>
  30. <view class="desc omit">
  31. <text>重量 {{ item.totalWeight }}</text>
  32. <text>{{ item.tradeAreaName }}</text>
  33. </view>
  34. <view class="price">¥ {{ item.totalPrice }}</view>
  35. </view>
  36. <view class="clear"></view>
  37. <view class="op">
  38. <view class="date">{{ item.createTime }}</view>
  39. <template v-if="item.peopleConfirmStatus == 0">
  40. <view class="an" style="color: #f44336" @click.stop="confirmOrder(item.id)">边民确认</view>
  41. </template>
  42. <template v-if="item.peopleConfirmStatus == 1 && item.applyConfirmStatus == 0">
  43. <view class="an" style="color: #f44336" @click.stop="applyOrder(item.id)">进口申报确认</view>
  44. </template>
  45. <template v-if="item.peopleConfirmStatus == 1 && item.applyConfirmStatus == 1 && item.apply == 1 && item.resaleStatus == 0">
  46. <view class="an" style="color: #f44336" @click.stop="resale(item)">订单转售</view>
  47. </template>
  48. <!-- <template v-if="item.peopleConfirmStatus == 0">
  49. <view class="an" style="color: #f44336" v-if="user.userType == 2" @click.stop="confirm(item.id)">取消订单</view>
  50. </template>
  51. <template v-if="item.finishStatus == 3">
  52. <view class="an" style="color: #f44336" v-if="user.userType == 2" @click.stop="del(item.id)">删除订单</view>
  53. </template> -->
  54. </view>
  55. </view>
  56. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  57. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. tab: [
  66. {
  67. name: '全部',
  68. peopleConfirmStatus: '', //边民确认状态
  69. applyConfirmStatus: '', //进口申报确认状态
  70. apply: '', //订单申报状态
  71. finishStatus: '', //订单完成状态
  72. resaleStatus: '' //订单转售状态
  73. },
  74. {
  75. name: '订单确认',
  76. peopleConfirmStatus: 0,
  77. applyConfirmStatus: 0,
  78. apply: 0,
  79. finishStatus: 0,
  80. resaleStatus: 0
  81. }
  82. ],
  83. param: {
  84. pageNo: 1,
  85. pageSize: 10
  86. },
  87. user: this.getUser(),
  88. list: [],
  89. loadMore: true,
  90. confirmType: 1, //边民确认类型[1=刷脸,2=指纹]
  91. id: '',
  92. flag: ''
  93. };
  94. },
  95. onLoad() {
  96. this.getData();
  97. },
  98. methods: {
  99. getData() {
  100. this.http.request({
  101. url: '/level-one-server/app/TbOrder/getList',
  102. loading: 'false',
  103. data: this.param,
  104. success: res => {
  105. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  106. if (res.data.data) {
  107. this.list.push(...res.data.data);
  108. }
  109. }
  110. });
  111. },
  112. // 点击tab切换
  113. click(e) {
  114. console.log(e);
  115. this.param.peopleConfirmStatus = e.peopleConfirmStatus;
  116. this.param.applyConfirmStatus = e.applyConfirmStatus;
  117. this.param.apply = e.apply;
  118. this.param.finishStatus = e.finishStatus;
  119. this.param.resaleStatus = e.resaleStatus;
  120. this.refresh();
  121. },
  122. detail(item) {
  123. uni.navigateTo({ url: '/pages/market/one/leader/detail?id=' + item.id });
  124. },
  125. // 刷新数据
  126. refresh() {
  127. this.loadMore = true;
  128. this.param.pageNo = 1;
  129. this.list = [];
  130. this.getData();
  131. },
  132. //边民确认订单
  133. confirmOrder(id) {
  134. this.id = id;
  135. this.flag = 1;
  136. uni.navigateTo({ url: '/pages/authentication/face' });
  137. },
  138. //边民进口申报确认
  139. applyOrder(id) {
  140. this.id = id;
  141. this.flag = 2;
  142. uni.navigateTo({ url: '/pages/authentication/face' });
  143. },
  144. // 取消订单
  145. confirm(id) {
  146. uni.showModal({
  147. title: '提示',
  148. content: '是否确认取消订单?',
  149. success: res => {
  150. if (res.confirm) {
  151. this.http.request({
  152. url: '/level-one-server/app/TbOrder/cancelOrder',
  153. data: { orderId: id },
  154. success: resp => {
  155. uni.showToast({ title: '操作成功' });
  156. this.refresh();
  157. }
  158. });
  159. }
  160. }
  161. });
  162. },
  163. // 删除订单
  164. del(id) {
  165. uni.showModal({
  166. title: '提示',
  167. content: '确认删除该订单?',
  168. success: res => {
  169. if (res.confirm) {
  170. this.http.request({
  171. url: '/level-one-server/app/TbOrder/delete',
  172. data: { id: id },
  173. success: resp => {
  174. uni.showToast({ title: '操作成功' });
  175. this.refresh();
  176. }
  177. });
  178. }
  179. }
  180. });
  181. }
  182. },
  183. //下拉刷新
  184. onPullDownRefresh() {
  185. setTimeout(() => {
  186. this.refresh();
  187. uni.stopPullDownRefresh();
  188. }, 1000);
  189. },
  190. //上拉加载
  191. onReachBottom() {
  192. if (this.loadMore) {
  193. this.param.pageNo++;
  194. this.getData();
  195. }
  196. }
  197. };
  198. </script>
  199. <style lang="scss">
  200. page {
  201. background-color: $pg;
  202. }
  203. .state {
  204. margin-right: -70px;
  205. }
  206. </style>