2 lines
4.5 KiB
JavaScript
2 lines
4.5 KiB
JavaScript
import{_ as e}from"./index.1758875307304Drnfzvd7.js";import{s as a}from"./merchant.1758875307304lXd_YoVM.js";import{b2 as l,ag as t,bT as o,bm as r,c as s,e as i,m as p,w as n,l as d,n as c,t as m,g as b,al as u,bR as _}from"./index.1758875307304Bqu9OSaU.js";/* empty css */import"./el-col.1758875307304DQSijX35.js";const v={key:0,class:"cell-btn cl-2"},h={class:"cell-btn cl-2"},y={class:"cell-btn cl-2"},g={class:"cell-btn cl-2"},w={class:"blue"},f={class:"cell-btn cl-2"},F=l({__name:"merchant-bill",setup(l){const F=e=>`${Number(e).toFixed(2)}`,j=t({columns:[{prop:"id",label:"编号",width:80},{prop:"mer_name",label:"商户账号",width:100,slot:"mer_name"},{prop:"order_type",label:"订单类型",width:100,slot:"order_type"},{prop:"handle_type",label:"操作类型",width:90,slot:"handle_type"},{prop:"capital_type",label:"余额类型",width:90,slot:"capital_type"},{prop:"reason",label:"账变类型",width:160,slot:"reason"},{prop:"source",label:"来源",width:80,slot:"source"},{prop:"amount",label:"账变金额",width:90,formatter:F},{prop:"before_amount",label:"变动前金额",width:100,formatter:F},{prop:"after_amount",label:"变动后金额",width:100,formatter:F},{prop:"mer_order_sn",label:"商户订单号",width:180},{prop:"order_sn",label:"系统订单号",width:180},{prop:"remark",label:"备注"},{prop:"create_time",label:"创建时间",width:150,formatter:function(e){return _(1e3*e)}}],tableData:[],searchFields:[{label:"商户编号",type:"input",prop:"mer_id",value:""},{prop:"mer_name",label:"商户名称",type:"input",value:""},{prop:"handle_type",label:"操作类型",type:"select",value:"",options:[{label:"减少",value:1},{label:"增加",value:2}]},{prop:"capital_type",label:"余额类型",type:"select",value:"",options:[{label:"可用余额",value:1},{label:"冻结余额",value:2}]},{prop:"reason",label:"账变类型",type:"select",value:"",options:[]},{prop:"source",label:"来源",type:"select",value:"",options:[{label:"系统",value:1},{label:"人工",value:2}]},{prop:"order_type",label:"订单类型",type:"select",value:"",options:[{label:"订单",value:1},{label:"代付订单",value:2}]},{prop:"order_sn",label:"订单号",type:"input",value:""},{prop:"create_time",label:"创建时间",type:"date",dateType:"datetimerange",value:o()}],total:0,page:1,limit:10,amount:0,loading:!1,reasonList:[],reasonObj:{}}),T=()=>{j.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=o():e.value=""}),L()};r(()=>{L()});const L=()=>{var e,l,t,o,r;j.loading=!0;let s={limit:j.limit,page:j.page},i=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(j.searchFields);(null==(e=i.create_time)?void 0:e.length)>0&&(i.start_time=(null==(l=i.create_time[0])?void 0:l.getTime())?(null==(t=i.create_time[0])?void 0:t.getTime())/1e3:"",i.end_time=(null==(o=i.create_time[1])?void 0:o.getTime())?(null==(r=i.create_time[1])?void 0:r.getTime())/1e3:""),a(Object.assign(s,i)).then(e=>{j.tableData=e.list,j.total=e.total,j.amount=e.total_usable_amount,j.loading=!1,0==j.reasonList.length&&(j.reasonObj=e.reasonList,j.reasonList=Object.keys(e.reasonList).map(a=>({label:e.reasonList[a],value:a})),j.searchFields[4].options=j.reasonList)}).catch(()=>{j.loading=!1})};return(a,l)=>(i(),s("div",null,[(i(),p(e,{type:"merchant-bill",columns:b(j).columns,searchFields:b(j).searchFields,"onUpdate:searchFields":l[0]||(l[0]=e=>b(j).searchFields=e),data:b(j).tableData,limit:b(j).limit,"onUpdate:limit":l[1]||(l[1]=e=>b(j).limit=e),page:b(j).page,"onUpdate:page":l[2]||(l[2]=e=>b(j).page=e),total:b(j).total,onGetTableData:L,onResetForm:T,loading:b(j).loading,name:"merchant-bill",key:"merchant-bill"},{btns:n(()=>l[3]||(l[3]=[])),mer_name:n(({row:e})=>[d("div",null,m(`[${e.id}]${e.mer_name}`),1)]),order_type:n(({row:e})=>[0!=e.order_type?(i(),s("div",v,[d("div",{class:c(1==e.order_type?"blue":"red")},m(1==e.order_type?"订单":"代付订单"),3)])):u("",!0)]),handle_type:n(({row:e})=>[d("div",h,[d("div",{class:c(1==e.handle_type?"blue":"red")},m(1==e.handle_type?"减少":"增加"),3)])]),capital_type:n(({row:e})=>[d("div",y,[d("div",{class:c(1==e.capital_type?"blue":"red")},m(1==e.capital_type?"可用余额":"冻结余额"),3)])]),reason:n(({row:e})=>[d("div",g,[d("div",w,m(b(j).reasonObj[e.reason]),1)])]),source:n(({row:e})=>[d("div",f,[d("div",{class:c(1==e.source?"blue":"red")},m(1==e.source?"系统":"人工"),3)])]),_:1},8,["columns","searchFields","data","limit","page","total","loading"]))]))}},[["__scopeId","data-v-4a7454b9"]]);export{F as default};
|