Commit 5125cc55 authored by 仇晓婷's avatar 仇晓婷

订单树

parent a4e11182
...@@ -40,7 +40,9 @@ export default { ...@@ -40,7 +40,9 @@ export default {
}, },
methods: { methods: {
loadTree() { loadTree() {
this.$api.get(`${technologyUrl}productlevel/getproducttreenew`).then(r => { this.$api
.get(`${technologyUrl}productlevel/getproducttreenew`)
.then(r => {
setTree(r.result); setTree(r.result);
function setTree(data) { function setTree(data) {
data.map(u => { data.map(u => {
...@@ -61,41 +63,51 @@ export default { ...@@ -61,41 +63,51 @@ export default {
toggle() { toggle() {
this.expand = !this.expand; this.expand = !this.expand;
}, },
renderContent(h,{root,node,data}){ renderContent(h, { root, node, data }) {
let type="md-folder"; let type = "md-folder";
if(data.isProduct!=0){ if (data.isProduct != 0) {
type="ios-image" type = "ios-image";
} }
return h('span', [ return h("span", [
h('Icon', { h("Icon", {
props: { props: {
type: type type: type
}, },
style: { style: {
marginRight: '8px' marginRight: "8px"
} }
}), }),
h('span',{style:{ h(
color:data.isProduct==0?"#000":"rgba(38, 128, 235, 1)" "span",
}}, data.title) {
]) style: {
color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
}
},
data.title
)
]);
}, },
change(v, b) { change(v, b) {
// console.log(b) console.log(b);
let ids = []; let ids = [];
ids.push(b.value); if (b.bomId !== 0) {
ids.push(b.bomId);
}
if (b.children) { if (b.children) {
addId(b.children); addId(b.children);
function addId(data) { function addId(data) {
data.map(u => { data.map(u => {
ids.push(u.value); if (u.bomId !== 0) {
ids.push(u.bomId);
}
if (u.children) { if (u.children) {
addId(u.children); addId(u.children);
} }
}); });
} }
} }
this.$emit("on-select", b.value, b, ids); this.$emit("on-select", b.bomId, b, ids);
}, },
hide() { hide() {
this.$emit("on-hide"); this.$emit("on-hide");
...@@ -137,7 +149,7 @@ export default { ...@@ -137,7 +149,7 @@ export default {
font-weight: bold; font-weight: bold;
line-height: 50px; line-height: 50px;
color: rgba(81, 90, 110, 1); color: rgba(81, 90, 110, 1);
background:rgba(245,246,250,1); background: rgba(245, 246, 250, 1);
opacity: 1; opacity: 1;
padding-left: 10px; padding-left: 10px;
} }
......
...@@ -783,7 +783,7 @@ export default { ...@@ -783,7 +783,7 @@ export default {
this.showMenu = true; this.showMenu = true;
}, },
productSearch(id, item, ids) { productSearch(id, item, ids) {
let where = { bomId: { op: "In", value: item.bomId } }; let where = { bomId: { op: "In", value: ids } };
this.$refs.grid.reload(where); this.$refs.grid.reload(where);
}, },
//确定分解 //确定分解
......
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