su
su1124
2024-01-23 d33a1299a9e5f23641ef2d549b7bab26c91819cb
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
<template>
    <div>
        <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
            <h3 v-if="fList.proResult ">检测项目 :{{ fList.project.proName }}</h3>
            <h3 v-if="fList.proResult ">检测结果 :{{ fList.proResult }}{{fList.project.proMetering}}</h3>
            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
                <el-form-item label="病种名称" prop="bingzhong">
                    <el-input v-model="queryParams.bingzhong" placeholder="请输入简称" clearable
                        @keyup.enter.native="handleQuery" style="width: 120px;" />
                </el-form-item>
                <el-form-item label="拼音码" prop="bzPinyin">
                    <el-input v-model="queryParams.bzPinyin" placeholder="请输入拼音码" clearable
                        @keyup.enter.native="handleQuery" style="width: 130px;" />
                </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>
            <el-table :data="dataList" ref="multipleTable" v-loading="loading" @selection-change="handleSelectionChange"
                border height="320px
        ">
                <el-table-column type="selection" width="40" align="center" />
                <el-table-column label="序号" type="index" width="80px" />
                <el-table-column label="规则" align="center" prop="ruleStr" />
                <el-table-column label="病种名称" align="center" prop="bingzhong" />
            </el-table>
            <h3>已选项目</h3>
            <el-form :model="form" ref="queryForm" size="small" :inline="true" label-width="68px">
                <el-form-item>
                    <el-input type="textarea" v-model="form.desc" style="width: 560px"></el-input>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="open = false">取 消</el-button>
                <el-button type="primary" @click="handleOk">确 定</el-button>
            </span>
        </el-dialog>
 
    </div>
</template>
  
<script>
import {
    getlist, getlistByRuleStr
} from "@/api/doctor/check";
export default {
    name: 'Public',
 
    props: {
        row: {
            type: Object,
        }
 
    },
    data() {
        return {
            open: false,
            // 弹出层标题
            title: "",
            dataList: [],
            // 遮罩层
            loading: false,
            form: {
                desc: ""
            },
            queryParams: {
                bingzhong: "",
                bzPinyin: "",
            },
            list: [],
            fList: {}
        };
    },
    watch: {
        'row'(val, newVla) {
            // console.log(val,newVla)
            this.fList = val
            // if (this.fList) {
            //     this.getList()
            // }
        }
    },
    mounted() {
 
    },
 
    created() {
 
    },
    methods: {
        getList(row,date) {
            if (row.proId) {
                let fList = row
                // if (this.fList.proResult == "") {
                let data = {
                    proId: fList.proId,
                    // ruleStr: fList.proResult,
                }
                getlist(data).then(res => {
                    this.dataList = res.rows
                    this.$nextTick(() => {
                        this.dataList.forEach(item => {
                            this.fList.rulesList.forEach(item1 => {
                                if (item.aid == item1.aid) {
                                    this.$refs.multipleTable.toggleRowSelection(item, true);
                                }
                            })
                        })
                    })
 
                })
                // }else{
                //     let data = {
                //         proId: this.fList.proId,
                //         bingzhong: this.queryParams.bingzhong,
                //         ruleStr: this.fList.proResult,
                //     }
                //     getlistByRuleStr(data).then(res => {
                //         this.dataList = res.rows
                //         this.$nextTick(() => {
                //             this.dataList.forEach(item => {
                //                 this.fList.rulesList.forEach(item1 => {
                //                     if (item.aid == item1.aid) {
                //                         this.$refs.multipleTable.toggleRowSelection(item, true);
                //                     }
                //                 })
                //             })
                //         })
 
                //     })
                // }
            }else{
                let data = {
                    proId: row,
                }
                getlist(data).then(res => {
                    this.dataList = res.rows
                    // this.$nextTick(() => {
                    //     this.dataList.forEach(item => {
                    //         this.fList.rulesList.forEach(item1 => {
                    //             if (item.aid == item1.aid) {
                    //                 this.$refs.multipleTable.toggleRowSelection(item, true);
                    //             }
                    //         })
                    //     })
                    // })
 
                })
            }
 
 
        },
        handleQuery() {
            let data = {
                proId: this.fList.proId,
                bingzhong: this.queryParams.bingzhong,
                bzPinyin: this.queryParams.bzPinyin,
            }
            getlist(data).then(res => {
                this.dataList = res.rows
                this.$nextTick(() => {
                    this.dataList.forEach(item => {
                        this.fList.rulesList.forEach(item1 => {
                            if (item.aid == item1.aid) {
                                this.$refs.multipleTable.toggleRowSelection(item, true);
                            }
                        })
                    })
                })
 
            })
        },
        handleSelectionChange(selection) {
            this.list = []
            this.list = selection
            this.form.desc = ""
            this.list.forEach(element => {
                this.form.desc += element.bingzhong + ","
            });
        },
        handleOk() {
            this.open = false
            if (this.form.desc) {
                this.$emit('add', this.form.desc, this.list);
            }
            this.form.desc = ""
        }
    }
}
</script>
  
<style scoped></style>