evaluationDeptBusinessFrom.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <template>
  2. <div class="deptstartFrom">
  3. <el-dialog title="考评启动详情" v-model="dialogVisible" :fullscreen="true" :close-on-click-modal="false">
  4. <div class="startDetail">
  5. <p class="starttitleSty">单据信息:</p>
  6. <el-row class="danjuMsg">
  7. <el-col :span="6">
  8. <div class="danjuMsg_data">
  9. <span class="data_tit">业务编号:</span>
  10. <span>{{receiptMsg.code}}</span>
  11. </div>
  12. <div class="danjuMsg_data">
  13. <span class="data_tit">创建日期:</span>
  14. <span>{{receiptMsg.createDate}}</span>
  15. </div>
  16. </el-col>
  17. <el-col :span="6">
  18. <div class="danjuMsg_data">
  19. <span class="data_tit">业务简述:</span>
  20. <span>{{receiptMsg.des}}</span>
  21. </div>
  22. <div class="danjuMsg_data">
  23. <span class="data_tit">考评周期:</span>
  24. <span>{{receiptMsg.type}}</span>
  25. </div>
  26. </el-col>
  27. <el-col :span="6">
  28. <div class="danjuMsg_data">
  29. <span class="data_tit">流程状态:</span>
  30. <span>{{receiptMsg.stage}}</span>
  31. </div>
  32. <div class="danjuMsg_data">
  33. <span class="data_tit">年度:</span>
  34. <span>{{receiptMsg.year}}</span>
  35. </div>
  36. </el-col>
  37. <el-col :span="6">
  38. <div class="danjuMsg_data">
  39. <span class="data_tit">创建人:</span>
  40. <span>{{receiptMsg.createName}}</span>
  41. </div>
  42. <div class="danjuMsg_data">
  43. <span class="data_tit">单据状态:</span>
  44. <span>{{receiptMsg.recStage}}</span>
  45. </div>
  46. </el-col>
  47. </el-row>
  48. <div class="btnASeach">
  49. <div class="detaTableBtns">
  50. <div class="tableBtn save" @click="saveDetail">
  51. <img :src="saveIcon" alt="">
  52. <span>保存</span>
  53. </div>
  54. <div class="tableBtn import" @click="handleImport">
  55. <img :src="importIcon" alt="">
  56. <span>导入</span>
  57. </div>
  58. <div class="tableBtn export" @click="handleExport">
  59. <img :src="exportIcon" alt="">
  60. <span>导出</span>
  61. </div>
  62. </div>
  63. </div>
  64. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
  65. <el-tab-pane label="考评指标项内容" name="first">
  66. <el-table :data="quantifiedList.slice((pageLeft.currentPage-1)*pageLeft.pagesize, pageLeft.currentPage*pageLeft.pagesize)"
  67. style="width: 100%" @select="rowClick" @select-all="rowClick">
  68. <el-table-column label="序号" type="index" width="80" />
  69. <el-table-column label="部门名称" prop="deptName" width="260">
  70. <template #default="scope">
  71. <el-select v-model="scope.row.deptName" placeholder="请选择所属部门" v-if="scope.row.showInput">
  72. <el-option
  73. v-for="item in departData"
  74. :key="item.id"
  75. :label="item.keyName"
  76. :value="item.id">
  77. </el-option>
  78. </el-select>
  79. <span v-else>{{scope.row.deptName}}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="排序" width="100" prop="serialNumber" />
  83. <el-table-column label="指标名称" prop="targetName" />
  84. <el-table-column label="目标值" prop="targetValue" />
  85. <el-table-column label="基础分" width="150" prop="baseScore" />
  86. <el-table-column label="完成情况" width="300">
  87. <template #default="scope">
  88. <el-input v-model="scope.row.completionStatus"
  89. type="textarea" :rows="2" placeholder="请输入完成情况"></el-input>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="评价标准" prop="evaluationCriteria" />
  93. <el-table-column label="自评得分" width="150">
  94. <template #default="scope">
  95. <el-input-number v-model="scope.row.evaluationScore" :precision="2" :step="0.1" :min="0" />
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="审核状态" width="200" >
  99. <template #default="scope">
  100. <el-select v-model="scope.row.auditStatus" placeholder="请选择审核状态">
  101. <el-option
  102. v-for="item in statusData"
  103. :key="item.id"
  104. :label="item.name"
  105. :value="item.id">
  106. </el-option>
  107. </el-select>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. <el-pagination
  112. @current-change="handleCurrentChangeLeft"
  113. :current-page="pageLeft.currentPage"
  114. :page-size="pageLeft.pagesize"
  115. layout="total, prev, pager, next, jumper"
  116. :total="pageLeft.total">
  117. </el-pagination>
  118. </el-tab-pane>
  119. </el-tabs>
  120. </div>
  121. <template #footer>
  122. <span class="dialog-footer">
  123. <el-button type="primary" @click="dialogVisible = false">取 消</el-button>
  124. </span>
  125. </template>
  126. </el-dialog>
  127. <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
  128. </div>
  129. </template>
  130. <script>
  131. import importDailog from '../importPage/importDailog.vue'
  132. import {apiGetevaluationdeptplanDetail,apiGetevaluationdeptplanUpdate, apiPostIsdoAction} from '../../api/api'
  133. import ExcelJS from 'exceljs'
  134. import fileSave from 'file-saver'
  135. import addIcon from '../../assets/btnIcon/add.png'
  136. import saveIcon from '../../assets/btnIcon/save.png'
  137. import editIcon from '../../assets/btnIcon/edit.png'
  138. import deleteIcon from '../../assets/btnIcon/delete.png'
  139. import exportIcon from '../../assets/btnIcon/export.png'
  140. import importIcon from '../../assets/btnIcon/import.png'
  141. export default {
  142. components: {
  143. importDailog
  144. },
  145. data() {
  146. return {
  147. dialogVisible: false,
  148. activeName: 'first',
  149. quantifiedList: [],
  150. changeDateSelect: [],
  151. receiptMsg: {
  152. code: '',
  153. des: '',
  154. stage: '',
  155. createName: '',
  156. createDate: '',
  157. type: '',
  158. year: '',
  159. recStage: ''
  160. },
  161. addIcon: addIcon,
  162. saveIcon: saveIcon,
  163. editIcon: editIcon,
  164. deleteIcon: deleteIcon,
  165. exportIcon: exportIcon,
  166. importIcon: importIcon,
  167. rowMsg: {},
  168. orgruleData: [],
  169. indicItemoptions: [],
  170. sectionNameArr: [],
  171. deptNameArr: [],
  172. statusData: [],
  173. pageLeft:{
  174. pagesize: 15,
  175. currentPage: 1,
  176. total: 0
  177. },
  178. pageRight:{
  179. pagesize: 15,
  180. currentPage: 1,
  181. total: 0
  182. },
  183. departData: []
  184. }
  185. },
  186. created() {
  187. this.statusData = [
  188. {
  189. name: '已通过',
  190. id: '0'
  191. },
  192. {
  193. name: '待审核',
  194. id: '-1'
  195. },
  196. {
  197. name: '未通过',
  198. id: '-2'
  199. },
  200. {
  201. name: '已批准',
  202. id: '1'
  203. }
  204. ]
  205. },
  206. methods: {
  207. init(row, deptData) {
  208. this.dialogVisible = true
  209. this.activeName = 'first'
  210. this.receiptMsg = {
  211. code: row.responsibilityCode,
  212. des: row.des,
  213. stage: row.stage,
  214. createName: row.createName,
  215. createDate: row.createTime,
  216. type: row.checkCycle === 'YDKP'?'月度考评':row.checkCycle === 'JDKP'?'季度考评':'年度考评',
  217. year: row.appraisalYear,
  218. recStage: '有效'
  219. }
  220. this.getDetails(row.id)
  221. this.rowMsg = row
  222. },
  223. handleClick() {
  224. this.changeDateSelect = []
  225. },
  226. rowClick(selection, row) {
  227. this.changeDateSelect = selection
  228. },
  229. handleCurrentChangeLeft(val) {
  230. this.pageLeft.currentPage = val
  231. },
  232. handleCurrentChangeRight(val) {
  233. this.pageRight.currentPage = val
  234. },
  235. //获取详情
  236. getDetails(id) {
  237. let that = this
  238. that.quantifiedList = []
  239. let userMes = JSON.parse(window.sessionStorage.getItem('user'))
  240. let params = {
  241. id: id,
  242. deptId: userMes.deptId
  243. }
  244. apiGetevaluationdeptplanDetail(params).then(datas =>{
  245. if (datas && datas.data) {
  246. that.quantifiedList = datas.data
  247. that.pageLeft.total = datas.data.length
  248. }
  249. })
  250. },
  251. saveDetail() {
  252. let that = this
  253. let params = []
  254. that.quantifiedList.forEach(item =>{
  255. let obj = {
  256. id: item.id,
  257. targetName: item.targetName,
  258. targetValue: item.targetValue,
  259. baseScore: item.baseScore.toString(),
  260. evaluationCriteria: item.evaluationCriteria,
  261. auditStatus: item.auditStatus,
  262. serialNumber: item.serialNumber,
  263. completionStatus: item.completionStatus,
  264. evaluationScore: item.evaluationScore
  265. }
  266. params.push(obj)
  267. })
  268. apiGetevaluationdeptplanUpdate(params).then(datas =>{
  269. if (datas) {
  270. if (datas.success) {
  271. that.$message({
  272. message: '保存成功',
  273. type: 'success'
  274. });
  275. that.getDetails(that.rowMsg.id)
  276. } else {
  277. that.$message({
  278. message: datas.data,
  279. type: 'error'
  280. })
  281. }
  282. }
  283. })
  284. },
  285. handleImport() {
  286. this.$refs.importPage.upload.title = "本部部门业绩指标计划信息导入"
  287. this.$refs.importPage.upload.open = true
  288. this.$refs.importPage.upload.url = '/evaluation-dept-plan/import'
  289. },
  290. successImport(val) {
  291. this.getDetails(this.rowMsg.id)
  292. },
  293. handleExport() {
  294. let data = this.quantifiedList //接口返回数据
  295. const workbook = new ExcelJS.Workbook()
  296. const worksheet = workbook.addWorksheet('Sheet1')
  297. //根据数据自己调整
  298. let colums = []
  299. colums = [
  300. { header: 'ID', key: 'id', width: 26 },
  301. { header: '业务ID', key: 'businessPlanId', width: 26 },
  302. { header: '部门ID', key: 'deptId', width: 26 },
  303. { header: '部门名称', key: 'deptName', width: 26 },
  304. { header: '部门编码', key: 'deptCode', width: 26 },
  305. { header: '排序', key: 'serialNumber', width: 26 },
  306. { header: '指标名称', key: 'targetName', width: 18 },
  307. { header: '目标值', key: 'targetValue', width: 18 },
  308. { header: '基础分', key: 'baseScore', width: 18 },
  309. { header: '完成情况', key: 'completionStatus', width: 18 },
  310. { header: '评价标准', key: 'evaluationCriteria', width: 18 },
  311. { header: '自评得分', key: 'evaluationScore', width: 18 }
  312. ]
  313. worksheet.columns = colums
  314. worksheet.getRow(1).font = {
  315. size: 12,
  316. bold: true
  317. }
  318. worksheet.addRows(data)
  319. workbook.xlsx.writeBuffer().then(buffer => {
  320. //这里为type
  321. const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
  322. fileSave(blob, `本部部门业绩指标考核数据导出.xlsx`)
  323. })
  324. },
  325. }
  326. }
  327. </script>
  328. <style lang="less">
  329. .deptstartFrom{
  330. .el-overlay{
  331. .el-dialog{
  332. // margin-top: 7vh;
  333. .el-dialog__body{
  334. padding: 0 20px !important;
  335. .startDetail{
  336. .starttitleSty{
  337. font-size: 18px;
  338. font-family: Microsoft YaHei;
  339. font-weight: bold;
  340. color: #3B7AD1;
  341. // line-height: 12px;
  342. margin: 20px 0 20px 10px;
  343. }
  344. .danjuMsg{
  345. border: 1px solid #D6DBEA;
  346. padding: 10px 20px;
  347. border-radius: 10px;
  348. margin-bottom: 20px;
  349. .danjuMsg_data{
  350. padding: 5px 0 10px 0;
  351. .data_tit{
  352. margin-right: 10px;
  353. font-weight: bold;
  354. font-size: 14px;
  355. font-family: Microsoft YaHei;
  356. color: #8991B0;
  357. }
  358. .data_tit_wd{
  359. display: inline-block;
  360. width: 90px;
  361. }
  362. .el-form-item--small{
  363. .el-input{
  364. height: 25px;
  365. width: 160px;
  366. }
  367. margin-bottom: 0;
  368. .el-input-number{
  369. height: 25px;
  370. .el-input-number__decrease, .el-input-number__increase{
  371. right: -39px;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. .el-select, .el-input{
  378. width: 100%;
  379. }
  380. .btnASeach{
  381. display: flex;
  382. z-index: 11111;
  383. justify-content: end;
  384. position: relative;
  385. top: 32px;
  386. left: 50vw;
  387. width: 50%;
  388. .detaTableBtns{
  389. display: flex;
  390. width: 300px;
  391. margin-top: 5px;
  392. .tableBtn {
  393. display: flex;
  394. height: 20px;
  395. margin: 0 10px;
  396. img{
  397. margin-right: 5px;
  398. margin-top: 1px;
  399. }
  400. span{
  401. font-size: 14px;
  402. font-family: Microsoft YaHei;
  403. font-weight: 400;
  404. }
  405. }
  406. .add{
  407. cursor: pointer;
  408. span{
  409. color: #3B7AD1;
  410. }
  411. }
  412. .save{
  413. cursor: pointer;
  414. span{
  415. color: #50C14E;
  416. }
  417. }
  418. .edit{
  419. span{
  420. color: #F5A623;
  421. }
  422. }
  423. .delete{
  424. cursor: no-drop;
  425. span{
  426. color: #F65177;
  427. }
  428. }
  429. .import{
  430. cursor: pointer;
  431. span{
  432. color: #ce1e78;
  433. }
  434. }
  435. .export{
  436. cursor: pointer;
  437. span{
  438. color: #2baa8a;
  439. }
  440. }
  441. }
  442. }
  443. .el-tabs{
  444. .el-tabs__header{
  445. .el-tabs__nav{
  446. .el-tabs__item{
  447. font-size: 18px;
  448. font-family: Microsoft YaHei;
  449. font-weight: bold;
  450. margin: 0 10px;
  451. color: #8991B0;
  452. }
  453. .is-active{
  454. font-size: 18px;
  455. font-family: Microsoft YaHei;
  456. font-weight: bold;
  457. color: #3B7AD1;
  458. margin: 0 10px;
  459. }
  460. }
  461. }
  462. .el-table{
  463. margin-bottom: 10px;
  464. .el-table__body-wrapper{
  465. height: 50vh;
  466. }
  467. .el-table__row{
  468. .cell{
  469. .el-input{
  470. height: 24px;
  471. .el-input__inner{
  472. height: 24px;
  473. }
  474. }
  475. }
  476. }
  477. }
  478. }
  479. }
  480. }
  481. .el-dialog__footer{
  482. .dialog-footer{
  483. display: flex;
  484. justify-content: center;
  485. .el-button{
  486. width: 180px !important;
  487. height: 40px !important;
  488. }
  489. }
  490. }
  491. }
  492. }
  493. }
  494. </style>