appealDetails.vue 10 KB

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