ysy 1 год назад
Родитель
Сommit
81a37e7af5
2 измененных файлов с 47 добавлено и 28 удалено
  1. 46 27
      src/views/material/BOMmanage/index.vue
  2. 1 1
      vue.config.js

+ 46 - 27
src/views/material/BOMmanage/index.vue

@@ -6,31 +6,37 @@
         :statusOpt="statusOpt"
         :categoryCode="where.categoryCode"
       />
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        :initLoad="false"
-        class="dict-table"
-        tool-class="ele-toolbar-actions"
-      >
-        <!-- 表头工具栏 -->
-        <template v-slot:action="{ row }">
-          <el-link
-            style="margin-right: 20px"
-            type="primary"
-            @click="handelDetail(row)"
-            >详情</el-link
-          >
-          <el-switch
-            :active-value="'1'"
-            :inactive-value="'0'"
-            @change="openBom(row, $event)"
-            v-model="row.status"
-          >
-          </el-switch>
-        </template>
-      </ele-pro-table>
+      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
+        <el-tab-pane label="PBOM" name="1"> </el-tab-pane>
+        <el-tab-pane label="MBOM" name="2"> </el-tab-pane>
+        <el-tab-pane label="ABOM" name="3"> </el-tab-pane>
+
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          :initLoad="false"
+          class="dict-table"
+          tool-class="ele-toolbar-actions"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              style="margin-right: 20px"
+              type="primary"
+              @click="handelDetail(row)"
+              >详情</el-link
+            >
+            <el-switch
+              :active-value="'1'"
+              :inactive-value="'0'"
+              @change="openBom(row, $event)"
+              v-model="row.status"
+            >
+            </el-switch>
+          </template>
+        </ele-pro-table>
+      </el-tabs>
     </el-card>
   </div>
 </template>
@@ -108,7 +114,9 @@
         },
         loading: false,
         loadingInstance: null,
-        where: {}
+        where: {},
+
+        activeName: "1"
       };
     },
     mounted() {
@@ -129,7 +137,6 @@
             pageNum: 1,
             size: 10
           }).then((data) => {
-     
             if (data.count > 1) {
               this.$refs.table.setData(data.list || []);
             } else {
@@ -162,6 +169,7 @@
       datasource({ where, page, limit }) {
         return getBomPageList({
           ...where,
+          bomType:  Number(this.activeName),
           pageNum: page,
           size: limit
         });
@@ -224,6 +232,17 @@
           .catch((e) => {
             this.loading = false;
           });
+      },
+
+      handleClick(tab) {
+        this.activeName = tab.name
+        getBomPageList({
+          pageNum: 1,
+          size: 10,
+          bomType:  Number(this.activeName)
+        }).then((data) => {
+          this.$refs.table.setData(data.list || []);
+        });
       }
     }
   };

+ 1 - 1
vue.config.js

@@ -33,7 +33,7 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.1.124:50001',
         // target: 'http://192.168.1.147:18086',
-        target: 'http://localhost:18086',
+        target: 'http://192.168.1.125:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''