import{d as h,U as F,q as g,v as y,r as a,l as A,C as b,o as C,i as D,e as S,b as w,u as _,m,E as R,_ as x}from"./index-8184dd63-1780045603901v=1.0.0.js";import{I as k}from"./IndexPagePro-13c09835-1780045603901v=1.0.0.js";import q from"./SchoolEditForm-de005152-1780045603901v=1.0.0.js";import{u as U}from"./useFormEdit-20fecb8c-1780045603901v=1.0.0.js";import{y as I,z as $,f as M}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 N=h({__name:"edit",setup(P){const{closeCurrent:c,setTitle:T}=U(),r=F(),i=g();y();const n=a(i.query.edit_id),l=a(i.query.report_type),p=A(()=>[`\u586B\u62A5\u5185\u5BB9\uFF1A${l.value==1?r.reporting_year:r.plan_year} \u5B66\u6821${l.value==1?"\u6536\u76CA\u5B9E\u9645\u60C5\u51B5":"\u6536\u76CA\u8BA1\u5212"}`,"\u8BF4\u660E\uFF1A\u6559\u5B66\u70B9,\u6307\u4E3A\u5F25\u8865\u5B66\u6821\u4F53\u80B2\u6559\u5B66\u8BBE\u65BD\u4E0D\u8DB3,\u6309\u7167\u5B66\u6821\u4F53\u80B2\u6559\u5B66\u5927\u7EB2,\u5229\u7528\u516C\u5171\u4F53\u80B2\u573A\u9986\u5F00\u5C55\u5B66\u751F\u4F53\u80B2\u6559\u5B66\u5DE5\u4F5C\u7684\u573A\u5730\u9879\u76EE\u3002\u7B7E\u7EA6\u4E00\u6240\u5B66\u6821\u4E00\u4E2A\u8FD0\u52A8\u9879\u76EE\u4E3A1\u4E2A\u6559\u5B66\u70B9,\u4EE5\u6B64\u7C7B\u63A8"]),s=a({stadium_name:r.stadium_name,school_name:"",teaching_site:"",site_use_time:[],site_use_start_time:"",site_use_end_time:"",benefit_number:"",school_address:"",school_teaching_site_contact:"",school_teaching_site_contact_phone:"",charge_type_id:"",charging_standard:"",contract_document_list:[],contract_document:"",report_type:1}),o=a(!1),d=()=>{c()},B=async u=>{o.value=!0,u.report_type=l.value;try{let e=I,t="\u65B0\u589E\u6210\u529F";n.value&&(u.school_benefit_report_id=n.value,e=$,t="\u66F4\u65B0\u6210\u529F"),(await e(u)).code==200&&(R({type:"success",message:`${t}!`}),setTimeout(()=>{c()},500)),o.value=!1}catch{o.value=!1}},f=()=>{},E=async()=>{let u={school_benefit_report_id:n.value},t=(await M(u)).data;v(t)},v=u=>{if(Object.keys(s.value).forEach(e=>{u[e]&&(s.value[e]=u[e])}),u.site_use_start_time&&u.site_use_end_time&&(s.value.site_use_time=[new Date(u.site_use_start_time*1e3),new Date(u.site_use_end_time*1e3)]),u.contract_document.length>0){let e=[];u.contract_document.map(t=>{e.push({url:t.full_url,file_path:t.url,name:t.name})}),s.value.contract_document_list=e}};return b(()=>{i.query.edit_id&&E()}),(u,e)=>(C(),D(k,null,{default:S(()=>[w(q,{value:_(s),"onUpdate:value":e[0]||(e[0]=t=>m(s)?s.value=t:null),loading:_(o),"onUpdate:loading":e[1]||(e[1]=t=>m(o)?o.value=t:null),"alert-list":_(p),onCancel:d,onSubmit:B,onImportpre:f},null,8,["value","loading","alert-list"])]),_:1}))}}),Z=x(N,[["__file","D:/desktop/yunNan/vue-area-submit/src/views/stadium/supply/school/edit.vue"]]);export{Z as default};
