PageSourceSearch

https://sistema.yacamba.com/assets/NewEntry-9nGWe9NN.js

js yacamba.com collected 2026-09-24 11:06:53 UTC 7,338 bytes, 1 lines download raw bytes

1import{jc as A,hH as a,gT as e,b6 as w,e7 as H,b1 as L,iU as R,iZ as q,eb as _}from"./index-DfEzlclk.js";import{S as g}from"./SelectDrawerMulti-C7Lbn7AB.js";import{getCatalogById as $}from"./utils-B34yWrRQ.js";import"./drawer-Ch_49rYl.js";function G({tableData:i,setTableData:f,productId:j,setProductId:p,setShow:r,locations:v}){const{t:n}=A(),s=i.find(l=>l.idAux===j),[u,N]=a.useState(s==null?void 0:s.ubication),[c,x]=a.useState((s==null?void 0:s.receivedQuantity)||0);if(!s)return null;const y=a.useCallback(l=>{x(l)},[]),d=a.useCallback(l=>{N(l)},[]),h=a.useCallback(()=>{f(l=>l.map(m=>m.idAux===s.idAux?{...m,receivedQuantity:c,ubication:u}:m)),r(!1)},[c,u,f,s,r]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"z-60 fixed top-0 flex w-full flex-col p-4 pt-[calc(1rem+var(--sat,0px))]",children:e.jsxs("div",{className:"flex items-center justify-start gap-3 pt-5",onClick:()=>{r(!1)},children:[e.jsx(w,{icon:H,className:"size-7 text-grisHeading"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-poppins text-[16px] font-semibold text-grisHeading",children:"INVENTARIO"}),e.jsx("span",{className:"font-poppins text-[12px] font-medium text-grisHeading",children:s.description||n("No se encontró nombre o descripción")})]})]})}),e.jsx("div",{className:"mt-[90px] h-full overflow-auto px-8 py-6",children:e.jsxs("div",{className:"flex flex-col space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-normal text-grisText",children:n("Número de artículo")}),e.jsx("span",{className:"font-dm text-xs font-normal text-grisHeading",children:s.code||"-"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-normal text-grisText",children:n("Descripción")}),e.jsx("span",{className:"font-dm text-xs font-normal text-grisHeading",children:s.description||"-"})]}),e.jsx("div",{className:"rounded-[14px] bg-blancoForms p-2",children:e.jsx("span",{className:"font-dm text-[12px] font-normal text-grisSubText",children:n("Gestionar por Lotes")})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-normal text-grisText",children:n("Cantidad esperada")}),e.jsx("span",{className:"font-dm text-xs font-normal text-grisHeading",children:s.eQuantity||0})]}),e.jsx(L,{type:"number",placeholder:n("Recibido"),className:`${c==Number(s.eQuantity)?"text-[#00A259] dark:text-[#8de2bc]":"text-[#D7586B]"}`,value:c||0,onChange:l=>y(l.target.value)}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-normal text-grisText",children:n("Ubicación")}),e.jsx(g,{itemSelected:u,setItemSelected:d,options:v})]})]})}),e.jsx("div",{className:"fixed bottom-0 z-10 flex w-full items-center justify-center border-t bg-surface p-4 pb-[calc(1rem+var(--sab,0px))]",children:e.jsx("button",{type:"button",disabled:c>Number(s.eQuantity),onClick:h,className:`h-[41px] w-full max-w-[192px] rounded-[10px] font-dm text-[11px] font-medium text-white ${c>Number(s.eQuantity)?"bg-grisDisabled hover:bg-grisDisabled":"bg-violetBlue hover:bg-violetBlue/85"}`,children:n("Agregar")})})]})}function K(){const{t:i}=A(),f=R(),j=q(),{warehouses:p,catalogs:r,products:v,locations:n}=f,[s,u]=a.useState(null),[N,c]=a.useState(null),[x,y]=a.useState(null),[d,h]=a.use
1State(null),[l,m]=a.useState(!1),[T,I]=a.useState(null),k=a.useCallback(t=>{u(t)},[]),D=a.useCallback(t=>{y(t)},[]),F=a.useCallback(t=>{c(t)},[]),z=a.useMemo(()=>(r==null?void 0:r.data.map(t=>({value:t.id,label:t.number})))||[],[r]),B=a.useMemo(()=>(p==null?void 0:p.data.map(t=>({value:t.id,label:t.name})))||[],[p]),E=a.useMemo(()=>(n==null?void 0:n.data.map(t=>({value:t.id,label:t.name})))||[],[n]);return a.useEffect(()=>{async function t(){if(x!==null){const b=r==null?void 0:r.data.find(C=>C.id===x.id),S=await $(b);if(Array.isArray(S.data.slots)){const C=S.data.slots.map((o,M)=>{let Q=v.data.find(P=>P.id===o.master_product),O=Q?parseFloat(Q.price):0;return{type:o.type,code:o.articleNumber||"",idAux:M,articleNumber:o.master_product||"",variation:o.variations||"",description:o.name||"",rel_id:o.id,eQuantity:o.quantity||0,receivedQuantity:0,unitPrice:O,total:0,batches:[],ubication:null}});h(C)}}}t()},[x]),e.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden bg-surface",children:[!l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"z-60 fixed top-0 flex w-full flex-col bg-surface p-0 px-4 pt-[var(--sat,0px)]",children:e.jsxs("div",{className:"flex items-center justify-start gap-3 pt-6",onClick:()=>{j(-1)},children:[e.jsx(w,{icon:H,className:"size-7 text-grisHeading"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-poppins text-[16px] font-semibold text-grisHeading",children:"INVENTARIO"}),e.jsx("span",{className:"font-poppins text-[12px] font-medium text-grisHeading",children:i("Nueva entrada")})]})]})}),e.jsxs("div",{className:"mb-[70px] mt-[70px] h-full overflow-auto",children:[e.jsx("div",{className:"p-4",children:e.jsxs("div",{className:"mt-4 flex flex-col space-y-6 rounded-[10px] border px-4 py-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-normal text-grisText",children:i("Almacén")}),e.jsx(g,{required:!0,itemSelected:s,setItemSelected:k,options:[{value:"1",label:i("Almacén")}]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-normal text-grisText",children:i("Numero de pedido")}),e.jsx(g,{itemSelected:x,setItemSelected:D,options:z})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-normal text-grisText",children:i("Almacén destino")}),e.jsx(g,{itemSelected:N,setItemSelected:F,options:B})]})]})}),e.jsx("div",{className:"mt-2 w-full border-[5px] border-b p-0"}),e.jsx("div",{className:"p-4",children:e.jsxs("div",{className:"mt-3 flex flex-col",children:[e.jsx("span",{className:"font-poppins text-[14px] font-medium text-grisHeading",children:i("Productos a ingresar")}),e.jsx("section",{className:"mt-3 rounded-[14px] bg-blancoForms p-3",children:d&&d.map((t,b)=>e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:`flex items-center justify-between py-3 ${b!==d.length-1?"border-b":""}`,children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-dm text-[12px] font-normal text-grisHeading",children:t.description}),e.jsx("span",{className:"font-dm text-[10px] font-normal text-grisSubText",children:t.receivedQuantity==t.eQuantity?i("Completada"):i("Cantidad esperada • {{eQuantity}}",{eQuantity:t.eQuantity})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"rounded-[10px] bg-hoverModal text-center",children:e.jsx("span",{className:"p-2 font-dm text-[12px] font-normal text-grisHeading",children:t.receivedQuantity||0})}),e.jsx(w,{icon:_,onClick:()=>{I(t.idAux),m(!0)},className:"size-5 text-grisHeading"})]})]})},b))})]})})]}),e.jsx("div",{className:"fixed bottom-0 z-10 flex w-full items-center justify-center border-t bg-surface p-4 pb-[calc(1rem+var(--sab,0px))]",children:e.jsx("button",{type:"submit",className:"h-[41px] w-full max-w-[192px] rounded-[10px] bg-violetBlue font-dm text-[11px] font-medium text-white transition-colors hover:bg-violetBlue/85",children:i("Guardar")})})]}),l&&d&&e.jsx(G,{tableData:d,setTableData:h,productId:T,setProductId:I,setShow:m,locations:E})]})}export{K 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.