sf_web_dist/js/deposit-channels-set.CnfqhZK5.js
2025-08-11 16:53:49 +08:00

2 lines
10 KiB
JavaScript

import{b2 as e,bt as o,r as l,ag as a,b4 as t,bQ as n,aZ as s,c as r,e as i,N as p,w as h,l as c,d8 as d,an as u,O as m,m as _,al as w,t as C,E as g,ce as y,bb as b,g as f,c8 as k,aO as R}from"./index.BbWNJA3u.js";import{_ as v}from"./index.BGlQrNQO.js";/* empty css */import{E as F}from"./el-text.BqQoSb1f.js";import D from"./add-channel.B5a7LnBZ.js";import S from"./channel-code.ChqYzNzb.js";import j from"./single_fee.KQw4Bo03.js";import U from"./test_channel.BRdmtySm.js";import x from"./fee-risk.voGetltB.js";import V from"./copy-channel.q3LTfRNr.js";import A from"./sub-channel.OW1FnVPe.js";import z from"./channel-fee.DUy74m87.js";import E from"./channel-risk.sJRVEfyC.js";import{g as B,d as O,e as T,f as $}from"./payee-channel.DejSFHmk.js";import{g as I}from"./payee-suppiler.BkM07qHt.js";import{s as q}from"./staticData.8wZxkmL4.js";/* empty css */import"./el-col.DFkN-DyX.js";import"./el-link.D74svpjD.js";import"./el-time-select.BLMMptNC.js";import"./el-card.CX1x8dSX.js";import"./sub-channel-add.CjkstU31.js";import"./sub-channel-fee.yE-Uj3C8.js";import"./sub-channel-risk.D7fU1Zby.js";const N={key:0},P={key:1},W={class:"operate-btn"},G=e({__name:"deposit-channels-set",props:{currentRow:{type:Object,default:{}}},setup(e,{expose:G}){o({legacy:!0});let Q=l([]);const X=a({columns:[{prop:"id",label:"ID",align:"center",width:"80"},{prop:"shop_id",label:"供应商编码",align:"center"},{prop:"shop_id",label:"供应商名称",align:"center",slot:"shop_name_slot"},{prop:"name",label:"渠道名称",align:"center"},{prop:"code",label:"渠道代码",align:"center"},{prop:"",label:"跑量",align:"center",slot:"run_num_slot",sortable:"custom"},{prop:"",label:"成功率",align:"center",slot:"success_rate_slot",sortable:"custom"},{prop:"status",label:"接口状态",align:"center",slot:"status_slot"},{prop:"pr",label:"费率",align:"center",slot:"pr_slot"},{prop:"limit",label:"风控限额",align:"center",slot:"limit_slot"},{prop:"notify_time",label:"操作",slot:"operate_slot",width:"280px"}],tableData:[],searchFields:[{label:"渠道名称",prop:"name",type:"input",value:""},{label:"供应商",prop:"shop_id",type:"select",options:Q.value,value:""},{label:"是否开启",type:"select",prop:"notify_status",value:"",options:q.status}],total:0,page:1,per_page:10,loading:!1,showBatchSettingDialog:!1,batchSetting:{title:"批量设置",fields:[{label:"设置",type:"radio",prop:"status",options:[{label:"开启",value:1},{label:"关闭",value:0}]}],rules:{status:[{required:!0,message:"请选择设置",trigger:"blur"}]},values:{status:""}},showRiskControlDialog:!1,riskControl:{title:"风控实况",fields:[],rules:{},values:{}},riskControlColumns:[{label:"通道名称/子账号",prop:"channelName"},{label:"交易时间",prop:"channelCode"},{label:"今天交易金额/可交易金额",prop:"status"},{label:"上线请款",prop:"description"}],riskControlSearchFields:[],riskControlData:[],showAddChannel:!1,batchSettingType:"1",showProduct:!1,productData:{},currentRow:{},channelVisible:!1,showFeeRisk:!1,showCopyChannel:!1,showSubChannel:!1,showChannelCode:!1}),Y=()=>{X.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),Z()};t(()=>{Z(),ee()});const Z=()=>{var e,o;X.loading=!0;let l={limit:X.per_page,page:X.page},a=function(e){const o={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(o[e.prop]=e.value)}),o}(X.searchFields);(null==(e=a.created_at)?void 0:e.length)>0&&(a.created_at_start=a.created_at[0]?n(a.created_at[0]):"",a.created_at_end=a.created_at[1]?n(a.created_at[1]):""),(null==(o=a.completed_at)?void 0:o.length)>0&&(a.completed_at_start=a.completed_at[0]?n(a.completed_at[0]):"",a.completed_at_end=a.completed_at[1]?n(a.completed_at[1]):""),B(Object.assign(l,a)).then(e=>{X.tableData=e.data,X.total=e.total,X.loading=!1}).catch(()=>{X.loading=!1})},H=()=>{X.showBatchSettingDialog=!0},J=()=>{X.showBatchSettingDialog=!1},K=()=>{X.showRiskControlDialog=!0},L=e=>{X.showAddChannel=!0,X.currentRow=e},M=e=>{e.id?T(e).then(e=>{Z(),R.success("修改成功"),X.showAddChannel=!1}):$(e).then(e=>{Z(),R.success("添加成功"),X.showAddChannel=!1,X.showCopyChannel=!1})},ee=()=>{I({saiType:"all"}).then(e=>{Q.value=[],e.forEach(e=>{Q.value.push({label:e.supplier_name,value:e.shop_id})}),X.searchFields[1].options=Q.value})};return G({filterChannel:e=>{X.searchFields[1].value=e.shop_id,Z()}}),(e,o)=>{const l=u,a=b,t=F,n=s("EditPen"),R=g,B=y,T=d,$=v,I=k;return i(),r("div",null,[p($,{type:"export",columns:f(X).columns,searchFields:f(X).searchFields,"onUpdate:searchFields":o[1]||(o[1]=e=>f(X).searchFields=e),data:f(X).tableData,per_page:f(X).per_page,"onUpdate:per_page":o[2]||(o[2]=e=>f(X).per_page=e),page:f(X).page,"onUpdate:page":o[3]||(o[3]=e=>f(X).page=e),total:f(X).total,onGetTableData:Z,onResetForm:Y,loading:f(X).loading,showSelection:!1,showRightRefreshSlot:!1},{btns:h(({row:e})=>[p(l,{type:"primary",onClick:H},{default:h(()=>o[18]||(o[18]=[m("批量开启/关闭")])),_:1,__:[18]}),p(l,{type:"primary",onClick:K},{default:h(()=>o[19]||(o[19]=[m("风控实况")])),_:1,__:[19]}),p(l,{type:"primary",onClick:o[0]||(o[0]=e=>L({}))},{default:h(()=>o[20]||(o[20]=[m("添加渠道")])),_:1,__:[20]})]),shop_name_slot:h(({row:e})=>{var o;return[c("div",null,C(null==(o=f(Q).find(o=>o.value==e.shop_id))?void 0:o.label),1)]}),run_num_slot:h(({row:e})=>[c("div",null,C(`${e.succ_num?e.succ_num:0}/${e.num?e.num:0}`),1),c("div",null,C(`${e.pay_succ_money?e.pay_succ_money:0}/${e.pay_money?e.pay_money:0}`),1)]),success_rate_slot:h(({row:e})=>[m(C((null==e?void 0:e.num)&&(null==e?void 0:e.succ_num)?((null==e?void 0:e.succ_num)/(null==e?void 0:e.num)*100).toFixed(2):0)+"% ",1)]),status_slot:h(({row:e})=>[p(a,{modelValue:e.status,"onUpdate:modelValue":o=>e.status=o,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"正常","inactive-text":"停用",onChange:o=>(e=>{O({id:e.id,status:e.status})})(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),limit_slot:h(({row:e})=>[e.min_money?(i(),r("div",N,C(e.min_money)+"~"+C(e.max_money),1)):w("",!0),e.not_allow_money?(i(),r("div",P,C(e.not_allow_money),1)):w("",!0)]),pr_slot:h(({row:e})=>[e.edit?w("",!0):(i(),_(t,{key:0},{default:h(()=>[m(C(e.pr),1)]),_:2},1024)),e.edit?w("",!0):(i(),_(t,{key:1,type:"primary",onClick:o=>e.edit=!0},{default:h(()=>[p(R,null,{default:h(()=>[p(n)]),_:1})]),_:2},1032,["onClick"])),e.edit?(i(),_(B,{key:2,modelValue:e.pr,"onUpdate:modelValue":o=>e.pr=o,type:"number",controls:!1,placeholder:"请输入",style:{width:"80px"}},null,8,["modelValue","onUpdate:modelValue"])):w("",!0),e.edit?(i(),_(l,{key:3,type:"primary",style:{"margin-left":"4px"},size:"small",onClick:o=>(e=>{e.edit=!1})(e)},{default:h(()=>o[21]||(o[21]=[m("保存")])),_:2,__:[21]},1032,["onClick"])):w("",!0)]),operate_slot:h(({row:a})=>[c("div",W,[p(T,{style:{"margin-bottom":"4px"}},{default:h(()=>[p(l,{type:"primary",onClick:e=>(e=>{X.showSubChannel=!0,X.currentRow=e})(a),size:"small"},{default:h(()=>o[22]||(o[22]=[m("子账号")])),_:2,__:[22]},1032,["onClick"]),p(l,{type:"primary",onClick:e=>(e=>{X.showChannelRisk=!0,X.currentRow=e})(a),size:"small"},{default:h(()=>o[23]||(o[23]=[m("风控")])),_:2,__:[23]},1032,["onClick"]),p(l,{type:"primary",onClick:e=>L(a),size:"small"},{default:h(()=>o[24]||(o[24]=[m("编辑")])),_:2,__:[24]},1032,["onClick"])]),_:2},1024),p(T,null,{default:h(()=>[p(l,{type:"primary",onClick:e=>(e=>{X.channelVisible=!0,X.currentRow=e})(a),size:"small"},{default:h(()=>o[25]||(o[25]=[m("测试渠道")])),_:2,__:[25]},1032,["onClick"]),p(l,{type:"primary",onClick:e=>(e=>{X.showCopyChannel=!0,X.currentRow=e})(a),size:"small"},{default:h(()=>o[26]||(o[26]=[m("复制渠道")])),_:2,__:[26]},1032,["onClick"]),p(l,{type:"primary",onClick:o=>e.handleDelete(a),size:"small"},{default:h(()=>o[27]||(o[27]=[m("删除")])),_:2,__:[27]},1032,["onClick"])]),_:2},1024)])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),p(I,{showDialog:f(X).showBatchSettingDialog,"onUpdate:showDialog":o[4]||(o[4]=e=>f(X).showBatchSettingDialog=e),formData:f(X).batchSetting,"onUpdate:formData":o[5]||(o[5]=e=>f(X).batchSetting=e),ref:"productRef"},{submit:h(()=>[p(l,{type:"primary",onClick:J},{default:h(()=>o[28]||(o[28]=[m("确定")])),_:1,__:[28]})]),_:1},8,["showDialog","formData"]),p(I,{showDialog:f(X).showRiskControlDialog,"onUpdate:showDialog":o[7]||(o[7]=e=>f(X).showRiskControlDialog=e),formData:f(X).riskControl,"onUpdate:formData":o[8]||(o[8]=e=>f(X).riskControl=e),ref:"productRef",dialogWidth:"900px"},{otherInfo:h(()=>[p($,{type:"export",columns:f(X).riskControlColumns,searchFields:f(X).riskControlSearchFields,"onUpdate:searchFields":o[6]||(o[6]=e=>f(X).riskControlSearchFields=e),data:f(X).riskControlData,loading:f(X).loading,showSelection:!1,showRightRefreshSlot:!1},null,8,["columns","searchFields","data","loading"])]),_:1},8,["showDialog","formData"]),p(D,{showAddChannel:f(X).showAddChannel,"onUpdate:showAddChannel":o[9]||(o[9]=e=>f(X).showAddChannel=e),onConfirmAddChannel:M,currentRow:f(X).currentRow},null,8,["showAddChannel","currentRow"]),p(j,{showSingleFee:f(X).showSingleFee,"onUpdate:showSingleFee":o[10]||(o[10]=e=>f(X).showSingleFee=e),currentRow:f(X).currentRow},null,8,["showSingleFee","currentRow"]),p(U,{channelVisible:f(X).channelVisible,"onUpdate:channelVisible":o[11]||(o[11]=e=>f(X).channelVisible=e),currentRow:f(X).currentRow},null,8,["channelVisible","currentRow"]),p(x,{showFeeRisk:f(X).showFeeRisk,"onUpdate:showFeeRisk":o[12]||(o[12]=e=>f(X).showFeeRisk=e),currentRow:f(X).currentRow},null,8,["showFeeRisk","currentRow"]),p(V,{showCopyChannel:f(X).showCopyChannel,"onUpdate:showCopyChannel":o[13]||(o[13]=e=>f(X).showCopyChannel=e),currentRow:f(X).currentRow,onConfirmAddChannel:M},null,8,["showCopyChannel","currentRow"]),p(A,{showSubChannel:f(X).showSubChannel,"onUpdate:showSubChannel":o[14]||(o[14]=e=>f(X).showSubChannel=e),currentRow:f(X).currentRow},null,8,["showSubChannel","currentRow"]),p(z,{showChannelFee:f(X).showChannelFee,"onUpdate:showChannelFee":o[15]||(o[15]=e=>f(X).showChannelFee=e),currentRow:f(X).currentRow},null,8,["showChannelFee","currentRow"]),p(E,{showChannelRisk:f(X).showChannelRisk,"onUpdate:showChannelRisk":o[16]||(o[16]=e=>f(X).showChannelRisk=e),currentRow:f(X).currentRow},null,8,["showChannelRisk","currentRow"]),p(S,{showChannelCode:f(X).showChannelCode,"onUpdate:showChannelCode":o[17]||(o[17]=e=>f(X).showChannelCode=e)},null,8,["showChannelCode"])])}}},[["__scopeId","data-v-a65ef55a"]]);export{G as default};