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 line
7.5KB

  1. import{d as H,z as J,A as K,D as N,r as U,L as G,c as i,e as b,I as P,i as t,g as v,h as o,j as d,f as F,k as I,F as Q,V as R,u as s,t as x,ah as X,ai as Y,ae as Z,x as ee}from"./index.63921713.js";import{h as k,i as C,f as V,c as f,b as B,e as q,g as te}from"./uploadAction.1ab7d8a2.js";const oe={key:0,class:"infoTip flex items-center mb-16"},ae=v("span",null,"\u9A73\u56DE\u540E\uFF0C\u9700\u8981\u7533\u62A5\u5355\u4F4D\u4FEE\u6539\u9879\u76EE\u4FE1\u606F\u540E\uFF0C\u91CD\u65B0\u53D1\u8D77\u8BE5\u6D41\u7A0B\u3002",-1),le={key:1,class:"infoTip flex items-center mb-16"},se=v("span",null,"\u9000\u56DE\u540E\uFF0C\u9700\u8981\u7533\u62A5\u5355\u4F4D\u4FEE\u6539\u9879\u76EE\u4FE1\u606F\u540E\uFF0C\u518D\u7531\u60A8\u8FDB\u884C\u5BA1\u6838\u786E\u8BA4\u3002",-1),ne={class:"el-upload__tip"},ie={class:"el-upload__tip"},re={class:"el-upload__tip"},ue={class:"flex justify-center"},pe=H({name:"auditDialog"}),me=Object.assign(pe,{props:{visible:{type:Boolean,default:!1,required:!0},title:{type:String,default:"\u901A\u8FC7"},taskId:{type:String,default:""},action:{type:String,default:""},constructionSuggestions:{type:Boolean,default:!1},projectDetail:{type:Object},projectCode:{type:String,default:""},isPerformance:{type:Boolean,default:!1}},emits:["close","reload"],setup(n,{emit:O}){const g=J(),T=K(),{proxy:$}=ee(),S=N.dictStore.uploadUrl,u=n,w=O,j=U(),a=U({attachments:[],opinions:[]}),L={comment:[{required:!0,message:"\u8BF7\u8F93\u5165\u610F\u89C1",trigger:"blur"}],proposeTotalInvest:[{required:!0,message:"\u8BF7\u8F93\u5165\u5EFA\u8BAE\u603B\u6295\u8D44"}],proposeAnnualBudget:[{required:!0,message:"\u8BF7\u8F93\u5165\u5EFA\u8BAE\u5E74\u5EA6\u9884\u7B97"}],proposeAttachFiles:[{required:!0,message:"\u8BF7\u4E0A\u4F20"}],opinions:[{required:!0,message:"\u8BF7\u4E0A\u4F20"}]},M=async _=>{!_||await _.validate(async l=>{if(l){const h={instanceId:g.query.instanceId,projectId:g.query.projectId,projectCode:u.projectCode,taskId:u.taskId,action:u.action,auditInfo:{text:a.value.comment,attachments:a.value.attachments.map(r=>({fileId:r.response.data.id,fileName:r.response.data.originalFileName}))}};if(u.constructionSuggestions&&u.action==="PASS"&&await X({projectCode:u.projectCode,instanceId:g.query.instanceId,proposeTotalInvest:a.value.proposeTotalInvest,proposeAnnualBudget:a.value.proposeAnnualBudget,proposeAttachFiles:a.value.proposeAttachFiles&&JSON.stringify(te(a.value.proposeAttachFiles))}),a.value.opinions&&a.value.opinions.length>0)try{await Y({projectId:g.query.projectId,opinions:a.value.opinions.map(r=>({fileId:r.response.data.id,fileName:r.response.data.originalFileName}))})}catch(r){console.log(r)}const p=await Z(h);p.data==="TASKID_ERROR"?($.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),T.push({name:"waitMeToHandle"})):($.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),p.data&&T.push({query:{...g.query,taskId:p.data}}),w("close",!0),w("reload",p.data),await N.countStore.setCountStore())}})};return G(()=>u.visible,async _=>{_||(j.value.resetFields(),a.value={attachments:[],opinions:[]})}),(_,l)=>{const h=i("Warning"),p=i("el-icon"),r=i("el-input"),c=i("el-form-item"),m=i("el-col"),D=i("el-input-number"),y=i("el-button"),A=i("el-upload"),E=i("el-row"),W=i("el-form"),z=i("el-dialog");return b(),P(z,{"model-value":n.visible,title:n.title,width:"600px","destroy-on-close":"",onClose:l[10]||(l[10]=e=>w("close"))},{footer:t(()=>[v("div",ue,[o(y,{class:"ml-22",type:"primary",onClick:l[8]||(l[8]=e=>M(j.value))},{default:t(()=>[d(" \u63D0\u4EA4 ")]),_:1}),o(y,{onClick:l[9]||(l[9]=e=>w("close"))},{default:t(()=>[d(" \u5173\u95ED ")]),_:1})])]),default:t(()=>[n.title==="\u9A73\u56DE"&&!n.isPerformance?(b(),F("div",oe,[o(p,{class:"mr-8"},{default:t(()=>[o(h)]),_:1}),ae])):I("",!0),n.title==="\u9000\u56DE"?(b(),F("div",le,[o(p,{class:"mr-8"},{default:t(()=>[o(h)]),_:1}),se])):I("",!0),o(W,{ref_key:"formRef",ref:j,model:a.value,rules:L,"label-width":"auto","label-suffix":":"},{default:t(()=>[o(E,null,{default:t(()=>[o(m,{span:24},{default:t(()=>[o(c,{label:`${n.title}\u610F\u89C1`,prop:"comment"},{default:t(()=>[o(r,{modelValue:a.value.comment,"onUpdate:modelValue":l[0]||(l[0]=e=>a.value.comment=e),maxlength:"200",placeholder:"\u8BF7\u8F93\u5165","show-word-limit":"",type:"textarea"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),n.constructionSuggestions&&n.action==="PASS"?(b(),F(Q,{key:0},[o(m,{span:24},{default:t(()=>[o(c,{label:"\u5EFA\u8BAE\u603B\u6295\u8D44",prop:"proposeTotalInvest"},{default:t(()=>[o(D,{modelValue:a.value.proposeTotalInvest,"onUpdate:modelValue":l[1]||(l[1]=e=>a.value.proposeTotalInvest=e),class:"input-amount",placeholder:"\u8BF7\u586B\u5199",min:1e-6,controls:!1,onMousewheel:l[2]||(l[2]=R(()=>{},["prevent"]))},{suffix:t(()=>[d("\u4E07\u5143")]),_:1},8,["modelValue"])]),_:1})]),_:1}),o(m,{span:24},{default:t(()=>[o(c,{label:"\u5EFA\u8BAE\u5E74\u5EA6\u9884\u7B97",prop:"proposeAnnualBudget"},{default:t(()=>[o(D,{modelValue:a.value.proposeAnnualBudget,"onUpdate:modelValue":l[3]||(l[3]=e=>a.value.proposeAnnualBudget=e),class:"input-amount",placeholder:"\u8BF7\u586B\u5199",min:1e-6,controls:!1,onMousewheel:l[4]||(l[4]=R(()=>{},["prevent"]))},{suffix:t(()=>[d("\u4E07\u5143")]),_:1},8,["modelValue"])]),_:1})]),_:1}),o(m,{span:24},{default:t(()=>[o(c,{label:"\u8BC4\u5BA1\u610F\u89C1\u9644\u4EF6",prop:"proposeAttachFiles"},{default:t(()=>[o(A,{"file-list":a.value.proposeAttachFiles,"onUpdate:fileList":l[5]||(l[5]=e=>a.value.proposeAttachFiles=e),class:"w-full",action:s(S),"on-success":e=>s(k)(e,a.value.proposeAttachFiles),"on-error":s(C),"before-upload":e=>s(V)(e,{types:s(f)}),accept:s(f).map(e=>`.${e}`).join(","),multiple:"",limit:10,"on-preview":s(B)},{tip:t(()=>[v("div",ne,"\u652F\u6301"+x(s(q))+"\u6587\u4EF6",1)]),default:t(()=>[o(y,{type:"primary",class:"mr-4"},{default:t(()=>[d("\u4E0A\u4F20\u9644\u4EF6")]),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1})],64)):I("",!0),n.projectDetail&&n.projectDetail.status===20004?(b(),P(m,{key:1,span:24},{default:t(()=>[o(c,{label:"\u7EC8\u9A8C\u610F\u89C1",prop:"opinions"},{default:t(()=>[o(A,{"file-list":a.value.opinions,"onUpdate:fileList":l[6]||(l[6]=e=>a.value.opinions=e),class:"w-full",action:s(S),"on-success":e=>s(k)(e,a.value.opinions),"on-error":s(C),"before-upload":e=>s(V)(e,{types:s(f)}),accept:s(f).map(e=>`.${e}`).join(","),multiple:"",limit:10,"on-preview":s(B)},{tip:t(()=>[v("div",ie,"\u652F\u6301"+x(s(q))+"\u6587\u4EF6",1)]),default:t(()=>[o(y,{type:"primary",class:"mr-4"},{default:t(()=>[d("\u4E0A\u4F20\u9644\u4EF6")]),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1})):I("",!0),o(m,{span:24},{default:t(()=>[o(c,{label:`${n.constructionSuggestions&&n.action==="PASS"?"\u5176\u4ED6\u9644\u4EF6":"\u9644\u4EF6"}`,prop:"files"},{default:t(()=>[o(A,{"file-list":a.value.attachments,"onUpdate:fileList":l[7]||(l[7]=e=>a.value.attachments=e),class:"w-full",action:s(S),"on-success":e=>s(k)(e,a.value.attachments),"on-error":s(C),"before-upload":e=>s(V)(e,{types:s(f)}),accept:s(f).map(e=>`.${e}`).join(","),multiple:"",limit:10,"on-preview":s(B)},{tip:t(()=>[v("div",re,"\u652F\u6301"+x(s(q))+"\u6587\u4EF6",1)]),default:t(()=>[o(y,{type:"primary",class:"mr-4"},{default:t(()=>[d("\u4E0A\u4F20\u9644\u4EF6")]),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])}}});export{me as default};