sf_web_dist/js/supplier-info.1760951033397Dyg6U6iE.js
2025-10-20 17:04:56 +08:00

2 lines
13 KiB
JavaScript

import{b3 as e,bu as a,r as t,ag as l,b5 as o,dm as r,c as n,e as s,N as i,w as p,l as u,dp as c,an as d,O as m,t as _,bc as g,g as y,ca as h,aX as w,aO as v,a$ as f,ai as b,dw as D,dx as F}from"./index.1760951033397DkciTaBu.js";import{_ as k}from"./index.1760951033397ddktKltv.js";/* empty css */import C from"./merge-list.1760951033397BoNvXTym.js";import j from"./bind-aircraft.1760951033397yJZRAwls.js";import P from"./add-reduce-prepayment.1760951033397CDtZQD8T.js";import x from"./prepayment-log.1760951033397Bay1MWms.js";import R from"./deposit-channels-set.1760951033397D5fDB8W9.js";import{g as S,d as B,c as U,e as A,a as L}from"./payee-suppiler.1760951033397BF7LrcN4.js";import{b as T}from"./payee-order.1760951033397COOHrl_G.js";import{p as V}from"./common.1760951033397CCwWzMi9.js";/* empty css */import"./el-col.1760951033397-rTOfC7Z.js";import"./el-text.1760951033397BDEcsA1s.js";import"./el-card.1760951033397mbcAsi-d.js";import"./settlement-log.17609510333975nlDsKLi.js";import"./payee-count.1760951033397OjFQ7F1b.js";import"./add-channel.1760951033397qw5x_EAQ.js";import"./channel-code.1760951033397D_yWWNuw.js";import"./single_fee.1760951033397ByvBEDRm.js";import"./test_channel.1760951033397Br4oKzee.js";import"./el-link.1760951033397CDtQ4T4O.js";import"./fee-risk.1760951033397GJb3LYWg.js";import"./el-time-select.1760951033397BOmgmBjp.js";import"./copy-channel.1760951033397CgbXM8wl.js";import"./sub-channel.1760951033397cXOFxmIU.js";import"./sub-channel-add.1760951033397BnkMaB8E.js";import"./sub-channel-fee.1760951033397BPBy63Qa.js";import"./sub-channel-risk.1760951033397DHkiEWjY.js";import"./channel-fee.1760951033397CZwwhGqM.js";import"./channel-risk.1760951033397CJnotlJm.js";import"./staticData.1760951033397ieVX5Cz9.js";const I={style:{"margin-bottom":"4px"}},M=e({__name:"supplier-info",setup(e){a({legacy:!0});let M=[],z=t("create_time"),O=t("DESC");const E=t("日切清账,关闭通道"),q=t("warning"),N=t("0"),J=l({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:V},{prop:"credit_money",label:"授信额度",align:"center",formatter:V},{prop:"prepay",label:"预付",align:"center",sortable:"custom",slot:"sum_money_slot"},{prop:"money",label:"跑量",align:"center",sortable:"custom",formatter:V},{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:M,value:[]},{label:"合并到",type:"select",prop:"status",options:M,value:[]}],rules:{status:[{required:!0,message:"请选择设置",trigger:"blur"}]},values:{status:""}},showMergeListDialog:!1,showBindAircraftDialog:!1,currentRow:{},showPrePaymentDialog:!1,showPrePaymentLogDialog:!1,dialogShowChannelVisible:!1}),G=()=>{J.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),$()};o(async()=>{$(),Y(),le();let e=(await S({saiType:"all"})).map(e=>({label:e.supplier_name,value:e.supplier_name}));J.searchFields.forEach(a=>{"supplier_name"==a.prop&&(a.options=e)})}),r(()=>{clearInterval(ae.value)});let X=!1;const Y=()=>{T().then(e=>{0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(ae.value),N.value=e.system_clear_status,1==e.system_clear_status&&(q.value="danger",E.value="日切清账中,所有支付通道已关闭",X||(le(),X=!0)),2==e.system_clear_status&&(q.value="success",E.value="日切清账完成00:00系统自动开启所有通道")})};const $=()=>{let e={limit:J.per_page,page:J.page,orderBy:z.value,orderType:O.value},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(J.searchFields);S(Object.assign(e,a)).then(e=>{J.tableData=e.data,J.total=e.total}).catch(()=>{J.loading=!1})},H=()=>{J.showAddSupplierDialog=!0,J.addForm.values.id="",J.addForm.values.supplier_name="",J.addForm.values.warn_money="",J.addForm.values.credit_money="",J.addForm.values.gateway="",J.addForm.values.notify_url="",J.addForm.values.class_name="",J.addForm.values.mer_id="",J.addForm.values.mer_key="",J.addForm.values.callback_white_ip="",J.addForm.values.extend=""},K=t(null),Q=()=>{J.dialogShowChannelVisible=!1},W=()=>{let e=JSON.parse(JSON.stringify(J.addForm.values));delete e.callback_white_ip,e.callback_white_ip=J.addForm.values.callback_white_ip?J.addForm.values.callback_white_ip.split(","):"",e.id?A(e).then(e=>{J.showAddSupplierDialog=!1,v.success("编辑成功!"),$()}):L(e).then(e=>{J.showAddSupplierDialog=!1,$(),v.success("添加成功!")})},Z=()=>{if(1==N.value)return v.warning("清账中,请勿重复点击");2!=N.value?te(4,[]):f.alert("确定手动开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{ee()}).catch(()=>{})},ee=()=>{F({onoff:"on"}).then(e=>{$(),Y(),E.value="日切清账,关闭通道",q.value="warning",clearInterval(ae.value)}).catch(()=>{})};let ae=t(null);const te=(e,a)=>{D({type:e,clear_ids:a}).then(e=>{Y(),le(),setTimeout(()=>{$()},1e3)})},le=()=>{clearInterval(ae.value),ae.value=setInterval(()=>{Y()},1e4)},oe=()=>{$()},re=()=>{$()},ne=e=>{"count_money"!=e.prop&&"prepay_money"!=e.prop?(z.value=e.prop,O.value="descending"==e.order?"DESC":"ASC",$()):"descending"==e.order?se(e.prop):"ascending"==e.order?ie(e.prop):$()},se=e=>{J.tableData.sort((a,t)=>{let l="",o="";return"count_money"==e?(l=a.account.money,o=t.account.money):"prepay_money"==e&&(l=a.account.prepay_money,o=t.account.prepay_money),l-o})},ie=e=>{J.tableData.sort((a,t)=>{let l="",o="";return"count_money"==e?(l=a.account.money,o=t.account.money):"prepay_money"==e&&(l=a.account.prepay_money,o=t.account.prepay_money),l-o})};return(e,a)=>{const t=d,l=g,o=c,r=k,D=h,F=w;return s(),n("div",null,[i(r,{type:"export",columns:y(J).columns,searchFields:y(J).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>y(J).searchFields=e),data:y(J).tableData,per_page:y(J).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>y(J).per_page=e),page:y(J).page,"onUpdate:page":a[2]||(a[2]=e=>y(J).page=e),total:y(J).total,onGetTableData:$,onResetForm:G,loading:y(J).loading,showSelection:!1,showRightRefreshSlot:!1,onSortChange:ne},{btns:p(()=>[i(t,{type:"primary",onClick:H},{default:p(()=>a[15]||(a[15]=[m("添加供应商")])),_:1,__:[15]}),i(t,{type:y(q),onClick:Z},{default:p(()=>[m(_(y(E)),1)]),_:1},8,["type"])]),prepay_money_slot:p(({row:e})=>{var a;return[u("div",null,_(y(V)(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(V)(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(V)(null==(a=null==e?void 0:e.account)?void 0:a.sum_money)),1)]}),status_slot:p(({row:e})=>[i(l,{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(()=>{U({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:e})=>[u("div",I,[i(o,null,{default:p(()=>[i(t,{type:1==e.clear_status?"danger":"warning",size:"small",onClick:a=>(e=>"1"==e.clear_status?v.warning("清账中,请勿重复点击"):"日切清账完成00:00系统自动开启所有通道"==E.value?v.error(E.value):void f.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{v.success("清账中"),te(4,[e.shop_id])}).catch(()=>{}))(e)},{default:p(()=>[m(_(1==e.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),i(t,{type:"primary",onClick:a=>((e={})=>{J.showBindAircraftDialog=!0,J.currentRow=e})(e),size:"small"},{default:p(()=>a[16]||(a[16]=[m("飞机")])),_:2,__:[16]},1032,["onClick"]),i(t,{type:"warning",onClick:a=>((e={})=>{J.showPrePaymentDialog=!0,J.currentRow=e})(e),size:"small"},{default:p(()=>a[17]||(a[17]=[m("加/减预付")])),_:2,__:[17]},1032,["onClick"])]),_:2},1024)]),u("div",null,[i(o,null,{default:p(()=>[i(t,{type:"primary",onClick:a=>((e={})=>{J.showPrePaymentLogDialog=!0,J.currentRow=e})(e),size:"small"},{default:p(()=>a[18]||(a[18]=[m("预付日志")])),_:2,__:[18]},1032,["onClick"]),i(t,{type:"primary",onClick:a=>((e={})=>{J.dialogShowChannelVisible=!0,b(()=>{K.value&&K.value.filterChannel(e)})})(e),size:"small"},{default:p(()=>a[19]||(a[19]=[m("渠道")])),_:2,__:[19]},1032,["onClick"]),i(t,{type:"primary",onClick:a=>(e=>{J.showAddSupplierDialog=!0,J.addForm.values.supplier_name=e.supplier_name,J.addForm.values.warn_money=e.warn_money,J.addForm.values.credit_money=e.credit_money,J.addForm.values.id=e.id,J.addForm.values.gateway=e.gateway,J.addForm.values.notify_url=e.notify_url,J.addForm.values.class_name=e.class_name,J.addForm.values.mer_id=e.mer_id,J.addForm.values.mer_key=e.mer_key,J.addForm.values.callback_white_ip=(null==e?void 0:e.callback_white_ip)?JSON.parse(e.callback_white_ip).join(","):"",J.addForm.values.extend=e.extend})(e),size:"small"},{default:p(()=>a[20]||(a[20]=[m("编辑")])),_:2,__:[20]},1032,["onClick"]),i(t,{type:"primary",onClick:a=>(e=>{f.alert("是否确定删除当前供应商?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{B({id:e.id}).then(e=>{v.success("删除成功!"),$()})})})(e),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(J).showAddSupplierDialog,"onUpdate:showDialog":a[3]||(a[3]=e=>y(J).showAddSupplierDialog=e),formData:y(J).addForm,"onUpdate:formData":a[4]||(a[4]=e=>y(J).addForm=e),ref:"addSupplierRef"},{submit:p(()=>[i(t,{type:"primary",onClick:W},{default:p(()=>a[22]||(a[22]=[m("确定")])),_:1,__:[22]})]),_:1},8,["showDialog","formData"]),i(D,{showDialog:y(J).showMergeSupplierDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>y(J).showMergeSupplierDialog=e),formData:y(J).mergeForm,"onUpdate:formData":a[6]||(a[6]=e=>y(J).mergeForm=e),ref:"productRef"},{submit:p(()=>[i(t,{type:"primary",onClick:e.confirmBatchSetting},{default:p(()=>a[23]||(a[23]=[m("确定")])),_:1,__:[23]},8,["onClick"])]),_:1},8,["showDialog","formData"]),i(C,{showMergeListDialog:y(J).showMergeListDialog,"onUpdate:showMergeListDialog":a[7]||(a[7]=e=>y(J).showMergeListDialog=e)},null,8,["showMergeListDialog"]),i(j,{showBindAircraftDialog:y(J).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[8]||(a[8]=e=>y(J).showBindAircraftDialog=e),currentRow:y(J).currentRow,"onUpdate:currentRow":a[9]||(a[9]=e=>y(J).currentRow=e),onRefreshLoad:re},null,8,["showBindAircraftDialog","currentRow"]),i(P,{showPrePaymentDialog:y(J).showPrePaymentDialog,"onUpdate:showPrePaymentDialog":a[10]||(a[10]=e=>y(J).showPrePaymentDialog=e),onConfrimPrePay:oe,currentRow:y(J).currentRow,"onUpdate:currentRow":a[11]||(a[11]=e=>y(J).currentRow=e)},null,8,["showPrePaymentDialog","currentRow"]),i(x,{showPrePaymentLogDialog:y(J).showPrePaymentLogDialog,"onUpdate:showPrePaymentLogDialog":a[12]||(a[12]=e=>y(J).showPrePaymentLogDialog=e),currentRow:y(J).currentRow,"onUpdate:currentRow":a[13]||(a[13]=e=>y(J).currentRow=e)},null,8,["showPrePaymentLogDialog","currentRow"]),i(F,{modelValue:y(J).dialogShowChannelVisible,"onUpdate:modelValue":a[14]||(a[14]=e=>y(J).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-4fc50be4"]]);export{M as default};