<template>
    <el-dialog
    title="统计表"
    width="800px"
    :visible.sync="visible"
    :before-close="_close"
    >
    <div>
        <el-date-picker
        style="width:140px;margin-right:10px"
        v-model="startTime"
        type="date"
        placeholder="选择日期">
        </el-date-picker>
        <el-date-picker
        style="width:140px;margin-right:10px"
        v-model="endTime"
        type="date"
        placeholder="选择日期">
        </el-date-picker>
        <el-select style="width:140px;margin-right:10px" v-model="schedulType" placeholder="请选择">
            <el-option
            v-for="item in schedulArr"
            :key="item.value"
            :label="item.label"
            :value="item.value">
            </el-option>
        </el-select>
        <el-select style="width:140px;margin-right:10px" v-model="partitionType" placeholder="请选择">
            <el-option
            v-for="item in partitionArr"
            :key="item.id"
            :label="item.name"
            :value="item.id">
            </el-option>
        </el-select>
        <el-button icon="el-icon-printer" type="primary" @click="toPrint">打印</el-button>
        
    </div>
    <div style="margin-top:10px;">
        <el-table :data="tableData" border style="width: 100%" height="300">
            <el-table-column
            align="center"
            prop="address"
            label="地址">
            </el-table-column>
            <el-table-column
            align="center"
            prop="name"
            label="姓名"
            width="100">
            </el-table-column>
        </el-table>
    </div>
    <!-- <div slot="footer" class="dialog-footer">
      <el-button @click="hide">取 消</el-button>
      <el-button type="primary" @click="submitAction()">保 存</el-button>
    </div> -->
  </el-dialog>
</template>



<script>
import { GetAllZone } from "@/api/dialysis";
export default {
    data(){
        return{
            visible: false,
            startTime:'',
            endTime:'',
            schedulArr: [
                {value: 0, label: '全部班'},
                {value: 1, label: '上午'},
                {value: 2, label: '中午'},
                {value: 3, label: '下午'},
            ],
            schedulType: 0,
            partitionArr:[],
            partitionType: 0,
            tableData: [{
                date: '2016-05-02',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
                }, {
                date: '2016-05-04',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1517 弄'
                }, {
                date: '2016-05-01',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1519 弄'
                }, {
                date: '2016-05-03',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1516 弄'
            }]
        }
    },
    created(){
        this.getAllZone()
    },
    methods:{
        _close: function(done) {
            done();
        },
        show() {
            this.visible = true;
        },
        getAllZone: function() {
            GetAllZone().then(response => {
                if (response.data.state == 0) {
                this.$message.error(response.data.msg);
                return false;
                } else {
                this.partitionArr = response.data.data.zone;
                this.partitionArr.unshift({ id: 0, name: "全部分区" });
                }
            });
        },
        toPrint(){
            this.$router.push({
                path: '/dialysis/dialysisDrugs_print',
                // query: { date: date }
            })
        }
    }
}
</script>
