作者 小范

库存管理添加查询时间段条件

... ... @@ -2,7 +2,8 @@
<el-row>
<el-card style="background-color: #F5F7FA">
<!-- 搜索区域-->
<el-row :gutter="10" class="toolbar">
<el-row class="toolbar" style="height: 100px">
<el-row style="margin-top: -3px">
<el-col :span="6">
<el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 280px"
placeholder="货物单号" clearable>
... ... @@ -21,6 +22,24 @@
<template slot="prepend">库位编号</template>
</el-input>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<div class="my-text-area">
<div class="el-input-group__prepend prepand">时间段</div>
<el-date-picker
v-model="searchTime"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions">
</el-date-picker>
</div>
</el-col>
<el-col :span="5">
<el-button type="primary" icon="el-icon-search" size="small" @click="getList()">
查询
... ... @@ -28,9 +47,10 @@
<el-button type="success" size="small" @click="changeFwb()" :disabled="this.sels.length===0">
更改主单号
</el-button>
<!-- <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>-->
<!-- <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>-->
</el-col>
</el-row>
</el-row>
<!-- 列表区域-->
<el-row>
<template>
... ... @@ -423,6 +443,34 @@
props:['parentLoId'],
data() {
return {
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
queryInfo: {
waybill:'',
billfhl:'',
... ... @@ -431,7 +479,10 @@
pageNum: 1,
// 每页大小
pageSize: 10,
starttime:'',
endtime:'',
},
creattime:'',
total: 0,
tableData:[],
//新增编辑
... ... @@ -594,6 +645,21 @@
fwbRules:{},
}
},
computed:{
//选中的时间段
searchTime: {
get:function () {
return this.creattime
},
set:function (val) {
this.creattime = val
if (val && val.length===2){
this.queryInfo.starttime = val[0]
this.queryInfo.endtime = val[1]
}
}
},
},
methods: {
//获取所属库位
// getLo:function(query){
... ...