File: /var/www/html/public/static/js/hookAccountList-8f2df533.js
import{AccountListWeb as L,AddEditAccountWeb as P,DeleteAccountWeb as R}from"./po-829b88f8.js";import{d as f,u as z}from"./vue-router-a383d220.js";import{o as K}from"./index-81e4a901.js";import{b7 as l}from"./message-2472a54a.js";import{r as a,A as c,o as M}from"./runtime-core.esm-bundler-6128546f.js";import"./index-4e6349f8.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(){f(),z(),f();const g=a(),s=a(!1),b=a(!1),h=a(!1),r=a(!1),A=a(!1),y=a(""),o=a(""),u=a([]),_=c({}),k=c({tableIndex:0,note:""}),m=c({}),v=c({}),B=c({}),d=c({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),t=c({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",type:"",role:"",clinic_id:""}),N=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"Idx",type:"index",width:70,hide:({checkList:e})=>!e.includes("Idx")},{label:"Account Name",prop:"account_name",minWidth:100,hide:({checkList:e})=>!e.includes("Account Name")},{label:"Create Date",prop:"create_date",minWidth:100,hide:({checkList:e})=>!e.includes("Create Date")},{label:"Bank Name",prop:"bank_name",minWidth:100,hide:({checkList:e})=>!e.includes("Bank Name")},{label:"Bank Address",prop:"bank_address",minWidth:100,hide:({checkList:e})=>!e.includes("Bank Address")},{label:"Bank Account Name",prop:"bank_account_name",minWidth:150,hide:({checkList:e})=>!e.includes("Bank Account Name")},{label:"Account Number",prop:"account_number",minWidth:120,hide:({checkList:e})=>!e.includes("Account Number")},{label:"Received Amount",prop:"received_amount",minWidth:120,hide:({checkList:e})=>!e.includes("Received Amount")},{label:"Action",fixed:"right",width:120,slot:"operation",hide:({checkList:e})=>!e.includes("Action")}],w=["Idx","Account Name","Create Date","Bank Name","Bank Address","Bank Account Name","Account Number","Received Amount","Action","Action"];function x(){i()}function D(e){d.pageSize=e,i()}function W(e){d.currentPage=e,i()}async function i(){t.type=localStorage.getItem("type"),t.type==2&&(t.role="clinic"),t.type==1&&(t.role="therapists"),t.clinic_id=localStorage.getItem("clinicIdOverall"),s.value=!0;const{data:e}=await L(Object.assign(_,{clinic_id:t.clinic_id,role:t.role,searchKey:t.searchKey}));e.code==1&&(u.value=e.data,o.value=e.add_model),s.value=!1}const C=(e,n)=>{};function I(e){Object.keys(e).map(n=>{m[n]=e[n]})}async function O(e){const{data:n}=await R(Object.assign(v,{account_id:e.id}));n.code==1?(i(),l({type:"success",message:n.msg})):l({type:"error",message:n.msg})}const p=e=>{K.confirm("Are you sure you want to delete this?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{O(e)}).catch(()=>{l({type:"info",message:"Canceled"})})};function S(){Object.keys(o.value).map(e=>{o.value[e]=""}),r.value=!0}async function j(){s.value=!0;const{data:e}=await P(Object.assign(B,{clinic_id:t.clinic_id,role:t.role,row:o.value}));e.code==1?(i(),l({type:"success",message:e.msg}),r.value=!1):l({type:"error",message:e.msg}),s.value=!1}function E(e){Object.keys(e).map(n=>{o.value[n]=e[n]}),r.value=!0}return M(()=>{i()}),{searchDetail:t,btnSearchPart:x,loading:s,small:A,selectList:w,columns:N,pagination:d,handleSizeChange:D,handleCurrentChange:W,PartList:u,order_date:y,deliverDialog:b,selectClick:C,itemArr:k,addLocationDialog:h,locationArr:m,EditLocation:I,btnDellocation:p,singleTableRef:g,addDialog:r,btnAdd:S,btnAccountConfirm:j,add_model:o,btnEdit:E,btnDellocation:p}}export{ee as useEqu};