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