sf_web_dist/js/supplier-info.1758003331317BZDJqnRs.js
2025-09-16 14:17:15 +08:00

2 lines
13 KiB
JavaScript

import{b2 as e,bt as a,r as l,ag as t,b4 as o,dj as r,c as n,e as s,N as i,w as p,l as u,dl as c,an as d,O as m,t as _,bb as g,g as y,c9 as h,aX as w,aO as v,a_ as f,ai as b,ds as D,dt as k}from"./index.1758003331317vvB65Rub.js";import{_ as F}from"./index.1758003331317CzYz1jbO.js";/* empty css */import C from"./merge-list.1758003331317BNcSCkip.js";import j from"./bind-aircraft.1758003331317Cp4sAUw5.js";import P from"./add-reduce-prepayment.1758003331317BEIsXKeF.js";import x from"./prepayment-log.1758003331317B3fJL1M5.js";import R from"./deposit-channels-set.1758003331317BzTW6snJ.js";import{g as S,c as B,e as U,a as A}from"./payee-suppiler.1758003331317Bi1EFvJR.js";import{b as L}from"./payee-order.1758003331317CaCJqbSU.js";import{p as T}from"./common.1758003331317CCwWzMi9.js";/* empty css */import"./el-col.1758003331317V7vwfNFl.js";import"./el-text.1758003331317BzviT3zm.js";import"./el-card.1758003331317D6OzpBrD.js";import"./settlement-log.1758003331317BEWapgzj.js";import"./payee-count.1758003331317DnOTTpcH.js";import"./add-channel.1758003331317Cm8msRAl.js";import"./channel-code.1758003331317Dd5AHrZl.js";import"./single_fee.1758003331317D17dYuSe.js";import"./test_channel.1758003331317vCZrF5WQ.js";import"./el-link.1758003331317BzshAUaa.js";import"./fee-risk.1758003331317B_OnVOEq.js";import"./el-time-select.1758003331317W-c5yTUq.js";import"./copy-channel.1758003331317BUJj4ERG.js";import"./sub-channel.1758003331317lNw8BlIP.js";import"./sub-channel-add.1758003331317DNaQsK7g.js";import"./sub-channel-fee.1758003331317DwkWq58K.js";import"./sub-channel-risk.1758003331317D9FNVTML.js";import"./channel-fee.1758003331317Cm48knDG.js";import"./channel-risk.1758003331317CwsnlRfP.js";import"./staticData.17580033313178wZxkmL4.js";const V={style:{"margin-bottom":"4px"}},I=e({__name:"supplier-info",setup(e){a({legacy:!0});let I=[],M=l("create_time"),z=l("DESC");const O=l("日切清账,关闭通道"),E=l("warning"),N=l("0"),q=t({columns:[{prop:"id",label:"ID",align:"center",width:"80"},{prop:"shop_id",label:"供应商编号",align:"center",width:"100"},{prop:"supplier_name",label:"供应商名称",align:"center"},{prop:"telegram_group",label:"飞机群ID",align:"center"},{prop:"warn_money",label:"预警金额",align:"center",formatter:T},{prop:"credit_money",label:"授信额度",align:"center",formatter:T},{prop:"prepay",label:"预付",align:"center",sortable:"custom",slot:"sum_money_slot"},{prop:"money",label:"跑量",align:"center",sortable:"custom",formatter:T},{prop:"prepay_money",label:"剩余预付",align:"center",slot:"prepay_money_slot",sortable:!0},{prop:"count_money",label:"应下发",align:"center",slot:"count_money_slot",sortable:!0},{prop:"status",label:"状态",align:"center",slot:"status_slot",width:"80"},{prop:"create_time",label:"注册时间",align:"center"},{prop:"ca",label:"操作",align:"center",slot:"operate_slot",width:"240px"}],tableData:[],searchFields:[{prop:"supplier_query",label:"供应商编号/名称",type:"input",value:""}],total:0,page:1,per_page:50,loading:!1,showAddSupplierDialog:!1,addForm:{title:"添加供应商",fields:[{label:"供应商名称",type:"input",prop:"supplier_name",value:""},{label:"预警金额",type:"input_num",prop:"warn_money",value:""},{label:"授信额度",type:"number",prop:"credit_money",value:""},{label:"网关地址",type:"input",prop:"gateway",value:""},{label:"页面通知",type:"input",prop:"notify_url",value:""},{label:"接口类名称",type:"input",prop:"class_name",value:""},{label:"商户id",type:"input",prop:"mer_id",value:""},{label:"密钥",type:"input",prop:"mer_key",value:""},{label:"回调IP白名单",type:"textarea",prop:"callback_white_ip",value:"",htmlTxt:"<el-text type='danger'>使用英文,分割</el-text>"},{label:"扩展字段",type:"input",prop:"extend",value:""}],rules:{},values:{supplier_name:"",warn_money:"",credit_money:"",gateway:"",notify_url:"",class_name:"",mer_id:"",mer_key:"",callback_white_ip:"",extend:"",id:""}},showMergeSupplierDialog:!1,mergeForm:{title:"合并供应商",fields:[{label:"供应商从",type:"select",prop:"status",options:I,value:[]},{label:"合并到",type:"select",prop:"status",options:I,value:[]}],rules:{status:[{required:!0,message:"请选择设置",trigger:"blur"}]},values:{status:""}},showMergeListDialog:!1,showBindAircraftDialog:!1,currentRow:{},showPrePaymentDialog:!1,showPrePaymentLogDialog:!1,dialogShowChannelVisible:!1}),J=()=>{q.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),$()};o(async()=>{$(),X(),le();let e=(await S({saiType:"all"})).map(e=>({label:e.supplier_name,value:e.supplier_name}));q.searchFields.forEach(a=>{"supplier_name"==a.prop&&(a.options=e)})}),r(()=>{clearInterval(ee.value)});let G=!1;const X=()=>{L().then(e=>{0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(ee.value),N.value=e.system_clear_status,1==e.system_clear_status&&(E.value="danger",O.value="日切清账中,所有支付通道已关闭",G||(le(),G=!0)),2==e.system_clear_status&&(E.value="success",O.value="日切清账完成,请手动点击开启所有通道")})};const $=()=>{let e={limit:q.per_page,page:q.page,orderBy:M.value,orderType:z.value},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(q.searchFields);S(Object.assign(e,a)).then(e=>{q.tableData=e.data,q.total=e.total}).catch(()=>{q.loading=!1})},H=()=>{q.showAddSupplierDialog=!0,q.addForm.values.id="",q.addForm.values.supplier_name="",q.addForm.values.warn_money="",q.addForm.values.credit_money="",q.addForm.values.gateway="",q.addForm.values.notify_url="",q.addForm.values.class_name="",q.addForm.values.mer_id="",q.addForm.values.mer_key="",q.addForm.values.callback_white_ip="",q.addForm.values.extend=""},K=l(null),Q=()=>{q.dialogShowChannelVisible=!1},W=()=>{let e=JSON.parse(JSON.stringify(q.addForm.values));delete e.callback_white_ip,e.callback_white_ip=q.addForm.values.callback_white_ip?q.addForm.values.callback_white_ip.split(","):"",e.id?U(e).then(e=>{q.showAddSupplierDialog=!1,v.success("编辑成功!"),$()}):A(e).then(e=>{q.showAddSupplierDialog=!1,$(),v.success("添加成功!")})},Y=()=>{if(1==N.value)return v.warning("清账中,请勿重复点击");2!=N.value?ae(4,[]):f.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{Z()}).catch(()=>{})},Z=()=>{k({onoff:"on"}).then(e=>{$(),X(),O.value="日切清账,关闭通道",E.value="warning",clearInterval(ee.value)}).catch(()=>{})};let ee=l(null);const ae=(e,a)=>{D({type:e,clear_ids:a}).then(e=>{X(),le(),setTimeout(()=>{$()},1e3)})},le=()=>{clearInterval(ee.value),ee.value=setInterval(()=>{X()},1e4)},te=()=>{$()},oe=e=>{"count_money"!=e.prop&&"prepay_money"!=e.prop?(M.value=e.prop,z.value="descending"==e.order?"DESC":"ASC",$()):"descending"==e.order?re(e.prop):"ascending"==e.order?ne(e.prop):$()},re=e=>{q.tableData.sort((a,l)=>{let t="",o="";return"count_money"==e?(t=a.account.money,o=l.account.money):"prepay_money"==e&&(t=a.account.prepay_money,o=l.account.prepay_money),t-o})},ne=e=>{q.tableData.sort((a,l)=>{let t="",o="";return"count_money"==e?(t=a.account.money,o=l.account.money):"prepay_money"==e&&(t=a.account.prepay_money,o=l.account.prepay_money),t-o})};return(e,a)=>{const l=d,t=g,o=c,r=F,D=h,k=w;return s(),n("div",null,[i(r,{type:"export",columns:y(q).columns,searchFields:y(q).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>y(q).searchFields=e),data:y(q).tableData,per_page:y(q).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>y(q).per_page=e),page:y(q).page,"onUpdate:page":a[2]||(a[2]=e=>y(q).page=e),total:y(q).total,onGetTableData:$,onResetForm:J,loading:y(q).loading,showSelection:!1,showRightRefreshSlot:!1,onSortChange:oe},{btns:p(()=>[i(l,{type:"primary",onClick:H},{default:p(()=>a[15]||(a[15]=[m("添加供应商")])),_:1,__:[15]}),i(l,{type:y(E),onClick:Y},{default:p(()=>[m(_(y(O)),1)]),_:1},8,["type"])]),prepay_money_slot:p(({row:e})=>{var a;return[u("div",null,_(y(T)(null==(a=null==e?void 0:e.account)?void 0:a.prepay_money)),1)]}),count_money_slot:p(({row:e})=>{var a;return[u("div",null,_(y(T)(null==(a=null==e?void 0:e.account)?void 0:a.money)),1)]}),sum_money_slot:p(({row:e})=>{var a;return[u("div",null,_(y(T)(null==(a=null==e?void 0:e.account)?void 0:a.sum_money)),1)]}),status_slot:p(({row:e})=>[i(t,{modelValue:e.status,"onUpdate:modelValue":a=>e.status=a,"inline-prompt":"","active-value":1,"inactive-value":2,onChange:a=>(e=>{f.alert("是否确定对当前用户进行状态切换?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{B({id:e.id,status:e.status}).then(e=>{v.success("修改成功!")})}).catch(()=>{e.status=1==e.status?2:1})})(e),"active-text":"正常","inactive-text":"停用"},null,8,["modelValue","onUpdate:modelValue","onChange"])]),operate_slot:p(({row:t})=>[u("div",V,[i(o,null,{default:p(()=>[i(l,{type:1==t.clear_status?"danger":"warning",size:"small",onClick:e=>(e=>"1"==e.clear_status?v.warning("清账中,请勿重复点击"):"日切清账完成,请手动点击开启所有通道"==O.value?v.error(O.value):void f.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{v.success("清账中"),ae(4,[e.shop_id])}).catch(()=>{}))(t)},{default:p(()=>[m(_(1==t.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),i(l,{type:"primary",onClick:e=>((e={})=>{q.showBindAircraftDialog=!0,q.currentRow=e})(t),size:"small"},{default:p(()=>a[16]||(a[16]=[m("飞机")])),_:2,__:[16]},1032,["onClick"]),i(l,{type:"warning",onClick:e=>((e={})=>{q.showPrePaymentDialog=!0,q.currentRow=e})(t),size:"small"},{default:p(()=>a[17]||(a[17]=[m("加/减预付")])),_:2,__:[17]},1032,["onClick"])]),_:2},1024)]),u("div",null,[i(o,null,{default:p(()=>[i(l,{type:"primary",onClick:e=>((e={})=>{q.showPrePaymentLogDialog=!0,q.currentRow=e})(t),size:"small"},{default:p(()=>a[18]||(a[18]=[m("预付日志")])),_:2,__:[18]},1032,["onClick"]),i(l,{type:"primary",onClick:e=>((e={})=>{q.dialogShowChannelVisible=!0,b(()=>{K.value&&K.value.filterChannel(e)})})(t),size:"small"},{default:p(()=>a[19]||(a[19]=[m("渠道")])),_:2,__:[19]},1032,["onClick"]),i(l,{type:"primary",onClick:e=>(e=>{q.showAddSupplierDialog=!0,q.addForm.values.supplier_name=e.supplier_name,q.addForm.values.warn_money=e.warn_money,q.addForm.values.credit_money=e.credit_money,q.addForm.values.id=e.id,q.addForm.values.gateway=e.gateway,q.addForm.values.notify_url=e.notify_url,q.addForm.values.class_name=e.class_name,q.addForm.values.mer_id=e.mer_id,q.addForm.values.mer_key=e.mer_key,q.addForm.values.callback_white_ip=(null==e?void 0:e.callback_white_ip)?JSON.parse(e.callback_white_ip).join(","):"",q.addForm.values.extend=e.extend})(t),size:"small"},{default:p(()=>a[20]||(a[20]=[m("编辑")])),_:2,__:[20]},1032,["onClick"]),i(l,{type:"primary",onClick:a=>e.handleFeeRisk(t),size:"small"},{default:p(()=>a[21]||(a[21]=[m("删除")])),_:2,__:[21]},1032,["onClick"])]),_:2},1024)])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),i(D,{showDialog:y(q).showAddSupplierDialog,"onUpdate:showDialog":a[3]||(a[3]=e=>y(q).showAddSupplierDialog=e),formData:y(q).addForm,"onUpdate:formData":a[4]||(a[4]=e=>y(q).addForm=e),ref:"addSupplierRef"},{submit:p(()=>[i(l,{type:"primary",onClick:W},{default:p(()=>a[22]||(a[22]=[m("确定")])),_:1,__:[22]})]),_:1},8,["showDialog","formData"]),i(D,{showDialog:y(q).showMergeSupplierDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>y(q).showMergeSupplierDialog=e),formData:y(q).mergeForm,"onUpdate:formData":a[6]||(a[6]=e=>y(q).mergeForm=e),ref:"productRef"},{submit:p(()=>[i(l,{type:"primary",onClick:e.confirmBatchSetting},{default:p(()=>a[23]||(a[23]=[m("确定")])),_:1,__:[23]},8,["onClick"])]),_:1},8,["showDialog","formData"]),i(C,{showMergeListDialog:y(q).showMergeListDialog,"onUpdate:showMergeListDialog":a[7]||(a[7]=e=>y(q).showMergeListDialog=e)},null,8,["showMergeListDialog"]),i(j,{showBindAircraftDialog:y(q).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[8]||(a[8]=e=>y(q).showBindAircraftDialog=e),currentRow:y(q).currentRow,"onUpdate:currentRow":a[9]||(a[9]=e=>y(q).currentRow=e)},null,8,["showBindAircraftDialog","currentRow"]),i(P,{showPrePaymentDialog:y(q).showPrePaymentDialog,"onUpdate:showPrePaymentDialog":a[10]||(a[10]=e=>y(q).showPrePaymentDialog=e),onConfrimPrePay:te,currentRow:y(q).currentRow,"onUpdate:currentRow":a[11]||(a[11]=e=>y(q).currentRow=e)},null,8,["showPrePaymentDialog","currentRow"]),i(x,{showPrePaymentLogDialog:y(q).showPrePaymentLogDialog,"onUpdate:showPrePaymentLogDialog":a[12]||(a[12]=e=>y(q).showPrePaymentLogDialog=e),currentRow:y(q).currentRow,"onUpdate:currentRow":a[13]||(a[13]=e=>y(q).currentRow=e)},null,8,["showPrePaymentLogDialog","currentRow"]),i(k,{modelValue:y(q).dialogShowChannelVisible,"onUpdate:modelValue":a[14]||(a[14]=e=>y(q).dialogShowChannelVisible=e),title:"渠道管理",width:"70vw","before-close":Q},{default:p(()=>[i(R,{ref_key:"depositChannelRef",ref:K},null,512)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-2a47404f"]]);export{I as default};