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

update

parent 8f56f0e8
......@@ -188,6 +188,7 @@ export default {
itemdata:[],
deleteRowData:[],
deleteManyData:[],
currentRow: [],
editData:[],
typeV:'',
pathE:'',
......@@ -226,41 +227,41 @@ export default {
},
methods:{
//查询
query(keyWord){
this.$axios({
method:"post",
url:`/api/Schedule/Schedule_Query?argKeyWord=${ keyWord.argKeyWord }&argKeyWord1=${ keyWord.argKeyWord1 }&argWhere=${ keyWord.argWhere }&Stime=${ keyWord.Stime }&Etime=${ keyWord.Etime }`,
}).then((res)=>{
if(res.data.data.length != 0 ){
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].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')
if(res.data.data[i].StartDt == 'Invalid date'){
res.data.data[i].StartDt = ''
}
if( res.data.data[i].EndDt == 'Invalid date'){
res.data.data[i].EndDt = ''
}
}
this.AllTableData = res.data.data
if(this.AllTableData.length >50){
this.tableData = this.AllTableData.slice(0,50)
async query(keyWord){
await this.$axios({
method:"post",
url:`/api/Schedule/Schedule_Query?argKeyWord=${ keyWord.argKeyWord }&argKeyWord1=${ keyWord.argKeyWord1 }&argWhere=${ keyWord.argWhere }&Stime=${ keyWord.Stime }&Etime=${ keyWord.Etime }`,
}).then((res)=>{
if(res.data.data.length != 0 ){
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].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')
if(res.data.data[i].StartDt == 'Invalid date'){
res.data.data[i].StartDt = ''
}
if( res.data.data[i].EndDt == 'Invalid date'){
res.data.data[i].EndDt = ''
}
}
this.AllTableData = res.data.data
if(this.AllTableData.length >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{
this.tableData = this.AllTableData
this.tableData = []
this.TotalCount = 0
this.PageIndex = 1
this.TotalPage = 1
}
this.TotalCount = this.AllTableData.length
this.PageIndex = 1
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)
})
}).catch(function(err){
console.log('err',err)
})
},
// 保存变量
saveData (data, type) {
......@@ -532,8 +533,12 @@ export default {
},
//勾选
handleSelectionChange(val){
console.log(val)
this.deleteManyData = val
if (val && val.length !== 0) {
this.deleteManyData = val
this.currentRow = val
} else {
this.deleteManyData = val
}
},
//暂停
zantin(data){
......@@ -685,34 +690,35 @@ export default {
}
},
//移动接口
A_MoveFun(id1,id2,text){
async A_MoveFun(id1,id2,text){
var $this = this
this.$axios({
method:"post",
url:`/api/Schedule/Schedule_Move?argID1=${id1}&&argID2=${id2}`,
}).then((res)=>{
var postData = this.resetData()
$this.query(postData)
}).catch((err) =>{
this.typeV = '7'
this.deleteShow = true
if(text == 'down'){
this.deletetext = '已是最后一个不可下移'
}else{
this.deletetext = '已是第一个不可上移'
}
})
await this.$axios({
method:"post",
url:`/api/Schedule/Schedule_Move?argID1=${id1}&&argID2=${id2}`,
}).then(async (res)=>{
var postData = this.resetData()
await $this.query(postData)
}).catch((err) =>{
this.typeV = '7'
this.deleteShow = true
if(text == 'down'){
this.deletetext = '已是最后一个不可下移'
}else{
this.deletetext = '已是第一个不可上移'
}
})
},
//上移
MoveUp(){
async MoveUp(){
if(this.deleteManyData.length == 1 ){
for(let i=0;i<this.AllTableData.length;i++){
if(this.AllTableData[i].ID == this.deleteManyData[0].ID){
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{
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){
......@@ -725,16 +731,24 @@ export default {
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 ){
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){
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{
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){
......
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