<template>
    <div class="container_fluid">
        <PageTitle TitleFa=" مدیریت سفارشات " TitleEn=" Orders Management " Color="orange darken-3" TitleFaClass="WM-Color-Black"></PageTitle>
        <v-alert :value="true" color="grey lighten-2" dismissible outline>
            <PartTitle class="WM-Margin-T-20" TitleFa=" خلاصه ای از آمار " TitleEn=" Statistics Summery " ThemeColor="Orange"></PartTitle>
            <v-layout row wrap class="WM-Margin-T-20">
                <v-flex xs12 sm6 md4> <DoughnutChart :height="280"></DoughnutChart> </v-flex>
            </v-layout>
        </v-alert>

        <ul class="nav nav-tabs WM-Margin-T-20" id="WMTabs">
            <template v-for="(Tab, index) in Tabs">
                <component :is="Tab.Type" :TitleFa="Tab.NameFa" :TitleEn="Tab.NameEn" :Status="Tab.Status" :Quantity="Tab.Quantity" :SubItems="Tab.SubItems" :TabContent="index" Color="Orange"></component>
            </template>
        </ul>


        <div class="tab-content">
            <div class="tab-pane container-fluid active" id="OngoingOrders">
                <PartTitle class="WM-Margin-T-20" TitleFa=" سفارشات در حال انجام " TitleEn=" Ongoing Orders " ThemeColor="Orange"></PartTitle>
                <v-layout row wrap class="WM-Margin-T-20">
                    <v-flex xs12 sm4 md3>
                        <v-menu :close-on-content-click="false" v-model="DateFilterBefore" :nudge-right="40" lazy transition="slide-y-transition" offset-y full-width min-width="290px">
                            <v-text-field slot="activator" v-model="date" label=" سفارشات قبل از تاریخ " prepend-icon="fas fa-calendar-alt" color="orange darken-3" readonly></v-text-field>
                            <v-date-picker v-model="date" @input="DateFilterBefore = false" color="orange darken-3" locale="fa-ir"></v-date-picker>
                        </v-menu>
                    </v-flex>
                    <v-flex xs12 sm4 md3>
                        <v-menu :close-on-content-click="false" v-model="DateFilterAfter" :nudge-right="40" lazy transition="slide-y-transition" offset-y full-width min-width="290px">
                            <v-text-field slot="activator" v-model="date" label=" سفارشات بعد از تاریخ " prepend-icon="fas fa-calendar-alt" color="orange darken-3" readonly></v-text-field>
                            <v-date-picker v-model="date" @input="DateFilterAfter = false" color="orange darken-3" locale="fa-ir"></v-date-picker>
                        </v-menu>
                    </v-flex>

                </v-layout>
            </div>
            <div class="tab-pane container fade" id="CompletedOrders">  </div>
        </div>

    </div>

</template>



<script>
import QuickLink from "../../components/Misc/QuickLink.vue";
import TabItem from "../../components/Misc/TabItem.vue";
import TabDropdownItem from "../../components/Misc/TabDropdownItem.vue";
import DoughnutChart from '../../components/Charts/DoughnutChart.vue';

export default {
    components: {
        QuickLink,
        TabItem,
        TabDropdownItem,
        DoughnutChart
    },
    data: function ()  {
        return {
            date: new Date().toISOString().substr(0, 10),
            DateFilterAfter: false,
            DateFilterBefore: false,
            Tabs: {
                OngoingOrders: {
                    Type: 'TabItem',
                    NameFa: ' سفارشات در حال انجام ',
                    NameEn: ' Ongoing Orders ',
                    Status: 'Active',
                    Quantity: 5
                },
                CompletedOrders: {
                    Type: 'TabItem',
                    NameFa: ' سفارشات انجام شده ',
                    NameEn: ' Completed Orders ',
                    Quantity: 42
                },
            },

        }
    },
};


</script>
