import{a6 as Z,$ as G,C as H,D as J,w as Q,F as W,L as X,M as Y,b as ee,N as oe,O as te}from"./element-plus.7b9d0c0d.js";import{_ as ae}from"./index.vue_vue_type_script_setup_true_lang.8b9de773.js";import{d as I,r as D,Z as le,af as re,ap as ue,o as i,c as se,U as e,L as o,u as l,aa as ie,R as p,M as c,K as n,a as z,j as pe}from"./@vue.18505fe0.js";import{u as ne}from"./usePaging.6a6670f9.js";import{u as de}from"./useDictOptions.1e75c240.js";import{f as me,d as ce}from"./store_product.5324b61b.js";import"./lodash.9dc701ad.js";import{f as _e}from"./index.887947f5.js";import{_ as fe}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.fc18641b.js";import{a as we}from"./store_category.6535800b.js";import{u as he}from"./vue-router.101084e3.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.7347fedc.js";import"./axios.4607972f.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./system_store.5adf4f9f.js";import"./pinia.a969beab.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.0d2736b7.js";import"./vue-clipboard3.7d5a7a5d.js";import"./clipboard.860a1cea.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";const Ce={class:"mt-4"},ve={class:"flex mt-4 justify-end"},be=I({name:"storeProductLists"}),so=I({...be,setup(ge){const V=he(),h=D(null),_=le({store_name:"",class_all:""}),C=D([]),R=u=>{C.value=u.map(({id:a})=>a)};de("");let x=1;V.query.page_no&&(x=parseInt(V.query.page_no));const{pager:f,getLists:v,resetParams:S,resetPage:b}=ne({page:x,fetchFun:ce,params:_}),A=async u=>{var a,m;(a=h.value)==null||a.open(),(m=h.value)==null||m.setFormData(u)};let g,y;const E=D(!1);let F;const K=u=>(F=u,E.value=!0,L.lazyLoad(y,g),!1),L={value:"id",label:"name",emitPath:!1,lazy:!0,lazyLoad(u,a){g||(g=a),y||(y=u);const m=u.value||0;let d={};E.value?(d={name:F},F||(d={pid:m,page_size:1e4})):d={pid:m,page_size:1e4},we({...d}).then(k=>{a(k.lists.map(s=>(s.leaf=!0,E.value=!1,s)))})}},P=async u=>{await _e.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await me({id:u}),v()};return v(),(u,a)=>{const m=H,d=J,k=Z,s=Q,N=W,$=X,B=re("router-link"),t=Y,T=ee,q=G,U=oe,j=ae,w=ue("perms"),M=te;return i(),se("div",null,[e($,{class:"!border-none mb-4",shadow:"never"},{default:o(()=>[e(N,{class:"mb-[-16px]",model:l(_),inline:""},{default:o(()=>[e(d,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:o(()=>[e(m,{class:"w-[280px]",onKeydown:ie(l(b),["enter"]),modelValue:l(_).store_name,"onUpdate:modelValue":a[0]||(a[0]=r=>l(_).store_name=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["onKeydown","modelValue"])]),_:1}),e(d,{label:"\u5546\u54C1\u5206\u7C7B",prop:"store_name"},{default:o(()=>[e(k,{class:"w-[280px]",modelValue:l(_).class_all,"onUpdate:modelValue":a[1]||(a[1]=r=>l(_).class_all=r),filterable:"",clearable:"","before-filter":K,props:L,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",onChange:l(b)},null,8,["modelValue","onChange"])]),_:1}),e(d,null,{default:o(()=>[e(s,{type:"primary",onClick:l(b)},{default:o(()=>[p("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(s,{onClick:l(S)},{default:o(()=>[p("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),c((i(),n($,{class:"!border-none",shadow:"never"},{default:o(()=>[c((i(),n(B,{to:{path:"store_product_edit",query:{id:0,mode:"add"}},class:"mr-4"},{default:o(()=>[e(s,{type:"primary",icon:"Plus"},{default:o(()=>[p(" \u65B0\u589E ")]),_:1})]),_:1})),[[w,["store_product.store_product/add"]]]),c((i(),n(s,{disabled:!l(C).length,onClick:a[2]||(a[2]=r=>P(l(C)))},{default:o(()=>[p(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[w,["store_product.store_product/delete"]]]),c((i(),n(B,{to:{path:"product_import"},class:"ml-4"},{default:o(()=>[e(s,{type:"primary"},{default:o(()=>[p(" \u5BFC\u5165\u5546\u54C1\u5230\u95E8\u5E97 ")]),_:1})]),_:1})),[[w,["store_product.store_product/add"]]]),z("div",Ce,[e(U,{data:l(f).lists,onSelectionChange:R},{default:o(()=>[e(t,{type:"selection",width:"55"}),e(t,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(t,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:o(({row:r})=>[e(T,{style:{width:"50px",height:"50px"},src:r.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(t,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(t,{label:"\u5206\u7C7B",prop:"cate_name","min-width":"120","show-overflow-tooltip":""}),e(t,{label:"\u5355\u4F4D",prop:"unit_name","min-width":"80","show-overflow-tooltip":""}),e(t,{label:"\u4F9B\u8D27\u4EF7",prop:"purchase","min-width":"100","show-overflow-tooltip":""}),e(t,{label:"\u5546\u6237\u4EF7",prop:"cost","min-width":"120","show-overflow-tooltip":""}),e(t,{label:"\u4F1A\u5458\u4EF7",prop:"vip_price","min-width":"120","show-overflow-tooltip":""}),e(t,{label:"\u7EC8\u7AEF\u96F6\u552E\u4EF7",prop:"price","min-width":"120","show-overflow-tooltip":""}),e(t,{label:"\u8D77\u6279\u91CF",prop:"batch","min-width":"100","show-overflow-tooltip":""}),e(t,{label:"\u552E\u5356\u5E93\u5B58",prop:"stock","min-width":"100","show-overflow-tooltip":""}),e(t,{label:"\u5151\u6362\u5E93\u5B58",prop:"swap","min-width":"100","show-overflow-tooltip":""}),e(t,{label:"\u9500\u91CF",prop:"sales","min-width":"100","show-overflow-tooltip":""}),e(t,{label:"\u72B6\u6001",prop:"is_show"},{default:o(({row:r})=>[r.is_show?(i(),n(q,{key:0,type:"success"},{default:o(()=>[p(" \u4E0A\u67B6 ")]),_:1})):(i(),n(q,{key:1,type:"info"},{default:o(()=>[p(" \u4E0B\u67B6 ")]),_:1}))]),_:1}),e(t,{label:"\u6761\u7801",prop:"bar_code","min-width":"200","show-overflow-tooltip":""}),e(t,{label:"\u64CD\u4F5C",width:"180",fixed:"right"},{default:o(({row:r})=>[c((i(),n(B,{to:{path:"store_product_edit",query:{id:r.id,mode:"edit",page:l(f).page}},class:"mr-4"},{default:o(()=>[e(s,{type:"primary",link:""},{default:o(()=>[p(" \u7F16\u8F91 ")]),_:1})]),_:2},1032,["to"])),[[w,["store_product.store_product/edit"]]]),c((i(),n(s,{type:"primary",link:"",onClick:O=>A(r)},{default:o(()=>[p(" \u8BE6\u60C5 ")]),_:2},1032,["onClick"])),[[w,["store_product.store_product/edit"]]]),c((i(),n(s,{type:"danger",link:"",onClick:O=>P(r.id)},{default:o(()=>[p(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[w,["store_product.store_product/delete"]]])]),_:1})]),_:1},8,["data"])]),z("div",ve,[e(j,{modelValue:l(f),"onUpdate:modelValue":a[3]||(a[3]=r=>pe(f)?f.value=r:null),onChange:l(v)},null,8,["modelValue","onChange"])])]),_:1})),[[M,l(f).loading]]),e(fe,{ref_key:"detailsRef",ref:h},null,512)])}}});export{so as default};