import{_ as R}from"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import{B as I}from"./BasicForm-dL_oCSPM.js";import{d as P,c as M}from"./jobPlan-DTKoW_aS.js";import{V as c,bk as B,d as C,c as T,o as j,l as t,w as k,j as y,cZ as O,ac as F}from"./index-9PRMimni.js";import{u as N}from"./useForm-CKmgcynv.js";import{u as S}from"./useModal-CO65vga3.js";B();const{t:n}=c();function V(){return[{field:"planId",hidden:!0},{field:"cancellationReason",component:"NInput",label:n("jobPlan.cancel.cancellationReason"),giProps:{span:3},componentProps:{placeholder:n("jobPlan.cancel.cancellationReason"),type:"textarea",showCount:!0,maxlength:100,autosize:{minRows:3,maxRows:3}},rules:[{required:!0,message:n("jobPlan.cancel.cancellationReasonRequired")}]}]}const Z=C({__name:"index",emits:["refresh"],setup(q,{expose:l,emit:r}){const{t:a}=c(),i=O(),u=r,[m,{submit:d,setFieldsValue:p}]=N({schemas:V(),layout:"horizontal",gridProps:{cols:3}}),[f,{openModal:h,closeModal:b,setSubLoading:s}]=S({title:a("jobPlan.cancel.cancelTitle"),subBtuText:a("common.confirmText"),cancelText:a("common.cancelText"),width:600});async function _(){try{const e=await d();if(!e){s(!1);return}const o=await P({...e});await M({busId:o.busId,busNo:o.busNo,shipId:o.shipId,moduleCode:o.moduleCode,subModuleCode:o.subModuleCode}),i.success(a("jobPlan.cancel.cancelSuccessText")),s(!1),u("refresh"),b()}catch{s(!1)}}async function g({record:e}){h(),await F(),p({planId:e.planId})}return l({handleOpenModal:g}),(e,o)=>{const x=I,w=R;return j(),T(w,{onRegister:t(f),"show-icon":"",type:"warning",onOnOk:_},{default:k(()=>[y(x,{onRegister:t(m),showActionButtonGroup:!1},null,8,["onRegister"])]),_:1},8,["onRegister"])}}});export{Z as _};
