Browse Source

班次管理bug修复提交

LAPTOP-16IUEB3P\Lenovo 2 years ago
parent
commit
cd81378569

+ 5 - 2
src/views/workforceManagement/classes/components/edit.vue

@@ -56,7 +56,7 @@
         header="工作时间段"
         body-style="padding: 22px 22px 0 22px;"
       >
-        <timeTable ref="timeTable" @timeAll="gettimeAll"></timeTable>
+        <timeTable ref="timeTable" @timeAll="gettimeAll" :delDetailIds="delDetailIds"></timeTable>
       </el-card>
     </el-form>
     <template v-slot:footer>
@@ -102,7 +102,8 @@ export default {
         workshopId: [],
         productionLineId: [],
         workStationId: []
-      }
+      },
+      delDetailIds:[]
     };
   },
   computed: {
@@ -158,6 +159,7 @@ export default {
               break;
             case 'edit':
               fn = updateteamtime;
+              this.form.delDetailIds = this.delDetailIds
               break;
             default:
               break;
@@ -182,6 +184,7 @@ export default {
       this.form = { ...this.defaultForm };
     },
     handleClose() {
+      this.delDetailIds = []
       this.restForm();
       this.$refs.timeTable.restTable();
       this.visible = false;

+ 11 - 2
src/views/workforceManagement/classes/components/timeTable.vue

@@ -6,6 +6,7 @@
       :columns="columns"
       :datasource="form.datasource"
       cache-key="systemRoleTable"
+      class="time-form"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
@@ -112,6 +113,9 @@
 </template>
 <script>
 export default {
+  props:{
+    delDetailIds:Array
+  },
   data() {
     const defaultForm = {
       key: null,
@@ -173,11 +177,13 @@ export default {
   },
   methods: {
     remove(row) {
-      console.log(row);
       let index = this.form.datasource.findIndex((n) => n.key == row.key);
       if (index !== -1) {
         this.form.datasource.splice(index, 1);
         this.setSort();
+        if(row.id){
+          this.delDetailIds.push(row.id)
+        }
       }
     },
     // 清空表格
@@ -291,4 +297,7 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
-</style>
+  .time-form .el-form-item{
+    margin-bottom: 0!important;
+  }
+</style>

+ 1 - 1
src/views/workforceManagement/team/components/edit.vue

@@ -244,7 +244,7 @@ export default {
           })
           .catch((e) => {
             this.loading = false;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       });
     },