2 lines
3.2 KiB
JavaScript
2 lines
3.2 KiB
JavaScript
import{D as e,ag as t,r as a,aZ as l,m as o,e as s,w as n,l as r,N as i,g as p,al as d,O as c,t as u,E as h,am as m,an as _,aX as g,a_ as w}from"./index.D4F5fok9.js";import{_ as y}from"./index.nIDlrajv.js";import{E as f}from"./el-text.BZJaClWd.js";import{g as b,e as x}from"./payee-user.BqJN8mk6.js";/* empty css */import"./el-col.DB0VBTxV.js";const S={__name:"single_fee_set",props:{showSingleFeeSet:{type:Boolean,default:!1},currentRow:{type:Object,default:()=>{}}},emits:["update:showSingleFeeSet"],setup(S,{emit:F}){const B=S;e(()=>B.showSingleFeeSet,e=>{e&&T()});const k=t({columns:[{label:"通道编号",prop:"id"},{label:"通道名称",prop:"name",slot:"name_slot"},{label:"批量费率",prop:"pr",slot:"batch_pr_slot"},{label:"定制费率",prop:"rate",slot:"rate_slot",align:"center"}],searchFields:[],tableData:[],loading:!1,selectData:[]});a([]);const j=F,C=()=>{j("update:showSingleFeeSet",!1)},T=()=>{k.loading=!0;let e={shop_id:B.currentRow.shop_id},t=(e=>{const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t})(k.searchFields);b(Object.assign(e,t)).then(e=>{k.tableData=e,k.loading=!1}).catch(()=>{k.loading=!1})};return(e,t)=>{const a=f,b=l("EditPen"),F=h,j=m,v=_,D=y,R=g;return s(),o(R,{"model-value":S.showSingleFeeSet,title:"费率设置",width:"60vw",onClose:C},{default:n(()=>[t[2]||(t[2]=r("div",null,"注:费率为千分位,例如:千分之一则填0.001",-1)),i(D,{type:"export",columns:p(k).columns,searchFields:p(k).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>p(k).searchFields=e),paginationSlot:!1,data:p(k).tableData,onGetTableData:T,loading:p(k).loading,showSelection:!1,showRightRefreshSlot:!1},{name_slot:n(({row:e})=>[r("span",null,u(e.name),1)]),batch_pr_slot:n(({row:e})=>[r("span",null,u(e.global_pr),1)]),rate_slot:n(({row:e})=>[e.edit?d("",!0):(s(),o(a,{key:0,type:e.global_pr!=e.pr?"danger":""},{default:n(()=>[c(u(e.pr),1)]),_:2},1032,["type"])),e.edit?d("",!0):(s(),o(a,{key:1,type:"primary",onClick:t=>e.edit=!0},{default:n(()=>[i(F,null,{default:n(()=>[i(b)]),_:1})]),_:2},1032,["onClick"])),e.edit?(s(),o(j,{key:2,modelValue:e.pr,"onUpdate:modelValue":t=>e.pr=t,placeholder:"请输入费率",style:{width:"80px"}},null,8,["modelValue","onUpdate:modelValue"])):d("",!0),e.edit?(s(),o(v,{key:3,type:"primary",style:{"margin-left":"4px"},size:"small",onClick:t=>(e=>{let t={shop_id:B.currentRow.shop_id,payment_product_id:e.id,pr:e.pr};e.max_cost_pr-e.pr>0?w({title:"提示",message:'<span style="color: red">通道费率小于渠道成本</span>',confirmButtonText:"我已知晓",cancelButtonText:"取消",showCancelButton:!0,type:"warning",dangerouslyUseHTMLString:!0}).then(()=>{w.alert("确定修改通道费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{x(t).then(e=>{T()})}).catch(()=>{e.edit=!1})}).catch(()=>{e.edit=!1}):w.alert("确定修改通道费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{x(t).then(e=>{T()})}).catch(()=>{e.edit=!1})})(e)},{default:n(()=>t[1]||(t[1]=[c("保存")])),_:2,__:[1]},1032,["onClick"])):d("",!0)]),_:1},8,["columns","searchFields","data","loading"])]),_:1,__:[2]},8,["model-value"])}}};export{S as default};
|