index.vue 8.2 KB

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