File: /var/www/html/public/static/js/hookAddBooking-legacy-fd4de1b2.js
System.register(["./po-legacy-4e000543.js","./vue-router-legacy-a12307c3.js","./index-legacy-42c17c53.js","./message-legacy-10af7c73.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-3f97fe0a.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 a,t,n,s,c,r,l,o,d,m,u,_;return{setters:[e=>{a=e.getBookingDetail,t=e.getBookingTimes,n=e.bookingOrderNP,s=e.deleteCompanyWeb,c=e.bookingAmountCalculteWeb},e=>{r=e.d,l=e.u},e=>{o=e.o},e=>{d=e.b7},e=>{m=e.r,u=e.A,_=e.o},null,null,null,null,null,null,null,null],execute:function(){e("useEqu",(function(){r();const e=l();r();const i=m(),p=m(!1),h=m(!1),g=m(!1),v=m(!1),y=m(!1),f=m(""),k=m([]),b=m([]),T=m([]),S=m([]),j=m([]),L=m([]),P=u({}),C=u({tableIndex:0,note:""}),A=u({}),x=u({}),w=u({});u({});const D=u({}),W=u({}),O=u({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),E=u({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",type:"",role:"",clinic_id:"",key_param:"",Therapist_id:"",during:60,service_name:"",service_id:"",date:"",isService:1,price:0,time:"",Time1:"",is_Submit:1,is_select:"services",is_service_select:"Promotions",Therapist_name:"",first_name:"",last_name:"",phone:"",email:""});async function z(){p.value=!0;const{data:e}=await a(Object.assign(P,{key_param:E.key_param,service_name:E.service_name,clinic_id:E.clinic_id}));1==e.code&&(S.value=e.data.service_info,j.value=e.data.therapists_info,S.value.length>0&&1==E.isService&&(E.service_name=S.value[0].service_name,E.is_service_select=S.value[0].service_name,E.service_id=S.value[0].id,E.isService=2,S.value[0].additional_Service?T.value=S.value[0].additional_Service:T.value=[],z())),p.value=!1}async function B(e){const{data:i}=await s(Object.assign(w,{company_id:e.id}));1==i.code?(z(),d({type:"success",message:i.msg})):d({type:"error",message:i.msg})}async function H(){if(""==E.Therapist_id)return;const{data:e}=await c(Object.assign(D,{descrption:E.service_name,Therapist_id:E.Therapist_id,during:E.during,is_during:"",customer_id:"",role:"client",key_param:E.key_param,additional_Service:T.value,service_id:E.service_id,begin_time:E.time,clinic_id:E.clinic_id}));1==e.code?(E.price=e.total_amount,E.Time1=e.end_time,E.during=e.during):d({type:"error",message:e.msg})}async function N(){if(""==E.Therapist_id)return;const{data:e}=await t(Object.assign(x,{key_param:E.key_param,service_name:E.service_name,therapist_id:E.Therapist_id,date:E.date,duration:E.during,clinic_id:E.clinic_id}));1==e.code?(L.value=e.data,H()):d({type:"error",message:e.msg})}return _((()=>{const i=e.options.history.location.split("?"),a=i[1].split("&&"),t=i[1].split("=");"key_param"==a[0]&&(E.key_param=a[1]),"clinic_id"==t[0]&&(E.clinic_id=t[1]),z()})),{searchDetail:E,btnSearchPart:function(){z()},loading:p,small:v,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:O,handleSizeChange:function(e){O.pageSize=e,z()},handleCurrentChange:function(e){O.currentPage=e,z()},PartList:k,order_date:f,deliverDialog:h,selectClick:(e,i)=>{},itemArr:C,addLocationDialog:g,locationArr:A,EditLocation:function(e){Object.keys(e).map((i=>{A[i]=e[i]}))},btnDellocation:e=>{o.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{B(e)})).catch((()=>{d({type:"info",message:"Canceled"})}))},singleTableRef:i,addServiceData:S,therapistsData:j,onServiceAdd:function(e){E.during=60,E.Therapist_id="",E.Therapist_name="",E.date="",E.time="",L.value=[],E.price=0,E.service_id=e.id,E.service_name=e.service_name,e.additional_Service?T.value=e.additional_Service:T.value=[],z(),N()},onTherapists:function(e){E.Therapist_id=e.id,E.Therapist_name=e.name,b.value=e.date,N()},loadTime:N,dateList:b,onDate:function(e){E.date=e,N()},TimeData:L,onTime:function(e){E.time=e,H()},btnDeliverConfirm:async function(){if(""==E.Therapist_id&&""==E.clinic_id||""==E.Therapist_id&&E.clinic_id&&E.first_name&&E.last_name&&E.phone&&E.email)return void d({type:"error",message:"Please select therapist"});const{data:e}=await n(Object.assign(W,{key_param:E.key_param,therapist_list:E.Therapist_id,description:E.service_name,service_date:E.date,service_times:E.time,first_name:E.first_name,last_name:E.last_name,phone:E.phone,email:E.email,config_id:"",add_session:"",during:E.during,sex:"",customer_id:"",company_id:"",Description_type:E.service_name,mul_service:[],amount:E.price,booking_id:"",type:"",counter:"",higher_days:"",is_invoice:"",is_tax:"",include_tax:"",additional_Service:[],clinics_id:E.clinic_id}));1==e.code?E.is_Submit=2:d({type:"error",message:e.msg})},loading2:y,btnContinue:function(){y.value=!0,"services"==E.is_select?E.is_select="professional":"professional"==E.is_select&&(E.is_select="time"),y.value=!1},additionalService:T,changeAdditional:function(){H()}}}))}}}));