| | |
| | | </div> |
| | | <Table :data="schedulingData" :total="schedulingTotal" :height="null"> |
| | | <template> |
| | | <el-table-column |
| | | prop="planCode" |
| | | 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="notifyTime" label="通知时间"></el-table-column> |
| | | <el-table-column |
| | | prop="startTime" |
| | | label="实验开始时间" |
| | | ></el-table-column> |
| | | <el-table-column prop="endTime" label="实验结束时间"></el-table-column> |
| | | <el-table-column prop="participants" label="参加人员"></el-table-column> |
| | | <el-table-column prop="status" label="状态"></el-table-column> |
| | | <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="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 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="sample-code">待收样列表</div> |
| | | |
| | | <div class="sample-table"> |
| | | <Table |
| | | :data="sampleList" |
| | | :total="sampleTotal" |
| | | :height="null" |
| | | style="width: 100%" |
| | | > |
| | | <!-- 待收样列表 --> |
| | | <div class="pending-samples"> |
| | | <div class="sub-title">待收样列表</div> |
| | | <Table ref="pendingTable" |
| | | :data="pendingSamples" |
| | | :total="pendingSamplesTotal" |
| | | :height="null"> |
| | | <template> |
| | | <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="取样名称" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="sampleCode" |
| | | label="取样样品编号" |
| | | min-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" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive2" |
| | | label="加辅2" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive3" |
| | | label="加辅3" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive4" |
| | | label="加辅4" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive5" |
| | | label="加辅5" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive6" |
| | | label="加辅6" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive7" |
| | | label="加辅7" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive8" |
| | | label="加辅8" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive9" |
| | | label="加辅9" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive10" |
| | | label="加辅10" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <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="100" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="sampleTime" |
| | | label="取样时间" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column prop="photo" label="拍照" width="100"> |
| | | <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"> |
| | | <img |
| | | v-if="scope.row.photo" |
| | | :src="scope.row.photo" |
| | | class="sample-photo" |
| | | /> |
| | | <span>{{ scope.row.status == '2' ? '待接收' : '已接收' }}</span> |
| | | </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> |
| | | </template> |
| | | </Table> |
| | | </div> |
| | | <div class="received-samples"> |
| | | <div style="display: flex; align-items: center"> |
| | | <div class="sample-code">已收样列表</div> |
| | | |
| | | <el-button |
| | | type="primary" |
| | | class="el-icon-plus" |
| | | style="margin-left: 16px" |
| | | @click="showReceivedColumns = !showReceivedColumns" |
| | | > |
| | | {{ showReceivedColumns ? "收起辅料详情" : "展开辅料详情" }} |
| | | </el-button> |
| | | </div> |
| | | <Table |
| | | :data="receivedSamples" |
| | | :total="receivedSamplesTotal" |
| | | :height="null" |
| | | style="width: 100%" |
| | | > |
| | | <!-- 已收样列表 --> |
| | | <div class="received-samples"> |
| | | <div class="sub-title">已收样列表</div> |
| | | <Table ref="receivedTable" :data="receivedSamples" :total="receivedSamplesTotal" :height="null"> |
| | | <template> |
| | | <el-table-column |
| | | prop="index" |
| | | label="序号" |
| | | width="80" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="sampleName" |
| | | label="取样名称" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="sampleCode" |
| | | label="取样样品编号" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="temperature" |
| | | label="温度" |
| | | width="100" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="waterAmount" |
| | | label="加水量" |
| | | width="100" |
| | | ></el-table-column> |
| | | <el-table-column prop="ph" label="PH" width="100"></el-table-column> |
| | | <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="additive1" |
| | | label="加辅1" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive2" |
| | | label="加辅2" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive3" |
| | | label="加辅3" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive4" |
| | | label="加辅4" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="additive5" |
| | | label="加辅5" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <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="100" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="sendTime" |
| | | label="送样时间" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="sender" |
| | | label="送样人" |
| | | width="100" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="receiveTime" |
| | | label="收样时间" |
| | | min-width="150" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="receiver" |
| | | label="收样人" |
| | | width="100" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | prop="status" |
| | | label="状态" |
| | | width="100" |
| | | fixed="right" |
| | | ></el-table-column> |
| | | <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> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDetail } from "../sampleManage/service"; |
| | | |
| | | export default { |
| | | name: "SampleSubmission", |
| | | name: "SampleDeliveryRecord", |
| | | data() { |
| | | return { |
| | | showAdditives: true, |
| | | showReceivedColumns: 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, |
| | | showPendingColumns: false, |
| | | showReceivedColumns: false, |
| | | schedulingData: [], |
| | | schedulingTotal: 0, |
| | | form: { |
| | | sampleCode: "DD-25010BS01", |
| | | sampleCode: "", |
| | | id: "", |
| | | }, |
| | | 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: "待发送", |
| | | pendingSamples: [], |
| | | pendingSamplesTotal: 0, |
| | | receivedSamples: [], |
| | | receivedSamplesTotal: 0, |
| | | statusTypeMap: { |
| | | "-1": "info", |
| | | "1": "warning", |
| | | "2": "success", |
| | | "3": "info" |
| | | }, |
| | | { |
| | | 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: "待接收", |
| | | statusTextMap: { |
| | | "-1": "草稿箱", |
| | | "1": "待确认", |
| | | "2": "已确认", |
| | | "3": "已封存" |
| | | }, |
| | | { |
| | | 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, |
| | | }; |
| | | }, |
| | | 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> |
| | |
| | | margin: 20px 0; |
| | | } |
| | | |
| | | .table-header { |
| | | margin-bottom: 16px; |
| | | text-align: left; |
| | | .sub-title { |
| | | font-size: 16px; |
| | | font-weight: 500; |
| | | color: #333; |
| | | margin: 20px 0; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .sample-photo { |
| | | width: 60px; |
| | | height: 60px; |
| | | object-fit: cover; |
| | | .pending-samples, |
| | | .received-samples { |
| | | margin-top: 20px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="list"> |
| | | <TableCustom :queryForm="form" :tableData="tableData" :total="total"> |
| | | <TableCustom :queryForm="form" :height="null" :tableData="tableData" :total="total" |
| | | @handlePageChange="handlePageChange" @handleSizeChange="handleSizeChange"> |
| | | <template #search> |
| | | <el-form :model="form" labelWidth="auto" inline> |
| | | <el-form-item label="项目课题方案名称:"> |
| | | <el-input v-model="form.planName" placeholder="请输入"></el-input> |
| | | <el-form-item label="所属项目课题方案:"> |
| | | <el-input v-model="form.projectName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="实验编号:"> |
| | | <el-input v-model="form.planCode" placeholder="请输入"></el-input> |
| | | <el-input v-model="form.experimentCode" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="实验名称:"> |
| | | <el-input v-model="form.experimentName" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="创建人:"> |
| | | <el-input v-model="form.creator" placeholder="请输入"></el-input> |
| | | <el-input v-model="form.createBy" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间:"> |
| | | <el-date-picker |
| | | v-model="form.createTime" |
| | | v-model="form.timeRange" |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="实验名称:"> |
| | | <el-input v-model="form.planCode" placeholder="请输入"></el-input> |
| | | @change="handleTimeChange"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label=""> |
| | | <el-button type="default" @click="resetForm">重置</el-button> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | <el-button type="primary" @click="handleSearch" style="margin-left: 10px;">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | <template #setting> |
| | | <div class="tableTitle"> |
| | | <div class="flex a-center"> |
| | | <div class="title">待接收样品列表</div> |
| | | <div class="title active">待接收样品列表</div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template #table> |
| | | <el-table-column |
| | | prop="planName" |
| | | label="所属项目课题方案" |
| | | ></el-table-column> |
| | | <el-table-column prop="experimentNo" label="实验编号"></el-table-column> |
| | | <el-table-column |
| | | prop="experimentName" |
| | | label="实验名称" |
| | | ></el-table-column> |
| | | <el-table-column prop="sampleNo" label="取样单编号"></el-table-column> |
| | | <el-table-column prop="creator" label="创建人"></el-table-column> |
| | | <el-table-column prop="createTime" label="创建时间"></el-table-column> |
| | | <el-table-column |
| | | prop="sampleStatus" |
| | | label="样品总数/待接收/已接收" |
| | | ></el-table-column> |
| | | <el-table-column label="操作" width="100"> |
| | | <el-table-column v-for="(column, index) in columns" :key="index" :prop="column.prop" |
| | | :label="column.label"></el-table-column> |
| | | <el-table-column label="样品总数/待送达/待接收/已接收"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleDetail(scope.row)" |
| | | >详情</el-button |
| | | > |
| | | {{ getSampleStatus(scope.row) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleDetail(scope.row.id)">详情</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList } from './service' |
| | | |
| | | export default { |
| | | name: "ProjectList", |
| | | data() { |
| | | return { |
| | | form: { |
| | | planName: "", |
| | | planCode: "", |
| | | creator: "", |
| | | createTime: [], |
| | | approver: "", |
| | | status: "", |
| | | experimentCode: "", |
| | | experimentName: "", |
| | | projectName: "", |
| | | createBy: "", |
| | | startTime: "", |
| | | endTime: "", |
| | | timeRange: [], |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }, |
| | | tableData: [], |
| | | total: 0, |
| | | // 模拟数据 |
| | | mockListData: [ |
| | | { |
| | | planCode: "PLAN-2024-001", |
| | | planName: "2024年度实验室设备升级方案", |
| | | stage: "规划阶段", |
| | | creator: "张三", |
| | | createTime: "2024-03-15", |
| | | status: "pending", |
| | | approver: "李四", |
| | | approveTime: "2024-03-16", |
| | | }, |
| | | { |
| | | planCode: "PLAN-2024-002", |
| | | planName: "实验室安全管理制度更新方案", |
| | | stage: "实施阶段", |
| | | creator: "王五", |
| | | createTime: "2024-03-14", |
| | | status: "approved", |
| | | approver: "赵六", |
| | | approveTime: "2024-03-15", |
| | | }, |
| | | { |
| | | planCode: "PLAN-2024-003", |
| | | planName: "实验室人员培训计划", |
| | | stage: "准备阶段", |
| | | creator: "孙七", |
| | | createTime: "2024-03-13", |
| | | status: "rejected", |
| | | approver: "周八", |
| | | approveTime: "2024-03-14", |
| | | }, |
| | | ], |
| | | columns: [ |
| | | { prop: 'projectName', label: '所属项目课题方案' }, |
| | | { prop: 'experimentCode', label: '实验编号' }, |
| | | { prop: 'experimentName', label: '实验名称' }, |
| | | { prop: 'samplingCode', label: '取样单编号' }, |
| | | { prop: 'createBy', label: '创建人' }, |
| | | { prop: 'createTime', label: '创建时间' } |
| | | ] |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | methods: { |
| | | resetForm() { |
| | | this.form = { |
| | | planName: "", |
| | | planCode: "", |
| | | creator: "", |
| | | createTime: [], |
| | | approver: "", |
| | | status: "", |
| | | experimentCode: "", |
| | | experimentName: "", |
| | | projectName: "", |
| | | createBy: "", |
| | | startTime: "", |
| | | endTime: "", |
| | | timeRange: [], |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }; |
| | | this.handleSearch(); |
| | | }, |
| | | handleSearch() { |
| | | // 实现查询逻辑 |
| | | console.log("查询条件:", this.form); |
| | | this.getTableData(); |
| | | handleTimeChange(val) { |
| | | if (val) { |
| | | this.form.startTime = val[0]; |
| | | this.form.endTime = val[1]; |
| | | } else { |
| | | this.form.startTime = ""; |
| | | this.form.endTime = ""; |
| | | } |
| | | }, |
| | | handleDetail(row) { |
| | | async handleSearch() { |
| | | const params = { |
| | | experimentCode: this.form.experimentCode, |
| | | experimentName: this.form.experimentName, |
| | | projectName: this.form.projectName, |
| | | createBy: this.form.createBy, |
| | | startTime: this.form.startTime, |
| | | endTime: this.form.endTime, |
| | | pageNum: this.form.pageNum, |
| | | pageSize: this.form.pageSize |
| | | }; |
| | | try { |
| | | const res = await getList(params) |
| | | this.tableData = res.data.records || []; |
| | | this.total = res.data.total || 0; |
| | | } catch (error) { |
| | | console.error("查询失败:", error); |
| | | } |
| | | }, |
| | | getStatusType(status) { |
| | | const statusMap = { |
| | | '-1': 'info', |
| | | '1': 'warning', |
| | | '2': 'success', |
| | | '3': 'info' |
| | | }; |
| | | return statusMap[status] || 'info'; |
| | | }, |
| | | getStatusText(status) { |
| | | const statusMap = { |
| | | '-1': '草稿箱', |
| | | '1': '待提交', |
| | | '2': '已提交', |
| | | '3': '已封存' |
| | | }; |
| | | return statusMap[status] || '未知'; |
| | | }, |
| | | handleDetail(id) { |
| | | this.$router.push({ |
| | | path: "/dataManagement/delivery", |
| | | query: { |
| | | id: row.id, |
| | | type: "view", |
| | | }, |
| | | id: id, |
| | | type: 'detail' |
| | | } |
| | | }); |
| | | }, |
| | | getTableData() { |
| | | // 获取列表数据 |
| | | this.tableData = this.mockListData; |
| | | this.total = this.mockListData.length; |
| | | this.handleSearch(); |
| | | }, |
| | | handlePageChange(pageNum) { |
| | | this.form.pageNum = pageNum; |
| | | this.getTableData(); |
| | | }, |
| | | handleSizeChange(pageSize) { |
| | | this.form.pageSize = pageSize; |
| | | this.getTableData(); |
| | | }, |
| | | getSampleStatus(row) { |
| | | const send = row.sendCount || 0; |
| | | const receive = row.receiveCount || 0; |
| | | const received = row.receivedCount || 0; |
| | | const total = send + receive + received; |
| | | return `${total} / ${send} / ${receive} / ${received}`; |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
New file |
| | |
| | | import axios from '@/utils/request'; |
| | | |
| | | // 列表 |
| | | export const getList = (data) => { |
| | | return axios.post('/api/t-sampling-record/pageList', { ...data }) |
| | | } |
| | | // 详情 |
| | | export const getDetail = (data) => { |
| | | return axios.get('/open/t-sampling-record/getDetailById', { params:data }) |
| | | } |
| | | //添加 |
| | | export const add = (data) => { |
| | | return axios.post('/api/t-sampling-record/add', { ...data }) |
| | | } |
| | | //修改 |
| | | export const update = (data) => { |
| | | return axios.post('/api/t-sampling-record/update', { ...data }) |
| | | } |
| | | //删除 |
| | | export const deleteById = (data) => { |
| | | return axios.delete('/open/t-sampling-record/deleteById', { params:data }) |
| | | } |
| | | //批量删除 |
| | | export const deleteByIds = (data) => { |
| | | return axios.delete('/open/t-sampling-record/deleteByIds', { params:data }) |
| | | } |
| | | |
| | | // 实验员提交记录 |
| | | export const commitRecord = (data) => { |
| | | return axios.post('/api/t-sampling-record/commitRecord', { ...data }) |
| | | } |
| | | // 修改取样操作记录 |
| | | export const updateRecordOperation = (data) => { |
| | | return axios.post('/api/t-sampling-record/updateRecordOperation', { params:data }) |
| | | } |
| | | // 批量收样 |
| | | export const batchCollectSamples = (data) => { |
| | | return axios.post('/open/t-sampling-record/batchCollectSamples', { params:data }) |
| | | } |
| | | // 批量送样 |
| | | export const batchSendSamples = (data) => { |
| | | return axios.post('/open/t-sampling-record/batchSendSamples', { ...data }) |
| | | } |
| | | |
| | | // 获取实验调度列表 |
| | | export const getDispatchList = (data) => { |
| | | return axios.post('/api/t-experiment-dispatch/pageList', { params:data }) |
| | | } |