/home/techb158/ileadtechnology.com/SSM/public/js/transport/vehicle/document
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/transport/vehicle/document/index.js (30734B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[363],{"98wa":function(e,t,n){"use strict";n.r(t);var i={components:{vehicleDocumentForm:n("redg").a},data:function(){return{vehicle_documents:{total:0,data:[]},filter:{sort_by:"date_of_expiry",order:"desc",expired:!1,expiring_in:0,vehicle_id:[],vehicle_document_type_id:[],page_length:helper.getConfig("page_length")},orderByOptions:[{value:"vehicle_id",translation:i18n.transport.vehicle},{value:"date_of_expiry",translation:i18n.transport.date_of_expiry},{value:"title",translation:i18n.transport.vehicle_document_title},{value:"created_at",translation:i18n.general.created_at}],vehicles:[],selected_vehicle:null,vehicle_document_types:[],selected_vehicle_document_type:null,showCreatePanel:!1,showFilterPanel:!1,viewId:"",vehicle_document:{},documents:[],showDetailModal:!1,help_topic:""}},mounted:function(){helper.hasPermission("list-vehicle-document")&&helper.hasPermission("create-vehicle-document")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),helper.hasPermission("list-vehicle-document")&&this.getVehicleDocuments(),helper.showDemoNotification(["transport"])},methods:{getConfig:function(e){return helper.getConfig(e)},hasPermission:function(e){return helper.hasPermission(e)},getVehicleDocuments:function(e){var t=this,n=this.$loading.show();"number"!=typeof e&&(e=1);var i=helper.getFilterURL(this.filter);axios.get("/api/vehicle/document?page="+e+i).then((function(e){t.vehicle_documents=e.vehicle_documents,t.vehicles=e.filters.vehicles,t.vehicle_document_types=e.filters.vehicle_document_types,n.hide()})).catch((function(e){n.hide(),helper.showErrorMsg(e)}))},getVehicleDocument:function(){var e=this,t=this.$loading.show();axios.get("/api/vehicle/document/"+this.viewId).then((function(n){e.vehicle_document=n.vehicle_document,e.documents=n.documents,t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},editVehicleLog:function(e){this.$router.push("/transport/vehicle/document/"+e.id+"/edit")},confirmDelete:function(e){var t=this;return function(n){return t.deleteVehicleLog(e)}},deleteVehicleLog:function(e){var t=this,n=this.$loading.show();axios.delete("/api/vehicle/document/"+e.id).then((function(e){toastr.success(e.message),t.getVehicleDocuments(),n.hide()})).catch((function(e){n.hide(),helper.showErrorMsg(e)}))},print:function(){var e=this.$loading.show();axios.post("/api/vehicle/document/print",{filter:this.filter}).then((function(t){var n=window.open("/print");e.hide(),n.document.write(t)})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},pdf:function(){var e=this,t=this.$loading.show();axios.post("/api/vehicle/document/pdf",{filter:this.filter}).then((function(n){t.hide(),window.open("/download/report/"+n+"?token="+e.authToken)})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},onVehicleSelect:function(e){this.filter.vehicle_id.push(e.id)},onVehicleRemove:function(e){this.filter.vehicle_id.splice(this.filter.vehicle_id.indexOf(e.id),1)},onVehicleDocumentTypeSelect:function(e){this.filter.vehicle_document_type_id.push(e.id)},onVehicleDocumentTypeRemove:function(e){this.filter.vehicle_document_type_id.splice(this.filter.vehicle_document_type_id.indexOf(e.id),1)},getStatus:function(e){return helper.getVehicleDocumentStatus(e)},showDetailAction:function(e){this.viewId=e.id,this.showDetailModal=!0}},filters:{moment:function(e){return helper.formatDate(e)},momentDateTime:function(e){return helper.formatDateTime(e)}},watch:{"filter.sort_by":function(e){this.getVehicleDocuments()},"filter.order":function(e){this.getVehicleDocuments()},"filter.page_length":function(e){this.getVehicleDocuments()},viewId:function(e){e?this.getVehicleDocument():(this.vehicle_document={},this.documents=[])}},computed:{authToken:function(){return helper.getAuthToken()}}},o=n("KHd+"),s=Object(o.a)(i,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"page-titles"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-sm-6"},[n("h3",{staticClass:"text-themecolor"},[e._v(e._s(e.trans("transport.vehicle_document"))+" \n "),e.vehicle_documents.total?n("span",{staticClass:"card-subtitle d-none d-sm-inline"},[e._v(e._s(e.trans("general.total_result_found",{count:e.vehicle_documents.total,from:e.vehicle_documents.from,to:e.vehicle_documents.to})))]):n("span",{staticClass:"card-subtitle d-none d-sm-inline"},[e._v(e._s(e.trans("general.no_result_found")))])])]),e._v(" "),n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"action-buttons pull-right"},[e.vehicle_documents.total&&!e.showCreatePanel&&e.hasPermission("create-vehicle-document")?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.trans("general.add_new"),expression:"trans('general.add_new')"}],staticClass:"btn btn-info btn-sm",on:{click:function(t){e.showCreatePanel=!e.showCreatePanel}}},[n("i",{staticClass:"fas fa-plus"}),e._v(" "),n("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.trans("transport.add_new_vehicle_document")))])]):e._e(),e._v(" "),e.showFilterPanel?e._e():n("button",{staticClass:"btn btn-info btn-sm",on:{click:function(t){e.showFilterPanel=!e.showFilterPanel}}},[n("i",{staticClass:"fas fa-filter"}),e._v(" "),n("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.trans("general.filter")))])]),e._v(" "),n("sort-by",{attrs:{"order-by-options":e.orderByOptions,"sort-by":e.filter.sort_by,order:e.filter.order},on:{updateSortBy:function(t){e.filter.sort_by=t},updateOrder:function(t){e.filter.order=t}}}),e._v(" "),n("div",{staticClass:"btn-group"},[n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.trans("general.more_option"),expression:"trans('general.more_option')"}],staticClass:"btn btn-info btn-sm dropdown-toggle no-caret ",attrs:{type:"button",role:"menu",id:"moreOption","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[n("i",{staticClass:"fas fa-ellipsis-h"}),e._v(" "),n("span",{staticClass:"d-none d-sm-inline"})]),e._v(" "),n("div",{class:["dropdown-menu","ltr"==e.getConfig("direction")?"dropdown-menu-right":""],attrs:{"aria-labelledby":"moreOption"}},[n("button",{staticClass:"dropdown-item custom-dropdown",on:{click:e.print}},[n("i",{staticClass:"fas fa-print"}),e._v(" "+e._s(e.trans("general.print")))]),e._v(" "),n("button",{staticClass:"dropdown-item custom-dropdown",on:{click:e.pdf}},[n("i",{staticClass:"fas fa-file-pdf"}),e._v(" "+e._s(e.trans("general.generate_pdf")))])])]),e._v(" "),n("help-button",{on:{clicked:function(t){e.help_topic="transport.vehicle.document"}}})],1)])])]),e._v(" "),n("div",{staticClass:"container-fluid"},[n("transition",{attrs:{name:"fade"}},[e.showFilterPanel?n("div",{staticClass:"card card-form"},[n("div",{staticClass:"card-body"},[n("h4",{staticClass:"card-title"},[e._v(e._s(e.trans("general.filter")))]),e._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle")))]),e._v(" "),n("v-select",{attrs:{label:"name","track-by":"id",name:"vehicle_id",id:"vehicle_id",options:e.vehicles,placeholder:e.trans("transport.select_vehicle"),multiple:!0,"close-on-select":!1,"clear-on-select":!1,"hide-selected":!0,selected:e.selected_vehicle},on:{select:e.onVehicleSelect,remove:e.onVehicleRemove},model:{value:e.selected_vehicle,callback:function(t){e.selected_vehicle=t},expression:"selected_vehicle"}},[e.vehicles.length?e._e():n("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])])],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_document_type")))]),e._v(" "),n("v-select",{attrs:{label:"name","track-by":"id",name:"vehicle_document_type_id",id:"vehicle_document_type_id",options:e.vehicle_document_types,placeholder:e.trans("transport.select_vehicle_document_type"),multiple:!0,"close-on-select":!1,"clear-on-select":!1,"hide-selected":!0,selected:e.selected_vehicle_document_type},on:{select:e.onVehicleDocumentTypeSelect,remove:e.onVehicleDocumentTypeRemove},model:{value:e.selected_vehicle_document_type,callback:function(t){e.selected_vehicle_document_type=t},expression:"selected_vehicle_document_type"}},[e.vehicle_document_types.length?e._e():n("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])])],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-1"},[n("div",{staticClass:"form-group"},[n("div",[e._v(e._s(e.trans("transport.vehicle_document_status_expired")))]),e._v(" "),n("switches",{staticClass:"m-t-20",attrs:{theme:"bootstrap",color:"success"},model:{value:e.filter.expired,callback:function(t){e.$set(e.filter,"expired",t)},expression:"filter.expired"}})],1)]),e._v(" "),e.filter.expired?e._e():n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_document_expiring_in_days")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.filter.expiring_in,expression:"filter.expiring_in"}],staticClass:"form-control",attrs:{type:"text",name:"expiring_in",placeholder:e.trans("transport.vehicle_document_expiring_in_days")},domProps:{value:e.filter.expiring_in},on:{input:function(t){t.target.composing||e.$set(e.filter,"expiring_in",t.target.value)}}})])])]),e._v(" "),n("div",{staticClass:"card-footer text-right"},[n("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(t){e.showFilterPanel=!1}}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),n("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"button"},on:{click:e.getVehicleDocuments}},[e._v(e._s(e.trans("general.filter")))])])])]):e._e()]),e._v(" "),e.hasPermission("create-vehicle-document")?n("transition",{attrs:{name:"fade"}},[e.showCreatePanel?n("div",{staticClass:"card card-form"},[n("div",{staticClass:"card-body"},[n("h4",{staticClass:"card-title"},[e._v(e._s(e.trans("transport.add_new_vehicle_document")))]),e._v(" "),n("vehicle-document-form",{on:{completed:e.getVehicleDocuments,cancel:function(t){e.showCreatePanel=!e.showCreatePanel}}})],1)]):e._e()]):e._e(),e._v(" "),n("div",{staticClass:"card"},[n("div",{staticClass:"card-body"},[e.vehicle_documents.total?n("div",{staticClass:"table-responsive"},[n("table",{staticClass:"table table-sm"},[n("thead",[n("tr",[n("th",[e._v(e._s(e.trans("transport.vehicle")))]),e._v(" "),n("th",[e._v(e._s(e.trans("transport.vehicle_document_type")))]),e._v(" "),n("th",[e._v(e._s(e.trans("transport.vehicle_document_title")))]),e._v(" "),n("th",[e._v(e._s(e.trans("transport.date_of_expiry")))]),e._v(" "),n("th",[e._v(e._s(e.trans("transport.vehicle_document_description")))]),e._v(" "),n("th",{staticClass:"table-option"},[e._v(e._s(e.trans("general.action")))])])]),e._v(" "),n("tbody",e._l(e.vehicle_documents.data,(function(t){return n("tr",[n("td",[e._v(e._s(t.vehicle.name+" ("+t.vehicle.registration_number+")"))]),e._v(" "),n("td",[e._v(e._s(t.vehicle_document_type.name))]),e._v(" "),n("td",[e._v(e._s(t.title))]),e._v(" "),n("td",[t.date_of_expiry?n("span",[e._v("\n "+e._s(e._f("moment")(t.date_of_expiry))+"\n "),n("span",{class:["label","label-"+e.getStatus(t).color]},[e._v(e._s(e.trans("transport."+e.getStatus(t).status,{day:e.getStatus(t).day})))])]):n("span",[e._v("-")])]),e._v(" "),n("td",[e._v(e._s(t.description))]),e._v(" "),n("td",{staticClass:"table-option"},[n("div",{staticClass:"btn-group"},[n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.trans("transport.view_vehicle_document"),expression:"trans('transport.view_vehicle_document')"}],staticClass:"btn btn-success btn-sm",on:{click:function(n){return n.preventDefault(),e.showDetailAction(t)}}},[n("i",{staticClass:"fas fa-arrow-circle-right"})]),e._v(" "),n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.trans("transport.edit_vehicle_document"),expression:"trans('transport.edit_vehicle_document')"}],staticClass:"btn btn-info btn-sm",on:{click:function(n){return n.preventDefault(),e.editVehicleLog(t)}}},[n("i",{staticClass:"fas fa-edit"})]),e._v(" "),n("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:e.confirmDelete(t)},expression:"{ok: confirmDelete(vehicle_document)}"},{name:"tooltip",rawName:"v-tooltip",value:e.trans("transport.delete_vehicle_document"),expression:"trans('transport.delete_vehicle_document')"}],key:t.id,staticClass:"btn btn-danger btn-sm"},[n("i",{staticClass:"fas fa-trash"})])])])])})),0)])]):e._e(),e._v(" "),e.vehicle_documents.total?e._e():n("module-info",{attrs:{module:"transport",title:"vehicle_document_module_title",description:"vehicle_document_module_description",icon:"list"}},[n("div",{attrs:{slot:"btn"},slot:"btn"},[!e.showCreatePanel&&e.hasPermission("create-vehicle-document")?n("button",{staticClass:"btn btn-info btn-md",on:{click:function(t){e.showCreatePanel=!e.showCreatePanel}}},[n("i",{staticClass:"fas fa-plus"}),e._v(" "+e._s(e.trans("general.add_new")))]):e._e()])]),e._v(" "),n("pagination-record",{attrs:{"page-length":e.filter.page_length,records:e.vehicle_documents},on:{"update:pageLength":function(t){return e.$set(e.filter,"page_length",t)},"update:page-length":function(t){return e.$set(e.filter,"page_length",t)},updateRecords:e.getVehicleDocuments}})],1)])],1),e._v(" "),e.showDetailModal?n("transition",{attrs:{name:"modal"}},[n("div",{staticClass:"modal-mask"},[n("div",{staticClass:"modal-wrapper"},[n("div",{staticClass:"modal-container modal-lg"},[n("div",{staticClass:"modal-header"},[e._t("header",[e.vehicle_document.vehicle?n("span",[e._v(e._s(e.vehicle_document.vehicle.name+" ("+e.vehicle_document.vehicle.registration_number+")"))]):e._e(),e._v(" "),n("span",{staticClass:"float-right pointer",on:{click:function(t){e.showDetailModal=!1}}},[e._v("x")])])],2),e._v(" "),n("div",{staticClass:"modal-body"},[e._t("body",[e.vehicle_document.vehicle_document_type?n("h4",{staticClass:"card-title"},[e._v(e._s(e.vehicle_document.title)+" ("+e._s(e.vehicle_document.vehicle_document_type.name)+")")]):e._e(),e._v(" "),e.vehicle_document.date_of_expiry?n("div",[e._v("\n "+e._s(e.trans("transport.date_of_expiry"))+": "+e._s(e._f("moment")(e.vehicle_document.date_of_expiry))+"\n "),n("span",{class:["label","label-"+e.getStatus(e.vehicle_document).color]},[e._v(e._s(e.trans("transport."+e.getStatus(e.vehicle_document).status,{day:e.getStatus(e.vehicle_document).day})))])]):e._e(),e._v(" "),n("div",{staticClass:"m-t-20",domProps:{innerHTML:e._s(e.vehicle_document.description)}}),e._v(" "),e.documents.length?n("div",[n("ul",{staticClass:"m-t-10 upload-file-list"},e._l(e.documents,(function(t){return n("li",{staticClass:"upload-file-list-item"},[n("a",{staticClass:"no-link-color",attrs:{href:"/transport/vehicle/document/"+e.vehicle_document.id+"/attachment/"+t.uuid+"/download?token="+e.authToken}},[n("i",{class:["file-icon","fas","fa-lg",t.file_info.icon]}),e._v(" "),n("span",{staticClass:"upload-file-list-item-size"},[e._v(e._s(t.file_info.size))]),e._v(" "+e._s(t.user_filename))])])})),0)]):e._e(),e._v(" "),n("hr"),e._v(" "),n("p",[n("i",{staticClass:"far fa-clock"}),e._v(" "),n("small",[e._v(e._s(e.trans("general.created_at"))+" "+e._s(e._f("momentDateTime")(e.vehicle_document.created_at)))]),e._v(" "),n("span",{staticClass:"pull-right"},[n("i",{staticClass:"far fa-clock"}),e._v(" "),n("small",[e._v(e._s(e.trans("general.updated_at"))+" "+e._s(e._f("momentDateTime")(e.vehicle_document.updated_at)))])])]),e._v(" "),n("div",{staticClass:"clearfix"})])],2)])])])]):e._e(),e._v(" "),n("right-panel",{attrs:{topic:e.help_topic}})],1)}),[],!1,null,null,null);t.default=s.exports},redg:function(e,t,n){"use strict";var i={components:{},props:["id"],data:function(){return{vehicleDocumentForm:new Form({title:"",vehicle_id:"",vehicle_document_type_id:"",date_of_expiry:"",description:"",policy_number:"",insurance_date:"",insurance_amount:"",insured_amount:"",insurance_company_name:"",insurance_agent_name:"",insurance_agent_contact_number:"",upload_token:""}),vehicles:[],selected_vehicle:null,selected_vehicle_document_type:null,vehicle_document_types:[],vehicle_document_type_details:[],clearAttachment:!1,expiry_date:!1,insurance_document:!1,module_id:""}},mounted:function(){this.vehicleDocumentForm.upload_token=this.$uuid.v4(),this.getPreRequisite(),this.id&&this.getDocument()},methods:{proceed:function(){this.id?this.updateDocument():this.storeDocument()},getPreRequisite:function(){var e=this,t=this.$loading.show();axios.get("/api/vehicle/document/pre-requisite").then((function(n){e.vehicles=n.vehicles,e.vehicle_document_types=n.vehicle_document_types,e.vehicle_document_type_details=n.vehicle_document_type_details,t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},storeDocument:function(){var e=this,t=this.$loading.show();this.vehicleDocumentForm.post("/api/vehicle/document").then((function(n){toastr.success(n.message),e.clearAttachment=!e.clearAttachment,e.$emit("completed"),e.vehicleDocumentForm.upload_token=e.$uuid.v4(),e.selected_vehicle_document_type=null,e.selected_vehicle=null,t.hide()})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},getDocument:function(){var e=this,t=this.$loading.show();axios.get("/api/vehicle/document/"+this.id).then((function(n){e.vehicleDocumentForm.title=n.vehicle_document.title,e.vehicleDocumentForm.vehicle_id=n.vehicle_document.vehicle_id,e.vehicleDocumentForm.date_of_expiry=n.vehicle_document.date_of_expiry,e.vehicleDocumentForm.vehicle_document_type_id=n.vehicle_document.vehicle_document_type_id,e.selected_vehicle_document_type={id:n.vehicle_document.vehicle_document_type_id,name:n.vehicle_document.vehicle_document_type.name},e.selected_vehicle={id:n.vehicle_document.vehicle_id,name:n.vehicle_document.vehicle.name},e.vehicleDocumentForm.description=n.vehicle_document.description,e.vehicleDocumentForm.upload_token=n.vehicle_document.upload_token,e.expiry_date=!!n.vehicle_document.vehicle_document_type.has_expiry_date,e.insurance_document=!!n.vehicle_document.vehicle_document_type.is_insurance_document,e.module_id=n.vehicle_document.id;var i=n.vehicle_document.options&&n.vehicle_document.options.hasOwnProperty("insurance")?n.vehicle_document.options.insurance:{policy_number:"",insurance_date:"",insurance_amount:"",insured_amount:"",insurance_company_name:"",insurance_agent_name:"",insurance_agent_contact_number:""};e.vehicleDocumentForm.policy_number=i.policy_number,e.vehicleDocumentForm.insurance_date=i.insurance_date,e.vehicleDocumentForm.insurance_amount=i.insurance_amount,e.vehicleDocumentForm.insured_amount=i.insured_amount,e.vehicleDocumentForm.insurance_company_name=i.insurance_company_name,e.vehicleDocumentForm.insurance_agent_name=i.insurance_agent_name,e.vehicleDocumentForm.insurance_agent_contact_number=i.insurance_agent_contact_number,t.hide()})).catch((function(n){t.hide(),e.$router.push("/transport/vehicle/document")}))},updateDocument:function(){var e=this,t=this.$loading.show();this.vehicleDocumentForm.patch("/api/vehicle/document/"+this.id).then((function(n){toastr.success(n.message),e.$emit("completed"),t.hide(),e.$router.push("/transport/vehicle/document")})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},onDocumentTypeSelect:function(e){this.vehicleDocumentForm.vehicle_document_type_id=e.id;var t=this.vehicle_document_type_details.find((function(t){return t.id==e.id}));t.has_expiry_date?this.expiry_date=!0:this.expiry_date=!1,t.is_insurance_document?this.insurance_document=!0:this.insurance_document=!1},onVehicleSelect:function(e){this.vehicleDocumentForm.vehicle_id=e.id}},watch:{"vehicleDocumentForm.vehicle_document_type_id":function(e){e||(this.expiry_date=!1)}}},o=n("KHd+"),s=Object(o.a)(i,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("form",{on:{submit:function(t){return t.preventDefault(),e.proceed(t)},keydown:function(t){return e.vehicleDocumentForm.errors.clear(t.target.name)}}},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle")))]),e._v(" "),n("v-select",{attrs:{label:"name",name:"vehicle_id",id:"vehicle_id",options:e.vehicles,placeholder:e.trans("general.select_one")},on:{select:e.onVehicleSelect,close:function(t){return e.vehicleDocumentForm.errors.clear("vehicle_id")},remove:function(t){e.vehicleDocumentForm.vehicle_id=""}},model:{value:e.selected_vehicle,callback:function(t){e.selected_vehicle=t},expression:"selected_vehicle"}},[e.vehicles.length?e._e():n("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"vehicle_id"}})],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-9"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_document_title")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.vehicleDocumentForm.title,expression:"vehicleDocumentForm.title"}],staticClass:"form-control",attrs:{type:"text",name:"title",placeholder:e.trans("transport.vehicle_document_title")},domProps:{value:e.vehicleDocumentForm.title},on:{input:function(t){t.target.composing||e.$set(e.vehicleDocumentForm,"title",t.target.value)}}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"title"}})],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_document_type")))]),e._v(" "),n("v-select",{attrs:{label:"name",name:"vehicle_document_type_id",id:"vehicle_document_type_id",options:e.vehicle_document_types,placeholder:e.trans("general.select_one")},on:{select:e.onDocumentTypeSelect,close:function(t){return e.vehicleDocumentForm.errors.clear("vehicle_document_type_id")},remove:function(t){e.vehicleDocumentForm.vehicle_document_type_id=""}},model:{value:e.selected_vehicle_document_type,callback:function(t){e.selected_vehicle_document_type=t},expression:"selected_vehicle_document_type"}},[e.vehicle_document_types.length?e._e():n("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"vehicle_document_type_id"}})],1)]),e._v(" "),e.expiry_date?n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.date_of_expiry")))]),e._v(" "),n("datepicker",{attrs:{bootstrapStyling:!0,placeholder:e.trans("transport.date_of_expiry")},on:{selected:function(t){return e.vehicleDocumentForm.errors.clear("date_of_expiry")}},model:{value:e.vehicleDocumentForm.date_of_expiry,callback:function(t){e.$set(e.vehicleDocumentForm,"date_of_expiry",t)},expression:"vehicleDocumentForm.date_of_expiry"}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"date_of_expiry"}})],1)]):e._e(),e._v(" "),n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_document_description")))]),e._v(" "),n("autosize-textarea",{attrs:{rows:"2",name:"description",placeholder:e.trans("vehicle.vehicle_document_description")},model:{value:e.vehicleDocumentForm.description,callback:function(t){e.$set(e.vehicleDocumentForm,"description",t)},expression:"vehicleDocumentForm.description"}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"description"}})],1)]),e._v(" "),e.insurance_document?[n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_policy_number")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.vehicleDocumentForm.policy_number,expression:"vehicleDocumentForm.policy_number"}],staticClass:"form-control",attrs:{type:"text",name:"policy_number",placeholder:e.trans("transport.vehicle_policy_number")},domProps:{value:e.vehicleDocumentForm.policy_number},on:{input:function(t){t.target.composing||e.$set(e.vehicleDocumentForm,"policy_number",t.target.value)}}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"policy_number"}})],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_insurance_date")))]),e._v(" "),n("datepicker",{attrs:{bootstrapStyling:!0,placeholder:e.trans("transport.vehicle_insurance_date")},on:{selected:function(t){return e.vehicleDocumentForm.errors.clear("insurance_date")}},model:{value:e.vehicleDocumentForm.insurance_date,callback:function(t){e.$set(e.vehicleDocumentForm,"insurance_date",t)},expression:"vehicleDocumentForm.insurance_date"}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"insurance_date"}})],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_insurance_amount")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.vehicleDocumentForm.insurance_amount,expression:"vehicleDocumentForm.insurance_amount"}],staticClass:"form-control",attrs:{type:"text",name:"insurance_amount",placeholder:e.trans("transport.vehicle_insurance_amount")},domProps:{value:e.vehicleDocumentForm.insurance_amount},on:{input:function(t){t.target.composing||e.$set(e.vehicleDocumentForm,"insurance_amount",t.target.value)}}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"insurance_amount"}})],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_insured_amount")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.vehicleDocumentForm.insured_amount,expression:"vehicleDocumentForm.insured_amount"}],staticClass:"form-control",attrs:{type:"text",name:"insured_amount",placeholder:e.trans("transport.vehicle_insured_amount")},domProps:{value:e.vehicleDocumentForm.insured_amount},on:{input:function(t){t.target.composing||e.$set(e.vehicleDocumentForm,"insured_amount",t.target.value)}}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"insured_amount"}})],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_insurance_company_name")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.vehicleDocumentForm.insurance_company_name,expression:"vehicleDocumentForm.insurance_company_name"}],staticClass:"form-control",attrs:{type:"text",name:"insurance_company_name",placeholder:e.trans("transport.vehicle_insurance_company_name")},domProps:{value:e.vehicleDocumentForm.insurance_company_name},on:{input:function(t){t.target.composing||e.$set(e.vehicleDocumentForm,"insurance_company_name",t.target.value)}}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"insurance_company_name"}})],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_insurance_agent_name")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.vehicleDocumentForm.insurance_agent_name,expression:"vehicleDocumentForm.insurance_agent_name"}],staticClass:"form-control",attrs:{type:"text",name:"insurance_agent_name",placeholder:e.trans("transport.vehicle_insurance_agent_name")},domProps:{value:e.vehicleDocumentForm.insurance_agent_name},on:{input:function(t){t.target.composing||e.$set(e.vehicleDocumentForm,"insurance_agent_name",t.target.value)}}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"insurance_agent_name"}})],1)]),e._v(" "),n("div",{staticClass:"col-12 col-sm-3"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[e._v(e._s(e.trans("transport.vehicle_insurance_agent_contact_number")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.vehicleDocumentForm.insurance_agent_contact_number,expression:"vehicleDocumentForm.insurance_agent_contact_number"}],staticClass:"form-control",attrs:{type:"text",name:"insurance_agent_contact_number",placeholder:e.trans("transport.vehicle_insurance_agent_contact_number")},domProps:{value:e.vehicleDocumentForm.insurance_agent_contact_number},on:{input:function(t){t.target.composing||e.$set(e.vehicleDocumentForm,"insurance_agent_contact_number",t.target.value)}}}),e._v(" "),n("show-error",{attrs:{"form-name":e.vehicleDocumentForm,"prop-name":"insurance_agent_contact_number"}})],1)])]:e._e()],2),e._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-sm-3"},[n("label",[e._v(" ")]),e._v(" "),n("div",{staticClass:"form-group"},[n("file-upload-input",{attrs:{"button-text":e.trans("general.upload_document"),token:e.vehicleDocumentForm.upload_token,module:"vehicle_document","clear-file":e.clearAttachment,"module-id":e.module_id}})],1)])]),e._v(" "),n("div",{staticClass:"card-footer text-right"},[n("router-link",{directives:[{name:"show",rawName:"v-show",value:e.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/transport/vehicle/document"}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),e.id?e._e():n("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(t){return e.$emit("cancel")}}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),n("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[e.id?n("span",[e._v(e._s(e.trans("general.update")))]):n("span",[e._v(e._s(e.trans("general.save")))])])],1)])])}),[],!1,null,null,null);t.a=s.exports}}]);
//# sourceMappingURL=index.js.map?id=c4d69620a667c43b121b