sf_web_dist/js/supplier-info.Dw1TTKyd.js
2025-08-25 17:12:04 +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 t,ag as o,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.DpTrk04W.js";import{_ as b}from"./index.B9z9vlz0.js";/* empty css */import{E as C}from"./el-text._Dsb_OuH.js";import j from"./merge-list.CiIXSDq8.js";import k from"./bind-aircraft.LZM1g1JW.js";import P from"./add-reduce-prepayment.BMQWz3bC.js";import R from"./prepayment-log.DlNiNIth.js";import S from"./deposit-channels-set.zhdEpWtv.js";import{g as F,c as B,e as x,a as U}from"./payee-suppiler.jkhhq4F7.js";import{k as A,l as L}from"./payee-user.KHsPGkDg.js";import{b as T}from"./payee-order.CBQCTvIh.js";/* empty css */import"./el-col.C6R59TWy.js";import"./el-card.Hc3mYuG1.js";import"./settlement-log.CFSSOLRM.js";import"./payee-count.CSwtnvuh.js";import"./add-channel.BgUP1WRV.js";import"./payee-channel.CxDNt_0m.js";import"./channel-code.CtBhXevZ.js";import"./single_fee.PhfUhTEI.js";import"./test_channel.C0al2tct.js";import"./el-link.BpTeNAFy.js";import"./fee-risk.BA_jQKJs.js";import"./el-time-select.D8jmlFuI.js";import"./copy-channel.dbjbwfms.js";import"./sub-channel.BzgQa-eZ.js";import"./sub-channel-add.BK37O9pT.js";import"./sub-channel-fee.BuJWZco2.js";import"./sub-channel-risk.t1PeJqtY.js";import"./channel-fee.Boe8XR5U.js";import"./channel-risk.D9x9BHrG.js";import"./staticData.8wZxkmL4.js";const V={style:{"margin-bottom":"4px"}},M=e({__name:"supplier-info",setup(e){a({legacy:!0});let M=[],z=t("create_time"),I=t("DESC");const E=t("日切清账,关闭通道"),q=t("warning"),O=t("0"),X=o({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"},{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: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: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=()=>{X.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),Y()};l(async()=>{Y(),Q(),oe();let e=(await F({saiType:"all"})).map(e=>({label:e.supplier_name,value:e.supplier_name}));X.searchFields.forEach(a=>{"supplier_name"==a.prop&&(a.options=e)})}),r(()=>{clearInterval(ae.value)});let N=!1;const Q=()=>{T().then(e=>{0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(ae.value),O.value=e.system_clear_status,1==e.system_clear_status&&(q.value="danger",E.value="日切清账中,所有支付通道已关闭",N||(oe(),N=!0)),2==e.system_clear_status&&(q.value="success",E.value="日切清账完成,请手动点击开启所有通道")})};const Y=()=>{let e={limit:X.per_page,page:X.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}(X.searchFields);F(Object.assign(e,a)).then(e=>{X.tableData=e.data,X.total=e.total}).catch(()=>{X.loading=!1})},Z=()=>{X.showAddSupplierDialog=!0,X.addForm.values.id=""},H=t(null),J=()=>{X.dialogShowChannelVisible=!1},K=()=>{let e=X.addForm.values;e.id?x(e).then(e=>{X.showAddSupplierDialog=!1,f.success("编辑成功!"),Y()}):U(e).then(e=>{X.showAddSupplierDialog=!1,Y(),f.success("添加成功!")})},W=()=>{if(1==O.value)return f.warning("清账中,请勿重复点击");2!=O.value?te(4,[]):v.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{$()}).catch(()=>{})},$=()=>{L({onoff:"on"}).then(e=>{Y(),Q(),E.value="日切清账,关闭通道",q.value="warning",clearInterval(ae.value)}).catch(()=>{})},ee=()=>{v.confirm("确定要重置供应的预付吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{}).catch(()=>{})};let ae=t(null);const te=(e,a)=>{A({type:e,clear_ids:a}).then(e=>{Q(),oe(),setTimeout(()=>{Y()},1e3)})},oe=()=>{clearInterval(ae.value),ae.value=setInterval(()=>{Q()},1e4)},le=()=>{Y()},re=e=>{"count_money"!=e.prop&&"prepay_money"!=e.prop?(z.value=e.prop,I.value="descending"==e.order?"DESC":"ASC",Y()):"descending"==e.order?ne(e.prop):"ascending"==e.order?se(e.prop):Y()},ne=e=>{X.tableData.sort((a,t)=>{let o="",l="";return"count_money"==e?(o=a.account.money,l=t.account.money):"prepay_money"==e&&(o=a.account.prepay_money,l=t.account.prepay_money),o-l})},se=e=>{X.tableData.sort((a,t)=>{let o="",l="";return"count_money"==e?(o=a.account.money,l=t.account.money):"prepay_money"==e&&(o=a.account.prepay_money,l=t.account.prepay_money),o-l})};return(e,a)=>{const t=d,o=C,l=_,r=m,F=b,x=h,U=w;return s(),n("div",null,[i(F,{type:"export",columns:y(X).columns,searchFields:y(X).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>y(X).searchFields=e),data:y(X).tableData,per_page:y(X).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>y(X).per_page=e),page:y(X).page,"onUpdate:page":a[2]||(a[2]=e=>y(X).page=e),total:y(X).total,onGetTableData:Y,onResetForm:G,loading:y(X).loading,showSelection:!1,showRightRefreshSlot:!1,onSortChange:re},{btns:p(()=>[i(t,{type:"primary",onClick:Z},{default:p(()=>a[15]||(a[15]=[u("添加供应商")])),_:1,__:[15]}),i(t,{type:y(q),onClick:W},{default:p(()=>[u(g(y(E)),1)]),_:1},8,["type"]),i(t,{type:"danger",onClick:ee},{default:p(()=>a[16]||(a[16]=[u("重置预付")])),_:1,__:[16]})]),count:p(()=>[i(o,null,{default:p(()=>a[17]||(a[17]=[u("总跑量0.0000 总预付0.0000 总应下发0.0000 总剩余0.0000")])),_:1,__:[17]})]),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)]),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:o})=>[c("div",V,[i(r,null,{default:p(()=>[i(t,{type:1==o.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("清账中"),te(4,[e.shop_id])}).catch(()=>{}))(o)},{default:p(()=>[u(g(1==o.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),i(t,{type:"primary",onClick:e=>((e={})=>{X.showBindAircraftDialog=!0,X.currentRow=e})(o),size:"small"},{default:p(()=>a[18]||(a[18]=[u("飞机")])),_:2,__:[18]},1032,["onClick"]),i(t,{type:"primary",onClick:e=>((e={})=>{X.showPrePaymentDialog=!0,X.currentRow=e})(o),size:"small"},{default:p(()=>a[19]||(a[19]=[u("加/减预付")])),_:2,__:[19]},1032,["onClick"])]),_:2},1024)]),c("div",null,[i(r,null,{default:p(()=>[i(t,{type:"primary",onClick:e=>((e={})=>{X.showPrePaymentLogDialog=!0,X.currentRow=e})(o),size:"small"},{default:p(()=>a[20]||(a[20]=[u("预付日志")])),_:2,__:[20]},1032,["onClick"]),i(t,{type:"primary",onClick:e=>((e={})=>{X.dialogShowChannelVisible=!0,D(()=>{H.value&&H.value.filterChannel(e)})})(o),size:"small"},{default:p(()=>a[21]||(a[21]=[u("渠道")])),_:2,__:[21]},1032,["onClick"]),i(t,{type:"primary",onClick:e=>(e=>{X.showAddSupplierDialog=!0,X.addForm.values.supplier_name=e.supplier_name,X.addForm.values.warn_money=e.warn_money,X.addForm.values.credit_money=e.credit_money,X.addForm.values.id=e.id})(o),size:"small"},{default:p(()=>a[22]||(a[22]=[u("编辑")])),_:2,__:[22]},1032,["onClick"]),i(t,{type:"primary",onClick:a=>e.handleFeeRisk(o),size:"small"},{default:p(()=>a[23]||(a[23]=[u("删除")])),_:2,__:[23]},1032,["onClick"])]),_:2},1024)])]),default:p(()=>[a[24]||(a[24]=u('" '))]),_:1,__:[24]},8,["columns","searchFields","data","per_page","page","total","loading"]),i(x,{showDialog:y(X).showAddSupplierDialog,"onUpdate:showDialog":a[3]||(a[3]=e=>y(X).showAddSupplierDialog=e),formData:y(X).addForm,"onUpdate:formData":a[4]||(a[4]=e=>y(X).addForm=e),ref:"addSupplierRef"},{submit:p(()=>[i(t,{type:"primary",onClick:K},{default:p(()=>a[25]||(a[25]=[u("确定")])),_:1,__:[25]})]),_:1},8,["showDialog","formData"]),i(x,{showDialog:y(X).showMergeSupplierDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>y(X).showMergeSupplierDialog=e),formData:y(X).mergeForm,"onUpdate:formData":a[6]||(a[6]=e=>y(X).mergeForm=e),ref:"productRef"},{submit:p(()=>[i(t,{type:"primary",onClick:e.confirmBatchSetting},{default:p(()=>a[26]||(a[26]=[u("确定")])),_:1,__:[26]},8,["onClick"])]),_:1},8,["showDialog","formData"]),i(j,{showMergeListDialog:y(X).showMergeListDialog,"onUpdate:showMergeListDialog":a[7]||(a[7]=e=>y(X).showMergeListDialog=e)},null,8,["showMergeListDialog"]),i(k,{showBindAircraftDialog:y(X).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[8]||(a[8]=e=>y(X).showBindAircraftDialog=e),currentRow:y(X).currentRow,"onUpdate:currentRow":a[9]||(a[9]=e=>y(X).currentRow=e)},null,8,["showBindAircraftDialog","currentRow"]),i(P,{showPrePaymentDialog:y(X).showPrePaymentDialog,"onUpdate:showPrePaymentDialog":a[10]||(a[10]=e=>y(X).showPrePaymentDialog=e),onConfrimPrePay:le,currentRow:y(X).currentRow,"onUpdate:currentRow":a[11]||(a[11]=e=>y(X).currentRow=e)},null,8,["showPrePaymentDialog","currentRow"]),i(R,{showPrePaymentLogDialog:y(X).showPrePaymentLogDialog,"onUpdate:showPrePaymentLogDialog":a[12]||(a[12]=e=>y(X).showPrePaymentLogDialog=e),currentRow:y(X).currentRow,"onUpdate:currentRow":a[13]||(a[13]=e=>y(X).currentRow=e)},null,8,["showPrePaymentLogDialog","currentRow"]),i(U,{modelValue:y(X).dialogShowChannelVisible,"onUpdate:modelValue":a[14]||(a[14]=e=>y(X).dialogShowChannelVisible=e),title:"渠道管理",width:"70vw","before-close":J},{default:p(()=>[i(S,{ref_key:"depositChannelRef",ref:H},null,512)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-37f11cf0"]]);export{M as default};