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
4.2KB

  1. import{c as O}from"./expertStore-7d1ebc1f.js";import{a as P,r as f,B as $,V as j,E as J,b as i,c as q,L as A,h as l,f as t,i as y,e as C,t as F,k as G,s as H}from"./index-dd5fae99.js";const K={class:"search mb-16"},M=G({name:"driverDialog"}),X=Object.assign(M,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},selectExpertType:{type:Number,default:1}},emits:["close","getUserData"],setup(I,{emit:V}){const{proxy:h}=H(),c=I,b=V,o=P({expertRegionLevel:void 0,expertName:void 0,company:void 0}),u=f(),N=f(0),S=[{type:"selection",reserveSelection:!0,width:"55"},{label:"姓名",key:"expertName",prop:"expertName"},{label:"工作单位",key:"company",prop:"company",showOverflowTooltip:!0,width:250},{label:"专家级别",key:"expertRegionInfo",slot:"expertRegionInfo",width:"150"},{label:"手机号码",key:"phoneNo",prop:"phoneNo",width:"150"},{label:"专家类型",key:"expertType[0].dictionaryName",prop:"expertType[0].dictionaryName",width:"150"}],m=f([]),g=async(s=(e=>(e=u.value)==null?void 0:e.pageParams)())=>{const n=await O({...s,...o,expertRegionInfo:o.expertRegionInfo?{regionCode:o.expertRegionInfo.slice(-1)[0].split("##")[0],regionLevel:o.expertRegionInfo.slice(-1)[0].split("##")[2],regionName:o.expertRegionInfo.slice(-1)[0].split("##")[1]}:void 0});N.value=n.data.total,m.value=n.data.records||[];const a=JSON.parse(JSON.stringify(p.value));a!=null&&a.length&&m.value&&m.value.forEach(d=>{a.map(v=>v.userId*1).includes(d.userId)&&u.value.toggleRowSelect(d,!0)})},T=()=>{g()},L=()=>{o.expertRegionInfo=void 0,o.expertName=void 0,o.company=void 0,u.value.pageParams.pageNumber=1,u.value.pageParams.pageSize=10,g()},p=f([]),D=s=>{const e=s.map(n=>n.userId);m.value.forEach(n=>{e.includes(n.userId)?p.value.push(n):p.value=p.value.filter(a=>a.userId!==n.userId)})},E=()=>{const s={},e=p.value.reduce((n,a)=>(s[a.userId]||(s[a.userId]=n.push(a)),n),[]);c.selectExpertType===1&&(e==null?void 0:e.length)>10?h.$message.warning("最多选择10位人员"):b("getUserData",e)},w=f([]);return $(()=>c.visible,async s=>{var e;if(s){(e=c.data)!=null&&e.length&&(p.value=c.data.map(a=>a));const n=await j({regionCode:330500,regionLevel:2});w.value=[n.data],g(),J.userStore.setRoleStore()}}),(s,e)=>{const n=i("el-cascader"),a=i("el-form-item"),d=i("el-col"),x=i("el-input"),v=i("el-row"),_=i("el-button"),B=i("el-form"),U=i("table-list"),z=i("el-dialog");return q(),A(z,{"model-value":I.visible,title:"选择人员",width:"840px","destroy-on-close":"",onClose:e[4]||(e[4]=r=>b("close"))},{footer:l(()=>[t(_,{type:"primary",size:"small",onClick:E},{default:l(()=>e[7]||(e[7]=[y(" 确定 ")])),_:1}),t(_,{size:"small",onClick:e[3]||(e[3]=r=>b("close"))},{default:l(()=>e[8]||(e[8]=[y(" 关闭 ")])),_:1})]),default:l(()=>[C("div",K,[t(B,{"label-suffix":":",model:o,size:"small"},{default:l(()=>[t(v,{gutter:16,class:"mb-16"},{default:l(()=>[t(d,{span:8},{default:l(()=>[t(a,{label:"专家级别"},{default:l(()=>[t(n,{modelValue:o.expertRegionInfo,"onUpdate:modelValue":e[0]||(e[0]=r=>o.expertRegionInfo=r),options:w.value,placeholder:"请选择",class:"w-full",props:{value:"unionCode",label:"name"}},null,8,["modelValue","options"])]),_:1})]),_:1}),t(d,{span:8},{default:l(()=>[t(a,{label:"专家姓名"},{default:l(()=>[t(x,{modelValue:o.expertName,"onUpdate:modelValue":e[1]||(e[1]=r=>o.expertName=r),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),t(d,{span:8},{default:l(()=>[t(a,{label:"工作单位"},{default:l(()=>[t(x,{modelValue:o.company,"onUpdate:modelValue":e[2]||(e[2]=r=>o.company=r),maxlength:"11",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(v,null,{default:l(()=>[t(d,{span:24},{default:l(()=>[t(a,{class:"btn"},{default:l(()=>[t(_,{type:"primary",onClick:T},{default:l(()=>e[5]||(e[5]=[y("查询")])),_:1}),t(_,{onClick:L},{default:l(()=>e[6]||(e[6]=[y("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),t(U,{ref_key:"tableListRef",ref:u,column:S,data:m.value,total:N.value,"row-key":"userId",onSelectionChange:D,onGetTableData:g},{expertRegionInfo:l(({scope:r})=>{var R,k;return[C("span",null,F(((k=(R=r.row)==null?void 0:R.expertRegionInfo)==null?void 0:k.regionName)||"-"),1)]}),_:1},8,["data","total"])]),_:1},8,["model-value"])}}});export{X as default};