Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

2 rindas
5.7KB

  1. import{d as ee,G as te,D as _,b as D,r as i,a0 as A,o as le,c as o,e as d,f as g,h as a,i as l,F as L,J as h,u as I,I as k,j as m,t as y,g as R,U as ae,$ as se,aw as oe,ax as ne,x as ue}from"./index.622ee9e7.js";const re=["onClick"],ie=["onClick"],de=ee({name:"memberManage"}),pe=Object.assign(de,{setup(me){const{proxy:w}=ue(),U=te(_.userStore).userInfo,r=D({name:void 0,userRoleList:void 0}),E=i(),B=i(0),F=D([{label:"\u5E8F\u53F7",type:"index",width:"80"},{label:"\u59D3\u540D",key:"name",prop:"name"},{label:"\u89D2\u8272",slot:"userRoleList",minWidth:"200"},{label:"\u72B6\u6001",key:"status",prop:"status",width:"120",render:s=>[A("span",{class:["dot mr-4",`${s.status==="ENABLE"?"bg-success":"bg-danger"}`]}),A("span",{class:`${s.status==="ENABLE"?"text-success":"text-danger"}`},s.status==="ENABLE"?"\u542F\u7528":"\u7981\u7528")]},{label:"\u64CD\u4F5C",slot:"action",width:"120",fixed:"right"}]),C=i(),c=async(s=E.value.pageParams)=>{const t=await se({...s,...r,orgCode:U.value.empPosUnitCode});C.value=t.data.records,B.value=t.data.total},T=()=>{c()},q=()=>{r.name=void 0,r.userRoleList=void 0,c({pageNumber:1,pageSize:10})},p=i(!1),V=i(),n=i({status:!0}),z=s=>{V.value=s.name,n.value={...s,userRoleList:s.userRoleList.map(t=>t.id),status:s.status==="ENABLE"},p.value=!0},j={phoneNo:[{required:!0,pattern:/^1[3456789]\d{9}$/,message:"\u624B\u673A\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E",trigger:"blur"}],userRoleList:[{required:!0,message:"\u8BF7\u9009\u62E9\u7528\u6237\u89D2\u8272",trigger:"change"}],status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:"change"}]},N=i(),G=async s=>{!s||await s.validate(async t=>{if(t){const b={...n.value,status:n.value.status?"ENABLE":"DISABLE",userRoleInfoList:_.userStore.roleListDict.filter(u=>n.value.userRoleList.includes(u.id)).map(u=>({id:u.id,name:u.name}))};await oe(b),w.$message.success("\u7F16\u8F91\u6210\u529F\uFF01"),p.value=!1,c()}})},M=s=>{const t=s.status==="DISABLE"?"\u542F\u7528":"\u7981\u7528";w.$messageBox.confirm(`\u662F\u5426${t}\u8BE5\u7528\u6237?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await ne({employeeCode:s.employeeCode,operation:s.status==="DISABLE"?"ENABLE":"DISABLE",userId:s.userId}),w.$message.success(`${t}\u6210\u529F\uFF01`),c()})};return le(()=>{_.userStore.setRoleStore(),c()}),(s,t)=>{const b=o("el-input"),u=o("el-form-item"),x=o("el-col"),P=o("el-option"),J=o("el-select"),v=o("el-button"),O=o("el-row"),S=o("el-form"),$=o("el-card"),W=o("el-tag"),H=o("table-list"),K=o("el-checkbox"),Q=o("el-checkbox-group"),X=o("el-switch"),Y=o("el-dialog");return d(),g(L,null,[a($,{shadow:"never",class:"search mb-16"},{default:l(()=>[a(S,{"label-suffix":":",model:r,size:"small"},{default:l(()=>[a(O,{gutter:16},{default:l(()=>[a(x,{span:8},{default:l(()=>[a(u,{label:"\u59D3\u540D"},{default:l(()=>[a(b,{modelValue:r.name,"onUpdate:modelValue":t[0]||(t[0]=e=>r.name=e),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),a(x,{span:8},{default:l(()=>[a(u,{label:"\u7528\u6237\u89D2\u8272"},{default:l(()=>[a(J,{modelValue:r.userRoleList,"onUpdate:modelValue":t[1]||(t[1]=e=>r.userRoleList=e),style:{width:"100%"},placeholder:"\u8BF7\u9009\u62E9",multiple:!0,"value-key":"id"},{default:l(()=>[(d(!0),g(L,null,h(I(_).userStore.roleListDict,(e,f)=>(d(),k(P,{key:f,label:e.name,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(x,{span:8},{default:l(()=>[a(u,{class:"btn"},{default:l(()=>[a(v,{type:"primary",onClick:T},{default:l(()=>[m("\u67E5\u8BE2")]),_:1}),a(v,{type:"info",onClick:q},{default:l(()=>[m("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a($,{title:"\u89D2\u8272\u5217\u8868",shadow:"never"},{default:l(()=>[a(H,{ref_key:"tableListRef",ref:E,column:F,data:C.value,total:B.value,onGetTableData:c},{userRoleList:l(({scope:e})=>[(d(!0),g(L,null,h(e.row.userRoleList,(f,Z)=>(d(),k(W,{key:Z,type:"info",class:"mr-4 mb-4"},{default:l(()=>[m(y(f.name),1)]),_:2},1024))),128))]),action:l(({scope:e})=>[R("a",{class:"text-primary",onClick:f=>z(e.row)},"\u7F16\u8F91",8,re),R("a",{onClick:f=>M(e.row)},y(e.row.status==="ENABLE"?"\u7981\u7528":"\u542F\u7528"),9,ie)]),_:1},8,["column","data","total"])]),_:1}),a(Y,{"model-value":p.value,title:"\u7F16\u8F91 - "+V.value,width:"600px",onClose:t[7]||(t[7]=e=>p.value=!1)},{footer:l(()=>[a(v,{type:"primary",onClick:t[5]||(t[5]=e=>G(N.value))},{default:l(()=>[m(" \u63D0\u4EA4 ")]),_:1}),a(v,{onClick:t[6]||(t[6]=e=>p.value=!1)},{default:l(()=>[m(" \u5173\u95ED ")]),_:1})]),default:l(()=>[a(S,{ref_key:"formRef",ref:N,model:n.value,rules:j,"label-width":"90px","label-suffix":":"},{default:l(()=>[a(u,{label:"\u624B\u673A\u53F7\u7801",prop:"phoneNo"},{default:l(()=>[a(b,{modelValue:n.value.phoneNo,"onUpdate:modelValue":t[2]||(t[2]=e=>n.value.phoneNo=e),style:{width:"200px"},placeholder:"\u8BF7\u8F93\u5165",maxlength:"11"},null,8,["modelValue"])]),_:1}),a(u,{label:"\u7528\u6237\u89D2\u8272",prop:"userRoleList"},{default:l(()=>[a(Q,{modelValue:n.value.userRoleList,"onUpdate:modelValue":t[3]||(t[3]=e=>n.value.userRoleList=e)},{default:l(()=>[(d(!0),g(L,null,h(I(_).userStore.roleListDict.filter(e=>e.name==="\u666E\u901A\u7528\u6237"||e.name==="\u5355\u4F4D\u7BA1\u7406\u5458"),e=>(d(),k(K,{key:e.id,label:e.id},{default:l(()=>[m(y(e.name),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(u,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[a(X,{modelValue:n.value.status,"onUpdate:modelValue":t[4]||(t[4]=e=>n.value.status=e),style:{"--el-switch-on-color":"#4ecb74","--el-switch-off-color":"#ff3b30"}},null,8,["modelValue"]),m("\xA0 "),R("span",{style:ae({color:n.value.status?"#4ECB74":"#FF3B30"})},y(n.value.status?"\u5DF2\u542F\u7528":"\u5DF2\u7981\u7528"),5)]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])],64)}}});export{pe as default};