Mars3D-screen_web/dist/assets/js/engineerAdd-557d48ce.js
2023-10-10 09:36:22 +08:00

2 lines
9.5 KiB
JavaScript

import{d as K,r as d,w as L,b as O,c,a5 as G,e as h,f as N,h as s,i as t,g as o,S as M,k as w,l as y,F as H,j as Q,t as A,a4 as W,bR as X,E as k,q as Z,s as ee,_ as le}from"./index-ccab2584.js";import{F as ue}from"./FilesUpload-88b3af60.js";import"./upload-a8c669b8.js";const U=_=>(Z("data-v-60c93548"),_=_(),ee(),_),oe={class:"overview"},se={class:"title-detail"},te=U(()=>o("span",null,"\u65B0\u589E\u5371\u5927\u5DE5\u7A0B",-1)),ae={class:"basic-info"},ne=U(()=>o("div",{class:"content-title"},"\u57FA\u672C\u4FE1\u606F",-1)),ie={class:"form-content"},re={class:"row"},ce={class:"col"},de={class:"col"},pe={class:"row"},ve={class:"col"},me={class:"col"},_e={class:"row"},fe={class:"col"},Fe={class:"col"},ge={class:"row"},he={class:"col"},ye={class:"col"},Be={class:"row"},De={class:"col"},Ve={class:"basic-info"},be=U(()=>o("div",{class:"content-title"},"\u5371\u5927\u5DE5\u7A0B\u8D44\u6599",-1)),Ce={class:"form-content"},Ee={class:"row"},Se={class:"col"},we={class:"switch-box"},Ae={class:"col"},Ue={class:"switch-box"},xe={class:"row"},Te={class:"col"},Ye={class:"switch-box"},Re=K({__name:"engineerAdd",props:{addVisible:Boolean,searchSn:String,activeValue:String,relativeId:String},emits:["update:addVisible","confirm"],setup(_,{emit:D}){const f=_,x=d(""),p=d({files:[]}),V=d(!1),b=d([]),q=d({engineeringName:[{required:!0,message:"\u8BF7\u8F93\u5165",trigger:"blur"}],type:[{required:!0,message:"\u8BF7\u8F93\u5165",trigger:"change"}],typeDescribe:[{required:!0,message:"\u8BF7\u8F93\u5165",trigger:"blur"}]}),C=d(),z=d([]),l=d({technicalDisclosureFile:[],securityConstructionSchemeFile:[],specialConstructionSchemeFile:[]}),v=d(!1),I=n=>{p.value.files=n.map(e=>(e.label=p.value.dictLabel,e)),p.value.files,l.value[x.value]=p.value.files},E=async n=>{if(V.value=!0,x.value=n,l.value[n],l.value[n].length>0){let e=[];l.value[n].map(a=>{a.response?e.push({response:{...a.response,url:a.response.url},name:a.response.originalFilename,url:a.response.url,size:+a.response.size,type:a.response.contentType}):e.push({response:{...a,url:a.fileUrl},name:a.fileName,url:a.fileUrl,size:+a.fileSize,type:a.contentType}),delete a.response}),p.value.files=e,p.value.files}else p.value.files=[]},$=async()=>{const{result:n}=await W({dictType:"dangerous_engineer_type"});if(n.length>0){let e=[];n.map(a=>{e.push({label:a.dictValue,value:a.dictLabel})}),b.value.length=0,b.value.push(...e)}},j=async n=>{!n||await n.validate(async(e,a)=>{if(e){l.value;let r={...l.value,technicalDisclosureFile:"",securityConstructionSchemeFile:"",specialConstructionSchemeFile:""};f.activeValue=="eng"?r.engineeringSn=f.searchSn:f.activeValue=="project"&&(r.projectSn=f.searchSn);for(let i in r)if(i=="technicalDisclosureFile"||i=="securityConstructionSchemeFile"||i=="specialConstructionSchemeFile"){let B=[];l.value[i].map(F=>{F.response&&B.push({fileName:F.response.originalFilename,fileUrl:F.response.url})}),r[i]=JSON.stringify(B)}r.planRange&&(r.constructionPlanStartTime=r.planRange[0],r.constructionPlanEndTime=r.planRange[1]),r.constructionRange&&(r.constructionStartTime=r.constructionRange[0],r.constructionEndTime=r.constructionRange[1]),(await X(r)).success&&(k.success("\u64CD\u4F5C\u6210\u529F"),v.value=!1,D("confirm"))}else k({showClose:!0,message:"\u8BF7\u5B8C\u5584\u8868\u5355\u4FE1\u606F\uFF01",type:"error"})})},T=()=>{v.value=!1,D("update:addVisible",!1)};return L(()=>f.addVisible,n=>{n&&(n&&($(),z.value=[],l.value={technicalDisclosureFile:[],securityConstructionSchemeFile:[],specialConstructionSchemeFile:[]},setTimeout(function(){var e;(e=C.value)==null||e.clearValidate()},200)),v.value=n)}),L(()=>v,n=>{D("update:addVisible",n)}),O(()=>{}),(n,e)=>{const a=c("close"),r=c("el-icon"),m=c("el-input"),i=c("el-form-item"),B=c("el-option"),F=c("el-select"),Y=c("el-date-picker"),S=c("el-switch"),g=c("el-button"),P=c("el-form"),J=c("el-dialog"),R=G("auth");return h(),N("div",oe,[s(J,{"show-close":!1,modelValue:v.value,"onUpdate:modelValue":e[17]||(e[17]=u=>v.value=u),width:"1565px",onClose:T},{title:t(()=>[o("div",se,[te,s(r,null,{default:t(()=>[s(a,{onClick:T})]),_:1})])]),footer:t(()=>[M((h(),w(g,{class:"cancelButtonStyle",onClick:e[15]||(e[15]=u=>v.value=!1)},{default:t(()=>[y("\u53D6\u6D88")]),_:1})),[[R,"dangerous_engineering_add"]]),M((h(),w(g,{type:"primary",onClick:e[16]||(e[16]=u=>j(C.value))},{default:t(()=>[y(" \u4FDD\u5B58 ")]),_:1})),[[R,"dangerous_engineering_add"]])]),default:t(()=>[s(P,{ref_key:"formRef",ref:C,model:l.value,"label-width":"auto",rules:q.value,class:"basic-form",size:"default"},{default:t(()=>[o("div",ae,[ne,o("div",ie,[o("div",re,[o("div",ce,[s(i,{label:"\u5371\u5927\u5DE5\u7A0B\u540D\u79F0:",prop:"engineeringName"},{default:t(()=>[s(m,{modelValue:l.value.engineeringName,"onUpdate:modelValue":e[0]||(e[0]=u=>l.value.engineeringName=u),style:{width:"380px"},placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),o("div",de,[s(i,{label:"\u5371\u5927\u5DE5\u7A0B\u7C7B\u522B:",prop:"type"},{default:t(()=>[s(F,{modelValue:l.value.type,"onUpdate:modelValue":e[1]||(e[1]=u=>l.value.type=u),placeholder:"\u8BF7\u9009\u62E9",style:{width:"380px"}},{default:t(()=>[(h(!0),N(H,null,Q(b.value,u=>(h(),w(B,{key:u.value,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})])]),o("div",pe,[o("div",ve,[s(i,{label:"\u5371\u5927\u5DE5\u7A0B\u6982\u51B5:",prop:"engineeringSurvey"},{default:t(()=>[s(m,{modelValue:l.value.engineeringSurvey,"onUpdate:modelValue":e[2]||(e[2]=u=>l.value.engineeringSurvey=u),style:{width:"380px"},placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),o("div",me,[s(i,{label:"\u7C7B\u522B\u63CF\u8FF0:",prop:"typeDescribe"},{default:t(()=>[s(m,{modelValue:l.value.typeDescribe,"onUpdate:modelValue":e[3]||(e[3]=u=>l.value.typeDescribe=u),style:{width:"380px"},placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})])]),o("div",_e,[o("div",fe,[s(i,{label:"\u65BD\u5DE5\u90E8\u4F4D:",prop:"constructionLocation"},{default:t(()=>[s(m,{modelValue:l.value.constructionLocation,"onUpdate:modelValue":e[4]||(e[4]=u=>l.value.constructionLocation=u),style:{width:"380px"},placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),o("div",Fe,[s(i,{label:"\u8BA1\u5212\u65F6\u95F4:",prop:"planRange"},{default:t(()=>[s(Y,{style:{width:"360px"},modelValue:l.value.planRange,"onUpdate:modelValue":e[5]||(e[5]=u=>l.value.planRange=u),"range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",type:"daterange",placeholder:"\u8BF7\u9009\u62E9\u65F6\u95F4"},null,8,["modelValue"])]),_:1})])]),o("div",ge,[o("div",he,[s(i,{label:"\u65BD\u5DE5\u65F6\u95F4:",prop:"constructionRange"},{default:t(()=>[s(Y,{style:{width:"360px"},modelValue:l.value.constructionRange,"onUpdate:modelValue":e[6]||(e[6]=u=>l.value.constructionRange=u),"range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",type:"daterange",placeholder:"\u8BF7\u9009\u62E9\u65F6\u95F4"},null,8,["modelValue"])]),_:1})]),o("div",ye,[s(i,{label:"\u8D23\u4EFB\u4EBA:",prop:"personLiable"},{default:t(()=>[s(m,{modelValue:l.value.personLiable,"onUpdate:modelValue":e[7]||(e[7]=u=>l.value.personLiable=u),style:{width:"380px"},placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})])]),o("div",Be,[o("div",De,[s(i,{label:"\u8D23\u4EFB\u5206\u5305\u5355\u4F4D:",prop:"responsibilityCompany"},{default:t(()=>[s(m,{modelValue:l.value.responsibilityCompany,"onUpdate:modelValue":e[8]||(e[8]=u=>l.value.responsibilityCompany=u),style:{width:"380px"},placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})])])])]),o("div",Ve,[be,o("div",Ce,[o("div",Ee,[o("div",Se,[s(i,{label:"\u5B89\u5168\u6280\u672F\u4EA4\u5E95:",prop:"devName"},{default:t(()=>[o("div",we,[s(S,{modelValue:l.value.technicalDisclosureType,"onUpdate:modelValue":e[9]||(e[9]=u=>l.value.technicalDisclosureType=u),"active-value":2,"inactive-value":1},null,8,["modelValue"]),o("span",null,A(l.value.technicalDisclosureType==2?"\u5DF2\u5B8C\u6210":"\u672A\u5B8C\u6210"),1),s(g,{type:"primary",onClick:e[10]||(e[10]=u=>E("technicalDisclosureFile"))},{default:t(()=>[y("\u70B9\u51FB\u4E0A\u4F20")]),_:1})])]),_:1})]),o("div",Ae,[s(i,{label:"\u5B89\u5168\u4E13\u9879\u65BD\u5DE5\u65B9\u6848\u53CA\u9644\u4EF6:",prop:"devNumber"},{default:t(()=>[o("div",Ue,[s(S,{modelValue:l.value.securityConstructionSchemeType,"onUpdate:modelValue":e[11]||(e[11]=u=>l.value.securityConstructionSchemeType=u),"active-value":2,"inactive-value":1},null,8,["modelValue"]),o("span",null,A(l.value.securityConstructionSchemeType==2?"\u5DF2\u5B8C\u6210":"\u672A\u5B8C\u6210"),1),s(g,{type:"primary",onClick:e[12]||(e[12]=u=>E("securityConstructionSchemeFile"))},{default:t(()=>[y("\u70B9\u51FB\u4E0A\u4F20")]),_:1})])]),_:1})])]),o("div",xe,[o("div",Te,[s(i,{label:"\u4E13\u9879\u65BD\u5DE5\u65B9\u6848\u4EA4\u5E95:",prop:"devName"},{default:t(()=>[o("div",Ye,[s(S,{modelValue:l.value.specialConstructionSchemeType,"onUpdate:modelValue":e[13]||(e[13]=u=>l.value.specialConstructionSchemeType=u),"active-value":2,"inactive-value":1},null,8,["modelValue"]),o("span",null,A(l.value.specialConstructionSchemeType==2?"\u5DF2\u5B8C\u6210":"\u672A\u5B8C\u6210"),1),s(g,{type:"primary",onClick:e[14]||(e[14]=u=>E("specialConstructionSchemeFile"))},{default:t(()=>[y("\u70B9\u51FB\u4E0A\u4F20")]),_:1})])]),_:1})])])])])]),_:1},8,["model","rules"])]),_:1},8,["modelValue"]),s(ue,{modelValue:V.value,"onUpdate:modelValue":e[18]||(e[18]=u=>V.value=u),"onUpdate:files":I,files:p.value.files,reset:!0},null,8,["modelValue","files"])])}}});const ke=le(Re,[["__scopeId","data-v-60c93548"]]);export{ke as default};