evaluationDeptBusinessFrom.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  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: '1'
  191. },
  192. {
  193. name: '待审核',
  194. id: '0'
  195. },
  196. {
  197. name: '未开始',
  198. id: '-1'
  199. }
  200. ]
  201. },
  202. methods: {
  203. init(row, deptData) {
  204. this.dialogVisible = true
  205. this.activeName = 'first'
  206. this.receiptMsg = {
  207. code: row.responsibilityCode,
  208. des: row.des,
  209. stage: row.stage,
  210. createName: row.createName,
  211. createDate: row.createTime,
  212. type: row.checkCycle === 'YDKP'?'月度考评':row.checkCycle === 'JDKP'?'季度考评':'年度考评',
  213. year: row.appraisalYear,
  214. recStage: '有效'
  215. }
  216. this.getDetails(row.id)
  217. this.rowMsg = row
  218. },
  219. handleClick() {
  220. this.changeDateSelect = []
  221. },
  222. rowClick(selection, row) {
  223. this.changeDateSelect = selection
  224. },
  225. handleCurrentChangeLeft(val) {
  226. this.pageLeft.currentPage = val
  227. },
  228. handleCurrentChangeRight(val) {
  229. this.pageRight.currentPage = val
  230. },
  231. //获取详情
  232. getDetails(id) {
  233. let that = this
  234. that.quantifiedList = []
  235. apiGetevaluationdeptplanDetail(id).then(datas =>{
  236. if (datas && datas.data) {
  237. that.quantifiedList = datas.data
  238. that.pageLeft.total = datas.data.length
  239. }
  240. })
  241. },
  242. saveDetail() {
  243. let that = this
  244. let params = []
  245. that.quantifiedList.forEach(item =>{
  246. let obj = {
  247. id: item.id,
  248. targetName: item.targetName,
  249. targetValue: item.targetValue,
  250. baseScore: item.baseScore.toString(),
  251. evaluationCriteria: item.evaluationCriteria,
  252. auditStatus: item.auditStatus,
  253. serialNumber: item.serialNumber,
  254. completionStatus: item.completionStatus,
  255. evaluationScore: item.evaluationScore
  256. }
  257. params.push(obj)
  258. })
  259. apiGetevaluationdeptplanUpdate(params).then(datas =>{
  260. if (datas) {
  261. if (datas.success) {
  262. that.$message({
  263. message: '保存成功',
  264. type: 'success'
  265. });
  266. that.getDetails(that.rowMsg.id)
  267. } else {
  268. that.$message({
  269. message: datas.data,
  270. type: 'error'
  271. })
  272. }
  273. }
  274. })
  275. },
  276. handleImport() {
  277. this.$refs.importPage.upload.title = "本部部门业绩指标计划信息导入"
  278. this.$refs.importPage.upload.open = true
  279. this.$refs.importPage.upload.url = '/evaluation-dept-plan/import'
  280. },
  281. successImport(val) {
  282. this.getDetails(this.rowMsg.id)
  283. },
  284. handleExport() {
  285. let data = this.quantifiedList //接口返回数据
  286. const workbook = new ExcelJS.Workbook()
  287. const worksheet = workbook.addWorksheet('Sheet1')
  288. //根据数据自己调整
  289. let colums = []
  290. colums = [
  291. { header: 'ID', key: 'id', width: 26 },
  292. { header: '业务ID', key: 'businessPlanId', width: 26 },
  293. { header: '部门ID', key: 'deptId', width: 26 },
  294. { header: '部门名称', key: 'deptName', width: 26 },
  295. { header: '部门编码', key: 'deptCode', width: 26 },
  296. { header: '排序', key: 'serialNumber', width: 26 },
  297. { header: '指标名称', key: 'targetName', width: 18 },
  298. { header: '目标值', key: 'targetValue', width: 18 },
  299. { header: '基础分', key: 'baseScore', width: 18 },
  300. { header: '完成情况', key: 'completionStatus', width: 18 },
  301. { header: '评价标准', key: 'evaluationCriteria', width: 18 },
  302. { header: '自评得分', key: 'evaluationScore', width: 18 }
  303. ]
  304. worksheet.columns = colums
  305. worksheet.getRow(1).font = {
  306. size: 12,
  307. bold: true
  308. }
  309. worksheet.addRows(data)
  310. workbook.xlsx.writeBuffer().then(buffer => {
  311. //这里为type
  312. const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
  313. fileSave(blob, `本部部门业绩指标考核数据导出.xlsx`)
  314. })
  315. },
  316. }
  317. }
  318. </script>
  319. <style lang="less">
  320. .deptstartFrom{
  321. .el-overlay{
  322. .el-dialog{
  323. // margin-top: 7vh;
  324. .el-dialog__body{
  325. padding: 0 20px !important;
  326. .startDetail{
  327. .starttitleSty{
  328. font-size: 18px;
  329. font-family: Microsoft YaHei;
  330. font-weight: bold;
  331. color: #3B7AD1;
  332. // line-height: 12px;
  333. margin: 20px 0 20px 10px;
  334. }
  335. .danjuMsg{
  336. border: 1px solid #D6DBEA;
  337. padding: 10px 20px;
  338. border-radius: 10px;
  339. margin-bottom: 20px;
  340. .danjuMsg_data{
  341. padding: 5px 0 10px 0;
  342. .data_tit{
  343. margin-right: 10px;
  344. font-weight: bold;
  345. font-size: 14px;
  346. font-family: Microsoft YaHei;
  347. color: #8991B0;
  348. }
  349. .data_tit_wd{
  350. display: inline-block;
  351. width: 90px;
  352. }
  353. .el-form-item--small{
  354. .el-input{
  355. height: 25px;
  356. width: 160px;
  357. }
  358. margin-bottom: 0;
  359. .el-input-number{
  360. height: 25px;
  361. .el-input-number__decrease, .el-input-number__increase{
  362. right: -39px;
  363. }
  364. }
  365. }
  366. }
  367. }
  368. .el-select, .el-input{
  369. width: 100%;
  370. }
  371. .btnASeach{
  372. display: flex;
  373. z-index: 11111;
  374. justify-content: end;
  375. position: relative;
  376. top: 32px;
  377. left: 50vw;
  378. width: 50%;
  379. .detaTableBtns{
  380. display: flex;
  381. width: 300px;
  382. margin-top: 5px;
  383. .tableBtn {
  384. display: flex;
  385. height: 20px;
  386. margin: 0 10px;
  387. img{
  388. margin-right: 5px;
  389. margin-top: 1px;
  390. }
  391. span{
  392. font-size: 14px;
  393. font-family: Microsoft YaHei;
  394. font-weight: 400;
  395. }
  396. }
  397. .add{
  398. cursor: pointer;
  399. span{
  400. color: #3B7AD1;
  401. }
  402. }
  403. .save{
  404. cursor: pointer;
  405. span{
  406. color: #50C14E;
  407. }
  408. }
  409. .edit{
  410. span{
  411. color: #F5A623;
  412. }
  413. }
  414. .delete{
  415. cursor: no-drop;
  416. span{
  417. color: #F65177;
  418. }
  419. }
  420. .import{
  421. cursor: pointer;
  422. span{
  423. color: #ce1e78;
  424. }
  425. }
  426. .export{
  427. cursor: pointer;
  428. span{
  429. color: #2baa8a;
  430. }
  431. }
  432. }
  433. }
  434. .el-tabs{
  435. .el-tabs__header{
  436. .el-tabs__nav{
  437. .el-tabs__item{
  438. font-size: 18px;
  439. font-family: Microsoft YaHei;
  440. font-weight: bold;
  441. margin: 0 10px;
  442. color: #8991B0;
  443. }
  444. .is-active{
  445. font-size: 18px;
  446. font-family: Microsoft YaHei;
  447. font-weight: bold;
  448. color: #3B7AD1;
  449. margin: 0 10px;
  450. }
  451. }
  452. }
  453. .el-table{
  454. margin-bottom: 10px;
  455. .el-table__body-wrapper{
  456. height: 50vh;
  457. }
  458. .el-table__row{
  459. .cell{
  460. .el-input{
  461. height: 24px;
  462. .el-input__inner{
  463. height: 24px;
  464. }
  465. }
  466. }
  467. }
  468. }
  469. }
  470. }
  471. }
  472. .el-dialog__footer{
  473. .dialog-footer{
  474. display: flex;
  475. justify-content: center;
  476. .el-button{
  477. width: 180px !important;
  478. height: 40px !important;
  479. }
  480. }
  481. }
  482. }
  483. }
  484. }
  485. </style>