evaluationPersonnelPage.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. <template>
  2. <div class="evaluationPerson" v-loading="loadingImport">
  3. <div class="evaluationPersonBtn">
  4. <div class="collectSeach">
  5. <div class="exceed">
  6. <span class="exceedSpan">人员名称:</span>
  7. <el-input v-model="companyS" placeholder="请输入人员名称"></el-input>
  8. </div>
  9. <el-button type="primary" style="margin-left: 10px;" @click="getSeachData">搜索</el-button>
  10. <el-button style="margin-left: 10px;" @click="resetSeach">重置</el-button>
  11. </div>
  12. <div class="PeriodBtn">
  13. <btns
  14. :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
  15. :disDelete="changeDateSelect.length === 0"
  16. :disImport="true"
  17. :disExport="true"
  18. @handleAdd="handleAdd"
  19. @handleEdit="handleEdit"
  20. @handleDelete="handleDelete"
  21. @handleImport="handleImport"
  22. @handleExport="handleExport"
  23. ></btns>
  24. </div>
  25. <div class="evaluationPersonTableData">
  26. <el-table :data="evaluationPersonData" style="width: 100%" @select="rowClick" @select-all="rowClick">
  27. <el-table-column type="selection" label="操作" align="center"></el-table-column>
  28. <el-table-column label="所属公司" prop="companyName" />
  29. <el-table-column label="所属部门" prop="deptName" />
  30. <el-table-column label="人员名称" prop="personnelName" />
  31. <el-table-column label="人员岗位" prop="position" />
  32. <el-table-column label="人员职称" prop="rank" />
  33. <el-table-column label="考评周期" prop="evaluationCycle" />
  34. <el-table-column label="考评规则ID" prop="evaluateRuleId" />
  35. <el-table-column label="是否考核" prop="isCheck" />
  36. <el-table-column label="考核级别" prop="evaluationLevel" />
  37. <el-table-column label="年份" prop="year" />
  38. <el-table-column label="月份" prop="month" />
  39. </el-table>
  40. <el-pagination
  41. @size-change="handleSizeChange"
  42. @current-change="handleCurrentChange"
  43. :current-page="page.currentPage"
  44. :page-size="page.pagesize"
  45. layout="total, prev, pager, next, jumper"
  46. :total="page.total">
  47. </el-pagination>
  48. </div>
  49. <div class="indexdialog">
  50. <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
  51. <div class="periodFrom">
  52. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
  53. <el-form-item label="所属公司" prop="companyName">
  54. <el-select v-model="ruleForm.companyName" placeholder="请选择所属公司" @change="changeCompany">
  55. <el-option
  56. v-for="item in companyDatas"
  57. :key="item.id"
  58. :label="item.name"
  59. :value="item.id">
  60. </el-option>
  61. </el-select>
  62. </el-form-item>
  63. <el-form-item label="所属部门" prop="deptName">
  64. <el-select v-model="ruleForm.deptName" placeholder="请选择所属部门" @change="changeDepartment">
  65. <el-option
  66. v-for="item in departmentDatas"
  67. :key="item.id"
  68. :label="item.name"
  69. :value="item.id">
  70. </el-option>
  71. </el-select>
  72. </el-form-item>
  73. <el-form-item label="人员名称" prop="personnelName">
  74. <el-select v-model="ruleForm.personnelName" placeholder="请选择人员名称" @change="changePerson">
  75. <el-option
  76. v-for="item in personDatas"
  77. :key="item.id"
  78. :label="item.name"
  79. :value="item.id">
  80. </el-option>
  81. </el-select>
  82. </el-form-item>
  83. <el-form-item label="人员岗位" prop="position">
  84. <el-input v-model="ruleForm.position" placeholder="请输入人员岗位"></el-input>
  85. </el-form-item>
  86. <el-form-item label="人员职称" prop="rank">
  87. <el-input v-model="ruleForm.rank" placeholder="请输入人员职称"></el-input>
  88. </el-form-item>
  89. <el-form-item label="是否考核">
  90. <el-radio-group v-model="ruleForm.isCheck">
  91. <el-radio border label="是" />
  92. <el-radio border label="否" />
  93. </el-radio-group>
  94. </el-form-item>
  95. <el-form-item label="考评规则" prop="evaluateRule">
  96. <el-select v-model="ruleForm.evaluateRule" placeholder="请选择考评规则" @change="changeRule">
  97. <el-option
  98. v-for="item in ruleDataAll"
  99. :key="item.id"
  100. :label="item.ruleName"
  101. :value="item.id">
  102. </el-option>
  103. </el-select>
  104. </el-form-item>
  105. <el-form-item label="考评周期" prop="evaluationCycle">
  106. <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择考评周期">
  107. <el-option
  108. v-for="item in periodData"
  109. :key="item.keyValue"
  110. :label="item.keyName"
  111. :value="item.keyValue">
  112. </el-option>
  113. </el-select>
  114. </el-form-item>
  115. <el-form-item label="考评级别" prop="evaluationLevel">
  116. <el-select v-model="ruleForm.evaluationLevel" placeholder="请选择考评级别">
  117. <el-option
  118. v-for="item in levelDatas"
  119. :key="item.keyValue"
  120. :label="item.keyName"
  121. :value="item.keyValue">
  122. </el-option>
  123. </el-select>
  124. </el-form-item>
  125. <el-form-item label="年份" prop="year">
  126. <el-date-picker
  127. v-model="ruleForm.year"
  128. type="year"
  129. value-format="YYYY"
  130. placeholder="请选择年份"
  131. />
  132. </el-form-item>
  133. <el-form-item label="月份">
  134. <el-input-number v-model="ruleForm.month" :min="1" :max="12" />
  135. </el-form-item>
  136. </el-form>
  137. </div>
  138. <template #footer>
  139. <span class="dialog-footer">
  140. <el-button @click="dialogVisible = false">取 消</el-button>
  141. <el-button type="primary" @click="saveevaluationPersonMsg('ruleForm')">确 定</el-button>
  142. </span>
  143. </template>
  144. </el-dialog>
  145. </div>
  146. <indicator-item ref="indicatorItem"></indicator-item>
  147. </div>
  148. <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
  149. </div>
  150. </template>
  151. <script>
  152. import importDailog from '../importPage/importDailog.vue'
  153. import btns from '../elbuttonS.vue'
  154. import {apiGetpersonnelList, apiGetpersonnelSaveList, apiGetpersonneldeleteList,
  155. apiGetevaluateListAll, apiGetorganizationgetTree, apiGetdatadictionaryList, apiGetuserListAll} from '../../api/api'
  156. export default {
  157. components: { importDailog, btns },
  158. data() {
  159. return {
  160. dialogVisible: false,
  161. title: '',
  162. isSave: false,
  163. changeDateSelect: [],
  164. indicatoroptions: [],
  165. companyS: '',
  166. evaluationPersonData:[],
  167. ruleDataAll: [],
  168. periodData: [],
  169. levelDatas: [],
  170. companyDatas: [],
  171. departmentDatas: [],
  172. personDatas: [],
  173. ruleForm: {
  174. companyName: '',
  175. deptName: '',
  176. personnelName: '',
  177. position: '',
  178. rank: '',
  179. isCheck: '否',
  180. evaluateRule: '',
  181. evaluationCycle: '',
  182. evaluationLevel: '',
  183. year: '',
  184. month: 1
  185. },
  186. rules: {
  187. companyName: [
  188. { required: true, message: '请输入所属公司', trigger: 'blur' }
  189. ],
  190. deptName: [
  191. { required: true, message: '请输入所属部门', trigger: 'blur' }
  192. ],
  193. personnelName: [
  194. { required: true, message: '请输入人员名称', trigger: 'blur' }
  195. ],
  196. position: [
  197. { required: true, message: '请输入人员岗位', trigger: 'blur' }
  198. ],
  199. rank: [
  200. { required: true, message: '请输入人员职称', trigger: 'blur' }
  201. ],
  202. evaluateRule: [
  203. { required: true, message: '请选择考评规则', trigger: 'change' }
  204. ],
  205. evaluationCycle: [
  206. { required: true, message: '请选择考评周期', trigger: 'change' }
  207. ],
  208. evaluationLevel: [
  209. { required: true, message: '请输入考评级别', trigger: 'blur' }
  210. ],
  211. year: [
  212. { required: true, message: '请选择年份', trigger: 'change' }
  213. ]
  214. },
  215. page:{
  216. pagesize: 12,
  217. currentPage: 1,
  218. total: 0
  219. },
  220. evalradio: {},
  221. loadingImport: false,
  222. }
  223. },
  224. created() {
  225. this.getEvalpersonData()
  226. this.getRuleallData()
  227. this.getOrganizetionData(23031000, 2, 'GS')
  228. this.getPeriodData()
  229. this.getevalLevel()
  230. },
  231. methods:{
  232. // 查询人员配置数据
  233. getEvalpersonData(type) {
  234. let that = this
  235. let params = {
  236. pageNum: this.page.currentPage,
  237. pageSize: this.page.pagesize,
  238. organizationType: 'DWKP'
  239. }
  240. if (type) {
  241. params.personnelName = that.companyS
  242. }
  243. apiGetpersonnelList(params).then(datas =>{
  244. if (datas && datas.data) {
  245. that.evaluationPersonData = datas.data.records
  246. that.page.total = datas.data.total
  247. }
  248. })
  249. },
  250. //查询组织数据
  251. getOrganizetionData(id, num, type) {
  252. let that = this
  253. let params = {
  254. id: id,
  255. num: num
  256. }
  257. apiGetorganizationgetTree(params).then(datas =>{
  258. if (datas && datas.data && datas.data[0].children.length>0) {
  259. if (type === 'GS') {
  260. that.companyDatas = datas.data[0].children
  261. } else {
  262. that.departmentDatas = datas.data[0].children
  263. }
  264. }
  265. })
  266. },
  267. // 查询人员
  268. getDepartMentPerson(id) {
  269. let that = this
  270. let params = {
  271. orgId: id
  272. }
  273. apiGetuserListAll(params).then(datas =>{
  274. if (datas && datas.data) {
  275. that.personDatas = datas.data
  276. }
  277. })
  278. },
  279. //考评周期
  280. getPeriodData() {
  281. let that = this
  282. let params = {
  283. superKey: 'KPZQ0001'
  284. }
  285. apiGetdatadictionaryList(params).then(datas =>{
  286. if (datas && datas.data) {
  287. that.periodData = datas.data
  288. }
  289. })
  290. },
  291. // 考评级别
  292. getevalLevel() {
  293. let that = this
  294. let params = {
  295. superKey: 'KHJB0001'
  296. }
  297. apiGetdatadictionaryList(params).then(datas =>{
  298. if (datas && datas.data) {
  299. that.levelDatas = datas.data
  300. }
  301. })
  302. },
  303. getRuleallData() {
  304. let that = this
  305. apiGetevaluateListAll().then(datas =>{
  306. if (datas && datas.data) {
  307. that.ruleDataAll = datas.data
  308. }
  309. })
  310. },
  311. changeRule(val) {
  312. this.ruleDataAll.forEach(item =>{
  313. if (item.id === val) {
  314. this.ruleForm.binSection = item.binSection
  315. this.ruleForm.binStage = item.binStage
  316. }
  317. })
  318. },
  319. changeCompany(val) {
  320. this.getOrganizetionData(val, 3, 'BM')
  321. this.ruleForm.deptName = ''
  322. this.ruleForm.personnelName = ''
  323. },
  324. changeDepartment(val) {
  325. this.getDepartMentPerson(val)
  326. this.ruleForm.personnelName = ''
  327. },
  328. handleAdd() {
  329. this.dialogVisible = true
  330. this.isSave = false
  331. this.title = '新增考评人员'
  332. this.$nextTick(() =>{
  333. // this.$refs['ruleForm'].resetFields()
  334. this.ruleForm = {
  335. companyName: '',
  336. deptName: '',
  337. personnelName: '',
  338. position: '',
  339. rank: '',
  340. isCheck: '否',
  341. evaluateRule: '',
  342. evaluationCycle: '',
  343. evaluationLevel: '',
  344. year: '',
  345. month: 1
  346. }
  347. })
  348. },
  349. handleEdit() {
  350. this.dialogVisible = true
  351. this.isSave = true
  352. this.title = '修改考评人员'
  353. this.evalradio = this.changeDateSelect[0]
  354. this.ruleForm = {
  355. companyName: this.evalradio.companyId,
  356. deptName: this.evalradio.deptId,
  357. personnelName: this.evalradio.personnelId,
  358. position: this.evalradio.position,
  359. rank: this.evalradio.rank,
  360. isCheck: this.evalradio.isCheck,
  361. evaluateRule: this.evalradio.evaluateRuleId,
  362. evaluationCycle: this.evalradio.evaluationCycle,
  363. evaluationLevel: this.evalradio.evaluationLevel,
  364. year: this.evalradio.year,
  365. month: this.evalradio.month
  366. }
  367. this.getOrganizetionData(this.evalradio.companyId, 3, 'BM')
  368. this.getDepartMentPerson(this.evalradio.deptId)
  369. },
  370. saveevaluationPersonMsg(formName) {
  371. let that = this
  372. that.$refs[formName].validate((valid) => {
  373. if (valid) {
  374. that.saveAndEditIndicatorData()
  375. }
  376. });
  377. },
  378. //新增/修改指标数据
  379. saveAndEditIndicatorData() {
  380. let that = this
  381. let comName = ''
  382. let departName = ''
  383. let personName = ''
  384. this.companyDatas.forEach(it =>{
  385. if (it.id === that.ruleForm.companyName) {
  386. comName = it.name
  387. }
  388. })
  389. this.departmentDatas.forEach(it =>{
  390. if (it.id === that.ruleForm.deptName) {
  391. departName = it.name
  392. }
  393. })
  394. this.personDatas.forEach(it =>{
  395. if (it.id === that.ruleForm.personnelName) {
  396. personName = it.name
  397. }
  398. })
  399. let params = {
  400. companyId: that.ruleForm.companyName,
  401. companyName: comName,
  402. deptId: that.ruleForm.deptName,
  403. deptName: departName,
  404. personnelId: that.ruleForm.personnelName,
  405. personnelName: personName,
  406. position: that.ruleForm.position,
  407. rank: that.ruleForm.rank,
  408. isCheck: that.ruleForm.isCheck,
  409. evaluateRuleId: that.ruleForm.evaluateRule,
  410. evaluationCycle: that.ruleForm.evaluationCycle,
  411. evaluationLevel: that.ruleForm.evaluationLevel,
  412. year: that.ruleForm.year,
  413. month: that.ruleForm.month
  414. }
  415. if (that.isSave) {
  416. params.id = this.evalradio.id
  417. }
  418. apiGetpersonnelSaveList(params).then(datas =>{
  419. if (!datas.success) {
  420. that.$message({
  421. message: datas.message,
  422. type: 'error'
  423. });
  424. } else {
  425. if (!that.isSave) {
  426. that.$message({
  427. message: '考评人员新增成功',
  428. type: 'success'
  429. });
  430. } else {
  431. that.$message({
  432. message: '考评人员修改成功',
  433. type: 'success'
  434. });
  435. }
  436. that.dialogVisible = false
  437. that.changeDateSelect = []
  438. that.getEvalpersonData()
  439. }
  440. })
  441. },
  442. //删除指标数据
  443. handleDelete() {
  444. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  445. confirmButtonText: '确定',
  446. cancelButtonText: '取消',
  447. type: 'warning'
  448. }).then(() => {
  449. let that = this
  450. let paramsArr = []
  451. that.changeDateSelect.forEach(it =>{
  452. paramsArr.push(it.id)
  453. })
  454. apiGetpersonneldeleteList(paramsArr.join(',')).then(datas =>{
  455. if (datas) {
  456. that.$message({
  457. type: 'success',
  458. message: '删除成功!'
  459. });
  460. that.changeDateSelect = []
  461. that.getEvalpersonData()
  462. }
  463. })
  464. })
  465. },
  466. rowClick(selection, row) {
  467. this.changeDateSelect = selection
  468. },
  469. getSeachData() {
  470. this.page.currentPage = 1
  471. this.getEvalpersonData('seach')
  472. },
  473. resetSeach() {
  474. this.page.currentPage = 1
  475. this.companyS = ''
  476. this.getEvalpersonData()
  477. },
  478. successImport(val) {
  479. this.loadingImport = false
  480. this.getEvalpersonData()
  481. },
  482. importLoading(val) {
  483. this.loadingImport = true
  484. },
  485. handleSizeChange(val){
  486. this.page.pagesize = val
  487. this.getEvalpersonData()
  488. },
  489. handleCurrentChange(val){
  490. this.page.currentPage =val
  491. this.getEvalpersonData()
  492. },
  493. handleImport() {
  494. this.$refs.importPage.upload.title = "考评指标管理信息导入"
  495. this.$refs.importPage.upload.open = true
  496. },
  497. }
  498. }
  499. </script>
  500. <style lang="less">
  501. .evaluationPerson{
  502. .evaluationPersonBtn{
  503. .collectSeach{
  504. display: flex;
  505. padding: 24px 20px;
  506. border-bottom: 1px solid#D6DBEA;
  507. .exceed{
  508. display: flex;
  509. .exceedSpan{
  510. width: 100px;
  511. height: 12px;
  512. font-size: 14px;
  513. font-family: Microsoft YaHei;
  514. font-weight: 400;
  515. color: #8991B0;
  516. line-height: 12px;
  517. margin-top: 10px;
  518. }
  519. .el-input{
  520. margin-right:10px;
  521. .el-input__inner{
  522. height:30px;
  523. }
  524. .el-input__suffix{
  525. .el-select__caret{
  526. line-height:30px;
  527. }
  528. }
  529. }
  530. }
  531. .el-select{
  532. margin-right:10px;
  533. .el-input__inner{
  534. height:30px;
  535. }
  536. .el-input__suffix{
  537. .el-select__caret{
  538. line-height:30px;
  539. }
  540. }
  541. }
  542. }
  543. span{
  544. font-size:14px;
  545. }
  546. .PeriodBtn{
  547. display: flex;
  548. justify-content: end;
  549. padding: 20px 0;
  550. }
  551. .el-button{
  552. height: 30px;
  553. // width:100px;
  554. padding: 0 30px ;
  555. // padding-top: 8px;
  556. span{
  557. margin:0;
  558. }
  559. }
  560. .indexdialog{
  561. .el-overlay{
  562. .el-dialog{
  563. .el-dialog__body{
  564. padding: 30px 60px 30px 20px !important;
  565. .periodFrom{
  566. .el-select, .el-input{
  567. width: 100%;
  568. }
  569. .el-input{
  570. height: 30px;
  571. }
  572. }
  573. }
  574. }
  575. }
  576. }
  577. }
  578. .evaluationPersonTableData{
  579. .el-table{
  580. .el-table__body-wrapper{
  581. height: 64vh !important;
  582. }
  583. .el-input__inner{
  584. height: 30px !important;
  585. }
  586. .el-radio__label{
  587. display: none;
  588. }
  589. .indicitem{
  590. color: #409EFF;
  591. font-size: 12px;
  592. margin-right: 20px;
  593. cursor:pointer;
  594. &:hover{
  595. text-decoration: underline;
  596. }
  597. }
  598. }
  599. .el-pagination{
  600. margin-top: 20px;
  601. text-align: end;
  602. position: relative;
  603. }
  604. }
  605. }
  606. </style>