123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- <template>
- <view class="content">
- <!-- 头部 -->
- <view class="example-body vertical-layout">
- <!-- 用户头像 -->
- <image :src="avatar" class="user" @click="userTo()">
- </image>
- <view class="falseSearch">
- <u-search bgColor="#fff" hover-class="search" @confirm="getOrderBillsPlansList()" :showAction="false"
- placeholder="请输入订单号码" v-model="condition.orderNo">
- </u-search>
- <text class="search" hover-class="search-click" @click="getOrderBillsPlansList()">搜索</text>
- </view>
- </view>
- <!-- 日期 -->
- <view style="position: sticky;top: 120rpx;">
- <view style="background-color: white">
- <uni-datetime-picker v-model="condition.range" type="daterange" />
- </view>
- </view>
- <view class="dataList">
- <!-- 列表 -->
- <view class="list" v-for="(item,index) in orderBillsPlansList"
- @click="jumpDetails(item.orderNo, item.status317, item.status376)">
- <!-- 头部 -->
- <view class="head vertical-layout">
- <view class="no">
- <view class="blueStick-blue"></view>
- <!-- <view class="blueStick-red" v-if="item.billStatus == 6"></view> -->
- <!-- 订单号 -->
- <text class="odd">订单号: {{ item.orderNo == null ? '' : item.orderNo }}</text>
- </view>
- <!-- <view class="date">
- <text>{{ item.billDate }}</text>
- </view> -->
- <!-- {{item.status317}}
- {{item.status376}} -->
- <view class="date">
- <text class="true" v-if="item.status317 == 2">{{ item.billStatusName }}</text>
- <!-- item.status376 == 0 -->
- <!-- item.status376 == 2 -->
- <text class="yellow"
- v-if="item.status317 == 6">{{ item.billStatusName }}</text>
- <text class="false" v-if="item.status376 == 6">{{ item.billStatusName }}</text>
- </view>
- </view>
- <!-- <view class="details">
- <view class="left vertical-layout">
- <text class="data-left vertical-layout colorBlue">装车地</text>
- <text class="data-right">{{ item.loadAddr == null ? '' : item.loadAddr }}</text>
- </view>
- <view class="right vertical-layout">
- <text class="data-left vertical-layout colorBlue">卸车地 </text>
- <text> {{ item.unLoadAddr == null ? '' : item.unLoadAddr }}</text>
- </view>
- </view>
- <view class="details">
- <view class="left vertical-layout">
- <text class="data-left vertical-layout colorBlue">装货品名 </text>
- <text>{{ item.goodsCName == null ? '' : item.goodsCName }}</text>
- </view>
- <view class="right">
- <text class="data-left colorBlue">额定数量 </text>
- <text>{{ item.rightqty == null ? '' : item.rightqty }}</text>
- </view>
- </view>
- <view class="details">
- <view class="left vertical-layout">
- <text class="data-left vertical-layout colorBlue">业务员 </text>
- <text>{{ item.transact == null ? '' : item.transact }}</text>
- </view>
- <view class="right vertical-layout">
- <text class="data-left vertical-layout colorBlue">派单日期</text>
- <text>{{ item.billDate == null ? '' : item.billDate}}</text>
- </view>
- </view> -->
- <view class="details">
- <view class="data">
- <text class="key">装卸地点</text>
- <text
- class="value">{{ item.loadAddr == null ? '' : item.loadAddr }}--{{ item.unLoadAddr == null ? '' : item.unLoadAddr }}</text>
- </view>
- <view class="data">
- <text class="key">装货品名</text>
- <text class="value">{{ item.goodsCName == null ? '' : item.goodsCName }} {{ item.rightqty == null ? '' : item.rightqty + "吨" }}</text>
- </view>
- <view class="data vertical-layout">
- <view class="a">
- <text class="key">派单日期</text>
- <text class="value">{{ item.billDate == null ? '' : item.billDate}}</text>
- </view>
- <view class="b">
- <text class="key">业务员</text>
- <text class="value">{{ item.transact == null ? '' : item.transact }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- orderBillsPlansList
- } from "@/api/home"
- import storage from '@/utils/storage'
- export default {
- data() {
- return {
- // 查询条件
- condition: {
- range: [],
- head: 1,
- tail: 9
- },
- // 数据
- orderBillsPlansList: [],
- show: false,
- }
- },
- computed: {
- avatar() {
- return this.$store.state.user.avatar
- }
- },
- onLoad() {
- this.getCurrentMonthFirst();
- this.getOrderBillsPlansList();
- },
- onReachBottom() {
- this.condition.head += 9;
- this.condition.tail += 9;
- orderBillsPlansList(this.condition).then(res => {
- var next_data = res.data;
- this.orderBillsPlansList = this.orderBillsPlansList.concat(next_data);
- })
- },
- methods: {
- // 查询主页数据
- getOrderBillsPlansList() {
- this.condition.head = 1;
- this.condition.tail = 9;
- orderBillsPlansList(this.condition).then(res => {
- this.orderBillsPlansList = res.data;
- })
- },
- // 跳转详情
- jumpDetails(orderNo, status317, status376) {
- uni.navigateTo({
- url: 'particulars/index?orderNo=' + orderNo + '&status317=' + status317 + '&status376=' +
- status376
- });
- },
- // 跳转用户信息
- userTo() {
- // console.log("跳转用户信息");
- uni.navigateTo({
- url: 'mine/index'
- });
- },
- //获取当前月份第一天和最后一天
- getCurrentMonthFirst() {
- var date = new Date();
- var nowDate = new Date()
- var fullYear = nowDate.getFullYear();
- var month = nowDate.getMonth() + 1;
- var endOfMonth = new Date(fullYear, month, 0).getDate(); // 获取本月最后一天
- date.setDate(1);
- var beginDate = date.toISOString().slice(0, 10);
- var endDate = this.getFullDate(new Date().setDate(endOfMonth));
- var date1 = new Date();
- var date2 = new Date(date1);
- //-30为30天前,+30可以获得30天后的日期
- date2.setDate(date1.getDate() - 30);
- //30天前(月份判断是否小于10,小于10的前面+0)
- var agoDay =
- `${date2.getFullYear()}-${date2.getMonth() + 1<10?`0${date2.getMonth() + 1}`:date2.getMonth() + 1}-${date2.getDate()}`;
- this.condition.range.push(agoDay, endDate);
- },
- // 日期格式化
- getFullDate(targetDate) {
- var D, y, m, d;
- if (targetDate) {
- D = new Date(targetDate);
- y = D.getFullYear();
- m = D.getMonth() + 1;
- d = D.getDate();
- } else {
- y = fullYear;
- m = month;
- d = date;
- }
- m = m > 9 ? m : '0' + m;
- d = d > 9 ? d : '0' + d;
- return y + '-' + m + '-' + d;
- }
- },
- }
- </script>
- <style lang="scss">
- // 修改布局方向为纵向布局
- .vertical-layout {
- display: flex;
- }
- // 文字浅蓝色
- .colorBlue {
- color: #3c9cff;
- }
- .blueStick-blue {
- width: 10rpx;
- height: 100%;
- border-radius: 5rpx;
- background-color: #3c9cff;
- }
- .blueStick-red {
- width: 10rpx;
- height: 100%;
- border-radius: 5rpx;
- background-color: red;
- }
- .img {
- padding-left: 20rpx;
- max-width: 30rpx;
- }
- // 头部
- .example-body {
- box-sizing: border-box;
- width: 100%;
- height: 120rpx;
- position: -webkit-sticky;
- position: sticky;
- top: var(--window-top);
- z-index: 99;
- background-color: #3c9cff;
- padding-left: 40rpx;
- align-items: center;
- // 用户头像
- .user {
- width: 90rpx;
- height: 90rpx;
- border-radius: 45rpx;
- background-color: #c4c6c9;
- margin-right: 40rpx;
- }
- // 搜索框
- .falseSearch {
- // width: calc(100% - 130rpx);
- height: 80rpx;
- // width: 1000rpx;
- border-radius: 35rpx;
- display: flex;
- // align-items: center;
- // margin-left: 0rpx;
- background-color: #fff;
- align-content: center;
- align-items: center;
- color: #c4c6c9;
- // 搜索按钮
- .search {
- height: 100%;
- border-radius: 35rpx;
- color: #303133;
- text-align: center;
- line-height: 80rpx;
- padding: 0 40rpx;
- }
- .search-click {
- background-color: pink;
- }
- }
- }
- .dataList {
- box-sizing: border-box;
- padding-left: 10rpx;
- padding-right: 10rpx;
- .list {
- padding-top: 5rpx;
- border-radius: 20rpx;
- margin-top: 20rpx;
- background-color: white;
- padding-bottom: 15rpx;
- box-shadow: 1px 1px 2px 2px rgba(76, 76, 76, 0.1);
- .head {
- font-size: 34rpx;
- height: 50rpx;
- margin: 10rpx 20rpx 20rpx 20rpx;
- padding-top: 6rpx;
- padding-bottom: 6rpx;
- // margin-bottom: 20rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .no {
- height: 100%;
- display: flex;
- align-items: center;
- .odd {
- height: 100%;
- display: flex;
- align-items: center;
- padding-left: 15rpx;
- font-weight: 700;
- }
- }
- .date {
- .true {
- color: red;
- }
- .yellow {
- color: #3c9cff;
- }
- .false {
- color: green;
- }
- }
- }
- .details {
- width: 100%;
- font-size: 30rpx;
- // margin-left: 20rpx;
- margin-right: 20rpx;
- margin-bottom: 10rpx;
- padding-bottom: 4rpx;
- margin-left: 20rpx;
- // border-top: 4rpx solid #f0f0f0ff;
- // border-bottom: 2rpx dotted #000;
- .left {
- // text-align: right;
- width: 35%;
- float: left;
- }
- .right {
- width: 50%;
- margin-left: 30%;
- }
- .right-two {
- // border-top: 4rpx solid #f0f0f0ff;\
- margin-top: 10rpx;
- padding-bottom: 10rpx;
- }
- .data-left {
- margin-right: 20rpx;
- display: inline-block;
- width: 50%;
- text-align: right;
- }
- .data-right {
- // width: 50%;
- }
- .data {
-
- margin-bottom: 10rpx;
- .key {
- color: #3c9cff;
- }
- .value {
- padding-left: 20rpx;
- }
- .a {
- width: 50%;
- }
- .b {
- width: 50%;
- }
- }
- }
- .primary {
- float: right;
- line-height: 40rpx;
- margin-top: 10rpx;
- margin-right: 10rpx;
- height: 40rpx;
- }
- }
- }
- </style>
|