|
@@ -1,17 +1,21 @@
|
|
|
<template>
|
|
|
<div class="collapseStyle">
|
|
|
+
|
|
|
<el-scrollbar style="border: 1px solid #ebeef5" :height="tableHeight">
|
|
|
<el-collapse accordion v-model="activeNames" >
|
|
|
+ <el-segmented v-model="value" :options="options" size="large" @change="materialChange"/>
|
|
|
<el-collapse-item v-for="(item, index) in materialsData" :key="index" :title="item.opName" :name="index">
|
|
|
+
|
|
|
<el-table :data="item.children" border>
|
|
|
<el-table-column prop="itemName" label="物料名称" />
|
|
|
<el-table-column prop="itemModel" label="物料规格" />
|
|
|
<el-table-column prop="itemCode" label="物料编号" />
|
|
|
- <el-table-column prop="itemSeq" label="采集编码" />
|
|
|
- <el-table-column prop="batchNo" label="批次号/管号" />
|
|
|
- <el-table-column prop="replaceBatchNo" label="替换批次号" />
|
|
|
- <el-table-column prop="needNum" label="需求数量" />
|
|
|
- <el-table-column prop="realNum" label="已采集数量" />
|
|
|
+<!-- <el-table-column prop="itemSeq" label="采集编码" />-->
|
|
|
+ <el-table-column prop="batchNo" label="批次号" />
|
|
|
+ <el-table-column prop="seqNo" label="管号" />
|
|
|
+ <el-table-column v-if="value==='host'" prop="replaceBatchNo" label="替换批次号" />
|
|
|
+ <el-table-column v-if="value==='host'" prop="needNum" label="需求数量" />
|
|
|
+ <el-table-column v-if="value==='host'" prop="realNum" label="已采集数量" />
|
|
|
</el-table>
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
@@ -23,7 +27,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { useProcessStore } from "@/store";
|
|
|
-import { getMaterialsInfo } from "@/api/process/traceability";
|
|
|
+import {getAccessoryMaterialsInfo, getMaterialsInfo} from "@/api/process/traceability";
|
|
|
const store = useProcessStore();
|
|
|
const activeNames = ref([0]);
|
|
|
const page = ref(1);
|
|
@@ -31,6 +35,19 @@ const limit = ref(10);
|
|
|
const total = ref(10);
|
|
|
const materialsData = ref([]);
|
|
|
const tableHeight = ref(null);
|
|
|
+const value = ref('host')
|
|
|
+
|
|
|
+const options = [
|
|
|
+ {
|
|
|
+ label: '主料记录',
|
|
|
+ value: 'host'
|
|
|
+
|
|
|
+},
|
|
|
+{
|
|
|
+ label: '辅料记录',
|
|
|
+ value: 'auxiliary',
|
|
|
+},
|
|
|
+]
|
|
|
const getPagination = async () => {
|
|
|
const { data } = await getMaterialsInfo({
|
|
|
pageNo: page.value,
|
|
@@ -41,6 +58,23 @@ const getPagination = async () => {
|
|
|
total.value = data.totalCount;
|
|
|
materialsData.value = data.records;
|
|
|
};
|
|
|
+const getAccessoryPagination = async () => {
|
|
|
+ const { data } = await getAccessoryMaterialsInfo({
|
|
|
+ pageNo: page.value,
|
|
|
+ pageSize: limit.value,
|
|
|
+ seqNo: store.useSeqNo,
|
|
|
+ workOrderCode: store.odersData.workOrderCode,
|
|
|
+ });
|
|
|
+ total.value = data.totalCount;
|
|
|
+ materialsData.value = data.records;
|
|
|
+};
|
|
|
+const materialChange = () =>{
|
|
|
+ if(value.value==="auxiliary"){
|
|
|
+ getAccessoryPagination();
|
|
|
+ }else{
|
|
|
+ getPagination();
|
|
|
+ }
|
|
|
+}
|
|
|
//动态控制高度
|
|
|
const setTableHeight = () => {
|
|
|
tableHeight.value =
|