taskCenterDeptBusinessFrom.vue 23 KB

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