consultInfo.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div>
  3. <NavBar />
  4. <div class="bigBox">
  5. <van-row>
  6. <van-col span="24">
  7. <div class="textTitle">任务名称:{{ taskData?.taskName }}</div>
  8. </van-col>
  9. <van-col span="24">
  10. <div class="text">调阅开始时间:{{ taskData?.taskStartTime }}</div>
  11. </van-col>
  12. </van-row>
  13. <div v-if="taskData?.coreMonitoringTaskRegistrationMonitorVOList">
  14. <!-- 调阅列表 -->
  15. <div class="topBox" v-for="item in taskData.coreMonitoringTaskRegistrationMonitorVOList" :key="item.id">
  16. <!-- //主机列表组件 -->
  17. <MonitoingList :list="item"></MonitoingList>
  18. </div>
  19. </div>
  20. <!-- 底部按钮 -->
  21. <div class="bottomClass">
  22. <van-row>
  23. <van-col span="24">
  24. <van-button type="info" @click="addInfoHandler">添加调阅记录</van-button>
  25. </van-col>
  26. </van-row>
  27. <van-row>
  28. <van-col span="24">
  29. <van-button type="info" @click="endMontor">结束调阅</van-button>
  30. </van-col>
  31. </van-row>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import NavBar from '@/components/NavBar'
  38. // 主机列表组件
  39. import MonitoingList from './monitoringList.vue'
  40. import { Col, Row, Dialog, Icon, Picker } from 'vant'
  41. import { registrationList,getEndInfo, login } from '@/api/toConsult.js'
  42. export default {
  43. data() {
  44. return {
  45. taskData: {}
  46. }
  47. },
  48. components: {
  49. NavBar,
  50. Dialog,
  51. Icon,
  52. Picker,
  53. Col,
  54. Row,
  55. MonitoingList
  56. },
  57. created() {
  58. this.init()
  59. console.log(this);
  60. },
  61. methods: {
  62. //项目初始化获取数据
  63. init() {
  64. registrationList({ taskId: this.$route.params.id }).then(res => {
  65. let { code, data, msg } = res
  66. if (code == 200) {
  67. this.taskData = data
  68. }
  69. })
  70. },
  71. addInfoHandler() {
  72. console.log(this.taskData);
  73. this.$router.push('/addInfo/'+this.$route.params.id+'_'+this.taskData.id+'_add')
  74. },
  75. //结束调阅
  76. endMontor(){
  77. let startDate=JSON.parse(JSON.stringify(this.taskData.taskStartTime))
  78. console.log(startDate);
  79. startDate=Date.parse(new Date(startDate))
  80. let endDate=Date.parse(new Date())
  81. if((endDate-startDate)<=3600000){
  82. Dialog({message:'该调阅未满一个小时请确认'})
  83. }
  84. startDate=new Date(startDate)
  85. getEndInfo({
  86. id:this.taskData.id,
  87. taskId:this.$route.params.id
  88. }).then(res=>{
  89. this.$router.push('/monitoringCall')
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .bigBox {
  97. height: calc(100vh - 260px);
  98. overflow: scroll;
  99. // height: 100vh;
  100. background-color: #f2f2f2;
  101. .textTitle {
  102. font-size: 40px;
  103. font-weight: bold;
  104. padding: 20px;
  105. }
  106. .text {
  107. padding: 20px;
  108. font-size: 26px;
  109. }
  110. .topBox {
  111. margin-bottom: 10px;
  112. margin: 20px;
  113. }
  114. .bottomClass {
  115. position: fixed;
  116. width: 100%;
  117. bottom: 0%;
  118. }
  119. .van-button {
  120. width: 100%;
  121. margin-top: 10px;
  122. border-radius: 10px;
  123. }
  124. }
  125. </style>