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