Commit 4c9c39af authored by 周远喜's avatar 周远喜

Merge branch 'master' of http://git.mes123.com/zhouyx/mes-ui

parents 44632f2d b61860d7
......@@ -403,10 +403,31 @@ div::-webkit-scrollbar-corner {
.pt15 {
padding-top: 15px
}
.pr10 {
padding-right: 10px;
}
.pr20 {
padding-right: 20px;
}
.pr30 {
padding-right: 30px;
}
.pr50 {
padding-right: 50px;
}
.pr80 {
padding-right: 80px;
}
.pr100 {
padding-right: 100px;
}
.pr200 {
padding-right: 200px;
}
.pr240 {
padding-right: 240px;
}
.bnone {
border: none;
......@@ -996,10 +1017,9 @@ textarea::-webkit-input-placeholder {
display:block;
line-height:30px;
padding:5px 10px;
background:#f5f6fa;
border-bottom:solid 1px #ccc;
border-left:solid 1px #ccc;
border-right:solid 1px #ccc
border-bottom: #ccc solid 1px;
border-right: #ccc solid 1px;
border-left: #ccc solid 1px;
}
.cellInfoTitle {
padding: 0 10px;
......
<template>
<div class="flex fd tree-menu">
<div class="flex fd tree-menu">
<h3>
产品结构
<div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small">
<Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
产品结构
<div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small">
<Button :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" @click="toggle" title="展开/合并"></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
</h3>
<div class="search">
<Input search placeholder="请输入关键字" v-model="keys" clearable />
<Input search placeholder="请输入关键字" v-model="keys" clearable />
</div>
<div class="fg">
<div class="tree">
<Tree :data="data" :render="renderContent" ref="tree" @on-select-change="change"></Tree>
</div>
<div class="tree">
<Tree :data="data" :render="renderContent" ref="tree" @on-select-change="change"></Tree>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "",
data() {
return {
keys: "",
expand: false,
list: []
};
},
created() {
this.loadTree();
},
methods: {
loadTree() {
this.$api
.get(`${technologyUrl}productlevel/getproducttreenew`)
.then(r => {
setTree(r.result);
function setTree(data) {
data.map(u => {
u.title = u.name;
u.value = u.id;
// u.expand = true;
// u.selected = false;
// u.checked = false;
if (u.children) {
setTree(u.children);
}
});
}
var data = r.result;
this.list = this.$u.clone(data);
});
name: "",
data() {
return {
keys: "",
expand: false,
list: []
};
},
toggle() {
this.expand = !this.expand;
created() {
this.loadTree();
},
renderContent(h, { root, node, data }) {
let type = "md-folder";
if (data.isProduct != 0) {
type = "ios-image";
}
return h("span", [
h("Icon", {
props: {
type: type
},
style: {
marginRight: "8px"
}
}),
h(
"span",
{
style: {
color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
methods: {
loadTree() {
this.$api
.get(`${technologyUrl}productlevel/getproducttreenew`)
.then(r => {
setTree(r.result);
function setTree(data) {
data.map(u => {
u.title = u.name;
u.value = u.id;
u.expand = true;
// u.selected = false;
// u.checked = false;
if (u.children) {
setTree(u.children);
}
});
}
var data = r.result;
this.list = this.$u.clone(data);
});
},
toggle() {
this.expand = !this.expand;
},
renderContent(h, {
root,
node,
data
}) {
let type = "md-folder";
if (data.isProduct != 0) {
type = "ios-image";
}
},
data.title
)
]);
},
change(v, b) {
// console.log(b);
let ids = [];
let productIds = [];
if (b.bomId !== 0) {
ids.push(b.bomId);
}
productIds.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map(u => {
if (u.bomId !== 0) {
ids.push(u.bomId);
return h("span", [
h("Icon", {
props: {
type: type
},
style: {
marginRight: "8px"
}
}),
h(
"span", {
style: {
color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
}
},
data.title
)
]);
},
change(v, b) {
// console.log(b);
let ids = [];
let productIds = [];
if (b.bomId !== 0) {
ids.push(b.bomId);
}
productIds.push(u.value);
if (u.children) {
addId(u.children);
productIds.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map(u => {
if (u.bomId !== 0) {
ids.push(u.bomId);
}
productIds.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
}
});
this.$emit("on-select", b.bomId, b, productIds, ids);
},
hide() {
this.$emit("on-hide");
}
}
this.$emit("on-select", b.bomId, b, productIds, ids);
},
hide() {
this.$emit("on-hide");
}
},
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
if (keys.length < 2) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
} else if (u.children) {
search(keys, u.children);
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
if (keys.length < 2) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
} else if (u.children) {
search(keys, u.children);
}
}
});
}
}
});
}
return result;
return result;
}
}
}
};
</script>
<style lang="less">
@import "../../assets/css/custom.less";
.tree-menu {
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: @left-tree-header-color;
background: @left-tree-header-bg-color;
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
// height:0;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: @left-tree-header-color;
background: @left-tree-header-bg-color;
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
// height:0;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
</style>
\ No newline at end of file
</style>
......@@ -266,6 +266,7 @@ export default {
if (r.success) {
this.$Message.success('审批通过成功')
this.footerStatu = 3
this.$refs.userProcess.load(this.detailId)
} else {
this.$Message.error('审批通过失败')
}
......@@ -282,6 +283,7 @@ export default {
Api.reject(param).then((r) => {
if (r.success) {
this.$Message.success('驳回审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
......@@ -298,6 +300,7 @@ export default {
Api.terminate(param).then((r) => {
if (r.success) {
this.$Message.success('终止审批成功')
this.$refs.userProcess.load(this.detailId)
this.footerStatu = 3
} else {
this.$Message.error('加载失败')
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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