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.4KB

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