Commit f7defc13 by LJM

add

parent b275189b
Showing with 15 additions and 2 deletions
......@@ -3,7 +3,7 @@
<view class="search-params row verCenter">
<view class="sn row rowCenter verCenter" style="width: 100%;">
<view class="select-box row" style="width: 100%;">
<uni-datetime-picker v-model="searchParams.stock_shelf_time" type="daterange" rangeSeparator="~" :clear-icon="true" @change="changeDate" start-placeholder="上架开始时间" end-placeholder="上架结束时间" :border="false" />
<uni-datetime-picker v-model="stock_shelf_time" type="daterange" rangeSeparator="~" :clear-icon="true" @change="changeDate" start-placeholder="上架开始时间" end-placeholder="上架结束时间" :border="false" />
</view>
</view>
</view>
......@@ -278,8 +278,9 @@
detail: {},
hasMoreData: true, //是否分页加载
total: 0,
stock_shelf_time: [start, end],
searchParams: {
stock_shelf_time: [start, end], //上架时间
stock_shelf_time: this.formatDate(start) + ' ~ ' + this.formatDate(end),
stock_in_type: '',
search_type: 1,
search_keyword: '',
......@@ -327,6 +328,17 @@
this.index = e.detail.value;
this.searchParams.search_type = parseInt(this.index) + 1;
},
/**
* 格式化日期
* @param {Object} date
*/
formatDate(date) {
const d = new Date(date);
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
showDrawer(id) {
this.onShelfRecordInfo(id);
},
......@@ -397,6 +409,7 @@
* 获取列表数据
*/
getData() {
console.log(this.searchParams.stock_shelf_time)
this.request(API.onShelfRecordList, 'GET', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
if (res.data.total > 0) {
......
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