import{d as F,q as y,U as E,r as s,l as D,C as b,o as h,i as j,e as A,b as C,u as _,m as c,E as w,_ as x}from"./index-8184dd63-1780045603901v=1.0.0.js";import{I as R}from"./IndexPagePro-13c09835-1780045603901v=1.0.0.js";import T from"./TrainEditForm-2b83f47e-1780045603901v=1.0.0.js";import{u as k}from"./useFormEdit-20fecb8c-1780045603901v=1.0.0.js";import{B as q,C as S,i as U}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"./index-7b6cf23d-1780045603901v=1.0.0.js";import"./tagManage-1b66d64b-1780045603901v=1.0.0.js";import"./useGetTagHook-d138769d-1780045603901v=1.0.0.js";import"./reportingYear-23c6c3e7-1780045603901v=1.0.0.js";import"./common-5ba50e89-1780045603901v=1.0.0.js";import"./tabs-7d324d56-1780045603901v=1.0.0.js";const I=F({__name:"edit",setup(P){const{closeCurrent:p}=k(),i=y(),o=E(),n=s(i.query.report_type),m=D(()=>[`\u586B\u62A5\u5185\u5BB9\uFF1A${n.value==1?o.reporting_year:o.plan_year} \u4F53\u80B2\u57F9\u8BAD${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"]),l=s(i.query.edit_id),u=s({stadium_name:o.stadium_name,site_type:"",train_name:"",sport_project_ids_list:[],sport_project_ids:"",train_time:[],train_start_time:"",train_end_time:"",train_venue:"",service_object_id:"",service_object:"",train_join_person_time:"",public_status:1,charge_type_id:"",charging_standard:"",contract_document_list:[],contract_document:"",train_cover_list:[],train_cover:"",report_type:""}),a=s(!1),d=()=>{p()},f=async t=>{a.value=!0,t.report_type=n.value;try{let e=q,r="\u65B0\u589E\u6210\u529F";l.value&&(t.sports_train_report_id=l.value,e=S,r="\u66F4\u65B0\u6210\u529F"),(await e(t)).code==200&&(w({type:"success",message:`${r}!`}),setTimeout(()=>{p()},500)),a.value=!1}catch{a.value=!1}},v=()=>{},B=async()=>{let t={sports_train_report_id:l.value},r=(await U(t)).data;g(r)},g=t=>{if(Object.keys(u.value).forEach(e=>{t[e]&&(u.value[e]=t[e])}),t.train_start_time&&t.train_end_time&&(u.value.train_time=[new Date(t.train_start_time*1e3),new Date(t.train_end_time*1e3)]),t.sport_projects&&t.sport_projects.length&&(u.value.sport_project_ids_list=t.sport_projects),t.train_cover_url.length>0){let e=[];t.train_cover_url.map(r=>{e.push({url:r.full_url,imgPath:r.url,name:r.url})}),u.value.train_cover_list=e}if(t.contract_document.length>0){let e=[];t.contract_document.map(r=>{e.push({url:r.full_url,file_path:r.url,name:r.name})}),u.value.contract_document_list=e}};return b(()=>{i.query.edit_id&&B()}),(t,e)=>(h(),j(R,null,{default:A(()=>[C(T,{value:_(u),"onUpdate:value":e[0]||(e[0]=r=>c(u)?u.value=r:null),loading:_(a),"onUpdate:loading":e[1]||(e[1]=r=>c(a)?a.value=r:null),"alert-list":_(m),onCancel:d,onSubmit:f,onImportpre:v},null,8,["value","loading","alert-list"])]),_:1}))}}),tt=x(I,[["__file","D:/desktop/yunNan/vue-area-submit/src/views/stadium/supply/train/edit.vue"]]);export{tt as default};
