sf_web_dist/js/single_fee_set.1759047074685BuYWE90t.js
2025-09-28 16:12:20 +08:00

2 lines
3.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{D as e,r as t,ag as a,aZ as l,m as o,e as s,w as n,N as r,g as i,al as p,O as d,t as c,E as u,am as h,an as m,l as g,aX as _,dh as y,a_ as w,dg as f}from"./index.1759047074685BJRc_drO.js";import{_ as b}from"./index.1759047074685CI2OyV6t.js";import{E as x}from"./el-text.1759047074685Bs9id-cU.js";import{p as v}from"./common.1759047074685CCwWzMi9.js";/* empty css */import"./el-col.1759047074685DbDBHzwv.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 k=S;e(()=>k.showSingleFeeSet,e=>{e&&(D(),B.value="calc(100vh - 280px)")});const B=t(),j=a({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:[{prop:"name_query",label:"渠道名称",type:"select",options:[],value:""}],tableData:[],loading:!1,selectData:[]});t([]);const C=F,T=()=>{C("update:showSingleFeeSet",!1)},D=()=>{j.loading=!0;let e={shop_id:k.currentRow.shop_id},t=(e=>{const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t})(j.searchFields);y(Object.assign(e,t)).then(e=>{let t=e.filter(e=>e.global_pr==e.pr),a=e.filter(e=>e.global_pr!=e.pr);t.sort((e,t)=>e.id-t.id),a.sort((e,t)=>e.id-t.id),j.tableData=[...a,...t],j.loading=!1;let l=e.map(e=>({label:e.name,value:e.name}));j.searchFields[0].options=l}).catch(()=>{j.loading=!1})},E=t(null);return e(E,e=>{B.value="calc(100vh - 280px)"}),(e,t)=>{const a=x,y=l("EditPen"),F=u,C=h,R=m,U=b,V=_;return s(),o(V,{"model-value":S.showSingleFeeSet,title:"费率设置",width:"60vw",onClose:T,"body-class":"dialog-body1",ref_key:"myElDialog",ref:E},{header:n(()=>t[1]||(t[1]=[g("div",{class:"dialog-title"},"费率设置",-1),g("div",{style:{"font-size":"12px",color:"#666"}},"注费率为千分位例如千分之一则填0.001",-1)])),default:n(()=>[r(U,{type:"export",columns:i(j).columns,searchFields:i(j).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>i(j).searchFields=e),paginationSlot:!1,data:i(j).tableData,onGetTableData:D,loading:i(j).loading,showSelection:!1,showRightRefreshSlot:!1,window_Height:i(B)},{name_slot:n(({row:e})=>[g("span",null,c(e.name),1)]),batch_pr_slot:n(({row:e})=>[g("span",null,c(i(v)(e.global_pr)),1)]),rate_slot:n(({row:e})=>[e.edit?p("",!0):(s(),o(a,{key:0,type:e.global_pr!=e.pr?"danger":""},{default:n(()=>[d(c(i(v)(e.pr)),1)]),_:2},1032,["type"])),e.edit?p("",!0):(s(),o(a,{key:1,type:"primary",onClick:t=>e.edit=!0},{default:n(()=>[r(F,null,{default:n(()=>[r(y)]),_:1})]),_:2},1032,["onClick"])),e.edit?(s(),o(C,{key:2,modelValue:e.pr,"onUpdate:modelValue":t=>e.pr=t,placeholder:"请输入费率",style:{width:"80px"}},null,8,["modelValue","onUpdate:modelValue"])):p("",!0),e.edit?(s(),o(R,{key:3,type:"primary",style:{"margin-left":"4px"},size:"small",onClick:t=>(e=>{let t={shop_id:k.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(()=>{f(t).then(e=>{D()})}).catch(()=>{e.edit=!1,D()})}).catch(()=>{e.edit=!1,D()}):w.alert("确定修改通道费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{f(t).then(e=>{D()})}).catch(()=>{e.edit=!1,D()})})(e)},{default:n(()=>t[2]||(t[2]=[d("保存")])),_:2,__:[2]},1032,["onClick"])):p("",!0)]),_:1},8,["columns","searchFields","data","loading","window_Height"])]),_:1},8,["model-value"])}}};export{S as default};