import{_ as I,d as G,m as p,cq as L,Q as z,r as s,ag as O,o as c,A as b,x as a,B as Q,u as i,cr as h,h as t,a as q,c as H,F as P,y as W,H as D,G as J,b as K}from"./index.e80c366d.js";import{h as M}from"./index.a292e2d1.js";import{u as X}from"./useCompany.1643e7d1.js";var v=(n=>(n[n.update=0]="update",n[n.preview=1]="preview",n[n.create=2]="create",n))(v||{});const Y={class:"flex w-full justify-end"},Z=G({__name:"role-modal",emits:["finance-save"],setup(n,{expose:C,emit:g}){const d=p(!1),f=p(v.create),y=p(null);let V="";const{run:R,data:N,loading:w}=L({initalData:[],isList:!0}),k={nickname:"",mobile:"",roleid:""},o=p({...k}),F=p({}),{currentCompany:x}=X(),A=z(()=>{const u="\u516C\u53F8\u8D26\u53F7\u89D2\u8272\u8BBE\u7F6E";switch(f.value){case v.create:return"\u521B\u5EFA"+u;case v.preview:return"\u67E5\u770B"+u;default:return"\u4FEE\u6539"+u}});function S(){y.value.validate(u=>{!u||(g("finance-save",{companyNo:V,relaComNo:x.value.companyNo,...i(o)},i(f)),d.value=!1)})}return C({onDisplay:(u,e)=>{if(o.value={...k},d.value=!0,f.value=e,V=u.companyCode,R(M({size:"1000",level:"3",noRale:!0})),u){const{mobile:m,nickname:r,roleid:E,id:B,companyName:_}=u;F.value=_,o.value={mobile:m,nickname:r,roleid:E,id:B}}}}),(u,e)=>{const m=s("ElInput"),r=s("ElFormItem"),E=s("ElRadio"),B=s("ElRadioGroup"),_=s("ElButton"),U=s("ElDialog"),j=O("loading");return c(),b(U,{center:"",modelValue:d.value,"onUpdate:modelValue":e[5]||(e[5]=l=>d.value=l),title:A.value,"close-on-click-modal":!1},{default:a(()=>[Q((c(),b(i(h),{ref_key:"formRef",ref:y,labelWidth:"100px","label-position":"left",model:o.value,rules:{},disabled:f.value===i(v).preview},{default:a(()=>[t(r,{label:"\u771F\u5B9E\u59D3\u540D",prop:"nickname"},{default:a(()=>[t(m,{placeholder:"\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D",modelValue:o.value.nickname,"onUpdate:modelValue":e[0]||(e[0]=l=>o.value.nickname=l),disabled:""},null,8,["modelValue"])]),_:1}),t(r,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:a(()=>[t(m,{placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",modelValue:o.value.mobile,"onUpdate:modelValue":e[1]||(e[1]=l=>o.value.mobile=l),disabled:""},null,8,["modelValue"])]),_:1}),F.value?(c(),b(r,{key:0,label:"\u4F9B\u5E94\u5546\u516C\u53F8",prop:"companyName"},{default:a(()=>[t(m,{placeholder:"\u8BF7\u8F93\u5165\u4F9B\u5E94\u5546\u516C\u53F8",value:F.value,disabled:""},null,8,["value"])]),_:1})):q("v-if",!0),t(r,{label:"\u89D2\u8272",prop:"roleid"},{default:a(()=>[t(B,{modelValue:o.value.roleid,"onUpdate:modelValue":e[2]||(e[2]=l=>o.value.roleid=l)},{default:a(()=>[(c(!0),H(P,null,W(i(N),l=>(c(),b(E,{disabled:String(l.status)==="0",key:l.id,label:l.id},{default:a(()=>[D(J(l.role_name),1)]),_:2},1032,["disabled","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(r,null,{default:a(()=>[K("div",Y,[t(_,{onClick:e[3]||(e[3]=()=>d.value=!1)},{default:a(()=>[D("\u53D6\u6D88")]),_:1}),t(_,{type:"primary",onClick:e[4]||(e[4]=()=>S())},{default:a(()=>[D("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model","disabled"])),[[j,i(w)]])]),_:1},8,["modelValue","title"])}}});var $=I(Z,[["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/supplierManage/supplierAccoutQuery/components/role-modal.vue"]]),ae=Object.freeze(Object.defineProperty({__proto__:null,default:$},Symbol.toStringTag,{value:"Module"}));export{v as M,$ as R,ae as r};
