| | |
| | | <el-option label="已终止" value="99" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <!-- 新增搜索字段 --> |
| | | <el-form-item label="上报时间" prop="reportTimeRange"> |
| | | <el-date-picker |
| | | v-model="queryParams.reportTimeRange" |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | value-format="yyyy-MM-dd" |
| | | size="small" |
| | | style="width: 240px;" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="首诊医院" prop="treatmenthospitalname"> |
| | | <el-input |
| | | v-model="queryParams.treatmenthospitalname" |
| | | placeholder="请输入首诊医院" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="住院号" prop="hospitalNo"> |
| | | <el-input |
| | | v-model="queryParams.hospitalNo" |
| | | placeholder="请输入住院号" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | |
| | | |
| | | <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="dict.type.sys_BloodType" |
| | | :value="scope.row.bloodtype" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="证件号码" |
| | | label="传染病" |
| | | align="center" |
| | | prop="idcardno" |
| | | prop="infectious" |
| | | width="180" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="治疗医院" |
| | | label="首诊医院" |
| | | align="center" |
| | | prop="treatmenthospitalname" |
| | | width="150" |
| | |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="案例编号" |
| | | label="住院号" |
| | | align="center" |
| | | prop="caseNo" |
| | | prop="hospitalNo" |
| | | width="120" |
| | | /> |
| | | |
| | | <!-- 第一次医学评估 --> |
| | | <el-table-column |
| | | label="第一次评估结论" |
| | | label="评估状态" |
| | | align="center" |
| | | prop="firstAssessState" |
| | | prop="assessState" |
| | | width="120" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.sys_BaseAssessConclusion" |
| | | :value="scope.row.firstAssessState" |
| | | :value="scope.row.assessState" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="第一次评估时间" |
| | | label="评估时间" |
| | | align="center" |
| | | prop="assessFirstTime" |
| | | prop="assessTime" |
| | | width="110" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.assessFirstTime, "{y}-{m}-{d}") }}</span> |
| | | </template> |
| | | <!-- <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.assessTime, "{y}-{m}-{d}") }}</span> |
| | | </template> --> |
| | | </el-table-column> |
| | | |
| | | <!-- 第二次医学评估 --> |
| | | <el-table-column |
| | | label="第二次评估结论" |
| | | align="center" |
| | | prop="secondAssessState" |
| | | width="120" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.sys_BaseAssessConclusion" |
| | | :value="scope.row.secondAssessState" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="第二次评估时间" |
| | | align="center" |
| | | prop="assessSecondTime" |
| | | width="110" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ |
| | | parseTime(scope.row.assessSecondTime, "{y}-{m}-{d}") |
| | | }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="亲属确认时间" |
| | | align="center" |
| | | prop="signDate" |
| | | width="110" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <!-- <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.signDate, "{y}-{m}-{d}") }}</span> |
| | | </template> |
| | | </template> --> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | |
| | | </el-table-column> |
| | | |
| | | <!-- 操作列:只保留终止和查看详情 --> |
| | | <el-table-column label="操作" align="center" width="150" fixed="right"> |
| | | <el-table-column label="操作" align="center" width="200" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" @click="handleDetail(scope.row)" |
| | | >查看详情</el-button |
| | |
| | | scope.row.terminationCase === 0 && scope.row.recordstate !== '99' |
| | | " |
| | | >终止</el-button |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | style="color: #67c23a;" |
| | | @click="handleRestore(scope.row)" |
| | | v-if="scope.row.terminationCase === 1" |
| | | >恢复</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <donor-detail :donorData="currentRecord" @close="detailVisible = false" /> |
| | | </el-dialog> |
| | | |
| | | <!-- 终止确认弹框 --> |
| | | <el-dialog |
| | | title="终止确认" |
| | | :visible.sync="terminateVisible" |
| | | width="400px" |
| | | append-to-body |
| | | > |
| | | <div style="margin-bottom: 20px;"> |
| | | <p> |
| | | 确定要终止捐献者 |
| | | <strong>{{ currentRecord.name }}</strong> 的捐献进程吗? |
| | | </p> |
| | | <p style="color: #f56c6c; font-size: 12px;"> |
| | | 此操作不可逆,请谨慎操作! |
| | | </p> |
| | | </div> |
| | | <div slot="footer"> |
| | | <el-button @click="terminateVisible = false">取消</el-button> |
| | | <el-button type="danger" @click="submitTerminate">确认终止</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 终止/恢复弹框组件 --> |
| | | <terminate-restore-modal |
| | | :current-record="currentRecord" |
| | | :visible="modalVisible" |
| | | :titles="modalTitles" |
| | | @update:visible="handleModalVisibleChange" |
| | | @operation-success="handleOperationSuccess" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { courselist, terminateDonor } from "@/api/businessApi"; |
| | | import TerminateRestoreModal from "@/components/TerminateRestoreModal"; |
| | | |
| | | export default { |
| | | name: "Donatebaseinfo", |
| | | dicts: ["sys_donornode", "sys_EthicalReview", "sys_BaseAssessConclusion"], |
| | | components: { |
| | | TerminateRestoreModal |
| | | }, |
| | | dicts: ["sys_donornode",'sys_BloodType', "sys_EthicalReview", "sys_BaseAssessConclusion"], |
| | | data() { |
| | | return { |
| | | // 遮罩层 |
| | | loading: false, |
| | | // 显示搜索条件 |
| | | showSearch: true, |
| | |
| | | donatebaseinfoList: [], |
| | | // 详情弹框显示 |
| | | detailVisible: false, |
| | | // 终止确认弹框显示 |
| | | terminateVisible: false, |
| | | // 当前操作记录 |
| | | currentRecord: {}, |
| | | // 统计数据 |
| | |
| | | pageSize: 10, |
| | | name: undefined, |
| | | idcardno: undefined, |
| | | recordstate: undefined |
| | | recordstate: undefined, |
| | | // 新增的搜索字段 |
| | | reportTimeRange: [], |
| | | treatmenthospitalname: undefined, |
| | | hospitalNo: undefined |
| | | }, |
| | | // 弹框显示状态 |
| | | modalVisible: { |
| | | terminate: false, |
| | | restore: false |
| | | }, |
| | | // 弹框标题 |
| | | modalTitles: { |
| | | terminate: "终止捐献进程", |
| | | restore: "恢复捐献进程" |
| | | } |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | /** 查询捐献基础列表 */ |
| | | /** 查询捐献基础列表 */ |
| | | async getList() { |
| | | this.loading = true; |
| | | try { |
| | | const response = await courselist(this.queryParams); |
| | | |
| | | // 根据实际接口返回结构调整 |
| | | let realData = []; |
| | | realData = response.data.donatebaseinfoProgressDTOS; |
| | | this.total = response.total; |
| | | this.stats.pendingCount = response.data.terminationCase[0]; |
| | | this.stats.approvedCount = response.data.terminationCase[1]; |
| | | this.stats.terminatedCount = response.data.terminationCase[2]; |
| | | this.stats.totalCount = response.total; |
| | | // 存储所有数据用于前端筛选和分页 |
| | | this.allTableData = realData; |
| | | this.stats.totalCount = |
| | | response.total - response.data.terminationCase[2]; |
| | | |
| | | // 应用前端筛选条件(如果接口不支持后端筛选) |
| | | this.allTableData = realData; |
| | | let filteredData = this.applyFrontendFilter(realData); |
| | | |
| | | // 前端分页处理(如果接口不支持后端分页) |
| | | if (!response.total && !response.data) { |
| | | const startIndex = |
| | | (this.queryParams.pageNum - 1) * this.queryParams.pageSize; |
| | |
| | | this.donatebaseinfoList = filteredData.slice(startIndex, endIndex); |
| | | this.total = filteredData.length; |
| | | } else { |
| | | // 接口已分页,直接使用返回数据 |
| | | this.donatebaseinfoList = filteredData; |
| | | } |
| | | |
| | | // 更新统计数据 |
| | | // this.updateStats(realData); |
| | | } catch (error) { |
| | | console.error("获取数据失败:", error); |
| | | this.$message.error("数据加载失败"); |
| | | this.donatebaseinfoList = []; |
| | | this.total = 0; |
| | | // this.updateStats([]); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | |
| | | ); |
| | | } |
| | | |
| | | return filteredData; |
| | | }, |
| | | if (this.queryParams.treatmenthospitalname) { |
| | | filteredData = filteredData.filter( |
| | | item => |
| | | item.treatmenthospitalname && |
| | | item.treatmenthospitalname.includes( |
| | | this.queryParams.treatmenthospitalname |
| | | ) |
| | | ); |
| | | } |
| | | |
| | | /** 更新统计数据 */ |
| | | updateStats(data) { |
| | | this.stats.totalCount = data.length; |
| | | this.stats.pendingCount = data.filter( |
| | | item => item.recordstate === "0" || item.recordstate === 0 |
| | | ).length; |
| | | this.stats.approvedCount = data.filter( |
| | | item => item.recordstate === "1" || item.recordstate === 1 |
| | | ).length; |
| | | this.stats.terminatedCount = data.filter( |
| | | item => item.recordstate === "99" || item.recordstate === 99 |
| | | ).length; |
| | | if (this.queryParams.hospitalNo) { |
| | | filteredData = filteredData.filter( |
| | | item => |
| | | item.hospitalNo && |
| | | item.hospitalNo.includes(this.queryParams.hospitalNo) |
| | | ); |
| | | } |
| | | |
| | | if ( |
| | | this.queryParams.reportTimeRange && |
| | | this.queryParams.reportTimeRange.length === 2 |
| | | ) { |
| | | const [startTime, endTime] = this.queryParams.reportTimeRange; |
| | | filteredData = filteredData.filter(item => { |
| | | if (!item.reporttime) return false; |
| | | const reportDate = this.parseTime(item.reporttime, "{y}-{m}-{d}"); |
| | | return reportDate >= startTime && reportDate <= endTime; |
| | | }); |
| | | } |
| | | |
| | | return filteredData; |
| | | }, |
| | | |
| | | /** 获取状态标签样式 */ |
| | |
| | | /** 时间格式化 */ |
| | | parseTime(time, format) { |
| | | if (!time) return "-"; |
| | | |
| | | // 处理时间戳和日期字符串 |
| | | const date = new Date(time); |
| | | if (isNaN(date.getTime())) return time; |
| | | |
| | |
| | | /** 终止操作 */ |
| | | handleTerminate(row) { |
| | | this.currentRecord = { ...row }; |
| | | this.terminateVisible = true; |
| | | this.modalVisible = { ...this.modalVisible, terminate: true }; |
| | | }, |
| | | |
| | | /** 提交终止 */ |
| | | async submitTerminate() { |
| | | try { |
| | | // 调用终止接口 |
| | | await terminateDonor({ |
| | | id: this.currentRecord.id, |
| | | caseNo: this.currentRecord.caseNo, |
| | | terminationReason: "管理员手动终止" |
| | | }); |
| | | /** 恢复操作 */ |
| | | handleRestore(row) { |
| | | this.currentRecord = { ...row }; |
| | | this.modalVisible = { ...this.modalVisible, restore: true }; |
| | | }, |
| | | |
| | | this.$message.success("终止成功"); |
| | | this.terminateVisible = false; |
| | | this.getList(); // 重新加载更新数据 |
| | | } catch (error) { |
| | | this.$message.error("终止失败"); |
| | | console.error("终止错误:", error); |
| | | } |
| | | /** 处理弹框显示状态变化 */ |
| | | handleModalVisibleChange(newVisible) { |
| | | this.modalVisible = { ...newVisible }; |
| | | }, |
| | | |
| | | /** 处理操作成功 */ |
| | | handleOperationSuccess({ type, record }) { |
| | | console.log(`${type}操作成功:`, record); |
| | | this.getList(); // 重新加载数据 |
| | | } |
| | | } |
| | | }; |