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