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
@@ -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) {
        'baogao'(val, newVla) {
            this.openone = 2
        //     console.log(val,newVla)
        //     this.fList = val
        //     console.log(this.fList);
            this.dataList = val
            // console.log(this.dataList);
        // }
        }
    },
    mounted() {
@@ -87,23 +89,30 @@
        // this.getList()
    },
    methods: {
        getbaogaoList() {
        },
        getAllList(){
            this.openone = true
            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,15 +121,21 @@
                this.$refs.elTable.toggleRowSelection(selection.pop()); // 设置选择项
            }
            this.list = selection;
            console.log(this.list)
        },
        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>