| | |
| | | <div class="app-container"> |
| | | <!-- 搜索筛选区域 --> |
| | | <el-card class="filter-card"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" class="demo-form-inline"> |
| | | <el-form-item label="捐献编号" prop="donorNo"> |
| | | <el-input v-model="queryParams.donorNo" placeholder="请输入捐献编号" clearable style="width: 200px"/> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | :inline="true" |
| | | class="demo-form-inline" |
| | | > |
| | | <el-form-item label="案例编号" prop="caseNo"> |
| | | <el-input |
| | | v-model="queryParams.caseNo" |
| | | placeholder="请输入案例编号" |
| | | clearable |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="捐献者姓名" prop="donorName"> |
| | | <el-input v-model="queryParams.donorName" placeholder="请输入捐献者姓名" clearable style="width: 200px"/> |
| | | <el-form-item label="捐献者姓名" prop="name"> |
| | | <el-input |
| | | v-model="queryParams.name" |
| | | placeholder="请输入捐献者姓名" |
| | | clearable |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="案例状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 200px"> |
| | | <el-option label="全部" value=""/> |
| | | <el-option label="待审批" value="0"/> |
| | | <el-option label="已通过" value="1"/> |
| | | <el-option label="已驳回" value="2"/> |
| | | <el-form-item label="案例状态" prop="reportStatus"> |
| | | <el-select |
| | | v-model="queryParams.reportStatus" |
| | | placeholder="请选择状态" |
| | | clearable |
| | | style="width: 200px" |
| | | > |
| | | <el-option label="全部" value="" /> |
| | | <el-option label="已阅读" value="2" /> |
| | | <el-option label="已同意" value="3" /> |
| | | <el-option label="已驳回" value="4" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> |
| | | <el-button type="primary" icon="el-icon-search" @click="handleQuery" |
| | | >搜索</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | |
| | | <!-- 操作按钮区域 --> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <!-- <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" |
| | | >新增案例</el-button |
| | | > |
| | | </el-col> --> |
| | | |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd">新增案例</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="success" plain icon="el-icon-edit" :disabled="single" @click="handleUpdate">修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="el-icon-delete" :disabled="multiple" @click="handleDelete">删除</el-button> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | >删除</el-button |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- 数据表格 --> |
| | | <el-table v-loading="loading" :data="caseList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center"/> |
| | | <el-table-column label="序号" type="index" width="60" align="center"/> |
| | | <el-table-column label="捐献编号" align="center" prop="donorNo" width="140"/> |
| | | <el-table-column label="捐献者姓名" align="center" prop="donorName" width="100"/> |
| | | <el-table-column label="性别" align="center" prop="gender" width="80"> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="caseList" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column |
| | | label="上报时间" |
| | | align="center" |
| | | prop="reporttime" |
| | | width="160" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="捐献者姓名" |
| | | align="center" |
| | | prop="name" |
| | | width="100" |
| | | /> |
| | | <el-table-column label="性别" align="center" prop="sex" width="80"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="genderOptions" :value="scope.row.gender"/> |
| | | <dict-tag |
| | | :options="dict.type.sys_user_sex" |
| | | :value="parseInt(scope.row.sex)" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="年龄" align="center" prop="age" width="80"/> |
| | | <el-table-column label="年龄" align="center" prop="age" width="80" /> |
| | | <el-table-column label="血型" align="center" prop="bloodType" width="80"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="bloodTypeOptions" :value="scope.row.bloodType"/> |
| | | <dict-tag |
| | | :options="dict.type.sys_BloodType" |
| | | :value="scope.row.bloodtype" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="疾病诊断" align="center" prop="diagnosis" min-width="200" show-overflow-tooltip/> |
| | | <el-table-column label="医院名称" align="center" prop="hospitalName" width="150"/> |
| | | <el-table-column label="案例状态" align="center" prop="status" width="100"> |
| | | |
| | | <el-table-column |
| | | label="GCS评分" |
| | | align="center" |
| | | prop="gscScore" |
| | | width="80" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="疾病诊断" |
| | | align="center" |
| | | prop="diagnosisname" |
| | | min-width="200" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="治疗医院" |
| | | align="center" |
| | | prop="treatmenthospitalname" |
| | | width="150" |
| | | /> |
| | | <el-table-column |
| | | label="状态" |
| | | align="center" |
| | | prop="reportStatus" |
| | | width="100" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="scope.row.status | statusFilter"> |
| | | {{ scope.row.status | statusTextFilter }} |
| | | <el-tag :type="scope.row.reportStatus | statusFilter"> |
| | | {{ scope.row.reportStatus | statusTextFilter }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="上报时间" align="center" prop="reportTime" width="160"/> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200"> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | class-name="small-padding fixed-width" |
| | | width="200" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">详情</el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handleDetail(scope.row)" |
| | | >详情</el-button |
| | | > |
| | | |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-check" |
| | | @click="handleApprove(scope.row)" |
| | | v-if="scope.row.status === '0'" |
| | | >审批</el-button> |
| | | v-if="scope.row.reportStatus === '2'" |
| | | >审批</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- 分页 --> |
| | | <pagination |
| | | v-show="total>0" |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | |
| | | append-to-body |
| | | :close-on-click-modal="false" |
| | | > |
| | | <case-detail :caseData="currentCase" @close="detailOpen = false"/> |
| | | <case-detail :caseData="currentCase" @close="detailOpen = false" /> |
| | | </el-dialog> |
| | | |
| | | <!-- 审批弹框 --> |
| | | <el-dialog |
| | | title="案例审批" |
| | | :visible.sync="approveOpen" |
| | | width="500px" |
| | | width="80vw" |
| | | append-to-body |
| | | class="approve-dialog" |
| | | > |
| | | <el-form ref="approveForm" :model="approveForm" :rules="approveRules" label-width="80px"> |
| | | <el-form-item label="审批结果" prop="approveResult"> |
| | | <el-radio-group v-model="approveForm.approveResult"> |
| | | <el-radio label="1">通过</el-radio> |
| | | <el-radio label="2">驳回</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="审批意见" prop="approveOpinion"> |
| | | <el-input |
| | | type="textarea" |
| | | v-model="approveForm.approveOpinion" |
| | | placeholder="请输入审批意见" |
| | | :rows="4" |
| | | maxlength="500" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-container style="height: 800px;"> |
| | | <!-- 左侧:案例详情 --> |
| | | <el-aside |
| | | width="50vw" |
| | | style="background: #f8f9fa; padding: 20px; overflow-y: auto;" |
| | | > |
| | | <div class="approve-detail-preview"> |
| | | <h3 style="margin-bottom: 15px; color: #303133;">案例详情预览</h3> |
| | | <case-detail :caseData="currentCase" :showtitle="false" /> |
| | | </div> |
| | | </el-aside> |
| | | |
| | | <!-- 右侧:审批表单 --> |
| | | <el-main style="padding: 20px;"> |
| | | <el-form |
| | | ref="approveForm" |
| | | :model="approveForm" |
| | | :rules="approveRules" |
| | | label-width="100px" |
| | | > |
| | | <el-form-item label="审批结果" prop="approveResult"> |
| | | <el-radio-group v-model="approveForm.approveResult"> |
| | | <el-radio label="3">同意</el-radio> |
| | | <el-radio label="4">驳回</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="审批意见" prop="approveOpinion"> |
| | | <el-input |
| | | type="textarea" |
| | | v-model="approveForm.approveOpinion" |
| | | placeholder="请输入详细的审批意见,包括通过或驳回的理由" |
| | | :rows="6" |
| | | maxlength="500" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-main> |
| | | </el-container> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="approveOpen = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitApprove">确 定</el-button> |
| | | <el-button @click="approveOpen = false">取消</el-button> |
| | | <el-button type="primary" @click="submitApprove">确定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import CaseDetail from './caseDetail'; |
| | | import CaseDetail from "./caseDetail"; |
| | | import { |
| | | donateList, |
| | | donateInfo, |
| | | donateDel, |
| | | donateEdit |
| | | } from "@/api/businessApi/index"; |
| | | |
| | | export default { |
| | | name: "CaseList", |
| | | components: { CaseDetail }, |
| | | |
| | | components: { CaseDetail }, |
| | | dicts: ["sys_user_sex", "sys_BloodType"], |
| | | data() { |
| | | return { |
| | | // 遮罩层 |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | donorNo: undefined, |
| | | donorName: undefined, |
| | | status: undefined |
| | | caseNo: undefined, |
| | | name: undefined, |
| | | reportStatus: undefined |
| | | }, |
| | | // 审批表单 |
| | | approveForm: { |
| | | caseId: null, |
| | | approveResult: "1", |
| | | id: null, |
| | | approveResult: "3", |
| | | approveOpinion: "" |
| | | }, |
| | | // 审批表单验证 |
| | |
| | | }; |
| | | }, |
| | | filters: { |
| | | statusFilter(status) { |
| | | statusFilter(reportStatus) { |
| | | const statusMap = { |
| | | '0': 'warning', // 待审批 |
| | | '1': 'success', // 已通过 |
| | | '2': 'danger' // 已驳回 |
| | | "1": "info", // 已上报 |
| | | "2": "warning", // 已阅读(待审批) |
| | | "3": "success", // 已同意 |
| | | "4": "danger" // 已驳回 |
| | | }; |
| | | return statusMap[status]; |
| | | return statusMap[reportStatus] || "info"; |
| | | }, |
| | | statusTextFilter(status) { |
| | | statusTextFilter(reportStatus) { |
| | | const statusMap = { |
| | | '0': '待审批', |
| | | '1': '已通过', |
| | | '2': '已驳回' |
| | | "1": "已上报", |
| | | "2": "已阅读", |
| | | "3": "已同意", |
| | | "4": "已驳回" |
| | | }; |
| | | return statusMap[status]; |
| | | return statusMap[reportStatus] || "未知状态"; |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | methods: { |
| | | /** 查询案例列表 */ |
| | | getList() { |
| | | async getList() { |
| | | this.loading = true; |
| | | // 模拟API调用延迟 |
| | | setTimeout(() => { |
| | | // 测试数据 |
| | | this.caseList = [ |
| | | { |
| | | id: 1, |
| | | donorNo: 'DON20241219001', |
| | | donorName: '张三', |
| | | gender: '0', |
| | | age: 38, |
| | | bloodType: 'A', |
| | | diagnosis: '脑外伤导致脑死亡,经抢救无效宣布脑死亡。家属同意器官捐献。', |
| | | hospitalName: '青岛大学附属医院', |
| | | status: '0', |
| | | reportTime: '2024-12-19 09:30:00', |
| | | reporterName: '李医生', |
| | | idCardNo: '370203198510123456', |
| | | nation: '汉族', |
| | | phone: '13800138000', |
| | | address: '山东省青岛市市南区香港中路100号', |
| | | inpatientNo: 'ZY20241219001', |
| | | departmentName: '神经外科', |
| | | doctorName: '王主任', |
| | | infectiousDisease: '无', |
| | | medicalRecord: '患者因交通事故导致严重脑外伤,经抢救无效宣布脑死亡。', |
| | | hospitalLevel: '三级甲等', |
| | | contactPerson: '张护士', |
| | | contactPhone: '13900139000', |
| | | hospitalAddress: '山东省青岛市市南区江苏路1号' |
| | | }, |
| | | { |
| | | id: 2, |
| | | donorNo: 'DON20241218001', |
| | | donorName: '李四', |
| | | gender: '1', |
| | | age: 45, |
| | | bloodType: 'O', |
| | | diagnosis: '急性心肌梗死,心脏功能衰竭', |
| | | hospitalName: '青岛市立医院', |
| | | status: '1', |
| | | reportTime: '2024-12-18 14:20:00', |
| | | approveTime: '2024-12-18 16:30:00', |
| | | reporterName: '刘医生', |
| | | approverName: '审核专员A', |
| | | approveOpinion: '资料齐全,符合捐献条件,同意通过。' |
| | | }, |
| | | { |
| | | id: 3, |
| | | donorNo: 'DON20241217001', |
| | | donorName: '王五', |
| | | gender: '0', |
| | | age: 52, |
| | | bloodType: 'B', |
| | | diagnosis: '颅内出血,脑干功能丧失', |
| | | hospitalName: '青岛眼科医院', |
| | | status: '2', |
| | | reportTime: '2024-12-17 10:15:00', |
| | | approveTime: '2024-12-17 14:20:00', |
| | | reporterName: '陈医生', |
| | | approverName: '审核专员B', |
| | | approveOpinion: '家属同意书不完整,需补充材料后重新提交。' |
| | | }, |
| | | { |
| | | id: 4, |
| | | donorNo: 'DON20241216001', |
| | | donorName: '赵六', |
| | | gender: '1', |
| | | age: 28, |
| | | bloodType: 'AB', |
| | | diagnosis: '重型颅脑损伤,多器官功能衰竭', |
| | | hospitalName: '青岛儿童医院', |
| | | status: '0', |
| | | reportTime: '2024-12-16 16:45:00', |
| | | reporterName: '孙医生' |
| | | } |
| | | ]; |
| | | try { |
| | | const response = await donateList(this.queryParams); |
| | | this.caseList = response.rows || response.data || []; |
| | | this.total = response.total || this.caseList.length; |
| | | } catch (error) { |
| | | console.error("获取案例列表失败:", error); |
| | | this.$modal.msgError("获取案例列表失败"); |
| | | // 模拟数据 |
| | | this.caseList = this.getMockData(); |
| | | this.total = this.caseList.length; |
| | | } finally { |
| | | this.loading = false; |
| | | }, 500); |
| | | } |
| | | }, |
| | | |
| | | /** 模拟数据 */ |
| | | getMockData() { |
| | | return [ |
| | | { |
| | | id: 1, |
| | | caseNo: "DON20241219001", |
| | | name: "张三", |
| | | sex: "0", |
| | | age: 38, |
| | | bloodType: "A", |
| | | gscScore: "1", |
| | | diagnosisname: |
| | | "脑外伤导致脑死亡,经抢救无效宣布脑死亡。家属同意器官捐献。", |
| | | treatmenthospitalname: "青岛大学附属医院", |
| | | reportStatus: "2", |
| | | reporttime: "2024-12-19 09:30:00", |
| | | reportername: "李医生", |
| | | idcardno: "370203198510123456", |
| | | nation: "汉族", |
| | | phone: "13800138000", |
| | | registeraddress: "山东省青岛市市南区香港中路100号", |
| | | inpatientno: "ZY20241219001", |
| | | treatmentdeptname: "神经外科", |
| | | doctorname: "王主任", |
| | | infectious: "无", |
| | | illnessoverview: |
| | | "患者因交通事故导致严重脑外伤,经抢救无效宣布脑死亡。", |
| | | hospitalLevel: "三级甲等", |
| | | contactperson: "张护士", |
| | | contactphone: "13900139000", |
| | | hospitalAddress: "山东省青岛市市南区江苏路1号" |
| | | }, |
| | | { |
| | | id: 2, |
| | | caseNo: "DON20241218001", |
| | | name: "李四", |
| | | sex: "0", |
| | | age: 45, |
| | | bloodType: "O", |
| | | gscScore: "3", |
| | | diagnosisname: "急性心肌梗死,心脏功能衰竭", |
| | | treatmenthospitalname: "青岛市立医院", |
| | | reportStatus: "3", |
| | | reporttime: "2024-12-18 14:20:00", |
| | | approvetime: "2024-12-18 16:30:00", |
| | | reportername: "刘医生", |
| | | approvername: "审核专员A", |
| | | approveopinion: "资料齐全,符合捐献条件,同意通过。" |
| | | } |
| | | ]; |
| | | }, |
| | | |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id); |
| | | this.single = selection.length !== 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | | |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | |
| | | /** 详情按钮操作 */ |
| | | handleDetail(row) { |
| | | this.currentCase = row; |
| | | this.detailTitle = `案例详情 - ${row.donorNo}`; |
| | | this.detailOpen = true; |
| | | }, |
| | | /** 审批按钮操作 */ |
| | | handleApprove(row) { |
| | | this.currentCase = row; |
| | | this.approveForm.caseId = row.id; |
| | | this.approveForm.approveResult = "1"; |
| | | this.approveForm.approveOpinion = ""; |
| | | this.approveOpen = true; |
| | | }, |
| | | /** 提交审批 */ |
| | | submitApprove() { |
| | | this.$refs["approveForm"].validate(valid => { |
| | | if (valid) { |
| | | // 模拟审批提交 |
| | | this.$modal.msgSuccess("审批成功"); |
| | | this.approveOpen = false; |
| | | // 更新案例状态 |
| | | const caseItem = this.caseList.find(item => item.id === this.approveForm.caseId); |
| | | if (caseItem) { |
| | | caseItem.status = this.approveForm.approveResult; |
| | | caseItem.approveTime = new Date().toLocaleString(); |
| | | caseItem.approverName = '当前用户'; |
| | | caseItem.approveOpinion = this.approveForm.approveOpinion; |
| | | async handleDetail(row) { |
| | | try { |
| | | // 先获取案例详情 |
| | | const response = await donateInfo(row.id); |
| | | this.currentCase = response.data || response || row; |
| | | |
| | | // 如果状态是"已上报"(1),则使用完整数据更新为"已阅读"(2) |
| | | if (this.currentCase.reportStatus === "1") { |
| | | try { |
| | | // 使用完整的案例数据作为更新基础,确保所有字段都被保留 |
| | | const updateData = { |
| | | ...this.currentCase, // 展开所有现有字段 |
| | | reportStatus: "2", // 更新状态为已阅读 |
| | | updateTime: new Date() |
| | | .toISOString() |
| | | .replace("T", " ") |
| | | .substring(0, 19), |
| | | updateBy: "当前用户" // 添加更新人信息 |
| | | }; |
| | | |
| | | await donateEdit(updateData); |
| | | |
| | | // 更新本地数据和当前显示的数据 |
| | | this.currentCase.reportStatus = "2"; |
| | | this.currentCase.updateTime = updateData.updateTime; |
| | | row.reportStatus = "2"; // 更新列表中的状态 |
| | | |
| | | this.$modal.msgSuccess("状态已更新为已阅读"); |
| | | } catch (updateError) { |
| | | console.error("状态更新失败:", updateError); |
| | | this.$modal.msgError("状态更新失败,但将继续显示详情"); |
| | | // 更新失败时,继续使用原始状态显示详情 |
| | | } |
| | | } |
| | | }); |
| | | |
| | | this.detailTitle = `案例详情 - ${this.currentCase.caseNo || |
| | | row.caseNo}`; |
| | | this.detailOpen = true; |
| | | } catch (error) { |
| | | console.error("获取案例详情失败:", error); |
| | | // 如果获取详情失败,使用行数据作为后备 |
| | | this.currentCase = row; |
| | | this.detailTitle = `案例详情 - ${row.caseNo}`; |
| | | this.detailOpen = true; |
| | | |
| | | // 即使获取详情失败,也尝试更新状态(使用行数据) |
| | | if (row.reportStatus === "1") { |
| | | try { |
| | | const updateData = { |
| | | id: row.id, |
| | | reportStatus: "2", |
| | | updateTime: new Date() |
| | | .toISOString() |
| | | .replace("T", " ") |
| | | .substring(0, 19), |
| | | updateBy: "当前用户" |
| | | // 注意:这里只能传递部分字段,因为详情获取失败了 |
| | | }; |
| | | |
| | | await donateEdit(updateData); |
| | | row.reportStatus = "2"; |
| | | this.currentCase.reportStatus = "2"; |
| | | this.$modal.msgSuccess("状态已更新为已阅读"); |
| | | } catch (updateError) { |
| | | console.error("状态更新失败:", updateError); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** 审批按钮操作 */ |
| | | async handleApprove(row) { |
| | | try { |
| | | // 先获取案例详情数据,确保有完整数据 |
| | | const response = await donateInfo(row.id); |
| | | this.currentCase = response.data || response || row; |
| | | |
| | | this.approveForm.id = row.id; |
| | | this.approveForm.approveResult = "3"; |
| | | this.approveForm.approveOpinion = ""; |
| | | |
| | | this.$nextTick(() => { |
| | | if (this.$refs.approveForm) { |
| | | this.$refs.approveForm.clearValidate(); |
| | | } |
| | | }); |
| | | |
| | | this.approveOpen = true; |
| | | } catch (error) { |
| | | console.error("获取案例详情失败:", error); |
| | | // 如果获取详情失败,使用行数据作为后备 |
| | | this.currentCase = row; |
| | | this.approveForm.id = row.id; |
| | | this.approveForm.approveResult = "3"; |
| | | this.approveForm.approveOpinion = ""; |
| | | this.approveOpen = true; |
| | | this.$modal.msgError("获取详情失败,但已打开审批窗口"); |
| | | } |
| | | }, |
| | | |
| | | /** 提交审批 */ |
| | | async submitApprove() { |
| | | try { |
| | | const valid = await this.$refs.approveForm.validate(); |
| | | if (valid) { |
| | | // 使用完整的案例数据作为基础,确保所有字段都被保留 |
| | | const approveData = { |
| | | ...this.currentCase, // 展开所有现有字段 |
| | | reportStatus: this.approveForm.approveResult, |
| | | approveOpinion: this.approveForm.approveOpinion, |
| | | approvername: "当前用户", // 实际项目中应该获取当前登录用户 |
| | | approvetime: new Date() |
| | | .toISOString() |
| | | .replace("T", " ") |
| | | .substring(0, 19), |
| | | updateTime: new Date() |
| | | .toISOString() |
| | | .replace("T", " ") |
| | | .substring(0, 19), |
| | | updateBy: "当前用户" |
| | | }; |
| | | |
| | | // 移除可能不需要的字段(根据实际API需求调整) |
| | | delete approveData.createTime; // 创建时间不应被更新 |
| | | delete approveData.createBy; // 创建人不应变 |
| | | |
| | | await donateEdit(approveData); |
| | | this.$modal.msgSuccess("审批成功"); |
| | | this.approveOpen = false; |
| | | this.getList(); // 重新加载列表 |
| | | } |
| | | } catch (error) { |
| | | console.error("审批失败:", error); |
| | | if (error !== "cancel") { |
| | | this.$modal.msgError("审批失败"); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.$router.push('/case/add'); |
| | | this.$router.push("/case/add"); |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | const id = row.id || this.ids[0]; |
| | | this.$router.push('/case/edit/' + id); |
| | | }, |
| | | |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | async handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('是否确认删除案例编号为"' + ids + '"的数据项?').then(() => { |
| | | // 模拟删除操作 |
| | | this.caseList = this.caseList.filter(item => !ids.includes(item.id)); |
| | | this.total = this.caseList.length; |
| | | try { |
| | | await this.$modal.confirm( |
| | | '是否确认删除案例编号为"' + ids + '"的数据项?' |
| | | ); |
| | | await donateDel(ids); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | this.getList(); |
| | | } catch (error) { |
| | | if (error !== "cancel") { |
| | | console.error("删除失败:", error); |
| | | this.$modal.msgError("删除失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | |
| | | .mb8 { |
| | | margin-bottom: 8px; |
| | | } |
| | | /* 详情页面样式优化 */ |
| | | .case-detail-container { |
| | | max-height: 70vh; |
| | | overflow-y: auto; |
| | | padding: 0 10px; |
| | | } |
| | | |
| | | .detail-section { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .section-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | color: #303133; |
| | | } |
| | | |
| | | /* 审批弹框样式 */ |
| | | .approve-dialog >>> .el-dialog__body { |
| | | padding: 0; |
| | | } |
| | | |
| | | .approve-detail-preview { |
| | | height: 100%; |
| | | } |
| | | |
| | | /* 响应式设计 */ |
| | | @media (max-width: 1200px) { |
| | | .approve-dialog { |
| | | width: 95% !important; |
| | | } |
| | | |
| | | .el-aside { |
| | | width: 50% !important; |
| | | } |
| | | } |
| | | </style> |