import{d as w,U as C,q as B,v as D,r as _,l as A,C as b,o as j,i as S,e as x,b as R,u as g,m as y,E as k,_ as I}from"./index-8184dd63-1780045603901v=1.0.0.js";import{I as N}from"./IndexPagePro-13c09835-1780045603901v=1.0.0.js";import q from"./AreaEditForm-56359150-1780045603901v=1.0.0.js";import{u as U}from"./useFormEdit-20fecb8c-1780045603901v=1.0.0.js";import{p as $,u as M,g as O}from"./areaSupply-2a8dcd36-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"./eleValidate-6679fb6f-1780045603901v=1.0.0.js";import"./index-7b6cf23d-1780045603901v=1.0.0.js";import"./tabs-7d324d56-1780045603901v=1.0.0.js";const P=w({__name:"edit",setup(T){const{closeCurrent:c,setTitle:V}=U(),r=C(),d=B();D();const l=_(d.query.edit_id),s=_(d.query.report_type),h=A(()=>[`\u586B\u62A5\u5185\u5BB9\uFF1A${s.value==1?r.reporting_year:r.plan_year} \u573A\u5730${s.value==1?"\u5B9E\u9645\u5F00\u653E\u60C5\u51B5":"\u8BA1\u5212\u5F00\u653E\u60C5\u51B5"}`,"\u8BF4\u660E\uFF1A\u514D\u8D39\uFF08\u4F4E\u6536\u8D39\uFF09\u5F00\u653E\u7684\u573A\u5730\u548C\u9879\u76EE\uFF0C\u6307\u8BE5\u573A\u9986\u514D\u8D39\u6216\u4F4E\u6536\u8D39\u5411\u793E\u4F1A\u5F00\u653E\u7684\u8FD0\u52A8\u573A\u5730\u53CA\u9879\u76EE\u540D\u79F0\uFF0C\u6309\u987A\u5E8F\u7F57\u5217\u6240\u6709\u5F00\u653E\u573A\u5730\u53CA\u5BF9\u5E94\u9879\u76EE\u540D\u79F0\uFF0C\u5E76\u586B\u5199\u6BCF\u5929\u5F00\u653E\u65F6\u95F4\u53CA\u65F6\u6BB5"]),u=_({stadium_name:r.stadium_name,name:"",site_type:"",annual_expenditure:"",annual_income:"",subsidy_fund:"",sport_project_ids_list:[],open_date:[],open_start_date:"",open_end_date:"",public_status:1,is_distinguish_holiday:1,daily_list:[{open_situation_type:"2",charge_type_id:"",holiday_type_id:"",daily_open:[],daily_open_start:"",daily_open_end:"",daily_open_hours:"",charging_standard:"",charging_standard_unit:"",down_charging_standard:"",down_charging_standard_unit:"",normal_charging_standard:"",normal_charging_standard_unit:"",showDownCharging:!1,showNormalCharging:!1}],holiday_list:[{open_situation_type:"1",charge_type_id:"",holiday_type_id:"",daily_open:[],daily_open_start:"",daily_open_end:"",daily_open_hours:"",charging_standard:"",charging_standard_unit:"",down_charging_standard:"",down_charging_standard_unit:"",normal_charging_standard:"",normal_charging_standard_unit:"",showDownCharging:!1,showNormalCharging:!1}]}),i=_(!1),m=()=>{c()},f=async e=>{i.value=!0,e.report_type=s.value;try{e.report_type=s.value;let t=$,a="\u65B0\u589E\u6210\u529F";l.value&&(e.site_opening_report_id=l.value,t=M,a="\u66F4\u65B0\u6210\u529F"),(await t(e)).code==200&&(k({type:"success",message:`${a}!`}),setTimeout(()=>{c()},500)),i.value=!1}catch{i.value=!1}},F=()=>{},E=async()=>{let e={site_opening_report_id:l.value},a=(await O(e)).data;v(a)},v=e=>{if(Object.keys(u.value).forEach(t=>{e[t]&&(u.value[t]=e[t])}),e.sport_projects&&e.sport_projects.length&&(u.value.sport_project_ids_list=e.sport_projects),e.open_start_date&&e.open_end_date&&(u.value.open_date=[new Date(e.open_start_date*1e3),new Date(e.open_end_date*1e3)]),e.site_open_situation.length>0){let t=[],a=[];e.site_open_situation.map(n=>{let o={open_situation_type:"2",charge_type_id:n.charge_type_id,holiday_type_id:n.holiday_type_id,daily_open:[n.daily_open_start,n.daily_open_end],daily_open_start:"",daily_open_end:"",daily_open_hours:"",charging_standard:"",charging_standard_unit:"",down_charging_standard:"",down_charging_standard_unit:"",normal_charging_standard:"",normal_charging_standard_unit:"",showDownCharging:!1,showNormalCharging:!1};Object.keys(o).forEach(p=>{n[p]&&(o[p]=n[p])}),n.open_situation_type==1&&a.push(o),n.open_situation_type==2&&t.push(o),t.length>0&&(u.value.daily_list=t),a.length>0&&(u.value.holiday_list=a)})}};return b(()=>{if(d.query.edit_id)E();else{let e=r.stadiumInfo.reporting_year_start_date,t=r.stadiumInfo.reporting_year_end_date;u.value.open_date=[e*1e3,t*1e3]}}),(e,t)=>(j(),S(N,null,{default:x(()=>[R(q,{value:g(u),"onUpdate:value":t[0]||(t[0]=a=>y(u)?u.value=a:null),loading:g(i),"onUpdate:loading":t[1]||(t[1]=a=>y(i)?i.value=a:null),"alert-list":g(h),onCancel:m,onSubmit:f,onImportpre:F},null,8,["value","loading","alert-list"])]),_:1}))}}),ee=I(P,[["__file","D:/desktop/yunNan/vue-area-submit/src/views/stadium/supply/area/edit.vue"]]);export{ee as default};
