influenceDialog.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <el-dialog
  3. :visible.sync="isShow.influence"
  4. :center="true"
  5. :width="width">
  6. <span slot="title">{{title}}</span>
  7. <div id="influenceDialog">
  8. <p class="influence-p">受元空间变化影响,部分业务空间需重新划分</p>
  9. <el-tabs type="border-card">
  10. <el-tab-pane v-for="(item,index) in tabsList" v-if="index == 0">
  11. <span slot="label">{{item.name}}</span>
  12. <p style="line-height:30px;font-size:20px;margin-bottom: 20px;">受影响的业务空间</p>
  13. <div v-for="i in mess">
  14. <p style="line-height:20px;margin-left:10px;">{{i.RoomLocalName || '--'}} - {{i.RoomLocalID || '--'}}</p>
  15. </div>
  16. </el-tab-pane>
  17. </el-tabs>
  18. </div>
  19. <span slot="footer" class="dialog-footer center">
  20. <el-button type="primary" @click="confirm">我知道了</el-button>
  21. </span>
  22. </el-dialog>
  23. </template>
  24. <script>
  25. import { getAllMess, deleteNotice } from "@/api/request";
  26. export default {
  27. props: {
  28. width: {
  29. type: String,
  30. default: "40%"
  31. },
  32. title: {
  33. type: String,
  34. default: "提示"
  35. },
  36. isShow: {
  37. type: Object
  38. },
  39. param: {
  40. type: Object
  41. },
  42. tabsList: {
  43. type: Array,
  44. default: []
  45. }
  46. },
  47. data() {
  48. return {
  49. data: null,
  50. proj: null,
  51. activeName: "1",
  52. allMess: [], //所有提示
  53. mess: [], //实际提示
  54. build: {}
  55. };
  56. },
  57. created() {
  58. this.getAllMess();
  59. },
  60. methods: {
  61. //我知道了
  62. confirm() {
  63. let ids = [];
  64. if (!!this.allMess[this.build.code]) {
  65. this.allMess[this.build.code].map(item => {
  66. ids.push(item.RoomID);
  67. });
  68. }
  69. let param = {
  70. data: {
  71. ids: ids
  72. },
  73. ProjId: this.$route.query.projId,
  74. secret: this.$route.query.secret
  75. };
  76. deleteNotice(param)
  77. .then(res => {
  78. if (res.data.Result == "success") {
  79. this.isShow.influence = false;
  80. } else {
  81. this.$message.error(res.data.ResultMsg);
  82. }
  83. })
  84. .catch(() => {
  85. this.$message.error("请求失败");
  86. });
  87. },
  88. getData(build) {
  89. this.build = build;
  90. this.mess = this.allMess[build.code];
  91. },
  92. getAllMess() {
  93. getAllMess({
  94. ProjId: this.$route.query.projId,
  95. secret: this.$route.query.secret
  96. })
  97. .then(res => {
  98. if (res.data.Result == "success") {
  99. // this.allMess = res.data.Content
  100. this.changeMsg(res.data.Content);
  101. console.log(this.allMess);
  102. } else {
  103. this.$message.error(res.data.ResultMsg);
  104. }
  105. })
  106. .catch(() => {
  107. this.$message.error("请求错误");
  108. });
  109. },
  110. //获取楼层信息
  111. changeMsg(arr) {
  112. arr.map(item => {
  113. if (!!this.allMess[item.location.floor]) {
  114. this.allMess[item.location.floor].push(item.infos);
  115. } else {
  116. this.allMess[item.location.floor] = [];
  117. this.allMess[item.location.floor].push(item.infos);
  118. }
  119. });
  120. },
  121. handleClick() {}
  122. }
  123. };
  124. </script>
  125. <style lang="less">
  126. #influenceDialog {
  127. .el-tabs__content {
  128. max-height: 200px;
  129. overflow-y: auto;
  130. }
  131. .influence-p {
  132. height: 40px;
  133. line-height: 40px;
  134. font-size: 17px;
  135. margin-bottom: 10px;
  136. }
  137. }
  138. </style>