PageSourceSearch

https://magyarmenedek.com/build/assets/Shelves-B9bhlT-R.js

js magyarmenedek.com collected 2026-09-24 21:27:15 UTC 14,066 bytes, 1 lines download raw bytes

1import{r as f,y as Z,j as N,k as ee,d as e,o as i,c as n,m as p,F as w,q as x,n as v,t as o,b as c,f as y,v as T,A as j,p as m,H as te,T as se,w as le,B as W,s as B}from"./app-7QF_nJu6.js";import{u as oe}from"./useUresForm-DGjXXXtZ.js";import{_ as ae}from"./AdminLayout-D4CY-9Wh.js";import{u as ie}from"./useMoney-CHFQ2CcG.js";import{u as ne}from"./useScreen-DzaXmgwc.js";const de={class:"page-header"},re={style:{display:"flex",gap:"10px","align-items":"center"},class:"page-header-actions"},ue={class:"sh-wh-row",id:"shWhRow"},ce=["onClick"],ve={class:"sh-wh-name"},he={class:"sh-wh-val"},pe={class:"cat-toolbar sh-filter-bar"},me={class:"cat-search"},fe={class:"card sh-list-card"},ye={class:"table-scroll"},be={class:"data-table sh-table"},ke={class:"sort-ind"},ge={class:"sort-ind"},_e={id:"shListBody"},we=["onClick"],xe={class:"sh-code"},Ce={class:"sh-wh-badge"},ze={key:0,class:"sh-content-cell empty"},Be={key:1,class:"sh-content-cell"},Se={key:0,class:"sh-more"},Me={class:"sh-usage"},Ee={class:"sh-bar"},Pe={class:"sh-usage-txt"},Te={class:"col-status"},je={key:0},De={class:"pagination"},$e={class:"page-info",id:"shPageInfo"},Ae={class:"page-controls",id:"shPageControls"},Ve=["disabled"],Ue=["onClick"],Ne=["disabled"],We={class:"page-size"},He={class:"modal-head"},qe={class:"modal-title",id:"shDetTitle"},Fe={class:"modal-sub",id:"shDetSub"},Le={class:"modal-body"},Re={class:"sh-det-meta",id:"shDetMeta"},Ie={class:"sh-det-stat"},Oe={class:"sh-det-stat-num"},Ke={class:"sh-det-stat"},Je={class:"sh-det-stat-num"},Ge={class:"sh-det-stat"},Qe={class:"sh-det-stat-num"},Xe={class:"sh-det-list",id:"shDetList"},Ye={class:"sh-det-info"},Ze={class:"sh-det-name"},et={class:"sh-det-author"},tt={class:"sh-det-qty"},st={key:0,class:"sh-det-empty"},lt={class:"modal-foot"},ot={class:"modal-foot-hint",id:"shDetHint"},at={class:"modal-foot-actions"},it={class:"modal-head"},nt={class:"modal-title",id:"shEditTitle"},dt={class:"modal-body"},rt={class:"form-field"},ut={key:0,class:"sh-err"},ct={class:"form-field"},vt=["value"],ht={key:0,class:"sh-err"},pt={class:"form-field"},mt={key:0,class:"sh-err"},ft={class:"modal-foot"},yt={class:"modal-foot-hint"},bt={class:"modal-foot-actions"},kt=["disabled"],zt={__name:"Shelves",props:{shelves:{type:Object,required:!0},warehouses:{type:Array,default:()=>[]},editWarehouses:{type:Array,default:()=>[]},filters:{type:Object,required:!0},canEdit:{type:Boolean,default:!1},defaultCapacity:{type:Number,default:60}},setup(r){const{screenClass:H}=ne(),d=r,{num:S}=ie(),q={empty:"Üres",partial:"Részben telt",full:"Megtelt"},C=f(d.filters.search??""),M=f(d.filters.status??"all"),E=f(d.filters.per_page??10);function b(l={}){const t={wh:d.filters.wh,search:C.value.trim(),status:M.value,sort:d.filters.sort,dir:d.filters.dir,per_page:E.value,...l};t.wh||delete t.wh,t.search||delete t.search,t.status==="all"&&delete t.status,t.sort==="code"&&delete t.sort,t.dir==="asc"&&delete t.dir,Number(t.per_page)===10&&delete t.per_page,(!t.page||t.page<=1)&&delete t.page,W.get(route("admin.stock.shelves.index"),t,{preserveState:!0,preserveScroll:!0,replace:!0})}let D=null;Z(C,()=>{clearTimeout(D),D=setTimeout(()=>b({page:1}),350)});function F(l){b({wh:l,page:1})}function $(){b({page:1})}function P(l){b({page:l})}function A(l){const t=d.filters.sort===l&&d.filters.dir==="asc"?"desc":"asc";b({sort:l,dir:t,page:1})}function V(l){return d.filters.sort===l?d.filters.dir==="asc"?"↑":"↓":"↑"}const L=B(()=>{const l=d.shelves.last_page;let t=Math.max(1,d.shelves.current_page-2);const s=Math.min(l,t+4);return t=Math.max(1,Math.min(t,s-4)),Array.from({length:s-t+1},(_,Y)=>t+Y)}),R=B(()=>{const l=d.shelves.total;return l?`${S(d.shelves.data.length)} / ${S(l)} polc mutatva`:"0 polc"}),u=f(null);function I(l){u.value=l,document.body.style.overflow="hidden"}function z(){u.value=null,document.body.style.overflow=""}const k=f(!1),h=f(null),a=oe({warehouse_id:null,code:"",capacity:d.defaultCapacity});function O(){d.canEdit&&(h.value=null,a.reset(),a.clearErrors(),a.warehouse_id=d.filters.wh||d.editWarehouses[0]?.id||null,a.capacity=d.defaultCapacity,k.value=!0,document.body.style.overflow="hidden")}function K(l){d.canEdit&&(h.value=l,a.clearErrors(),a.warehouse_id=l.whId,a.code=l.code,a.capacity=l.cap,k.value=!0,document.body.style.overflow="hidden")}function J(){const l=u.value;z(),K(l)}function g(){k.value=!1,document.body.style.overflow=""}function U(){const l={preserveScroll:!0,onSuccess:()=>g()};h.value?a.patch(route("admin.stock.shelves.update",h.value.id),l):a.post(route("admin.stock.shelves.store"),l)}function G(){h.value&&W.delete(route("admin.stock.shelves.destroy",h.value.id),{preserveScroll:!0,onSuccess:()=>g()})}const Q=B(()=>h.value?`Polc szerkesztése — ${h.value.code}`:"Új polc"),X=B(()=>u.value?`Polc — ${u.value.code}`:"Polc");return(l,t)=>(i(),N(ae,{breadcrumb:"Polcrendszer"},{default:ee(()=>[e("div",de,[t[11]||(t[11]=e("div",null,[e("h1",null,"Polcrendszer"),e("div",{class:"sub"},"Fizikai tárolóhelyek — polckód, raktár, kihasználtság és a rajtuk lévő termékek")],-1)),e("div",re,[r.canEdit?(i(),n("button",{key:0,class:"btn-primary",type:"button",onClick:O},[...t[10]||(t[10]=[e("svg",{viewBox:"0 0 24 24"},[e("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1),e("span",{class:"btn-label"},"Új polc",-1)])])):p("",!0)])]),e("div",ue,[(i(!0),n(w,null,x(r.warehouses,s=>(i(),n("button",{key:s.id,class:v(["sh-wh",{active:(r.filters.wh||0)===s.id}]),type:"button",onClick:_=>F(s.id)},[e("span",ve,o(s.name),1),e("span",he,o(c(S)(s.count))+" polc · "+o(s.pct)+"% telt",1)],10,ce))),128))]),e("div",pe,[e("div",me,[t[12]||(t[12]=e("svg",{class:"search-icon",viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("circle",{cx:"11",cy:"11",r:"8"}),e("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),y(e("input",{type:"text",id:"shSearch",placeholder:"Polckód vagy termék keresése...","onUpdate:modelValue":t[0]||(t[0]=s=>C.value=s)},null,512),[[T,C.value]])]),y(e("select",{class:"filter-select",id:"shStatus","onUpdate:modelValue":t[1]||(t[1]=s=>M.value=s),onChange:$},[...t[13]||(t[13]=[e("option",{value:"all"},"Minden állapot",-1),e("option",{value:"empty"},"Üres polcok",-1),e("option",{value:"partial"},"Részben telt",-1),e("option",{value:"full"},"Megtelt",-1)])],544),[[j,M.value]])]),e("div",fe,[e("div",ye,[e("table",be,[e("thead",null,[e("tr",null,[e("th",{class:v(["sortable",{sorted:r.filters.sort==="code"}]),onClick:t[2]||(t[2]=s=>A("code"))}
1,[t[14]||(t[14]=m("Polckód ",-1)),e("span",ke,o(V("code")),1)],2),t[16]||(t[16]=e("th",null,"Raktár",-1)),t[17]||(t[17]=e("th",null,"Tartalom",-1)),e("th",{class:v(["sortable",{sorted:r.filters.sort==="usage"}]),onClick:t[3]||(t[3]=s=>A("usage"))},[t[15]||(t[15]=m("Kihasználtság ",-1)),e("span",ge,o(V("usage")),1)],2),t[18]||(t[18]=e("th",{class:"col-status"},"Állapot",-1))])]),e("tbody",_e,[(i(!0),n(w,null,x(r.shelves.data,s=>(i(),n("tr",{key:s.id,onClick:_=>I(s)},[e("td",null,[e("span",xe,[t[19]||(t[19]=e("svg",{viewBox:"0 0 24 24",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),e("line",{x1:"3",y1:"15",x2:"21",y2:"15"})],-1)),m(o(s.code),1)])]),e("td",null,[e("span",Ce,o(s.wh),1)]),e("td",null,[s.items.length?(i(),n("span",Be,[m(o(s.items[0].n),1),s.items.length>1?(i(),n("span",Se," +"+o(s.items.length-1)+" további",1)):p("",!0)])):(i(),n("span",ze,"Üres polc"))]),e("td",null,[e("div",Me,[e("div",Ee,[e("div",{class:v(["sh-bar-fill",s.bar]),style:te({width:Math.min(s.pct,100)+"%"})},null,6)]),e("span",Pe,o(s.used)+"/"+o(s.cap),1)])]),e("td",Te,[e("span",{class:v(["sh-badge",s.status])},[t[20]||(t[20]=e("span",{class:"sh-dot"},null,-1)),m(o(q[s.status]),1)],2)])],8,we))),128)),r.shelves.data.length?p("",!0):(i(),n("tr",je,[...t[21]||(t[21]=[e("td",{colspan:"5",style:{"text-align":"center",padding:"30px",color:"var(--text-body)","font-weight":"600"}},"Nincs polc a szűrésnek megfelelően.",-1)])]))])])]),e("div",De,[e("div",$e,o(R.value),1),e("div",Ae,[e("button",{class:"page-btn",disabled:r.shelves.current_page<=1,onClick:t[4]||(t[4]=s=>P(r.shelves.current_page-1))},[...t[22]||(t[22]=[e("svg",{viewBox:"0 0 24 24","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"15 18 9 12 15 6"})],-1)])],8,Ve),(i(!0),n(w,null,x(L.value,s=>(i(),n("button",{key:s,class:v(["page-btn",{active:s===r.shelves.current_page}]),onClick:_=>P(s)},o(s),11,Ue))),128)),e("button",{class:"page-btn",disabled:r.shelves.current_page>=r.shelves.last_page,onClick:t[5]||(t[5]=s=>P(r.shelves.current_page+1))},[...t[23]||(t[23]=[e("svg",{viewBox:"0 0 24 24","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"9 18 15 12 9 6"})],-1)])],8,Ne)]),e("div",We,[t[25]||(t[25]=e("span",null,"Oldalanként:",-1)),y(e("select",{class:"filter-select",id:"shPageSize","onUpdate:modelValue":t[6]||(t[6]=s=>E.value=s),onChange:$},[...t[24]||(t[24]=[e("option",{value:10},"10",-1),e("option",{value:25},"25",-1),e("option",{value:50},"50",-1),e("option",{value:100},"100",-1)])],544),[[j,E.value]])])])]),(i(),N(se,{to:"body"},[e("div",{class:v(c(H)),style:{display:"contents"}},[e("div",{class:v(["modal-backdrop",{visible:!!u.value}]),id:"shDetBackdrop",onClick:z},null,2),e("div",{class:v(["modal",{visible:!!u.value}]),id:"shDetModal",role:"dialog","aria-modal":"true","aria-labelledby":"shDetTitle"},[e("div",He,[e("div",null,[e("div",qe,o(X.value),1),e("div",Fe,o(u.value?u.value.wh+" raktár":""),1)]),e("button",{class:"modal-x",type:"button","aria-label":"Bezárás",onClick:z},[...t[26]||(t[26]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e("div",Le,[e("div",Re,[e("div",Ie,[e("div",Oe,o(u.value?.used??0)+" db",1),t[27]||(t[27]=e("div",{class:"sh-det-stat-lbl"},"Jelenleg",-1))]),e("div",Ke,[e("div",Je,o(Math.max(0,(u.value?.cap??0)-(u.value?.used??0)))+" db",1),t[28]||(t[28]=e("div",{class:"sh-det-stat-lbl"},"Szabad hely",-1))]),e("div",Ge,[e("div",Qe,o(u.value?.pct??0)+"%",1),t[29]||(t[29]=e("div",{class:"sh-det-stat-lbl"},"Kihasználtság",-1))])]),t[31]||(t[31]=e("div",{class:"sh-det-lbl"},"Polcon lévő termékek",-1)),e("div",Xe,[(i(!0),n(w,null,x(u.value?.items??[],(s,_)=>(i(),n("div",{key:_,class:"sh-det-item"},[t[30]||(t[30]=e("span",{class:"sh-det-cover"},[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),e("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"})])],-1)),e("div",Ye,[e("div",Ze,o(s.n),1),e("div",et,o(s.a),1)]),e("span",tt,o(s.q)+" db",1)]))),128)),(u.value?.items??[]).length?p("",!0):(i(),n("div",st,"Ez a polc jelenleg üres."))])]),e("div",lt,[e("span",ot,o((u.value?.items??[]).length)+" különböző termék",1),e("div",at,[r.canEdit?(i(),n("button",{key:0,class:"btn-outline",type:"button",onClick:J},"Szerkesztés")):p("",!0),e("button",{class:"btn-primary",type:"button",onClick:z},"Bezárás")])])],2),e("div",{class:v(["modal-backdrop",{visible:k.value}]),id:"shEditBackdrop",onClick:g},null,2),e("div",{class:v(["modal modal-sm",{visible:k.value}]),id:"shEditModal",role:"dialog","aria-modal":"true","aria-labelledby":"shEditTitle"},[e("div",it,[e("div",null,[e("div",nt,o(Q.value),1),t[32]||(t[32]=e("div",{class:"modal-sub"},"Polc alapadatai — kód, raktár és kapacitás.",-1))]),e("button",{class:"modal-x",type:"button","aria-label":"Bezárás",onClick:g},[...t[33]||(t[33]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e("div",dt,[e("form",{class:"sh-form",onSubmit:le(U,["prevent"])},[e("div",rt,[t[34]||(t[34]=e("label",{class:"form-label",for:"shCode"},[m("Polckód "),e("span",{class:"lbl-hint"},"(pl. A-01-03)")],-1)),y(e("input",{type:"text",class:"form-input",id:"shCode",placeholder:"A-01-03",autocomplete:"off","onUpdate:modelValue":t[7]||(t[7]=s=>c(a).code=s)},null,512),[[T,c(a).code]]),c(a).errors.code?(i(),n("span",ut,o(c(a).errors.code),1)):p("",!0)]),e("div",ct,[t[35]||(t[35]=e("label",{class:"form-label",for:"shWhSel"},"Raktár",-1)),y(e("select",{class:"form-input",id:"shWhSel","onUpdate:modelValue":t[8]||(t[8]=s=>c(a).warehouse_id=s)},[(i(!0),n(w,null,x(r.editWarehouses,s=>(i(),n("option",{key:s.id,value:s.id},o(s.name),9,vt))),128))],512),[[j,c(a).warehouse_id]]),c(a).errors.warehouse_id?(i(),n("span",ht,o(c(a).errors.warehouse_id),1)):p("",!0)]),e("div",pt,[t[36]||(t[36]=e("label",{class:"form-label",for:"shCap"},[m("Kapacitás "),e("span",{class:"lbl-hint"},"(hány db fér el)")],-1)),y(e("input",{type:"number",class:"form-input no-spin",id:"shCap",min:"1",style:{"max-width":"140px"},"onUpdate:modelValue":t[9]||(t[9]=s=>c(a).capacity=s)},null,512),[[T,c(a).capacity,void 0,{number:!0}]]),c(a).errors.capacity?(i(),n("span",mt,o(c(a).errors.capacity),1)):p("",!0)])],32)]),e("div",ft,[e("span",yt,[h.value?(i(),n("button",{key:0,class:"sh-del",type:"button",title:"Polc törlése","aria-label":"Polc törlése",onClick:G},[...t[37]||(t[37]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("polyline",{points:"3 6 5 6 21 6"}),e("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])])):p("",!0)]),e("div",bt,[e("button",{class:"btn-outline",type:"button",onClick:g},"Mégse"),e("button",{class:"btn-primary",id:"shSaveBtn",type:"button",disabled:c(a).processing,onClick:U}
1,"Mentés",8,kt)])])],2)],2)]))]),_:1}))}};export{zt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.