File: /var/www/html/public/static/js/hookDeducation-23247651.js
import{UsedFormListWeb as N,UsedFormDetail as O,deleteCompanyWeb as j}from"./po-fd838395.js";import{d as g,u as E}from"./vue-router-a383d220.js";import{o as B}from"./index-81e4a901.js";import{b7 as s}from"./message-2472a54a.js";import{r as i,A as a,o as K}from"./runtime-core.esm-bundler-6128546f.js";import"./index-f28053db.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 ee(){const{query:r,params:M}=g();E(),g();const f=i(),l=i(!1),h=i(!1),d=i(!1),y=i(!1),b=i(!1),_=i(""),u=i([]),m=i([]),v=a({}),D=a({tableIndex:0,note:""}),p=a({}),A=a({}),C=a({}),n=a({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),o=a({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",clinic_id:"",type:"",role:"",customername:"",Account:"",location:"",name:"",pkg:"",tel:""}),S=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"Idx",type:"index",width:70,hide:({checkList:e})=>!e.includes("Idx")},{label:"CustomerId",prop:"customer_id",minWidth:100,hide:({checkList:e})=>!e.includes("CustomerId")},{label:"CustomerName",prop:"customer_name",minWidth:100,hide:({checkList:e})=>!e.includes("CustomerName")},{label:"Service Name",prop:"service_name",minWidth:100,hide:({checkList:e})=>!e.includes("Service Name")},{label:"Date Period",prop:"date_period",minWidth:100,hide:({checkList:e})=>!e.includes("Date Period")},{label:"Deducation",prop:"deducation",minWidth:150,slot:"slotAction",hide:({checkList:e})=>!e.includes("Deducation")},{label:"Deducation value",prop:"deducation_value",minWidth:120,hide:({checkList:e})=>!e.includes("Deducation value")},{label:"Used value",prop:"used_value",minWidth:120,hide:({checkList:e})=>!e.includes("Used value")},{label:"Action",fixed:"right",width:120,slot:"operation",hide:({checkList:e})=>!e.includes("Action")}],k=["Idx","CustomerId","CustomerName","Service Name","Date Period","Deducation","Deducation value","Used value","Action"];function w(){c()}function x(e){n.pageSize=e,c()}function I(e){n.currentPage=e,c()}async function c(){let e="";r.use_id&&(e=r.use_id),l.value=!0;const{data:t}=await N(Object.assign(v,{clinic_id:o.clinic_id,role:o.role,customername:o.customername,searchKey:o.searchKey,use_id:e,pageSize:n.pageSize,page:n.currentPage}));u.value=t.data,n.total=t.total,l.value=!1}const P=(e,t)=>{};function W(e){Object.keys(e).map(t=>{p[t]=e[t]})}async function L(e){const{data:t}=await j(Object.assign(C,{company_id:e.id}));t.code==1?(c(),s({type:"success",message:t.msg})):s({type:"error",message:t.msg})}const U=e=>{B.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{L(e)}).catch(()=>{s({type:"info",message:"Canceled"})})};async function z(e){const{data:t}=await O(Object.assign(A,{used_id:e.id}));t.code==1?(o.pkg=t.date.info.pkg,o.tel=t.date.info.tel,o.location=t.date.info.location,o.name=t.date.info.name,o.Account=t.date.info.Account,m.value=t.date.detail,d.value=!0):s({type:"error",message:t.msg})}return K(()=>{o.type=localStorage.getItem("type"),o.clinic_id=localStorage.getItem("clinicIdOverall"),o.type==2&&(o.role="clinic"),o.type==1&&(o.role="therapists"),c()}),{searchDetail:o,btnSearchPart:w,loading:l,small:b,selectList:k,columns:S,pagination:n,handleSizeChange:x,handleCurrentChange:I,PartList:u,order_date:_,deliverDialog:h,selectClick:P,itemArr:D,addLocationDialog:y,locationArr:p,EditLocation:W,btnDellocation:U,singleTableRef:f,UsedLogDialog:d,btnUsedLog:z,logData:m}}export{ee as useEqu};