1
lkk
2025-06-05 8925a21e020cdaee64924f3243898c4d86038fa2
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
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      label-width="68px"
      @submit.native.prevent
    >
      <el-form-item label="体检号" prop="reportDoctorCode">
        <el-input
          ref="inputName"
          v-model="queryParams.tjNum"
          placeholder="请输入体检号"
          clearable
          @keyup.enter.native="handleQuery"
          style="width: 170px"
        />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          style="margin-right: 15px"
          >查询</el-button
        >
        <el-button
          icon="el-icon-refresh"
          type="primary"
          size="mini"
          @click="resetQuery"
          >重置</el-button
        >
        <el-button
          icon="el-icon-check"
          type="primary"
          size="mini"
          style="margin-right: 15px"
          @click="tongbu"
          >同步</el-button
        >
      </el-form-item>
    </el-form>
 
    <!-- <div class="table-title">
      <h3>检验记录</h3>
    </div> -->
    <div class="box">
      <div
        style="text-align: center; background-color: #aad8df; margin-top: 10px"
      >
        检验记录
        <!-- {{ item.parent || "" }} -->
      </div>
      <div>
        <el-table
          :data="exaLists"
          border
          style="width: 100%"
          @selection-change="handleSelectionChange"
          :header-cell-style="{ background: '#aad8df' }"
          height="350"
        >
          <el-table-column
            fixed
            type="selection"
            align="center"
            label="选择"
            width="40"
          >
          </el-table-column>
          <el-table-column
            label="姓名"
            align="center"
            prop="name"
            width="80px"
          />
          <el-table-column
            label="性别"
            align="center"
            prop="gender"
            width="80px"
          />
          <el-table-column
            label="年龄"
            align="center"
            prop="patientAge"
            width="80px"
          >
          </el-table-column>
          <el-table-column
            label="送检科室"
            align="center"
            prop="deptName"
            width="100px"
          />
 
          <el-table-column
            label="检验项目"
            align="center"
            prop="checkParts"
            width="350px"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="项目编号"
            align="center"
            prop="jcxmid"
            width="150px"
          />
          <el-table-column
            label="审核医师"
            align="center"
            prop="shys"
            width="150px"
          />
          <el-table-column
            label="报告时间"
            align="center"
            prop="examinationDate"
            width="150px"
            
          />
          <!-- :formatter="formatDate" -->
 
          <el-table-column
            label="门诊号"
            align="center"
            prop="mzh"
            width="140px"
          />
          <el-table-column
            label="申请单号"
            align="center"
            prop="brid"
            width="145px"
          />
          <el-table-column
            label="报告医师"
            align="center"
            prop="reportDoctorName"
            width="120px"
          />
          <el-table-column
            label="检验医师名"
            align="center"
            prop="checkDoctorName"
            width="120px"
          />
          <el-table-column align="center" label="检测项目" width="100px ">
            <template slot-scope="scope">
              <div>{{ scope.row.proName }}</div>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="proResult"
            label="检测结果"
            width="180"
          >
          </el-table-column>
          <el-table-column align="center" prop="company" label="单位">
            <!--    <template slot-scope="scope">
              <div v-if="scope.row.project != null">
                {{ scope.row.standard.company || "" }}
              </div>
              <div v-else>{{ scope.row.proAdvice }}</div>
            </template> -->
          </el-table-column>
          <el-table-column
            align="center"
            prop="conclusion"
            label="异常"
            width="180"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="tjStandardGtValue"
            label=" 参考范围"
          >
            <!--   <template slot-scope="scope">
              <div v-if="scope.row.project != null">
                {{
                  scope.row.standard.tjStandardGtValue ||
                  "/" + "-" + scope.row.standard.tjStandardLtValue ||
                  "/"
                }}
              </div>
            </template> -->
          </el-table-column>
        </el-table>
      </div>
    </div>
 
    <!--  <el-table
      id="ta"
      ref="tb"
      :data="exaLists"
      v-loading="loading"
      border
      max-height="350"
      @current-change="handleCurrentChange"
      @selection-change="handleSelectionChange"
      :row-class-name="tableRowClassName"
    >
      <el-table-column
        fixed
        type="selection"
        align="center"
        label="选择"
        width="40"
        :selectable="isSelectable"
      >
      </el-table-column>
 
      <el-table-column label="姓名" align="center" prop="name" width="80px" />
      <el-table-column label="性别" align="center" prop="gender" width="80px" />
      <el-table-column
        label="年龄"
        align="center"
        prop="patientAge"
        width="80px"
      >
      </el-table-column>
      <el-table-column
        label="送检科室"
        align="center"
        prop="deptName"
        width="100px"
      />
 
      <el-table-column
        label="检查项目"
        align="center"
        prop="checkParts"
        width="150px"
      />
      <el-table-column
        label="报告时间"
        align="center"
        prop="examinationDate"
        width="150px"
      />
 
      <el-table-column label="门诊号" align="center" prop="mzh" width="140px" />
      <el-table-column
        label="申请单号"
        align="center"
        prop="brid"
        width="145px"
      />
      <el-table-column
        label="结果状态"
        align="center"
        prop="diagnosis"
        width="150"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="报告医师"
        align="center"
        prop="reportDoctorName"
        width="120px"
      />
      <el-table-column
        label="检查医师名"
        align="center"
        prop="checkDoctorName"
        width="120px"
      />
 
      <el-table-column
        label="结果表现"
        align="center"
        prop="examination"
        :show-overflow-tooltip="true"
      />
    </el-table> -->
 
    <div class="table-title">
      <h3>体检记录</h3>
    </div>
    <el-table
      border
      height="350"
      ref="tab1"
      :data="checkList"
      v-loading="loading"
      style="width: 100%"
      @selection-change="handleSelectionChangeSecond"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column
        label="状态"
        align="center"
        prop="type"
        :show-overflow-tooltip="true"
        min-width="60"
      >
        <template slot-scope="scope">
          <span v-if="scope.row.type == '0'">未检</span>
          <span v-if="scope.row.type == '1'">已检</span>
          <span v-if="scope.row.type == '2'">弃检</span>
          <span v-if="scope.row.type == '3'">延期</span>
        </template>
      </el-table-column>
      <el-table-column
        label="科室"
        align="center"
        prop="deptName"
        min-width="115"
      />
      <el-table-column
        label="项目"
        align="center"
        prop="proName"
        min-width="160"
      />
      <el-table-column
        label="收费方式"
        align="center"
        prop="sffs"
        min-width="80"
      />
      <el-table-column
        label="是否收费"
        align="center"
        prop="isPay"
        min-width="80"
      />
      <el-table-column
        label="检验时间"
        align="center"
        prop="bcupdateTime"
        min-width="160"
      />
 
      <el-table-column
        label="最后修改时间"
        align="center"
        prop="zhupdateTime"
        min-width="160"
      />
    </el-table>
  </div>
</template>
  
  <script>
import { getlisList, getJyTjList, asyncPacs } from "@/api/doctor/pacsCheck";
import moment from "moment";
 
export default {
  dicts: ["dict_tj_status"],
  data() {
    return {
      dis: false,
      code: null,
      createTimeList: "",
      total: 0,
      loading: false,
      isSyncing: false,
      // 查询参数
      queryParams: {
        // page: 1,
        // pageSize: 20,
        name: null,
        start: null,
        end: null,
        tjNum: null,
      },
      // 绑定单选按钮
      checkStatus: "0",
      exaLists: [],
      selectedFirstTable: null, // 第一个表格选中行
      selectedSecondTable: [], // 第二个表格选中行
      // 表单参数
      form: {},
      clearTimeSet: null,
      tjNumbers: "",
      multipleSelection: "",
      tjnum: "",
      xiangmuList: [],
      checkList: [],
      tg: true,
      bh: true,
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    };
  },
 
  mounted() {
    this.$nextTick(() => {
      this.$refs.inputName.focus();
    });
  },
  methods: {
    handleDateChange(val) {
      if (val && val.length === 2) {
        this.queryParams.start = val[0]; // 设置开始时间
        this.queryParams.end = val[1]; // 设置结束时间
      } else {
        this.queryParams.start = null;
        this.queryParams.end = null;
      }
      console.log("Query Params:", this.queryParams);
    },
    /* formatDate(row) {
      if (!row.examinationDate) return "";
 
      // 使用 moment 解析指定格式的日期字符串
      const date = moment(row.examinationDate, "MM DD YYYY hh:mmA");
 
      if (!date.isValid()) return "无效日期";
 
      // 格式化为所需格式
      return date.format("YYYY-MM-DD HH:mm");
    }, */
    // isSelectable(row) {
    //   return !!row.mzh;
    // },
    tableRowClassName({ row }) {
      return !row.mzh ? "row-disabled" : "";
    },
 
    handleSelectionChange(val) {
      // console.log(val);
      /*  if (val.length > 1) {
        let del_row = val.shift();
        this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      console.log(val, 999); */
 
      if (val.length > 0) {
        // const selectedRow = val[0];
        // console.log(val[0], 555);
 
        this.selectedFirstTable = val;
        console.log("当前选中的行数据:", this.selectedFirstTable);
        this.fetchRightTableData(val);
      } else {
        this.selectedFirstTable = null;
        this.checkList = [];
      }
    },
    // 根据选中的行数据请求右边表格数据
    fetchRightTableData() {
      const code = queryParams.tjNum;
      // if (!code) return;
      getJyTjList(code).then((response) => {
        this.checkList = response.data;
        this.loading = false;
      });
    },
 
    handleSelectionChangeSecond(selectedRows) {
      this.selectedSecondTable = selectedRows;
      if (selectedRows.length > 1) {
        let del_row = selectedRows.shift();
        this.$refs.tab1.toggleRowSelection(del_row, false); //设置这一行取消选中
      }
      console.log("当前选中的行数据:", this.selectedSecondTable);
    },
    getList() {
      if (this.createTimeList) {
        this.queryParams.start = this.createTimeList[0];
        this.queryParams.end = this.createTimeList[1];
      } else if (this.createTimeList == null) {
        this.queryParams.start = null;
        this.queryParams.end = null;
      }
    },
 
    /** 搜索按钮操作 */
    handleQuery() {
      // this.queryParams.page = 1;
      this.loading = true;
      if (!this.queryParams.tjNum) {
        this.loading = false;
        this.$message.error("体检号不能为空");
        return; // 终止请求
      }
      getlisList(this.queryParams)
        .then((res) => {
          if (res.code == 200) {
            this.loading = false;
            this.exaLists = res.data;
            // const code = this.exaLists[0].mzh;
            const code = this.queryParams.tjNum;
            getJyTjList(code).then((response) => {
              this.checkList = response.data;
            });
          }
        })
        .catch((error) => {
          this.loading = false;
          this.$message.error(res.msg || "查询失败,请稍后重试");
        });
      this.getList();
    },
 
    /** 重置按钮操作 */
    resetQuery() {
      this.createTimeList = [];
      this.resetForm("queryForm");
      this.queryParams = {
        name: null,
        start: null,
        end: null,
        tjNum: null,
      };
 
      // 清空其他依赖数据
      this.checkList = [];
      this.exaLists = [];
    },
 
    handleCurrentChange(row) {
      this.currentRow = row;
      // console.log('当前选中的行:', row);
    },
 
    setTime() {
      //设置定时器
      this.clearTimeSet = setInterval(() => {
        this.$modal.closeLoading();
      }, 300000);
    },
    tongbu(row) {
      this.$modal.loading("正在同步,请稍候...");
      this.setTime();
      const requestData = {
        lis: this.selectedFirstTable.map((item) => ({
          ...item,
          tjNum: this.queryParams.tjNum,
        })),
        jcxmid: this.selectedFirstTable.jcxmid,
        shys: this.selectedFirstTable.shys,
        tj: this.selectedSecondTable[0], // 右侧表格选中数据
      };
 
      /*   if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
        this.$message.error("至少选一条数据!");
        return;
      } */
 
      asyncPacs(requestData)
        .then((res) => {
          if (res.code == 200) {
            this.fetchRightTableData(this.selectedFirstTable);
            clearInterval(this.clearTimeSet);
            this.clearTimeSet = null;
            this.$modal.closeLoading();
            this.$modal.msgSuccess("同步成功!");
          } else {
            this.$message.error(res.message || "同步失败,请稍后重试");
          }
        })
        .catch((error) => {
          clearInterval(this.clearTimeSet);
          this.clearTimeSet = null;
          this.$modal.closeLoading();
        });
    },
  },
};
</script>
  
  <style lang="scss" scoped>
#ta .el-table__header-wrapper .el-checkbox {
  display: none;
}
 
.el-table .warning-row {
  background: #e5f3ff !important;
}
::v-deep .el-table__body tr.current-row > td {
  background: #edf2fa !important;
}
 
.table-title {
  text-align: center;
  margin-bottom: 10px;
}
.row-disabled {
  color: #ccc; /* 设置禁用行的字体颜色 */
  pointer-events: none; /* 禁止鼠标操作 */
  background-color: #f5f5f5; /* 设置禁用行的背景色 */
}
 
.pag {
  width: 100%;
  display: flex;
  justify-content: center;
}
 
.pag1 {
  width: 30%;
}
</style>