From 9273c8cd58b07c17a38edadca51434beee0f95ab Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Tue, 28 Dec 2021 18:28:18 +0800 Subject: [PATCH] init --- src/views/Scheduling/index.vue | 41 +++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/views/Scheduling/index.vue b/src/views/Scheduling/index.vue index 18dbfbb..9494fd2 100644 --- a/src/views/Scheduling/index.vue +++ b/src/views/Scheduling/index.vue @@ -275,19 +275,33 @@ export default { }, save(){ if(this.showFlag){ - // let arr2=[] - // this.arr.map((item,idx)=>{ - // let idx1=this.arr1.findIndex(item1=>item1==item) - // if(idx1==-1){ - // // 没有重复的 - // console.log(item); - // arr2.push(this.arr1[idx]) - // } - // }) - // console.log(arr2); + let arr2=[] + let arr3=[] + console.log(this.arr1); + this.arr.map((item,idx)=>{ + let idx1=this.arr1.findIndex(item1=>item1==item) + if(idx1==-1){ + // 没有重复的 + console.log(item); + arr2.push(item) + } + }) + this.arr1.map((item,idx)=>{ + let idx1=this.arr.findIndex(item1=>item1==item) + if(idx1==-1){ + // 没有重复的 + console.log(item); + arr3.push(item) + } + }) + // console.log(arr2,'新增的数据'); + // console.log(arr3,'修改的'); + // console.log(this.arr); + // return + this.$api.api.scheduling({ - chosed:this.arr.join(','), - // unChosed:arr2.join(','), + chosed:arr2.join(','), + unChosed:arr3.join(','), id:this.roleId }) .then(res=>{ @@ -334,7 +348,7 @@ export default { res.data.map(item=>{ this.arr.push(item.jobDate) }) - this.arr1=this.arr + this.arr1=[...this.arr] }) }, clickDay(data) { @@ -346,6 +360,7 @@ export default { this.arr.push(data) }else{ this.arr.splice(idx,1) + } }, changeDate(data) {