memberMessage.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405
  1. <template>
  2. <div class="message-info">
  3. <div class="error"></div>
  4. <div style=" box-sizing: border-box; padding: 15px;background-color: #fff;">
  5. <el-row :gutter="24">
  6. <el-col :span="20">
  7. <div style="display: flex; align-items: center;">
  8. <div class="img-title">
  9. {{ pinyin.getFullChars(operationForm.name).substring(0, 1) }}
  10. </div>
  11. <h4>{{ operationForm.name }}</h4>
  12. </div>
  13. </el-col>
  14. <el-col :span="4">
  15. <el-button type="primary" @click="editMember">编辑</el-button>
  16. <el-dropdown style="margin-left: 15px;">
  17. <el-button type="primary"> 更多 </el-button>
  18. <template #dropdown>
  19. <el-dropdown-menu>
  20. <el-dropdown-item v-on:click="changeDept()"
  21. >变更机构</el-dropdown-item
  22. >
  23. <el-dropdown-item v-on:click="resign()">操作离职</el-dropdown-item>
  24. <el-dropdown-item v-on:click="transfer()"
  25. >资源转移</el-dropdown-item
  26. >
  27. <el-dropdown-item v-on:click="delUser()">删除</el-dropdown-item>
  28. </el-dropdown-menu>
  29. </template>
  30. </el-dropdown>
  31. </el-col>
  32. </el-row>
  33. <el-row :gutter="24">
  34. <el-col :span="18">
  35. <el-descriptions title="" class="info-list" :column="2">
  36. <el-descriptions-item label="工号:">{{
  37. operationForm.userId
  38. }}</el-descriptions-item>
  39. <el-descriptions-item label="手机号:">{{
  40. operationForm.mobile
  41. }}</el-descriptions-item>
  42. <el-descriptions-item label="所在机构:">
  43. {{ operationForm.deptName }}
  44. </el-descriptions-item>
  45. <el-descriptions-item label="角色:">
  46. {{ operationForm.deptName }}
  47. </el-descriptions-item>
  48. <el-descriptions-item label="创建人:">
  49. {{ operationForm.createBy }}
  50. </el-descriptions-item>
  51. <el-descriptions-item label="创建时间:">
  52. {{ operationForm.createTime }}
  53. </el-descriptions-item>
  54. </el-descriptions>
  55. </el-col>
  56. <el-col :span="6">
  57. <h2>
  58. {{
  59. statusList
  60. .map((item) => {
  61. return item.value == operationForm.status ? item.label : "";
  62. })
  63. .join("")
  64. }}
  65. </h2>
  66. <p>状态</p>
  67. </el-col>
  68. </el-row>
  69. </div>
  70. <el-form
  71. :model="operationForm"
  72. ref="OperationFormRef"
  73. label-width="120"
  74. style=" box-sizing: border-box; padding: 20px;background-color: #fff;"
  75. >
  76. <el-tabs v-model="activeName" class="demo-tabs">
  77. <el-tab-pane label="基本信息" name="first">
  78. <el-descriptions title="个人信息">
  79. <el-descriptions-item>
  80. <template #default>
  81. <el-row :gutter="24">
  82. <el-col :span="12">
  83. <el-form-item prop="name" label="姓名:">
  84. {{ operationForm.name }}
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="12">
  88. <el-form-item prop="mobile" label="手机号:">
  89. {{ operationForm.mobile }}
  90. </el-form-item>
  91. </el-col>
  92. </el-row>
  93. <el-row :gutter="24">
  94. <el-col :span="12">
  95. <el-form-item prop="deptId" label="所属机构:">
  96. {{ operationForm.deptName || "--" }}
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="12">
  100. <el-form-item prop="identity" label="证件号:">
  101. {{ operationForm.identity }}
  102. </el-form-item>
  103. </el-col>
  104. </el-row>
  105. <el-row :gutter="24">
  106. <el-col :span="12">
  107. <el-form-item
  108. prop="identityTimeStart"
  109. label="证件有效期始:"
  110. >
  111. {{ operationForm.identityTimeStart }}
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="12">
  115. <el-form-item prop="identityTimeEnd" label="证件有效期止:">
  116. {{ operationForm.identityTimeEnd }}
  117. </el-form-item>
  118. </el-col>
  119. </el-row>
  120. <el-row :gutter="24">
  121. <el-col :span="12">
  122. <el-form-item prop="sex" label="性别:">
  123. {{
  124. genderList
  125. .map((item) => {
  126. return item.value == operationForm.sex
  127. ? item.label
  128. : "";
  129. })
  130. .join("")
  131. }}
  132. </el-form-item>
  133. </el-col>
  134. <el-col :span="12">
  135. <el-form-item prop="born" label="出生日期:">
  136. {{ operationForm.birthday }}
  137. </el-form-item>
  138. </el-col>
  139. </el-row>
  140. <el-row :gutter="24">
  141. <el-col :span="12">
  142. <el-form-item prop="type" label="民族:">
  143. {{
  144. nation
  145. .map((item) => {
  146. return item.value == operationForm.nations
  147. ? item.label
  148. : "";
  149. })
  150. .join("")
  151. }}
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="12">
  155. <el-form-item prop="team" label="户籍:">
  156. {{ operationForm.koseki }}
  157. </el-form-item>
  158. </el-col>
  159. </el-row>
  160. <el-row :gutter="24">
  161. <el-col :span="12">
  162. <el-form-item prop="type" label="婚姻状况:">
  163. {{
  164. marriage
  165. .map((item) => {
  166. return item.value == operationForm.maritalStatus
  167. ? item.label
  168. : "";
  169. })
  170. .join("")
  171. }}
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="12">
  175. <el-form-item prop="team" label="政治面貌:">
  176. {{
  177. political_status
  178. .map((item) => {
  179. return item.value == operationForm.politicsStatus
  180. ? item.label
  181. : "";
  182. })
  183. .join("")
  184. }}
  185. </el-form-item>
  186. </el-col>
  187. </el-row>
  188. <el-row :gutter="24">
  189. <el-col :span="12">
  190. <el-form-item prop="type" label="健康状况:">
  191. {{
  192. health_status
  193. .map((item) => {
  194. return item.value == operationForm.health
  195. ? item.label
  196. : "";
  197. })
  198. .join("")
  199. }}
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="12">
  203. <el-form-item prop="team" label="居住地区:">
  204. <!-- <el-select
  205. v-model="operationForm.address"
  206. placeholder="请选择居住地区"
  207. >
  208. <el-option key="1" value="团队1"></el-option>
  209. </el-select> -->
  210. {{ operationForm.region || "--" }}
  211. </el-form-item>
  212. </el-col>
  213. </el-row>
  214. <el-row :gutter="24">
  215. <el-col :span="12">
  216. <el-form-item prop="team" label="详细地址:">
  217. {{ operationForm.liveAddress }}
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="12">
  221. <el-form-item prop="team" label="邮政编码:">
  222. {{ operationForm.postalCode }}
  223. </el-form-item>
  224. </el-col>
  225. </el-row>
  226. </template>
  227. </el-descriptions-item>
  228. </el-descriptions>
  229. <el-descriptions title="学历信息" v-show="recordShow">
  230. <el-descriptions-item>
  231. <template #default>
  232. <el-row :gutter="24">
  233. <el-col :span="12">
  234. <el-form-item prop="sex" label="学历:">
  235. {{
  236. educational
  237. .map((item) => {
  238. return item.value == operationForm.education
  239. ? item.label
  240. : "";
  241. })
  242. .join("")
  243. }}
  244. </el-form-item>
  245. </el-col>
  246. <el-col :span="12">
  247. <el-form-item prop="born" label="毕业时间:">
  248. {{ operationForm.graduationTime }}
  249. </el-form-item>
  250. </el-col>
  251. </el-row>
  252. <el-row :gutter="24">
  253. <el-col :span="12">
  254. <el-form-item prop="type" label="毕业院校:">
  255. {{ operationForm.school }}
  256. </el-form-item>
  257. </el-col>
  258. <el-col :span="12">
  259. <el-form-item prop="team" label="是否计算机专业:">
  260. {{ operationForm.isComputer }}
  261. </el-form-item>
  262. </el-col>
  263. </el-row>
  264. </template>
  265. </el-descriptions-item>
  266. </el-descriptions>
  267. <el-descriptions title="紧急联系人信息" v-show="recordShow">
  268. <el-descriptions-item>
  269. <template #default>
  270. <el-row :gutter="24">
  271. <el-col :span="12">
  272. <el-form-item prop="team" label="姓名:">
  273. {{ operationForm.emergencyContactName }}
  274. </el-form-item>
  275. </el-col>
  276. <el-col :span="12">
  277. <el-form-item prop="team" label="手机号:">
  278. {{ operationForm.emergencyContactTel }}
  279. </el-form-item>
  280. </el-col>
  281. </el-row>
  282. </template>
  283. </el-descriptions-item>
  284. </el-descriptions>
  285. <el-descriptions title="工资信息" v-show="recordShow">
  286. <el-descriptions-item>
  287. <template #default>
  288. <el-row :gutter="24">
  289. <el-col :span="12">
  290. <el-form-item prop="team" label="工资:">
  291. {{ operationForm.salary }}
  292. </el-form-item>
  293. </el-col>
  294. <el-col :span="12">
  295. <el-form-item prop="team" label="工资等级:">
  296. {{ operationForm.salaryLevel }}
  297. </el-form-item>
  298. </el-col>
  299. </el-row>
  300. <el-row :gutter="24">
  301. <el-col :span="12">
  302. <el-form-item prop="team" label="银行卡号:">
  303. {{ operationForm.bankCardId }}
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="12">
  307. <el-form-item prop="team" label="开户行:">
  308. {{ operationForm.bankName }}
  309. </el-form-item>
  310. </el-col>
  311. </el-row>
  312. </template>
  313. </el-descriptions-item>
  314. </el-descriptions>
  315. </el-tab-pane>
  316. <el-tab-pane label="资料附件" name="second">
  317. <el-descriptions v-show="recordShow" title="资料附件">
  318. <el-descriptions-item>
  319. <template #default>
  320. <el-form-item
  321. prop=""
  322. label="身份证(人像面)"
  323. label-width="150"
  324. label-position="left"
  325. >
  326. <el-upload
  327. :auto-upload="false"
  328. v-if="!IDCardFront"
  329. action="#"
  330. :show-file-list="false"
  331. accept=".png, .jpg, .jpeg"
  332. @change="uploadImage($event, 1)"
  333. >
  334. <el-button link type="primary">上传</el-button>
  335. </el-upload>
  336. <div class="fileInfo" v-else>
  337. <div class="fileName">{{ IDCardFrontName }}</div>
  338. <div class="fileBtn">
  339. <el-upload
  340. :auto-upload="false"
  341. action="#"
  342. :show-file-list="false"
  343. accept=".png, .jpg, .jpeg"
  344. @change="uploadImage($event, 1)"
  345. style="display: flex; align-items: center;"
  346. >
  347. <el-icon class="btn-icon"><Upload /></el-icon>
  348. </el-upload>
  349. <el-icon class="btn-icon" @click="imageView(1)"
  350. ><View
  351. /></el-icon>
  352. <el-icon class="btn-icon"><Download /></el-icon>
  353. <el-icon class="btn-icon"><Delete /></el-icon>
  354. </div>
  355. </div>
  356. </el-form-item>
  357. <el-form-item
  358. prop=""
  359. label="身份证(国徽面)"
  360. label-width="150"
  361. label-position="left"
  362. >
  363. <el-upload
  364. :auto-upload="false"
  365. v-if="!IDCardBack"
  366. action="#"
  367. :show-file-list="false"
  368. accept=".png, .jpg, .jpeg"
  369. @change="uploadImage($event, 2)"
  370. >
  371. <el-button link type="primary">上传</el-button>
  372. </el-upload>
  373. <div class="fileInfo" v-else>
  374. <div class="fileName">{{ IDCardBackName }}</div>
  375. <div class="fileBtn">
  376. <el-upload
  377. :auto-upload="false"
  378. action="#"
  379. :show-file-list="false"
  380. accept=".png, .jpg, .jpeg"
  381. @change="uploadImage($event, 2)"
  382. style="display: flex; align-items: center;"
  383. >
  384. <el-icon class="btn-icon"><Upload /></el-icon>
  385. </el-upload>
  386. <el-icon class="btn-icon" @click="imageView(2)"
  387. ><View
  388. /></el-icon>
  389. <el-icon class="btn-icon"><Download /></el-icon>
  390. <el-icon class="btn-icon"><Delete /></el-icon>
  391. </div>
  392. </div>
  393. </el-form-item>
  394. <el-form-item
  395. prop=""
  396. label="银行卡"
  397. label-width="150"
  398. label-position="left"
  399. >
  400. <el-upload
  401. :auto-upload="false"
  402. v-if="!bankSize"
  403. action="#"
  404. :show-file-list="false"
  405. accept=".png, .jpg, .jpeg"
  406. @change="uploadImage($event, 3)"
  407. >
  408. <el-button link type="primary">上传</el-button>
  409. </el-upload>
  410. <div class="fileInfo" v-else>
  411. <div class="fileName">{{ bankName }}</div>
  412. <div class="fileBtn">
  413. <el-upload
  414. :auto-upload="false"
  415. action="#"
  416. :show-file-list="false"
  417. accept=".png, .jpg, .jpeg"
  418. @change="uploadImage($event, 3)"
  419. style="display: flex; align-items: center;"
  420. >
  421. <el-icon class="btn-icon"><Upload /></el-icon>
  422. </el-upload>
  423. <el-icon class="btn-icon" @click="imageView(3)"
  424. ><View
  425. /></el-icon>
  426. <el-icon class="btn-icon"><Download /></el-icon>
  427. <el-icon class="btn-icon"><Delete /></el-icon>
  428. </div>
  429. </div>
  430. </el-form-item>
  431. <el-form-item
  432. prop=""
  433. label="劳动合同"
  434. label-width="150"
  435. label-position="left"
  436. >
  437. <el-upload
  438. :auto-upload="false"
  439. v-if="!contract"
  440. action="#"
  441. :show-file-list="false"
  442. accept=".png, .jpg, .jpeg"
  443. @change="uploadImage($event, 4)"
  444. >
  445. <el-button link type="primary">上传</el-button>
  446. </el-upload>
  447. <div class="fileInfo" v-else>
  448. <div class="fileName">{{ contractName }}</div>
  449. <div class="fileBtn">
  450. <el-upload
  451. :auto-upload="false"
  452. action="#"
  453. :show-file-list="false"
  454. accept=".png, .jpg, .jpeg"
  455. @change="uploadImage($event, 4)"
  456. style="display: flex; align-items: center;"
  457. >
  458. <el-icon class="btn-icon"><Upload /></el-icon>
  459. </el-upload>
  460. <el-icon class="btn-icon" @click="imageView(4)"
  461. ><View
  462. /></el-icon>
  463. <el-icon class="btn-icon"><Download /></el-icon>
  464. <el-icon class="btn-icon"><Delete /></el-icon>
  465. </div>
  466. </div>
  467. </el-form-item>
  468. <el-form-item
  469. prop=""
  470. label="应聘表"
  471. label-width="150"
  472. label-position="left"
  473. >
  474. <el-upload
  475. :auto-upload="false"
  476. v-if="!applicant"
  477. action="#"
  478. :show-file-list="false"
  479. accept=".png, .jpg, .jpeg"
  480. @change="uploadImage($event, 5)"
  481. >
  482. <el-button link type="primary">上传</el-button>
  483. </el-upload>
  484. <div class="fileInfo" v-else>
  485. <div class="fileName">{{ applicantName }}</div>
  486. <div class="fileBtn">
  487. <el-upload
  488. :auto-upload="false"
  489. action="#"
  490. :show-file-list="false"
  491. accept=".png, .jpg, .jpeg"
  492. @change="uploadImage($event, 5)"
  493. style="display: flex; align-items: center;"
  494. >
  495. <el-icon class="btn-icon"><Upload /></el-icon>
  496. </el-upload>
  497. <el-icon class="btn-icon" @click="imageView(5)"
  498. ><View
  499. /></el-icon>
  500. <el-icon class="btn-icon"><Download /></el-icon>
  501. <el-icon class="btn-icon"><Delete /></el-icon>
  502. </div>
  503. </div>
  504. </el-form-item>
  505. <el-form-item
  506. prop=""
  507. label="定薪表"
  508. label-width="150"
  509. label-position="left"
  510. >
  511. <el-upload
  512. :auto-upload="false"
  513. v-if="!decidePay"
  514. action="#"
  515. :show-file-list="false"
  516. accept=".png, .jpg, .jpeg"
  517. @change="uploadImage($event, 6)"
  518. >
  519. <el-button link type="primary">上传</el-button>
  520. </el-upload>
  521. <div class="fileInfo" v-else>
  522. <div class="fileName">{{ decidePayName }}</div>
  523. <div class="fileBtn">
  524. <el-upload
  525. :auto-upload="false"
  526. action="#"
  527. :show-file-list="false"
  528. accept=".png, .jpg, .jpeg"
  529. @change="uploadImage($event, 6)"
  530. style="display: flex; align-items: center;"
  531. >
  532. <el-icon class="btn-icon"><Upload /></el-icon>
  533. </el-upload>
  534. <el-icon class="btn-icon" @click="imageView(6)"
  535. ><View
  536. /></el-icon>
  537. <el-icon class="btn-icon"><Download /></el-icon>
  538. <el-icon class="btn-icon"><Delete /></el-icon>
  539. </div>
  540. </div>
  541. </el-form-item>
  542. <el-form-item
  543. prop=""
  544. label="离职表"
  545. label-width="150"
  546. label-position="left"
  547. >
  548. <el-upload
  549. :auto-upload="false"
  550. v-if="!dimission"
  551. action="#"
  552. :show-file-list="false"
  553. accept=".png, .jpg, .jpeg"
  554. @change="uploadImage($event, 7)"
  555. >
  556. <el-button link type="primary">上传</el-button>
  557. </el-upload>
  558. <div class="fileInfo" v-else>
  559. <div class="fileName">{{ dimissionName }}</div>
  560. <div class="fileBtn">
  561. <el-upload
  562. :auto-upload="false"
  563. action="#"
  564. :show-file-list="false"
  565. accept=".png, .jpg, .jpeg"
  566. @change="uploadImage($event, 7)"
  567. style="display: flex; align-items: center;"
  568. >
  569. <el-icon class="btn-icon"><Upload /></el-icon>
  570. </el-upload>
  571. <el-icon class="btn-icon" @click="imageView(7)"
  572. ><View
  573. /></el-icon>
  574. <el-icon class="btn-icon"><Download /></el-icon>
  575. <el-icon class="btn-icon"><Delete /></el-icon>
  576. </div>
  577. </div>
  578. </el-form-item>
  579. </template>
  580. </el-descriptions-item>
  581. </el-descriptions>
  582. </el-tab-pane>
  583. </el-tabs>
  584. <!-- <div style="display: flex; justify-content: flex-end">
  585. <el-button @click="onSubmit(0)">取消</el-button>
  586. <el-button type="primary" @click="onSubmit(OperationFormRef, 1)"
  587. >确定</el-button
  588. >
  589. </div> -->
  590. </el-form>
  591. <div class="image-view" v-if="imageShow" @click="imageShow = false">
  592. <img :src="imageUrl" />
  593. </div>
  594. <el-dialog
  595. v-model="dialogVisible"
  596. :title="leave?'操作离职':'资源转移'"
  597. width="800"
  598. draggable
  599. append-to-body
  600. >
  601. <el-row :gutter="24">
  602. <el-col :span="20">
  603. <div style="display: flex; align-items: center;">
  604. <div class="img-title">
  605. {{ pinyin.getFullChars(operationForm.name).substring(0, 1) }}
  606. </div>
  607. <h4>{{ operationForm.name }}</h4>
  608. </div>
  609. </el-col>
  610. </el-row>
  611. <p style="margin-left: 50px;">工号:{{ transferInfo.userId }}</p>
  612. <p style="margin-left: 50px;">所在机构:{{ transferInfo.deptName }}</p>
  613. <el-divider v-show="leave"/>
  614. <!-- 资源转移--->
  615. <p style="margin-left: 50px;" v-show="!leave">需要转移的资源</p>
  616. <el-table :data="[{}]" style="width: 100%;" v-show="!leave">
  617. <el-table-column prop="date" label="资源" width="120">
  618. <template #default> 业务员 </template>
  619. </el-table-column>
  620. <el-table-column prop="name" label="描述" width="180">
  621. <template #default> 转让该成员维护的业务员 </template>
  622. </el-table-column>
  623. <el-table-column prop="address" label="数量" width="80">
  624. <template #default> {{ transferInfo.count }}人 </template>
  625. </el-table-column>
  626. <el-table-column prop="address" label="资源接收人">
  627. <template #default>
  628. <el-input
  629. :value="receiveInfo?.name"
  630. @click="deptDialogVisible = true"
  631. placeholder="输入姓名,手机号,工号查找"
  632. ></el-input>
  633. </template>
  634. </el-table-column>
  635. </el-table>
  636. <!-- 操作离职--->
  637. <!-- <el-radio-group v-model="radio1">
  638. <el-radio value="1" size="large">转移给其他成员</el-radio>
  639. <el-radio value="0" size="large">不转移</el-radio>
  640. </el-radio-group> -->
  641. <template #footer>
  642. <div class="dialog-footer">
  643. <el-button @click="dialogVisible = false">取消</el-button>
  644. <el-button type="primary" @click="confirmTransfer">
  645. 确认{{ leave?'离职':'转移' }}
  646. </el-button>
  647. </div>
  648. </template>
  649. </el-dialog>
  650. <setDept
  651. :dialogVisible="deptDialogVisible"
  652. :dept-list="tableData"
  653. :dept-ids="[]"
  654. @close-dialog="confirmDialogInfo"
  655. title="选择交接人"
  656. @cancel-dialog="deptDialogVisible=false"
  657. ></setDept>
  658. <el-dialog
  659. v-model="changeDeptDialog"
  660. title="变更机构"
  661. width="600"
  662. append-to-body
  663. draggable
  664. >
  665. <div>
  666. <el-input
  667. v-model="filterText"
  668. style="width: 240px;"
  669. placeholder="请输入机构名称查找"
  670. :prefix-icon="Search"
  671. />
  672. <el-tree
  673. ref="treeRef"
  674. style="max-width: 600px;"
  675. class="filter-tree"
  676. :data="tableData"
  677. :props="tableProps"
  678. :default-expand-all="true"
  679. :expand-on-click-node="false"
  680. :filter-node-method="filterNode"
  681. @node-click="treeClick"
  682. >
  683. <template #default="{ node, data }">
  684. <span class="custom-tree-node">
  685. <span>{{ node.label }}</span>
  686. <span>
  687. <a style="color: #00a0f4;">
  688. {{ node.label == deptItem.name ? "已选" : "" }}
  689. </a>
  690. </span>
  691. </span>
  692. </template>
  693. </el-tree>
  694. </div>
  695. <template #footer>
  696. <div class="dialog-footer">
  697. <el-button @click="changeDeptDialog = false">取消</el-button>
  698. <el-button type="primary" @click="submitChangeDept"> 确认 </el-button>
  699. </div>
  700. </template>
  701. </el-dialog>
  702. </div>
  703. </template>
  704. <script setup lang="ts">
  705. import { ref, defineEmits, onMounted, watch } from "vue";
  706. import { memberType } from "@/api/modules/user";
  707. import type { FormRules, FormInstance, ElTree } from "element-plus";
  708. import api from "@/api";
  709. import { Search } from "@element-plus/icons-vue";
  710. import { ElMessage, ElMessageBox } from "element-plus";
  711. import { getDictItems } from "@/api/dict";
  712. import { useRoute } from "vue-router";
  713. import pinyin from "js-pinyin";
  714. import { useRouter } from "vue-router";
  715. import setDept from "@/components/DialogSetDeptLeader/index.vue";
  716. interface dictType {
  717. value: string;
  718. id: string;
  719. label: string;
  720. [property: string]: any;
  721. }
  722. interface institutionData {
  723. name: string;
  724. system: string;
  725. }
  726. const info = ref<institutionData>({
  727. name: "",
  728. system: "",
  729. });
  730. //转移资源
  731. const dialogVisible = ref(false);
  732. //选择交接人
  733. const deptDialogVisible = ref(false);
  734. const route = useRoute();
  735. const activeName = ref("first");
  736. const statusList = ref<dictType[]>([]);
  737. onMounted(async () => {
  738. genderList.value = await getDictItems({ dictCode: "gender" });
  739. nation.value = await getDictItems({ dictCode: "nation" });
  740. marriage.value = await getDictItems({ dictCode: "marriage" });
  741. political_status.value = await getDictItems({ dictCode: "political_status" });
  742. health_status.value = await getDictItems({ dictCode: "health_status" });
  743. educational.value = await getDictItems({ dictCode: "educational" });
  744. statusList.value = await getDictItems({ dictCode: "person_status" });
  745. getAreaList(); //省市区级联数据
  746. api.institutionApi.institutionList(info.value).then((res) => {
  747. tableData.value = [...res.data];
  748. });
  749. api.userApi
  750. .getUserInfo({
  751. id: route.query.id || "",
  752. })
  753. .then((res: any) => {
  754. console.log(res);
  755. if (res.code === 200) {
  756. operationForm.value = res.data;
  757. let formData = res.data
  758. if(formData.fileList) {
  759. let sfz1 = formData.fileList.find(item => item.fileType == 'sfz1')
  760. let sfz2 = formData.fileList.find(item => item.fileType == 'sfz2')
  761. let qualification = formData.fileList.find(item => item.fileType == 'bankCard')
  762. let contractImg = formData.fileList.find(item => item.fileType == 'contract')
  763. let applicantImg = formData.fileList.find(item => item.fileType == 'applicant')
  764. let salaryTable = formData.fileList.find(item => item.fileType == 'salaryTable')
  765. let leaveTable = formData.fileList.find(item => item.fileType == 'leaveTable')
  766. if(sfz1) {
  767. operationForm.value.sfz1 = sfz1.id
  768. IDCardFrontName.value = sfz1.fileName
  769. IDCardFront.value = sfz1.fileUrl
  770. }
  771. if(sfz2) {
  772. operationForm.value.sfz2 = sfz2.id
  773. IDCardBackName.value = sfz2.fileName
  774. IDCardBack.value = sfz2.fileUrl
  775. }
  776. if(qualification) {
  777. operationForm.value.qualification = qualification.id
  778. bankName.value = qualification.fileName
  779. bankSize.value = qualification.fileUrl
  780. }
  781. if(contractImg) {
  782. operationForm.value.contract = contract.id
  783. contractName.value = contractImg.fileName
  784. contract.value = contractImg.fileUrl
  785. }
  786. if(applicantImg) {
  787. operationForm.value.applicant = applicant.id
  788. applicantName.value = applicantImg.fileName
  789. applicant.value = applicantImg.fileUrl
  790. }
  791. if(salaryTable) {
  792. operationForm.value.salaryTable = salaryTable.id
  793. decidePayName.value = salaryTable.fileName
  794. decidePay.value = salaryTable.fileUrl
  795. }
  796. if(leaveTable) {
  797. operationForm.value.leaveTable = leaveTable.id
  798. dimissionName.value = leaveTable.fileName
  799. dimission.value = leaveTable.fileUrl
  800. }
  801. }
  802. }
  803. });
  804. });
  805. const areaOptins = ref([]);
  806. const getAreaList = () => {
  807. api.areaApi.areaList({}).then((res) => {
  808. areaOptins.value = res.data;
  809. });
  810. };
  811. //性别字典
  812. const genderList = ref<dictType[]>([]);
  813. //民族
  814. const nation = ref<dictType[]>([]);
  815. //婚姻状况
  816. const marriage = ref<dictType[]>([]);
  817. //政治面貌
  818. const political_status = ref<dictType[]>([]);
  819. //健康状况
  820. const health_status = ref<dictType[]>([]);
  821. //学历
  822. const educational = ref<dictType[]>([]);
  823. interface OperationFormProps extends memberType {
  824. deptId: string;
  825. leaderNumber: string;
  826. referrerNumber: string;
  827. address?: [];
  828. [key: string]: any;
  829. }
  830. // console.log(memberType,5555)
  831. let emits = defineEmits(["closeDialog"]);
  832. const OperationFormRef = ref<FormInstance>();
  833. // 添加/编辑业务员表单
  834. let operationForm = ref<OperationFormProps>({
  835. deptId: "",
  836. name: "",
  837. mobile: "",
  838. identity: "",
  839. identityTimeStart: "",
  840. identityTimeEnd: "",
  841. leaderId: "",
  842. leaderNumber: "",
  843. referrerId: "",
  844. referrerNumber: "",
  845. sex: "",
  846. birthday: "",
  847. nations: "",
  848. koseki: "",
  849. maritalStatus: "",
  850. politicsStatus: "",
  851. health: "",
  852. province: "",
  853. city: "",
  854. district: "",
  855. address: [],
  856. liveAddress: "",
  857. postalCode: "",
  858. education: "",
  859. graduationTime: "",
  860. school: "",
  861. isComputer: "",
  862. emergencyContactName: "",
  863. emergencyContactTel: "",
  864. salary: "",
  865. salaryLevel: "",
  866. bankCardId: "",
  867. bankName: "",
  868. });
  869. // 添加/编辑业务员表单校验
  870. const operationRules = ref<FormRules>({
  871. name: [{ required: true, trigger: "blur", message: "请填写姓名" }],
  872. mobile: [
  873. { required: true, trigger: "blur", message: "请填写手机号" },
  874. {
  875. pattern: /^1[34578][0-9]{9}$/,
  876. message: "请填写正确的手机号",
  877. trigger: "blur",
  878. },
  879. ],
  880. deptId: [{ required: true, trigger: "change", message: "请选择所属机构" }],
  881. identity: [
  882. { required: true, trigger: "blur", message: "请填写证件号" },
  883. {
  884. pattern:
  885. /^[1-9]\d{5}(19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9X]$/,
  886. message: "请填写正确的身份证号",
  887. trigger: "blur",
  888. },
  889. ],
  890. identityTimeStart: [
  891. { required: true, trigger: "change", message: "请选择证件有效期始" },
  892. ],
  893. identityTimeEnd: [
  894. { required: true, trigger: "change", message: "请选择证件有效期止" },
  895. ],
  896. leaderId: [{ required: true, trigger: "change", message: "请选择管理人" }],
  897. leaderNumber: [
  898. { required: true, trigger: "blur", message: "请填写管理人工号" },
  899. ],
  900. referrerId: [{ required: true, trigger: "change", message: "请选择推荐人" }],
  901. referrerNumber: [
  902. { required: true, trigger: "blur", message: "请填写推荐人工号" },
  903. ],
  904. });
  905. // 身份证人像面
  906. let IDCardFrontName = ref("");
  907. let IDCardFront = ref("");
  908. let sfz1 = ref("");
  909. // 身份证国徽面
  910. let IDCardBackName = ref("");
  911. let IDCardBack = ref("");
  912. let sfz2 = ref("");
  913. // 银行卡
  914. let bankName = ref("");
  915. let bankSize = ref("");
  916. let bankCard = ref("");
  917. // 劳务合同
  918. let contractName = ref("");
  919. let contract = ref("");
  920. let contractId = ref("");
  921. // 应聘表
  922. let applicantName = ref("");
  923. let applicant = ref("");
  924. let applicantId = ref("");
  925. // 定薪表
  926. let decidePayName = ref("");
  927. let decidePay = ref("");
  928. let salaryTable = ref("");
  929. // 离职表
  930. let dimissionName = ref("");
  931. let dimission = ref("");
  932. let leaveTable = ref("");
  933. // 图片预览地址
  934. let imageShow = ref(false);
  935. let imageUrl = ref("");
  936. //机构列表
  937. type tableType = {
  938. id: string;
  939. name: string;
  940. };
  941. const tableData = ref<tableType[]>([]);
  942. const tableProps = ref({
  943. value: "id",
  944. label: "name",
  945. children: "children",
  946. checkStrictly: true,
  947. });
  948. //跳转编辑页面
  949. const router = useRouter();
  950. function editMember(e: any) {
  951. router.push({
  952. path: "/personnel/member/memberEdit",
  953. query: {
  954. id: operationForm.value.userId,
  955. },
  956. });
  957. // console.log(e)
  958. // if (e != undefined) {
  959. // let deptId = e[e?.length - 1];
  960. // operationForm.deptId = deptId;
  961. // } else {
  962. // operationForm.deptId = "";
  963. // }
  964. }
  965. //数组去重
  966. // 上传图片
  967. const uploadImage = (file: any, type: number) => {
  968. let files = file.raw;
  969. console.log(files)
  970. let url = window.URL.createObjectURL(files); //转临时路径
  971. const params = new FormData(); // 声明formData数据类型
  972. params.append("file", files);
  973. // params.append("multipartFile", files);
  974. // params.append("type", "image");
  975. api.areaApi.fileUpload(params).then((res: any) => {
  976. if (res.code === 200) {
  977. switch (type) {
  978. case 1:
  979. IDCardFrontName.value = res.data.fileName;
  980. IDCardFront.value = res.data.downloadUrl;
  981. sfz1.value = res.data.id;
  982. break;
  983. case 2:
  984. IDCardBackName.value = res.data.fileName;
  985. IDCardBack.value = res.data.downloadUrl;
  986. sfz2.value = res.data.id;
  987. break;
  988. case 3:
  989. bankName.value = res.data.fileName;
  990. bankSize.value = res.data.downloadUrl;
  991. bankCard.value = res.data.id;
  992. break;
  993. case 4:
  994. contractName.value = res.data.fileName;
  995. contract.value = res.data.downloadUrl;
  996. contractId.value = res.data.id;
  997. break;
  998. case 5:
  999. applicantName.value = res.data.fileName;
  1000. applicant.value = res.data.downloadUrl;
  1001. applicantId.value = res.data.id;
  1002. break;
  1003. case 6:
  1004. decidePayName.value = res.data.fileName;
  1005. decidePay.value = res.data.downloadUrl;
  1006. salaryTable.value = res.data.id;
  1007. break;
  1008. case 7:
  1009. dimissionName.value = res.data.fileName;
  1010. dimission.value = res.data.downloadUrl;
  1011. leaveTable.value = res.data.id;
  1012. break;
  1013. }
  1014. }
  1015. });
  1016. };
  1017. // 人事档案
  1018. let recordShow = ref(true);
  1019. const imageView = (type: number) => {
  1020. imageShow.value = true;
  1021. switch (type) {
  1022. case 1:
  1023. imageUrl.value = IDCardFront.value;
  1024. break;
  1025. case 2:
  1026. imageUrl.value = IDCardBack.value;
  1027. break;
  1028. case 3:
  1029. imageUrl.value = bankSize.value;
  1030. break;
  1031. case 4:
  1032. imageUrl.value = contract.value;
  1033. break;
  1034. case 5:
  1035. imageUrl.value = applicant.value;
  1036. break;
  1037. case 6:
  1038. imageUrl.value = decidePay.value;
  1039. break;
  1040. case 7:
  1041. imageUrl.value = dimission.value;
  1042. break;
  1043. }
  1044. };
  1045. const onSubmit = async (OperationFormRef: FormInstance, type: number) => {
  1046. if (!OperationFormRef) {
  1047. emits("closeDialog", false);
  1048. return;
  1049. }
  1050. await OperationFormRef.validate((valid) => {
  1051. if (valid) {
  1052. api.operationApi
  1053. .addOperation({
  1054. ...operationForm.value,
  1055. province: operationForm.value.address[0],
  1056. city: operationForm.value.address[1],
  1057. district: operationForm.value.address[2],
  1058. deptId:
  1059. operationForm.value.deptId[operationForm.value.deptId.length - 1],
  1060. typeAttr: 2,
  1061. sfz1: sfz1.value,
  1062. sfz2: sfz2.value,
  1063. bankCard: bankCard.value,
  1064. contractId: contractId.value,
  1065. applicantId: applicantId.value,
  1066. salaryTable: salaryTable.value,
  1067. leaveTable: leaveTable.value,
  1068. })
  1069. .then((res: any) => {
  1070. // console.log(123, res);
  1071. if (res.code === 200) {
  1072. ElMessage.success(res.msg);
  1073. }
  1074. });
  1075. } else {
  1076. ElMessage({
  1077. message: "请正确填写相关信息!",
  1078. type: "warning",
  1079. });
  1080. }
  1081. });
  1082. };
  1083. interface transfer {
  1084. [key: string]: any;
  1085. }
  1086. //资源转移信息
  1087. const transferInfo = ref<transfer>({});
  1088. function transfer() {
  1089. // console.log(123)
  1090. leave.value=false
  1091. api.userApi
  1092. .getTransferInfo({
  1093. userId: operationForm.value.userId,
  1094. })
  1095. .then((res: any) => {
  1096. if (res.code === 200) {
  1097. transferInfo.value = res.data;
  1098. if (res.data.count < 1) {
  1099. ElMessage.error("当前用户没有可转移的资源");
  1100. } else {
  1101. dialogVisible.value = true;
  1102. }
  1103. }
  1104. });
  1105. }
  1106. //操作离职
  1107. const leave=ref(false)
  1108. function resign() {
  1109. // console.log(123)
  1110. leave.value=true
  1111. api.userApi
  1112. .getTransferInfo({
  1113. userId: operationForm.value.userId,
  1114. })
  1115. .then((res: any) => {
  1116. if (res.code === 200) {
  1117. transferInfo.value = res.data;
  1118. if (res.data.count < 1) {
  1119. // ElMessage.error("当前用户没有可转移的资源");
  1120. ElMessageBox.confirm(
  1121. "离职后,账号将无法访问本企业,请确定是否离职?",
  1122. `确定要将${operationForm.value.name}设置为离职吗?`,
  1123. {
  1124. confirmButtonText: "确认",
  1125. cancelButtonText: "取消",
  1126. type: "warning",
  1127. }
  1128. )
  1129. .then(() => {
  1130. api.userApi
  1131. .userQuitApply({
  1132. userId:operationForm.value.userId,
  1133. })
  1134. .then((res: any) => {
  1135. if(res.code==200){
  1136. ElMessage.success(res.msg)
  1137. router.back()
  1138. }
  1139. });
  1140. // console.log(123);
  1141. })
  1142. .catch(() => {
  1143. ElMessage.warning("用户取消操作");
  1144. });
  1145. } else {
  1146. ElMessage.warning("当前用户有资源未转移,请转移后执行离职操作");
  1147. // dialogVisible.value = true;
  1148. }
  1149. }
  1150. });
  1151. }
  1152. //确认弹框提交信息
  1153. const receiveInfo = ref<transfer>({});
  1154. function confirmDialogInfo(item: any) {
  1155. deptDialogVisible.value = false;
  1156. receiveInfo.value = item;
  1157. }
  1158. //资源转移确认
  1159. function confirmTransfer() {
  1160. api.userApi
  1161. .transfer({
  1162. originalUserId: transferInfo.value.userId,
  1163. transferUserId: receiveInfo.value.id,
  1164. })
  1165. .then((res: any) => {
  1166. // console.log(res)
  1167. if (res.code === 200) {
  1168. ElMessage.success(res.msg);
  1169. dialogVisible.value = false;
  1170. }
  1171. });
  1172. // api.userApi
  1173. // .userQuitApply({
  1174. // originalUserId: transferInfo.value.userId,
  1175. // transferUserId: receiveInfo.value.id,
  1176. // })
  1177. // .then((res: any) => {
  1178. // // console.log(res)
  1179. // if (res.code === 200) {
  1180. // ElMessage.success(res.msg);
  1181. // dialogVisible.value = false;
  1182. // }
  1183. // });
  1184. }
  1185. //变更机构弹框
  1186. interface Tree {
  1187. [key: string]: any;
  1188. }
  1189. const filterText = ref("");
  1190. const treeRef = ref<InstanceType<typeof ElTree>>();
  1191. watch(filterText, (val) => {
  1192. treeRef.value!.filter(val);
  1193. });
  1194. const filterNode = (value: string, data: Tree) => {
  1195. // console.log(data)
  1196. if (!value) return true;
  1197. return data.name.includes(value);
  1198. };
  1199. //判断当前机构是否可以进行变更
  1200. const changeDeptDialog = ref(false);
  1201. function changeDept() {
  1202. // changeDeptDialog.value=true
  1203. api.userApi
  1204. .checkChangeDept({
  1205. userId: operationForm.value.userId,
  1206. })
  1207. .then((res: any) => {
  1208. if (res.code === 200) {
  1209. // transferInfo.value=res.data
  1210. changeDeptDialog.value = true;
  1211. }
  1212. });
  1213. }
  1214. //选择变更的机构
  1215. const deptItem = ref({});
  1216. function treeClick(node: any) {
  1217. deptItem.value = node;
  1218. }
  1219. //提交变更机构信息
  1220. function submitChangeDept() {
  1221. // changeDeptDialog.value=true
  1222. api.userApi
  1223. .changeDept({
  1224. userId: operationForm.value.userId,
  1225. deptId: deptItem.value.id,
  1226. })
  1227. .then((res: any) => {
  1228. if (res.code === 200) {
  1229. // transferInfo.value=res.data
  1230. ElMessage.success(res.msg);
  1231. changeDeptDialog.value = false;
  1232. }
  1233. });
  1234. }
  1235. //删除成员
  1236. function delUser() {
  1237. api.userApi
  1238. .checkChangeDept({
  1239. userId: operationForm.value.userId,
  1240. })
  1241. .then((res: any) => {
  1242. if (res.code === 200) {
  1243. // transferInfo.value=res.data
  1244. ElMessageBox.confirm(
  1245. "账号删除后,该账号将无法使用访问本企业,请确定是否删除 ",
  1246. "确认要删除账号吗?",
  1247. {
  1248. confirmButtonText: "确认删除",
  1249. cancelButtonText: "取消",
  1250. type: "warning",
  1251. }
  1252. )
  1253. .then(() => {
  1254. api.userApi
  1255. .userDelete({
  1256. id: [operationForm.value.id],
  1257. })
  1258. .then((res: any) => {
  1259. if(res.code==200){
  1260. ElMessage.success(res.msg)
  1261. router.back()
  1262. }
  1263. });
  1264. // console.log(123);
  1265. })
  1266. .catch(() => {
  1267. ElMessage.warning("用户取消操作");
  1268. });
  1269. }
  1270. });
  1271. }
  1272. </script>
  1273. <style scoped lang="scss">
  1274. .message-info {
  1275. box-sizing: border-box;
  1276. // background: #fff;
  1277. padding: 15px;
  1278. h4 {
  1279. margin: 0;
  1280. }
  1281. }
  1282. .img-title {
  1283. display: flex;
  1284. align-items: center;
  1285. justify-content: center;
  1286. width: 30px;
  1287. height: 30px;
  1288. margin-right: 20px;
  1289. color: #fff;
  1290. background: #00a0f4;
  1291. border-radius: 50%;
  1292. }
  1293. .fileInfo {
  1294. display: flex;
  1295. align-items: center;
  1296. justify-content: flex-start;
  1297. padding: 2px 20px;
  1298. margin: 0 10px;
  1299. border-radius: 5px;
  1300. &:hover {
  1301. background: #ccc;
  1302. }
  1303. .fileName {
  1304. width: 200px;
  1305. overflow: hidden;
  1306. text-overflow: ellipsis;
  1307. white-space: nowrap;
  1308. }
  1309. .fileBtn {
  1310. display: flex;
  1311. align-items: center;
  1312. .btn-icon {
  1313. margin: 0 10px;
  1314. font-size: 16px;
  1315. cursor: pointer;
  1316. &:hover {
  1317. color: #00a0f4;
  1318. }
  1319. }
  1320. }
  1321. }
  1322. .image-view {
  1323. position: absolute;
  1324. top: 0;
  1325. left: 0;
  1326. z-index: 9999;
  1327. display: flex;
  1328. align-items: center;
  1329. justify-content: center;
  1330. width: 100%;
  1331. height: 100%;
  1332. background: rgb(0 0 0 / 60%);
  1333. img {
  1334. width: 800px;
  1335. height: 800px;
  1336. border-radius: 5px;
  1337. }
  1338. }
  1339. .custom-tree-node {
  1340. display: flex;
  1341. flex: 1;
  1342. align-items: center;
  1343. justify-content: space-between;
  1344. padding-right: 8px;
  1345. font-size: 14px;
  1346. }
  1347. </style>