import{P as R,Q as U,k as T,C as j,D as A,w as G,F as K,G as M,b as q,H,I as Q}from"./element-plus.8e273e86.js";import{_ as Z}from"./index.vue_vue_type_script_setup_true_lang.d6032bc4.js";import{d as g,Z as $,r as w,o as C,c as b,U as e,L as o,u as l,aa as z,R as i,M as J,a as O,j as W}from"./@vue.76ce7aa3.js";import{u as X}from"./usePaging.f8c888e4.js";import{u as Y}from"./useDictOptions.0f4dac76.js";import{a as ee}from"./store_product.607bf6ee.js";const te={class:"mt-4"},oe={class:"flex mt-4 justify-end"},le=g({name:"systemStoreLists"}),pe=g({...le,props:{userId:Number,storeId:Number,order_type:Number},emits:["onBindStore"],setup(E,{emit:v}){const p=E,u=$({store_name:"",is_warehouse:1,user_id:p.userId,store_id:p.storeId,order_type:p.order_type,type_filter:1}),c=w([]);w();const y=s=>{c.value=s.map(({id:t})=>t)};Y("");const h=s=>{m(),s.preventDefault()},{pager:r,getLists:m,resetParams:B,resetPage:F}=X({fetchFun:ee,params:u});m();const D=v,V=()=>{const s=r.lists.filter(t=>c.value.includes(t.id));if(!s.length)return T.error("\u8BF7\u5148\u9009\u62E9\u5546\u54C1");D("onBindStore",s)};return(s,t)=>{const k=j,d=A,f=R,x=U,_=G,I=K,a=M,S=q,L=H,N=Z,P=Q;return C(),b("div",null,[e(I,{class:"mb-[-16px]",model:l(u),inline:""},{default:o(()=>[e(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:o(()=>[e(k,{class:"w-[200px]",modelValue:l(u).store_name,"onUpdate:modelValue":t[0]||(t[0]=n=>l(u).store_name=n),onKeydown:z(h,["enter"]),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(d,{label:"\u5546\u54C1\u7C7B\u578B",prop:"type_filter"},{default:o(()=>[e(x,{modelValue:l(u).type_filter,"onUpdate:modelValue":t[1]||(t[1]=n=>l(u).type_filter=n)},{default:o(()=>[e(f,{label:1},{default:o(()=>t[3]||(t[3]=[i("\u4E0A\u67B6")])),_:1}),e(f,{label:0},{default:o(()=>t[4]||(t[4]=[i("\u4E34\u91C7")])),_:1})]),_:1},8,["modelValue"])]),_:1}),e(d,null,{default:o(()=>[e(_,{type:"primary",onClick:l(F)},{default:o(()=>t[5]||(t[5]=[i("\u67E5\u8BE2")])),_:1},8,["onClick"]),e(_,{onClick:l(B)},{default:o(()=>t[6]||(t[6]=[i("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),J((C(),b("div",te,[e(L,{data:l(r).lists,onSelectionChange:y,height:300},{default:o(()=>[e(a,{type:"selection",width:"55"}),e(a,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:n})=>[e(S,{style:{width:"50px",height:"50px"},src:n.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(a,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(a,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),e(a,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(a,{label:"\u5546\u54C1\u4EF7\u683C",prop:"price","min-width":"100","show-overflow-tooltip":""}),e(a,{label:"\u4ED3\u5E93\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""})]),_:1},8,["data"])])),[[P,l(r).loading]]),O("div",oe,[e(N,{modelValue:l(r),"onUpdate:modelValue":t[2]||(t[2]=n=>W(r)?r.value=n:null),onChange:l(m)},null,8,["modelValue","onChange"])]),e(_,{class:"w-full mt-4",type:"primary",onClick:V},{default:o(()=>t[7]||(t[7]=[i("\u6DFB\u52A0\u5546\u54C1")])),_:1})])}}});export{pe as _};
