index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. <template>
  2. <div class="oa-sys-list-view">
  3. <div class="searchBox">
  4. <div class="form">
  5. <span class="formSpan">姓名:</span>
  6. <el-input v-model="formData.nickname" placeholder="请输入姓名" style="width: 210px" />
  7. </div>
  8. <div class="form">
  9. <span class="formSpan">部门:</span>
  10. <el-tree-select
  11. v-model="formData.deptId"
  12. :data="deptList"
  13. :props="defaultProps"
  14. check-strictly
  15. default-expand-all
  16. node-key="id"
  17. placeholder="请选择部门"
  18. clearable
  19. />
  20. </div>
  21. <div class="form">
  22. <span class="formSpan">岗位:</span>
  23. <el-select
  24. clearable
  25. width="160px"
  26. v-model="formData.ypgw"
  27. class="m-2"
  28. placeholder="请选择岗位"
  29. >
  30. <el-option
  31. v-for="item in postType"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value"
  35. />
  36. </el-select>
  37. </div>
  38. <div class="form">
  39. <span class="formSpan">等级:</span>
  40. <el-select
  41. clearable
  42. width="160px"
  43. v-model="formData.djcd"
  44. class="m-2"
  45. placeholder="请选择等级"
  46. >
  47. <el-option
  48. v-for="item in level"
  49. :key="item.value"
  50. :label="item.label"
  51. :value="item.value"
  52. />
  53. </el-select>
  54. </div>
  55. <div class="from">
  56. <div class="btnBox">
  57. <el-button type="primary" style="background: #3485ff" @click="onSearchHandle">
  58. <img src="@/assets/imgs/OA/search.png" class="mr-8px" alt="" />
  59. 查询</el-button
  60. >
  61. </div>
  62. </div>
  63. </div>
  64. <div class="tableBox">
  65. <TableLayout :is-loading="loading" :data="list">
  66. <el-table-column type="index" label="序号" width="60" />
  67. <el-table-column label="姓名" prop="nickname" width="150" />
  68. <el-table-column label="所在部门" align="center" prop="deptName" />
  69. <el-table-column show-overflow-tooltip="true" label="面试时间" align="center" prop="mssj">
  70. <template #default="scope">
  71. <span>{{ formatDate(scope.row.mssj) }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column show-overflow-tooltip="true" label="报到日期" align="center" prop="bdrq">
  75. <template #default="scope">
  76. <span>{{ formatDate(scope.row.bdrq) }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="岗位" align="center" prop="ypgw">
  80. <template #default="scope">
  81. {{ getDictLabel(DICT_TYPE.POST_TYPE, scope.row.ypgw) }}
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="初定等级" align="center" prop="djcd">
  85. <template #default="scope">
  86. {{ getDictLabel(DICT_TYPE.ABILITY_LEVEL, scope.row.djcd) }}
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="操作" width="180" align="center" fixed="right">
  90. <template #default="scope">
  91. <div class="operateBtn">
  92. <span @click="lookClick(scope.row)">查看</span>
  93. <span @click="operateClick(scope.row)" style="margin-left: 20px">报到</span>
  94. </div>
  95. </template>
  96. </el-table-column>
  97. </TableLayout>
  98. <div class="pageBox">
  99. <el-pagination
  100. v-model:current-page="formData.pageNo"
  101. :page-size="formData.pageSize"
  102. background
  103. layout="total, prev, pager, next, jumper"
  104. :total="total"
  105. @current-change="handleCurrentChange"
  106. />
  107. </div>
  108. </div>
  109. <el-dialog v-model="dialogVisible" title="入职办理" width="1200px">
  110. <div class="dialog_content">
  111. <el-form :model="form" ref="formEl" :rules="rules" label-width="120px">
  112. <h4 class="title_form">基本信息</h4>
  113. <el-row :gutter="20">
  114. <el-col :span="8">
  115. <el-form-item label="员工姓名">
  116. <el-input v-model="form.nickname" :disabled="true" />
  117. </el-form-item>
  118. </el-col>
  119. <el-col :span="8">
  120. <el-form-item label="身份证号" prop="cardid">
  121. <el-input v-model="form.cardid" />
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="8">
  125. <el-form-item label="手机号" prop="mobilePhone">
  126. <el-input v-model="form.mobilePhone" />
  127. </el-form-item>
  128. </el-col>
  129. </el-row>
  130. <el-row :gutter="20">
  131. <el-col :span="8">
  132. <el-form-item label="性别" prop="sex">
  133. <el-select v-model="form.sex" style="width: 100%">
  134. <el-option
  135. v-for="item in sexTypes"
  136. :key="item.value"
  137. :label="item.label"
  138. :value="item.value"
  139. />
  140. </el-select>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="8">
  144. <el-form-item label="民族" prop="nation">
  145. <el-select v-model="form.nation" style="width: 100%">
  146. <el-option
  147. v-for="item in nationTypes"
  148. :key="item.value"
  149. :label="item.label"
  150. :value="item.value"
  151. />
  152. </el-select>
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="8">
  156. <el-form-item label="出生日期" prop="birthday">
  157. <el-date-picker
  158. type="date"
  159. value-format="YYYY-MM-DD"
  160. v-model="form.birthday"
  161. style="width: 100%"
  162. />
  163. </el-form-item>
  164. </el-col>
  165. </el-row>
  166. <el-row :gutter="20">
  167. <el-col :span="8">
  168. <el-form-item label="婚姻状况" prop="hyzk">
  169. <el-select v-model="form.hyzk" style="width: 100%">
  170. <el-option
  171. v-for="item in hyTypes"
  172. :key="item.value"
  173. :label="item.label"
  174. :value="item.value"
  175. />
  176. </el-select>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="8">
  180. <el-form-item label="户口性质" prop="hkxz">
  181. <el-select v-model="form.hkxz" style="width: 100%">
  182. <el-option
  183. v-for="item in hkTypes"
  184. :key="item.value"
  185. :label="item.label"
  186. :value="item.value"
  187. />
  188. </el-select>
  189. </el-form-item>
  190. </el-col>
  191. <el-col :span="8">
  192. <el-form-item label="政治面貌" prop="zzmm">
  193. <el-select v-model="form.zzmm" style="width: 100%">
  194. <el-option
  195. v-for="item in polityTypes"
  196. :key="item.value"
  197. :label="item.label"
  198. :value="item.value"
  199. />
  200. </el-select>
  201. </el-form-item>
  202. </el-col>
  203. </el-row>
  204. <el-row :gutter="20">
  205. <el-col :span="8">
  206. <el-form-item label="在岗职位" prop="drzw">
  207. <el-select v-model="form.drzw" style="width: 100%">
  208. <el-option
  209. v-for="item in postTypes"
  210. :key="item.value"
  211. :label="item.label"
  212. :value="item.value"
  213. />
  214. </el-select>
  215. </el-form-item>
  216. </el-col>
  217. <el-col :span="8">
  218. <el-form-item label="状态" prop="state">
  219. <el-select v-model="form.state" style="width: 100%">
  220. <el-option
  221. v-for="item in staffStateTypes"
  222. :key="item.value"
  223. :label="item.label"
  224. :value="item.value"
  225. />
  226. </el-select>
  227. </el-form-item>
  228. </el-col>
  229. <el-col :span="8">
  230. <el-form-item label="参加工作时间" prop="cjgzsj">
  231. <el-date-picker
  232. type="date"
  233. value-format="YYYY-MM-DD"
  234. v-model="form.cjgzsj"
  235. style="width: 100%"
  236. />
  237. </el-form-item>
  238. </el-col>
  239. </el-row>
  240. <el-row :gutter="20">
  241. <el-col :span="8">
  242. <el-form-item label="合同签订时间" prop="htqdsj">
  243. <el-date-picker
  244. type="date"
  245. value-format="YYYY-MM-DD"
  246. v-model="form.htqdsj"
  247. style="width: 100%"
  248. />
  249. </el-form-item>
  250. </el-col>
  251. <el-col :span="8">
  252. <el-form-item label="合同到期时间" prop="htdqs">
  253. <el-date-picker
  254. type="date"
  255. value-format="YYYY-MM-DD"
  256. v-model="form.htdqs"
  257. style="width: 100%"
  258. />
  259. </el-form-item>
  260. </el-col>
  261. <el-col :span="8">
  262. <el-form-item label="入职时间" prop="rgssj">
  263. <el-date-picker
  264. type="date"
  265. value-format="YYYY-MM-DD"
  266. v-model="form.rgssj"
  267. style="width: 100%"
  268. />
  269. </el-form-item>
  270. </el-col>
  271. </el-row>
  272. <el-row :gutter="20">
  273. <el-col :span="8">
  274. <el-form-item label="初始司龄(年)" prop="cssl">
  275. <el-input v-model="form.cssl" />
  276. </el-form-item>
  277. </el-col>
  278. <el-col :span="8">
  279. <el-form-item label="年限(天)" prop="nj">
  280. <el-input v-model="form.nj" />
  281. </el-form-item>
  282. </el-col>
  283. <el-col :span="8">
  284. <el-form-item label="户口所在地" prop="hkszd">
  285. <el-input v-model="form.hkszd" />
  286. </el-form-item>
  287. </el-col>
  288. </el-row>
  289. <el-row :gutter="20">
  290. <el-col :span="8">
  291. <el-form-item label="现居住地址" prop="xjzdz">
  292. <el-input v-model="form.xjzdz" />
  293. </el-form-item>
  294. </el-col>
  295. <el-col :span="8">
  296. <el-form-item label="签订公司">
  297. <TreeSelectV2
  298. :data="assigneeTree"
  299. :props="{ label: 'name', value: 'id' }"
  300. v-model="form.qdgsid"
  301. :filter-method="filterNodeMethod"
  302. style="width: 100%"
  303. />
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="8">
  307. <el-form-item label="所属部门">
  308. <DeptTree v-model="form.ssbm" placeholder="请选择所属部门" style="width: 100%" />
  309. </el-form-item>
  310. </el-col>
  311. </el-row>
  312. <el-row :gutter="20">
  313. <el-col :span="8">
  314. <el-form-item label="指导人">
  315. <UserOrgTree v-model="form.zdr" placeholder="请选择指导人" style="width: 100%" />
  316. </el-form-item>
  317. </el-col>
  318. <el-col :span="8">
  319. <el-form-item label="试用期(月)">
  320. <el-input v-model="form.syq" />
  321. </el-form-item>
  322. </el-col>
  323. <el-col :span="8" />
  324. </el-row>
  325. <h4 class="title_form">工资卡信息</h4>
  326. <el-row :gutter="20">
  327. <el-col :span="12">
  328. <el-form-item label="开户银行">
  329. <el-input v-model="form.khyh" />
  330. </el-form-item>
  331. </el-col>
  332. <el-col :span="12">
  333. <el-form-item label="银行卡号">
  334. <el-input v-model="form.yhzh" />
  335. </el-form-item>
  336. </el-col>
  337. </el-row>
  338. <h4 class="title_form">教育信息</h4>
  339. <el-row :gutter="20">
  340. <el-col :span="12">
  341. <el-form-item label="毕业院校" prop="byxx">
  342. <el-input v-model="form.byxx" />
  343. </el-form-item>
  344. </el-col>
  345. <el-col :span="12">
  346. <el-form-item label="毕业时间" prop="bysj">
  347. <el-date-picker
  348. type="date"
  349. value-format="YYYY-MM-DD"
  350. v-model="form.bysj"
  351. style="width: 100%"
  352. />
  353. </el-form-item>
  354. </el-col>
  355. </el-row>
  356. <el-row :gutter="20">
  357. <el-col :span="12">
  358. <el-form-item label="专业" prop="major">
  359. <el-input v-model="form.major" />
  360. </el-form-item>
  361. </el-col>
  362. <el-col :span="12">
  363. <el-form-item label="最高学历" prop="zgxl">
  364. <el-input v-model="form.zgxl" />
  365. </el-form-item>
  366. </el-col>
  367. </el-row>
  368. <h4 class="title_form">紧急联系人信息</h4>
  369. <el-row :gutter="20">
  370. <el-col :span="8">
  371. <el-form-item label="联系人姓名" prop="jjlxrxm">
  372. <el-input v-model="form.jjlxrxm" />
  373. </el-form-item>
  374. </el-col>
  375. <el-col :span="8">
  376. <el-form-item label="联系人电话" prop="jjlxrhm">
  377. <el-input v-model="form.jjlxrhm" />
  378. </el-form-item>
  379. </el-col>
  380. <el-col :span="8">
  381. <el-form-item label="联系人关系" prop="jjlxrgx">
  382. <el-input v-model="form.jjlxrgx" />
  383. </el-form-item>
  384. </el-col>
  385. </el-row>
  386. </el-form>
  387. <div class="title_box">
  388. <h4 class="title_form">家庭成员信息</h4>
  389. <el-button type="primary" @click="addFamilyHandle">新增</el-button>
  390. </div>
  391. <div class="tableBox">
  392. <el-table :data="familyTables" :border="true">
  393. <el-table-column
  394. v-for="(item, index) in familyColumns"
  395. :label="item['title']"
  396. :key="index"
  397. >
  398. <template #default="scope">
  399. <el-input v-model="scope.row[item.key]" :disabled="scope.row['disabled']" />
  400. </template>
  401. </el-table-column>
  402. <el-table-column label="操作">
  403. <template #default="scope">
  404. <div class="operateBtn">
  405. <span @click="saveFamilyHandle(scope.row)">{{
  406. scope.row.disabled ? '编辑' : '保存'
  407. }}</span>
  408. <span
  409. @click="deleteFamilyHandle(scope.row, scope.$index)"
  410. style="margin-left: 20px"
  411. >
  412. 删除
  413. </span>
  414. </div>
  415. </template>
  416. </el-table-column>
  417. </el-table>
  418. </div>
  419. </div>
  420. <template #footer>
  421. <div class="dialog-footer">
  422. <el-button @click="dialogVisible = false">取消</el-button>
  423. <el-button type="primary" @click="submitHandle"> 提交 </el-button>
  424. </div>
  425. </template>
  426. </el-dialog>
  427. </div>
  428. </template>
  429. <script setup lang="ts">
  430. import { defaultProps, handleTree } from '@/utils/tree'
  431. import request from '@/config/axios'
  432. import { DICT_TYPE, getDictLabel, getDictOptions } from '@/utils/dict'
  433. import { ref } from 'vue'
  434. import { useRouter } from 'vue-router'
  435. import TableLayout from '../../oaViews/layout/TableLayout.vue'
  436. import { formatDate } from '@/utils/formatTime'
  437. import * as DeptApi from '@/api/system/dept'
  438. import { arrFlatten } from '@/views/OaSystem/attendanceCenter/attendAuth'
  439. import UserOrgTree from '@/views/OaSystem/components/UserOrgTree/index.vue'
  440. import DeptTree from '@/views/OaSystem/components/DeptTree/index.vue'
  441. import TreeSelectV2 from '@/components/TreeSelectV2/index.vue'
  442. import { filterNodeMethod } from '@/utils/tree'
  443. import { useQuery } from '@tanstack/vue-query'
  444. import { queryCompanyTree } from '@/service/contract'
  445. import { form, familyColumns, rules } from './common'
  446. defineOptions({ name: 'RchbkPage' })
  447. const postType = getDictOptions(DICT_TYPE.POST_TYPE)
  448. const level = getDictOptions(DICT_TYPE.ABILITY_LEVEL)
  449. const nationTypes = getDictOptions(DICT_TYPE.NATION_TYPE)
  450. const hyTypes = getDictOptions(DICT_TYPE.HY_TYPES)
  451. const hkTypes = getDictOptions(DICT_TYPE.HK_TYPES)
  452. const polityTypes = getDictOptions(DICT_TYPE.POLITY_TYPES)
  453. const postTypes = getDictOptions(DICT_TYPE.POST_TYPE)
  454. const staffStateTypes = getDictOptions(DICT_TYPE.STAFF_STATE_TYPES)
  455. const sexTypes = getDictOptions(DICT_TYPE.SEX_TYPES)
  456. const router = useRouter()
  457. const formData = ref<{
  458. pageNo: number
  459. pageSize: number
  460. deptId: string
  461. nickname: string
  462. deptName: string
  463. ypgw: any
  464. djcd: any
  465. }>({
  466. pageNo: 1,
  467. pageSize: 15,
  468. deptId: '',
  469. nickname: '',
  470. deptName: '',
  471. ypgw: '',
  472. djcd: ''
  473. })
  474. const loading = ref(true) // 列表的加载中
  475. const total = ref(0) // 列表的总页数
  476. const list = ref([]) // 列表的数
  477. const deptList = ref<Tree[]>([]) // 树形结构
  478. const deptSort: any = ref([])
  479. const initTreeDeps = async () => {
  480. DeptApi.getSimpleDeptList().then((res) => {
  481. deptList.value = handleTree(res)
  482. deptSort.value = arrFlatten(res, 'children')
  483. })
  484. }
  485. /***
  486. * 查询受托方数据
  487. * **/
  488. const { data: assigneeTree } = useQuery(['assigneeTree'], async () => await queryCompanyTree(), {
  489. staleTime: Infinity
  490. })
  491. /** 查询列表 */
  492. const queryListByPage = async () => {
  493. loading.value = true
  494. try {
  495. const urlApi = `/interview/page`
  496. const sendData = {
  497. ...formData.value
  498. }
  499. const result = await request.get({ url: urlApi, params: sendData }, '/business')
  500. list.value = result['list']
  501. total.value = result['total']
  502. loading.value = false
  503. } catch (error) {
  504. loading.value = false
  505. }
  506. }
  507. const lookClick = (row: any) => {
  508. router.push({
  509. path: '/processLook',
  510. query: {
  511. url:
  512. `${
  513. import.meta.env.VITE_PROCESS_DETAIL_URI
  514. }/IFlowInstance/redirectFlowPage?flowInstanceId=` + row.instanceId
  515. }
  516. })
  517. }
  518. const dialogVisible = ref<boolean>(false)
  519. const operateClick = (row: any) => {
  520. dialogVisible.value = true
  521. form.value.userId = row.userId
  522. form.value.nickname = row.nickname
  523. }
  524. const formEl = ref<any>(null)
  525. const submitHandle = async () => {
  526. await formEl.value.validate((valid, fields) => {
  527. if (valid) {
  528. console.log('submit!')
  529. insertStaffRecords()
  530. } else {
  531. console.log('error submit!', fields)
  532. }
  533. })
  534. }
  535. /** 新增入职人员 */
  536. const insertStaffRecords = async () => {
  537. try {
  538. const urlApi = `/adm/staff-records/insert`
  539. form.value.familyList = familyTables.value as never[]
  540. const result = await request.post({ url: urlApi, data: form.value })
  541. dialogVisible.value = false
  542. queryListByPage()
  543. } catch (error) {
  544. loading.value = false
  545. }
  546. }
  547. interface FamilyType {
  548. name: string
  549. xb: string
  550. gzdw: string
  551. zz: string
  552. lxdh: string
  553. gx: string
  554. disabled: boolean
  555. }
  556. const familyTables = ref<FamilyType[]>([])
  557. const addFamilyHandle = () => {
  558. familyTables.value.push({
  559. name: '',
  560. xb: '',
  561. gzdw: '',
  562. zz: '',
  563. lxdh: '',
  564. gx: '',
  565. disabled: false
  566. })
  567. }
  568. const saveFamilyHandle = (item) => {
  569. item.disabled = !item.disabled
  570. }
  571. const deleteFamilyHandle = (item, index) => {
  572. familyTables.value.splice(index, 1)
  573. }
  574. /** 搜索按钮操作 */
  575. const onSearchHandle = (): void => {
  576. queryListByPage()
  577. }
  578. /** 分页操作 */
  579. const handleCurrentChange = (): void => {
  580. queryListByPage()
  581. }
  582. /** 初始化 */
  583. onMounted(() => {
  584. initTreeDeps()
  585. queryListByPage()
  586. })
  587. </script>
  588. <style lang="scss" scoped>
  589. .dialog_content {
  590. padding: 0px 20px;
  591. }
  592. .title_box {
  593. display: flex;
  594. justify-content: space-between;
  595. }
  596. .title_form {
  597. font-size: 18px;
  598. margin-bottom: 15px;
  599. }
  600. .operateBtn {
  601. display: flex;
  602. cursor: pointer;
  603. align-items: center;
  604. justify-content: center;
  605. width: auto !important;
  606. span {
  607. color: #2e77e6;
  608. white-space: nowrap;
  609. }
  610. }
  611. .tableBox {
  612. :deep(.el-input.is-disabled .el-input__wrapper) {
  613. background: none !important;
  614. box-shadow: none !important;
  615. }
  616. :deep(.el-input.is-disabled .el-input__inner) {
  617. color: #333 !important;
  618. -webkit-text-fill-color: #333 !important;
  619. }
  620. }
  621. </style>