index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <view>
  3. <view class="condition">
  4. <view class="conditionone">
  5. <view :style="{'border-bottom':(underline =='0'?'3rpx solid #fff':'none')}" @click="whole">全部</view>
  6. <view :style="{'border-bottom':(underline =='1'?'3rpx solid #fff':'none')}" @click="show = !show,underline = '1'">下单日期</view>
  7. <view :style="{'border-bottom':(underline =='2'?'3rpx solid #fff':'none')}" @click="suitcase = !suitcase,underline = '2'">提箱日期</view>
  8. <view :style="{'border-bottom':(underline =='3'?'3rpx solid #fff':'none')}" @click="choiceState = !choiceState,underline = '3'">状态</view>
  9. </view>
  10. </view>
  11. <view class="search">
  12. <u-search shape="round" placeholder="请输入提单号" @custom="custom" @search="custom" :clearabled="false">
  13. </u-search>
  14. </view>
  15. <view class="ordertop" v-for="(item, index) in lisi" :key="index">
  16. <view>
  17. <view class="iconblue"></view>
  18. <text class="license">车号:{{item.carregNo}}</text>
  19. <view class="various" @click="viewDetails(item.id)" v-if="item.orderStatus == 10">待接单</view>
  20. <view class="various" @click="viewDetails(item.id)" v-else-if="item.orderStatus == 20">待提箱</view>
  21. <view class="various" @click="viewDetails(item.id)" v-else-if="item.orderStatus == 40 && item.billType == 2">待装货</view>
  22. <view class="various" @click="viewDetails(item.id)" v-else-if="item.orderStatus == 40 && item.billType == 1">待卸货</view>
  23. <view class="various" @click="viewDetails(item.id)" v-else-if="item.orderStatus == 50">还卸柜</view>
  24. <view class="various" @click="viewDetails(item.id)" v-else-if="item.orderStatus > 50">已完成</view>
  25. </view>
  26. <view class="line">
  27. <u-line color="#ccc" border-style='dashed' />
  28. </view>
  29. <view class="oddnumber">
  30. <view v-if="item.mblno">
  31. 提单号:{{item.mblno}}
  32. </view>
  33. <view v-else>
  34. 提单号:
  35. </view>
  36. <view v-if="item.loadDate">
  37. 提箱日期:{{item.loadDate.slice(0,10)}}
  38. </view>
  39. <view v-else>
  40. 提箱日期:
  41. </view>
  42. <view v-if="item.loadAddr">
  43. 装卸地点:{{item.loadAddr}}
  44. </view>
  45. <view v-else>
  46. 装卸地点:
  47. </view>
  48. </view>
  49. <view class="line">
  50. <u-line color="#ccc" border-style='dashed' />
  51. </view>
  52. <view class="view" @click="viewDetails(item.id)">
  53. <view>
  54. <text>查看订单详情</text>
  55. </view>
  56. <view>
  57. <u-icon name="arrow-right"></u-icon>
  58. </view>
  59. </view>
  60. </view>
  61. <u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
  62. <u-calendar v-model="show" :mode="mode" @change="orderdate"></u-calendar>
  63. <u-calendar v-model="suitcase" :mode="mode" @change="suitcaSe"></u-calendar>
  64. <u-action-sheet :list="column" @close="underline = '0'" @click="thatOne" v-model="choiceState"></u-action-sheet>
  65. </view>
  66. </template>
  67. <script>
  68. import {request} from '@/common/request/request'
  69. export default {
  70. data() {
  71. return {
  72. lisi: [],
  73. column: [{
  74. text: '新录入',
  75. value:'0'
  76. }, {
  77. text: '车队安排',
  78. value:'10'
  79. }, {
  80. text: '司机受理',
  81. value:'20'
  82. }, {
  83. text: '司机出车',
  84. value:'30'
  85. }, {
  86. text: '提箱',
  87. value:'40'
  88. }, {
  89. text: '装卸货',
  90. value:'50'
  91. }, {
  92. text: '还卸柜子',
  93. value:'60'
  94. }, {
  95. text: '费用确认',
  96. value:'70'
  97. }, {
  98. text: '回单',
  99. value:'80'
  100. },
  101. ],
  102. show: false,
  103. suitcase: false,
  104. choiceState: false,
  105. underline: '0',
  106. mode: 'range',
  107. queryParams: {
  108. pageNum: 1,
  109. pageSize: 10,
  110. },
  111. status: 'loadmore',
  112. iconType: 'flower',
  113. loadText: {
  114. loadmore: '轻轻上拉',
  115. loading: '努力加载中',
  116. nomore: '实在没有了'
  117. },
  118. total: 0,
  119. }
  120. },
  121. onShow(){
  122. this.whole()
  123. },
  124. onReachBottom() {
  125. this.status = 'loading'
  126. console.log(this.queryParams.pageNum)
  127. console.log(this.lisi.length, this.total)
  128. if (this.lisi.length < this.total) {
  129. this.queryParams.pageNum++
  130. this.query()
  131. } else {
  132. this.status = 'nomore'
  133. }
  134. },
  135. created() {
  136. uni.showLoading({
  137. title: '加载中'
  138. });
  139. setTimeout(function () {
  140. uni.hideLoading();
  141. }, 1000);
  142. // #ifdef MP-WEIXIN
  143. if (wx.hideHomeButton) {
  144. wx.hideHomeButton();
  145. }
  146. // #endif
  147. },
  148. methods: {
  149. thatOne(index){
  150. console.log(index)
  151. console.log(this.column[index].value)
  152. this.lisi = []
  153. this.queryParams = {}
  154. this.queryParams = {
  155. pageNum: 1,
  156. pageSize: 10,
  157. orderStatus:this.column[index].value
  158. }
  159. this.query()
  160. },
  161. whole() {
  162. this.underline = '0'
  163. this.lisi = []
  164. this.queryParams = []
  165. this.queryParams = {
  166. pageNum: 1,
  167. pageSize: 10
  168. }
  169. this.query()
  170. },
  171. custom(res) {
  172. this.lisi = []
  173. this.queryParams = []
  174. this.queryParams = {
  175. pageNum: 1,
  176. pageSize: 10,
  177. mblno: res
  178. }
  179. console.log(this.queryParams)
  180. this.query()
  181. },
  182. orderdate(e) {
  183. this.lisi = []
  184. this.queryParams = []
  185. this.queryParams = {
  186. pageNum: 1,
  187. pageSize: 10,
  188. planStartDate: e.startDate + ' ' + '00:00:00',
  189. planEndDate: e.endDate + ' ' + '23:59:59'
  190. }
  191. this.query()
  192. },
  193. suitcaSe(e) {
  194. this.lisi = []
  195. this.queryParams = []
  196. this.queryParams = {
  197. pageNum: 1,
  198. pageSize: 10,
  199. sLoadStartDate: e.startDate + ' ' + '00:00:00',
  200. sLoadEndDate: e.endDate + ' ' + '23:59:59'
  201. }
  202. this.query()
  203. },
  204. query() {
  205. request({
  206. url: '/fleet/ftmsorderbillscars/wechatQuery',
  207. method: 'get',
  208. params: this.queryParams
  209. }).then(res => {
  210. // console.log(res.data.code)
  211. if(res.data.code == 500){
  212. uni.showToast({
  213. icon: 'none',
  214. title: res.msg,
  215. position: "bottom"
  216. })
  217. }else if(res.data.code == 403){
  218. uni.showToast({
  219. icon: 'none',
  220. title: res.data.msg,
  221. position: "bottom"
  222. })
  223. }else if(res.data.dataTable.code == 200){
  224. this.total = res.data.dataTable.total
  225. this.lisi = this.lisi.concat(res.data.dataTable.rows)
  226. this.status = 'nomore'
  227. }
  228. }).catch(err => {
  229. console.log(err)
  230. uni.showToast({
  231. icon: 'none',
  232. title: err.msg,
  233. position: "bottom"
  234. })
  235. })
  236. },
  237. viewDetails(id) {
  238. uni.navigateTo({
  239. url: './orderDetails/index?id=' + id
  240. });
  241. },
  242. }
  243. }
  244. </script>
  245. <style scoped lang="scss">
  246. .view {
  247. width: 96%;
  248. margin: 20rpx auto;
  249. display: flex;
  250. justify-content: space-between
  251. }
  252. .line {
  253. width: 92%;
  254. margin: 0 auto;
  255. }
  256. .oddnumber {
  257. width: 96%;
  258. margin: 20rpx auto;
  259. margin-bottom: 20rpx;
  260. }
  261. .ordertop {
  262. width: 96%;
  263. background-color: #fff;
  264. margin: 20rpx auto;
  265. border-radius: 20rpx;
  266. padding-top: 20rpx;
  267. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  268. padding-bottom: 10rpx;
  269. }
  270. .ordertop>view:nth-child(1) {
  271. width: 98%;
  272. margin-bottom: 60rpx;
  273. }
  274. .search {
  275. width: 96%;
  276. margin: 10rpx auto;
  277. }
  278. .iconblue {
  279. width: 10rpx;
  280. height: 45rpx;
  281. float: left;
  282. background-color: #3a63cf;
  283. margin-right: 10rpx;
  284. }
  285. .license {
  286. float: left;
  287. font-size: 32rpx;
  288. }
  289. .various {
  290. float: right;
  291. width: 150rpx;
  292. border: 2rpx solid #3a63cf;
  293. text-align: center;
  294. border-radius: 100rpx;
  295. color: #3a63cf;
  296. }
  297. .condition {
  298. background-color: #3a63cf;
  299. height: 60rpx;
  300. }
  301. .conditionone {
  302. width: 92%;
  303. height: 44rpx;
  304. margin: 0rpx auto;
  305. display: flex;
  306. justify-content: space-between;
  307. color: #fff;
  308. }
  309. .conditionone>view {
  310. color: #e6e8e8;
  311. }
  312. </style>