Просмотр исходного кода

1、新增产品导入功能,修改产品详情页没有接收生产类型、件号和图号的问题。

mazheng 1 год назад
Родитель
Сommit
037ccd17a1

+ 29 - 32
src/views/material/product/components/index-data.vue

@@ -25,24 +25,16 @@
         >
           新建
         </el-button>
-        <div class="upload" v-if="rootTreeId == 6">
-          <el-upload
-            v-if="!isLoading"
-            :show-file-list="false"
-            class="upload-demo"
-            action=""
-            :before-upload="beforeUpload"
-            :on-success="successUpload"
-            :on-error="errorUpload"
-          >
-            <slot>
-              <el-button size="small" type="primary">导入</el-button>
-            </slot>
-          </el-upload>
-          <el-button v-else size="small" type="primary" :loading="isLoading"
-            >导入</el-button
-          >
-        </div>
+
+        <el-button
+          type="primary"
+          size="mini"
+          icon="el-icon-upload2"
+          plain
+          @click="uploadFile"
+          >导入</el-button
+        >
+
         <!-- <el-button
           v-if="rootTreeId == 9"
           size="small"
@@ -77,7 +69,7 @@
           size="small"
           type="primary"
           @click="handleLink('6')"
-          >关联备品备件</el-button 
+          >关联备品备件</el-button
         >-->
       </template>
       <template v-slot:action="{ row }">
@@ -115,13 +107,8 @@
           结构BOM
         </el-link>
 
-
-        <el-link
-          type="primary"
-          v-if="row.isProduct == 1"
-          :underline="false"
-        >
-        BOM管理
+        <el-link type="primary" v-if="row.isProduct == 1" :underline="false">
+          BOM管理
         </el-link>
 
         <el-link
@@ -213,6 +200,12 @@
         >
       </span>
     </el-dialog>
+
+    <importDialog
+      :defModule="moudleName"
+      ref="importDialogRef"
+      @success="reload"
+    />
   </div>
 </template>
 
@@ -228,8 +221,11 @@
   import linkMaterialDialog from './link-material-dialog.vue';
   import goodsAllocation from './goodsAllocation.vue';
   import aridRegion from './aridRegion';
+  import importDialog from '@/components/upload/import-dialog.vue';
+
   export default {
     components: {
+      importDialog,
       MaterialModal,
       ParamEdit,
       mouldDialog,
@@ -246,10 +242,11 @@
       rootTreeId: [Number, String],
 
       oneProduct: Boolean
-
     },
     data() {
       return {
+        moudleName : "mainCategory",
+
         errorData: [],
         exportErrorDioalogVisible: false,
         // 表格列配置
@@ -369,15 +366,11 @@
 
     methods: {
       toBomManager(row) {
-
-  
-
         this.$router.push({
           path: '/material/BOMmanage/details',
           query: {
             categoryId: row.id,
             code: row.code
-
           }
         });
       },
@@ -437,7 +430,7 @@
             id: row.id ? row.id : null,
             status: status,
             rootId: this.rootId,
-            oneProduct:this.oneProduct,
+            oneProduct: this.oneProduct,
             t: new Date().getTime()
           }
         });
@@ -502,6 +495,10 @@
 
       handleAridRegion(row) {
         this.$refs.aridRegionRef.open(row);
+      },
+
+      uploadFile () {
+        this.$refs.importDialogRef.open();
       }
     },
     watch: {

+ 4 - 2
src/views/material/product/detail.vue

@@ -49,7 +49,7 @@
 
           <el-col :span="8">
             <el-form-item label="图号/件号" prop="partNumber">
-              <el-input v-model="form.partNumber" />
+              <el-input v-model="form.imgCode" />
             </el-form-item>
           </el-col>
 
@@ -164,7 +164,7 @@
           <el-col :span="8">
             <el-form-item label="所属部门">
               <deptSelect
-                v-model="form.chargeDeptId"
+                v-model="form.chargeGroupId"
                 @changeGroup="searchDeptNodeClick"
               />
             </el-form-item>
@@ -376,6 +376,8 @@
         this.form = {
           ...info.category
         };
+        let productType_ = this.form.produceType;
+        this.form.produceType = productType_.split(",");
 
         this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
         this.judgeSet(info);