فهرست منبع

添加sop,作业票新增成功提示

wangyani 1 سال پیش
والد
کامیت
752c8eb10f
2فایلهای تغییر یافته به همراه15 افزوده شده و 12 حذف شده
  1. 1 0
      src/views/mes/job/jobm/NewOperations.vue
  2. 14 12
      src/views/mes/sop/sopm/NewSop.vue

+ 1 - 0
src/views/mes/job/jobm/NewOperations.vue

@@ -701,6 +701,7 @@ export default {
         const res = await addJobTicket(data);
         if (res.code === 200) {
           this.$router.go(-1);
+          this.$message.success("作业票新建成功");
         } else {
           console.error("提交工单失败", res);
         }

+ 14 - 12
src/views/mes/sop/sopm/NewSop.vue

@@ -175,7 +175,7 @@ import {
   updateIsSop,
   selectIsSopById,
 } from "@/api/mes/sop/sopindex";
-import { mapActions, mapGetters } from 'vuex'
+import { mapActions, mapGetters } from "vuex";
 export default {
   name: "addView",
   dicts: ["power_type", "point_type", "sop_type"],
@@ -230,23 +230,24 @@ export default {
     };
   },
   mounted() {
-
     if (this.$route.query.sopId !== "null") {
       // console.log(this.$route.query.sopId, "接受路由参数");
       this.getSopInfo();
-
     }
   },
 
   methods: {
-    ...mapActions('sopSelectPoints', [
-      'setSelectSopPoints','setPointTableData','setSopEdit'
+    ...mapActions("sopSelectPoints", [
+      "setSelectSopPoints",
+      "setPointTableData",
+      "setSopEdit",
     ]),
     handleClick(tab, event) {
       // console.log(tab, event);
     },
     preStep() {
       this.activeName = "first";
+      this.tableData = [];
     },
     nextStep() {
       this.activeName = "second";
@@ -258,7 +259,7 @@ export default {
       const sopId = this.$route.query.sopId;
       console.log(this.$route.query.sopId, "接受路由参数");
 
-      if (sopId!==null) {
+      if (sopId !== null) {
         selectIsSopById(sopId).then((response) => {
           console.log(response, "详细内容");
           this.form = response.data;
@@ -268,9 +269,9 @@ export default {
         });
       } else {
         this.title = "新增隔离点信息";
-        this.setSopEdit(true)
-        this.setSelectSopPoints([])
-        this.setPointTableData([])
+        this.setSopEdit(true);
+        this.setSelectSopPoints([]);
+        this.setPointTableData([]);
         this.tableData = null;
         this.form = {
           spoint: [],
@@ -307,8 +308,8 @@ export default {
       };
 
       // 编辑模式
-      if (this.$route.query.sopId!=='null') {
-        console.log(this.$route.query.sopId,'sopIdaaa');
+      if (this.$route.query.sopId !== "null") {
+        console.log(this.$route.query.sopId, "sopIdaaa");
         // 确保 sopId 存在
         if (!this.form.sopId) {
           console.error("隔离点id不可为空!");
@@ -322,6 +323,7 @@ export default {
           console.log(res, "修改接口");
           if (res.code == 200) {
             this.$router.go(-1);
+            this.$message.success("SOP修改成功");
           }
         });
       } else {
@@ -330,6 +332,7 @@ export default {
           console.log(res, "新增接口");
           if (res.code == 200) {
             this.$router.go(-1);
+            this.$message.success("SOP新建成功");
           }
         });
       }
@@ -378,7 +381,6 @@ export default {
     //   }
     // },
 
-
     // 子组件选中的隔离点逆传递拿到的数据
     handleSelectPoint(points) {
       // console.log(points, "父组件接收逆向传递选中的隔离点");