运行图代码调整

This commit is contained in:
joylink_cuiweidong 2020-10-21 18:40:02 +08:00
parent c684dd5149
commit 4eb69d03a6

View File

@ -204,14 +204,37 @@ export default {
},
handleDeleteTask() {
if (this.currentRow.routingCode || this.currentRow.tripNumber) {
this.$emit('dispatchDialog', {
name: 'deleteTask', params: {
isPlan: true,
routingCode: this.currentRow.routingCode,
serviceNumber: this.model.serviceNumber,
tripNumber: this.currentRow.tripNumber
}
});
let index = -1;
if (this.currentRow.routingCode) {
index = this.model.tripConfigList.findIndex(
elem => {
return elem.routingCode == this.currentRow.routingCode &&
elem.startTime == this.currentRow.startTime &&
elem.endTime == this.currentRow.endTime;
}
);
} else {
index = this.model.tripConfigList.findIndex(
elem => { return elem.tripNumber == this.currentRow.tripNumber; }
);
}
this.model.tripConfigList.splice(index, 1);
// const tripConfigList = Object.assign([], this.model.tripConfigList);
// tripConfigList.forEach(tripConfig=>{
// if (tripConfig.routingCode == model.routingCode) {
// Object.assign(tripConfig, model);
// }
// });
// this.model.tripConfigList = tripConfigList;
// this.$emit('dispatchDialog', {
// name: 'deleteTask', params: {
// isPlan: true,
// routingCode: this.currentRow.routingCode,
// serviceNumber: this.model.serviceNumber,
// tripNumber: this.currentRow.tripNumber
// }
// });
} else {
this.$messageBox(this.$t('tip.selectAPieceOfData'));
}
@ -245,25 +268,27 @@ export default {
this.model.tripConfigList.push(model);
}
},
handleConfirmDeleteTask(model) {
let index = -1;
if (model.routingCode) {
index = this.model.tripConfigList.findIndex(
elem => { return elem.routingCode == model.routingCode; }
);
} else {
index = this.model.tripConfigList.findIndex(
elem => { return elem.tripNumber == model.tripNumber; }
);
}
if (index >= 0) {
if (model.addToFront) {
this.model.tripConfigList = this.model.tripConfigList.slice(index + 1);
} else {
this.model.tripConfigList = this.model.tripConfigList.slice(0, index);
}
}
},
// handleConfirmDeleteTask(model) {
// debugger;
// let index = -1;
// if (model.routingCode) {
// index = this.model.tripConfigList.findIndex(
// elem => { return elem.routingCode == model.routingCode; }
// );
// } else {
// index = this.model.tripConfigList.findIndex(
// elem => { return elem.tripNumber == model.tripNumber; }
// );
// }
// // this.model.tripConfigList.
// if (index >= 0) {
// if (model.addToFront) {
// this.model.tripConfigList = this.model.tripConfigList.slice(index + 1);
// } else {
// this.model.tripConfigList = this.model.tripConfigList.slice(0, index);
// }
// }
// },
handleCommit() {
if (this.isNew) {
if (this.model.tripConfigList.length > 0) {