import{a6 as ne,C as re,D as ie,w as ue,F as pe,L as ce,c as me,a as _e,M as de,b as fe,N as he,O as Ce}from"./element-plus.4a7d92a3.js";import{_ as ye}from"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import{_ as ge}from"./index.d12367fc.js";import{_ as ve}from"./index.vue_vue_type_script_setup_true_lang.7d2de4e0.js";import{d as I,r as d,Z as N,i as we,af as be,o as y,c as g,U as e,L as a,u as l,aa as ke,R as f,a as p,T as xe,a9 as De,a0 as Fe,S as c,M as Ee,K as Be,j as Re,n as V}from"./@vue.18505fe0.js";import{u as Le}from"./usePaging.6a6670f9.js";import{u as Ve}from"./useDictOptions.359e8a2b.js";import{a as Ae}from"./store_product.c39d9d12.js";import{t as Pe,w as $e}from"./workbench.8c65fbf0.js";import{_ as Se}from"./details.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.5bf14522.js";import{_ as ze}from"./stockDetails.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.66bb6882.js";import{_ as Ne}from"./warehouseProduct.vue_vue_type_script_setup_true_name_storeProductDETAILS_lang.f24fe6d7.js";import{a as Ie}from"./store_category.4e7efb7f.js";import{u as Te}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"./index.ea66144a.js";import"./lodash.9dc701ad.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.912c44f1.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";import"./store_order.f650cad2.js";const Ue={class:"flex flex-wrap"},We={class:"mr-2"},je={class:"text-info"},Ke={key:0},Oe={class:"text-2xl mr-2"},qe={class:"text-2xl mr-2"},Me={key:1},Ze={class:"text-6xl mr-2"},Ge={class:"mt-4"},He={class:"flex mt-4 justify-end"},Je=I({name:"storeProductLists"}),Kt=I({...Je,setup(Qe){const T=d(!1),U=d(!1),W=d(!1),A=Te(),v=d(null),w=d(null),b=d(null),m=N({store_name:"",class_all:"",bar_code:""}),j=async s=>{var o,r;T.value=!0,await V(),(o=v.value)==null||o.open(),(r=v.value)==null||r.getDetail(s)},P=async(s,o=1)=>{var r,n;U.value=!0,await V(),(r=w.value)==null||r.open(),(n=w.value)==null||n.getDetail(s,o)},k=async(s,o=1)=>{var r,n;W.value=!0,await V(),(r=b.value)==null||r.open(),(n=b.value)==null||n.getDetail(s,o)},K=d([]),O=s=>{K.value=s.map(({id:o})=>o)};Ve("");let $=1;A.query.page_no&&($=parseInt(A.query.page_no));const{pager:h,getLists:S,resetParams:q,resetPage:x}=Le({page:$,fetchFun:$e,params:m});let D,F;const E=d(!1);let B;const M=s=>(B=s,E.value=!0,z.lazyLoad(F,D),!1),z={value:"id",label:"name",emitPath:!1,lazy:!0,lazyLoad(s,o){D||(D=o),F||(F=s);const r=s.value||0;let n={};E.value?(n={name:B},B||(n={pid:r,page_size:1e4})):n={pid:r,page_size:1e4},Ie({...n}).then(R=>{o(R.lists.map(i=>(i.leaf=!0,E.value=!1,i)))})}},Z=["#5DB1FF","#4CD384","#FFC46A","#CAA5F1","#FFC46A","#4CD384","#5DB1FF","#CAA5F1"],G=d(["RectangleCopy58","RectangleCopy48","RectangleCopy65","RectangleCopy62","RectangleCopy56","RectangleCopy55","RectangleCopy57","RectangleCopy65","RectangleCopy61","RectangleCopy52","RectangleCopy14","RectangleCopy32"]),C=N({xAxis:{type:"category",data:[0],axisLabel:{rotate:45,color:"#333"}},yAxis:{type:"value",name:"\u91D1\u989D",position:"left",axisLabel:{formatter:"{value}"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},legend:{data:["\u8BBF\u95EE\u91CF"]},itemStyle:{color:"red"},tooltip:{trigger:"axis"},series:[{name:"\u8BBF\u95EE\u91CF",data:[0],type:"line",smooth:!0}]}),H=()=>{Pe({}).then(s=>{C.xAxis.data=[],C.series=[],console.log(s),C.legend.data=Object.values(s.series).map(o=>o.name),C.xAxis.data=s.x,C.series=Object.values(s.series).map(o=>({type:"line",smooth:!0,data:o.value,name:o.name,total_value:o.total_value,rate:o.rate,desc:o.desc,total_money:o.total_money}))})};return we(()=>{S(),H()}),(s,o)=>{const r=re,n=ie,R=ne,i=ue,J=ve,Q=pe,L=ce,X=ge,Y=be("Warning"),ee=me,te=_e,u=de,oe=fe,ae=he,le=ye,se=Ce;return y(),g("div",null,[e(L,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(Q,{class:"mb-[-16px]",model:l(m),inline:""},{default:a(()=>[e(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:a(()=>[e(r,{class:"w-[280px]",onKeydown:ke(l(x),["enter"]),modelValue:l(m).store_name,"onUpdate:modelValue":o[0]||(o[0]=t=>l(m).store_name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["onKeydown","modelValue"])]),_:1}),e(n,{label:"\u5546\u54C1\u6761\u7801",prop:"bar_code"},{default:a(()=>[e(r,{class:"w-[280px]",modelValue:l(m).bar_code,"onUpdate:modelValue":o[1]||(o[1]=t=>l(m).bar_code=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801"},null,8,["modelValue"])]),_:1}),e(n,{label:"\u5546\u54C1\u5206\u7C7B",prop:"store_name"},{default:a(()=>[e(R,{class:"w-[280px]",modelValue:l(m).class_all,"onUpdate:modelValue":o[2]||(o[2]=t=>l(m).class_all=t),filterable:"",clearable:"","before-filter":M,props:z,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B",onChange:l(x)},null,8,["modelValue","onChange"])]),_:1}),e(n,null,{default:a(()=>[e(i,{type:"primary",onClick:l(x)},{default:a(()=>[f("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(i,{onClick:l(q)},{default:a(()=>[f("\u91CD\u7F6E")]),_:1},8,["onClick"]),e(J,{class:"ml-2.5","fetch-fun":l(Ae),params:l(m),"page-size":l(h).size},null,8,["fetch-fun","params","page-size"])]),_:1})]),_:1},8,["model"])]),_:1}),e(L,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[p("div",Ue,[(y(!0),g(xe,null,De(l(C).series,(t,_)=>(y(),g("div",{class:"w-1/5 flex mb-6",key:_},[p("div",We,[p("div",{class:"rounded-full p-2",style:Fe({"background-color":Z[_%4]})},[e(X,{iconName:l(G)[_],white:"",className:"text-6xl"},null,8,["iconName"])],4)]),p("div",null,[p("div",je,[f(c(t.name)+" ",1),e(te,{class:"box-item",effect:"dark",content:t.desc,placement:"top-start"},{default:a(()=>[e(ee,null,{default:a(()=>[e(Y)]),_:1})]),_:2},1032,["content"])]),t.total_money!=""?(y(),g("div",Ke,[p("span",Oe,"\u5E93\u5B58:"+c(t.total_value),1),p("span",qe,"\u91D1\u989D:"+c(t.total_money),1)])):(y(),g("div",Me,[p("span",Ze,c(t.total_value),1)]))])]))),128))])]),_:1}),Ee((y(),Be(L,{class:"!border-none",shadow:"never"},{default:a(()=>[p("div",Ge,[e(ae,{data:l(h).lists,onSelectionChange:O},{default:a(()=>[e(u,{type:"selection",width:"55"}),e(u,{label:"\u5546\u54C1ID",prop:"id","show-overflow-tooltip":""}),e(u,{label:"\u5546\u54C1\u56FE\u7247",prop:"image","min-width":"80"},{default:a(({row:t})=>[e(oe,{style:{width:"50px",height:"50px"},src:t.image,"preview-teleported":!0},null,8,["src"])]),_:1}),e(u,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","min-width":"200","show-overflow-tooltip":""}),e(u,{label:"\u9500\u91CF",prop:"sales","min-width":"100","show-overflow-tooltip":""},{default:a(({row:t})=>[e(i,{type:"primary",link:"",onClick:_=>j(t)},{default:a(()=>[f(c(t.sales||0),1)]),_:2},1032,["onClick"])]),_:1}),e(u,{label:"\u95E8\u5E97\u5E93\u5B58",prop:"store_stock","min-width":"100","show-overflow-tooltip":""},{default:a(({row:t})=>[e(i,{type:"primary",link:"",onClick:_=>P(t,1)},{default:a(()=>[f(c(t.store_stock||0),1)]),_:2},1032,["onClick"])]),_:1}),e(u,{label:"\u4ED3\u5E93\u5E93\u5B58",prop:"warehouse_stock","min-width":"100","show-overflow-tooltip":""},{default:a(({row:t})=>[e(i,{type:"primary",link:"",onClick:_=>P(t,0)},{default:a(()=>[f(c(t.warehouse_stock||0),1)]),_:2},1032,["onClick"])]),_:1}),e(u,{label:"\u603B\u5E93\u5B58",prop:"total_stock","min-width":"100","show-overflow-tooltip":""}),e(u,{label:"\u91C7\u8D2D\u603B\u4EF7",prop:"total_purchase","min-width":"100","show-overflow-tooltip":""},{default:a(({row:t})=>[e(i,{type:"primary",link:"",onClick:_=>k(t,1)},{default:a(()=>[f(c(t.total_purchase||0),1)]),_:2},1032,["onClick"])]),_:1}),e(u,{label:"\u5DF2\u7ED3",prop:"total_completed_amount","min-width":"100","show-overflow-tooltip":""},{default:a(({row:t})=>[e(i,{type:"primary",link:"",onClick:_=>k(t,2)},{default:a(()=>[f(c(t.total_completed_amount||0),1)]),_:2},1032,["onClick"])]),_:1}),e(u,{label:"\u672A\u7ED3",prop:"total_outstanding_amount","min-width":"100","show-overflow-tooltip":""},{default:a(({row:t})=>[e(i,{type:"primary",link:"",onClick:_=>k(t,3)},{default:a(()=>[f(c(t.total_outstanding_amount||0),1)]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),p("div",He,[e(le,{modelValue:l(h),"onUpdate:modelValue":o[3]||(o[3]=t=>Re(h)?h.value=t:null),onChange:l(S)},null,8,["modelValue","onChange"])])]),_:1})),[[se,l(h).loading]]),e(Se,{ref_key:"detailsRef",ref:v},null,512),e(ze,{ref_key:"stockDetailsRef",ref:w},null,512),e(Ne,{ref_key:"warehouseProductRef",ref:b},null,512)])}}});export{Kt as default};