import y from"./BaseForm-191edff1-1782572373740v=1.0.0.js";import{i as E,e as F,j as S,k as _}from"./eventApplyMgmtApi-d35d9842-1782572373740v=1.0.0.js";import{u as L}from"./useFormEdit-e67d5b61-1782572373740v=1.0.0.js";import{a as w}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{E as r}from"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";import{y as c,r as i,m as B,al as C,z as P,I as k,J as A,R as M,u as l,k as d}from"./vendor-866bb149-1782572373740v=1.0.0.js";import"./eleValidate-aae13e4d-1782572373740v=1.0.0.js";import"./usePrint-d2511e6d-1782572373740v=1.0.0.js";import"./keepAlive-0ac97bbd-1782572373740v=1.0.0.js";const R=c({name:"agreementManageEdit"}),V=c({...R,setup(D){const{closeCurrent:m}=L(),f=i(null),u=i({applicableType:"",name:"",content:"",mobileSignatureStatus:"",status:"",agreementId:""}),o=i(!1),n=w(),p=()=>{m()},g=async a=>{o.value=!0;try{let e=E,t="\u66F4\u65B0\u6210\u529F",s=await e(a);s.code==0?(a.isSubmit&&((await F({id:s.data})).code==0?t="\u66F4\u65B0\u5E76\u63D0\u4EA4\u6210\u529F":t="\u66F4\u65B0\u6210\u529F\u4F46\u672A\u63D0\u4EA4"),r({type:"success",message:`${t}!`})):r.warning(s.msg),o.value=!1,m()}catch{o.value=!1}},v=async a=>{let e=await S(a);if(e.code!=0){r.warning(e.msg);return}e.data.eventTime=[e.data.eventStartTime,e.data.eventEndTime],e.data.auditLastSubmitList=await b(e.data.eventProposerId),u.value=e.data},b=async a=>{const e=await _(a);let t=[];return e.code==0&&e.data.length>0&&(t=e.data.slice(1)),t};return B(()=>{n.query.id&&(f.value=n.query.id,v(n.query.id))}),(a,e)=>{const t=C("HZPageLayout");return P(),k(t,{title:l(n).meta.title,isBack:!0},{default:A(()=>[M(y,{value:l(u),"onUpdate:value":e[0]||(e[0]=s=>d(u)?u.value=s:null),loading:l(o),"onUpdate:loading":e[1]||(e[1]=s=>d(o)?o.value=s:null),onCancel:p,onSubmit:g},null,8,["value","loading"])]),_:1},8,["title"])}}});export{V as default};
