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