File: /var/www/html/public/static/js/hookinvoiceConfig-a4ccb3e5.js
import{getCompanyListWeb as Ie,addCompanyWeb as De,getInvoiceConfigWeb as xe,updateInvoiceConfigWeb as Pe,updateEmailConfigWeb as Se,sendEmailTestWeb as Te,getUserInfoWeb as We,yuyueFDF as Oe,deleteCompanyWeb as Be,setCompanyDefault as Ne}from"./po-53124e2d.js";import{d as O,u as je}from"./vue-router-a383d220.js";import{b7 as i}from"./message-2472a54a.js";import{o as B}from"./index-81e4a901.js";import{r as n,A as a,o as Re}from"./runtime-core.esm-bundler-6128546f.js";import"./index-912f0f0b.js";import"./preload-helper-78dc9057.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./utils-2ab4f76a.js";import"./focus-trap-53f1c6ab.js";import"./error-78e43d3e.js";function Xe(){const{query:k,params:Le}=O();je(),O();const d=n(!1),y=n(!0),N=n(null);n({start:0,end:0});const j=n(!1),E=n(!1),h=n(!1),R=n(!1),L=n(""),s=a({step:"",invoceGuide:5}),Y=n(""),_=n(""),b=n(""),C=n(""),A=n("");n("");const S=n([]),v=n([]),z=a({}),F=a({}),m=a({tableIndex:0,note:"",during:""}),u=a({company_name:"",first_name:"",last_name:"",phone:"",email:"",address:"",state:"Ontraio",city:"",hst:"",r_ac:"",rmt_register:"",country:"Canada",postal:"L3S 0E2",company_id:"",number_companyname:""}),o=a({smtp_serverv:"",smtp_port:"",from_email:"",email_password:"",comment:"Attached is the invoice for your therapy session at {Your company name}. Thank you for choosing us for your treatment. If you have any concerns or discomfort, feel free to contact us anytime.",comment1:"Attached is the invoice for your therapy session at {Your company name}. Thank you for choosing us for your treatment. If you have any concerns or discomfort, feel free to contact us anytime.",text:"Please write variables in the position where you need to add a name. company name: {{ company_name }} , company phone number: {{ company_phone }}",checked:!1,is_public:"N",flag:!0,msgCorrect:"",msgError:"",cursorStart:-1,selectionStart:"",selectionEnd:"",booking_desc:"Thanks for booking on {{service_date}}, at{{begin_time}} with therapist {{therapist_name}}. Please complete your health history at the following link before your appointment. Ignore if already done.",booking_desc3:"Thanks for booking on {{service_date}}, at{{begin_time}} with therapist {{therapist_name}}. Please complete your health history at the following link before your appointment. Ignore if already done.",booking_desc1:"Thanks for booking on {{service_date}}, at{{begin_time}} with therapist {{therapist_name}}. Please complete your health history at the following link before your appointment. Ignore if already done.",service_date:"",therapist_name:"",ymd:""});a({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const M=a({}),T=a({}),q=a({}),H=a({}),K=a({}),U=a({}),V=a({qo_item_str:"",name:"",address:"",way:"",shipping:[],itemsDetail:[],trackingNo:"",courier:"",comment:""}),I=a({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),$=n([{name:"Setup",id:1},{name:"Email Config",id:2}]),G=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"Company",prop:"company_name",minWidth:100,hide:({checkList:e})=>!e.includes("Company")},{label:"HST#",prop:"hst",minWidth:100,hide:({checkList:e})=>!e.includes("HST#")},{label:"Name",prop:"first_name",minWidth:100,hide:({checkList:e})=>!e.includes("Name")},{label:"Postal",prop:"postal",minWidth:100,hide:({checkList:e})=>!e.includes("Postal")},{label:"Phone",prop:"phone",minWidth:150,slot:"slotAction",hide:({checkList:e})=>!e.includes("Phone")},{label:"Email",prop:"email",minWidth:120,hide:({checkList:e})=>!e.includes("Email")},{label:"Address",prop:"address",minWidth:120,hide:({checkList:e})=>!e.includes("Address")},{label:"Provice",prop:"state",minWidth:120,hide:({checkList:e})=>!e.includes("Provice")},{label:"City",prop:"city",minWidth:120,hide:({checkList:e})=>!e.includes("City")},{label:"Default",prop:"city",minWidth:60,fixed:"right",slot:"Default",hide:({checkList:e})=>!e.includes("Default")},{label:"Action",fixed:"right",width:200,slot:"operation",hide:({checkList:e})=>!e.includes("Action")}],J=["勾选列","Company","HST#","Name","Postal","Phone","Email","Address","Provice","City","Default","Action"],c=a({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",type:"",role:""});function Q(){r()}function X(e){I.pageSize=e,r()}function Z(e){I.currentPage=e,r()}async function r(){d.value=!0;const{data:e}=await Ie(Object.assign(z,{searchKey:c.searchKey,Therapist_id:L.value}));S.value=e.data,d.value=!1}function ee(e){m.tableIndex=e}function te(){Object.keys(u).map(e=>{u[e]=""}),h.value=!0}async function oe(){const{data:e}=await De(Object.assign(M,{data_row:u}));e.code==1?(r(),h.value=!1,i({type:"success",message:e.msg})):i({type:"error",message:e.msg})}function ne(e){Object.keys(e).map(t=>{u[t]=e[t]}),h.value=!0}async function ae(e){const{data:t}=await Be(Object.assign(T,{company_id:e.id}));t.code==1?(r(),i({type:"success",message:t.msg})):i({type:"error",message:t.msg})}const ie=e=>{B.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{ae(e)}).catch(()=>{i({type:"info",message:"Canceled"})})};async function se(e){const{data:t}=await xe(Object.assign(q,{clinic_id:_}));t.code==1?(b.value=t.data,v.value=t.data.during_price,o.smtp_serverv=t.data.emailconfig.smtp_serverv,o.smtp_port=t.data.emailconfig.smtp_port,o.from_email=t.data.emailconfig.from_email,o.email_password=t.data.emailconfig.email_password,o.is_public=t.data.emailconfig.is_public,o.ymd=t.ymd,A.value=t.data.companyInfo[0].company_name,C.value=t.data.companyInfo[0].phone,t.data.emailconfig.is_public=="Y"?o.checked=!0:o.checked=!1,t.data.emailconfig.message?(o.comment=t.data.emailconfig.message,w()):o.comment="Attached is the invoice for your therapy session at  {{company_name}} . Thank you for choosing us for your treatment. If you have any concerns or discomfort, feel free to contact us anytime.",t.data.emailconfig.booking_message?(o.booking_desc=t.data.emailconfig.booking_message,p()):o.booking_desc=o.booking_desc3):i({type:"error",message:t.msg})}async function ce(e){const{data:t}=await Pe(Object.assign(H,{date_row:b,action:"config",during_price:v,clinic_id:_}));t.code==1?i({type:"success",message:t.msg}):i({type:"error",message:t.msg})}function re(){E.value=!0}function me(){if(m.during==""){i({type:"info",message:"Please Enter During Value"});return}let e={during:m.during,price:0};v.value.push(e),E.value=!1}function le(e){e?o.is_public="Y":o.is_public="N"}function de(){o.comment="Attached is the invoice for your therapy session at  {{company_name}} . Thank you for choosing us for your treatment. If you have any concerns or discomfort, feel free to contact us anytime.",w(o.comment)}function ue(e){const t=document.getElementById("inputRefId"),l=t.selectionStart,f=t.selectionEnd;setTimeout(()=>{const g=e,D=o.comment.substring(0,l),x=o.comment.substring(f),P=D+g+x;o.comment=P,w()},500)}function pe(e){const t=document.getElementById("bookingId"),l=t.selectionStart,f=t.selectionEnd;setTimeout(()=>{const g=e,D=o.booking_desc.substring(0,l),x=o.booking_desc.substring(f),P=D+g+x;o.booking_desc=P,p()},500)}function w(e){var t=o.comment;t=t.replace(new RegExp("{{company_phone}}","g"),C.value),t=t.replace(new RegExp("{{company_name}}","g"),A.value),o.comment1=t}function p(e){var t=o.booking_desc;t=t.replace(new RegExp("{{service_date}}","g"),o.service_date),t=t.replace(new RegExp("{{begin_time}}","g"),"14:00"),t=t.replace(new RegExp("{{therapist_name}}","g"),o.therapist_name),o.booking_desc1=t}function fe(e){}async function W(e){d.value=!0;const{data:t}=await Se(Object.assign(F,{smtp_serverv:o.smtp_serverv,smtp_port:o.smtp_port,from_email:o.from_email,email_password:o.email_password,is_public:o.is_public,message:o.comment,booking_message:o.booking_desc,clinic_id:_}));t.code==1&&e==2&&i({type:"success",message:t.msg})}function ge(){if(o.is_public=="N"){var e=document.getElementById("ps");y.value?(e.type="text",y.value=!1):(e.type="password",y.value=!0)}}async function ye(){o.msgCorrect="",o.msgError="",d.value=!0;const{data:e}=await Te(Object.assign(K,{smtp_serverv:o.smtp_serverv,smtp_port:o.smtp_port,from_email:o.from_email,email_password:o.email_password}));e.code==1?(o.msgCorrect=e.result,o.msgError="",W(1)):(o.msgError=e.error,o.msgCorrect="")}function he(){o.booking_desc=o.booking_desc3,p(o.booking_desc)}function _e(){const e=new Date,t=e.getFullYear(),l=String(e.getMonth()+1).padStart(2,"0"),f=String(e.getDate()).padStart(2,"0"),g=`${t}-${l}-${f}`;o.service_date=g,setTimeout(()=>{p(o.booking_desc)},500)}async function be(){const{data:e}=await We(Object.assign(U,{}));e.code==0?o.therapist_name=e.data.firstName+e.data.lastName:i({type:"error",message:e.msg})}async function ve(e){const{data:t}=await Ne(Object.assign(T,{company_id:e.id}));t.code==1?(r(),i({type:"success",message:t.msg})):i({type:"error",message:t.msg})}const we=e=>{B.confirm("Are you sure you want to set this address as the default value",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{ve(e)}).catch(()=>{i({type:"info",message:"Canceled"})})};function ke(e,t,l){b.value.chapter_image=Oe+e.data.file_path.replace("/var/www/html/public","")}function Ee(){k.invoceGuide==4&&(s.step=4),k.help&&(m.tableIndex=k.help)}function Ce(){s.step=""}function Ae(){s.step==4?(s.step=5,m.tableIndex=1):s.step==5&&(s.step="")}return Re(()=>{_.value=localStorage.getItem("clinicIdOverall"),c.type=localStorage.getItem("type"),c.type==2&&(c.role="clinic"),c.type==1&&(c.role="therapists"),r(),se(),Ee(),_e(),be()}),{searchDetail:c,btnSearchPart:Q,loading:d,small:R,selectList:J,columns:G,pagination:I,handleSizeChange:X,handleCurrentChange:Z,PartList:S,order_date:Y,deliverDialog:j,deliverDataArr:V,btnDeliverConfirm:oe,locationData:$,itemArr:m,onSituationArr:ee,addLocationDialog:h,btnAdd:te,locationArr:u,EditLocation:ne,btnDellocation:ie,during_price:v,onUpdate:ce,configData:b,addDuring:re,addDuringDialog:E,addDuringConfirm:me,EmailConfig:o,onCheckbox:le,onEmailConfig:W,showEye:ge,flag:y,onEmailTest:ye,onRestore1:de,giveName:ue,onBlur:fe,inputRef:N,company_phone:C,company_name:A,getComment1:w,onRestoreBooking:he,giveNameB:pe,getCommentB:p,defaultAdress:we,uploadSlotFile1:ke,processArr:s,onCancel:Ce,onNext:Ae}}export{Xe as useEqu};