|
- import{d as ne,D as A,b as T,A as re,r as s,o as ie,c as r,e as v,f as C,h as e,i as l,F as P,J as se,u as c,I as ce,g as d,j as m,t as de,Y as ue,x as pe}from"./index.ac8ca1e3.js";import{g as me,d as fe,a as _e}from"./index.1a26ded7.js";import{h as be,f as ye,c as N,b as ge,e as Te}from"./uploadAction.b85e4dbe.js";import{u as ve}from"./useExportExc.f81cb4a1.js";const he={class:"flex"},je={class:"flex justify-between"},we=d("span",null,"\u5F85\u7533\u62A5\u7684\u9879\u76EE",-1),ke=["onClick"],Ye=["onClick"],Fe={class:"el-upload__tip"},Ve={class:"dialog-footer"},xe=ne({name:"constructionPlanDeclare"}),Ue=Object.assign(xe,{setup(De){const{projectTypeOptions:U}=A.dictStore.globalDicts||{},{proxy:S}=pe(),a=T({projectName:"",projectType:"",projectYear:null,startTime:"",endTime:"",createTimeArr:[]}),R=re(),h=s(),j=s([]),f=async(n=h.value.pageParams)=>{var y,i;const t=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});j.value=t.data.records,w.value=t.data.total},I=T([{label:"\u5E8F\u53F7",type:"index",width:"80"},{label:"\u9879\u76EE\u540D\u79F0",key:"projectName",prop:"projectName",minWidth:"200",showOverflowTooltip:!0},{label:"\u9879\u76EE\u7C7B\u578B",key:"projectTypeName",prop:"projectTypeName",width:80},{label:"\u7533\u62A5\u91D1\u989D(\u4E07\u5143)",key:"declaredAmount",prop:"declaredAmount",width:"200"},{label:"\u9884\u7B97\u5E74\u5EA6",key:"projectYear",prop:"projectYear",width:"100"},{label:"\u521B\u5EFA\u65F6\u95F4",key:"createOn",prop:"createOn",width:"250"},{label:"\u64CD\u4F5C",slot:"action",width:"140",fixed:"right"}]),$=T({constructionPlanFile:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u5EFA\u8BBE\u65B9\u6848",trigger:"blur"}]}),w=s(2),O=n=>{R.push({name:"projectDeclareDetail",query:{id:n.id}})},E=()=>{f()},H=()=>{a.projectName=null,a.projectType=null,a.projectYear=null,a.startTime=null,a.endTime=null,a.createTimeArr=null,f()},L=s(),M=n=>{L.value=n},b=s(!1),B=n=>{n()},q=A.dictStore.uploadUrl,u=T({constructionPlanFile:[]}),k=s(),z=s(),Y=s(),J=n=>{k.value.clearFiles();const t=n[0];t.uid=ue(),k.value.handleStart(t)},G=s(),W=async n=>{!n||n.validate(t=>{t?K():console.log("error submit!")})},K=async()=>{await fe({projectInfo:{id:G.value,constructionPlanFile:JSON.stringify(u.constructionPlanFile&&u.constructionPlanFile.map(n=>({fileId:n.response.data.id,fileName:n.response.data.originalFileName}))[0])}}),b.value=!1,u.constructionPlanFile=[],S.$message.success("\u63D0\u4EA4\u6210\u529F"),f()},{exportLoading:Q,exportData:X}=ve(),Z=()=>{X(()=>{var n,t;return _e(3,{...a,year:a.year*1,startTime:(n=a.createTimeArr)!=null&&n.length?a.createTimeArr[0]:void 0,endTime:(t=a.createTimeArr)!=null&&t.length?a.createTimeArr[0]:void 0,createTimeArr:void 0})})};return ie(async()=>{f()}),(n,t)=>{const y=r("el-input"),i=r("el-form-item"),_=r("el-col"),ee=r("el-option"),le=r("el-select"),F=r("el-date-picker"),V=r("el-row"),p=r("el-button"),x=r("el-form"),D=r("el-card"),te=r("table-list"),ae=r("el-upload"),oe=r("el-dialog");return v(),C(P,null,[e(D,{class:"w-full search"},{default:l(()=>[e(x,{model:a,size:"small","label-suffix":":"},{default:l(()=>[e(V,{gutter:16,class:"mb-16"},{default:l(()=>[e(_,{span:8},{default:l(()=>[e(i,{label:"\u9879\u76EE\u540D\u79F0"},{default:l(()=>[e(y,{modelValue:a.projectName,"onUpdate:modelValue":t[0]||(t[0]=o=>a.projectName=o),maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(_,{span:8},{default:l(()=>[e(i,{label:"\u9879\u76EE\u7C7B\u578B"},{default:l(()=>[e(le,{modelValue:a.projectType,"onUpdate:modelValue":t[1]||(t[1]=o=>a.projectType=o),placeholder:"\u5168\u90E8",class:"w-full"},{default:l(()=>[(v(!0),C(P,null,se(c(U),(o,g)=>(v(),ce(ee,{key:g,label:o,value:g},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(_,{span:8},{default:l(()=>[e(i,{label:"\u9884\u7B97\u5E74\u5EA6"},{default:l(()=>[e(F,{modelValue:a.projectYear,"onUpdate:modelValue":t[2]||(t[2]=o=>a.projectYear=o),type:"year",placeholder:"\u8BF7\u9009\u62E9",format:"YYYY","value-format":"YYYY"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(V,{gutter:16},{default:l(()=>[e(_,{span:10},{default:l(()=>[e(i,{label:"\u521B\u5EFA\u65F6\u95F4"},{default:l(()=>[e(F,{modelValue:a.createTimeArr,"onUpdate:modelValue":t[3]||(t[3]=o=>a.createTimeArr=o),type:"datetimerange","range-separator":"-","start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4",format:"YYYY-MM-DD HH:mm","value-format":"YYYY-MM-DD HH:mm"},null,8,["modelValue"])]),_:1})]),_:1}),e(_,{span:14},{default:l(()=>[e(i,{class:"btn"},{default:l(()=>[d("div",he,[e(p,{type:"primary",onClick:E},{default:l(()=>[m("\u67E5\u8BE2")]),_:1}),e(p,{onClick:H},{default:l(()=>[m("\u91CD\u7F6E")]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(D,{class:"w-full mt-8"},{header:l(()=>[d("div",je,[we,d("div",null,[e(p,{type:"primary",plain:"",size:"small",loading:c(Q),onClick:Z},{default:l(()=>[m("\u5BFC\u51FA")]),_:1},8,["loading"])])])]),default:l(()=>[e(te,{ref_key:"tableListRef",ref:h,column:I,data:j.value,total:w.value,onHandleTable:M,onGetTableData:f},{action:l(({scope:o})=>[d("a",{onClick:g=>n.$router.push({name:"declarePlan",query:{id:o.row.id}})},"\u7533\u62A5\u65B9\u6848",8,ke),d("a",{onClick:g=>O(o.row)},"\u8BE6\u60C5",8,Ye)]),_:1},8,["column","data","total"])]),_:1}),e(oe,{modelValue:b.value,"onUpdate:modelValue":t[7]||(t[7]=o=>b.value=o),title:"\u7533\u62A5\u5EFA\u8BBE\u65B9\u6848",width:"35%","before-close":B},{footer:l(()=>[d("span",Ve,[e(p,{type:"primary",onClick:t[5]||(t[5]=o=>W(Y.value))},{default:l(()=>[m(" \u63D0\u4EA4 ")]),_:1}),e(p,{onClick:t[6]||(t[6]=o=>b.value=!1)},{default:l(()=>[m("\u5173\u95ED")]),_:1})])]),default:l(()=>[e(x,{ref_key:"constructionPlanRef",ref:Y,model:u,rules:$,"label-position":"right","label-width":"auto","status-icon":""},{default:l(()=>[e(i,{label:"\u5EFA\u8BBE\u65B9\u6848:",prop:"constructionPlanFile"},{default:l(()=>[e(ae,{ref_key:"planUploadRef",ref:z,"file-list":u.constructionPlanFile,"onUpdate:fileList":t[4]||(t[4]=o=>u.constructionPlanFile=o),action:c(q),limit:1,"on-exceed":J,"on-success":o=>c(be)(o,u.constructionPlanFile,!0),"before-upload":o=>c(ye)(o,{types:c(N)}),accept:c(N).map(o=>`.${o}`).join(","),"on-preview":c(ge)},{tip:l(()=>[d("div",Fe," \u652F\u6301"+de(c(Te))+"\u6587\u4EF6 ",1)]),default:l(()=>[e(p,{plain:"",type:"primary"},{default:l(()=>[m("\u9009\u62E9\u6587\u4EF6")]),_:1})]),_:1},8,["file-list","action","on-success","before-upload","accept","on-preview"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])],64)}}});export{Ue as default};
|