import{U as he,a2 as ye,H as De,$ as Fe,C as ge,D as we,J as Ee,K as be,w as Ce,F as Be,L as ke,M as Ve,b as xe,N as Se,O as Ae}from"./element-plus.a63a26dd.js";import{_ as Te}from"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import{_ as $e}from"./index.vue_vue_type_script_setup_true_lang.ab7008c1.js";import{_ as Me}from"./index.vue_vue_type_script_setup_true_lang.6a7afe63.js";import{d as G,s as K,r as p,Z as Ue,i as Le,af as Re,ap as Oe,o as n,c as m,U as o,L as l,u as a,aa as Ye,T as x,a9 as S,K as d,j as U,R as r,M as N,a as L,S as g,Q as R,n as Pe}from"./@vue.18505fe0.js";import{u as ze}from"./usePaging.6a6670f9.js";import{u as Ie}from"./useDictOptions.f757f46e.js";import{a as j}from"./store_order.6bb18cc8.js";import{j as Ke}from"./beforehand_order.c8bd3ceb.js";import"./lodash.2473fc51.js";import{a as Ne}from"./system_store.0a321149.js";import{h as je}from"./index.914e16f9.js";import{h as q}from"./moment.40bc58bf.js";import{_ as qe}from"./edit.vue_vue_type_script_setup_true_name_storeOrderEdit_lang.8bde31c3.js";import{_ as Ge}from"./details.vue_vue_type_script_setup_true_name_storeOrderDETAILS_lang.8b99b900.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"./index.da3823b2.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.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"./delivery_service.311514dd.js";import"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.3565b593.js";import"./orderInfo.vue_vue_type_script_setup_true_name_orderInfo_lang.143e1eec.js";import"./storeTable.vue_vue_type_script_setup_true_name_storeTable_lang.f59e21f3.js";import"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.b651f149.js";import"./store_product.22e2a1b2.js";import"./store_branch_product.9586a3e4.js";import"./warehouse_product_storege.a3485e96.js";import"./editProduct.vue_vue_type_script_setup_true_name_warehouseOrderEdit_lang.948c47c7.js";import"./refundOrderProduct.vue_vue_type_script_setup_true_name_refundOrderProduct_lang.b71fd1a6.js";import"./warehouse.06fa072e.js";const He={class:"mt-4"},Je={class:"truncate text-[12px]"},Qe={key:0,style:{"text-align":"left"}},Ze={key:0},We={key:1},Xe={class:"flex mt-4 justify-end"},et=G({name:"storeOrderLists"}),ao=G({...et,setup(tt){const H=K(),A=K(),O=p(!1),T=p(!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]}}],_=p([]),u=Ue({order_id:"",uid:"",pay_type:"",store_id:"",start_time:"",end_time:"",paid:null,status:null,is_writeoff:null,source:""}),$=p("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=q(_.value[0]).format("YYYY-MM-DD")+" 00:00:00",u.end_time=q(_.value[1]).format("YYYY-MM-DD")+" 23:59:59"):(u.start_time="",u.end_time=""),v()},w=p(!1),Y=p([]),W=(s="")=>{w.value=!0,Ne({name:s,page_size:50}).then(t=>{Y.value=t.lists,setTimeout(()=>{w.value=!1},300)}).catch(t=>{setTimeout(()=>{w.value=!1},300)})},X=p([]),ee=s=>{X.value=s.map(({id:t})=>t)},{dictData:E}=Ie("pay_type"),{pager:f,getLists:v,resetParams:te,resetPage:h}=ze({fetchFun:j,params:u}),oe=async s=>{var t,C;T.value=!0,await Pe(),(t=A.value)==null||t.open(),(C=A.value)==null||C.getDetail(s)},b=p(!1),P=p([]),ae=(s="")=>{b.value=!0,je({nickname:s,page_size:50}).then(t=>{P.value=t.lists,setTimeout(()=>{b.value=!1},300)}).catch(t=>{setTimeout(()=>{b.value=!1},300)})},le=s=>{Ke(s)};return Le(()=>{v()}),(s,t)=>{const C=ge,c=we,B=Ee,k=be,ue=he,D=Ce,se=Me,ne=Be,z=ke,re=Re("router-link"),y=ye,ie=De,i=Ve,de=xe,F=Fe,pe=$e,me=Se,_e=Te,ce=Oe("perms"),fe=Ae;return n(),m("div",null,[o(z,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[o(ne,{class:"mb-[-16px]",model:a(u),inline:""},{default:l(()=>[o(c,{label:"\u8BA2\u5355\u53F7",prop:"order_id"},{default:l(()=>[o(C,{class:"w-[280px]",modelValue:a(u).order_id,"onUpdate:modelValue":t[0]||(t[0]=e=>a(u).order_id=e),onKeydown:Ye(a(h),["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u53F7"},null,8,["modelValue","onKeydown"])]),_:1}),o(c,{label:"\u95E8\u5E97",prop:"store_id"},{default:l(()=>[o(k,{modelValue:a(u).store_id,"onUpdate:modelValue":t[1]||(t[1]=e=>a(u).store_id=e),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u95E8\u5E97\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":W,loading:a(w),style:{width:"240px"},onChange:a(h)},{default:l(()=>[(n(!0),m(x,null,S(a(Y),e=>(n(),d(B,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading","onChange"])]),_:1}),o(c,{label:"\u7528\u6237",prop:"uid"},{default:l(()=>[o(k,{modelValue:a(u).uid,"onUpdate:modelValue":t[2]||(t[2]=e=>a(u).uid=e),filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8F93\u5165\u7528\u6237\u540D\u79F0\u641C\u7D22","remote-show-suffix":"","remote-method":ae,loading:a(b),style:{width:"240px"},onChange:a(h)},{default:l(()=>[(n(!0),m(x,null,S(a(P),e=>(n(),d(B,{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}),o(c,{label:"\u65E5\u671F",prop:"order_id"},{default:l(()=>[o(ue,{modelValue:a(_),"onUpdate:modelValue":t[3]||(t[3]=e=>U(_)?_.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}),o(c,{label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type"},{default:l(()=>[o(k,{class:"w-[280px]",modelValue:a(u).pay_type,"onUpdate:modelValue":t[4]||(t[4]=e=>a(u).pay_type=e),placeholder:"\u8BF7\u9009\u62E9\u652F\u4ED8\u65B9\u5F0F",onChange:a(h)},{default:l(()=>[(n(!0),m(x,null,S(a(E).pay_type,e=>(n(),d(B,{label:e.name,value:e.value,key:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),o(c,{label:"\u8BA2\u5355\u7C7B\u578B",prop:"source"},{default:l(()=>[o(k,{class:"w-[280px]",modelValue:a(u).source,"onUpdate:modelValue":t[5]||(t[5]=e=>a(u).source=e),placeholder:"\u8BF7\u9009\u62E9\u8BA2\u5355\u7C7B\u578B",onChange:a(h)},{default:l(()=>[o(B,{label:"\u6279\u53D1\u8BA2\u5355",value:"4"})]),_:1},8,["modelValue","onChange"])]),_:1}),o(c,null,{default:l(()=>[o(D,{type:"primary",onClick:a(h)},{default:l(()=>[r("\u67E5\u8BE2")]),_:1},8,["onClick"]),o(D,{onClick:t[6]||(t[6]=e=>a(te)())},{default:l(()=>[r("\u91CD\u7F6E")]),_:1}),o(se,{class:"ml-2.5","fetch-fun":a(j),params:a(u),"page-size":a(f).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),N((n(),d(z,{class:"!border-none",shadow:"never"},{default:l(()=>[o(ie,{modelValue:a($),"onUpdate:modelValue":t[7]||(t[7]=e=>U($)?$.value=e:null),onChange:Q},{default:l(()=>[N((n(),d(re,{to:{path:"store_order/add"},class:"ml-4 mr-4"},{default:l(()=>[o(D,{type:"primary"},{default:l(()=>[r(" \u6DFB\u52A0\u8BA2\u5355 ")]),_:1})]),_:1})),[[ce,["order/store_order/add"]]]),o(y,{label:"0"},{default:l(()=>[r("\u5168\u90E8")]),_:1}),o(y,{label:"1"},{default:l(()=>[r("\u5F85\u652F\u4ED8")]),_:1}),o(y,{label:"2"},{default:l(()=>[r("\u5F85\u6838\u9500")]),_:1}),o(y,{label:"60"},{default:l(()=>[r("\u5DF2\u8BBE\u7F6E\u914D\u9001\u4EBA\u5458")]),_:1}),o(y,{label:"3"},{default:l(()=>[r("\u5DF2\u5B8C\u6210")]),_:1}),o(y,{label:"4"},{default:l(()=>[r("\u5DF2\u9000\u6B3E")]),_:1})]),_:1},8,["modelValue"]),L("div",He,[o(me,{data:a(f).lists,onSelectionChange:ee},{default:l(()=>[o(i,{label:"ID",prop:"id","show-overflow-tooltip":"",width:"100"}),o(i,{label:"\u8BA2\u5355\u53F7",prop:"order_id","show-overflow-tooltip":"",width:"200"}),o(i,{label:"\u5546\u54C1\u4FE1\u606F",prop:"order_id",width:"150","show-overflow-tooltip":""},{default:l(({row:e})=>{var V,I;return[(n(!0),m(x,null,S((V=e.product)==null?void 0:V.slice(0,3),(M,ve)=>(n(),m("div",{class:"flex items-center mb-2",key:ve},[o(de,{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",Je,g(M.store_name),1)]))),128)),((I=e.product)==null?void 0:I.length)>3?(n(),m("div",Qe,"...")):R("",!0)]}),_:1}),o(i,{label:"\u95E8\u5E97",prop:"store_name","show-overflow-tooltip":"",width:"150"}),o(i,{label:"\u7528\u6237",prop:"nickname","show-overflow-tooltip":"",width:"150"}),o(i,{label:"\u5B9E\u9645\u652F\u4ED8\u91D1\u989D",prop:"pay_price","show-overflow-tooltip":"",width:"150"}),o(i,{label:"\u8BA2\u5355\u72B6\u6001",prop:"status_name",width:"100"},{default:l(({row:e})=>[e.refund_status==2?(n(),m("div",Ze,[o(F,{type:"danger"},{default:l(()=>[r("\u5DF2\u9000\u6B3E")]),_:1})])):(n(),m("div",We,[e.status_name=="\u5F85\u6536\u8D27"?(n(),d(F,{key:0,type:"success"},{default:l(()=>[r(g(e.status_name),1)]),_:2},1024)):e.status_name=="\u5DF2\u6536\u8D27"||e.status_name=="\u5DF2\u5B8C\u6210"?(n(),d(F,{key:1,type:"info"},{default:l(()=>[r(g(e.status_name),1)]),_:2},1024)):e.status_name=="\u5F85\u53D1\u8D27"||e.status_name=="\u5F85\u6838\u9500"?(n(),d(F,{key:2,type:"warning"},{default:l(()=>[r(g(e.status_name),1)]),_:2},1024)):(n(),d(F,{key:3,type:"danger"},{default:l(()=>[r(g(e.status_name),1)]),_:2},1024))]))]),_:1}),o(i,{label:"\u652F\u4ED8\u65B9\u5F0F",prop:"pay_type","show-overflow-tooltip":"",width:"100"},{default:l(({row:e})=>[o(pe,{options:a(E).pay_type,value:e.pay_type},null,8,["options","value"])]),_:1}),o(i,{label:"\u8BA2\u5355\u7C7B\u578B",prop:"source_name","show-overflow-tooltip":"",width:"100"}),o(i,{label:"\u652F\u4ED8\u65F6\u95F4",prop:"pay_time","show-overflow-tooltip":"",width:"200"}),o(i,{label:"\u64CD\u4F5C",fixed:"right"},{default:l(({row:e})=>[o(D,{type:"primary",link:"",onClick:V=>oe(e)},{default:l(()=>[r("\u8BE6\u60C5")]),_:2},1032,["onClick"]),o(D,{type:"primary",link:"",onClick:V=>le(e)},{default:l(()=>[r("\u8F6C\u9884\u5B9A\u5355")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),L("div",Xe,[o(_e,{modelValue:a(f),"onUpdate:modelValue":t[8]||(t[8]=e=>U(f)?f.value=e:null),onChange:a(v)},null,8,["modelValue","onChange"])])]),_:1})),[[fe,a(f).loading]]),a(O)?(n(),d(qe,{key:0,ref_key:"editRef",ref:H,"dict-data":a(E),onSuccess:a(v),onClose:t[9]||(t[9]=e=>O.value=!1)},null,8,["dict-data","onSuccess"])):R("",!0),a(T)?(n(),d(Ge,{key:1,ref_key:"detailsRef",ref:A,onSuccess:a(v),onClose:t[10]||(t[10]=e=>T.value=!1),dictData:a(E)},null,8,["onSuccess","dictData"])):R("",!0)])}}});export{ao as default};