import{d as K,a6 as L,b as S,r as h,p as V,c as d,e as y,f as O,g as u,h as t,i as l,u as o,k as F,A as C,a1 as j,m as r,t as m,F as q,y as x,_ as G}from"./index.0308b213.js";import{S as H,g as J,p as M,a as Q}from"./stationEdit.381af607.js";import{c as R,p as W,d as X}from"./deliveryStation.d851c462.js";import{A as Y}from"./index.1d26a072.js";import{u as Z}from"./useAgent.c0cb1751.js";import"./index.68a0d43e.js";import"./loading.c9286a4b.js";import"./setting.644fa418.js";import"./install.524ae6f2.js";import"./list.5526c7ef.js";const ee={class:"filter-form"},te=r("\u67E5\u8BE2"),ae={class:"data"},le={class:"operation-container"},oe={class:"operation-btn"},se=r("\u6DFB\u52A0\u914D\u9001\u7AD9"),ne={class:"table"},ue={class:"table-operation-btn"},ie={class:"top"},de=r("\u7F16\u8F91"),re=r("\u5220\u9664"),pe={class:"bottom"},me={class:"pagination"},_e=K({setup(ce){const{OpPlatform:_}=L(),n=S({keyword:"",agentid:"",page:1,limit:10}),p=S({count:10,pages:1,stations:[],deliveryers:[]}),c=h(!1),b=h(!1),D=h(),B=()=>{b.value=!1,x(()=>{c.value=!1})},v=()=>{_.value==="agent"?R(n).then(a=>{p.stations=a.stations,p.deliveryers=a.deliveryers}):J(n).then(a=>{p.stations=a.stations,p.deliveryers=a.deliveryers})};v();const w=a=>{_.value==="agent"?W({id:a.id,status:a.status-0}):M({id:a.id,status:a.status-0})},U=async a=>{_.value==="agent"?await X({id:a}):await Q({id:a}),await v()};V(()=>[n.page,n.limit],()=>{v()});const k=()=>{v()},{getAgentList:z,getAgentTitle:ve}=Z();z();const E=a=>{b.value=!0,x(()=>{D.value=a,c.value=!0})};return V(c,a=>{a||(D.value=-1,v())}),(a,s)=>{const A=d("el-form-item"),P=d("el-input"),f=d("el-button"),$=d("el-form"),i=d("el-table-column"),N=d("el-switch"),T=d("el-table"),I=d("el-pagination");return y(),O(q,null,[u("div",ee,[t($,{model:o(n),"label-width":"90px"},{default:l(()=>[o(_)==="shangpu"?(y(),F(A,{key:0,class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:l(()=>[t(o(Y),{modelValue:o(n).agentid,"onUpdate:modelValue":s[0]||(s[0]=e=>o(n).agentid=e)},null,8,["modelValue"])]),_:1})):C("",!0),t(A,{class:"tn-el-form-item",label:"\u641C\u7D22"},{default:l(()=>[t(P,{modelValue:o(n).keyword,"onUpdate:modelValue":s[1]||(s[1]=e=>o(n).keyword=e),placeholder:"\u8F93\u5165\u914D\u9001\u7AD9\u70B9\u540D\u79F0",onKeyup:s[2]||(s[2]=j(e=>k(),["enter"]))},null,8,["modelValue"])]),_:1}),t(A,null,{default:l(()=>[t(f,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:k},{default:l(()=>[te]),_:1})]),_:1})]),_:1},8,["model"])]),u("div",ae,[u("div",le,[u("div",oe,[t(f,{class:"btn",type:"primary",onClick:s[3]||(s[3]=e=>E(0))},{default:l(()=>[se]),_:1})])]),u("div",ne,[t(T,{data:o(p).stations},{default:l(()=>[t(i,{label:"\u914D\u9001\u7AD9\u70B9\u540D\u79F0",prop:"title"}),o(_)=="shangpu"?(y(),F(i,{key:0,label:"\u6240\u5C5E\u4EE3\u7406",width:"100px"},{default:l(({row:e})=>[r(m(e.agent_title),1)]),_:1})):C("",!0),t(i,{label:"\u914D\u9001\u7AD9\u5730\u5740"},{default:l(({row:e})=>[r(m(e.address),1)]),_:1}),t(i,{label:"\u7ED1\u5B9A\u4E2D\u4E13\u5458"},{default:l(({row:e})=>[r(" \u5171"+m(e.deliveryer_total)+"\u4E2A ",1)]),_:1}),t(i,{label:"\u4E2D\u4E13\u8D39\u7528"},{default:l(({row:e})=>[r(" \u6BCF\u5355"+m(e.fee)+"\u5143 ",1)]),_:1}),t(i,{label:"\u662F\u5426\u542F\u7528"},{default:l(({row:e})=>[t(N,{modelValue:e.status,"onUpdate:modelValue":g=>e.status=g,"active-value":1,"inactive-value":0,onClick:g=>w(e)},null,8,["modelValue","onUpdate:modelValue","onClick"])]),_:1}),t(i,{width:"170px",label:"\u521B\u5EFA\u65F6\u95F4/\u4FEE\u6539\u65F6\u95F4"},{default:l(({row:e})=>[u("div",null,m(e.addtime),1),u("div",null,m(e.updatetime),1)]),_:1}),t(i,{fixed:"right",label:"\u64CD\u4F5C",width:"180px",align:"right"},{default:l(({row:e})=>[u("div",ue,[u("div",ie,[t(f,{size:"small",type:"primary",onClick:g=>E(e.id)},{default:l(()=>[de]),_:2},1032,["onClick"]),t(f,{size:"small",type:"danger",onClick:g=>U(e.id)},{default:l(()=>[re]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),u("div",pe,[u("div",me,[t(I,{currentPage:o(n).page,"onUpdate:currentPage":s[4]||(s[4]=e=>o(n).page=e),"page-size":o(n).limit,"onUpdate:page-size":s[5]||(s[5]=e=>o(n).limit=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:o(p).count},null,8,["currentPage","page-size","total"])])]),b.value?(y(),F(H,{key:0,modelValue:c.value,"onUpdate:modelValue":s[6]||(s[6]=e=>c.value=e),id:D.value,deliveryers:o(p).deliveryers,onOnClose:B},null,8,["modelValue","id","deliveryers"])):C("",!0)],64)}}});const Ee=G(_e,[["__scopeId","data-v-837075b2"]]);export{Ee as default};
