<template>
    <v-dialog v-model="$store.state.SendSMS" width="60%" transition="slide-x-transition">
        <v-card class="RTL">
            <v-card-title class="grey lighten-3" primary-title>
                <WM-PartTitle class="WM-Margin-T-20" TitleFa=" ارسال پیام کوتاه " TitleEn=" Sending a Text Message " Color="orange darken-3"></WM-PartTitle>
            </v-card-title>

            <v-card-text>
                <v-layout row wrap class="WM-Padding-RL-20">
                    <v-flex md4>
                        <v-card-text class="hasConfig">
                            <v-autocomplete prepend-icon="fas fa-align-right" :items="smsTemplates" color="orange" item-text="name" label=" قالب پیام کوتاه "></v-autocomplete>
                            <v-tooltip bottom color="black">
                                <v-btn class="XS" @click.native="$store.state.ConfigSMSTemplateList = true" slot="activator" outline fab color="black" dark>
                                    <v-icon dark>fas fa-pencil-alt</v-icon>
                                </v-btn>
                                <span> ویرایش دسته ها </span>
                            </v-tooltip>
                        </v-card-text>
                    </v-flex>
                    <v-flex md8>
                        <v-card-text style="padding-top:0px;">
                            <v-select v-model="clientNumberValues" :items="clientNumbers"  color="orange" attach chips label=" شماره های مورد نظر " multiple></v-select>
                        </v-card-text>
                    </v-flex>
                    <v-flex md12>
                        <v-card-text class="WM-JustSide">
                            <v-textarea name="input-7-1" label="لطفا پیام خود را بنویسید" value="" hint="هر پیام 53 کاراکتر " color="orange darken-3" prepend-icon="fas fa-envelope"></v-textarea>
                        </v-card-text>
                    </v-flex>
                </v-layout>
                <!-- -------------------------------------------------------------
                                        Remind Me
                ------------------------------------------------------------- -->
                <v-layout row wrap class="WM-Section" style="border-right-color: #ef6c00;">
                    <v-flex xs12 sm12 md5 class="RTL text-lg-right">
                        <div class="Step En" style="color:#ef6c00;"> SBS </div>
                        <div class="Title">
                            <div class="FA">  ارســــال با زمـــــان بــــــندی    </div>
                            <div class="EN"> Send By Schedule  </div>
                        </div>
                        <v-switch style="float:left; margin-left:10px;" @change="scheduleState = !scheduleState" color="orange" v-model="Schedule"></v-switch>
                    </v-flex>
                    <v-flex xs12 sm12 md7 :class="[ scheduleState ? 'has-blur' : '' ]">
                        <v-layout row wrap>
                            <v-flex xs12 sm4 md6>
                                <v-card-text>
                                    <v-menu :close-on-content-click="false" v-model="scheduleDateState" :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="purple" readonly></v-text-field>
                                        <v-date-picker v-model="date" @input="scheduleDateState = false" color="purple" locale="fa-ir"></v-date-picker>
                                    </v-menu>
                                </v-card-text>
                            </v-flex>
                            <v-flex xs12 sm4 md6>
                                <v-card-text>
                                    <v-menu ref="selfTimeMenu" v-model="scheduleTimeState" :close-on-content-click="false" :nudge-right="40" :return-value.sync="scheduleTime" lazy transition="slide-y-transition" offset-y full-width max-width="290px" min-width="290px">
                                        <template v-slot:activator="{ on }">
                                            <v-text-field v-model="scheduleTime" label="در ساعت" prepend-icon="fas fa-clock" class="text-lg-center" readonly color="purple" v-on="on"></v-text-field>
                                        </template>
                                        <v-time-picker class="LTR" v-if="scheduleTimeState" v-model="scheduleTime" color="purple" full-width  @click:minute="$refs.scheduleTimeState.save(selfTime)" locale="fa-ir"></v-time-picker>
                                    </v-menu>
                                </v-card-text>
                            </v-flex>
                        </v-layout>
                    </v-flex>
                </v-layout>
            </v-card-text>

            <v-divider></v-divider>

            <v-card-actions>
                <v-spacer></v-spacer>
                <v-btn color="orange darken-3" depressed dark @click="$store.state.SendSMS = false">
                    <v-icon dark right>fa fa-angle-left</v-icon> ارسال پیام
                </v-btn>
            </v-card-actions>
        </v-card>


        <!-- --------------------------------------------------------------------
                                    Modals :: BEGIN
        -------------------------------------------------------------------- -->
        <template>
            <div class="text-xs-center">
                <wm-sms-templates-edit></wm-sms-templates-edit>
            </div>
        </template>
        <!-- --------------------------------------------------------------------
                                    Modals :: END
        -------------------------------------------------------------------- -->
    </v-dialog>

</template>

<script>
import TemplatesEdit from "@Common/components/Contact/SMS/Config/Template/Modal-Layout.vue";
export default {
    components: {
        'wm-sms-templates-edit'  :  TemplatesEdit,
    },
    props: {
        Color:     { default: 'grey darken-4' },
    },
    data () {
        return {
            date: new Date().toISOString().substr(0, 10),
            smsTemplates: [
                { name: ' تبریک تولد ', id: 1 },
                { name: ' تبریک سال نو ', id: 2 },
                { name: ' تبریک عید فطر ', id: 3 },
            ],
            clientNumbers: [' 09127004945 ', ' 09300705030 '],
            clientNumberValues: [' 09127004945 ', ' 09300705030 '],
            scheduleState: true,
            scheduleDateState: false,
            scheduleTime: '12:00',
            scheduleTimeState: false,

        }
    }
};
</script>
