Jelajahi Sumber

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

5 tahun lalu
induk
melakukan
0ea6a55d38
2 mengubah file dengan 79 tambahan dan 17 penghapusan
  1. 1 0
      ys_vue/src/port.js
  2. 78 17
      ys_vue/src/views/mold/moldDetail.vue

+ 1 - 0
ys_vue/src/port.js

@@ -51,6 +51,7 @@ export default {
         moldFileDowloadList: '/mouldfile/fileList', //获取模具文档下载列表
         moldFileDowloadFile: '/mouldfile/downloadfileList', //批量下载
         moldFileCheck: '/mouldfile/check', //审批模具文档 
+        exportOperationExcel: '/mouldfile/downloadFileListExcel', //下载操作记录
 
         moldFileDelete: '/mouldfile/delFile', //项目文档的删除
         moldOperationList: '/mouldoperationdynamics/list', //项目文档的删除

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

@@ -347,8 +347,8 @@
                         </el-table-column>
                         <el-table-column label="操作" width="200" sortable>
                             <template slot-scope="scope">
-                                <el-button size="small" @click="updateApproval(scope.row.id, true)" type="primary">通过</el-button>
-                                <el-button size="small" @click="updateApproval(scope.row.id, false)">拒绝</el-button>
+                                <el-button size="small" @click="checkUpdate(scope.row.id, true)" type="primary">通过</el-button>
+                                <el-button size="small" @click="checkUpdate(scope.row.id, false)" type="danger">拒绝</el-button>
                             </template>
                         </el-table-column>
                     </el-table>
@@ -398,7 +398,7 @@
             <el-table :data="operations" highlight-current-row v-loading="listLoading" style="width: 100%;">
                 <el-table-column type="index" width="40"></el-table-column>
                 <el-table-column prop="content" label="操作" width="120" sortable></el-table-column>
-                <el-table-column prop="fileName" label="操作文档名称" sortable></el-table-column>
+                <el-table-column v-if="activeTab!= 4" prop="fileName" label="操作文档名称" sortable></el-table-column>
                 <el-table-column prop="operatorName" label="操作人" align="center" width="120" sortable></el-table-column>
                 <el-table-column prop="indate" label="操作时间" width="200" align="center" sortable></el-table-column>
             </el-table>
@@ -445,7 +445,7 @@
             <el-date-picker v-model="recordTime" type="datetimerange" placeholder="选择日期时间" style="float: right;"></el-date-picker>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="centerDialog5Visible = false">取消</el-button>
-                <el-button @click="exportRecords">确定</el-button>
+                <el-button type="primary" @click="exportRecords">确定</el-button>
             </span>
         </el-dialog>
 
@@ -922,6 +922,45 @@
                 );
             },
 
+            //更新审批通过
+            checkUpdate(id, approval) {
+                var tipString = "";
+                if(confirm){
+                    tipString = "确认审批通过吗?";
+                }else{
+                    tipString = "确认审批拒绝吗?";
+                }
+                this.$confirm(tipString, '审批', {
+                    type: 'info'
+                }).then(() => {
+                    this.http.post( this.port.mold.moldFileCheck, {
+                    mouldFileId: id,
+                    isPass: confirm ? 1 : 0 //通过为1 不通过为0
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: "审批完成",
+                            type: "success"
+                        });
+                        this.getDocument();
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    }
+                );
+                })
+            },
+
             //报废文件上传
             confirmUpload() {
                 if (this.$refs.upload1.uploadFiles.length == 1 && this.$refs.upload2.uploadFiles.length == 1) {
@@ -980,7 +1019,10 @@
                     this.getOperationRecord(this.activePage);
                 },
                 error => {
-
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
                 });
             },
 
@@ -1010,7 +1052,7 @@
                             type: "error"
                         });
                     });
-                })
+                }).catch(() => {});
             },
 
             //零件新建
@@ -1261,21 +1303,40 @@
                             type: "error"
                         });
                     });
-                })
-            },
-
-            //更新批准
-            updateApproval(id, approval){
-                if(approval){
-                    console.log("批准通过了" + id + "的申请,但什么都没有发生");
-                }else{
-                    console.log("批准拒绝了" + id + "的申请,但什么都没有发生");
-                }
+                }).catch(() => {});
             },
 
             //导出操作记录
             exportRecords(){
-                console.log("想要导出记录,但什么都没有发生");
+                if(this.recordTime[0] == null || this.recordTime[1] == null){
+                    this.$message({
+                        message: "未输入时间",
+                        type: "error"
+                    });
+                }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.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+                }
             }
         },
         created() {