Przeglądaj źródła

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into test

yusheng 1 rok temu
rodzic
commit
99e39eaa82

+ 12 - 4
src/views/factoryModel/qualificationManagement/components/vendorDialog.vue

@@ -2,7 +2,7 @@
   <ele-modal
     v-if="visible"
     :visible.sync="visible"
-    title="供应商列表"
+    :title="title"
     width="70%"
     :centered="true"
     :close-on-click-modal="false"
@@ -61,7 +61,7 @@
       >
         <AssetTree
           @handleNodeClick="handleNodeClick"
-          ids="19,20250317001"
+          :ids="ids"
           :isFirstRefreshTable="false"
           ref="treeList"
         />
@@ -135,6 +135,14 @@
       isAll: {
         type: Boolean,
         default: false
+      },
+      title: {
+        type: String,
+        default: '选择供应商'
+      },
+      ids: {
+        type: String,
+        default: '19'
       }
     },
     computed: {
@@ -155,7 +163,7 @@
             show: this.isAll,
             reserveSelection: true,
             selectable: (row, index) => {
-              return !this.disabledId.includes(row.id)
+              return !this.disabledId.includes(row.id);
             }
           },
           {
@@ -279,7 +287,7 @@
         return getVendorPageList({
           pageNum: page,
           size: limit,
-          type: 2,
+          type:this.title=='选择供应商'?2:3,
           ...where
         });
       },

+ 88 - 30
src/views/material/product/components/link-msg.vue

@@ -41,33 +41,64 @@
               添加供应商
             </el-button>
           </template>
-            <!-- 操作列 -->
-            <template v-slot:action="{ row }">
-              <el-popconfirm
-                  class="ele-action"
-                  title="确定要删除此供应商吗?"
-                  @confirm="deleteSupplie(row)"
-                >
-                  <template v-slot:reference>
-                    <el-link
-                      type="danger"
-                      :underline="false"
-                      icon="el-icon-delete"
-                    >
-                      删除
-                    </el-link>
-                  </template>
-          
-                </el-popconfirm>
-            </template>
+          <!-- 操作列 -->
+          <template v-slot:action="{ row }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此供应商吗?"
+              @confirm="deleteSupplie(row)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane label="生产厂家">
+        <ele-pro-table
+          :columns="supplierColumn"
+          :datasource="manufacturerData"
+          :need-page="false"
+          ref="supplierRef"
+        >
+          <template v-slot:toolbar>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              class="ele-btn-icon"
+              @click="handParent()"
+              v-if="id"
+            >
+              添加生产厂家
+            </el-button>
+          </template>
+          <!-- 操作列 -->
+          <!-- <template v-slot:action="{ row }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此供应商吗?"
+              @confirm="deleteSupplie(row)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template> -->
         </ele-pro-table>
-        </el-tab-pane
-      >
+      </el-tab-pane>
     </el-tabs>
     <vendorDialog
       ref="vendorDialogRef"
       :is-all="true"
       @success="success"
+      :ids="ids"
+      :title="title"
     ></vendorDialog>
   </div>
 </template>
@@ -310,11 +341,15 @@
             }
           }
         ],
+
         moduleData: [],
         eqData: [],
         bomData: [],
         pathData: [],
-        supplierData: [] //供应商
+        supplierData: [], //供应商
+        manufacturerData: [], //生产厂家
+        ids: '',
+        title: ''
       };
     },
     watch: {
@@ -322,7 +357,8 @@
         handler(val) {
           if (val) {
             this.getData();
-            this.contactQueryByCategoryIdsAPI();
+            this.contactQueryByCategoryIdsAPI(2);
+            this.contactQueryByCategoryIdsAPI(3);
           }
         },
         immediate: true
@@ -367,25 +403,47 @@
 
         this.moduleData = data;
       },
-      // 关联供应商
-      async contactQueryByCategoryIdsAPI() {
+      // 关联供应商/生产厂家
+      async contactQueryByCategoryIdsAPI(type) {
         const data = await storage.contactQueryByCategoryIdsAPI({
-          categoryIds: [this.id]
+          categoryIds: [this.id],
+          type
         });
-
-        this.supplierData = data[this.id] || [];
+        if (type == 2) {
+          this.supplierData = data[this.id] || [];
+        }
+        if (type == 3) {
+          this.manufacturerData = data[this.id] || [];
+        }
       },
       handParent() {
+        console.log(this.activeTab,'his.activeTab')
+        if (this.activeTab == '4') {
+          this.ids = '19';
+          this.title = '选择供应商';
+        }
+        if (this.activeTab == '5') {
+          this.ids = '20250317001';
+          this.title = '选择生产厂家';
+
+        }
         this.$refs.vendorDialogRef.open(
-          this.supplierData.map((item) => item.id)
+          this.activeTab == '4'
+            ? this.supplierData.map((item) => item.id)
+            : this.manufacturerData.map((item) => item.id)
         );
       },
+
       success(list) {
         saveSupplier({
           productId: this.id,
           supplierIds: list.map((item) => item.id)
         }).then((res) => {
-          this.contactQueryByCategoryIdsAPI();
+          if (this.activeTab == '4') {
+            this.contactQueryByCategoryIdsAPI(2);
+          } else {
+            this.contactQueryByCategoryIdsAPI(3);
+          }
         });
       },
       deleteSupplie(row) {