qx
qx
2025-03-12 c140987b3ef6fd47e3b795fc3a2c6f880f49f9c2
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
<template>
  <div>
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body @close="quxiao">
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" @submit.native.prevent="handleQuery">
 
        <el-form-item label="内容" prop="xmg">
          <el-input v-model="queryParams.xmgz" placeholder="请输入内容" clearable  
            style="width: 130px;"  @keyup.enter.native="handleQuery"/>
        </el-form-item>
        <el-form-item>                                                                                                                                                                                                                                                                                                          
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        </el-form-item>
        <el-form-item label="检测结果" prop="xmg">
          <el-input
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 4 }"
            v-model="selectedContent"
            placeholder=""
            style="width: 400px;"
            clearable
 
          />
        </el-form-item>
      </el-form>
      <el-table :data="dataList" ref="elTable" v-loading="loading" border @selection-change="handleSelectionChange" style="max-height: 360px; overflow-y: auto;">
        <el-table-column type="selection" width="40" align="center" />
        <el-table-column label="标号" prop="aid" align="center" />
        <el-table-column label="结论值" prop="ruleStr" align="center" />
        <el-table-column label="参考范围" prop="reference" align="center" />      
        <el-table-column label="简码" prop="jm" align="center" />
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="quxiao">取 消</el-button>
        <el-button type="primary" @click="handleOk">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
 
<script>
import { selectZT } from "@/api/system/package";
export default {
  name: "Packages",
  props: {
    baogao: {
      type: Array,
    },
  },
  data() {
    return {
      open: false,
      proId: '',
      // 弹出层标题
      title: "",
      dataList: [],
      // 遮罩层
      loading: false,
      form: {
        desc: "",
      },
      list: [],
      fList: {},
      queryParams: { xmgz: '' }
    };
  },
 
  mounted() {
  },
  methods: {
    handleOk() {
        this.open = false
        this.$emit('add', this.list);
        this.list = [];  // 清空已选列表
        this.queryParams.xmgz = '';  // 清空查询参数
    },
    quxiao(){
      this.open = false
      this.queryParams = {
        xmgz: ''
      }
      this.list = [];  // 清空已选列表
    },
    handleQuery() {
      console.log(11111)
      this.loading = true;
      selectZT({
        proId: this.proId,
        xmgz: this.queryParams.xmgz
      }).then((res) => {
        if (res.data.length > 0) {
          console.log(33333)
          this.open = true
          this.dataList = res.data;
          this.loading = false;
        } else {
          console.log(2222)
          this.dataList = res.data;
          this.loading = false;
        }
      });
    },
    handleSelectionChange(selection) {
      this.list = selection
      console.log(this.list);
      
    },
    getList(row,date) {
      console.log(row)
     this.proId=row.proId
      this.loading = true;
      selectZT({
        proId: this.proId,
        xmgz: this.queryParams.xmgz
      }).then((res) => {
        if (res.data.length > 0) {
          this.open = true
          this.dataList = res.data;
          this.loading = false;
        } else {
          this.dataList = res.data;
          this.loading = false;
        }
      });
    },
  },
  computed: {
    selectedContent: {
      get() {
        return this.list.map(item => item.ruleStr).join(',');
      },
      set(value) {
        // 手动编辑时同步回list(需要根据实际数据结构调整)
        this.list = value.split(',').map(str => ({
          ...this.dataList.find(item => item.ruleStr === str.trim()),
          ruleStr: str.trim()
        })).filter(Boolean);
      }
    }
  },
};
</script>
 
<style scoped></style>