import{d as y,U as A,q as B,v as C,r as a,l as b,C as D,o as h,i as z,e as w,b as R,u as p,m as c,E as x,_ as k}from"./index-8184dd63-1780045603901v=1.0.0.js";import{I as q}from"./IndexPagePro-13c09835-1780045603901v=1.0.0.js";import S from"./OrganizingEditForm-5cf102d0-1780045603901v=1.0.0.js";import{u as U}from"./useFormEdit-20fecb8c-1780045603901v=1.0.0.js";import{v as G,w as I,d as $}from"./areaSupply-2a8dcd36-1780045603901v=1.0.0.js";import"./Document-de2d7a80-1780045603901v=1.0.0.js";import"./eleValidate-6679fb6f-1780045603901v=1.0.0.js";import"./upload-cfe11744-1780045603901v=1.0.0.js";import"./useGetTagHook-d138769d-1780045603901v=1.0.0.js";import"./tagManage-1b66d64b-1780045603901v=1.0.0.js";import"./reportingYear-23c6c3e7-1780045603901v=1.0.0.js";import"./tabs-7d324d56-1780045603901v=1.0.0.js";const M=y({__name:"edit",setup(N){const{closeCurrent:m}=U(),n=A(),i=B();C();const _=a(i.query.edit_id),l=a(i.query.report_type),d=b(()=>[`\u586B\u62A5\u5185\u5BB9\uFF1A${l.value==1?n.reporting_year:n.plan_year} \u56E2\u961F\u7EC4\u7EC7${l.value==1?"\u5F00\u653E\u8BA1\u5212":"\u5F00\u653E\u5B9E\u9645\u60C5\u51B5"}`,"\u8BF4\u660E\uFF1A\u514D\u8D39\u6216\u4F4E\u6536\u8D39\u4F7F\u7528\u4F53\u80B2\u573A\u9986\u573A\u5730\u4F5C\u4E3A\u56FA\u5B9A\u8FD0\u52A8\u573A\u6240\u7684\u7B7E\u7EA6\u516C\u76CA\u6027\u9752\u5C11\u5E74\u4F53\u80B2\u4FF1\u4E50\u90E8\u3001\u793E\u4F1A\u56E2\u4F53\u3001\u57FA\u5C42\u6587\u5316\u4F53\u80B2\u7EC4\u7EC7\u540D\u79F0\u53CA\u53D7\u76CA\u4EBA\u6570"]),o=a({stadium_name:n.stadium_name,group_organizationl_name:"",site_use_time:[],site_use_start_time:"",site_use_end_time:"",benefit_number:"",group_organization_address:"",group_organization_contact:"",group_organization_contact_phone:"",charge_type_id:"",charging_standard:"",contract_document_list:[],contract_document:"",report_type:""}),r=a(!1),f=()=>{m()},g=async e=>{r.value=!0,e.report_type=l.value;try{let t=G,u="\u65B0\u589E\u6210\u529F";_.value&&(e.group_organization_report_id=_.value,t=I,u="\u66F4\u65B0\u6210\u529F"),(await t(e)).code==200&&(x({type:"success",message:`${u}!`}),setTimeout(()=>{m()},500)),r.value=!1}catch{r.value=!1}},F=()=>{},E=async()=>{let e={group_organization_report_id:_.value},u=(await $(e)).data;v(u)},v=e=>{Object.keys(o.value).forEach(u=>{e[u]&&(o.value[u]=e[u])}),e.site_use_start_time&&e.site_use_end_time&&(o.value.site_use_time=[new Date(e.site_use_start_time*1e3),new Date(e.site_use_end_time*1e3)]);let t=[];if(e.sport_bonus_money_doc_url&&t.push({name:e.sport_bonus_money_doc_name,file_url:e.sport_bonus_money_doc_url}),e.contract_document.length>0){let u=[];e.contract_document.map(s=>{u.push({url:s.full_url,file_path:s.url,name:s.name})}),o.value.contract_document_list=u}};return D(()=>{i.query.edit_id&&E()}),(e,t)=>(h(),z(q,null,{default:w(()=>[R(S,{value:p(o),"onUpdate:value":t[0]||(t[0]=u=>c(o)?o.value=u:null),loading:p(r),"onUpdate:loading":t[1]||(t[1]=u=>c(r)?r.value=u:null),"alert-list":p(d),onCancel:f,onSubmit:g,onImportpre:F},null,8,["value","loading","alert-list"])]),_:1}))}}),Y=k(M,[["__file","D:/desktop/yunNan/vue-area-submit/src/views/stadium/supply/organizing/edit.vue"]]);export{Y as default};
