<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 prop="planCode" label="所属项目课题方案" width="150"></el-table-column>
|
<el-table-column prop="experimentCode" label="实验编号" width="150"></el-table-column>
|
<el-table-column prop="experimentName" label="实验名称" width="150"></el-table-column>
|
<el-table-column prop="notifyTime" label="通知时间" width="150"></el-table-column>
|
<el-table-column prop="startTime" label="实验开始时间" width="150"></el-table-column>
|
<el-table-column prop="endTime" label="实验结束时间" width="150"></el-table-column>
|
<el-table-column prop="participants" label="参加人员" width="150"></el-table-column>
|
<el-table-column prop="status" label="状态" width="100"></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="showAdditives = !showAdditives"
|
>
|
{{ showAdditives ? "收起辅料详情" : "展开辅料详情" }}
|
</el-button>
|
</div>
|
<div class="sample-code">取样单编号:{{ form.sampleCode || 'DD-25010BS01' }}</div>
|
|
<div class="sample-table">
|
<div class="table-header">
|
<el-button type="primary" class="batch-send" @click="handleBatchSend">批量发送</el-button>
|
</div>
|
<Table :data="sampleList" :total="sampleTotal" :height="null" @selection-change="handleSelectionChange">
|
<template>
|
<el-table-column type="selection" width="55"></el-table-column>
|
<el-table-column prop="index" label="序号" width="80"></el-table-column>
|
<el-table-column prop="processTime" label="工艺时间间/h" width="120"></el-table-column>
|
<el-table-column prop="sampleName" label="取样名称" width="150"></el-table-column>
|
<el-table-column prop="sampleCode" label="取样样品编号" width="150"></el-table-column>
|
<el-table-column prop="temperature" label="温度" width="100"></el-table-column>
|
<el-table-column prop="ph" label="PH" width="100"></el-table-column>
|
<el-table-column prop="waterAmount" label="加水量" width="100"></el-table-column>
|
<template v-if="showAdditives">
|
<el-table-column prop="additive1" label="加辅1" width="150"></el-table-column>
|
<el-table-column prop="additive2" label="加辅2" width="150"></el-table-column>
|
<el-table-column prop="additive3" label="加辅3" width="150"></el-table-column>
|
<el-table-column prop="additive4" label="加辅4" width="150"></el-table-column>
|
<el-table-column prop="additive5" label="加辅5" width="150"></el-table-column>
|
<el-table-column prop="additive6" label="加辅6" width="150"></el-table-column>
|
<el-table-column prop="additive7" label="加辅7" width="150"></el-table-column>
|
<el-table-column prop="additive8" label="加辅8" width="150"></el-table-column>
|
<el-table-column prop="additive9" label="加辅9" width="150"></el-table-column>
|
<el-table-column prop="additive10" label="加辅10" width="150"></el-table-column>
|
</template>
|
<el-table-column prop="sampleAmount" label="取样量" width="100"></el-table-column>
|
<el-table-column prop="sampleTime" label="取样时间" width="150"></el-table-column>
|
<el-table-column prop="photo" label="拍照" width="100">
|
<template slot-scope="scope">
|
<img v-if="scope.row.photo" :src="scope.row.photo" class="sample-photo" />
|
</template>
|
</el-table-column>
|
<el-table-column prop="operator" label="操作人" width="100"></el-table-column>
|
<el-table-column prop="status" label="状态" width="100"></el-table-column>
|
<el-table-column label="操作" width="100" fixed="right">
|
<template slot-scope="scope">
|
<el-button type="text" @click="handleSend(scope.row)" v-if="scope.row.status === '待发送'">发送</el-button>
|
</template>
|
</el-table-column>
|
</template>
|
</Table>
|
</div>
|
</div>
|
|
<receive-confirm-dialog
|
:visible.sync="showReceiveConfirm"
|
:sample-count="selectedSamples.length"
|
@confirm="confirmSend"
|
/>
|
</Card>
|
</template>
|
|
<script>
|
import ReceiveConfirmDialog from './components/receiveConfirmDialog.vue'
|
|
export default {
|
name: "SampleSubmission",
|
components: {
|
ReceiveConfirmDialog
|
},
|
data() {
|
return {
|
showReceiveConfirm: false,
|
showAdditives: true,
|
schedulingData: [{
|
planCode: 'DD-EX001',
|
experimentCode: 'DD-EX001',
|
experimentName: '名称名称名称',
|
notifyTime: '2025-1-2 14:50:19',
|
startTime: '2025-02-27',
|
endTime: '2025-06-06',
|
participants: '张弘, 李天浩, 陈三, 李四',
|
status: '已确认'
|
}],
|
schedulingTotal: 1,
|
form: {
|
sampleCode: "DD-25010BS01",
|
},
|
sampleList: [
|
{
|
index: 1,
|
processTime: "2",
|
sampleName: "名称名称名称",
|
sampleCode: "314234321",
|
temperature: "34",
|
ph: "34",
|
waterAmount: "34",
|
additive1: "10g",
|
additive2: "5g",
|
additive3: "3g",
|
additive4: "",
|
additive5: "",
|
additive6: "",
|
additive7: "",
|
additive8: "",
|
additive9: "",
|
additive10: "",
|
sampleAmount: "34",
|
sampleTime: "2025-1-9 15:26:08",
|
photo: "@/assets/sample-photos/photo1.jpg",
|
operator: "张三",
|
status: "待发送"
|
},
|
{
|
index: 2,
|
processTime: "4",
|
sampleName: "名称名称名称",
|
sampleCode: "314234321",
|
temperature: "23",
|
ph: "23",
|
waterAmount: "23",
|
additive1: "8g",
|
additive2: "4g",
|
additive3: "",
|
additive4: "",
|
additive5: "",
|
additive6: "",
|
additive7: "",
|
additive8: "",
|
additive9: "",
|
additive10: "",
|
sampleAmount: "23",
|
sampleTime: "2025-1-9 15:26:08",
|
photo: "@/assets/sample-photos/photo2.jpg",
|
operator: "李四",
|
status: "待接收"
|
},
|
{
|
index: 3,
|
processTime: "8",
|
sampleName: "名称名称名称",
|
sampleCode: "314234321",
|
temperature: "23",
|
ph: "23",
|
waterAmount: "23",
|
additive1: "",
|
additive2: "",
|
additive3: "",
|
additive4: "",
|
additive5: "",
|
additive6: "",
|
additive7: "",
|
additive8: "",
|
additive9: "",
|
additive10: "",
|
sampleAmount: "23",
|
sampleTime: "2025-1-9 15:26:08",
|
photo: "@/assets/sample-photos/photo3.jpg",
|
operator: "王五",
|
status: "已接收"
|
}
|
],
|
sampleTotal: 3,
|
selectedSamples: []
|
};
|
},
|
methods: {
|
handleSelectionChange(selection) {
|
this.selectedSamples = selection;
|
},
|
handleSend(row) {
|
this.selectedSamples = [row];
|
this.showReceiveConfirm = true;
|
},
|
handleBatchSend() {
|
if (this.selectedSamples.length === 0) {
|
this.$message.warning('请先选择要发送的样品');
|
return;
|
}
|
this.showReceiveConfirm = true;
|
},
|
confirmSend(signature) {
|
// 处理发送确认逻辑
|
const sampleIds = this.selectedSamples.map(item => item.id);
|
console.log('发送样品', { sampleIds, signature });
|
|
// 更新状态
|
this.selectedSamples.forEach(sample => {
|
const index = this.sampleList.findIndex(item => item.id === sample.id);
|
if (index > -1) {
|
this.sampleList[index].status = '待接收';
|
}
|
});
|
|
this.$message.success(`成功发送 ${this.selectedSamples.length} 个样品`);
|
this.selectedSamples = [];
|
}
|
}
|
};
|
</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;
|
}
|
|
.table-header {
|
margin-bottom: 16px;
|
text-align: left;
|
}
|
|
.sample-photo {
|
width: 60px;
|
height: 60px;
|
object-fit: cover;
|
}
|
}
|
</style>
|