import w from"./BaseForm-0c5de720-1785478469326v=1.0.0.js";import{u as C,b as I,g as x}from"./billManageApi-d9ceb231-1785478469326v=1.0.0.js";import{u as E}from"./useFormEdit-c3e1ba91-1785478469326v=1.0.0.js";import{b as h}from"./index-5a47c360-1785478469326v=1.0.0.js";import{E as u}from"./eleVendor-bc05bc4d-1785478469326v=1.0.0.js";import{x as y,r as i,k,al as M,y as T,H as U,I as q,Q as D,u as g,l as p}from"./vendor-46662d77-1785478469326v=1.0.0.js";import"./useGetCollage-5696f774-1785478469326v=1.0.0.js";import"./keepAlive-4a384a77-1785478469326v=1.0.0.js";const H=y({name:"exerciseConfEdit"}),V=y({...H,setup(L){const{closeCurrent:c}=E(),v=i(null),l=i({exerciseType:[],fullNum:"",schoolYearId:"",semester:"",updateTime:"",updater:"",billId:""}),s=i(!1),B=()=>{c()},m=async r=>{s.value=!0;try{let e=C,t="\u66F4\u65B0\u6210\u529F",a=await e(r);return a.code==0?(u({type:"success",message:`${t}!`}),"ok"):(u.warning(a.msg),"error")}catch{s.value=!1}finally{s.value=!1}},n=h(),b=async r=>{var t,a,o,d,f;let e=await I(r);if(e.code!=0){u.warning(e.msg);return}e.data.schoolUserTypes=(t=e.data)==null?void 0:t.schoolUserTypes.split(","),((o=(a=e.data)==null?void 0:a.collegeIds)==null?void 0:o.length)>0&&(e.data.collegeIds=(f=(d=e.data)==null?void 0:d.collegeIds)==null?void 0:f.split(",").map(_=>Number(_))),e.data.semester=e.data.semester?String(e.data.semester):e.data.semester,l.value=e.data},F=async r=>{if(await m(r)!="error"){s.value=!0;try{let t=x,a="\u8D26\u5355\u751F\u6210\u4E2D",o=await t({id:l.value.billId});o.code==0?(u({type:"success",message:`${a}!`}),c()):u.warning(o.msg),s.value=!1}catch(t){console.error({error:t}),s.value=!1}finally{s.value=!1}}};return k(()=>{n.query.id&&(v.value=n.query.id,b(n.query.id))}),(r,e)=>{const t=M("HZPageLayout");return T(),U(t,{isBack:!0,title:"\u7F16\u8F91\u8BFE\u5916\u953B\u70BC\u8BB0\u5F55"},{default:q(()=>[D(w,{value:g(l),"onUpdate:value":e[0]||(e[0]=a=>p(l)?l.value=a:null),loading:g(s),"onUpdate:loading":e[1]||(e[1]=a=>p(s)?s.value=a:null),onCancel:B,onSubmit:m,onGenerate:F},null,8,["value","loading"])]),_:1})}}});export{V as default};
