1
lkk
4 天以前 efb20e6757a3e40e34fdeb8c5a8c28bd9f8be8f7
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
<template>
    <div>
        <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" v-if="openone != 2"> 
                <el-form-item label="编码" prop="pacCode">
                    <el-input v-model="queryParams.pacCode" placeholder="请输入编码" clearable @keyup.enter.native="handleQuery"
                        style="width: 120px;" />
                </el-form-item>
                <el-form-item label="名称" prop="pacName">
                    <el-input v-model="queryParams.pacName" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"
                        style="width: 130px;" />
                </el-form-item>
                <el-form-item label="内容" prop="pacRemark">
                    <el-input v-model="queryParams.pacRemark" 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="elTable" v-loading="loading" @selection-change="handleSelectionChange" border
                height="320px">
                <el-table-column type="selection" width="40" align="center" />
                <el-table-column label="序号" prop="xh" align="center" />
                <el-table-column label="编码" align="center" prop="pacCode" />
                <el-table-column label="名称" align="center" prop="pacName" width="100px" />
                <el-table-column label="拼音码" align="center" prop="detail" width="100px" />
                <el-table-column label="内容" align="center" prop="pacRemark" />
                <el-table-column label="备注" align="center" prop="price" />
            </el-table>
            <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 {
    Packagestlist, newGetTjPat, getTjYxjcList
} from "@/api/system/package";
import { getConfigKey } from "@/api/system/config";
export default {
    name: 'Packages',
    props: {
        baogao: {
            type: Array,
        }
 
    },
    data() {
        return {
            open: false,
            openone: 0,
            // 弹出层标题
            title: "",
            dataList: [],
            // 遮罩层
            loading: false,
            form: {
                desc: ""
            },
            queryParams: {
                pacCode: "",
                pacName: "",
                pacRemark: "",
            },
            list: [],
            fList: {}
        };
    },
    watch: {
        'baogao'(val, newVla) {
            this.openone = 2
            // console.log(val, newVla)
            this.dataList = val
            // console.log(this.dataList);
 
        }
 
    },
    mounted() {
        // this.getList()
    },
 
    created() {
        // this.getList()
    },
    methods: {
        getbaogaoList() {
 
        },
        getAllList() {
            this.loading = true
            this.openone = 1
            newGetTjPat(this.queryParams).then(res => {
                this.dataList = res.data
                this.loading = false
            })
        },
        getList() {
            this.openone = 0
            this.loading = true
            Packagestlist(this.queryParams).then(res => {
                this.dataList = res.rows
                this.loading = false
            })
        },
        handleQuery() {
            if (this.openone == 0) {
                this.getList()
            } else if (this.openone == 1) {
                this.getAllList()
            } else if (this.openone == 2) {
                this.loading = true
                getTjYxjcList(this.queryParams).then(res => {
                    this.dataList = res.data
                    this.loading = false
                })
            }
        },
        handleSelectionChange(selection) {
            if (selection.length > 1) {
                this.$refs.elTable.clearSelection(); // 清空所有选择
                this.$refs.elTable.toggleRowSelection(selection.pop()); // 设置选择项
            }
            this.list = selection;
        },
        handleOk() {
            this.open = false
            if (this.list.length == 1) {
                if (this.openone == 2) {
                    let configKey = "pacsUrl";
                    getConfigKey(configKey).then((res) => {
                        window.open(res.msg+"?"+"colid0="+"202"+"&colvalue0="+this.list[0].xh+"&colid1="+"903"+"&colvalue1="+"2", "_blank");
                    });
                } else {
                    this.$emit('add', this.list);
                }
            }
 
        }
    }
}
</script>
  
<style scoped></style>