import{e as U,a as j,g as T}from"./delivery.e746dcee.js";import{d as S,a4 as $,aN as F,b as h,r as I,p as G,c as u,e as p,f as x,g as D,h as a,i as l,u as r,k,q as H,A as J,F as Y,j as K,m as d,a as v,_ as O}from"./index.0308b213.js";const Q={class:"filter-form"},W=d("\u4ECA\u5929"),X=d("\u6700\u8FD17\u5929"),Z=d("\u6700\u8FD130\u5929"),ee=d("\u81EA\u5B9A\u4E49"),te=d("\u641C\u7D22"),ae={style:{"margin-bottom":"10px"}},oe=d("\u5BFC\u51FA"),ne=d("\u6253\u5370"),le={class:"pagination"},re=S({setup(ue){const m=$();let _=[];m.query.stat_day!==void 0?_=F([m.query.stat_day,m.query.stat_day],"YYYY-MM-DD"):_=[];const B=[{text:"\u4E00\u5468\u5185",value:()=>{const e=v();return[e.subtract(1,"week").toDate(),e.toDate()]}},{text:"\u4E24\u5468\u5185",value:()=>{const e=v();return[e.subtract(2,"week").toDate(),e.toDate()]}},{text:"\u4E00\u4E2A\u6708\u5185",value:()=>{const e=v();return[e.subtract(1,"month").toDate(),e.toDate()]}}],t=h({days:_.length!==0?-1:0,keyword:"",stat_day:"",end_day:"",page:1,limit:10}),i=h({records:[],areas:[],count:0});let s=I(_);const w=()=>{const e=F(s.value,"YYYY-MM-DD");t.stat_day=e[0]||"",t.end_day=e[1]||""},C=()=>T(t),f=()=>{t.days===-1&&(!s.value||s.value.length===0)||(w(),C().then(e=>{console.log(e,"res"),i.count=e.count,i.areas=e.parent_areas,i.records=e.deliverys}))};f();const V=()=>{U(t).then(e=>{window.open(e.data)})},E=()=>{j(t).then(e=>{window.open(e.data)})},A=()=>{f()};return G(()=>[t.days,t.page,t.limit],()=>{f()}),(e,n)=>{const c=u("el-radio"),M=u("el-radio-group"),L=u("el-date-picker"),g=u("el-form-item"),q=u("el-input"),y=u("el-button"),P=u("el-form"),b=u("el-table-column"),z=u("el-table"),N=u("el-card"),R=u("el-pagination");return p(),x(Y,null,[D("div",Q,[a(P,{model:r(t),"label-width":"90px"},{default:l(()=>[a(g,{class:"tn-el-form-item",label:"\u7B5B\u9009\u65F6\u95F4"},{default:l(()=>[a(M,{modelValue:r(t).days,"onUpdate:modelValue":n[0]||(n[0]=o=>r(t).days=o)},{default:l(()=>[a(c,{border:!0,label:0},{default:l(()=>[W]),_:1}),a(c,{border:!0,label:7},{default:l(()=>[X]),_:1}),a(c,{border:!0,label:30},{default:l(()=>[Z]),_:1}),a(c,{border:!0,label:-1},{default:l(()=>[ee]),_:1})]),_:1},8,["modelValue"]),r(t).days===-1?(p(),k(L,{key:0,modelValue:r(s),"onUpdate:modelValue":n[1]||(n[1]=o=>H(s)?s.value=o:s=o),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",style:{"margin-left":"8px"},shortcuts:B,onChange:A},null,8,["modelValue"])):J("",!0)]),_:1}),a(g,{class:"tn-el-form-item",label:"\u9A91\u624B\u540D\u79F0"},{default:l(()=>[a(q,{modelValue:r(t).keyword,"onUpdate:modelValue":n[2]||(n[2]=o=>r(t).keyword=o),style:{width:"400px"},type:"text",placeholder:"\u8BF7\u8F93\u5165\u9A91\u624B\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(g,null,{default:l(()=>[a(y,{type:"primary",onClick:A},{default:l(()=>[te]),_:1})]),_:1})]),_:1},8,["model"])]),a(N,{class:"table"},{default:l(()=>[D("div",ae,[a(y,{class:"tn-el-form-item--item tn-button tn-button--green",onClick:n[3]||(n[3]=o=>V())},{default:l(()=>[oe]),_:1}),a(y,{class:"tn-el-form-item--item tn-button tn-button--green",onClick:n[4]||(n[4]=o=>E())},{default:l(()=>[ne]),_:1})]),a(z,{data:r(i).records,border:!0},{default:l(()=>[a(b,{label:"\u914D\u9001\u5458",prop:"title",align:"center",fixed:""}),a(b,{label:"\u603B\u914D\u9001\u8BA2\u5355",prop:"order_count",align:"center"}),(p(!0),x(Y,null,K(r(i).areas,o=>(p(),k(b,{label:o.title,prop:`delivery_${o.id}`,align:"center"},null,8,["label","prop"]))),256))]),_:1},8,["data"])]),_:1}),D("div",le,[a(R,{currentPage:r(t).page,"onUpdate:currentPage":n[5]||(n[5]=o=>r(t).page=o),"page-size":r(t).limit,"onUpdate:page-size":n[6]||(n[6]=o=>r(t).limit=o),"page-sizes":[10,50,100,500,1e3,2e3,3e3,5e3],layout:"total, sizes, prev, pager, next, jumper",total:r(i).count},null,8,["currentPage","page-size","total"])])],64)}}});const ie=O(re,[["__scopeId","data-v-94c6fe52"]]);export{ie as default};
