import{_ as k}from"./ButtonDefault-CzWpVlv6.js";import{_ as b}from"./BlockSelectContract-DnFSm1Pw.js";import{u as y}from"./global-BK91p1BE.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as d,l as C,D as E,o as T,c as I,a as s,b as c}from"./index-Bb2UEb_P.js";import"./index-Dax_IkAt.js";import"./multiselect-Bk-p1X5E.js";const S={class:"modal__body"},w={class:"modal__input-row"},B={class:"modal__input-row"},D={__name:"ModalWindowTakeOrder",props:{data:{type:Object,default:()=>{}}},emits:["modalClose"],setup(_,{emit:m}){const i=_,u=m,t=d(""),p=d(i.data.OrdersTransferID||""),f=y();async function n(){const o={ContractID:t.value,OrdersTransferID:p.value.OrdersTransferID};try{const{result:e,error:r}=await f.OrdersTransfer(o);e==="SUCCESS"?u("modalClose"):console.error("Error:",r)}catch(e){console.error("Error:",e.message)}}const a=o=>{o.key==="Enter"&&n()};return C(()=>{document.addEventListener("keyup",a)}),E(()=>{document.removeEventListener("keyup",a)}),(o,e)=>{const r=b,v=k;return T(),I("div",S,[e[2]||(e[2]=s("div",{class:"list-item__title"},"Перенос услуги",-1)),s("div",w,[c(r,{modelValue:t.value,"onUpdate:modelValue":e[0]||(e[0]=l=>t.value=l)},null,8,["modelValue"])]),s("div",B,[c(v,{class:"modal__button",label:"Сохранить",onClick:e[1]||(e[1]=l=>n())})])])}}},W=O(D,[["__scopeId","data-v-8ef1f77e"]]);export{W as default};
