PageSourceSearch

https://printstudios.de/static/react/chunks/CreateLieferschein-CFyBTfRe.js

js printstudios.de collected 2026-10-06 14:05:02 UTC 8,388 bytes, 1 lines download raw bytes

1import{j as e}from"./motion-4Pe-0l9l.js";import{q as z,y as B,r as l,u as D,O as K,c as T,t as E,ah as F}from"./icons-D33OLVah.js";import{C as v,a as y,b as N}from"./Card-CRfFeeMV.js";import{I as c}from"./Input-DCHAd5rh.js";import{B as w}from"./Button-DINrkm76.js";import{e as O,c as C}from"./index-DOjRTYqR.js";import{b as A,a as M}from"./lieferscheine-D3-W7T3z.js";import{f as I}from"./angebote-C2--SnV1.js";function R({data:o,onSelect:u}){return o.length?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border-secondary text-left",children:[e.jsx("th",{className:"pb-3 pr-4 text-xs font-medium text-text-muted uppercase tracking-wider",children:"LS-Nr."}),e.jsx("th",{className:"pb-3 pr-4 text-xs font-medium text-text-muted uppercase tracking-wider",children:"Auftrag"}),e.jsx("th",{className:"pb-3 pr-4 text-xs font-medium text-text-muted uppercase tracking-wider",children:"Kunde"}),e.jsx("th",{className:"pb-3 pr-4 text-xs font-medium text-text-muted uppercase tracking-wider",children:"Erstellt"}),e.jsx("th",{className:"pb-3 text-xs font-medium text-text-muted uppercase tracking-wider",children:"PDF"})]})}),e.jsx("tbody",{children:o.map(s=>e.jsxs("tr",{className:"border-b border-border-secondary/50 hover:bg-white/[0.02] transition-colors cursor-pointer",onClick:()=>u?.(s),children:[e.jsx("td",{className:"py-3 pr-4 font-mono text-sm text-accent-cyan",children:s.ls_nummer}),e.jsx("td",{className:"py-3 pr-4 text-text-primary",children:s.order_number||"–"}),e.jsx("td",{className:"py-3 pr-4 text-text-primary",children:s.customer_name||"–"}),e.jsx("td",{className:"py-3 pr-4 text-text-secondary",children:O(s.created_at)}),e.jsx("td",{className:"py-3",children:s.pdf_url?e.jsxs("a",{href:s.pdf_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-accent-cyan hover:text-accent-cyan/80 transition-colors",onClick:d=>d.stopPropagation(),children:[e.jsx(B,{size:14}),e.jsx("span",{children:"PDF"})]}):e.jsx("span",{className:"text-text-muted",children:"–"})})]},s.id))})]})}):e.jsxs("div",{className:"text-center py-12 text-text-muted",children:[e.jsx(z,{className:"mx-auto mb-3 opacity-40",size:32}),e.jsx("p",{children:"Keine Lieferscheine vorhanden"})]})}const k={order_number:"",customer_name:"",category:"",task:"",textile:"",textile_color:"",shipping_method:"",box_number:"",shipping_address:"",size_run:"",extra_positions:""};function W({inline:o,onCreated:u}){const[s,d]=l.useState(k),[m,p]=l.useState(""),[L,x]=l.useState(!1),[j,_]=l.useState(""),h=l.useRef(null),i=A(),{data:f}=M(),{data:g}=I(m),a=l.useCallback((t,r)=>{d(n=>({...n,[t]:r}))},[]);l.useEffect(()=>{function t(r){h.current&&!h.current.contains(r.target)&&x(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]);const S=()=>{const t=new URLSearchParams;for(const[r,n]of Object.entries(s))n&&t.set(r,n);window.open(`/lieferschein/preview?${t.toString()}`,"_blank")},P=()=>{const t={};for(const[r,n]of Object.entries(s))n&&(t[r]=n);i.mutate(t,{onSuccess:r=>{_("Lieferschein erstellt!"),r.pdf_url&&window.open(r.pdf_url,"_blank"),d(k),p(""),u?.(),setTimeout(()=>_(""),4e3)}})},b=C("w-full px-3.5 py-3 bg-bg-input border border-border-secondary rounded-lg","text-text-primary text-sm font-sans transition-all duration-200","focus:outline-none focus:border-accent-cyan/50 focus:shadow-[0_0_0_3px_rgba(56,189,248,0.1),0_0_20px_rgba(56,189,248,0.05)]","placeholder:text-text-muted resize-y min-h-[80px]");return e.jsxs("div",{className:o?"":"p-8 max-w-5xl mx-auto space-y-6",children:[e.jsxs(v,{children:[e.jsxs(y,{children:[e.jsx(z,{size:18,className:"text-accent-cyan"}),e.jsx(N,{children:"Neuen Lieferschein erstellen"})]}),j&&e.jsxs("div",{className:"mb-4 flex items-center gap-2 p-3 rounded-lg bg-accent-green/10 border border-accent-green/30 text-accent-green text-sm",children:[e.jsx(D,{size:16}),j]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(c,{label:"Auftragsnummer",id:"order_number",placeholder:"z.B. A-2026-0042",value:s.order_number,onChange:t=>a("order_number",t.target.value)}),e.jsxs("div",{className:"relative",ref:h,children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:"Kundenname"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{className:C("w-full px-3.5 py-3 bg-bg-input border border-border-secondary rounded-lg","text-text-primary text-sm transition-all duration-200","focus:outline-none focus:border-accent-cyan/50 focus:shadow-[0_0_0_3px_rgba(56,189,248,0.1)]","placeholder:text-text-muted pr-10"),placeholder:"Kunde suchen…",value:s.customer_name||m,onChange:t=>{const r=t.target.value;a("customer_name",r),p(r),x(r.length>=2)},onFocus:()=>m.length>=2&&x(!0)}),e.jsx(K,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted"})]})]}),L&&g?.customers&&g.customers.length>0&&e.jsx("div",{className:"absolute z-50 w-full mt-1 bg-bg-secondary border border-border-secondary rounded-lg shadow-xl max-h-48 overflow-y-auto",children:g.customers.map(t=>e.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm text-text-primary hover:bg-white/[0.05] transition-colors flex flex-col",onClick:()=>{a("customer_name",t.name),t.full_address&&a("shipping_address",t.full_address),p(t.name),x(!1)},children:[e.jsx("span",{className:"font-medium",children:t.name}),t.city_zip&&e.jsx("span",{className:"text-xs text-text-muted",children:t.city_zip})]},t.id))})]}),e.jsx(c,{label:"Kategorie",id:"category",placeholder:"z.B. Textildruck, Stickerei",value:s.category,onChange:t=>a("category",t.target.value)}),e.jsx(c,{label:"Aufgabe",id:"task",placeholder:"z.B. DTF Transfer, Siebdruck",value:s.task,onChange:t=>a("task",t.target.value)}),e.jsx(c,{label:"Textil",id:"textile",placeholder:"z.B. Fruit of the Loom 61-036",value:s.textile,onChange:t=>a("textile",t.target.value)}),e.jsx(c,{label:"Textilfarbe",id:"textile_color",placeholder:"z.B. Schwarz, Navy Blue",value:s.textile_color,onChange:t=>a("textile_color",t.target.value)}),e.jsx(c,{label:"Versandart",id:"shipping_method",placeholder:"z.B. DHL, DPD, Abholung",value:s.shipping_method,onChange:t=>a("shipping_method",t.target.value)}),e.jsx(c,{label:"Kistennummer",id:"box_number",placeholder:"z.B. K-001",value:s.box_number,onChange:t=>a("box_number",t.target.value)})]}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:"Lieferadresse"}),e.jsx("textarea",{className:b,placeholder:"Straße, PLZ Ort, Land",rows:3,value:s.shipping_address,onChange:t=>a("shipping_address",t.target.value)})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:"Größenlauf"}),e.jsx("textarea",{className:b,placeholder:"S: 5, M: 10, L: 15, XL: 10",rows:3,value:s.size_run,onChange:t=>a("size_run",t.target.value)})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-muted uppercase tracking-wider",children:"Zusätzliche Positionen"}),e.jsx("textarea",{className:b,placeholder:"Weitere Positionen oder Anmerkungen",rows:3,value:s.extra_positions,onChange:t=>a("extra_positions",t.target.value)})]})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-6",children:[e.jsxs(w,{variant:"secondary",onClick:S,children:[e.jsx(T,{size:16}),"Vorschau"]}),e.jsxs(w,{onClick:P,disabled:i.isPending,children:[i.isPending?e.jsx(E,{size:16,className:"animate-spin"}):e.jsx(F,{size:16}),i.isPending?"Erstelle…":"Lieferschein erstellen"]})]}),i.isError&&e.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-accent-red/10 border border-accent-red/30 text-accent-red text-sm",children:["Fehler: ",i.error.message]})]}),f?.data&&f.data.length>0&&e.jsxs(v,{className:"mt-6",children:[e.jsx(y,{children:e.jsx(N,{children:"Letzte Lieferscheine"})}),e.jsx(R,{data:f.data.slice(0,10)})]})]})}const J=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));
1export{W as C,R as L,J as a};

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.