From 7615cd178bddab96443504029285d65ea1e7d447 Mon Sep 17 00:00:00 2001 From: pyt <626651354@qq.com> Date: 星期五, 16 五月 2025 09:22:21 +0800 Subject: [PATCH] Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory --- laboratory/src/views/dataManagement/schemeManagement/list.vue | 43 ++++++++++++++++++++++++++++--------------- 1 files changed, 28 insertions(+), 15 deletions(-) diff --git a/laboratory/src/views/dataManagement/schemeManagement/list.vue b/laboratory/src/views/dataManagement/schemeManagement/list.vue index 81ed5ba..4597a9e 100644 --- a/laboratory/src/views/dataManagement/schemeManagement/list.vue +++ b/laboratory/src/views/dataManagement/schemeManagement/list.vue @@ -23,6 +23,7 @@ <el-form-item label="状态:"> <el-select v-model="form.status" placeholder="请选择"> <el-option label="全部" value=""></el-option> + <el-option label="草稿" :value="-1"></el-option> <el-option label="已发送" :value="1"></el-option> <el-option label="申请中止待审核" :value="2"></el-option> <el-option label="申请中止已通过" :value="3"></el-option> @@ -89,13 +90,13 @@ <!-- 工艺工程师(3) --> <template v-if="userRole == '3'"> - <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status == '4'">编辑</el-button> + <!-- <el-button type="text" @click="handleEdit(scope.row)" >编辑</el-button> --> <el-button type="text" @click="handleDetail(scope.row)">详情</el-button> </template> <!-- 实验员(5) --> <template v-if="userRole == '5'"> - <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status == '4'">编辑</el-button> + <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status == 1">编辑</el-button> </template> </template> </el-table-column> @@ -156,11 +157,19 @@ methods: { handlePageChange(page) { this.form.pageNum = page; + // 当处于草稿箱模式时,强制将状态设置为-1 + if (this.currentType === 'draft') { + this.form.status = -1; + } this.getTableData(); }, handleSizeChange(size) { this.form.pageSize = size; this.form.pageNum = 1; + // 当处于草稿箱模式时,强制将状态设置为-1 + if (this.currentType === 'draft') { + this.form.status = -1; + } this.getTableData(); }, resetForm() { @@ -174,10 +183,18 @@ pageNum: 1, pageSize: 10 }; + // 当处于草稿箱模式时,强制将状态设置为-1 + if (this.currentType === 'draft') { + this.form.status = -1; + } this.getTableData(); }, handleSearch() { this.form.pageNum = 1; + // 当处于草稿箱模式时,强制将状态设置为-1 + if (this.currentType === 'draft') { + this.form.status = -1; + } this.getTableData(); }, getStatusType(status) { @@ -187,7 +204,8 @@ '2': "warning", '3': "success", '4': "danger", - '5': "info" + '5': "info", + '6':'success' }; return statusMap[status] || "info"; }, @@ -198,7 +216,8 @@ '2': "申请中止待审核", '3': "申请中止已通过", '4': "申请中止已驳回", - '5': "已封存" + '5': "已封存", + '6':'实验员已提交' }; return statusMap[status] || "未知"; }, @@ -219,6 +238,10 @@ }, async getTableData() { try { + // 当处于草稿箱模式时,强制将状态设置为-1 + if (this.currentType === 'draft') { + this.form.status = -1; + } const { data } = await getList(this.form); this.tableData = data.records || []; this.total = data.total || 0; @@ -244,17 +267,7 @@ handleDetail(row) { this.approvalDialogType = 'view'; this.approvalDialogVisible = true; - this.getPlanDetail(row.id); - }, - async getPlanDetail(id) { - try { - const { data } = await this.$api.getDetail({ id }); - this.currentApprovalData = data; - } catch (error) { - console.error('获取方案详情失败:', error); - this.$message.error('获取方案详情失败'); - this.approvalDialogVisible = false; - } + this.currentApprovalData = row; }, handleApproveSubmit(data) { this.approvalDialogVisible = false; -- Gitblit v1.7.1