You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

approvalDialog.691cba5a.js 5.7KB

1
  1. import{r as R,h as V,i as C,f as P,c as b,b as x,e as j}from"./uploadAction.44c3f16c.js";import{d as T,D as M,r as _,L as E,c as r,e as J,I as z,i as t,h as o,j as n,u as d,g as B,t as k,Y as G,N as H,x as K}from"./index.622ee9e7.js";import{b as Q}from"./annualPlanStore.132e0dc0.js";import{o as W}from"./index.7cf53a4d.js";const X={class:"el-upload__tip"},Z={class:"el-upload__tip"},h=T({name:"approvalDialog"}),oe=Object.assign(h,{props:{visible:{type:Boolean,default:!1,required:!0},title:{type:String,default:"\u7ACB\u9879\u6279\u590D"},data:Object},emits:["close"],setup(g,{emit:$}){const{proxy:U}=K(),w=M.dictStore.uploadUrl,m=g,y=$,F=_(),a=_({buildPlanFileId:[]}),q={approvedAmount:[{required:!0,message:"\u8BF7\u8F93\u5165\u6279\u590D\u91D1\u989D",trigger:"blur"}],approvedDate:[{required:!0,message:"\u8BF7\u8F93\u5165\u6279\u590D\u65F6\u95F4"}],buildCycle:[{required:!0,message:"\u8BF7\u8F93\u5165\u5EFA\u8BBE\u5468\u671F"}],approvedFileId:[{required:!0,message:"\u8BF7\u8F93\u5165\u6279\u590D\u6587\u4EF6"}],buildPlanFileId:[{required:!0,message:"\u8BF7\u8F93\u5165\u5EFA\u8BBE\u65B9\u6848"}],approvalBudget:[{required:!0,message:"\u8BF7\u8F93\u5165\u5EFA\u8BAE\u6279\u590D\u5E74\u5EA6\u9884\u7B97",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 Q(i),U.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),y("close",!0)}})};E(()=>m.visible,async u=>{u?(console.log("props.data",m.data),S()):(F.value.resetFields(),I.value={})});const I=_({});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=_();function N(u){a.value.buildPlanFileId=[],f.value.clearFiles();const e=u[0];e.uid=G(),H(()=>{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"),c=r("el-button"),D=r("el-upload"),Y=r("el-row"),L=r("el-form"),O=r("el-dialog");return J(),z(O,{"model-value":g.visible,title:g.title,width:"600px","destroy-on-close":"",onClose:e[11]||(e[11]=l=>y("close"))},{footer:t(()=>[o(c,{type:"primary",onClick:e[9]||(e[9]=l=>A(F.value))},{default:t(()=>[n(" \u63D0\u4EA4 ")]),_:1}),o(c,{onClick:e[10]||(e[10]=l=>y("close"))},{default:t(()=>[n(" \u5173\u95ED ")]),_: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:"\u5EFA\u8BAE\u6279\u590D\u603B\u6295\u8D44",prop:"approvedAmount"},{default:t(()=>[o(s,{modelValue:a.value.approvedAmount,"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.approvedAmount=l),type:"number",placeholder:"\u8BF7\u8F93\u5165",onInput:e[1]||(e[1]=l=>a.value.approvedAmount=a.value.approvedAmount.replace(/\D/g,""))},{append:t(()=>[n("\u4E07\u5143")]),_:1},8,["modelValue"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"\u6279\u590D\u65F6\u95F4",prop:"approvedDate"},{default:t(()=>[o(v,{modelValue:a.value.approvedDate,"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.approvedDate=l),type:"date",placeholder:"\u8BF7\u9009\u62E9","value-format":"YYYY-MM-DD"},null,8,["modelValue"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"\u5EFA\u8BAE\u6279\u590D\u5E74\u5EA6\u9884\u7B97",prop:"approvalBudget"},{default:t(()=>[o(s,{modelValue:a.value.approvalBudget,"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.approvalBudget=l),type:"number",placeholder:"\u8BF7\u8F93\u5165",onInput:e[4]||(e[4]=l=>a.value.approvalBudget=a.value.approvalBudget.replace(/\D/g,""))},{append:t(()=>[n("\u4E07\u5143")]),_:1},8,["modelValue"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"\u5EFA\u8BBE\u5468\u671F",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:"\u8BF7\u586B\u5199\u5EFA\u8BBE\u5468\u671F\uFF0C\u5355\u4F4D\u300C\u6708\u300D",controls:!1,onInput:e[6]||(e[6]=l=>a.value.buildCycle=a.value.buildCycle.replace(/\D/g,""))},{append:t(()=>[n("\u4E2A\u6708")]),_:1},8,["modelValue"])]),_:1})]),_:1}),o(i,{span:24},{default:t(()=>[o(p,{label:"\u6279\u590D\u6587\u4EF6",prop:"approvedFileId"},{default:t(()=>[o(D,{"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(V)(l,a.value.approvedFileId,!0),"on-error":d(C),"before-upload":l=>d(P)(l,{types:d(b)}),accept:d(b).map(l=>`.${l}`).join(","),multiple:"",limit:1,"on-preview":d(x)},{tip:t(()=>[B("div",X,"\u652F\u6301"+k(d(j))+"\u6587\u4EF6",1)]),default:t(()=>[o(c,{type:"primary"},{default:t(()=>[n("\u4E0A\u4F20\u9644\u4EF6")]),_: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:"\u5EFA\u8BBE\u65B9\u6848",prop:"buildPlanFileId"},{default:t(()=>[o(D,{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(V)(l,a.value.buildPlanFileId,!0),"on-error":d(C),"before-upload":l=>d(P)(l,{types:d(b)}),accept:d(b).map(l=>`.${l}`).join(","),multiple:"","auto-upload":!0,"on-exceed":N,limit:1,"on-preview":d(x)},{tip:t(()=>[B("div",Z,"\u652F\u6301"+k(d(j))+"\u6587\u4EF6",1)]),default:t(()=>[o(c,{type:"primary"},{default:t(()=>[n("\u66F4\u65B0")]),_: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};