|
1 |
- import{e as U}from"./index-b6aa4cff.js";import{G,E as L,r as u,a as q,b as l,c as z,d as J,f as s,h as a,i as c,e as $,F as A,k as H,C as K}from"./index-dd5fae99.js";const M={class:"flex"},Q=H({name:"coreBusiness"}),Z=Object.assign(Q,{props:{basicInfoData:{type:Object}},setup(R,{expose:I}){const p=R,y=G(L.userStore).userInfo||{},n=u({}),N=u(),S={coreBusiness:[{required:!0,message:"请至少选择一个核心业务"}]},T=o=>{N.value.validate(e=>{o(e)})},V=()=>{i.value=!0,B({pageNumber:1,pageSize:10},!0)},F=[{type:"index",label:"序号",width:60},{label:"业务名称",key:"matterName",prop:"matterName"},{label:"所属单位",key:"orgName",prop:"orgName"}],_=u(),v=u([]),k=u(0),O=[{type:"selection"},{label:"业务名称",prop:"matterName",key:"matterName"},{label:"所属单位",prop:"orgName",key:"orgName"}],i=u(!1),B=async(o=(r=>(r=_.value)==null?void 0:r.pageParams)(),e)=>{var g,d;var t=[];(g=p==null?void 0:p.basicInfoData)!=null&&g.superOrgCode&&t.push(p.basicInfoData.superOrgCode),(d=y.value)!=null&&d.empPosUnitCode&&t.push(y.value.empPosUnitCode);const m=await U({...o,businessName:b.businessName,orgCode:t.join(",")});v.value=m.data.data,k.value=m.data.total,await K(),e&&v.value&&v.value.forEach(f=>{(n.value.coreBusiness&&n.value.coreBusiness.map(C=>C.id)||[]).includes(f.id)?_.value.toggleRowSelect(f,!0):_.value.toggleRowSelect(f,!1)})},h=()=>{B()},x=u(),P=o=>{x.value=o},b=q({businessName:void 0}),j=()=>{b.businessName=""},E=()=>{n.value.coreBusiness=x.value,i.value=!1};return I({validForm:T,formData:n,setFormData:o=>{n.value={coreBusiness:o.coreBusiness?JSON.parse(o.coreBusiness):[]}}}),(o,e)=>{const r=l("el-button"),t=l("el-col"),m=l("table-list"),g=l("el-form-item"),d=l("el-row"),f=l("el-form"),w=l("el-input"),C=l("el-dialog");return z(),J(A,null,[s(f,{ref_key:"formRef",ref:N,model:n.value,rules:S,"label-position":"right","label-width":"0","label-suffix":":","scroll-to-error":""},{default:a(()=>[s(d,{gutter:40},{default:a(()=>[s(t,{span:24,class:"mb-16"},{default:a(()=>[s(r,{type:"primary",class:"float-right",onClick:V},{default:a(()=>e[2]||(e[2]=[c(" 选择核心业务 ")])),_:1})]),_:1}),s(t,{span:24},{default:a(()=>[s(g,{prop:"coreBusiness"},{default:a(()=>[s(m,{pagination:!1,style:{width:"100%"},column:F,data:n.value.coreBusiness,"empty-temp":!1},null,8,["data"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),s(C,{title:"选择核心业务","close-on-click-modal":!1,"before-close":()=>i.value=!1,"model-value":i.value,width:"700px"},{footer:a(()=>[s(r,{type:"primary",onClick:E},{default:a(()=>e[5]||(e[5]=[c(" 提交 ")])),_:1}),s(r,{onClick:e[1]||(e[1]=D=>i.value=!1)},{default:a(()=>e[6]||(e[6]=[c(" 关闭 ")])),_:1})]),default:a(()=>[s(d,{style:{"margin-bottom":"16px"},gutter:20},{default:a(()=>[s(t,{span:12},{default:a(()=>[s(w,{modelValue:b.businessName,"onUpdate:modelValue":e[0]||(e[0]=D=>b.businessName=D),placeholder:"请输入"},null,8,["modelValue"])]),_:1}),s(t,{span:12},{default:a(()=>[$("div",M,[s(r,{type:"primary",onClick:h},{default:a(()=>e[3]||(e[3]=[c("查询")])),_:1}),s(r,{onClick:j},{default:a(()=>e[4]||(e[4]=[c("重置")])),_:1})])]),_:1})]),_:1}),s(m,{ref_key:"tableListRef",ref:_,column:O,data:v.value,total:k.value,onSelectionChange:P,onGetTableData:B},null,8,["data","total"])]),_:1},8,["before-close","model-value"])],64)}}});export{Z as default};
|