2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{b2 as e,bs as a,r as t,ag as l,b4 as o,c as r,e as n,N as s,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.A3RPr1Hf.js";import{_ as v}from"./index.BJluNZyT.js";/* empty css */import{E as b}from"./el-text.QeOeLtCL.js";import j from"./merge-list.DEXqCdd4.js";import C from"./bind-aircraft.glEAaMHm.js";import k from"./add-reduce-prepayment.DPnqDGYh.js";import P from"./prepayment-log.BFJDInv9.js";import R from"./deposit-channels-set.DkMeipjb.js";import{g as F,c as B,e as S,a as x}from"./payee-suppiler.D0DKJDdh.js";import{k as U,l as A}from"./payee-user.KKrD2crk.js";/* empty css */import"./el-col.D6_hjphP.js";import"./payee-order.CsX3WYgQ.js";import"./el-card.C6-5TsXR.js";import"./settlement-log.BUEyrTBt.js";import"./payee-count.D8cRBcJL.js";import"./add-channel.CWrJwFo0.js";import"./payee-channel.DF5k8hKP.js";import"./channel-code.C7UuDpV9.js";import"./single_fee.B1sTMwp7.js";import"./test_channel.B4C-Jn9P.js";import"./el-link.BsbrnJ91.js";import"./fee-risk.IyRLrbGM.js";import"./el-time-select.DjsVL8mI.js";import"./copy-channel.CikjuccB.js";import"./sub-channel.DvXEGFuQ.js";import"./sub-channel-add.C39-ZKEP.js";import"./sub-channel-fee.Sd4OusnM.js";import"./sub-channel-risk.BsZl5ilA.js";import"./channel-fee.CFFUyMK_.js";import"./channel-risk.Bjx0GyOX.js";import"./staticData.8wZxkmL4.js";const L={style:{"margin-bottom":"4px"}},V=e({__name:"supplier-info",setup(e){a({legacy:!0});let V=[];const T=t("日切清账,关闭通道"),M=t("warning"),z=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}),q=()=>{I.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),E()};o(()=>{E()});const E=()=>{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,0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(H.value),z.value=e.system_clear_status,1==e.system_clear_status&&(M.value="danger",T.value="日切清账中,所有支付通道已关闭",initLoad||(K(),initLoad=!0)),2==e.system_clear_status&&(M.value="success",T.value="日切清账完成,请手动点击开启所有通道")}).catch(()=>{I.loading=!1})},O=()=>{I.showAddSupplierDialog=!0,I.addForm.values.id=""},X=t(null),G=()=>{I.dialogShowChannelVisible=!1},N=()=>{let e=I.addForm.values;e.id?S(e).then(e=>{I.showAddSupplierDialog=!1,y.success("编辑成功!"),E()}):x(e).then(e=>{I.showAddSupplierDialog=!1,E(),y.success("添加成功!")})},Q=()=>{if(1==z.value)return y.warning("清账中,请勿重复点击");2!=z.value?J(4,[]):f.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{Y()}).catch(()=>{})},Y=()=>{A({onoff:"on"}).then(e=>{E(),T.value="日切清账,关闭通道",M.value="warning",clearInterval(H.value)}).catch(()=>{})},Z=()=>{f.confirm("确定要重置供应的预付吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{}).catch(()=>{})};let H=t(null);const J=(e,a)=>{U({type:e,clear_ids:a}).then(e=>{E(),clearInterval(H.value),K()})},K=()=>{H.value=setInterval(()=>{E()},1e4)},W=()=>{E()};return(e,a)=>{const t=d,l=b,o=g,F=c,S=v,x=_,U=w;return n(),r("div",null,[s(S,{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:E,onResetForm:q,loading:h(I).loading,showSelection:!1,showRightRefreshSlot:!1},{btns:i(()=>[s(t,{type:"primary",onClick:O},{default:i(()=>a[15]||(a[15]=[p("添加供应商")])),_:1,__:[15]}),s(t,{type:h(M),onClick:Q},{default:i(()=>[p(m(h(T)),1)]),_:1},8,["type"]),s(t,{type:"danger",onClick:Z},{default:i(()=>a[16]||(a[16]=[p("重置预付")])),_:1,__:[16]})]),count:i(()=>[s(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})=>[s(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(()=>{B({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,[s(F,null,{default:i(()=>[s(t,{type:1==l.clear_status?"danger":"warning",size:"small",onClick:e=>(e=>"1"==e.clear_status?y.warning("清账中,请勿重复点击"):"日切清账完成,请手动点击开启所有通道"==T.value?y.error(T.value):void f.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{y.success("清账中"),J(4,[e.shop_id])}).catch(()=>{}))(l)},{default:i(()=>[p(m(1==l.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),s(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"]),s(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,[s(F,null,{default:i(()=>[s(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"]),s(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"]),s(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"]),s(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"]),s(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(()=>[s(t,{type:"primary",onClick:N},{default:i(()=>a[25]||(a[25]=[p("确定")])),_:1,__:[25]})]),_:1},8,["showDialog","formData"]),s(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(()=>[s(t,{type:"primary",onClick:e.confirmBatchSetting},{default:i(()=>a[26]||(a[26]=[p("确定")])),_:1,__:[26]},8,["onClick"])]),_:1},8,["showDialog","formData"]),s(j,{showMergeListDialog:h(I).showMergeListDialog,"onUpdate:showMergeListDialog":a[7]||(a[7]=e=>h(I).showMergeListDialog=e)},null,8,["showMergeListDialog"]),s(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"]),s(k,{showPrePaymentDialog:h(I).showPrePaymentDialog,"onUpdate:showPrePaymentDialog":a[10]||(a[10]=e=>h(I).showPrePaymentDialog=e),onConfrimPrePay:W,currentRow:h(I).currentRow,"onUpdate:currentRow":a[11]||(a[11]=e=>h(I).currentRow=e)},null,8,["showPrePaymentDialog","currentRow"]),s(P,{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"]),s(U,{modelValue:h(I).dialogShowChannelVisible,"onUpdate:modelValue":a[14]||(a[14]=e=>h(I).dialogShowChannelVisible=e),title:"渠道管理",width:"70vw","before-close":G},{default:i(()=>[s(R,{ref_key:"depositChannelRef",ref:X},null,512)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-0c701238"]]);export{V as default};
|