taskCenterDeptBusinessFrom.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  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. <p class="starttitleSty">审批意见:</p>
  122. <el-input v-model="descMsg" :rows="3" type="textarea" placeholder="请输入审批意见"></el-input>
  123. </div>
  124. </div>
  125. <template #footer>
  126. <span class="dialog-footer">
  127. <el-button type="primary" @click="examineAndApprove('agree')">同 意</el-button>
  128. <el-button @click="examineAndApprove('reject')">拒 绝</el-button>
  129. </span>
  130. </template>
  131. </el-dialog>
  132. <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
  133. </div>
  134. </template>
  135. <script>
  136. import importDailog from '../importPage/importDailog.vue'
  137. import {apiGetevaluationdeptplanDetail,apiGetevaluationdeptplanUpdate, apiPostIsdoAction, apiGetevaluationdeptassessmentDetailHeader} from '../../api/api'
  138. import ExcelJS from 'exceljs'
  139. import fileSave from 'file-saver'
  140. import addIcon from '../../assets/btnIcon/add.png'
  141. import saveIcon from '../../assets/btnIcon/save.png'
  142. import editIcon from '../../assets/btnIcon/edit.png'
  143. import deleteIcon from '../../assets/btnIcon/delete.png'
  144. import exportIcon from '../../assets/btnIcon/export.png'
  145. import importIcon from '../../assets/btnIcon/import.png'
  146. export default {
  147. components: {
  148. importDailog
  149. },
  150. data() {
  151. return {
  152. descMsg: '',
  153. dialogVisible: false,
  154. activeName: 'first',
  155. quantifiedList: [],
  156. changeDateSelect: [],
  157. receiptMsg: {
  158. code: '',
  159. des: '',
  160. stage: '',
  161. createName: '',
  162. createDate: '',
  163. type: '',
  164. year: '',
  165. recStage: ''
  166. },
  167. addIcon: addIcon,
  168. saveIcon: saveIcon,
  169. editIcon: editIcon,
  170. deleteIcon: deleteIcon,
  171. exportIcon: exportIcon,
  172. importIcon: importIcon,
  173. rowMsg: {},
  174. orgruleData: [],
  175. indicItemoptions: [],
  176. sectionNameArr: [],
  177. deptNameArr: [],
  178. statusData: [],
  179. pageLeft:{
  180. pagesize: 15,
  181. currentPage: 1,
  182. total: 0
  183. },
  184. pageRight:{
  185. pagesize: 15,
  186. currentPage: 1,
  187. total: 0
  188. },
  189. departData: [],
  190. instanceChild: {}
  191. }
  192. },
  193. created() {
  194. this.statusData = [
  195. {
  196. name: '已通过',
  197. id: '0'
  198. },
  199. {
  200. name: '待审核',
  201. id: '-1'
  202. },
  203. {
  204. name: '未通过',
  205. id: '-2'
  206. },
  207. {
  208. name: '已批准',
  209. id: '1'
  210. }
  211. ]
  212. },
  213. methods: {
  214. init(row, id, datas) {
  215. this.dialogVisible = true
  216. this.instanceChild = datas
  217. this.activeName = 'first'
  218. this.getDetails(id)
  219. this.rowMsg = row
  220. },
  221. handleClick() {
  222. this.changeDateSelect = []
  223. },
  224. rowClick(selection, row) {
  225. this.changeDateSelect = selection
  226. },
  227. handleCurrentChangeLeft(val) {
  228. this.pageLeft.currentPage = val
  229. },
  230. handleCurrentChangeRight(val) {
  231. this.pageRight.currentPage = val
  232. },
  233. //获取详情
  234. getDetails(id) {
  235. let that = this
  236. that.quantifiedList = []
  237. let userMes = JSON.parse(window.sessionStorage.getItem('user'))
  238. let params = {
  239. id: id,
  240. deptId: userMes.deptId
  241. }
  242. apiGetevaluationdeptassessmentDetailHeader(id).then(datas =>{
  243. if (datas && datas.data) {
  244. let item = datas.data
  245. this.receiptMsg = {
  246. code: item.responsibilityCode,
  247. des: item.des,
  248. stage: item.stage,
  249. createName: item.createName,
  250. createDate: item.createTime,
  251. type: item.checkCycle === 'YDKP'?'月度考评':item.checkCycle === 'JDKP'?'季度考评':'年度考评',
  252. year: item.appraisalYear,
  253. recStage: '有效'
  254. }
  255. }
  256. })
  257. apiGetevaluationdeptplanDetail(params).then(datas =>{
  258. if (datas && datas.data) {
  259. that.quantifiedList = datas.data
  260. that.pageLeft.total = datas.data.length
  261. }
  262. })
  263. },
  264. saveDetail() {
  265. let that = this
  266. let params = []
  267. that.quantifiedList.forEach(item =>{
  268. let obj = {
  269. id: item.id,
  270. targetName: item.targetName,
  271. targetValue: item.targetValue,
  272. baseScore: item.baseScore.toString(),
  273. evaluationCriteria: item.evaluationCriteria,
  274. auditStatus: item.auditStatus,
  275. serialNumber: item.serialNumber,
  276. completionStatus: item.completionStatus,
  277. evaluationScore: item.evaluationScore
  278. }
  279. params.push(obj)
  280. })
  281. apiGetevaluationdeptplanUpdate(params).then(datas =>{
  282. if (datas) {
  283. if (datas.success) {
  284. that.$message({
  285. message: '保存成功',
  286. type: 'success'
  287. });
  288. that.getDetails(that.rowMsg.id)
  289. } else {
  290. that.$message({
  291. message: datas.data,
  292. type: 'error'
  293. })
  294. }
  295. }
  296. })
  297. },
  298. examineAndApprove(type) {
  299. let that = this
  300. let actionCS = ''
  301. if (type === 'agree') {
  302. if (that.rowMsg.taskType === 'SIGN') {
  303. actionCS = 'signAgree'
  304. } else if (that.rowMsg.taskType === 'NORMAL') {
  305. actionCS = 'agree'
  306. }
  307. } else {
  308. if (that.rowMsg.taskType === 'SIGN') {
  309. actionCS = 'signReject'
  310. } else if (that.rowMsg.taskType === 'NORMAL') {
  311. actionCS = 'reject'
  312. }
  313. }
  314. let params = {
  315. taskId: that.rowMsg.id, //任务ID
  316. nodeId: that.rowMsg.nodeId, //节点ID
  317. action: actionCS, //固定值
  318. instanceId: that.rowMsg.instId, //流程实例ID
  319. opinion: that.descMsg, //审批意见
  320. iamCode: window.localStorage.getItem('code'), //认证后code值
  321. taskName: that.rowMsg.name,
  322. defKey: that.instanceChild.defKey,
  323. bizKey: that.instanceChild.bizKey
  324. }
  325. apiPostIsdoAction(params).then(datas =>{
  326. if (datas && datas.data) {
  327. if (datas.data.isOk) {
  328. that.$message({
  329. message: datas.data.data,
  330. type: 'success'
  331. })
  332. that.dialogVisible = false
  333. that.$emit('approveMsg', datas.data.isOk)
  334. } else {
  335. that.$message({
  336. message: datas.data.msg,
  337. type: 'error'
  338. })
  339. }
  340. }
  341. })
  342. },
  343. handleImport() {
  344. this.$refs.importPage.upload.title = "本部部门业绩指标计划信息导入"
  345. this.$refs.importPage.upload.open = true
  346. this.$refs.importPage.upload.url = '/evaluation-dept-plan/import'
  347. },
  348. successImport(val) {
  349. this.getDetails(this.rowMsg.id)
  350. },
  351. handleExport() {
  352. let data = this.quantifiedList //接口返回数据
  353. const workbook = new ExcelJS.Workbook()
  354. const worksheet = workbook.addWorksheet('Sheet1')
  355. //根据数据自己调整
  356. let colums = []
  357. colums = [
  358. { header: 'ID', key: 'id', width: 26 },
  359. { header: '业务ID', key: 'businessPlanId', width: 26 },
  360. { header: '部门ID', key: 'deptId', width: 26 },
  361. { header: '部门名称', key: 'deptName', width: 26 },
  362. { header: '部门编码', key: 'deptCode', width: 26 },
  363. { header: '排序', key: 'serialNumber', width: 26 },
  364. { header: '指标名称', key: 'targetName', width: 18 },
  365. { header: '目标值', key: 'targetValue', width: 18 },
  366. { header: '基础分', key: 'baseScore', width: 18 },
  367. { header: '完成情况', key: 'completionStatus', width: 18 },
  368. { header: '评价标准', key: 'evaluationCriteria', width: 18 },
  369. { header: '自评得分', key: 'evaluationScore', width: 18 }
  370. ]
  371. worksheet.columns = colums
  372. worksheet.getRow(1).font = {
  373. size: 12,
  374. bold: true
  375. }
  376. worksheet.addRows(data)
  377. workbook.xlsx.writeBuffer().then(buffer => {
  378. //这里为type
  379. const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
  380. fileSave(blob, `本部部门业绩指标考核数据导出.xlsx`)
  381. })
  382. },
  383. }
  384. }
  385. </script>
  386. <style lang="less">
  387. .deptstartFrom{
  388. .el-overlay{
  389. .el-dialog{
  390. // margin-top: 7vh;
  391. .el-dialog__body{
  392. padding: 0 20px !important;
  393. .startDetail{
  394. .starttitleSty{
  395. font-size: 18px;
  396. font-family: Microsoft YaHei;
  397. font-weight: bold;
  398. color: #3B7AD1;
  399. // line-height: 12px;
  400. margin: 20px 0 20px 10px;
  401. }
  402. .danjuMsg{
  403. border: 1px solid #D6DBEA;
  404. padding: 10px 20px;
  405. border-radius: 10px;
  406. margin-bottom: 20px;
  407. .danjuMsg_data{
  408. padding: 5px 0 10px 0;
  409. .data_tit{
  410. margin-right: 10px;
  411. font-weight: bold;
  412. font-size: 14px;
  413. font-family: Microsoft YaHei;
  414. color: #8991B0;
  415. }
  416. .data_tit_wd{
  417. display: inline-block;
  418. width: 90px;
  419. }
  420. .el-form-item--small{
  421. .el-input{
  422. height: 25px;
  423. width: 160px;
  424. }
  425. margin-bottom: 0;
  426. .el-input-number{
  427. height: 25px;
  428. .el-input-number__decrease, .el-input-number__increase{
  429. right: -39px;
  430. }
  431. }
  432. }
  433. }
  434. }
  435. .el-select, .el-input{
  436. width: 100%;
  437. }
  438. .btnASeach{
  439. display: flex;
  440. z-index: 11111;
  441. justify-content: end;
  442. position: relative;
  443. top: 32px;
  444. left: 50vw;
  445. width: 50%;
  446. .detaTableBtns{
  447. display: flex;
  448. width: 300px;
  449. margin-top: 5px;
  450. .tableBtn {
  451. display: flex;
  452. height: 20px;
  453. margin: 0 10px;
  454. img{
  455. margin-right: 5px;
  456. margin-top: 1px;
  457. }
  458. span{
  459. font-size: 14px;
  460. font-family: Microsoft YaHei;
  461. font-weight: 400;
  462. }
  463. }
  464. .add{
  465. cursor: pointer;
  466. span{
  467. color: #3B7AD1;
  468. }
  469. }
  470. .save{
  471. cursor: pointer;
  472. span{
  473. color: #50C14E;
  474. }
  475. }
  476. .edit{
  477. span{
  478. color: #F5A623;
  479. }
  480. }
  481. .delete{
  482. cursor: no-drop;
  483. span{
  484. color: #F65177;
  485. }
  486. }
  487. .import{
  488. cursor: pointer;
  489. span{
  490. color: #ce1e78;
  491. }
  492. }
  493. .export{
  494. cursor: pointer;
  495. span{
  496. color: #2baa8a;
  497. }
  498. }
  499. }
  500. }
  501. .el-tabs{
  502. .el-tabs__header{
  503. .el-tabs__nav{
  504. .el-tabs__item{
  505. font-size: 18px;
  506. font-family: Microsoft YaHei;
  507. font-weight: bold;
  508. margin: 0 10px;
  509. color: #8991B0;
  510. }
  511. .is-active{
  512. font-size: 18px;
  513. font-family: Microsoft YaHei;
  514. font-weight: bold;
  515. color: #3B7AD1;
  516. margin: 0 10px;
  517. }
  518. }
  519. }
  520. .el-table{
  521. margin-bottom: 10px;
  522. .el-table__body-wrapper{
  523. height: 38vh;
  524. }
  525. .el-table__row{
  526. .cell{
  527. .el-input{
  528. height: 24px;
  529. .el-input__inner{
  530. height: 24px;
  531. }
  532. }
  533. }
  534. }
  535. }
  536. }
  537. }
  538. }
  539. .el-dialog__footer{
  540. .dialog-footer{
  541. display: flex;
  542. justify-content: center;
  543. .el-button{
  544. width: 180px !important;
  545. height: 40px !important;
  546. }
  547. }
  548. }
  549. }
  550. }
  551. }
  552. </style>