evaluationUnitRatingPage.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <div class="evaluationUnitRating">
  3. <div class="evaluationUnitRatingBtn">
  4. <div class="collectSeach" :style="$utils.collectSeachSty()">
  5. <div class="exceed">
  6. <span class="exceedSpan">评级编码:</span>
  7. <el-input v-model="ratingCode" placeholder="请输入评级编码"></el-input>
  8. </div>
  9. <div class="exceed">
  10. <span class="exceedSpan">评级描述:</span>
  11. <el-input v-model="ratingDes" placeholder="请输入评级描述"></el-input>
  12. </div>
  13. <div class="exceed">
  14. <span class="exceedSpan" style="width: 80px">考评年度:</span>
  15. <el-date-picker v-model="resAnnual" type="year" value-format="YYYY" placeholder="选择年份" />
  16. </div>
  17. <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
  18. </div>
  19. <div class="PeriodBtn" :style="$utils.PeriodBtnSty()">
  20. <btns
  21. :showImport="false"
  22. :showExport="false"
  23. :showSave="$utils.havePurview('evaluationUnitRate:oneLevel:save')"
  24. :showAdd="$utils.havePurview('evaluationUnitRate:oneLevel:add')"
  25. :showDelete="$utils.havePurview('evaluationUnitRate:oneLevel:delete')"
  26. :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
  27. :disDelete="changeDateSelect.length === 0"
  28. :disImport="false" :disExport="false"
  29. @handleAdd="handleAdd"
  30. @handleEdit="handleEdit"
  31. @handleDelete="handleDelete"
  32. ></btns>
  33. </div>
  34. <div class="evaluationUnitRatingTableData">
  35. <!-- @row-click="rowClickToggle" -->
  36. <el-table :data="evaluationUnitRatingData" style="width: 100%" :class="unitRatingTableSty()"
  37. @select="rowClick" @select-all="rowClick" @row-dblclick="rowClickToggle">
  38. <el-table-column type="selection" label="操作" align="center"></el-table-column>
  39. <el-table-column type="index" label="序号" align="center"></el-table-column>
  40. <el-table-column label="编码" prop="yearRatingCode" />
  41. <el-table-column label="描述" prop="des" />
  42. <el-table-column label="年份" prop="year" />
  43. <el-table-column label="状态" prop="stage" width="200">
  44. <template #default="scope">
  45. <p class="indicitem" @click="seeStates(scope.row)">{{scope.row.stage}}</p>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="创建人" prop="createName" />
  49. <el-table-column label="创建时间" prop="createTime" />
  50. <el-table-column label="操作" width="160">
  51. <template #default="scope">
  52. <div style="display:flex">
  53. <p class="indicitem" v-if="scope.row.stage === '流程未启动'" @click="agetdeptresponsibility(scope.row)">启动</p>
  54. <p style="font-size: 12px;margin-right: 20px;" v-else-if="scope.row.stage === '流程已结束'" >已结束</p>
  55. <p style="font-size: 12px;margin-right: 20px;" v-else >已启动</p>
  56. </div>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <el-pagination
  61. @size-change="handleSizeChange"
  62. @current-change="handleCurrentChange"
  63. :current-page="page.currentPage"
  64. :page-size="page.pagesize"
  65. layout="total, prev, pager, next, jumper"
  66. :total="page.total">
  67. </el-pagination>
  68. </div>
  69. <el-dialog :title="title" custom-class="startToDia" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
  70. <div class="periodFrom">
  71. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
  72. <el-form-item label="年份" prop="year">
  73. <el-date-picker
  74. v-model="ruleForm.year"
  75. :disabled="isSave"
  76. type="year"
  77. value-format="YYYY"
  78. placeholder="请选择年份"
  79. />
  80. </el-form-item>
  81. <el-form-item label="描述" prop="des">
  82. <el-input v-model="ruleForm.des" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
  83. </el-form-item>
  84. </el-form>
  85. </div>
  86. <template #footer v-if="!isSave || (isSave && evalradio.stage === '流程未启动')">
  87. <span class="dialog-footer">
  88. <el-button @click="dialogVisible = false">取 消</el-button>
  89. <el-button type="primary" @click="saveevaluaStart('ruleForm')">确 定</el-button>
  90. </span>
  91. </template>
  92. </el-dialog>
  93. <el-dialog title="流程详情" v-model="statesVisible" :fullscreen="true" :close-on-click-modal="false">
  94. <div class="flowSty">
  95. <iframe id="iframeContain" width="100%" height="500px"
  96. frameborder="0" class="iframe" name="iframeContain" seamless scrolling="no" :src="iframeURL">
  97. </iframe>
  98. <el-table :data="stageArr" style="width: 100%">
  99. <el-table-column type="index" label="序号" align="center" />
  100. <el-table-column label="任务名称" prop="taskName" />
  101. <el-table-column label="任务创建时间" prop="createTime" />
  102. <el-table-column label="任务处理时间" prop="approveTime" />
  103. <el-table-column label="候选人" prop="assignInfo" width="300">
  104. <template #default="scope">
  105. <span>{{changeAssignInfo(scope.row)}}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="执行人" prop="approverName" />
  109. <el-table-column label="处理状态" prop="status">
  110. <template #default="scope">
  111. <div v-if="scope.row.status === 'start'">启动</div>
  112. <div v-else-if="scope.row.status === 'agree'">同意</div>
  113. <div v-else-if="scope.row.status === 'awaiting_check'">等待,待审批</div>
  114. <div v-else-if="scope.row.status === 'reject'">驳回</div>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="备注/意见" prop="opinion" />
  118. </el-table>
  119. </div>
  120. </el-dialog>
  121. </div>
  122. <rating-dialog ref="ratingDialog" ></rating-dialog>
  123. </div>
  124. </template>
  125. <script>
  126. import ratingDialog from './evaluationUnitRatingDialog.vue'
  127. import btns from '../elbuttonS.vue'
  128. import seachs from '../seachGroup.vue'
  129. import {apiGetorganizationyearratinglist, apiGetorganizationyearratingsave,apiGetworkflowgetOpinion,apiGetdoAction,
  130. apiPostorganizationyearratingDelete} from '../../api/api'
  131. export default {
  132. components: {
  133. ratingDialog,
  134. btns,
  135. seachs
  136. },
  137. data() {
  138. return {
  139. dialogVisible: false,
  140. statesVisible: false,
  141. isSave: false,
  142. title: '',
  143. iframeURL: '',
  144. evalradio: {},
  145. changeDateSelect: [],
  146. evaluationUnitRatingData:[],
  147. stageArr: [],
  148. ruleForm: {
  149. year: '',
  150. des: ''
  151. },
  152. rules: {
  153. year: [
  154. { required: true, message: '请选择年份', trigger: 'change' }
  155. ],
  156. des: [
  157. { required: true, message: '请输入描述', trigger: 'blur' }
  158. ]
  159. },
  160. page:{
  161. pagesize: 12,
  162. currentPage: 1,
  163. total: 0
  164. },
  165. ratingCode: '',
  166. ratingDes: '',
  167. businessStr: '',
  168. resAnnual: '',
  169. monthArr: [],
  170. ratingArr: [],
  171. winPix: window.devicePixelRatio,
  172. innerWidth: window.innerWidth
  173. }
  174. },
  175. created() {
  176. this.ratingArr = [
  177. {
  178. label: 'A级',
  179. value: 'A'
  180. },
  181. {
  182. label: 'B级',
  183. value: 'B'
  184. },
  185. {
  186. label: 'C级',
  187. value: 'C'
  188. }
  189. ]
  190. this.resAnnual = new Date().getFullYear().toString()
  191. this.getevaluRatingList()
  192. },
  193. methods:{
  194. // 查询列表页面
  195. getevaluRatingList() {
  196. let that = this
  197. let params = {
  198. pageNum: that.page.currentPage,
  199. pageSize: that.page.pagesize,
  200. des: that.ratingDes,
  201. yearRatingCode: that.ratingCode,
  202. year: that.resAnnual
  203. }
  204. apiGetorganizationyearratinglist(params).then(datas =>{
  205. if (datas && datas.data.records) {
  206. that.evaluationUnitRatingData = datas.data.records
  207. that.page.total = datas.data.total
  208. }
  209. })
  210. },
  211. handleSizeChange(val){
  212. this.page.pagesize = val
  213. this.getevaluRatingList()
  214. },
  215. handleCurrentChange(val){
  216. this.page.currentPage =val
  217. this.getevaluRatingList()
  218. },
  219. saveevaluaStart(formName) {
  220. let that = this
  221. that.$refs[formName].validate((valid) => {
  222. if (valid) {
  223. that.saveAndEditIndicatorData()
  224. }
  225. });
  226. },
  227. //新增/修改考评启动数据
  228. saveAndEditIndicatorData() {
  229. let that = this
  230. // let userMes = JSON.parse(window.sessionStorage.getItem('user'))
  231. let params = {
  232. // createName: userMes.name,
  233. createName: '组织人事部',
  234. year: that.ruleForm.year,
  235. des: that.ruleForm.des
  236. }
  237. if (that.isSave) {
  238. params.id = that.evalradio.id
  239. }
  240. apiGetorganizationyearratingsave(params).then(datas =>{
  241. if (!datas.success) {
  242. that.$message({
  243. message: datas.message,
  244. type: 'error'
  245. });
  246. } else {
  247. if (!that.isSave) {
  248. that.$message({
  249. message: '单位绩效考核评级新增成功',
  250. type: 'success'
  251. });
  252. } else {
  253. that.$message({
  254. message: '单位绩效考核评级修改成功',
  255. type: 'success'
  256. });
  257. }
  258. that.dialogVisible = false
  259. that.changeDateSelect = []
  260. that.getevaluRatingList()
  261. }
  262. })
  263. },
  264. getSeachData() {
  265. this.getevaluRatingList()
  266. },
  267. resetSeach() {
  268. this.ratingDes = ''
  269. this.ratingCode = ''
  270. this.resAnnual = ''
  271. this.getevaluRatingList()
  272. },
  273. rowClick(selection, row) {
  274. this.changeDateSelect = selection
  275. },
  276. rowClickToggle(row) {
  277. this.$refs.ratingDialog.init(row)
  278. },
  279. seeStates(row) {
  280. if (!row.instId) {
  281. this.$message({
  282. type: 'error',
  283. message: '无法查看流程'
  284. });
  285. } else {
  286. this.statesVisible = true
  287. let url = ''
  288. if (window.location.hostname === '10.65.78.81') {
  289. url = 'http://10.65.79.85:8080'
  290. } else {
  291. url = 'http://10.65.78.23:8080'
  292. }
  293. this.iframeURL = url+'/agilebpm-ui/bpm/instance/instanceImageDialog.html?instanceId='+row.instId+'&iamCode='+window.localStorage.getItem('code')
  294. this.getstageData(row.instId)
  295. }
  296. },
  297. // 根据流程id获取业务id
  298. getstageData(id) {
  299. let that = this
  300. let params = {
  301. instId: id,
  302. iamCode: window.localStorage.getItem('code')
  303. }
  304. apiGetworkflowgetOpinion(params).then(datas =>{
  305. if (datas && datas.data) {
  306. that.stageArr = datas.data.data
  307. }
  308. })
  309. },
  310. changeAssignInfo(row) {
  311. let showStr = ''
  312. if (row.assignInfo) {
  313. showStr = row.assignInfo.substring(row.assignInfo.indexOf('-')+1, row.assignInfo.length).substring(0, row.assignInfo.substring(row.assignInfo.indexOf('-')+1, row.assignInfo.length).indexOf('-'))
  314. }
  315. return showStr
  316. },
  317. agetdeptresponsibility(row) {
  318. let that = this
  319. let par = {
  320. defKey: "nddwpj",
  321. businessKey: row.id,
  322. action: "start",
  323. opinion: "年度单位评级",
  324. iamCode: window.localStorage.getItem('code')
  325. }
  326. if (row.instId === null || row.instId === '') {
  327. apiGetdoAction(par).then(datas =>{
  328. if (datas && datas.data) {
  329. if (datas.data.isOk) {
  330. that.$message({
  331. message: '流程已启动',
  332. type: 'success'
  333. });
  334. } else {
  335. that.$message({
  336. message: datas.data.msg,
  337. type: 'error'
  338. });
  339. }
  340. }
  341. })
  342. }
  343. },
  344. handleAdd() {
  345. this.dialogVisible = true
  346. this.isSave = false
  347. this.evalradio = {}
  348. this.title = '新建单位绩效考核评级'
  349. this.$nextTick(() =>{
  350. this.ruleForm = {
  351. year: '',
  352. des: ''
  353. }
  354. })
  355. },
  356. handleEdit() {
  357. this.dialogVisible = true
  358. this.isSave = true
  359. this.title = '修改单位绩效考核评级'
  360. this.evalradio = this.changeDateSelect[0]
  361. this.ruleForm = {
  362. year: this.evalradio.year,
  363. des: this.evalradio.des
  364. }
  365. },
  366. //删除
  367. handleDelete() {
  368. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  369. confirmButtonText: '确定',
  370. cancelButtonText: '取消',
  371. type: 'warning'
  372. }).then(() => {
  373. let that = this
  374. let paramsArr = []
  375. that.changeDateSelect.forEach(it =>{
  376. paramsArr.push(it.id)
  377. })
  378. apiPostorganizationyearratingDelete(paramsArr.join(',')).then(datas =>{
  379. that.$message({
  380. type: 'success',
  381. message: '删除成功!'
  382. });
  383. that.getevaluRatingList()
  384. that.changeDateSelect = []
  385. })
  386. })
  387. },
  388. unitRatingTableSty() {
  389. if (this.winPix === 1.25 || this.innerWidth < 1800) {
  390. return 'unitRating125Table'
  391. } else {
  392. return 'unitRating100Table'
  393. }
  394. }
  395. }
  396. }
  397. </script>
  398. <style lang="less">
  399. .evaluationUnitRating{
  400. .evaluationUnitRatingBtn{
  401. .collectSeach{
  402. display: flex;
  403. padding: 24px 20px;
  404. border-bottom: 1px solid#D6DBEA;
  405. .exceed{
  406. display: flex;
  407. .exceedSpan{
  408. width: 100px;
  409. height: 12px;
  410. font-size: 14px;
  411. font-family: Microsoft YaHei;
  412. font-weight: 400;
  413. color: #8991B0;
  414. line-height: 12px;
  415. margin-top: 14px;
  416. }
  417. .el-input{
  418. margin-right:10px;
  419. height: 40px;
  420. .el-input__inner{
  421. height:40px;
  422. }
  423. .el-input__suffix{
  424. .el-select__caret{
  425. line-height:30px;
  426. }
  427. }
  428. }
  429. }
  430. .el-select{
  431. margin-right:10px;
  432. .el-input__inner{
  433. height:30px;
  434. }
  435. .el-input__suffix{
  436. .el-select__caret{
  437. line-height:30px;
  438. }
  439. }
  440. }
  441. }
  442. span{
  443. font-size:14px;
  444. }
  445. .PeriodBtn{
  446. display: flex;
  447. justify-content: flex-end;
  448. padding: 20px 0;
  449. }
  450. .el-button{
  451. height: 30px;
  452. // width:100px;
  453. padding: 0 20px ;
  454. // padding-top: 8px;
  455. span{
  456. margin:0;
  457. }
  458. }
  459. .evaluationUnitRatingTableData{
  460. .unitRating125Table{
  461. .el-table__body-wrapper{
  462. height: 53vh !important;
  463. }
  464. }
  465. .unitRating100Table{
  466. .el-table__body-wrapper{
  467. height: 60vh !important;
  468. }
  469. }
  470. .el-table{
  471. .el-input__inner{
  472. height: 30px !important;
  473. }
  474. .el-radio__label{
  475. display: none;
  476. }
  477. .tooltipCC{
  478. width: 300px !important;
  479. display: inline-block;
  480. overflow: hidden;
  481. text-overflow: ellipsis;
  482. white-space: nowrap;
  483. }
  484. .tooltipCCDes{
  485. width: 50px;
  486. display: inline-block;
  487. overflow: hidden;
  488. text-overflow: ellipsis;
  489. white-space: nowrap;
  490. }
  491. .indicitem{
  492. color: #409EFF;
  493. font-size: 12px;
  494. margin-right: 20px;
  495. cursor:pointer;
  496. &:hover{
  497. text-decoration: underline;
  498. }
  499. }
  500. }
  501. .el-pagination{
  502. margin-top: 20px;
  503. text-align: end;
  504. position: relative;
  505. }
  506. }
  507. .el-overlay{
  508. .startToDia{
  509. .el-dialog__body{
  510. padding: 30px 60px 30px 20px !important;
  511. .periodFrom{
  512. .el-select, .el-input{
  513. width: 100%;
  514. }
  515. .el-input{
  516. height: 30px;
  517. }
  518. }
  519. .flowSty{
  520. width: 100%;
  521. height: 70vh;
  522. }
  523. }
  524. }
  525. }
  526. }
  527. }
  528. </style>