Commit ea367ce7 by LJM

css

parent 37f90a83
Showing with 9 additions and 43 deletions
<template> <template>
<view class="logisticsList"> <view class="logisticsList">
<view class="uni-list-cell row verCenter bothSide"> <view class="uni-list-cell row verCenter bothSide">
<view class="uni-list-cell-left">报关日期选择</view> <view class="uni-list-cell-db row"><uni-datetime-picker type="daterange" v-model="range" @change="bindDateChange" /></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> </view>
<view class="tab row verCenter"> <view class="tab row verCenter">
<view class="box row" @click="changeTab(index)" :class="{ curr: index == currentIndex }" :key="index" v-for="(item, index) in textArr"> <view class="box row" @click="changeTab(index)" :class="{ curr: index == currentIndex }" :key="index" v-for="(item, index) in textArr">
...@@ -22,7 +16,7 @@ ...@@ -22,7 +16,7 @@
<text class="row verCenter rowCenter">入库</text> <text class="row verCenter rowCenter">入库</text>
<text class="row verCenter rowCenter">出库</text> <text class="row verCenter rowCenter">出库</text>
</view> </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"> <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.entrustNo || '-' }}</text>
<text class="row verCenter rowCenter">{{ item.carOrder || '-' }}</text> <text class="row verCenter rowCenter">{{ item.carOrder || '-' }}</text>
...@@ -43,62 +37,34 @@ import { API } from '@/util/api.js'; ...@@ -43,62 +37,34 @@ import { API } from '@/util/api.js';
export default { export default {
data() { data() {
const currentDate = this.getDate({
format: true
});
return { return {
range: [],
currentIndex: 0, currentIndex: 0,
textArr: ['全部', '未入库', '未出库'], textArr: ['全部', '未入库', '未出库'],
today: currentDate, list: [],
total: 1, type: 0
list: []
}; };
}, },
computed: {
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
onShow() { onShow() {
this.getData(); this.getData();
}, },
methods: { methods: {
changeTab(index) { changeTab(index) {
this.currentIndex = index; this.currentIndex = index;
}, this.type = index;
getDate(type) { this.getData();
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}`;
}, },
bindDateChange(e) { bindDateChange(e) {
this.today = e.detail.value; this.range = e;
this.total = 0;
this.list = [];
this.getData(); this.getData();
}, },
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.err_code === 0) {
if (res.data.length > 0) { if (res.data.length > 0) {
this.is_loading = false; this.is_loading = false;
this.list = res.data; this.list = res.data;
this.total = 100;
} else { } else {
this.total = 0;
this.list = []; this.list = [];
} }
} else { } 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