import{d as R,v as A,r as z,a as G,g as s,J as Q,z as k,k as m,w as o,c as D,H as W,e as t,K as X,b as i,l as Y,m as Z,x as n,t as _,_ as $}from"./index-CUnFTKV2.js";import{i as ee}from"./user-EiTTpYhZ.js";const te={key:0,class:"user-info"},le={class:"user-detail"},oe={class:"nickname"},ae={class:"uid"},se={class:"prize-info"},ie={class:"prize-detail"},ne={class:"prize-title"},de={class:"prize-price"},ue={class:"text-muted"},re={class:"text-muted"},ce={class:"money"},pe={key:1,class:"text-muted"},me=R({__name:"UserBoxDialog",props:{modelValue:{type:Boolean},user:{}},emits:["update:modelValue"],setup(c,{emit:I}){const f=c,B=I,h=A({get:()=>f.modelValue,set:d=>B("update:modelValue",d)}),b=z(!1),x=z([]),y=z(0),a=G({status:void 0,goodslistTitle:void 0,goodTitle:void 0,startTime:void 0,endTime:void 0,page:1,pageSize:20}),N=d=>({0:"warning",1:"info",2:"success"})[d]||"",P=d=>({0:"待处理",1:"已回收",2:"已发货"})[d]||"未知",g=async()=>{var d,l;if(f.user){b.value=!0;try{const r=await ee(f.user.id,a);x.value=((d=r.data)==null?void 0:d.list)||[],y.value=((l=r.data)==null?void 0:l.total)||0}catch(r){console.error("获取用户盒柜失败",r),x.value=[],y.value=0}finally{b.value=!1}}},F=()=>{a.page=1,g()},C=()=>{a.status=void 0,a.goodslistTitle=void 0,a.goodTitle=void 0,a.startTime=void 0,a.endTime=void 0,a.page=1,g()},O=()=>{C()},S=()=>{h.value=!1};return(d,l)=>{const r=s("el-icon"),j=s("el-avatar"),V=s("el-option"),q=s("el-select"),v=s("el-form-item"),w=s("el-input"),T=s("el-button"),E=s("el-form"),H=s("el-image"),u=s("el-table-column"),U=s("el-tag"),J=s("el-table"),K=s("el-pagination"),L=s("el-dialog"),M=Q("loading");return m(),k(L,{modelValue:h.value,"onUpdate:modelValue":l[5]||(l[5]=e=>h.value=e),title:"用户盒柜",width:"1000px","close-on-click-modal":!1,onClose:S,onOpen:O},{footer:o(()=>[t(T,{onClick:S},{default:o(()=>[...l[8]||(l[8]=[_("关闭",-1)])]),_:1})]),default:o(()=>[c.user?(m(),D("div",te,[t(j,{src:c.user.avatar,size:40},{default:o(()=>[t(r,null,{default:o(()=>[t(Y(Z))]),_:1})]),_:1},8,["src"]),i("div",le,[i("div",oe,n(c.user.nickname||"-"),1),i("div",ae,"UID: "+n(c.user.id),1)])])):W("",!0),t(E,{inline:!0,model:a,class:"search-form"},{default:o(()=>[t(v,{label:"奖品状态"},{default:o(()=>[t(q,{modelValue:a.status,"onUpdate:modelValue":l[0]||(l[0]=e=>a.status=e),placeholder:"全部",clearable:"",style:{width:"120px"}},{default:o(()=>[t(V,{label:"待处理",value:0}),t(V,{label:"已回收",value:1}),t(V,{label:"已发货",value:2})]),_:1},8,["modelValue"])]),_:1}),t(v,{label:"奖品名称"},{default:o(()=>[t(w,{modelValue:a.goodslistTitle,"onUpdate:modelValue":l[1]||(l[1]=e=>a.goodslistTitle=e),placeholder:"奖品名称",clearable:"",style:{width:"150px"}},null,8,["modelValue"])]),_:1}),t(v,{label:"盒子名称"},{default:o(()=>[t(w,{modelValue:a.goodTitle,"onUpdate:modelValue":l[2]||(l[2]=e=>a.goodTitle=e),placeholder:"盒子名称",clearable:"",style:{width:"150px"}},null,8,["modelValue"])]),_:1}),t(v,null,{default:o(()=>[t(T,{type:"primary",onClick:F},{default:o(()=>[...l[6]||(l[6]=[_("查询",-1)])]),_:1}),t(T,{onClick:C},{default:o(()=>[...l[7]||(l[7]=[_("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"]),X((m(),k(J,{data:x.value,border:"",stripe:"","max-height":"400"},{default:o(()=>[t(u,{label:"奖品信息","min-width":"200"},{default:o(({row:e})=>{var p;return[i("div",se,[t(H,{src:e.goodslistImgurl,style:{width:"50px",height:"50px"},fit:"cover","preview-src-list":e.goodslistImgurl?[e.goodslistImgurl]:[]},null,8,["src","preview-src-list"]),i("div",ie,[i("div",ne,n(e.goodslistTitle||"-"),1),i("div",de,"价值: ¥"+n(((p=e.goodslistMoney)==null?void 0:p.toFixed(2))||"0.00"),1)])])]}),_:1}),t(u,{label:"所属盒子","min-width":"150"},{default:o(({row:e})=>[i("div",null,n(e.goodTitle||"-"),1),i("div",ue,"ID: "+n(e.goodsId||"-"),1)]),_:1}),t(u,{label:"订单信息","min-width":"150"},{default:o(({row:e})=>[i("div",null,n(e.orderNum||"-"),1),i("div",re,"ID: "+n(e.orderId),1)]),_:1}),t(u,{prop:"goodslistPrice",label:"回收价",width:"100",align:"right"},{default:o(({row:e})=>{var p;return[i("span",ce,"¥"+n(((p=e.goodslistPrice)==null?void 0:p.toFixed(2))||"0.00"),1)]}),_:1}),t(u,{label:"状态",width:"100",align:"center"},{default:o(({row:e})=>[t(U,{type:N(e.status),size:"small"},{default:o(()=>[_(n(e.statusText||P(e.status)),1)]),_:2},1032,["type"])]),_:1}),t(u,{label:"发货状态",width:"100",align:"center"},{default:o(({row:e})=>[e.status===2?(m(),k(U,{key:0,type:e.fhStatus===1?"success":"warning",size:"small"},{default:o(()=>[_(n(e.fhStatus===1?"已发货":"待发货"),1)]),_:2},1032,["type"])):(m(),D("span",pe,"-"))]),_:1}),t(u,{prop:"addtime",label:"获得时间",width:"170"})]),_:1},8,["data"])),[[M,b.value]]),t(K,{"current-page":a.page,"onUpdate:currentPage":l[3]||(l[3]=e=>a.page=e),"page-size":a.pageSize,"onUpdate:pageSize":l[4]||(l[4]=e=>a.pageSize=e),"page-sizes":[10,20,50,100],total:y.value,layout:"total, sizes, prev, pager, next, jumper",onSizeChange:g,onCurrentChange:g,class:"pagination"},null,8,["current-page","page-size","total"])]),_:1},8,["modelValue"])}}}),ve=$(me,[["__scopeId","data-v-29b1142e"]]);export{ve as default};
