2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{b2 as e,bs as o,r as a,ag as t,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 d,an as u,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.C7pORKmJ.js";import{_ as F}from"./index.BBJNkIuv.js";/* empty css */import{E as D}from"./el-text.CM-y9OXy.js";import S from"./add-channel.DkNv8xAx.js";import j from"./channel-code.Bs6iKo5B.js";import x from"./single_fee.uEavQB4F.js";import U from"./test_channel.BdmjBLB7.js";import V from"./fee-risk.ua5aEivC.js";import B from"./copy-channel.Cmoc9QN9.js";import A from"./sub-channel.Db9SiS1x.js";import T from"./channel-fee.CRpqZmTp.js";import z from"./channel-risk.B8UrH405.js";import{g as E,e as O,d as $,f as I}from"./payee-channel.D71BDaXF.js";import{g as P}from"./payee-suppiler.DpPs0JBh.js";import{s as q}from"./staticData.8wZxkmL4.js";/* empty css */import"./el-col.Wsf29Kwb.js";import"./el-link.BtzM2Mqc.js";import"./el-time-select.DcHLUEF0.js";import"./el-card.DqR62-U1.js";import"./sub-channel-add.Cf8NrL21.js";import"./sub-channel-fee.yN2LxQNF.js";import"./sub-channel-risk.Bgeu91Yu.js";const N={key:0},W={key:1},G={class:"operate-btn"},H=e({__name:"deposit-channels-set",props:{currentRow:{type:Object,default:{}}},setup(e,{expose:H}){o({legacy:!0});let L=a([]);const M=t({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:L.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}),Q=()=>{M.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),X()};l(()=>{X(),oe()});const X=()=>{var e,o;M.loading=!0;let a={limit:M.per_page,page:M.page},t=function(e){const o={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(o[e.prop]=e.value)}),o}(M.searchFields);(null==(e=t.created_at)?void 0:e.length)>0&&(t.created_at_start=t.created_at[0]?n(t.created_at[0]):"",t.created_at_end=t.created_at[1]?n(t.created_at[1]):""),(null==(o=t.completed_at)?void 0:o.length)>0&&(t.completed_at_start=t.completed_at[0]?n(t.completed_at[0]):"",t.completed_at_end=t.completed_at[1]?n(t.completed_at[1]):""),E(Object.assign(a,t)).then(e=>{M.tableData=e.data,M.total=e.total,M.loading=!1}).catch(()=>{M.loading=!1})},Y=()=>{M.showBatchSettingDialog=!0},Z=()=>{M.showBatchSettingDialog=!1},J=()=>{M.showRiskControlDialog=!0},K=e=>{M.showAddChannel=!0,M.currentRow=e},ee=e=>{e.id?O(e).then(e=>{X(),v.success("修改成功"),M.showAddChannel=!1}):I(e).then(e=>{X(),v.success("添加成功"),M.showAddChannel=!1,M.showCopyChannel=!1})},oe=()=>{P({saiType:"all"}).then(e=>{L.value=[],e.forEach(e=>{L.value.push({label:e.supplier_name,value:e.shop_id})}),M.searchFields[1].options=L.value})};return H({filterChannel:e=>{M.searchFields[1].value=e.shop_id,X()}}),(e,o)=>{const a=u,t=f,l=D,n=s("EditPen"),v=g,E=y,I=d,P=F,q=k;return i(),r("div",null,[p(P,{type:"export",columns:b(M).columns,searchFields:b(M).searchFields,"onUpdate:searchFields":o[1]||(o[1]=e=>b(M).searchFields=e),data:b(M).tableData,per_page:b(M).per_page,"onUpdate:per_page":o[2]||(o[2]=e=>b(M).per_page=e),page:b(M).page,"onUpdate:page":o[3]||(o[3]=e=>b(M).page=e),total:b(M).total,onGetTableData:X,onResetForm:Q,loading:b(M).loading,showSelection:!1,showRightRefreshSlot:!1},{btns:c(({row:e})=>[p(a,{type:"primary",onClick:Y},{default:c(()=>o[18]||(o[18]=[m("批量开启/关闭")])),_:1,__:[18]}),p(a,{type:"primary",onClick:J},{default:c(()=>o[19]||(o[19]=[m("风控实况")])),_:1,__:[19]}),p(a,{type:"primary",onClick:o[0]||(o[0]=e=>K({}))},{default:c(()=>o[20]||(o[20]=[m("添加渠道")])),_:1,__:[20]})]),shop_name_slot:c(({row:e})=>{var o;return[h("div",null,C(null==(o=b(L).find(o=>o.value==e.shop_id))?void 0:o.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(t,{modelValue:e.status,"onUpdate:modelValue":o=>e.status=o,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"正常","inactive-text":"停用",onChange:o=>(e=>{$({id:e.id,status:e.status})})(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),limit_slot:c(({row:e})=>[e.min_money?(i(),r("div",N,C(e.min_money)+"~"+C(e.max_money),1)):_("",!0),e.not_allow_money?(i(),r("div",W,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:o=>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":o=>e.pr=o,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:o=>(e=>{e.edit=!1;let o=[],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&&o.push(a.name)}),o.length>0?R({title:"提示",message:`<span style="color: red">通道[${o.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(()=>o[21]||(o[21]=[m("保存")])),_:2,__:[21]},1032,["onClick"])):_("",!0)]),operate_slot:c(({row:t})=>[h("div",G,[p(I,{style:{"margin-bottom":"4px"}},{default:c(()=>[p(a,{type:"primary",onClick:e=>(e=>{M.showSubChannel=!0,M.currentRow=e})(t),size:"small"},{default:c(()=>o[22]||(o[22]=[m("子账号")])),_:2,__:[22]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>(e=>{M.showChannelRisk=!0,M.currentRow=e})(t),size:"small"},{default:c(()=>o[23]||(o[23]=[m("风控")])),_:2,__:[23]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>K(t),size:"small"},{default:c(()=>o[24]||(o[24]=[m("编辑")])),_:2,__:[24]},1032,["onClick"])]),_:2},1024),p(I,null,{default:c(()=>[p(a,{type:"primary",onClick:e=>(e=>{M.channelVisible=!0,M.currentRow=e})(t),size:"small"},{default:c(()=>o[25]||(o[25]=[m("测试渠道")])),_:2,__:[25]},1032,["onClick"]),p(a,{type:"primary",onClick:e=>(e=>{M.showCopyChannel=!0,M.currentRow=e})(t),size:"small"},{default:c(()=>o[26]||(o[26]=[m("复制渠道")])),_:2,__:[26]},1032,["onClick"]),p(a,{type:"primary",onClick:o=>e.handleDelete(t),size:"small"},{default:c(()=>o[27]||(o[27]=[m("删除")])),_:2,__:[27]},1032,["onClick"])]),_:2},1024)])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),p(q,{showDialog:b(M).showBatchSettingDialog,"onUpdate:showDialog":o[4]||(o[4]=e=>b(M).showBatchSettingDialog=e),formData:b(M).batchSetting,"onUpdate:formData":o[5]||(o[5]=e=>b(M).batchSetting=e),ref:"productRef"},{submit:c(()=>[p(a,{type:"primary",onClick:Z},{default:c(()=>o[28]||(o[28]=[m("确定")])),_:1,__:[28]})]),_:1},8,["showDialog","formData"]),p(q,{showDialog:b(M).showRiskControlDialog,"onUpdate:showDialog":o[7]||(o[7]=e=>b(M).showRiskControlDialog=e),formData:b(M).riskControl,"onUpdate:formData":o[8]||(o[8]=e=>b(M).riskControl=e),ref:"productRef",dialogWidth:"900px"},{otherInfo:c(()=>[p(P,{type:"export",columns:b(M).riskControlColumns,searchFields:b(M).riskControlSearchFields,"onUpdate:searchFields":o[6]||(o[6]=e=>b(M).riskControlSearchFields=e),data:b(M).riskControlData,loading:b(M).loading,showSelection:!1,showRightRefreshSlot:!1},null,8,["columns","searchFields","data","loading"])]),_:1},8,["showDialog","formData"]),p(S,{showAddChannel:b(M).showAddChannel,"onUpdate:showAddChannel":o[9]||(o[9]=e=>b(M).showAddChannel=e),onConfirmAddChannel:ee,currentRow:b(M).currentRow},null,8,["showAddChannel","currentRow"]),p(x,{showSingleFee:b(M).showSingleFee,"onUpdate:showSingleFee":o[10]||(o[10]=e=>b(M).showSingleFee=e),currentRow:b(M).currentRow},null,8,["showSingleFee","currentRow"]),p(U,{channelVisible:b(M).channelVisible,"onUpdate:channelVisible":o[11]||(o[11]=e=>b(M).channelVisible=e),currentRow:b(M).currentRow},null,8,["channelVisible","currentRow"]),p(V,{showFeeRisk:b(M).showFeeRisk,"onUpdate:showFeeRisk":o[12]||(o[12]=e=>b(M).showFeeRisk=e),currentRow:b(M).currentRow},null,8,["showFeeRisk","currentRow"]),p(B,{showCopyChannel:b(M).showCopyChannel,"onUpdate:showCopyChannel":o[13]||(o[13]=e=>b(M).showCopyChannel=e),currentRow:b(M).currentRow,onConfirmAddChannel:ee},null,8,["showCopyChannel","currentRow"]),p(A,{showSubChannel:b(M).showSubChannel,"onUpdate:showSubChannel":o[14]||(o[14]=e=>b(M).showSubChannel=e),currentRow:b(M).currentRow},null,8,["showSubChannel","currentRow"]),p(T,{showChannelFee:b(M).showChannelFee,"onUpdate:showChannelFee":o[15]||(o[15]=e=>b(M).showChannelFee=e),currentRow:b(M).currentRow},null,8,["showChannelFee","currentRow"]),p(z,{showChannelRisk:b(M).showChannelRisk,"onUpdate:showChannelRisk":o[16]||(o[16]=e=>b(M).showChannelRisk=e),currentRow:b(M).currentRow},null,8,["showChannelRisk","currentRow"]),p(j,{showChannelCode:b(M).showChannelCode,"onUpdate:showChannelCode":o[17]||(o[17]=e=>b(M).showChannelCode=e)},null,8,["showChannelCode"])])}}},[["__scopeId","data-v-53dccf44"]]);export{H as default};
|