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
4.0KB

  1. import{h as T,i as I,f as O,b as A,c as H,e as M}from"./uploadAction-3962500e.js";import{E as P,r as F,o as W,b as s,c as n,L as d,h as e,f as a,d as b,F as V,H as w,i as m,t as y,j as z,u as p,e as G,k as J}from"./index-dd5fae99.js";const K={class:"el-upload__tip"},Q=J({name:"reviewCommentsDialog"}),Z=Object.assign(Q,{props:{templateData:Object},setup(g,{expose:D}){const x=P.dictStore.uploadUrl,h=g,k=F(),l=F({templates:[],attachments:[]}),C={otherAdvice:[{required:!0,message:"请输入意见",trigger:"blur"}],reviewResult:[{required:!0,message:"请选择评审结果",trigger:"blur"}]},R=c=>{k.value.validate(o=>{c(o)})};return W(async()=>{l.value.templates=h.templateData.templates.map(c=>({optionSerialNo:void 0,otherAdvice:"",questionSerialNo:c.serialNo})),l.value.templateId=h.templateData.templateId}),D({validForm:R,form:l}),(c,o)=>{const j=s("el-checkbox"),q=s("el-checkbox-group"),_=s("el-radio"),N=s("el-radio-group"),i=s("el-form-item"),U=s("el-input"),f=s("el-col"),B=s("el-button"),$=s("el-upload"),E=s("el-row"),L=s("el-form");return n(),d(L,{ref_key:"formRef",ref:k,model:l.value,rules:C,"label-width":"auto","label-suffix":":","label-position":"top",class:"reviewForm"},{default:e(()=>[a(E,null,{default:e(()=>{var S;return[(S=l.value.templates)!=null&&S.length?(n(!0),b(V,{key:0},w(g.templateData.templates,(t,u)=>(n(),d(f,{key:u,span:24},{default:e(()=>[a(i,{label:t.title,prop:`templates[${u}].optionSerialNo`,rules:[{required:!0,message:"请选择"}]},{default:e(()=>[t.optionType===2?(n(),d(q,{key:0,modelValue:l.value.templates[u].optionSerialNo,"onUpdate:modelValue":r=>l.value.templates[u].optionSerialNo=r},{default:e(()=>[(n(!0),b(V,null,w(t.options,(r,v)=>(n(),d(j,{key:v,label:r.serialNo},{default:e(()=>[m(y(r.option),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):(n(),d(N,{key:1,modelValue:l.value.templates[u].optionSerialNo,"onUpdate:modelValue":r=>l.value.templates[u].optionSerialNo=r,class:"myWrap"},{default:e(()=>[(n(!0),b(V,null,w(t.options,(r,v)=>(n(),d(_,{key:v,label:r.serialNo},{default:e(()=>[m(y(r.option),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"]))]),_:2},1032,["label","prop"]),a(i,{prop:`templates[${u}].otherAdvice`},{default:e(()=>[a(U,{modelValue:l.value.templates[u].otherAdvice,"onUpdate:modelValue":r=>l.value.templates[u].otherAdvice=r,rows:2,type:"textarea",placeholder:`请输入${t.title}的其他意见或建议`},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop"])]),_:2},1024))),128)):z("",!0),a(f,{span:24},{default:e(()=>[a(i,{label:"其他意见或建议",prop:"otherAdvice"},{default:e(()=>[a(U,{modelValue:l.value.otherAdvice,"onUpdate:modelValue":o[0]||(o[0]=t=>l.value.otherAdvice=t),rows:2,maxlength:"200",type:"textarea","show-word-limit":"",placeholder:"请输入其他意见或建议"},null,8,["modelValue"])]),_:1})]),_:1}),a(f,{span:24},{default:e(()=>[a(i,{label:"附件",prop:"attachments"},{default:e(()=>[a($,{"file-list":l.value.attachments,"onUpdate:fileList":o[1]||(o[1]=t=>l.value.attachments=t),class:"w-full",action:p(x),"on-success":t=>p(T)(t,l.value.attachments,!0),"on-error":p(I),"before-upload":t=>p(O)(t,{types:p(A)}),accept:p(A).map(t=>`.${t}`).join(","),limit:1,"on-preview":p(H)},{tip:e(()=>[G("div",K,"支持"+y(p(M))+"文件",1)]),default:e(()=>[a(B,{type:"primary",class:"mr-4"},{default:e(()=>o[3]||(o[3]=[m("上传附件")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1}),a(f,{span:24,class:"result"},{default:e(()=>[a(i,{label:"评审结果",prop:"reviewResult",class:"mb-0"},{default:e(()=>[a(N,{modelValue:l.value.reviewResult,"onUpdate:modelValue":o[2]||(o[2]=t=>l.value.reviewResult=t),class:"ml-4"},{default:e(()=>[a(_,{label:1},{default:e(()=>o[4]||(o[4]=[m("评审通过")])),_:1}),a(_,{label:2},{default:e(()=>o[5]||(o[5]=[m("通过需调整")])),_:1}),a(_,{label:3},{default:e(()=>o[6]||(o[6]=[m("修改方案后重新评审")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]}),_:1})]),_:1},8,["model"])}}});export{Z as default};