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);
......
<template> <template>
<div class="master-data"> <div class="master-data">
<DataGrid <DataGrid :columns="cols" ref="grid" :conditions="easySearch" :action="action" :initsearch="sets" :high="false" :format="formatFun" :height="tableHeight" @on-selection-change="onSelect" :exportTitle="exportTitle">
:columns="cols"
ref="grid"
:conditions="easySearch"
:action="action"
:initsearch="sets"
:high="false"
:format="formatFun"
:height="tableHeight"
@on-selection-change="onSelect"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input <Input placeholder="请输入编码/名称/状态" v-width="200" v-model="easySearch.keys.value" clearable />
placeholder="请输入编码/名称/状态"
v-width="200"
v-model="easySearch.keys.value"
clearable
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
...@@ -29,33 +14,19 @@ ...@@ -29,33 +14,19 @@
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="add">新增</Button> <Button type="primary" @click="add">新增</Button>
<Button @click="openModalIm">导入</Button>
</template> </template>
<template slot="batch"> <template slot="batch">
<Button type="primary" @click="modalSchedule">批量送审</Button> <Button type="primary" @click="modalSchedule">批量送审</Button>
</template> </template>
</DataGrid> </DataGrid>
<Modal <Modal v-model="modal" :title="title" width="1000" footer-hide :mask-closable="false" :fullscreen="fullscreen">
v-model="modal" <component :is="detail" :eid="curId" :rootCategoryId="rootCategoryId" :rowsTable="rowsTable" :nodeInfo="nodeInfo" @on-close="cancel" @on-cancel="cancel" @on-ok="ok" ref="chlidren" />
:title="title"
width="1000"
footer-hide
:mask-closable="false"
:fullscreen="fullscreen"
>
<component
:is="detail"
:eid="curId"
:rootCategoryId="rootCategoryId"
:rowsTable="rowsTable"
:nodeInfo="nodeInfo"
@on-close="cancel"
@on-cancel="cancel"
@on-ok="ok"
ref="chlidren"
/>
</Modal> </Modal>
</div> <ImportExcel ref="importExcel" @on-get-data="getData" :columns="cols" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
// import Search from "./search"; // import Search from "./search";
...@@ -82,14 +53,16 @@ export default { ...@@ -82,14 +53,16 @@ export default {
v.rootCategoryId = this.nodeInfo.rootCategoryId; v.rootCategoryId = this.nodeInfo.rootCategoryId;
}, },
easySearch: { easySearch: {
keys: { op: "code,name", value: null }, keys: {
op: "code,name",
value: null
},
categoryId: { categoryId: {
op: "In", op: "In",
value: this.nodeInfo.ids value: this.nodeInfo.ids
} }
}, },
columns: [ columns: [{
{
type: "selection", type: "selection",
width: 70, width: 70,
align: "center" align: "center"
...@@ -100,8 +73,7 @@ export default { ...@@ -100,8 +73,7 @@ export default {
align: "left", align: "left",
render: (h, params) => { render: (h, params) => {
return h( return h(
"a", "a", {
{
props: {}, props: {},
on: { on: {
click: () => this.details(params.row) click: () => this.details(params.row)
...@@ -119,16 +91,8 @@ export default { ...@@ -119,16 +91,8 @@ export default {
{ {
key: "status", key: "status",
title: "状态", title: "状态",
align: "left", align: "center",
render: (h, params) => {
return h("state", {
props: {
code: "material.main.status", code: "material.main.status",
type: "text",
value: params.row.status + ""
}
});
}
}, },
{ {
key: "version", key: "version",
...@@ -161,47 +125,65 @@ export default { ...@@ -161,47 +125,65 @@ export default {
width: 150, width: 150,
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)
}
}, },
params.row.status == 3 ? "" : "删除" params.row.status == 3 ? "" : "删除"
), ),
h( h(
"op", "op", {
{ attrs: {
attrs: { oprate: "edit" }, oprate: "edit"
on: { click: () => this.send(params.row) } },
on: {
click: () => this.send(params.row)
}
}, },
(params.row.status == 0 || params.row.status == 1) && (params.row.status == 0 || params.row.status == 1) &&
this.status == 0 this.status == 0 ?
? "送审" "送审" :
: "" ""
) )
]); ]);
} }
} }
], //基础咧 ], //基础咧
cols: [], // cols: [], //
status: null status: null,
ModalIm: false,
addCol: [],
exportTitle: '物料管理',
}; };
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() { created() {
this.tableHeight = window.innerHeight - 220; this.tableHeight = window.innerHeight - 220;
if (this.nodeInfo.rootCategoryId == 0) { if (this.nodeInfo.rootCategoryId == 0) {
this.cols = this.columns; this.cols = this.columns;
} else { } else {
...@@ -254,13 +236,11 @@ export default { ...@@ -254,13 +236,11 @@ export default {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
initCols(delay) { initCols(delay) {
let conditions = [ let conditions = [{
{
conditionalType: "Equal", conditionalType: "Equal",
fieldName: "categoryId", fieldName: "categoryId",
fieldValue: this.nodeInfo.rootCategoryId fieldValue: this.nodeInfo.rootCategoryId
} }];
];
Api.listTable({ Api.listTable({
conditions: conditions, conditions: conditions,
...@@ -275,6 +255,7 @@ export default { ...@@ -275,6 +255,7 @@ export default {
}) && u.dataType != 5 }) && u.dataType != 5
); );
}); });
this.addCol = items;
this.cols = this.$u.clone(this.columns); this.cols = this.$u.clone(this.columns);
let extra = items.map(u => { let extra = items.map(u => {
console.log(u); console.log(u);
...@@ -310,6 +291,7 @@ export default { ...@@ -310,6 +291,7 @@ export default {
// console.log(this.cols) // console.log(this.cols)
} }
}); });
this.exportTitle = "物料管理-" + this.nodeInfo.rootCategoryName;
}, },
add() { add() {
if (this.nodeInfo.categoryId) { if (this.nodeInfo.categoryId) {
...@@ -367,7 +349,57 @@ export default { ...@@ -367,7 +349,57 @@ export default {
cancel() { cancel() {
this.curId = 0; this.curId = 0;
this.modal = false; this.modal = false;
},
//批量导入start
//导入功能
openModalIm() {
if (this.nodeInfo.categoryId) {
this.ModalIm = true
} else {
this.$Message.error("请先选择分类");
} }
},
ModalImCancel() {
this.ModalIm = false
},
getData(val) {
let url = `${material}/materialimportservice/import`;
alert(JSON.stringify(this.cols))
this.$refs.importExcel.deelData(url, this.cols, this.formatMethod(val))
},
//根据页面二次处理数据
formatMethod(val) {
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
name: ele.name ? ele.name : '',
version: ele.version ? Number(ele.version) : '',
drawing: ele.drawing ? ele.drawing : '',
description: ele.description ? ele.description : "",
code: 0,
status: this.nodeInfo.status == 1 ? 3 : 0,
codeRuleId: this.nodeInfo.codeRuleId,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id
};
this.addCol.forEach(el => {
obj[el.field] = ele[el.field]
})
if (ele.name && ele.name != '') {
obj.ico = false
} else {
obj.ico = true
}
tempList.push(obj);
});
return tempList
},
//批量导入end
}, },
watch: { watch: {
nodeInfo: { nodeInfo: {
...@@ -391,7 +423,8 @@ export default { ...@@ -391,7 +423,8 @@ export default {
} }
}; };
</script> </script>
<style lang="less" >
<style lang="less">
.master-data { .master-data {
.ivu-footer-toolbar-right { .ivu-footer-toolbar-right {
margin-right: 72% !important; margin-right: 72% !important;
......
...@@ -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