zouyu
2025-03-18 bc44c8e3c9d85691ce3fa73ef1300a6fae46e365
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<template>
  <div class="main_div" ref="fullScreenElement">
    <p
      style="
        font-size: 16px;
        padding-left: 20px;
        text-align: left;
        height: 60px;
        line-height: 60px;
      "
    >
      任务展示
    </p>
    <div class="search">
      <div class="search_thing" style="margin-left: 20px">
        <div class="search_input">
          <el-select
            :popper-append-to-body="false"
            v-model="sonLaboratory"
            placeholder="请选择实验室"
            style="width: 200px; padding-right: 1%"
            size="small"
          >
            <el-option
              v-for="item in sonLaboratoryList"
              :key="item.id"
              :label="item.label"
              :value="item.label"
            ></el-option>
          </el-select>
        </div>
      </div>
      <div class="search_thing" style="margin-left: 20px">
        <div class="search_input">
          <el-tooltip content="刷新">
            <el-button
              size="mini"
              icon="el-icon-refresh"
              circle
              @click="refresh"
            ></el-button>
          </el-tooltip>
          <!-- <svg
            t="1736422165720"
            style="padding-right: 1%"
            @click="refresh"
            class="icon"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="9562"
            width="16"
            height="16"
          >
            <path
              d="M1011.264 431.573333c-19.008-117.973333-77.589333-222.208-163.989333-298.368-0.170667-0.149333-0.341333-0.298667-0.490667-0.448-6.933333-6.101333-14.122667-11.989333-21.44-17.728-1.173333-0.917333-2.261333-1.877333-3.434667-2.773333-6.464-4.970667-13.098667-9.728-19.818667-14.4-2.197333-1.514667-4.309333-3.114667-6.528-4.608-5.909333-3.989333-12.010667-7.744-18.154667-11.52-3.157333-1.962667-6.293333-3.989333-9.536-5.866667-2.666667-1.557333-5.354667-3.093333-8.064-4.586667l162.794667-26.218667c11.648-1.877333 19.541333-12.842667 17.664-24.469333-1.877333-11.626667-12.885333-19.541333-24.448-17.664L696.64 38.229333c-10.944 1.770667-20.522667 7.701333-27.008 16.661333-6.506667 9.002667-9.109333 19.989333-7.338667 30.912L697.6 304.981333c1.685333 10.474667 10.752 17.941333 21.034667 17.941333 1.130667 0 2.261333-0.085333 3.413333-0.277333 11.626667-1.877333 19.541333-12.821333 17.664-24.448L705.322667 91.52c4.949333 2.282667 9.962667 4.522667 14.784 6.976 3.413333 1.706667 6.698667 3.562667 10.048 5.333333 5.504 2.944 11.029333 5.866667 16.405333 9.002667 2.581333 1.514667 5.077333 3.157333 7.637333 4.714667 5.952 3.626667 11.904 7.296 17.642667 11.2 1.685333 1.130667 3.285333 2.346667 4.970667 3.52 6.485333 4.501333 12.906667 9.088 19.114667 13.888 0.725333 0.554667 1.386667 1.152 2.112 1.706667 90.602667 70.912 152.256 173.632 171.114667 290.581333 3.797333 23.616 5.738667 47.104 5.909333 70.314667 1.685333 224.597333-161.024 423.573333-389.418667 460.352-11.626667 1.877333-19.541333 12.821333-17.664 24.448 1.685333 10.474667 10.752 17.941333 21.034667 17.941333 1.130667 0 2.261333-0.085333 3.413333-0.277333 8.597333-1.386667 17.130667-2.986667 25.536-4.8 235.968-50.389333 401.536-261.141333 399.744-497.962667C1017.536 483.093333 1015.445333 457.408 1011.264 431.573333z"
              p-id="9563"
            ></path>
            <path
              d="M431.616 12.778667c-32.085333 5.162667-63.168 13.418667-93.056 24.277333-1.152 0.426667-2.389333 0.704-3.541333 1.130667-40.682667 15.104-78.72 35.797333-113.941333 60.650667-45.184 31.872-85.568 70.912-118.912 117.034667-64.277333 88.96-97.28 193.92-95.872 301.674667 0.32 24.874667 2.474667 49.898667 6.506667 74.922667 0.021333 0.149333 0.064 0.298667 0.085333 0.448 2.346667 14.549333 5.525333 28.821333 9.088 42.944 0.896 3.605333 1.792 7.168 2.773333 10.730667 3.776 13.781333 7.978667 27.349333 12.864 40.64 0.874667 2.368 1.898667 4.693333 2.816 7.04 4.437333 11.541333 9.301333 22.826667 14.528 33.941333 1.557333 3.306667 3.072 6.656 4.693333 9.92 6.250667 12.565333 12.992 24.832 20.245333 36.8 1.472 2.410667 3.072 4.8 4.586667 7.189333 7.104 11.285333 14.634667 22.272 22.613333 32.938667 1.024 1.344 1.962667 2.773333 3.008 4.117333 9.258667 12.096 19.136 23.722667 29.461333 34.965333 1.109333 1.216 2.218667 2.368 3.349333 3.562667 21.546667 22.954667 45.290667 43.946667 71.04 62.677333 0.661333 0.469333 1.237333 1.045333 1.898667 1.514667 0.192 0.149333 0.426667 0.192 0.64 0.32 15.317333 11.008 31.296 21.184 47.936 30.506667l-163.029333 26.261333c-11.626667 1.877333-19.541333 12.821333-17.664 24.448 1.685333 10.474667 10.752 17.941333 21.034667 17.941333 1.130667 0 2.261333-0.085333 3.434667-0.277333l219.157333-35.306667c10.922667-1.749333 20.522667-7.637333 27.029333-16.618667 6.506667-9.002667 9.109333-19.989333 7.36-30.933333l-35.306667-219.178667c-1.877333-11.626667-12.821333-19.456-24.469333-17.642667-11.626667 1.898667-19.541333 12.864-17.642667 24.469333l34.432 206.656c-28.416-13.034667-55.061333-28.714667-79.722667-46.677333-23.594667-17.237333-45.248-36.394667-64.853333-57.216-1.066667-1.152-2.176-2.282667-3.242667-3.434667-9.450667-10.24-18.410667-20.885333-26.858667-31.872-1.002667-1.322667-1.92-2.666667-2.922667-4.010667-7.253333-9.664-14.058667-19.669333-20.501333-29.845333-1.429333-2.261333-2.944-4.501333-4.330667-6.784-6.634667-10.922667-12.757333-22.122667-18.474667-33.557333-1.514667-3.050667-2.922667-6.165333-4.394667-9.258667-4.757333-10.090667-9.173333-20.330667-13.184-30.784-0.853333-2.218667-1.834667-4.416-2.666667-6.677333-4.437333-12.117333-8.298667-24.533333-11.733333-37.098667-0.896-3.285333-1.749333-6.613333-2.581333-9.92-3.242667-12.885333-6.144-25.941333-8.298667-39.232-0.021333-0.170667-0.064-0.341333-0.085333-0.490667-4.906667-30.528-6.784-61.034667-5.696-91.242667 3.264-90.666667 33.194667-178.325333 87.509333-253.504 54.314667-75.178667 128.170667-131.136 213.205333-162.709333 28.352-10.517333 57.941333-18.325333 88.469333-23.253333 11.626667-1.877333 19.541333-12.821333 17.664-24.448C454.208 18.816 443.264 10.794667 431.616 12.778667z"
              p-id="9564"
            ></path>
          </svg> -->
        </div>
      </div>
      <div class="search_thing" style="margin-left: 20px">
        <div class="search_input">
          <el-tooltip
            content="全屏"
            v-if="!isFullScreen"
            :popper-options="{ rootBoundary: 'viewport' }"
          >
            <svg
              t="1736421647849"
              style="margin-top: 5px; cursor: pointer"
              @click="close"
              class="icon"
              viewBox="0 0 1024 1024"
              version="1.1"
              xmlns="http://www.w3.org/2000/svg"
              p-id="4240"
              width="16"
              height="16"
            >
              <path
                d="M145.066667 85.333333h153.6c25.6 0 42.666667-17.066667 42.666666-42.666666S324.266667 0 298.666667 0H34.133333C25.6 0 17.066667 8.533333 8.533333 17.066667 0 25.6 0 34.133333 0 42.666667v256c0 25.6 17.066667 42.666667 42.666667 42.666666s42.666667-17.066667 42.666666-42.666666V145.066667l230.4 230.4c17.066667 17.066667 42.666667 17.066667 59.733334 0 17.066667-17.066667 17.066667-42.666667 0-59.733334L145.066667 85.333333z m170.666666 563.2L162.133333 802.133333l-76.8 76.8V725.333333C85.333333 699.733333 68.266667 682.666667 42.666667 682.666667s-42.666667 17.066667-42.666667 42.666666v256c0 25.6 17.066667 42.666667 42.666667 42.666667h256c25.6 0 42.666667-17.066667 42.666666-42.666667s-17.066667-42.666667-42.666666-42.666666H145.066667l76.8-76.8 153.6-153.6c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0z m665.6 34.133334c-25.6 0-42.666667 17.066667-42.666666 42.666666v153.6l-76.8-76.8-153.6-153.6c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733334l153.6 153.6 76.8 76.8H725.333333c-25.6 0-42.666667 17.066667-42.666666 42.666666s17.066667 42.666667 42.666666 42.666667h256c25.6 0 42.666667-17.066667 42.666667-42.666667v-256c0-25.6-17.066667-42.666667-42.666667-42.666666z m0-682.666667h-256c-25.6 0-42.666667 17.066667-42.666666 42.666667s17.066667 42.666667 42.666666 42.666666h153.6l-76.8 76.8-153.6 153.6c-17.066667 17.066667-17.066667 42.666667 0 59.733334 17.066667 17.066667 42.666667 17.066667 59.733334 0l153.6-153.6 76.8-76.8v153.6c0 25.6 17.066667 42.666667 42.666666 42.666666s42.666667-17.066667 42.666667-42.666666v-256c0-25.6-17.066667-42.666667-42.666667-42.666667z"
                fill="#2c2c2c"
                p-id="4241"
              ></path>
            </svg>
          </el-tooltip>
          <el-tooltip content="取消全屏" v-else>
            <svg
              t="1736421840887"
              @click="close"
              style="margin-top: 5px; cursor: pointer"
              class="icon"
              viewBox="0 0 1028 1024"
              version="1.1"
              xmlns="http://www.w3.org/2000/svg"
              p-id="8360"
              width="16"
              height="16"
            >
              <path
                d="M631.874913 676.029564v307.086828a39.857982 39.857982 0 0 0 79.715964 0v-221.853699l250.818816 249.863922a38.054293 38.054293 0 0 0 53.933826-53.721628l-250.818816-249.863922h222.808593a39.681149 39.681149 0 1 0 0-79.397665h-308.25392a43.712924 43.712924 0 0 0-48.204463 47.886164z m-280.137597-46.719071H43.483396a39.716516 39.716516 0 1 0 0 79.397665h222.808593L15.437806 958.430614a38.054293 38.054293 0 1 0 53.933826 53.721627l250.818816-249.863922v221.853699a39.857982 39.857982 0 0 0 79.715964 0v-307.086827c-2.511017-32.537128-18.850314-47.709332-48.169096-47.709332z m325.831042-234.691718h308.25392a39.716516 39.716516 0 1 0 0-79.397666h-222.808593l250.818816-249.863922A38.054293 38.054293 0 0 0 959.898675 11.63556L709.256691 261.711681V39.857982a39.857982 39.857982 0 0 0-79.715963 0V346.944809a44.773917 44.773917 0 0 0 48.062997 47.709332zM397.395394 347.935069V40.848242a39.857982 39.857982 0 0 0-79.715963 0v221.853699L66.860615 12.838019A38.054293 38.054293 0 0 0 12.926789 66.559646l250.818816 249.863922h-222.808593a39.716516 39.716516 0 1 0 0 79.397666h308.25392c31.865165-1.167093 48.204462-16.339297 48.204462-47.886165z"
                p-id="8361"
              ></path>
            </svg>
          </el-tooltip>
        </div>
      </div>
    </div>
    <div class="tableShow">
      <el-table
        border
        :data="tableData"
        style="width: 100%"
        :height="tableHeight+''"
        :header-cell-style="{ textAlign: 'center' }"
        :cell-style="{ textAlign: 'center' }"
      >
        <el-table-column
          prop="entrustCode"
          label="委托单号"
          width="170"
          min-width="170"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="sample"
          label="样品名称"
          min-width="180"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="company"
          label="委托单位"
          width="160"
          min-width="160"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="createTime"
          label="委托时间"
          width="110"
          min-width="110"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column label="样品状态">
          <el-table-column
            prop="state"
            label="测试"
            width="90"
            min-width="90"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="insState"
            label="复核"
            width="90"
            min-width="90"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="code"
            label="报告"
            width="90"
            min-width="90"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="isExamine"
            label="审核"
            width="90"
            min-width="90"
            show-overflow-tooltip
          >
          </el-table-column>
          <el-table-column
            prop="isRatify"
            label="批准"
            width="90"
            min-width="90"
            show-overflow-tooltip
          >
          </el-table-column>
        </el-table-column>
        <el-table-column
          prop="name"
          label="检测人"
          width="100"
          min-width="100"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="type"
          label="紧急程度"
          width="100"
          min-width="100"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <el-tag v-if="scope.row.type === '紧急'" type="danger">紧急</el-tag>
            <el-tag v-else-if="scope.row.type === '普通'" type="success"
              >普通</el-tag
            >
            <el-tag v-else type="warning">{{ scope.row.type }}</el-tag>
          </template>
        </el-table-column>
      </el-table>
      <div
        style="
          margin-top: 10px;
          display: flex;
          justify-content: flex-end;
          align-items: flex-end;
        "
      >
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="page.current"
          :page-sizes="[20, 40, 60, 80, 100]"
          :page-size="20"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>
 
<script>
import { getDicts } from "@/api/system/dict/data";
 
import {
  tasksShow
} from "../../../api/business/inspectionTask";
 
export default {
  data() {
    return {
      isFullScreen: false,
      sFullScreen: false,
      sonLaboratory: "",
      sonLaboratoryList: [],
      intervalId: null,
      total: 0,
      page: {
        current: 1,
        size: 20,
      },
      tableData: [],
      tableHeight: "",
    };
  },
  watch: {
    sonLaboratory: function (val) {
      this.getTableData();
    },
  },
  created() {
    this.handlerResize();
    // 查询字典
      getDicts('sys_sub_lab').then((res) => {
        let list = [];
        res.data.forEach(item => {
          let data = {
            label: item.dictLabel,
            value: item.dictValue,
          }
          list.push(data);
        });
        this.sonLaboratoryList = list;
        // 默认选中第一个
        this.sonLaboratory = this.sonLaboratoryList[0].label;
        this.getTableData();
      });
  },
  mounted() {
    // 每三分钟刷新一次
    this.intervalId = setInterval(() => {
      this.getTableData();
    }, 3 * 60 * 1000);
    window.addEventListener("resize", this.handlerResize);
    document.addEventListener("fullscreenchange", this.onFullScreenChange);
    document.addEventListener(
      "webkitfullscreenchange",
      this.onFullScreenChange
    );
    document.addEventListener("mozfullscreenchange", this.onFullScreenChange);
    document.addEventListener("msfullscreenchange", this.onFullScreenChange);
  },
  beforeDestroy() {
    if (this.intervalId) {
      clearInterval(this.intervalId);
    }
    window.removeEventListener("resize", this.handlerResize);
    document.removeEventListener("fullscreenchange", this.onFullScreenChange);
    document.removeEventListener(
      "webkitfullscreenchange",
      this.onFullScreenChange
    );
    document.removeEventListener(
      "mozfullscreenchange",
      this.onFullScreenChange
    );
    document.removeEventListener("msfullscreenchange", this.onFullScreenChange);
  },
  methods: {
    //动态获取表格高度
    handlerResize() {
      this.tableHeight = window.innerHeight - 50 - 46 - 60 - 80  - 30 - 30 - 32;
    },
    // 关闭
    close() {
      console.log("关闭");
      const element = this.$refs.fullScreenElement; // 指定要全屏的元素
      if (this.isFullScreen) {
        this.exitFullScreen();
      } else {
        this.enterFullScreen(element);
      }
    },
    enterFullScreen(element) {
      if (element.requestFullscreen) {
        element.requestFullscreen();
      } else if (element.webkitRequestFullScreen) {
        element.webkitRequestFullScreen();
      } else if (element.mozRequestFullScreen) {
        element.mozRequestFullScreen();
      } else if (element.msRequestFullscreen) {
        element.msRequestFullscreen();
      }
      this.isFullScreen = true;
    },
    exitFullScreen() {
      if (document.exitFullscreen) {
        document.exitFullscreen();
      } else if (document.webkitCancelFullScreen) {
        document.webkitCancelFullScreen();
      } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
      } else if (document.msExitFullscreen) {
        document.msExitFullscreen();
      }
      this.isFullScreen = false;
    },
    onFullScreenChange() {
      this.isFullScreen = !!(
        document.fullscreenElement ||
        document.webkitFullscreenElement ||
        document.mozFullScreenElement ||
        document.msFullscreenElement
      );
    },
    refresh() {
      this.getTableData();
    },
    handleSizeChange(val) {
      this.page.size = val;
      this.getTableData();
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      this.page.current = val;
      this.getTableData();
      console.log(`当前页: ${val}`);
    },
    getTableData() {
      this.loading = true;
      let data = {
        current: this.page.current,
        size: this.page.size,
        sonLaboratory: this.sonLaboratory,
      };
        tasksShow(data).then((res) => {
          this.total = res.data.total;
          let data = res.data.records.filter(item => {
            if(item.state == '已检验' && item.insState == '复核通过' && item.code == '已生成' && item.is_examine == '通过' && item.is_ratify == '已批准'){
              return false;
            }else{
              return true;
            }
          })
          this.tableData = data;
          this.loading = false;
        });
    },
  },
  computed: {},
};
</script>
 
<style scoped>
.search {
  background-color: #fff;
  height: 80px;
  margin-bottom: 10px;
  padding-right: 20px;
  border-radius: 3px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
 
.search_thing {
  display: flex;
  align-items: center;
  height: 50px;
}
 
.search_input {
  width: calc(100% - 100px);
}
.main_div {
  background-color: #f5f7fb;
  z-index: 2000;
}
.tableShow {
  width: calc(100% - 40px);
  height: calc(100% - 60px - 80px - 40px);
  background-color: #fff;
  border-radius: 3px;
  padding: 20px;
}
</style>