File: /var/www/html/public/static/js/hookNeedInvoice-57f05104.js
import{schBookingInvoiceListWeb as Y,schBookingInvoiceSubmitWeb as $,schBookingUseSubmitWeb as K}from"./po-dbdb2684.js";import{d as b,u as q}from"./vue-router-a383d220.js";import{o as U}from"./index-81e4a901.js";import{b7 as s}from"./message-2472a54a.js";import{r as i,A as o,o as F}from"./runtime-core.esm-bundler-6128546f.js";import"./index-f0216e7e.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 ce(){b(),q(),b();const y=i(),r=i(!1),d=i(!1),p=i(!1),v=i(!1),S=i(!1),x=i(""),g=i([]),_=i([]),u=i([]),k=o({}),A=o({tableIndex:0,note:""}),D=i([{value:"Y",text:"Y"},{value:"N",text:"N"}]),f=o({}),W=o({}),w=o({}),n=o({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),t=o({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",type:"",role:"",clinic_id:"",date_begin:"",date_end:"",loacation_id:"",loacation_name:"",is_tax:!0,include_tax:"Y"}),m=o({name:"",id:""}),B=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"CusName",prop:"customer_name",minWidth:100,hide:({checkList:e})=>!e.includes("CusName")},{label:"Booking#",prop:"booking_order_no",minWidth:100,hide:({checkList:e})=>!e.includes("Booking#")},{label:"Service Date",prop:"service_date",minWidth:100,hide:({checkList:e})=>!e.includes("Service Date")},{label:"Service Time",prop:"postal",minWidth:100,slot:"ServiceTime",hide:({checkList:e})=>!e.includes("Service Time")},{label:"Service Name",prop:"description_type",minWidth:150,hide:({checkList:e})=>!e.includes("Service Name")},{label:"Session (min)",prop:"session",minWidth:120,hide:({checkList:e})=>!e.includes("Session (min)")},{label:"Amount ($)",prop:"amount",minWidth:120,hide:({checkList:e})=>!e.includes("Amount ($)")},{label:"Action",fixed:"right",minWidth:100,slot:"operation",hide:({checkList:e})=>!e.includes("Action")}],C=["勾选列","CusName","Booking#","Service Date","Service Time","Service Name","Session (min)","Amount ($)","Action"];function N(){c()}function I(e){n.pageSize=e,c()}function P(e){n.currentPage=e,c()}async function c(){t.type=localStorage.getItem("type"),t.type==2&&(t.role="clinic"),t.type==1&&(t.role="therapists"),t.clinic_id=localStorage.getItem("clinicIdOverall"),r.value=!0;const{data:e}=await Y(Object.assign(k,{clinic_id:t.clinic_id,role:t.role,cusname:t.searchKey,date_begin:t.date_begin,date_end:t.date_end,pageSize:n.pageSize,page:n.currentPage}));e.code==1&&(g.value=e.data,n.total=e.total),r.value=!1}const L=(e,a)=>{u.value=e};function T(e){Object.keys(e).map(a=>{f[a]=e[a]})}async function z(e){const{data:a}=await K(Object.assign(w,{booking_id:e.id,use_type:e.use_type,customer_id:e.customer_id}));a.code==1?(c(),s({type:"success",message:a.msg})):s({type:"error",message:a.msg})}const O=e=>{U.confirm("Are you sure to use the deduction voucher",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{z(e)}).catch(()=>{s({type:"info",message:"Canceled"})})};function R(e){e==null?(t.date_begin="",t.date_end=""):(t.date_begin=e[0],t.date_end=e[1])}async function j(e){let a="",h="";if(e=="summary"){if(t.is_tax=!0,t.include_tax="Y",u.value.length==0){s({type:"error",message:"Please select Customer"});return}}else h=t.is_tax,a=t.include_tax;const{data:l}=await $(Object.assign(W,{dataRow:u.value,is_tax:h,include_tax:a,submit_action:e}));l.code==1?e=="summary"?(d.value=!0,_.value=l.data):(c(),d.value=!1,s({type:"success",message:l.msg})):s({type:"error",message:l.msg})}function E(){p.value=!0}function M(){t.loacation_name=m.name,t.loacation_id=m.id}return F(()=>{c()}),{searchDetail:t,btnSearchPart:N,loading:r,small:S,selectList:C,columns:B,pagination:n,handleSizeChange:I,handleCurrentChange:P,PartList:g,order_date:x,deliverDialog:d,selectClick:L,itemArr:A,addLocationDialog:v,locationArr:f,EditLocation:T,btnDellocation:O,singleTableRef:y,getDate:R,btnMakeInvoice:j,onSelectLocation:E,locationDialog:p,eventIsNumlocation:M,locationData:m,taxData:D,invoiceArr:_}}export{ce as useEqu};