Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

approvalDialog.53710b98.js 5.8KB

3 miesięcy temu
1
  1. import{r as R,h as V,i as C,f as P,c,b as x,e as B}from"./uploadAction.0eabe13b.js";import{d as T,B as J,r as g,J as M,c as r,e as E,G,i as t,h as o,j as n,u as d,g as j,t as k,W,L as z,q as H}from"./index.a2494fc2.js";import{b as K}from"./annualPlanStore.a72df6b3.js";import{o as Q}from"./index.7c249f3d.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(y,{emit:$}){const{proxy:q}=H(),w=J.dictStore.uploadUrl,m=y,_=$,F=g(),a=g({buildPlanFileId:[]}),U={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 K(i),q.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),_("close",!0)}})};M(()=>m.visible,async u=>{u?(console.log("props.data",m.data),S()):(F.value.resetFields(),I.value={})});const I=g({});async function S(){const u=await Q({id:m.data.projectId});I.value=u.data,a.value.buildPlanFileId=R(JSON.parse(I.value.constructionPlanFile))}const f=g();function N(u){a.value.buildPlanFileId=[],f.value.clearFiles();const e=u[0];e.uid=W(),z(()=>{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"),D=r("el-upload"),Y=r("el-row"),L=r("el-form"),O=r("el-dialog");return E(),G(O,{"model-value":y.visible,title:y.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(" \u63D0\u4EA4 ")])),_:1}),o(b,{onClick:e[10]||(e[10]=l=>_("close"))},{default:t(()=>e[18]||(e[18]=[n(" \u5173\u95ED ")])),_:1})]),default:t(()=>[o(L,{ref_key:"formRef",ref:F,model:a.value,rules:U,"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(()=>e[12]||(e[12]=[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(()=>e[13]||(e[13]=[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(()=>e[14]||(e[14]=[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(c)}),accept:d(c).map(l=>`.${l}`).join(","),multiple:"",limit:1,"on-preview":d(x)},{tip:t(()=>[j("div",X,"\u652F\u6301"+k(d(B))+"\u6587\u4EF6",1)]),default:t(()=>[o(b,{type:"primary"},{default:t(()=>e[15]||(e[15]=[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(c)}),accept:d(c).map(l=>`.${l}`).join(","),multiple:"","auto-upload":!0,"on-exceed":N,limit:1,"on-preview":d(x)},{tip:t(()=>[j("div",Z,"\u652F\u6301"+k(d(B))+"\u6587\u4EF6",1)]),default:t(()=>[o(b,{type:"primary"},{default:t(()=>e[16]||(e[16]=[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};