sf_web_dist/js/deposit-channels-set.1761036317407CR9w-pEO.js
2025-10-21 16:46:16 +08:00

2 lines
14 KiB
JavaScript

import{b3 as e,r as t,bu as a,ag as l,b5 as o,dh as n,dn as s,bS as i,a_ as r,c as p,e as d,N as u,w as h,l as c,dp as m,an as w,O as _,m as g,al as C,a7 as y,a8 as v,bD as f,t as b,g as k,E as R,cg as x,bc as F,ca as j,a$ as S,dI as D,aO as B,dJ as U,dK as T,dL as V}from"./index.1761036317407CqxspswV.js";import{_ as A}from"./index.1761036317407DLRP7xcE.js";/* empty css */import{E as O}from"./el-text.1761036317407DsMpd8ws.js";import E from"./add-channel.1761036317407CxHpbLoy.js";import z from"./channel-code.1761036317407BRv_HDxf.js";import $ from"./single_fee.1761036317407DIJAknET.js";import N from"./test_channel.1761036317407D-QvgEaJ.js";import I from"./fee-risk.1761036317407Dv0Sx5iT.js";import J from"./copy-channel.1761036317407Dz3nrTlY.js";import L from"./sub-channel.1761036317407BqcFiKxs.js";import P from"./channel-fee.1761036317407PS3Bg5Ik.js";import q from"./channel-risk.1761036317407eqZoUyRa.js";import{g as H}from"./payee-suppiler.1761036317407BBamrYdQ.js";import{s as M}from"./staticData.1761036317407ieVX5Cz9.js";import{p as G}from"./common.1761036317407CCwWzMi9.js";/* empty css */import"./el-col.1761036317407DyRlU4HE.js";import"./el-link.1761036317407bYP-7-YB.js";import"./el-time-select.1761036317407D-06DmYC.js";import"./el-card.1761036317407g3_nfes9.js";import"./sub-channel-add.1761036317407CJ2RNOTQ.js";import"./sub-channel-fee.17610363174076XhCCWE1.js";import"./sub-channel-risk.1761036317407Q2rpcsmU.js";const K={key:0},W={key:1},Y={key:2},Q={key:1,class:"shop-list"},X={class:"operate-btn"},Z=e({__name:"deposit-channels-set",props:{currentRow:{type:Object,default:{}}},setup(e,{expose:Z}){t("status"),t("1"),a({legacy:!0});let ee=t([]);const te=l({columns:[{prop:"id",label:"ID",align:"center",width:"60px"},{prop:"shop_id",label:"供应商编码",align:"center",width:"80px"},{prop:"shop_id",label:"供应商名称",align:"center",slot:"shop_name_slot",width:"100px"},{prop:"name",label:"渠道名称",align:"center",width:"300px"},{prop:"code",label:"渠道代码",align:"center",width:"100px"},{prop:"",label:"跑量",align:"center",slot:"run_num_slot",width:"100px",sortable:"custom"},{prop:"",label:"成功率",align:"center",slot:"success_rate_slot",sortable:"custom",width:"80px"},{prop:"status",label:"接口状态",align:"center",slot:"status_slot",width:"100px"},{prop:"pr",label:"费率",align:"center",slot:"pr_slot",width:"80px"},{prop:"limit",label:"金额限制",align:"center",slot:"limit_slot"},{prop:"limit",label:"商户限制",align:"center",slot:"shop_limit_slot",width:"160px"},{prop:"notify_time",label:"操作",slot:"operate_slot",width:"200px"}],tableData:[],searchFields:[{label:"渠道名称",prop:"api_query",type:"input",value:""},{label:"供应商",prop:"shop_id",type:"select",options:ee.value,value:""},{label:"是否开启",type:"select",prop:"status",value:"",options:M.status}],total:0,page:1,per_page:50,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}),ae=()=>{te.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),oe()},le=t([]);o(async()=>{oe(),pe();let e=(await n({saiType:"all"})).map(e=>({label:e.name,value:e.name}));te.searchFields.forEach(t=>{"name"==t.prop&&(t.options=e)});let t=await s({saiType:"all"});le.value=[],Object.keys(t).forEach(e=>{t[e].id&&le.value.push({label:t[e].username,value:t[e].shop_id})})});const oe=()=>{var e,t;te.loading=!0;let a={limit:te.per_page,page:te.page},l=function(e){const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t}(te.searchFields);(null==(e=l.created_at)?void 0:e.length)>0&&(l.created_at_start=l.created_at[0]?i(l.created_at[0]):"",l.created_at_end=l.created_at[1]?i(l.created_at[1]):""),(null==(t=l.completed_at)?void 0:t.length)>0&&(l.completed_at_start=l.completed_at[0]?i(l.completed_at[0]):"",l.completed_at_end=l.completed_at[1]?i(l.completed_at[1]):""),n(Object.assign(a,l)).then(e=>{te.tableData=e.data,te.total=e.total,te.loading=!1}).catch(()=>{te.loading=!1})},ne=()=>{te.showBatchSettingDialog=!1},se=e=>{te.showAddChannel=!0,te.currentRow=e},ie=l({}),re=e=>{e.id?U(e).then(e=>{oe(),B.success("修改成功"),te.showAddChannel=!1}):V(e).then(e=>{oe(),B.success("添加成功"),te.showAddChannel=!1,te.showCopyChannel=!1})},pe=()=>{H({saiType:"all"}).then(e=>{ee.value=[],e.forEach(e=>{ee.value.push({label:e.supplier_name,value:e.shop_id})}),te.searchFields[1].options=ee.value})},de=e=>{let t=[];if(1==(null==e?void 0:e.shop_type)){let a=""!=(null==e?void 0:e.allow_shop_ids)?JSON.parse(null==e?void 0:e.allow_shop_ids):[];t=le.value.filter(e=>a.includes(e.value))}else if(2==(null==e?void 0:e.shop_type)){let a=""!=(null==e?void 0:e.forbid_shop_ids)?JSON.parse(null==e?void 0:e.forbid_shop_ids):[];t=le.value.filter(e=>a.includes(e.value))}return t};return Z({filterChannel:e=>{te.searchFields[1].value=e.shop_id,oe()}}),(e,t)=>{const a=w,l=F,o=O,n=r("EditPen"),s=R,i=x,V=f,H=m,M=A,Z=j;return d(),p("div",null,[u(M,{type:"export",columns:k(te).columns,searchFields:k(te).searchFields,"onUpdate:searchFields":t[1]||(t[1]=e=>k(te).searchFields=e),data:k(te).tableData,per_page:k(te).per_page,"onUpdate:per_page":t[2]||(t[2]=e=>k(te).per_page=e),page:k(te).page,"onUpdate:page":t[3]||(t[3]=e=>k(te).page=e),total:k(te).total,onGetTableData:oe,onResetForm:ae,loading:k(te).loading,showSelection:!1,showRightRefreshSlot:!1,maxHeight:"58vh"},{btns:h(({row:e})=>[u(a,{type:"primary",onClick:t[0]||(t[0]=e=>se({}))},{default:h(()=>t[18]||(t[18]=[_("添加渠道")])),_:1,__:[18]})]),shop_name_slot:h(({row:e})=>{var t;return[c("div",null,b(null==(t=k(ee).find(t=>t.value==e.shop_id))?void 0:t.label),1)]}),run_num_slot:h(({row:e})=>{var t,a,l,o,n,s,i,r;return[c("div",null,b(`${(null==(t=null==e?void 0:e.sum_data)?void 0:t.success_num)?null==(a=null==e?void 0:e.sum_data)?void 0:a.success_num:0}/${(null==(l=null==e?void 0:e.sum_data)?void 0:l.num)?null==(o=null==e?void 0:e.sum_data)?void 0:o.num:0}`),1),c("div",null,b(`${(null==(n=null==e?void 0:e.sum_data)?void 0:n.money)?k(G)(null==(s=null==e?void 0:e.sum_data)?void 0:s.money):0}/${(null==(i=null==e?void 0:e.sum_data)?void 0:i.flow_money)?k(G)(null==(r=null==e?void 0:e.sum_data)?void 0:r.flow_money):0}`),1)]}),success_rate_slot:h(({row:e})=>{var t,a;return[_(b((null==(t=null==e?void 0:e.sum_data)?void 0:t.success_pr)?k(G)(null==(a=null==e?void 0:e.sum_data)?void 0:a.success_pr):0)+"% ",1)]}),status_slot:h(({row:e})=>[u(l,{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?S({title:"提示",message:`<span style="color: red">通道[${t.join(",")}]费率小于渠道成本</span>`,confirmButtonText:"我已知晓",cancelButtonText:"取消",showCancelButton:!0,type:"warning",dangerouslyUseHTMLString:!0}).then(()=>{S.alert("确定修改渠道状态吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{T({id:e.id,status:e.status})}).catch(()=>{e.status=1==e.status?2:1})}).catch(()=>{e.status=1==e.status?2:1}):S.alert("确定修改渠道状态吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{T({id:e.id,status:e.status})}).catch(()=>{e.status=1==e.status?2:1})})(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),limit_slot:h(({row:e})=>[2==e.money_type?(d(),p("div",K,"区间:"+b(e.min_money)+"~"+b(e.max_money),1)):C("",!0),1==e.money_type&&(null==e?void 0:e.allow_money)?(d(),p("div",W,"固定:"+b((null==e?void 0:e.allow_money)?JSON.parse(e.allow_money).join(","):""),1)):C("",!0),e.not_allow_money?(d(),p("div",Y,"限额:"+b(e.not_allow_money),1)):C("",!0)]),pr_slot:h(({row:e})=>[e.edit?C("",!0):(d(),g(o,{key:0},{default:h(()=>[_(b(k(G)(e.pr)),1)]),_:2},1024)),e.edit?C("",!0):(d(),g(o,{key:1,type:"primary",onClick:t=>(e=>{Object.assign(ie,e),e.edit=!0})(e)},{default:h(()=>[u(s,null,{default:h(()=>[u(n)]),_:1})]),_:2},1032,["onClick"])),e.edit?(d(),g(i,{key:2,modelValue:e.pr,"onUpdate:modelValue":t=>e.pr=t,type:"number",controls:!1,placeholder:"请输入",style:{width:"80px"}},null,8,["modelValue","onUpdate:modelValue"])):C("",!0),e.edit?(d(),g(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?S({title:"提示",message:`<span style="color: red">通道[${t.join(",")}]费率小于渠道成本</span>`,confirmButtonText:"我已知晓",cancelButtonText:"取消",showCancelButton:!0,type:"warning",dangerouslyUseHTMLString:!0}).then(()=>{S.alert("确定修改渠道费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{U(a).then(e=>{oe()})}).catch(()=>{e.edit=!1,Object.assign(e,ie)})}).catch(()=>{e.edit=!1,oe()}):S.alert("确定修改渠道费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{U(a).then(e=>{oe()})}).catch(()=>{e.edit=!1,Object.assign(e,ie)})})(e)},{default:h(()=>t[19]||(t[19]=[_("保存")])),_:2,__:[19]},1032,["onClick"])):C("",!0)]),shop_limit_slot:h(({row:e})=>[0==e.shop_type?(d(),g(o,{key:0},{default:h(()=>t[20]||(t[20]=[_("不限制")])),_:1,__:[20]})):C("",!0),1==(null==e?void 0:e.shop_type)||2==(null==e?void 0:e.shop_type)?(d(),p("div",Q,[(d(!0),p(y,null,v(de(e),t=>(d(),g(V,{class:"shop-tag",type:1==(null==e?void 0:e.shop_type)?"primary":"danger"},{default:h(()=>[_(b(t.label),1)]),_:2},1032,["type"]))),256))])):C("",!0)]),operate_slot:h(({row:e})=>[c("div",X,[u(H,{style:{"margin-bottom":"4px"}},{default:h(()=>[u(a,{type:"primary",onClick:t=>(e=>{te.showChannelRisk=!0,te.currentRow=e})(e),size:"small"},{default:h(()=>t[21]||(t[21]=[_("金额与商户设置")])),_:2,__:[21]},1032,["onClick"]),u(a,{type:"primary",onClick:t=>se(e),size:"small"},{default:h(()=>t[22]||(t[22]=[_("编辑")])),_:2,__:[22]},1032,["onClick"])]),_:2},1024),u(H,null,{default:h(()=>[u(a,{type:"primary",onClick:t=>(e=>{te.channelVisible=!0,te.currentRow=e})(e),size:"small"},{default:h(()=>t[23]||(t[23]=[_("测试渠道")])),_:2,__:[23]},1032,["onClick"]),u(a,{type:"primary",onClick:t=>(e=>{te.showCopyChannel=!0,te.currentRow=e})(e),size:"small"},{default:h(()=>t[24]||(t[24]=[_("复制渠道")])),_:2,__:[24]},1032,["onClick"]),u(a,{type:"primary",onClick:t=>(e=>{S.alert("确定删除当前渠道?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{D({id:e.id}).then(e=>{B.success("删除成功!"),oe()})}).catch(()=>{})})(e),size:"small"},{default:h(()=>t[25]||(t[25]=[_("删除")])),_:2,__:[25]},1032,["onClick"])]),_:2},1024)])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),u(Z,{showDialog:k(te).showBatchSettingDialog,"onUpdate:showDialog":t[4]||(t[4]=e=>k(te).showBatchSettingDialog=e),formData:k(te).batchSetting,"onUpdate:formData":t[5]||(t[5]=e=>k(te).batchSetting=e),ref:"productRef"},{submit:h(()=>[u(a,{type:"primary",onClick:ne},{default:h(()=>t[26]||(t[26]=[_("确定")])),_:1,__:[26]})]),_:1},8,["showDialog","formData"]),u(Z,{showDialog:k(te).showRiskControlDialog,"onUpdate:showDialog":t[7]||(t[7]=e=>k(te).showRiskControlDialog=e),formData:k(te).riskControl,"onUpdate:formData":t[8]||(t[8]=e=>k(te).riskControl=e),ref:"productRef",dialogWidth:"900px"},{otherInfo:h(()=>[u(M,{type:"export",columns:k(te).riskControlColumns,searchFields:k(te).riskControlSearchFields,"onUpdate:searchFields":t[6]||(t[6]=e=>k(te).riskControlSearchFields=e),data:k(te).riskControlData,loading:k(te).loading,showSelection:!1,showRightRefreshSlot:!1},null,8,["columns","searchFields","data","loading"])]),_:1},8,["showDialog","formData"]),u(E,{showAddChannel:k(te).showAddChannel,"onUpdate:showAddChannel":t[9]||(t[9]=e=>k(te).showAddChannel=e),onConfirmAddChannel:re,currentRow:k(te).currentRow},null,8,["showAddChannel","currentRow"]),u($,{showSingleFee:k(te).showSingleFee,"onUpdate:showSingleFee":t[10]||(t[10]=e=>k(te).showSingleFee=e),currentRow:k(te).currentRow},null,8,["showSingleFee","currentRow"]),u(N,{channelVisible:k(te).channelVisible,"onUpdate:channelVisible":t[11]||(t[11]=e=>k(te).channelVisible=e),currentRow:k(te).currentRow},null,8,["channelVisible","currentRow"]),u(I,{showFeeRisk:k(te).showFeeRisk,"onUpdate:showFeeRisk":t[12]||(t[12]=e=>k(te).showFeeRisk=e),currentRow:k(te).currentRow},null,8,["showFeeRisk","currentRow"]),u(J,{showCopyChannel:k(te).showCopyChannel,"onUpdate:showCopyChannel":t[13]||(t[13]=e=>k(te).showCopyChannel=e),currentRow:k(te).currentRow,onConfirmAddChannel:re},null,8,["showCopyChannel","currentRow"]),u(L,{showSubChannel:k(te).showSubChannel,"onUpdate:showSubChannel":t[14]||(t[14]=e=>k(te).showSubChannel=e),currentRow:k(te).currentRow},null,8,["showSubChannel","currentRow"]),u(P,{showChannelFee:k(te).showChannelFee,"onUpdate:showChannelFee":t[15]||(t[15]=e=>k(te).showChannelFee=e),currentRow:k(te).currentRow},null,8,["showChannelFee","currentRow"]),u(q,{showChannelRisk:k(te).showChannelRisk,"onUpdate:showChannelRisk":t[16]||(t[16]=e=>k(te).showChannelRisk=e),currentRow:k(te).currentRow,onLoadData:oe},null,8,["showChannelRisk","currentRow"]),u(z,{showChannelCode:k(te).showChannelCode,"onUpdate:showChannelCode":t[17]||(t[17]=e=>k(te).showChannelCode=e)},null,8,["showChannelCode"])])}}},[["__scopeId","data-v-d9f735d9"]]);export{Z as default};