|
- import{E as P,a as g,y as ne,r as s,o as re,b as r,c as v,d as h,f as l,h as t,F as A,H as ie,u as d,L as se,e as u,i as m,t as de,k as ue,Q as ce,s as pe}from"./index-dd5fae99.js";import{g as me,d as fe,a as _e}from"./index-b6aa4cff.js";import{h as be,f as ye,b as N,c as Te,e as ge}from"./uploadAction-3962500e.js";import{u as ve}from"./useExportExc-f315048b.js";const je={class:"flex"},ke={class:"flex justify-between"},we=["onClick"],Ye=["onClick"],Fe={class:"el-upload__tip"},Ve={class:"dialog-footer"},xe=ue({name:"constructionPlanDeclare"}),Ne=Object.assign(xe,{setup(Ce){const{projectTypeOptions:U}=P.dictStore.globalDicts||{},{proxy:S}=pe(),a=g({projectName:"",projectType:"",projectYear:null,startTime:"",endTime:"",createTimeArr:[]}),R=ne(),j=s(),k=s([]),f=async(n=j.value.pageParams)=>{var y,i;const e=await me({...n,...a,startTime:(y=a.createTimeArr)!=null&&y.length?a.createTimeArr[0]:void 0,endTime:(i=a.createTimeArr)!=null&&i.length?a.createTimeArr[0]:void 0,createTimeArr:void 0});k.value=e.data.records,w.value=e.data.total},$=g([{label:"序号",type:"index",width:"80"},{label:"项目名称",key:"projectName",prop:"projectName",minWidth:"200",showOverflowTooltip:!0},{label:"项目类型",key:"projectTypeName",prop:"projectTypeName",width:80},{label:"申报金额(万元)",key:"declaredAmount",prop:"declaredAmount",width:"200"},{label:"预算年度",key:"projectYear",prop:"projectYear",width:"100"},{label:"创建时间",key:"createOn",prop:"createOn",width:"250"},{label:"操作",slot:"action",width:"140",fixed:"right"}]),E=g({constructionPlanFile:[{required:!0,message:"请上传建设方案",trigger:"blur"}]}),w=s(2),H=n=>{R.push({name:"projectDeclareDetail",query:{id:n.id}})},I=()=>{f()},L=()=>{a.projectName=null,a.projectType=null,a.projectYear=null,a.startTime=null,a.endTime=null,a.createTimeArr=null,f()},O=s(),M=n=>{O.value=n},b=s(!1),B=n=>{n()},q=P.dictStore.uploadUrl,c=g({constructionPlanFile:[]}),Y=s(),z=s(),F=s(),G=n=>{Y.value.clearFiles();const e=n[0];e.uid=ce(),Y.value.handleStart(e)},J=s(),Q=async n=>{n&&n.validate(e=>{e?W():console.log("error submit!")})},W=async()=>{await fe({projectInfo:{id:J.value,constructionPlanFile:JSON.stringify(c.constructionPlanFile&&c.constructionPlanFile.map(n=>({fileId:n.response.data.id,fileName:n.response.data.originalFileName}))[0])}}),b.value=!1,c.constructionPlanFile=[],S.$message.success("提交成功"),f()},{exportLoading:K,exportData:X}=ve(),Z=()=>{X(()=>{var n,e;return _e(3,{...a,year:a.year*1,startTime:(n=a.createTimeArr)!=null&&n.length?a.createTimeArr[0]:void 0,endTime:(e=a.createTimeArr)!=null&&e.length?a.createTimeArr[0]:void 0,createTimeArr:void 0})})};return re(async()=>{f()}),(n,e)=>{const y=r("el-input"),i=r("el-form-item"),_=r("el-col"),ee=r("el-option"),le=r("el-select"),V=r("el-date-picker"),x=r("el-row"),p=r("el-button"),C=r("el-form"),D=r("el-card"),te=r("table-list"),ae=r("el-upload"),oe=r("el-dialog");return v(),h(A,null,[l(D,{class:"w-full search"},{default:t(()=>[l(C,{model:a,size:"small","label-suffix":":"},{default:t(()=>[l(x,{gutter:16,class:"mb-16"},{default:t(()=>[l(_,{span:8},{default:t(()=>[l(i,{label:"项目名称"},{default:t(()=>[l(y,{modelValue:a.projectName,"onUpdate:modelValue":e[0]||(e[0]=o=>a.projectName=o),maxlength:"50",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),l(_,{span:8},{default:t(()=>[l(i,{label:"项目类型"},{default:t(()=>[l(le,{modelValue:a.projectType,"onUpdate:modelValue":e[1]||(e[1]=o=>a.projectType=o),placeholder:"全部",class:"w-full"},{default:t(()=>[(v(!0),h(A,null,ie(d(U),(o,T)=>(v(),se(ee,{key:T,label:o,value:T},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(_,{span:8},{default:t(()=>[l(i,{label:"预算年度"},{default:t(()=>[l(V,{modelValue:a.projectYear,"onUpdate:modelValue":e[2]||(e[2]=o=>a.projectYear=o),type:"year",placeholder:"请选择",format:"YYYY","value-format":"YYYY"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(x,{gutter:16},{default:t(()=>[l(_,{span:10},{default:t(()=>[l(i,{label:"创建时间"},{default:t(()=>[l(V,{modelValue:a.createTimeArr,"onUpdate:modelValue":e[3]||(e[3]=o=>a.createTimeArr=o),type:"datetimerange","range-separator":"-","start-placeholder":"开始时间","end-placeholder":"结束时间",format:"YYYY-MM-DD HH:mm","value-format":"YYYY-MM-DD HH:mm"},null,8,["modelValue"])]),_:1})]),_:1}),l(_,{span:14},{default:t(()=>[l(i,{class:"btn"},{default:t(()=>[u("div",je,[l(p,{type:"primary",onClick:I},{default:t(()=>e[8]||(e[8]=[m("查询")])),_:1}),l(p,{onClick:L},{default:t(()=>e[9]||(e[9]=[m("重置")])),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),l(D,{class:"w-full mt-8"},{header:t(()=>[u("div",ke,[e[11]||(e[11]=u("span",null,"待申报的项目",-1)),u("div",null,[l(p,{type:"primary",plain:"",size:"small",loading:d(K),onClick:Z},{default:t(()=>e[10]||(e[10]=[m("导出")])),_:1},8,["loading"])])])]),default:t(()=>[l(te,{ref_key:"tableListRef",ref:j,column:$,data:k.value,total:w.value,onHandleTable:M,onGetTableData:f},{action:t(({scope:o})=>[u("a",{onClick:T=>n.$router.push({name:"declarePlan",query:{id:o.row.id}})},"申报方案",8,we),u("a",{onClick:T=>H(o.row)},"详情",8,Ye)]),_:1},8,["column","data","total"])]),_:1}),l(oe,{modelValue:b.value,"onUpdate:modelValue":e[7]||(e[7]=o=>b.value=o),title:"申报建设方案",width:"35%","before-close":B},{footer:t(()=>[u("span",Ve,[l(p,{type:"primary",onClick:e[5]||(e[5]=o=>Q(F.value))},{default:t(()=>e[13]||(e[13]=[m(" 提交 ")])),_:1}),l(p,{onClick:e[6]||(e[6]=o=>b.value=!1)},{default:t(()=>e[14]||(e[14]=[m("关闭")])),_:1})])]),default:t(()=>[l(C,{ref_key:"constructionPlanRef",ref:F,model:c,rules:E,"label-position":"right","label-width":"auto","status-icon":""},{default:t(()=>[l(i,{label:"建设方案:",prop:"constructionPlanFile"},{default:t(()=>[l(ae,{ref_key:"planUploadRef",ref:z,"file-list":c.constructionPlanFile,"onUpdate:fileList":e[4]||(e[4]=o=>c.constructionPlanFile=o),action:d(q),limit:1,"on-exceed":G,"on-success":o=>d(be)(o,c.constructionPlanFile,!0),"before-upload":o=>d(ye)(o,{types:d(N)}),accept:d(N).map(o=>`.${o}`).join(","),"on-preview":d(Te)},{tip:t(()=>[u("div",Fe," 支持"+de(d(ge))+"文件 ",1)]),default:t(()=>[l(p,{plain:"",type:"primary"},{default:t(()=>e[12]||(e[12]=[m("选择文件")])),_:1})]),_:1},8,["file-list","action","on-success","before-upload","accept","on-preview"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])],64)}}});export{Ne as default};
|