董国庆
8 天以前 0c9660562a03191d44fc779a889d3da0dc624b6d
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
<template>
    <div class="list">
        <TableCustom :queryForm="queryForm" :tableData="tableData" :height='null' :total="total" @currentChange="handleCurrentChange"
            @sizeChange="handleSizeChange">
            <template #search>
                <el-form :model="form" label-width="140px" inline>
                    <el-form-item label="项目组名称:">
                        <el-input v-model="form.teamName" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item label="试验内容:">
                        <el-input v-model="form.trialContent" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item class="search-btn-box">
                        <el-button @click="handleReset">重置</el-button>
                        <el-button type="primary" @click="handleSearch">查询</el-button>
                    </el-form-item>
                </el-form>
            </template>
            <template #setting>
                <el-button v-if="roleType==2" @click="handleAssessment" class="el-icon-plus" type="primary">
                    新增临床试验</el-button>
            </template>
            <template #table>
                <el-table-column prop="projectTeam" label="所属项目组" >
                    <template #default="{ row }">
                        <el-tag v-if="row.teamName" type="info">{{ row.teamName }}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="trialContent" label="临床试验内容" />
                <el-table-column prop="trialTime" label="临床试验时间" />
                <el-table-column prop="createBy" label="添加人" />
                <el-table-column prop="evaluateScore" label="评定积分" />
                <el-table-column prop="totalScore" label="累计分数" />
                <el-table-column prop="createTime" label="评定时间" />
                <el-table-column label="操作">
                    <template #default="{ row }">
                        <el-button type="text" @click="handleDetail(row)">详情</el-button>
                    </template>
                </el-table-column>
            </template>
        </TableCustom>
 
        <Detail :modelValue="assessmentVisible" :type="dialogType" :id="currentId" @close="closeDetail" />
    </div>
</template>
 
<script>
import Detail from './components/detail.vue'
import { pageList, getDetailByUserId } from './service.js'
 
export default {
    name: 'ClinicalTrial',
    components: {
        Detail
    },
    data() {
        return {
            form: {
                teamName: '',
                trialContent: ''
            },
            tableData: [],
            queryForm: {
                pageSize: 10,
                pageNum: 1
            },
            total: 0,
            assessmentVisible: false,
            dialogType: '',
            roleType: '',
            currentId: '',
        }
    },
    mounted() {
        const userInfo = JSON.parse(sessionStorage.getItem('userInfo'));
        this.roleType = userInfo?.roleType;
        this.getList();
    },
    methods: {
        handleCurrentChange(page) {
            this.queryForm.pageNum = page
            this.getList()
        },
        handleSizeChange(size) {
            this.queryForm.pageSize = size
            this.getList()
        },
        getList() {
            const params = { ...this.form, ...this.queryForm }
            pageList(params).then(res => {
                if(res && res.data) {
                    this.tableData = res.data.records || [];
                    this.total = res.data.total || 0;
                }
            })
        },
        handleSearch() {
            this.queryForm.pageNum = 1;
            this.getList();
        },
        handleReset() {
            this.form = { name: '', content: '' };
            this.queryForm.pageNum = 1;
            this.getList();
        },
        async openDialog(type, id = '') {
            this.dialogType = type;
            this.currentId = id;
            this.assessmentVisible = true;
        },
        handleDetail(row) {
            this.openDialog('detail', row.id);
        },
        handleAssessment() {
            this.openDialog('add');
        },
        closeDetail() {
            this.assessmentVisible = false;
            this.getList();
        },
    },
    watch: {
        assessmentVisible(val) {
            if (!val) {
                this.dialogType = '';
            }
        }
    }
}
</script>
 
<style scoped lang="less">
.list {
    height: 100%;
}
 
.top-box-integral {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 28px;
 
    &-card {
        flex: 1;
        background: #E8FAF6;
        box-shadow: 0px 10px 10px 0px rgba(0, 0, 0, 0.06);
        border-radius: 10px;
        padding: 21px 20px;
 
        &-title {
            font-family: 'SourceHanSansCN-Medium';
            font-size: 14px;
            color: rgba(0, 0, 0, 0.8);
        }
 
        &-num {
            font-family: 'SF Compact Display Black';
            text-align: center;
            font-weight: 900;
            font-size: 50px;
            color: #049C9A;
            line-height: 60px;
        }
    }
}
 
.tip-warring {
    margin-top: 20px;
    color: rgba(255, 73, 85, 1);
}
</style>