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.92433ea5.js 5.4KB

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