File: /var/www/html/public/static/js/hookPointsList-48317d84.js
import{getPointManagerWeb as R,changePointWeb as F,deleteCompanyWeb as U}from"./po-34b1a012.js";import{d as m,u as V}from"./vue-router-a383d220.js";import{o as q}from"./index-81e4a901.js";import{b7 as c}from"./message-2472a54a.js";import{r as a,A as o,o as K}from"./runtime-core.esm-bundler-6128546f.js";import"./index-48edda51.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 ie(){m(),V(),m();const g=a(),s=a(!1),h=a(!1),f=a(!1),r=a(!1),x=a(!1),y=a(""),p=a([]),b=o({}),_=o({tableIndex:0,note:""}),t=o({point:"",growth:"",redemption_ratio:"",Amount:0,exchange_point:0}),v=a([{id:1,value:"userName",text:"User Name"},{id:2,value:"payTime",text:"Pay Time"}]),D=a([{value:"prepaid",text:"Prepaid"},{value:"balance",text:"Balance"},{value:"all",text:"All"}]),P=a([{value:"1month",text:"1 Month"},{value:"3month",text:"3 Month"},{value:"6month",text:"6 Month"},{value:"1year",text:"1 Year"}]),d=o({}),w=o({}),A=o({}),l=o({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),u=o({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",searchType:"userName",searchValue:"",paymentType:"all"}),T=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"Idx",type:"index",width:70,hide:({checkList:e})=>!e.includes("Idx")},{label:"Point",prop:"point",width:200,slot:"Point",hide:({checkList:e})=>!e.includes("Point")},{label:"Description",prop:"point_origin",hide:({checkList:e})=>!e.includes("Description")},{label:"Date",prop:"create_time",minWidth:100,hide:({checkList:e})=>!e.includes("Date")}],k=["Idx","Point","Description","Date"];function C(){i()}function E(e){l.pageSize=e,i()}function M(e){l.currentPage=e,i()}async function i(){s.value=!0;const{data:e}=await R(Object.assign(b,{}));p.value=e.data.detail,t.point=e.data.total.point,t.growth=e.data.total.growth,t.redemption_ratio=e.data.redemption_ratio,s.value=!1}const S=(e,n)=>{};function L(e){Object.keys(e).map(n=>{d[n]=e[n]})}async function j(e){const{data:n}=await U(Object.assign(A,{company_id:e.id}));n.code==1?(i(),c({type:"success",message:n.msg})):c({type:"error",message:n.msg})}const z=e=>{q.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{j(e)}).catch(()=>{c({type:"info",message:"Canceled"})})};function B(){u.searchValue=""}function I(){t.exchange_point=0,r.value=!0}function O(){t.exchange_point=t.point,t.Amount=(t.exchange_point*t.redemption_ratio/100).toFixed(2)}function W(){t.exchange_point>t.point&&(c({type:"error",message:"Up to "+t.point+" can be exchanged"}),t.exchange_point=t.point),t.Amount=(t.exchange_point*t.redemption_ratio/100).toFixed(2)}async function N(e){const{data:n}=await F(Object.assign(w,{point:t.exchange_point}));n.code==1?(i(),c({type:"success",message:n.msg}),r.value=!1):c({type:"error",message:n.msg})}return K(()=>{i()}),{searchDetail:u,btnSearchPart:C,loading:s,small:x,selectList:k,columns:T,pagination:l,handleSizeChange:E,handleCurrentChange:M,PartList:p,order_date:y,deliverDialog:h,selectClick:S,itemArr:_,addLocationDialog:f,locationArr:d,EditLocation:L,btnDellocation:z,singleTableRef:g,searchData:v,DisplayType:D,timeData:P,loadPartList:i,btnSearchType:B,totalArr:t,ExchangeDialog:r,btnExchange:I,btnAll:O,exchangePoint:W,btnExchangeConfirm:N}}export{ie as useEqu};