File: /var/www/html/public/static/js/hookMemberLevel-98f171d7.js
import{getMemberLevelWeb as j,getPointManagerWeb as z,deleteCompanyWeb as E}from"./po-dbdb2684.js";import{d as m,u as I}from"./vue-router-a383d220.js";import{o as O}from"./index-81e4a901.js";import{b7 as s}from"./message-2472a54a.js";import{r as a,A as o,o as B}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 Y(){m(),I(),m();const u=a(),l=a(!1),g=a(!1),p=a(!1),h=a(!1),f=a(""),c=a([]),v=o({}),_=o({tableIndex:0,note:""}),t=o({level_code:0,level_name:"",user_growth:"",next_growth:"",level_value:""}),d=o({}),w=o({}),b=o({}),r=o({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),y=o({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:""}),x=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"Idx",type:"index",width:70,hide:({checkList:e})=>!e.includes("Idx")},{label:"Level Code",prop:"level_code",minWidth:100,hide:({checkList:e})=>!e.includes("Level Code")},{label:"Level Name",prop:"level_name",minWidth:100,hide:({checkList:e})=>!e.includes("Level Name")},{label:"Growth",prop:"growth",minWidth:100,hide:({checkList:e})=>!e.includes("Growth")},{label:"Priv",prop:"priv",minWidth:100,hide:({checkList:e})=>!e.includes("Priv")}],L=["Idx","Level Code","Level Name","Growth","Priv"];function P(){i()}function C(e){r.pageSize=e,i()}function A(e){r.currentPage=e,i()}async function i(){l.value=!0;const{data:e}=await j(Object.assign(w,{}));c.value=e.data,l.value=!1}async function k(){const{data:e}=await z(Object.assign(v,{}));e.code==1&&(t.level_code=e.data.level_info.level_code,t.level_name=e.data.level_info.level_name,t.user_growth=e.data.level_info.user_growth,t.next_growth=e.data.level_info.next_growth,t.level_value=(t.user_growth/t.next_growth*100).toFixed(2))}const W=(e,n)=>{};function M(e){Object.keys(e).map(n=>{d[n]=e[n]})}async function D(e){const{data:n}=await E(Object.assign(b,{company_id:e.id}));n.code==1?(i(),s({type:"success",message:n.msg})):s({type:"error",message:n.msg})}const S=e=>{O.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{D(e)}).catch(()=>{s({type:"info",message:"Canceled"})})};return B(()=>{i(),k()}),{searchDetail:y,btnSearchPart:P,loading:l,small:h,selectList:L,columns:x,pagination:r,handleSizeChange:C,handleCurrentChange:A,PartList:c,order_date:f,deliverDialog:g,selectClick:W,itemArr:_,addLocationDialog:p,locationArr:d,EditLocation:M,btnDellocation:S,singleTableRef:u,lecelArr:t}}export{Y as useEqu};