Commit f5c6af41 authored by renjintao's avatar renjintao

物料管理

parent 8018f5c3
<template>
<div class="classification">
<div class="classification">
<Layout>
<Sider width="300" v-if="showMenu">
<div class="p-list">
......@@ -10,21 +10,13 @@
<Icon type="ios-arrow-down"></Icon>
</a>
<DropdownMenu slot="list">
<DropdownItem
v-for="item in cityList"
:key="item.id"
:name="item.id"
>{{ item.name }}</DropdownItem>
<DropdownItem v-for="item in cityList" :key="item.id" :name="item.id">{{ item.name }}</DropdownItem>
</DropdownMenu>
</Dropdown>
<div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small">
<Button icon="md-add" title="新增顶级" @click="addNew"></Button>
<Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" @click="toggle" title="展开/合并"></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree(model8)"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
......@@ -36,13 +28,7 @@
<div class="fg">
<div class="tree">
<Tree :data="data" ref="tree" @on-select-change="change" :render="renderContent"></Tree>
<Dropdown
transfer
ref="contentMenu"
style="display: none;"
trigger="click"
placement="right-start"
>
<Dropdown transfer ref="contentMenu" style="display: none;" trigger="click" placement="right-start">
<DropdownMenu slot="list" ref="ppp" style="min-width: 80px;">
<DropdownItem @click.native="add">
<a>添加</a>
......@@ -69,17 +55,11 @@
</Content>
</Layout>
<Modal v-model="modal" :title="title" width="1500" footer-hide :mask-closable="false">
<component
:is="detail"
:eid="curId"
:nodeInfo="nodeInfo"
@on-close="cancel"
@on-ok="ok"
ref="chlidren"
/>
<component :is="detail" :eid="curId" :nodeInfo="nodeInfo" @on-close="cancel" @on-ok="ok" ref="chlidren" />
</Modal>
</div>
</div>
</template>
<script>
import MasterData from "./masterData.vue";
......@@ -112,7 +92,10 @@ export default {
dataList: []
};
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
......@@ -220,10 +203,13 @@ export default {
this.curId = 0;
this.modal = false;
},
renderContent(h, { root, node, data }) {
renderContent(h, {
root,
node,
data
}) {
return h(
"span",
{
"span", {
on: {
click: () => {
this.handleSelect(data); //手动选择树节点
......@@ -240,9 +226,9 @@ export default {
},
data.title +
"(" +
(data.totalMaterialCount == undefined
? "0"
: data.totalMaterialCount) +
(data.totalMaterialCount == undefined ?
"0" :
data.totalMaterialCount) +
")"
);
},
......@@ -274,9 +260,11 @@ export default {
},
loadTree(id) {
let data = {
conditions: [
{ fieldName: "codeRuleId", fieldValue: id, conditionalType: "Equal" }
],
conditions: [{
fieldName: "codeRuleId",
fieldValue: id,
conditionalType: "Equal"
}],
sortBy: "code",
isDesc: false
};
......@@ -308,6 +296,7 @@ export default {
ids.push(b.id);
if (b.children) {
addId(b.children);
function addId(data) {
data.map(u => {
ids.push(u.id);
......@@ -331,6 +320,7 @@ export default {
let expand = this.expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
if (keys.length < u.title) {
......@@ -351,7 +341,8 @@ export default {
}
};
</script>
<style lang="less" >
<style lang="less">
.classification {
font-family: Microsoft YaHei;
......@@ -367,6 +358,7 @@ export default {
background: #eee;
padding-left: 10px;
}
.p-list {
h3 {
height: 50px;
......@@ -379,22 +371,26 @@ export default {
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
height: 100%;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
}
.show_menu {
width: 30px;
height: 30px;
......@@ -402,6 +398,7 @@ export default {
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px;
height: 30px;
......@@ -414,11 +411,13 @@ export default {
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover {
background-color: #2d8cf0;
color: white;
}
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
......
<template>
<div class="master-data">
<div class="master-data">
<!-- <Table border :columns="columns" :data="dataColumns" :height="tableHeight"></Table> -->
<DataGrid
:columns="columns"
ref="grid"
:conditions="easySearch"
:action="action"
:high="false"
:height="tableHeight"
>
<DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action" :high="false" :height="tableHeight">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
......@@ -20,8 +13,9 @@
</Form>
</template>
</DataGrid>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
......@@ -33,8 +27,14 @@ export default {
tableHeight: "",
dataColumns: [],
easySearch: {
keys: { op: "code,name", value: null },
id: { op: "In", value: "" }
keys: {
op: "code,name",
value: null
},
id: {
op: "In",
value: ""
}
},
columns: [
// {
......@@ -71,20 +71,28 @@ export default {
width: 260,
align: "left",
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row)
}
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
"op", {
attrs: {
oprate: "delete"
},
on: {
click: () => this.remove(params.row.id)
}
},
"删除"
)
......@@ -94,7 +102,10 @@ export default {
]
};
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
......@@ -143,6 +154,7 @@ export default {
}
};
</script>
<style lang="less" scoped>
.spare-parts {
width: 100%;
......
<template>
<div class="classification">
<div class="classification">
<Layout>
<Sider width="300" v-if="showMenu">
<div class="p-list">
......@@ -10,20 +10,12 @@
<Icon type="ios-arrow-down"></Icon>
</a>
<DropdownMenu slot="list">
<DropdownItem
v-for="item in cityList"
:key="item.id"
:name="item.id"
>{{ item.name }}</DropdownItem>
<DropdownItem v-for="item in cityList" :key="item.id" :name="item.id">{{ item.name }}</DropdownItem>
</DropdownMenu>
</Dropdown>
<div class="fr mr10 mt10">
<ButtonGroup class="fr ddi" size="small">
<Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" @click="toggle" title="展开/合并"></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree(model8)"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
......@@ -48,8 +40,9 @@
<MasterData ref="dataTable" :nodeInfo="nodeInfo" @on-ok="ok" />
</Content>
</Layout>
</div>
</div>
</template>
<script>
import MasterData from "./masterData.vue";
......@@ -70,6 +63,7 @@ export default {
nodeInfo: {
categoryId: 0,
rootCategoryId: 0,
rootCategoryName: "",
ids: [],
addChange: true,
codeRuleId: 0,
......@@ -82,9 +76,14 @@ export default {
showMenu: true,
dataList: [],
codeRuleId: "",
rootCategoryId: null,
categoryId: null,
};
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
......@@ -138,10 +137,13 @@ export default {
this.curId = 0;
this.modal = false;
},
renderContent(h, { root, node, data }) {
renderContent(h, {
root,
node,
data
}) {
return h(
"span",
{
"span", {
on: {
click: () => {
this.handleSelect(root, data); //手动选择树节点
......@@ -150,21 +152,24 @@ export default {
},
data.title +
"(" +
(data.totalMaterialCount == undefined
? "0"
: data.totalMaterialCount) +
(data.totalMaterialCount == undefined ?
"0" :
data.totalMaterialCount) +
")"
);
},
handleSelect(root, data) {
let pid = null; //定义最顶级id
let upId = data.upId;
let pid = -1; //定义最顶级id
var pname = "";
var upId = data.upId;
let roots = root;
function addId(roots, upId) {
roots.map((u) => {
if (u.node.id == upId) {
if (u.node.upId == 0) {
pid = u.node.id;
pname = u.node.name;
} else {
upId = u.node.upId;
addId(roots, upId);
......@@ -172,19 +177,25 @@ export default {
}
});
}
addId(roots, upId);
this.nodeInfo.categoryId = data.id;
if (pid == null) {
this.nodeInfo.rootCategoryName = data.name;
if (pid == -1) {
this.nodeInfo.rootCategoryId = data.id;
this.nodeInfo.rootCategoryName = data.name;
} else {
this.nodeInfo.rootCategoryId = pid;
this.nodeInfo.rootCategoryName = pname
}
},
loadTree(id) {
let data = {
conditions: [
{ fieldName: "codeRuleId", fieldValue: id, conditionalType: "Equal" },
],
conditions: [{
fieldName: "codeRuleId",
fieldValue: id,
conditionalType: "Equal"
}, ],
sortBy: "code",
isDesc: false,
};
......@@ -219,6 +230,7 @@ export default {
ids.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map((u) => {
ids.push(u.value);
......@@ -240,6 +252,7 @@ export default {
let expand = this.expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map((u) => {
if (keys.length < u.title) {
......@@ -260,7 +273,8 @@ export default {
},
};
</script>
<style lang="less" >
<style lang="less">
.classification {
font-family: Microsoft YaHei;
......@@ -276,6 +290,7 @@ export default {
background: #eee;
padding-left: 10px;
}
.p-list {
h3 {
height: 50px;
......@@ -288,22 +303,26 @@ export default {
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
height: 100%;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
}
.show_menu {
width: 30px;
height: 30px;
......@@ -311,6 +330,7 @@ export default {
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px;
height: 30px;
......@@ -323,11 +343,13 @@ export default {
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover {
background-color: #2d8cf0;
color: white;
}
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
......
This diff is collapsed.
......@@ -27,7 +27,7 @@ window.apsUrl = `http://${systemApi.aps}:10111/api/services/app`;//aps排产(61)
window.technologyUrl =`http://${address}:10000/technology/`;//新工艺规程接口
window.iconImg = `/imgicon/`;
window.mncImg = `/images/mnc/`;//mnc图片
window.material = `http://${address}:10000/material`; //物料管理
window.material = `http://${address}:10000/material`; //物料管理 10032
window.Platform = `http://${address}:10000/platform`; //计划管理10131
/* window.systemUrl = `http://${address}:10020/api/services/app`; //System-api 系统管理(基础数据)
......
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