File: /var/www/html/public/static/js/hookAddBooking-05346fe5.js
import{getBookingDetail as V,getBookingTimes as X,bookingOrderNP as Y,deleteCompanyWeb as Z,bookingAmountCalculteWeb as $}from"./po-399a971b.js";import{d as y,u as ee}from"./vue-router-a383d220.js";import{o as ie}from"./index-81e4a901.js";import{b7 as c}from"./message-2472a54a.js";import{r as t,A as n,o as te}from"./runtime-core.esm-bundler-6128546f.js";import"./index-23ee140c.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 fe(){y();const b=ee();y();const T=t(),l=t(!1),k=t(!1),S=t(!1),A=t(!1),m=t(!1),P=t(""),C=t([]),h=t([]),r=t([]),s=t([]),f=t([]),_=t([]),w=n({}),D=n({tableIndex:0,note:""}),g=n({}),W=n({}),x=n({});n({});const E=n({}),O=n({}),p=n({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),i=n({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:""}),j=[{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")}],L=["勾选列","Company","HST#","Name","Postal","Phone","Email","Address","Provice","City","Action"];function B(){o()}function z(e){p.pageSize=e,o()}function N(e){p.currentPage=e,o()}async function o(){l.value=!0;const{data:e}=await V(Object.assign(w,{key_param:i.key_param,service_name:i.service_name,clinic_id:i.clinic_id}));e.code==1&&(s.value=e.data.service_info,f.value=e.data.therapists_info,s.value.length>0&&i.isService==1&&(i.service_name=s.value[0].service_name,i.is_service_select=s.value[0].service_name,i.service_id=s.value[0].id,i.isService=2,s.value[0].additional_Service?r.value=s.value[0].additional_Service:r.value=[],o())),l.value=!1}const H=(e,a)=>{};function M(e){Object.keys(e).map(a=>{g[a]=e[a]})}async function R(e){const{data:a}=await Z(Object.assign(x,{company_id:e.id}));a.code==1?(o(),c({type:"success",message:a.msg})):c({type:"error",message:a.msg})}const q=e=>{ie.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{R(e)}).catch(()=>{c({type:"info",message:"Canceled"})})};async function u(){if(i.Therapist_id=="")return;const{data:e}=await $(Object.assign(E,{descrption:i.service_name,Therapist_id:i.Therapist_id,during:i.during,is_during:"",customer_id:"",role:"client",key_param:i.key_param,additional_Service:r.value,service_id:i.service_id,begin_time:i.time,clinic_id:i.clinic_id}));e.code==1?(i.price=e.total_amount,i.Time1=e.end_time,i.during=e.during):c({type:"error",message:e.msg})}function I(e){i.during=60,i.Therapist_id="",i.Therapist_name="",i.date="",i.time="",_.value=[],i.price=0,i.service_id=e.id,i.service_name=e.service_name,e.additional_Service?r.value=e.additional_Service:r.value=[],o(),d()}function K(e){i.Therapist_id=e.id,i.Therapist_name=e.name,h.value=e.date,d()}function F(e){i.date=e,d()}function G(e){i.time=e,u()}async function d(){if(i.Therapist_id=="")return;const{data:e}=await X(Object.assign(W,{key_param:i.key_param,service_name:i.service_name,therapist_id:i.Therapist_id,date:i.date,duration:i.during,clinic_id:i.clinic_id}));e.code==1?(_.value=e.data,u()):c({type:"error",message:e.msg})}async function J(){if(i.Therapist_id==""&&i.clinic_id==""||i.Therapist_id==""&&i.clinic_id&&i.first_name&&i.last_name&&i.phone&&i.email){c({type:"error",message:"Please select therapist"});return}const{data:e}=await Y(Object.assign(O,{key_param:i.key_param,therapist_list:i.Therapist_id,description:i.service_name,service_date:i.date,service_times:i.time,first_name:i.first_name,last_name:i.last_name,phone:i.phone,email:i.email,config_id:"",add_session:"",during:i.during,sex:"",customer_id:"",company_id:"",Description_type:i.service_name,mul_service:[],amount:i.price,booking_id:"",type:"",counter:"",higher_days:"",is_invoice:"",is_tax:"",include_tax:"",additional_Service:[],clinics_id:i.clinic_id}));e.code==1?i.is_Submit=2:c({type:"error",message:e.msg})}function Q(){m.value=!0,i.is_select=="services"?i.is_select="professional":i.is_select=="professional"&&(i.is_select="time"),m.value=!1}function U(){u()}return te(()=>{const e=b.options.history.location.split("?"),a=e[1].split("&&"),v=e[1].split("=");a[0]=="key_param"&&(i.key_param=a[1]),v[0]=="clinic_id"&&(i.clinic_id=v[1]),o()}),{searchDetail:i,btnSearchPart:B,loading:l,small:A,selectList:L,columns:j,pagination:p,handleSizeChange:z,handleCurrentChange:N,PartList:C,order_date:P,deliverDialog:k,selectClick:H,itemArr:D,addLocationDialog:S,locationArr:g,EditLocation:M,btnDellocation:q,singleTableRef:T,addServiceData:s,therapistsData:f,onServiceAdd:I,onTherapists:K,loadTime:d,dateList:h,onDate:F,TimeData:_,onTime:G,btnDeliverConfirm:J,loading2:m,btnContinue:Q,additionalService:r,changeAdditional:U}}export{fe as useEqu};