|
1 |
- import{d as G,x as H,y as K,B as U,r as P,J as z,c as i,e as w,G as R,i as o,g as c,h as l,j as d,f as x,k as S,F as Q,T as h,u as s,t as k,af as X,ag as Y,ac as Z,q as ee}from"./index.149277cd.js";import{h as C,i as B,f as V,c as v,b as q,e as T,g as te}from"./uploadAction.da8c1cf8.js";const oe={key:0,class:"infoTip flex items-center mb-16"},le={key:1,class:"infoTip flex items-center mb-16"},ae={class:"el-upload__tip"},se={class:"el-upload__tip"},ne={class:"el-upload__tip"},ie={class:"flex justify-center"},re=G({name:"auditDialog"}),de=Object.assign(re,{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=H(),$=K(),{proxy:N}=ee(),j=U.dictStore.uploadUrl,u=n,_=O,A=P(),a=P({attachments:[],opinions:[]}),M={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"}]},L=async y=>{!y||await y.validate(async e=>{if(e){const I={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(I);p.data==="TASKID_ERROR"?(N.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),$.push({name:"waitMeToHandle"})):(N.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),p.data&&$.push({query:{...g.query,taskId:p.data}}),_("close",!0),_("reload",p.data),await U.countStore.setCountStore())}})};return z(()=>u.visible,async y=>{y||(A.value.resetFields(),a.value={attachments:[],opinions:[]})}),(y,e)=>{const I=i("Warning"),p=i("el-icon"),r=i("el-input"),m=i("el-form-item"),f=i("el-col"),D=i("el-input-number"),b=i("el-button"),F=i("el-upload"),E=i("el-row"),J=i("el-form"),W=i("el-dialog");return w(),R(W,{"model-value":n.visible,title:n.title,width:"600px","destroy-on-close":"",onClose:e[10]||(e[10]=t=>_("close"))},{footer:o(()=>[c("div",ie,[l(b,{class:"ml-22",type:"primary",onClick:e[8]||(e[8]=t=>L(A.value))},{default:o(()=>e[18]||(e[18]=[d(" \u63D0\u4EA4 ")])),_:1}),l(b,{onClick:e[9]||(e[9]=t=>_("close"))},{default:o(()=>e[19]||(e[19]=[d(" \u5173\u95ED ")])),_:1})])]),default:o(()=>[n.title==="\u9A73\u56DE"&&!n.isPerformance?(w(),x("div",oe,[l(p,{class:"mr-8"},{default:o(()=>[l(I)]),_:1}),e[11]||(e[11]=c("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))])):S("",!0),n.title==="\u9000\u56DE"?(w(),x("div",le,[l(p,{class:"mr-8"},{default:o(()=>[l(I)]),_:1}),e[12]||(e[12]=c("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))])):S("",!0),l(J,{ref_key:"formRef",ref:A,model:a.value,rules:M,"label-width":"auto","label-suffix":":"},{default:o(()=>[l(E,null,{default:o(()=>[l(f,{span:24},{default:o(()=>[l(m,{label:`${n.title}\u610F\u89C1`,prop:"comment"},{default:o(()=>[l(r,{modelValue:a.value.comment,"onUpdate:modelValue":e[0]||(e[0]=t=>a.value.comment=t),maxlength:"200",placeholder:"\u8BF7\u8F93\u5165","show-word-limit":"",type:"textarea"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),n.constructionSuggestions&&n.action==="PASS"?(w(),x(Q,{key:0},[l(f,{span:24},{default:o(()=>[l(m,{label:"\u5EFA\u8BAE\u603B\u6295\u8D44",prop:"proposeTotalInvest"},{default:o(()=>[l(D,{modelValue:a.value.proposeTotalInvest,"onUpdate:modelValue":e[1]||(e[1]=t=>a.value.proposeTotalInvest=t),class:"input-amount",placeholder:"\u8BF7\u586B\u5199",min:1e-6,controls:!1,onMousewheel:e[2]||(e[2]=h(()=>{},["prevent"]))},{suffix:o(()=>e[13]||(e[13]=[d("\u4E07\u5143")])),_:1},8,["modelValue"])]),_:1})]),_:1}),l(f,{span:24},{default:o(()=>[l(m,{label:"\u5EFA\u8BAE\u5E74\u5EA6\u9884\u7B97",prop:"proposeAnnualBudget"},{default:o(()=>[l(D,{modelValue:a.value.proposeAnnualBudget,"onUpdate:modelValue":e[3]||(e[3]=t=>a.value.proposeAnnualBudget=t),class:"input-amount",placeholder:"\u8BF7\u586B\u5199",min:1e-6,controls:!1,onMousewheel:e[4]||(e[4]=h(()=>{},["prevent"]))},{suffix:o(()=>e[14]||(e[14]=[d("\u4E07\u5143")])),_:1},8,["modelValue"])]),_:1})]),_:1}),l(f,{span:24},{default:o(()=>[l(m,{label:"\u8BC4\u5BA1\u610F\u89C1\u9644\u4EF6",prop:"proposeAttachFiles"},{default:o(()=>[l(F,{"file-list":a.value.proposeAttachFiles,"onUpdate:fileList":e[5]||(e[5]=t=>a.value.proposeAttachFiles=t),class:"w-full",action:s(j),"on-success":t=>s(C)(t,a.value.proposeAttachFiles),"on-error":s(B),"before-upload":t=>s(V)(t,{types:s(v)}),accept:s(v).map(t=>`.${t}`).join(","),multiple:"",limit:10,"on-preview":s(q)},{tip:o(()=>[c("div",ae,"\u652F\u6301"+k(s(T))+"\u6587\u4EF6",1)]),default:o(()=>[l(b,{type:"primary",class:"mr-4"},{default:o(()=>e[15]||(e[15]=[d("\u4E0A\u4F20\u9644\u4EF6")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1})],64)):S("",!0),n.projectDetail&&n.projectDetail.status===20004?(w(),R(f,{key:1,span:24},{default:o(()=>[l(m,{label:"\u7EC8\u9A8C\u610F\u89C1",prop:"opinions"},{default:o(()=>[l(F,{"file-list":a.value.opinions,"onUpdate:fileList":e[6]||(e[6]=t=>a.value.opinions=t),class:"w-full",action:s(j),"on-success":t=>s(C)(t,a.value.opinions),"on-error":s(B),"before-upload":t=>s(V)(t,{types:s(v)}),accept:s(v).map(t=>`.${t}`).join(","),multiple:"",limit:10,"on-preview":s(q)},{tip:o(()=>[c("div",se,"\u652F\u6301"+k(s(T))+"\u6587\u4EF6",1)]),default:o(()=>[l(b,{type:"primary",class:"mr-4"},{default:o(()=>e[16]||(e[16]=[d("\u4E0A\u4F20\u9644\u4EF6")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1})):S("",!0),l(f,{span:24},{default:o(()=>[l(m,{label:`${n.constructionSuggestions&&n.action==="PASS"?"\u5176\u4ED6\u9644\u4EF6":"\u9644\u4EF6"}`,prop:"files"},{default:o(()=>[l(F,{"file-list":a.value.attachments,"onUpdate:fileList":e[7]||(e[7]=t=>a.value.attachments=t),class:"w-full",action:s(j),"on-success":t=>s(C)(t,a.value.attachments),"on-error":s(B),"before-upload":t=>s(V)(t,{types:s(v)}),accept:s(v).map(t=>`.${t}`).join(","),multiple:"",limit:10,"on-preview":s(q)},{tip:o(()=>[c("div",ne,"\u652F\u6301"+k(s(T))+"\u6587\u4EF6",1)]),default:o(()=>[l(b,{type:"primary",class:"mr-4"},{default:o(()=>e[17]||(e[17]=[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{de as default};
|