From 1177e0550f0e80e759664d98d83b2bcef5a6acc0 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期一, 25 十二月 2023 17:24:09 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before

---
 src/views/plan/productionschedul/index.vue |   40 ++++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/src/views/plan/productionschedul/index.vue b/src/views/plan/productionschedul/index.vue
index 2b4de6c..ea93866 100644
--- a/src/views/plan/productionschedul/index.vue
+++ b/src/views/plan/productionschedul/index.vue
@@ -7,8 +7,11 @@
             <el-col :span="24">
               <div style="height:40vh;padding: 0px 10px;">
                 <span style="position: relative;top:40px;">鏈畬鎴�</span>
-                <span style="position: relative;top:30px;left:73%;z-index: 11">
+                <span style="position: relative;top:30px;left:60%;z-index: 11">
                   <el-button @click="tagFinished" size="mini" round type="primary">鏍囪宸插畬鎴�</el-button>
+                  <el-button size="mini" round type="primary"
+                  v-if="permissions.plan_productionschedul_edit_line" 
+                  @click="openEditDialog">缂栬緫鏃堕棿绾�</el-button>
                 </span>
                 <avue-crud 
                 :data="tableData" 
@@ -42,7 +45,7 @@
           <el-row>
             <el-col :span="24">
               <div style="height:40vh;padding: 0px 10px;">
-                <span style="position: relative;top:40px;">宸插畬鎴�</span>
+                <span style="position: relative;top:40px">宸插畬鎴�</span>
                 <avue-crud 
                 :data="finishedTableData" 
                 ref="finished" 
@@ -52,7 +55,7 @@
                 @current-change="handleCurrentChange"
                 @size-change="handleSizeChange"
                 :page="finishedPage" 
-                @selection-change="selectionRow">
+                @selection-change="selectionFinishedRow">
                 <!-- <template #menu="{ row, index }">
                   <el-button 
                   v-if="permissions.plan_productionschedul_del" 
@@ -71,7 +74,6 @@
             <el-card>
               <div slot="header" class="clearfix">
                 <span>璋冨害鏃堕棿绾�</span>
-                <el-button v-if="permissions.plan_productionschedul_edit_line && scheduleList.length>0" @click="openEditDialog" style="float: right; padding: 3px 0" type="text">缂栬緫</el-button>
               </div>
               <div style="height:70vh;overflow-y: scroll;">
                 <el-timeline>
@@ -183,6 +185,7 @@
   fillTime,
   deleteSchedul,
   updateState,
+  checkTimeLines,
 } from '@/api//plan/productionschedul'
 import ttable from '@/views/common/ztt-table.vue'
 import { mapGetters } from 'vuex'
@@ -541,8 +544,22 @@
       }
     },
     openEditDialog(){
-      this.scheduleEditList = JSON.parse(JSON.stringify(this.scheduleList))
-      this.dialogVisible = true
+      if(this.multipleSelection.length<1){
+        this.$message.error("璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�")
+        return
+      }
+      let mIds = this.multipleSelection.map(ele=>{
+        return ele.mid
+      })
+      checkTimeLines(mIds).then(res=>{
+        console.log(res);
+        if(res.data.code===200){
+          this.scheduleEditList = JSON.parse(JSON.stringify(this.scheduleList))
+          this.dialogVisible = true
+        }
+      }).catch(error=>{
+        console.error(error);
+      })
     },
     confirmEditSchedul(){
       let data = this.scheduleEditList
@@ -642,6 +659,17 @@
       this.multipleSelection = val
       // this.getScheduleById(val[0].id)
     },
+    selectionFinishedRow(val){
+      console.log(val);
+      if (val.length > 1) {
+        const preVal = val.shift();
+        this.$refs.finished.toggleRowSelection(preVal, false);
+      }
+      else{
+        this.scheduleList=[]
+      }
+      this.getScheduleById(val[0].mid)
+    },
     formatDate(row, cellValue){
       if (cellValue) {
         const dutyDateList = /\d{4}-\d{1,2}-\d{1,2}/g.exec(cellValue)

--
Gitblit v1.9.3