From 2a146bcbd2c3752d699338bad39a07feabe6890e Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期五, 26 十二月 2025 16:39:52 +0800
Subject: [PATCH] 产品结构

---
 src/views/productionManagement/productStructure/index.vue |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 101 insertions(+), 0 deletions(-)

diff --git a/src/views/productionManagement/productStructure/index.vue b/src/views/productionManagement/productStructure/index.vue
new file mode 100644
index 0000000..bdbec9c
--- /dev/null
+++ b/src/views/productionManagement/productStructure/index.vue
@@ -0,0 +1,101 @@
+<template>
+  <div class="app-container">
+    <PIMTable
+        rowKey="id"
+        :column="tableColumn"
+        :tableData="tableData"
+        :page="page"
+        :isSelection="true"
+        @selection-change="handleSelectionChange"
+        :tableLoading="tableLoading"
+        @pagination="pagination"
+    >
+      <template #detail="{row}">
+        <el-button
+            type="primary"
+            text
+            @click="() =>{
+              currentRowId = row.id;
+              showEdit = true;
+            }"
+        >{{ row.productName }}
+        </el-button>
+      </template>
+    </PIMTable>
+    <StructureEdit v-if="showEdit" v-model:show-model="showEdit" :product-model-id="currentRowId"/>
+  </div>
+</template>
+
+<script setup>
+import {ref} from "vue";
+import {productModelList} from "@/api/basicData/productModel.js";
+
+const StructureEdit = defineAsyncComponent(() => import('@/views/productionManagement/productStructure/StructureEdit.vue'))
+
+const tableColumn = ref([
+  {
+    label: "浜у搧鍚嶇О",
+    prop: "productName",
+    dataType: 'slot',
+    slot: "detail"
+  },
+  {
+    label: "瑙勬牸鍨嬪彿",
+    prop: "model",
+  },
+  {
+    label: "鍗曚綅",
+    prop: "unit",
+  }
+]);
+const tableData = ref([]);
+const tableLoading = ref(false);
+const showEdit = ref(false);
+const selectedRows = ref([]);
+const currentRowId = ref(0);
+const page = reactive({
+  current: 1,
+  size: 10,
+  total: 0,
+});
+const data = reactive({
+  form: {
+    productName: "",
+  },
+  rules: {
+    productName: [{required: true, message: "璇疯緭鍏�", trigger: "blur"}],
+  },
+  modelForm: {
+    otherModel: '',
+    model: "",
+    unit: "",
+    speculativeTradingName: [],
+  },
+});
+const {form, rules} = toRefs(data);
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+  selectedRows.value = selection;
+};
+
+// 鏌ヨ瑙勬牸鍨嬪彿
+const pagination = (obj) => {
+  page.current = obj.page;
+  page.size = obj.limit;
+  getModelList();
+};
+const getModelList = () => {
+  tableLoading.value = true;
+  productModelList({
+    current: page.current,
+    size: page.size,
+  }).then((res) => {
+    tableData.value = res.records;
+    page.total = res.total;
+    tableLoading.value = false;
+  });
+};
+onMounted(() => {
+  getModelList();
+})
+</script>

--
Gitblit v1.9.3