董国庆
2025-06-25 d8d68a0aee93073b5ec3195368ca0ed1076f66a2
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
<template>
    <div class="list">
        <TableCustom :queryForm="queryForm" :tableData="tableData" :total="total" :loading="loading" :height='null' @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.taskContent" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item class="search-btn-box">
                        <el-button @click="handleReset">重置</el-button>
                        <el-button type="primary" @click="getList">查询</el-button>
                    </el-form-item>
                </el-form>
            </template>
            <!-- 工艺工程师 -->
            <template #setting>
                <el-button v-if="roleType==3" @click="handleAdd" 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="taskContent" label="任务内容" />
                <el-table-column prop="taskTime" label="任务时间" />
                <el-table-column prop="createBy" label="添加人" />
                <el-table-column prop="evaluateScore" label="评定积分" />
                <el-table-column label="累计分数">
                  <template #default>
                    <!-- 累计分数接口未返回,留空或后端补充 -->
                  </template>
                </el-table-column>
                <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="detailType" :id="currentId" @close="closeDetail" />
    </div>
</template>
 
<script>
import Detail from './components/detail.vue'
import { pageList } from './service.js'
 
export default {
    name: 'RestsTask',
    components: {
        Detail
    },
    data() {
        return {
            form: {
                groupName: '',
                taskContent: ''
            },
            tableData: [],
            queryForm: {
                pageSize: 10,
                pageNum: 1
            },
            total: 0,
            assessmentVisible: false,
            detailType: '',
            currentId: null,
            loading: false,
            roleType:'',
        }
    },
    mounted() {
        this.getList();
        const userInfo = JSON.parse(sessionStorage.getItem('userInfo'));
        this.roleType = userInfo?.roleType;
    },
    methods: {
        handleCurrentChange(page) {
            this.queryForm.pageNum = page
            this.getList()
        },
        handleSizeChange(size) {
            this.queryForm.pageSize = size
            this.getList()
        },
        getList() {
            this.loading = true;
            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;
                }
            }).finally(() => {
                this.loading = false;
            });
        },
        handleReset() {
            this.form = {
                groupName: '',
                taskContent: ''
            };
            this.queryForm.pageNum = 1;
            this.getList();
        },
        closeDetail() {
            this.assessmentVisible = false;
            this.getList();
        },
        handleAdd() {
            this.detailType = 'add';
            this.currentId = null;
            this.assessmentVisible = true;
        },
        handleDetail(row) {
            if (!row || !row.id) return;
            this.detailType = 'detail';
            this.currentId = row.id;
            this.assessmentVisible = true;
        },
    }
}
</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>