index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. <template>
  2. <div class="appealBox">
  3. <div class="top">
  4. <Head :headText="headText"></Head>
  5. </div>
  6. <div class="bottom">
  7. <div class="appealContainer">
  8. <div class="appeal-left">
  9. <div class="appeal-left-top">
  10. <span class="appeal-left-top-span Micbold">待审核</span>
  11. <el-select v-model="value" placeholder="请选择">
  12. <el-option
  13. v-for="item in appealOptions"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value"
  17. ></el-option>
  18. </el-select>
  19. </div>
  20. <div class="appeal-left-box">
  21. <p class="date MicrYaHei">{{'--'}}</p>
  22. <div
  23. class="appeal-left-div"
  24. v-for="(item,index) in auditArr"
  25. :key="index"
  26. @click="appealClick(item,index)"
  27. :class="{border:index==isactive}"
  28. >
  29. <div class="time">
  30. <span>{{item.pushTime?formatter(item.pushTime):'--'}} {{item.title||'--'}}</span>
  31. <span>
  32. <img src="../../assets/tp.png" alt />
  33. {{item.pics.length}}
  34. </span>
  35. </div>
  36. <div class="content">
  37. <span>申请人:{{'--'}}</span>
  38. <span>申请时间:{{item.updateTime?formatter1(item.updateTime):'--'}}</span>
  39. <span>申请原因:{{item.reasonType||'--'}}</span>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="appeal-right">
  45. <div class="title Micbold">未执行申诉单</div>
  46. <div class="detailContainer">
  47. <div class="nav MicrYaHei">
  48. <span>项目名称:{{'--'}}</span>
  49. <span>申请人:{{auditObj.applyUser||'--'}}</span>
  50. <span>申请时间:{{auditObj.updateTime?formatter1(auditObj.updateTime):'--'}}</span>
  51. </div>
  52. <div class="cont1 MicrYaHei">申诉未执行指令:{{auditObj.title||'--'}}</div>
  53. <div class="cont2">
  54. <audit-table :tableList="tableList"></audit-table>
  55. </div>
  56. <div class="cont3">
  57. <span class="Micbold">策略评价</span>
  58. <span class="MicrYaHei">{{auditObj.judgement||'--'}}</span>
  59. </div>
  60. <div class="cont4">
  61. <span class="Micbold">申请原因</span>
  62. <span>
  63. <el-select size="mini" v-model="auditObj.reasonType" placeholder="请选择">
  64. <el-option
  65. v-for="item in options"
  66. :key="item.value"
  67. :label="item.label"
  68. :value="item.value"
  69. ></el-option>
  70. </el-select>
  71. </span>
  72. <span>
  73. <textarea placeholder="填写申请原因" v-model="auditObj.reason"></textarea>
  74. </span>
  75. </div>
  76. <div>
  77. <upload-img :souseArr="auditObj.pics || []"></upload-img>
  78. </div>
  79. </div>
  80. <div class="opinion">
  81. <span class="opinion-title Micbold">审批意见</span>
  82. <div class="opinion-bottom MicrYaHei">
  83. <input type="text" v-model="comment" />
  84. <span @click="approvalOpinion(auditObj,'reject')">不同意</span>
  85. <span @click="approvalOpinion(auditObj,'approve')">同意</span>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import Head from "../main/index";
  95. import AuditTable from "./auditTable";
  96. import uploadImg from "../../components/uploadImg";
  97. import { queryWorkflow, queryChillerExecuteInfo } from "@/api/appeal/appeal.js";
  98. import { updateWorkflow } from "@/api/audit/audit.js";
  99. import { querySimpleInfo } from "@/api/appeal/appeal.js";
  100. var moment = require("moment");
  101. import "moment/locale/zh-cn";
  102. export default {
  103. data() {
  104. return {
  105. headText: "申诉审核",
  106. isactive: 0, //默认第一个
  107. appealOptions: [
  108. {
  109. value: "0",
  110. label: "按未执行策略的时间"
  111. }
  112. ],
  113. resonOptions: [
  114. {
  115. value: "1",
  116. label: "策略原因"
  117. }
  118. ],
  119. resonValue: "1",
  120. options: [
  121. {
  122. value: "0",
  123. label: "策略原因"
  124. },
  125. {
  126. value: "1",
  127. label: "设备原因"
  128. },
  129. {
  130. value: "2",
  131. label: "其他"
  132. }
  133. ],
  134. auditArr: [],
  135. auditObj: {},
  136. value: "0",
  137. comment: "",
  138. souseArr: [],
  139. tableList: []
  140. };
  141. },
  142. components: {
  143. Head,
  144. AuditTable,
  145. uploadImg
  146. },
  147. mounted() {
  148. this.query();
  149. },
  150. methods: {
  151. quertName(id) {
  152. querySimpleInfo(id, {}).then(res => {
  153. this.auditObj.applyUser = res.realname;
  154. });
  155. },
  156. approvalOpinion(item, type) {
  157. let params = {
  158. postParams: {
  159. id: item.id,
  160. commit: type,
  161. comment: this.comment,
  162. roles: [1002],
  163. updateUser: "594e95e50abc4b6c9bdda985d313c1b9"
  164. }
  165. };
  166. updateWorkflow(params).then(res => {
  167. if (res.result == "success") {
  168. this.$message.success("操作成功");
  169. } else {
  170. this.$message.error("操作失败: " + res.message);
  171. }
  172. this.query();
  173. });
  174. },
  175. formatter(date) {
  176. return moment.unix(date / 1000).format("YYYY.MM.DD hh:mm");
  177. },
  178. formatter1(date) {
  179. return moment.unix(date / 1000).format("YYYY.MM.DD");
  180. },
  181. appealClick(item, index) {
  182. this.auditObj = item;
  183. this.quertName(item.applyUser);
  184. this.isactive = index;
  185. let params = {
  186. postParams: {
  187. criteria: {
  188. id: item.commandId
  189. }
  190. }
  191. };
  192. queryChillerExecuteInfo(params).then(res => {
  193. const list = res.data || [{}, {}, {}]
  194. this.tableList = Object.values(list[0]).map(i => i || {})
  195. this.tableList[0].title = '当前运行状态'
  196. this.tableList[1].title = '推送策略'
  197. this.tableList[2].title = '执行策略'
  198. });
  199. },
  200. query() {
  201. let params = {
  202. postParams: {
  203. criteria: {
  204. projectId: this.$store.state.projectId,
  205. trackerId: 3,
  206. status: 302
  207. },
  208. withColumns: ["customAttribute"]
  209. }
  210. };
  211. queryWorkflow(params).then(res => {
  212. this.auditArr = res.content ? res.content : [];
  213. if (this.auditArr.length > 0) {
  214. this.auditObj = this.auditArr[0];
  215. this.quertName(this.auditObj.applyUser);
  216. this.appealClick(this.auditObj,0)
  217. }
  218. });
  219. }
  220. }
  221. };
  222. </script>
  223. <style lang="scss" scoped>
  224. .appealBox {
  225. height: 100%;
  226. display: flex;
  227. .top {
  228. height: 100px;
  229. }
  230. .bottom {
  231. flex: 1;
  232. .appealContainer {
  233. height: 100%;
  234. display: flex;
  235. background: rgba(247, 249, 250, 1);
  236. border-top: 1px solid #e4e5e7;
  237. margin-top: 5px;
  238. .appeal-left {
  239. // flex: 1;
  240. height: 100%;
  241. display: flex;
  242. flex-direction: column;
  243. max-width: 460px;
  244. min-width: 350px;
  245. padding-left: 24px;
  246. .appeal-left-top {
  247. display: flex;
  248. justify-content: space-between;
  249. align-items: center;
  250. margin-bottom: 12px;
  251. padding-top: 112px;
  252. .appeal-left-top-span {
  253. height: 24px;
  254. font-size: 16px;
  255. color: rgba(31, 36, 41, 1);
  256. line-height: 21px;
  257. }
  258. }
  259. .appeal-left-box {
  260. flex: 1;
  261. overflow: scroll;
  262. margin-bottom: 24px;
  263. .date {
  264. height: 18px;
  265. font-size: 12px;
  266. color: rgba(141, 147, 153, 1);
  267. line-height: 16px;
  268. text-align: center;
  269. }
  270. .appeal-left-div {
  271. margin-bottom: 8px;
  272. padding: 16px 20px;
  273. background: rgba(255, 255, 255, 1);
  274. border-radius: 4px;
  275. border: 1px solid rgba(228, 230, 231, 1);
  276. .time {
  277. display: flex;
  278. justify-content: space-between;
  279. margin-bottom: 12px;
  280. span:nth-of-type(1) {
  281. height: 24px;
  282. font-size: 16px;
  283. font-family: PingFangSC-Regular, PingFang SC;
  284. font-weight: 400;
  285. color: rgba(31, 36, 41, 1);
  286. line-height: 22px;
  287. }
  288. span:nth-of-type(2) {
  289. display: flex;
  290. align-items: center;
  291. height: 22px;
  292. font-size: 14px;
  293. font-family: ArialMT;
  294. color: rgba(31, 36, 41, 1);
  295. line-height: 16px;
  296. img {
  297. width: 16px;
  298. height: 16px;
  299. margin-right: 6px;
  300. }
  301. }
  302. .content {
  303. span {
  304. display: block;
  305. height: 22px;
  306. font-size: 14px;
  307. font-family: PingFangSC-Regular, PingFang SC;
  308. font-weight: 400;
  309. color: rgba(100, 108, 115, 1);
  310. line-height: 20px;
  311. }
  312. span:nth-of-type(2) {
  313. margin: 4px 0;
  314. }
  315. }
  316. }
  317. }
  318. .border {
  319. border: 1px solid rgba(0, 145, 255, 1);
  320. }
  321. }
  322. }
  323. .appeal-right {
  324. flex: 1;
  325. margin-left: 28px;
  326. height: 100%;
  327. display: flex;
  328. flex-direction: column;
  329. background: #fff;
  330. .title {
  331. height: 32px;
  332. font-size: 24px;
  333. color: rgba(31, 36, 41, 1);
  334. line-height: 32px;
  335. padding-top: 148px;
  336. text-align: center;
  337. }
  338. .detailContainer {
  339. flex: 1;
  340. overflow: scroll;
  341. min-width: 762px;
  342. padding: 0 100px;
  343. margin: 0 auto;
  344. padding-bottom: 24px;
  345. background: rgba(255, 255, 255, 1);
  346. margin-bottom: 100px;
  347. .nav {
  348. display: flex;
  349. justify-content: space-between;
  350. margin-top: 40px;
  351. margin-bottom: 12px;
  352. span {
  353. height: 22px;
  354. font-size: 14px;
  355. color: rgba(31, 36, 41, 1);
  356. line-height: 19px;
  357. }
  358. }
  359. .cont1 {
  360. height: 22px;
  361. font-size: 14px;
  362. color: rgba(31, 36, 41, 1);
  363. line-height: 19px;
  364. margin-bottom: 16px;
  365. }
  366. .cont2 {
  367. margin-bottom: 24px;
  368. height: 180px;
  369. }
  370. .cont3 {
  371. margin-bottom: 24px;
  372. span {
  373. display: block;
  374. }
  375. span:nth-of-type(1) {
  376. height: 24px;
  377. font-size: 16px;
  378. color: rgba(31, 36, 41, 1);
  379. line-height: 21px;
  380. margin-bottom: 8px;
  381. }
  382. span:nth-of-type(2) {
  383. height: 22px;
  384. font-size: 14px;
  385. color: rgba(100, 108, 115, 1);
  386. line-height: 19px;
  387. }
  388. }
  389. .cont4 {
  390. margin-bottom: 8px;
  391. span {
  392. display: block;
  393. }
  394. span:nth-of-type(1) {
  395. height: 24px;
  396. font-size: 16px;
  397. color: rgba(31, 36, 41, 1);
  398. line-height: 21px;
  399. }
  400. span:nth-of-type(2) {
  401. margin: 8px 0;
  402. }
  403. span:nth-of-type(3) {
  404. textarea {
  405. width: 762px;
  406. height: 64px;
  407. border-radius: 4px;
  408. border: 1px solid rgba(195, 199, 203, 1);
  409. color: rgba(195, 199, 203, 1);
  410. }
  411. }
  412. }
  413. }
  414. .opinion {
  415. box-sizing: border-box;
  416. background: rgba(247, 249, 250, 1);
  417. box-shadow: 0px -1px 8px 0px rgba(0, 0, 0, 0.08);
  418. position: absolute;
  419. bottom: 0px;
  420. padding: 16px 32px;
  421. .opinion-title {
  422. height: 24px;
  423. font-size: 16px;
  424. color: rgba(31, 36, 41, 1);
  425. line-height: 21px;
  426. margin-bottom: 8px;
  427. display: block;
  428. }
  429. .opinion-bottom {
  430. display: flex;
  431. align-items: center;
  432. input {
  433. width: 697px;
  434. height: 32px;
  435. background: rgba(255, 255, 255, 1);
  436. border-radius: 4px;
  437. border: 1px solid rgba(195, 199, 203, 1);
  438. margin-right: 32px;
  439. }
  440. span {
  441. display: inline-block;
  442. width: 80px;
  443. height: 32px;
  444. background: rgba(255, 255, 255, 1);
  445. border-radius: 4px;
  446. border: 1px solid rgba(195, 199, 203, 1);
  447. font-size: 14px;
  448. color: rgba(31, 35, 41, 1);
  449. line-height: 32px;
  450. text-align: center;
  451. cursor: pointer;
  452. }
  453. span:nth-of-type(1) {
  454. margin-right: 12px;
  455. }
  456. }
  457. }
  458. }
  459. }
  460. }
  461. }
  462. </style>