taskCenterDeptBusinessFrom.vue 25 KB

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