appealDetail.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <div>
  3. <Head :headText='headText'></Head>
  4. <div class='nav-right'>
  5. <el-button type='info' plain size='mini' @click='back'>返回</el-button>
  6. <el-button type='primary' v-if='type==1' @click='submission' size='mini'>提交</el-button>
  7. </div>
  8. <div class='detailContainer' v-if='Object.keys(detailObj).length>0'>
  9. <div class='title Micbold'>未执行申诉单</div>
  10. <div class='nav MicrYaHei'>
  11. <span>项目名称:{{localName}}</span>
  12. <span>申请人:{{ $store.state.userInfo.username}}</span>
  13. <span>申请时间:{{dateNow||'--'}}</span>
  14. </div>
  15. <div
  16. class='cont1 MicrYaHei'
  17. >申诉未执行指令:{{formatterStr(detailObj.recommend.date)}} {{formatterStr1(detailObj.recommend.time)}} {{detailObj.title||'--'}}</div>
  18. <div class='cont2'>
  19. <audit-table :tableList='tableList'></audit-table>
  20. </div>
  21. <div class='cont3'>
  22. <span class='Micbold'>策略评价</span>
  23. <span class='MicrYaHei'>{{detailObj.recommend.evaluateStrategy||detailObj.recommend.remarks||'--'}}</span>
  24. </div>
  25. <div class='cont4'>
  26. <span class='Micbold'>申请原因</span>
  27. <span>
  28. <el-select size='mini' v-model='detailObj.reasonType' placeholder='请选择'>
  29. <el-option v-for='item in options' :key='item.value' :label='item.label' :value='item.label'></el-option>
  30. </el-select>
  31. </span>
  32. <span>
  33. <textarea placeholder='填写申请原因' v-model='detailObj.reason'></textarea>
  34. </span>
  35. </div>
  36. <div class='foot'>
  37. <upload-img :souseArr='detailObj.pics'></upload-img>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. var moment = require('moment')
  44. import 'moment/locale/zh-cn'
  45. import Head from '../main/index'
  46. import AuditTable from '../audit/auditTable'
  47. import UploadImg from '../../components/uploadImg'
  48. import { queryWorkflow, querySimpleInfo, queryChillerExecuteInfo } from '@/api/appeal/appeal.js'
  49. import { updateWorkflow } from '@/api/audit/audit.js'
  50. export default {
  51. data() {
  52. return {
  53. headText: '申诉审核',
  54. reason: '',
  55. options: [
  56. {
  57. value: '0',
  58. label: '策略原因'
  59. },
  60. {
  61. value: '1',
  62. label: '设备原因'
  63. },
  64. {
  65. value: '2',
  66. label: '其他'
  67. }
  68. ],
  69. value: '',
  70. detailObj: {},
  71. souseArr: [],
  72. appealId: '',
  73. commandId: '',
  74. tableList: [],
  75. dateNow: '',
  76. applyUser: '',
  77. localName: '',
  78. type: ''
  79. }
  80. },
  81. components: {
  82. Head,
  83. AuditTable,
  84. UploadImg
  85. },
  86. methods: {
  87. formatterStr(str) {
  88. if (str) {
  89. return str.substring(0, 4) + '.' + str.substring(4, 6) + '.' + str.substring(6, 8)
  90. }
  91. },
  92. formatterStr1(str) {
  93. if (str) {
  94. return str.substring(0, 2) + ':' + str.substring(2, 4)
  95. }
  96. },
  97. quertName(id) {
  98. querySimpleInfo(id, {}).then(res => {
  99. this.applyUser = res.realname
  100. })
  101. },
  102. back() {
  103. this.$router.push('/appeal')
  104. },
  105. queryDetail(commandId) {
  106. let params = {
  107. postParams: {
  108. criteria: {
  109. id: commandId
  110. }
  111. }
  112. }
  113. queryChillerExecuteInfo(params).then(res => {
  114. const list = res.data || [{}, {}, {}]
  115. this.tableList = Object.values(list[0]).map(i => i || {})
  116. this.tableList[0].title = '当前运行状态'
  117. this.tableList[1].title = '推送策略'
  118. this.tableList[2].title = '执行策略'
  119. })
  120. },
  121. submission() {
  122. // this.detailObj.applyUser
  123. let params = {
  124. postParams: {
  125. id: this.detailObj.id,
  126. commit: 'apply',
  127. updateUser: this.$store.state.userInfo.userId, //申请人
  128. applyUser: this.$store.state.userInfo.userId, //申请人
  129. // judgement:
  130. // this.detailObj.recommend.evaluateStrategy ||
  131. // this.detailObj.recommend.remarks ||
  132. // "", //策略评价
  133. reasonType: this.detailObj.reasonType, //申诉原因类型:策略原因;设备原因;其他
  134. reason: this.detailObj.reason, //具体申诉原因
  135. pics: this.detailObj.souseArr
  136. }
  137. }
  138. // console.log(params);
  139. // return;
  140. updateWorkflow(params).then(res => {
  141. if (res.result == 'success') {
  142. this.$message.success('申诉成功')
  143. } else {
  144. this.$message.error('申诉失败: ' + res.message)
  145. }
  146. this.$router.push('/appeal')
  147. })
  148. }
  149. },
  150. mounted() {
  151. this.detailObj = JSON.parse(this.$route.query.item)
  152. this.type = this.$route.query.type
  153. this.dateNow = moment()
  154. .locale('zh-cn')
  155. .format('YYYY.MM.DD')
  156. if (Object.keys(this.detailObj).length > 0) {
  157. console.log(this.detailObj)
  158. // return;
  159. this.quertName(this.detailObj.applyUser)
  160. let projects = this.$store.state.projects.projects
  161. projects.forEach(el => {
  162. if (this.detailObj.projectId == el.id) {
  163. this.localName = el.localName
  164. }
  165. })
  166. }
  167. }
  168. }
  169. </script>
  170. <style lang="scss" scoped>
  171. .nav-right {
  172. height: 48px;
  173. position: fixed;
  174. right: 24px;
  175. top: 53px;
  176. z-index: 1;
  177. display: flex;
  178. align-items: center;
  179. }
  180. .detailContainer {
  181. max-width: 762px;
  182. width: 60%;
  183. margin: 0 auto;
  184. padding-top: 36px;
  185. padding-bottom: 24px;
  186. .title {
  187. height: 32px;
  188. font-size: 24px;
  189. color: rgba(31, 36, 41, 1);
  190. line-height: 32px;
  191. text-align: center;
  192. }
  193. .nav {
  194. display: flex;
  195. justify-content: space-between;
  196. margin-top: 40px;
  197. margin-bottom: 12px;
  198. span {
  199. height: 22px;
  200. font-size: 14px;
  201. color: rgba(31, 36, 41, 1);
  202. line-height: 19px;
  203. }
  204. }
  205. .cont1 {
  206. height: 22px;
  207. font-size: 14px;
  208. color: rgba(31, 36, 41, 1);
  209. line-height: 19px;
  210. margin-bottom: 16px;
  211. }
  212. .cont2 {
  213. margin-bottom: 24px;
  214. height: 180px;
  215. }
  216. .cont3 {
  217. margin-bottom: 24px;
  218. span {
  219. display: block;
  220. }
  221. span:nth-of-type(1) {
  222. height: 24px;
  223. font-size: 16px;
  224. color: rgba(31, 36, 41, 1);
  225. line-height: 21px;
  226. margin-bottom: 8px;
  227. }
  228. span:nth-of-type(2) {
  229. height: 22px;
  230. font-size: 14px;
  231. color: rgba(100, 108, 115, 1);
  232. line-height: 19px;
  233. }
  234. }
  235. .cont4 {
  236. margin-bottom: 8px;
  237. span {
  238. display: block;
  239. }
  240. span:nth-of-type(1) {
  241. height: 24px;
  242. font-size: 16px;
  243. color: rgba(31, 36, 41, 1);
  244. line-height: 21px;
  245. }
  246. span:nth-of-type(2) {
  247. margin: 8px 0;
  248. }
  249. span:nth-of-type(3) {
  250. textarea {
  251. width: 100%;
  252. // max-width: 762px;
  253. height: 64px;
  254. border-radius: 4px;
  255. border: 1px solid rgba(195, 199, 203, 1);
  256. color: rgba(195, 199, 203, 1);
  257. }
  258. }
  259. }
  260. .foot {
  261. // width: 112px;
  262. // height: 112px;
  263. // background: rgba(248, 249, 250, 1);
  264. // border: 1px solid red;
  265. }
  266. }
  267. </style>
  268. <style lang="scss">
  269. .detailContainer {
  270. .el-input--mini .el-input__inner {
  271. height: 32px;
  272. border: 1px solid rgba(195, 199, 203, 1);
  273. }
  274. }
  275. </style>