Commit f5c6af41 authored by renjintao's avatar renjintao

物料管理

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