import{U as ve,a2 as ye,H as De,$ as he,C as Fe,D as ge,J as Ee,K as we,w as be,F as ke,L as Ce,M as Be,b as xe,N as Ve,O as Se}from"./element-plus.4a7d92a3.js";import{_ as $e}from"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import{_ as Me}from"./index.vue_vue_type_script_setup_true_lang.ab7008c1.js";import{_ as Te}from"./index.vue_vue_type_script_setup_true_lang.16184eff.js";import{d as H,s as P,r as d,Z as Le,i as Ue,af as Ae,o as n,c as m,U as a,L as o,u as l,aa as Re,T as B,a9 as x,K as p,j as R,R as r,M as Ye,a as Y,S as E,Q as z,n as j}from"./@vue.18505fe0.js";import{u as ze}from"./usePaging.6a6670f9.js";import{u as Ie}from"./useDictOptions.9fe2acdb.js";import{a as q}from"./store_order.9b760327.js";import"./lodash.9dc701ad.js";import{a as Ke}from"./system_store.d73430f5.js";import{h as Ne}from"./index.131d90ed.js";import{h as G}from"./moment.40bc58bf.js";import{_ as Oe}from"./edit.vue_vue_type_script_setup_true_name_storeOrderEdit_lang.ba50df11.js";import{_ as Pe}from"./details.vue_vue_type_script_setup_true_name_storeOrderDETAILS_lang.ca72de8a.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.7347fedc.js";import"./axios.4607972f.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.ee949b04.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.0d2736b7.js";import"./vue-clipboard3.7d5a7a5d.js";import"./clipboard.860a1cea.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./delivery_service.f352a54b.js";import"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.6387f140.js";import"./orderInfo.vue_vue_type_script_setup_true_name_orderInfo_lang.10c31732.js";import"./storeTable.vue_vue_type_script_setup_true_name_storeTable_lang.b85cd67e.js";import"./warehouse.696d316c.js";const je={class:"mt-4"},qe={class:"truncate text-[12px]"},Ge={key:0,style:{"text-align":"left"}},He={key:0},Je={key:1},Qe={class:"flex mt-4 justify-end"},Ze=H({name:"storeOrderLists"}),Gt=H({...Ze,setup(We){const V=P(),S=P(),$=d(!1),M=d(!1),J=[{text:"\u8FD1\u4E00\u5468",value:()=>{const s=new Date,t=new Date;return t.setDate(t.getDate()-7),[t,s]}},{text:"\u8FD1\u4E00\u6708",value:()=>{const s=new Date,t=new Date;return t.setMonth(t.getMonth()-1),[t,s]}},{text:"\u8FD1\u4E09\u6708",value:()=>{const s=new Date,t=new Date;return t.setMonth(t.getMonth()-3),[t,s]}}],_=d([]),u=Le({order_id:"",uid:"",pay_type:"",store_id:"",start_time:"",end_time:"",paid:null,status:null,is_writeoff:null}),T=d("0"),Q=s=>{s==0?(u.paid=null,u.status=null,u.is_writeoff=null):s==1?(u.paid=0,u.status=null,u.is_writeoff=null):s==2?(u.paid=1,u.status=1,u.is_writeoff=0):s==3?(u.paid=1,u.status=2,u.is_writeoff=null):s==4?(u.paid=null,u.status=4,u.is_writeoff=null):s==60&&(u.is_delivery=1,u.status=null,u.paid=null,u.is_writeoff=null),v()},Z=()=>{_.value[0]&&_.value[1]?(u.start_time=G(_.value[0]).format("YYYY-MM-DD")+" 00:00:00",u.end_time=G(_.value[1]).format("YYYY-MM-DD")+" 23:59:59"):(u.start_time="",u.end_time=""),v()},w=d(!1),I=d([]),W=(s="")=>{w.value=!0,Ke({name:s,page_size:50}).then(t=>{I.value=t.lists,setTimeout(()=>{w.value=!1},300)}).catch(t=>{setTimeout(()=>{w.value=!1},300)})},X=d([]),ee=s=>{X.value=s.map(({id:t})=>t)},{dictData:b}=Ie("pay_type"),{pager:f,getLists:v,resetParams:te,resetPage:h}=ze({fetchFun:q,params:u}),ae=async s=>{var t,c;M.value=!0,await j(),(t=S.value)==null||t.open(),(c=S.value)==null||c.getDetail(s)},le=async s=>{var t,c;$.value=!0,await j(),(t=V.value)==null||t.open("edit"),(c=V.value)==null||c.setFormData(s)},k=d(!1),K=d([]),oe=(s="")=>{k.value=!0,Ne({nickname:s,page_size:50}).then(t=>{K.value=t.lists,setTimeout(()=>{k.value=!1},300)}).catch(t=>{setTimeout(()=>{k.value=!1},300)})};return Ue(()=>{v()}),(s,t)=>{const c=Fe,y=ge,L=Ee,U=we,ue=ve,F=be,se=Te,ne=ke,N=Ce,re=Ae("router-link"),D=ye,ie=De,i=Be,pe=xe,g=he,de=Me,me=Ve,_e=$e,ce=Se;return n(),m("div",null,[a(N,{class:"!border-none mb-4",shadow:"never"},{default:o(()=>[a(ne,{class:"mb-[-16px]",model:l(u),inline:""},{default:o(()=>[a(y,{label:"\u8BA2\u5355\u53F7",prop:"order_id"},{default:o(()=>[a(c,{class:"w-[280px]",modelValue:l(u).order_id,"onUpdate:modelValue":t[0]||(t[0]=e=>l(u).order_id=e),onKeydown:Re(l(h),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u53F7"},null,8,["modelValue","onKeydown"])]),_:1}),a(y,{label:"\u95E8\u5E97",prop:"store_id"},{default:o(()=>[a(U,{modelValue:l(u).store_id,"onUpdate:modelValue":t[1]||(t[1]=e=>l(u).store_id=e),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":W,loading:l(w),style:{width:"240px"},onChange:l(h)},{default:o(()=>[(n(!0),m(B,null,x(l(I),e=>(n(),p(L,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading","onChange"])]),_:1}),a(y,{label:"\u7528\u6237",prop:"uid"},{default:o(()=>[a(U,{modelValue:l(u).uid,"onUpdate:modelValue":t[2]||(t[2]=e=>l(u).uid=e),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u7528\u6237\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":oe,loading:l(k),style:{width:"240px"},onChange:l(h)},{default:o(()=>[(n(!0),m(B,null,x(l(K),e=>(n(),p(L,{key:e.id,label:`${e.real_name}|${e.mobile} (ID:${e.id})`,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading","onChange"])]),_:1}),a(y,{label:"\u65E5\u671F",prop:"order_id"},{default:o(()=>[a(ue,{modelValue:l(_),"onUpdate:modelValue":t[3]||(t[3]=e=>R(_)?_.value=e:null),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","unlink-panels":"",shortcuts:J,onChange:Z},null,8,["modelValue"])]),_:1}),a(y,{label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type"},{default:o(()=>[a(U,{class:"w-[280px]",modelValue:l(u).pay_type,"onUpdate:modelValue":t[4]||(t[4]=e=>l(u).pay_type=e),placeholder:"\u8BF7\u9009\u62E9\u652F\u4ED8\u65B9\u5F0F",onChange:l(h)},{default:o(()=>[(n(!0),m(B,null,x(l(b).pay_type,e=>(n(),p(L,{label:e.name,value:e.value,key:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),a(y,null,{default:o(()=>[a(F,{type:"primary",onClick:l(h)},{default:o(()=>[r("\u67E5\u8BE2")]),_:1},8,["onClick"]),a(F,{onClick:t[5]||(t[5]=e=>l(te)())},{default:o(()=>[r("\u91CD\u7F6E")]),_:1}),a(se,{class:"ml-2.5","fetch-fun":l(q),params:l(u),"page-size":l(f).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),Ye((n(),p(N,{class:"!border-none",shadow:"never"},{default:o(()=>[a(ie,{modelValue:l(T),"onUpdate:modelValue":t[6]||(t[6]=e=>R(T)?T.value=e:null),onChange:Q},{default:o(()=>[a(re,{to:{path:"store_order/add"},class:"ml-4 mr-4"},{default:o(()=>[a(F,{type:"primary"},{default:o(()=>[r(" \u6DFB\u52A0\u8BA2\u5355 ")]),_:1})]),_:1}),a(D,{label:"0"},{default:o(()=>[r("\u5168\u90E8")]),_:1}),a(D,{label:"1"},{default:o(()=>[r("\u5F85\u652F\u4ED8")]),_:1}),a(D,{label:"2"},{default:o(()=>[r("\u5F85\u6838\u9500")]),_:1}),a(D,{label:"60"},{default:o(()=>[r("\u5DF2\u8BBE\u7F6E\u914D\u9001\u4EBA\u5458")]),_:1}),a(D,{label:"3"},{default:o(()=>[r("\u5DF2\u5B8C\u6210")]),_:1}),a(D,{label:"4"},{default:o(()=>[r("\u5DF2\u9000\u6B3E")]),_:1})]),_:1},8,["modelValue"]),Y("div",je,[a(me,{data:l(f).lists,onSelectionChange:ee},{default:o(()=>[a(i,{type:"selection",width:"55"}),a(i,{label:"\u8BA2\u5355ID",prop:"id","show-overflow-tooltip":""}),a(i,{label:"\u8BA2\u5355\u53F7",prop:"order_id","show-overflow-tooltip":""}),a(i,{label:"\u5546\u54C1\u4FE1\u606F",prop:"order_id","min-width":"150","show-overflow-tooltip":""},{default:o(({row:e})=>{var C,O;return[(n(!0),m(B,null,x((C=e.product)==null?void 0:C.slice(0,3),(A,fe)=>(n(),m("div",{class:"flex items-center mb-2",key:fe},[a(pe,{class:"w-[30px] h-[30px] mr-2 flex-shrink-0",src:A.image,fit:"cover","preview-src-list":[A.image],"preview-teleported":!0},null,8,["src","preview-src-list"]),Y("p",qe,E(A.store_name),1)]))),128)),((O=e.product)==null?void 0:O.length)>3?(n(),m("div",Ge,"...")):z("",!0)]}),_:1}),a(i,{label:"\u95E8\u5E97",prop:"store_name","show-overflow-tooltip":""}),a(i,{label:"\u7528\u6237",prop:"nickname","show-overflow-tooltip":""}),a(i,{label:"\u5B9E\u9645\u652F\u4ED8\u91D1\u989D",prop:"pay_price","show-overflow-tooltip":""}),a(i,{label:"\u8BA2\u5355\u72B6\u6001",prop:"status_name"},{default:o(({row:e})=>[e.refund_status==2?(n(),m("div",He,[a(g,{type:"danger"},{default:o(()=>[r("\u5DF2\u9000\u6B3E")]),_:1})])):(n(),m("div",Je,[e.status_name=="\u5F85\u6536\u8D27"?(n(),p(g,{key:0,type:"success"},{default:o(()=>[r(E(e.status_name),1)]),_:2},1024)):e.status_name=="\u5DF2\u6536\u8D27"||e.status_name=="\u5DF2\u5B8C\u6210"?(n(),p(g,{key:1,type:"info"},{default:o(()=>[r(E(e.status_name),1)]),_:2},1024)):e.status_name=="\u5F85\u53D1\u8D27"||e.status_name=="\u5F85\u6838\u9500"?(n(),p(g,{key:2,type:"warning"},{default:o(()=>[r(E(e.status_name),1)]),_:2},1024)):(n(),p(g,{key:3,type:"danger"},{default:o(()=>[r(E(e.status_name),1)]),_:2},1024))]))]),_:1}),a(i,{label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type","show-overflow-tooltip":""},{default:o(({row:e})=>[a(de,{options:l(b).pay_type,value:e.pay_type},null,8,["options","value"])]),_:1}),a(i,{label:"\u652F\u4ED8\u65F6\u95F4",prop:"pay_time","show-overflow-tooltip":""}),a(i,{label:"\u914D\u9001\u4EBA\u5458",prop:"delivery_name","show-overflow-tooltip":""}),a(i,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:e})=>[a(F,{type:"primary",link:"",onClick:C=>ae(e)},{default:o(()=>[r("\u8BE6\u60C5")]),_:2},1032,["onClick"]),a(F,{type:"primary",link:"",onClick:C=>le(e)},{default:o(()=>[r("\u8BBE\u7F6E\u914D\u9001\u4EBA\u5458")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),Y("div",Qe,[a(_e,{modelValue:l(f),"onUpdate:modelValue":t[7]||(t[7]=e=>R(f)?f.value=e:null),onChange:l(v)},null,8,["modelValue","onChange"])])]),_:1})),[[ce,l(f).loading]]),l($)?(n(),p(Oe,{key:0,ref_key:"editRef",ref:V,"dict-data":l(b),onSuccess:l(v),onClose:t[8]||(t[8]=e=>$.value=!1)},null,8,["dict-data","onSuccess"])):z("",!0),l(M)?(n(),p(Pe,{key:1,ref_key:"detailsRef",ref:S,onSuccess:l(v),onClose:t[9]||(t[9]=e=>M.value=!1),dictData:l(b)},null,8,["onSuccess","dictData"])):z("",!0)])}}});export{Gt as default};