Commit 8804fa40 authored by 徐来柯's avatar 徐来柯

update

parent 8f56f0e8
...@@ -188,6 +188,7 @@ export default { ...@@ -188,6 +188,7 @@ export default {
itemdata:[], itemdata:[],
deleteRowData:[], deleteRowData:[],
deleteManyData:[], deleteManyData:[],
currentRow: [],
editData:[], editData:[],
typeV:'', typeV:'',
pathE:'', pathE:'',
...@@ -226,41 +227,41 @@ export default { ...@@ -226,41 +227,41 @@ export default {
}, },
methods:{ methods:{
//查询 //查询
query(keyWord){ async query(keyWord){
this.$axios({ await this.$axios({
method:"post", method:"post",
url:`/api/Schedule/Schedule_Query?argKeyWord=${ keyWord.argKeyWord }&argKeyWord1=${ keyWord.argKeyWord1 }&argWhere=${ keyWord.argWhere }&Stime=${ keyWord.Stime }&Etime=${ keyWord.Etime }`, url:`/api/Schedule/Schedule_Query?argKeyWord=${ keyWord.argKeyWord }&argKeyWord1=${ keyWord.argKeyWord1 }&argWhere=${ keyWord.argWhere }&Stime=${ keyWord.Stime }&Etime=${ keyWord.Etime }`,
}).then((res)=>{ }).then((res)=>{
if(res.data.data.length != 0 ){ if(res.data.data.length != 0 ){
for(let i=0;i<res.data.data.length;i++){ for(let i=0;i<res.data.data.length;i++){
res.data.data[i].StartDt = this.$moment(res.data.data[i].StartDt).format('YYYY-MM-DD HH:mm:ss') res.data.data[i].StartDt = this.$moment(res.data.data[i].StartDt).format('YYYY-MM-DD HH:mm:ss')
res.data.data[i].EndDt = this.$moment(res.data.data[i].EndDt).format('YYYY-MM-DD HH:mm:ss') res.data.data[i].EndDt = this.$moment(res.data.data[i].EndDt).format('YYYY-MM-DD HH:mm:ss')
res.data.data[i].DeliveryDt = this.$moment(res.data.data[i].DeliveryDt).format('YYYY-MM-DD HH:mm:ss') res.data.data[i].DeliveryDt = this.$moment(res.data.data[i].DeliveryDt).format('YYYY-MM-DD HH:mm:ss')
if(res.data.data[i].StartDt == 'Invalid date'){ if(res.data.data[i].StartDt == 'Invalid date'){
res.data.data[i].StartDt = '' res.data.data[i].StartDt = ''
} }
if( res.data.data[i].EndDt == 'Invalid date'){ if( res.data.data[i].EndDt == 'Invalid date'){
res.data.data[i].EndDt = '' res.data.data[i].EndDt = ''
} }
} }
this.AllTableData = res.data.data this.AllTableData = res.data.data
if(this.AllTableData.length >50){ if(this.AllTableData.length >50){
this.tableData = this.AllTableData.slice(0,50) this.tableData = this.AllTableData.slice(0,50)
}else{
this.tableData = this.AllTableData
}
this.TotalCount = this.AllTableData.length
this.PageIndex = 1
this.TotalPage = Math.ceil(this.AllTableData.length / 50)
}else{ }else{
this.tableData = this.AllTableData this.tableData = []
this.TotalCount = 0
this.PageIndex = 1
this.TotalPage = 1
} }
this.TotalCount = this.AllTableData.length }).catch(function(err){
this.PageIndex = 1 console.log('err',err)
this.TotalPage = Math.ceil(this.AllTableData.length / 50) })
}else{
this.tableData = []
this.TotalCount = 0
this.PageIndex = 1
this.TotalPage = 1
}
}).catch(function(err){
console.log('err',err)
})
}, },
// 保存变量 // 保存变量
saveData (data, type) { saveData (data, type) {
...@@ -532,8 +533,12 @@ export default { ...@@ -532,8 +533,12 @@ export default {
}, },
//勾选 //勾选
handleSelectionChange(val){ handleSelectionChange(val){
console.log(val) if (val && val.length !== 0) {
this.deleteManyData = val this.deleteManyData = val
this.currentRow = val
} else {
this.deleteManyData = val
}
}, },
//暂停 //暂停
zantin(data){ zantin(data){
...@@ -685,34 +690,35 @@ export default { ...@@ -685,34 +690,35 @@ export default {
} }
}, },
//移动接口 //移动接口
A_MoveFun(id1,id2,text){ async A_MoveFun(id1,id2,text){
var $this = this var $this = this
this.$axios({ await this.$axios({
method:"post", method:"post",
url:`/api/Schedule/Schedule_Move?argID1=${id1}&&argID2=${id2}`, url:`/api/Schedule/Schedule_Move?argID1=${id1}&&argID2=${id2}`,
}).then((res)=>{ }).then(async (res)=>{
var postData = this.resetData() var postData = this.resetData()
$this.query(postData) await $this.query(postData)
}).catch((err) =>{ }).catch((err) =>{
this.typeV = '7' this.typeV = '7'
this.deleteShow = true this.deleteShow = true
if(text == 'down'){ if(text == 'down'){
this.deletetext = '已是最后一个不可下移' this.deletetext = '已是最后一个不可下移'
}else{ }else{
this.deletetext = '已是第一个不可上移' this.deletetext = '已是第一个不可上移'
} }
}) })
}, },
//上移 //上移
MoveUp(){ async MoveUp(){
if(this.deleteManyData.length == 1 ){ if(this.deleteManyData.length == 1 ){
for(let i=0;i<this.AllTableData.length;i++){ for(let i=0;i<this.AllTableData.length;i++){
if(this.AllTableData[i].ID == this.deleteManyData[0].ID){ if(this.AllTableData[i].ID == this.deleteManyData[0].ID){
if(i != 0){ if(i != 0){
this.A_MoveFun(this.deleteManyData[0].ID,this.AllTableData[i - 1].ID) await this.A_MoveFun(this.deleteManyData[0].ID,this.AllTableData[i - 1].ID)
}else{ }else{
this.A_MoveFun(this.deleteManyData[0].ID,'','up') await this.A_MoveFun(this.deleteManyData[0].ID,'','up')
} }
this.section()
} }
} }
}else if(this.deleteManyData.length > 1){ }else if(this.deleteManyData.length > 1){
...@@ -725,16 +731,24 @@ export default { ...@@ -725,16 +731,24 @@ export default {
this.deleteShow = true this.deleteShow = true
} }
}, },
section () {
var $this = this
$this.AllTableData.forEach(row => {
$this.$refs.multipleTable.toggleRowSelection(row, row.ID === this.currentRow[0].ID)
})
},
//下移 //下移
MoveDown(){ async MoveDown(){
if(this.deleteManyData.length == 1 ){ if(this.deleteManyData.length == 1 ){
for(let i=0;i<this.AllTableData.length;i++){ for(let i=0;i<this.AllTableData.length;i++){
if(this.AllTableData[i].ID == this.deleteManyData[0].ID){ if(this.AllTableData[i].ID === this.deleteManyData[0].ID){
if(i != this.AllTableData.length - 1){ if(i != this.AllTableData.length - 1){
this.A_MoveFun(this.deleteManyData[0].ID,this.AllTableData[i + 1].ID) await this.A_MoveFun(this.deleteManyData[0].ID,this.AllTableData[i + 1].ID)
}else{ }else{
this.A_MoveFun(this.deleteManyData[0].ID,'','down') await this.A_MoveFun(this.deleteManyData[0].ID,'','down')
} }
this.section()
break
} }
} }
}else if(this.deleteManyData.length > 1){ }else if(this.deleteManyData.length > 1){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment