File: /var/www/html/public/static/js/hookBoInfo-dad03a02.js
import{addCompanyWeb as vs,getdaysClander as ys,bookingSchduleListWeb as bs,bookingOrderWeb as Ss,sendBookingEmailWeb as ks,getHealthFormDataWeb as ws,submitHealthFormModelWeb as Cs,bookingCheckIn as As,getCustomerLogsWeb as Ds,bookingAmountCalculteWeb as Pi,submitNoteFormWeb as xs,getInvoiceNumberWeb as Ts,newInvoiceWeb as Os,getServiceListWeb as Wi,getManagerClinicsListWeb as Is,getLicenceServiceWeb as Ns,invoicePaymentWeb as Es,prePaidWeb as js,checkTherapistServiceWeb as Bs,getTherapistListByClinic as Ps,invoiceDetailArrWeb as Ws,updateShowNumber as Ms,sendEmailBatchWeb as Fs,bookingDetailWeb as Ls,SendEvaluationEmailWeb as Js,BookingSubmitWeb as qs,bookingDetailClientWeb as Rs,yuyueFDF as he,getNoteFormWeb as Vs,invoicePdfWeb as Hs,getMuitiBookingDateWeb as Ys,getBookingsByDateWeb as Us,getNoteSensiveWeb as zs,sendBookingSensitiveEmailWeb as Ks,setInvoicePaidWeb as Gs,getIllNessListBySymptomWeb as Xs,deleteCompanyWeb as Zs,bookingPaymentWeb as Qs,getCheckMembersWeb as $s,bookingDelete as eo,getUsedFormByCustomerWeb as io,BookingCompleteWeb as to,saveDefaultTaxWeb as ao}from"./po-fb6b3580.js";import{d as Mi,u as no}from"./vue-router-a383d220.js";import{f as so}from"./fabric-de8c9a53.js";import{b7 as c}from"./message-2472a54a.js";import{o as C}from"./index-81e4a901.js";import{g as oo}from"./upload-0ec567a8.js";import{r as o,A as l,o as co}from"./runtime-core.esm-bundler-6128546f.js";import"./index-d7b646b9.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 Ao(){const{query:ve,params:lo}=Mi(),I=no();Mi();const Fi=o([]),qe=o([]),Re=o([]),_=o(!1),Z=o(!1),Ve=o(!1),He=o(!1),Ye=o([]),y=o([]),ye=o([]),Q=o(!1),$=o(!1),be=o(!1),Ue=o(!1),F=o(!1),ze=o(!1),Ke=o(!1),L=o(!1),Se=o(!1),ke=o(!1),Ge=o(null),we=o(""),ee=o(""),Xe=o(""),Ce=o(""),j=o(""),Ze=o(""),h=o(""),Li=o(""),B=o(""),Qe=o(""),Ji=o(""),$e=o(""),ei=o(""),Ae=o([]),A=o([]),ii=o([]),J=o([]),q=o([]),D=o([]),qi=o([]),ie=o([]),te=o([]),u=o([]),ti=o(!1),De=o(!1),ae=o(!1),xe=o(!1),Te=o(!1),ai=o(!1),ni=o(!1),Oe=o(!1),R=o(!1),ne=o(!1),si=o(!1),se=o(!1),V=o(!1),oe=o(!1),Ri=o(!1),Vi=o(""),oi=o(""),H=o(""),Hi=o([]),ci=o([]),x=o([]),li=o([]),ri=o([]),di=o([]),Yi=o([]),_i=o([]),ui=o([]),mi=o([]),ce=o([]),le=o([]),fi=o([]),Ui=l({});l({});const zi=l({}),Ki=l({}),Gi=l({}),Xi=l({}),Zi=l({}),Qi=l({}),$i=l({}),et=l({}),it=l({}),tt=l({}),at=l({}),nt=l({}),st=l({}),ot=l({}),ct=l({}),lt=l({}),rt=l({}),dt=l({}),gi=l({}),pi=l({});l({});const _t=l({});l({});const ut=l({}),mt=l({}),ft=l({}),gt=l({}),pt=l({}),ht=l({}),vt=l({}),yt=l({}),bt=l({}),St=l({}),kt=l({}),wt=l({}),Ct=l({}),At=l({}),Dt=l({}),xt=l({}),Tt=l({}),Ot=l({});l({});const It=l({}),Nt=l({}),hi=o(1),vi=o(!1),yi=l({Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:"",customer_name:""}),Et=o([{name:"Basic Info",id:1},{name:"Invoices",id:2}]),Y=o([{id:1,text:"Mobile SMS",value:"message",is_selected:0},{id:2,text:"Email",value:"email",is_selected:0}]),bi=o([{id:1,text:"Free",value:"free",is_selected:1},{id:2,text:"New",value:"new",is_selected:1},{id:3,text:"Check In",value:"check_in",is_selected:1},{id:4,text:"Invoice",value:"invoice",is_selected:1},{id:5,text:"Email",value:"email",is_selected:1}]),jt=o([{value:"Massage Therapy Treatment",text:"Massage Therapy Treatment"},{value:"Acupuncture Treatment",text:"Acupuncture Treatment"}]),Bt=o([{value:"Y",text:"Y"},{value:"N",text:"N"}]),k=o([{id:1,price:0,spend_time:"",treatment_date:""}]),Pt=o([{value:"normal",text:"Normal"},{value:"third_Pay",text:"Third Pay"},{value:"gift",text:"Gift"}]),P=l({note_id:"",form_type:"",str:""}),Ie=l({name:"",today_date:"",hear_about:"",chief_complaint:"",rashes_bruise:!1,address:"",Birth:"",Code_ZIP:"",Occupation:"",Phone:"",Work_Phone:"",Physician:"",Phone1:"",City:""}),a=l({tableIndex:0,is_invoice:!1,SignatureValue:"Please sign in the mini program",time:"",note_id:"",signal_url1:"",signal_url2:"",signal_desc1:"",signal_desc2:"",form_type:"",sensitived_url:"",sensitived_desc:"",ougoing_url1:"",ougoing_url2:"",ougoing_url3:"",ougoing_url4:"",ougoing_url5:"",ougoing_desc1:"",ougoing_desc2:"",ougoing_desc3:"",ougoing_desc4:"",ougoing_desc5:"",userId1:"",formInfo1:"",formInfo2:"",formInfo3:"",formInfo4:"",formInfo5:"",imgView:"",service_name:"",Therapist_name:"",date:0,month:"",action:"",click_date:"",checked1:!0,therapist_name:"",userId:"",last_day:"",next_day:"",Clinic_id:"",type:"",LicenceServeValue:"",next_page:"",prev_page:"",page:1,therapists_name:"",is_invoiceShow:1,is_tax:!0,include_tax:"Y",service_id:"",is_form_edit:1,is_form_history:2,is_historyAll:2,is_leftShow:1,is_additional:"",is_health:"",treatment_description:""}),N=l({plan:"",date:"",daily_living:"",treatment_goal:"",focus_treatment:"",frequency:"",duration:"",performed:"",assessments:"",schedule:"",responses:"",recommended:"",hydrotherapy:"",contraindications:"",referrals:"",discussed_with:"",treatment_plan:"",checkedCities:""}),v=l({notes:"",date:"",time:"",duration:"",fee:"",assessment:"",therapist:"",findings:"",feedback:"",self_care:"",timeType:"",durationType:"",receivedType:"",client_goal:""}),E=l({name:"",name1:"",indication:"",client_name:"",date:"",checkedCities:""}),U=l({date1:"",date2:"",date3:"",date4:"",date5:""}),Si=o([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),ki=o([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),Ne=o([{id:1,text:"AM",value:"am",is_selected:0},{id:2,text:"PM",value:"pm",is_selected:0}]),wi=o([{id:1,text:"min.",value:"min",is_selected:1},{id:2,text:"hr.",value:"hr",is_selected:0}]),Wt=o([{id:1,text:"Paypal",value:"Paypal"},{id:2,text:"VISA",value:"VISA"},{id:3,text:"MasterCard",value:"MasterCard"},{id:4,text:"AMERICAN_EXPRESS",value:"AMERICAN_EXPRESS"},{id:5,text:"Cheque",value:"Cheque"},{id:6,text:"BankTransfer",value:"BankTransfer"},{id:7,text:"Cash",value:"Cash"},{id:8,text:"Other",value:"Other"}]),W=o([{id:1,name:"Chest Wall Muscles (not including breasts)",is_selected:0,signal_url1:""},{id:2,name:"Breast (s)",is_selected:0,signal_url1:""},{id:3,name:"Buttocks (gluteal muscles)",is_selected:0,signal_url1:""},{id:4,name:"Upper Inner Thigh(s)",is_selected:0,signal_url1:""}]),re=o([{id:1,name:"back",is_selected:0},{id:2,name:"neck",is_selected:0},{id:3,name:"shoulders",is_selected:0},{id:4,name:"face",is_selected:0},{id:5,name:"arm L",is_selected:0},{id:6,name:"arm R",is_selected:0},{id:7,name:"leg L",is_selected:0},{id:8,name:"leg R",is_selected:0},{id:9,name:"hip area",is_selected:0},{id:10,name:"abdominals",is_selected:0},{id:11,name:"chest",is_selected:0},{id:12,name:"breast",is_selected:0},{id:13,name:"other (list)",is_selected:0,input:""}]),de=o([{id:1,name:"Swedish",is_selected:0},{id:2,name:"Frictions",is_selected:0},{id:3,name:"deep facial",is_selected:0},{id:4,name:"trigger points",is_selected:0},{id:5,name:"stretch",is_selected:0},{id:6,name:"intra-oral",is_selected:0},{id:7,name:"Breast",is_selected:0},{id:8,name:"Hydrotherapy",is_selected:0},{id:9,name:"joint mobilization grade: ",is_selected:0,input:""},{id:10,name:"other (list) ",is_selected:0,input:""}]),Ci=o([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),_e=o([{id:1,name:"back",is_selected:0},{id:2,name:"neck",is_selected:0},{id:3,name:"shoulders",is_selected:0},{id:4,name:"face",is_selected:0},{id:5,name:"arm L",is_selected:0},{id:6,name:"arm R",is_selected:0},{id:7,name:"leg L",is_selected:0},{id:8,name:"leg R",is_selected:0},{id:9,name:"gluteus",is_selected:0},{id:10,name:"abdominals",is_selected:0},{id:11,name:"chest",is_selected:0},{id:12,name:"breast",is_selected:0},{id:13,name:"other (list)",is_selected:0,input:""}]),b=o([]);o([{id:1,date:"",time:"",amount:0,duration:60}]);const w=l({tableIndex:0,note:"",symptom_name_arr:"",symptom_str_arr:"",is_Client:""}),d=l({name:"",email_to:"",email_content:"",phone_to:"",booking_notice_type:"",booking_id:"",is_booking:1,booking_arr:[],sentive_include:!1,is_health_form:0,is_informed:"",is_sensitived:"",bookingServers:"",bookingorder_id:"",health_form_url:"",informed_content_url:"",informed_content_first_url:"",sentitive_content_url:"",email_type:"",email_health:!1,email_informed:!1}),t=l({signal_desc:"",loacation_id:"",loacation_name:"",Client_name:"",Client_id:"",date:"",time:"",service_name:"Massage",service_name1:"Massage",service_id1:"",service_disabled:!0,Therapist_name:"",Therapist_id:"",comment:"",During:"",gender:-1,description:"",service_times:"",config_id:"",dateInfo:"",Terapist:"",is_items:!1,Invoice_Number:"",hstValue:0,total:0,include_tax:"N",is_tax:"Y",is_tax1:!0,r_ac_name:"",r_ac_register:"",name1:"",rmt_register:"",signal_image5:"",receive:"",invoice_due_date:"",invoice_type:"normal",note_id:"",loacation_id1:"",loacation_name1:"",Client_name1:"",Client_id1:"",date1:"",description_type:"Massage Therapy Treatment",description_type1:"",booking_id:"",amount:"",amount1:"",booking_order_no:"",bookingorder_id:"",loacation_id_add:"",loacation_name_add:"",is_loacation:"",customArr:"",email_content:"",file_path:[],used_form_id:"",Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",chapter_image:"",is_use_chapter:"",is_Auto:0,interval_days:7,invoiceTherapist_name:"",invoiceTherapist_id:"",has_therapistlicence:"",files:[],files1:[],fileView:[]}),p=l({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",account_id:"",time:"",other:""}),z=l({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:""});l({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const ue=l({name:"",id:"",clinic_id:""}),S=l({signal_url:"",form_type:"",note_id:"",service:"",service_id:""}),K=l({name:"",id:""}),Mt=l({qo_item_str:"",name:"",address:"",way:"",shipping:[],itemsDetail:[],trackingNo:"",courier:"",comment:""}),Ee=l({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),G=o([{id:1,name:"Massage",value:"Massage",is_Selected:1},{id:2,name:"Acupuncture",value:"Acupuncture",is_Selected:0}]),Ft=[{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:"Action",fixed:"right",width:120,slot:"operation",hide:({checkList:e})=>!e.includes("Action")}],Lt=["勾选列","Company","HST#","Name","Postal","Phone","Email","Address","Provice","City","Action"],m=l({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",searchKey1:"",bookingorder_id:"",room:"",show_number:"",type:"",role:"",tableIndex:0});function Jt(e){Ee.pageSize=e,X()}function qt(e){Ee.currentPage=e,X()}const Rt=(e,i)=>{if(e.length>1){const s=e.shift();singleTableRef.value.toggleRowSelection(s,!1)}ve.note&&I.push({path:"/crm/yuyue/note",query:{location_id:i.id,location:encodeURIComponent(JSON.stringify(i))}})};function Vt(e){a.tableIndex=e}function Ht(){Object.keys(z).map(e=>{z[e]=""}),se.value=!0}async function Yt(){const{data:e}=await vs(Object.assign(ct,{data_row:z}));e.code==1?(X(),se.value=!1,c({type:"success",message:e.msg})):c({type:"error",message:e.msg})}function Ut(e){Object.keys(e).map(i=>{z[i]=e[i]}),se.value=!0}async function zt(e){const{data:i}=await Zs(Object.assign(Xi,{company_id:e.id}));i.code==1?(X(),c({type:"success",message:i.msg})):c({type:"error",message:i.msg})}const Ai=e=>{C.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{zt(e)}).catch(()=>{c({type:"info",message:"Canceled"})})};function Kt(){const e=new Date,i=e.getFullYear(),s=("0"+(e.getMonth()+1)).slice(-2),n=("0"+e.getDate()).slice(-2);oi.value=i+"-"+s+"-"+n}function Gt(){}function Xt(){a.prev_page==-2&&(a.click_date=a.last_day,a.action="click",M(a.action)),a.prev_page>0&&(a.page=a.prev_page,f())}function Zt(){a.next_page==-2&&(a.click_date=a.next_day,a.action="click",M(a.action)),a.next_page>0&&(a.page=a.next_page,f())}async function M(e,i){const s=localStorage.getItem("type");let n="";s==2&&(n="one"),e!==" "&&(a.action=e);const{data:r}=await ys(Object.assign(zi,{month:a.month,action:a.action,click_date:a.click_date,many_one:n}));r.code==1&&(a.month=r.month,ui.value=r.data,ce.value=r.higher_days,a.last_day=r.pre_next_day.last_day,a.next_day=r.pre_next_day.next_day,localStorage.getItem("type"),a.click_date=ce.value[0],(a.type==1||a.Clinic_id||a.type==6)&&f())}function Qt(e){a.action="click",a.click_date=e.date,M(a.action)}async function f(e){let i="";e==1&&(i=1);const s=localStorage.getItem("type"),{data:n}=await bs(Object.assign(Zi,{date:ce.value,type:s,clinics_id:a.Clinic_id,services_array:t.service_name,page:a.page,stulesShow:bi.value}));n.code==1?(F.value==!0&&i==""&&Je(),e==1&&(F.value=!1),fi.value=n.data.content,ri.value=n.data.title,a.therapist_name=n.data.therapist_name,t.loacation_id=n.data.location.id,t.loacation_name=n.data.location.company_name,a.next_page=n.page_data.next_page,a.prev_page=n.page_data.prev_page,Re.value=n.data.visual_data):c({type:"error",message:n.msg})}function $t(){ai.value=!0}function ea(e){t.is_loacation=e,si.value=!0}function ia(){t.is_loacation==1?(t.loacation_name=K.name,t.loacation_id=K.id):t.is_loacation==2&&(t.loacation_name_add=K.name,t.loacation_id_add=K.id)}async function ta(){_.value=!0,t.is_items||(b.value=[]);const{data:e}=await Ss(Object.assign(Qi,{clinics_id:a.Clinic_id,therapist_list:t.Therapist_id,description:t.description,service_date:t.date,service_times:t.service_times,first_name:"",last_name:"",phone:"",email:"",config_id:t.config_id,add_session:"",during:t.During,sex:t.gender,customer_id:t.Client_id,company_id:t.loacation_id_add,Description_type:t.service_name1,mul_service:b,amount:t.amount,booking_id:t.booking_id,type:a.type,counter:"",higher_days:ce.value,is_invoice:a.is_invoice,is_tax:a.is_tax,include_tax:a.include_tax,additional_Service:y.value}));e.code==1?(_.value=!1,t.booking_id==""&&a.is_invoice&&(Q.value=!0,h.value=e.bookingdetail,t.invoiceTherapist_name=e.bookingdetail.therapists_name,t.invoiceTherapist_id=e.bookingdetail.therapists_id,A.value=JSON.parse(JSON.stringify(e.bookingdetail.clients.combina_service_arr)),A.value.forEach((i,s)=>{i.service_detail.forEach((n,r)=>{n.spend_time=Number(n.spend_time)}),Be(i),T(i)})),D.value=e.invoiceIdArr,q.value=e.email_values.booking_detail,d.email_content=e.email_values.booking_message,d.email_to=e.email_values.email_to,d.phone_to=e.email_values.phone_to,e.email_values.booking_notice_type&&(d.booking_notice_type=e.email_values.booking_notice_type,Y.value.forEach((i,s)=>{d.booking_notice_type.includes(i.value)&&(i.is_selected=1)})),d.name=e.email_values.name,d.booking_id=e.email_values.booking_id,d.is_booking=1,d.booking_arr=e.email_values.booking_arr,d.is_health_form=e.email_values.booking_detail[0].is_health_form,d.is_informed=e.email_values.booking_detail[0].is_informed,d.is_sensitived=e.email_values.booking_detail[0].is_sensitived,d.health_form_url=e.email_values.booking_detail[0].health_form_url,d.informed_content_url=e.email_values.booking_detail[0].informed_content_url,d.sentitive_content_url=e.email_values.booking_detail[0].sentitive_content_url,d.bookingServers=t.service_name1,d.sentive_include=!1,e.result_key.is_data_change==1&&(a.click_date=e.result_key.data),a.action="click",a.page=e.result_key.page,M(a.action),V.value=!1,d.email_health=!1,d.email_informed=!1,d.email_type="",R.value=!0):(_.value=!1,e.index?e.index==-1?c({type:"error",message:"Article 1: Appointment Time Conflict"}):e.index==1&&c({type:"error",message:"Multiple appointment times conflict, please click on the date to view"}):c({type:"error",message:e.msg})),_.value=!1}async function aa(){_.value=!0;let e="";const i=[];d.email_type==""?(d.email_health&&i.push("health"),d.email_informed&&i.push("informed"),e=i.toString()):e=d.email_type;const{data:s}=await ks(Object.assign(Ki,{booking_id:d.booking_id,email_content:d.email_content,booking_arr:d.booking_arr,phone_to:d.phone_to,booking_notice_type:d.booking_notice_type,sentive_include:d.sentive_include,form_type:e}));s.code==1?(c({type:"success",message:s.msg}),f(),Q.value&&t.booking_id==""&&je(h.value),R.value=!1):c({type:"error",message:s.msg}),_.value=!1}async function Di(e,i){a.is_health=i,a.userId1=e.clients.customer_id;const{data:s}=await ws(Object.assign($i,{customer_id:e.clients.customer_id}));s.code==1&&(Ae.value=s.model.health_info,Object.keys(s.model.information).map(n=>{Ie[n]=s.model.information[n]}),Te.value=!0)}async function na(e){_.value=!0;const i={information:Ie,health_info:Ae.value},{data:s}=await Cs(Object.assign(et,{customer_id:a.userId1,data_row:i}));s.code==1?(oe.value&&Le(H.value),c({type:"success",message:s.msg}),f(),Te.value=!1,_.value=!1):(c({type:"error",message:s.msg}),_.value=!1)}async function xi(){const{data:e}=await As(Object.assign(it,{bookingorder_id:m.bookingorder_id}));e.code==1?(f(),oe.value=!1,c({type:"success",message:e.msg})):c({type:"error",message:e.msg})}async function sa(e){const{data:i}=await Qs(Object.assign(tt,{bookingorder_id:e.clients.id}));i.code==1?(f(),c({type:"success",message:i.msg})):c({type:"error",message:i.msg})}const oa=e=>{C.confirm("Are you sure to payment?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{sa(e)}).catch(()=>{c({type:"info",message:"Canceled"})})};function ca(e,i){i.is_selected==1?i.is_selected=0:i.is_selected==0&&(i.is_selected=1)}function la(e){e.is_Selected==1?(e.is_Selected=0,e.is_Selected1=0):(e.is_Selected=1,e.is_Selected1=1),a.page=1,ra()}function ra(){const e=[],i=[];u.value=[],G.value.forEach((s,n)=>{s.is_Selected==1&&(e.push(s.name),i.push(s))}),u.value=i,t.service_name=e.toString(),e.length>1?t.service_disabled=!1:t.service_disabled=!0,e.length==0&&(t.service_name1=""),e.length>0&&(t.service_name1=e[0]),u.value.length>0&&(u.value[0].additional_Service?y.value=JSON.parse(JSON.stringify(u.value[0].additional_Service)):y.value=[],u.value.forEach((s,n)=>{n>0&&(s.is_Selected1=0)})),Ni()}async function da(e){const{data:i}=await Ds(Object.assign(at,{customer_id:t.Client_id}));i.code==1?(_i.value=i.data.booking_arr,li.value=i.data.note_arr,ti.value=!0):c({type:"error",message:i.msg})}function _a(e){e.clients.is_more=2}function ua(e){e.clients.is_more=1}function Ti(e){Oi(e)}async function Oi(e){u.value.forEach((s,n)=>{s.name==t.service_name1&&(t.service_id1=s.id)});const{data:i}=await Pi(Object.assign(pi,{descrption:t.service_name1,Therapist_id:t.Therapist_id,during:e.duration,customer_id:t.Client_id,role:m.role,clinic_id:B,service_id:t.service_id1,additional_Service:y.value}));i.code==1?e.amount=i.total_amount:c({type:"error",message:i.msg})}function ma(e){const i=b.value.findIndex(s=>s.id===e.id);i!==-1&&b.value.splice(i,1),b.value.forEach((s,n)=>{s.id=n+1})}const fa=e=>{C.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{ma(e)}).catch(()=>{c({type:"info",message:"Canceled"})})};async function Ii(e){if(a.form_type=="sensitived")return;_.value=!0;const i={detail:"",imageurl:""},s={detail:""};if(a.form_type=="informed"){const g={information:a.time,signal_desc1:a.signal_desc1,signal_desc2:a.signal_desc2},O={signal_url1:a.signal_url1,signal_url2:a.signal_url2};i.detail=g,i.imageurl=O}if(a.form_type=="treatment_plan"){const g={pendingProcessing:_e,information:N};s.detail=g}if(a.form_type=="treatment_note"){const g={information:v,usedData:de,areasData:re};s.detail=g}if(a.form_type=="sensitived"){const g={information:E,initialData:W,sensitived_desc:a.sensitived_desc},O={signal_url1:a.sensitived_url};i.detail=g,i.imageurl=O}if(a.form_type=="ougoing"){const g={ougoingArr:U,ougoing_desc1:a.ougoing_desc1,ougoing_desc2:a.ougoing_desc2,ougoing_desc3:a.ougoing_desc3,ougoing_desc4:a.ougoing_desc4,ougoing_desc5:a.ougoing_desc5},O={signal_url2:a.ougoing_url1,signal_url3:a.ougoing_url2,signal_url4:a.ougoing_url3,signal_url5:a.ougoing_url4,signal_url6:a.ougoing_url5};i.detail=g,i.imageurl=O}let n="";a.form_type=="treatment_plan"||a.form_type=="treatment_note"?n=s:a.form_type=="informed"||a.form_type=="sensitived"||a.form_type=="ougoing"?n=i:a.form_type=="treatment"&&(n={detail:{treatment_desc1:a.treatment_description}});const{data:r}=await xs(Object.assign(ot,{note_id:a.note_id,form_type:a.form_type,data_row:n}));r.code==1?(e==1&&(oe.value&&Le(H.value),f(),Oe.value=!1,c({type:"success",message:r.msg})),_.value=!1):(_.value=!1,c({type:"error",message:r.msg}))}function ga(e,i){a.is_form_edit!=2&&(Si.value.forEach((s,n)=>{s.is_selected=0}),e.is_selected=1,N.discussed_with=e.value)}function pa(e,i){a.is_form_edit!=2&&(ki.value.forEach((s,n)=>{s.is_selected=0}),e.is_selected=1,N.treatment_plan=e.value)}function ha(e,i){a.is_form_edit!=2&&(e?i.is_selected=1:i.is_selected=0)}function va(e){a.is_form_edit!=2&&(e.is_selected==1?e.is_selected=0:e.is_selected==0&&(e.is_selected=1))}function ya(e){a.is_form_edit!=2&&(e.is_selected==1?e.is_selected=0:e.is_selected=1)}function ba(e){a.is_form_edit!=2&&(e.is_selected==1?e.is_selected=0:e.is_selected=1)}function Sa(e,i){a.is_form_edit!=2&&(Ne.value.forEach((s,n)=>{s.is_selected=0}),e.is_selected=1,v.timeType=e.value)}function ka(e,i){a.is_form_edit!=2&&(wi.value.forEach((s,n)=>{s.is_selected=0}),e.is_selected=1,v.durationType=e.value)}function wa(e,i){a.is_form_edit!=2&&(Ci.value.forEach((s,n)=>{s.is_selected=0}),e.is_selected=1,v.receivedType=e.value)}function Ca(){if(m.searchKey1==""){c({type:"error",message:"Please fill in the query value"});return}I.push({path:"/crm/yuyue/booking",query:{searchKey:m.searchKey1}})}async function je(e){A.value.forEach((i,s)=>{T(i)}),t.include_tax="N",a.LicenceServeValue="",Ce.value=e,t.files=[],t.files1=[],k.value=[],_.value=!0,k.value=JSON.parse(JSON.stringify(e.need_invoice)),t.During=e.clients.spend_time,t.loacation_name1=e.clients.company_name,t.Client_name1=e.clients.customer_name,t.Client_id1=e.clients.customer_id,t.loacation_id1=e.clients.company_id,t.date1=e.clients.service_date.substr(0,10),t.note_id=e.clients.note_id,t.description_type=e.clients.description_type,t.amount=e.clients.amount,a.type==6&&(data.signal_image.length>0&&(t.signal_image5=data.signal_image[0]),data.signal_desc.length>0&&(t.signal_desc=data.signal_desc[0])),Me(e.clients.therapist_list,e.clients.note_id),ne.value=!0}async function Be(e){const{data:i}=await Ts(Object.assign(lt,{note_id:h.value.clients.note_id,clinic_id:B,service_id:e.service_id}));i.code==1&&(e.invoice_number=i.invoice_number),_.value=!1}function Aa(){const e={id:k.value.length+1,price:0,spend_time:"",treatment_date:k.value[0].treatment_date};k.value.push(e)}function Da(e,i){const s=e.service_detail.findIndex(n=>n.id===i.id);s!==-1&&e.service_detail.splice(s,1),e.service_detail.forEach((n,r)=>{n.id=r+1}),T(e)}const xa=(e,i)=>{C.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{Da(e,i)}).catch(()=>{c({type:"info",message:"Canceled"})})};function Ta(e,i){e?t.is_tax="Y":t.is_tax="N",T(i)}function Oa(e,i){T(i)}function T(e){let i=0;e.service_detail.forEach((s,n)=>{s.price!=""&&(i=parseFloat(i)+parseFloat(s.price))}),e.is_tax?e.include_tax=="N"?(e.hstValue=Math.round(parseFloat(i)*.13*100)/100,e.total=Math.round(parseFloat(i)*1.13*100)/100):e.include_tax=="Y"&&(e.hstValue=Math.round(parseFloat(i)/1.13*.13*100)/100,e.total=Math.round(parseFloat(i)*100)/100):(e.hstValue=0,e.total=Math.round(parseFloat(i)*100)/100)}function Ia(e,i){le.value.forEach((s,n)=>{e==s.service_name&&(s.is_tax=="Y"?i.is_tax=!0:i.is_tax=!1,i.service_id=s.id,i.include_tax=s.include_tax,a.service_id=s.id,Be(i),x.value=s.during_price_json,i.licence_name=s.licence_name,i.licence_description=s.description,i.licence_title=s.licence_title,i.licence_number=s.licence_number,a.type==2&&(t.signal_image5=s.sinal_image_arr,t.signal_desc=s.sinal_desc_arr),a.type==1&&(t.signal_image5=s.sinal_image_arr,t.signal_desc=s.sinal_desc_arr))}),name=0,x.value.forEach((s,n)=>{s.duration==t.During&&(k.value[0].spend_time=s.duration,name=1,k.value[0].price=s.price)}),name==0&&(k.value[0].price=x.value[0].price)}function Na(e,i,s){s.spend_time=e,s.during_price_json.forEach((n,r)=>{n.value==e&&(s.price=n.price)}),T(i)}async function Ea(){Z.value=!0,t.invoice_type=="outside"?t.description_type1:t.description_type;const{data:e}=await Os(Object.assign(rt,{customer_id:t.Client_id1,company_id:t.loacation_id1,invoice_type:t.invoice_type,invoice_due_date:t.invoice_due_date,is_tax:t.is_tax,description_type:a.LicenceServeValue,signal_image:t.signal_image5,signal_desc:t.signal_desc,include_tax:t.include_tax,invoice_number:t.Invoice_Number,receive_message:t.receive,note_id:t.note_id,origin:"booking",combina_service_arr:A.value,therapist_id:t.invoiceTherapist_id,switch_therapist_id:t.has_therapistlicence,files:t.files}));e.code==1?(Z.value=!1,a.is_invoice==!0?(t.include_tax="N",D.value=e.invoice_id_arr,Fe(5),f(),ne.value=!1):(f(),ne.value=!1),c({type:"success",message:e.msg})):(Z.value=!1,c({type:"error",message:e.msg}))}let Pe=null;function ja(){we.value=""}const Ba=()=>{Pe.deactivateAll().renderAll(),we.value=Pe.toDataURL({format:"png"})};function Pa(e,i){a.is_form_edit!=2&&(S.signal_url=i,S.form_type=e,S.note_id=a.note_id,S.service="",S.service_id="",Ii(2),xe.value=!0)}function Wa(e){const i=new Date;return i.setHours(0,0,0,0),e.getTime()>i.getTime()}function Ma(){S.form_type=="invoice"?Me(Ce.value.clients.therapist_list,Ce.value.clients.note_id):fe(j.value,a.form_type)}async function We(){const{data:e}=await Wi(Object.assign(gt,{used:"Y",Therapists_id:t.Therapist_id,clinic_id:a.Clinic_id,type:a.type}));if(e.code==1){G.value=e.data,u.value=[];const i=[],s=[];e.data.forEach((n,r)=>{n.is_Selected==1&&(i.push(n),s.push(n.name))}),u.value=i,t.service_name1=s.toString(),y.value=JSON.parse(JSON.stringify(u.value[0].additional_Service)),t.service_name=s.toString(),a.type==2&&f()}else c({type:"error",message:e.msg})}function Fa(e){if(e.additional_Service?y.value=JSON.parse(JSON.stringify(e.additional_Service)):y.value=[],u.value.forEach((i,s)=>{i.is_Selected1=0}),e.is_Selected1=1,t.service_name1=e.service_name,e.value==h.value.clients.description_type&&(y.value=ye.value),t.booking_id==""){let i="";e.during_price_json.forEach((s,n)=>{s.default&&(i=s.duration)}),i==""&&(e.during_price_json.length>0?i=e.during_price_json[0].duration:i=60),t.During=i}me(),Ei()}function La(){me()}async function X(){const{data:e}=await Is(Object.assign(dt,{cliniic_name:"",pageSize:1e3,page:1}));e.code==1&&(ci.value=e.data,ve.clinics_id?a.Clinic_id=Number(ve.clinics_id):a.Clinic_id=Number(localStorage.getItem("clinicIdOverall")),We())}function Ja(){We()}function Ni(){f()}async function Me(e,i,s){const{data:n}=await Ns(Object.assign(gi,{Therapists_id:e,note_id:i,role:m.role,clinic_id:B,booking_id:h.value.clients.id,is_licence:!1}));if(n.code==1){n.data.length>0&&(t.signal_image5=n.data[0].sinal_image_arr,t.signal_desc=n.data[0].sinal_desc_arr),le.value=n.data;let r=0;a.LicenceServeValue="",a.service_id="",n.data.length>0&&(a.LicenceServeValue=n.data[0].service_name,a.service_id=n.data[0].id,n.data[0]),n.data.length>0&&x.value==""&&(x.value=n.data[0].during_price_json),le.value.forEach((g,O)=>{g.is_Selected==1}),r=0,x.value.forEach((g,O)=>{g.duration==t.During&&(r=1,k.value[0].price=g.price)}),r==0&&(k.value[0].price=x.value[0].price)}else c({type:"error",message:n.msg})}function qa(e){me(e)}async function me(e){u.value.forEach((n,r)=>{n.name==t.service_name1&&(t.service_id1=n.id)});let i="";e==1?i="Y":i="";const{data:s}=await Pi(Object.assign(pi,{descrption:t.service_name1,Therapist_id:t.Therapist_id,during:t.During,is_during:i,customer_id:t.Client_id,role:m.role,clinic_id:B,additional_Service:y.value,service_id:t.service_id1}));s.code==1?(t.amount=s.total_amount,t.During=s.during,b.value.forEach((n,r)=>{n.amount=t.amount,i==""&&Ti(n)})):c({type:"error",message:s.msg})}function Ra(e){const i={Invoice_Charge_Number:e.invoice_number,Customer_Name:e.username,Invoice_Total_Charge:e.total_amount,Has_Paid_Amount:e.pay_amount,Need_Charge_Amount:e.need_charge_amount,Total_Paid_Amount:"",customer_id:e.customer_id,customer_name:e.username,invoice_id:e.id};hi.value=1,yi.value=i,vi.value=!0}async function Va(){const{data:e}=await $s(Object.assign(nt,{customer_id:p.customer_id}));if(e.code==1){ie.value=e.data;let i=t.Need_Charge_Amount;ie.value.forEach((s,n)=>{const r=Math.min(s.remain_amount,i);r>0&&(s.paid_amount=r,i=parseFloat((i-r).toFixed(2)))}),ae.value=!0}else c({type:"error",message:e.msg})}async function Ha(){const{data:e}=await Es(Object.assign(_t,{invoice_id:p.invoice_id,pay_amount_details:ie.value}));e.code==1?(f(),ae.value=!1):c({type:"error",message:e.msg})}async function Ya(){if(_.value=!0,p.pay_method!="Cheque"&&(p.cheque_number=""),p.pay_method=="Cheque"&&p.cheque_number==""){c({type:"error",message:"Please enter cheque number"}),_.value=!1;return}let e="";if(p.pay_method=="Other"){if(p.other==""){c({type:"error",message:"Please enter pay method"}),_.value=!1;return}e=p.other}else e=p.pay_method;const{data:i}=await js(Object.assign(Ct,{customer_id:p.customer_id,pay_amount:p.pay_amount,pay_method:e,cheque_number:p.cheque_number,content:p.content,collection_time:p.time,account_id:p.account_id}));i.code==1?(Va(),c({type:"success",message:i.msg}),De.value=!1,_.value=!1):(c({type:"error",message:i.msg}),_.value=!1)}function Ua(){De.value=!0}async function za(e){_.value=!0;const{data:i}=await eo(Object.assign(ut,{booking_id:e.clients.id}));i.code==1?(f(1),c({type:"success",message:i.msg})):c({type:"error",message:i.msg}),_.value=!1}const Ka=e=>{C.confirm("Are you sure you want to delete this booking ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{za(e)}).catch(()=>{c({type:"info",message:"Canceled"})})};function Ga(e){e.clients.additional_Service?(y.value=JSON.parse(JSON.stringify(e.clients.additional_Service)),ye.value=JSON.parse(JSON.stringify(e.clients.additional_Service))):(y.value=[],ye.value=[]),t.booking_id=e.clients.id,t.Client_name=e.clients.customer_name,t.Client_id=e.clients.customer_id,u.value=G.value,t.date=e.clients.service_date.substr(0,10),t.service_times=e.clients.begin_time,t.During=e.clients.session,t.amount=e.clients.amount,t.description=e.clients.description,t.Therapist_name=e.therapists_name,t.Therapist_id=e.therapists_id,t.loacation_id_add=e.clients.company_id,t.loacation_name_add=e.clients.company_name,t.used_form_id="",te.value=[];const i=e.clients.description_type;t.service_name1=e.clients.description_type,u.value.forEach((s,n)=>{s.is_Selected1=0,i.includes(s.value)&&(s.is_Selected1=1)}),(a.type==1||a.type==6)&&(a.is_invoice=!1,V.value=!0),a.type==2&&(e.clients.clinics_id?Qa(e.clients.clinics_id):c({type:"error",message:"This appointment was not added by the current clinic and cannot be modified"}),Xa())}async function Xa(){const{data:e}=await Wi(Object.assign(ft,{used:"Y",Therapists_id:t.Therapist_id,clinic_id:a.Clinic_id,type:a.type}));e.code==1?(u.value=e.data,t.service_name1=h.value.clients.description_type,u.value.forEach((i,s)=>{i.is_Selected1=0,t.service_name1==i.value&&(i.is_Selected1=1)})):c({type:"error",message:e.msg})}function Za(e){if(m.tableIndex=0,_.value=!1,!(e.status=="time_inline"||e.status=="hide"))if(e.status=="free"){a.include_tax="Y",a.is_tax=!0,t.is_items=!1,b.value=[],t.interval_days=7,J.value=[],t.Therapist_name=e.therapists_name,t.Therapist_id=e.therapists_id,t.service_times=e.time,t.date=e.date,Oi(b.value[0]),t.booking_id="",t.loacation_id_add=t.loacation_id,t.loacation_name_add=t.loacation_name,t.Client_name="",t.Client_id="",t.During="",t.description="";const i=[],s=[];if(u.value=[],G.value.forEach((n,r)=>{n.is_Selected==1&&(i.push(n.name),s.push(n))}),u.value=s,u.value.length==0){c({type:"error",message:"Please select a service"});return}t.service_name=i.toString(),i.length>1?t.service_disabled=!1:t.service_disabled=!0,i.length==0&&(t.service_name1=""),i.length>0&&(t.service_name1=i[0]),u.value.length>0&&(u.value[0].additional_Service?y.value=JSON.parse(JSON.stringify(u.value[0].additional_Service)):y.value=[],u.value.forEach((n,r)=>{r==0&&(n.is_Selected1=1,n.during_price_json.forEach((g,O)=>{g.default&&(t.During=g.duration)}),t.During==""&&(n.during_price_json.length>0?t.During=n.during_price_json[0].duration:t.During=60)),r>0&&(n.is_Selected1=0)})),te.value=[],a.is_invoice=!1,V.value=!0,Ei()}else e.status=="virtual"?e.visual_date.count>0?(ii.value=e.visual_date.detail,Ue.value=!0):c({type:"info",message:"No virtual booking"}):ji(e)}async function Ei(){let e="";m.type==2&&(e=B);const{data:i}=await Bs(Object.assign(Ui,{therapist_id:t.Therapist_id,service_name:t.service_name1,clinic_id:e,role:m.role}));i.code==1?t.is_Auto=i.result:c({type:"error",message:i.msg})}function ji(e){a.is_form_history=2,h.value=e,Je()}async function Qa(e){_.value=!0;const{data:i}=await Ps(Object.assign(mt,{clinics_id:e}));i.code==1?(mi.value=i.data,a.is_invoice=!1,V.value=!0):c({type:"error",message:i.msg}),_.value=!1}function $a(){R.value=!1,Q.value&&t.booking_id==""&&je(h.value)}function en(e){D.value=[],D.value.push(e.id),Fe(1)}function tn(e){D.value=[],D.value.push(e.id),Fe(2)}async function Fe(e){if(a.is_invoice==!0||e==1||e==2){e==5||e==1?$.value=!0:L.value=!0;const{data:i}=await Ws(Object.assign(pt,{invoice_id_arr:D.value}));i.code==1?(m.show_number=i.data[0].config.show_number,di.value=i.data,Ze.value=i.data[0].company_info,ei.value=i.data[0].info,t.fileView=i.data[0].info.file,$e.value=i.licence,t.customArr=i.data[0].customer_info,t.file_path=i.data[0].invoice_pdf.file_path,t.email_content=i.data[0].config.emailconfig.email_content):c({type:"error",message:i.msg})}}function an(){$.value=!1}function nn(){$.value=!1,L.value=!0}function sn(){L.value=!1}async function on(){const{data:e}=await Ms(Object.assign(ht,{show_number:m.show_number}));e.code==1&&c({type:"success",message:e.msg})}async function cn(){_.value=!0;const{data:e}=await Fs(Object.assign(vt,{invoice_id_arr:D.value,email_content:t.email_content,show_number:m.show_number}));e.code==1?(f(),c({type:"success",message:e.msg}),L.value=!1):c({type:"error",message:e.msg}),_.value=!1}async function ln(){const{data:e}=await io(Object.assign(Gi,{customer_id:t.Client_id,service_name:t.service_name1,service_date:t.date}));e.code==1?(f(),ae.value=!1,te.value=e.data,t.used_form_id=e.data.length>0?e.data[0].id:"",t.is_invoiceShow=e.data.length>0?2:1):c({type:"error",message:e.msg})}function rn(e){t.used_form_id==e.id?(t.used_form_id="",t.is_invoiceShow=1):(t.used_form_id=e.id,a.is_invoice=!1,t.is_invoiceShow=2)}function dn(e){j.value=e,Se.value=!0}async function _n(){try{await navigator.clipboard.writeText(j.value.clients.customer_submit_href),c({type:"success",message:"The text has been copied to the clipboard!"})}catch(e){console.error("复制失败:",e),c({type:"error",message:"Copy failed, please manually copy"})}}async function un(e){const{data:i}=await Ls(Object.assign(yt,{bookingorder_id:e.clients.id}));i.code==1?(Xe.value=i.data.evaluationinfo,ze.value=!0):c({type:"error",message:i.msg})}async function mn(){const{data:e}=await Js(Object.assign(bt,{booking_id:j.value.clients.id}));e.code==1?(Se.value=!1,c({type:"success",message:e.msg})):c({type:"error",message:e.msg})}function fn(e){window.open(e)}function gn(){S.signal_url="signal_url1",S.form_type="invoice",S.note_id="",S.service=a.LicenceServeValue,S.service_id=a.service_id,xe.value=!0}function pn(e){Qe.value=e.clients.id,t.Customer_Name=e.clients.customer_name,p.customer_id=e.clients.customer_id,ke.value=!0}async function hn(e){const{data:i}=await qs(Object.assign(St,{booking_id:Qe}));i.code==1?(ke.value=!1,f(),i.is_use==1?c({type:"success",message:i.use_msg}):c({type:"success",message:i.msg})):c({type:"error",message:i.msg})}function vn(e,i,s){i==1&&(d.booking_arr=[]),d.email_health=!1,d.email_informed=!1,d.email_type=s,Y.value.forEach((n,r)=>{n.is_selected=0}),q.value=e.booking_detail,q.value.length>0&&(d.bookingServers=q.value[0].description_type),d.email_content=e.clients.email_values.booking_message,d.email_to=e.clients.email_values.email_to,d.name=e.clients.email_values.name,d.booking_id=e.clients.email_values.booking_id,d.is_booking=2,d.bookingorder_id=e.clients.id,d.phone_to=e.clients.email_values.phone_to,e.clients.email_values&&(d.booking_notice_type=e.clients.email_values.booking_notice_type,Y.value.forEach((n,r)=>{d.booking_notice_type&&d.booking_notice_type.includes(n.value)&&(n.is_selected=1)})),Je(),Q.value=!1,R.value=!0}function yn(e){}function bn(e){e.is_selected==1?e.is_selected=0:e.is_selected==0&&(e.is_selected=1);const i=[];Y.value.forEach((s,n)=>{s.is_selected==1&&i.push(s.value)}),d.booking_notice_type=i.toString()}const Le=e=>{m.bookingorder_id=e.clients.id,C.confirm("Are you sure you want to check in ?",{confirmButtonText:"Confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{xi()}).catch(()=>{c({type:"info",message:"Canceled"})})};function Sn(){fe(H.value,"sensitived")}function kn(){fe(H.value,"informed")}function wn(){Di(H.value)}async function Cn(e){_.value=!0;const{data:i}=await to(Object.assign(wt,{booking_id:e.clients.id}));i.code==1?(f(),c({type:"success",message:i.notice})):c({type:"error",message:i.notice}),_.value=!1}const An=e=>{C.confirm(" this booking is Appoint Complete ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{Cn(e)}).catch(()=>{c({type:"info",message:"Canceled"})})};async function Je(){const{data:e}=await Rs(Object.assign(kt,{bookingorder_id:h.value.clients.id}));e.code==1?(h.value=e.data,F.value==!1&&(F.value=!0),m.show_number=e.config.show_number,d.is_health_form=e.data.clients.is_health_form,d.is_informed=e.data.clients.is_informed,d.is_sensitived=e.data.clients.is_sensitived,d.health_form_url=e.data.clients.health_form_url,d.informed_content_url=e.data.clients.informed_content_url,d.informed_content_first_url=e.data.clients.first_informed_content_url,d.sentitive_content_url=e.data.clients.sentitive_content_url,t.invoiceTherapist_name=e.data.therapists_name,t.invoiceTherapist_id=e.data.therapists_id,d.sentive_include=!1,A.value=JSON.parse(JSON.stringify(e.data.clients.combina_service_arr)),A.value.forEach((i,s)=>{i.service_detail.forEach((n,r)=>{n.spend_time=Number(n.spend_time)}),a.is_additional="",e.data.clients.additional_Service&&e.data.clients.additional_Service.forEach((n,r)=>{n.is_Selected&&(a.is_additional=1)}),Be(i),T(i)})):c({type:"error",message:e.msg})}const Dn=e=>{ee.value.clearFiles();const i=e[0];i.uid=oo(),ee.value.handleStart(i),Tn()};function xn(e,i,s){i.length>1&&i.splice(0,1)}const Tn=()=>{ee.value.submit()};function On(e,i,s){e.code==1&&(f(),c({type:"success",message:"Upload successful"}))}function In(e){window.open(he+e.replace("/var/www/html/public",""))}function Nn(e){window.open(he+e.replace("/var/www/html/public",""))}function fe(e,i){Bi(e,i,1)}function En(e,i){Bi(e,i,2)}async function Bi(e,i,s){a.is_form_edit=s,s==1&&(i=="sensitived"||i=="informed")&&(a.is_form_edit=2),j.value=e,s==1?a.note_id=e.clients.note_id:s==2&&(a.note_id=e.id),a.form_type=i;const{data:n}=await Vs(Object.assign(st,{note_id:a.note_id,form_type:i}));n.code==1?(Oe.value=!0,a.form_type=="informed"?(n.data.content?(a.time=n.data.content.information,a.signal_desc1=n.data.content.signal_desc1,a.signal_desc2=n.data.content.signal_desc2):a.time="",a.signal_url1=n.data.signal_url1,a.signal_url2=n.data.signal_url2):a.form_type=="treatment_plan"?n.data.content?(Object.keys(n.data.content.information).map(r=>{N[r]=n.data.content.information[r]}),_e.value=n.data.content.pendingProcessing):(Object.keys(N).map(r=>{N[r]=""}),_e.value.forEach((r,g)=>{r.is_selected=0})):a.form_type=="treatment_note"?(n.data.content?(re.value=n.data.content.areasData,de.value=n.data.content.usedData,Object.keys(n.data.content.information).map(r=>{v[r]=n.data.content.information[r]})):(Object.keys(v).map(r=>{v[r]=""}),re.value.forEach((r,g)=>{r.is_selected=0}),de.value.forEach((r,g)=>{r.is_selected=0})),n.is_first&&(v.fee=e.clients.amount,v.duration=e.clients.session,v.time=e.clients.begin_time,v.date=e.date,v.notes=e.clients.customer_name,v.client_goal=e.clients.description,Ne.value.forEach((r,g)=>{r.is_selected=0,r.text==e.clients.am_pm&&(r.is_selected=1,v.timeType=r.value)}))):a.form_type=="sensitived"?(n.data.content?(W.value=n.data.content.initialData,a.sensitived_desc=n.data.content.sensitived_desc,Object.keys(n.data.content.information).map(r=>{E[r]=n.data.content.information[r]})):(Object.keys(E).map(r=>{E[r]=""}),W.value.forEach((r,g)=>{r.is_selected=0})),a.sensitived_url=n.data.signal_url1):a.form_type=="ougoing"?(n.data.content?(a.ougoing_desc1=n.data.content.ougoing_desc1,a.ougoing_desc2=n.data.content.ougoing_desc2,a.ougoing_desc3=n.data.content.ougoing_desc3,a.ougoing_desc4=n.data.content.ougoing_desc4,a.ougoing_desc5=n.data.content.ougoing_desc5,Object.keys(n.data.content.ougoingArr).map(r=>{U[r]=n.data.content.ougoingArr[r]})):(Object.keys(U).map(r=>{U[r]=""}),a.ougoing_desc1="",a.ougoing_desc2="",a.ougoing_desc3="",a.ougoing_desc4="",a.ougoing_desc5=""),a.ougoing_url1=n.data.signal_url2,a.ougoing_url2=n.data.signal_url3,a.ougoing_url3=n.data.signal_url4,a.ougoing_url4=n.data.signal_url5,a.ougoing_url5=n.data.signal_url6):a.form_type=="treatment"&&n.data.content&&(a.treatment_description=n.data.content.treatment_desc1),v.therapist=e.therapists_name):c({type:"error",message:n.msg})}async function jn(e){e.loading=!0;const{data:i}=await Hs(Object.assign(At,{invoice_id:e.id,show_number:m.show_number}));i.code==1?(e.loading=!1,window.open(he+i.file_path.replace("var/www/html/public",""))):(e.loading=!1,c({type:"error",message:i.msg}))}function Bn(){a.is_form_history==1?a.is_form_history=2:a.is_form_history=1}const Pn=()=>{C.confirm("Invoicing requires the therapist to provide licence services",{confirmButtonText:"Go add",cancelButtonText:"cancel",type:"warning"}).then(()=>{Wn()}).catch(()=>{c({type:"info",message:"Canceled"})})};function Wn(){a.type==1?I.push({path:"/crm/yuyue/licence",query:{invoceService:1}}):a.type==2&&I.push({path:"/crm/yuyue/clinic/employee",query:{invoceService:1}})}function Mn(e){b.value=[],e&&ge("add")}async function ge(e){const{data:i}=await Ys(Object.assign(Dt,{date_arr:b.value,interval_days:t.interval_days,date:t.date,duration:t.During,time:t.service_times,amount:t.amount,action:e,therapist_id:t.Therapist_id}));i.code==1?b.value=i.date_arr:c({type:"error",message:i.msg})}function Fn(){ge("update")}function Ln(){ge("add")}function Jn(e){}async function qn(){if(J.value.length>0){J.value=[];return}const{data:e}=await Us(Object.assign(xt,{therapist_id:t.Therapist_id,date:t.date}));e.code==1?e.data.length>0?J.value=e.data:c({type:"success",message:"No booking conflicts"}):c({type:"error",message:e.msg})}function Rn(e){ge("check")}function Vn(e){e.is_show==0?e.is_show=1:e.is_show=0}function Hn(){}function Yn(e){}function Un(e){}async function zn(){_.value=!0;const{data:e}=await zs(Object.assign(Tt,{booking_id:h.value.clients.id}));e.code==1?(W.value=e.data.sensitive_values,E.indication=e.data.Clinical_lndication,_.value=!1,be.value=!0):(_.value=!1,c({type:"error",message:e.msg}))}async function Kn(){_.value=!0;const{data:e}=await Ks(Object.assign(Ot,{booking_id:h.value.clients.id,sensitive_values:W.value,Clinical_lndication:E.indication}));e.code==1?(be.value=!1,_.value=!1,c({type:"success",message:e.msg})):(_.value=!1,c({type:"error",message:e.msg}))}function Gn(){I.push({path:"/crm/yuyue/clinic/employee",query:{}})}function Xn(){a.type==2?I.push({path:"/crm/yuyue/clinic/service",query:{}}):a.type==1&&I.push({path:"/crm/yuyue/licence",query:{booking:1}})}function Zn(e){a.is_historyAll=e,h.value.clients.other_note_detail.forEach((i,s)=>{e==1?(i.is_informed=!0,i.is_ongoning=!0,i.is_sensitive=!0,i.is_treatment_note=!0,i.is_treatment_plan=!0,i.is_TCM=!0,i.is_record=!0):e==2&&(i.is_informed=JSON.parse(JSON.stringify(i.is_informed_show)),i.is_ongoning=JSON.parse(JSON.stringify(i.is_ongoning_show)),i.is_sensitive=JSON.parse(JSON.stringify(i.is_sensitive_show)),i.is_treatment_note=JSON.parse(JSON.stringify(i.is_treatment_note_show)),i.is_treatment_plan=JSON.parse(JSON.stringify(i.is_treatment_plan_show)),i.is_TCM=JSON.parse(JSON.stringify(i.is_TCM_show)),i.is_record=JSON.parse(JSON.stringify(i.is_record_show)))})}function Qn(e){m.tableIndex=e}function $n(e){e.is_selected==1?e.is_selected=0:e.is_selected=1,f()}function es(e){const i=A.value.findIndex(s=>s.service_name===e.service_name);i!==-1&&A.value.splice(i,1)}const is=e=>{C.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{es(e)}).catch(()=>{c({type:"info",message:"Canceled"})})};function ts(e){a.is_leftShow=e}function as(){}async function ns(){Me(t.has_therapistlicence,h.value.clients.note_id)}function ss(){f()}async function os(e,i){const{data:s}=await Gs(Object.assign(gi,{invoice_id:i.id,is_paid:e}));s.code==1&&f(),c({type:"success",message:s.msg})}function cs(e,i,s){e.code==1?(t.files.push(he+e.data.file_path.replace("var/www/html/public/","")),t.files1.push(e.data.file_name)):c({type:"error",message:e.data.msg})}function ls(e){e.length&&(Ye.value=e,Ve.value=!0)}function rs(e){window.open(e)}function ds(e,i){e==1&&(P.note_id=h.value.clients.note_id,P.str=e),e==2&&(P.note_id=i.id),P.form_type="TCM",P.str=e,Ke.value=!0}function _s(){f()}async function us(e){const{data:i}=await ao(Object.assign(It,{is_tax:e.is_tax,include_tax:e.include_tax,service_name:e.service_name,service_id:e.service_id}));i.code==0?c({type:"success",message:i.msg}):c({type:"error",message:i.msg})}const ms=e=>{C.confirm("Do you want to change the current tax configuration to the default service configuration ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{us(e)}).catch(()=>{c({type:"info",message:"Canceled"})})},pe=l({name:"",id:"",symptom_str_arr:""});function fs(){w.is_Client=2,pe.symptom_str_arr=w.symptom_str_arr,He.value=!0}function gs(){w.is_Client==1&&(t.Client_id=ue.id,t.Client_name=ue.name,ln(),me()),w.is_Client==2&&(w.symptom_name_arr=pe.name,w.symptom_str_arr=pe.id,hs())}function ps(){w.is_Client=1,ue.clinic_id=a.Clinic_id,ni.value=!0}async function hs(){const{data:e}=await Xs(Object.assign(Nt,{symptom:w.symptom_str_arr}));e.code==0&&(qe.value=e.data)}return co(()=>{const e=parseInt(localStorage.getItem("type"));a.type=e,Pe=new so.fabric.Canvas(Ge.value,{isDrawingMode:!0}),Kt(),M(" "),e==2&&X(),(e==1||e==6)&&We(),m.type=localStorage.getItem("type"),m.type==2&&(m.role="clinic"),(m.type==1||m.type==6)&&(m.role="therapists"),B.value=localStorage.getItem("clinicIdOverall")}),{searchDetail:m,btnSearchPart:Ca,loading:_,small:Ri,selectList:Lt,columns:Ft,pagination:Ee,handleSizeChange:Jt,handleCurrentChange:qt,PartList:Hi,deliverDialog:ti,selectClick:Rt,deliverDataArr:Mt,btnDeliverConfirm:Yt,itemArr:w,addLocationDialog:se,btnAdd:Ht,locationArr:z,EditLocation:Ut,btnDellocation:Ai,BookingInfoData:fi,Terapist:ri,get_table_box:Vi,bookingDate:oi,serverDate:Gt,formArr:a,calendarData:ui,loadDaysClander:M,onDay:Qt,addBookingDialog:V,onAddBooking:Za,addForm:t,goPrivacy:$t,PrivacyDialog:ai,ClientDialog:ni,eventIsNum:gs,ClientData:ue,locationDialog:si,eventIsNumlocation:ia,locationData:K,onSelectLocation:ea,onSelClient:ps,btnAddConfirm:ta,serviceData:G,onHealthForm:Di,health_info:Ae,infoData:Yi,healthDialog:Te,btnHealthConfirm:na,onCheckIn:Le,addDuringDialog:oe,addDuringConfirm:xi,onPaymant:oa,onHealth:ca,sandEmailDialog:R,EmailArr:d,onSend:aa,onService:la,onCancel:$a,ClientDetail:da,BookingList:_i,NoteList:li,onMore:_a,onRetract:ua,onEmail:vn,items:b,onDelete:fa,onAddItem:Ln,formDialog:Oe,Form1Edit:fe,planArr:N,noteArr:v,sensitivedArr:E,ougoingArr:U,isData:Si,isData1:ki,TimeData:Ne,DurationData:wi,initialData:W,areasData1:re,usedData1:de,receivedData1:Ci,treatedData:_e,submitNoteForm:Ii,selectedTr:ga,selectedTr1:pa,btnInitia:ha,coatingRequire:va,coatingRequire1:ya,coatingRequire2:ba,onTime:Sa,onDuration:ka,onReceived:wa,btnAddInvoice:je,items1:k,InvoiceType:Pt,during_price_array:x,disabledBeforeToday:Wa,onIs_tax:Ta,AddItem:Aa,onDeleteI:xa,IncludeTax:Oa,onPrice:T,taxData:Bt,invoiceConfirm:Ea,duringPrice:Na,changeService:Ia,invoiceDialog:ne,descriptionData:jt,signatureCanvas:Ge,signatureDataUrl:we,saveSignature:Ba,clearSignature:ja,autographDialog:xe,openAutograph:Pa,signalData:S,eventSignal:Ma,addServiceData:u,onServiceAdd:Fa,onArrowLeft:Xt,onArrowRight:Zt,ClinicsList:ci,btnClinic:Ja,btnSearchService:Ni,LicenceServeData:le,btnAmount:qa,CollectionDialog:ae,btnCollection:Ra,CollectionData:ie,bookingPaymentConfirm:Ha,addCollectionDialog:De,AddCollect:Ua,collectionArr:p,btncollectionConfirm:Ya,btnDellocation:Ai,btnDelBooking:Ka,btnEdit:Ga,TherapistList1:mi,btnAmount1:Ti,emailData:q,InvoiceDetailDialog:$,company_info:Ze,customer_info:Ji,info:ei,licenceDetail:$e,detailInfo:qi,invoiceData:di,onCancelEmail:an,sendEmail:nn,sandEmailInvoiceDialog:L,noSend:sn,btnShowNumber:on,InvoiceEmailSend:cn,DeducationData:te,selectedDeducation:rn,customerSubmit:dn,customerConfirmDialog:Se,sigArr:j,onShare1:_n,btnEvaluation:un,EvaluationDialog:ze,evaluationinfo:Xe,evaluationImg:fn,SendEvaluationEmail:mn,openInvoAutograph:gn,signalUrl:Li,btnFinish:pn,onEmailSensitive:yn,addMessageData:Y,onMessageData:bn,btnIsSensitived:Sn,btnIsInformed:kn,btnIsHealthForm:wn,onAppointComplete:An,btnBookingDetail:ji,bookingDetailDialog:F,bookedArr:h,handleExceed:Dn,handleChangePic:xn,bookingImg:ee,uploadSlotFile1:On,btnFormImgView:In,onNotesForm:En,btnFormImgView8:Nn,getbookingDetalInvoiceDetail:en,bookingInvoiceEmailSend:tn,payMethodData:Wt,AccountData:Fi,btnPrintPDF:jn,btnHistory:Bn,btnService:Pn,btnFinish1:hn,FinishDialog:ke,btnAddmultiple:Mn,changeNumber:Fn,intervalDays:Jn,BookingsByDate:qn,bookingByDate:J,changeTime:Rn,btnViewtime:Vn,onSituationArr:Vt,onBackInvoice:Hn,handleDblClick:Yn,visual_data:Re,virtualDialog:Ue,virtualArr:ii,HealthArr:Ie,rashesBruise:Un,SensitiveDialog:be,SensitiveEmail:zn,SendEmailSensitive:Kn,GoaddTherapist:Gn,GoaddService:Xn,btnFillout:Zn,detaiilMenu:Et,onDetaiilMenu:Qn,ServiceInvoice:A,stulesShow:bi,btnStulesShow:$n,onDeleteService:is,isleftShow:ts,canLicenceTherapist:as,canLicenceTherapistConfirm:ns,ChargeDialog:vi,eventCharge:ss,str1:hi,ChargeArr:yi,btnIsPaid:os,loading5:Z,uploadSlotFile11:cs,btnFile:ls,fileArr:Ye,onFile:rs,fileDialog:Ve,additionalService:y,changeAdditional:La,onChineseMedical:ds,chineseMedicalDialog:Ke,chineseArr:P,eventChinese:_s,btnSaveDefault:ms,btnSymptom:fs,symptomDialog:He,symptomData:pe,itemArr:w,IllNessData:qe}}export{Ao as useEqu};