PageSourceSearch

https://portal.clickheredigital.com/assets/ProspectsIndexPage-CiLUvSao.js

js clickheredigital.com collected 2026-09-24 13:08:10 UTC 6,779 bytes, 1 lines download raw bytes

1import{n as C,d as k,ar as $,m as w,K as B,D,c as P,z as I,O as T,G as l,u as M,r as m,o as R,a as z,aH as G}from"./index-C3PRlZvS.js";import{I as L}from"./IndustryResource-M9XhWYYL.js";import{P as N}from"./PageHeader-PLupPr9R.js";import{u as S}from"./useFilter--W0njOqf.js";import{P as _}from"./ProspectResource-fjsuRWSC.js";const E={__name:"ProspectTable",props:{headers:{type:Array,required:!0},items:{type:Array,required:!0},loading:{type:Boolean,default:!1}},setup(h){k.extend($);const e=w(),{showErrorNotification:t,showSuccessNotification:r}=M(),{confirm:s}=B("prospect"),{can:a}=D(),c=P(()=>a("manage","Clients"));function y(n){return k(n).utc().format("YYYY-MM-DD")}function o(n){return n?n.reduce((u,v)=>(u+=v.invoiceAmount,u),0).toFixed(2):0}function d(n){s(async()=>{await _.archiveProspectById(n).then(()=>{r("Prospect has been deleted."),l.emit("prospects-list-refresh")}).catch(()=>{t()})})}async function g(n){await _.restoreProspectById(n).then(()=>{r("Prospect has been restored."),l.emit("prospects-list-refresh")}).catch(()=>{t()})}async function p(n){await _.convertToActive(n).then(()=>{r("Prospect has been converted."),l.emit("prospects-list-refresh")}).catch(()=>{t()})}return{__sfc:!0,router:e,showErrorNotification:t,showSuccessNotification:r,confirmDeleteProspect:s,can:a,canManage:c,makeCalculate:y,sumOfBudgets:o,deleteProspect:d,restoreProspect:g,convertToActive:p,formatCurrency:T,formatDate:I}}};var F=function(){var e=this,t=e._self._c,r=e._self._setupProxy;return t("div",[t("v-data-table",{staticClass:"elevation-1",attrs:{"footer-props":{"items-per-page-options":[10,20,30,40,300]},"items-per-page":300,loading:e.loading,flat:"",headers:e.headers,items:e.items},scopedSlots:e._u([{key:"item.name",fn:function({item:s}){return[e._v(" "+e._s(s.deletedAt?`${s.name} (Deleted)`:s.name)+" ")]}},{key:"item.pitchedBy",fn:function({item:s}){return[e._v(" "+e._s(s.pitchedBy?s.pitchedBy.fullName:"")+" ")]}},{key:"item.pitchedDate",fn:function({item:s}){return[e._v(" "+e._s(r.formatDate(s.pitchedDate?r.makeCalculate(s.pitchedDate):null))+" ")]}},{key:"item.group",fn:function({item:s}){return[e._v(" "+e._s(s.Group?s.Group.name:"")+" ")]}},{key:"item.budgets",fn:function({item:s}){return[t("RouterLink",{attrs:{to:{name:"clients.profile.budgets",params:{slug:s.slug}}}},[e._v(" "+e._s(r.formatCurrency(r.sumOfBudgets(s.budgets)))+" ")])]}},{key:"item.proposedCloseAt",fn:function({item:s}){return[e._v(" "+e._s(r.formatDate(s.proposedCloseAt?r.makeCalculate(s.proposedCloseAt):null))+" ")]}},{key:"item.actions",fn:function({item:s}){return[t("v-menu",{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:c}){return[t("v-btn",e._g(e._b({attrs:{color:"primary",small:"",dark:""}},"v-btn",c,!1),a),[e._v("Actions")])]}}],null,!0)},[t("v-list",[t("v-list-item",{on:{click:function(a){return r.router.push({name:"agreement.index",params:{slug:s.slug}})}}},[t("v-list-item-title",[e._v("Generate Agreement")])],1),r.canManage?t("v-list-item",{on:{click:function(a){return r.convertToActive(s.id)}}},[t("v-list-item-title",[e._v("Convert to Active")])],1):e._e(),t("v-list-item",{attrs:{to:{name:"clients.profile.activity",params:{slug:s.slug}}}},[t("v-list-item-title",[e._v("Edit prospect")])],1),r.canManage&&!s.deletedAt?t("v-list-item",{on:{click:function(a){return r.deleteProspect(s.id)}}},[t("v-list-item-title",[e._v("Delete prospect")])],1):r.canManage?t("v-list-item",{on:{click:function(a){return r.restoreProspect(s.id)}}},[t("v-list-item-title",[e._v("Restore prospect")])],1):e._e()],1)],1)]}}])})],1)},U=[],Y=C(E,F,U,!1,null,null);const H=Y.exports,O={__name:"ProspectsIndexPage",setup(h){const e=m([]),{divisions:t}=S(e),{can:r}=D(),s=m(!0),a=[{text:"Client",value:"name"},{text:"Pitched by",value:"pitchedBy"},{text:"Pitched date",value:"pitchedDate"},{text:"Pitched to",value:"pitchedTo"},{text:"Group",value:"group"},{text:"Prospect budget",value:"budgets"},{text:"Proposed close Date",value:"proposedCloseAt"},{text:"Actions",value:"actions"}],c=m([]),y=[{name:"All",value:null},{name:"Active",value:"active"},{name:"Archived",value:"archived"}],o=m({type:null,division:null}),d=P(()=>r("manage","Clients")),g=P(()=>{let i=c.value.filter(f=>o.value.type?o.value.type==="active"?!f.deletedAt:!!f.deletedAt:!0);return o.value.division&&(i=i.filter(f=>{var A,x;return(x=(A=o.value.division)==null?void 0:A.value)==null?void 0:x.includes(f.industryId)})),i});async function p(){e.value=await L.getIndustriesList().then(i=>i.data)}async function n(){s.value=!0,c.value=await _.getProspectsList().then(i=>i.data),await p(),s.value=!1}function b(){d.value&&G.push({name:"prospects.create"})}function u(){l.on("prospect-filter",i=>{o.value=i,n()}),l.on("prospects-list-refresh",()=>{n()})}function v(){l.off("prospect-filter"),l.off("prospects-list-refresh")}return R(()=>{n(),u()}),z(()=>{v()}),{__sfc:!0,industries:e,divisions:t,can:r,loading:s,headers:a,prospects:c,types:y,filters:o,isUserAuthorized:d,items:g,getIndustries:p,getInitialData:n,checkProspectCreation:b,registerEvents:u,unloadEvents:v,PageHeader:N,ProspectTable:H}}};var j=function(){var e=this,t=e._self._c,r=e._self._setupProxy;return t("section",{},[t("div",{staticClass:"px-6 pt-3"},[t("v-alert",{attrs:{type:"error",elevation:"2"}},[e._v(" This is a legacy module and will soon be deprecated. Please use the "),t("v-btn",{attrs:{small:"",color:"primary",to:{name:"leads.index"}}},[e._v("Leads module")]),e._v(" instead. ")],1)],1),t(r.PageHeader,{staticClass:"pt-0 mt-0",scopedSlots:e._u([{key:"right",fn:function(){return[t("v-select",{attrs:{filled:"",label:"Active/Archived",items:r.types,"hide-details":"","item-text":"name","
1item-value":"value"},model:{value:r.filters.type,callback:function(s){e.$set(r.filters,"type",s)},expression:"filters.type"}}),t("div",{staticClass:"m-2"},[t("v-autocomplete",{attrs:{"item-text":"name",items:r.divisions,"return-object":"",label:"Division",clearable:"",filled:"","hide-details":""},model:{value:r.filters.division,callback:function(s){e.$set(r.filters,"division",s)},expression:"filters.division"}})],1),t("v-tooltip",{attrs:{left:"",disabled:r.isUserAuthorized},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[t("div",e._g({},s),[t("v-btn",{attrs:{large:"",color:"success",disabled:!r.isUserAuthorized},on:{click:function(a){return r.checkProspectCreation()}}},[t("v-icon",{attrs:{small:"",left:""}},[e._v("fas fa-plus")]),e._v(" New ")],1)],1)]}}])},[t("span",[e._v("Please use the Leads module to create a new prospective client.")])])]},proxy:!0}])},[e._v(" Prospects ")]),t("v-divider"),t("div",{staticClass:"p-6"},[t(r.ProspectTable,{attrs:{headers:r.headers,items:r.items,loading:r.loading}})],1)],1)},q=[],K=C(O,j,q,!1,null,null);const Z=K.exports;export{Z 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.