You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
5.8KB

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