作者 小范

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

@@ -2,7 +2,8 @@ @@ -2,7 +2,8 @@
2 <el-row> 2 <el-row>
3 <el-card style="background-color: #F5F7FA"> 3 <el-card style="background-color: #F5F7FA">
4 <!-- 搜索区域--> 4 <!-- 搜索区域-->
5 - <el-row :gutter="10" class="toolbar"> 5 + <el-row class="toolbar" style="height: 100px">
  6 + <el-row style="margin-top: -3px">
6 <el-col :span="6"> 7 <el-col :span="6">
7 <el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 280px" 8 <el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 280px"
8 placeholder="货物单号" clearable> 9 placeholder="货物单号" clearable>
@@ -21,6 +22,24 @@ @@ -21,6 +22,24 @@
21 <template slot="prepend">库位编号</template> 22 <template slot="prepend">库位编号</template>
22 </el-input> 23 </el-input>
23 </el-col> 24 </el-col>
  25 + </el-row>
  26 + <el-row>
  27 + <el-col :span="12">
  28 + <div class="my-text-area">
  29 + <div class="el-input-group__prepend prepand">时间段</div>
  30 + <el-date-picker
  31 + v-model="searchTime"
  32 + type="daterange"
  33 + unlink-panels
  34 + range-separator="至"
  35 + start-placeholder="开始日期"
  36 + end-placeholder="结束日期"
  37 + value-format="yyyy-MM-dd HH:mm:ss"
  38 + format="yyyy-MM-dd HH:mm:ss"
  39 + :picker-options="pickerOptions">
  40 + </el-date-picker>
  41 + </div>
  42 + </el-col>
24 <el-col :span="5"> 43 <el-col :span="5">
25 <el-button type="primary" icon="el-icon-search" size="small" @click="getList()"> 44 <el-button type="primary" icon="el-icon-search" size="small" @click="getList()">
26 查询 45 查询
@@ -28,9 +47,10 @@ @@ -28,9 +47,10 @@
28 <el-button type="success" size="small" @click="changeFwb()" :disabled="this.sels.length===0"> 47 <el-button type="success" size="small" @click="changeFwb()" :disabled="this.sels.length===0">
29 更改主单号 48 更改主单号
30 </el-button> 49 </el-button>
31 -<!-- <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>--> 50 + <!-- <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>-->
32 </el-col> 51 </el-col>
33 </el-row> 52 </el-row>
  53 + </el-row>
34 <!-- 列表区域--> 54 <!-- 列表区域-->
35 <el-row> 55 <el-row>
36 <template> 56 <template>
@@ -423,6 +443,34 @@ @@ -423,6 +443,34 @@
423 props:['parentLoId'], 443 props:['parentLoId'],
424 data() { 444 data() {
425 return { 445 return {
  446 + pickerOptions: {
  447 + shortcuts: [{
  448 + text: '最近一周',
  449 + onClick(picker) {
  450 + const end = new Date();
  451 + const start = new Date();
  452 + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  453 + picker.$emit('pick', [start, end]);
  454 + }
  455 + }, {
  456 + text: '最近一个月',
  457 + onClick(picker) {
  458 + const end = new Date();
  459 + const start = new Date();
  460 + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  461 + picker.$emit('pick', [start, end]);
  462 + }
  463 + }, {
  464 + text: '最近三个月',
  465 + onClick(picker) {
  466 + const end = new Date();
  467 + const start = new Date();
  468 + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  469 + picker.$emit('pick', [start, end]);
  470 + }
  471 + }]
  472 + },
  473 +
426 queryInfo: { 474 queryInfo: {
427 waybill:'', 475 waybill:'',
428 billfhl:'', 476 billfhl:'',
@@ -431,7 +479,10 @@ @@ -431,7 +479,10 @@
431 pageNum: 1, 479 pageNum: 1,
432 // 每页大小 480 // 每页大小
433 pageSize: 10, 481 pageSize: 10,
  482 + starttime:'',
  483 + endtime:'',
434 }, 484 },
  485 + creattime:'',
435 total: 0, 486 total: 0,
436 tableData:[], 487 tableData:[],
437 //新增编辑 488 //新增编辑
@@ -594,6 +645,21 @@ @@ -594,6 +645,21 @@
594 fwbRules:{}, 645 fwbRules:{},
595 } 646 }
596 }, 647 },
  648 + computed:{
  649 + //选中的时间段
  650 + searchTime: {
  651 + get:function () {
  652 + return this.creattime
  653 + },
  654 + set:function (val) {
  655 + this.creattime = val
  656 + if (val && val.length===2){
  657 + this.queryInfo.starttime = val[0]
  658 + this.queryInfo.endtime = val[1]
  659 + }
  660 + }
  661 + },
  662 + },
597 methods: { 663 methods: {
598 //获取所属库位 664 //获取所属库位
599 // getLo:function(query){ 665 // getLo:function(query){