sunyadv 5 سال پیش
والد
کامیت
98618fc658
2فایلهای تغییر یافته به همراه16 افزوده شده و 17 حذف شده
  1. 3 3
      ys_vue/src/http.js
  2. 13 14
      ys_vue/src/views/mold/moldDetail.vue

+ 3 - 3
ys_vue/src/http.js

@@ -41,7 +41,7 @@ export default {
             method: 'post',
             url: handleUrl(url),
             data: handleParams(qs.stringify(data)),
-            timeout: TIME_OUT_MS,
+            // timeout: TIME_OUT_MS,
             headers: {
                 //'Content-Type': 'application/json; charset=UTF-8'
                 'Content-type': ' application/x-www-form-urlencoded; charset=UTF-8',
@@ -74,7 +74,7 @@ export default {
         axios({
             method: 'get',
             url: handleUrl(url),
-            timeout: TIME_OUT_MS,
+            // timeout: TIME_OUT_MS,
             headers: {
                 'Content-Type': 'application/json; charset=UTF-8'
             }
@@ -174,7 +174,7 @@ export default {
             method: 'post',
             url: handleUrl(url),
             data: data,
-            timeout: TIME_OUT_MS,
+            // timeout: TIME_OUT_MS,
             headers: {
                 'Content-Type': 'multipart/form-data'
             }

+ 13 - 14
ys_vue/src/views/mold/moldDetail.vue

@@ -396,7 +396,7 @@
         </el-col>
 
         <!-- 审批弹窗 -->
-        <el-dialog title="审批" :visible.sync="centerDialogVisible" width="30%" center>
+        <el-dialog title="审批" :visible.sync="centerDialogVisible" width="100" center>
             <span>{{this.activeFileName}}</span>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="check(false)">不通过</el-button>
@@ -405,7 +405,7 @@
         </el-dialog>
 
         <!-- 模具报废上传弹窗 -->
-        <el-dialog title="模具报废上传" :visible.sync="centerDialog2Visible" width="30%" :before-close="clearFileRecord" center>
+        <el-dialog title="模具报废上传" :visible.sync="centerDialog2Visible" width="100" :before-close="clearFileRecord" center>
             <p>申请单</p>
             <el-upload ref="upload1" action="customize" :http-request="uploadFile" :limit="1" :auto-upload="false">
                 <el-button size="small" type="primary">上传</el-button>
@@ -420,7 +420,7 @@
         </el-dialog>
 
         <!-- 零件文档上传弹窗 -->
-        <el-dialog title="零件文档上传" v-if="centerDialog4Visible" :visible.sync="centerDialog4Visible" width="30%" :before-close="clearFileRecord" center>
+        <el-dialog title="零件文档上传" v-if="centerDialog4Visible" :visible.sync="centerDialog4Visible" width="100" :before-close="clearFileRecord" center>
             <p style="color:#ccc;">文件命名规则:零件编号+2D/3D  如 LJ001+2D.dwg</p>
             <el-upload ref="upload4" action="uploadFile" :http-request="uploadPartFile" :show-file-list="true" :before-remove="beforeRemove" multiple>
                 <el-button size="small" type="primary">上传</el-button>
@@ -578,7 +578,7 @@
                     flag: 1
                 },
 
-                files: new FormData()
+                files: []
             };
         },
         methods: {
@@ -995,19 +995,16 @@
             },
 
             uploadPartFile(params) {
-                //this.files.push(params.file)
-                this.files.append("file", params.file);
+                this.files.push(params.file)
                 return false;
             },
 
             uploadFilePart() {
-                // var fileObj = this.files;
-                // var form = new FormData();
-                // for(var i in fileObj){
-                //     console.log(fileObj[i])
-                //     form.append("file", fileObj[i]);
-                // }
-                var form = this.files;
+                var fileObj = this.files;
+                var form = new FormData();
+                for(var i in fileObj){
+                    form.append("file", fileObj[i]);
+                }
                 form.append("mouldId", this.detailId);
                 this.http.uploadFile( this.port.mold.partUpload, form,
                 res => {
@@ -1016,7 +1013,8 @@
                             message: "上传成功",
                             type: "success"
                         });
-                        this.$refs.upload.clearFiles();
+                        this.centerDialog4Visible = false;
+                        this.$refs.upload4.clearFiles();
                         this.getPartList();
                     } else {
                         this.$message({
@@ -1026,6 +1024,7 @@
                     }
                 },
                 error => {
+                    this.centerDialog4Visible = false;
                     this.$message({
                         message: error,
                         type: "error"