|
- import{r as R,h as D,i as V,f as P,b as c,c as x,e as B}from"./uploadAction-3962500e.js";import{E as T,r as y,B as E,b as r,c as M,L as J,h as t,f as o,i as n,u as d,e as k,t as j,k as Q,Q as z,C as G,s as H}from"./index-dd5fae99.js";import{b as K}from"./annualPlanStore-7a8e5db4.js";import{o as W}from"./index-b6aa4cff.js";const X={class:"el-upload__tip"},Z={class:"el-upload__tip"},h=Q({name:"approvalDialog"}),oe=Object.assign(h,{props:{visible:{type:Boolean,default:!1,required:!0},title:{type:String,default:"立项批复"},data:Object},emits:["close"],setup(g,{emit:$}){const{proxy:U}=H(),w=T.dictStore.uploadUrl,m=g,_=$,F=y(),a=y({buildPlanFileId:[]}),q={approvedAmount:[{required:!0,message:"请输入批复金额",trigger:"blur"}],approvedDate:[{required:!0,message:"请输入批复时间"}],buildCycle:[{required:!0,message:"请输入建设周期"}],approvedFileId:[{required:!0,message:"请输入批复文件"}],buildPlanFileId:[{required:!0,message:"请输入建设方案"}],approvalBudget:[{required:!0,message:"请输入建议批复年度预算",trigger:"blur"}]},A=async u=>{u&&await u.validate(async e=>{var s,p;if(e){const i={...a.value,projectId:m.data.projectId,buildCycle:a.value.buildCycle*1,approvedFileId:((s=a.value.approvedFileId)==null?void 0:s.map(v=>v.response.data.id)[0])||void 0,buildPlanFileId:((p=a.value.buildPlanFileId)==null?void 0:p.map(v=>v.response.data.id)[0])||void 0};await K(i),U.$message.success("提交成功!"),_("close",!0)}})};E(()=>m.visible,async u=>{u?(console.log("props.data",m.data),S()):(F.value.resetFields(),I.value={})});const I=y({});async function S(){const u=await W({id:m.data.projectId});I.value=u.data,a.value.buildPlanFileId=R(JSON.parse(I.value.constructionPlanFile))}const f=y();function N(u){a.value.buildPlanFileId=[],f.value.clearFiles();const e=u[0];e.uid=z(),G(()=>{f.value.handleStart(e),f.value.submit()})}return(u,e)=>{const s=r("el-input"),p=r("el-form-item"),i=r("el-col"),v=r("el-date-picker"),b=r("el-button"),C=r("el-upload"),Y=r("el-row"),L=r("el-form"),O=r("el-dialog");return M(),J(O,{"model-value":g.visible,title:g.title,width:"600px","destroy-on-close":"",onClose:e[11]||(e[11]=l=>_("close"))},{footer:t(()=>[o(b,{type:"primary",onClick:e[9]||(e[9]=l=>A(F.value))},{default:t(()=>e[17]||(e[17]=[n(" 提交 ")])),_:1}),o(b,{onClick:e[10]||(e[10]=l=>_("close"))},{default:t(()=>e[18]||(e[18]=[n(" 关闭 ")])),_:1})]),default:t(()=>[o(L,{ref_key:"formRef",ref:F,model:a.value,rules:q,"label-width":"140px","label-suffix":":"},{default:t(()=>[o(Y,null,{default:t(()=>[o(i,{span:24},{default:t(()=>[o(p,{label:"建议批复总投资",prop:"approvedAmount"},{default:t(()=>[o(s,{modelValue:a.value.approvedAmount,"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.approvedAmount=l),type:"number",placeholder:"请输入",onInput:e[1]||(e[1]=l=>a.value.approvedAmount=a.value.approvedAmount.replace(/\D/g,""))},{append:t(()=>e[12]||(e[12]=[n("万元")])),_:1},8,["modelValue"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"批复时间",prop:"approvedDate"},{default:t(()=>[o(v,{modelValue:a.value.approvedDate,"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.approvedDate=l),type:"date",placeholder:"请选择","value-format":"YYYY-MM-DD"},null,8,["modelValue"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"建议批复年度预算",prop:"approvalBudget"},{default:t(()=>[o(s,{modelValue:a.value.approvalBudget,"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.approvalBudget=l),type:"number",placeholder:"请输入",onInput:e[4]||(e[4]=l=>a.value.approvalBudget=a.value.approvalBudget.replace(/\D/g,""))},{append:t(()=>e[13]||(e[13]=[n("万元")])),_:1},8,["modelValue"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"建设周期",prop:"buildCycle"},{default:t(()=>[o(s,{modelValue:a.value.buildCycle,"onUpdate:modelValue":e[5]||(e[5]=l=>a.value.buildCycle=l),min:0,type:"number",placeholder:"请填写建设周期,单位「月」",controls:!1,onInput:e[6]||(e[6]=l=>a.value.buildCycle=a.value.buildCycle.replace(/\D/g,""))},{append:t(()=>e[14]||(e[14]=[n("个月")])),_:1},8,["modelValue"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"批复文件",prop:"approvedFileId"},{default:t(()=>[o(C,{"file-list":a.value.approvedFileId,"onUpdate:fileList":e[7]||(e[7]=l=>a.value.approvedFileId=l),class:"w-full",action:d(w),"on-success":l=>d(D)(l,a.value.approvedFileId,!0),"on-error":d(V),"before-upload":l=>d(P)(l,{types:d(c)}),accept:d(c).map(l=>`.${l}`).join(","),multiple:"",limit:1,"on-preview":d(x)},{tip:t(()=>[k("div",X,"支持"+j(d(B))+"文件",1)]),default:t(()=>[o(b,{type:"primary"},{default:t(()=>e[15]||(e[15]=[n("上传附件")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"建设方案",prop:"buildPlanFileId"},{default:t(()=>[o(C,{ref_key:"upload",ref:f,"file-list":a.value.buildPlanFileId,"onUpdate:fileList":e[8]||(e[8]=l=>a.value.buildPlanFileId=l),class:"w-full",action:d(w),"on-success":l=>d(D)(l,a.value.buildPlanFileId,!0),"on-error":d(V),"before-upload":l=>d(P)(l,{types:d(c)}),accept:d(c).map(l=>`.${l}`).join(","),multiple:"","auto-upload":!0,"on-exceed":N,limit:1,"on-preview":d(x)},{tip:t(()=>[k("div",Z,"支持"+j(d(B))+"文件",1)]),default:t(()=>[o(b,{type:"primary"},{default:t(()=>e[16]||(e[16]=[n("更新")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])}}});export{oe as default};
|