qinxianzhangyao
2024-02-20 b19a3cd44a42730b0b3ffeb0359ff42c9d07cba5
src/components/Packages/index.vue
@@ -1,14 +1,14 @@
<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">
            <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-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-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
@@ -21,7 +21,7 @@
            <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="序号" 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" />
@@ -39,20 +39,21 @@
  
<script>
import {
    Packagestlist,newGetTjPat
    Packagestlist, newGetTjPat, getTjYxjcList
} from "@/api/system/package";
import { getConfigKey } from "@/api/system/config";
export default {
    name: 'Packages',
    // props: {
    //     row: {
    //         type: Object,
    //     }
    props: {
        baogao: {
            type: Array,
        }
    // },
    },
    data() {
        return {
            open: false,
            openone:false,
            openone: 0,
            // 弹出层标题
            title: "",
            dataList: [],
@@ -71,12 +72,13 @@
        };
    },
    watch: {
        // 'row'(val, newVla) {
        //     console.log(val,newVla)
        //     this.fList = val
        //     console.log(this.fList);
        'baogao'(val, newVla) {
            this.openone = 2
            // console.log(val, newVla)
            this.dataList = val
            // console.log(this.dataList);
        // }
        }
    },
    mounted() {
@@ -87,23 +89,30 @@
        // this.getList()
    },
    methods: {
        getAllList(){
            this.openone = true
        getbaogaoList() {
        },
        getAllList() {
            this.openone = 1
            newGetTjPat(this.queryParams).then(res => {
                this.dataList = res.data
            })
        },
        getList() {
            this.openone = false
            this.openone = 0
            Packagestlist(this.queryParams).then(res => {
                this.dataList = res.rows
            })
        },
        handleQuery() {
            if(this.openone == false){
            if (this.openone == 0) {
                this.getList()
            }else  if(this.openone == true){
            } else if (this.openone == 1) {
                this.getAllList()
            } else if (this.openone == 2) {
                getTjYxjcList(this.queryParams).then(res => {
                    this.dataList = res.data
                })
            }
        },
        handleSelectionChange(selection) {
@@ -112,14 +121,20 @@
                this.$refs.elTable.toggleRowSelection(selection.pop()); // 设置选择项
            }
            this.list = selection;
            console.log(this.list)
        },
        handleOk() {
            this.open = false
            if (this.list.length == 1) {
                this.$emit('add',this.list);
                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);
                }
            }
        }
    }
}