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

  1. import{g as Y,a as W}from"./unitManage-104cfe86.js";import{r as c,o as F,b as s,c as i,L as p,h as o,f as a,d as y,H as g,u as V,F as _,j as T,k as I,W as O,E as k}from"./index-dd5fae99.js";const H=I({name:"jobInfo"}),P=Object.assign(H,{setup(G,{expose:j}){const t=c({companyAttribute:void 0}),C=c(),x={company:[{required:!0,message:"请上选择工作单位",trigger:"blur"}],companyUniqCode:[{required:!0,message:"工作单位code不能为空",trigger:"blur"}],legalEntityCode:[{required:!0,message:"请输入单位法人编号",trigger:"blur"}],administrativeDuties:[{required:!0,message:"请输入行政职务",trigger:"blur"}],startWorkAt:[{required:!0,message:"请选择开始工作日期",trigger:"blur"}],administrativeRank:[{required:!0,message:"请选择行政职级",trigger:"blur"}],jobStatus:[{required:!0,message:"请选择在职状态",trigger:"blur"}],retiredAt:[{required:!0,message:"请选退休日期",trigger:"blur"}],companyAttribute:[{required:!0,message:"请选单位类型",trigger:"blur"}]},R=u=>{C.value.validate(e=>{u(e)})},M=u=>{var e,n,r;t.value={...u,administrativeRank:((e=u.administrativeRank)==null?void 0:e[0])||void 0,jobStatus:((n=u.jobStatus)==null?void 0:n[0])||void 0,companyAttribute:((r=u.companyAttribute)==null?void 0:r[0])||void 0}},U=c(),N=()=>{t.value.company=U.value.getCurrentNode().name},L=async(u,e)=>{var n;if(u.level===0){const r=await Y({isCompetentUnit:!0,isSuperiorLineCompetentUnit:!0});e(r.data)}else{const r=await Y({parentCode:u.data.organizationCode});(n=r.data)!=null&&n.length?e(r.data):e([])}},D=c([]),h=async()=>{const u=await O();D.value=u.data},q=c(),w=u=>{const e=[];return u.forEach(n=>{var r;e.push({name:n.title,organizationCode:n.key,children:(r=n.children)!=null&&r.lengt?w(n.children):[]})}),e},z=async u=>{const e=await W({organizationName:u});q.value=w(e.data)};return j({validForm:R,formData:t,setFormData:M}),F(async()=>{h()}),(u,e)=>{const n=s("el-tree-select"),r=s("el-form-item"),d=s("el-col"),f=s("el-input"),A=s("el-date-picker"),v=s("el-option"),b=s("el-select"),E=s("el-row"),B=s("el-form");return i(),p(B,{ref_key:"formRef",ref:C,model:t.value,rules:x,"label-position":"right","label-width":"120px","label-suffix":":","scroll-to-error":"",class:"jobInfo"},{default:o(()=>[a(E,{gutter:8},{default:o(()=>{var S;return[a(d,{span:8},{default:o(()=>[a(r,{label:"工作单位",prop:"company"},{default:o(()=>[a(n,{ref_key:"orgTreeRef",ref:U,modelValue:t.value.companyUniqCode,"onUpdate:modelValue":e[0]||(e[0]=l=>t.value.companyUniqCode=l),data:q.value,class:"w-full","node-key":"organizationCode",lazy:"","check-strictly":!0,load:L,"cache-data":t.value.company&&t.value.companyUniqCode?[{organizationCode:t.value.companyUniqCode,name:t.value.company}]:[],props:{label:"name",value:"organizationCode"},filterable:"",remote:"","remote-method":z,onChange:N},null,8,["modelValue","data","cache-data"])]),_:1})]),_:1}),a(d,{span:8},{default:o(()=>[a(r,{label:"工作单位code",prop:"formData.companyUniqCode"},{default:o(()=>[a(f,{modelValue:t.value.companyUniqCode,"onUpdate:modelValue":e[1]||(e[1]=l=>t.value.companyUniqCode=l),placeholder:"请选择",disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),a(d,{span:8},{default:o(()=>[a(r,{label:"单位法人编号"},{default:o(()=>[a(f,{modelValue:t.value.legalEntityCode,"onUpdate:modelValue":e[2]||(e[2]=l=>t.value.legalEntityCode=l),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),a(d,{span:8},{default:o(()=>[a(r,{label:"行政职务",prop:"administrativeDuties"},{default:o(()=>[a(f,{modelValue:t.value.administrativeDuties,"onUpdate:modelValue":e[3]||(e[3]=l=>t.value.administrativeDuties=l),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),a(d,{span:8},{default:o(()=>[a(r,{label:"开始工作日期",prop:"startWorkAt"},{default:o(()=>[a(A,{modelValue:t.value.startWorkAt,"onUpdate:modelValue":e[4]||(e[4]=l=>t.value.startWorkAt=l),type:"date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",placeholder:"请选择"},null,8,["modelValue"])]),_:1})]),_:1}),a(d,{span:8},{default:o(()=>[a(r,{label:"行政职级",prop:"administrativeRank"},{default:o(()=>[a(b,{modelValue:t.value.administrativeRank,"onUpdate:modelValue":e[5]||(e[5]=l=>t.value.administrativeRank=l),class:"w-full",placeholder:"请选择","value-key":"dictionaryCode"},{default:o(()=>[(i(!0),y(_,null,g(V(k).dictStore.administrativeRankDict,(l,m)=>(i(),p(v,{key:m,label:l.dictionaryName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(d,{span:8},{default:o(()=>[a(r,{label:"在职状态",prop:"jobStatus"},{default:o(()=>[a(b,{modelValue:t.value.jobStatus,"onUpdate:modelValue":e[6]||(e[6]=l=>t.value.jobStatus=l),class:"w-full",placeholder:"请选择","value-key":"dictionaryCode"},{default:o(()=>[(i(!0),y(_,null,g(V(k).dictStore.jobStatusDict,(l,m)=>(i(),p(v,{key:m,label:l.dictionaryName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),((S=t.value.jobStatus)==null?void 0:S.dictionaryName)==="退休"?(i(),p(d,{key:0,span:8},{default:o(()=>[a(r,{label:"退休日期",prop:"retiredAt"},{default:o(()=>[a(A,{modelValue:t.value.retiredAt,"onUpdate:modelValue":e[7]||(e[7]=l=>t.value.retiredAt=l),type:"date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",placeholder:"请选择"},null,8,["modelValue"])]),_:1})]),_:1})):T("",!0),a(d,{span:8},{default:o(()=>[a(r,{label:"单位类型",prop:"companyAttribute"},{default:o(()=>[a(b,{modelValue:t.value.companyAttribute,"onUpdate:modelValue":e[8]||(e[8]=l=>t.value.companyAttribute=l),placeholder:"请选择",class:"w-full","value-key":"dictionaryCode"},{default:o(()=>[(i(!0),y(_,null,g(V(k).dictStore.companyAttributeDict,(l,m)=>(i(),p(v,{key:m,label:l.dictionaryName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(d,{span:8},{default:o(()=>[a(r,{label:"条线"},{default:o(()=>[a(b,{modelValue:t.value.businessStrips,"onUpdate:modelValue":e[9]||(e[9]=l=>t.value.businessStrips=l),multiple:"","value-key":"businessStripCode",filterable:"",class:"w-full"},{default:o(()=>[(i(!0),y(_,null,g(D.value,(l,m)=>(i(),p(v,{key:m,label:l.businessStripName,value:l},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(d,{span:24},{default:o(()=>[a(r,{label:"工作地址",prop:"address"},{default:o(()=>[a(f,{modelValue:t.value.address,"onUpdate:modelValue":e[10]||(e[10]=l=>t.value.address=l),maxlength:"50",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),a(d,{span:24},{default:o(()=>[a(r,{label:"工作经历",prop:"experience"},{default:o(()=>[a(f,{modelValue:t.value.experience,"onUpdate:modelValue":e[11]||(e[11]=l=>t.value.experience=l),maxlength:"200",rows:5,type:"textarea","show-word-limit":"",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1})]}),_:1})]),_:1},8,["model"])}}});export{P as default};