freightOrder.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <view class="">
  3. <u-collapse style="background: #fff">
  4. <u-collapse-item
  5. title="搜索"
  6. >
  7. <div style="padding: 5px 10px">
  8. <u--input
  9. placeholder="关键字(发货单号/专线名称)"
  10. border="surround"
  11. v-model="search.keyWord"
  12. ></u--input>
  13. <div style="height: 5px"></div>
  14. <div @click="dateClickStart" class="u-input u-border u-input--radius u-input--square" style="padding: 9px 9px;border-radius:4px">{{beginTimeTitle}}</div>
  15. <div style="height: 5px"></div>
  16. <div @click="dateClickEnd" class="u-input u-border u-input--radius u-input--square" style="padding: 9px 9px;border-radius:4px">{{endTimeTitle}}</div>
  17. <div style="height: 5px"></div>
  18. <u-checkbox-group
  19. v-model="checkboxValue6"
  20. @change="checkboxChange"
  21. >
  22. <u-checkbox
  23. :customStyle="{marginRight: '16px'}"
  24. v-for="(item, index) in checkboxList6"
  25. :key="index"
  26. :label="item.name"
  27. :name="item.value"
  28. >
  29. </u-checkbox>
  30. </u-checkbox-group>
  31. <div style="height: 8px"></div>
  32. <u-button @click="searchBill" :plain="true" type="primary" text="搜 索"></u-button>
  33. </div>
  34. </u-collapse-item>
  35. </u-collapse>
  36. <div class="total-con">合计:{{collection.truckMoneySum}}元,订单{{collection.freightCountSum}}条</div>
  37. <uni-list>
  38. <uni-list-item style="margin-top: 0;padding-top: 0" v-for="(item,index) in billList" :key="item.id" :index="index" :threshold="0">
  39. <template slot="body">
  40. <uni-card>
  41. <view class="demo-layout">
  42. <div class="do-con">
  43. <div class="do-code">{{item.deliveryBillCode}}</div>
  44. <div class="do-status">
  45. <u-tag v-if="item.voidFlag == 1" text="已作废" plain size="mini" type="error"></u-tag>
  46. <u-tag v-else-if="item.billState == 0" text="待派车" plain size="mini" type="warning"></u-tag>
  47. <u-tag v-else-if="item.billState == 1" text="待装车" plain size="mini"></u-tag>
  48. <u-tag v-else-if="item.billState == 2" text="待发车" plain size="mini" type="warning"></u-tag>
  49. <u-tag v-else-if="item.billState == 3" text="运输中" plain size="mini"></u-tag>
  50. <u-tag v-else-if="item.billState == 4" text="待结算" plain size="mini" type="error"></u-tag>
  51. <u-tag color="#333" v-else-if="item.billState == 10" text="已完成" plain size="mini"></u-tag>
  52. </div>
  53. </div>
  54. <view>
  55. <span v-if="item.idBranchLine == 0">{{ '干线:' + item.mainLineName }}</span>
  56. <span v-else>{{ '支线:' + item.branchLineName }}</span>
  57. </view>
  58. <view>
  59. <span v-if="item.departTime">发车时间:{{item.departTime.substring(0, 19)}}</span>
  60. </view>
  61. <view>
  62. 运费金额:<span style="margin: 0 5px;font-weight: bold;color: #e4493c;font-size: 15px">{{ item.truckMoney }}</span>元
  63. </view>
  64. <view>{{ item.billMemo }}</view>
  65. </view>
  66. </uni-card>
  67. </template>
  68. </uni-list-item>
  69. </uni-list>
  70. <view v-show="isLoadMore && !signVisible">
  71. <uni-load-more :status="loadStatus" :content-text="contentText" showIcon @clickLoadMore="loadMoreBill()"></uni-load-more>
  72. </view>
  73. <u-datetime-picker
  74. :show="show"
  75. @cancel="show=false"
  76. @confirm="selectDate"
  77. v-model="value1"
  78. mode="date"
  79. ></u-datetime-picker>
  80. </view>
  81. </template>
  82. <script>
  83. import request from '@/common/libs/request.js';
  84. import dayjs from '../../libs/util/dayjs.js';
  85. export default {
  86. data() {
  87. return {
  88. dateType:0,
  89. collection:{},
  90. show: false,
  91. value1: Number(new Date()),
  92. checkboxValue6: [3, 10],
  93. checkboxList6: [{
  94. name: '运输中',
  95. value: 3,
  96. disabled: false
  97. },
  98. {
  99. name: '完成',
  100. value: 10,
  101. disabled: false
  102. }
  103. ],
  104. contentText: {
  105. contentdown: '查看更多',
  106. contentrefresh: '加载中',
  107. contentnomore: '没有更多数据了'
  108. },
  109. search: {
  110. keyWord: '',
  111. beginTime: '',
  112. endTime: '',
  113. billStates: '',
  114. voidFlag: 0
  115. },
  116. beginTimeTitle:"发车开始日期",
  117. endTimeTitle:"发车结束日期",
  118. signVisible:false,
  119. fabPattern: {
  120. color: '#7A7E83',
  121. backgroundColor: '#fff',
  122. selectedColor: '#007AFF',
  123. buttonColor: '#007AFF',
  124. iconColor: '#fff'
  125. },
  126. billList: [],
  127. page: {
  128. pageIndex: 1,
  129. pageSize: 20
  130. },
  131. isLoadMore: true,
  132. loadStatus: 'noMore',
  133. }
  134. },
  135. onLoad() {
  136. this.getSignBillList();
  137. },
  138. onPullDownRefresh() {
  139. this.billList = [];
  140. this.search = {
  141. keyWord: '',
  142. beginTime: '',
  143. endTime: '',
  144. billStates: '',
  145. voidFlag: 0
  146. }
  147. this.pageIndex = 1;
  148. this.getSignBillList();
  149. },
  150. methods: {
  151. selectDate(data) {
  152. let deliveryDate = dayjs(data.value).format("YYYY-MM-DD")
  153. if(this.dateType==1){
  154. this.search.beginTime = deliveryDate
  155. this.beginTimeTitle = deliveryDate
  156. }
  157. if(this.dateType==2){
  158. this.search.endTime = deliveryDate
  159. this.endTimeTitle = deliveryDate
  160. }
  161. this.show = false;
  162. },
  163. dateClickStart(){
  164. let _that = this;
  165. _that.dateType = 1
  166. _that.show = true;
  167. _that.value1 = Number(new Date());
  168. },
  169. dateClickEnd(){
  170. let _that = this;
  171. _that.show = true;
  172. _that.dateType = 2
  173. _that.value1 = Number(new Date());
  174. },
  175. checkboxChange(n) {
  176. // console.log('change', n);
  177. // console.log(this.checkboxValue6);
  178. },
  179. getSignBillList: function () {
  180. let _that = this;
  181. if(_that.beginTimeTitle=='发车开始日期' || _that.endTimeTitle=='发车结束日期'){
  182. _that.search.beginTime = "";
  183. _that.search.endTime = "";
  184. }
  185. if (_that.checkboxValue6.length > 0) {
  186. _that.search.billStates = _that.checkboxValue6.join(',')
  187. }else {
  188. _that.search.billStates = ""
  189. }
  190. const params = _that.search;
  191. // console.log(params);
  192. let listData = {
  193. params: JSON.stringify(params),
  194. page: JSON.stringify(_that.page)
  195. }
  196. request.httpPost("/dnyDriver/getDeliveryBillFreightList", listData, true).then(res => {
  197. // console.log("res1111", res);
  198. uni.stopPullDownRefresh();
  199. if (!res.data || res.data.length == 0) {
  200. this.loadStatus = "noMore";
  201. return;
  202. }
  203. this.collection = res.collection;
  204. this.billList = this.billList.concat(res.data);
  205. this.loadStatus = "more";
  206. // supplierIndex = 0;
  207. });
  208. },
  209. searchBill() {
  210. const _that = this;
  211. _that.billList = [];
  212. _that.pageIndex = 1;
  213. _that.getSignBillList();
  214. },
  215. loadMoreBill: function () {
  216. this.loadStatus = "loading";
  217. setTimeout(() => {
  218. this.page.pageIndex += 1;
  219. this.getSignBillList();
  220. }, 100);
  221. }
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. .total-con{
  227. padding: 5px 10px;
  228. }
  229. .collapse-con{
  230. padding: 10px;
  231. }
  232. .do-con{
  233. display: flex;
  234. justify-content:space-between;
  235. }
  236. .tag-con {
  237. color: #e4493c;
  238. margin-right: 20rpx;
  239. }
  240. /deep/ .uni-list-item__container {
  241. padding: 0rpx;
  242. }
  243. /deep/ .uni-list-item__container {
  244. padding: 0 rpx;
  245. }
  246. /deep/ .uni-card uni-card--border{
  247. padding: 0 rpx;
  248. }
  249. .card-actions {
  250. display: flex;
  251. flex-direction: row;
  252. justify-content: space-around;
  253. align-items: center;
  254. height: 45px;
  255. border-top: 1px #eee solid;
  256. }
  257. .card-actions-item {
  258. display: flex;
  259. flex-direction: row;
  260. align-items: center;
  261. }
  262. .card-actions-item-text {
  263. font-size: 12px;
  264. color: #666;
  265. margin-left: 5px;
  266. }
  267. .textTitle {
  268. border-left: 0px solid #007AFF;
  269. display: inline-block;
  270. width: 180 rpx;
  271. text-align: left;
  272. margin-bottom: 5px;
  273. color: #8799a3;
  274. }
  275. </style>