2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
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.1756289702739Dl7wcJE2.js";import{_ as b}from"./index.1756289702739Bcvr0Q1n.js";/* empty css */import{E as j}from"./el-text.17562897027396N9X0RiB.js";import C from"./merge-list.1756289702739BpNgt-E_.js";import P from"./bind-aircraft.1756289702739DlZcvPW7.js";import k from"./add-reduce-prepayment.1756289702739CoIkPjhG.js";import R from"./prepayment-log.1756289702739D2yak-la.js";import F from"./deposit-channels-set.1756289702739Q8us-CsA.js";import{g as S,c as B,e as x,a as U}from"./payee-suppiler.1756289702739B9oU2vKp.js";import{k as A,l as L}from"./payee-user.1756289702739BlgSw46e.js";import{b as T}from"./payee-order.1756289702739_pCOCZ8q.js";/* empty css */import"./el-col.1756289702739DeVCQHJI.js";import"./el-card.1756289702739BjZtzvlo.js";import"./settlement-log.1756289702739C9J_Fj5-.js";import"./payee-count.1756289702739BHfHK8_L.js";import"./add-channel.1756289702739Boyt7Ahw.js";import"./payee-channel.1756289702739CvnskvEF.js";import"./channel-code.1756289702739BVBSclxq.js";import"./single_fee.1756289702739CW2uEi6g.js";import"./test_channel.1756289702739DJcqI5nx.js";import"./el-link.1756289702739BzaUfd9a.js";import"./fee-risk.1756289702739DJE6uDvz.js";import"./el-time-select.1756289702739dUB0AOuI.js";import"./copy-channel.1756289702739D0_t_n-I.js";import"./sub-channel.1756289702739CNw7LKqq.js";import"./sub-channel-add.1756289702739BFXUjngT.js";import"./sub-channel-fee.1756289702739CZQTz9x6.js";import"./sub-channel-risk.1756289702739C82mB62Z.js";import"./channel-fee.1756289702739DRsAbJdS.js";import"./channel-risk.1756289702739BiubVWUh.js";import"./staticData.17562897027398wZxkmL4.js";const V={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=""}),Z()};l(async()=>{Z(),Y(),oe();let e=(await S({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 Y=()=>{T().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 Z=()=>{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);S(Object.assign(e,a)).then(e=>{G.tableData=e.data,G.total=e.total}).catch(()=>{G.loading=!1})},$=()=>{G.showAddSupplierDialog=!0,G.addForm.values.id=""},H=o(null),J=()=>{G.dialogShowChannelVisible=!1},K=()=>{let e=G.addForm.values;e.id?x(e).then(e=>{G.showAddSupplierDialog=!1,f.success("编辑成功!"),Z()}):U(e).then(e=>{G.showAddSupplierDialog=!1,Z(),f.success("添加成功!")})},Q=()=>{if(1==O.value)return f.warning("清账中,请勿重复点击");2!=O.value?ae(4,[]):v.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{W()}).catch(()=>{})},W=()=>{L({onoff:"on"}).then(e=>{Z(),Y(),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=>{Y(),oe(),setTimeout(()=>{Z()},1e3)})},oe=()=>{clearInterval(ee.value),ee.value=setInterval(()=>{Y()},1e4)},te=()=>{Z()},le=e=>{"count_money"!=e.prop&&"prepay_money"!=e.prop?(z.value=e.prop,I.value="descending"==e.order?"DESC":"ASC",Z()):"descending"==e.order?re(e.prop):"ascending"==e.order?ne(e.prop):Z()},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,S=b,x=h,U=w;return s(),n("div",null,[i(S,{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:Z,onResetForm:N,loading:y(G).loading,showSelection:!1,showRightRefreshSlot:!1,onSortChange:le},{btns:p(()=>[i(o,{type:"primary",onClick:$},{default:p(()=>a[15]||(a[15]=[u("添加供应商")])),_:1,__:[15]}),i(o,{type:y(q),onClick:Q},{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",V,[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:"primary",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(()=>{H.value&&H.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(x,{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:K},{default:p(()=>a[24]||(a[24]=[u("确定")])),_:1,__:[24]})]),_:1},8,["showDialog","formData"]),i(x,{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(U,{modelValue:y(G).dialogShowChannelVisible,"onUpdate:modelValue":a[14]||(a[14]=e=>y(G).dialogShowChannelVisible=e),title:"渠道管理",width:"70vw","before-close":J},{default:p(()=>[i(F,{ref_key:"depositChannelRef",ref:H},null,512)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-d609cf76"]]);export{M as default};
|