todayStrategy.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class='remarks'>
  3. <el-table :data='data' border style='width: 100%;' height='400'>
  4. <el-table-column type='index' width='50' label='序号'></el-table-column>
  5. <el-table-column prop='pushTime' label='策略推送时间' width='105'>
  6. <template
  7. slot-scope='{row}'
  8. >{{row.pushTime?timestamp2String(row.pushTime).slice(8,10)+":"+timestamp2String(row.pushTime).slice(10,12) : '--'}}</template>
  9. </el-table-column>
  10. <el-table-column prop='executeTime' label='策略执行时间' width='105'>
  11. <template slot-scope='{row}' v-if="row.onTime">{{row.onTime?row.onTime.slice(0,2)+":"+row.onTime.slice(2,4):"--"}}</template>
  12. <template slot-scope='{row}' v-else-if="row.offTime">{{row.offTime?row.offTime.slice(0,2)+":"+row.offTime.slice(2,4):"--"}}</template>
  13. <template slot-scope='{row}' v-else>{{row.executeTime?row.executeTime.slice(8,10)+":"+row.executeTime.slice(10,12):"--"}}</template>
  14. </el-table-column>
  15. <el-table-column prop label='冷水机组开启台数' min-width='85'>
  16. <template
  17. slot-scope='{row}'
  18. >{{Number(formatterRes(row.chillerNumSetL,true,0))+'&nbsp;大'+Number(formatterRes(row.chillerNumSetS,true,0))+'&nbsp;小'}}</template>
  19. </el-table-column>
  20. <el-table-column prop='chillWaterOutTempSet' label='出水温度设定值' min-width='75'>
  21. <template slot-scope='{row}'>{{formatterRes(row.chillWaterOutTempSet,false,1)}}</template>
  22. </el-table-column>
  23. <el-table-column prop label='冷冻泵开启台数' min-width='75'>
  24. <template
  25. slot-scope='{row}'
  26. >{{Number(formatterRes(row.coolPumpNumSetL,true,0))+'&nbsp;大'+Number(formatterRes(row.coolPumpNumSetS,true,0))+'&nbsp;小'}}</template>
  27. </el-table-column>
  28. <el-table-column prop label='冷却泵开启台数' min-width='75'>
  29. <template
  30. slot-scope='{row}'
  31. >{{Number(formatterRes(row.chillPumpNumSetL,true,0))+'&nbsp;大'+Number(formatterRes(row.chillPumpNumSetS,true,0))+'&nbsp;小'}}</template>
  32. </el-table-column>
  33. <el-table-column prop label='冷却塔开启组数' min-width='75'>
  34. <template
  35. slot-scope='{row}'
  36. >{{Number(formatterRes(row.coolTowerNumSetL,true,0))+'&nbsp;大'+Number(formatterRes(row.coolTowerNumSetS,true,0))+'&nbsp;小'}}</template>
  37. </el-table-column>
  38. <el-table-column prop='zip' label='通风策略' width='80'>
  39. <template slot-scope='{row}'>无</template>
  40. </el-table-column>
  41. <el-table-column label='执行情况' width='80'>
  42. <template slot-scope='{row}'>
  43. <div v-if='row.isExecuted==0' style='display: flex;align-items: center;'>
  44. <span style='display: inline-block;width:6px;height:6px;background:#F54E45;border-radius: 3px;margin-right: 5px;'></span>
  45. <span>未执行</span>
  46. </div>
  47. <div v-else style='display: flex;align-items: center;'>
  48. <span style='display: inline-block;width:6px;height:6px;background:#34C724;border-radius: 3px;margin-right: 5px;'></span>
  49. <span>已执行</span>
  50. </div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label='操作' width='90'>
  54. <template slot-scope='scope'>
  55. <el-button @click='handleClick(scope.row)' type='text' size='small'>备注</el-button>
  56. <el-button @click='dumpAduit(scope.row)' v-if='isShow(scope.row)' type='text' size='small'>申诉</el-button>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <el-dialog title='备注' :visible.sync='dialogVisible' width='30%'>
  61. <el-input type='textarea' :autosize='{ minRows: 2, maxRows: 4}' placeholder='请填写备注内容' v-model='remarks'></el-input>
  62. <span slot='footer' class='dialog-footer'>
  63. <el-button @click='dialogVisible = false'>关闭</el-button>
  64. <el-button type='primary' @click='saveCommand'>保存</el-button>
  65. </span>
  66. </el-dialog>
  67. </div>
  68. </template>
  69. <script>
  70. import { updateCommand } from '@/api/strategy/strategy.js'
  71. import { timestamp2String } from '@/utils/helper.js'
  72. import { queryWorkflow } from '@/api/appeal/appeal.js'
  73. export default {
  74. data() {
  75. return {
  76. timestamp2String,
  77. dialogVisible: false,
  78. remarks: '',
  79. row: '',
  80. newData: []
  81. }
  82. },
  83. props: ['data', 'idArr'],
  84. methods: {
  85. formatterRes(res, type, num) {
  86. if (res == '-9999') {
  87. return 'x'
  88. } else if (res == '-9998') {
  89. if (type) {
  90. return 0
  91. } else {
  92. return '--'
  93. }
  94. } else {
  95. if (res != undefined) {
  96. res = res.toFixed(num)
  97. } else {
  98. return '--'
  99. }
  100. return res
  101. }
  102. },
  103. isShow(data) {
  104. let isShow = false
  105. if (this.newData.length) {
  106. this.newData.forEach(el => {
  107. if (data.appealId == el.id) {
  108. if (el.status == 301 || el.status == 305) {
  109. isShow = true
  110. }
  111. }
  112. })
  113. }
  114. return isShow
  115. },
  116. appealsIng(id) {
  117. let params = {
  118. postParams: {
  119. criteria: {
  120. id: id
  121. },
  122. withColumns: ['customAttribute']
  123. }
  124. }
  125. queryWorkflow(params).then(res => {
  126. this.newData = res.content ? res.content : []
  127. console.log(res)
  128. // let arr = [];
  129. // arr = res.content ? res.content : [];
  130. // if (arr.length > 0) {
  131. // arr.forEach(item => {
  132. // arr.push(item.commandId);
  133. // this.newArr.push(item);
  134. // });
  135. // this.queryExecute(arr);
  136. // }
  137. })
  138. },
  139. handleClick(row) {
  140. console.log(row)
  141. this.row = row
  142. this.remarks = row.remarks
  143. this.dialogVisible = true
  144. },
  145. saveCommand(row) {
  146. this.dialogVisible = false
  147. let postParams = {
  148. id: this.row.id,
  149. remarks: this.remarks
  150. }
  151. updateCommand({ postParams }).then(res => {
  152. if (res.result == 'success') {
  153. this.$message.success('添加备注成功!')
  154. }
  155. })
  156. },
  157. dumpAduit(row) {
  158. console.log(row)
  159. this.$router.push({
  160. path: '/appeal/appealDetails',
  161. query: { item: JSON.stringify(row) }
  162. })
  163. }
  164. },
  165. mounted() {
  166. if (this.data && this.idArr) {
  167. this.appealsIng(this.idArr)
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang='scss' >
  173. .remarks {
  174. .el-dialog {
  175. margin-top: 30vh !important;
  176. z-index: 999999 !important;
  177. }
  178. }
  179. .v-modal {
  180. z-index: 1 !important;
  181. background: #fff !important;
  182. }
  183. </style>