import{C as T,D as j,w as R,F as A,T as G,O as S,b as q,Q as K,R as M}from"./element-plus.bccb9376.js";import{_ as O}from"./index.vue_vue_type_script_setup_true_lang.120de7ce.js";import{u as Q}from"./usePaging.6a6670f9.js";import{u as Z}from"./useDictOptions.f22931fb.js";import{a as $,b as z}from"./goods.f07434d1.js";import{d as h,r as c,Z as H,o as F,c as J,U as e,L as l,u,R as m,M as W,K as X,a as _,j as Y}from"./@vue.18505fe0.js";const ee={class:"mt-4"},le={class:"flex mt-4 justify-end"},oe={class:"flex mt-4 justify-end"},ae=h({name:"goodsLists"}),pe=h({...ae,props:{mer_id:Number},emits:["offPop"],setup(v,{emit:E}){let g=v;c(!1),c(!1);const f=E,s=H({name:"",class:"",brand:"",unit:"",code:"",warehouse:"",retail_name:"",sort:""}),b=c([]),D=d=>{b.value=d.map(({id:o})=>o)};Z("");const{pager:r,getLists:C,resetParams:V,resetPage:B}=Q({fetchFun:$,params:s}),x=async()=>{let d=r.lists.filter(n=>b.value.includes(n.id)),o={mer_id:g.mer_id,bind_data:[]};d.forEach(n=>{o.bind_data.push({goods_id:n.id,nums:n.num})}),await z(o),f("offPop")},y=()=>{f("offPop")};return C(),(d,o)=>{const n=T,p=j,i=R,k=A,w=G,a=S,P=q,U=K,L=O,I=M;return F(),J("div",null,[e(w,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[e(k,{class:"mb-[-16px]",model:u(s),inline:""},{default:l(()=>[e(p,{label:"\u5546\u54C1\u540D\u79F0",prop:"name"},{default:l(()=>[e(n,{class:"w-[280px]",modelValue:u(s).name,"onUpdate:modelValue":o[0]||(o[0]=t=>u(s).name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u5546\u54C1\u54C1\u724C",prop:"brand"},{default:l(()=>[e(n,{class:"w-[280px]",modelValue:u(s).brand,"onUpdate:modelValue":o[1]||(o[1]=t=>u(s).brand=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u54C1\u724C"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u5546\u54C1\u5355\u4F4D",prop:"unit"},{default:l(()=>[e(n,{class:"w-[280px]",modelValue:u(s).unit,"onUpdate:modelValue":o[2]||(o[2]=t=>u(s).unit=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u5355\u4F4D"},null,8,["modelValue"])]),_:1}),e(p,null,{default:l(()=>[e(i,{type:"primary",onClick:u(B)},{default:l(()=>[m("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(i,{onClick:u(V)},{default:l(()=>[m("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),W((F(),X(w,{class:"!border-none",shadow:"never"},{default:l(()=>[_("div",ee,[e(U,{data:u(r).lists,onSelectionChange:D},{default:l(()=>[e(a,{type:"selection",width:"55"}),e(a,{label:"ID",prop:"id",width:"55"}),e(a,{label:"\u5546\u54C1\u56FE\u7247",prop:"imgs"},{default:l(({row:t})=>[e(P,{style:{width:"50px",height:"50px"},src:t.imgs},null,8,["src"])]),_:1}),e(a,{label:"\u5546\u54C1\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(a,{label:"\u89C4\u683C\u578B\u53F7",prop:"spec","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u5206\u7C7B",prop:"class_name","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u54C1\u724C",prop:"brand_name","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),e(a,{label:"\u8D2D\u8D27\u4EF7\u683C",prop:"buy","show-overflow-tooltip":""}),e(a,{label:"\u9500\u8D27\u4EF7\u683C",prop:"sell","show-overflow-tooltip":""}),e(a,{label:"\u96F6\u552E\u4EF7\u683C",prop:"retail","show-overflow-tooltip":""}),e(a,{label:"\u6807\u7B7E",prop:"sys_labels_text","show-overflow-tooltip":""}),e(a,{label:"\u6570\u91CF",prop:"num",width:"170"},{default:l(({row:t})=>[e(n,{type:"number",modelValue:t.num,"onUpdate:modelValue":N=>t.num=N,clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6570\u91CF"},null,8,["modelValue","onUpdate:modelValue"])]),_:1})]),_:1},8,["data"])]),_("div",le,[e(L,{modelValue:u(r),"onUpdate:modelValue":o[3]||(o[3]=t=>Y(r)?r.value=t:null),onChange:u(C)},null,8,["modelValue","onChange"])]),_("div",oe,[e(i,{type:"primary",onClick:x},{default:l(()=>[m("\u786E\u8BA4\u7ED1\u5B9A")]),_:1}),e(i,{onClick:y},{default:l(()=>[m("\u53D6\u6D88")]),_:1})])]),_:1})),[[I,u(r).loading]])])}}});export{pe as _};
