2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
import{bo as e,a$ as a,r as o,ag as t,b4 as l,d6 as s,dj as r,dk as n,c as i,e as u,N as p,O as d,w as c,t as _,l as w,dl as m,an as h,bb as g,g as y,a7 as f,a8 as v,c9 as D,aO as b,a_ as C,dm as R,dn as k,dp as F,dq as S,dr as j,ds as x}from"./index.1757572449837Cu_lKLCH.js";import{_ as U}from"./index.1757572449837DqyYy1dn.js";/* empty css */import{E as A}from"./el-text.1757572449837CC58clkr.js";import z from"./modify_deposit.1757572449837Dv8svMN8.js";import B from"./modify_deposit_log.1757572449837BNnsGgv0.js";import M from"./single_channel_set.1757572449837B9ZAF50q.js";import T from"./single_fee_set.1757572449837CU_XwWCe.js";import I from"./modify_password.1757572449837CVAn3QDe.js";import P from"./clear_account.1757572449837C9K3qFc9.js";import L from"./aircraft.1757572449837BV053AD7.js";import V from"./user_gorup.1757572449837D6O0ilm1.js";import G from"./detail.1757572449837D_yXwmMy.js";import E from"./account_total.1757572449837NUCbAt2N.js";import{b as O}from"./payee-order.1757572449837BfFSsZpJ.js";import{s as $}from"./staticData.17575724498378wZxkmL4.js";import{p as W}from"./common.1757572449837CCwWzMi9.js";/* empty css */import"./el-col.1757572449837Dq9OPBTw.js";import"./el-card.1757572449837ut6uYbKT.js";import"./settlement_log.1757572449837CNm8Rtnb.js";import"./payee-count.1757572449837BQfAlo73.js";import"./lodash.1757572449837C4Q-35yT.js";import"./select_channel.1757572449837fIchIPBL.js";import"./el-link.1757572449837DYvlqGNm.js";import"./handle_balance.1757572449837BA-yMJiU.js";import"./freeze_balance.1757572449837B3HYgpeM.js";import"./freeze_money_management.1757572449837DYjw30Ie.js";import"./freeze_balance_management.1757572449837CGq83JwQ.js";const q={class:"statistics-box"},N={style:{"font-size":"10px"}},Z={style:{"font-size":"10px"}},H=["onClick"],J={style:{"margin-top":"4px"}},K={style:{"margin-top":"4px"}},Q={__name:"user-info",setup(Q,{expose:X}){e();const Y=a(),ee=$.userType,ae=o([]),oe=o("日切清账,关闭通道"),te=o("warning"),le=o("0"),se=t({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:ee},{label:"用户分组",type:"select",prop:"user_group",value:"",options:ae}],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:""}),re=(e,a)=>{let o="";return(0===a?type_options:pay_type_options).some(a=>{if(a.value===e)return o=a.label,!0}),o},ne=()=>{se.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),pe()};l(async()=>{ae.value=[],(await s({})).data.forEach(e=>{ae.value.push({label:e.name,value:e.id})}),pe(),ue()}),r(()=>{clearInterval(he.value)});let ie=!1;const ue=()=>{O().then(e=>{0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(he.value),le.value=e.system_clear_status,1==e.system_clear_status&&(te.value="danger",oe.value="日切清账中,所有支付通道已关闭",ie||(ye(),ie=!0)),2==e.system_clear_status&&(te.value="success",oe.value="日切清账完成,请手动点击开启所有通道")})};const pe=()=>{let e={limit:se.per_page,page:se.page,status:se.freezeStatus},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(se.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=>{se.tableData=e.data,se.total=e.total,se.sum_data=e.sum_data}).catch(()=>{se.loading=!1})},de=e=>{se.selectData=e},ce=()=>{x({onoff:"on"}).then(e=>{ue(),pe(),oe.value="日切清账,关闭通道",te.value="warning",clearInterval(he.value)}).catch(()=>{})},_e=()=>{let e={username:se.addForm.values.username,name:se.addForm.values.name,user_type:se.addForm.values.user_type,password:se.addForm.values.password,login_white_ip:se.addForm.values.login_white_ip,callback_white_ip:se.addForm.values.callback_white_ip};se.addForm.values.id?(e.id=se.addForm.values.id,F(e).then(e=>{se.showAddDialog=!1,pe()})):S(e).then(e=>{se.showAddDialog=!1,pe()})},we=(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})},me=()=>{pe()};let he=o(null);const ge=(e,a)=>{j({type:e,clear_ids:a}).then(e=>{ue(),ye(),setTimeout(()=>{pe()},1e3)})},ye=()=>{clearInterval(he.value),he.value=setInterval(()=>{ue()},1e4)};return X({getFreezeUserList:()=>{se.page=1,se.freezeStatus=2,pe()}}),(e,a)=>{const o=h,t=A,l=g,s=m,r=U,n=D;return u(),i("div",null,[p(r,{type:"export",columns:y(se).columns,searchFields:y(se).searchFields,"onUpdate:searchFields":a[2]||(a[2]=e=>y(se).searchFields=e),data:y(se).tableData,per_page:y(se).per_page,"onUpdate:per_page":a[3]||(a[3]=e=>y(se).per_page=e),page:y(se).page,"onUpdate:page":a[4]||(a[4]=e=>y(se).page=e),total:y(se).total,onGetTableData:pe,onResetForm:ne,loading:y(se).loading,showSelection:!0,selectionChange:de,showRightRefreshSlot:!1},{btns:c(()=>[w("div",null,[p(o,{type:y(te),onClick:a[0]||(a[0]=e=>(()=>{if(1==le.value)return b.warning("清账中,请勿重复点击");2!=le.value?se.showClearAccount=!0:C.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{ce()}).catch(()=>{})})())},{default:c(()=>[d(_(y(oe)),1)]),_:1},8,["type"]),p(o,{type:"primary",onClick:a[1]||(a[1]=e=>(se.showAddDialog=!0,se.addForm.values.id="",se.addForm.fields[0].disabled=!1,void(se.addForm.title="新增用户")))},{default:c(()=>a[17]||(a[17]=[d(" 添加用户 ")])),_:1,__:[17]})])]),count:c(({row:e})=>[w("div",q,[a[18]||(a[18]=d(" 商户数量: ")),p(t,{type:"primary"},{default:c(()=>[d(_(y(se).sum_data.shop_num),1)]),_:1}),a[19]||(a[19]=d(" 总预付: ")),p(t,{type:"primary"},{default:c(()=>[d(_(y(W)(y(se).sum_data.sum_money)),1)]),_:1}),a[20]||(a[20]=d(" 可结算金额:")),p(t,{type:"success"},{default:c(()=>[d(_(y(W)(y(se).sum_data.money)),1)]),_:1}),a[21]||(a[21]=d(" 剩余预付: ")),p(t,{type:"primary"},{default:c(()=>[d(_(y(W)(y(se).sum_data.prepay_money)),1)]),_:1})])]),username_slot:c(({row:e})=>[w("div",null,_(e.username),1),w("div",N,_(1==e.private_pr?"定制费率用户":""),1),w("div",Z,_(1==e.private_status?"定制通道用户":""),1)]),group_slot:c(({row:e})=>[(u(!0),i(f,null,v(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(t,{type:"success"},{default:c(()=>{var a;return[d(_(y(W)(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(t,{type:"warning"},{default:c(()=>{var a;return[d(_(y(W)(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=>{se.showTotalDetailDialog=!0,se.currentRow=e})(e)},[w("div",null,[a[24]||(a[24]=d("可结算: ")),p(t,{type:"success"},{default:c(()=>{var a;return[d(_(y(W)(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(t,{type:"warning"},{default:c(()=>{var a;return[d(_(y(W)(null==(a=null==e?void 0:e.account)?void 0:a.yesterday_money)||0),1)]}),_:2},1024)])],8,H)]),account_type_slot:c(({row:e})=>[w("div",null,_(re(e.account_type,0)),1)]),pay_type_slot:c(({row:e})=>[w("div",null,_(re(e.pay_type,1)),1)]),modify_deposit_slot:c(({row:e})=>[w("div",null,[p(o,{type:"primary",size:"small",onClick:a=>(e=>{se.showModifyDeposit=!0,se.currentRow=e})(e)},{default:c(()=>a[26]||(a[26]=[d("加减预付")])),_:2,__:[26]},1032,["onClick"])]),w("div",J,[p(o,{type:"warning",size:"small",onClick:a=>(e=>{se.showModifyDepositLog=!0,se.currentRow=e})(e)},{default:c(()=>a[27]||(a[27]=[d("预付记录")])),_:2,__:[27]},1032,["onClick"])])]),channel_slot:c(({row:e})=>[p(o,{type:"primary",size:"small",onClick:a=>(e=>{se.showSingleChannelSet=!0,se.currentRow=e})(e)},{default:c(()=>a[28]||(a[28]=[d("通道")])),_:2,__:[28]},1032,["onClick"])]),fee_slot:c(({row:e})=>[p(o,{type:"primary",size:"small",onClick:a=>(e=>{se.showSingleFeeSet=!0,se.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=>we(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=>we(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(o,{type:1==e.clear_status?"danger":"warning",size:"small",onClick:a=>(e=>"1"==e.clear_status?b.warning("清账中,请勿重复点击"):"日切清账完成,请手动点击开启所有通道"==oe.value?b.error(oe.value):void C.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{b.success("清账中"),ge(3,[e.shop_id])}).catch(()=>{}))(e)},{default:c(()=>[d(_(1==e.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{se.showBindAircraftDialog=!0,se.currentRow=e})(e)},{default:c(()=>a[32]||(a[32]=[d("飞机")])),_:2,__:[32]},1032,["onClick"]),p(o,{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 o=Y.resolve({path:"/login/payer"});window.open(o.href,"_blank")})})(e)},{default:c(()=>a[33]||(a[33]=[d("登录")])),_:2,__:[33]},1032,["onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{se.showDetailDialog=!0,se.currentRow=e})(e)},{default:c(()=>a[34]||(a[34]=[d("资料")])),_:2,__:[34]},1032,["onClick"])]),_:2},1024)]),w("div",K,[p(s,null,{default:c(()=>[p(o,{type:"primary",size:"small",onClick:a=>(e=>{se.showModifyPassword=!0,se.currentRow=e})(e)},{default:c(()=>a[35]||(a[35]=[d("密码")])),_:2,__:[35]},1032,["onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{se.showAddDialog=!0,se.addForm.values.id=e.id,se.addForm.values.username=e.username,se.addForm.values.name=e.name,se.addForm.values.user_type=e.user_type,se.addForm.values.login_white_ip=e.login_white_ip,se.addForm.values.callback_white_ip=e.callback_white_ip,se.addForm.fields[0].disabled=!0,se.addForm.title="编辑用户"})(e)},{default:c(()=>a[36]||(a[36]=[d("编辑")])),_:2,__:[36]},1032,["onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{se.showUserGroupDialog=!0,se.currentRow=e})(e)},{default:c(()=>a[37]||(a[37]=[d("分组")])),_:2,__:[37]},1032,["onClick"]),p(o,{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(t,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:y(se).showAddDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>y(se).showAddDialog=e),formData:y(se).addForm,"onUpdate:formData":a[6]||(a[6]=e=>y(se).addForm=e),ref:"addFormRef",labelWidth:"120px"},{submit:c(()=>[p(o,{type:"primary",loading:y(se).btnLoading,onClick:_e},{default:c(()=>a[39]||(a[39]=[d("确定")])),_:1,__:[39]},8,["loading"])]),_:1},8,["showDialog","formData"]),p(z,{showModifyDeposit:y(se).showModifyDeposit,"onUpdate:showModifyDeposit":a[7]||(a[7]=e=>y(se).showModifyDeposit=e),currentRow:y(se).currentRow},null,8,["showModifyDeposit","currentRow"]),p(B,{showModifyDepositLog:y(se).showModifyDepositLog,"onUpdate:showModifyDepositLog":a[8]||(a[8]=e=>y(se).showModifyDepositLog=e),currentRow:y(se).currentRow},null,8,["showModifyDepositLog","currentRow"]),p(M,{showSingleChannelSet:y(se).showSingleChannelSet,"onUpdate:showSingleChannelSet":a[9]||(a[9]=e=>y(se).showSingleChannelSet=e),currentRow:y(se).currentRow},null,8,["showSingleChannelSet","currentRow"]),p(T,{showSingleFeeSet:y(se).showSingleFeeSet,"onUpdate:showSingleFeeSet":a[10]||(a[10]=e=>y(se).showSingleFeeSet=e),currentRow:y(se).currentRow},null,8,["showSingleFeeSet","currentRow"]),p(I,{showModifyPassword:y(se).showModifyPassword,"onUpdate:showModifyPassword":a[11]||(a[11]=e=>y(se).showModifyPassword=e),currentRow:y(se).currentRow},null,8,["showModifyPassword","currentRow"]),p(P,{showClearAccount:y(se).showClearAccount,"onUpdate:showClearAccount":a[12]||(a[12]=e=>y(se).showClearAccount=e),onClearAccount:ge},null,8,["showClearAccount"]),p(L,{showBindAircraftDialog:y(se).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[13]||(a[13]=e=>y(se).showBindAircraftDialog=e),currentRow:y(se).currentRow,onRefreshLoad:me},null,8,["showBindAircraftDialog","currentRow"]),p(V,{showUserGroupDialog:y(se).showUserGroupDialog,"onUpdate:showUserGroupDialog":a[14]||(a[14]=e=>y(se).showUserGroupDialog=e),currentRow:y(se).currentRow,onRefreshLoad:me},null,8,["showUserGroupDialog","currentRow"]),p(G,{showDetailDialog:y(se).showDetailDialog,"onUpdate:showDetailDialog":a[15]||(a[15]=e=>y(se).showDetailDialog=e),currentRow:y(se).currentRow},null,8,["showDetailDialog","currentRow"]),p(E,{showTotalDetailDialog:y(se).showTotalDetailDialog,"onUpdate:showTotalDetailDialog":a[16]||(a[16]=e=>y(se).showTotalDetailDialog=e),currentRow:y(se).currentRow},null,8,["showTotalDetailDialog","currentRow"]),a[40]||(a[40]=d('" '))])}}};export{Q as default};
|