import{G as e,P as a,O as l,C as o,J as t,D as d,y as u,S as s,h as r}from"./element-plus-DSMJnpwa.js";import{d as i}from"./index-mv7arXuk.js";/* empty css                *//* empty css                     *//* empty css               *//* empty css               *//* empty css               *//* empty css                    *//* empty css                 *//* empty css                    */import{_ as n}from"./index-9_f6rNAP.js";import{g as p,u as m,a as c}from"./index-CY1MRuaW.js";import{u as f,g as v}from"./house-Dn7jiId_.js";import{B as _,aB as h,aE as g,H as y,L as j,M as V,P as C,O as b,Y as x,d as I}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";import"./index-CWCutGkV.js";import"./index-nsQnTcne.js";const M={class:"ResidentMainBox p-2 w-full"},B={class:"ResidentMainBody"},D={class:"addBuildingFormBody"},q={class:"formbox"},N=i(_({__name:"addDecoration",setup(i){const _=f(),N=I([]),U=h(),k=g(),w=I(),O=I({id:null,houseId:null,applyName:"",decorationCompany:"",decorationContent:"",decorationDeposit:null}),R={houseId:[{required:!0,message:"请选择具体房屋",trigger:"blur"}],applyName:[{required:!0,message:"请输入申请人",trigger:"blur"}],decorationDeposit:[{required:!0,message:"请输入装修押金",trigger:"blur"}],decorationContent:[{required:!0,message:"请输入装修内容",trigger:"blur"}]},E=I(),F=I([]);function G(e){e.length>=3?O.value.houseId=e.pop():O.value.houseId=null}_.getCurrentVilageTreeHouse().then(e=>{N.value=e,U.query.id&&(E.value=U.query.id,p(E.value).then(e=>{O.value={...O.value,...e.data};const a=v(N.value,O.value.houseId);F.value=a}))});const H=()=>{w.value?.validate(async e=>{e&&(E.value?m(O.value).then(()=>{r.success("编辑成功"),L()}):c(O.value).then(()=>{r.success("添加成功"),L()}))})};function L(){k.push({path:"/repair/decoration"})}return(r,i)=>{const p=t,m=o,c=l,f=d,v=a,_=u,h=e,g=s;return y(),j("div",M,[V(n,{title:"装修编辑"}),C("div",B,[V(g,null,{header:b(()=>[...i[5]||(i[5]=[C("div",{class:"title"},"基本信息",-1)])]),default:b(()=>[C("div",D,[C("div",q,[V(h,{ref_key:"formRef",ref:w,model:O.value,rules:R,"label-width":"120px"},{default:b(()=>[V(v,null,{default:b(()=>[V(c,{span:12},{default:b(()=>[V(m,{label:"房屋",prop:"houseId"},{default:b(()=>[V(p,{onChange:G,modelValue:F.value,"onUpdate:modelValue":i[0]||(i[0]=e=>F.value=e),options:N.value},null,8,["modelValue","options"])]),_:1})]),_:1}),V(c,{span:12},{default:b(()=>[V(m,{label:"申请人",prop:"applyName"},{default:b(()=>[V(f,{modelValue:O.value.applyName,"onUpdate:modelValue":i[1]||(i[1]=e=>O.value.applyName=e),modelModifiers:{trim:!0},placeholder:"请输入申请人"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),V(v,null,{default:b(()=>[V(c,{span:12},{default:b(()=>[V(m,{label:"装修公司",prop:"decorationCompany"},{default:b(()=>[V(f,{modelValue:O.value.decorationCompany,"onUpdate:modelValue":i[2]||(i[2]=e=>O.value.decorationCompany=e),modelModifiers:{trim:!0},placeholder:"请输入装修公司"},null,8,["modelValue"])]),_:1})]),_:1}),V(c,{span:12},{default:b(()=>[V(m,{label:"装修内容",prop:"decorationContent"},{default:b(()=>[V(f,{modelValue:O.value.decorationContent,"onUpdate:modelValue":i[3]||(i[3]=e=>O.value.decorationContent=e),modelModifiers:{trim:!0},placeholder:"请输入装修内容"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),V(v,null,{default:b(()=>[V(c,{span:12},{default:b(()=>[V(m,{label:"装修押金(元)",prop:"decorationDeposit"},{default:b(()=>[V(f,{modelValue:O.value.decorationDeposit,"onUpdate:modelValue":i[4]||(i[4]=e=>O.value.decorationDeposit=e),modelModifiers:{trim:!0},placeholder:"请输入装修押金"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),V(m,null,{default:b(()=>[V(_,{type:"primary",onClick:H},{default:b(()=>[...i[6]||(i[6]=[x("提交",-1)])]),_:1}),V(_,{onClick:L},{default:b(()=>[...i[7]||(i[7]=[x("返回",-1)])]),_:1})]),_:1})]),_:1},8,["model"])])])]),_:1})])])}}}),[["__scopeId","data-v-8768afd0"]]);export{N as default};
