2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
import{bo as e,a$ as a,r as t,ag as o,b4 as l,d8 as s,dk as r,dl as n,c as i,e as u,N as p,O as d,w as c,t as _,l as w,dm as m,an as h,bb as g,a7 as y,a8 as f,g as v,cb as D,aO as b,a_ as C,dn as R,dp as k,dq as F,dr as S,ds as x,dt as j}from"./index.1757051889208DRqHAyxg.js";import{_ as U}from"./index.1757051889208B27YTq0N.js";/* empty css */import{E as A}from"./el-text.1757051889208Dqvtkogw.js";import z from"./modify_deposit.1757051889208BNRbsUAE.js";import B from"./modify_deposit_log.1757051889208FkAKh7Vu.js";import M from"./single_channel_set.1757051889208BZdF6pCQ.js";import T from"./single_fee_set.1757051889208Bsjq1MWg.js";import I from"./modify_password.1757051889208DVPvzj8e.js";import P from"./clear_account.1757051889208CDRmey5b.js";import L from"./aircraft.1757051889208Bg_tvbUe.js";import V from"./user_gorup.1757051889208AQHG2jrS.js";import G from"./detail.1757051889208IzjxXudr.js";import E from"./account_total.1757051889208mQdu1rY4.js";import{b as O}from"./payee-order.1757051889208CZYFISQg.js";import{s as $}from"./staticData.17570518892088wZxkmL4.js";/* empty css */import"./el-col.1757051889208m32Fovi8.js";import"./el-card.1757051889208DQ50vU5q.js";import"./settlement_log.1757051889208BqFubGF-.js";import"./payee-count.1757051889208Cxdg3wbb.js";import"./select_channel.1757051889208CZRpt7Ro.js";import"./el-link.1757051889208D3Ew2ssK.js";import"./handle_balance.1757051889208CMhtbUdu.js";import"./freeze_balance.1757051889208BDB31r4O.js";import"./freeze_money_management.1757051889208DYBsE7DY.js";import"./freeze_balance_management.1757051889208BuNkJpXM.js";const W={class:"statistics-box"},q={style:{"font-size":"10px"}},N={style:{"font-size":"10px"}},Z=["onClick"],H={style:{"margin-top":"4px"}},J={style:{"margin-top":"4px"}},K={__name:"user-info",setup(K,{expose:Q}){e();const X=a(),Y=$.userType,ee=t([]),ae=t("日切清账,关闭通道"),te=t("warning"),oe=t("0"),le=o({sum_data:[],columns:[{prop:"shop_id",label:"商户号",align:"center",width:"100"},{prop:"username",label:"用户名",align:"center",slot:"username_slot",width:"100"},{prop:"group",label:"分组",align:"center",width:"100px",slot:"group_slot"},{prop:"",label:"预付操作",align:"center",slot:"modify_deposit_slot",width:"120"},{prop:"",label:"预付",align:"center",slot:"modify_deposit_log_slot"},{prop:"",label:"账号总额",align:"center",slot:"account_total_slot"},{prop:"",label:"通道",align:"center",slot:"channel_slot",width:"100px"},{prop:"",label:"费率",align:"center",slot:"fee_slot",width:"100px"},{prop:"",label:"状态",align:"center",slot:"status_slot"},{prop:"callback_white_ip",label:"回调IP",align:"center"},{prop:"",label:"操作",align:"center",slot:"operate_slot",width:"240"},{prop:"create_time",label:"注册时间",align:"center"},{prop:"login_time",label:"最后登录时间",align:"center",slot:"login_time_slot"}],tableData:[],searchFields:[{label:"商户号",prop:"shop_id",type:"input",value:""},{label:"用户名称",type:"input",prop:"username",value:""},{label:"用户定制类型",prop:"user_type",type:"select",value:"",options:Y},{label:"用户分组",type:"select",prop:"user_group",value:"",options:ee}],total:0,page:1,per_page:50,loading:!1,selectData:[],showAddDialog:!1,btnLoading:!1,addForm:{title:"新增用户",fields:[{label:"用户名称",prop:"username",type:"input",value:""},{label:"登录密码",prop:"password",type:"password"},{label:"登录IP白名单",prop:"login_white_ip",type:"textarea",value:""},{label:"回调IP白名单",prop:"callback_white_ip",type:"textarea",value:"",placeholder:"商户的回调IP,管理员有IP池,建议每个商户独立IP,若是包网,则改为批量,切记线下一定要记录每个商户的IP,若IP被打,则及时变更不影响其他商户用英文逗号隔开"}],rules:{},values:{username:"",name:"",user_type:"",password:"",login_white_ip:"",callback_white_ip:"",id:""}},showBatchChannel:!1,showBatchFee:!1,showWrongAccount:!1,showRepairRecord:!1,showModifyDeposit:!1,showModifyDepositLog:!1,showSingleChannelSet:!1,showSingleFeeSet:!1,showModifyPassword:!1,showClearAccount:!1,showBindAircraftDialog:!1,showUserGroupDialog:!1,showDetailDialog:!1,showTotalDetailDialog:!1,currentRow:{},freezeStatus:""}),se=(e,a)=>{let t="";return(0===a?type_options:pay_type_options).some(a=>{if(a.value===e)return t=a.label,!0}),t},re=()=>{le.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),ue()};l(async()=>{ee.value=[],(await s({})).data.forEach(e=>{ee.value.push({label:e.name,value:e.id})}),ue(),ie()}),r(()=>{clearInterval(me.value)});let ne=!1;const ie=()=>{O().then(e=>{0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(me.value),oe.value=e.system_clear_status,1==e.system_clear_status&&(te.value="danger",ae.value="日切清账中,所有支付通道已关闭",ne||(ge(),ne=!0)),2==e.system_clear_status&&(te.value="success",ae.value="日切清账完成,请手动点击开启所有通道")})};const ue=()=>{let e={limit:le.per_page,page:le.page,status:le.freezeStatus},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(le.searchFields);a.user_type?(e.private_status=1==a.user_type?1:"",e.private_pr=2==a.user_type?1:""):(e.private_status="",e.private_pr=""),delete a.user_type,n(Object.assign(e,a)).then(e=>{le.tableData=e.data,le.total=e.total,le.sum_data=e.sum_data}).catch(()=>{le.loading=!1})},pe=e=>{le.selectData=e},de=()=>{j({onoff:"on"}).then(e=>{ie(),ue(),ae.value="日切清账,关闭通道",te.value="warning",clearInterval(me.value)}).catch(()=>{})},ce=()=>{let e={username:le.addForm.values.username,name:le.addForm.values.name,user_type:le.addForm.values.user_type,password:le.addForm.values.password,login_white_ip:le.addForm.values.login_white_ip,callback_white_ip:le.addForm.values.callback_white_ip};le.addForm.values.id?(e.id=le.addForm.values.id,F(e).then(e=>{le.showAddDialog=!1,ue()})):S(e).then(e=>{le.showAddDialog=!1,ue()})},_e=(e,a)=>{C.alert("是否确定对当前用户进行状态切换?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{k({id:e.id,status:1==a?e.status:e.recharge_status,type:a}).then(e=>{b.success("修改成功!")})}).catch(()=>{1==a?e.status=1==e.status?2:1:e.recharge_status=1==e.recharge_status?2:1})},we=()=>{ue()};let me=t(null);const he=(e,a)=>{x({type:e,clear_ids:a}).then(e=>{ie(),ge(),setTimeout(()=>{ue()},1e3)})},ge=()=>{clearInterval(me.value),me.value=setInterval(()=>{ie()},1e4)};return Q({getFreezeUserList:()=>{le.page=1,le.freezeStatus=2,ue()}}),(e,a)=>{const t=h,o=A,l=g,s=m,r=U,n=D;return u(),i("div",null,[p(r,{type:"export",columns:v(le).columns,searchFields:v(le).searchFields,"onUpdate:searchFields":a[2]||(a[2]=e=>v(le).searchFields=e),data:v(le).tableData,per_page:v(le).per_page,"onUpdate:per_page":a[3]||(a[3]=e=>v(le).per_page=e),page:v(le).page,"onUpdate:page":a[4]||(a[4]=e=>v(le).page=e),total:v(le).total,onGetTableData:ue,onResetForm:re,loading:v(le).loading,showSelection:!0,selectionChange:pe,showRightRefreshSlot:!1},{btns:c(()=>[w("div",null,[p(t,{type:v(te),onClick:a[0]||(a[0]=e=>(()=>{if(1==oe.value)return b.warning("清账中,请勿重复点击");2!=oe.value?le.showClearAccount=!0:C.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{de()}).catch(()=>{})})())},{default:c(()=>[d(_(v(ae)),1)]),_:1},8,["type"]),p(t,{type:"primary",onClick:a[1]||(a[1]=e=>(le.showAddDialog=!0,le.addForm.values.id="",le.addForm.fields[0].disabled=!1,void(le.addForm.title="新增用户")))},{default:c(()=>a[17]||(a[17]=[d(" 添加用户 ")])),_:1,__:[17]})])]),count:c(({row:e})=>[w("div",W,[a[18]||(a[18]=d(" 商户数量: ")),p(o,{type:"primary"},{default:c(()=>[d(_(v(le).sum_data.shop_num),1)]),_:1}),a[19]||(a[19]=d(" 总预付: ")),p(o,{type:"primary"},{default:c(()=>[d(_(v(le).sum_data.sum_money),1)]),_:1}),a[20]||(a[20]=d(" 可结算金额:")),p(o,{type:"success"},{default:c(()=>[d(_(v(le).sum_data.money),1)]),_:1}),a[21]||(a[21]=d(" 剩余预付: ")),p(o,{type:"primary"},{default:c(()=>[d(_(v(le).sum_data.prepay_money),1)]),_:1})])]),username_slot:c(({row:e})=>[w("div",null,_(e.username),1),w("div",q,_(1==e.private_pr?"定制费率用户":""),1),w("div",N,_(1==e.private_status?"定制通道用户":""),1)]),group_slot:c(({row:e})=>[(u(!0),i(y,null,f(e.groupInfo,e=>(u(),i("div",null,_(e.name),1))),256))]),modify_deposit_log_slot:c(({row:e})=>[w("div",null,[a[22]||(a[22]=d("累计:")),p(o,{type:"success"},{default:c(()=>{var a;return[d(_((null==(a=null==e?void 0:e.account)?void 0:a.sum_money)||0),1)]}),_:2},1024)]),w("div",null,[a[23]||(a[23]=d("剩余:")),p(o,{type:"warning"},{default:c(()=>{var a;return[d(_((null==(a=null==e?void 0:e.account)?void 0:a.prepay_money)||0),1)]}),_:2},1024)])]),account_total_slot:c(({row:e})=>[w("div",{onClick:a=>(e=>{le.showTotalDetailDialog=!0,le.currentRow=e})(e)},[w("div",null,[a[24]||(a[24]=d("可结算: ")),p(o,{type:"success"},{default:c(()=>{var a;return[d(_((null==(a=null==e?void 0:e.account)?void 0:a.money)||0),1)]}),_:2},1024)]),w("div",null,[a[25]||(a[25]=d("昨日: ")),p(o,{type:"warning"},{default:c(()=>{var a;return[d(_((null==(a=null==e?void 0:e.account)?void 0:a.yesterday_money)||0),1)]}),_:2},1024)])],8,Z)]),account_type_slot:c(({row:e})=>[w("div",null,_(se(e.account_type,0)),1)]),pay_type_slot:c(({row:e})=>[w("div",null,_(se(e.pay_type,1)),1)]),modify_deposit_slot:c(({row:e})=>[w("div",null,[p(t,{type:"primary",size:"small",onClick:a=>(e=>{le.showModifyDeposit=!0,le.currentRow=e})(e)},{default:c(()=>a[26]||(a[26]=[d("加减预付")])),_:2,__:[26]},1032,["onClick"])]),w("div",H,[p(t,{type:"warning",size:"small",onClick:a=>(e=>{le.showModifyDepositLog=!0,le.currentRow=e})(e)},{default:c(()=>a[27]||(a[27]=[d("预付记录")])),_:2,__:[27]},1032,["onClick"])])]),channel_slot:c(({row:e})=>[p(t,{type:"primary",size:"small",onClick:a=>(e=>{le.showSingleChannelSet=!0,le.currentRow=e})(e)},{default:c(()=>a[28]||(a[28]=[d("通道")])),_:2,__:[28]},1032,["onClick"])]),fee_slot:c(({row:e})=>[p(t,{type:"primary",size:"small",onClick:a=>(e=>{le.showSingleFeeSet=!0,le.currentRow=e})(e)},{default:c(()=>a[29]||(a[29]=[d("费率")])),_:2,__:[29]},1032,["onClick"])]),status_slot:c(({row:e})=>[w("div",null,[a[30]||(a[30]=d("状态: ")),p(l,{onChange:a=>_e(e,1),modelValue:e.status,"onUpdate:modelValue":a=>e.status=a,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"正常","inactive-text":"冻结"},null,8,["onChange","modelValue","onUpdate:modelValue"])]),w("div",null,[a[31]||(a[31]=d("充值: ")),p(l,{onChange:a=>_e(e,2),modelValue:e.recharge_status,"onUpdate:modelValue":a=>e.recharge_status=a,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"开启","inactive-text":"关闭"},null,8,["onChange","modelValue","onUpdate:modelValue"])])]),operate_slot:c(({row:e})=>[w("div",null,[p(s,null,{default:c(()=>[p(t,{type:1==e.clear_status?"danger":"warning",size:"small",onClick:a=>(e=>"1"==e.clear_status?b.warning("清账中,请勿重复点击"):"日切清账完成,请手动点击开启所有通道"==ae.value?b.error(ae.value):void C.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{b.success("清账中"),he(3,[e.shop_id])}).catch(()=>{}))(e)},{default:c(()=>[d(_(1==e.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),p(t,{type:"primary",size:"small",onClick:a=>(e=>{le.showBindAircraftDialog=!0,le.currentRow=e})(e)},{default:c(()=>a[32]||(a[32]=[d("飞机")])),_:2,__:[32]},1032,["onClick"]),p(t,{type:"primary",size:"small",onClick:a=>(e=>{R({shop_id:e.shop_id}).then(e=>{const{access_token:a}=e;localStorage.setItem("payeraccessToken",a);const t=X.resolve({path:"/login/payer"});window.open(t.href,"_blank")})})(e)},{default:c(()=>a[33]||(a[33]=[d("登录")])),_:2,__:[33]},1032,["onClick"]),p(t,{type:"primary",size:"small",onClick:a=>(e=>{le.showDetailDialog=!0,le.currentRow=e})(e)},{default:c(()=>a[34]||(a[34]=[d("资料")])),_:2,__:[34]},1032,["onClick"])]),_:2},1024)]),w("div",J,[p(s,null,{default:c(()=>[p(t,{type:"primary",size:"small",onClick:a=>(e=>{le.showModifyPassword=!0,le.currentRow=e})(e)},{default:c(()=>a[35]||(a[35]=[d("密码")])),_:2,__:[35]},1032,["onClick"]),p(t,{type:"primary",size:"small",onClick:a=>(e=>{le.showAddDialog=!0,le.addForm.values.id=e.id,le.addForm.values.username=e.username,le.addForm.values.name=e.name,le.addForm.values.user_type=e.user_type,le.addForm.values.login_white_ip=e.login_white_ip,le.addForm.values.callback_white_ip=e.callback_white_ip,le.addForm.fields[0].disabled=!0,le.addForm.title="编辑用户"})(e)},{default:c(()=>a[36]||(a[36]=[d("编辑")])),_:2,__:[36]},1032,["onClick"]),p(t,{type:"primary",size:"small",onClick:a=>(e=>{le.showUserGroupDialog=!0,le.currentRow=e})(e)},{default:c(()=>a[37]||(a[37]=[d("分组")])),_:2,__:[37]},1032,["onClick"]),p(t,{type:"primary",size:"small",onClick:e=>{C.alert("确定删除当前用户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{b.success("删除成功!")}).catch(()=>{})}},{default:c(()=>a[38]||(a[38]=[d("删除")])),_:2,__:[38]},1032,["onClick"])]),_:2},1024)])]),login_time_slot:c(({row:e})=>[p(o,null,{default:c(()=>[d(_(null==e?void 0:e.login_time),1)]),_:2},1024)]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),p(n,{showDialog:v(le).showAddDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>v(le).showAddDialog=e),formData:v(le).addForm,"onUpdate:formData":a[6]||(a[6]=e=>v(le).addForm=e),ref:"addFormRef",labelWidth:"120px"},{submit:c(()=>[p(t,{type:"primary",loading:v(le).btnLoading,onClick:ce},{default:c(()=>a[39]||(a[39]=[d("确定")])),_:1,__:[39]},8,["loading"])]),_:1},8,["showDialog","formData"]),p(z,{showModifyDeposit:v(le).showModifyDeposit,"onUpdate:showModifyDeposit":a[7]||(a[7]=e=>v(le).showModifyDeposit=e),currentRow:v(le).currentRow},null,8,["showModifyDeposit","currentRow"]),p(B,{showModifyDepositLog:v(le).showModifyDepositLog,"onUpdate:showModifyDepositLog":a[8]||(a[8]=e=>v(le).showModifyDepositLog=e),currentRow:v(le).currentRow},null,8,["showModifyDepositLog","currentRow"]),p(M,{showSingleChannelSet:v(le).showSingleChannelSet,"onUpdate:showSingleChannelSet":a[9]||(a[9]=e=>v(le).showSingleChannelSet=e),currentRow:v(le).currentRow},null,8,["showSingleChannelSet","currentRow"]),p(T,{showSingleFeeSet:v(le).showSingleFeeSet,"onUpdate:showSingleFeeSet":a[10]||(a[10]=e=>v(le).showSingleFeeSet=e),currentRow:v(le).currentRow},null,8,["showSingleFeeSet","currentRow"]),p(I,{showModifyPassword:v(le).showModifyPassword,"onUpdate:showModifyPassword":a[11]||(a[11]=e=>v(le).showModifyPassword=e),currentRow:v(le).currentRow},null,8,["showModifyPassword","currentRow"]),p(P,{showClearAccount:v(le).showClearAccount,"onUpdate:showClearAccount":a[12]||(a[12]=e=>v(le).showClearAccount=e),onClearAccount:he},null,8,["showClearAccount"]),p(L,{showBindAircraftDialog:v(le).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[13]||(a[13]=e=>v(le).showBindAircraftDialog=e),currentRow:v(le).currentRow},null,8,["showBindAircraftDialog","currentRow"]),p(V,{showUserGroupDialog:v(le).showUserGroupDialog,"onUpdate:showUserGroupDialog":a[14]||(a[14]=e=>v(le).showUserGroupDialog=e),currentRow:v(le).currentRow,onRefreshLoad:we},null,8,["showUserGroupDialog","currentRow"]),p(G,{showDetailDialog:v(le).showDetailDialog,"onUpdate:showDetailDialog":a[15]||(a[15]=e=>v(le).showDetailDialog=e),currentRow:v(le).currentRow},null,8,["showDetailDialog","currentRow"]),p(E,{showTotalDetailDialog:v(le).showTotalDetailDialog,"onUpdate:showTotalDetailDialog":a[16]||(a[16]=e=>v(le).showTotalDetailDialog=e),currentRow:v(le).currentRow},null,8,["showTotalDetailDialog","currentRow"]),a[40]||(a[40]=d('" '))])}}};export{K as default};
|