import{d as y,U as F,q as b,r as _,l as D,C as h,o as j,i as A,e as C,b as w,u as p,m as c,E as x,_ as R}from"./index-8184dd63-1780045603901v=1.0.0.js";import{I as k}from"./IndexPagePro-13c09835-1780045603901v=1.0.0.js";import q from"./EventEditForm-2c8ad750-1780045603901v=1.0.0.js";import{u as S}from"./useFormEdit-20fecb8c-1780045603901v=1.0.0.js";import{r as U,s as I,b as P}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"./Imgs-6059d7c6-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"./index-7b6cf23d-1780045603901v=1.0.0.js";import"./common-5ba50e89-1780045603901v=1.0.0.js";import"./tabs-7d324d56-1780045603901v=1.0.0.js";const $=y({__name:"edit",setup(M){const{closeCurrent:m}=S(),l=F(),a=b(),n=_(a.query.report_type),v=D(()=>[`\u586B\u62A5\u5185\u5BB9\uFF1A${n.value==1?l.reporting_year:l.plan_year} \u4E3E\u529E\u4F53\u80B2\u8D5B\u4E8B${n.value==1?"\u5B9E\u9645\u60C5\u51B5":"\u8BA1\u5212\u60C5\u51B5"}`,"\u8BF4\u660E\uFF1A\u5728\u4F53\u80B2\u573A\u9986\u6838\u5FC3\u533A\u4E3E\u529E\u514D\u8D39\u6216\u4F4E\u6536\u8D39\u4F53\u80B2\u8D5B\u4E8B\u6D3B\u52A8\u540D\u79F0\u548C\u53C2\u52A0\u4EBA\u6B21"]),i=_(a.query.edit_id),r=_({stadium_name:l.stadium_name,site_type:"",event_name:"",level:"",sport_project_ids_list:[],sport_project_ids:"",event_time:[],event_start_time:"",event_end_time:"",event_venue:"",service_object_id:"",event_join_range:"",event_join_person_time:"",public_status:1,charge_type_id:"",charging_standard:"",contract_document:"",contract_document_list:[],event_cover:"",event_cover_list:[],report_type:"",name:""}),s=_(!1),d=()=>{m()},f=async e=>{s.value=!0,e.report_type=n.value;try{e.report_type=n.value;let u=U,t="\u65B0\u589E\u6210\u529F";i.value&&(e.sports_event_report_id=i.value,u=I,t="\u66F4\u65B0\u6210\u529F"),(await u(e)).code==200&&(x({type:"success",message:`${t}!`}),setTimeout(()=>{m()},500)),s.value=!1}catch{s.value=!1}},B=()=>{},E=async()=>{let e={sports_event_report_id:i.value},t=(await P(e)).data;g(t)},g=e=>{Object.keys(r.value).forEach(t=>{e[t]&&(r.value[t]=e[t])}),e.event_start_time&&e.event_end_time&&(r.value.event_time=[new Date(e.event_start_time*1e3),new Date(e.event_end_time*1e3)]);let u=[];if(e.sport_bonus_money_doc_url&&u.push({name:e.sport_bonus_money_doc_name,file_url:e.sport_bonus_money_doc_url}),e.event_cover_url.length>0){let t=[];e.event_cover_url.map(o=>{t.push({url:o.full_url,imgPath:o.url,name:o.url})}),r.value.event_cover_list=t}if(e.contract_document.length>0){let t=[];e.contract_document.map(o=>{t.push({url:o.full_url,file_path:o.url,name:o.name})}),r.value.contract_document_list=t}e.sport_projects&&e.sport_projects.length&&(r.value.sport_project_ids_list=e.sport_projects)};return h(()=>{a.query.edit_id&&E()}),(e,u)=>(j(),A(k,null,{default:C(()=>[w(q,{value:p(r),"onUpdate:value":u[0]||(u[0]=t=>c(r)?r.value=t:null),loading:p(s),"onUpdate:loading":u[1]||(u[1]=t=>c(s)?s.value=t:null),"alert-list":p(v),onCancel:d,onSubmit:f,onImportpre:B},null,8,["value","loading","alert-list"])]),_:1}))}}),ee=R($,[["__file","D:/desktop/yunNan/vue-area-submit/src/views/stadium/supply/event/edit.vue"]]);export{ee as default};
