edit.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  1. <template>
  2. <div class="card-edit">
  3. <a-form :model="dataModel" autocomplete="off" @finish="onFinish">
  4. <a-divider orientation="left">求职人员信息</a-divider>
  5. <a-row :gutter="24">
  6. <a-col :span="8">
  7. <a-form-item label="姓名" :label-col="{ span: 6 }"
  8. name="name" :rules="[{ required: true, message: '请输入姓名!' }]">
  9. <a-input v-model:value="dataModel.name" placeholder=""/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :span="8">
  13. <a-form-item label="身份证号码" :label-col="{ span: 6 }"
  14. name="identityNumber" :rules="[{ required: true, message: '请输入身份证号码!' }]" >
  15. <a-input v-model:value="dataModel.identityNumber" placeholder="" @change="onIdentityNumberChange()"/>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :span="8">
  19. <a-form-item label="性别" :label-col="{span:6}"
  20. name="sex" :rules="[{ required: true, message: '请选择性别!' }]">
  21. <a-select
  22. ref="select" disabled
  23. v-model:value="dataModel.sex"
  24. :options="genderList"
  25. :field-names="{ label: 'name', value: 'value' }"
  26. :allow-clear="true"
  27. >
  28. </a-select>
  29. </a-form-item>
  30. </a-col>
  31. </a-row>
  32. <a-row :gutter="24">
  33. <a-col :span="8">
  34. <a-form-item label="重点人员类别" :label-col="{span:6}" name="keyPersonTypeID"
  35. :rules="[{ required: true, message: '请选择重点人员类别!' }]">
  36. <a-select
  37. ref="select"
  38. v-model:value="dataModel.keyPersonTypeID"
  39. :options="keyPersonTypeList"
  40. :field-names="{ label: 'name', value: 'value' }"
  41. :allow-clear="true"
  42. >
  43. </a-select>
  44. </a-form-item>
  45. </a-col>
  46. <a-col :span="8">
  47. <a-form-item label="就业状态" :label-col="{span:6}" name="jobStatusID"
  48. :rules="[{ required: true, message: '请选择就业状态!' }]">
  49. <a-select
  50. ref="select"
  51. v-model:value="dataModel.jobStatusID"
  52. :options="jobStatusList"
  53. :field-names="{ label: 'name', value: 'value' }"
  54. :allow-clear="true"
  55. >
  56. </a-select>
  57. </a-form-item>
  58. </a-col>
  59. <a-col :span="8">
  60. <a-form-item label="所属驿站" :label-col="{span:6}" name="siteID"
  61. :rules="[{ required: true, message: '请选择所属驿站!' }]">
  62. <a-select
  63. ref="select"
  64. v-model:value="dataModel.siteID"
  65. :options="siteList"
  66. :field-names="{ label: 'siteName', value: 'siteID' }"
  67. :allow-clear="true"
  68. >
  69. </a-select>
  70. </a-form-item>
  71. </a-col>
  72. </a-row>
  73. <a-row :gutter="24">
  74. <a-col :span="8">
  75. <a-form-item
  76. label="联系人"
  77. :label-col="{ span: 6 }"
  78. name="userName">
  79. <a-input v-model:value="dataModel.userName" placeholder=""/>
  80. </a-form-item>
  81. </a-col>
  82. <a-col :span="8">
  83. <a-form-item label="联系电话" :label-col="{ span: 6 }"
  84. name="userMobile" :rules="[{ required: true,message: '请输入联系电话!' }]">
  85. <a-input v-model:value="dataModel.userMobile" placeholder=""/>
  86. </a-form-item>
  87. </a-col>
  88. <a-col :span="8">
  89. <a-form-item
  90. label="地址"
  91. :label-col="{ span: 6 }"
  92. name="address"
  93. :rules="[{ required: true, message: '请输入地址!' }]"
  94. >
  95. <a-input v-model:value="dataModel.address" placeholder=""/>
  96. </a-form-item>
  97. </a-col>
  98. </a-row>
  99. <a-row :gutter="24">
  100. <a-col :span="8">
  101. <a-form-item
  102. label="籍贯"
  103. :label-col="{ span: 6 }"
  104. name="nativePlace">
  105. <a-input v-model:value="dataModel.nativePlace" placeholder=""/>
  106. </a-form-item>
  107. </a-col>
  108. <a-col :span="8">
  109. </a-col>
  110. <a-col :span="8">
  111. </a-col>
  112. </a-row>
  113. <a-divider orientation="left">其它信息</a-divider>
  114. <a-row :gutter="24">
  115. <a-col :span="8">
  116. <a-form-item label="社会保障卡号" :label-col="{ span: 6 }" name="socialSecurityCard">
  117. <a-input v-model:value="dataModel.socialSecurityCard" placeholder=""/>
  118. </a-form-item>
  119. </a-col>
  120. <a-col :span="8">
  121. <a-form-item label="毕业院校" :label-col="{span:6}" name="finishSchool">
  122. <a-input v-model:value="dataModel.finishSchool" placeholder=""/>
  123. </a-form-item>
  124. </a-col>
  125. <a-col :span="8">
  126. <a-form-item label="专业" :label-col="{ span: 6 }" name="profession">
  127. <a-input v-model:value="dataModel.profession" placeholder=""/>
  128. </a-form-item>
  129. </a-col>
  130. </a-row>
  131. <a-row :gutter="24">
  132. <a-col :span="8">
  133. <a-form-item label="是否全日制" :label-col="{ span: 6 }" name="socialSecurityCard">
  134. <a-select ref="select" v-model:value="dataModel.isFullTime" :options="isFullTimeList"
  135. :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
  136. </a-form-item>
  137. </a-col>
  138. <a-col :span="8">
  139. <a-form-item label="职业资格类别" :label-col="{span:6}" name="occupationalCategoryName">
  140. <a-cascader :load-data="loadLevelOccupationalCategoryList"
  141. v-model:value="dataModel.occupationalCategoryName"
  142. :options="occupationalCategoryList" change-on-select @change="occupationalChange">
  143. </a-cascader>
  144. </a-form-item>
  145. </a-col>
  146. <a-col :span="8">
  147. <a-form-item label="职业资格等级" :label-col="{ span: 6 }" name="profession">
  148. <a-select ref="select" v-model:value="dataModel.occupationalLevel" :options="occupationalLevelList"
  149. :field-names="{ label: 'name', value: 'value' }" :allow-clear="false"></a-select>
  150. </a-form-item>
  151. </a-col>
  152. </a-row>
  153. <a-row :gutter="24">
  154. <a-col :span="8">
  155. <a-form-item label="民族" :label-col="{ span: 6 }" name="nation">
  156. <a-select
  157. ref="select"
  158. v-model:value="dataModel.nation"
  159. :options="nationList"
  160. :field-names="{ label: 'name', value: 'value' }"
  161. :allow-clear="true"
  162. ></a-select>
  163. </a-form-item>
  164. </a-col>
  165. <a-col :span="8">
  166. <a-form-item label="政治面貌" :label-col="{span:6}" name="politicsStatusID">
  167. <a-select
  168. ref="select"
  169. v-model:value="dataModel.politicsStatusID"
  170. :options="politicsStatusList"
  171. :field-names="{ label: 'name', value: 'value' }"
  172. :allow-clear="true"
  173. >
  174. </a-select>
  175. </a-form-item>
  176. </a-col>
  177. <a-col :span="8">
  178. <a-form-item label="出生地" :label-col="{ span: 6 }" name="birthPlace">
  179. <a-input v-model:value="dataModel.birthPlace" placeholder=""/>
  180. </a-form-item>
  181. </a-col>
  182. </a-row>
  183. <a-row :gutter="24">
  184. <a-col :span="8">
  185. <a-form-item label="出生日期" :label-col="{ span: 6 }" name="birthDay" >
  186. <a-date-picker disabled
  187. v-model:value="dataModel.birthDay"
  188. picker="date"
  189. value-format="YYYY-MM-DD"/>
  190. </a-form-item>
  191. </a-col>
  192. <a-col :span="8">
  193. <a-form-item label="户口性质" :label-col="{span:6}" name="familyNatureID" >
  194. <a-select
  195. ref="select"
  196. v-model:value="dataModel.familyNatureID"
  197. :options="familyNatureList"
  198. :field-names="{ label: 'name', value: 'value' }"
  199. :allow-clear="true"
  200. >
  201. </a-select>
  202. </a-form-item>
  203. </a-col>
  204. <a-col :span="8">
  205. <a-form-item label="最高学历" :label-col="{span:6}" name="cultureRank">
  206. <a-select
  207. ref="select"
  208. v-model:value="dataModel.cultureRank"
  209. :options="cultureList"
  210. :field-names="{ label: 'name', value: 'value' }"
  211. :allow-clear="true"
  212. >
  213. </a-select>
  214. </a-form-item>
  215. </a-col>
  216. </a-row>
  217. <a-row :gutter="24">
  218. <a-col :span="8">
  219. <a-form-item label="健康状况" :label-col="{span:6}" name="healthID">
  220. <a-select
  221. ref="select"
  222. v-model:value="dataModel.healthID"
  223. :options="healthList"
  224. :field-names="{ label: 'name', value: 'value' }"
  225. :allow-clear="true"
  226. >
  227. </a-select>
  228. </a-form-item>
  229. </a-col>
  230. <a-col :span="8">
  231. <a-form-item label="婚姻状况" :label-col="{span:6}" name="maritalStatusID">
  232. <a-select
  233. ref="select"
  234. v-model:value="dataModel.maritalStatusID"
  235. :options="maritalStatusList"
  236. :field-names="{ label: 'name', value: 'value' }"
  237. :allow-clear="true"
  238. >
  239. </a-select>
  240. </a-form-item>
  241. </a-col>
  242. <a-col :span="8">
  243. <a-form-item
  244. label="电子邮箱"
  245. :label-col="{ span: 6 }"
  246. name="email">
  247. <a-input v-model:value="dataModel.email" placeholder=""/>
  248. </a-form-item>
  249. <!-- <a-form-item-->
  250. <!-- label="血型"-->
  251. <!-- :label-col="{ span: 6 }"-->
  252. <!-- name="bloodTypeID" >-->
  253. <!-- <a-select-->
  254. <!-- ref="select"-->
  255. <!-- v-model:value="dataModel.bloodTypeID"-->
  256. <!-- :options="bloodTypeList"-->
  257. <!-- :field-names="{ label: 'name', value: 'value' }"-->
  258. <!-- :allow-clear="true"-->
  259. <!-- >-->
  260. <!-- </a-select>-->
  261. <!-- </a-form-item>-->
  262. </a-col>
  263. </a-row>
  264. <a-row :gutter="24">
  265. <a-col :span="8">
  266. <a-form-item
  267. label="身高"
  268. :label-col="{ span: 6 }"
  269. name="height">
  270. <a-input v-model:value="dataModel.height" placeholder="" suffix="cm"/>
  271. </a-form-item>
  272. </a-col>
  273. <a-col :span="8">
  274. <a-form-item
  275. label="体重"
  276. :label-col="{ span: 6 }"
  277. name="weight" >
  278. <a-input v-model:value="dataModel.weight" placeholder="" suffix="kg"/>
  279. </a-form-item>
  280. </a-col>
  281. <a-col :span="8">
  282. <a-form-item
  283. label="视力"
  284. :label-col="{ span: 6 }"
  285. name="vision">
  286. <a-input v-model:value="dataModel.vision" placeholder=""/>
  287. </a-form-item>
  288. </a-col>
  289. </a-row>
  290. <a-row :gutter="24">
  291. <a-col :span="8">
  292. <a-form-item label="省份" :label-col="{span:6}" name="provinceCode">
  293. <a-select
  294. ref="select"
  295. v-model:value="dataModel.provinceCode"
  296. :options="provinceList"
  297. :field-names="{ label: 'name', value: 'code' }"
  298. :allow-clear="true"
  299. >
  300. </a-select>
  301. </a-form-item>
  302. </a-col>
  303. <a-col :span="8">
  304. <a-form-item label="市/县" :label-col="{span:6}" name="regionCode">
  305. <a-select
  306. ref="select"
  307. v-model:value="dataModel.regionCode"
  308. :options="regionList"
  309. :field-names="{ label: 'name', value: 'code' }"
  310. :allow-clear="true"
  311. @change="regionChange"
  312. >
  313. </a-select>
  314. </a-form-item>
  315. </a-col>
  316. <a-col :span="8">
  317. <a-form-item label="镇街" :label-col="{span:6}" name="streetCode">
  318. <a-select
  319. ref="select"
  320. v-model:value="dataModel.streetCode"
  321. :options="streetList"
  322. :field-names="{ label: 'name', value: 'code' }"
  323. :allow-clear="true"
  324. >
  325. </a-select>
  326. </a-form-item>
  327. </a-col>
  328. </a-row>
  329. <a-row :gutter="24">
  330. <a-col :span="8">
  331. <a-form-item
  332. label="家庭住址"
  333. :label-col="{ span: 6 }"
  334. name="familyAddress" >
  335. <a-input v-model:value="dataModel.familyAddress" placeholder=""/>
  336. </a-form-item>
  337. </a-col>
  338. <a-col :span="8">
  339. <!-- <a-form-item-->
  340. <!-- label="邮政编码"-->
  341. <!-- :label-col="{ span: 6 }"-->
  342. <!-- name="postalCode">-->
  343. <!-- <a-input v-model:value="dataModel.postalCode" placeholder=""/>-->
  344. <!-- </a-form-item>-->
  345. </a-col>
  346. <a-col :span="8">
  347. </a-col>
  348. </a-row>
  349. <a-row :gutter="24">
  350. <a-col :span="16">
  351. <a-form-item label="兴趣爱好" :label-col="{ span: 3}" name="hobby" >
  352. <a-textarea v-model:value="dataModel.hobby" placeholder="兴趣爱好" :rows="2" />
  353. </a-form-item>
  354. </a-col>
  355. </a-row>
  356. <a-row :gutter="24">
  357. <a-col :span="16">
  358. <a-form-item label="个人技能" :label-col="{ span: 3 }" name="personalSkills" >
  359. <a-textarea v-model:value="dataModel.personalSkills" placeholder="个人技能" :rows="4" />
  360. </a-form-item>
  361. </a-col>
  362. </a-row>
  363. <a-row :gutter="24">
  364. <a-col :span="24">
  365. <a-form-item label="标签" :label-col="{ span: 2 }" name="listLabel" >
  366. <a-button style="margin: 0px 5px 5px 0px;color: black;border: 1px solid rgb(217, 217, 217);" v-for="item in dataModel.listLabel">
  367. {{ item.labelName }}
  368. </a-button>
  369. <a-button @click="onSelectModel">
  370. <plus-circle-outlined/>选择标签
  371. </a-button>
  372. </a-form-item>
  373. </a-col>
  374. </a-row>
  375. <a-row>
  376. <a-col :span="24" style="text-align: right; margin-top: 20px; margin-right: 20px">
  377. <Space>
  378. <a-button @click="addEducation">
  379. <template #icon>
  380. <plus-circle-outlined/>
  381. </template>
  382. 新增
  383. </a-button>
  384. </Space>
  385. </a-col>
  386. </a-row>
  387. <a-divider orientation="left">教育经历</a-divider>
  388. <a-row>
  389. <a-col style="margin-bottom: 20px;">
  390. <a-table :columns="educationColumns" :data-source="educationData" :pagination="false" bordered>
  391. <template #bodyCell="{ column ,index}">
  392. <template v-if="column.key === 'schoolName'">
  393. <div>
  394. <a-input v-model:value="educationData[index][column.key]" style="width: 200px" />
  395. </div>
  396. </template>
  397. <template v-if="column.key === 'cultureRank'">
  398. <div>
  399. <a-select
  400. ref="select"
  401. v-model:value="educationData[index][column.key]"
  402. :options="cultureList"
  403. :field-names="{ label: 'name', value: 'value' }"
  404. :allow-clear="false" style="width: 200px" >
  405. </a-select>
  406. </div>
  407. </template>
  408. <template v-if="column.key === 'schoolTime'">
  409. <div>
  410. <a-date-picker
  411. v-model:value="educationData[index][column.key]"
  412. picker="date" :allow-clear="false"
  413. value-format="YYYY-MM-DD"
  414. />
  415. </div>
  416. </template>
  417. <template v-if="column.key === 'overTime'">
  418. <div>
  419. <a-date-picker
  420. v-model:value="educationData[index][column.key]"
  421. picker="date" :allow-clear="false"
  422. value-format="YYYY-MM-DD"
  423. />
  424. </div>
  425. </template>
  426. <template v-if="column.key === 'major'">
  427. <div>
  428. <a-input
  429. v-model:value="educationData[index][column.key]" style="width: 200px"
  430. />
  431. </div>
  432. </template>
  433. <template v-if="column.key === 'educationOperation'">
  434. <a-button type="link" size="small" @click="delEducation(index)">删除</a-button>
  435. </template>
  436. </template>
  437. </a-table>
  438. </a-col>
  439. </a-row>
  440. <a-row>
  441. <a-col :span="24" style="text-align: right; margin-top: 20px; margin-right: 20px">
  442. <Space>
  443. <a-button @click="addExperience">
  444. <template #icon>
  445. <plus-circle-outlined/>
  446. </template>
  447. 新增
  448. </a-button>
  449. </Space>
  450. </a-col>
  451. </a-row>
  452. <a-divider orientation="left">工作经历</a-divider>
  453. <a-row>
  454. <a-col style="margin-bottom: 20px;">
  455. <a-table :columns="experienceColumns" :data-source="experienceData" :pagination="false"
  456. bordered>
  457. <template #bodyCell="{ column ,index}">
  458. <template v-if="column.key === 'startTime'">
  459. <div>
  460. <a-date-picker v-model:value="experienceData[index][column.key]"
  461. picker="date" value-format="YYYY-MM-DD" :allow-clear="false" />
  462. </div>
  463. </template>
  464. <template v-if="column.key === 'endTime'">
  465. <div>
  466. <a-date-picker v-model:value="experienceData[index][column.key]"
  467. picker="date" value-format="YYYY-MM-DD" :allow-clear="false" />
  468. </div>
  469. </template>
  470. <template v-if="column.key === 'workAddress'">
  471. <div>
  472. <a-input
  473. v-model:value="experienceData[index][column.key]" style="width: 200px"
  474. />
  475. </div>
  476. </template>
  477. <template v-if="column.key === 'duties'">
  478. <div>
  479. <a-input
  480. v-model:value="experienceData[index][column.key]" style="width: 200px"
  481. />
  482. </div>
  483. </template>
  484. <template v-if="column.key === 'experienceOperation'">
  485. <a-button type="link" size="small" @click="deleteExperience(index)">删除</a-button>
  486. </template>
  487. </template>
  488. </a-table>
  489. </a-col>
  490. </a-row>
  491. <a-form-item class="buttom-btns">
  492. <a-button @click="onClose">取消</a-button>
  493. <a-button type="primary" html-type="submit">提交</a-button>
  494. </a-form-item>
  495. </a-form>
  496. <select-label ref="refSelectModel" :list-label="dataModel.listLabel" :big-type="2" @selectLabelChecks="selectLabelChecks"></select-label>
  497. </div>
  498. </template>
  499. <script lang="ts">
  500. import {defineComponent, reactive, ref, toRefs} from 'vue';
  501. import type {SelectProps, TableColumnsType} from 'ant-design-vue';
  502. import {message} from "ant-design-vue";
  503. import {useTabsViewStore} from '@/store/modules/tabsView';
  504. import BUploadFile from '@/components/file/uploadFile.vue';
  505. import {get} from "@/api/common";
  506. import {getSysDictionaryList} from '@/api/system/dictionary';
  507. import {getDataById, getEducationList, getExperienceList, save} from '@/api/jobUserManager/jobuser';
  508. import {getSiteList} from "@/api/baseSettings/siteInfo";
  509. import {getInfo} from "@/api/account";
  510. import dayjs from "dayjs";
  511. import SelectLabel from "@/views/baseSettings/label/selectLabel.vue";
  512. interface FormState {
  513. dataModel: any;
  514. }
  515. export default defineComponent(
  516. {
  517. components: {BUploadFile,SelectLabel},
  518. setup() {
  519. // const router = useRouter();
  520. const isAllowCommit = ref(true);
  521. const refSelectModel = ref();
  522. const formState = reactive<FormState>({dataModel: {}});
  523. const formTableState = reactive({loading: false});
  524. const searchParams = reactive({
  525. pageIndex: 1,
  526. pageSize: 99
  527. });
  528. const provinceList = ref<SelectProps['options']>([{name: '广东省', code: '440000000000000'}]);
  529. const siteList = ref<any>([]);
  530. const genderList = ref<SelectProps['options']>();
  531. const keyPersonTypeList = ref<SelectProps['options']>();
  532. const jobStatusList = ref<SelectProps['options']>();
  533. const maritalStatusList = ref<SelectProps['options']>();
  534. const healthList = ref<SelectProps['options']>();
  535. const bloodTypeList = ref<SelectProps['options']>();
  536. const cultureList = ref<SelectProps['options']>();
  537. const politicsStatusList = ref<SelectProps['options']>();
  538. const regionList = ref<SelectProps['options']>();
  539. const streetList = ref<SelectProps['options']>();
  540. const familyNatureList = ref<SelectProps['options']>();
  541. const nationList = ref<SelectProps['options']>();
  542. const isFullTimeList = ref<SelectProps["options"]>();
  543. const occupationalCategoryList = ref<SelectProps["options"]>();
  544. const occupationalLevelList = ref<SelectProps["options"]>();
  545. const educationData = ref([]);
  546. const educationColumns: TableColumnsType = [
  547. {
  548. title: '序号',
  549. align: "center",
  550. key: 'educationID',
  551. width: 120,
  552. customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`
  553. },
  554. {
  555. title: '学校名',
  556. dataIndex: 'schoolName',
  557. key: 'schoolName',
  558. align: "center",
  559. width: 120
  560. },
  561. {
  562. title: '最高学历',
  563. dataIndex: 'cultureRank',
  564. key: 'cultureRank',
  565. align: "center",
  566. width: 120
  567. },
  568. {
  569. title: '就读时间',
  570. dataIndex: 'schoolTime',
  571. key: 'schoolTime',
  572. align: "center",
  573. width: 120
  574. },
  575. {
  576. title: '毕业时间',
  577. dataIndex: 'overTime',
  578. key: 'overTime',
  579. align: "center",
  580. width: 120
  581. },
  582. {
  583. title: '专业',
  584. dataIndex: 'major',
  585. key: 'major',
  586. align: "center",
  587. width: 120
  588. },
  589. {title: '操作', key: 'educationOperation', fixed: 'right', width: 120, align: "center"},
  590. ];
  591. // const fullpath = router.currentRoute.value.fullPath;
  592. const tabsViewStore = useTabsViewStore();
  593. const isEdit = true;
  594. const fileList = ref();
  595. const setFileList = (files) => {
  596. fileList.value = files;
  597. };
  598. const onIdentityNumberChange =()=>{
  599. const identReg = /^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
  600. if(formState.dataModel.identityNumber.match(identReg)&&formState.dataModel.identityNumber.length==18){
  601. const birthDayStr = String(formState.dataModel.identityNumber).substring(6,14);
  602. const sexStr = String(formState.dataModel.identityNumber).substring(16,17);
  603. formState.dataModel.sex = parseInt(sexStr)%2 == 0 ? 2 : 1; //双女单男
  604. formState.dataModel.birthDay = dayjs(birthDayStr).format("YYYY-MM-DD");
  605. }
  606. }
  607. const inputDataValidate = () =>{
  608. isAllowCommit.value = true;
  609. const identReg = /^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
  610. if(!formState.dataModel.identityNumber.match(identReg)){
  611. message.error("输入的身份证号码有误!");
  612. isAllowCommit.value = false;
  613. }
  614. const mobileReg = /^1[3|4|5|6|7|8|9]\d{9}$/;
  615. if(!mobileReg.test(formState.dataModel.userMobile)){
  616. message.error("输入的联系电话有误!");
  617. isAllowCommit.value = false;
  618. }
  619. const emailReg = /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
  620. if(formState.dataModel.email!=null && formState.dataModel.email.trim()!==""){
  621. if(!emailReg.test(formState.dataModel.email)){
  622. message.error("输入的电子邮箱有误!");
  623. isAllowCommit.value = false;
  624. }
  625. }
  626. };
  627. const getAllSites = () => {
  628. getSiteList({pageIndex:1,pageSize:9999}).then((result :any) => {
  629. siteList.value = result.list;
  630. })
  631. }
  632. const getHealthList = () => {
  633. getSysDictionaryList('Health').then((data) => {
  634. healthList.value = data;
  635. });
  636. };
  637. const getGenderList = () => {
  638. getSysDictionaryList('Gender').then((data) => {
  639. genderList.value = data;
  640. });
  641. };
  642. const getCultureList = () => {
  643. getSysDictionaryList('HighestDegree').then((data) => {
  644. cultureList.value = data;
  645. });
  646. };
  647. const getJobStatusList = () => {
  648. getSysDictionaryList('JobStatus').then((data) => {
  649. jobStatusList.value = data;
  650. });
  651. };
  652. const getNationList = () => {
  653. getSysDictionaryList('NationType').then((data) => {
  654. nationList.value = data;
  655. });
  656. };
  657. const getBloodTypeList = () => {
  658. getSysDictionaryList('BloodType').then((data) => {
  659. bloodTypeList.value = data;
  660. });
  661. };
  662. const getFamilyNatureList = () => {
  663. getSysDictionaryList('FamilyNature').then((data) => {
  664. familyNatureList.value = data;
  665. });
  666. };
  667. const getKeyPersonTypeList = () => {
  668. getSysDictionaryList('KeyPersonType').then((data) => {
  669. keyPersonTypeList.value = data;
  670. });
  671. };
  672. const getMaritalStatusList = () => {
  673. getSysDictionaryList('MaritalStatus').then((data) => {
  674. maritalStatusList.value = data;
  675. });
  676. };
  677. const getPoliticsStatusList = () => {
  678. getSysDictionaryList('PoliticsStatus').then((data) => {
  679. politicsStatusList.value = data;
  680. });
  681. };
  682. const getIsFullTimeList = async function () {
  683. const result: any = await getSysDictionaryList("IsFullTime");
  684. isFullTimeList.value = result;
  685. }
  686. const getOccupationalLevelList = async function () {
  687. const result: any = await getSysDictionaryList("OccupationalLevel");
  688. occupationalLevelList.value = result;
  689. }
  690. get('system/area/getCityList', {}).then(data => {
  691. regionList.value = data;
  692. });
  693. const changeCity = () => {
  694. if (formState.dataModel.regionCode) {
  695. get('system/area/getAreaList', {code: formState.dataModel.regionCode}).then(data => {
  696. streetList.value = data;
  697. // formState.dataModel.streetCode = "";
  698. })
  699. }
  700. }
  701. const regionChange = async function () {
  702. formState.dataModel.streetCode = null;
  703. changeCity();
  704. }
  705. const loadEducation = (id: any) => {
  706. getEducationList(id).then(data => {
  707. if (data)
  708. educationData.value = data;
  709. });
  710. }
  711. const addEducation = () => {
  712. (educationData.value as any[]).push({
  713. schoolName: '',
  714. cultureRank: null,
  715. schoolTime: null,
  716. overTime: null,
  717. major: ''
  718. });
  719. }
  720. const delEducation = (record) => {
  721. (educationData.value as any[]).splice(record, 1);
  722. }
  723. const experienceColumns: TableColumnsType = [
  724. {
  725. title: '序号',
  726. align: "center",
  727. key: 'experienceID',
  728. width: 120,
  729. customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`
  730. },
  731. {
  732. title: '开始时间',
  733. dataIndex: 'startTime',
  734. key: 'startTime',
  735. align: "center",
  736. width: 120
  737. },
  738. {
  739. title: '结束时间',
  740. dataIndex: 'endTime',
  741. key: 'endTime',
  742. align: "center",
  743. width: 120
  744. },
  745. {
  746. title: '工作单位',
  747. dataIndex: 'workAddress',
  748. key: 'workAddress',
  749. align: "center",
  750. width: 120
  751. },
  752. {
  753. title: '职务',
  754. dataIndex: 'duties',
  755. key: 'duties',
  756. align: "center",
  757. width: 120
  758. },
  759. {title: '操作', key: 'experienceOperation', fixed: 'right', width: 120, align: "center"},
  760. ]
  761. const experienceData = ref([]);
  762. const loadExperienceData = (id: any) => {
  763. getExperienceList(id).then(data => {
  764. if (data) {
  765. experienceData.value = data;
  766. }
  767. })
  768. }
  769. const deleteExperience = (record) => {
  770. (experienceData.value as any[]).splice(record, 1);
  771. }
  772. const addExperience = () => {
  773. (experienceData.value as any[]).push({
  774. startTime: null,
  775. endTime: null,
  776. workAddress: null,
  777. duties: null,
  778. });
  779. }
  780. const onClose = (reload: any) => {
  781. tabsViewStore.closeCurrentTabByPath('/jobusermgr/jobseeker/add');
  782. tabsViewStore.closeCurrentTabByPath('/jobusermgr/jobseeker/edit');
  783. tabsViewStore.openTab('/jobusermgr/jobseeker/index', {reload: reload});
  784. };
  785. const onFinish = () => {
  786. inputDataValidate();
  787. if(isAllowCommit.value){
  788. formState.dataModel.jobEducation = educationData.value;
  789. formState.dataModel.jobExperience = experienceData.value;
  790. save(formState.dataModel).then(result => {
  791. if (result) {
  792. onClose(1)
  793. }
  794. });
  795. }
  796. }
  797. const getFirstOccupationalList = () => {
  798. get("occupational/getFirstOccupationalList", null).then(data => {
  799. occupationalCategoryList.value = (data as any[]).map((x) => {
  800. return {
  801. label: x.name,
  802. value: x.code,
  803. isLeaf: false,
  804. tag: 'firstLevel'
  805. }
  806. });
  807. });
  808. }
  809. const loadLevelOccupationalCategoryList = (selectedOptions) => {
  810. let targetOption = selectedOptions[selectedOptions.length - 1];
  811. if (targetOption) {
  812. get("occupational/getListByParentOccupationalID", {parentOccupationalID: targetOption.value}).then(data => {
  813. targetOption.loading = false;
  814. targetOption.children = (data as any[]).map((x) => {
  815. return {
  816. label: x.name,
  817. value: x.code,
  818. isLeaf: true,
  819. tag: 'secondLevel'
  820. };
  821. });
  822. });
  823. formState.dataModel.hasOccupational = false;
  824. }
  825. };
  826. // 职业资格选择变更事件
  827. function occupationalChange(value: any, selectedOptions: any) {
  828. if (value.length >= 2) {
  829. formState.dataModel.occupationalCategory = selectedOptions[1].value;
  830. formState.dataModel.occupationalCategoryName = selectedOptions[1].label;
  831. } else {
  832. formState.dataModel.occupationalCategory = "";
  833. formState.dataModel.occupationalCategoryName = "";
  834. }
  835. }
  836. const onSelectModel = ()=>{
  837. refSelectModel.value.show();
  838. }
  839. const selectLabelChecks = (list: any)=>{
  840. formState.dataModel.listLabel = list;
  841. }
  842. const loadData = (id: any) => {
  843. getAllSites();
  844. getHealthList();
  845. getGenderList();
  846. getCultureList();
  847. getJobStatusList();
  848. getNationList();
  849. getBloodTypeList();
  850. getFamilyNatureList();
  851. getKeyPersonTypeList();
  852. getMaritalStatusList();
  853. getPoliticsStatusList();
  854. getIsFullTimeList()
  855. getOccupationalLevelList()
  856. getFirstOccupationalList()
  857. getInfo().then((loginUserInfo:any)=>{
  858. getDataById(id,loginUserInfo.userID,null).then(data => {
  859. formState.dataModel = data;
  860. if (formState.dataModel.regionCode) {
  861. changeCity();
  862. }
  863. });
  864. });
  865. };
  866. return {
  867. ...toRefs(formState),
  868. isEdit,
  869. loadData,
  870. onClose,
  871. onFinish,
  872. setFileList,
  873. addEducation,
  874. delEducation,
  875. loadEducation,
  876. inputDataValidate,
  877. onIdentityNumberChange,
  878. onSelectModel,
  879. selectLabelChecks,
  880. refSelectModel,
  881. siteList,
  882. regionList,
  883. streetList,
  884. cultureList,
  885. genderList,
  886. healthList,
  887. jobStatusList,
  888. provinceList,
  889. bloodTypeList,
  890. maritalStatusList,
  891. familyNatureList,
  892. formState,
  893. educationData,
  894. experienceData,
  895. formTableState,
  896. keyPersonTypeList,
  897. politicsStatusList,
  898. changeCity,
  899. regionChange,
  900. loadExperienceData,
  901. deleteExperience,
  902. addExperience,
  903. experienceColumns,
  904. educationColumns,
  905. nationList,
  906. isFullTimeList,
  907. occupationalCategoryList,
  908. occupationalLevelList,
  909. loadLevelOccupationalCategoryList,
  910. occupationalChange
  911. }
  912. },
  913. created() {
  914. const id = history.state.params?.id;
  915. this.loadData(id);
  916. if (id) {
  917. this.loadEducation(id);
  918. this.loadExperienceData(id);
  919. }
  920. }
  921. })
  922. </script>