import{d as x,r as s,a as L,o as k,g as p,c as z,k as I,e as n,w as l,b as _,t as N,l as R,aa as T,E as v,_ as E}from"./index-CUnFTKV2.js";import U from"./OrderListSearchForm-IqV81pVb.js";import j from"./OrderListTable-DQTZ49je.js";import B from"./OrderDetailDialog-CCUOom5N.js";import{h as P,i as M}from"./order-BSmesayL.js";const q={class:"page-container"},F={class:"card-header"},$=x({__name:"list",setup(A){const d=s(!1),m=s([]),g=s(0),i=s(!1),e=L({page:1,pageSize:20}),c=s(!1),u=s(null),r=async()=>{d.value=!0;try{const a=await P(e);m.value=a.data.list,g.value=a.data.total}catch(a){console.error("获取综合订单列表失败:",a),v.error("获取综合订单列表失败")}finally{d.value=!1}},f=a=>{e.userId=void 0,e.mobile=void 0,e.orderNum=void 0,e.startDate=void 0,e.endDate=void 0,e.status=void 0,e.accountType=void 0,e.accountStatus=void 0,Object.assign(e,a),e.page=1,r()},h=()=>{e.userId=void 0,e.mobile=void 0,e.orderNum=void 0,e.startDate=void 0,e.endDate=void 0,e.status=void 0,e.accountType=void 0,e.accountStatus=void 0,e.page=1,r()},b=a=>{e.page=a,r()},D=a=>{e.pageSize=a,e.page=1,r()},y=a=>{u.value=a.id,c.value=!0},C=()=>{u.value=null},S=async()=>{i.value=!0;try{const a=await M({userId:e.userId,mobile:e.mobile,orderNum:e.orderNum,startDate:e.startDate,endDate:e.endDate,status:e.status,accountType:e.accountType,accountStatus:e.accountStatus}),t=window.URL.createObjectURL(a),o=document.createElement("a");o.href=t,o.download=`综合订单_${new Date().toISOString().slice(0,10)}.csv`,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(t),v.success("导出成功")}catch(a){console.error("导出失败:",a),v.error("导出失败")}finally{i.value=!1}};return k(()=>{r()}),(a,t)=>{const o=p("el-icon"),w=p("el-button"),O=p("el-card");return I(),z("div",q,[n(O,null,{header:l(()=>[_("div",F,[t[2]||(t[2]=_("span",null,"综合订单",-1)),n(w,{type:"primary",onClick:S,loading:i.value},{default:l(()=>[n(o,null,{default:l(()=>[n(R(T))]),_:1}),t[1]||(t[1]=N("导出 ",-1))]),_:1},8,["loading"])])]),default:l(()=>[n(U,{onSearch:f,onReset:h}),n(j,{data:m.value,loading:d.value,total:g.value,page:e.page,"page-size":e.pageSize,onPageChange:b,onSizeChange:D,onViewDetail:y},null,8,["data","loading","total","page","page-size"])]),_:1}),n(B,{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=V=>c.value=V),"order-id":u.value,onClose:C},null,8,["modelValue","order-id"])])}}}),W=E($,[["__scopeId","data-v-2b0d52a1"]]);export{W as default};
