PageSourceSearch

https://portal.clickheredigital.com/assets/ClientFirstPartyDataUpload-2yOc5Gt3.js

js clickheredigital.com collected 2026-09-24 13:07:47 UTC 7,408 bytes, 1 lines download raw bytes

1import{i as v,a0 as R,a1 as k,$ as w,n as y,q,r as c,o as L,s as x,I as M,u as g,z as T,G as m,d as D}from"./index-C3PRlZvS.js";import{P as $}from"./PageHeader-PLupPr9R.js";R(w,k);const h={uploadFile:i=>v.post("/api/upload",i,{headers:{"Content-Type":"multipart/form-data"}}),getUploadedFiles:(i,t,e,a)=>v.get(`/api/clients/${t}/uploads?tenant_id=${i}&start_date=${e}&end_date=${a}`),deleteUploadedFile(i,t,e){return v.delete(`/api/clients/${t}/uploads/${e}?tenant_id=${i}`)}},Y={__name:"FirstPartyDataUploadForm",props:["client"],emits:["fetch"],setup(i,{emit:t}){const e=i,{showErrorNotification:a,showSuccessNotification:s}=g(),{requiredTextRule:n,requiredFileRule:u,fileShouldBeLessThanMBRule:f}=q(),_=c(null),l=c({client_id:null,submitted_by:null,tenant_id:null,data_source:"",data_type:"",month:"",file:null}),P=[{value:"elead",text:"ELead"},{value:"vinsolutions",text:"VinSolutions"},{value:"drivecentric",text:"DriveCentric"},{value:"dealervaultsls",text:"DealerVault Sales"},{value:"dealervaultsvc",text:"DealerVault Services"},{value:"locationiq",text:"LocationIQ"},{value:"smartpixl",text:"SmartPiXL"}],p=c(!1),S=[".csv",".xlsx",".xls"],C=c(!0);L(()=>{var o,r,d;l.value.client_id=e.client.id,l.value.submitted_by=(r=(o=x)==null?void 0:o.getters["authorization/currentUser"])==null?void 0:r.email,l.value.tenant_id=(d=x)==null?void 0:d.getters["authorization/currentTenantId"]});function F(){var o;l.value.data_source="",l.value.data_type="",l.value.month="",l.value.file=null,(o=_.value)==null||o.reset()}async function U(){var o;if((o=_.value)!=null&&o.validate()){p.value=!0;const r=new FormData;r.append("tenant_id",l.value.tenant_id),r.append("data_source",l.value.data_source),r.append("data_type",l.value.data_type),r.append("month",`${l.value.month}-01`),r.append("client_id",l.value.client_id),r.append("submitted_by",l.value.submitted_by),r.append("file",l.value.file),h.uploadFile(r).then(()=>{s("File is successfully uploaded for processing."),F(),t("fetch")}).catch(d=>{var b;a(((b=d==null?void 0:d.response)==null?void 0:b.data)||"There was an error uploading the file.")}).finally(()=>{p.value=!1})}}return{__sfc:!0,props:e,emit:t,showErrorNotification:a,showSuccessNotification:s,requiredTextRule:n,requiredFileRule:u,fileShouldBeLessThanMBRule:f,form:_,draft:l,dataSources:P,loading:p,acceptedFileTypes:S,valid:C,clearForm:F,submitForm:U,DatePickerField:M}}};var z=function(){var t=this,e=t._self._c,a=t._self._setupProxy;return e("v-form",{ref:"form",staticClass:"p-6",attrs:{"lazy-validation":""},model:{value:a.valid,callback:function(s){a.valid=s},expression:"valid"}},[e("v-card",{staticClass:"p-2"},[e("v-card-text",[e("v-row",[e("v-col",{attrs:{cols:"12"}},[e("v-select",{attrs:{label:"Data Source",items:a.dataSources,rules:a.requiredTextRule,"hide-details":"",filled:"",required:""},model:{value:a.draft.data_source,callback:function(s){t.$set(a.draft,"data_source",s)},expression:"draft.data_source"}})],1)],1),e("v-row",[e("v-col",{attrs:{cols:"12"}},[e("v-text-field",{attrs:{label:"Data Type",rules:a.requiredTextRule,"hide-details":"",filled:"",required:""},model:{value:a.draft.data_type,callback:function(s){t.$set(a.draft,"data_type",s)},expression:"draft.data_type"}})],1)],1),e("v-row",[e("v-col",{attrs:{cols:12}},[e(a.DatePickerField,{attrs:{menu:"","auto-commit":"",value:a.draft.month,type:"month",label:"Month","display-format":"MMM YYYY","prepend-inner-icon":"mdi-calendar",rules:a.requiredTextRule,"hide-details":"",filled:""},on:{input:function(s){a.draft.month=s}}})],1)],1),e("v-row",[e("v-col",{attrs:{cols:12}},[e("v-file-input",{attrs:{accept:a.acceptedFileTypes.join(","),label:"Upload File",rules:a.requiredFileRule.concat(a.fileShouldBeLessThanMBRule(10)),"prepend-icon":"","prepend-inner-icon":"mdi-attachment","hide-details":"",filled:"","show-size":"","small-chips":"",required:""},model:{value:a.draft.file,callback:function(s){t.$set(a.draft,"file",s)},expression:"draft.file"}})],1)],1)],1),e("v-card-actions",[e("v-spacer"),e("v-btn",{attrs:{large:"",color:"primary",disabled:!a.valid,loading:a.loading},on:{click:a.submitForm}},[t._v(" Submit ")])],1)],1)],1)},H=[],B=y(Y,z,H,!1,null,null);const I=B.exports,N={__name:"FirstPartyDataUploadHistory",props:["client","
1items"],emits:["fetch"],setup(i,{emit:t}){const e=i,{showErrorNotification:a,showSuccessNotification:s}=g(),n=c(!1),u=[{text:"Submitted At",value:"submitted_at"},{text:"Data Source",value:"data_source"},{text:"Status",value:"status_name"},{text:"Processed At",value:"processed_at"},{text:"Actions",value:"actions",align:"right"}];async function f(_){m.emit("delete","fpd-file"),m.on("confirmation-fpd-file",async l=>{l&&(n.value=!0,h.deleteUploadedFile(e.client.tenantId,e.client.id,_.id).then(()=>{t("fetch"),s("File and associated records have been deleted successfully.")}).catch(()=>{a()}).finally(()=>{n.value=!1})),m.off("confirmation-fpd-file")})}return{__sfc:!0,props:e,emit:t,showErrorNotification:a,showSuccessNotification:s,loading:n,headers:u,deleteFile:f,PageHeader:$,formatDate:T}}};var V=function(){var t=this,e=t._self._c,a=t._self._setupProxy;return e("div",[e(a.PageHeader,{attrs:{"sub-header":""}},[t._v("Upload History")]),e("div",{staticClass:"p-6"},[e("h6",{staticClass:"text-gray-600 pb-3"},[e("v-icon",{attrs:{small:""}},[t._v("fas fa-history")]),t._v(" Last 6 Months ")],1),e("v-data-table",{staticClass:"elevation-1",attrs:{loading:a.loading,headers:a.headers,items:t.items,"sort-by":"submitted_at","sort-desc":""},scopedSlots:t._u([{key:"item.submitted_at",fn:function({item:s}){return[e("p",[t._v(" "+t._s(a.formatDate(s.submitted_at,"LLL"))+" "),e("br"),t._v(" Submitted By: "+t._s(s.submitted_by)+" ")])]}},{key:"item.data_source",fn:function({item:s}){return[e("div",{staticClass:"capitalize"},[t._v(t._s(s.data_source))])]}},{key:"item.status_name",fn:function({item:s}){return[e("div",{staticClass:"capitalize"},[t._v(t._s(s.status_name))])]}},{key:"item.processed_at",fn:function({item:s}){return[e("p",[t._v(" "+t._s(a.formatDate(s.processed_at,"LLL"))+" "),e("br"),t._v(" "+t._s(s.process_message)+" ")])]}},{key:"item.actions",fn:function({item:s}){return[e("div",{staticClass:"flex"},[e("v-btn",{staticClass:"mr-2",attrs:{small:"",color:"error"},on:{click:function(n){return a.deleteFile(s)}}},[e("v-icon",{attrs:{small:""}},[t._v("fas fa-trash")])],1)],1)]}}])})],1)],1)},A=[],E=y(N,V,A,!1,null,null);const j=E.exports,G={__name:"ClientFirstPartyDataUpload",props:["client"],setup(i){const t=i,e=c([]),a=c(!1);function s(){a.value=!0;const n=D().subtract(6,"month").startOf("day").format("YYYY-MM-DD"),u=D().format("YYYY-MM-DD");h.getUploadedFiles(t.client.tenantId,t.client.id,n,u).then(f=>{e.value=f.data}).finally(()=>{a.value=!1})}return s(),{__sfc:!0,props:t,items:e,loading:a,fetchFiles:s,PageHeader:$,FirstPartyDataUploadForm:I,FirstPartyDataUploadHistory:j}}};var O=function(){var t=this,e=t._self._c,a=t._self._setupProxy;return e("section",[e("v-container",[e(a.PageHeader,{attrs:{"sub-header":""}},[t._v("First Party Data Upload")]),e("v-row",[e("v-col",{attrs:{cols:"8"}},[e(a.FirstPartyDataUploadForm,{attrs:{client:t.client},on:{fetch:a.fetchFiles}})],1)],1),e("v-divider",{staticClass:"my-8"}),e("v-row",[e("v-col",{attrs:{cols:"12"}},[e(a.FirstPartyDataUploadHistory,{attrs:{client:t.client,items:a.items},on:{fetch:a.fetchFiles}})],1)],1)],1)],1)},Q=[],X=y(G,O,Q,!1,null,null);const W=X.exports;export{W as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.