sf_web_dist/js/supplier-info.1756459140674GjoNlBCI.js
2025-08-29 17:20:14 +08:00

2 lines
12 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{b2 as e,bs as a,r as o,ag as t,b4 as l,d8 as r,c as n,e as s,N as i,w as p,O as u,l as c,d9 as m,an as d,t as g,bb as _,g as y,c8 as h,aX as w,aO as f,a_ as v,ai as D}from"./index.17564591406745lmpCs6q.js";import{_ as b}from"./index.17564591406749F8tamFh.js";/* empty css */import{E as j}from"./el-text.1756459140674dopA6ZEH.js";import C from"./merge-list.1756459140674Ccpt0uJ1.js";import P from"./bind-aircraft.1756459140674BQ4S_Q48.js";import k from"./add-reduce-prepayment.1756459140674i_czvUNV.js";import R from"./prepayment-log.1756459140674_gXpZ0N0.js";import S from"./deposit-channels-set.1756459140674DVPYmCRz.js";import{g as F,c as B,e as U,a as x}from"./payee-suppiler.1756459140674DJUokbTm.js";import{k as A,l as L}from"./payee-user.1756459140674Fz0b5Ipi.js";import{b as V}from"./payee-order.1756459140674BLGymFr4.js";/* empty css */import"./el-col.1756459140674Gn9OdUhz.js";import"./el-card.1756459140674Covu3pnV.js";import"./settlement-log.1756459140674Dqkumcy0.js";import"./payee-count.1756459140674NkajeVpb.js";import"./add-channel.1756459140674CbTRCem0.js";import"./payee-channel.1756459140674CmO9G21x.js";import"./channel-code.1756459140674D8oZXIHb.js";import"./single_fee.1756459140674C6TL5SOM.js";import"./test_channel.1756459140674B9tiofTR.js";import"./el-link.1756459140674NlwSE52a.js";import"./fee-risk.1756459140674IZJcn3Zz.js";import"./el-time-select.1756459140674CwBylOUT.js";import"./copy-channel.1756459140674D27Bk6WV.js";import"./sub-channel.1756459140674BkcBjf_Y.js";import"./sub-channel-add.1756459140674CeHFYp4B.js";import"./sub-channel-fee.1756459140674BTnbqi09.js";import"./sub-channel-risk.1756459140674DvPBVyk7.js";import"./channel-fee.1756459140674BOVqXTPb.js";import"./channel-risk.1756459140674DWnRKiWw.js";import"./staticData.17564591406748wZxkmL4.js";const T={style:{"margin-bottom":"4px"}},M=e({__name:"supplier-info",setup(e){a({legacy:!0});let M=[],z=o("create_time"),I=o("DESC");const E=o("日切清账,关闭通道"),q=o("warning"),O=o("0"),G=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"},{prop:"credit_money",label:"授信额度",align:"center"},{prop:"prepay",label:"预付",align:"center",sortable:"custom",slot:"sum_money_slot"},{prop:"pay_money",label:"跑量",align:"center",sortable:"custom"},{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_name",label:"供应商编号/名称",type:"select",options:[],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:""}],rules:{status:[{required:!0,message:"请选择设置",trigger:"blur"}]},values:{supplier_name:"",warn_money:"",credit_money:"",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}),N=()=>{G.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),$()};l(async()=>{$(),Z(),oe();let e=(await F({saiType:"all"})).map(e=>({label:e.supplier_name,value:e.supplier_name}));G.searchFields.forEach(a=>{"supplier_name"==a.prop&&(a.options=e)})}),r(()=>{clearInterval(ee.value)});let X=!1;const Z=()=>{V().then(e=>{0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(ee.value),O.value=e.system_clear_status,1==e.system_clear_status&&(q.value="danger",E.value="日切清账中,所有支付通道已关闭",X||(oe(),X=!0)),2==e.system_clear_status&&(q.value="success",E.value="日切清账完成,请手动点击开启所有通道")})};const $=()=>{let e={limit:G.per_page,page:G.page,orderBy:z.value,orderType:I.value},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(G.searchFields);F(Object.assign(e,a)).then(e=>{G.tableData=e.data,G.total=e.total}).catch(()=>{G.loading=!1})},H=()=>{G.showAddSupplierDialog=!0,G.addForm.values.id=""},J=o(null),K=()=>{G.dialogShowChannelVisible=!1},Q=()=>{let e=G.addForm.values;e.id?U(e).then(e=>{G.showAddSupplierDialog=!1,f.success("编辑成功!"),$()}):x(e).then(e=>{G.showAddSupplierDialog=!1,$(),f.success("添加成功!")})},W=()=>{if(1==O.value)return f.warning("清账中,请勿重复点击");2!=O.value?ae(4,[]):v.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{Y()}).catch(()=>{})},Y=()=>{L({onoff:"on"}).then(e=>{$(),Z(),E.value="日切清账,关闭通道",q.value="warning",clearInterval(ee.value)}).catch(()=>{})};let ee=o(null);const ae=(e,a)=>{A({type:e,clear_ids:a}).then(e=>{Z(),oe(),setTimeout(()=>{$()},1e3)})},oe=()=>{clearInterval(ee.value),ee.value=setInterval(()=>{Z()},1e4)},te=()=>{$()},le=e=>{"count_money"!=e.prop&&"prepay_money"!=e.prop?(z.value=e.prop,I.value="descending"==e.order?"DESC":"ASC",$()):"descending"==e.order?re(e.prop):"ascending"==e.order?ne(e.prop):$()},re=e=>{G.tableData.sort((a,o)=>{let t="",l="";return"count_money"==e?(t=a.account.money,l=o.account.money):"prepay_money"==e&&(t=a.account.prepay_money,l=o.account.prepay_money),t-l})},ne=e=>{G.tableData.sort((a,o)=>{let t="",l="";return"count_money"==e?(t=a.account.money,l=o.account.money):"prepay_money"==e&&(t=a.account.prepay_money,l=o.account.prepay_money),t-l})};return(e,a)=>{const o=d,t=j,l=_,r=m,F=b,U=h,x=w;return s(),n("div",null,[i(F,{type:"export",columns:y(G).columns,searchFields:y(G).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>y(G).searchFields=e),data:y(G).tableData,per_page:y(G).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>y(G).per_page=e),page:y(G).page,"onUpdate:page":a[2]||(a[2]=e=>y(G).page=e),total:y(G).total,onGetTableData:$,onResetForm:N,loading:y(G).loading,showSelection:!1,showRightRefreshSlot:!1,onSortChange:le},{btns:p(()=>[i(o,{type:"primary",onClick:H},{default:p(()=>a[15]||(a[15]=[u("添加供应商")])),_:1,__:[15]}),i(o,{type:y(q),onClick:W},{default:p(()=>[u(g(y(E)),1)]),_:1},8,["type"])]),count:p(()=>[i(t,null,{default:p(()=>a[16]||(a[16]=[u("总跑量0.0000 总预付0.0000 总应下发0.0000 总剩余0.0000")])),_:1,__:[16]})]),prepay_money_slot:p(({row:e})=>[c("div",null,g(e.account.prepay_money),1)]),count_money_slot:p(({row:e})=>[c("div",null,g(e.account.money),1)]),sum_money_slot:p(({row:e})=>[c("div",null,g(e.account.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=>{v.alert("是否确定对当前用户进行状态切换?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{B({id:e.id,status:e.status}).then(e=>{f.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})=>[c("div",T,[i(r,null,{default:p(()=>[i(o,{type:1==t.clear_status?"danger":"warning",size:"small",onClick:e=>(e=>"1"==e.clear_status?f.warning("清账中,请勿重复点击"):"日切清账完成,请手动点击开启所有通道"==E.value?f.error(E.value):void v.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{f.success("清账中"),ae(4,[e.shop_id])}).catch(()=>{}))(t)},{default:p(()=>[u(g(1==t.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),i(o,{type:"primary",onClick:e=>((e={})=>{G.showBindAircraftDialog=!0,G.currentRow=e})(t),size:"small"},{default:p(()=>a[17]||(a[17]=[u("飞机")])),_:2,__:[17]},1032,["onClick"]),i(o,{type:"warning",onClick:e=>((e={})=>{G.showPrePaymentDialog=!0,G.currentRow=e})(t),size:"small"},{default:p(()=>a[18]||(a[18]=[u("加/减预付")])),_:2,__:[18]},1032,["onClick"])]),_:2},1024)]),c("div",null,[i(r,null,{default:p(()=>[i(o,{type:"primary",onClick:e=>((e={})=>{G.showPrePaymentLogDialog=!0,G.currentRow=e})(t),size:"small"},{default:p(()=>a[19]||(a[19]=[u("预付日志")])),_:2,__:[19]},1032,["onClick"]),i(o,{type:"primary",onClick:e=>((e={})=>{G.dialogShowChannelVisible=!0,D(()=>{J.value&&J.value.filterChannel(e)})})(t),size:"small"},{default:p(()=>a[20]||(a[20]=[u("渠道")])),_:2,__:[20]},1032,["onClick"]),i(o,{type:"primary",onClick:e=>(e=>{G.showAddSupplierDialog=!0,G.addForm.values.supplier_name=e.supplier_name,G.addForm.values.warn_money=e.warn_money,G.addForm.values.credit_money=e.credit_money,G.addForm.values.id=e.id})(t),size:"small"},{default:p(()=>a[21]||(a[21]=[u("编辑")])),_:2,__:[21]},1032,["onClick"]),i(o,{type:"primary",onClick:a=>e.handleFeeRisk(t),size:"small"},{default:p(()=>a[22]||(a[22]=[u("删除")])),_:2,__:[22]},1032,["onClick"])]),_:2},1024)])]),default:p(()=>[a[23]||(a[23]=u('" '))]),_:1,__:[23]},8,["columns","searchFields","data","per_page","page","total","loading"]),i(U,{showDialog:y(G).showAddSupplierDialog,"onUpdate:showDialog":a[3]||(a[3]=e=>y(G).showAddSupplierDialog=e),formData:y(G).addForm,"onUpdate:formData":a[4]||(a[4]=e=>y(G).addForm=e),ref:"addSupplierRef"},{submit:p(()=>[i(o,{type:"primary",onClick:Q},{default:p(()=>a[24]||(a[24]=[u("确定")])),_:1,__:[24]})]),_:1},8,["showDialog","formData"]),i(U,{showDialog:y(G).showMergeSupplierDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>y(G).showMergeSupplierDialog=e),formData:y(G).mergeForm,"onUpdate:formData":a[6]||(a[6]=e=>y(G).mergeForm=e),ref:"productRef"},{submit:p(()=>[i(o,{type:"primary",onClick:e.confirmBatchSetting},{default:p(()=>a[25]||(a[25]=[u("确定")])),_:1,__:[25]},8,["onClick"])]),_:1},8,["showDialog","formData"]),i(C,{showMergeListDialog:y(G).showMergeListDialog,"onUpdate:showMergeListDialog":a[7]||(a[7]=e=>y(G).showMergeListDialog=e)},null,8,["showMergeListDialog"]),i(P,{showBindAircraftDialog:y(G).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[8]||(a[8]=e=>y(G).showBindAircraftDialog=e),currentRow:y(G).currentRow,"onUpdate:currentRow":a[9]||(a[9]=e=>y(G).currentRow=e)},null,8,["showBindAircraftDialog","currentRow"]),i(k,{showPrePaymentDialog:y(G).showPrePaymentDialog,"onUpdate:showPrePaymentDialog":a[10]||(a[10]=e=>y(G).showPrePaymentDialog=e),onConfrimPrePay:te,currentRow:y(G).currentRow,"onUpdate:currentRow":a[11]||(a[11]=e=>y(G).currentRow=e)},null,8,["showPrePaymentDialog","currentRow"]),i(R,{showPrePaymentLogDialog:y(G).showPrePaymentLogDialog,"onUpdate:showPrePaymentLogDialog":a[12]||(a[12]=e=>y(G).showPrePaymentLogDialog=e),currentRow:y(G).currentRow,"onUpdate:currentRow":a[13]||(a[13]=e=>y(G).currentRow=e)},null,8,["showPrePaymentLogDialog","currentRow"]),i(x,{modelValue:y(G).dialogShowChannelVisible,"onUpdate:modelValue":a[14]||(a[14]=e=>y(G).dialogShowChannelVisible=e),title:"渠道管理",width:"70vw","before-close":K},{default:p(()=>[i(S,{ref_key:"depositChannelRef",ref:J},null,512)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-a82e091f"]]);export{M as default};