taskCenterDeptBusinessFrom.vue 24 KB

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