cashier-mer/build/assets/index-DvxbA7Cs.js

2 lines
7.9 KiB
JavaScript

import{K as V,_ as B,u as j,r as y,b as p,c as s,k as f,e as t,t as m,g as d,F as E,l as F,z as q,f as l,w as r,E as $,m as D,q as J,s as K,o as W,a as G,h as N,d as k,p as w,j as U}from"./index-eNDFCmNV.js";import{h as T}from"./moment-Cl4UOzQZ.js";import{p as H}from"./padding-DXLLhlux.js";function P(){return V.get("/merchant/Merchant/amount_account")}function Q(u){return V.get("/merchant/Merchant/taking_lists",{params:u})}function X(){return V.get("/merchant/Merchant/taking_info")}function Z(u){return V.post("/merchant/Merchant/withdraw",u)}function ee(u){return V.get("/financial/FinancialRecord/api_lists",{params:u})}const z=u=>(J("data-v-e01d9d71"),u=u(),K(),u),ae={class:"my-order"},te={class:"header-nav"},le=z(()=>t("div",{class:"nav-item"},m("提现"),-1)),ne={class:"nav-body"},oe={class:"my-money"},se=z(()=>t("div",null,"我的余额:",-1)),ie={style:{"text-align":"center",color:"#2ec479"}},re={class:"my-count"},de={class:"count"},ue={class:"money"},ce={style:{color:"#ff4a00"}},_e={class:"order-lists","infinite-scroll-distance":300,"infinite-scroll-delay":500,style:{overflow:"auto"}},ve=["onClick"],me={style:{color:"#1890ff"}},pe={class:"own"},fe=z(()=>t("div",{style:{height:"8.2rem"}},null,-1)),he={class:"order-footer"},ge={class:"input-btn"},be={class:"order-btn"},ke={__name:"order",setup(u){j();const e=y({balance:0,count:0,total:0}),g=y([]),c=()=>{P().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),g.value=o.data.bank_list,e.value.balance=o.data.balance}),X().then(o=>{e.value=Object.assign(e.value,o.data)})};c();const a=y({merchant_bank_id:"",amount:""}),h=o=>{a.value.merchant_bank_id=o.id},x=()=>{if(a.value.amount=Math.floor(a.value.amount*100)/100,+a.value.amount<=0)return a.value.amount="",$.error("提现金额必须大于0");if(+a.value.amount>+e.value.balance)return a.value.amount=e.value.balance,$.error("提现金额不能大于余额");Z(a.value).then(o=>{a.value.amount="",$.success("提现成功,等待管理员审核"),D.emit("get-taking-lists"),c()})};return(o,i)=>{const b=p("el-input"),M=p("el-button");return s(),f("div",ae,[t("div",te,[le,t("div",ne,[t("div",oe,[se,t("div",ie,[t("span",null,m(e.value.balance),1),d("元 ")])]),t("div",re,[t("div",de,[d("提现次数: "),t("span",null,m(e.value.count),1),d("次")]),t("div",ue,[d("累计提现到账: "),t("span",ce,m(e.value.total),1),d("元")])])])]),t("div",_e,[(s(!0),f(E,null,F(g.value,(_,C)=>(s(),f("div",{class:q(["item",{"item-active":a.value.merchant_bank_id==_.id}]),key:C,onClick:v=>h(_)},[t("div",null,[d(" 提现至 "),t("span",me,m(_.bank_name)+"("+m(_.bank_code.slice(-4))+")",1),t("span",pe,m(_.is_own==1?"对公":"个人"),1)])],10,ve))),128))]),fe,t("div",he,[t("div",ge,[l(b,{modelValue:a.value.amount,"onUpdate:modelValue":i[0]||(i[0]=_=>a.value.amount=_),placeholder:"请输入提现金额",type:"number"},null,8,["modelValue"]),l(M,{class:"btn",type:"primary",onClick:i[1]||(i[1]=_=>a.value.amount=e.value.balance)},{default:r(()=>[d("全部")]),_:1})]),t("div",be,[l(M,{class:"btn",type:"primary",onClick:x,disabled:e.value.balance<=0||g.value.length==0},{default:r(()=>[d("立即提现")]),_:1},8,["disabled"])])])])}}},ye=B(ke,[["__scopeId","data-v-e01d9d71"]]),we={class:"my-order"},Ve={class:"date"},Me={class:"detail"},Ye={key:0,class:"table",":infinite-scroll-delay":500,"infinite-scroll-distance":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},$e={key:0},xe={key:1},Ce={key:1,class:"table",":infinite-scroll-delay":500,"infinite-scroll-distance":300,style:{overflow:"auto"},"infinite-scroll-immediate":!1},De={__name:"detail",setup(u){const e=y({page_no:1,page_size:15,loadend:!1,loading:!1,create_time:"",start_time:""}),g=()=>{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()},c=y(1),a=y([]),h=()=>{if(console.log("触底",!e.value.loadend,!e.value.loading),!e.value.loadend&&!e.value.loading&&(console.log("加载"),e.value.loading=!0,c.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++}),c.value==2)){if(e.value.start_time[0]>=e.value.start_time[1])return e.value.loading=!1,$.error("开始时间不能大于等于结束时间");let o=e.value.start_time[0]?T(e.value.start_time[0]).format("YYYY-MM-DD"):"",i=e.value.start_time[1]?T(e.value.start_time[1]).format("YYYY-MM-DD"):"";ee({page_no:e.value.page_no,page_size:e.value.page_size,start_time:o,end_time:i}).then(b=>{a.value=[...a.value,...b.data.lists],b.data.lists.length<e.value.page_size&&(e.value.loadend=!0),e.value.loading=!1,e.value.page_no++})}};h();const x=()=>{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()};return W(()=>{D.on("get-taking-lists",o=>{e.value.page_no=1,e.value.loadend=!1,e.value.loading=!1,a.value=[],h()})}),G(()=>{D.off("get-taking-lists")}),(o,i)=>{const b=p("el-date-picker"),M=p("el-button"),_=p("el-radio-button"),C=p("el-radio-group"),v=p("el-table-column"),O=p("el-image"),Y=p("el-tag"),I=p("el-table"),S=N("loading"),A=N("infinite-scroll");return s(),f("div",we,[t("div",Ve,[t("div",null,[c.value==1?(s(),k(b,{key:0,modelValue:e.value.create_time,"onUpdate:modelValue":i[0]||(i[0]=n=>e.value.create_time=n),type:"month",placeholder:"请选择月份",onChange:g,clearable:!1},null,8,["modelValue"])):w("",!0),c.value==2?(s(),k(b,{key:1,modelValue:e.value.start_time,"onUpdate:modelValue":i[1]||(i[1]=n=>e.value.start_time=n),type:"daterange",placeholder:"请选择日期",onChange:g,format:"YYYY-MM-DD",clearable:!1},null,8,["modelValue"])):w("",!0),l(M,{type:"primary",style:{"margin-left":"1rem"}},{default:r(()=>[d("重置")]),_:1})]),l(C,{modelValue:c.value,"onUpdate:modelValue":i[2]||(i[2]=n=>c.value=n),onChange:x},{default:r(()=>[l(_,{label:"提现记录",value:1}),l(_,{label:"余额明细",value:2})]),_:1},8,["modelValue"])]),t("div",Me,[c.value==1?U((s(),f("div",Ye,[l(I,{data:a.value},{default:r(()=>[l(v,{prop:"merchant_bank_info.is_own",label:"账户类型",width:"100"},{default:r(({row:n})=>[t("div",null,m(n.merchant_bank_info.is_own?"对公账户":"个人账户"),1)]),_:1}),l(v,{prop:"price",label:"银行卡"},{default:r(({row:n})=>[t("div",null,m(n.merchant_bank_info.bank_info.name)+" ("+m(n.merchant_bank_info.bank_code.slice(-4))+") ",1)]),_:1}),l(v,{prop:"amount",label:"提现金额",width:"150"}),l(v,{label:"备注/凭证",width:"200"},{default:r(({row:n})=>[n.arrival_proof?(s(),f("div",$e,[(s(!0),f(E,null,F(JSON.parse(n.arrival_proof),(R,L)=>(s(),k(O,{style:{width:"3rem",height:"3rem","margin-right":"0.2rem"},key:L,src:R,"preview-src-list":JSON.parse(n.arrival_proof),"initial-index":L},null,8,["src","preview-src-list","initial-index"]))),128))])):(s(),f("div",xe,m(n.fail_msg),1))]),_:1}),l(v,{label:"提现状态",width:"100"},{default:r(({row:n})=>[n.arrival_proof?(s(),k(Y,{key:0,type:"success"},{default:r(()=>[d("已到账")]),_:1})):n.is_check==1?(s(),k(Y,{key:1,type:"primary"},{default:r(()=>[d("待转账")]),_:1})):n.is_check==0?(s(),k(Y,{key:2,type:"info"},{default:r(()=>[d("待审核")]),_:1})):n.is_check==2?(s(),k(Y,{key:3,type:"danger"},{default:r(()=>[d("提现失败")]),_:1})):w("",!0)]),_:1}),l(v,{prop:"create_time",label:"提现时间",width:"200"})]),_:1},8,["data"])])),[[S,e.value.loading],[A,h]]):w("",!0),c.value==2?U((s(),f("div",Ce,[l(I,{data:a.value},{default:r(()=>[l(v,{prop:"number_sn",label:"订单号",width:"250"}),l(v,{prop:"number",label:"变动金额",width:"180"}),l(v,{prop:"financial_type",label:"变动类型",width:"180"}),l(v,{prop:"create_time",label:"时间"})]),_:1},8,["data"])])),[[S,e.value.loading],[A,h]]):w("",!0)])])}}},ze=B(De,[["__scopeId","data-v-b27fe34a"]]),Ie={class:"my-card"},Ne={__name:"index",setup(u){return(e,g)=>(s(),f("div",Ie,[l(ye,{style:{"flex-shrink":"0"},ref:"orderRef"},null,512),l(H),l(ze,{ref:"detailRef"},null,512)]))}};export{Ne as default};