import{a8 as oe,C as te,D as le,J as ae,K as ue,w as se,F as ne,L as re,M as pe,b as ie,t as de,N as me,O as _e}from"./element-plus.91c68cc0.js";import{_ as ce}from"./index.vue_vue_type_script_setup_true_lang.863ae816.js";import{_ as fe}from"./index.vue_vue_type_script_setup_true_lang.d134accc.js";import{d as N,s as Ce,r as E,Z as ve,i as be,af as ge,ap as ye,o as c,c as we,U as o,L as a,u as l,aa as he,R as i,M as b,K as v,a as d,S as g,j as Ee,Q as Fe,n as Be}from"./@vue.76ce7aa3.js";import{u as Ve}from"./usePaging.f8c888e4.js";import{u as De}from"./useDictOptions.1f11cf62.js";import{a as K,g as ke,h as xe}from"./store_product.9ae93a40.js";import"./lodash.4e6d2a38.js";import{f as Se}from"./index.d12b3af4.js";import{_ as Ae}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.1fad8124.js";import{_ as Pe}from"./copy.vue_vue_type_script_setup_true_name_storeProductEdit_lang.6e806ea2.js";import{a as Ue}from"./store_category.b8c1e5ac.js";import{u as $e}from"./vue-router.10bd5b90.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.e03c2e5b.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";import"./axios.cffda5ac.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./pinia.f3529286.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.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./system_store.de1a4364.js";import"./warehouse_product_storege.03d18b57.js";import"./index.vue_vue_type_script_setup_true_name_systemStoreLists_lang.85ada49c.js";const ze={class:"mt-4"},Le={style:{color:"red"}},Re={style:{color:"red"}},Ie={style:{color:"red"}},qe={class:"mr-1"},Ke={class:"ml-1"},Ne={class:"flex mt-4 justify-end"},Te=N({name:"storeProductLists"}),Io=N({...Te,setup(Me){const U=$e(),F=Ce(),B=E(null),V=E(!1),s=ve({store_name:"",class_all:"",is_show:"",id:"",bar_code:"",product_type:""}),D=E([]),T=u=>{D.value=u.map(({id:e})=>e)};De("");let $=1;U.query.page_no&&($=parseInt(U.query.page_no));const{pager:f,getLists:h,resetParams:M,resetPage:C}=Ve({page:$,fetchFun:K,params:s}),j=async u=>{var e,r;(e=B.value)==null||e.open(),(r=B.value)==null||r.setFormData(u)},O=async u=>{var e,r;V.value=!0,await Be(),(e=F.value)==null||e.open("edit"),(r=F.value)==null||r.setFormData(u)};let k,x;const S=E(!1);let A;const J=u=>(A=u,S.value=!0,z.lazyLoad(x,k),!1),z={value:"id",label:"name",emitPath:!1,lazy:!0,lazyLoad(u,e){k||(k=e),x||(x=u);const r=u.value||0;let p={};S.value?(p={name:A},A||(p={pid:r,page_size:1e4})):p={pid:r,page_size:1e4},Ue({...p}).then(P=>{e(P.lists.map(m=>(m.leaf=!0,S.value=!1,m)))})}},Q=u=>{ke({id:u.id,is_show:u.is_show})},L=async u=>{await Se.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await xe({id:u}),h()};return be(()=>{h()}),(u,e)=>{const r=te,p=le,P=oe,m=ae,R=ue,_=se,Z=fe,G=ne,I=re,q=ge("router-link"),n=pe,H=ie,W=de,X=me,Y=ce,y=ye("perms"),ee=_e;return c(),we("div",null,[o(I,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[o(G,{class:"mb-[-16px]",model:l(s),inline:""},{default:a(()=>[o(p,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:a(()=>[o(r,{class:"w-[280px]",onKeydown:he(l(C),["enter"]),modelValue:l(s).store_name,"onUpdate:modelValue":e[0]||(e[0]=t=>l(s).store_name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["onKeydown","modelValue"])]),_:1}),o(p,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:a(()=>[o(r,{class:"w-[280px]",modelValue:l(s).bar_code,"onUpdate:modelValue":e[1]||(e[1]=t=>l(s).bar_code=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801",onChange:l(C)},null,8,["modelValue","onChange"])]),_:1}),o(p,{label:"\u5546\u54C1ID",prop:"id"},{default:a(()=>[o(r,{class:"w-[280px]",modelValue:l(s).id,"onUpdate:modelValue":e[2]||(e[2]=t=>l(s).id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1ID",onChange:l(C)},null,8,["modelValue","onChange"])]),_:1}),o(p,{label:"\u5546\u54C1\u5206\u7C7B",prop:"store_name"},{default:a(()=>[o(P,{class:"w-[280px]",modelValue:l(s).class_all,"onUpdate:modelValue":e[3]||(e[3]=t=>l(s).class_all=t),filterable:"",clearable:"","before-filter":J,props:z,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",onChange:l(C)},null,8,["modelValue","onChange"])]),_:1}),o(p,{label:"\u5546\u54C1\u7C7B\u578B",prop:"product_type"},{default:a(()=>[o(R,{modelValue:l(s).product_type,"onUpdate:modelValue":e[4]||(e[4]=t=>l(s).product_type=t),placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u7C7B\u578B",style:{width:"240px"},onChange:l(C)},{default:a(()=>[o(m,{label:"\u666E\u901A\u5546\u54C1",value:"0"}),o(m,{label:"\u5151\u6362\u4EA7\u54C1",value:"2"}),o(m,{label:"\u6D3B\u52A8\u5546\u54C1",value:"4"}),o(m,{label:"\u6279\u53D1\u4EA7\u54C1",value:"5"})]),_:1},8,["modelValue","onChange"])]),_:1}),o(p,{label:"\u663E\u793A",prop:"is_show"},{default:a(()=>[o(R,{modelValue:l(s).is_show,"onUpdate:modelValue":e[5]||(e[5]=t=>l(s).is_show=t),placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u663E\u793A",style:{width:"240px"},onChange:l(C)},{default:a(()=>[o(m,{label:"\u663E\u793A",value:"1"}),o(m,{label:"\u4E0D\u663E\u793A",value:"0"})]),_:1},8,["modelValue","onChange"])]),_:1}),o(p,null,{default:a(()=>[o(_,{type:"primary",onClick:l(C)},{default:a(()=>e[9]||(e[9]=[i("\u67E5\u8BE2")])),_:1},8,["onClick"]),o(_,{onClick:l(M)},{default:a(()=>e[10]||(e[10]=[i("\u91CD\u7F6E")])),_:1},8,["onClick"]),o(Z,{class:"ml-2.5","fetch-fun":l(K),params:l(s),"page-size":l(f).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),b((c(),v(I,{class:"!border-none",shadow:"never"},{default:a(()=>[b((c(),v(q,{to:{path:"store_product_edit",query:{id:0,mode:"add"}},class:"mr-4"},{default:a(()=>[o(_,{type:"primary",icon:"Plus"},{default:a(()=>e[11]||(e[11]=[i(" \u65B0\u589E ")])),_:1})]),_:1})),[[y,["store_product.store_product/add"]]]),b((c(),v(_,{disabled:!l(D).length,onClick:e[6]||(e[6]=t=>L(l(D)))},{default:a(()=>e[12]||(e[12]=[i(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[y,["store_product.store_product/delete"]]]),d("div",ze,[o(X,{data:l(f).lists,onSelectionChange:T},{default:a(()=>[o(n,{type:"selection",width:"55"}),o(n,{label:"ID",prop:"id","show-overflow-tooltip":""}),o(n,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:a(({row:t})=>[o(H,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""},{default:a(({row:t})=>[d("div",null,g(t.store_name),1),d("div",null,[e[13]||(e[13]=i(" \u4F9B\u8D27\u4EF7:")),d("span",Le,g(t.purchase),1)]),d("div",null,[e[14]||(e[14]=i(" \u5546\u6237\u4EF7: ")),d("span",Re,g(t.cost),1)]),d("div",null,[e[15]||(e[15]=i(" \u96F6\u552E\u4EF7:")),d("span",Ie,g(t.price),1)])]),_:1}),o(n,{label:"\u5206\u7C7B",prop:"cate_name","show-overflow-tooltip":""}),o(n,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),o(n,{label:"\u5546\u54C1\u7C7B\u578B",prop:"product_type_name","show-overflow-tooltip":""}),o(n,{label:"\u8D77\u6279\u91CF",prop:"batch","show-overflow-tooltip":""}),o(n,{label:"\u6BDB\u5229\u7387",prop:"rose","show-overflow-tooltip":""}),o(n,{label:"\u5E93\u5B58/\u9500\u91CF",prop:"stock","show-overflow-tooltip":""},{default:a(({row:t})=>[d("span",qe,g(t.stock),1),e[16]||(e[16]=i("/")),d("span",Ke,g(t.sales),1)]),_:1}),o(n,{label:"\u72B6\u6001",prop:"is_show"},{default:a(({row:t})=>[o(W,{size:"large",onChange:w=>Q(t),modelValue:t.is_show,"onUpdate:modelValue":w=>t.is_show=w,"active-value":1,"inactive-value":0,"active-text":"\u4E0A\u67B6","inactive-text":"\u4E0B\u67B6","inline-prompt":""},null,8,["onChange","modelValue","onUpdate:modelValue"])]),_:1}),o(n,{label:"\u6761\u7801",prop:"bar_code","show-overflow-tooltip":""}),o(n,{label:"\u64CD\u4F5C",width:"180",fixed:"right"},{default:a(({row:t})=>[b((c(),v(q,{to:{path:"store_product_edit",query:{id:t.id,mode:"edit",page:l(f).page}},class:"mr-4"},{default:a(()=>[o(_,{type:"primary",link:""},{default:a(()=>e[17]||(e[17]=[i(" \u7F16\u8F91 ")])),_:1})]),_:2},1032,["to"])),[[y,["store_product.store_product/edit"]]]),b((c(),v(_,{type:"primary",link:"",onClick:w=>j(t)},{default:a(()=>e[18]||(e[18]=[i(" \u8BE6\u60C5 ")])),_:2},1032,["onClick"])),[[y,["store_product.store_product/edit"]]]),o(_,{type:"primary",link:"",onClick:w=>O(t)},{default:a(()=>e[19]||(e[19]=[i(" \u590D\u5236 ")])),_:2},1032,["onClick"]),b((c(),v(_,{type:"danger",link:"",onClick:w=>L(t.id)},{default:a(()=>e[20]||(e[20]=[i(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[y,["store_product.store_product/delete"]]])]),_:1})]),_:1},8,["data"])]),d("div",Ne,[o(Y,{modelValue:l(f),"onUpdate:modelValue":e[7]||(e[7]=t=>Ee(f)?f.value=t:null),onChange:l(h)},null,8,["modelValue","onChange"])])]),_:1})),[[ee,l(f).loading]]),o(Ae,{ref_key:"detailsRef",ref:B},null,512),l(V)?(c(),v(Pe,{key:0,ref_key:"copyRef",ref:F,onSuccess:l(h),onClose:e[8]||(e[8]=t=>V.value=!1)},null,8,["onSuccess"])):Fe("",!0)])}}});export{Io as default};