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.

2 lines
5.0KB

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