// 短信实绩
<template>
    <div class="sale">
        <div class="top">
            <!-- 框计算 -->
            <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
            </el-date-picker>
            <span class="text1">至</span>
            <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
            </el-date-picker>
            <el-input
                placeholder="请输入车牌号"
                v-model="inputText"
                clearable>
            </el-input>
            <el-button type="primary" class="btn" @click="onclick">
                <i class="el-icon-search"></i>查询
            </el-button>
        </div>
        <div class="tab">
            <dilTable v-bind.sync="option" max-height="300"></dilTable>
        </div>
    </div>
</template>
<script>
import { sjTime } from "@/utils/sharedJsFile";
export default {
    data(){
        return{
            startTime: null,
            endTime: null,
            inputText:'',
            option: {       
                // 表格请求数据的地址
                requestUrl: "/api/v1/tms/getSmsResult?apiId=175&orderType=1",
            },
        }
    },
    methods:{
        onclick(){
            let startTime = null;
            let endTime = null;
            if(this.startTime){
                startTime = sjTime(this.startTime);
            }
            if(this.endTime){
                endTime = sjTime(this.endTime);
            }
            let option = {       
                requestQuery:{},
                requestUrl : "/api/v1/tms/getSmsResult?apiId=175&orderType=1&con="+this.inputText+"&i=" +new Date()
            }
            if(startTime && endTime){
                if(startTime >= endTime){
                    this.startTime = null;
                    this.endTime = null;
                    this.$message.warning('开始时间要比结束时间早')
                    return;
                }
            }
            option.requestQuery.startTime=startTime;
            option.requestQuery.endTime=endTime;
            this.option=option;
            this.$forceUpdate();
        }
    }
}
</script>
<style lang="scss" scoped>
    .sale{
        .top{
            padding: 1.25rem 0.375rem;
			.el-input {
			width: 20%;
			margin-right: 1.25rem;
			}
        }
    }
</style>