zhl 4 rokov pred
rodič
commit
9ad0791cf2

+ 52 - 54
ruoyi-ui/src/views/management/roduction/index.vue

@@ -26,13 +26,13 @@
       <el-col :span="1.5" :offset="18" v-if="setrd % 2 == 0">
         <el-button
           type="danger"
-          @click="infoBtn"
+          @click="applyBtn"
           v-hasPermi="['bmProject:project:pass']"
           >审核</el-button
         >
         <el-button
           type="danger"
-          @click="infoBtn"
+          @click="backBtn"
           v-hasPermi="['bmProject:project:reject']"
           >驳回</el-button
         >
@@ -155,7 +155,7 @@ import {
   updateProduct,
   exportProduct,
 } from "@/api/production/production.js";
-
+import { setExamine, setReject } from "@/api/projectInfo/info.js";
 export default {
   name: "production",
   data() {
@@ -238,6 +238,27 @@ export default {
       console.log(file.response.url);
     },
 
+    //提交
+    submitBtn() {
+      var that = this;
+      this.$confirm("是否确认提交", "提醒", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
+          return setExamine({
+            code: 1,
+            bmProjectId: that.bmProjectId,
+          });
+        })
+        .then(() => {
+          this.$router.go(-1);
+          this.getList();
+          this.msgSuccess("审核成功");
+        });
+    },
+
     /** 暂存按钮 */
     submitForm() {
       var tmp = [];
@@ -303,76 +324,53 @@ export default {
     //   return this.selectDictLabel(this.typeOptions, row.configType);
     // },
 
-    submitBtn(scope) {
-      this.$confirm("是否确认提交申请", "提醒", {
+    //审核
+    applyBtn() {
+      var that = this;
+      this.$confirm("是否确认审核", "提醒", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
       })
         .then(function () {
-          setExamine({
-            code: 1,
-            bmProjectId: scope.id,
+          return setExamine({
+            code: 3,
+            bmProjectId: that.bmProjectId,
           });
         })
         .then(() => {
+          this.$router.go(-1);
           this.getList();
-          this.msgSuccess("提交成功");
+          this.msgSuccess("审核成功");
         });
     },
-
-    infoBtn(scrop) {
-      if (scrop.projectStatus % 2 == 1) {
-        this.$confirm("是否确认审核", "提醒", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-          .then(function () {
-            return setExamine({
-              code: 3,
-              bmProjectId: scrop.id,
-            });
-          })
-          .then(() => {
-            this.getList();
-            this.msgSuccess("审核成功");
+    //驳回
+    backBtn() {
+      var that = this;
+      this.$confirm("是否确认驳回", "提醒", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function () {
+          return setReject({
+            code: 2,
+            bmProjectId: that.bmProjectId,
           });
-      } else {
-        this.$confirm("是否确认驳回", "提醒", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
         })
-          .then(function () {
-            return setReject({
-              code: 2,
-              bmProjectId: scrop.id,
-            });
-          })
-          .then(() => {
-            this.getList();
-            this.msgSuccess("驳回成功");
-          });
-      }
+        .then(() => {
+          this.$router.go(-1);
+          this.getList();
+          this.msgSuccess("驳回成功");
+        });
     },
+
     // 取消按钮
     cancel() {
       this.open = false;
       this.reset();
     },
-    // 表单重置
-    // reset() {
-    //   this.form = {
-    //     configId: undefined,
-    //     configName: undefined,
-    //     configKey: undefined,
-    //     configValue: undefined,
-    //     configType: "Y",
-    //     remark: undefined,
-    //   };
-    //   this.resetForm("form");
-    // },
+
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;