PageSourceSearch

https://zakup.gov.kz/assets/AnnualPlansList-DTiGlUMV.js

js zakup.gov.kz collected 2026-10-09 16:56:46 UTC 13,975 bytes, 1 lines download raw bytes

1import{eR as W,r as f,x as Z,q as ee,$ as ae,j as a,G as p,m as u,a0 as te}from"./theme-3dfVej7W.js";import{u as se}from"./planningAccess-BVrV6qWb.js";import{F as ne,G as re,H as le,I as ie,J as oe,K as ce,L as de,M as pe,N as ue,s as me}from"./PrivateApp-BFO3_Tbx.js";import{F as xe}from"./FilterBar-ByoPoEbr.js";import{g as fe,p as w}from"./parseErrors-BsNA3L7K.js";import{F as d}from"./index-BzeA_MbD.js";import{P as M}from"./index-DqejBB-o.js";import{R as he}from"./MoreOutlined-CmU-huJc.js";import{I as S}from"./index-CQ9iPbHV.js";import{D as Y}from"./index-D4v2P043.js";import{U as h}from"./index-YFykW8M_.js";import{R}from"./InboxOutlined-C26zLnfQ.js";import{D as ye}from"./index-DbyqvX_N.js";import{C as _e}from"./index-CwLtvCkV.js";import{R as ge}from"./InfoCircleTwoTone-OJZVSewk.js";import{T as v}from"./index-I1ZxXO3B.js";import{R as je}from"./PlusOutlined-DO9FITow.js";import{F as A,P as be,T as we}from"./index-C86gn5Ct.js";import{R as ve}from"./index-CkPKzKfo.js";import"./vite-preload-helper-BXl3LOEh.js";import"./index-LRpAibSh.js";import"../remoteEntry.js";import"./index-BEDcFE4N.js";import"./SignatureContext-BIIScoJU.js";import"./registerCabinetApi-CKnIRFA1.js";import"./downloadFileByUrl-w19mXwt2.js";import"./index-C016Db5J.js";import"./AntdIcon-B8e_FEAo.js";import"./LeftOutlined-zZTRbrqI.js";import"./purify.es-LQkvcK5U.js";import"./formatAmount-BO0bCaMt.js";import"./index-wH3ULS13.js";import"./PurePanel-CIovuaru.js";import"./row-M1qaIYld.js";import"./useBreakpoint-DBaSuQQQ.js";import"./index-C63dYVM1.js";import"./CaretUpOutlined-BEFoO-V0.js";import"./CaretDownOutlined-8u9gCQpJ.js";import"./useForm-Cmblz3t1.js";import"./EyeOutlined-DGpwx6h2.js";import"./progress-DriKEix0.js";import"./Sider-CaqjhNAo.js";import"./EllipsisOutlined-fLaExTxN.js";import"./index-D10blwUV.js";function fa(){const L=(W().data?.roles??[]).some(e=>e.role_id===5),{readOnly:_}=se(),[c]=d.useForm(),[j,O]=f.useState(1),[b,E]=f.useState(10),{modal:m,message:i}=Z.useApp(),{t:n}=ee("plan"),x=ae(),[U,g]=ne(),k=re(),[N]=le(),[$]=ie(),[G]=oe(),[P,V]=f.useState({}),[q]=ce?.(),[B]=de(),z=[{name:"year",label:n("annual.financialYear"),type:"select",options:k.isSuccess?k.data.map(e=>({label:e.year,value:e.id})):[],colSpan:{xs:24,sm:24,md:12,lg:8,xl:4,xxl:4}},{name:"status",label:n("annual.status"),type:"select",colSpan:{xs:24,sm:24,md:12,lg:8,xl:4,xxl:4},useOptionsQuery:pe},{name:"preliminary_plan",label:n("annual.planType"),type:"select",options:[{label:n("annual.preliminary"),value:!0},{label:n("annual.mainPlan"),value:!1}],colSpan:{xs:24,sm:24,md:12,lg:8,xl:4,xxl:4}},{name:"plan_type",label:n("annual.planView"),type:"select",colSpan:{xs:24,sm:24,md:12,lg:16,xl:7,xxl:8},useOptionsQuery:ue}],D=async e=>{const{file:r,onSuccess:t,onError:s}=e;if(!r){i.error(n("annual.fileNotSelected"));return}try{const l=await me(r),o=await q({userfile:r,signature:l}).unwrap();c.setFieldsValue({act_file:[{uid:o.uuid,name:r.name,status:"done",response:o}]}),t?.(o,r),i.success(n("annual.signedUploaded"))}catch(l){s?.(l),i.error(n("annual.signUploadError"))}},y=async(e=j,r=b)=>{await U({...P,offset:(e-1)*r,limit:r})},I=async(e,r)=>{try{await N({planId:e,file_id:r}).unwrap(),i.success(n("annual.approved")),await y()}catch(t){const s=fe(t?.data);s.points.length>0?m.error({title:"Невозможно утвердить план",width:640,content:a.jsxs("div",{children:[s.actErrors.length>0&&a.jsx("ul",{style:{paddingLeft:20},children:s.actErrors.map((l,o)=>a.jsx("li",{children:l},`act-${o}`))}),s.points.map(l=>a.jsxs("div",{style:{marginTop:8},children:[a.jsxs("b",{children:["№ ",l.point_number??l.point_id,l.point_name?` ${l.point_name}`:""]}),a.jsx("ul",{style:{margin:"4px 0 0",paddingLeft:20},children:l.messages.map((o,J)=>a.jsx("li",{children:o},`${l.point_id}-${J}`))})]},l.point_id))]})}):i.error(w(t?.data,"утверждение плана","Невозможно утвердить план"))}},F=async e=>{try{await G(e).unwrap(),i.success("Годовой план успешно создан."),await y()}catch{i.error("Ошибка при создании плана.")}},T=async e=>{try{await $(e).unwrap(),i.success("План успешно удалён"),await y()}catch(r){i.error(w(r,void 0,"Ошибка при удалении годового плана"))}},Q=f.useCallback(e=>a.jsx(M,{placement:"bottomRight",content:a.jsxs("div",{className:"flex flex-col",children:[!_&&e?.allowed_actions?.includes("edit")&&a.jsxs(a.Fragment,{children:[a.jsx(p,{type:"text",className:"justify-start",onClick:()=>x(`edit/${e.id}`),children:n("annual.edit")}),a.jsx(p,{type:"text",className:"justify-start",onClick:()=>
1{if(!e.act_file||!e.act_date||!e.act_number){const r=async()=>{const s=await c.validateFields(),l=s.act_file?.[0]?.response?.id??e.act_file?.id;try{await B({id:e.id,body:{act_number:s.act_number,act_date:s.act_date.format("YYYY-MM-DD"),preliminary_plan:e.preliminary_plan,file_id:l}}).unwrap(),await N({planId:e.id,file_id:l}).unwrap()}catch(o){throw i.error(w(o,"утверждение плана","Невозможно утвердить план")),o}i.success("План утвержден"),c.resetFields(),await y()};c.resetFields();const t=m.info({title:"Заполните данные акта перед утверждением",width:700,icon:null,content:a.jsx(d,{layout:"vertical",form:c,initialValues:{act_number:e.act_number,act_date:e.act_date?u(e.act_date*1e3):void 0,act_file:e?.act_file?.id?[{uid:String(e.act_file.id),name:"Приказ об утверждении",status:"done"}]:[]},onValuesChange:()=>{const s=c.getFieldsValue();t.update({okButtonProps:{disabled:!s.act_number||!s.act_date||!(s.act_file?.[0]?.response?.id||s.act_file?.[0]?.uid)}})},children:a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsx(d.Item,{label:"Номер акта",name:"act_number",rules:[{required:!0,message:"Укажите номер акта"}],children:a.jsx(S,{placeholder:"Введите номер акта"})}),a.jsx(d.Item,{label:"Дата акта",name:"act_date",children:a.jsx(Y,{format:"DD.MM.YYYY",className:"w-full",placeholder:"Введите дату",disabledDate:s=>s&&s>u().endOf("day")})}),a.jsx(d.Item,{label:"Файл утвержденного акта",name:"act_file",valuePropName:"fileList",getValueFromEvent:s=>Array.isArray(s)?s:s?.fileList,rules:[{required:!0,message:"Загрузите файл акта"}],children:a.jsxs(h.Dragger,{accept:".pdf,.doc,.docx",maxCount:1,listType:"text",showUploadList:{showRemoveIcon:!0},customRequest:D,beforeUpload:s=>{if(!(s.size/1024/1024<20))return i.error("Файл должен быть меньше 20MB!"),h.LIST_IGNORE;const o=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"];return!s.type||!o.includes(s.type)?(i.error("Разрешены только .PDF, .DOC, .DOCX"),h.LIST_IGNORE):!0},children:[a.jsx("p",{className:"ant-upload-drag-icon",children:a.jsx(R,{})}),a.jsx("p",{className:"ant-upload-text",children:"Нажмите или перетащите файл"}),a.jsx("p",{className:"ant-upload-hint",children:"Загрузите 1 файл в формате .PDF до 20 мегабайт"})]})})]})}),okText:"Сохранить и утвердить",cancelText:"Отмена",onOk:r,okButtonProps:{disabled:!e.act_number||!e.act_date||!e.act_file?.id},closable:!0});setTimeout(()=>{c.setFieldsValue({act_number:e.act_number,act_date:e.act_date?u(e.act_date*1e3):void 0,act_file:e?.act_file?.id?[{uid:String(e.act_file.id),name:"Приказ об утверждении",status:"done"}]:[]})},0)}else m.confirm({title:"Вы действительно хотите утвердить Годовой план?",content:null,okText:"Утвердить",cancelText:"Отмена",onOk:()=>I(e.id,e.act_file?.id)})},children:n("annual.approve")}),a.jsx(p,{danger:!0,type:"text",className:"justify-start font-semibold",onClick:()=>m.confirm({title:"Вы уверены, что хотите удалить план?",content:"Это действие невозможно отменить.",okText:"Удалить",okType:"danger",cancelText:"Отмена",onOk:()=>T(e?.id)}),children:n("annual.deleteDraft")})]}),!_&&e?.allowed_actions?.includes("amend")&&a.jsx(a.Fragment,{children:a.jsx(p,{type:"text",className:"justify-start",onClick:()=>{c.resetFields();const r=m.info({title:"Заполните данные акта перед утверждением",width:700,icon:null,content:a.jsx(d,{layout:"vertical",form:c,onValuesChange:()=>{const t=c.getFieldsValue();r.update({okButtonProps:{disabled:!t.act_number||!t.act_date||!(t.act_file?.[0]?.response?.id||t.act_file?.[0]?.uid)}})}
1,children:a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsx(ye,{items:[{label:"Финансовый год",children:e?.year?.year},{label:"Тип плана",children:e?.plan_type?.name}]}),a.jsxs(_e,{checked:e?.preliminary_plan,disabled:!0,children:["Предварительный план",a.jsx(M,{placement:"rightTop",content:a.jsx(v.Paragraph,{className:"w-60",children:"Предварительный годовой план действует до утверждения..."}),title:"Что это?",children:a.jsx(ge,{className:"ml-2"})})]}),a.jsx(d.Item,{label:"Номер акта",name:"act_number",rules:[{required:!0,message:"Укажите номер акта"}],children:a.jsx(S,{placeholder:"Введите номер акта"})}),a.jsx(d.Item,{rules:[{required:!0}],label:"Дата акта",name:"act_date",children:a.jsx(Y,{format:"DD.MM.YYYY",className:"w-full",placeholder:"Введите дату",disabledDate:t=>t&&t>u().endOf("day")})}),a.jsx(d.Item,{label:"Файл утвержденного акта",name:"act_file",valuePropName:"fileList",getValueFromEvent:t=>Array.isArray(t)?t:t?.fileList,rules:[{required:!0,message:"Загрузите файл акта"}],children:a.jsxs(h.Dragger,{accept:".pdf,.doc,.docx",maxCount:1,listType:"picture",showUploadList:{showRemoveIcon:!0},customRequest:D,beforeUpload:t=>{if(!(t.size/1024/1024<20))return i.error("Файл должен быть меньше 20MB!"),h.LIST_IGNORE;const l=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"];return!t.type||!l.includes(t.type)?(i.error("Разрешены только .PDF, .DOC, .DOCX"),h.LIST_IGNORE):!0},children:[a.jsx("p",{className:"ant-upload-drag-icon",children:a.jsx(R,{})}),a.jsx("p",{className:"ant-upload-text",children:"Нажмите или перетащите файл"}),a.jsx("p",{className:"ant-upload-hint",children:"Загрузите 1 файл в формате .PDF до 20 мегабайт"})]})})]})}),okText:"Сохранить",cancelText:"Отмена",onOk:async()=>{const t=await c.validateFields();F({id:e?.id,act_number:t?.act_number,act_date:u(t?.act_date).format("YYYY-MM-DD"),file_id:t?.act_file?.[0]?.response?.id})},okButtonProps:{},closable:!0})},children:n("annual.amendPlan")})}),a.jsx("div",{className:"border-t-[1px]",children:a.jsx(p,{type:"text",className:"justify-start",onClick:()=>x(`${e.id}`),children:n("annual.viewItems")})})]}),trigger:"click",children:a.jsx(he,{onClick:()=>{},className:"cursor-pointer"})}),[x,m,i,I,F,T,_]),K=()=>[{title:"№",key:"id",width:110,render:e=>a.jsx(v.Text,{copyable:{text:String(e.id),tooltips:["Копировать №","Скопировано"]},children:a.jsx(te,{to:`${e.id}`,className:"text-[#006196] font-semibold text-nowrap",children:e.id})})},{title:"Финансовый год",key:"years",render:e=>e?.year?.year,width:50},{title:"№ акта",key:"actNumber",width:50,dataIndex:"act_number"},{title:"Дата утверждения акта",key:"approvalDate",width:50,render:e=>e.act_date?u(e.act_date*1e3).format("DD/MM/YYYY"):"-"},{title:"Утвержден в системе",key:"approvedInSystem",render:e=>e?.approved_date?u(e.approved_date*1e3).format("DD/MM/YYYY"):"-",width:50},{title:"Тип плана",key:"planType",render:e=>` ${e?.plan_type?.name}`+(e?.preliminary_plan?" (Предварительный план)":""),width:50},{title:"Пунктов плана",dataIndex:"count",key:"count",width:50},{title:"Сумма, ₸",key:"total_price",width:50,render:e=>Intl.NumberFormat("ru-RU").format(e.total_price??0)},{title:"Статус",key:"status",width:50,render:e=>a.jsx(we,{title:e?.status?.name,children:e?.status?.name})},{title:"",key:"actions",fixed:"right",width:50,render:Q}],C=f.useMemo(()=>K(),[]),X=g.isSuccess?g?.data?.result?.map(e=>({key:e.id,...e})):[],H=e=>e.history?a.jsx(a.Fragment,{children:a.jsx(A,{size:"small",columns:[{title:"v",key:"key",dataIndex:"key",width:25},...C],dataSource:e.history.map((r,t)=>({key:e.history.length-t,...r})),rowKey:"id",scroll:{x:"max-content"}})}):null;return f.useEffect(()=>{y()},[P,j,b]),a.jsx(a.Fragment,{children:L?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 mb-4",children:[a.jsx(v.Title,{level:1,children:n("annual.plans")}),a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[!_&&a.jsx(p,{type:"primary",icon:a.jsx(je,{}),onClick:()=>x("new"),children:n("annual.createPlan")}),a.jsx(p,{onClick:()=>x("incoming-transferred"),children:n("annual.incomingItems")})]})]}),a.jsx(xe,{fields:z,onChange:V,initialValues:{name:""}}),a.jsx(A,{rowKey:"id",pagination:!1,scroll:{x:"max-content"},loading:g.isLoading,className:"border rounded-xl pb-4 bg-white",expandable:{expandedRowRender:H,rowExpandable:e=>e.history?.length>1},columns:C,dataSource:X}),a.jsx("div",{className:"p-4 flex justify-center",children:a.jsx(be,{current:j,pageSize:b,total:g.data?.count??0,showSizeChanger:!0,pageSizeOptions:[10,20,50,100],onChange:(e,r)=>{O(e),E(r)}})})]}):a.jsx(ve,{status:"403",title:"403",subTitle:n("annual.accessDenied"),extra:a.jsx(p,{type:"primary",onClick:()=>
1x("/cabinet/dashboard"),children:n("annual.home")})})})}export{fa 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.