sf_web_dist/js/payment-products-set.1757077236563BgsIQ6FW.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2025-09-05 21:01:54 +08:00
import{b2 as e,bv as t,r as a,ag as o,b4 as l,dB as n,bT as s,aZ as i,c as r,e as p,N as c,w as d,l as h,dm as u,an as m,O as w,bP as g,bN as _,cM as y,al as f,t as b,am as C,bb as v,m as B,E as x,ch as S,g as k,cb as D,a_ as T,dH as F,dI as j,aO as U,dJ as V,dK as R,dL as A,dM as P}from"./index.1757077236563vDlphaMY.js";import{_ as O}from"./index.1757077236563BBjdoXnT.js";/* empty css */import{E}from"./el-text.1757077236563C6sTWa8x.js";import z from"./add-pay-channel.1757077236563CP6zdTx0.js";import I from"./select-channel.1757077236563CHXbCBtw.js";import M from"./batch-setting-fee.1757077236563CKRGk9Ok.js";import{s as N}from"./staticData.17570772365638wZxkmL4.js";import"./lodash.1757077236563DyqpLKyp.js";/* empty css */import"./el-col.1757077236563Cz-Myat0.js";const H={key:0},J={key:1},L={key:2},q={class:"operate-btn"},G=e({__name:"payment-products-set",setup(e){t({legacy:!0}),a("status"),a("1");const G=o({columns:[{prop:"id",label:"ID",align:"center",width:"60"},{prop:"name",label:"通道名称",align:"center"},{prop:"code",label:"通道代码",align:"center",width:"80"},{prop:"pr",label:"通道费率(千分位‰)",align:"center",slot:"pr_slot",width:"100"},{prop:"expire_time",label:"状态",align:"center",slot:"status_slot",width:"80px"},{prop:"",label:"渠道设置",align:"left",slot:"channel_slot",width:"700px"},{prop:"notify_time",label:"操作",align:"center",slot:"operate_slot",width:"120px"}],tableData:[],searchFields:[{prop:"name",label:"通道名称",type:"select",options:[],value:""},{label:"是否开启",type:"select",prop:"status",value:"",options:N.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:""}},showBatchFateSetting:!1,showRiskControlDialog:!1,batchSettingType:"1",showAddPayChannel:!1,currentRow:{},showSingleFee:!1,showSelectChannel:!1,showBatchSettingFee:!1,selectData:[]}),K=()=>{G.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),Z()};l(async()=>{let e=(await n({saiType:"all"})).map(e=>({label:e.name,value:e.name}));G.searchFields.forEach(t=>{"name"==t.prop&&(t.options=e)}),Z()});const Z=()=>{var e,t;G.loading=!0;let a={limit:G.per_page,page:G.page},o=function(e){const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t}(G.searchFields);(null==(e=o.created_at)?void 0:e.length)>0&&(o.created_at_start=o.created_at[0]?s(o.created_at[0]):"",o.created_at_end=o.created_at[1]?s(o.created_at[1]):""),(null==(t=o.completed_at)?void 0:t.length)>0&&(o.completed_at_start=o.completed_at[0]?s(o.completed_at[0]):"",o.completed_at_end=o.completed_at[1]?s(o.completed_at[1]):""),n(Object.assign(a,o)).then(e=>{G.tableData=e.data,G.total=e.total,G.loading=!1}).catch(()=>{G.loading=!1})},$=()=>{G.showBatchSettingDialog=!1},Q=()=>{G.showAddPayChannel=!0,G.currentRow={}},W=e=>{},X=e=>{e.id?V(e).then(e=>{U.success("修改成功"),G.showAddPayChannel=!1,Z()}):A(e).then(e=>{U.success("添加成功"),G.showAddPayChannel=!1,Z()})},Y=o({}),ee=()=>{Z()},te=e=>{R({ids:[e]}).then(e=>{Z()})},ae=()=>{if(0==G.selectData.length)return U.warning("请先勾选通道");G.showBatchSettingFee=!0},oe=e=>{let t=G.selectData.map(e=>({id:e.id,pr:e.modify_pr?e.modify_pr:e.pr}));T.alert("确定批量修改通道费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{P({data:t}).then(e=>{U.success("修改成功"),G.showBatchSettingFee=!1,Z()})}).catch(()=>{G.showBatchSettingFee=!1})},le=e=>{G.selectData=e};return(e,t)=>{const a=m,o=E,l=i("EditPen"),n=x,s=S,R=v,A=y,P=_,N=C,ne=g,se=u,ie=O,re=D;return p(),r("div",null,[c(ie,{type:"export",columns:k(G).columns,searchFields:k(G).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>k(G).searchFields=e),data:k(G).tableData,per_page:k(G).per_page,"onUpdate:pe