作者 小范

库存变更记录添加查询时间段条件

@@ -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="5"> 7 <el-col :span="5">
7 <el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 240px" 8 <el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 240px"
8 placeholder="主单号" clearable> 9 placeholder="主单号" clearable>
@@ -23,10 +24,10 @@ @@ -23,10 +24,10 @@
23 <el-option label="出入库类型-出" value="E"></el-option> 24 <el-option label="出入库类型-出" value="E"></el-option>
24 </el-select> 25 </el-select>
25 </div> 26 </div>
26 -<!-- <el-input v-model="queryInfo.ietype" prefix-icon="el-icon-search" size="small" style="width: 240px"-->  
27 -<!-- placeholder="类型" clearable>-->  
28 -<!-- <template slot="prepend">类型</template>-->  
29 -<!-- </el-input>--> 27 + <!-- <el-input v-model="queryInfo.ietype" prefix-icon="el-icon-search" size="small" style="width: 240px"-->
  28 + <!-- placeholder="类型" clearable>-->
  29 + <!-- <template slot="prepend">类型</template>-->
  30 + <!-- </el-input>-->
30 </el-col> 31 </el-col>
31 <el-col :span="5"> 32 <el-col :span="5">
32 <el-input v-model="queryInfo.custcode" prefix-icon="el-icon-search" size="small" style="width: 240px" 33 <el-input v-model="queryInfo.custcode" prefix-icon="el-icon-search" size="small" style="width: 240px"
@@ -34,13 +35,32 @@ @@ -34,13 +35,32 @@
34 <template slot="prepend">客户代码</template> 35 <template slot="prepend">客户代码</template>
35 </el-input> 36 </el-input>
36 </el-col> 37 </el-col>
  38 + </el-row>
  39 + <el-row>
  40 + <el-col :span="10">
  41 + <div class="my-text-area">
  42 + <div class="el-input-group__prepend prepand">时间段</div>
  43 + <el-date-picker
  44 + v-model="searchTime"
  45 + type="daterange"
  46 + unlink-panels
  47 + range-separator="至"
  48 + start-placeholder="开始日期"
  49 + end-placeholder="结束日期"
  50 + value-format="yyyy-MM-dd HH:mm:ss"
  51 + format="yyyy-MM-dd HH:mm:ss"
  52 + :picker-options="pickerOptions">
  53 + </el-date-picker>
  54 + </div>
  55 + </el-col>
37 <el-col :span="4"> 56 <el-col :span="4">
38 <el-button type="primary" icon="el-icon-search" size="small" @click="getList()"> 57 <el-button type="primary" icon="el-icon-search" size="small" @click="getList()">
39 查询 58 查询
40 </el-button> 59 </el-button>
41 -<!-- <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>--> 60 + <!-- <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>-->
42 </el-col> 61 </el-col>
43 </el-row> 62 </el-row>
  63 + </el-row>
44 <el-row> 64 <el-row>
45 <el-dialog :title="dialogMap[dialogApply]" :visible.sync="apply_dialog.addDialog" width="80%" > 65 <el-dialog :title="dialogMap[dialogApply]" :visible.sync="apply_dialog.addDialog" width="80%" >
46 <el-form :model="addForm" :rules="rules" ref="addForm" style="margin-top: 40px"> 66 <el-form :model="addForm" :rules="rules" ref="addForm" style="margin-top: 40px">
@@ -258,6 +278,33 @@ @@ -258,6 +278,33 @@
258 }, 278 },
259 data() { 279 data() {
260 return { 280 return {
  281 + pickerOptions: {
  282 + shortcuts: [{
  283 + text: '最近一周',
  284 + onClick(picker) {
  285 + const end = new Date();
  286 + const start = new Date();
  287 + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  288 + picker.$emit('pick', [start, end]);
  289 + }
  290 + }, {
  291 + text: '最近一个月',
  292 + onClick(picker) {
  293 + const end = new Date();
  294 + const start = new Date();
  295 + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  296 + picker.$emit('pick', [start, end]);
  297 + }
  298 + }, {
  299 + text: '最近三个月',
  300 + onClick(picker) {
  301 + const end = new Date();
  302 + const start = new Date();
  303 + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  304 + picker.$emit('pick', [start, end]);
  305 + }
  306 + }]
  307 + },
261 queryInfo: { 308 queryInfo: {
262 waybill:'', 309 waybill:'',
263 billfhl:'', 310 billfhl:'',
@@ -267,7 +314,10 @@ @@ -267,7 +314,10 @@
267 pageNum: 1, 314 pageNum: 1,
268 // 每页大小 315 // 每页大小
269 pageSize: 10, 316 pageSize: 10,
  317 + starttime:'',
  318 + endtime:'',
270 }, 319 },
  320 + creattime:'',
271 total: 0, 321 total: 0,
272 // tableData:[], 322 // tableData:[],
273 dialogMap: { 323 dialogMap: {
@@ -352,12 +402,28 @@ @@ -352,12 +402,28 @@
352 }, 402 },
353 } 403 }
354 }, 404 },
  405 + computed:{
  406 + //选中的时间段
  407 + searchTime: {
  408 + get:function () {
  409 + return this.creattime
  410 + },
  411 + set:function (val) {
  412 + this.creattime = val
  413 + if (val && val.length===2){
  414 + this.queryInfo.starttime = val[0]
  415 + this.queryInfo.endtime = val[1]
  416 + }
  417 + }
  418 + },
  419 + },
355 methods: { 420 methods: {
356 zancun(){ 421 zancun(){
357 this.zancundata.push(this.addForm); 422 this.zancundata.push(this.addForm);
358 console.log(this.zancundata) 423 console.log(this.zancundata)
359 }, 424 },
360 getList() { 425 getList() {
  426 + console.log("queryinfo---->"+this.queryInfo)
361 this.$refs.tabulation.getList(this.queryInfo) 427 this.$refs.tabulation.getList(this.queryInfo)
362 428
363 }, 429 },