選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

editPersonInfoDialog-a8320c15.js 3.4KB

1
  1. import{h as B,f as I,b as L,c as h,e as D,g as N,r as q}from"./uploadAction-3962500e.js";import{E as O,r as g,B as P,b as d,c as _,L as J,h as o,f as a,i as y,d as V,F as T,H as E,e as w,u as r,t as H,k as z,s as A}from"./index-dd5fae99.js";import{p as G,d as K}from"./securityPersonnelControl-9b4e1dfe.js";const M={class:"flex-1"},Q={class:"el-upload__tip"},W=z({name:"editPersonInfoDialog"}),ee=Object.assign(W,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(b,{emit:C}){const{proxy:F}=A(),k=O.dictStore.uploadUrl,m=b,v=C,c=g(!1),p=g({infoList:[{investigationReport:[]}]}),R=g(),U=async i=>{i&&i.validate(async e=>{if(e)try{c.value=!0;const l=p.value.infoList.map(s=>{var u;return{...s,projectCode:m.data.projectCode,investigationReport:((u=s==null?void 0:s.investigationReport)==null?void 0:u.length)&&JSON.stringify(N(s.investigationReport))||void 0}});await G(l),F.$message.success("提交成功!"),c.value=!1,v("close",!0)}catch{c.value=!1}})},$=async()=>{var e;const i=await K(m.data.projectCode);p.value.infoList=((e=i.data.personSafetyInfo)==null?void 0:e.map(l=>({...l,investigationReport:l.investigationReport?q(JSON.parse(l.investigationReport)):[]})))||[{investigationReport:[]}]};return P(()=>m.visible,async i=>{i?$():p.value={infoList:[{investigationReport:[]}]}}),(i,e)=>{const l=d("el-input"),s=d("el-form-item"),u=d("el-button"),S=d("el-upload"),j=d("el-form"),x=d("el-dialog");return _(),J(x,{"model-value":b.visible,title:"填写安全人员信息",width:"600px","destroy-on-close":"",onClose:e[2]||(e[2]=n=>v("close"))},{footer:o(()=>[a(u,{type:"primary",loading:c.value,onClick:e[0]||(e[0]=n=>U(R.value))},{default:o(()=>e[4]||(e[4]=[y(" 提交 ")])),_:1},8,["loading"]),a(u,{onClick:e[1]||(e[1]=n=>v("close"))},{default:o(()=>e[5]||(e[5]=[y(" 关闭 ")])),_:1})]),default:o(()=>[a(j,{ref_key:"dialogFormRef",ref:R,model:p.value,"label-width":"auto","status-icon":"",class:"mt-16","label-suffix":":"},{default:o(()=>[(_(!0),V(T,null,E(p.value.infoList,(n,f)=>(_(),V("div",{key:f,class:"flex items-start"},[w("div",M,[a(s,{label:"项目安全负责人",prop:`infoList[${f}].username`,rules:[{required:!0,message:"请填写"}]},{default:o(()=>[a(l,{modelValue:n.username,"onUpdate:modelValue":t=>n.username=t,placeholder:"请填写"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),a(s,{label:"联系方式",prop:`infoList[${f}].contactInfo`,rules:[{required:!0,message:"请填写"}]},{default:o(()=>[a(l,{modelValue:n.contactInfo,"onUpdate:modelValue":t=>n.contactInfo=t,placeholder:"请填写",maxlength:11},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),a(s,{label:"项目保密协议",prop:`infoList[${f}].investigationReport`,rules:[{required:!0,message:"请上传"}]},{default:o(()=>[a(S,{"file-list":n.investigationReport,"onUpdate:fileList":t=>n.investigationReport=t,class:"w-full",action:r(k),limit:1,"on-success":t=>r(B)(t,p.value.infoList[f].investigationReport,!0),"before-upload":t=>r(I)(t,{types:r(L)}),accept:r(L).map(t=>`.${t}`).join(","),"on-preview":r(h)},{tip:o(()=>[w("div",Q," 支持"+H(r(D))+"文件 ",1)]),default:o(()=>[a(u,{type:"primary",plain:""},{default:o(()=>e[3]||(e[3]=[y("选择文件")])),_:1})]),_:2},1032,["file-list","onUpdate:fileList","action","on-success","before-upload","accept","on-preview"])]),_:2},1032,["prop"])])]))),128))]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{ee as default};