Bläddra i källkod

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

5 år sedan
förälder
incheckning
8d51d7e13c
3 ändrade filer med 106 tillägg och 50 borttagningar
  1. 2 0
      ys_vue/src/port.js
  2. 59 6
      ys_vue/src/views/base/allocation.vue
  3. 45 44
      ys_vue/src/views/mold/moldDownload.vue

+ 2 - 0
ys_vue/src/port.js

@@ -52,6 +52,7 @@ export default {
         moldFileUpload: '/mouldfile/uploadFile', //上传模具文档
         moldFileDowload: '/mouldfile/dowloadFile', //模具文档的下载
         moldFileDowloadList: '/mouldfile/fileList', //获取模具文档下载列表
+
         moldFileDowloadFile: '/mouldfile/downloadfileList', //批量下载
         moldFileCheck: '/mouldfile/check', //审批模具文档 
         exportOperationExcel: '/mouldfile/downloadFileListExcel', //下载操作记录
@@ -100,5 +101,6 @@ export default {
         mouldeList: '/mouldequipment/getEquipmentList', //设备列表
         enableMould: '/mouldequipment/use', //启用设备
         moulds: '/mouldequipment/getMouldEquipmentList', //创建模具时获取资产方公司的设备列表
+        importMouldEquipmentExcel: '/mouldequipment/importMouldEquipmentExcel', //批量导入云模盒
     }
 }

+ 59 - 6
ys_vue/src/views/base/allocation.vue

@@ -17,6 +17,18 @@
                 <el-form-item>
                     <el-button type="primary" @click="getMoulds">查询</el-button>
                 </el-form-item>
+                <el-form-item style="float: right;">
+                    <a class="download" href="/upload/零件信息导入模板示例.xlsx" download="零件信息导入模板示例.xlsx">
+                        <el-button type="primary">
+                            下载模板
+                        </el-button>
+                    </a>
+                </el-form-item>
+                <el-form-item style="float: right;">
+                    <el-upload ref="upload" action="customize" :show-file-list="false" :http-request="uploadFile" :limit="1">
+                        <el-button type="primary" :loading="uploading">批量导入</el-button>
+                    </el-upload>
+                </el-form-item>
                 <el-form-item style="float: right;">
                     <el-button type="primary" @click="showAllocation">新建</el-button>
                 </el-form-item>
@@ -120,11 +132,11 @@
 
         <!--修改界面-->
         <el-dialog
-        title="修改模具"
-        v-if="editFormVisible"
-        :visible.sync="editFormVisible"
-        :close-on-click-modal="false"
-        customClass="customWidth"
+            title="修改模具"
+            v-if="editFormVisible"
+            :visible.sync="editFormVisible"
+            :close-on-click-modal="false"
+            customClass="customWidth"
         >
             <el-form
                 :model="newAllocation"
@@ -178,7 +190,7 @@
         </el-dialog>
 
         <!-- 启用弹窗 -->
-        <el-dialog title="启用" :visible.sync="operateDialogVisible" width="100" center>
+        <el-dialog title="启用" :visible.sync="operateDialogVisible" width="400px">
             <el-form
                 label-width="100px"
                 :rules="formRules"
@@ -232,13 +244,17 @@
                         { required: true, message: "请填写代理商", trigger: "blur" }
                     ]
                 },
+
                 listLoading: false,
                 addLoading: false,
                 editLoading: false,
+                uploading: false,
+
                 total: 0,
                 page: 1,
                 size: 20,
                 tableHeight: 0,
+
                 addFormVisible: false,
                 editFormVisible: false,
                 operateDialogVisible: false,
@@ -468,6 +484,39 @@
                         });
                     });
                 }
+            },
+
+            //导入云模盒
+            uploadFile(params) {
+                var fileObj = params.file;
+                var form = new FormData();
+                form.append("file", fileObj);
+                this.uploading = true;
+                this.http.uploadFile( this.port.base.importMouldEquipmentExcel,  form,
+                res => {
+                    this.uploading = false;
+                    this.$refs.upload.clearFiles();
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: "上传成功",
+                            type: "success"
+                        });
+                        this.getMoulds();
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.uploading = false;
+                    this.$refs.upload.clearFiles();
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
             }
         },
         created() {
@@ -487,4 +536,8 @@
 </script>
 
 <style scoped>
+    .download {
+        color: #fff;
+        text-decoration: none;
+    }
 </style>

+ 45 - 44
ys_vue/src/views/mold/moldDownload.vue

@@ -39,7 +39,7 @@
     >
       <el-table-column type="selection" width="40"></el-table-column>
       <el-table-column type="index" width="60"></el-table-column>
-      <el-table-column width="200" label="模具名称">
+      <el-table-column label="模具名称">
         <template slot-scope="scope">
             <router-link :to="'/moldList/' + scope.row.id" tag="span" style="color: #409eff;cursor: pointer;">{{scope.row.modelName}}</router-link>
         </template>
@@ -205,54 +205,55 @@ export default {
       if (this.selectedArray.length == 0) {
         this.$message("请选择要下载的文档");
       } else {
-        switch (type) {
-          case 0:
-            this.downloadPost();
-            break;
-          case 1:
-            console.log("点击了下载模具3D图档,但是什么都没发生");
-            break;
-          case 2:
-            console.log("点击了下载模具2D图档,但是什么都没发生");
-            break;
-          case 3:
-            console.log("点击了下载零件3D图档,但是什么都没发生");
-            break;
-          case 4:
-            console.log("点击了下载零件2D图档,但是什么都没发生");
-            break;
-          case 5:
-            console.log("点击了下载保养方案,但是什么都没发生");
-            break;
-        }
+        // switch (type) {
+        //   case 0:
+        //     this.downloadPost();
+        //     break;
+        //   case 1:
+        //     console.log("点击了下载模具3D图档,但是什么都没发生");
+        //     break;
+        //   case 2:
+        //     console.log("点击了下载模具2D图档,但是什么都没发生");
+        //     break;
+        //   case 3:
+        //     console.log("点击了下载零件3D图档,但是什么都没发生");
+        //     break;
+        //   case 4:
+        //     console.log("点击了下载零件2D图档,但是什么都没发生");
+        //     break;
+        //   case 5:
+        //     console.log("点击了下载保养方案,但是什么都没发生");
+        //     break;
+        // }
+        this.downloadPost(type);
       }
     },
     //具体的下载
-    downloadPost() {
-      this.http.post(
-        this.port.mold.moldFileDowloadFile,
-        {
-          ids: this.selectedArray.join(",")
-        },
-        res => {
-          this.listLoading = false;
-          if (res.code == "ok") {
-            console.log(res);
-          } else {
+    downloadPost(type) {
+        this.http.post(
+            this.port.mold.moldFileDowloadFile,{
+                ids: this.selectedArray.join(","),
+                dwgType: type
+            },
+            res => {
+                this.listLoading = false;
+                if (res.code == "ok") {
+                    console.log(res);
+                } else {
+                    this.$message({
+                        message: res.msg,
+                        type: "error"
+                    });
+                }
+            },
+            error => {
+            this.listLoading = false;
             this.$message({
-              message: res.msg,
-              type: "error"
+                message: error,
+                type: "error"
             });
-          }
-        },
-        error => {
-          this.listLoading = false;
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
+            }
+        );
     }
   },
   created() {