PageSourceSearch

https://app.sigeflex.com/assets/BatchControl-CxfkoC__.js

js sigeflex.com collected 2026-10-02 00:59:43 UTC 8,368 bytes, 1 lines download raw bytes

1import{S as X}from"./BatchControlService-DJD1-Ppm.js";import{g as K}from"./gridBadgeHelper-hYWjGFdT.js";/* empty css                                                                     */import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{p as Q,aS as b,Y as J,W as D,bJ as i,aC as z,X as C,a5 as r,F as G,r as y,c as g,b2 as s,a4 as W,bg as Y}from"./@vue-DmAB7yje.js";import"./dataset-DSY1Ij4o.js";import"./store-BS8x5qv_.js";import"./pinia-CAngz53m.js";import"./axios-Dlr9j6MA.js";import"./@fortawesome-CHr9kUcr.js";import"./lodash-DYhSs6Mk.js";import"./string-_buJapO2.js";import"./moment-Cl4UOzQZ.js";import"./compressorjs-D0oVaUf3.js";import"./apiHost-DqDNI4uj.js";import"./string-DrdasdIl.js";import"./errorMessages-BX_GrsJH.js";import"./report-DbjakC-p.js";import"./metadata-BT8H-kKA.js";import"./@protobuf-ts-D9nIBb28.js";import"./org-BIS9ejlb.js";const Z={__name:"BatchControl",props:{productId:{type:String,default:null},productName:{type:String,default:null},mode:{type:String,default:void 0},filters:{type:Object,default:()=>({})},autoLoad:{type:Boolean,default:!0}},setup(v){const m=v,S=y(null),V=y(null),_=y(!1),t=Q(new X);if(m.productId){const o=t.getModel.bind(t);t.getModel=()=>({...o(),productId:m.productId,productName:m.productName}),t.record.productId=m.productId,t.record.productName=m.productName}const x=g(()=>V.value?[V.value]:[]),h=[{cmd:"relatorios",text:"Relatórios",icon:"print",helpMessage:"Abre a tela de relatórios de lotes"}],N=o=>{o==="relatorios"&&(_.value=!0)},U=g(()=>!!m.productId),E=g(()=>{var o;return!!((o=t.record)!=null&&o.id)}),A={BATCH_STATUS_EXPIRED:"Vencido",BATCH_STATUS_DEPLETED:"Esgotado"},w=g(()=>{var o;return Object.prototype.hasOwnProperty.call(A,(o=t.record)==null?void 0:o.status)}),T=g(()=>{var e;const o=(e=t.record)==null?void 0:e.status;return o==="BATCH_STATUS_EXPIRED"?{type:"warning",title:"Lote vencido",message:"Este lote passou da data de vencimento. Por isso o sistema o marca como Vencido automaticamente — esse status não pode ser alterado manualmente."}:o==="BATCH_STATUS_DEPLETED"?{type:"info",title:"Lote esgotado",message:"Este lote está com a quantidade zerada. Por isso o sistema o marca como Esgotado automaticamente. Ele volta a ficar disponível quando houver entrada de saldo pela movimentação de estoque."}:null}),I=g(()=>{var l;const o=[{text:"Ativo",value:"BATCH_STATUS_ACTIVE"},{text:"Bloqueado",value:"BATCH_STATUS_BLOCKED"}],e=(l=t.record)==null?void 0:l.status;return A[e]&&o.push({text:A[e],value:e}),o}),p={status:[{required:!0,message:"Status é obrigatório",trigger:"change"}],batchNumber:[{required:!0,message:"Número do lote é obrigatório",trigger:"blur"},{min:1,max:100,message:"Número do lote deve ter entre 1 e 100 caracteres",trigger:"blur"}],product:[{required:!0,message:"Produto é obrigatório",trigger:"change"}],stock:[{required:!0,message:"Estoque é obrigatório",trigger:"change"}],quantity:[{required:!0,message:"Quantidade é obrigatória",trigger:"blur"}],expirationDate:[{required:!0,message:"Data de vencimento é obrigatória",trigger:"change"}]},k=o=>{t.record.productId=o.id,t.record.productName=o.nome},H=o=>{t.record.stockId=o.id,t.record.stockName=o.nome||o.estoqueNome},q=o=>{t.record.supplierId=o.id,t.record.supplierName=o.name||o.nome},P=o=>{var l;const e=(l=o.event)==null?void 0:l.target;if(e&&e.tagName==="A"&&e.dataset.action==="open-batch"){o.event.preventDefault();const c=e.dataset.id;c&&S.value&&S.value.openRecord([{id:c}])}},L=(o,e)=>{if(!e)return null;if(o==="batchNumber"&&e.batchNumber)return`<a href="javascript:void(0)" style="color: var(--app-color-info); font-weight: 600; text-decoration: underline;" data-action="open-batch" data-id="${e.id}">${e.batchNumber}</a>`;if(o==="status"&&e.status){const l={BATCH_STATUS_ACTIVE:"success",BATCH_STATUS_EXPIRED:"danger",BATCH_STATUS_BLOCKED:"warning",BATCH_STATUS_DEPLETED:"default"},c={BATCH_STATUS_ACTIVE:"Ativo",BATCH_STATUS_EXPIRED:"Vencido",BATCH_STATUS_BLOCKED:"Bloqueado",BATCH_STATUS_DEPLETED:"Esgotado"},f={BATCH_STATUS_ACTIVE:"fa-check-circle",BATCH_STATUS_EXPIRED:"fa-calendar-times",BATCH_STATUS_BLOCKED:"fa-ban",BATCH_STATUS_DEPLETED:"fa-box-open"};return K(c[e.status]||e.status,l[e.status]||"default",f[e.status])}if(o==="expirationDate"){if(!e.expirationDate)return'<span style="opacity: 0.5;">-</span>';
1const l=new Date(e.expirationDate),c=l.toLocaleDateString("pt-BR"),f=new Date;f.setHours(0,0,0,0),l.setHours(0,0,0,0);const n=Math.ceil((l-f)/(1e3*60*60*24));let d,u;return n<0?(d="var(--app-color-danger)",u=`Vencido ${Math.abs(n)}d`):n===0?(d="var(--app-color-warning)",u="HOJE"):n<=7?(d="var(--app-color-warning)",u=`${n}d`):n<=30?(d="var(--app-color-info)",u=`${n}d`):(d="var(--app-color-success)",u=`${n}d`),`<span>${c}</span> <span style="color: ${d}; font-weight: 600;">(${u})</span>`}return null};return(o,e)=>{const l=s("f-alert"),c=s("f-combobox"),f=s("f-textbox"),n=s("f-form-row"),d=s("f-lookup"),u=s("f-card"),R=s("f-numberbox"),B=s("f-datetimebox"),O=s("FormView"),$=s("f-crud-form"),F=s("ReportView"),M=s("Dialog");return b(),J(G,null,[t?(b(),D($,z({key:0,"screen-name":"Batch Control",ref_key:"form",ref:S,"link-doc":v.mode!=="child"?"estoque/lotes":""},o.$attrs,{schema:t,mode:v.mode,filters:v.filters,"auto-load":v.autoLoad,permissao:"estoque.batch","forms-validation":x.value,"style-cell":L,"dropdown-items":h,onCellClick:P,onHandleOpcoes:N}),{default:i(()=>[r(O,{ref_key:"formRef",ref:V,"col-count":1,class:"batch-form"},{default:i(()=>[T.value?(b(),D(l,{key:0,type:T.value.type,title:T.value.title,"show-icon":!0,closeable:!1,class:"batch-form__alert"},{default:i(()=>[W(Y(T.value.message),1)]),_:1},8,["type","title"])):C("",!0),r(u,{title:"Identificação","title-align":"left",shadow:"never"},{default:i(()=>[r(n,null,{default:i(()=>[r(c,{modelValue:t.record.status,"onUpdate:modelValue":e[0]||(e[0]=a=>t.record.status=a),caption:"Status",options:I.value,"read-only":w.value,validations:p.status},null,8,["modelValue","options","read-only","validations"]),r(f,{modelValue:t.record.batchNumber,"onUpdate:modelValue":e[1]||(e[1]=a=>t.record.batchNumber=a),caption:"Número do Lote",validations:p.batchNumber},null,8,["modelValue","validations"])]),_:1}),r(n,null,{default:i(()=>[r(d,{modelValue:t.record.productName,"onUpdate:modelValue":e[2]||(e[2]=a=>t.record.productName=a),caption:"Produto",component:"Produto","value-id":t.record.productId,disabled:E.value||U.value,validations:p.product,onValue:k},null,8,["modelValue","value-id","disabled","validations"]),r(d,{modelValue:t.record.stockName,"onUpdate:modelValue":e[3]||(e[3]=a=>t.record.stockName=a),caption:"Estoque",component:"Estoque","value-id":t.record.stockId,disabled:E.value,validations:p.stock,onValue:H},null,8,["modelValue","value-id","disabled","validations"])]),_:1})]),_:1}),r(u,{title:"Quantidade e Validade","title-align":"left",shadow:"never"},{default:i(()=>[r(n,null,{default:i(()=>[r(R,{modelValue:t.record.quantity,"onUpdate:modelValue":e[4]||(e[4]=a=>t.record.quantity=a),caption:"Quantidade",precision:0,"read-only":E.value,validations:p.quantity},null,8,["modelValue","read-only","validations"]),r(B,{modelValue:t.record.manufacturingDate,"onUpdate:modelValue":e[5]||(e[5]=a=>t.record.manufacturingDate=a),caption:"Data de Fabricação",type:"date"},null,8,["modelValue"]),r(B,{modelValue:t.record.expirationDate,"onUpdate:modelValue":e[6]||(e[6]=a=>t.record.expirationDate=a),caption:"Data de Vencimento",type:"date",validations:p.expirationDate},null,8,["modelValue","validations"])]),_:1})]),_:1}),r(u,{title:"Fornecedor","title-align":"left",shadow:"never"},{default:i(()=>[r(n,null,{default:i(()=>[r(d,{modelValue:t.record.supplierName,"onUpdate:modelValue":e[7]||(e[7]=a=>t.record.supplierName=a),caption:"Fornecedor",component:"Person","page-title":"Consulta de Fornecedor","value-id":t.record.supplierId,filters:{type:"vendor"},onValue:q},null,8,["modelValue","value-id"])]),_:1})]),_:1})]),_:1},512)]),_:1},16,["link-doc","schema","mode","filters","auto-load","forms-validation"])):C("",!0),r(M,{modelValue:_.value,"onUpdate:modelValue":e[8]||(e[8]=a=>_.value=a),title:"Relatórios de Lotes",width:"100%",height:"100%"},{default:i(()=>[_.value?(b(),D(F,{key:0,module:"batch_relatorio","show-filter":!0,"auto-filter":!1})):C("",!0)]),_:1},8,["modelValue"])],64)}}},Ve=j(Z,[["__scopeId","data-v-4aa71305"]]);export{Ve 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.