import{d as N,r as f,c as F,e as a,f as d,g as e,F as S,j as x,t as n,u as A,a as B,k as D,A as b,h as p,i as k,m,R as L,S as H,_ as Y}from"./index.0308b213.js";import z from"./RemarkPopup.30c621c2.js";const V=r=>(L("data-v-d936d672"),r=r(),H(),r),J={class:"main"},P=V(()=>e("h1",null,"\u53D6\u5355",-1)),R=V(()=>e("hr",null,null,-1)),T={class:"main-list"},$=m(" \u8BA2\u5355\u603B\u4EF7: "),j={class:"main-list-item-goods"},M=["src"],U={style:{"max-width":"200px"}},q={style:{"min-width":"200px"}},G={class:"main-list-btn"},K=m("\u5220\u9664"),Q=m("\u5907\u6CE8"),W=m("\u53D6\u5355"),X=N({props:{modelValue:{default:()=>[]}},emits:["update:modelValue","delete","takeAnOrder"],setup(r,{emit:g}){const u=r,i=f(!1),v=f(""),c=f("");function C(l){var _;const s=(_=JSON.parse(localStorage.getItem("orderList")||""))!=null?_:[];s.splice(l,1),localStorage.setItem("orderList",JSON.stringify(s)),u.modelValue.splice(l,1),g("update:modelValue",u.modelValue)}function w(l){v.value=l.id,c.value=l.remark,i.value=!0}function I(l){u.modelValue.forEach(s=>{s.id===v.value&&(s.remark=l)}),localStorage.setItem("orderList",JSON.stringify(u.modelValue)),v.value="",c.value="",i.value=!1}function O(l){g("takeAnOrder",l)}return(l,s)=>{const _=F("el-alert"),h=F("el-button");return a(),d("div",J,[P,R,e("div",T,[(a(!0),d(S,null,x(u.modelValue,(t,y)=>(a(),d("div",{key:y,class:"main-list-item"},[e("p",null,[$,e("span",null,"\uFFE5"+n(t.totalPrice),1)]),e("p",null,"\u6302\u5355\u65F6\u95F4\uFF1A"+n(A(B)(t.time).format("YYYY-MM-DD HH:mm:ss")),1),e("div",j,[(a(!0),d(S,null,x(t.list,(o,E)=>(a(),d("div",{key:E,class:"main-list-item-goods-item"},[e("img",{src:o.thumb,alt:""},null,8,M),e("div",null,[e("div",U,[e("p",q,n(o.title),1),e("p",null,"\uFFE5"+n(o.price),1)]),e("div",null,"x"+n(o.num),1),e("div",null,"\uFFE5"+n((o.price*o.num).toFixed(2)),1)])]))),128))]),t.remark?(a(),D(_,{key:0,title:t.remark,type:"success",closable:!1},null,8,["title"])):b("",!0),e("div",G,[p(h,{size:"large",onClick:o=>C(y)},{default:k(()=>[K]),_:2},1032,["onClick"]),p(h,{size:"large",onClick:o=>w(t)},{default:k(()=>[Q]),_:2},1032,["onClick"]),p(h,{size:"large",type:"primary",onClick:o=>O(t)},{default:k(()=>[W]),_:2},1032,["onClick"])])]))),128))]),p(z,{show:i.value,"onUpdate:show":s[0]||(s[0]=t=>i.value=t),text:c.value,"onUpdate:text":s[1]||(s[1]=t=>c.value=t),onSave:I},null,8,["show","text"])])}}});const te=Y(X,[["__scopeId","data-v-d936d672"]]);export{te as default};
