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