ec1acb3c5d4df3e1625917babd4d8e32ce5b641a.svn-base 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <div>
  3. <!--选择人员-->
  4. <el-dialog :close-on-click-modal="false" title="请选择人员" :visible.sync="dialogXzPersVisible" width="60%"
  5. :modal-append-to-body="true" :append-to-body="true" @close="closeXzRyDialog">
  6. <el-row>
  7. <el-col :span="24" style="text-align: right;margin-bottom: 15px;">
  8. <el-input v-model="name" clearable placeholder="请输入姓名" style="width: 20vw;"></el-input>
  9. </el-col>
  10. </el-row>
  11. <el-table
  12. v-loading="loading"
  13. border
  14. ref="multipleTable"
  15. :height="tableHeight"
  16. :data="jichuData"
  17. tooltip-effect="dark"
  18. style="width: 100%"
  19. @selection-change="handleSelectionChange"
  20. >
  21. <el-table-column
  22. type="selection"
  23. width="55">
  24. </el-table-column>
  25. <el-table-column
  26. header-align="center"
  27. align="center"
  28. min-width="100"
  29. prop="roleTypeList"
  30. label="角色"
  31. show-overflow-tooltip
  32. >
  33. <template slot-scope="scope" v-if="scope.row.roleTypeList">
  34. <span v-for="(item,index) in scope.row.roleTypeList" :key="index">
  35. {{roleType(item.value) + ' '}}
  36. </span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column
  40. header-align="center"
  41. align="center"
  42. min-width="100"
  43. prop="name"
  44. label="姓名"
  45. show-overflow-tooltip
  46. ></el-table-column>
  47. <el-table-column
  48. header-align="center"
  49. align="center"
  50. min-width="120"
  51. prop="sex"
  52. label="性别"
  53. show-overflow-tooltip
  54. ></el-table-column>
  55. <el-table-column
  56. header-align="center"
  57. align="center"
  58. min-width="80"
  59. show-overflow-tooltip
  60. prop="age"
  61. label="年龄"
  62. ></el-table-column>
  63. <el-table-column
  64. header-align="center"
  65. align="center"
  66. min-width="200"
  67. label="工作单位"
  68. show-overflow-tooltip
  69. prop="workDpNm"
  70. ></el-table-column>
  71. <el-table-column
  72. header-align="center"
  73. align="center"
  74. min-width="100"
  75. label="职务"
  76. show-overflow-tooltip
  77. prop="duty"
  78. ></el-table-column>
  79. <el-table-column
  80. header-align="center"
  81. align="center"
  82. min-width="100"
  83. prop="titles"
  84. label="职称"
  85. show-overflow-tooltip
  86. >
  87. <template slot-scope="scope">
  88. <span v-if="scope.row.titles == '1'">正高</span>
  89. <span v-if="scope.row.titles == '2'">副高</span>
  90. <span v-if="scope.row.titles == '3'">中级</span>
  91. <span v-if="scope.row.titles == '4'">初级</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column
  95. header-align="center"
  96. align="center"
  97. min-width="150"
  98. prop="telnumb"
  99. label="电话"
  100. show-overflow-tooltip
  101. ></el-table-column>
  102. <el-table-column
  103. header-align="center"
  104. align="center"
  105. min-width="100"
  106. prop="isOffice"
  107. label="在职情况"
  108. >
  109. <template slot-scope="scope">
  110. <span v-if="scope.row.isOffice == '1'">是</span>
  111. <span v-if="scope.row.isOffice == '2'">否</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column
  115. header-align="center"
  116. align="center"
  117. min-width="120"
  118. prop="education"
  119. label="学历"
  120. show-overflow-tooltip
  121. >
  122. <template slot-scope="scope">
  123. <span v-if="scope.row.education == '1'">专科及以下</span>
  124. <span v-if="scope.row.education == '2'">本科</span>
  125. <span v-if="scope.row.education == '3'">研究生</span>
  126. <span v-if="scope.row.education == '4'">博士</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column
  130. header-align="center"
  131. align="center"
  132. min-width="80"
  133. prop="workAdNm"
  134. label="原工作地"
  135. show-overflow-tooltip
  136. ></el-table-column>
  137. <el-table-column
  138. header-align="center"
  139. align="center"
  140. min-width="80"
  141. prop="professional"
  142. label="从事专业"
  143. show-overflow-tooltip
  144. ></el-table-column>
  145. <el-table-column
  146. header-align="center"
  147. align="center"
  148. min-width="80"
  149. prop="recommendedUnits"
  150. label="推荐单位"
  151. show-overflow-tooltip
  152. ></el-table-column>
  153. <el-table-column
  154. header-align="center"
  155. align="center"
  156. min-width="80"
  157. prop="unitRanks"
  158. label="单位职级"
  159. show-overflow-tooltip
  160. >
  161. <template slot-scope="scope">
  162. <span v-if="scope.row.unitRanks == '1'">省部级</span>
  163. <span v-if="scope.row.unitRanks == '2'">地市级</span>
  164. <span v-if="scope.row.unitRanks == '3'">县市级</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column
  168. header-align="center"
  169. align="center"
  170. min-width="80"
  171. label="库别"
  172. show-overflow-tooltip
  173. >
  174. <template slot-scope="scope">
  175. {{groupType(scope.row.groupType)}}
  176. </template>
  177. </el-table-column>
  178. <el-table-column
  179. header-align="center"
  180. align="center"
  181. min-width="120"
  182. prop="inTm"
  183. label="入库时间"
  184. show-overflow-tooltip
  185. ></el-table-column>
  186. <el-table-column
  187. header-align="center"
  188. align="center"
  189. min-width="80"
  190. prop="orgNm"
  191. label="流域机构"
  192. show-overflow-tooltip
  193. ></el-table-column>
  194. <el-table-column
  195. header-align="center"
  196. align="center"
  197. min-width="80"
  198. prop="oe"
  199. label="体检结果"
  200. show-overflow-tooltip
  201. ></el-table-column>
  202. <el-table-column
  203. header-align="center"
  204. align="center"
  205. min-width="80"
  206. prop="isTraining"
  207. label="培训情况"
  208. show-overflow-tooltip
  209. >
  210. <template slot-scope="scope">
  211. <span v-if="scope.row.isTraining == '1'">是</span>
  212. <span v-if="scope.row.isTraining == '2'">否</span>
  213. </template>
  214. </el-table-column>
  215. <!--<el-table-column-->
  216. <!--align="center"-->
  217. <!--min-width="220"-->
  218. <!--label="操作"-->
  219. <!--fixed="right"-->
  220. <!--&gt;-->
  221. <!--<template slot-scope="scope">-->
  222. <!--<span>-->
  223. <!--<el-button type="primary" size="mini" @click.stop="renYuanModifyThe(scope.row)">编辑</el-button>-->
  224. <!--<el-button type="danger" size="mini" @click.stop="renYuanDelete(scope.row)">删除</el-button>-->
  225. <!--</span>-->
  226. <!--</template>-->
  227. <!--</el-table-column>-->
  228. </el-table>
  229. <!--<el-pagination-->
  230. <!--style="margin: 10px auto"-->
  231. <!--background-->
  232. <!--:pager-count="5"-->
  233. <!--:current-page="pageNum"-->
  234. <!--:page-size="pageSize"-->
  235. <!--:page-sizes="[10, 20, 30, 40, 50, 100]"-->
  236. <!--layout="sizes, total, prev, pager, next"-->
  237. <!--:total="total"-->
  238. <!--@current-change="pageIndexChange"-->
  239. <!--@size-change="handleSizeChange"-->
  240. <!--&gt;</el-pagination>-->
  241. <div slot="footer" class="dialog-footer" style="text-align: right;">
  242. <!--<el-button type="danger" @click="dialogDelPersVisible = false" size="medium">取 消</el-button>-->
  243. <el-button type="primary" @click="savePersInfo" size="medium">保 存</el-button>
  244. </div>
  245. </el-dialog>
  246. </div>
  247. </template>
  248. <script>
  249. import request from '../../utils/gw_ajax_request'
  250. export default {
  251. name: "NewPersInfo",
  252. props: ["roleTypes", "yearBatchId", "editAdd", "rowData", "changeEdit", "changeDataList"],
  253. data() {
  254. return {
  255. loading: false,
  256. jichuData: [],
  257. tableHeight: window.innerHeight * .4,
  258. pageNum: 1,
  259. pageSize: 20,
  260. total: 0,
  261. multipleSelection: [],
  262. name: "",
  263. dialogXzPersVisible: true
  264. }
  265. },
  266. computed: {
  267. userId: function () {
  268. return localStorage.getItem("userid") ? localStorage.getItem("userid") : '1098101939614724096'
  269. },
  270. groupTypeData() {
  271. return this.$store.state.jcState.groupTypeData;
  272. },
  273. roleTypeData() {
  274. return this.$store.state.jcState.roleTypeData;
  275. }
  276. },
  277. mounted() {
  278. this.getRyXxData();
  279. },
  280. methods: {
  281. getRyXxData() {
  282. this.loading = true;
  283. if (this.editAdd) {
  284. let obj = {
  285. 'name': this.name,
  286. 'roleType': this.roleTypes,
  287. 'yearBatchId': this.yearBatchId,
  288. 'groupId': this.rowData.id,
  289. }
  290. request.post(`/tac/worker/b/getNotDisPersList`, obj).then(res => {
  291. if (res.success) {
  292. this.loading = false;
  293. this.jichuData = res.data;
  294. } else {
  295. this.$message.warning(res.message);
  296. }
  297. })
  298. } else {
  299. let obj = {
  300. 'name': this.name,
  301. 'roleType': this.roleTypes,
  302. 'yearBatchId': this.yearBatchId
  303. }
  304. request.post(`/tac/worker/b/getWorkerList`, obj).then(res => {
  305. if (res.success) {
  306. this.loading = false;
  307. this.jichuData = res.data;
  308. } else {
  309. this.$message.warning(res.message);
  310. }
  311. })
  312. }
  313. },
  314. //角色
  315. roleType(row) {
  316. if (row) {
  317. this.roleTypeData.forEach(ele => {
  318. if (ele.value == row) {
  319. row = ele.label;
  320. }
  321. });
  322. return row;
  323. } else {
  324. return '';
  325. }
  326. },
  327. //库别
  328. groupType(row) {
  329. if (row) {
  330. this.groupTypeData.forEach(ele => {
  331. if (ele.value == row) {
  332. row = ele.label;
  333. }
  334. });
  335. return row;
  336. } else {
  337. return '';
  338. }
  339. },
  340. //分页
  341. // pageIndexChange(val) {
  342. // this.pageNum = val;
  343. // this.getRyXxData();
  344. // },
  345. // handleSizeChange(val) {
  346. // this.pageSize = val;
  347. // this.getRyXxData();
  348. // },
  349. handleSelectionChange(val) {
  350. console.log(val);
  351. this.multipleSelection = val;
  352. },
  353. savePersInfo() {
  354. if (!this.multipleSelection.length) {
  355. this.$message.warning("请至少选择一位人员");
  356. return;
  357. }
  358. if (this.editAdd) {
  359. let obj = {
  360. "bs": this.multipleSelection,
  361. "batchId": this.yearBatchId,
  362. "groupNm": this.rowData.groupNm,
  363. "groupId": this.rowData.id
  364. };
  365. if (this.changeEdit == 'change') {
  366. obj["updateBs"] = this.changeDataList;
  367. }
  368. request.post(`/tac/insp/year/batch/group/pers/updateGroupPers
  369. `, obj).then(res => {
  370. if (res.success) {
  371. this.$message.success("操作成功");
  372. this.dialogXzPersVisible = false;
  373. this.$emit("closeXzPers")
  374. } else {
  375. this.$message.warning(res.message);
  376. }
  377. })
  378. } else {
  379. let obj = {
  380. "persId": this.userId,
  381. "workerBList": this.multipleSelection,
  382. "yearBatchId": this.yearBatchId
  383. }
  384. request.post(`/tac/worker/b/insertTacWorkerB`, obj).then(res => {
  385. if (res.success) {
  386. this.$message.success("操作成功");
  387. this.dialogXzPersVisible = false;
  388. this.$emit("closeXzPers")
  389. } else {
  390. this.$message.warning(res.message);
  391. }
  392. })
  393. }
  394. },
  395. closeXzRyDialog() {
  396. this.$emit('closeXzPers');
  397. }
  398. },
  399. watch: {
  400. name() {
  401. this.getRyXxData();
  402. }
  403. }
  404. }
  405. </script>
  406. <style scoped>
  407. </style>