Commit 8b6bb87e by LJM

移动端--到货登记--已登记展示数据改为展示全部正常状态数据和时间查询

parent 82bfd3b3
Showing with 66 additions and 10 deletions
<template> <template>
<view class="arrivalRegister"> <view class="arrivalRegister">
<!-- 时间筛选 -->
<view class="time-interval row bothSide verCenter" style="margin-bottom: 15rpx;">
<view class="time-interval-box row verCenter bothSide">
<view class="row verCenter">
<text class="iconfont icon-juxing4"></text>
<picker mode="date" @change="bindTimeChange(1, $event)">
<input type="text" class="uni-input" placeholder="请选择起始时间" placeholder-style="color:#919399" v-model="searchParams.arrival_time_begin" />
</picker>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput('start')" v-if="searchParams.arrival_time_begin != ''"></text>
</view>
<view class="time-interval-box row verCenter bothSide">
<view class="row verCenter">
<text class="iconfont icon-juxing4"></text>
<picker mode="date" @change="bindTimeChange(2, $event)">
<input type="text" class="uni-input" placeholder="请选择结束时间" placeholder-style="color:#919399" v-model="searchParams.arrival_time_end" />
</picker>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput('end')" v-if="searchParams.arrival_time_end != ''"></text>
</view>
</view>
<!-- 搜索条件 --> <!-- 搜索条件 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="search-box-wrap row verCenter"> <view class="search-box-wrap row verCenter">
...@@ -195,6 +216,8 @@ ...@@ -195,6 +216,8 @@
hasMoreData: true, //是否分页加载 hasMoreData: true, //是否分页加载
maxInputLength: 7, maxInputLength: 7,
searchParams: { searchParams: {
arrival_time_begin: '',
arrival_time_end: '',
mobile_register_all_search: '', //全量搜索 mobile_register_all_search: '', //全量搜索
stock_in_with_stock_in_items_inhouse: '', //入仓单号 stock_in_with_stock_in_items_inhouse: '', //入仓单号
box_sn: '' //箱号 box_sn: '' //箱号
...@@ -220,6 +243,29 @@ ...@@ -220,6 +243,29 @@
this.getData(); this.getData();
}, },
methods: { methods: {
/**
* 时间选择
*/
bindTimeChange(type, e) {
this.resetChange();
if (type == 1) {
this.searchParams.arrival_time_begin = e.detail.value;
} else if (type == 2) {
this.searchParams.arrival_time_end = e.detail.value;
}
var timeA = new Date(this.searchParams.arrival_time_begin).getTime();
var timeB = new Date(this.searchParams.arrival_time_end).getTime();
if (timeB < timeA) {
uni.showToast({
title: '不能小于开始时间',
icon: 'none'
});
this.searchParams.arrival_time_begin = this.searchParams.arrival_time_begin;
return false;
}
this.getData();
},
bindPickerChange: function(e) { bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value); console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value; this.index = e.detail.value;
...@@ -264,19 +310,29 @@ ...@@ -264,19 +310,29 @@
/** /**
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput(type) {
this.input_flag = false; this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点 this.clearInputAndFocus(); //再次获取焦点
this.resetChange(); this.resetChange();
if (this.index == 0) { if (type) {
//全量搜索 if (type == 'start') {
this.searchParams.mobile_register_all_search = ''; //清除起始时间
} else if (this.index == 1) { this.searchParams.arrival_time_begin = '';
//入仓号 } else if (type == 'end') {
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; //清除结束时间
} else if (this.index == 2) { this.searchParams.arrival_time_end = '';
//箱号 }
this.searchParams.box_sn = ''; } else {
if (this.index == 0) {
//全量搜索
this.searchParams.mobile_register_all_search = '';
} else if (this.index == 1) {
//入仓号
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
} else if (this.index == 2) {
//箱号
this.searchParams.box_sn = '';
}
} }
this.getData(); this.getData();
}, },
......
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