evaluationDeptStartFrom.vue 24 KB

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