[text] test

Viewer

  1. <template>
  2.   <div class="">
  3.     <div
  4.       class="
  5.         container
  6.         items-center
  7.         flex flex-col
  8.         justify-center
  9.         h-36
  10.         rounded-md
  11.       "
  12.       v-bind:class="{ showTheConfirmation: isConfirmed }"
  13.     >
  14.       <div class="flex pb-2 animate-bounce">
  15.         <img :src="rightLogo" class="h-6" alt="" />
  16.         <p class="font-bold pl-2 text-xl">
  17.           Your booking request has been taken
  18.         </p>
  19.       </div>
  20.       <p class="text-center text-2xl text-red-600">
  21.         We have received your booking request, once approved you will receive an
  22.         email confirmation.
  23.       </p>
  24.     </div>
  25.     <div class="" v-bind:class="{ hideAccordion: isShowingAccordian }">
  26.       <div class="py-4">
  27.         <select
  28.           style="width: 30vw"
  29.           class="
  30.             text-base text-gray-700
  31.             bg-white
  32.             border border-solid border-gray-300
  33.             rounded
  34.             transition
  35.             ease-in-out
  36.             pl-4
  37.             py-2
  38.           "
  39.           required
  40.           v-model="formData.listOfRooms"
  41.           aria-label=""
  42.           @change="getCalenderData($event)"
  43.         >
  44.           <!-- <option>Select Room</option> -->
  45.           <option
  46.             v-for="room in listOfRooms"
  47.             :value="room.value"
  48.             :key="room.value"
  49.             class="py-1"
  50.           >
  51.             {{ room.label }}
  52.           </option>
  53.  
  54.           <!-- <option value="room1">Room 1</option>
  55.                       <option value="room2">Room 2</option> -->
  56.         </select>
  57.       </div>
  58.       <div class="tabs">
  59.         <div class="tab mb-4" v-bind:class="{ disableDateTab: isDateDisable }">
  60.           <input
  61.             type="radio"
  62.             id="rd1"
  63.             name="rd"
  64.             v-on:click="handleCloseButton1"
  65.           />
  66.           <label class="tab-label font-bold" for="rd1"
  67.             >Select Date and Time</label
  68.           >
  69.           <div class="tab-content">
  70.             <div class="container calender-height">
  71.               <!-- * Selected Time must be atleast <span class="font-extrabold text-gray-700"> 1 hour</span> -->
  72.               <vue-cal
  73.                 ref="vuecal"
  74.                 class="h-full"
  75.                 hide-weekends
  76.                 :time-from="0 * 60"
  77.                 style="height: 80vh"
  78.                 :special-hours="specialHours"
  79.                 :disable-views="['years', 'year', 'month', 'day']"
  80.                 :cell-click-hold="false"
  81.                 :drag-to-create-event="true"
  82.                 :snap-to-time="60"
  83.                 :editable-events="{
  84.                   title: false,
  85.                   drag: false,
  86.                   resize: true,
  87.                   delete: true,
  88.                   create: true,
  89.                 }"
  90.                 :clickToNavigate="true"
  91.                 :events="events"
  92.                 twelveHour
  93.                 @cell-click="
  94.                   $refs.vuecal.createEvent($event, 60, { class: 'blue-event' })
  95.                 "
  96.                 @event-duration-change="
  97.                   onEventChange('event-duration-change', $event)
  98.                 "
  99.                 :on-event-create="onEventCreate"
  100.               >
  101.               </vue-cal>
  102.               <div class="flex items-center justify-center w-full h-20">
  103.                 <button
  104.                   type="button"
  105.                   class="
  106.                     flex
  107.                     items-center
  108.                     justify-between
  109.                     px-6
  110.                     py-4
  111.                     text-md
  112.                     font-medium
  113.                     leading-5
  114.                     text-black
  115.                     transition-colors
  116.                     duration-150
  117.                     bg-white
  118.                     border-2
  119.                     rounded-full
  120.                     active:bg-blue-900
  121.                     hover:text-white
  122.                     focus:outline-none focus:shadow-outline-blue
  123.                   "
  124.                   v-on:click="handleCalenderSubmit"
  125.                 >
  126.                   Next
  127.                 </button>
  128.               </div>
  129.               <!-- <div class="calender-height border border-gray-800 p-4 rounded-md">
  130.                 <div
  131.                   class="
  132.                     fix-calender-hei
  133.                     flex
  134.                     justify-evenly
  135.                     w-full
  136.                     items-center
  137.                     text-center
  138.                   "
  139.                 >
  140.                   <div class="">
  141.                     <p class="text-base font-semibold pb-4">Select Date:</p>
  142.                     <v-calendar></v-calendar>
  143.                   </div>
  144.                   <div class="z-auto">
  145.                     <div class="">
  146.                       <p class="text-base font-semibold pb-4">Select Time:</p>
  147.                       <vue-timepicker></vue-timepicker>
  148.                       <p>to</p>
  149.                       <vue-timepicker></vue-timepicker>
  150.                     </div>
  151.                   </div>
  152.                 </div>
  153.               </div> -->
  154.             </div>
  155.           </div>
  156.         </div>
  157.         <div class="tab mb-4" v-bind:class="{ disableInfoTab: isInfoDisable }">
  158.           <input
  159.             type="radio"
  160.             id="rd2"
  161.             name="rd"
  162.             v-on:click="handleCloseButton2"
  163.           />
  164.           <label class="tab-label font-bold" for="rd2">Your Information</label>
  165.           <div class="tab-content">
  166.             <div
  167.               class="
  168.                 fix-input-width
  169.                 container
  170.                 border border-gray-800
  171.                 p-4
  172.                 rounded-md
  173.               "
  174.             >
  175.               <ValidationObserver ref="loginForm">
  176.                 <form class="w-full" method="post" v-on:submit.prevent>
  177.                   <div class="flex flex-col">
  178.                     <div
  179.                       class="
  180.                         flex flex-col
  181.                         md:flex-row
  182.                         w-full
  183.                         justify-evenly
  184.                         items-center
  185.                       "
  186.                     >
  187.                       <label
  188.                         for="fname"
  189.                         class="text-base font-medium text-gray-900 block mb-4"
  190.                         >Organization/Company Name
  191.                         <ValidationProvider v-slot="v" rules="">
  192.                           <input
  193.                             type="text"
  194.                             id="formData.companyName"
  195.                             name="Organization/Company Name"
  196.                             class="
  197.                               bg-gray-50
  198.                               border border-gray-300
  199.                               text-gray-900
  200.                               sm:text-sm
  201.                               rounded-lg
  202.                               block
  203.                               p-2.5
  204.                             "
  205.                             v-model="formData.companyName"
  206.                             placeholder="Enter company name"
  207.                           />
  208.                           <span class="text-sm font-semibold text-red-600">{{
  209.                             v.errors[0]
  210.                           }}</span>
  211.                         </ValidationProvider>
  212.                       </label>
  213.                       <label
  214.                         for="lname"
  215.                         class="text-base font-medium text-gray-900 block mb-4"
  216.                         >Contact Person
  217.                         <ValidationProvider
  218.                           v-slot="v"
  219.                           :rules="{
  220.                             regex:
  221.                               /^[A-Z]?[a-z][a-z]+\s?[A-Z]?[a-z][a-z]+\s?[A-Z]?[a-z][a-z]+$/,
  222.                           }"
  223.                         >
  224.                           <input
  225.                             type="text"
  226.                             id="formData.contactPersonName"
  227.                             name="Contact Person"
  228.                             class="
  229.                               bg-gray-50
  230.                               border border-gray-300
  231.                               text-gray-900
  232.                               sm:text-sm
  233.                               rounded-lg
  234.                               block
  235.                               p-2.5
  236.                             "
  237.                             v-model="formData.contactPersonName"
  238.                             required
  239.                             placeholder="Enter person's name"
  240.                           />
  241.                           <span class="text-sm font-semibold text-red-600">{{
  242.                             v.errors[0]
  243.                           }}</span>
  244.                         </ValidationProvider>
  245.                       </label>
  246.                     </div>
  247.                     <div
  248.                       class="
  249.                         flex flex-col
  250.                         md:flex-row
  251.                         w-full
  252.                         justify-evenly
  253.                         items-center
  254.                       "
  255.                     >
  256.                       <label
  257.                         for="email"
  258.                         class="text-base font-medium text-gray-900 block mb-4"
  259.                         >Email
  260.                         <ValidationProvider
  261.                           v-slot="v"
  262.                           :rules="{
  263.                             regex: /^[a-z0-9._-]+@[a-z0-9.-]+\.[a-z]{2,6}$/,
  264.                           }"
  265.                         >
  266.                           <input
  267.                             type="email"
  268.                             id="formData.contactEmail"
  269.                             name="Email"
  270.                             class="
  271.                               bg-gray-50
  272.                               border border-gray-300
  273.                               text-gray-900
  274.                               sm:text-sm
  275.                               rounded-lg
  276.                               block
  277.                               p-2.5
  278.                             "
  279.                             v-model="formData.contactEmail"
  280.                             required
  281.                             placeholder="Enter Email"
  282.                           />
  283.                           <span class="text-sm font-semibold text-red-600">{{
  284.                             v.errors[0]
  285.                           }}</span>
  286.                         </ValidationProvider>
  287.                       </label>
  288.                       <label
  289.                         for="mobile"
  290.                         class="text-base font-medium text-gray-900 block mb-4"
  291.                         >Phone Number
  292.                         <ValidationProvider
  293.                           v-slot="v"
  294.                           :rules="{
  295.                             regex: /^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/,
  296.                           }"
  297.                         >
  298.                           <div class="relative phone-number-fix">
  299.                             <input
  300.                               type="text"
  301.                               min="0"
  302.                               id="formData.phoneNumber"
  303.                               pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"
  304.                               name="Phone Number"
  305.                               class="
  306.                                 bg-gray-50
  307.                                 border border-gray-300
  308.                                 text-gray-900
  309.                                 sm:text-sm
  310.                                 rounded-lg
  311.                                 block
  312.                                 p-2.5
  313.                                 pl-12
  314.                               "
  315.                               v-model="formData.phoneNumber"
  316.                               required
  317.                               placeholder="Enter Phone Number"
  318.                             />
  319.                             <!-- <input
  320.                             type="tel"
  321.                             id="formData.phoneNumber"
  322.                             pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"
  323.                             maxlength="10"
  324.                             name="Phone Number"
  325.                             class="
  326.                               bg-gray-50
  327.                               border border-gray-300
  328.                               text-gray-900
  329.                               sm:text-sm
  330.                               rounded-lg
  331.                               block
  332.                               p-2.5
  333.                               pl-12
  334.                             "
  335.                             v-model="formData.phoneNumber"
  336.                             required
  337.                             placeholder="Enter Phone Number"
  338.                           /> -->
  339.                             <div
  340.                               class="
  341.                                 absolute
  342.                                 inset-y-0
  343.                                 flex
  344.                                 items-center
  345.                                 ml-3
  346.                                 pointer-events-none
  347.                               "
  348.                             >
  349.                               +61
  350.                             </div>
  351.                           </div>
  352.                           <!-- <label
  353.                         for="mobile"
  354.                         class="text-base font-medium text-gray-900 block mb-4"
  355.                         >Phone Number
  356.                         <ValidationProvider
  357.                           v-slot="v"
  358.                           :rules="{
  359.                             regex: /^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/,
  360.                           }"
  361.                         > -->
  362.                           <!-- <input
  363.                             type="tel"
  364.                             id="formData.phoneNumber"
  365.                             name="Phone Number"
  366.                             class="
  367.                               bg-gray-50
  368.                               border border-gray-300
  369.                               text-gray-900
  370.                               sm:text-sm
  371.                               rounded-lg
  372.                               block
  373.                               p-2.5
  374.                             "
  375.                             v-model="formData.phoneNumber"
  376.                             required
  377.                             placeholder="Enter Phone Number"
  378.                           /> -->
  379.                           <span class="text-sm font-semibold text-red-600">{{
  380.                             v.errors[0]
  381.                           }}</span>
  382.                         </ValidationProvider>
  383.                       </label>
  384.                     </div>
  385.                     <div
  386.                       class="
  387.                         flex flex-col
  388.                         md:flex-row
  389.                         w-full
  390.                         justify-evenly
  391.                         items-center
  392.                       "
  393.                     >
  394.                       <label
  395.                         for="email"
  396.                         class="text-base font-medium text-gray-900 block mb-4"
  397.                         >Expected Attendance
  398.                         <ValidationProvider v-slot="v" rules="">
  399.                           <input
  400.                             min="0"
  401.                             type="number"
  402.                             id="formData.expectedAttendance"
  403.                             name="Attendance"
  404.                             class="
  405.                               bg-gray-50
  406.                               border border-gray-300
  407.                               text-gray-900
  408.                               sm:text-sm
  409.                               rounded-lg
  410.                               block
  411.                               p-2.5
  412.                             "
  413.                             v-model="formData.expectedAttendance"
  414.                             placeholder="Enter expected attendance"
  415.                           />
  416.                           <span class="text-sm font-semibold text-red-600">{{
  417.                             v.errors[0]
  418.                           }}</span>
  419.                         </ValidationProvider>
  420.                       </label>
  421.  
  422.                       <label
  423.                         for="mobile"
  424.                         class="text-base font-medium text-gray-900 block mb-4"
  425.                         >Activity (Booking for)
  426.                         <ValidationProvider v-slot="v" rules="required">
  427.                           <textarea
  428.                             type="tel"
  429.                             id="formData.activityDetail"
  430.                             name="Activity"
  431.                             class="
  432.                               bg-gray-50
  433.                               border border-gray-300
  434.                               text-gray-900
  435.                               sm:text-sm
  436.                               rounded-lg
  437.                               block
  438.                               p-2.5
  439.                             "
  440.                             v-model="formData.activityDetail"
  441.                             required
  442.                             placeholder="Enter activity details briefly"
  443.                           />
  444.                           <span class="text-sm font-semibold text-red-600">{{
  445.                             v.errors[0]
  446.                           }}</span>
  447.                         </ValidationProvider>
  448.                       </label>
  449.                     </div>
  450.                   </div>
  451.                   <div class="flex items-center justify-center w-full h-20">
  452.                     <button
  453.                       type="submit"
  454.                       class="
  455.                         flex
  456.                         items-center
  457.                         justify-between
  458.                         px-6
  459.                         py-4
  460.                         text-md
  461.                         font-medium
  462.                         leading-5
  463.                         text-black
  464.                         transition-colors
  465.                         duration-150
  466.                         bg-white
  467.                         border-2
  468.                         rounded-full
  469.                         active:bg-blue-900
  470.                         hover:text-white
  471.                         focus:outline-none focus:shadow-outline-blue
  472.                       "
  473.                       v-on:click="handleNextButton"
  474.                     >
  475.                       Next
  476.                     </button>
  477.                   </div>
  478.                 </form>
  479.               </ValidationObserver>
  480.             </div>
  481.           </div>
  482.         </div>
  483.         <div class="tab mb-4" v-bind:class="{ disableInfoTab: isInfoDisable }">
  484.           <input
  485.             type="radio"
  486.             id="rd3"
  487.             name="rd"
  488.             v-on:click="handleCloseButton3"
  489.           />
  490.           <label class="tab-label font-bold" for="rd3">Epuipments</label>
  491.           <div class="tab-content">
  492.             <div
  493.               class="
  494.                 fix-input-width
  495.                 container
  496.                 border border-gray-800
  497.                 p-4
  498.                 rounded-md
  499.               "
  500.             >
  501.               <table class="table w-full">
  502.                 <thead>
  503.                   <tr>
  504.                     <th class="text-center" style="width:3%;"></th>
  505.                     <th class="text-center" style="width:20%;"></th>
  506.                     <th class="text-center" style="width:50%;"></th>
  507.                     <th class="text-center" style="width:27%;"></th>
  508.                   </tr>
  509.                 </thead>
  510.                 <tbody id="requipementTable">
  511.                   
  512.                 
  513.                 </tbody>
  514.               </table>
  515.             <div class="flex items-center justify-center w-full h-16">
  516.               <button
  517.                 type="submit"
  518.                 class="
  519.                   flex
  520.                   items-center
  521.                   justify-between
  522.                   px-6
  523.                   py-4
  524.                   text-md
  525.                   font-medium
  526.                   leading-5
  527.                   text-black
  528.                   transition-colors
  529.                   duration-150
  530.                   bg-white
  531.                   border-2
  532.                   rounded-full
  533.                   active:bg-blue-900
  534.                   hover:text-white
  535.                   focus:outline-none focus:shadow-outline-blue
  536.                 "
  537.                 v-on:click="handleExtraNextButton"
  538.               >
  539.                 Next
  540.               </button>
  541.             </div>
  542.             </div>
  543.           </div>
  544.         </div>
  545.         <div class="tab mb-4" v-bind:class="{ disableClick: isDisable }">
  546.           <input
  547.             type="radio"
  548.             id="rd4"
  549.             name="rd"
  550.             v-on:click="handleCloseButton4"
  551.           />
  552.           <label class="tab-label font-bold" for="rd4">Confirm Booking</label>
  553.           <div class="tab-content">
  554.             <div
  555.               class="
  556.                 fix-input-width
  557.                 container
  558.                 border border-gray-800
  559.                 p-4
  560.                 rounded-md
  561.               "
  562.             >
  563.               <div class="flex flex-col tracking-wider">
  564.                 <div class="grid grid-cols-2 md:gap-x-32 my-4">
  565.                   <div class="md:pl-64"><p>Booking Date & Time :</p></div>
  566.                   <div class="font-semibold flex flex-col md:flex-row">
  567.                     <p class="pr-4">{{ formData.bookingDate }}</p>
  568.                     <p>{{ formData.bookingTime }}</p>
  569.                   </div>
  570.                 </div>
  571.                 <div class="grid grid-cols-2 md:gap-x-32 my-4">
  572.                   <div class="md:pl-64"><p>Organization/Company Name :</p></div>
  573.                   <div class="font-semibold">
  574.                     <p>{{ formData.companyName }}</p>
  575.                   </div>
  576.                 </div>
  577.                 <div class="grid grid-cols-2 md:gap-x-32 my-4">
  578.                   <div class="md:pl-64"><p>Contact Person :</p></div>
  579.                   <div class="font-semibold">
  580.                     <p>{{ formData.contactPersonName }}</p>
  581.                   </div>
  582.                 </div>
  583.                 <div class="grid grid-cols-2 md:gap-x-32 my-4">
  584.                   <div class="md:pl-64"><p>Email :</p></div>
  585.                   <div class="font-semibold">
  586.                     <p>{{ formData.contactEmail }}</p>
  587.                   </div>
  588.                 </div>
  589.                 <div class="grid grid-cols-2 md:gap-x-32 my-4">
  590.                   <div class="md:pl-64"><p>Phone Number :</p></div>
  591.                   <div class="font-semibold">
  592.                     <p>+61 {{ formData.phoneNumber }}</p>
  593.                   </div>
  594.                 </div>
  595.                 <div class="grid grid-cols-2 md:gap-x-32 my-4">
  596.                   <div class="md:pl-64"><p>Expected Attendance :</p></div>
  597.                   <div class="font-semibold">
  598.                     <p>{{ formData.expectedAttendance }}</p>
  599.                   </div>
  600.                 </div>
  601.                 <div class="grid grid-cols-2 md:gap-x-32 my-4">
  602.                   <div class="md:pl-64"><p>Activity :</p></div>
  603.                   <div class="">
  604.                     <p class="font-semibold" id="activityPara">
  605.                       {{ formData.activityDetail }}
  606.                     </p>
  607.                   </div>
  608.                 </div>
  609.                 <!-- <div class="grid grid-cols-2 md:gap-x-32 my-4">
  610.                   <div class="md:pl-64"><p>Select Hall :</p></div>
  611.  
  612.                 </div> -->
  613.               </div>
  614.  
  615.               <div class="flex items-center justify-center w-full h-20 mt-4">
  616.                 <button
  617.                   class="
  618.                     flex
  619.                     items-center
  620.                     justify-between
  621.                     px-6
  622.                     py-4
  623.                     text-md
  624.                     font-medium
  625.                     leading-5
  626.                     text-black
  627.                     transition-colors
  628.                     duration-150
  629.                     bg-white
  630.                     border-2
  631.                     rounded-full
  632.                     active:bg-blue-900
  633.                     hover:text-white
  634.                     focus:outline-none focus:shadow-outline-blue
  635.                   "
  636.                   v-on:click="handleConfirmBtn"
  637.                 >
  638.                   <span class="pr-1">Confirm</span>
  639.                 </button>
  640.               </div>
  641.               <!-- </form> -->
  642.             </div>
  643.           </div>
  644.         </div>
  645.         <div class="tab">
  646.           <input type="radio" id="rd5" name="rd" />
  647.           <label for="rd5" class="tab-close"></label>
  648.         </div>
  649.       </div>
  650.     </div>
  651.   </div>
  652. </template>
  653.  
  654. <script>
  655. import VueCal from "vue-cal";
  656. import Vue from "vue";
  657. import "vue-cal/dist/vuecal.css";
  658. // import { ValidationProvider } from 'vee-validate';
  659. import { ValidationObserver } from "vee-validate";
  660. import { ValidationProvider } from "vee-validate/dist/vee-validate.full.esm";
  661. import { regex } from "vee-validate/dist/rules";
  662. import { extend } from "vee-validate";
  663.  
  664. extend("regex", regex);
  665. Vue.component("ValidationProvider", ValidationProvider);
  666. Vue.component("ValidationObserver", ValidationObserver);
  667.  
  668. extend("password", {
  669.   message:
  670.     "{_field_} must be at least 8 characters, contain One Uppercase, One lowercase, One Special character i.e (! @ # $ % ^ & *), One number.",
  671.   validate: (value) => {
  672.     const strong_password = new RegExp(
  673.       "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})"
  674.     ); // regex to check our strong password
  675.  
  676.     return strong_password.test(value); //Test the regex. Test function returns a true or false value.
  677.   },
  678. });
  679.  
  680. export default {
  681.   components: { VueCal },
  682.   data() {
  683.     return {
  684.       bookedevent: null,
  685.       events: [],
  686.       newEvents: [],
  687.       specialHours: null,
  688.       recordCalenderClick1: 1,
  689.       recordCalenderClick2: 1,
  690.       recordCalenderClick3: 1,
  691.       recordCalenderClick4: 1,
  692.       selectedEvent: null,
  693.       extras:[],
  694.  
  695.       formData: {
  696.         companyName: "",
  697.         contactPersonName: "",
  698.         contactEmail: "",
  699.         phoneNumber: "",
  700.         expectedAttendance: "",
  701.         activityDetail: "",
  702.         bookingTime: "",
  703.         bookingDate: "",
  704.         listOfRooms: "",
  705.         output: "",
  706.         selectedDay: "",
  707.         selectedFromTime: "",
  708.         selectedToTime: "",
  709.         Time: "",
  710.         checkedCheckbox: [],
  711.       },
  712.  
  713.       listOfRooms: [
  714.         { value: "", label: "Select Hall" },
  715.         { value: "1", label: "Hall 1" },
  716.         { value: "2", label: "Hall 2" },
  717.       ],
  718.  
  719.       rightLogo: "assets/images/right.png",
  720.       isConfirmed: true,
  721.       isShowingAccordian: false,
  722.       isDisable: true,
  723.       isInfoDisable: true,
  724.       isDateDisable: true,
  725.       changedValue: 0,
  726.     };
  727.   },
  728.  
  729.   mounted(){
  730.     // this.extras = this.$store.getters.getCurrentExtra;
  731.   },
  732.  
  733.   methods: {
  734.     increaseCount() {
  735.       let quantityValue = document.querySelector("#qty").value;
  736.       this.changedValue = Number(quantityValue) + 1;
  737.       document.getElementById("qty").value = this.changedValue;
  738.     },
  739.  
  740.     decreaseCount() {
  741.       let quantityValue = document.querySelector("#qty").value;
  742.       this.changedValue = Number(quantityValue) - 1;
  743.       document.getElementById("qty").value = this.changedValue;
  744.     },
  745.  
  746.     deleteEvents() {
  747.       if (this.newEvents.length === 1) {
  748.         this.events.pop();
  749.       }
  750.       this.newEvents.pop();
  751.     },
  752.     getCalenderData(e) {
  753.       let selectedRooms = this.formData.listOfRooms;
  754.       let currentObj = this;
  755.       (currentObj.events.length = 0),
  756.         (currentObj.newEvents.length = 0),
  757.         this.axios
  758.           .get("api/get-calendar?selectedRooms=" + selectedRooms)
  759.           .then(function (response) {
  760.             currentObj.bookedevent = response.data.bookedDate;
  761.  
  762.             (currentObj.specialHours = {
  763.               1: {
  764.                 from:
  765.                   parseInt(response.data.selectedRooms[0]["timing_from"]) * 60,
  766.                 to: parseInt(response.data.selectedRooms[0]["timing_to"]) * 60,
  767.                 class: "business-hours",
  768.               },
  769.               2: {
  770.                 from:
  771.                   parseInt(response.data.selectedRooms[1]["timing_from"]) * 60,
  772.                 to: parseInt(response.data.selectedRooms[1]["timing_to"]) * 60,
  773.                 class: "business-hours",
  774.               },
  775.               3: {
  776.                 from:
  777.                   parseInt(response.data.selectedRooms[2]["timing_from"]) * 60,
  778.                 to: parseInt(response.data.selectedRooms[2]["timing_to"]) * 60,
  779.                 class: "business-hours",
  780.               },
  781.               4: {
  782.                 from:
  783.                   parseInt(response.data.selectedRooms[4]["timing_from"]) * 60,
  784.                 to: parseInt(response.data.selectedRooms[3]["timing_to"]) * 60,
  785.                 class: "business-hours",
  786.               },
  787.               5: {
  788.                 from:
  789.                   parseInt(response.data.selectedRooms[4]["timing_from"]) * 60,
  790.                 to: parseInt(response.data.selectedRooms[4]["timing_to"]) * 60,
  791.                 class: "business-hours",
  792.               },
  793.             }),
  794.               response.data.bookedDate.forEach(function (number) {
  795.                 currentObj.events.push({
  796.                   start: number.from_time,
  797.                   end: number.to_time,
  798.                   title: "Booked event",
  799.                   content: null,
  800.                   class: "red-event",
  801.                   deletable: false,
  802.                   resizable: false,
  803.                   draggable: false,
  804.                 });
  805.               });
  806.           })
  807.           .catch(function (error) {
  808.             currentObj.output = error;
  809.           });
  810.       this.isDateDisable = false;
  811.     },
  812.  
  813.     handleCloseButton1(e) {
  814.       this.recordCalenderClick1 = this.recordCalenderClick1 + 1;
  815.       if (this.recordCalenderClick1 == 2) {
  816.         document.getElementById("rd1").checked = true;
  817.         this.recordCalenderClick2 = 1;
  818.         this.recordCalenderClick3 = 1;
  819.         this.recordCalenderClick4 = 1;
  820.       } else {
  821.         document.getElementById("rd1").checked = false;
  822.         this.recordCalenderClick1 = 1;
  823.       }
  824.     },
  825.  
  826.     handleCloseButton2(e) {
  827.       this.recordCalenderClick2 = this.recordCalenderClick2 + 1;
  828.       if (this.recordCalenderClick2 == 2) {
  829.         document.getElementById("rd2").checked = true;
  830.         this.recordCalenderClick1 = 1;
  831.         this.recordCalenderClick3 = 1;
  832.         this.recordCalenderClick4 = 1;
  833.       } else {
  834.         document.getElementById("rd2").checked = false;
  835.         this.recordCalenderClick2 = 1;
  836.       }
  837.     },
  838.  
  839.     handleCloseButton3(e) {
  840.       this.recordCalenderClick3 = this.recordCalenderClick3 + 1;
  841.       if (this.recordCalenderClick3 == 2) {
  842.         document.getElementById("rd3").checked = true;
  843.         this.recordCalenderClick2 = 1;
  844.         this.recordCalenderClick1 = 1;
  845.         this.recordCalenderClick4 = 1;
  846.       } else {
  847.         document.getElementById("rd3").checked = false;
  848.         this.recordCalenderClick3 = 1;
  849.       }
  850.     },
  851.     handleCloseButton4(e) {
  852.       this.recordCalenderClick4 = this.recordCalenderClick4 + 1;
  853.       if (this.recordCalenderClick4 == 2) {
  854.         document.getElementById("rd4").checked = true;
  855.         this.recordCalenderClick2 = 1;
  856.         this.recordCalenderClick1 = 1;
  857.         this.recordCalenderClick3 = 1;
  858.       } else {
  859.         document.getElementById("rd4").checked = false;
  860.         this.recordCalenderClick4 = 1;
  861.       }
  862.     },
  863.  
  864.     handleExtraNextButton(){
  865.       let checkboxInputs = document.getElementsByClassName("check-checked-input");
  866.       console.log(checkboxInputs)
  867.       for (let checkboxInput of checkboxInputs) {
  868.         if (checkboxInput.checked){
  869.           // checkedCheckbox.push(checkboxInput)
  870.           console.log(checkboxInput)
  871.         } 
  872.       }
  873.       // console.log(this.checkedCheckbox)
  874.     },
  875.  
  876.     handleCalenderSubmit() {
  877.       var enddate = new Date(this.selectedEvent.end);
  878.       var bookedDate =
  879.         enddate.getFullYear() +
  880.         "-" +
  881.         (enddate.getMonth() + 1) +
  882.         "-" +
  883.         enddate.getDate() +
  884.         " " +
  885.         enddate.getHours() +
  886.         ":00";
  887.  
  888.       //  this.bookedevent.forEach((number) => {
  889.       //     if(bookedDate > number.from_time){
  890.       //       alert("This events already booked..!");
  891.       //       this.deleteEvents();
  892.       //     }
  893.       //   });
  894.  
  895.       if (this.selectedEvent) {
  896.         if (
  897.           this.selectedEvent.startTimeMinutes <
  898.             this.specialHours[this.selectedEvent.start.getDay()].from ||
  899.           this.selectedEvent.endTimeMinutes >
  900.             this.specialHours[this.selectedEvent.start.getDay()].to
  901.         ) {
  902.           alert(
  903.             `Please create events within business hours(09:00am to 07:00pm)`
  904.           );
  905.           this.deleteEvents();
  906.         } else {
  907.           if (
  908.             this.selectedEvent.endTimeMinutes -
  909.               this.selectedEvent.startTimeMinutes <
  910.             60
  911.           ) {
  912.             alert("Time period less than 1 hour is not allowed");
  913.           } else {
  914.             var startdate = new Date(this.selectedEvent.start);
  915.             var enddate = new Date(this.selectedEvent.end);
  916.             var fromDate = this.getDateFunction(startdate);
  917.             var selectedDayInput = this.getSelectedDay(startdate);
  918.             var toDate = this.getDateFunction(enddate);
  919.             var fromTime = this.getTimeFunction(startdate);
  920.             var toTime = this.getTimeFunction(enddate);
  921.             this.formData.bookingTime = fromTime + " to " + toTime;
  922.             this.formData.bookingDate =
  923.               fromDate == toDate ? fromDate : fromDate + " to " + toDate;
  924.             this.formData.selectedDay = selectedDayInput;
  925.             this.formData.selectedFromTime =
  926.               startdate.getFullYear() +
  927.               "-" +
  928.               (startdate.getMonth() + 1) +
  929.               "-" +
  930.               startdate.getDate() +
  931.               " " +
  932.               startdate.getHours() +
  933.               ":00";
  934.             this.formData.selectedToTime =
  935.               enddate.getFullYear() +
  936.               "-" +
  937.               (enddate.getMonth() + 1) +
  938.               "-" +
  939.               enddate.getDate() +
  940.               " " +
  941.               enddate.getHours() +
  942.               ":00";
  943.             this.formData.Time =
  944.               startdate.getFullYear() +
  945.               "-" +
  946.               (startdate.getMonth() + 1) +
  947.               "-" +
  948.               startdate.getDate();
  949.             this.isInfoDisable = false;
  950.             document.getElementById("rd2").checked = true;
  951.           }
  952.           //'2022-01-11 14:00
  953.         }
  954.       } else {
  955.         alert("Please create one event!");
  956.       }
  957.     },
  958.  
  959.     onEventCreate($event, deleteEventFunction) {
  960.       if (
  961.         $event.startTimeMinutes <
  962.           this.specialHours[$event.start.getDay()].from ||
  963.         $event.endTimeMinutes > this.specialHours[$event.start.getDay()].to
  964.       ) {
  965.         alert(`Please create events within business hours(09:00am to 07:00pm)`);
  966.         return false;
  967.       }
  968.       this.deleteEvents();
  969.       this.selectedEvent = $event;
  970.       this.events.push($event);
  971.       this.newEvents.push($event);
  972.       return $event;
  973.     },
  974.  
  975.     onEventChange(events, $event) {
  976.       this.selectedEvent = $event.event;
  977.       var enddate = new Date(this.selectedEvent.end);
  978.       var bookedDate =
  979.         enddate.getFullYear() +
  980.         "-" +
  981.         (enddate.getMonth() + 1) +
  982.         "-" +
  983.         enddate.getDate() +
  984.         " " +
  985.         enddate.getHours() +
  986.         ":00";
  987.       if (
  988.         $event.event.startTimeMinutes <
  989.           this.specialHours[$event.event.start.getDay()].from ||
  990.         $event.event.endTimeMinutes >
  991.           this.specialHours[$event.event.start.getDay()].to
  992.       ) {
  993.         alert("Please create events within business hours(09:00am to 07:00pm)");
  994.         this.events[0] = this.selectedEvent;
  995.         return this.selectedEvent;
  996.       } else {
  997.         // console.log(bookedDate)
  998.         //  this.bookedevent.forEach((number) => {
  999.         //     console.log(number.time)
  1000.         //     if(bookedDate >=  number.from_time){
  1001.         //       alert("This events already booked..!");
  1002.         //       this.deleteEvents();
  1003.         //     }
  1004.         // });
  1005.       }
  1006.  
  1007.       return $event.event;
  1008.     },
  1009.  
  1010.     // || ($event.event.endTimeMinutes - $event.event.startTimeMinutes) >= 60
  1011.  
  1012.     getSelectedDay(date) {
  1013.       var day = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"];
  1014.       return day[date.getDay() - 1];
  1015.     },
  1016.  
  1017.     getDateFunction(date) {
  1018.       var month = [
  1019.         "January",
  1020.         "February",
  1021.         "March",
  1022.         "April",
  1023.         "May",
  1024.         "June",
  1025.         "July",
  1026.         "August",
  1027.         "September",
  1028.         "October",
  1029.         "November",
  1030.         "December",
  1031.       ];
  1032.       var day = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"];
  1033.       var formatedDate =
  1034.         date.getDate() +
  1035.         "th" +
  1036.         " " +
  1037.         month[date.getMonth()] +
  1038.         " " +
  1039.         date.getFullYear();
  1040.       return formatedDate;
  1041.     },
  1042.  
  1043.     getTimeFunction(date) {
  1044.       var hours = date.getHours();
  1045.       var minutes = date.getMinutes();
  1046.       var ampm = hours >= 12 ? "pm" : "am";
  1047.       hours = hours % 12;
  1048.       hours = hours ? hours : 12; // the hour '0' should be '12'
  1049.       minutes = minutes < 10 ? "0" + minutes : minutes;
  1050.       var formatedTime = hours + ":" + minutes + "" + ampm;
  1051.       return formatedTime;
  1052.     },
  1053.     is(value) {
  1054.       return value ? true : "This field is ";
  1055.     },
  1056.     async handleNextButton(e) {
  1057.       e.preventDefault();
  1058.       const isValid = await this.$refs.loginForm.validate();
  1059.       var formValid = isValid;
  1060.       if (isValid) {
  1061.         this.formData.phoneNumber = this.formData.phoneNumber;
  1062.         // this.formData.phoneNumber = "+61" + this.formData.phoneNumber;
  1063.         this.isDisable = false;
  1064.         document.getElementById("rd3").checked = true;
  1065.         this.getRequipment();
  1066.       }
  1067.     },
  1068.     getRequipment(){
  1069.         let currentObj = this;
  1070.         this.axios
  1071.           .get("api/get-equipment")
  1072.           .then(function (response) {
  1073.              var requipementDataTable = [];
  1074.              response.data.forEach(function (data) {
  1075.                currentObj.requipementDataTable.push( 
  1076.                 '<tr><td class="text-right" style=""><input type="checkbox" class="form-checkbox h-4 w-4 text-gray-600 check-checked-input" ><span class="ml-2 text-gray-700"></span></td><td class="text-center">'+data.name+'</td><td class="text-center"><p class="qty"><button @click="decreaseCount()" class="qtyminus" aria-hidden="true">−</button><input type="number" name="qty[]" id="qty" min="1" max="10" step="1" value="1" style="width:3rem;"><button @click="increaseCount()" class="qtyplus" aria-hidden="true">&plus;</button></p></td><td>$ '+data.price+'</td></tr>');
  1077.               });
  1078.             document.getElementById("requipementTable").append(requipementDataTable);
  1079.           })
  1080.           .catch(function (error) {
  1081.             currentObj.output = error;
  1082.           });
  1083.     },
  1084.  
  1085.     handleConfirmBtn() {
  1086.       if (this.formData.listOfRooms == "") {
  1087.         alert("Please select Hall");
  1088.       } else {
  1089.         let currentObj = this;
  1090.         this.axios
  1091.           .post("api/hallbookingemail", {
  1092.             data: this.formData,
  1093.           })
  1094.           .then(function (response) {
  1095.             currentObj.output = response.data;
  1096.           })
  1097.           .catch(function (error) {
  1098.             currentObj.output = error;
  1099.           });
  1100.         document.getElementById("rd4").checked = true;
  1101.         currentObj.isConfirmed = false;
  1102.         currentObj.isShowingAccordian = true;
  1103.       }
  1104.     },
  1105.   },
  1106. };
  1107. </script>
  1108.  
  1109. <style>
  1110. /* @import "vue2-timepicker/dist/VueTimepicker.css"; */
  1111.  
  1112. /* Quantity selector UI */
  1113.  
  1114.  
  1115. .qty button {
  1116.   padding: 0;
  1117.   margin: 0;
  1118.   border-style: none;
  1119.   touch-action: manipulation;
  1120.   display: inline-block;
  1121.   border: none;
  1122.   background: none;
  1123.   cursor: pointer;
  1124. }
  1125.  
  1126. /* End Reset for the demo */
  1127. /* Sass Config */
  1128. /* Contrast : 7.2:1 */
  1129. /* End Sass Config */
  1130. .qty {
  1131.   display: flex;
  1132.   flex-wrap: wrap;
  1133.   justify-content: center;
  1134.   text-align: center;
  1135. }
  1136. .qty label {
  1137.   flex: 1 0 100%;
  1138. }
  1139. .qty input {
  1140.   height: 3rem;
  1141.   font-size: 1.3rem;
  1142.   text-align: center;
  1143.   border: 1px solid #575757;
  1144. }
  1145. .qty button {
  1146.   text-align: center;
  1147.   width: 2rem;
  1148.   height: 3rem;
  1149.   color: #fff;
  1150.   font-size: 2rem;
  1151.   background: #575757;
  1152. }
  1153. .qty button.qtyminus {
  1154.   margin-right: 0.3rem;
  1155. }
  1156. .qty button.qtyplus {
  1157.   margin-left: 0.3rem;
  1158. }
  1159.  
  1160.  
  1161. input[type="number"]::-webkit-inner-spin-button,
  1162. input[type="number"]::-webkit-outer-spin-button {
  1163.   -webkit-appearance: none;
  1164.   margin: 0;
  1165. }
  1166.  
  1167. .custom-number-input input:focus {
  1168.   outline: none !important;
  1169. }
  1170.  
  1171. .custom-number-input button:focus {
  1172.   outline: none !important;
  1173. }
  1174.  
  1175. .blue-event {
  1176.   background-color: rgba(145, 175, 76, 0.35);
  1177. }
  1178.  
  1179. .red-event {
  1180.   background-color: rgba(175, 79, 76, 0.35);
  1181. }
  1182.  
  1183. .business-hours {
  1184.   background-color: rgba(255, 255, 0, 0.2);
  1185.   border: solid rgba(255, 210, 0, 0.6);
  1186.   border-width: 2px 0;
  1187. }
  1188.  
  1189. .fix-input-width {
  1190.   /* min-height: 100vh; */
  1191. }
  1192.  
  1193. .fix-input-width input,
  1194. .fix-input-width textarea,
  1195. .fix-input-width select {
  1196.   width: 30vw;
  1197. }
  1198.  
  1199. .fix-input-width input:hover,
  1200. .fix-input-width textarea:hover,
  1201. .fix-input-width select:hover {
  1202.   outline-color: #2c3e50;
  1203. }
  1204. .fix-input-width input:focus,
  1205. .fix-input-width textarea:focus,
  1206. .fix-input-width select:focus {
  1207.   outline-color: #2c3e50;
  1208. }
  1209.  
  1210. @media only screen and (max-width: 750px) {
  1211.   .fix-input-width input,
  1212.   .fix-input-width textarea,
  1213.   .fix-input-width select {
  1214.     width: 80vw;
  1215.   }
  1216. }
  1217.  
  1218. @media only screen and (min-width: 2000px) {
  1219.   .fix-input-width input,
  1220.   .fix-input-width textarea,
  1221.   .fix-input-width select {
  1222.     width: 20vw;
  1223.   }
  1224. }
  1225. @media only screen and (min-width: 3000px) {
  1226.   .fix-input-width input,
  1227.   .fix-input-width textarea,
  1228.   .fix-input-width select {
  1229.     width: 10vw;
  1230.   }
  1231. }
  1232.  
  1233. input[type="radio"] {
  1234.   position: absolute;
  1235.   opacity: 0;
  1236.   z-index: -1;
  1237. }
  1238.  
  1239. .row {
  1240.   display: flex;
  1241. }
  1242. .row .col {
  1243.   flex: 1;
  1244. }
  1245. .row .col:last-child {
  1246.   margin-left: 1em;
  1247. }
  1248.  
  1249. /* Accordion styles */
  1250. .tabs {
  1251.   border-radius: 8px;
  1252.   overflow: hidden;
  1253.   box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.5);
  1254. }
  1255.  
  1256. .tab {
  1257.   width: 100%;
  1258.   color: white;
  1259.   overflow: hidden;
  1260. }
  1261. .tab-label {
  1262.   display: flex;
  1263.   justify-content: space-between;
  1264.   padding: 1em;
  1265.   background: #2c3e50;
  1266.   /* font-weight: bold; */
  1267.   cursor: pointer;
  1268.   /* Icon */
  1269. }
  1270. .tab-label:hover {
  1271.   background: #1a252f;
  1272. }
  1273. .tab-label::after {
  1274.   content: "❯";
  1275.   width: 1em;
  1276.   height: 1em;
  1277.   text-align: center;
  1278.   transition: all 0.35s;
  1279. }
  1280. .tab-content {
  1281.   max-height: 0;
  1282.   padding: 0 1em;
  1283.   color: #2c3e50;
  1284.   background: white;
  1285.   transition: all 0.35s;
  1286. }
  1287. .tab-close {
  1288.   display: flex;
  1289.   justify-content: flex-end;
  1290.   /* padding: 1em; */
  1291.   font-size: 0.75em;
  1292.   background: white;
  1293.   cursor: pointer;
  1294. }
  1295. .tab-close:hover {
  1296.   background: #1a252f;
  1297. }
  1298.  
  1299. input:checked + .tab-label {
  1300.   background: #1a252f;
  1301. }
  1302. input:checked + .tab-label::after {
  1303.   transform: rotate(90deg);
  1304. }
  1305. input:checked ~ .tab-content {
  1306.   max-height: 100vh;
  1307.   padding: 1em;
  1308. }
  1309. </style>

Editor

You can edit this paste and save as new:


File Description
  • test
  • Paste Code
  • 24 Jan-2022
  • 43.13 Kb
You can Share it: