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

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