sf_web_dist/js/deposit-channels-set.CroaTUVT.js
2025-08-01 16:47:19 +08:00

2 lines
9.9 KiB
JavaScript

import{b2 as e,bs as o,r as a,ag as l,D as n,b4 as t,bQ as s,c as r,e as i,N as p,w as c,l as h,d8 as u,an as d,O as m,al as w,t as _,bb as C,g,c8 as b,aO as y}from"./index.DJNSIh0Y.js";import{_ as f}from"./index.DVTSUScJ.js";/* empty css */import R from"./add-channel.OepEdR-v.js";import k from"./channel-code.Bot5w-in.js";import v from"./single_fee.mw3gPz2u.js";import F from"./test_channel.DlMr_dLj.js";import D from"./fee-risk.2fOF-ykh.js";import S from"./copy-channel.B3grhyTL.js";import j from"./sub-channel.DyHpu2T8.js";import U from"./channel-fee.IivFqIJb.js";import x from"./channel-risk.DbKeuFf6.js";import{a as A,e as V,b as z}from"./payee-channel.BEuboKA7.js";import{g as O}from"./payee-suppiler.DJDs-dP6.js";import{s as B}from"./staticData.Bf5zg7ho.js";/* empty css */import"./el-col.COnh3ypM.js";import"./el-text.DyHgK1aZ.js";import"./el-link.qTcJVLmq.js";import"./el-time-select.DzaqoecV.js";import"./el-card.COoDLYBs.js";import"./sub-channel-add.D3t_OQAi.js";import"./sub-channel-fee.COq3jTQ8.js";import"./sub-channel-risk.C7Jkhqhd.js";const N={key:0},T={key:1},$={class:"operate-btn"},E=e({__name:"deposit-channels-set",props:{currentRow:{type:Object,default:{}}},setup(e){o({legacy:!0});const E=e;let I=a([]);const P=l({columns:[{prop:"id",label:"ID",align:"center"},{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"},{prop:"limit",label:"风控限额",align:"center",slot:"limit_slot"},{prop:"notify_time",label:"操作",slot:"operate_slot",width:"400px"}],tableData:[],searchFields:[{label:"渠道名称",prop:"name",type:"input",value:""},{label:"供应商",prop:"shop_id",type:"select",options:I.value,value:""},{label:"是否开启",type:"select",prop:"notify_status",value:"",options:B.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}),q=()=>{P.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),G()};n(()=>E.currentRow,e=>{"{}"!=JSON.stringify(E.currentRow)&&(P.searchFields[1].value=E.currentRow.shop_id,G())}),t(()=>{G(),H()});const G=()=>{var e,o;P.loading=!0;let a={per_page:P.per_page,page:P.page},l=function(e){const o={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(o[e.prop]=e.value)}),o}(P.searchFields);(null==(e=l.created_at)?void 0:e.length)>0&&(l.created_at_start=l.created_at[0]?s(l.created_at[0]):"",l.created_at_end=l.created_at[1]?s(l.created_at[1]):""),(null==(o=l.completed_at)?void 0:o.length)>0&&(l.completed_at_start=l.completed_at[0]?s(l.completed_at[0]):"",l.completed_at_end=l.completed_at[1]?s(l.completed_at[1]):""),A(Object.assign(a,l)).then(e=>{P.tableData=e.data,P.total=e.total,P.loading=!1}).catch(()=>{P.loading=!1})},J=()=>{P.showBatchSettingDialog=!0},L=()=>{P.showBatchSettingDialog=!1},M=()=>{P.showRiskControlDialog=!0},Q=e=>{P.showAddChannel=!0,P.currentRow=e},W=e=>{e.id?V(e).then(e=>{G(),y.success("修改成功"),P.showAddChannel=!1}):z(e).then(e=>{G(),y.success("添加成功"),P.showAddChannel=!1,P.showCopyChannel=!1})},H=()=>{O({saiType:"all"}).then(e=>{I.value=[],e.forEach(e=>{I.value.push({label:e.supplier_name,value:e.shop_id})}),P.searchFields[1].options=I.value})};return(e,o)=>{const a=d,l=C,n=u,t=f,s=b;return i(),r("div",null,[p(t,{type:"export",columns:g(P).columns,searchFields:g(P).searchFields,"onUpdate:searchFields":o[2]||(o[2]=e=>g(P).searchFields=e),data:g(P).tableData,per_page:g(P).per_page,"onUpdate:per_page":o[3]||(o[3]=e=>g(P).per_page=e),page:g(P).page,"onUpdate:page":o[4]||(o[4]=e=>g(P).page=e),total:g(P).total,onGetTableData:G,onResetForm:q,loading:g(P).loading,showSelection:!1,showRightRefreshSlot:!1},{btns:c(({row:e})=>[p(a,{type:"primary",onClick:J},{default:c(()=>o[19]||(o[19]=[m("批量开启/关闭")])),_:1,__:[19]}),p(a,{type:"primary",onClick:M},{default:c(()=>o[20]||(o[20]=[m("风控实况")])),_:1,__:[20]}),p(a,{type:"primary",onClick:o[0]||(o[0]=e=>Q({}))},{default:c(()=>o[21]||(o[21]=[m("添加渠道")])),_:1,__:[21]}),p(a,{type:"primary",onClick:o[1]||(o[1]=e=>{P.showChannelCode=!0})},{default:c(()=>o[22]||(o[22]=[m("添加渠道编码")])),_:1,__:[22]})]),shop_name_slot:c(({row:e})=>{var o;return[h("div",null,_(null==(o=g(I).find(o=>o.value==e.shop_id))?void 0:o.label),1)]}),run_num_slot:c(({row:e})=>[h("div",null,_(`${e.succ_num?e.succ_num:0}/${e.num?e.num:0}`),1),h("div",null,_(`${e.pay_succ_money?e.pay_succ_money:0}/${e.pay_money?e.pay_money:0}`),1)]),success_rate_slot:c(({row:e})=>[m(_((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:c(({row:e})=>[p(l,{modelValue:e.status,"onUpdate:modelValue":o=>e.status=o,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"正常","inactive-text":"停用"},null,8,["modelValue","onUpdate:modelValue"])]),limit_slot:c(({row:e})=>[e.min_money?(i(),r("div",N,_(e.min_money)+"~"+_(e.max_money),1)):w("",!0),e.not_allow_money?(i(),r("div",T,_(e.not_allow_money),1)):w("",!0)]),operate_slot:c(({row:l})=>[h("div",$,[p(n,{style:{"margin-bottom":"4px"}},{default:c(()=>[p(a,{type:"primary",onClick:e=>(e=>{P.showSubChannel=!0,P.currentRow=e})(l),size:"small"},{default:c(()=>o[23]||(o[23]=[m("子账号")])),_:2,__:[23]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>(e=>{P.showChannelFee=!0,P.currentRow=e})(l),size:"small"},{default:c(()=>o[24]||(o[24]=[m("费率")])),_:2,__:[24]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>(e=>{P.showChannelRisk=!0,P.currentRow=e})(l),size:"small"},{default:c(()=>o[25]||(o[25]=[m("风控")])),_:2,__:[25]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>Q(l),size:"small"},{default:c(()=>o[26]||(o[26]=[m("编辑")])),_:2,__:[26]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>(e=>{P.channelVisible=!0,P.currentRow=e})(l),size:"small"},{default:c(()=>o[27]||(o[27]=[m("测试通道")])),_:2,__:[27]},1032,["onClick"])]),_:2},1024),p(n,null,{default:c(()=>[p(a,{type:"primary",onClick:e=>(e=>{P.showCopyChannel=!0,P.currentRow=e})(l),size:"small"},{default:c(()=>o[28]||(o[28]=[m("复制通道")])),_:2,__:[28]},1032,["onClick"]),p(a,{type:"primary",onClick:o=>e.handleDelete(l),size:"small"},{default:c(()=>o[29]||(o[29]=[m("删除")])),_:2,__:[29]},1032,["onClick"])]),_:2},1024)])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),p(s,{showDialog:g(P).showBatchSettingDialog,"onUpdate:showDialog":o[5]||(o[5]=e=>g(P).showBatchSettingDialog=e),formData:g(P).batchSetting,"onUpdate:formData":o[6]||(o[6]=e=>g(P).batchSetting=e),ref:"productRef"},{submit:c(()=>[p(a,{type:"primary",onClick:L},{default:c(()=>o[30]||(o[30]=[m("确定")])),_:1,__:[30]})]),_:1},8,["showDialog","formData"]),p(s,{showDialog:g(P).showRiskControlDialog,"onUpdate:showDialog":o[8]||(o[8]=e=>g(P).showRiskControlDialog=e),formData:g(P).riskControl,"onUpdate:formData":o[9]||(o[9]=e=>g(P).riskControl=e),ref:"productRef",dialogWidth:"900px"},{otherInfo:c(()=>[p(t,{type:"export",columns:g(P).riskControlColumns,searchFields:g(P).riskControlSearchFields,"onUpdate:searchFields":o[7]||(o[7]=e=>g(P).riskControlSearchFields=e),data:g(P).riskControlData,loading:g(P).loading,showSelection:!1,showRightRefreshSlot:!1},null,8,["columns","searchFields","data","loading"])]),_:1},8,["showDialog","formData"]),p(R,{showAddChannel:g(P).showAddChannel,"onUpdate:showAddChannel":o[10]||(o[10]=e=>g(P).showAddChannel=e),onConfirmAddChannel:W,currentRow:g(P).currentRow},null,8,["showAddChannel","currentRow"]),p(v,{showSingleFee:g(P).showSingleFee,"onUpdate:showSingleFee":o[11]||(o[11]=e=>g(P).showSingleFee=e),currentRow:g(P).currentRow},null,8,["showSingleFee","currentRow"]),p(F,{channelVisible:g(P).channelVisible,"onUpdate:channelVisible":o[12]||(o[12]=e=>g(P).channelVisible=e),currentRow:g(P).currentRow},null,8,["channelVisible","currentRow"]),p(D,{showFeeRisk:g(P).showFeeRisk,"onUpdate:showFeeRisk":o[13]||(o[13]=e=>g(P).showFeeRisk=e),currentRow:g(P).currentRow},null,8,["showFeeRisk","currentRow"]),p(S,{showCopyChannel:g(P).showCopyChannel,"onUpdate:showCopyChannel":o[14]||(o[14]=e=>g(P).showCopyChannel=e),currentRow:g(P).currentRow,onConfirmAddChannel:W},null,8,["showCopyChannel","currentRow"]),p(j,{showSubChannel:g(P).showSubChannel,"onUpdate:showSubChannel":o[15]||(o[15]=e=>g(P).showSubChannel=e),currentRow:g(P).currentRow},null,8,["showSubChannel","currentRow"]),p(U,{showChannelFee:g(P).showChannelFee,"onUpdate:showChannelFee":o[16]||(o[16]=e=>g(P).showChannelFee=e),currentRow:g(P).currentRow},null,8,["showChannelFee","currentRow"]),p(x,{showChannelRisk:g(P).showChannelRisk,"onUpdate:showChannelRisk":o[17]||(o[17]=e=>g(P).showChannelRisk=e),currentRow:g(P).currentRow},null,8,["showChannelRisk","currentRow"]),p(k,{showChannelCode:g(P).showChannelCode,"onUpdate:showChannelCode":o[18]||(o[18]=e=>g(P).showChannelCode=e)},null,8,["showChannelCode"])])}}},[["__scopeId","data-v-6e3b11ad"]]);export{E as default};