index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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. height: 100%;
  240. display: flex;
  241. flex-direction: column;
  242. max-width: 460px;
  243. min-width: 350px;
  244. padding-left: 20px;
  245. .appeal-left-top {
  246. display: flex;
  247. justify-content: space-between;
  248. align-items: center;
  249. margin-bottom: 12px;
  250. padding-top: 112px;
  251. .appeal-left-top-span {
  252. height: 24px;
  253. font-size: 16px;
  254. color: rgba(31, 36, 41, 1);
  255. line-height: 21px;
  256. }
  257. }
  258. .appeal-left-box {
  259. flex: 1;
  260. overflow: scroll;
  261. margin-bottom: 24px;
  262. .date {
  263. height: 18px;
  264. font-size: 12px;
  265. color: rgba(141, 147, 153, 1);
  266. line-height: 16px;
  267. text-align: center;
  268. }
  269. .appeal-left-div {
  270. margin-bottom: 8px;
  271. padding: 16px 20px;
  272. background: rgba(255, 255, 255, 1);
  273. border-radius: 4px;
  274. border: 1px solid rgba(228, 230, 231, 1);
  275. .time {
  276. display: flex;
  277. justify-content: space-between;
  278. margin-bottom: 12px;
  279. span:nth-of-type(1) {
  280. height: 24px;
  281. font-size: 16px;
  282. font-family: PingFangSC-Regular, PingFang SC;
  283. font-weight: 400;
  284. color: rgba(31, 36, 41, 1);
  285. line-height: 22px;
  286. }
  287. span:nth-of-type(2) {
  288. display: flex;
  289. align-items: center;
  290. height: 22px;
  291. font-size: 14px;
  292. font-family: ArialMT;
  293. color: rgba(31, 36, 41, 1);
  294. line-height: 16px;
  295. img {
  296. width: 16px;
  297. height: 16px;
  298. margin-right: 6px;
  299. }
  300. }
  301. .content {
  302. span {
  303. display: block;
  304. height: 22px;
  305. font-size: 14px;
  306. font-family: PingFangSC-Regular, PingFang SC;
  307. font-weight: 400;
  308. color: rgba(100, 108, 115, 1);
  309. line-height: 20px;
  310. }
  311. span:nth-of-type(2) {
  312. margin: 4px 0;
  313. }
  314. }
  315. }
  316. }
  317. .border {
  318. border: 1px solid rgba(0, 145, 255, 1);
  319. }
  320. }
  321. }
  322. .appeal-right {
  323. position: relative;
  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. overflow: auto;
  340. // min-width: 762px;
  341. padding: 0 100px;
  342. padding-bottom: 24px;
  343. background: rgba(255, 255, 255, 1);
  344. margin-bottom: 100px;
  345. .nav {
  346. display: flex;
  347. justify-content: space-between;
  348. margin-top: 40px;
  349. margin-bottom: 12px;
  350. span {
  351. height: 22px;
  352. font-size: 14px;
  353. color: rgba(31, 36, 41, 1);
  354. line-height: 19px;
  355. }
  356. }
  357. .cont1 {
  358. height: 22px;
  359. font-size: 14px;
  360. color: rgba(31, 36, 41, 1);
  361. line-height: 19px;
  362. margin-bottom: 16px;
  363. }
  364. .cont2 {
  365. margin-bottom: 24px;
  366. height: 180px;
  367. }
  368. .cont3 {
  369. margin-bottom: 24px;
  370. span {
  371. display: block;
  372. }
  373. span:nth-of-type(1) {
  374. height: 24px;
  375. font-size: 16px;
  376. color: rgba(31, 36, 41, 1);
  377. line-height: 21px;
  378. margin-bottom: 8px;
  379. }
  380. span:nth-of-type(2) {
  381. height: 22px;
  382. font-size: 14px;
  383. color: rgba(100, 108, 115, 1);
  384. line-height: 19px;
  385. }
  386. }
  387. .cont4 {
  388. margin-bottom: 8px;
  389. span {
  390. display: block;
  391. }
  392. span:nth-of-type(1) {
  393. height: 24px;
  394. font-size: 16px;
  395. color: rgba(31, 36, 41, 1);
  396. line-height: 21px;
  397. }
  398. span:nth-of-type(2) {
  399. margin: 8px 0;
  400. }
  401. span:nth-of-type(3) {
  402. textarea {
  403. width: 762px;
  404. height: 64px;
  405. border-radius: 4px;
  406. border: 1px solid rgba(195, 199, 203, 1);
  407. color: rgba(195, 199, 203, 1);
  408. }
  409. }
  410. }
  411. }
  412. .opinion {
  413. width: 100%;
  414. box-sizing: border-box;
  415. background: rgba(247, 249, 250, 1);
  416. box-shadow: 0px -1px 8px 0px rgba(0, 0, 0, 0.08);
  417. position: absolute;
  418. bottom: 0px;
  419. padding: 16px 32px;
  420. .opinion-title {
  421. height: 24px;
  422. font-size: 16px;
  423. color: rgba(31, 36, 41, 1);
  424. line-height: 21px;
  425. margin-bottom: 8px;
  426. display: block;
  427. }
  428. .opinion-bottom {
  429. display: flex;
  430. align-items: center;
  431. input {
  432. flex: 1;
  433. height: 32px;
  434. background: rgba(255, 255, 255, 1);
  435. border-radius: 4px;
  436. border: 1px solid rgba(195, 199, 203, 1);
  437. margin-right: 32px;
  438. }
  439. span {
  440. display: inline-block;
  441. width: 80px;
  442. height: 32px;
  443. background: rgba(255, 255, 255, 1);
  444. border-radius: 4px;
  445. border: 1px solid rgba(195, 199, 203, 1);
  446. font-size: 14px;
  447. color: rgba(31, 35, 41, 1);
  448. line-height: 32px;
  449. text-align: center;
  450. cursor: pointer;
  451. }
  452. span:nth-of-type(1) {
  453. margin-right: 12px;
  454. }
  455. }
  456. }
  457. }
  458. }
  459. }
  460. }
  461. </style>