import{d as M,r as g,G as B,g as u,J as R,z as b,k as r,w as e,K as j,e as l,c as f,H as k,F as q,t as i,x as t,b as c,l as h,L as T,_ as Q}from"./index-CUnFTKV2.js";import{f as W,S as p}from"./order-BSmesayL.js";import X from"./ShipDialog-D8f2yF8b.js";const Y={class:"shipping-detail"},Z={class:"freight"},$={key:0,class:"logistics-section"},ee={class:"courier-number"},le={key:1,class:"prize-section"},ae={class:"image-error"},te={key:1,class:"image-error"},se={class:"prize-code"},oe={class:"money"},ie=M({__name:"ShippingDetailDialog",props:{modelValue:{type:Boolean},sendId:{}},emits:["update:modelValue","close","shipped"],setup(D,{emit:U}){const _=D,y=U,m=g(_.modelValue),V=g(!1),a=g(null),S=g(!1);B(()=>_.modelValue,d=>{m.value=d,d&&_.sendId&&C()}),B(m,d=>{y("update:modelValue",d)});const C=async()=>{if(_.sendId){V.value=!0;try{const d=await W(_.sendId);a.value=d.data}catch(d){console.error("获取发货订单详情失败:",d)}finally{V.value=!1}}},F=d=>{switch(d){case p.Pending:return"warning";case p.Shipped:return"info";case p.Received:return"success";case p.Cancelled:return"danger";default:return"info"}},O=()=>{S.value=!0},P=()=>{},A=()=>{C(),y("shipped")},w=()=>{m.value=!1,a.value=null,y("close")};return(d,n)=>{const s=u("el-descriptions-item"),E=u("el-tag"),z=u("el-descriptions"),N=u("el-icon"),G=u("el-image"),v=u("el-table-column"),H=u("el-table"),J=u("el-empty"),x=u("el-button"),K=u("el-dialog"),L=R("loading");return r(),b(K,{modelValue:m.value,"onUpdate:modelValue":n[1]||(n[1]=o=>m.value=o),title:"发货订单详情",width:"800px","close-on-click-modal":!1,onClose:w},{footer:e(()=>[l(x,{onClick:w},{default:e(()=>[...n[4]||(n[4]=[i("关闭",-1)])]),_:1}),a.value&&a.value.status===h(p).Pending?(r(),b(x,{key:0,type:"primary",onClick:O},{default:e(()=>[...n[5]||(n[5]=[i(" 发货 ",-1)])]),_:1})):k("",!0)]),default:e(()=>[j((r(),f("div",Y,[a.value?(r(),f(q,{key:0},[l(z,{column:2,border:"",class:"order-info"},{default:e(()=>[l(s,{label:"发货单号"},{default:e(()=>[i(t(a.value.sendNum),1)]),_:1}),l(s,{label:"订单状态"},{default:e(()=>[l(E,{type:F(a.value.status),size:"small"},{default:e(()=>[i(t(a.value.statusName),1)]),_:1},8,["type"])]),_:1}),l(s,{label:"收件人"},{default:e(()=>[i(t(a.value.name||"-"),1)]),_:1}),l(s,{label:"收货手机号"},{default:e(()=>[i(t(a.value.receiverMobile||"-"),1)]),_:1}),l(s,{label:"收货地址",span:2},{default:e(()=>[i(t(a.value.address||"-"),1)]),_:1}),l(s,{label:"用户昵称"},{default:e(()=>[i(t(a.value.userNickname||"-"),1)]),_:1}),l(s,{label:"用户ID"},{default:e(()=>[i(t(a.value.userId),1)]),_:1}),l(s,{label:"发货数量"},{default:e(()=>[i(t(a.value.count),1)]),_:1}),l(s,{label:"运费"},{default:e(()=>{var o;return[c("span",Z,"¥"+t(((o=a.value.freight)==null?void 0:o.toFixed(2))||"0.00"),1)]}),_:1}),l(s,{label:"下单时间"},{default:e(()=>[i(t(a.value.createdAt),1)]),_:1}),l(s,{label:"支付时间"},{default:e(()=>[i(t(a.value.payTime||"-"),1)]),_:1}),l(s,{label:"备注",span:2},{default:e(()=>[i(t(a.value.message||"-"),1)]),_:1})]),_:1}),a.value.status>=h(p).Shipped&&a.value.courierName?(r(),f("div",$,[n[2]||(n[2]=c("h4",{class:"section-title"},"物流信息",-1)),l(z,{column:2,border:""},{default:e(()=>[l(s,{label:"快递公司"},{default:e(()=>[i(t(a.value.courierName),1)]),_:1}),l(s,{label:"快递单号"},{default:e(()=>[c("span",ee,t(a.value.courierNumber),1)]),_:1}),l(s,{label:"发货时间"},{default:e(()=>[i(t(a.value.sendTime||"-"),1)]),_:1}),l(s,{label:"签收时间"},{default:e(()=>[i(t(a.value.receiveTime||"-"),1)]),_:1})]),_:1})])):k("",!0),a.value.prizes&&a.value.prizes.length>0?(r(),f("div",le,[n[3]||(n[3]=c("h4",{class:"section-title"},"发货奖品明细",-1)),l(H,{data:a.value.prizes,size:"small",border:""},{default:e(()=>[l(v,{label:"奖品图片",width:"80",align:"center"},{default:e(({row:o})=>[o.imgUrl?(r(),b(G,{key:0,src:o.imgUrl,"preview-src-list":[o.imgUrl],fit:"cover",class:"prize-img",lazy:""},{error:e(()=>[c("div",ae,[l(N,null,{default:e(()=>[l(h(T))]),_:1})])]),_:1},8,["src","preview-src-list"])):(r(),f("div",te,[l(N,null,{default:e(()=>[l(h(T))]),_:1})]))]),_:1}),l(v,{prop:"title",label:"奖品名称","min-width":"180"},{default:e(({row:o})=>[c("span",null,t(o.title||"-"),1)]),_:1}),l(v,{prop:"prizeCode",label:"奖品编码",width:"120"},{default:e(({row:o})=>[c("span",se,t(o.prizeCode||"-"),1)]),_:1}),l(v,{label:"价值",width:"100",align:"right"},{default:e(({row:o})=>{var I;return[c("span",oe,"¥"+t(((I=o.price)==null?void 0:I.toFixed(2))||"0.00"),1)]}),_:1})]),_:1},8,["data"])])):(r(),b(J,{key:2,description:"暂无奖品信息"}))],64)):k("",!0)])),[[L,V.value]]),l(X,{modelValue:S.value,"onUpdate:modelValue":n[0]||(n[0]=o=>S.value=o),"send-id":D.sendId,onClose:P,onSuccess:A},null,8,["modelValue","send-id"])]),_:1},8,["modelValue"])}}}),re=Q(ie,[["__scopeId","data-v-e135a069"]]);export{re as default};
