sf_web_dist/js/deposit-channels-set.B2drx7lc.js
2025-08-19 16:39:02 +08:00

2 lines
12 KiB
JavaScript

import{b2 as e,bs as t,r as a,ag as o,b4 as l,bQ as n,aZ 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,m as w,al as _,t as C,E as g,ce as y,bb as f,g as b,c8 as k,a_ as R,aO as v}from"./index.mTcqLH5d.js";import{_ as F}from"./index.CTCMwBhz.js";/* empty css */import{E as D}from"./el-text.BOCiS2r2.js";import S from"./add-channel.Dg1b_8sT.js";import j from"./channel-code.B0JxWMnH.js";import x from"./single_fee.5QHBaAnn.js";import U from"./test_channel.D1YCwDkO.js";import B from"./fee-risk.D5ZuET9F.js";import T from"./copy-channel.BhJJNURT.js";import V from"./sub-channel.da_FwOgH.js";import A from"./channel-fee.BJV5zH-r.js";import z from"./channel-risk.SHcA2-P0.js";import{g as E,e as O,d as $,f as P}from"./payee-channel.DjKE5cIY.js";import{g as I}from"./payee-suppiler.B0nQhxL5.js";import{s as L}from"./staticData.8wZxkmL4.js";/* empty css */import"./el-col.h7Ynt187.js";import"./el-link.D4RIheNc.js";import"./el-time-select.BCTni2SV.js";import"./el-card.CGSkZ7Ta.js";import"./sub-channel-add.x5cLnl8K.js";import"./sub-channel-fee.CFby-wBY.js";import"./sub-channel-risk.BouV2_OR.js";const N={key:0},q={key:1},H={key:2},M={class:"operate-btn"},W=e({__name:"deposit-channels-set",props:{currentRow:{type:Object,default:{}}},setup(e,{expose:W}){t({legacy:!0});let G=a([]);const J=o({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:G.value,value:""},{label:"是否开启",type:"select",prop:"notify_status",value:"",options:L.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=()=>{J.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),X()};l(()=>{X(),ae()});const X=()=>{var e,t;J.loading=!0;let a={limit:J.per_page,page:J.page},o=function(e){const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t}(J.searchFields);(null==(e=o.created_at)?void 0:e.length)>0&&(o.created_at_start=o.created_at[0]?n(o.created_at[0]):"",o.created_at_end=o.created_at[1]?n(o.created_at[1]):""),(null==(t=o.completed_at)?void 0:t.length)>0&&(o.completed_at_start=o.completed_at[0]?n(o.completed_at[0]):"",o.completed_at_end=o.completed_at[1]?n(o.completed_at[1]):""),E(Object.assign(a,o)).then(e=>{J.tableData=e.data,J.total=e.total,J.loading=!1}).catch(()=>{J.loading=!1})},Y=()=>{J.showBatchSettingDialog=!0},Z=()=>{J.showBatchSettingDialog=!1},K=()=>{J.showRiskControlDialog=!0},ee=e=>{J.showAddChannel=!0,J.currentRow=e},te=e=>{e.id?O(e).then(e=>{X(),v.success("修改成功"),J.showAddChannel=!1}):P(e).then(e=>{X(),v.success("添加成功"),J.showAddChannel=!1,J.showCopyChannel=!1})},ae=()=>{I({saiType:"all"}).then(e=>{G.value=[],e.forEach(e=>{G.value.push({label:e.supplier_name,value:e.shop_id})}),J.searchFields[1].options=G.value})};return W({filterChannel:e=>{J.searchFields[1].value=e.shop_id,X()}}),(e,t)=>{const a=d,o=f,l=D,n=s("EditPen"),v=g,E=y,P=u,I=F,L=k;return i(),r("div",null,[p(I,{type:"export",columns:b(J).columns,searchFields:b(J).searchFields,"onUpdate:searchFields":t[1]||(t[1]=e=>b(J).searchFields=e),data:b(J).tableData,per_page:b(J).per_page,"onUpdate:per_page":t[2]||(t[2]=e=>b(J).per_page=e),page:b(J).page,"onUpdate:page":t[3]||(t[3]=e=>b(J).page=e),total:b(J).total,onGetTableData:X,onResetForm:Q,loading:b(J).loading,showSelection:!1,showRightRefreshSlot:!1},{btns:c(({row:e})=>[p(a,{type:"primary",onClick:Y},{default:c(()=>t[18]||(t[18]=[m("批量开启/关闭")])),_:1,__:[18]}),p(a,{type:"primary",onClick:K},{default:c(()=>t[19]||(t[19]=[m("风控实况")])),_:1,__:[19]}),p(a,{type:"primary",onClick:t[0]||(t[0]=e=>ee({}))},{default:c(()=>t[20]||(t[20]=[m("添加渠道")])),_:1,__:[20]})]),shop_name_slot:c(({row:e})=>{var t;return[h("div",null,C(null==(t=b(G).find(t=>t.value==e.shop_id))?void 0:t.label),1)]}),run_num_slot:c(({row:e})=>[h("div",null,C(`${e.succ_num?e.succ_num:0}/${e.num?e.num:0}`),1),h("div",null,C(`${e.pay_succ_money?e.pay_succ_money:0}/${e.pay_money?e.pay_money:0}`),1)]),success_rate_slot:c(({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:c(({row:e})=>[p(o,{modelValue:e.status,"onUpdate:modelValue":t=>e.status=t,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"正常","inactive-text":"停用",onChange:t=>(e=>{let t=[];e.payProduct.forEach(a=>{e.pr-a.pr>0&&t.push(a.name)}),t.length>0&&1==e.status?R({title:"提示",message:`<span style="color: red">通道[${t.join(",")}]费率小于渠道成本</span>`,confirmButtonText:"我已知晓",cancelButtonText:"取消",showCancelButton:!0,type:"warning",dangerouslyUseHTMLString:!0}).then(()=>{R.alert("确定修改渠道状态吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{$({id:e.id,status:e.status})}).catch(()=>{e.status=1==e.status?2:1})}).catch(()=>{e.status=1==e.status?2:1}):R.alert("确定修改渠道状态吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{$({id:e.id,status:e.status})}).catch(()=>{e.status=1==e.status?2:1})})(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),limit_slot:c(({row:e})=>[2==e.money_type?(i(),r("div",N,"区间:"+C(e.min_money)+"~"+C(e.max_money),1)):_("",!0),1==e.money_type?(i(),r("div",q,"固定:"+C(JSON.parse(e.allow_money).join(",")),1)):_("",!0),e.not_allow_money?(i(),r("div",H,"限额:"+C(e.not_allow_money),1)):_("",!0)]),pr_slot:c(({row:e})=>[e.edit?_("",!0):(i(),w(l,{key:0},{default:c(()=>[m(C(e.pr),1)]),_:2},1024)),e.edit?_("",!0):(i(),w(l,{key:1,type:"primary",onClick:t=>e.edit=!0},{default:c(()=>[p(v,null,{default:c(()=>[p(n)]),_:1})]),_:2},1032,["onClick"])),e.edit?(i(),w(E,{key:2,modelValue:e.pr,"onUpdate:modelValue":t=>e.pr=t,type:"number",controls:!1,placeholder:"请输入",style:{width:"80px"}},null,8,["modelValue","onUpdate:modelValue"])):_("",!0),e.edit?(i(),w(a,{key:3,type:"primary",style:{"margin-left":"4px"},size:"small",onClick:t=>(e=>{e.edit=!1;let t=[],a={id:e.id,pr:e.pr,name:e.name,gateway:e.gateway,status:e.status,code:e.code};e.payProduct.forEach(a=>{e.pr-a.pr>0&&t.push(a.name)}),t.length>0?R({title:"提示",message:`<span style="color: red">通道[${t.join(",")}]费率小于渠道成本</span>`,confirmButtonText:"我已知晓",cancelButtonText:"取消",showCancelButton:!0,type:"warning",dangerouslyUseHTMLString:!0}).then(()=>{R.alert("确定修改渠道费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{O(a).then(e=>{X()})}).catch(()=>{e.edit=!1})}).catch(()=>{e.edit=!1}):R.alert("确定修改渠道费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{O(a).then(e=>{X()})}).catch(()=>{e.edit=!1})})(e)},{default:c(()=>t[21]||(t[21]=[m("保存")])),_:2,__:[21]},1032,["onClick"])):_("",!0)]),operate_slot:c(({row:o})=>[h("div",M,[p(P,{style:{"margin-bottom":"4px"}},{default:c(()=>[p(a,{type:"primary",onClick:e=>(e=>{J.showSubChannel=!0,J.currentRow=e})(o),size:"small"},{default:c(()=>t[22]||(t[22]=[m("子账号")])),_:2,__:[22]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>(e=>{J.showChannelRisk=!0,J.currentRow=e})(o),size:"small"},{default:c(()=>t[23]||(t[23]=[m("风控")])),_:2,__:[23]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>ee(o),size:"small"},{default:c(()=>t[24]||(t[24]=[m("编辑")])),_:2,__:[24]},1032,["onClick"])]),_:2},1024),p(P,null,{default:c(()=>[p(a,{type:"primary",onClick:e=>(e=>{J.channelVisible=!0,J.currentRow=e})(o),size:"small"},{default:c(()=>t[25]||(t[25]=[m("测试渠道")])),_:2,__:[25]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>(e=>{J.showCopyChannel=!0,J.currentRow=e})(o),size:"small"},{default:c(()=>t[26]||(t[26]=[m("复制渠道")])),_:2,__:[26]},1032,["onClick"]),p(a,{type:"primary",onClick:t=>e.handleDelete(o),size:"small"},{default:c(()=>t[27]||(t[27]=[m("删除")])),_:2,__:[27]},1032,["onClick"])]),_:2},1024)])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),p(L,{showDialog:b(J).showBatchSettingDialog,"onUpdate:showDialog":t[4]||(t[4]=e=>b(J).showBatchSettingDialog=e),formData:b(J).batchSetting,"onUpdate:formData":t[5]||(t[5]=e=>b(J).batchSetting=e),ref:"productRef"},{submit:c(()=>[p(a,{type:"primary",onClick:Z},{default:c(()=>t[28]||(t[28]=[m("确定")])),_:1,__:[28]})]),_:1},8,["showDialog","formData"]),p(L,{showDialog:b(J).showRiskControlDialog,"onUpdate:showDialog":t[7]||(t[7]=e=>b(J).showRiskControlDialog=e),formData:b(J).riskControl,"onUpdate:formData":t[8]||(t[8]=e=>b(J).riskControl=e),ref:"productRef",dialogWidth:"900px"},{otherInfo:c(()=>[p(I,{type:"export",columns:b(J).riskControlColumns,searchFields:b(J).riskControlSearchFields,"onUpdate:searchFields":t[6]||(t[6]=e=>b(J).riskControlSearchFields=e),data:b(J).riskControlData,loading:b(J).loading,showSelection:!1,showRightRefreshSlot:!1},null,8,["columns","searchFields","data","loading"])]),_:1},8,["showDialog","formData"]),p(S,{showAddChannel:b(J).showAddChannel,"onUpdate:showAddChannel":t[9]||(t[9]=e=>b(J).showAddChannel=e),onConfirmAddChannel:te,currentRow:b(J).currentRow},null,8,["showAddChannel","currentRow"]),p(x,{showSingleFee:b(J).showSingleFee,"onUpdate:showSingleFee":t[10]||(t[10]=e=>b(J).showSingleFee=e),currentRow:b(J).currentRow},null,8,["showSingleFee","currentRow"]),p(U,{channelVisible:b(J).channelVisible,"onUpdate:channelVisible":t[11]||(t[11]=e=>b(J).channelVisible=e),currentRow:b(J).currentRow},null,8,["channelVisible","currentRow"]),p(B,{showFeeRisk:b(J).showFeeRisk,"onUpdate:showFeeRisk":t[12]||(t[12]=e=>b(J).showFeeRisk=e),currentRow:b(J).currentRow},null,8,["showFeeRisk","currentRow"]),p(T,{showCopyChannel:b(J).showCopyChannel,"onUpdate:showCopyChannel":t[13]||(t[13]=e=>b(J).showCopyChannel=e),currentRow:b(J).currentRow,onConfirmAddChannel:te},null,8,["showCopyChannel","currentRow"]),p(V,{showSubChannel:b(J).showSubChannel,"onUpdate:showSubChannel":t[14]||(t[14]=e=>b(J).showSubChannel=e),currentRow:b(J).currentRow},null,8,["showSubChannel","currentRow"]),p(A,{showChannelFee:b(J).showChannelFee,"onUpdate:showChannelFee":t[15]||(t[15]=e=>b(J).showChannelFee=e),currentRow:b(J).currentRow},null,8,["showChannelFee","currentRow"]),p(z,{showChannelRisk:b(J).showChannelRisk,"onUpdate:showChannelRisk":t[16]||(t[16]=e=>b(J).showChannelRisk=e),currentRow:b(J).currentRow,onLoadData:X},null,8,["showChannelRisk","currentRow"]),p(j,{showChannelCode:b(J).showChannelCode,"onUpdate:showChannelCode":t[17]||(t[17]=e=>b(J).showChannelCode=e)},null,8,["showChannelCode"])])}}},[["__scopeId","data-v-1e90f634"]]);export{W as default};