|
@@ -31,7 +31,12 @@
|
|
|
新建
|
|
新建
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
|
- <el-button type="danger" size="mini" icon="el-icon-delete">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ @click="remove"
|
|
|
|
|
+ >
|
|
|
删除
|
|
删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
@@ -236,6 +241,7 @@
|
|
|
bomChange(e) {
|
|
bomChange(e) {
|
|
|
this.currentNodeData.bomType = e;
|
|
this.currentNodeData.bomType = e;
|
|
|
this.getTreeData();
|
|
this.getTreeData();
|
|
|
|
|
+ this.getVersion();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
async getTreeData() {
|
|
async getTreeData() {
|
|
@@ -275,6 +281,7 @@
|
|
|
if (id) {
|
|
if (id) {
|
|
|
getBomGetById(id).then((res) => {
|
|
getBomGetById(id).then((res) => {
|
|
|
this.currentNodeData = res.data;
|
|
this.currentNodeData = res.data;
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
this.currentNodeData = {
|
|
this.currentNodeData = {
|
|
@@ -284,13 +291,18 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- getVersion() {
|
|
|
|
|
|
|
+ getVersion(type) {
|
|
|
let param = {
|
|
let param = {
|
|
|
categoryId: this.searchObj.categoryId,
|
|
categoryId: this.searchObj.categoryId,
|
|
|
bomType: this.currentNodeData.bomType
|
|
bomType: this.currentNodeData.bomType
|
|
|
};
|
|
};
|
|
|
versionList(param).then((res) => {
|
|
versionList(param).then((res) => {
|
|
|
- this.versList = res;
|
|
|
|
|
|
|
+ this.versList = res || [];
|
|
|
|
|
+ if (type == 'del' || type == 'add') {
|
|
|
|
|
+ this.searchObj.versions =
|
|
|
|
|
+ this.versList[this.versList.length - 1].versions;
|
|
|
|
|
+ this.getTreeData();
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -302,19 +314,12 @@
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
})
|
|
})
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
- const loading = this.$loading({ lock: true });
|
|
|
|
|
-
|
|
|
|
|
- deleteBomTreeList([this.currentNodeData.id])
|
|
|
|
|
- .then((msg) => {
|
|
|
|
|
- loading.close();
|
|
|
|
|
- this.$message.success('删除' + msg);
|
|
|
|
|
- this.getTreeData();
|
|
|
|
|
- })
|
|
|
|
|
- .catch((e) => {
|
|
|
|
|
- loading.close();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ deleteBomTreeList([this.currentNodeData.id]).then((msg) => {
|
|
|
|
|
+ this.$message.success('删除' + msg);
|
|
|
|
|
+ this.getVersion('del');
|
|
|
|
|
+ });
|
|
|
})
|
|
})
|
|
|
- .catch(() => {});
|
|
|
|
|
|
|
+ .finally(() => {});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
transformation(tt) {
|
|
transformation(tt) {
|
|
@@ -340,7 +345,7 @@
|
|
|
|
|
|
|
|
baseClose(val) {
|
|
baseClose(val) {
|
|
|
if (val) {
|
|
if (val) {
|
|
|
- this.getVersion();
|
|
|
|
|
|
|
+ this.getVersion('add');
|
|
|
}
|
|
}
|
|
|
this.baseInfoShow = false;
|
|
this.baseInfoShow = false;
|
|
|
}
|
|
}
|