sf_web_dist/js/deposit-channels-set.BbWMyXIJ.js
2025-08-01 18:29:50 +08:00

2 lines
9.8 KiB
JavaScript

import{b2 as e,bs as o,r as a,ag as l,b4 as n,bQ as t,c as s,e as r,N as i,w as p,l as h,d8 as c,an as u,O as d,al as m,t as w,bb as _,g as C,c8 as g,aO as b}from"./index.BFaMmrdh.js";import{_ as y}from"./index.xeBmeYqo.js";/* empty css */import f from"./add-channel.PDJcaGtV.js";import R from"./channel-code.CP_baGBp.js";import k from"./single_fee.BS_X5FYE.js";import v from"./test_channel.DKcacH2d.js";import F from"./fee-risk.BAUfwbh0.js";import D from"./copy-channel.C6xN-Osk.js";import S from"./sub-channel.BDJlmzD1.js";import j from"./channel-fee.BJ4o1TO2.js";import U from"./channel-risk.uPFhXuKH.js";import{a as x,e as A,b as V}from"./payee-channel.DLl77Mmv.js";import{g as z}from"./payee-suppiler.CRsotqwB.js";import{s as B}from"./staticData.Bf5zg7ho.js";/* empty css */import"./el-col.BSUex2-D.js";import"./el-text.d-rFxsty.js";import"./el-link.BfP8HzjV.js";import"./el-time-select.Bv1tNhFE.js";import"./el-card.DF-g7L2j.js";import"./sub-channel-add.uCBOtCCC.js";import"./sub-channel-fee.Ch4DocBC.js";import"./sub-channel-risk.DsUXMAtg.js";const O={key:0},T={key:1},$={class:"operate-btn"},E=e({__name:"deposit-channels-set",props:{currentRow:{type:Object,default:{}}},setup(e,{expose:E}){o({legacy:!0});let I=a([]);const N=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}),P=()=>{N.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),q()};n(()=>{q(),H()});const q=()=>{var e,o;N.loading=!0;let a={limit:N.per_page,page:N.page},l=function(e){const o={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(o[e.prop]=e.value)}),o}(N.searchFields);(null==(e=l.created_at)?void 0:e.length)>0&&(l.created_at_start=l.created_at[0]?t(l.created_at[0]):"",l.created_at_end=l.created_at[1]?t(l.created_at[1]):""),(null==(o=l.completed_at)?void 0:o.length)>0&&(l.completed_at_start=l.completed_at[0]?t(l.completed_at[0]):"",l.completed_at_end=l.completed_at[1]?t(l.completed_at[1]):""),x(Object.assign(a,l)).then(e=>{N.tableData=e.data,N.total=e.total,N.loading=!1}).catch(()=>{N.loading=!1})},G=()=>{N.showBatchSettingDialog=!0},L=()=>{N.showBatchSettingDialog=!1},M=()=>{N.showRiskControlDialog=!0},Q=e=>{N.showAddChannel=!0,N.currentRow=e},W=e=>{e.id?A(e).then(e=>{q(),b.success("修改成功"),N.showAddChannel=!1}):V(e).then(e=>{q(),b.success("添加成功"),N.showAddChannel=!1,N.showCopyChannel=!1})},H=()=>{z({saiType:"all"}).then(e=>{I.value=[],e.forEach(e=>{I.value.push({label:e.supplier_name,value:e.shop_id})}),N.searchFields[1].options=I.value})};return E({filterChannel:e=>{N.searchFields[1].value=e.shop_id,q()}}),(e,o)=>{const a=u,l=_,n=c,t=y,b=g;return r(),s("div",null,[i(t,{type:"export",columns:C(N).columns,searchFields:C(N).searchFields,"onUpdate:searchFields":o[2]||(o[2]=e=>C(N).searchFields=e),data:C(N).tableData,per_page:C(N).per_page,"onUpdate:per_page":o[3]||(o[3]=e=>C(N).per_page=e),page:C(N).page,"onUpdate:page":o[4]||(o[4]=e=>C(N).page=e),total:C(N).total,onGetTableData:q,onResetForm:P,loading:C(N).loading,showSelection:!1,showRightRefreshSlot:!1},{btns:p(({row:e})=>[i(a,{type:"primary",onClick:G},{default:p(()=>o[19]||(o[19]=[d("批量开启/关闭")])),_:1,__:[19]}),i(a,{type:"primary",onClick:M},{default:p(()=>o[20]||(o[20]=[d("风控实况")])),_:1,__:[20]}),i(a,{type:"primary",onClick:o[0]||(o[0]=e=>Q({}))},{default:p(()=>o[21]||(o[21]=[d("添加渠道")])),_:1,__:[21]}),i(a,{type:"primary",onClick:o[1]||(o[1]=e=>{N.showChannelCode=!0})},{default:p(()=>o[22]||(o[22]=[d("添加渠道编码")])),_:1,__:[22]})]),shop_name_slot:p(({row:e})=>{var o;return[h("div",null,w(null==(o=C(I).find(o=>o.value==e.shop_id))?void 0:o.label),1)]}),run_num_slot:p(({row:e})=>[h("div",null,w(`${e.succ_num?e.succ_num:0}/${e.num?e.num:0}`),1),h("div",null,w(`${e.pay_succ_money?e.pay_succ_money:0}/${e.pay_money?e.pay_money:0}`),1)]),success_rate_slot:p(({row:e})=>[d(w((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:p(({row:e})=>[i(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:p(({row:e})=>[e.min_money?(r(),s("div",O,w(e.min_money)+"~"+w(e.max_money),1)):m("",!0),e.not_allow_money?(r(),s("div",T,w(e.not_allow_money),1)):m("",!0)]),operate_slot:p(({row:l})=>[h("div",$,[i(n,{style:{"margin-bottom":"4px"}},{default:p(()=>[i(a,{type:"primary",onClick:e=>(e=>{N.showSubChannel=!0,N.currentRow=e})(l),size:"small"},{default:p(()=>o[23]||(o[23]=[d("子账号")])),_:2,__:[23]},1032,["onClick"]),i(a,{type:"primary",onClick:e=>(e=>{N.showChannelFee=!0,N.currentRow=e})(l),size:"small"},{default:p(()=>o[24]||(o[24]=[d("费率")])),_:2,__:[24]},1032,["onClick"]),i(a,{type:"primary",onClick:e=>(e=>{N.showChannelRisk=!0,N.currentRow=e})(l),size:"small"},{default:p(()=>o[25]||(o[25]=[d("风控")])),_:2,__:[25]},1032,["onClick"]),i(a,{type:"primary",onClick:e=>Q(l),size:"small"},{default:p(()=>o[26]||(o[26]=[d("编辑")])),_:2,__:[26]},1032,["onClick"]),i(a,{type:"primary",onClick:e=>(e=>{N.channelVisible=!0,N.currentRow=e})(l),size:"small"},{default:p(()=>o[27]||(o[27]=[d("测试渠道")])),_:2,__:[27]},1032,["onClick"])]),_:2},1024),i(n,null,{default:p(()=>[i(a,{type:"primary",onClick:e=>(e=>{N.showCopyChannel=!0,N.currentRow=e})(l),size:"small"},{default:p(()=>o[28]||(o[28]=[d("复制渠道")])),_:2,__:[28]},1032,["onClick"]),i(a,{type:"primary",onClick:o=>e.handleDelete(l),size:"small"},{default:p(()=>o[29]||(o[29]=[d("删除")])),_:2,__:[29]},1032,["onClick"])]),_:2},1024)])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),i(b,{showDialog:C(N).showBatchSettingDialog,"onUpdate:showDialog":o[5]||(o[5]=e=>C(N).showBatchSettingDialog=e),formData:C(N).batchSetting,"onUpdate:formData":o[6]||(o[6]=e=>C(N).batchSetting=e),ref:"productRef"},{submit:p(()=>[i(a,{type:"primary",onClick:L},{default:p(()=>o[30]||(o[30]=[d("确定")])),_:1,__:[30]})]),_:1},8,["showDialog","formData"]),i(b,{showDialog:C(N).showRiskControlDialog,"onUpdate:showDialog":o[8]||(o[8]=e=>C(N).showRiskControlDialog=e),formData:C(N).riskControl,"onUpdate:formData":o[9]||(o[9]=e=>C(N).riskControl=e),ref:"productRef",dialogWidth:"900px"},{otherInfo:p(()=>[i(t,{type:"export",columns:C(N).riskControlColumns,searchFields:C(N).riskControlSearchFields,"onUpdate:searchFields":o[7]||(o[7]=e=>C(N).riskControlSearchFields=e),data:C(N).riskControlData,loading:C(N).loading,showSelection:!1,showRightRefreshSlot:!1},null,8,["columns","searchFields","data","loading"])]),_:1},8,["showDialog","formData"]),i(f,{showAddChannel:C(N).showAddChannel,"onUpdate:showAddChannel":o[10]||(o[10]=e=>C(N).showAddChannel=e),onConfirmAddChannel:W,currentRow:C(N).currentRow},null,8,["showAddChannel","currentRow"]),i(k,{showSingleFee:C(N).showSingleFee,"onUpdate:showSingleFee":o[11]||(o[11]=e=>C(N).showSingleFee=e),currentRow:C(N).currentRow},null,8,["showSingleFee","currentRow"]),i(v,{channelVisible:C(N).channelVisible,"onUpdate:channelVisible":o[12]||(o[12]=e=>C(N).channelVisible=e),currentRow:C(N).currentRow},null,8,["channelVisible","currentRow"]),i(F,{showFeeRisk:C(N).showFeeRisk,"onUpdate:showFeeRisk":o[13]||(o[13]=e=>C(N).showFeeRisk=e),currentRow:C(N).currentRow},null,8,["showFeeRisk","currentRow"]),i(D,{showCopyChannel:C(N).showCopyChannel,"onUpdate:showCopyChannel":o[14]||(o[14]=e=>C(N).showCopyChannel=e),currentRow:C(N).currentRow,onConfirmAddChannel:W},null,8,["showCopyChannel","currentRow"]),i(S,{showSubChannel:C(N).showSubChannel,"onUpdate:showSubChannel":o[15]||(o[15]=e=>C(N).showSubChannel=e),currentRow:C(N).currentRow},null,8,["showSubChannel","currentRow"]),i(j,{showChannelFee:C(N).showChannelFee,"onUpdate:showChannelFee":o[16]||(o[16]=e=>C(N).showChannelFee=e),currentRow:C(N).currentRow},null,8,["showChannelFee","currentRow"]),i(U,{showChannelRisk:C(N).showChannelRisk,"onUpdate:showChannelRisk":o[17]||(o[17]=e=>C(N).showChannelRisk=e),currentRow:C(N).currentRow},null,8,["showChannelRisk","currentRow"]),i(R,{showChannelCode:C(N).showChannelCode,"onUpdate:showChannelCode":o[18]||(o[18]=e=>C(N).showChannelCode=e)},null,8,["showChannelCode"])])}}},[["__scopeId","data-v-cdcc15a1"]]);export{E as default};