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