File: /var/www/html/public/static/js/hookBoInfo-legacy-357b592d.js
System.register(["./po-legacy-1db6aa77.js","./vue-router-legacy-a12307c3.js","./fabric-legacy-12e80ceb.js","./message-legacy-10af7c73.js","./index-legacy-42c17c53.js","./upload-legacy-da990a47.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-c484260e.js","./preload-helper-legacy-f8638e03.js","./vue-i18n.runtime.esm-bundler-legacy-720876b1.js","./index-legacy-c9e20962.js","./_commonjsHelpers-legacy-5498c249.js","./utils-legacy-c0023c33.js","./focus-trap-legacy-631b7396.js","./error-legacy-e98f9e58.js"],(function(e,i){"use strict";var t,a,n,s,o,c,l,r,d,_,u,m,g,v,p,h,f,y,b,k,S,C,w,D,x,T,O,A,E,I,N,j,P,B,W,L,M,F,J,q,V,R,H,Y,U,z,K,G,X,Z,Q,$;return{setters:[e=>{t=e.addCompanyWeb,a=e.getdaysClander,n=e.bookingSchduleListWeb,s=e.bookingOrderWeb,o=e.sendBookingEmailWeb,c=e.getHealthFormDataWeb,l=e.submitHealthFormModelWeb,r=e.bookingCheckIn,d=e.getCustomerLogsWeb,_=e.bookingAmountCalculteWeb,u=e.submitNoteFormWeb,m=e.getInvoiceNumberWeb,g=e.newInvoiceWeb,v=e.getServiceListWeb,p=e.getManagerClinicsListWeb,h=e.getLicenceServiceWeb,f=e.invoicePaymentWeb,y=e.prePaidWeb,b=e.checkTherapistServiceWeb,k=e.getTherapistListByClinic,S=e.invoiceDetailArrWeb,C=e.updateShowNumber,w=e.sendEmailBatchWeb,D=e.bookingDetailWeb,x=e.SendEvaluationEmailWeb,T=e.BookingSubmitWeb,O=e.bookingDetailClientWeb,A=e.yuyueFDF,E=e.getNoteFormWeb,I=e.invoicePdfWeb,N=e.getMuitiBookingDateWeb,j=e.getBookingsByDateWeb,P=e.getNoteSensiveWeb,B=e.sendBookingSensitiveEmailWeb,W=e.setInvoicePaidWeb,L=e.getIllNessListBySymptomWeb,M=e.deleteCompanyWeb,F=e.bookingPaymentWeb,J=e.getCheckMembersWeb,q=e.bookingDelete,V=e.getUsedFormByCustomerWeb,R=e.BookingCompleteWeb,H=e.saveDefaultTaxWeb},e=>{Y=e.d,U=e.u},e=>{z=e.f},e=>{K=e.b7},e=>{G=e.o},e=>{X=e.g},e=>{Z=e.r,Q=e.A,$=e.o},null,null,null,null,null,null,null,null],execute:function(){e("useEqu",(function(){const{query:e,params:i}=Y(),ee=U();Y();const ie=Z([]),te=Z([]),ae=Z([]),ne=Z(!1),se=Z(!1),oe=Z(!1),ce=Z(!1),le=Z([]),re=Z([]),de=Z([]),_e=Z(!1),ue=Z(!1),me=Z(!1),ge=Z(!1),ve=Z(!1),pe=Z(!1),he=Z(!1),fe=Z(!1),ye=Z(!1),be=Z(!1),ke=Z(!1),Se=Z(null),Ce=Z(""),we=Z(""),De=Z(""),xe=Z(""),Te=Z(""),Oe=Z(""),Ae=Z(""),Ee=Z(""),Ie=Z(""),Ne=Z(""),je=Z(""),Pe=Z(""),Be=Z(""),We=Z([]),Le=Z([]),Me=Z([]),Fe=Z([]),Je=Z([]),qe=Z([]),Ve=Z([]),Re=Z([]),He=Z([]),Ye=Z([]),Ue=Z([]),ze=Z(!1),Ke=Z(!1),Ge=Z(!1),Xe=Z(!1),Ze=Z(!1),Qe=Z(!1),$e=Z(!1),ei=Z(!1),ii=Z(!1),ti=Z(!1),ai=Z(!1),ni=Z(!1),si=Z(!1),oi=Z(!1),ci=Z(!1),li=Z(!1),ri=Z(""),di=Z(""),_i=Z(""),ui=Z([]),mi=Z([]),gi=Z([]),vi=Z([]),pi=Z([]),hi=Z([]),fi=Z([]),yi=Z([]),bi=Z([]),ki=Z([]),Si=Z([]),Ci=Z([]),wi=Z([]),Di=Q({});Q({});const xi=Q({}),Ti=Q({}),Oi=Q({}),Ai=Q({}),Ei=Q({}),Ii=Q({}),Ni=Q({}),ji=Q({}),Pi=Q({}),Bi=Q({}),Wi=Q({}),Li=Q({}),Mi=Q({}),Fi=Q({}),Ji=Q({}),qi=Q({}),Vi=Q({}),Ri=Q({}),Hi=Q({}),Yi=Q({});Q({});const Ui=Q({});Q({});const zi=Q({}),Ki=Q({}),Gi=Q({}),Xi=Q({}),Zi=Q({}),Qi=Q({}),$i=Q({}),et=Q({}),it=Q({}),tt=Q({}),at=Q({}),nt=Q({}),st=Q({}),ot=Q({}),ct=Q({}),lt=Q({}),rt=Q({}),dt=Q({});Q({});const _t=Q({}),ut=Q({}),mt=Z(1),gt=Z(!1),vt=Q({Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:"",customer_name:""}),pt=Z([{name:"Basic Info",id:1},{name:"Invoices",id:2}]),ht=Z([{id:1,text:"Mobile SMS",value:"message",is_selected:0},{id:2,text:"Email",value:"email",is_selected:0}]),ft=Z([{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}]),yt=Z([{value:"Massage Therapy Treatment",text:"Massage Therapy Treatment"},{value:"Acupuncture Treatment",text:"Acupuncture Treatment"}]),bt=Z([{value:"Y",text:"Y"},{value:"N",text:"N"}]),kt=Z([{id:1,price:0,spend_time:"",treatment_date:""}]),St=Z([{value:"normal",text:"Normal"},{value:"third_Pay",text:"Third Pay"},{value:"gift",text:"Gift"}]),Ct=Q({note_id:"",form_type:"",str:""}),wt=Q({name:"",today_date:"",hear_about:"",chief_complaint:"",rashes_bruise:!1,address:"",Birth:"",Code_ZIP:"",Occupation:"",Phone:"",Work_Phone:"",Physician:"",Phone1:"",City:""}),Dt=Q({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:""}),xt=Q({plan:"",date:"",daily_living:"",treatment_goal:"",focus_treatment:"",frequency:"",duration:"",performed:"",assessments:"",schedule:"",responses:"",recommended:"",hydrotherapy:"",contraindications:"",referrals:"",discussed_with:"",treatment_plan:"",checkedCities:""}),Tt=Q({notes:"",date:"",time:"",duration:"",fee:"",assessment:"",therapist:"",findings:"",feedback:"",self_care:"",timeType:"",durationType:"",receivedType:"",client_goal:""}),Ot=Q({name:"",name1:"",indication:"",client_name:"",date:"",checkedCities:""}),At=Q({date1:"",date2:"",date3:"",date4:"",date5:""}),Et=Z([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),It=Z([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),Nt=Z([{id:1,text:"AM",value:"am",is_selected:0},{id:2,text:"PM",value:"pm",is_selected:0}]),jt=Z([{id:1,text:"min.",value:"min",is_selected:1},{id:2,text:"hr.",value:"hr",is_selected:0}]),Pt=Z([{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"}]),Bt=Z([{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:""}]),Wt=Z([{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:""}]),Lt=Z([{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:""}]),Mt=Z([{id:1,text:"Yes",value:"yes",is_selected:0},{id:2,text:"No",value:"no",is_selected:0}]),Ft=Z([{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:""}]),Jt=Z([]);Z([{id:1,date:"",time:"",amount:0,duration:60}]);const qt=Q({tableIndex:0,note:"",symptom_name_arr:"",symptom_str_arr:"",is_Client:"",ill_str:"",ill_name:"",chm_name:"",chm_str:""}),Vt=Q({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}),Rt=Q({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:[]}),Ht=Q({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",account_id:"",time:"",other:""}),Yt=Q({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:""});Q({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const Ut=Q({name:"",id:"",clinic_id:""}),zt=Q({signal_url:"",form_type:"",note_id:"",service:"",service_id:""}),Kt=Q({name:"",id:""}),Gt=Q({qo_item_str:"",name:"",address:"",way:"",shipping:[],itemsDetail:[],trackingNo:"",courier:"",comment:""}),Xt=Q({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),Zt=Z([{id:1,name:"Massage",value:"Massage",is_Selected:1},{id:2,name:"Acupuncture",value:"Acupuncture",is_Selected:0}]),Qt=Q({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",searchKey1:"",bookingorder_id:"",room:"",show_number:"",type:"",role:"",tableIndex:0}),$t=e=>{G.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{!async function(e){const{data:i}=await M(Object.assign(Ai,{company_id:e.id}));1==i.code?(pa(),K({type:"success",message:i.msg})):K({type:"error",message:i.msg})}(e)})).catch((()=>{K({type:"info",message:"Canceled"})}))};async function ea(e,i){let t="";2==localStorage.getItem("type")&&(t="one")," "!==e&&(Dt.action=e);const{data:n}=await a(Object.assign(xi,{month:Dt.month,action:Dt.action,click_date:Dt.click_date,many_one:t}));1==n.code&&(Dt.month=n.month,bi.value=n.data,Si.value=n.higher_days,Dt.last_day=n.pre_next_day.last_day,Dt.next_day=n.pre_next_day.next_day,localStorage.getItem("type"),Dt.click_date=Si.value[0],(1==Dt.type||Dt.Clinic_id||6==Dt.type)&&ia())}async function ia(e){let i="";1==e&&(i=1);const t=localStorage.getItem("type"),{data:a}=await n(Object.assign(Ei,{date:Si.value,type:t,clinics_id:Dt.Clinic_id,services_array:Rt.service_name,page:Dt.page,stulesShow:ft.value}));1==a.code?(1==ve.value&&""==i&&Ea(),1==e&&(ve.value=!1),wi.value=a.data.content,pi.value=a.data.title,Dt.therapist_name=a.data.therapist_name,Rt.loacation_id=a.data.location.id,Rt.loacation_name=a.data.location.company_name,Dt.next_page=a.page_data.next_page,Dt.prev_page=a.page_data.prev_page,ae.value=a.data.visual_data):K({type:"error",message:a.msg})}async function ta(e,i){Dt.is_health=i,Dt.userId1=e.clients.customer_id;const{data:t}=await c(Object.assign(Ni,{customer_id:e.clients.customer_id}));1==t.code&&(We.value=t.model.health_info,Object.keys(t.model.information).map((e=>{wt[e]=t.model.information[e]})),Qe.value=!0)}async function aa(){const{data:e}=await r(Object.assign(Pi,{bookingorder_id:Qt.bookingorder_id}));1==e.code?(ia(),ci.value=!1,K({type:"success",message:e.msg})):K({type:"error",message:e.msg})}async function na(e){const{data:i}=await F(Object.assign(Bi,{bookingorder_id:e.clients.id}));1==i.code?(ia(),K({type:"success",message:i.msg})):K({type:"error",message:i.msg})}function sa(){const e=[],i=[];Ue.value=[],Zt.value.forEach(((t,a)=>{1==t.is_Selected&&(e.push(t.name),i.push(t))})),Ue.value=i,Rt.service_name=e.toString(),e.length>1?Rt.service_disabled=!1:Rt.service_disabled=!0,0==e.length&&(Rt.service_name1=""),e.length>0&&(Rt.service_name1=e[0]),Ue.value.length>0&&(Ue.value[0].additional_Service?re.value=JSON.parse(JSON.stringify(Ue.value[0].additional_Service)):re.value=[],Ue.value.forEach(((e,i)=>{i>0&&(e.is_Selected1=0)}))),ha()}function oa(e){ca(e)}async function ca(e){Ue.value.forEach(((e,i)=>{e.name==Rt.service_name1&&(Rt.service_id1=e.id)}));const{data:i}=await _(Object.assign(Yi,{descrption:Rt.service_name1,Therapist_id:Rt.Therapist_id,during:e.duration,customer_id:Rt.Client_id,role:Qt.role,clinic_id:Ie,service_id:Rt.service_id1,additional_Service:re.value}));1==i.code?e.amount=i.total_amount:K({type:"error",message:i.msg})}function la(e){const i=Jt.value.findIndex((i=>i.id===e.id));-1!==i&&Jt.value.splice(i,1),Jt.value.forEach(((e,i)=>{e.id=i+1}))}async function ra(e){if("sensitived"==Dt.form_type)return;ne.value=!0;const i={detail:"",imageurl:""},t={detail:""};if("informed"==Dt.form_type){const e={information:Dt.time,signal_desc1:Dt.signal_desc1,signal_desc2:Dt.signal_desc2},t={signal_url1:Dt.signal_url1,signal_url2:Dt.signal_url2};i.detail=e,i.imageurl=t}if("treatment_plan"==Dt.form_type){const e={pendingProcessing:Ft,information:xt};t.detail=e}if("treatment_note"==Dt.form_type){const e={information:Tt,usedData:Lt,areasData:Wt};t.detail=e}if("sensitived"==Dt.form_type){const e={information:Ot,initialData:Bt,sensitived_desc:Dt.sensitived_desc},t={signal_url1:Dt.sensitived_url};i.detail=e,i.imageurl=t}if("ougoing"==Dt.form_type){const e={ougoingArr:At,ougoing_desc1:Dt.ougoing_desc1,ougoing_desc2:Dt.ougoing_desc2,ougoing_desc3:Dt.ougoing_desc3,ougoing_desc4:Dt.ougoing_desc4,ougoing_desc5:Dt.ougoing_desc5},t={signal_url2:Dt.ougoing_url1,signal_url3:Dt.ougoing_url2,signal_url4:Dt.ougoing_url3,signal_url5:Dt.ougoing_url4,signal_url6:Dt.ougoing_url5};i.detail=e,i.imageurl=t}let a="";"treatment_plan"==Dt.form_type||"treatment_note"==Dt.form_type?a=t:"informed"==Dt.form_type||"sensitived"==Dt.form_type||"ougoing"==Dt.form_type?a=i:"treatment"==Dt.form_type&&(a={detail:{treatment_desc1:Dt.treatment_description}});const{data:n}=await u(Object.assign(Fi,{note_id:Dt.note_id,form_type:Dt.form_type,data_row:a}));1==n.code?(1==e&&(ci.value&&Oa(_i.value),ia(),ii.value=!1,K({type:"success",message:n.msg})),ne.value=!1):(ne.value=!1,K({type:"error",message:n.msg}))}async function da(e){Le.value.forEach(((e,i)=>{ma(e)})),Rt.include_tax="N",Dt.LicenceServeValue="",xe.value=e,Rt.files=[],Rt.files1=[],kt.value=[],ne.value=!0,kt.value=JSON.parse(JSON.stringify(e.need_invoice)),Rt.During=e.clients.spend_time,Rt.loacation_name1=e.clients.company_name,Rt.Client_name1=e.clients.customer_name,Rt.Client_id1=e.clients.customer_id,Rt.loacation_id1=e.clients.company_id,Rt.date1=e.clients.service_date.substr(0,10),Rt.note_id=e.clients.note_id,Rt.description_type=e.clients.description_type,Rt.amount=e.clients.amount,6==Dt.type&&(data.signal_image.length>0&&(Rt.signal_image5=data.signal_image[0]),data.signal_desc.length>0&&(Rt.signal_desc=data.signal_desc[0])),fa(e.clients.therapist_list,e.clients.note_id),ai.value=!0}async function _a(e){const{data:i}=await m(Object.assign(qi,{note_id:Ae.value.clients.note_id,clinic_id:Ie,service_id:e.service_id}));1==i.code&&(e.invoice_number=i.invoice_number),ne.value=!1}function ua(e,i){const t=e.service_detail.findIndex((e=>e.id===i.id));-1!==t&&e.service_detail.splice(t,1),e.service_detail.forEach(((e,i)=>{e.id=i+1})),ma(e)}function ma(e){let i=0;e.service_detail.forEach(((e,t)=>{""!=e.price&&(i=parseFloat(i)+parseFloat(e.price))})),e.is_tax?"N"==e.include_tax?(e.hstValue=Math.round(.13*parseFloat(i)*100)/100,e.total=Math.round(1.13*parseFloat(i)*100)/100):"Y"==e.include_tax&&(e.hstValue=Math.round(parseFloat(i)/1.13*.13*100)/100,e.total=Math.round(100*parseFloat(i))/100):(e.hstValue=0,e.total=Math.round(100*parseFloat(i))/100)}let ga=null;async function va(){const{data:e}=await v(Object.assign(Xi,{used:"Y",Therapists_id:Rt.Therapist_id,clinic_id:Dt.Clinic_id,type:Dt.type}));if(1==e.code){Zt.value=e.data,Ue.value=[];const i=[],t=[];e.data.forEach(((e,a)=>{1==e.is_Selected&&(i.push(e),t.push(e.name))})),Ue.value=i,Rt.service_name1=t.toString(),re.value=JSON.parse(JSON.stringify(Ue.value[0].additional_Service)),Rt.service_name=t.toString(),2==Dt.type&&ia()}else K({type:"error",message:e.msg})}async function pa(){const{data:i}=await p(Object.assign(Ri,{cliniic_name:"",pageSize:1e3,page:1}));1==i.code&&(mi.value=i.data,e.clinics_id?Dt.Clinic_id=Number(e.clinics_id):Dt.Clinic_id=Number(localStorage.getItem("clinicIdOverall")),va())}function ha(){ia()}async function fa(e,i,t){const{data:a}=await h(Object.assign(Hi,{Therapists_id:e,note_id:i,role:Qt.role,clinic_id:Ie,booking_id:Ae.value.clients.id,is_licence:!1}));if(1==a.code){a.data.length>0&&(Rt.signal_image5=a.data[0].sinal_image_arr,Rt.signal_desc=a.data[0].sinal_desc_arr),Ci.value=a.data;let e=0;Dt.LicenceServeValue="",Dt.service_id="",a.data.length>0&&(Dt.LicenceServeValue=a.data[0].service_name,Dt.service_id=a.data[0].id,a.data[0]),a.data.length>0&&""==gi.value&&(gi.value=a.data[0].during_price_json),Ci.value.forEach(((e,i)=>{e.is_Selected})),e=0,gi.value.forEach(((i,t)=>{i.duration==Rt.During&&(e=1,kt.value[0].price=i.price)})),0==e&&(kt.value[0].price=gi.value[0].price)}else K({type:"error",message:a.msg})}async function ya(e){Ue.value.forEach(((e,i)=>{e.name==Rt.service_name1&&(Rt.service_id1=e.id)}));let i="";i=1==e?"Y":"";const{data:t}=await _(Object.assign(Yi,{descrption:Rt.service_name1,Therapist_id:Rt.Therapist_id,during:Rt.During,is_during:i,customer_id:Rt.Client_id,role:Qt.role,clinic_id:Ie,additional_Service:re.value,service_id:Rt.service_id1}));1==t.code?(Rt.amount=t.total_amount,Rt.During=t.during,Jt.value.forEach(((e,t)=>{e.amount=Rt.amount,""==i&&oa(e)}))):K({type:"error",message:t.msg})}async function ba(){const{data:e}=await J(Object.assign(Li,{customer_id:Ht.customer_id}));if(1==e.code){He.value=e.data;let i=Rt.Need_Charge_Amount;He.value.forEach(((e,t)=>{const a=Math.min(e.remain_amount,i);a>0&&(e.paid_amount=a,i=parseFloat((i-a).toFixed(2)))})),Xe.value=!0}else K({type:"error",message:e.msg})}async function ka(e){ne.value=!0;const{data:i}=await q(Object.assign(zi,{booking_id:e.clients.id}));1==i.code?(ia(1),K({type:"success",message:i.msg})):K({type:"error",message:i.msg}),ne.value=!1}async function Sa(){const{data:e}=await v(Object.assign(Gi,{used:"Y",Therapists_id:Rt.Therapist_id,clinic_id:Dt.Clinic_id,type:Dt.type}));1==e.code?(Ue.value=e.data,Rt.service_name1=Ae.value.clients.description_type,Ue.value.forEach(((e,i)=>{e.is_Selected1=0,Rt.service_name1==e.value&&(e.is_Selected1=1)}))):K({type:"error",message:e.msg})}async function Ca(){let e="";2==Qt.type&&(e=Ie);const{data:i}=await b(Object.assign(Di,{therapist_id:Rt.Therapist_id,service_name:Rt.service_name1,clinic_id:e,role:Qt.role}));1==i.code?Rt.is_Auto=i.result:K({type:"error",message:i.msg})}function wa(e){Dt.is_form_history=2,Ae.value=e,Ea()}async function Da(e){ne.value=!0;const{data:i}=await k(Object.assign(Ki,{clinics_id:e}));1==i.code?(ki.value=i.data,Dt.is_invoice=!1,oi.value=!0):K({type:"error",message:i.msg}),ne.value=!1}async function xa(e){if(1==Dt.is_invoice||1==e||2==e){5==e||1==e?ue.value=!0:fe.value=!0;const{data:i}=await S(Object.assign(Zi,{invoice_id_arr:Ve.value}));1==i.code?(Qt.show_number=i.data[0].config.show_number,hi.value=i.data,Oe.value=i.data[0].company_info,Be.value=i.data[0].info,Rt.fileView=i.data[0].info.file,Pe.value=i.licence,Rt.customArr=i.data[0].customer_info,Rt.file_path=i.data[0].invoice_pdf.file_path,Rt.email_content=i.data[0].config.emailconfig.email_content):K({type:"error",message:i.msg})}}async function Ta(){const{data:e}=await V(Object.assign(Oi,{customer_id:Rt.Client_id,service_name:Rt.service_name1,service_date:Rt.date}));1==e.code?(ia(),Xe.value=!1,Ye.value=e.data,Rt.used_form_id=e.data.length>0?e.data[0].id:"",Rt.is_invoiceShow=e.data.length>0?2:1):K({type:"error",message:e.msg})}const Oa=e=>{Qt.bookingorder_id=e.clients.id,G.confirm("Are you sure you want to check in ?",{confirmButtonText:"Confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{aa()})).catch((()=>{K({type:"info",message:"Canceled"})}))};async function Aa(e){ne.value=!0;const{data:i}=await R(Object.assign(nt,{booking_id:e.clients.id}));1==i.code?(ia(),K({type:"success",message:i.notice})):K({type:"error",message:i.notice}),ne.value=!1}async function Ea(){const{data:e}=await O(Object.assign(at,{bookingorder_id:Ae.value.clients.id}));1==e.code?(Ae.value=e.data,0==ve.value&&(ve.value=!0),Qt.show_number=e.config.show_number,Vt.is_health_form=e.data.clients.is_health_form,Vt.is_informed=e.data.clients.is_informed,Vt.is_sensitived=e.data.clients.is_sensitived,Vt.health_form_url=e.data.clients.health_form_url,Vt.informed_content_url=e.data.clients.informed_content_url,Vt.informed_content_first_url=e.data.clients.first_informed_content_url,Vt.sentitive_content_url=e.data.clients.sentitive_content_url,Rt.invoiceTherapist_name=e.data.therapists_name,Rt.invoiceTherapist_id=e.data.therapists_id,Vt.sentive_include=!1,Le.value=JSON.parse(JSON.stringify(e.data.clients.combina_service_arr)),Le.value.forEach(((i,t)=>{i.service_detail.forEach(((e,i)=>{e.spend_time=Number(e.spend_time)})),Dt.is_additional="",e.data.clients.additional_Service&&e.data.clients.additional_Service.forEach(((e,i)=>{e.is_Selected&&(Dt.is_additional=1)})),_a(i),ma(i)}))):K({type:"error",message:e.msg})}const Ia=()=>{we.value.submit()};function Na(e,i){ja(e,i,1)}async function ja(e,i,t){Dt.is_form_edit=t,1!=t||"sensitived"!=i&&"informed"!=i||(Dt.is_form_edit=2),Te.value=e,1==t?Dt.note_id=e.clients.note_id:2==t&&(Dt.note_id=e.id),Dt.form_type=i;const{data:a}=await E(Object.assign(Mi,{note_id:Dt.note_id,form_type:i}));1==a.code?(ii.value=!0,"informed"==Dt.form_type?(a.data.content?(Dt.time=a.data.content.information,Dt.signal_desc1=a.data.content.signal_desc1,Dt.signal_desc2=a.data.content.signal_desc2):Dt.time="",Dt.signal_url1=a.data.signal_url1,Dt.signal_url2=a.data.signal_url2):"treatment_plan"==Dt.form_type?a.data.content?(Object.keys(a.data.content.information).map((e=>{xt[e]=a.data.content.information[e]})),Ft.value=a.data.content.pendingProcessing):(Object.keys(xt).map((e=>{xt[e]=""})),Ft.value.forEach(((e,i)=>{e.is_selected=0}))):"treatment_note"==Dt.form_type?(a.data.content?(Wt.value=a.data.content.areasData,Lt.value=a.data.content.usedData,Object.keys(a.data.content.information).map((e=>{Tt[e]=a.data.content.information[e]}))):(Object.keys(Tt).map((e=>{Tt[e]=""})),Wt.value.forEach(((e,i)=>{e.is_selected=0})),Lt.value.forEach(((e,i)=>{e.is_selected=0}))),a.is_first&&(Tt.fee=e.clients.amount,Tt.duration=e.clients.session,Tt.time=e.clients.begin_time,Tt.date=e.date,Tt.notes=e.clients.customer_name,Tt.client_goal=e.clients.description,Nt.value.forEach(((i,t)=>{i.is_selected=0,i.text==e.clients.am_pm&&(i.is_selected=1,Tt.timeType=i.value)})))):"sensitived"==Dt.form_type?(a.data.content?(Bt.value=a.data.content.initialData,Dt.sensitived_desc=a.data.content.sensitived_desc,Object.keys(a.data.content.information).map((e=>{Ot[e]=a.data.content.information[e]}))):(Object.keys(Ot).map((e=>{Ot[e]=""})),Bt.value.forEach(((e,i)=>{e.is_selected=0}))),Dt.sensitived_url=a.data.signal_url1):"ougoing"==Dt.form_type?(a.data.content?(Dt.ougoing_desc1=a.data.content.ougoing_desc1,Dt.ougoing_desc2=a.data.content.ougoing_desc2,Dt.ougoing_desc3=a.data.content.ougoing_desc3,Dt.ougoing_desc4=a.data.content.ougoing_desc4,Dt.ougoing_desc5=a.data.content.ougoing_desc5,Object.keys(a.data.content.ougoingArr).map((e=>{At[e]=a.data.content.ougoingArr[e]}))):(Object.keys(At).map((e=>{At[e]=""})),Dt.ougoing_desc1="",Dt.ougoing_desc2="",Dt.ougoing_desc3="",Dt.ougoing_desc4="",Dt.ougoing_desc5=""),Dt.ougoing_url1=a.data.signal_url2,Dt.ougoing_url2=a.data.signal_url3,Dt.ougoing_url3=a.data.signal_url4,Dt.ougoing_url4=a.data.signal_url5,Dt.ougoing_url5=a.data.signal_url6):"treatment"==Dt.form_type&&a.data.content&&(Dt.treatment_description=a.data.content.treatment_desc1),Tt.therapist=e.therapists_name):K({type:"error",message:a.msg})}function Pa(){1==Dt.type?ee.push({path:"/crm/yuyue/licence",query:{invoceService:1}}):2==Dt.type&&ee.push({path:"/crm/yuyue/clinic/employee",query:{invoceService:1}})}async function Ba(e){const{data:i}=await N(Object.assign(ct,{date_arr:Jt.value,interval_days:Rt.interval_days,date:Rt.date,duration:Rt.During,time:Rt.service_times,amount:Rt.amount,action:e,therapist_id:Rt.Therapist_id}));1==i.code?Jt.value=i.date_arr:K({type:"error",message:i.msg})}function Wa(e){const i=Le.value.findIndex((i=>i.service_name===e.service_name));-1!==i&&Le.value.splice(i,1)}async function La(e){const{data:i}=await H(Object.assign(_t,{is_tax:e.is_tax,include_tax:e.include_tax,service_name:e.service_name,service_id:e.service_id}));0==i.code?K({type:"success",message:i.msg}):K({type:"error",message:i.msg})}const Ma=Q({name:"",id:"",symptom_str_arr:""});async function Fa(){const{data:e}=await L(Object.assign(ut,{symptom:qt.symptom_str_arr}));0==e.code&&(te.value=e.data,Je.value=e.data_chine,qt.ill_str&&te.value.forEach(((e,i)=>{qt.ill_str==e.id&&(e.checked=!0)})),qt.chm_str&&Je.value.forEach(((e,i)=>{qt.chm_str==e.id&&(e.checked=!0)})))}const Ja=Q({name:"",id:""}),qa=Q({name:"",id:""});return $((()=>{const e=parseInt(localStorage.getItem("type"));Dt.type=e,ga=new z.fabric.Canvas(Se.value,{isDrawingMode:!0}),function(){const e=new Date,i=e.getFullYear(),t=("0"+(e.getMonth()+1)).slice(-2),a=("0"+e.getDate()).slice(-2);di.value=i+"-"+t+"-"+a}(),ea(" "),2==e&&pa(),1!=e&&6!=e||va(),Qt.type=localStorage.getItem("type"),2==Qt.type&&(Qt.role="clinic"),1!=Qt.type&&6!=Qt.type||(Qt.role="therapists"),Ie.value=localStorage.getItem("clinicIdOverall")})),{searchDetail:Qt,btnSearchPart:function(){""!=Qt.searchKey1?ee.push({path:"/crm/yuyue/booking",query:{searchKey:Qt.searchKey1}}):K({type:"error",message:"Please fill in the query value"})},loading:ne,small:li,selectList:["勾选列","Company","HST#","Name","Postal","Phone","Email","Address","Provice","City","Action"],columns:[{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")}],pagination:Xt,handleSizeChange:function(e){Xt.pageSize=e,pa()},handleCurrentChange:function(e){Xt.currentPage=e,pa()},PartList:ui,deliverDialog:ze,selectClick:(i,t)=>{if(i.length>1){const e=i.shift();singleTableRef.value.toggleRowSelection(e,!1)}e.note&&ee.push({path:"/crm/yuyue/note",query:{location_id:t.id,location:encodeURIComponent(JSON.stringify(t))}})},deliverDataArr:Gt,btnDeliverConfirm:async function(){const{data:e}=await t(Object.assign(Ji,{data_row:Yt}));1==e.code?(pa(),si.value=!1,K({type:"success",message:e.msg})):K({type:"error",message:e.msg})},itemArr:qt,addLocationDialog:si,btnAdd:function(){Object.keys(Yt).map((e=>{Yt[e]=""})),si.value=!0},locationArr:Yt,EditLocation:function(e){Object.keys(e).map((i=>{Yt[i]=e[i]})),si.value=!0},btnDellocation:$t,BookingInfoData:wi,Terapist:pi,get_table_box:ri,bookingDate:di,serverDate:function(){},formArr:Dt,calendarData:bi,loadDaysClander:ea,onDay:function(e){Dt.action="click",Dt.click_date=e.date,ea(Dt.action)},addBookingDialog:oi,onAddBooking:function(e){if(Qt.tableIndex=0,ne.value=!1,"time_inline"!=e.status&&"hide"!=e.status)if("free"==e.status){te.value=[],Je.value=[],qt.symptom_name_arr="",qt.symptom_str_arr="",qt.is_Client="",qt.ill_str="",qt.ill_name="",qt.chm_name="",qt.chm_str="",Dt.include_tax="Y",Dt.is_tax=!0,Rt.is_items=!1,Jt.value=[],Rt.interval_days=7,Fe.value=[],Rt.Therapist_name=e.therapists_name,Rt.Therapist_id=e.therapists_id,Rt.service_times=e.time,Rt.date=e.date,ca(Jt.value[0]),Rt.booking_id="",Rt.loacation_id_add=Rt.loacation_id,Rt.loacation_name_add=Rt.loacation_name,Rt.Client_name="",Rt.Client_id="",Rt.During="",Rt.description="";const i=[],t=[];if(Ue.value=[],Zt.value.forEach(((e,a)=>{1==e.is_Selected&&(i.push(e.name),t.push(e))})),Ue.value=t,0==Ue.value.length)return void K({type:"error",message:"Please select a service"});Rt.service_name=i.toString(),i.length>1?Rt.service_disabled=!1:Rt.service_disabled=!0,0==i.length&&(Rt.service_name1=""),i.length>0&&(Rt.service_name1=i[0]),Ue.value.length>0&&(Ue.value[0].additional_Service?re.value=JSON.parse(JSON.stringify(Ue.value[0].additional_Service)):re.value=[],Ue.value.forEach(((e,i)=>{0==i&&(e.is_Selected1=1,e.during_price_json.forEach(((e,i)=>{e.default&&(Rt.During=e.duration)})),""==Rt.During&&(e.during_price_json.length>0?Rt.During=e.during_price_json[0].duration:Rt.During=60)),i>0&&(e.is_Selected1=0)}))),Ye.value=[],Dt.is_invoice=!1,oi.value=!0,Ca()}else"virtual"==e.status?e.visual_date.count>0?(Me.value=e.visual_date.detail,ge.value=!0):K({type:"info",message:"No virtual booking"}):wa(e)},addForm:Rt,goPrivacy:function(){$e.value=!0},PrivacyDialog:$e,ClientDialog:ei,eventIsNum:function(){1==qt.is_Client&&(Rt.Client_id=Ut.id,Rt.Client_name=Ut.name,Ta(),ya()),2==qt.is_Client&&(qt.symptom_name_arr=Ma.name,qt.symptom_str_arr=Ma.id,Fa()),3==qt.is_Client&&(te.value.forEach(((e,i)=>{e.checked=!1})),qt.ill_str=Ja.id,qt.ill_name=Ja.name),4==qt.is_Client&&(Je.value.forEach(((e,i)=>{e.checked=!1})),qt.chm_str=qa.id,qt.chm_name=qa.name)},ClientData:Ut,locationDialog:ni,eventIsNumlocation:function(){1==Rt.is_loacation?(Rt.loacation_name=Kt.name,Rt.loacation_id=Kt.id):2==Rt.is_loacation&&(Rt.loacation_name_add=Kt.name,Rt.loacation_id_add=Kt.id)},locationData:Kt,onSelectLocation:function(e){Rt.is_loacation=e,ni.value=!0},onSelClient:function(){qt.is_Client=1,Ut.clinic_id=Dt.Clinic_id,ei.value=!0},btnAddConfirm:async function(){ne.value=!0,Rt.is_items||(Jt.value=[]);const{data:e}=await s(Object.assign(Ii,{clinics_id:Dt.Clinic_id,therapist_list:Rt.Therapist_id,description:Rt.description,service_date:Rt.date,service_times:Rt.service_times,first_name:"",last_name:"",phone:"",email:"",config_id:Rt.config_id,add_session:"",during:Rt.During,sex:Rt.gender,customer_id:Rt.Client_id,company_id:Rt.loacation_id_add,Description_type:Rt.service_name1,mul_service:Jt,amount:Rt.amount,booking_id:Rt.booking_id,type:Dt.type,counter:"",higher_days:Si.value,is_invoice:Dt.is_invoice,is_tax:Dt.is_tax,include_tax:Dt.include_tax,additional_Service:re.value,symptom_str:qt.symptom_str_arr,ill_str:qt.ill_str,chm_str:qt.chm_str}));1==e.code?(ne.value=!1,""==Rt.booking_id&&Dt.is_invoice&&(_e.value=!0,Ae.value=e.bookingdetail,Rt.invoiceTherapist_name=e.bookingdetail.therapists_name,Rt.invoiceTherapist_id=e.bookingdetail.therapists_id,Le.value=JSON.parse(JSON.stringify(e.bookingdetail.clients.combina_service_arr)),Le.value.forEach(((e,i)=>{e.service_detail.forEach(((e,i)=>{e.spend_time=Number(e.spend_time)})),_a(e),ma(e)}))),Ve.value=e.invoiceIdArr,qe.value=e.email_values.booking_detail,Vt.email_content=e.email_values.booking_message,Vt.email_to=e.email_values.email_to,Vt.phone_to=e.email_values.phone_to,e.email_values.booking_notice_type&&(Vt.booking_notice_type=e.email_values.booking_notice_type,ht.value.forEach(((e,i)=>{Vt.booking_notice_type.includes(e.value)&&(e.is_selected=1)}))),Vt.name=e.email_values.name,Vt.booking_id=e.email_values.booking_id,Vt.is_booking=1,Vt.booking_arr=e.email_values.booking_arr,Vt.is_health_form=e.email_values.booking_detail[0].is_health_form,Vt.is_informed=e.email_values.booking_detail[0].is_informed,Vt.is_sensitived=e.email_values.booking_detail[0].is_sensitived,Vt.health_form_url=e.email_values.booking_detail[0].health_form_url,Vt.informed_content_url=e.email_values.booking_detail[0].informed_content_url,Vt.sentitive_content_url=e.email_values.booking_detail[0].sentitive_content_url,Vt.bookingServers=Rt.service_name1,Vt.sentive_include=!1,1==e.result_key.is_data_change&&(Dt.click_date=e.result_key.data),Dt.action="click",Dt.page=e.result_key.page,ea(Dt.action),oi.value=!1,Vt.email_health=!1,Vt.email_informed=!1,Vt.email_type="",ti.value=!0):(ne.value=!1,e.index?-1==e.index?K({type:"error",message:"Article 1: Appointment Time Conflict"}):1==e.index&&K({type:"error",message:"Multiple appointment times conflict, please click on the date to view"}):K({type:"error",message:e.msg})),ne.value=!1},serviceData:Zt,onHealthForm:ta,health_info:We,infoData:fi,healthDialog:Qe,btnHealthConfirm:async function(e){ne.value=!0;const i={information:wt,health_info:We.value},{data:t}=await l(Object.assign(ji,{customer_id:Dt.userId1,data_row:i}));1==t.code?(ci.value&&Oa(_i.value),K({type:"success",message:t.msg}),ia(),Qe.value=!1,ne.value=!1):(K({type:"error",message:t.msg}),ne.value=!1)},onCheckIn:Oa,addDuringDialog:ci,addDuringConfirm:aa,onPaymant:e=>{G.confirm("Are you sure to payment?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{na(e)})).catch((()=>{K({type:"info",message:"Canceled"})}))},onHealth:function(e,i){1==i.is_selected?i.is_selected=0:0==i.is_selected&&(i.is_selected=1)},sandEmailDialog:ti,EmailArr:Vt,onSend:async function(){ne.value=!0;let e="";const i=[];""==Vt.email_type?(Vt.email_health&&i.push("health"),Vt.email_informed&&i.push("informed"),e=i.toString()):e=Vt.email_type;const{data:t}=await o(Object.assign(Ti,{booking_id:Vt.booking_id,email_content:Vt.email_content,booking_arr:Vt.booking_arr,phone_to:Vt.phone_to,booking_notice_type:Vt.booking_notice_type,sentive_include:Vt.sentive_include,form_type:e}));1==t.code?(K({type:"success",message:t.msg}),ia(),_e.value&&""==Rt.booking_id&&da(Ae.value),ti.value=!1):K({type:"error",message:t.msg}),ne.value=!1},onService:function(e){1==e.is_Selected?(e.is_Selected=0,e.is_Selected1=0):(e.is_Selected=1,e.is_Selected1=1),Dt.page=1,sa()},onCancel:function(){ti.value=!1,_e.value&&""==Rt.booking_id&&da(Ae.value)},ClientDetail:async function(e){const{data:i}=await d(Object.assign(Wi,{customer_id:Rt.Client_id}));1==i.code?(yi.value=i.data.booking_arr,vi.value=i.data.note_arr,ze.value=!0):K({type:"error",message:i.msg})},BookingList:yi,NoteList:vi,onMore:function(e){e.clients.is_more=2},onRetract:function(e){e.clients.is_more=1},onEmail:function(e,i,t){1==i&&(Vt.booking_arr=[]),Vt.email_health=!1,Vt.email_informed=!1,Vt.email_type=t,ht.value.forEach(((e,i)=>{e.is_selected=0})),qe.value=e.booking_detail,qe.value.length>0&&(Vt.bookingServers=qe.value[0].description_type),Vt.email_content=e.clients.email_values.booking_message,Vt.email_to=e.clients.email_values.email_to,Vt.name=e.clients.email_values.name,Vt.booking_id=e.clients.email_values.booking_id,Vt.is_booking=2,Vt.bookingorder_id=e.clients.id,Vt.phone_to=e.clients.email_values.phone_to,e.clients.email_values&&(Vt.booking_notice_type=e.clients.email_values.booking_notice_type,ht.value.forEach(((e,i)=>{Vt.booking_notice_type&&Vt.booking_notice_type.includes(e.value)&&(e.is_selected=1)}))),Ea(),_e.value=!1,ti.value=!0},items:Jt,onDelete:e=>{G.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{la(e)})).catch((()=>{K({type:"info",message:"Canceled"})}))},onAddItem:function(){Ba("add")},formDialog:ii,Form1Edit:Na,planArr:xt,noteArr:Tt,sensitivedArr:Ot,ougoingArr:At,isData:Et,isData1:It,TimeData:Nt,DurationData:jt,initialData:Bt,areasData1:Wt,usedData1:Lt,receivedData1:Mt,treatedData:Ft,submitNoteForm:ra,selectedTr:function(e,i){2!=Dt.is_form_edit&&(Et.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,xt.discussed_with=e.value)},selectedTr1:function(e,i){2!=Dt.is_form_edit&&(It.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,xt.treatment_plan=e.value)},btnInitia:function(e,i){2!=Dt.is_form_edit&&(i.is_selected=e?1:0)},coatingRequire:function(e){2!=Dt.is_form_edit&&(1==e.is_selected?e.is_selected=0:0==e.is_selected&&(e.is_selected=1))},coatingRequire1:function(e){2!=Dt.is_form_edit&&(1==e.is_selected?e.is_selected=0:e.is_selected=1)},coatingRequire2:function(e){2!=Dt.is_form_edit&&(1==e.is_selected?e.is_selected=0:e.is_selected=1)},onTime:function(e,i){2!=Dt.is_form_edit&&(Nt.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,Tt.timeType=e.value)},onDuration:function(e,i){2!=Dt.is_form_edit&&(jt.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,Tt.durationType=e.value)},onReceived:function(e,i){2!=Dt.is_form_edit&&(Mt.value.forEach(((e,i)=>{e.is_selected=0})),e.is_selected=1,Tt.receivedType=e.value)},btnAddInvoice:da,items1:kt,InvoiceType:St,during_price_array:gi,disabledBeforeToday:function(e){const i=new Date;return i.setHours(0,0,0,0),e.getTime()>i.getTime()},onIs_tax:function(e,i){Rt.is_tax=e?"Y":"N",ma(i)},AddItem:function(){const e={id:kt.value.length+1,price:0,spend_time:"",treatment_date:kt.value[0].treatment_date};kt.value.push(e)},onDeleteI:(e,i)=>{G.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{ua(e,i)})).catch((()=>{K({type:"info",message:"Canceled"})}))},IncludeTax:function(e,i){ma(i)},onPrice:ma,taxData:bt,invoiceConfirm:async function(){se.value=!0,"outside"==Rt.invoice_type?Rt.description_type1:Rt.description_type;const{data:e}=await g(Object.assign(Vi,{customer_id:Rt.Client_id1,company_id:Rt.loacation_id1,invoice_type:Rt.invoice_type,invoice_due_date:Rt.invoice_due_date,is_tax:Rt.is_tax,description_type:Dt.LicenceServeValue,signal_image:Rt.signal_image5,signal_desc:Rt.signal_desc,include_tax:Rt.include_tax,invoice_number:Rt.Invoice_Number,receive_message:Rt.receive,note_id:Rt.note_id,origin:"booking",combina_service_arr:Le.value,therapist_id:Rt.invoiceTherapist_id,switch_therapist_id:Rt.has_therapistlicence,files:Rt.files}));1==e.code?(se.value=!1,1==Dt.is_invoice?(Rt.include_tax="N",Ve.value=e.invoice_id_arr,xa(5),ia(),ai.value=!1):(ia(),ai.value=!1),K({type:"success",message:e.msg})):(se.value=!1,K({type:"error",message:e.msg}))},duringPrice:function(e,i,t){t.spend_time=e,t.during_price_json.forEach(((i,a)=>{i.value==e&&(t.price=i.price)})),ma(i)},changeService:function(e,i){Ci.value.forEach(((t,a)=>{e==t.service_name&&("Y"==t.is_tax?i.is_tax=!0:i.is_tax=!1,i.service_id=t.id,i.include_tax=t.include_tax,Dt.service_id=t.id,_a(i),gi.value=t.during_price_json,i.licence_name=t.licence_name,i.licence_description=t.description,i.licence_title=t.licence_title,i.licence_number=t.licence_number,2==Dt.type&&(Rt.signal_image5=t.sinal_image_arr,Rt.signal_desc=t.sinal_desc_arr),1==Dt.type&&(Rt.signal_image5=t.sinal_image_arr,Rt.signal_desc=t.sinal_desc_arr))})),name=0,gi.value.forEach(((e,i)=>{e.duration==Rt.During&&(kt.value[0].spend_time=e.duration,name=1,kt.value[0].price=e.price)})),0==name&&(kt.value[0].price=gi.value[0].price)},invoiceDialog:ai,descriptionData:yt,signatureCanvas:Se,signatureDataUrl:Ce,saveSignature:()=>{ga.deactivateAll().renderAll(),Ce.value=ga.toDataURL({format:"png"})},clearSignature:function(){Ce.value=""},autographDialog:Ze,openAutograph:function(e,i){2!=Dt.is_form_edit&&(zt.signal_url=i,zt.form_type=e,zt.note_id=Dt.note_id,zt.service="",zt.service_id="",ra(2),Ze.value=!0)},signalData:zt,eventSignal:function(){"invoice"==zt.form_type?fa(xe.value.clients.therapist_list,xe.value.clients.note_id):Na(Te.value,Dt.form_type)},addServiceData:Ue,onServiceAdd:function(e){if(e.additional_Service?re.value=JSON.parse(JSON.stringify(e.additional_Service)):re.value=[],Ue.value.forEach(((e,i)=>{e.is_Selected1=0})),e.is_Selected1=1,Rt.service_name1=e.service_name,e.value==Ae.value.clients.description_type&&(re.value=de.value),""==Rt.booking_id){let i="";e.during_price_json.forEach(((e,t)=>{e.default&&(i=e.duration)})),""==i&&(i=e.during_price_json.length>0?e.during_price_json[0].duration:60),Rt.During=i}ya(),Ca()},onArrowLeft:function(){-2==Dt.prev_page&&(Dt.click_date=Dt.last_day,Dt.action="click",ea(Dt.action)),Dt.prev_page>0&&(Dt.page=Dt.prev_page,ia())},onArrowRight:function(){-2==Dt.next_page&&(Dt.click_date=Dt.next_day,Dt.action="click",ea(Dt.action)),Dt.next_page>0&&(Dt.page=Dt.next_page,ia())},ClinicsList:mi,btnClinic:function(){va()},btnSearchService:ha,LicenceServeData:Ci,btnAmount:function(e){ya(e)},CollectionDialog:Xe,btnCollection:function(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};return mt.value=1,vt.value=i,void(gt.value=!0)},CollectionData:He,bookingPaymentConfirm:async function(){const{data:e}=await f(Object.assign(Ui,{invoice_id:Ht.invoice_id,pay_amount_details:He.value}));1==e.code?(ia(),Xe.value=!1):K({type:"error",message:e.msg})},addCollectionDialog:Ge,AddCollect:function(){Ge.value=!0},collectionArr:Ht,btncollectionConfirm:async function(){if(ne.value=!0,"Cheque"!=Ht.pay_method&&(Ht.cheque_number=""),"Cheque"==Ht.pay_method&&""==Ht.cheque_number)return K({type:"error",message:"Please enter cheque number"}),void(ne.value=!1);let e="";if("Other"==Ht.pay_method){if(""==Ht.other)return K({type:"error",message:"Please enter pay method"}),void(ne.value=!1);e=Ht.other}else e=Ht.pay_method;const{data:i}=await y(Object.assign(st,{customer_id:Ht.customer_id,pay_amount:Ht.pay_amount,pay_method:e,cheque_number:Ht.cheque_number,content:Ht.content,collection_time:Ht.time,account_id:Ht.account_id}));1==i.code?(ba(),K({type:"success",message:i.msg}),Ge.value=!1,ne.value=!1):(K({type:"error",message:i.msg}),ne.value=!1)},btnDellocation:$t,btnDelBooking:e=>{G.confirm("Are you sure you want to delete this booking ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{ka(e)})).catch((()=>{K({type:"info",message:"Canceled"})}))},btnEdit:function(e){if(te.value=[],Je.value=[],qt.symptom_name_arr="",qt.symptom_str_arr="",qt.is_Client="",qt.ill_str="",qt.ill_name="",qt.chm_name="",qt.chm_str="","TCM"==e.clients.description_type){const i=[];e.clients.symptom_str_arr.forEach(((e,t)=>{i.push(e.name)})),qt.symptom_name_arr=i.toString(),qt.symptom_str_arr=e.clients.symptom_str,Fa(),qt.ill_str=Number(e.clients.ill_str),qt.ill_name=e.clients.ill_str_arr.name,qt.chm_name=e.clients.chm_str_arr.name,qt.chm_str=Number(e.clients.chm_str)}e.clients.additional_Service?(re.value=JSON.parse(JSON.stringify(e.clients.additional_Service)),de.value=JSON.parse(JSON.stringify(e.clients.additional_Service))):(re.value=[],de.value=[]),Rt.booking_id=e.clients.id,Rt.Client_name=e.clients.customer_name,Rt.Client_id=e.clients.customer_id,Ue.value=Zt.value,Rt.date=e.clients.service_date.substr(0,10),Rt.service_times=e.clients.begin_time,Rt.During=e.clients.session,Rt.amount=e.clients.amount,Rt.description=e.clients.description,Rt.Therapist_name=e.therapists_name,Rt.Therapist_id=e.therapists_id,Rt.loacation_id_add=e.clients.company_id,Rt.loacation_name_add=e.clients.company_name,Rt.used_form_id="",Ye.value=[];const i=e.clients.description_type;Rt.service_name1=e.clients.description_type,Ue.value.forEach(((e,t)=>{e.is_Selected1=0,i.includes(e.value)&&(e.is_Selected1=1)})),(1==Dt.type||6==Dt.type)&&(Dt.is_invoice=!1,oi.value=!0),2==Dt.type&&(e.clients.clinics_id?Da(e.clients.clinics_id):K({type:"error",message:"This appointment was not added by the current clinic and cannot be modified"}),Sa())},TherapistList1:ki,btnAmount1:oa,emailData:qe,InvoiceDetailDialog:ue,company_info:Oe,customer_info:je,info:Be,licenceDetail:Pe,detailInfo:Re,invoiceData:hi,onCancelEmail:function(){ue.value=!1},sendEmail:function(){ue.value=!1,fe.value=!0},sandEmailInvoiceDialog:fe,noSend:function(){fe.value=!1},btnShowNumber:async function(){const{data:e}=await C(Object.assign(Qi,{show_number:Qt.show_number}));1==e.code&&K({type:"success",message:e.msg})},InvoiceEmailSend:async function(){ne.value=!0;const{data:e}=await w(Object.assign($i,{invoice_id_arr:Ve.value,email_content:Rt.email_content,show_number:Qt.show_number}));1==e.code?(ia(),K({type:"success",message:e.msg}),fe.value=!1):K({type:"error",message:e.msg}),ne.value=!1},DeducationData:Ye,selectedDeducation:function(e){Rt.used_form_id==e.id?(Rt.used_form_id="",Rt.is_invoiceShow=1):(Rt.used_form_id=e.id,Dt.is_invoice=!1,Rt.is_invoiceShow=2)},customerSubmit:function(e){Te.value=e,ye.value=!0},customerConfirmDialog:ye,sigArr:Te,onShare1:async function(){try{await navigator.clipboard.writeText(Te.value.clients.customer_submit_href),K({type:"success",message:"The text has been copied to the clipboard!"})}catch(e){console.error("复制失败:",e),K({type:"error",message:"Copy failed, please manually copy"})}},btnEvaluation:async function(e){const{data:i}=await D(Object.assign(et,{bookingorder_id:e.clients.id}));1==i.code?(De.value=i.data.evaluationinfo,pe.value=!0):K({type:"error",message:i.msg})},EvaluationDialog:pe,evaluationinfo:De,evaluationImg:function(e){window.open(e)},SendEvaluationEmail:async function(){const{data:e}=await x(Object.assign(it,{booking_id:Te.value.clients.id}));1==e.code?(ye.value=!1,K({type:"success",message:e.msg})):K({type:"error",message:e.msg})},openInvoAutograph:function(){zt.signal_url="signal_url1",zt.form_type="invoice",zt.note_id="",zt.service=Dt.LicenceServeValue,zt.service_id=Dt.service_id,Ze.value=!0},signalUrl:Ee,btnFinish:function(e){Ne.value=e.clients.id,Rt.Customer_Name=e.clients.customer_name,Ht.customer_id=e.clients.customer_id,ke.value=!0},onEmailSensitive:function(e){},addMessageData:ht,onMessageData:function(e){1==e.is_selected?e.is_selected=0:0==e.is_selected&&(e.is_selected=1);const i=[];ht.value.forEach(((e,t)=>{1==e.is_selected&&i.push(e.value)})),Vt.booking_notice_type=i.toString()},btnIsSensitived:function(){Na(_i.value,"sensitived")},btnIsInformed:function(){Na(_i.value,"informed")},btnIsHealthForm:function(){ta(_i.value)},onAppointComplete:e=>{G.confirm(" this booking is Appoint Complete ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{Aa(e)})).catch((()=>{K({type:"info",message:"Canceled"})}))},btnBookingDetail:wa,bookingDetailDialog:ve,bookedArr:Ae,handleExceed:e=>{we.value.clearFiles();const i=e[0];i.uid=X(),we.value.handleStart(i),Ia()},handleChangePic:function(e,i,t){i.length>1&&i.splice(0,1)},bookingImg:we,uploadSlotFile1:function(e,i,t){1==e.code&&(ia(),K({type:"success",message:"Upload successful"}))},btnFormImgView:function(e){window.open(A+e.replace("/var/www/html/public",""))},onNotesForm:function(e,i){ja(e,i,2)},btnFormImgView8:function(e){window.open(A+e.replace("/var/www/html/public",""))},getbookingDetalInvoiceDetail:function(e){Ve.value=[],Ve.value.push(e.id),xa(1)},bookingInvoiceEmailSend:function(e){Ve.value=[],Ve.value.push(e.id),xa(2)},payMethodData:Pt,AccountData:ie,btnPrintPDF:async function(e){e.loading=!0;const{data:i}=await I(Object.assign(ot,{invoice_id:e.id,show_number:Qt.show_number}));1==i.code?(e.loading=!1,window.open(A+i.file_path.replace("var/www/html/public",""))):(e.loading=!1,K({type:"error",message:i.msg}))},btnHistory:function(){1==Dt.is_form_history?Dt.is_form_history=2:Dt.is_form_history=1},btnService:()=>{G.confirm("Invoicing requires the therapist to provide licence services",{confirmButtonText:"Go add",cancelButtonText:"cancel",type:"warning"}).then((()=>{Pa()})).catch((()=>{K({type:"info",message:"Canceled"})}))},btnFinish1:async function(e){const{data:i}=await T(Object.assign(tt,{booking_id:Ne}));1==i.code?(ke.value=!1,ia(),1==i.is_use?K({type:"success",message:i.use_msg}):K({type:"success",message:i.msg})):K({type:"error",message:i.msg})},FinishDialog:ke,btnAddmultiple:function(e){Jt.value=[],e&&Ba("add")},changeNumber:function(){Ba("update")},intervalDays:function(e){},BookingsByDate:async function(){if(Fe.value.length>0)return void(Fe.value=[]);const{data:e}=await j(Object.assign(lt,{therapist_id:Rt.Therapist_id,date:Rt.date}));1==e.code?e.data.length>0?Fe.value=e.data:K({type:"success",message:"No booking conflicts"}):K({type:"error",message:e.msg})},bookingByDate:Fe,changeTime:function(e){Ba("check")},btnViewtime:function(e){0==e.is_show?e.is_show=1:e.is_show=0},onSituationArr:function(e){Dt.tableIndex=e},onBackInvoice:function(){},handleDblClick:function(e){},visual_data:ae,virtualDialog:ge,virtualArr:Me,HealthArr:wt,rashesBruise:function(e){},SensitiveDialog:me,SensitiveEmail:async function(){ne.value=!0;const{data:e}=await P(Object.assign(rt,{booking_id:Ae.value.clients.id}));1==e.code?(Bt.value=e.data.sensitive_values,Ot.indication=e.data.Clinical_lndication,ne.value=!1,me.value=!0):(ne.value=!1,K({type:"error",message:e.msg}))},SendEmailSensitive:async function(){ne.value=!0;const{data:e}=await B(Object.assign(dt,{booking_id:Ae.value.clients.id,sensitive_values:Bt.value,Clinical_lndication:Ot.indication}));1==e.code?(me.value=!1,ne.value=!1,K({type:"success",message:e.msg})):(ne.value=!1,K({type:"error",message:e.msg}))},GoaddTherapist:function(){ee.push({path:"/crm/yuyue/clinic/employee",query:{}})},GoaddService:function(){2==Dt.type?ee.push({path:"/crm/yuyue/clinic/service",query:{}}):1==Dt.type&&ee.push({path:"/crm/yuyue/licence",query:{booking:1}})},btnFillout:function(e){Dt.is_historyAll=e,Ae.value.clients.other_note_detail.forEach(((i,t)=>{1==e?(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):2==e&&(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)))}))},detaiilMenu:pt,onDetaiilMenu:function(e){Qt.tableIndex=e},ServiceInvoice:Le,stulesShow:ft,btnStulesShow:function(e){1==e.is_selected?e.is_selected=0:e.is_selected=1,ia()},onDeleteService:e=>{G.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{Wa(e)})).catch((()=>{K({type:"info",message:"Canceled"})}))},isleftShow:function(e){Dt.is_leftShow=e},canLicenceTherapist:function(){},canLicenceTherapistConfirm:async function(){fa(Rt.has_therapistlicence,Ae.value.clients.note_id)},ChargeDialog:gt,eventCharge:function(){ia()},str1:mt,ChargeArr:vt,btnIsPaid:async function(e,i){const{data:t}=await W(Object.assign(Hi,{invoice_id:i.id,is_paid:e}));1==t.code&&ia(),K({type:"success",message:t.msg})},loading5:se,uploadSlotFile11:function(e,i,t){1==e.code?(Rt.files.push(A+e.data.file_path.replace("var/www/html/public/","")),Rt.files1.push(e.data.file_name)):K({type:"error",message:e.data.msg})},btnFile:function(e){e.length&&(le.value=e,oe.value=!0)},fileArr:le,onFile:function(e){window.open(e)},fileDialog:oe,additionalService:re,changeAdditional:function(){ya()},onChineseMedical:function(e,i){1==e&&(Ct.note_id=Ae.value.clients.note_id,Ct.str=e),2==e&&(Ct.note_id=i.id),Ct.form_type="TCM",Ct.str=e,he.value=!0},chineseMedicalDialog:he,chineseArr:Ct,eventChinese:function(){ia()},btnSaveDefault:e=>{G.confirm("Do you want to change the current tax configuration to the default service configuration ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{La(e)})).catch((()=>{K({type:"info",message:"Canceled"})}))},btnSymptom:function(){qt.is_Client=2,Ma.symptom_str_arr=qt.symptom_str_arr,ce.value=!0},symptomDialog:ce,symptomData:Ma,itemArr:qt,IllNessData:te,dataChine:Je,changeill:function(e,i){te.value.forEach(((e,i)=>{e.checked=!1})),i.checked=!0,qt.ill_str=i.id,qt.ill_name=i.name},changChm:function(e,i){Je.value.forEach(((e,i)=>{e.checked=!1})),i.checked=!0,qt.chm_str=i.id,qt.chm_name=i.name},onSelectIll:function(){qt.is_Client=3,Ja.id=qt.ill_str,be.value=!0},illData:Ja,illnessDialog:be,onSelectChm:function(){qt.is_Client=4,qa.id=qt.chm_str,Ke.value=!0},chmData:qa,chmDialog:Ke}}))}}}));