import{T as A,a as b}from"./tabbarLeftItem-d60bd7c0-1779868775780v=1.0.0.js";import E from"./accountBaseInfoPro-24840e28-1779868775780v=1.0.0.js";import N from"./accountRole-53c8486d-1779868775780v=1.0.0.js";import{d as R,u as S,e as q}from"./account-ec8d0b54-1779868775780v=1.0.0.js";import P from"./asyncApplication-bd84e3b6-1779868775780v=1.0.0.js";import{u as D}from"./useFormEdit-42a9503c-1779868775780v=1.0.0.js";import{b as L}from"./index-0f3e2c06-1779868775780v=1.0.0.js";import{E as c}from"./eleVendor-dbf96bf3-1779868775780v=1.0.0.js";import{l as U,a as m,e as M,d as V,ah as $,m as p,M as f,O as y,U as v,u as n,B as s,R as I}from"./vendor-98154105-1779868775780v=1.0.0.js";import"./_plugin-vue_export-helper-8c5478df-1779868775780v=1.0.0.js";import"./Imgs-fee891de-1779868775780v=1.0.0.js";import"./upload-a2386bf9-1779868775780v=1.0.0.js";import"./addOrganAccount-f8281166-1779868775780v=1.0.0.js";import"./eleValidate-dfbd5aa5-1779868775780v=1.0.0.js";import"./Cascader-42286393-1779868775780v=1.0.0.js";import"./organize-df1743e7-1779868775780v=1.0.0.js";import"./department-b547eda3-1779868775780v=1.0.0.js";import"./index-f89521bb-1779868775780v=1.0.0.js";import"./organSelect-aa5d969e-1779868775780v=1.0.0.js";import"./systemManage-d67b09c0-1779868775780v=1.0.0.js";import"./tabs-e9b8af2b-1779868775780v=1.0.0.js";import"./unit-3af479b6-1779868775780v=1.0.0.js";const O=U({name:"organManageAccountEdit"}),me=U({...O,setup(W){const{closeCurrent:g,setTitle:j}=D(),i=L(),d=m(""),_=m(""),C=M(()=>!Boolean(d.value)),l=m("1"),k=r=>{},o=m({accountId:"",accountName:"",avatar:"",phone:"",sex:3,identityCard:"",account:"",password:"",status:1,organUnitId:"",areaId:"",departmentId:"",position:"",accountType:null,identitys:"",identitysList:[],socialCreditCode:null,deptName:null,codeRole:"",thirdDeptType:"",thirdRegType:"",organFormArr:[],organUnitTypes:"",organUnitIds:"",departmentIds:"",positions:"",dictIds:"",organUnitDictIds:""}),t=m(!1),F=()=>{g()},T=async r=>{t.value=!0;try{let e=R,u="\u66F4\u65B0\u6210\u529F",a=await e(r);a.code==0?(c({type:"success",message:`${u}!`}),l.value="2"):c.warning(a.msg),t.value=!1}catch{t.value=!1}},w=()=>{g()},x=async r=>{t.value=!0;try{let e=S,u="\u66F4\u65B0\u6210\u529F",a=await e(r);a.code==0?(c({type:"success",message:`${u}!`}),g()):c.warning(a.msg),t.value=!1}catch{t.value=!1}},B=async r=>{let e=await q(r);if(e.code!=0){c.error(e.msg);return}for(const u in o.value)u!=="password"&&(e.data[u]===0&&(e.data[u]=null),o.value[u]=e.data[u]);o.value.sex=Number(e.data.sex),o.value.accountType=Number(e.data.accountType),o.value,o.value.status=Number(e.data.status)};return V(()=>{i.query.areaId&&(_.value=i.query.areaId,o.value.areaId=i.query.areaId),i.query.accountId&&(d.value=i.query.accountId,B(d.value))}),(r,e)=>{const u=$("PaIndexPage");return p(),f(u,{filterWidth:240},{treeCard:y(()=>[v(A,{value:n(l),"onUpdate:value":e[0]||(e[0]=a=>s(l)?l.value=a:null),onTabClick:k},{default:y(()=>[v(b,{name:"1",label:"\u57FA\u672C\u4FE1\u606F","icon-name":"icon_addCard_base_info"}),v(b,{name:"2",label:"\u5E94\u7528\u540C\u6B65",disabled:n(C),"icon-name":"icon_addCard_base_info"},null,8,["disabled"]),v(b,{name:"4",label:"\u89D2\u8272\u4FE1\u606F",disabled:n(C),"icon-name":"icon_addCard_sell_info"},null,8,["disabled"])]),_:1},8,["value"])]),default:y(()=>[n(l)=="1"?(p(),f(E,{key:0,value:n(o),"onUpdate:value":e[1]||(e[1]=a=>s(o)?o.value=a:null),loading:n(t),"onUpdate:loading":e[2]||(e[2]=a=>s(t)?t.value=a:null),onCancel:F,onSubmit:T},null,8,["value","loading"])):I("",!0),n(l)=="2"?(p(),f(P,{key:1,accountId:n(d),value:n(o),"onUpdate:value":e[3]||(e[3]=a=>s(o)?o.value=a:null),loading:n(t),"onUpdate:loading":e[4]||(e[4]=a=>s(t)?t.value=a:null),onCancel:F,onSubmit:T},null,8,["accountId","value","loading"])):I("",!0),n(l)=="4"?(p(),f(N,{key:2,accountId:n(d),onCancel:w,loading:n(t),"onUpdate:loading":e[5]||(e[5]=a=>s(t)?t.value=a:null),onSubmit:x},null,8,["accountId","loading"])):I("",!0)]),_:1})}}});export{me as default};
