text: (window.webpackJsonp=window.webpackJsonp||[]).push([[88],{17:function(t,n,i){"use strict";var e={name:"SubmitButtonGBI",data:function(){return{}}},a=i(0),s=Object(a.a)(e,(function(){var t=this.$createElement;return(this._self._c||t)("button",{staticClass:"btn btn-primary itrn_add_btn back_btn text-capitalize font-weight-bold"},[this._t("default",[this._v("submit")])],2)}),[],!1,null,null,null);n.a=s.exports},19:function(t,n,i){"use strict";var e={name:"BackButtonGBI",props:["url"],methods:{goBack:function(){this.$router.back()}}},a=i(0),s=Object(a.a)(e,(function(){var t=this,n=t.$createElement,i=t._self._c||n;return i("span",[t.url?i("router-link",{staticClass:"btn btn-primary itrn_add_btn back_btn text-capitalize font-weight-bold",attrs:{to:t.url},on:{click:function(n){return t.goBack()}}},[t._t("default",[t._v("Back")])],2):i("button",{staticClass:"btn btn-primary itrn_add_btn back_btn text-capitalize font-weight-bold",attrs:{type:"button"},on:{click:function(n){return t.goBack()}}},[t._t("default",[t._v("Back")])],2)],1)}),[],!1,null,null,null);n.a=s.exports},235:function(t,n,i){"use strict";i.r(n);var e=i(1),a=i(16),s=i(4),r={name:"PlusButtonGBI",data:function(){return{}}},o=i(0),l=Object(o.a)(r,(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,n=this._self._c||t;return n("button",{staticClass:"btn btn-info btn_plus",attrs:{type:"button"}},[n("i",{staticClass:"fas fa-plus",attrs:{"aria-hidden":"true"}})])}],!1,null,null,null).exports,u={name:"MinusButtonGBI",data:function(){return{}}},c=Object(o.a)(u,(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,n=this._self._c||t;return n("button",{staticClass:"btn btn-info btn_plus",attrs:{type:"button"}},[n("i",{staticClass:"fas fa-minus",attrs:{"aria-hidden":"true"}})])}],!1,null,null,null).exports,d=i(3),_={name:"ListSightseeingsNew",components:{Form:e.Form,"has-error":e.HasError,ModelSelect:a.ModelSelect,"form-buttons":s.a,"form-layout":d.a,"plus-button":l,"minus-button":c},data:function(){return{row_input:"",itineraryday_list:"",tour:"",options:[],total_row:[]}},created:function(){this.sightseeingData(),this.itineraryData()},methods:{sightseeingData:function(){var t=this;axios.get("/api/sightseeings").then((function(n){t.options=n.data.data}))},itineraryData:function(){var t=this;axios.get("/api/itinerarydayget/".concat(this.$route.params.itinerary_id)).then((function(n){t.itineraryday_list=n.data;for(var i=0;i<t.itineraryday_list.length;i++)t.total_row.push([{tour_id:t.$route.params.id,tour_code:t.$route.params.tour_code,itineraryday_id:t.itineraryday_list[i].id,sightseeing_id:""}])}))},addRow:function(t){this.total_row[t].push({tour_id:this.$route.params.id,tour_code:this.$route.params.tour_code,itineraryday_id:this.itineraryday_list[t].id,sightseeing_id:""})},removeRow:function(t){1!=this.total_row[t].length&&this.total_row[t].splice(-1,1)},addSightseeing:function(){var t=this;console.log(this.total_row),axios.post("/api/bookedsightseeings",this.total_row).then((function(n){return console.log(n),1==n.data?(t.$toast.fire({icon:"error",title:"Already sightseeing added for this tour !!!"}),!1):2==n.data?(t.$toast.fire({icon:"error",title:"Try again"}),!1):void t.$toast.fire({icon:"success",title:"Sightseeings Added successfully"})})).catch((function(){}))}}},f=Object(o.a)(_,(function(){var t=this,n=t.$createElement,i=t._self._c||n;return i("form-layout",{scopedSlots:t._u([{key:"formdata",fn:function(){return[i("div",{staticClass:"reservation pl-4 pt-2"},[i("form",{attrs:{role:"form"},on:{submit:function(n){return n.preventDefault(),t.addSightseeing()}}},[t._l(t.itineraryday_list,(function(n,e){return i("div",{key:n.id,staticClass:"row w-100 p-3 card-layout"},[i("div",{staticClass:"col-sm-5"},[i("p",[i("label",{attrs:{for:"name"}},[t._v("Sightseeing Day "+t._s(n.day)+" ("),i("small",[t._v(t._s(n.day_source)+" - "+t._s(n.day_destination))]),t._v(")")])])]),t._v(" "),i("div",{staticClass:"col-sm-5"},t._l(t.total_row[e],(function(n,a){return i("div",{key:a,staticClass:"row w-100"},[i("div",{staticClass:"col-sm-12"},[i("select",{directives:[{name:"model",rawName:"v-model",value:t.total_row[e][a].sightseeing_id,expression:"total_row[index][i].sightseeing_id"}],staticClass:"form-control select-field",attrs:{placeholder:"From"},on:{change:function(n){var i=Array.prototype.filter.call(n.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.total_row[e][a],"sightseeing_id",n.target.multiple?i:i[0])}}},[i("option",{attrs:{value:"",disabled:"",hidden:""}},[t._v("Select Sightseeing")]),t._v(" "),t._l(t.options,(function(n){return i("option",{key:n.id,domProps:{value:n.id}},[t._v(t._s(n.name))])}))],2)])])})),0),t._v(" "),i("div",{staticClass:"col-sm-2"},[i("plus-button",{nativeOn:{click:function(n){return t.addRow(e)}}}),t._v(" "),i("minus-button",{nativeOn:{click:function(n){return t.removeRow(e)}}})],1)])})),t._v(" "),i("form-buttons",{staticClass:"mb-5"})],2)])]},proxy:!0}])})}),[],!1,null,null,null);n.default=f.exports},3:function(t,n,i){"use strict";var e={name:"FromLayoutGBI",data:function(){return{}}},a=i(0),s=Object(a.a)(e,(function(){var t=this.$createElement,n=this._self._c||t;return n("section",{staticClass:"content"},[n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"row justify-content-around"},[n("div",{staticClass:"col-md-12 pl-4 pb-5"},[this._t("formdata")],2)])])])}),[],!1,null,null,null);n.a=s.exports},4:function(t,n,i){"use strict";var e=i(19),a=i(17),s={name:"FormButtonGBI",components:{"back-button":e.a,"submit-button":a.a}},r=i(0),o=Object(r.a)(s,(function(){var t=this.$createElement,n=this._self._c||t;return n("div",{staticClass:"row justify-content-center"},[n("div",{staticClass:"col-sm-9 text-center"},[n("back-button"),this._v(" "),n("submit-button")],1)])}),[],!1,null,null,null);n.a=o.exports}}]);