import{a as M}from"./addOrganize-08c738d9-1779868775780v=1.0.0.js";import{h as R}from"./account-ec8d0b54-1779868775780v=1.0.0.js";import{g as T}from"./department-b547eda3-1779868775780v=1.0.0.js";import{b as J}from"./index-0f3e2c06-1779868775780v=1.0.0.js";import{E as P}from"./eleVendor-dbf96bf3-1779868775780v=1.0.0.js";import{l as j,a as d,e as E,d as $,ah as c,m as f,M as b,O as s,q as _,U as l,u as o,p as G,F as H,a7 as K,S as F}from"./vendor-98154105-1779868775780v=1.0.0.js";import{_ as Q}from"./_plugin-vue_export-helper-8c5478df-1779868775780v=1.0.0.js";import"./eleValidate-dfbd5aa5-1779868775780v=1.0.0.js";const W={class:"form\u2014container"},X={class:"el-dialog__footer"},Y={class:"dialog-footer"},Z=j({__name:"organizeDepartmentForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(I,{emit:V}){const p=J(),g=d();let y=I;const m=V;d(p.query.organUnitId);const n=E({get(){return A(y.value)},set(t){m("update:value",t)}}),C=E({get(){return y.loading},set(t){m("update:loading",t)}}),i=d([]),B=async t=>{t.validate(async(e,u)=>{if(e){let r=k();r.accountId===""&&delete r.accountId,m("submit",r)}})},D=()=>{m("cancel")},A=t=>t,k=()=>JSON.parse(JSON.stringify(n.value)),U=async t=>{let u=await R({page:1,size:1e4,organUnitId:t});u.code===0?i.value=u.data.listData:P.warning(u.msg)},x=t=>{let e=i.value.filter(u=>u.accountId==t);e.length>0&&(n.value.contact=e[0].phone)},h=d([]),w=d({label:"name",children:"children"}),O=t=>{},N=async t=>{let e=await T(t);e.code===0&&(h.value=e.data)};return $(async()=>{p.query.organUnitId&&(U(p.query.organUnitId),N(p.query.organUnitId))}),(t,e)=>{const u=c("el-input"),r=c("el-form-item"),q=c("el-tree-select"),z=c("el-option"),S=c("el-select"),v=c("el-button"),L=c("el-form");return f(),b(L,{model:o(n),rules:o(M),ref_key:"ruleFormRef",ref:g,"label-position":"right","scroll-to-error":!0,"label-width":"140px"},{default:s(()=>[_("div",W,[l(r,{label:"\u90E8\u95E8\u540D\u79F0",prop:"name"},{default:s(()=>[l(u,{modelValue:o(n).name,"onUpdate:modelValue":e[0]||(e[0]=a=>o(n).name=a),placeholder:"\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u4E0A\u7EA7\u90E8\u95E8",prop:"pid"},{default:s(()=>[l(q,{modelValue:o(n).pid,"onUpdate:modelValue":e[1]||(e[1]=a=>o(n).pid=a),"node-key":"departmentId",data:o(h),props:o(w),"render-after-expand":!1,"check-strictly":!0,"show-checkbox":!0,"highlight-current":!0,onCurrentChange:O,style:{width:"100%"}},null,8,["modelValue","data","props"])]),_:1}),l(r,{label:"\u90E8\u95E8\u7BA1\u7406\u5458",prop:"accountId"},{default:s(()=>[l(S,{modelValue:o(n).accountId,"onUpdate:modelValue":e[2]||(e[2]=a=>o(n).accountId=a),placeholder:"\u8BF7\u9009\u62E9\u90E8\u95E8\u7BA1\u7406\u5458",onChange:x},{default:s(()=>[(f(!0),G(H,null,K(o(i),a=>(f(),b(z,{key:a.accountId,label:a.accountName,value:a.accountId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(r,{label:"\u624B\u673A\u53F7",prop:"contact"},{default:s(()=>[l(u,{modelValue:o(n).contact,"onUpdate:modelValue":e[3]||(e[3]=a=>o(n).contact=a),placeholder:"\u8BF7\u8F93\u5165\u90E8\u95E8\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1})]),_("div",X,[_("span",Y,[l(v,{onClick:D},{default:s(()=>[F("\u53D6\u6D88")]),_:1}),l(v,{type:"primary",loading:o(C),onClick:e[4]||(e[4]=a=>B(o(g)))},{default:s(()=>[F(" \u786E\u8BA4 ")]),_:1},8,["loading"])])])]),_:1},8,["model","rules"])}}});const se=Q(Z,[["__scopeId","data-v-ace2388a"]]);export{se as default};
