import b from"./BaseForm-0c5de720-1785478469326v=1.0.0.js";import{a as y,g as B}from"./billManageApi-d9ceb231-1785478469326v=1.0.0.js";import{u as _}from"./useFormEdit-c3e1ba91-1785478469326v=1.0.0.js";import{E as o}from"./eleVendor-bc05bc4d-1785478469326v=1.0.0.js";import{x as f,r as u,al as C,y as E,H as w,I as F,Q as h,u as c,l as d}from"./vendor-46662d77-1785478469326v=1.0.0.js";import"./index-5a47c360-1785478469326v=1.0.0.js";import"./useGetCollage-5696f774-1785478469326v=1.0.0.js";import"./keepAlive-4a384a77-1785478469326v=1.0.0.js";const I=f({name:"billManageAdd"}),U=f({...I,setup(T){const{closeCurrent:n}=_(),r=u({billType:"",name:"",semester:"",collegeIds:[],schoolUserTypes:[],billPushStatus:"",pushStartTime:"",pushEndTime:"",failedCause:"",updater:"",updateTime:"",billId:""}),s=u(!1),p=()=>{n()},g=u(""),i=async l=>{s.value=!0;try{let a=y,t="\u65B0\u589E\u6210\u529F",e=await a(l);return e.code==0?(o({type:"success",message:`${t}!`}),g.value=e.data,r.value.billId=e.data,"ok"):(o.warning(e.msg),"error")}catch(a){console.error("submit",{error:a}),s.value=!1}},v=async l=>{if(await i(l)!="error"){s.value=!0;try{let t=B,e="\u8D26\u5355\u751F\u6210\u4E2D",m=await t({id:r.value.billId});m.code==0?(o({type:"success",message:`${e}!`}),n()):o.warning(m.msg),s.value=!1}catch(t){console.error({error:t}),s.value=!1}}};return(l,a)=>{const t=C("HZPageLayout");return E(),w(t,{isBack:!0,title:"\u65B0\u589E\u4F53\u80B2\u8D26\u5355"},{default:F(()=>[h(b,{value:c(r),"onUpdate:value":a[0]||(a[0]=e=>d(r)?r.value=e:null),loading:c(s),"onUpdate:loading":a[1]||(a[1]=e=>d(s)?s.value=e:null),onCancel:p,onSubmit:i,onGenerate:v},null,8,["value","loading"])]),_:1})}}});export{U as default};
