Reiskuchen 5 anos atrás
pai
commit
9e02d1ea1a
1 arquivos alterados com 48 adições e 15 exclusões
  1. 48 15
      ys_vue/src/views/mold/moldDetail.vue

+ 48 - 15
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)">拒绝</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>
@@ -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,16 +1303,7 @@
                             type: "error"
                         });
                     });
-                })
-            },
-
-            //更新批准
-            updateApproval(id, approval){
-                if(approval){
-                    console.log("批准通过了" + id + "的申请,但什么都没有发生");
-                }else{
-                    console.log("批准拒绝了" + id + "的申请,但什么都没有发生");
-                }
+                }).catch(() => {});
             },
 
             //导出操作记录