<template>
|
<Card>
|
<div class="header-title-left">
|
<img src="@/assets/public/headercard.png" />
|
<div>所属实验调度</div>
|
</div>
|
<Table :data="schedulingData" :total="schedulingTotal" :height="null">
|
<template>
|
<el-table-column type="index" label="序号" width="80"></el-table-column>
|
<el-table-column prop="projectName" label="所属项目课题方案"></el-table-column>
|
<el-table-column prop="experimentCode" label="实验编号"></el-table-column>
|
<el-table-column prop="experimentName" label="实验名称"></el-table-column>
|
<el-table-column prop="experimentDate" label="通知时间"></el-table-column>
|
<el-table-column prop="experimentStartTime" label="实验开始时间"></el-table-column>
|
<el-table-column prop="experimentEndTime" label="实验结束时间"></el-table-column>
|
<el-table-column prop="participantsName" label="参加人员"></el-table-column>
|
<el-table-column prop="status" label="状态">
|
<template slot-scope="scope">
|
<el-tag :type="getStatusType(scope.row.status)">
|
{{ getStatusText(scope.row.status) }}
|
</el-tag>
|
</template>
|
</el-table-column>
|
</template>
|
</Table>
|
|
<!-- 送样-收样记录部分 -->
|
<div class="sample-record-section">
|
<div class="header-title-left" style="margin-top: 38px">
|
<img src="@/assets/public/headercard.png" />
|
<span>送样-收样记录</span>
|
<el-button type="primary" class="el-icon-plus" @click="showPendingColumns = !showPendingColumns">
|
{{ showPendingColumns ? "收起待收样详情" : "展开待收样详情" }}
|
</el-button>
|
<el-button type="primary" class="el-icon-plus" @click="showReceivedColumns = !showReceivedColumns">
|
{{ showReceivedColumns ? "收起已收样详情" : "展开已收样详情" }}
|
</el-button>
|
</div>
|
<div class="sample-code">
|
取样单编号:{{ form.sampleCode || "DD-25010BS01" }}
|
</div>
|
|
<!-- 待收样列表 -->
|
<div class="pending-samples">
|
<div class="sub-title">待收样列表</div>
|
<Table ref="pendingTable"
|
:data="pendingSamples"
|
:total="pendingSamplesTotal"
|
:height="null">
|
<template>
|
<el-table-column type="index" label="序号" width="80"></el-table-column>
|
<el-table-column prop="samplingName" label="取样名称" width="200"></el-table-column>
|
<el-table-column prop="sampleCode" label="取样样品编号" width="200"></el-table-column>
|
<el-table-column prop="temperature" label="温度" width="150"></el-table-column>
|
<el-table-column prop="samplePh" label="PH" width="150"></el-table-column>
|
<el-table-column prop="waterAddition" label="加水量" width="150"></el-table-column>
|
<template v-if="showPendingColumns">
|
<el-table-column prop="addAuxiliaryOne" label="加辅1" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryTwo" label="加辅2" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryThree" label="加辅3" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryFour" label="加辅4" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryFive" label="加辅5" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliarySix" label="加辅6" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliarySeven" label="加辅7" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryEight" label="加辅8" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryNine" label="加辅9" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryTen" label="加辅10" width="150"></el-table-column>
|
</template>
|
<el-table-column prop="sampleAmount" label="取样量" width="150"></el-table-column>
|
<el-table-column prop="receiptsTime" label="收样时间" width="150"></el-table-column>
|
<el-table-column prop="receiptsPersonName" label="收样人" width="150"></el-table-column>
|
<el-table-column label="状态" prop="status" width="100" fixed="right">
|
<template slot-scope="scope">
|
<span>{{ scope.row.status == '2' ? '待接收' : '已接收' }}</span>
|
</template>
|
</el-table-column>
|
</template>
|
</Table>
|
</div>
|
|
<!-- 已收样列表 -->
|
<div class="received-samples">
|
<div class="sub-title">已收样列表</div>
|
<Table ref="receivedTable" :data="receivedSamples" :total="receivedSamplesTotal" :height="null">
|
<template>
|
<el-table-column type="index" label="序号" width="80"></el-table-column>
|
<el-table-column prop="samplingName" label="取样名称" width="150"></el-table-column>
|
<el-table-column prop="sampleCode" label="取样样品编号" width="150"></el-table-column>
|
<el-table-column prop="temperature" label="温度" width="150"></el-table-column>
|
<el-table-column prop="samplePh" label="PH" width="150"></el-table-column>
|
<el-table-column prop="waterAddition" label="加水量" width="150"></el-table-column>
|
<template v-if="showReceivedColumns">
|
<el-table-column prop="addAuxiliaryOne" label="加辅1" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryTwo" label="加辅2" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryThree" label="加辅3" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryFour" label="加辅4" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryFive" label="加辅5" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliarySix" label="加辅6" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliarySeven" label="加辅7" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryEight" label="加辅8" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryNine" label="加辅9" width="150"></el-table-column>
|
<el-table-column prop="addAuxiliaryTen" label="加辅10" width="150"></el-table-column>
|
</template>
|
<el-table-column prop="sampleAmount" label="取样量" width="150"></el-table-column>
|
<el-table-column prop="sendTime" label="送样时间" width="150"></el-table-column>
|
<el-table-column prop="sendPersonName" label="送样人" width="150"></el-table-column>
|
<el-table-column prop="receiptsTime" label="收样时间" width="150"></el-table-column>
|
<el-table-column prop="receiptsPersonName" label="收样人" width="150"></el-table-column>
|
<el-table-column label="状态" prop="status" width="100" fixed="right">
|
<template slot-scope="scope">
|
<span>{{ scope.row.status == '3' ? '已接收' : '待接收' }}</span>
|
</template>
|
</el-table-column>
|
</template>
|
</Table>
|
</div>
|
</div>
|
</Card>
|
</template>
|
|
<script>
|
import { getDetail } from "../sampleManage/service";
|
|
export default {
|
name: "SampleDeliveryRecord",
|
data() {
|
return {
|
showPendingColumns: false,
|
showReceivedColumns: false,
|
schedulingData: [],
|
schedulingTotal: 0,
|
form: {
|
sampleCode: "",
|
id: "",
|
},
|
pendingSamples: [],
|
pendingSamplesTotal: 0,
|
receivedSamples: [],
|
receivedSamplesTotal: 0,
|
statusTypeMap: {
|
"-1": "info",
|
"1": "warning",
|
"2": "success",
|
"3": "info"
|
},
|
statusTextMap: {
|
"-1": "草稿箱",
|
"1": "待确认",
|
"2": "已确认",
|
"3": "已封存"
|
},
|
};
|
},
|
created() {
|
const { id } = this.$route.query;
|
if (id) {
|
this.form.id = id;
|
this.getDetailData(id);
|
}
|
},
|
methods: {
|
async getDetailData(id) {
|
try {
|
const res = await getDetail({ id });
|
if (res) {
|
const detail = res;
|
this.form = {
|
...this.form,
|
...detail,
|
sampleCode: detail.samplingCode,
|
};
|
|
if (detail.experimentDispatch) {
|
this.schedulingData = [detail.experimentDispatch];
|
}
|
|
if (detail.samplingRecordOperations && detail.samplingRecordOperations.length > 0) {
|
this.pendingSamples = detail.samplingRecordOperations
|
.filter(item => String(item.status) === '2')
|
.map(item => ({
|
...item,
|
status: String(item.status)
|
}));
|
this.pendingSamplesTotal = this.pendingSamples.length;
|
|
this.receivedSamples = detail.samplingRecordOperations
|
.filter(item => String(item.status) === '3')
|
.map(item => ({
|
...item,
|
status: String(item.status)
|
}));
|
this.receivedSamplesTotal = this.receivedSamples.length;
|
}
|
}
|
} catch (error) {
|
console.error('获取详情失败:', error);
|
this.$message.error('获取详情失败,请重试');
|
}
|
},
|
getStatusType(status) {
|
return this.statusTypeMap[status] || 'info';
|
},
|
getStatusText(status) {
|
return this.statusTextMap[status] || '未知状态';
|
},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.header-title-left {
|
display: flex;
|
align-items: center;
|
gap: 13px;
|
margin-bottom: 20px;
|
|
img {
|
width: 12px;
|
height: 19px;
|
}
|
|
div,
|
span {
|
flex-shrink: 0;
|
font-weight: bold;
|
font-size: 18px;
|
color: #222222;
|
line-height: 27px;
|
font-family: "Source Han Sans CN Bold Bold";
|
}
|
|
div:before {
|
content: "*";
|
color: #f56c6c;
|
margin-right: 4px;
|
}
|
|
.el-button {
|
margin-left: 16px;
|
}
|
}
|
|
.sample-record-section {
|
.sample-code {
|
font-family: PingFangSC, PingFang SC;
|
font-weight: 400;
|
font-size: 14px;
|
color: rgba(0, 0, 0, 0.88);
|
margin: 20px 0;
|
}
|
|
.sub-title {
|
font-size: 16px;
|
font-weight: 500;
|
color: #333;
|
margin: 20px 0;
|
display: inline-block;
|
}
|
|
.pending-samples,
|
.received-samples {
|
margin-top: 20px;
|
}
|
}
|
</style>
|