import{k as y,C as x,D as L,w as N,F as P,M as S,N as A,O as I}from"./element-plus.a63a26dd.js";import{_ as M}from"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import{u as T}from"./usePaging.6a6670f9.js";import{u as U}from"./useDictOptions.f757f46e.js";import{a as W}from"./warehouse.06fa072e.js";import"./lodash.2473fc51.js";import"./index.914e16f9.js";import{d as E,Z as j,r as R,o as _,c as f,U as e,L as a,u as o,R as m,M as q,a as O,j as Z}from"./@vue.18505fe0.js";const $={class:"mt-4"},z={class:"flex mt-4 justify-end"},G=E({name:"systemStoreLists"}),ae=E({...G,emits:["onBindWarehouse"],setup(H,{emit:h}){const u=j({name:""}),c=R([]),g=n=>{c.value=n.map(({id:t})=>t)};U("");const{pager:l,getLists:p,resetParams:w,resetPage:C}=T({fetchFun:W,params:u});p();const v=h,D=()=>{const n=l.lists.filter(t=>c.value.includes(t.id));if(!n.length)return y.error("\u8BF7\u5148\u9009\u62E9\u4ED3\u5E93");v("onBindWarehouse",n[0])};return(n,t)=>{const b=x,d=L,i=N,B=P,s=S,F=A,V=M,k=I;return _(),f("div",null,[e(B,{class:"mb-[-16px]",model:o(u),inline:""},{default:a(()=>[e(d,{label:"\u4ED3\u5E93\u540D\u79F0",prop:"name"},{default:a(()=>[e(b,{class:"w-[200px]",modelValue:o(u).name,"onUpdate:modelValue":t[0]||(t[0]=r=>o(u).name=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(d,null,{default:a(()=>[e(i,{type:"primary",onClick:o(C)},{default:a(()=>[m("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(i,{onClick:o(w)},{default:a(()=>[m("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),q((_(),f("div",$,[e(F,{data:o(l).lists,onSelectionChange:g,height:300},{default:a(()=>[e(s,{type:"selection",width:"55"}),e(s,{label:"ID",prop:"id","show-overflow-tooltip":""}),e(s,{label:"\u4ED3\u5E93\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(s,{label:"\u8054\u7CFB\u4EBA\u5458",prop:"contacts","show-overflow-tooltip":""}),e(s,{label:"\u624B\u673A\u53F7\u7801",prop:"tel","show-overflow-tooltip":""}),e(s,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"address","show-overflow-tooltip":""})]),_:1},8,["data"])])),[[k,o(l).loading]]),O("div",z,[e(V,{modelValue:o(l),"onUpdate:modelValue":t[1]||(t[1]=r=>Z(l)?l.value=r:null),onChange:o(p)},null,8,["modelValue","onChange"])]),e(i,{class:"w-full mt-4",type:"primary",onClick:D},{default:a(()=>[m("\u6DFB\u52A0\u4ED3\u5E93")]),_:1})])}}});export{ae as _};
