Reiskuchen 5 years ago
parent
commit
394757a081

+ 42 - 34
ys_vue/src/views/detection/maintenance.vue

@@ -57,7 +57,7 @@
         <el-tab-pane label="角色管理" name="3">角色管理</el-tab-pane>
         <el-tab-pane label="定时任务补偿" name="4">定时任务补偿</el-tab-pane>
       </el-tabs>
-    </el-col> -->
+    </el-col>-->
     <el-table :data="records" highlight-current-row v-loading="listLoading" style="width: 100%;">
       <el-table-column type="index" width="60"></el-table-column>
       <el-table-column prop="maintainUserName" label="保养人" width="100" sortable></el-table-column>
@@ -334,43 +334,51 @@ export default {
     },
     //模具保养
     maintain(params) {
-      var fileObj = params.file;
-      var form = new FormData();
-      form.append("file", fileObj);
-      form.append("mouldId", this.mouldId);
-      form.append("maintainType", this.type.value);
-      if (this.type.value == 0) {
-        form.append("ways", this.action.value);
-      } else {
-        form.append("ways", this.vulnerable.value); //后面应该换成易损件的ID
-      }
-      this.http.uploadFile(
-        this.port.mold.moldMaintain,
-        form,
-        res => {
-          if (res.code == "ok") {
-            this.$message({
-              message: "保养完成",
-              type: "success"
-            });
-            this.maintenanceFormVisible = false;
-            this.$refs.upload.clearFiles();
-            this.getList();
-          } else {
+      if (this.type.value != null) {
+        var fileObj = params.file;
+        var form = new FormData();
+        form.append("file", fileObj);
+        form.append("mouldId", this.mouldId);
+        form.append("maintainType", this.type.value);
+        if (this.type.value == 0) {
+          if (this.action.value != null) {
+            return;
+          }
+          form.append("ways", this.action.value);
+        } else {
+          if (this.vulnerable.value == null) {
+            return;
+          }
+          form.append("ways", this.vulnerable.value); //后面应该换成易损件的ID
+        }
+        this.http.uploadFile(
+          this.port.mold.moldMaintain,
+          form,
+          res => {
+            if (res.code == "ok") {
+              this.$message({
+                message: "保养完成",
+                type: "success"
+              });
+              this.maintenanceFormVisible = false;
+              this.$refs.upload.clearFiles();
+              this.getList();
+            } else {
+              this.$message({
+                message: res.msg,
+                type: "error"
+              });
+            }
+          },
+          error => {
+            this.listLoading = false;
             this.$message({
-              message: res.msg,
+              message: error,
               type: "error"
             });
           }
-        },
-        error => {
-          this.listLoading = false;
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
+        );
+      }
     }
   },
   created() {

+ 17 - 17
ys_vue/src/views/mold/moldDetail.vue

@@ -1319,27 +1319,27 @@
                     });
                 }else{
                     this.centerDialog5Visible = false;
-                this.http.post( this.port.mold.exportOperationExcel, {
-                    mouldId: this.detailId,
-                    startTime: this.recordTime[0],
-                    endTime: this.recordTime[1]
-                },
-                res => {
-                    if (res.code == "ok") {
-                        console.log("进行下载,我文件呢???")
-                    } else {
+                    this.http.post( this.port.mold.exportOperationExcel, {
+                        mouldId: this.detailId,
+                        startTime: this.recordTime[0],
+                        endTime: this.recordTime[1]
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            console.log("进行下载,我文件呢???")
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
                         this.$message({
-                            message: res.msg,
+                            message: error,
                             type: "error"
                         });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
                     });
-                });
                 }
             }
         },

+ 1 - 1
ys_vue/src/views/mold/moldDownload.vue

@@ -7,7 +7,7 @@
           <el-input v-model="filters.name" placeholder="请输入模具名称进行搜索"></el-input>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary">查询</el-button>
+          <el-button type="primary" @click="getFileList(filters.name)">查询</el-button>
         </el-form-item>
         <el-form-item style="float: right;">
           <el-dropdown>