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