import{g as B}from"./spellrice.ca3d178e.js";import{d as N,r as y,a as q,c,at as T,e as b,f as w,h as e,i as l,g as r,t as D,u as p,dt as C,aT as O,w as A,as as H,m as _,y as J,_ as Y}from"./index.0308b213.js";const R={style:{width:"100%"}},$={style:{display:"flex","align-items":"center"}},j={style:{"margin-left":"10px"}},I=_("\u5220\u9664"),M=_("\u9009\u62E9\u5546\u54C1"),U={class:"content"},z={class:"inpBox"},K={class:"dialog-footer"},L=_("\u53D6\u6D88"),P=_(" \u786E\u5B9A "),Q=N({props:{goods:{default:()=>[]},id:{default:0}},setup(m){const i=m,f=y();q().format("YYYY-MM-DD");const t=y({show:!1,loading:!1,keyword:"",tableData:[]}),v=y([]),x=()=>{t.value.show=!0,t.value.keyword="",t.value.tableData=[]},k=()=>{t.value.show=!1,t.value.keyword="",t.value.tableData=[]},S=n=>{i.goods.splice(n,1)},E=()=>{t.value.loading=!0,B({keyword:t.value.keyword,is_tuangouquan:1}).then(n=>{t.value.tableData=n.list,console.log(i.goods),console.log(f),J(()=>{t.value.tableData.forEach(s=>{i.goods.forEach(u=>{s.id===u.id&&f.value.toggleRowSelection(s,!0)})})})}).finally(()=>{t.value.loading=!1})},F=n=>{v.value=n},G=()=>{let n=JSON.parse(JSON.stringify(v.value)),u=[...JSON.parse(JSON.stringify(i.goods)),...n];u=u.filter((a,d,h)=>(a.quantity_price||(a.quantity_price=[{quantity:"",discount_price:""},{quantity:"",discount_price:""},{quantity:"",discount_price:""}]),h.findIndex(g=>g.id===a.id)===d)),i.goods.length=0,i.goods.push(...u),k()};return(n,s)=>{const u=c("el-image"),a=c("el-table-column"),d=c("el-button"),h=c("el-input"),g=c("el-dialog"),V=T("loading");return b(),w("div",R,[e(p(C),{data:m.goods,style:{width:"100%"},border:""},{default:l(()=>[e(a,{label:"\u7565\u7F29\u56FE"},{default:l(({row:o})=>[r("div",$,[e(u,{style:{width:"60px",height:"60px"},src:o.thumb,fit:"fill"},null,8,["src"])])]),_:1}),e(a,{label:"\u83DC\u54C1\u540D\u79F0"},{default:l(({row:o})=>[r("span",j,D(o.title),1)]),_:1}),e(a,{label:"\u64CD\u4F5C"},{default:l(o=>[e(d,{size:"small",onClick:W=>S(o.$index)},{default:l(()=>[I]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),e(d,{style:{"margin-top":"10px"},type:"primary",icon:p(O),onClick:x},{default:l(()=>[M]),_:1},8,["icon"]),e(g,{"append-to-body":"",modelValue:t.value.show,"onUpdate:modelValue":s[2]||(s[2]=o=>t.value.show=o),title:"\u9009\u62E9\u5546\u54C1",width:"600px"},{footer:l(()=>[r("span",K,[e(d,{onClick:s[1]||(s[1]=o=>t.value.show=!1)},{default:l(()=>[L]),_:1}),e(d,{type:"primary",onClick:G},{default:l(()=>[P]),_:1})])]),default:l(()=>[A((b(),w("div",U,[e(h,{modelValue:t.value.keyword,"onUpdate:modelValue":s[0]||(s[0]=o=>t.value.keyword=o),placeholder:"\u8F93\u5165\u5546\u54C1\u540D\u79F0\u8FDB\u884C\u641C\u7D22",class:"input-with-select"},{append:l(()=>[e(d,{icon:p(H),onClick:E},null,8,["icon"])]),_:1},8,["modelValue"]),e(p(C),{"empty-text":"\u8F93\u5165\u5546\u54C1\u540D\u79F0\u8FDB\u884C\u641C\u7D22",data:t.value.tableData,style:{width:"100%"},border:"",onSelectionChange:F,ref_key:"multipleTableRef",ref:f},{default:l(()=>[e(a,{type:"selection",width:"55"}),e(a,{prop:"title",label:"\u540D\u79F0",width:"200px"},{default:l(o=>[r("div",z,[e(u,{style:{width:"40px",height:"40px","flex-shrink":"0"},src:o.row.thumb},null,8,["src"]),r("span",null,D(o.row.title),1)])]),_:1}),e(a,{prop:"store_title",label:"\u5546\u6237"}),e(a,{prop:"price",label:"\u4EF7\u683C"}),e(a,{prop:"total",label:"\u5E93\u5B58"})]),_:1},8,["data"])])),[[V,t.value.loading]])]),_:1},8,["modelValue"])])}}});const ee=Y(Q,[["__scopeId","data-v-f9fb6b55"]]);export{ee as default};
