|
@@ -85,7 +85,7 @@
|
|
|
label="已采物料"
|
|
|
class="tabpaneBox"
|
|
|
>
|
|
|
- <template #label>
|
|
|
+<!-- <template #label>
|
|
|
<span
|
|
|
>已采物料
|
|
|
<el-badge
|
|
@@ -94,9 +94,45 @@
|
|
|
type="primary"
|
|
|
/>
|
|
|
</span>
|
|
|
- </template>
|
|
|
- <MaterialsCom ref="materialsComRef" />
|
|
|
+ </template>-->
|
|
|
+ <el-tabs type="border-card" @tab-click="tabsEvent2"
|
|
|
+ v-model="defaultTab">
|
|
|
+ <el-tab-pane
|
|
|
+ name="materialsComRef"
|
|
|
+ label="主料记录"
|
|
|
+ class="tabpaneBox"
|
|
|
+ >
|
|
|
+ <template #label>
|
|
|
+ <span
|
|
|
+ >主料记录
|
|
|
+ <el-badge
|
|
|
+ :value="tabCount.materials"
|
|
|
+ class="item"
|
|
|
+ type="primary"
|
|
|
+ />
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <MaterialsCom ref="materialsComRef" />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane
|
|
|
+ name="materialsAccessoryComRef"
|
|
|
+ label="辅料记录"
|
|
|
+ class="tabpaneBox"
|
|
|
+ ><template #label>
|
|
|
+ <span
|
|
|
+ >辅料记录
|
|
|
+ <el-badge
|
|
|
+ :value="tabCount.accessoryMaterials"
|
|
|
+ class="item"
|
|
|
+ type="primary"
|
|
|
+ />
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <MaterialsAccessoryCom ref="materialsAccessoryComRef" />
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
</el-tab-pane>
|
|
|
+
|
|
|
<el-tab-pane name="recordComRef" label="记录项" class="tabpaneBox">
|
|
|
<template #label>
|
|
|
<span
|
|
@@ -198,6 +234,7 @@ import { useCrud } from "@/hooks/userCrud";
|
|
|
import { traceabilityTabCount } from "@/api/process";
|
|
|
import { getMaterialDetailsByseqNo, getOperationCompent } from "@/api/material";
|
|
|
import TraceabilityCom from "@/views/pro/traceability/components/traceabilityCom.vue";
|
|
|
+import MaterialsAccessoryCom from "@/views/pro/traceability/components/materialsAccessoryCom.vue";
|
|
|
import MaterialsCom from "@/views/pro/traceability/components/materialsCom.vue";
|
|
|
import RecordCom from "@/views/pro/traceability/components/recordCom.vue";
|
|
|
import CheckCom from "@/views/pro/traceability/components/checkCom.vue";
|
|
@@ -207,7 +244,6 @@ import MediaCom from "./components/mediaCom.vue";
|
|
|
import ExcelCom from "./components/excelCom.vue";
|
|
|
import TestData from "./components/testData.vue";
|
|
|
import FileCom from "./components/fileCom.vue";
|
|
|
-
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
@@ -231,6 +267,7 @@ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
|
|
const traceabilityComRef = ref(null);
|
|
|
const materialsComRef = ref(null);
|
|
|
+const materialsAccessoryComRef = ref(null);
|
|
|
const recordComRef = ref(null);
|
|
|
const checkComRef = ref(null);
|
|
|
const equitComRef = ref(null);
|
|
@@ -240,11 +277,15 @@ const excelComRef = ref(null);
|
|
|
const cssjComRef = ref(null);
|
|
|
const fileComRef = ref(null);
|
|
|
let defaultTabName = ref("traceabilityComRef");
|
|
|
+
|
|
|
+let defaultTab = ref("materialsComRef");
|
|
|
+
|
|
|
//tab页组件
|
|
|
const tabNameComRef = new Map([
|
|
|
["traceabilityComRef", traceabilityComRef],
|
|
|
["materialsComRef", materialsComRef],
|
|
|
["recordComRef", recordComRef],
|
|
|
+ ["materialsAccessoryComRef", materialsAccessoryComRef],
|
|
|
["checkComRef", checkComRef],
|
|
|
["equitComRef", equitComRef],
|
|
|
["faultComRef", faultComRef],
|
|
@@ -261,6 +302,13 @@ const tabsEvent = (pane, ev) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const tabsEvent2 = (pane, ev) => {
|
|
|
+ defaultTab.value = pane.props.name;
|
|
|
+ if (temRow.value.seqNo) {
|
|
|
+ tabNameComRef.get(pane.props.name)?.value.refreshTra(temRow.value);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const chooseTagType = (row, type) => {
|
|
|
let daynamicType = "";
|
|
|
if (type == "text") {
|
|
@@ -296,6 +344,7 @@ let tabCount = reactive({
|
|
|
excel: "",
|
|
|
testData: "",
|
|
|
file: "",
|
|
|
+ accessoryMaterials:"",
|
|
|
});
|
|
|
|
|
|
const handleCellClick = (row, column, event) => {
|
|
@@ -326,6 +375,7 @@ const handleCellClick = (row, column, event) => {
|
|
|
//物料履历
|
|
|
//traceabilityComRef.value.refreshTra(row);
|
|
|
tabNameComRef.get(defaultTabName.value)?.value.refreshTra(temRow.value);
|
|
|
+ tabNameComRef.get(defaultTab.value)?.value.refreshTra(temRow.value);
|
|
|
}
|
|
|
//每次点击都要获取tab页面的数量
|
|
|
traceabilityTabCount({
|