Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

2 linhas
6.6KB

  1. import{d as ne,B as P,b as T,y as re,r as s,o as ie,c as r,e as v,f as h,h as l,i as t,F as A,H as se,u as d,G as de,g as u,j as m,t as ue,W as ce,q as pe}from"./index.88314652.js";import{g as me,d as fe,a as _e}from"./index.52f0c4e2.js";import{h as be,f as ye,c as N,b as ge,e as Te}from"./uploadAction.a771741b.js";import{u as ve}from"./useExportExc.d7823a98.js";const je={class:"flex"},we={class:"flex justify-between"},ke=["onClick"],Ye=["onClick"],Fe={class:"el-upload__tip"},Ve={class:"dialog-footer"},xe=ne({name:"constructionPlanDeclare"}),Ne=Object.assign(xe,{setup(Ce){const{projectTypeOptions:U}=P.dictStore.globalDicts||{},{proxy:S}=pe(),a=T({projectName:"",projectType:"",projectYear:null,startTime:"",endTime:"",createTimeArr:[]}),R=re(),j=s(),w=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});w.value=e.data.records,k.value=e.data.total},$=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"}]),H=T({constructionPlanFile:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u5EFA\u8BBE\u65B9\u6848",trigger:"blur"}]}),k=s(2),I=n=>{R.push({name:"projectDeclareDetail",query:{id:n.id}})},O=()=>{f()},B=()=>{a.projectName=null,a.projectType=null,a.projectYear=null,a.startTime=null,a.endTime=null,a.createTimeArr=null,f()},E=s(),L=n=>{E.value=n},b=s(!1),M=n=>{n()},q=P.dictStore.uploadUrl,c=T({constructionPlanFile:[]}),Y=s(),z=s(),F=s(),G=n=>{Y.value.clearFiles();const e=n[0];e.uid=ce(),Y.value.handleStart(e)},W=s(),J=async n=>{!n||n.validate(e=>{e?K():console.log("error submit!")})},K=async()=>{await fe({projectInfo:{id:W.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("\u63D0\u4EA4\u6210\u529F"),f()},{exportLoading:Q,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 ie(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:"\u9879\u76EE\u540D\u79F0"},{default:t(()=>[l(y,{modelValue:a.projectName,"onUpdate:modelValue":e[0]||(e[0]=o=>a.projectName=o),maxlength:"50",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(_,{span:8},{default:t(()=>[l(i,{label:"\u9879\u76EE\u7C7B\u578B"},{default:t(()=>[l(le,{modelValue:a.projectType,"onUpdate:modelValue":e[1]||(e[1]=o=>a.projectType=o),placeholder:"\u5168\u90E8",class:"w-full"},{default:t(()=>[(v(!0),h(A,null,se(d(U),(o,g)=>(v(),de(ee,{key:g,label:o,value:g},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(_,{span:8},{default:t(()=>[l(i,{label:"\u9884\u7B97\u5E74\u5EA6"},{default:t(()=>[l(V,{modelValue:a.projectYear,"onUpdate:modelValue":e[2]||(e[2]=o=>a.projectYear=o),type:"year",placeholder:"\u8BF7\u9009\u62E9",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:"\u521B\u5EFA\u65F6\u95F4"},{default:t(()=>[l(V,{modelValue:a.createTimeArr,"onUpdate:modelValue":e[3]||(e[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}),l(_,{span:14},{default:t(()=>[l(i,{class:"btn"},{default:t(()=>[u("div",je,[l(p,{type:"primary",onClick:O},{default:t(()=>e[8]||(e[8]=[m("\u67E5\u8BE2")])),_:1}),l(p,{onClick:B},{default:t(()=>e[9]||(e[9]=[m("\u91CD\u7F6E")])),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),l(D,{class:"w-full mt-8"},{header:t(()=>[u("div",we,[e[11]||(e[11]=u("span",null,"\u5F85\u7533\u62A5\u7684\u9879\u76EE",-1)),u("div",null,[l(p,{type:"primary",plain:"",size:"small",loading:d(Q),onClick:Z},{default:t(()=>e[10]||(e[10]=[m("\u5BFC\u51FA")])),_:1},8,["loading"])])])]),default:t(()=>[l(te,{ref_key:"tableListRef",ref:j,column:$,data:w.value,total:k.value,onHandleTable:L,onGetTableData:f},{action:t(({scope:o})=>[u("a",{onClick:g=>n.$router.push({name:"declarePlan",query:{id:o.row.id}})},"\u7533\u62A5\u65B9\u6848",8,ke),u("a",{onClick:g=>I(o.row)},"\u8BE6\u60C5",8,Ye)]),_:1},8,["column","data","total"])]),_:1}),l(oe,{modelValue:b.value,"onUpdate:modelValue":e[7]||(e[7]=o=>b.value=o),title:"\u7533\u62A5\u5EFA\u8BBE\u65B9\u6848",width:"35%","before-close":M},{footer:t(()=>[u("span",Ve,[l(p,{type:"primary",onClick:e[5]||(e[5]=o=>J(F.value))},{default:t(()=>e[13]||(e[13]=[m(" \u63D0\u4EA4 ")])),_:1}),l(p,{onClick:e[6]||(e[6]=o=>b.value=!1)},{default:t(()=>e[14]||(e[14]=[m("\u5173\u95ED")])),_:1})])]),default:t(()=>[l(C,{ref_key:"constructionPlanRef",ref:F,model:c,rules:H,"label-position":"right","label-width":"auto","status-icon":""},{default:t(()=>[l(i,{label:"\u5EFA\u8BBE\u65B9\u6848:",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(ge)},{tip:t(()=>[u("div",Fe," \u652F\u6301"+ue(d(Te))+"\u6587\u4EF6 ",1)]),default:t(()=>[l(p,{plain:"",type:"primary"},{default:t(()=>e[12]||(e[12]=[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{Ne as default};