|
- import{e as E}from"./index.8a59d8d8.js";import{d as F,C as M,B as U,r as f,b as q,J as z,c as i,e as G,f as J,h as a,i as s,j as _,g as $,F as A,L as H}from"./index.55251523.js";const K={class:"flex"},Q=F({name:"coreBusiness"}),Y=Object.assign(Q,{props:{detail:{type:Object},basicInfoData:{type:Object}},setup(x,{expose:I}){const o=x,R=M(U.userStore).userInfo||{},m=f({}),C=f(),T={coreBusiness:[{required:!1,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6838\u5FC3\u4E1A\u52A1"}]},V=()=>{c.value=!0,B({pageNumber:1,pageSize:10},!0)},h=[{type:"index",label:"\u5E8F\u53F7",width:60},{label:"\u4E1A\u52A1\u540D\u79F0",key:"matterName",prop:"matterName"},{label:"\u6240\u5C5E\u5355\u4F4D",key:"orgName",prop:"orgName"}],b=f(),g=f([]),N=f(0),j=[{type:"selection"},{label:"\u4E1A\u52A1\u540D\u79F0",prop:"matterName",key:"matterName"},{label:"\u6240\u5C5E\u5355\u4F4D",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 E({...n,businessName:v.businessName,orgCode:t.join(",")});g.value=d.data.data,N.value=d.data.total,await H(),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)})},S=()=>{B()},D=f(),L=n=>{D.value=n},v=q({businessName:void 0}),O=()=>{v.businessName=""},P=()=>{m.value.coreBusiness=D.value,c.value=!1};return I({formRef:C,formData:m}),z(()=>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("\uFF1B"))==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("\uFF1B")[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 G(),J(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]=[_(" \u9009\u62E9\u6838\u5FC3\u4E1A\u52A1 ")])),_: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:"\u9009\u62E9\u6838\u5FC3\u4E1A\u52A1","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]=[_(" \u63D0\u4EA4 ")])),_:1}),a(l,{onClick:e[1]||(e[1]=w=>c.value=!1)},{default:s(()=>e[6]||(e[6]=[_(" \u5173\u95ED ")])),_: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:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),a(t,{span:12},{default:s(()=>[$("div",K,[a(l,{type:"primary",onClick:S},{default:s(()=>e[3]||(e[3]=[_("\u67E5\u8BE2")])),_:1}),a(l,{onClick:O},{default:s(()=>e[4]||(e[4]=[_("\u91CD\u7F6E")])),_:1})])]),_:1})]),_:1}),a(d,{ref_key:"tableListRef",ref:b,column:j,data:g.value,total:N.value,onSelectionChange:L,onGetTableData:B},null,8,["data","total"])]),_:1},8,["before-close","model-value"])],64)}}});export{Y as default};
|