<template>
|
<div class="organ-allocation-detail">
|
<!-- 基本信息部分 -->
|
<el-card class="detail-card">
|
<div slot="header" class="clearfix">
|
<span class="detail-title">器官分配基本信息</span>
|
<div style="float: right;">
|
<el-button type="primary" @click="handleSave" :loading="saveLoading">
|
保存
|
</el-button>
|
<el-button
|
type="success"
|
@click="handleAllocate"
|
:disabled="form.allocationStatus === 'allocated'"
|
>
|
确认分配
|
</el-button>
|
</div>
|
</div>
|
|
<el-form :model="form" ref="form" :rules="rules" label-width="120px">
|
<el-row :gutter="20">
|
<el-col :span="8">
|
<el-form-item label="住院号" prop="hospitalNo">
|
<el-input v-model="form.hospitalNo" readonly />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="住院号" prop="caseNo">
|
<el-input v-model="form.caseNo" readonly />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="捐献者姓名" prop="donorName">
|
<el-input v-model="form.donorName" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row :gutter="20">
|
<el-col :span="8">
|
<el-form-item label="性别" prop="gender">
|
<el-select v-model="form.gender" style="width: 100%">
|
<el-option label="男" value="0" />
|
<el-option label="女" value="1" />
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="年龄" prop="age">
|
<el-input v-model="form.age" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="出生日期" prop="birthDate">
|
<el-date-picker
|
v-model="form.birthDate"
|
type="date"
|
value-format="yyyy-MM-dd"
|
style="width: 100%"
|
/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row :gutter="20">
|
<el-col :span="12">
|
<el-form-item label="疾病诊断" prop="diagnosis">
|
<el-input
|
type="textarea"
|
:rows="2"
|
v-model="form.diagnosis"
|
placeholder="请输入疾病诊断信息"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="分配时间" prop="allocationTime">
|
<el-date-picker
|
v-model="form.allocationTime"
|
type="datetime"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
style="width: 100%"
|
:disabled="form.allocationStatus !== 'allocated'"
|
/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row :gutter="20">
|
<el-col :span="12">
|
<el-form-item label="登记人" prop="registrant">
|
<el-input v-model="form.registrant" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="登记时间" prop="registrationTime">
|
<el-date-picker
|
v-model="form.registrationTime"
|
type="datetime"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
style="width: 100%"
|
readonly
|
/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
</el-card>
|
|
<!-- 器官分配记录部分 -->
|
<el-card class="allocation-card">
|
<div slot="header" class="clearfix">
|
<span class="detail-title">器官分配记录</span>
|
<div style="float: right;">
|
<el-tag
|
:type="
|
form.allocationStatus === 'allocated' ? 'success' : 'warning'
|
"
|
>
|
{{ form.allocationStatus === "allocated" ? "已分配" : "待分配" }}
|
</el-tag>
|
</div>
|
</div>
|
|
<el-form
|
ref="allocationForm"
|
:rules="allocationRules"
|
:model="allocationData"
|
label-position="right"
|
>
|
<el-row>
|
<el-col>
|
<el-form-item label-width="100px" label="分配器官">
|
<el-checkbox-group
|
v-model="selectedOrgans"
|
@change="handleOrganSelectionChange"
|
>
|
<el-checkbox
|
v-for="organ in organDict"
|
:key="organ.value"
|
:label="organ.value"
|
:disabled="form.allocationStatus === 'allocated'"
|
>
|
{{ organ.label }}
|
</el-checkbox>
|
</el-checkbox-group>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<el-col>
|
<el-form-item>
|
<el-table
|
:data="allocationData.records"
|
v-loading="loading"
|
border
|
style="width: 100%"
|
:row-class-name="getOrganRowClassName"
|
>
|
<el-table-column
|
label="器官名称"
|
align="center"
|
width="120"
|
prop="organName"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.organName"
|
placeholder="器官名称"
|
:disabled="true"
|
/>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="分配系统编号"
|
align="center"
|
width="150"
|
prop="systemNo"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.systemNo"
|
placeholder="分配系统编号"
|
:disabled="form.allocationStatus === 'allocated'"
|
/>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="分配接收时间"
|
align="center"
|
width="180"
|
prop="applicantTime"
|
>
|
<template slot-scope="scope">
|
<el-date-picker
|
clearable
|
size="small"
|
style="width: 100%"
|
v-model="scope.row.applicantTime"
|
type="datetime"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
placeholder="选择分配接收时间"
|
:disabled="form.allocationStatus === 'allocated'"
|
/>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="受体姓氏"
|
align="center"
|
width="120"
|
prop="recipientName"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.recipientName"
|
placeholder="受体姓氏"
|
:disabled="form.allocationStatus === 'allocated'"
|
/>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="移植医院"
|
align="center"
|
width="200"
|
prop="transplantHospitalNo"
|
>
|
<template slot-scope="scope">
|
<el-select
|
v-model="scope.row.transplantHospitalNo"
|
placeholder="请选择移植医院"
|
style="width: 100%"
|
:disabled="form.allocationStatus === 'allocated'"
|
@change="handleHospitalChange(scope.row, $event)"
|
>
|
<el-option
|
v-for="hospital in hospitalList"
|
:key="hospital.hospitalNo"
|
:label="hospital.hospitalName"
|
:value="hospital.hospitalNo"
|
/>
|
</el-select>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="说明"
|
align="center"
|
prop="reallocationReason"
|
min-width="200"
|
>
|
<template slot-scope="scope">
|
<el-input
|
type="textarea"
|
clearable
|
v-model="scope.row.reallocationReason"
|
placeholder="请输入说明"
|
:disabled="form.allocationStatus === 'allocated'"
|
/>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="操作"
|
align="center"
|
width="120"
|
class-name="small-padding fixed-width"
|
v-if="form.allocationStatus !== 'allocated'"
|
>
|
<template slot-scope="scope">
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-copy-document"
|
@click="handleRedistribution(scope.row)"
|
:disabled="!scope.row.systemNo"
|
>
|
重分配
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<!-- 分配统计信息 -->
|
<div class="allocation-stats" v-if="allocationData.records.length > 0">
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<div class="stat-item">
|
<span class="stat-label">已分配器官:</span>
|
<span class="stat-value"
|
>{{ allocationData.records.length }} 个</span
|
>
|
</div>
|
</el-col>
|
<el-col :span="6">
|
<div class="stat-item">
|
<span class="stat-label">待完善信息:</span>
|
<span class="stat-value">{{ incompleteRecords }} 个</span>
|
</div>
|
</el-col>
|
<el-col :span="6">
|
<div class="stat-item">
|
<span class="stat-label">涉及医院:</span>
|
<span class="stat-value">{{ uniqueHospitals }} 家</span>
|
</div>
|
</el-col>
|
<el-col :span="6">
|
<div class="stat-item">
|
<span class="stat-label">分配状态:</span>
|
<span class="stat-value">
|
<el-tag
|
:type="
|
form.allocationStatus === 'allocated'
|
? 'success'
|
: 'warning'
|
"
|
>
|
{{
|
form.allocationStatus === "allocated"
|
? "已完成"
|
: "进行中"
|
}}
|
</el-tag>
|
</span>
|
</div>
|
</el-col>
|
</el-row>
|
</div>
|
|
<div v-else class="empty-allocation">
|
<el-empty description="暂无分配记录" :image-size="80">
|
<span>请先选择要分配的器官</span>
|
</el-empty>
|
</div>
|
</el-form>
|
|
<div class="dialog-footer" v-if="form.allocationStatus !== 'allocated'">
|
<el-button
|
type="primary"
|
@click="handleSaveAllocation"
|
:loading="saveLoading"
|
:disabled="allocationData.records.length === 0"
|
>
|
保存分配记录
|
</el-button>
|
<el-button
|
type="success"
|
@click="handleConfirmAllocation"
|
:loading="confirmLoading"
|
:disabled="incompleteRecords > 0"
|
>
|
确认完成分配
|
</el-button>
|
</div>
|
</el-card>
|
|
<!-- 附件管理部分 -->
|
<el-card class="attachment-card">
|
<div slot="header" class="clearfix">
|
<span class="detail-title">相关附件</span>
|
<upload-attachment
|
:file-list="attachments"
|
@change="handleAttachmentChange"
|
:limit="10"
|
:accept="'.pdf,.jpg,.jpeg,.png,.doc,.docx'"
|
/>
|
</div>
|
|
<div class="attachment-list">
|
<el-table :data="attachments" style="width: 100%">
|
<el-table-column label="文件名称" min-width="200">
|
<template slot-scope="scope">
|
<div class="file-info">
|
<i
|
:class="getFileIcon(scope.row.fileName)"
|
style="margin-right: 8px; color: #409EFF;"
|
></i>
|
<span>{{ scope.row.fileName }}</span>
|
</div>
|
</template>
|
</el-table-column>
|
|
<el-table-column label="文件类型" width="100" align="center">
|
<template slot-scope="scope">
|
<el-tag size="small">{{
|
getFileType(scope.row.fileName)
|
}}</el-tag>
|
</template>
|
</el-table-column>
|
|
<el-table-column label="文件大小" width="100" align="center">
|
<template slot-scope="scope">
|
<span>{{ formatFileSize(scope.row.fileSize) }}</span>
|
</template>
|
</el-table-column>
|
|
<el-table-column label="上传时间" width="160" align="center">
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.uploadTime) }}</span>
|
</template>
|
</el-table-column>
|
|
<el-table-column label="操作" width="150" align="center">
|
<template slot-scope="scope">
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-view"
|
@click="handlePreviewAttachment(scope.row)"
|
>预览</el-button
|
>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-download"
|
@click="handleDownloadAttachment(scope.row)"
|
>下载</el-button
|
>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-delete"
|
style="color: #F56C6C;"
|
@click="handleRemoveAttachment(scope.row)"
|
>删除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
</el-card>
|
<!-- 附件预览对话框 -->
|
<attachment-preview
|
:visible="attachmentPreviewVisible"
|
:file-list="currentAttachmentList"
|
:title="attachmentPreviewTitle"
|
@close="attachmentPreviewVisible = false"
|
/>
|
<!-- 重分配对话框 -->
|
<el-dialog
|
title="器官重分配"
|
:visible.sync="redistributionDialogVisible"
|
width="500px"
|
>
|
<el-form :model="redistributionForm" label-width="100px">
|
<el-form-item label="原器官信息">
|
<el-input v-model="redistributionForm.organName" readonly />
|
</el-form-item>
|
<el-form-item label="重分配原因" prop="reason">
|
<el-input
|
type="textarea"
|
:rows="4"
|
v-model="redistributionForm.reason"
|
placeholder="请输入重分配原因"
|
/>
|
</el-form-item>
|
</el-form>
|
<div slot="footer">
|
<el-button @click="redistributionDialogVisible = false">取消</el-button>
|
<el-button type="primary" @click="handleRedistributionConfirm"
|
>确认重分配</el-button
|
>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import {
|
getOrganAllocationDetail,
|
updateOrganAllocation,
|
saveAllocationRecords,
|
getHospitalList,
|
getOrganDict
|
} from "./organAllocation";
|
import UploadAttachment from "@/components/UploadAttachment";
|
import AttachmentPreview from "@/components/AttachmentPreview";
|
export default {
|
name: "OrganAllocationDetail",
|
components: {
|
UploadAttachment,
|
AttachmentPreview,
|
},
|
data() {
|
return {
|
// 表单数据
|
form: {
|
id: undefined,
|
hospitalNo: "",
|
caseNo: "",
|
donorName: "",
|
gender: "",
|
age: "",
|
birthDate: "",
|
diagnosis: "",
|
allocationStatus: "pending",
|
allocationTime: "",
|
registrant: "",
|
registrationTime: ""
|
},
|
// 表单验证规则
|
rules: {
|
donorName: [
|
{ required: true, message: "捐献者姓名不能为空", trigger: "blur" }
|
],
|
diagnosis: [
|
{ required: true, message: "疾病诊断不能为空", trigger: "blur" }
|
]
|
},
|
// 分配记录验证规则
|
allocationRules: {},
|
// 保存加载状态
|
saveLoading: false,
|
confirmLoading: false,
|
// 加载状态
|
loading: false,
|
// 选中的器官
|
selectedOrgans: [],
|
// 器官字典
|
organDict: [],
|
// 医院列表
|
hospitalList: [],
|
// 分配记录数据
|
allocationData: {
|
records: []
|
},
|
// 附件数据
|
attachments: [],
|
// 重分配对话框
|
redistributionDialogVisible: false,
|
redistributionForm: {
|
organName: "",
|
reason: ""
|
},
|
currentRedistributeRecord: null
|
};
|
},
|
computed: {
|
// 当前用户信息
|
currentUser() {
|
return JSON.parse(sessionStorage.getItem("user") || "{}");
|
},
|
// 不完整的记录数量
|
incompleteRecords() {
|
return this.allocationData.records.filter(
|
record =>
|
!record.systemNo ||
|
!record.applicantTime ||
|
!record.recipientName ||
|
!record.transplantHospitalNo
|
).length;
|
},
|
// 唯一医院数量
|
uniqueHospitals() {
|
const hospitals = this.allocationData.records
|
.map(record => record.transplantHospitalNo)
|
.filter(Boolean);
|
return new Set(hospitals).size;
|
}
|
},
|
created() {
|
const id = this.$route.query.id;
|
if (id) {
|
this.getDetail(id);
|
} else {
|
this.generateCaseNo();
|
this.form.registrant = this.currentUser.username || "当前用户";
|
this.form.registrationTime = new Date()
|
.toISOString()
|
.replace("T", " ")
|
.substring(0, 19);
|
}
|
this.getOrganDictionary();
|
this.getHospitalData();
|
},
|
methods: {
|
// 生成住院号
|
generateCaseNo() {
|
const timestamp = Date.now().toString();
|
this.form.hospitalNo = "D" + timestamp.slice(-6);
|
this.form.caseNo = "C" + timestamp.slice(-6);
|
},
|
// 获取详情
|
getDetail(id) {
|
this.loading = true;
|
getOrganAllocationDetail(id)
|
.then(response => {
|
if (response.code === 200) {
|
this.form = response.data;
|
if (response.data.allocationRecords) {
|
this.allocationData.records = response.data.allocationRecords;
|
this.selectedOrgans = response.data.allocationRecords.map(
|
item => item.organNo
|
);
|
}
|
}
|
this.loading = false;
|
})
|
.catch(error => {
|
console.error("获取器官分配详情失败:", error);
|
this.loading = false;
|
this.$message.error("获取详情失败");
|
});
|
},
|
// 获取器官字典
|
getOrganDictionary() {
|
getOrganDict().then(response => {
|
if (response.code === 200) {
|
this.organDict = response.data;
|
}
|
});
|
},
|
// 获取医院数据
|
getHospitalData() {
|
getHospitalList().then(response => {
|
if (response.code === 200) {
|
this.hospitalList = response.data;
|
}
|
});
|
},
|
handleAttachmentChange(fileList) {
|
console.log(fileList,'测试');
|
|
},
|
// 器官选择状态变化
|
handleOrganSelectionChange(selectedValues) {
|
const currentOrganNos = this.allocationData.records.map(
|
item => item.organNo
|
);
|
|
// 新增选择的器官
|
selectedValues.forEach(organValue => {
|
if (!currentOrganNos.includes(organValue)) {
|
const organInfo = this.organDict.find(
|
item => item.value === organValue
|
);
|
if (organInfo) {
|
this.allocationData.records.push({
|
organName: organInfo.label,
|
organNo: organValue,
|
id: null,
|
allocationId: this.form.id,
|
systemNo: "",
|
applicantTime: "",
|
recipientName: "",
|
transplantHospitalNo: "",
|
transplantHospitalName: "",
|
reallocationReason: "",
|
organState: 1
|
});
|
}
|
}
|
});
|
|
// 移除取消选择的器官
|
this.allocationData.records = this.allocationData.records.filter(
|
record => {
|
if (selectedValues.includes(record.organNo)) {
|
return true;
|
} else {
|
if (record.id) {
|
this.$confirm(
|
"删除器官分配数据后将无法恢复,您确认删除该条记录吗?",
|
"提示",
|
{
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
}
|
)
|
.then(() => {
|
// 实际项目中这里应该调用删除API
|
this.allocationData.records = this.allocationData.records.filter(
|
r => r.organNo !== record.organNo
|
);
|
this.$message.success("删除成功");
|
})
|
.catch(() => {
|
this.selectedOrgans.push(record.organNo);
|
});
|
return true; // 等待用户确认
|
} else {
|
return false; // 直接删除新记录
|
}
|
}
|
}
|
);
|
},
|
// 医院选择变化
|
handleHospitalChange(row, hospitalNo) {
|
const hospital = this.hospitalList.find(
|
item => item.hospitalNo === hospitalNo
|
);
|
if (hospital) {
|
row.transplantHospitalName = hospital.hospitalName;
|
}
|
},
|
// 重分配操作
|
handleRedistribution(row) {
|
this.currentRedistributeRecord = row;
|
this.redistributionForm.organName = row.organName;
|
this.redistributionForm.reason = row.reallocationReason || "";
|
this.redistributionDialogVisible = true;
|
},
|
// 确认重分配
|
handleRedistributionConfirm() {
|
if (!this.redistributionForm.reason) {
|
this.$message.warning("请输入重分配原因");
|
return;
|
}
|
|
if (this.currentRedistributeRecord) {
|
this.currentRedistributeRecord.reallocationReason = this.redistributionForm.reason;
|
this.$message.success("重分配原因已更新");
|
this.redistributionDialogVisible = false;
|
}
|
},
|
// 器官行样式
|
getOrganRowClassName({ row }) {
|
if (
|
!row.systemNo ||
|
!row.applicantTime ||
|
!row.recipientName ||
|
!row.transplantHospitalNo
|
) {
|
return "warning-row";
|
}
|
return "";
|
},
|
// 保存基本信息
|
handleSave() {
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
this.saveLoading = true;
|
const apiMethod = this.form.id
|
? updateOrganAllocation
|
: addOrganAllocation;
|
|
apiMethod(this.form)
|
.then(response => {
|
if (response.code === 200) {
|
this.$message.success("保存成功");
|
if (!this.form.id) {
|
this.form.id = response.data.id;
|
this.$router.replace({
|
query: { ...this.$route.query, id: this.form.id }
|
});
|
}
|
}
|
})
|
.catch(error => {
|
console.error("保存失败:", error);
|
this.$message.error("保存失败");
|
})
|
.finally(() => {
|
this.saveLoading = false;
|
});
|
}
|
});
|
},
|
// 保存分配记录
|
handleSaveAllocation() {
|
if (!this.form.id) {
|
this.$message.warning("请先保存基本信息");
|
return;
|
}
|
|
this.saveLoading = true;
|
saveAllocationRecords(this.form.id, this.allocationData.records)
|
.then(response => {
|
if (response.code === 200) {
|
this.$message.success("分配记录保存成功");
|
}
|
})
|
.catch(error => {
|
console.error("保存分配记录失败:", error);
|
this.$message.error("保存分配记录失败");
|
})
|
.finally(() => {
|
this.saveLoading = false;
|
});
|
},
|
// 确认完成分配
|
handleConfirmAllocation() {
|
if (this.incompleteRecords > 0) {
|
this.$message.warning("请先完善所有分配记录的信息");
|
return;
|
}
|
|
this.$confirm("确认完成器官分配吗?完成后将无法修改分配信息。", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
this.confirmLoading = true;
|
this.form.allocationStatus = "allocated";
|
this.form.allocationTime = new Date()
|
.toISOString()
|
.replace("T", " ")
|
.substring(0, 19);
|
|
updateOrganAllocation(this.form)
|
.then(response => {
|
if (response.code === 200) {
|
this.$message.success("器官分配已完成");
|
}
|
})
|
.catch(error => {
|
console.error("确认分配失败:", error);
|
this.$message.error("确认分配失败");
|
})
|
.finally(() => {
|
this.confirmLoading = false;
|
});
|
})
|
.catch(() => {});
|
},
|
// 上传附件
|
handleUploadAttachment() {
|
// 附件上传逻辑
|
this.$message.info("附件上传功能");
|
},
|
// 预览附件
|
handlePreviewAttachment(attachment) {
|
// 附件预览逻辑
|
this.$message.info("附件预览功能");
|
},
|
// 下载附件
|
handleDownloadAttachment(attachment) {
|
// 附件下载逻辑
|
this.$message.info("附件下载功能");
|
},
|
// 删除附件
|
handleRemoveAttachment(attachment) {
|
this.$confirm("确定要删除这个附件吗?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
this.$message.success("附件删除成功");
|
})
|
.catch(() => {});
|
},
|
// 获取文件图标
|
getFileIcon(fileName) {
|
const ext = fileName
|
.split(".")
|
.pop()
|
.toLowerCase();
|
const iconMap = {
|
pdf: "el-icon-document",
|
doc: "el-icon-document",
|
docx: "el-icon-document",
|
xls: "el-icon-document",
|
xlsx: "el-icon-document",
|
jpg: "el-icon-picture",
|
jpeg: "el-icon-picture",
|
png: "el-icon-picture"
|
};
|
return iconMap[ext] || "el-icon-document";
|
},
|
// 获取文件类型
|
getFileType(fileName) {
|
const ext = fileName
|
.split(".")
|
.pop()
|
.toLowerCase();
|
const typeMap = {
|
pdf: "PDF",
|
doc: "DOC",
|
docx: "DOCX",
|
xls: "XLS",
|
xlsx: "XLSX",
|
jpg: "JPG",
|
jpeg: "JPEG",
|
png: "PNG"
|
};
|
return typeMap[ext] || ext.toUpperCase();
|
},
|
// 文件大小格式化
|
formatFileSize(size) {
|
if (size === 0) return "0 B";
|
const k = 1024;
|
const sizes = ["B", "KB", "MB", "GB"];
|
const i = Math.floor(Math.log(size) / Math.log(k));
|
return parseFloat((size / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
},
|
// 时间格式化
|
parseTime(time) {
|
if (!time) return "";
|
const date = new Date(time);
|
return `${date.getFullYear()}-${(date.getMonth() + 1)
|
.toString()
|
.padStart(2, "0")}-${date
|
.getDate()
|
.toString()
|
.padStart(2, "0")} ${date
|
.getHours()
|
.toString()
|
.padStart(2, "0")}:${date
|
.getMinutes()
|
.toString()
|
.padStart(2, "0")}`;
|
}
|
}
|
};
|
</script>
|
|
<style scoped>
|
.organ-allocation-detail {
|
padding: 20px;
|
background-color: #f5f7fa;
|
}
|
|
.detail-card {
|
margin-bottom: 20px;
|
border-radius: 8px;
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
}
|
|
.allocation-card {
|
margin-bottom: 20px;
|
border-radius: 8px;
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
}
|
|
.attachment-card {
|
margin-bottom: 20px;
|
border-radius: 8px;
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
}
|
|
.detail-title {
|
font-size: 18px;
|
font-weight: 600;
|
color: #303133;
|
}
|
|
/* 统计信息样式 */
|
.allocation-stats {
|
margin-top: 20px;
|
padding: 15px;
|
background: linear-gradient(135deg, #9eb7e5 0%, #53519c 100%);
|
border-radius: 8px;
|
color: white;
|
font-size: 18px;
|
}
|
|
.stat-item {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
padding: 10px;
|
}
|
|
.stat-label {
|
/* font-size: 12px; */
|
opacity: 0.9;
|
|
/* color: #606266; */
|
margin-bottom: 5px;
|
}
|
|
.stat-value {
|
font-size: 20px;
|
font-weight: bold;
|
/* color: #303133; */
|
}
|
|
/* 空状态样式 */
|
.empty-allocation {
|
text-align: center;
|
padding: 40px 0;
|
color: #909399;
|
}
|
|
/* 对话框底部按钮 */
|
.dialog-footer {
|
margin-top: 20px;
|
text-align: center;
|
padding-top: 20px;
|
border-top: 1px solid #e4e7ed;
|
}
|
|
/* 表格行样式 */
|
:deep(.warning-row) {
|
background-color: #fff7e6;
|
}
|
|
:deep(.warning-row:hover) {
|
background-color: #ffecc2;
|
}
|
|
/* 响应式设计 */
|
@media (max-width: 768px) {
|
.organ-allocation-detail {
|
padding: 10px;
|
}
|
|
.allocation-stats .el-col {
|
margin-bottom: 10px;
|
}
|
}
|
</style>
|