/home/techb158/ileadtechnology.com/SSM/public/js/reception/callLog
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/reception/callLog/edit.js (11661B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[293],{B5Rr:function(t,e,o){"use strict";o.r(e);var i={components:{callLogForm:o("pJ1D").a},data:function(){return{uuid:this.$route.params.uuid}},mounted:function(){helper.hasPermission("edit-call-log")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},r=o("KHd+"),a=Object(r.a)(i,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{staticClass:"page-titles"},[o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-6"},[o("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("reception.edit_call_log")))])]),t._v(" "),o("div",{staticClass:"col-12 col-sm-6"},[o("div",{staticClass:"action-buttons pull-right"},[o("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){return t.$router.push("/reception/call/log")}}},[o("i",{staticClass:"fas fa-list"}),t._v(" "),o("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("reception.call_log")))])])])])])]),t._v(" "),o("div",{staticClass:"container-fluid"},[o("div",{staticClass:"card card-form"},[o("div",{staticClass:"card-body p-t-20"},[o("call-log-form",{attrs:{uuid:t.uuid}})],1)])])])}),[],!1,null,null,null);e.default=a.exports},pJ1D:function(t,e,o){"use strict";var i={components:{},data:function(){return{callLogForm:new Form({name:"",incoming_number:"",outgoing_number:"",type:"outgoing",calling_purpose_id:"",date:"",start_time:"",end_time:"",description:""}),loaded:!1,start_time:{hour:"",minute:"",meridiem:"am"},end_time:{hour:"",minute:"",meridiem:"am"},calling_purposes:[],selected_calling_purpose:null}},props:["uuid"],mounted:function(){helper.hasPermission("create-call-log")||helper.hasPermission("edit-call-log")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getPreRequisite()},methods:{timePadding:function(t){return helper.formatWithPadding(t,2)},proceed:function(){this.uuid?this.update():this.store()},getPreRequisite:function(){var t=this,e=this.$loading.show();axios.get("/api/call/log/pre-requisite").then((function(o){t.calling_purposes=o.calling_purposes,t.callLogForm.date=helper.today(),t.uuid||(t.loaded=!0),t.uuid&&t.get(),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},store:function(){var t=this;this.callLogForm.start_time=this.start_time.hour&&this.start_time.minute?helper.formatWithPadding(this.start_time.hour,2)+":"+helper.formatWithPadding(this.start_time.minute,2)+" "+this.start_time.meridiem:"",this.callLogForm.end_time=this.end_time.hour&&this.end_time.minute?helper.formatWithPadding(this.end_time.hour,2)+":"+helper.formatWithPadding(this.end_time.minute,2)+" "+this.end_time.meridiem:"";var e=this.$loading.show();this.callLogForm.post("/api/call/log").then((function(o){toastr.success(o.message),t.selected_calling_purpose=null,t.start_time.hour="",t.start_time.minute="",t.start_time.meridiem="am",t.end_time.hour="",t.end_time.minute="",t.end_time.meridiem="am",t.callLogForm.type="outgoing",t.$emit("completed"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},get:function(){var t=this,e=this.$loading.show();axios.get("/api/call/log/"+this.uuid).then((function(o){t.callLogForm.type=o.call_log.type,t.callLogForm.name=o.call_log.name,t.callLogForm.incoming_number=o.call_log.incoming_number,t.callLogForm.outgoing_number=o.call_log.outgoing_number,t.callLogForm.calling_purpose_id=o.call_log.calling_purpose_id,t.selected_calling_purpose=o.selected_calling_purpose,t.callLogForm.description=o.call_log.description,t.callLogForm.date=o.call_log.date,t.start_time.hour=o.start_time.hour,t.start_time.minute=o.start_time.minute,t.start_time.meridiem=o.start_time.meridiem,o.call_log.end_time&&(t.end_time.hour=o.end_time.hour,t.end_time.minute=o.end_time.minute,t.end_time.meridiem=o.end_time.meridiem),t.loaded=!0,e.hide()})).catch((function(o){e.hide(),helper.showErrorMsg(o),t.$router.push("/reception/call/log")}))},update:function(){var t=this;this.callLogForm.start_time=this.start_time.hour&&this.start_time.minute?helper.formatWithPadding(this.start_time.hour,2)+":"+helper.formatWithPadding(this.start_time.minute,2)+" "+this.start_time.meridiem:"",this.callLogForm.end_time=this.end_time.hour&&this.end_time.minute?helper.formatWithPadding(this.end_time.hour,2)+":"+helper.formatWithPadding(this.end_time.minute,2)+" "+this.end_time.meridiem:"";var e=this.$loading.show();this.callLogForm.patch("/api/call/log/"+this.uuid).then((function(o){toastr.success(o.message),e.hide(),t.$router.push("/reception/call/log")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},onCallingPurposeSelect:function(t){return this.callLogForm.calling_purpose_id=t.id}}},r=o("KHd+"),a=Object(r.a)(i,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.callLogForm.errors.clear(e.target.name)}}},[o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-3"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.calling_purpose")))]),t._v(" "),o("v-select",{attrs:{label:"name",name:"calling_purpose_id",id:"calling_purpose_id",options:t.calling_purposes,placeholder:t.trans("reception.select_calling_purpose")},on:{select:t.onCallingPurposeSelect,close:function(e){return t.callLogForm.errors.clear("calling_purpose_id")},remove:function(e){t.callLogForm.calling_purpose_id=""}},model:{value:t.selected_calling_purpose,callback:function(e){t.selected_calling_purpose=e},expression:"selected_calling_purpose"}},[t.calling_purposes.length?t._e():o("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[t._v("\n "+t._s(t.trans("general.no_option_found"))+"\n ")])]),t._v(" "),o("show-error",{attrs:{"form-name":t.callLogForm,"prop-name":"calling_purpose_id"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-3"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.call_type")))]),t._v(" "),o("select",{directives:[{name:"model",rawName:"v-model",value:t.callLogForm.type,expression:"callLogForm.type"}],staticClass:"custom-select col-12",on:{select:function(e){return t.callLogForm.errors.clear("type")},change:function(e){var o=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.callLogForm,"type",e.target.multiple?o:o[0])}}},[o("option",{attrs:{value:"outgoing"}},[t._v(t._s(t.trans("reception.call_type_outgoing")))]),t._v(" "),o("option",{attrs:{value:"incoming"}},[t._v(t._s(t.trans("reception.call_type_incoming")))])]),t._v(" "),o("show-error",{attrs:{"form-name":t.callLogForm,"prop-name":"type"}})],1)])]),t._v(" "),o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-3"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.call_log_name")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.callLogForm.name,expression:"callLogForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("reception.call_log_name")},domProps:{value:t.callLogForm.name},on:{input:function(e){e.target.composing||t.$set(t.callLogForm,"name",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.callLogForm,"prop-name":"name"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-3"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.call_log_incoming_number")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.callLogForm.incoming_number,expression:"callLogForm.incoming_number"}],staticClass:"form-control",attrs:{type:"text",name:"incoming_number",placeholder:t.trans("reception.call_log_incoming_number")},domProps:{value:t.callLogForm.incoming_number},on:{input:function(e){e.target.composing||t.$set(t.callLogForm,"incoming_number",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.callLogForm,"prop-name":"incoming_number"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-3"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.call_log_outgoing_number")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.callLogForm.outgoing_number,expression:"callLogForm.outgoing_number"}],staticClass:"form-control",attrs:{type:"text",name:"outgoing_number",placeholder:t.trans("reception.call_log_outgoing_number")},domProps:{value:t.callLogForm.outgoing_number},on:{input:function(e){e.target.composing||t.$set(t.callLogForm,"outgoing_number",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.callLogForm,"prop-name":"outgoing_number"}})],1)])]),t._v(" "),o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-4"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.date")))]),t._v(" "),o("datepicker",{attrs:{bootstrapStyling:!0,placeholder:t.trans("reception.date")},on:{selected:function(e){return t.callLogForm.errors.clear("date")}},model:{value:t.callLogForm.date,callback:function(e){t.$set(t.callLogForm,"date",e)},expression:"callLogForm.date"}}),t._v(" "),o("show-error",{attrs:{"form-name":t.callLogForm,"prop-name":"date"}})],1)]),t._v(" "),t.loaded?o("div",{staticClass:"col-12 col-sm-4"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.start_time")))]),t._v(" "),o("timepicker",{attrs:{hour:t.start_time.hour,minute:t.start_time.minute,meridiem:t.start_time.meridiem},on:{"update:hour":function(e){return t.$set(t.start_time,"hour",e)},"update:minute":function(e){return t.$set(t.start_time,"minute",e)},"update:meridiem":function(e){return t.$set(t.start_time,"meridiem",e)}}})],1)]):t._e(),t._v(" "),t.loaded?o("div",{staticClass:"col-12 col-sm-4"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.end_time")))]),t._v(" "),o("timepicker",{attrs:{hour:t.end_time.hour,minute:t.end_time.minute,meridiem:t.end_time.meridiem},on:{"update:hour":function(e){return t.$set(t.end_time,"hour",e)},"update:minute":function(e){return t.$set(t.end_time,"minute",e)},"update:meridiem":function(e){return t.$set(t.end_time,"meridiem",e)}}})],1)]):t._e(),t._v(" "),o("div",{staticClass:"col-12"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.call_log_description")))]),t._v(" "),o("autosize-textarea",{attrs:{rows:"1",name:"description",placeholder:t.trans("reception.call_log_description")},model:{value:t.callLogForm.description,callback:function(e){t.$set(t.callLogForm,"description",e)},expression:"callLogForm.description"}}),t._v(" "),o("show-error",{attrs:{"form-name":t.callLogForm,"prop-name":"description"}})],1)])]),t._v(" "),o("div",{staticClass:"card-footer text-right"},[o("router-link",{directives:[{name:"show",rawName:"v-show",value:t.uuid,expression:"uuid"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/reception/call/log"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.uuid?t._e():o("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(e){return t.$emit("cancel")}}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),o("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.uuid?o("span",[t._v(t._s(t.trans("general.update")))]):o("span",[t._v(t._s(t.trans("general.save")))])])],1)])}),[],!1,null,null,null);e.a=a.exports}}]);
//# sourceMappingURL=edit.js.map?id=52bfe802f4acf43cc277