taskApplicationFrom.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. <template>
  2. <div class="applicationFrom">
  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.deptName}}</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.declarationLevel}}级</span>
  21. </div>
  22. <div class="danjuMsg_data">
  23. <span class="data_tit">申报领导:</span>
  24. <span>{{receiptMsg.deptLeaderName}}</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.createDate}}</span>
  41. </div>
  42. <div class="danjuMsg_data">
  43. <span class="data_tit">申报月份:</span>
  44. <span>{{receiptMsg.month}}月</span>
  45. </div>
  46. </el-col>
  47. <el-col :span="6">
  48. <div class="danjuMsgSelect">
  49. <span class="data_tit">评定等级:</span>
  50. <span v-if="userMes.deptId !== '23031009'">{{receiptMsg.ratingGrade}}</span>
  51. <el-select v-model="receiptMsg.ratingGrade" placeholder="请选择评定等级" @change="changeratingGrade" v-else>
  52. <el-option
  53. v-for="item in ratingGradeOption"
  54. :key="item.value"
  55. :label="item.label"
  56. :value="item.value">
  57. </el-option>
  58. </el-select>
  59. </div>
  60. </el-col>
  61. <el-col :span="18">
  62. <div class="danjuMsgSelect">
  63. <span class="data_tit">申报简述:</span>
  64. <span v-if="userMes.deptId !== '23031009'">{{receiptMsg.des}}</span>
  65. <el-input v-model="receiptMsg.des" :rows="1" type="textarea" @blur="blurDes" v-else
  66. placeholder="请输入申报简述"></el-input>
  67. </div>
  68. </el-col>
  69. </el-row>
  70. <div class="btnASeach">
  71. <!-- <div class="detaTableBtns">
  72. <div class="tableBtn add" @click="addTableDetail">
  73. <img :src="addIcon" alt="">
  74. <span>新增</span>
  75. </div>
  76. <div class="tableBtn save" @click="saveDetail">
  77. <img :src="saveIcon" alt="">
  78. <span>保存</span>
  79. </div>
  80. <div class="tableBtn import" @click="handleImport">
  81. <img :src="importIcon" alt="">
  82. <span>导入</span>
  83. </div>
  84. <div class="tableBtn export" @click="handleExport">
  85. <img :src="exportIcon" alt="">
  86. <span>导出</span>
  87. </div>
  88. </div> -->
  89. </div>
  90. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
  91. <el-tab-pane label="考评指标项内容" name="first">
  92. <el-table :data="quantifiedList.slice((pageLeft.currentPage-1)*pageLeft.pagesize, pageLeft.currentPage*pageLeft.pagesize)"
  93. style="width: 100%">
  94. <el-table-column label="序号" type="index" width="80" />
  95. <el-table-column label="人员编号" prop="employeeNo">
  96. <template #default="scope">
  97. <el-input v-model="scope.row.employeeNo" @blur="employeeNoInputBlur(scope.row.employeeNo, scope.row)" />
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="人员" prop="deptName">
  101. <template #default="scope">
  102. <el-select v-model="scope.row.employeeId" placeholder="请选择人员">
  103. <el-option
  104. v-for="item in deptLeaderOptionDet"
  105. :key="item.id"
  106. :label="item.name"
  107. :value="item.id">
  108. </el-option>
  109. </el-select>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="建议值">
  113. <template #default="scope">
  114. <el-input-number v-model="scope.row.suggestedValue" :precision="2" :step="0.1" :min="0" />
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="排序" >
  118. <template #default="scope">
  119. <el-input-number v-model="scope.row.serialNumber" :min="1" />
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="操作" width="120">
  123. <template #default="scope">
  124. <p class="indicitem" v-if="receiptMsg.stage !== '流程已结束'" @click="deleteRowFn(scope.row, scope.$index)">删除</p>
  125. </template>
  126. </el-table-column>
  127. </el-table>
  128. <el-pagination
  129. @current-change="handleCurrentChangeLeft"
  130. :current-page="pageLeft.currentPage"
  131. :page-size="pageLeft.pagesize"
  132. layout="total, prev, pager, next, jumper"
  133. :total="pageLeft.total">
  134. </el-pagination>
  135. </el-tab-pane>
  136. </el-tabs>
  137. <div>
  138. <p class="starttitleSty">审批意见:</p>
  139. <el-input v-model="descMsg" :rows="3" type="textarea" placeholder="请输入审批意见"></el-input>
  140. </div>
  141. </div>
  142. <template #footer>
  143. <span class="dialog-footer">
  144. <el-button type="primary" @click="examineAndApprove('agree')">同 意</el-button>
  145. <el-button @click="examineAndApprove('reject')">拒 绝</el-button>
  146. </span>
  147. </template>
  148. </el-dialog>
  149. <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
  150. </div>
  151. </template>
  152. <script>
  153. import importDailog from '../importPage/importDailog.vue'
  154. import {apiPostevaluationdeptadDetails,apiGetevaluationdeptadUpdate, apiGetevaluationdeptadDelete,apiPostIsdoAction,apideptAdmodify,
  155. apiPostevaluationdeptadDetailsHead, apiGetuserPageList} from '../../api/api'
  156. import ExcelJS from 'exceljs'
  157. import fileSave from 'file-saver'
  158. import addIcon from '../../assets/btnIcon/add.png'
  159. import saveIcon from '../../assets/btnIcon/save.png'
  160. import editIcon from '../../assets/btnIcon/edit.png'
  161. import deleteIcon from '../../assets/btnIcon/delete.png'
  162. import exportIcon from '../../assets/btnIcon/export.png'
  163. import importIcon from '../../assets/btnIcon/import.png'
  164. export default {
  165. components: {
  166. importDailog
  167. },
  168. data() {
  169. return {
  170. dialogVisible: false,
  171. activeName: 'first',
  172. quantifiedList: [],
  173. changeDateSelect: [],
  174. descMsg: '',
  175. receiptMsg: {
  176. code: '',
  177. des: '',
  178. stage: '',
  179. createName: '',
  180. createDate: '',
  181. type: '',
  182. year: '',
  183. month: '',
  184. recStage: ''
  185. },
  186. addIcon: addIcon,
  187. saveIcon: saveIcon,
  188. editIcon: editIcon,
  189. deleteIcon: deleteIcon,
  190. exportIcon: exportIcon,
  191. importIcon: importIcon,
  192. rowMsg: {},
  193. orgruleData: [],
  194. indicItemoptions: [],
  195. sectionNameArr: [],
  196. deptNameArr: [],
  197. pageLeft:{
  198. pagesize: 15,
  199. currentPage: 1,
  200. total: 0
  201. },
  202. pageRight:{
  203. pagesize: 15,
  204. currentPage: 1,
  205. total: 0
  206. },
  207. deptLeaderOptionDet: [],
  208. ratingGradeOption: [],
  209. userMes: {},
  210. instanceChild: {},
  211. keyId: ''
  212. }
  213. },
  214. created() {
  215. this.ratingGradeOption = [
  216. {
  217. label: 'A',
  218. value: 'A'
  219. },
  220. {
  221. label: 'B',
  222. value: 'B'
  223. },
  224. {
  225. label: 'C',
  226. value: 'C'
  227. },
  228. {
  229. label: 'D',
  230. value: 'D'
  231. }
  232. ]
  233. },
  234. methods: {
  235. init(row, id, allData) {
  236. this.dialogVisible = true
  237. this.userMes = JSON.parse(window.sessionStorage.getItem('user'))
  238. this.activeName = 'first'
  239. this.instanceChild = allData
  240. this.getDetails(id)
  241. this.getDetailsHeader(id)
  242. this.keyId = id
  243. this.changeDeptLead(row.deptId)
  244. this.rowMsg = row
  245. },
  246. // 根据部门查询人员
  247. changeDeptLead(val) {
  248. let that = this
  249. let params = {
  250. current: 1,
  251. size: 500,
  252. orgId: val
  253. }
  254. apiGetuserPageList(params).then(datas =>{
  255. if (datas && datas.data) {
  256. that.deptLeaderOptionDet = datas.data.records
  257. }
  258. })
  259. },
  260. changeratingGrade(val) {
  261. this.modeifyDetail('level', val)
  262. },
  263. blurDes() {
  264. this.modeifyDetail('des', this.receiptMsg.des)
  265. },
  266. // 修改申报详情头信息
  267. modeifyDetail(type, val) {
  268. let that = this
  269. let params = {
  270. id: that.keyId
  271. }
  272. if (type === 'level') {
  273. params.ratingGrade = val
  274. } else {
  275. params.des = val
  276. }
  277. apideptAdmodify(params).then(datas =>{
  278. if (datas.success) {
  279. that.$message({
  280. message: '修改成功',
  281. type: 'success'
  282. });
  283. } else {
  284. that.$message({
  285. message: '修改失败',
  286. type: 'error'
  287. });
  288. }
  289. })
  290. },
  291. handleClick() {
  292. this.changeDateSelect = []
  293. },
  294. handleCurrentChangeLeft(val) {
  295. this.pageLeft.currentPage = val
  296. },
  297. //获取详情头数据
  298. getDetailsHeader(id) {
  299. let that = this
  300. apiPostevaluationdeptadDetailsHead(id).then(datas =>{
  301. if (datas && datas.data) {
  302. let row = datas.data
  303. that.receiptMsg = {
  304. code: row.orderNumber,
  305. des: row.des,
  306. stage: row.stage,
  307. ratingGrade: row.ratingGrade,
  308. createName: row.createName,
  309. createDate: row.createTime,
  310. type: row.checkCycle === 'YDKP'?'月度考评':row.checkCycle === 'JDKP'?'季度考评':'年度考评',
  311. year: row.appraisalYear,
  312. month: row.declarationMonth,
  313. recStage: '有效'
  314. }
  315. }
  316. })
  317. },
  318. //获取详情
  319. getDetails(id) {
  320. let that = this
  321. that.quantifiedList = []
  322. apiPostevaluationdeptadDetails(id).then(datas =>{
  323. if (datas && datas.data) {
  324. datas.data.forEach(it =>{
  325. it.serialNumber = it.serialNumber.toString()
  326. })
  327. that.quantifiedList = datas.data
  328. that.pageLeft.total = datas.data.length
  329. }
  330. })
  331. },
  332. employeeNoInputBlur(val, row) {
  333. this.deptLeaderOptionDet.forEach(it =>{
  334. if (val === it.no) {
  335. row.employeeId = it.id
  336. }
  337. })
  338. },
  339. addTableDetail() {
  340. this.pageLeft.currentPage = 1
  341. let obj = {
  342. showInput: true,
  343. businessPlanId: this.rowMsg.id,
  344. employeeId: '',
  345. employeeNo: '',
  346. suggestedValue: 1,
  347. serialNumber: 0
  348. }
  349. this.quantifiedList.unshift(obj)
  350. },
  351. saveDetail() {
  352. let that = this
  353. let params = []
  354. that.quantifiedList.forEach(item =>{
  355. let emName = ''
  356. let emNo = ''
  357. that.deptLeaderOptionDet.forEach(it =>{
  358. if (item.employeeId === it.id) {
  359. emName = it.name
  360. emNo = it.no
  361. }
  362. })
  363. let obj = {
  364. assessmentDeclarationId: that.rowMsg.id,
  365. employeeId: item.employeeId,
  366. employeeName: emName,
  367. employeeNo: item.employeeNo ? item.employeeNo : emNo,
  368. suggestedValue: item.suggestedValue.toString(),
  369. serialNumber: item.serialNumber
  370. }
  371. if (!item.showInput) {
  372. obj.id = item.id
  373. }
  374. params.push(obj)
  375. })
  376. apiGetevaluationdeptadUpdate(params).then(datas =>{
  377. if (datas) {
  378. if (datas.success) {
  379. that.$message({
  380. message: '保存成功',
  381. type: 'success'
  382. });
  383. that.getDetails(that.rowMsg.id)
  384. } else {
  385. that.$message({
  386. message: datas.data,
  387. type: 'error'
  388. })
  389. }
  390. }
  391. })
  392. },
  393. deleteRowFn(row) {
  394. let that = this
  395. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  396. confirmButtonText: '确定',
  397. cancelButtonText: '取消',
  398. type: 'warning'
  399. }).then(() => {
  400. if (!row.id) {
  401. that.quantifiedList.splice(index, 1)
  402. } else {
  403. apiGetevaluationdeptadDelete(row.id).then(datas =>{
  404. if (datas) {
  405. that.$message({
  406. type: 'success',
  407. message: '删除成功!'
  408. });
  409. that.getDetails(that.rowMsg.id)
  410. }
  411. })
  412. }
  413. })
  414. },
  415. handleImport() {
  416. this.$refs.importPage.upload.title = "绩效结果考核申报导入"
  417. this.$refs.importPage.upload.open = true
  418. this.$refs.importPage.upload.url = '/evaluation-dept-ad/import'
  419. },
  420. successImport(val) {
  421. that.$message({
  422. type: 'success',
  423. message: val.data
  424. });
  425. this.getDetails(this.rowMsg.id)
  426. },
  427. handleExport() {
  428. let data = this.quantifiedList //接口返回数据
  429. const workbook = new ExcelJS.Workbook()
  430. const worksheet = workbook.addWorksheet('Sheet1')
  431. //根据数据自己调整
  432. let colums = []
  433. colums = [
  434. // { header: 'ID', key: 'id', width: 26, hidden: true },
  435. { header: '申报ID', key: 'assessmentDeclarationId', width: 26, hidden: true },
  436. { header: '人员编号', key: 'employeeNo', width: 26 },
  437. // { header: '员工ID', key: 'employeeId', width: 26 },
  438. { header: '员工名称', key: 'employeeName', width: 26 },
  439. { header: '建议值', key: 'suggestedValue', width: 26 },
  440. { header: '排序', key: 'serialNumber', width: 26 },
  441. ]
  442. worksheet.columns = colums
  443. worksheet.getRow(1).font = {
  444. size: 12,
  445. bold: true
  446. }
  447. worksheet.addRows(data)
  448. workbook.xlsx.writeBuffer().then(buffer => {
  449. //这里为type
  450. const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
  451. fileSave(blob, `绩效结果考核申报数据导出.xlsx`)
  452. })
  453. },
  454. examineAndApprove(type) {
  455. let that = this
  456. let actionCS = ''
  457. if (type === 'agree') {
  458. if (that.rowMsg.taskType === 'SIGN') {
  459. actionCS = 'signAgree'
  460. } else if (that.rowMsg.taskType === 'NORMAL') {
  461. actionCS = 'agree'
  462. }
  463. } else {
  464. if (that.rowMsg.taskType === 'SIGN') {
  465. actionCS = 'signReject'
  466. } else if (that.rowMsg.taskType === 'NORMAL') {
  467. actionCS = 'reject'
  468. }
  469. }
  470. let params = {
  471. taskId: that.rowMsg.id, //任务ID
  472. nodeId: that.rowMsg.nodeId, //节点ID
  473. action: actionCS, //固定值
  474. instanceId: that.rowMsg.instId, //流程实例ID
  475. opinion: that.descMsg, //审批意见
  476. iamCode: window.localStorage.getItem('code'), //认证后code值
  477. taskName: that.rowMsg.name,
  478. defKey: that.instanceChild.defKey,
  479. bizKey: that.instanceChild.bizKey
  480. }
  481. apiPostIsdoAction(params).then(datas =>{
  482. if (datas && datas.data) {
  483. if (datas.data.isOk) {
  484. that.$message({
  485. message: datas.data.data,
  486. type: 'success'
  487. })
  488. that.dialogVisible = false
  489. that.$emit('approveMsg', datas.data.isOk)
  490. } else {
  491. that.$message({
  492. message: datas.data.msg,
  493. type: 'error'
  494. })
  495. }
  496. }
  497. })
  498. },
  499. }
  500. }
  501. </script>
  502. <style lang="less">
  503. .applicationFrom{
  504. .el-overlay{
  505. .el-dialog{
  506. // margin-top: 7vh;
  507. .el-dialog__body{
  508. padding: 0 20px !important;
  509. .startDetail{
  510. .starttitleSty{
  511. font-size: 18px;
  512. font-family: Microsoft YaHei;
  513. font-weight: bold;
  514. color: #3B7AD1;
  515. // line-height: 12px;
  516. margin: 20px 0 20px 10px;
  517. }
  518. .danjuMsg{
  519. border: 1px solid #D6DBEA;
  520. padding: 10px 20px;
  521. border-radius: 10px;
  522. margin-bottom: 10px;
  523. .danjuMsg_data{
  524. padding: 5px 0 10px 0;
  525. .data_tit{
  526. margin-right: 10px;
  527. font-weight: bold;
  528. font-size: 14px;
  529. font-family: Microsoft YaHei;
  530. color: #8991B0;
  531. }
  532. .data_tit_wd{
  533. display: inline-block;
  534. width: 90px;
  535. }
  536. .el-form-item--small{
  537. .el-input{
  538. height: 25px;
  539. width: 160px;
  540. }
  541. margin-bottom: 0;
  542. .el-input-number{
  543. height: 25px;
  544. .el-input-number__decrease, .el-input-number__increase{
  545. right: -39px;
  546. }
  547. }
  548. }
  549. }
  550. .danjuMsgSelect{
  551. display: flex;
  552. .data_tit{
  553. margin-right: 10px;
  554. font-weight: bold;
  555. font-size: 14px;
  556. font-family: Microsoft YaHei;
  557. color: #8991B0;
  558. }
  559. .el-select{
  560. width: 30%;
  561. position: relative;
  562. top: -5px;
  563. }
  564. .el-textarea{
  565. width: 80%;
  566. position: relative;
  567. top: -4px;
  568. }
  569. }
  570. }
  571. .el-select, .el-input{
  572. width: 100%;
  573. }
  574. .btnASeach{
  575. display: flex;
  576. z-index: 11111;
  577. justify-content: flex-end;
  578. position: relative;
  579. top: 32px;
  580. // left: 50vw;
  581. width: 100%;
  582. .detaTableBtns{
  583. display: flex;
  584. justify-content: flex-end;
  585. width: 300px;
  586. margin-top: 5px;
  587. .tableBtn {
  588. display: flex;
  589. height: 20px;
  590. margin: 0 10px;
  591. // width: 13%;
  592. width: fit-content;
  593. img{
  594. margin-right: 5px;
  595. margin-top: 1px;
  596. }
  597. span{
  598. display: inline-block;
  599. width: 35px;
  600. font-size: 14px;
  601. font-family: Microsoft YaHei;
  602. font-weight: 400;
  603. }
  604. }
  605. .add{
  606. cursor: pointer;
  607. span{
  608. color: #3B7AD1;
  609. }
  610. }
  611. .save{
  612. cursor: pointer;
  613. span{
  614. color: #50C14E;
  615. }
  616. }
  617. .edit{
  618. span{
  619. color: #F5A623;
  620. }
  621. }
  622. .delete{
  623. cursor: no-drop;
  624. span{
  625. color: #F65177;
  626. }
  627. }
  628. .import{
  629. cursor: pointer;
  630. span{
  631. color: #ce1e78;
  632. }
  633. }
  634. .export{
  635. cursor: pointer;
  636. span{
  637. color: #2baa8a;
  638. }
  639. }
  640. }
  641. }
  642. .el-tabs{
  643. .el-tabs__header{
  644. .el-tabs__nav{
  645. .el-tabs__item{
  646. font-size: 18px;
  647. font-family: Microsoft YaHei;
  648. font-weight: bold;
  649. margin: 0 10px;
  650. color: #8991B0;
  651. }
  652. .is-active{
  653. font-size: 18px;
  654. font-family: Microsoft YaHei;
  655. font-weight: bold;
  656. color: #3B7AD1;
  657. margin: 0 10px;
  658. }
  659. }
  660. }
  661. .el-table{
  662. margin-bottom: 10px;
  663. .el-table__body-wrapper{
  664. height: 38vh;
  665. }
  666. .el-table__row{
  667. .cell{
  668. .el-input{
  669. height: 24px;
  670. .el-input__inner{
  671. height: 24px;
  672. }
  673. }
  674. }
  675. }
  676. .indicitem{
  677. color: #F65177;
  678. font-size: 12px;
  679. margin-right: 20px;
  680. cursor:pointer;
  681. &:hover{
  682. text-decoration: underline;
  683. }
  684. }
  685. }
  686. }
  687. }
  688. }
  689. .el-dialog__footer{
  690. .dialog-footer{
  691. display: flex;
  692. justify-content: center;
  693. .el-button{
  694. width: 180px !important;
  695. height: 40px !important;
  696. }
  697. }
  698. }
  699. }
  700. }
  701. }
  702. </style>