cashier-ERP/build/assets/index-CDcak4i9.js

2 lines
7.6 KiB
JavaScript
Raw Permalink Normal View History

2024-05-30 15:51:26 +08:00
import{_ as B,u as R,r as k,b as m,c as s,h as p,e as t,t as v,g as _,F as T,i as E,y as J,f as l,w as d,E as Y,m as D,B as j,C as W,o as q,a as G,s as L,d as b,A as w,z as N}from"./index-D1f-ww4d.js";import{a as H,b as K,c as P,d as Q,e as X}from"./merchant-BH28HDnN.js";import{h as U}from"./moment-Cl4UOzQZ.js";import{p as Z}from"./padding-KS62mXF5.js";const z=y=>(j("data-v-e01d9d71"),y=y(),W(),y),ee={class:"my-order"},ae={class:"header-nav"},te=z(()=>t("div",{class:"nav-item"},v("提现"),-1)),le={class:"nav-body"},ne={class:"my-money"},oe=z(()=>t("div",null,"我的余额:",-1)),se={style:{"text-align":"center",color:"#2ec479"}},ie={class:"my-count"},de={class:"count"},_e={class:"money"},re={style:{color:"#ff4a00"}},ue={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ce=["onClick"],ve={style:{color:"#1890ff"}},me={class:"own"},pe=z(()=>t("div",{style:{height:"8.2rem"}},null,-1)),fe={class:"order-footer"},he={class:"input-btn"},ge={class:"order-btn"},be={__name:"order",setup(y){R();const e=k({balance:0,count:0,total:0}),h=k([]),r=()=>{H().then(o=>{o.data.bank_list.forEach(i=>{i.is_check&&(a.value.merchant_bank_id=i.id)}),a.value.merchant_bank_id||(a.value.merchant_bank_id=o.data.bank_list[0].id),h.value=o.data.bank_list,e.value.balance=o.data.balance}),K().then(o=>{e.value=Object.assign(e.value,o.data)})};r();const a=k({merchant_bank_id:"",amount:""}),f=o=>{a.value.merchant_bank_id=o.id},$=()=>{if(a.value.amount=Math.floor(a.value.amount*100)/100,+a.value.amount<=0)return a.value.amount="",Y.error("提现金额必须大于0");if(+a.value.amount>+e.value.balance)return a.value.amount=e.value.balance,Y.error("提现金额不能大于余额");P(a.value).then(o=>{a.value.amount="",Y.success("提现成功,等待管理员审核"),D.emit("get-taking-lists"),r()})};return(o,i)=>{const g=m("el-input"),V=m("el-button");return s(),p("div",ee,[t("div",ae,[te,t("div",le,[t("div",ne,[oe,t("div",se,[t("span",null,v(e.value.balance),1),_("元 ")])]),t("div",ie,[t("div",de,[_("提现次数: "),t("span",null,v(e.value.count),1),_("次")]),t("div",_e,[_("累计提现到账: "),t("span",re,v(e.value.total),1),_("元")])])])]),t("div",ue,[(s(!0),p(T,null,E(h.value,(u,x)=>(s(),p("div",{class:J(["item",{"item-active":a.value.merchant_bank_id==u.id}]),key:x,onClick:c=>f(u)},[t("div",null,[_(" 提现至 "),t("span",ve,v(u.bank_name)+"("+v(u.bank_code.slice(-4))+")",1),t("span",me,v(u.is_own==1?"对公":"个人"),1)])],10,ce))),128))]),pe,t("div",fe,[t("div",he,[l(g,{modelValue:a.value.amount,"onUpdate:modelValue":i[0]||(i[0]=u=>a.value.amount=u),placeholder:"请输入提现金额",type:"number"},null,8,["modelValue"]),l(V,{class:"btn",type:"primary",onClick:i[1]||(i[1]=u=>a.value.amount=e.value.balance)},{default:d(()=>[_("全部")]),_:1})]),t("div",ge,[l(V,{class:"btn",type:"primary",onClick:$,disabled:e.value.balance<=0||h.value.length==0},{default:d(()=>[_("立即提现")]),_:1},8,["disabled"])])])])}}},ye=B(be,[["__scopeId","data-v-e01d9d71"]]),ke={class:"my-order"},we={class:"date"},Ve={class:"detail"},Ce={key:0,class:"table",":infinite-scroll-delay":500,"infinite-scroll-distance":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},Ye={key:0},$e={key:1},xe={key:1,class:"table",":infinite-scroll-delay":500,"infinite-scroll-distance":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},De={__name:"detail",setup(y){const e=k({page_no:1,page_size:15,loadend:!1,loading:!1,create_time:"",start_time:""}),h=()=>{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],f()},r=k(1),a=k([]),f=()=>{if(console.log("触底",!e.value.loadend,!e.value.loading),!e.value.loadend&&!e.value.loading&&(console.log("加载"),e.value.loading=!0,r.value==1&&Q({page_no:e.value.page_no,page_size:e.value.page_size,create_time:e.value.create_time}).then(o=>{a.value=[...a.value,...o.data.lists],o.data.lists.length<e.value.page_size&&(e.value.loadend=!0),e.value.loading=!1,e.value.page_no++}),r.value==2)){if(e.value.start_time[0]>=e.value.start_time[1])return e.value.loading=!1,Y.error("<EFBFBD>