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

订单树

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