quwangxin hace 2 años
padre
commit
de65e52630
Se han modificado 1 ficheros con 27 adiciones y 20 borrados
  1. 27 20
      src/views/materialPlan/components/plan-view.vue

+ 27 - 20
src/views/materialPlan/components/plan-view.vue

@@ -47,8 +47,7 @@
       </div> -->
     </div>
     <el-form :model="{ tableData }" label-width="0" ref="formRef">
-      <el-table :data="tableData"
-	  >
+      <el-table :data="tableData">
         <el-table-column type="index" label="序号"></el-table-column>
         <el-table-column label="工单号" prop="code"></el-table-column>
         <el-table-column label="生产重量" prop="" width="120">
@@ -157,6 +156,7 @@
 
   import { release } from '@/api/materialPlan/order.js';
   import { getCode } from '@/api/codeManagement';
+  import { getRouteTabKey, removePageTab } from '@/utils/page-tab-util';
   import { deepClone } from '@/utils';
   export default {
     components: { equipmentDailog, classesSelect },
@@ -219,7 +219,7 @@
             list: [{ label: '末单均衡', value: 0 }]
           }
         ],
-		selectionList:[]
+        selectionList: []
       };
     },
     computed: {
@@ -258,15 +258,20 @@
       }
     },
     methods: {
-	 // chooseItem(selection){
-		//  this.selectionList = selection
-	 // },
+      back () {
+        const key = getRouteTabKey();
+        this.$router.push('/productionPlan');
+        removePageTab({ key });
+      },
+      // chooseItem(selection){
+      //  this.selectionList = selection
+      // },
       // 发布
       handleRelease () {
         this.$refs.formRef.validate((value) => {
           if (value) {
-            this.$confirm('发布工单后不可撤回,确定发布吗?', '发布确认').then(
-              async () => {
+            this.$confirm('发布工单后不可撤回,确定发布吗?', '发布确认')
+              .then(async () => {
                 const loading = this.$loading({
                   lock: true,
                   fullscreen: true,
@@ -289,13 +294,13 @@
                   } else {
                     this.$message.error('发布失败,请重新发布!');
                   }
-                  this.$router.back();
+                  this.back();
                 } catch (error) {
                   console.error(error);
                 }
                 loading.close();
-              }).catch(() => {         
-			  });
+              })
+              .catch(() => {});
           }
         });
       },
@@ -319,7 +324,8 @@
         row.executorName = executorName.substring(1);
       },
       addOrder () {
-		if(this.tableData.length>0) return  this.$message.warning('工单只能添加一条!');
+        if (this.tableData.length > 0)
+          return this.$message.warning('工单只能添加一条!');
         this.$refs.equipmentDailogRef.open();
       },
       editOrder (row) {
@@ -366,15 +372,16 @@
         }
       },
       handleDelete (index) {
-        this.$confirm('确定删除当前数据?', '提示').then(() => {
-          const [item] = this.tableData.splice(index, 1);
+        this.$confirm('确定删除当前数据?', '提示')
+          .then(() => {
+            const [item] = this.tableData.splice(index, 1);
 
-          if (this.orderList.find((i) => i.id == item.id)) {
-            item.deleted = 1;
-            this.deleteList.push(item);
-          }
-        }).catch(() => {         
-		});
+            if (this.orderList.find((i) => i.id == item.id)) {
+              item.deleted = 1;
+              this.deleteList.push(item);
+            }
+          })
+          .catch(() => {});
       }
     }
   };