sf_web_dist/js/supplier-info.CDHsQHFE.js
2025-08-14 20:33:51 +08:00

2 lines
10 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 t,ag as l,b4 as o,c as r,e as s,N as n,w as i,O as p,l as u,d8 as c,an as d,t as m,bb as g,g as h,c8 as _,aX as w,aO as y,a_ as f,ai as D}from"./index.BWytR7iN.js";import{_ as b}from"./index.C4yhrqXY.js";/* empty css */import{E as v}from"./el-text.Du9YCsTZ.js";import j from"./merge-list.TMcpxWT4.js";import C from"./bind-aircraft.CZI5YfVu.js";import P from"./add-reduce-prepayment.CDzf-tDA.js";import k from"./prepayment-log.0FS3rK42.js";import R from"./deposit-channels-set.BCaI4LJK.js";import{g as F,c as S,e as U,a as x}from"./payee-suppiler.BOEfjxZu.js";import{i as B,j as A}from"./payee-user.DRFYUFEm.js";/* empty css */import"./el-col.BK_EqEAK.js";import"./payee-order.BMJGbNb9.js";import"./el-card.BG4Il_so.js";import"./settlement-log.jcNLS0bB.js";import"./add-channel.SOoNh_tM.js";import"./payee-channel.CPuW5z4I.js";import"./channel-code.CB33EiBT.js";import"./single_fee.BVA8pZYU.js";import"./test_channel.B7nZjBvF.js";import"./el-link.KjyFwAak.js";import"./fee-risk.CPUwVgkg.js";import"./el-time-select.CsXIUS8f.js";import"./copy-channel._thqWVjC.js";import"./sub-channel.DzCz8n8Y.js";import"./sub-channel-add.orX3ljOl.js";import"./sub-channel-fee.DNb7Rp93.js";import"./sub-channel-risk.a-nhtQPj.js";import"./channel-fee.C3KjuWtD.js";import"./channel-risk.kl1pHGdw.js";import"./staticData.8wZxkmL4.js";const L={style:{"margin-bottom":"4px"}},V=e({__name:"supplier-info",setup(e){a({legacy:!0});let V=[];const M=t("日切清账,关闭通道"),z=t("warning"),T=t("0"),I=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"},{prop:"credit_money",label:"授信额度",align:"center"},{prop:"prepay",label:"预付",align:"center",sortable:!0},{prop:"pay_money",label:"跑量",align:"center",sortable:!0},{prop:"prepay_money",label:"剩余预付",align:"center",slot:"prepay_money_slot",sortable:!0},{prop:"notify_time",label:"应下发",align:"center",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:"input",value:""}],total:0,page:1,per_page:10,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:V,value:[]},{label:"合并到",type:"select",prop:"status",options:V,value:[]}],rules:{status:[{required:!0,message:"请选择设置",trigger:"blur"}]},values:{status:""}},showMergeListDialog:!1,showBindAircraftDialog:!1,currentRow:{},showPrePaymentDialog:!1,showPrePaymentLogDialog:!1,dialogShowChannelVisible:!1}),O=()=>{I.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),q()};o(()=>{q()});const q=()=>{let e={limit:I.per_page,page:I.page},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(I.searchFields);F(Object.assign(e,a)).then(e=>{I.tableData=e.data,I.total=e.total,clearInterval(J.value),T.value=e.system_clear_status,1==e.system_clear_status&&(z.value="danger",M.value="日切清账中,所有支付通道已关闭",initLoad||(Q(),initLoad=!0)),2==e.system_clear_status&&(z.value="success",M.value="日切清账完成,请手动点击开启所有通道")}).catch(()=>{I.loading=!1})},E=()=>{I.showAddSupplierDialog=!0,I.addForm.values.id=""},X=t(null),G=()=>{I.dialogShowChannelVisible=!1},N=()=>{let e=I.addForm.values;e.id?U(e).then(e=>{I.showAddSupplierDialog=!1,y.success("编辑成功!"),q()}):x(e).then(e=>{I.showAddSupplierDialog=!1,q(),y.success("添加成功!")})},W=()=>1==T.value?y.warning("清账中,请勿重复点击"):2==T.value?Y():void K(4,[]),Y=()=>{A({onoff:"on"}).then(e=>{q(),clearInterval(J.value)}).catch(()=>{})},H=()=>{f.confirm("确定要重置供应的预付吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{}).catch(()=>{})};let J=t(null);const K=(e,a)=>{B({type:e,clear_ids:a}).then(e=>{q(),clearInterval(J.value),Q()})},Q=()=>{J.value=setInterval(()=>{q()},1e4)},Z=()=>{q()};return(e,a)=>{const t=d,l=v,o=g,F=c,U=b,x=_,B=w;return s(),r("div",null,[n(U,{type:"export",columns:h(I).columns,searchFields:h(I).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>h(I).searchFields=e),data:h(I).tableData,per_page:h(I).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>h(I).per_page=e),page:h(I).page,"onUpdate:page":a[2]||(a[2]=e=>h(I).page=e),total:h(I).total,onGetTableData:q,onResetForm:O,loading:h(I).loading,showSelection:!1,showRightRefreshSlot:!1},{btns:i(()=>[n(t,{type:"primary",onClick:E},{default:i(()=>a[15]||(a[15]=[p("添加供应商")])),_:1,__:[15]}),n(t,{type:h(z),onClick:W},{default:i(()=>[p(m(h(M)),1)]),_:1},8,["type"]),n(t,{type:"danger",onClick:H},{default:i(()=>a[16]||(a[16]=[p("重置预付")])),_:1,__:[16]})]),count:i(()=>[n(l,null,{default:i(()=>a[17]||(a[17]=[p("总跑量0.0000 总预付0.0000 总应下发0.0000 总剩余0.0000")])),_:1,__:[17]})]),prepay_money_slot:i(({row:e})=>[u("div",null,m(e.account.prepay_money),1)]),status_slot:i(({row:e})=>[n(o,{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(()=>{S({id:e.id,status:e.status}).then(e=>{y.success("修改成功!")})}).catch(()=>{e.status=1==e.status?2:1})})(e),"active-text":"正常","inactive-text":"停用"},null,8,["modelValue","onUpdate:modelValue","onChange"])]),operate_slot:i(({row:l})=>[u("div",L,[n(F,null,{default:i(()=>[n(t,{type:1==l.clear_status?"danger":"warning",size:"small",onClick:e=>(e=>{if("1"==e.clear_status)return y.warning("清账中,请勿重复点击");f.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{y.success("清账中"),K(4,[e.shop_id])}).catch(()=>{})})(l)},{default:i(()=>[p(m(1==l.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),n(t,{type:"primary",onClick:e=>((e={})=>{I.showBindAircraftDialog=!0,I.currentRow=e})(l),size:"small"},{default:i(()=>a[18]||(a[18]=[p("飞机")])),_:2,__:[18]},1032,["onClick"]),n(t,{type:"primary",onClick:e=>((e={})=>{I.showPrePaymentDialog=!0,I.currentRow=e})(l),size:"small"},{default:i(()=>a[19]||(a[19]=[p("加/减预付")])),_:2,__:[19]},1032,["onClick"])]),_:2},1024)]),u("div",null,[n(F,null,{default:i(()=>[n(t,{type:"primary",onClick:e=>((e={})=>{I.showPrePaymentLogDialog=!0,I.currentRow=e})(l),size:"small"},{default:i(()=>a[20]||(a[20]=[p("预付日志")])),_:2,__:[20]},1032,["onClick"]),n(t,{type:"primary",onClick:e=>((e={})=>{I.dialogShowChannelVisible=!0,D(()=>{X.value&&X.value.filterChannel(e)})})(l),size:"small"},{default:i(()=>a[21]||(a[21]=[p("渠道")])),_:2,__:[21]},1032,["onClick"]),n(t,{type:"primary",onClick:e=>(e=>{I.showAddSupplierDialog=!0,I.addForm.values.supplier_name=e.supplier_name,I.addForm.values.warn_money=e.warn_money,I.addForm.values.credit_money=e.credit_money,I.addForm.values.id=e.id})(l),size:"small"},{default:i(()=>a[22]||(a[22]=[p("编辑")])),_:2,__:[22]},1032,["onClick"]),n(t,{type:"primary",onClick:a=>e.handleFeeRisk(l),size:"small"},{default:i(()=>a[23]||(a[23]=[p("删除")])),_:2,__:[23]},1032,["onClick"])]),_:2},1024)])]),default:i(()=>[a[24]||(a[24]=p('" '))]),_:1,__:[24]},8,["columns","searchFields","data","per_page","page","total","loading"]),n(x,{showDialog:h(I).showAddSupplierDialog,"onUpdate:showDialog":a[3]||(a[3]=e=>h(I).showAddSupplierDialog=e),formData:h(I).addForm,"onUpdate:formData":a[4]||(a[4]=e=>h(I).addForm=e),ref:"addSupplierRef"},{submit:i(()=>[n(t,{type:"primary",onClick:N},{default:i(()=>a[25]||(a[25]=[p("确定")])),_:1,__:[25]})]),_:1},8,["showDialog","formData"]),n(x,{showDialog:h(I).showMergeSupplierDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>h(I).showMergeSupplierDialog=e),formData:h(I).mergeForm,"onUpdate:formData":a[6]||(a[6]=e=>h(I).mergeForm=e),ref:"productRef"},{submit:i(()=>[n(t,{type:"primary",onClick:e.confirmBatchSetting},{default:i(()=>a[26]||(a[26]=[p("确定")])),_:1,__:[26]},8,["onClick"])]),_:1},8,["showDialog","formData"]),n(j,{showMergeListDialog:h(I).showMergeListDialog,"onUpdate:showMergeListDialog":a[7]||(a[7]=e=>h(I).showMergeListDialog=e)},null,8,["showMergeListDialog"]),n(C,{showBindAircraftDialog:h(I).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[8]||(a[8]=e=>h(I).showBindAircraftDialog=e),currentRow:h(I).currentRow,"onUpdate:currentRow":a[9]||(a[9]=e=>h(I).currentRow=e)},null,8,["showBindAircraftDialog","currentRow"]),n(P,{showPrePaymentDialog:h(I).showPrePaymentDialog,"onUpdate:showPrePaymentDialog":a[10]||(a[10]=e=>h(I).showPrePaymentDialog=e),onConfrimPrePay:Z,currentRow:h(I).currentRow,"onUpdate:currentRow":a[11]||(a[11]=e=>h(I).currentRow=e)},null,8,["showPrePaymentDialog","currentRow"]),n(k,{showPrePaymentLogDialog:h(I).showPrePaymentLogDialog,"onUpdate:showPrePaymentLogDialog":a[12]||(a[12]=e=>h(I).showPrePaymentLogDialog=e),currentRow:h(I).currentRow,"onUpdate:currentRow":a[13]||(a[13]=e=>h(I).currentRow=e)},null,8,["showPrePaymentLogDialog","currentRow"]),n(B,{modelValue:h(I).dialogShowChannelVisible,"onUpdate:modelValue":a[14]||(a[14]=e=>h(I).dialogShowChannelVisible=e),title:"渠道管理",width:"70vw","before-close":G},{default:i(()=>[n(R,{ref_key:"depositChannelRef",ref:X},null,512)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-e1223146"]]);export{V as default};