index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. <template>
  2. <div class="appealBoxContainer">
  3. <div class="top">
  4. <Head :headText="headText"></Head>
  5. </div>
  6. <div class="bottom">
  7. <div class="appealBox">
  8. <div class="appealBoxLeft">
  9. <div class="title">
  10. <span class="Micbold">可申诉的未执行策略</span>
  11. <span v-if="appealsArr.length>0">{{appealsArr.length}}</span>
  12. </div>
  13. <p class="date MicrYaHei">{{appealsDate?formatterStr(appealsDate):'--'}}</p>
  14. <div class="left">
  15. <div class="execute">
  16. <div class="card" v-for="(item,index) in appealsArr" :key="index+'i'">
  17. <div class="time">执行时间:{{item.recommend?formatterStr2(item.recommend.time):'--'}}</div>
  18. <div class="advice MicrYaHei">
  19. <span>策略建议</span>
  20. <span>冷机台数</span>
  21. <span>{{item.recommend.chillerNumSetL||'--'}}大{{item.recommend.chillerNumSetS||'--'}}小</span>
  22. <span>冷机出水温度</span>
  23. <span>{{item.recommend.chillWaterOutTempSet||'--'}}°C</span>
  24. </div>
  25. <div class="advice">
  26. <span>实际执行</span>
  27. <span>冷机台数</span>
  28. <span>{{item.real?item.real.chillerNumSetLOrg:'--'}}大{{item.real?item.real.chillerNumSetSOrg:'--'}}小</span>
  29. <span>冷机出水温度</span>
  30. <span>{{item.real?item.real.chillWaterOutTempSetOrg:'--'}}°C</span>
  31. </div>
  32. <div class="remark">备注:{{item.remarks||'--'}}</div>
  33. <div class="refuteBox">
  34. <div class="refute" v-if="item.status=='305'">
  35. <img src="../../assets/error.png" alt />
  36. <span>已驳回</span>
  37. </div>
  38. <div v-else class="refute2"></div>
  39. <div class="btn">
  40. <el-button size="mini" @click="viewSnapshots = true">查看快照</el-button>
  41. <el-button size="mini" type="primary" @click="menu(item)">申诉</el-button>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="appealBoxCenter">
  49. <div class="title">
  50. <span class="Micbold">审核中</span>
  51. <span v-if="InAuditArr.length>0">{{InAuditArr.length}}</span>
  52. </div>
  53. <div class="center">
  54. <div class="card" v-for="(item,index) in InAuditArr" :key="index">
  55. <div class="time">
  56. <span class="time-box">
  57. <span>{{item.pushTime?formatter(item.pushTime):'--'}}</span>
  58. <span>{{item.title||'--'}}</span>
  59. </span>
  60. <span class="backout" @click="backoutClick(item,'revoke')">
  61. <img src="../../assets/backout.png" />撤销申请
  62. </span>
  63. </div>
  64. <div class="remark">申请原因:{{item.reasonType||'--'}}</div>
  65. <div class="remark">{{item.reason||'--'}}</div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="appealBoxRight" ref="appealBoxRight">
  70. <div class="title Micbold">审核完成/超时未申诉</div>
  71. <div class="right">
  72. <div class="card" v-for="(item,index) in auditCompletedArr" :key="index">
  73. <div class="remark">
  74. <div class="remark-left">审批时间:{{item.updateTime?formatter1(item.updateTime):'--'}}</div>
  75. <div class="remark-right Micbold">
  76. <span
  77. :class="item.status=='303'?'backout':(item.status=='306'?'backout1':'backout2')"
  78. >
  79. <img
  80. :src="item.status=='303'?require('../../assets/completed.png'):(item.status=='306'?require('../../assets/gray.png'):require('../../assets/error.png'))"
  81. />
  82. {{item.status=='303'?'申诉成功':(item.status=='306'?'未申诉':'申诉失败')}}
  83. </span>
  84. </div>
  85. </div>
  86. <div class="time">
  87. <span>{{item.pushTime?formatter(item.pushTime):'--'}}</span>
  88. <span>{{item.title||'--'}}</span>
  89. </div>
  90. </div>
  91. <div v-infinite-scroll="loadMore" infinite-scroll-disabled="busy">
  92. <div
  93. class="loadingIcon"
  94. style="width: 50px;
  95. text-align: center;
  96. margin: 0 auto;
  97. margin-top: 20px;
  98. margin-bottom: 30px;"
  99. >
  100. <i class="el-icon-loading"></i>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="view-dialog">
  108. <el-dialog
  109. title="策略推出时状况"
  110. :visible.sync="viewSnapshots"
  111. :close-on-click-modal="false"
  112. width="1260px"
  113. >
  114. <ev-snapshots-dialog></ev-snapshots-dialog>
  115. </el-dialog>
  116. </div>
  117. </div>
  118. </template>
  119. <script>
  120. import Head from "../main/index";
  121. import {
  122. queryWorkflow,
  123. queryChillerExecuteInfo,
  124. querySimpleInfo
  125. } from "@/api/appeal/appeal.js";
  126. import EvSnapshotsDialog from "../evaluate/evSnapshotsDialog";
  127. import { updateWorkflow } from "@/api/audit/audit.js";
  128. var moment = require("moment");
  129. import "moment/locale/zh-cn";
  130. export default {
  131. data() {
  132. return {
  133. headText: "未执行申诉",
  134. appealsArr: [], //可申诉的未执行策略
  135. InAuditArr: [], //审核中
  136. auditCompletedArr: [], //审核完成,超时未申诉
  137. appealsDate: "",
  138. viewSnapshots: false,
  139. newArr: [],
  140. busy: true,
  141. page: 1,
  142. pageSize: 15
  143. };
  144. },
  145. components: {
  146. Head,
  147. EvSnapshotsDialog
  148. },
  149. mounted() {
  150. this.init();
  151. },
  152. methods: {
  153. backoutClick(item, type) {
  154. let params = {
  155. postParams: {
  156. id: item.id,
  157. commit: type,
  158. roles: [1002],
  159. updateUser: "594e95e50abc4b6c9bdda985d313c1b9"
  160. }
  161. };
  162. updateWorkflow(params).then(res => {
  163. if (res.result == "success") {
  164. this.$message.success("撤销成功");
  165. } else {
  166. this.$message.error("撤销失败: " + res.message);
  167. }
  168. this.init();
  169. });
  170. },
  171. formatter(date) {
  172. return moment.unix(date / 1000).format("YYYY.MM.DD hh:mm");
  173. },
  174. formatter1(date) {
  175. return moment.unix(date / 1000).format("YYYY.MM.DD");
  176. },
  177. formatterStr(str) {
  178. if (str) {
  179. return (
  180. str.substring(0, 4) +
  181. "." +
  182. str.substring(4, 6) +
  183. "." +
  184. str.substring(6, 8)
  185. );
  186. }
  187. },
  188. formatterStr2(str) {
  189. if (str) {
  190. return str.substring(0, 2) + ":" + str.substring(2, 4);
  191. }
  192. },
  193. menu(item) {
  194. this.$router.push({
  195. path: "/appeal/appealDetail",
  196. query: { item: JSON.stringify(item) }
  197. });
  198. },
  199. init() {
  200. this.appealsIng();
  201. this.auditCompletedIng(true);
  202. this.InAuditIng();
  203. },
  204. // 可申诉的未执行策略
  205. appealsIng() {
  206. let params = {
  207. postParams: {
  208. criteria: {
  209. projectId: this.$store.state.projectId,
  210. trackerId: 3, //固定为3
  211. status: [301, 305] //固定为未申诉和已驳回
  212. },
  213. withColumns: ["customAttribute"]
  214. }
  215. };
  216. queryWorkflow(params).then(res => {
  217. let arr = [];
  218. arr = res.content ? res.content : [];
  219. if (arr.length > 0) {
  220. arr.forEach(item => {
  221. arr.push(item.commandId);
  222. this.newArr.push(item);
  223. });
  224. this.queryExecute(arr);
  225. }
  226. });
  227. },
  228. queryExecute(id) {
  229. this.appealsArr = [];
  230. let params = {
  231. postParams: {
  232. criteria: {
  233. id: id
  234. }
  235. }
  236. };
  237. queryChillerExecuteInfo(params).then(res => {
  238. let arr1 = [],
  239. arr2 = [];
  240. arr1 = res.data ? res.data : [];
  241. if (arr1.length > 0) {
  242. arr1.forEach(item => {
  243. this.newArr.forEach(item2 => {
  244. if (item.recommend.appealId == item2.id) {
  245. let obj = Object.assign(item, item2);
  246. this.appealsArr.push(obj);
  247. this.appealsDate = this.appealsArr[0].recommend.date;
  248. }
  249. });
  250. });
  251. }
  252. console.log(this.appealsArr);
  253. });
  254. },
  255. // 审核完成、超时未申诉
  256. auditCompletedIng(flag) {
  257. let params = {
  258. postParams: {
  259. criteria: {
  260. projectId: this.$store.state.projectId,
  261. trackerId: 3,
  262. status: [303, 304, 306],
  263. createTime: {
  264. $gte: "20200216000000" //三天以内
  265. }
  266. },
  267. size: this.pageSize,
  268. page: this.page,
  269. withColumns: ["customAttribute"]
  270. }
  271. };
  272. queryWorkflow(params).then(res => {
  273. // this.auditCompletedArr = res.content ? res.content : [];
  274. if (flag) {
  275. // 多次加载数据
  276. this.auditCompletedArr = this.auditCompletedArr.concat(res.content);
  277. if (res.content.length == 0) {
  278. this.busy = true;
  279. } else {
  280. this.busy = false;
  281. }
  282. } else {
  283. this.auditCompletedArr = res.content;
  284. this.busy = false;
  285. }
  286. });
  287. },
  288. loadMore: function() {
  289. this.busy = true;
  290. setTimeout(() => {
  291. this.page++;
  292. this.auditCompletedIng(true);
  293. }, 1000);
  294. },
  295. // 审核中
  296. InAuditIng() {
  297. let params = {
  298. postParams: {
  299. criteria: {
  300. projectId: this.$store.state.projectId,
  301. trackerId: 3,
  302. status: 302
  303. },
  304. withColumns: ["customAttribute"]
  305. }
  306. };
  307. queryWorkflow(params).then(res => {
  308. this.InAuditArr = res.content ? res.content : [];
  309. });
  310. }
  311. }
  312. };
  313. </script>
  314. <style lang="scss" scoped>
  315. .appealBoxContainer {
  316. height: 100%;
  317. display: flex;
  318. .top {
  319. height: 100px;
  320. }
  321. .bottom {
  322. flex: 1;
  323. .appealBox {
  324. height: 100%;
  325. background: #fff;
  326. display: flex;
  327. justify-content: space-between;
  328. padding: 0 24px;
  329. .appealBoxLeft {
  330. flex: 1;
  331. height: 100%;
  332. display: flex;
  333. flex-direction: column;
  334. // overflow: scroll;
  335. .title {
  336. display: flex;
  337. align-items: center;
  338. padding-top: 116px;
  339. span:nth-of-type(1) {
  340. height: 24px;
  341. font-size: 16px;
  342. color: rgba(31, 36, 41, 1);
  343. line-height: 21px;
  344. margin-right: 8px;
  345. }
  346. span:nth-of-type(2) {
  347. width: 18px;
  348. height: 18px;
  349. background: rgba(245, 74, 69, 1);
  350. border-radius: 9px;
  351. border: 1px solid rgba(255, 255, 255, 1);
  352. font-size: 12px;
  353. font-family: ArialMT;
  354. color: rgba(255, 255, 255, 1);
  355. line-height: 18px;
  356. text-align: center;
  357. }
  358. }
  359. .date {
  360. height: 18px;
  361. font-size: 12px;
  362. color: rgba(141, 147, 153, 1);
  363. line-height: 16px;
  364. margin: 0;
  365. text-align: center;
  366. }
  367. .left {
  368. flex: 1;
  369. overflow: scroll;
  370. .execute {
  371. .card {
  372. min-width: 470px;
  373. background: rgba(255, 255, 255, 1);
  374. border-radius: 4px;
  375. border: 1px solid rgba(228, 230, 231, 1);
  376. margin-top: 8px;
  377. padding: 16px 20px;
  378. cursor: pointer;
  379. .time {
  380. height: 24px;
  381. font-size: 16px;
  382. font-family: PingFangSC-Regular, PingFang SC;
  383. font-weight: 400;
  384. color: rgba(31, 36, 41, 1);
  385. line-height: 22px;
  386. margin-bottom: 8px;
  387. }
  388. .advice {
  389. margin-top: 4px;
  390. height: 40px;
  391. background: rgba(245, 246, 247, 1);
  392. border-radius: 1px;
  393. display: flex;
  394. justify-content: space-between;
  395. padding-left: 16px;
  396. padding-right: 20px;
  397. align-items: center;
  398. span:nth-of-type(1),
  399. span:nth-of-type(3),
  400. span:nth-of-type(5) {
  401. height: 22px;
  402. font-size: 14px;
  403. color: rgba(31, 36, 41, 1);
  404. }
  405. span:nth-of-type(3) {
  406. width: 115px;
  407. display: inline-block;
  408. }
  409. span:nth-of-type(5) {
  410. width: 65px;
  411. display: inline-block;
  412. }
  413. span:nth-of-type(2),
  414. span:nth-of-type(4) {
  415. height: 18px;
  416. font-size: 12px;
  417. color: rgba(141, 147, 153, 1);
  418. }
  419. span:nth-of-type(1) {
  420. width: 56px;
  421. margin-right: 36px;
  422. }
  423. span:nth-of-type(2) {
  424. margin-right: 8px;
  425. }
  426. span:nth-of-type(3) {
  427. margin-right: 24px;
  428. }
  429. span:nth-of-type(4) {
  430. margin-right: 8px;
  431. }
  432. }
  433. .remark {
  434. height: 22px;
  435. font-size: 14px;
  436. font-family: PingFangSC-Regular, PingFang SC;
  437. font-weight: 400;
  438. color: rgba(100, 108, 115, 1);
  439. line-height: 20px;
  440. margin-top: 16px;
  441. margin-bottom: 24px;
  442. }
  443. .refuteBox {
  444. display: flex;
  445. justify-content: space-between;
  446. align-items: center;
  447. .refute {
  448. padding: 0 12px;
  449. // width: 85px;
  450. height: 24px;
  451. background: #fde3e2;
  452. border-radius: 12px;
  453. display: flex;
  454. align-items: center;
  455. img {
  456. width: 14px;
  457. height: 14px;
  458. margin-right: 4px;
  459. }
  460. span {
  461. display: inline-block;
  462. height: 22px;
  463. font-size: 14px;
  464. font-family: MicrosoftYaHeiSemibold;
  465. color: rgba(245, 78, 69, 1);
  466. line-height: 22px;
  467. }
  468. }
  469. .refute2 {
  470. padding: 0 12px;
  471. // width: 85px;
  472. height: 24px;
  473. background: #fff;
  474. border-radius: 12px;
  475. display: flex;
  476. align-items: center;
  477. }
  478. .btn {
  479. // display: flex;
  480. // justify-content: flex-end;
  481. .el-button {
  482. width: 80px;
  483. height: 28px;
  484. }
  485. }
  486. }
  487. }
  488. }
  489. .card:after {
  490. display: block;
  491. clear: both;
  492. content: "";
  493. visibility: hidden;
  494. height: 0;
  495. }
  496. }
  497. }
  498. .appealBoxCenter {
  499. flex: 1;
  500. height: 100%;
  501. margin: 0 24px;
  502. // overflow: scroll;
  503. // height: 100%;
  504. display: flex;
  505. flex-direction: column;
  506. .title {
  507. display: flex;
  508. margin-bottom: 16px;
  509. padding-top: 116px;
  510. span:nth-of-type(1) {
  511. height: 24px;
  512. font-size: 16px;
  513. color: rgba(31, 36, 41, 1);
  514. line-height: 21px;
  515. margin-right: 8px;
  516. }
  517. span:nth-of-type(2) {
  518. text-align: center;
  519. line-height: 18px;
  520. width: 18px;
  521. height: 18px;
  522. background: rgba(245, 74, 69, 1);
  523. border-radius: 9px;
  524. border: 1px solid rgba(255, 255, 255, 1);
  525. font-size: 12px;
  526. font-family: ArialMT;
  527. color: rgba(255, 255, 255, 1);
  528. }
  529. }
  530. .center {
  531. margin: 0 18px;
  532. min-width: 410px;
  533. flex: 1;
  534. overflow: scroll;
  535. .card {
  536. margin-top: 8px;
  537. cursor: pointer;
  538. background: rgba(255, 255, 255, 1);
  539. border-radius: 4px;
  540. border: 1px solid rgba(228, 230, 231, 1);
  541. padding: 16px 20px;
  542. .time {
  543. margin-bottom: 6px;
  544. height: 24px;
  545. font-size: 16px;
  546. font-family: PingFangSC-Regular, PingFang SC;
  547. font-weight: 400;
  548. color: rgba(31, 36, 41, 1);
  549. line-height: 22px;
  550. .time-box {
  551. display: flex;
  552. align-items: center;
  553. span:nth-of-type(1) {
  554. width: 140px;
  555. }
  556. }
  557. .backout {
  558. display: flex;
  559. align-items: center;
  560. font-size: 14px;
  561. font-family: MicrosoftYaHei;
  562. color: rgba(0, 145, 255, 1);
  563. float: right;
  564. margin-right: 20px;
  565. display: none;
  566. img {
  567. height: 15px;
  568. width: 18px;
  569. }
  570. }
  571. }
  572. .remark {
  573. margin-top: 4px;
  574. height: 22px;
  575. font-size: 14px;
  576. font-family: PingFangSC-Regular, PingFang SC;
  577. font-weight: 400;
  578. color: rgba(100, 108, 115, 1);
  579. line-height: 20px;
  580. }
  581. }
  582. .card:hover {
  583. border: 1px solid rgba(0, 145, 255, 1);
  584. }
  585. .card:hover .backout {
  586. display: block;
  587. }
  588. .loadingIcon {
  589. width: 50px;
  590. text-align: center;
  591. margin: 0 auto;
  592. margin-top: 20px;
  593. margin-bottom: 30px;
  594. }
  595. }
  596. }
  597. .appealBoxRight {
  598. flex: 1;
  599. height: 100%;
  600. display: flex;
  601. flex-direction: column;
  602. .title {
  603. padding-top: 116px;
  604. margin-bottom: 16px;
  605. }
  606. .right {
  607. flex: 1;
  608. overflow: scroll;
  609. min-width: 310px;
  610. .card {
  611. margin-bottom: 8px;
  612. background: rgba(255, 255, 255, 1);
  613. border-radius: 4px;
  614. border: 1px solid rgba(228, 230, 231, 1);
  615. padding: 16px 20px;
  616. cursor: pointer;
  617. .remark {
  618. margin-bottom: 14px;
  619. display: flex;
  620. justify-content: space-between;
  621. align-items: center;
  622. .remark-left {
  623. height: 22px;
  624. font-size: 14px;
  625. font-family: PingFangSC-Regular, PingFang SC;
  626. font-weight: 400;
  627. color: rgba(100, 108, 115, 1);
  628. line-height: 20px;
  629. }
  630. .remark-right {
  631. height: 24px;
  632. height: 22px;
  633. font-size: 14px;
  634. line-height: 22px;
  635. img {
  636. width: 14px;
  637. height: 14px;
  638. margin-right: 4px;
  639. }
  640. .backout {
  641. display: flex;
  642. justify-content: space-between;
  643. align-items: center;
  644. padding-left: 12px;
  645. padding-right: 14px;
  646. background: rgba(217, 245, 214, 1);
  647. color: rgba(52, 199, 36, 1);
  648. border-radius: 12px;
  649. }
  650. .backout1 {
  651. display: flex;
  652. justify-content: space-between;
  653. align-items: center;
  654. padding-left: 12px;
  655. padding-right: 14px;
  656. background: rgba(239, 240, 241, 1);
  657. color: rgba(141, 147, 153, 1);
  658. border-radius: 12px;
  659. }
  660. .backout2 {
  661. display: flex;
  662. justify-content: space-between;
  663. align-items: center;
  664. padding-left: 12px;
  665. padding-right: 14px;
  666. background: rgba(253, 227, 226, 1);
  667. color: rgba(245, 78, 69, 1);
  668. border-radius: 12px;
  669. }
  670. }
  671. }
  672. .time {
  673. padding: 8px 12px;
  674. background: rgba(248, 249, 250, 1);
  675. border-radius: 1px;
  676. height: 22px;
  677. font-size: 14px;
  678. font-family: PingFangSC-Regular, PingFang SC;
  679. font-weight: 400;
  680. color: rgba(31, 36, 41, 1);
  681. line-height: 20px;
  682. span:nth-of-type(2) {
  683. margin-left: 10px;
  684. margin-right: 5px;
  685. }
  686. }
  687. }
  688. }
  689. }
  690. }
  691. }
  692. }
  693. </style>
  694. <style lang="scss">
  695. .view-dialog {
  696. .el-dialog__header {
  697. padding: 16px 28px 0 32px;
  698. .el-dialog__title {
  699. height: 24px;
  700. font-size: 16px;
  701. font-family: PingFangSC-Medium, PingFang SC;
  702. font-weight: 500;
  703. color: rgba(31, 36, 41, 1);
  704. line-height: 24px;
  705. }
  706. }
  707. .el-dialog__body {
  708. padding-top: 0;
  709. }
  710. }
  711. </style>