This commit is contained in:
2021-06-16 23:02:02 +00:00
parent e1912d5f14
commit 68768a47c6
4 changed files with 58 additions and 16 deletions

View File

@@ -243,6 +243,10 @@ export default {
gotoIndex: {
default: null,
type: Number
},
addNew: {
default: null,
type: Number
}
},
watch: {
@@ -253,8 +257,13 @@ export default {
},
gotoIndex(val, oldVal) {
if (val != oldVal) {
this.selectedRow = [{ index: val }];
this.activeItemIndex = val;
let gotoIndex = val;
if (val < 0) {
//it's a create request
gotoIndex = this.newItem();
}
this.selectedRow = [{ index: gotoIndex }];
this.activeItemIndex = gotoIndex;
this.$nextTick(() => {
const el = this.$refs.unittopform;
if (el) {
@@ -301,6 +310,8 @@ export default {
`Items[${this.activeWoItemIndex}].units[${this.activeItemIndex}].unitId`
);
});
return newIndex; //for create new on goto
},
unDeleteItem() {
this.value.items[this.activeWoItemIndex].units[