Commit ea367ce7 by LJM

css

parent 37f90a83
Showing with 9 additions and 43 deletions
<template>
<view class="logisticsList">
<view class="uni-list-cell row verCenter bothSide">
<view class="uni-list-cell-left">报关日期选择</view>
<view class="uni-list-cell-db row">
<picker mode="date" :value="today" :start="startDate" :end="endDate" @change="bindDateChange">
<text class="uni-input">{{ today }}</text>
<text class="iconfont icon-Chevron1"></text>
</picker>
</view>
<view class="uni-list-cell-db row"><uni-datetime-picker type="daterange" v-model="range" @change="bindDateChange" /></view>
</view>
<view class="tab row verCenter">
<view class="box row" @click="changeTab(index)" :class="{ curr: index == currentIndex }" :key="index" v-for="(item, index) in textArr">
......@@ -22,7 +16,7 @@
<text class="row verCenter rowCenter">入库</text>
<text class="row verCenter rowCenter">出库</text>
</view>
<template v-if="total > 0">
<template v-if="list.length > 0">
<view class="uni-tr row verCenter" v-for="(item, index) in list" :key="index">
<text class="row verCenter rowCenter">{{ item.entrustNo || '-' }}</text>
<text class="row verCenter rowCenter">{{ item.carOrder || '-' }}</text>
......@@ -43,62 +37,34 @@ import { API } from '@/util/api.js';
export default {
data() {
const currentDate = this.getDate({
format: true
});
return {
range: [],
currentIndex: 0,
textArr: ['全部', '未入库', '未出库'],
today: currentDate,
total: 1,
list: []
list: [],
type: 0
};
},
computed: {
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
onShow() {
this.getData();
},
methods: {
changeTab(index) {
this.currentIndex = index;
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
this.type = index;
this.getData();
},
bindDateChange(e) {
this.today = e.detail.value;
this.total = 0;
this.list = [];
this.range = e;
this.getData();
},
getData() {
this.request(API.szScanOutInList, 'POST', { today: this.today }, true).then(res => {
this.request(API.szScanOutInList, 'POST', { startTime: this.range[0], endTime: this.range[1], type: this.type }, true).then(res => {
if (res.err_code === 0) {
if (res.data.length > 0) {
this.is_loading = false;
this.list = res.data;
this.total = 100;
} else {
this.total = 0;
this.list = [];
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment