Commit 929cf7a5 authored by 仇晓婷's avatar 仇晓婷

产品bom

parent 7e87c011
...@@ -170,6 +170,7 @@ export default { ...@@ -170,6 +170,7 @@ export default {
this.entity.productUrl = liUrl; this.entity.productUrl = liUrl;
}, },
handleSelect1(data) { handleSelect1(data) {
console.log(data)
if (data.length > 0) { if (data.length > 0) {
this.selectdata1 = []; this.selectdata1 = [];
this.selectdata1 = data; this.selectdata1 = data;
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() { created() {
// this.getTree(); this.getTree();
}, },
methods: { methods: {
getTree() { getTree() {
......
...@@ -224,26 +224,23 @@ export default { ...@@ -224,26 +224,23 @@ export default {
}, },
componayId(v) { componayId(v) {
if (v != null) { if (v != null) {
var url = `${designUrl}/productlevel/getdepartmentstree`; var arr = this.data2;
service.get(`${url}`).then(response => { var id = this.componayId;
var arr = response.result; var returnedItem = "";
var id = this.componayId; var finds = function(arr, id) {
var returnedItem = ""; for (let i = 0; i < arr.length; i++) {
var finds = function(arr, id) { if (arr[i].id == id) {
for (let i = 0; i < arr.length; i++) { returnedItem = arr[i].title;
if (arr[i].id == id) { break;
returnedItem = arr[i].title; } else if (arr[i].children.length > 0) {
break; finds(arr[i].children, id); //递归调用
} else if (arr[i].children.length > 0) {
finds(arr[i].children, id); //递归调用
}
} }
return returnedItem; }
}; return returnedItem;
finds(arr, id); };
this.label = returnedItem; finds(arr, id);
this.value = id; this.label = returnedItem;
}); this.value = id;
} }
} }
} }
......
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