sf_web_dist/js/group_fee_set.1760685172143BQA02hUs.js
2025-10-17 15:16:42 +08:00

2 lines
4.0 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{r as e,ai as t,D as a,ag as l,a_ as o,m as s,e as r,w as n,N as p,g as i,al as d,O as c,t as u,E as m,am as h,an as _,l as g,aX as w,d8 as y,a$ as f,d9 as b}from"./index.1760685172143ChvXXrGI.js";import{_ as x}from"./index.1760685172143Dni7r4WH.js";import{E as v}from"./el-text.1760685172143BWHdRXwV.js";import{p as F}from"./common.1760685172143CCwWzMi9.js";/* empty css */import"./el-col.1760685172143CNfdOm1y.js";const k={__name:"group_fee_set",props:{showGroupFeeSet:{type:Boolean,default:!1},currentRow:{type:Object,default:()=>{}}},emits:["update:showGroupFeeSet"],setup(k,{emit:B}){const S=k,j=e();t(()=>{}),a(()=>S.showGroupFeeSet,e=>{e&&(G(),j.value=S.currentRow.name,T.columns.forEach(e=>{"rate"==e.prop&&(e.label=`${j.value}费率`)}),C.value="calc(100vh - 280px)")});const C=e(),T=l({columns:[{label:"通道编号",prop:"id"},{label:"通道名称",prop:"name",slot:"name_slot"},{label:"全局费率",prop:"pr",slot:"batch_pr_slot"},{label:`${j.value}费率`,prop:"rate",slot:"rate_slot",align:"center"}],searchFields:[{prop:"name_query",label:"渠道名称",type:"select",options:[],value:""}],tableData:[],loading:!1,selectData:[]});e([]);const D=B,E=()=>{D("update:showGroupFeeSet",!1)},G=()=>{T.loading=!0;let e={group_id:S.currentRow.id},t=(e=>{const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t})(T.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),T.tableData=[...a,...t],T.loading=!1;let l=e.map(e=>({label:e.name,value:e.name}));T.searchFields[0].options=l}).catch(()=>{T.loading=!1})},R=e(null);return a(R,e=>{C.value="calc(100vh - 280px)"}),(e,t)=>{const a=v,l=o("EditPen"),y=m,B=h,j=_,D=x,U=w;return r(),s(U,{"model-value":k.showGroupFeeSet,title:"费率设置",width:"60vw",onClose:E,"body-class":"dialog-body1",ref_key:"myElDialog",ref:R},{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(()=>[p(D,{type:"export",columns:i(T).columns,searchFields:i(T).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>i(T).searchFields=e),paginationSlot:!1,data:i(T).tableData,onGetTableData:G,loading:i(T).loading,showSelection:!1,showRightRefreshSlot:!1,window_Height:i(C)},{name_slot:n(({row:e})=>[g("span",null,u(e.name),1)]),batch_pr_slot:n(({row:e})=>[g("span",null,u(i(F)(e.global_pr)),1)]),rate_slot:n(({row:e})=>[e.edit?d("",!0):(r(),s(a,{key:0,type:e.global_pr!=e.pr?"danger":""},{default:n(()=>[c(u(i(F)(e.pr)),1)]),_:2},1032,["type"])),e.edit?d("",!0):(r(),s(a,{key:1,type:"primary",onClick:t=>e.edit=!0},{default:n(()=>[p(y,null,{default:n(()=>[p(l)]),_:1})]),_:2},1032,["onClick"])),e.edit?(r(),s(B,{key:2,modelValue:e.pr,"onUpdate:modelValue":t=>e.pr=t,placeholder:"请输入费率",style:{width:"80px"}},null,8,["modelValue","onUpdate:modelValue"])):d("",!0),e.edit?(r(),s(j,{key:3,type:"primary",style:{"margin-left":"4px"},size:"small",onClick:t=>(e=>{let t={group_id:S.currentRow.id,payment_product_id:e.id,pr:e.pr};e.max_cost_pr-e.pr>0?f({title:"提示",message:'<span style="color: red">群组费率小于渠道成本</span>',confirmButtonText:"我已知晓",cancelButtonText:"取消",showCancelButton:!0,type:"warning",dangerouslyUseHTMLString:!0}).then(()=>{f.alert("确定修改群组费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{b(t).then(e=>{G()})}).catch(()=>{e.edit=!1,G()})}).catch(()=>{e.edit=!1,G()}):f.alert("确定修改群组费率吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{b(t).then(e=>{G()})}).catch(()=>{e.edit=!1,G()})})(e)},{default:n(()=>t[2]||(t[2]=[c("保存")])),_:2,__:[2]},1032,["onClick"])):d("",!0)]),_:1},8,["columns","searchFields","data","loading","window_Height"])]),_:1},8,["model-value"])}}};export{k as default};