import{S as p}from"./order-BSmesayL.js";import{d as U,r as y,G as C,g as _,J as F,c as r,k as o,K as O,e as n,z as S,w as s,b as i,H as u,x as a,t as b,_ as $}from"./index-CUnFTKV2.js";const j={class:"shipping-order-table"},A={class:"user-info"},E={class:"nickname"},G={class:"uid"},H={key:0,class:"mobile"},J={class:"order-num"},K={class:"count"},R={class:"money"},q={class:"freight"},L={class:"receiver-info"},Q={class:"receiver-name"},W={key:0,class:"receiver-mobile"},X={key:1,class:"receiver-address"},Y={class:"time-info"},Z={key:0},ee={key:1},te={key:2},ae={class:"message"},se=U({__name:"ShippingOrderTable",props:{data:{},loading:{type:Boolean},total:{},page:{},pageSize:{}},emits:["page-change","size-change","view-detail","cancel-ship"],setup(g,{emit:z}){const h=g,m=z,v=y(h.page),f=y(h.pageSize);C(()=>h.page,t=>{v.value=t}),C(()=>h.pageSize,t=>{f.value=t});const x=t=>{switch(t){case p.Pending:return"warning";case p.Shipped:return"info";case p.Received:return"success";case p.Cancelled:return"danger";default:return"info"}},T=t=>t===p.Pending,N=t=>{m("page-change",t)},P=t=>{m("size-change",t)},B=t=>{m("view-detail",t)},D=t=>{m("cancel-ship",t)};return(t,d)=>{const l=_("el-table-column"),V=_("el-tag"),k=_("el-button"),M=_("el-table"),w=_("el-pagination"),I=F("loading");return o(),r("div",j,[O((o(),S(M,{data:g.data,border:"",stripe:""},{default:s(()=>[n(l,{label:"用户信息","min-width":"160",fixed:"left"},{default:s(({row:e})=>[i("div",A,[i("div",E,a(e.userNickname||"-"),1),i("div",G,"UID: "+a(e.userId),1),e.userMobile?(o(),r("div",H,a(e.userMobile),1)):u("",!0)])]),_:1}),n(l,{prop:"sendNum",label:"发货单号","min-width":"180"},{default:s(({row:e})=>[i("span",J,a(e.sendNum),1)]),_:1}),n(l,{prop:"count",label:"发货数量",width:"100",align:"center"},{default:s(({row:e})=>[i("span",K,a(e.count),1)]),_:1}),n(l,{label:"总价格",width:"120",align:"right"},{default:s(({row:e})=>{var c;return[i("span",R,"¥"+a(((c=e.totalPrice)==null?void 0:c.toFixed(2))||"0.00"),1)]}),_:1}),n(l,{label:"运费",width:"100",align:"right"},{default:s(({row:e})=>{var c;return[i("span",q,"¥"+a(((c=e.freight)==null?void 0:c.toFixed(2))||"0.00"),1)]}),_:1}),n(l,{label:"收货信息","min-width":"200"},{default:s(({row:e})=>[i("div",L,[i("div",Q,a(e.name||"-"),1),e.receiverMobile?(o(),r("div",W,a(e.receiverMobile),1)):u("",!0),e.address?(o(),r("div",X,a(e.address),1)):u("",!0)])]),_:1}),n(l,{label:"状态",width:"100",align:"center"},{default:s(({row:e})=>[n(V,{type:x(e.status),size:"small"},{default:s(()=>[b(a(e.statusName),1)]),_:2},1032,["type"])]),_:1}),n(l,{label:"时间","min-width":"160"},{default:s(({row:e})=>[i("div",Y,[i("div",null,"申请: "+a(e.createdAt),1),e.payTime?(o(),r("div",Z,"支付: "+a(e.payTime),1)):u("",!0),e.sendTime?(o(),r("div",ee,"发货: "+a(e.sendTime),1)):u("",!0),e.receiveTime?(o(),r("div",te,"签收: "+a(e.receiveTime),1)):u("",!0)])]),_:1}),n(l,{prop:"message",label:"备注","min-width":"120"},{default:s(({row:e})=>[i("span",ae,a(e.message||"-"),1)]),_:1}),n(l,{label:"操作",width:"160",fixed:"right",align:"center"},{default:s(({row:e})=>[n(k,{type:"primary",link:"",onClick:c=>B(e)},{default:s(()=>[...d[2]||(d[2]=[b(" 查看详情 ",-1)])]),_:1},8,["onClick"]),T(e.status)?(o(),S(k,{key:0,type:"danger",link:"",onClick:c=>D(e)},{default:s(()=>[...d[3]||(d[3]=[b(" 取消发货 ",-1)])]),_:1},8,["onClick"])):u("",!0)]),_:1})]),_:1},8,["data"])),[[I,g.loading]]),n(w,{"current-page":v.value,"onUpdate:currentPage":d[0]||(d[0]=e=>v.value=e),"page-size":f.value,"onUpdate:pageSize":d[1]||(d[1]=e=>f.value=e),"page-sizes":[10,20,50,100],total:g.total,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:P,onCurrentChange:N,class:"pagination"},null,8,["current-page","page-size","total"])])}}}),le=$(se,[["__scopeId","data-v-49b19a2f"]]);export{le as default};
