processDisplay4.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div class="app-container">
  3. <div class="main-area">
  4. <div class="show-header">
  5. <div class="tag-list">
  6. <div class="tag-item">
  7. 工序扫码记录
  8. </div>
  9. </div>
  10. <div class="search-list">
  11. <div class="search-tab">
  12. <el-radio-group
  13. v-model="queryParams.status"
  14. @change="getList"
  15. >
  16. <el-radio-button label="2">已完成</el-radio-button>
  17. <el-radio-button label="1">进行中</el-radio-button>
  18. <el-radio-button label="">所有</el-radio-button>
  19. </el-radio-group>
  20. </div>
  21. <div class="search-input">
  22. <el-input
  23. placeholder="请输入订单号..."
  24. v-model="queryString"
  25. @keyup.enter.native="getList"
  26. >
  27. <el-button
  28. slot="append"
  29. @click="getList"
  30. icon="el-icon-search"
  31. ></el-button>
  32. </el-input>
  33. </div>
  34. </div>
  35. </div>
  36. <!--主体内容部分-->
  37. <div class="show-body" v-loading="loading">
  38. <template v-if="total > 0">
  39. <TaskListTotal v-for="(value, key,index) of tableData" :key="index + 1" :orderNumber="key" :cardData="value" :status="queryParams.status"></TaskListTotal>
  40. </template>
  41. <el-empty v-else description="暂无数据"></el-empty>
  42. <!--分页列表-->
  43. <pagination
  44. v-show="total > 0"
  45. :total="total"
  46. :page.sync="queryParams.pageNum"
  47. :limit.sync="queryParams.pageSize"
  48. @pagination="getList"
  49. :page-sizes="[50]"
  50. />
  51. </div>
  52. </div>
  53. </div>
  54. </template>
  55. <script>
  56. import TaskList from "./components/taskList.vue";
  57. import TaskListTotal from "./components/taskListTotal.vue";
  58. import {scanCodeMonitoringLogs,scanCodeMonitoringLogs2} from "@/api/amichi/ringScanInformation/index.js";
  59. export default {
  60. name: "ProgressShow",
  61. props: [],
  62. components: { TaskList,TaskListTotal },
  63. data() {
  64. return {
  65. queryString: "",
  66. total: 0,
  67. queryParams: {
  68. pageNum: 1,
  69. pageSize: 50,
  70. status: "1",
  71. },
  72. // 列表数据
  73. tableData: {
  74. }, //列表数据
  75. loading: true,
  76. intervalId: null, // 用于存储定时器 ID
  77. };
  78. },
  79. computed: {},
  80. methods: {
  81. // 获取列表数据
  82. getList() {
  83. this.loading = true;
  84. scanCodeMonitoringLogs2({ ...this.queryParams, orderNumber: this.queryString })
  85. .then(
  86. res => {
  87. if (res.code == 200) {
  88. this.tableData=res.data;
  89. // this.tableData.forEach((item) => {
  90. // this.$set(item, 'isExpanded', false);
  91. // });
  92. this.total = res.total;
  93. } else {
  94. this.$message.error("网络异常,请稍后再试");
  95. }
  96. this.loading=false;
  97. }
  98. );
  99. },
  100. },
  101. mounted() {
  102. this.getList();
  103. // 每 30 分钟调用一次 API
  104. // this.intervalId = setInterval(() => {
  105. // this.getList();
  106. // console.log("我执行了")
  107. // }, 1 * 60 * 1000); // 30 分钟 = 30 * 60 * 1000 毫秒
  108. },
  109. activated() {
  110. this.getList();
  111. },
  112. beforeDestroy() {
  113. // 组件销毁前清除定时器,防止内存泄漏
  114. if (this.intervalId) {
  115. clearInterval(this.intervalId);
  116. }
  117. },
  118. };
  119. </script>
  120. <style scoped lang="scss">
  121. .app-container {
  122. padding: 15px 15px;
  123. box-sizing: border-box;
  124. .main-area {
  125. box-shadow: 0 1px 15px 1px rgb(69 65 78 / 8%);
  126. background-color: #fff;
  127. .show-header {
  128. border-bottom: 1px solid #ebedf2;
  129. display: flex;
  130. align-items: center;
  131. justify-content: space-between;
  132. padding: 0px 20px 0px 20px;
  133. height: 50px;
  134. .tag-list {
  135. display: flex;
  136. align-items: center;
  137. .tag-item {
  138. display: flex;
  139. align-items: center;
  140. margin-right: 15px;
  141. font-size: 16px;
  142. .circle {
  143. width: 15px;
  144. height: 15px;
  145. background-color: rgb(104, 221, 104);
  146. border-radius: 50%;
  147. margin-right: 5px;
  148. }
  149. .icon {
  150. margin-right: 5px;
  151. }
  152. .current-node {
  153. display: inline-block;
  154. border: 2px solid #34bfa3;
  155. padding: 2px 5px;
  156. margin: 2px 40px 2px 10px;
  157. }
  158. }
  159. }
  160. .search-list {
  161. display: flex;
  162. .search-tab {
  163. margin-right: 20px;
  164. }
  165. }
  166. }
  167. .show-body {
  168. padding: 25px;
  169. }
  170. }
  171. }
  172. </style>