import{P as e,O as l,C as a,D as t,Z as r,_ as u,L as s,M as o,y as d,G as p,h as i}from"./element-plus-DSMJnpwa.js";import{d as c}from"./index-mv7arXuk.js";/* empty css                     *//* empty css               *//* empty css                  *//* empty css               *//* empty css                 *//* empty css                       *//* empty css               */import{_ as m}from"./index-9_f6rNAP.js";import{l as n,a as v,u as _}from"./index-Dg6crvMG.js";import{B as f,g as j,a4 as y,aE as g,aB as b,H as V,L,M as h,P as B,O as x,F as k,ab as q,u as I,I as N,Y as T,Z as w,X as U,d as C}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";const D={class:"AddBuildingBox"},M={class:"AddBuildingBody"},O={class:"addBuildingFormBody"},P=c(f({__name:"addRepairlist",setup(c){const{proxy:f}=j(),{com_repair_project_types:P}=y(f?.useDict("com_repair_project_types")),{com_repair_project_status:A}=y(f?.useDict("com_repair_project_status")),{com_repair_project_level:F}=y(f?.useDict("com_repair_project_level")),R=g(),Z=b(),E=C(),G=C({id:null,projectName:null,parentId:"",projectType:"0",projectLevel:"0",status:"0"}),H=C({projectName:[{required:!0,message:"请选择房屋",trigger:"blur"}],parentId:[{required:!0,message:"请选择房屋",trigger:"blur"}],projectType:[{required:!0,message:"请选择房屋",trigger:"blur"}],projectLevel:[{required:!0,message:"请选择房屋",trigger:"blur"}],status:[{required:!0,message:"请输入名称",trigger:"blur"}]}),J=C(null),S=C([]);function X(e){const l=S.value.find(l=>l.id===e);l&&(G.value.projectType=l.projectType)}n().then(e=>{const l=e.rows.filter(e=>0===e.projectLevel);if(S.value=l,Z.query.id){J.value=Z.query.id;const l=e.rows.find(e=>e.id===J.value);l&&(G.value={...G.value,...l,projectLevel:String(l.projectLevel)})}});const Y=()=>{E.value?.validate(async e=>{e&&(J.value?_(G.value).then(()=>{i.success("编辑成功"),z()}):v(G.value).then(()=>{i.success("添加成功"),z()}))})},z=()=>{R.push({path:"/system/repairProjectList"})};return(i,c)=>{const n=t,v=a,_=l,f=u,j=r,y=e,g=o,b=s,C=d,R=p;return V(),L("div",D,[h(m,{title:J.value?"编辑车辆信息":"添加车辆信息"},null,8,["title"]),B("div",M,[c[7]||(c[7]=B("div",{class:"title"},"基本信息",-1)),B("div",O,[h(R,{class:"formBody","label-position":"right",ref_key:"formRef",ref:E,model:G.value,rules:H.value,"label-width":"130px"},{default:x(()=>[h(y,null,{default:x(()=>[h(_,{span:11},{default:x(()=>[h(v,{label:"维修项目名",prop:"projectName"},{default:x(()=>[h(n,{modelValue:G.value.projectName,"onUpdate:modelValue":c[0]||(c[0]=e=>G.value.projectName=e),modelModifiers:{trim:!0},placeholder:"请输入维修项目名"},null,8,["modelValue"])]),_:1})]),_:1}),h(_,{span:2}),h(_,{span:11},{default:x(()=>[h(v,{label:"项目类型",prop:"projectType"},{default:x(()=>[h(j,{disabled:"1"===G.value.projectLevel,modelValue:G.value.projectType,"onUpdate:modelValue":c[1]||(c[1]=e=>G.value.projectType=e)},{default:x(()=>[(V(!0),L(k,null,q(I(P),e=>(V(),N(f,{key:e.id,value:e.value},{default:x(()=>[T(w(e.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["disabled","modelValue"])]),_:1})]),_:1})]),_:1}),h(y,null,{default:x(()=>[h(_,{span:11},{default:x(()=>[h(v,{label:"项目层级",prop:"projectLevel"},{default:x(()=>[h(j,{modelValue:G.value.projectLevel,"onUpdate:modelValue":c[2]||(c[2]=e=>G.value.projectLevel=e)},{default:x(()=>[(V(!0),L(k,null,q(I(F),e=>(V(),N(f,{key:e.id,value:e.value},{default:x(()=>[T(w(e.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),h(_,{span:2}),h(_,{span:11},{default:x(()=>[h(v,{label:"项目状态",prop:"status"},{default:x(()=>[h(j,{modelValue:G.value.status,"onUpdate:modelValue":c[3]||(c[3]=e=>G.value.status=e)},{default:x(()=>[(V(!0),L(k,null,q(I(A),e=>(V(),N(f,{key:e.id,value:e.value},{default:x(()=>[T(w(e.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),"1"===G.value.projectLevel?(V(),N(y,{key:0},{default:x(()=>[h(_,{span:11},{default:x(()=>[h(v,{label:"隶属父级",prop:"email"},{default:x(()=>[h(b,{onChange:X,modelValue:G.value.parentId,"onUpdate:modelValue":c[4]||(c[4]=e=>G.value.parentId=e),placeholder:"请选择隶属父级",style:{width:"240px"}},{default:x(()=>[(V(!0),L(k,null,q(S.value,e=>(V(),N(g,{key:e.id,label:e.projectName,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})):U("",!0),h(v,{style:{"margin-top":"30px"}},{default:x(()=>[h(C,{type:"primary",onClick:Y},{default:x(()=>[...c[5]||(c[5]=[T("提交",-1)])]),_:1}),h(C,{onClick:z},{default:x(()=>[...c[6]||(c[6]=[T("返回",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])}}}),[["__scopeId","data-v-47c75fdd"]]);export{P as default};
