"use strict";(globalThis["webpackChunkbaggisowtfaresystem"]=globalThis["webpackChunkbaggisowtfaresystem"]||[]).push([[950],{5950:(e,a,t)=>{t.r(a),t.d(a,{default:()=>x});var l=t(1347),r=t(4187),i=t(7763),n=t(3022),s=t(455),d=t(588),u=t(8557);const o={class:"text-caption text-grey-7"},c={__name:"OrderPdf",setup(e){const{canWrite:a,canUpdate:t,canExport:c}=(0,d.J)(),v=c("order"),g=a("order"),y=t("order"),p=(0,l.EW)(()=>g.value||y.value),f=(0,l.EW)(()=>v.value),m=(0,n.A)(),k=(0,s.lq)(),b=(0,s.rd)(),x=(0,u.Bm)(),h=(0,r.KR)(!1),q=(0,l.EW)(()=>String(k.params.id||"").trim());async function _(){if(f.value)if(q.value){h.value=!0;try{await x.downloadOrderPdf(q.value)}catch(e){m.notify({type:"negative",message:e?.message||"PDF acilamadi"})}finally{h.value=!1}}else m.notify({type:"warning",message:"Order ID bulunamadi"});else m.notify({type:"negative",message:"Siparis PDF export yetkiniz yok"})}function w(){if(!p.value)return void m.notify({type:"negative",message:"Siparis duzenleme yetkiniz yok"});if(!q.value)return void m.notify({type:"warning",message:"Order ID bulunamadi"});const e=y.value?"order-edit":"order-entry";b.push({name:e,params:{orderHeaderID:q.value}})}return(e,a)=>{const t=(0,l.g2)("q-card-section"),n=(0,l.g2)("q-btn"),s=(0,l.g2)("q-card-actions"),d=(0,l.g2)("q-card"),u=(0,l.g2)("q-page");return(0,r.R1)(v)?((0,l.uX)(),(0,l.Wv)(u,{key:0,class:"q-pa-md"},{default:(0,l.k6)(()=>[(0,l.bF)(d,{flat:"",bordered:"",class:"q-pa-md",style:{"max-width":"720px"}},{default:(0,l.k6)(()=>[(0,l.bF)(t,null,{default:(0,l.k6)(()=>[a[0]||(a[0]=(0,l.Lk)("div",{class:"text-h6"},"Order PDF",-1)),(0,l.Lk)("div",o,"Order ID: "+(0,i.v_)(q.value||"-"),1)]),_:1}),(0,l.bF)(s,{align:"right",class:"q-gutter-sm"},{default:(0,l.k6)(()=>[f.value?((0,l.uX)(),(0,l.Wv)(n,{key:0,color:"primary",icon:"picture_as_pdf",label:"PDF Ac",loading:h.value,disable:h.value||!q.value,onClick:_},null,8,["loading","disable"])):(0,l.Q3)("",!0),p.value?((0,l.uX)(),(0,l.Wv)(n,{key:1,flat:"",color:"secondary",label:"Siparise Don",disable:!q.value,onClick:w},null,8,["disable"])):(0,l.Q3)("",!0)]),_:1})]),_:1})]),_:1})):((0,l.uX)(),(0,l.Wv)(u,{key:1,class:"q-pa-md flex flex-center"},{default:(0,l.k6)(()=>[...a[1]||(a[1]=[(0,l.Lk)("div",{class:"text-negative text-subtitle1"}," Bu module erisim yetkiniz yok. ",-1)])]),_:1}))}}};var v=t(5013),g=t(3341),y=t(222),p=t(5034),f=t(2677),m=t(272),k=t.n(m);const b=c,x=b;k()(c,"components",{QPage:v.A,QCard:g.A,QCardSection:y.A,QCardActions:p.A,QBtn:f.A})}}]);