Commit ca559b17 authored by 仇晓婷's avatar 仇晓婷

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

parents 8aee2646 abc532dd
......@@ -100,6 +100,8 @@ export default {
userConfig: null, //用户页面配置信息。,
// userId: 1
userId: this.$store.state.userInfo.userId,
treeData: [], //物料数据
codeRuleData: [], //物料编码
};
},
props: {
......@@ -271,6 +273,9 @@ export default {
this.$dragging.$on("dragend", (e) => {
this.saveUserconfig();
});
//物料加载类型数据
this.getTreeData();
this.getcodeRuleData();
},
methods: {
//数据加载
......@@ -513,6 +518,7 @@ export default {
const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性
var tempCol = [];
var tempCol1 = [];
var columnsCur = this.$u.clone(this.columnsNow); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if ((el.hide && !el.import) || (!el.hide && el.key != "action" && el.type != "selection" && el.key != "ico")) {
......@@ -522,6 +528,12 @@ export default {
code: el.code
}); //临时存放code数据字典的字段及对应的数据字典code
}
if (el.materialKey) {
tempCol1.push({
key: el.key,
code: el.materialKey
}); //临时存放物料管理大类和子类列表
}
tHeader.push(el.title);
filterVal.push(el.key);
}
......@@ -534,7 +546,19 @@ export default {
e[ele.key]
);
});
//导出数据增加对应的物料管理信息
tempCol1.forEach((elcol1) => {
if (elcol1.code == 1) {
e[elcol1.key] = this.getType1(e[elcol1.key])
} else if (elcol1.code == 2) {
e[elcol1.key] = this.getType2(e[elcol1.key])
} else if (elcol1.code == 3) {
e[elcol1.key] = this.getType3(e[elcol1.key])
}
});
});
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
this.$u.outExcel(this.exportTitle +
......@@ -545,6 +569,57 @@ export default {
);
});
},
//物料大类和子类的解析start
getTreeData() {
let data = {
conditions: []
};
this.$api.post(`${material}/category/list`, data).then((r) => {
this.treeData = r.result
});
},
getType1(val) {
let tempTreeList = this.$u.clone(this.treeData)
let rootName = ""
tempTreeList.forEach(ele => {
if (ele.upId == 0 && ele.id == val) {
rootName = ele.name
}
})
return rootName
},
getType2(val) {
let tempTreeList = this.$u.clone(this.treeData)
let childrenName = ""
tempTreeList.forEach(ele => {
if (ele.upId > 0 && ele.id == val) {
childrenName = ele.name
}
})
return childrenName
},
//获取编码名称
getcodeRuleData() {
let data = {
conditions: []
};
this.$api.post(`${material}/coderule/paged`, data).then((r) => {
if (r.success) {
this.codeRuleData = r.result.items || []
}
});
},
getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData)
let codeRuleName = ""
codeRuleDataList.forEach(ele => {
if (ele.id == val) {
codeRuleName = ele.name
}
})
return codeRuleName
},
//物料大类和子类的解析end
},
computed: {
columnsNow() {
......
......@@ -50,7 +50,7 @@
</FormItem>
</Form>
</FooterToolbar>
<Modal v-model="infoModal" :title="titleInfo" fullscreen>
<Modal v-model="infoModal" :title="modalTitles" fullscreen>
<DataGrid :tool="false" :page="false" :columns="colsIm" :data="dataIm" :height="tdHeightExcel+30" ref="dataImport"></DataGrid>
<div slot="footer">
<Button @click="infoModal=false">关闭</Button>
......@@ -236,7 +236,6 @@ export default {
}
});
}
arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
......@@ -246,9 +245,9 @@ export default {
);
}
});
})
this.dataIm = useData;
let tempData = this.$u.clone(this.dataIm);
this.$emit("on-get-data", tempData)
},
......
This diff is collapsed.
<template>
<div class="classification">
<div class="classification">
<Layout>
<Sider width="300" v-if="showMenu">
<div class="p-list">
......@@ -10,25 +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 ddi" size="small">
<Button
:icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@click="toggle"
title="展开/合并"
></Button>
<Button
icon="md-refresh"
title="刷新"
@click="loadTree(model8,nodeInfo.codeRuleType)"
></Button>
<Button :icon="expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'" @click="toggle" title="展开/合并"></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree(model8,nodeInfo.codeRuleType)"></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
......@@ -52,7 +40,7 @@
<MasterData ref="dataTable" :nodeInfo="nodeInfo" @on-ok="ok" />
</Content>
</Layout>
</div>
</div>
</template>
<script>
......@@ -93,7 +81,10 @@ export default {
categoryId: null,
};
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
......@@ -149,10 +140,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); //手动选择树节点
......@@ -161,9 +155,9 @@ export default {
},
data.title +
"(" +
(data.totalMaterialCount == undefined
? "0"
: data.totalMaterialCount) +
(data.totalMaterialCount == undefined ?
"0" :
data.totalMaterialCount) +
")"
);
},
......@@ -200,8 +194,7 @@ export default {
},
loadTree(id, codeRuleType) {
let data = {
conditions: [
{
conditions: [{
fieldName: "codeRuleId",
fieldValue: id,
conditionalType: "Equal",
......
......@@ -47,6 +47,8 @@ export default {
selectRows: [],
rowsTable: [],
fullscreen: false,
treeData: [],
codeRuleData: [],
detail: null,
temTitle: "物料管理",
sets: v => {
......@@ -74,15 +76,40 @@ export default {
align: "center",
code: "material.code.type"
},
{
key: "codeRuleId",
title: "编码名称",
materialKey: '3',
render: (h, params) => {
return h(
"span", {},
this.getType3(params.row.codeRuleId)
);
}
},
{
key: "rootCategoryId",
title: "大类编号",
title: "大类",
align: "right",
materialKey: '1',
render: (h, params) => {
return h(
"span", {},
this.getType1(params.row.rootCategoryId)
);
}
},
{
key: "categoryId",
title: "子类编号",
title: "子类",
align: "right",
materialKey: '2',
render: (h, params) => {
return h(
"span", {},
this.getType2(params.row.categoryId)
);
}
},
{
key: "code",
......@@ -214,6 +241,8 @@ export default {
});
},
mounted() {
this.getTreeData()
this.getcodeRuleData()
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
......@@ -401,6 +430,7 @@ export default {
categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id
codeRuleType: this.nodeInfo.codeRuleType
};
this.addCol.forEach(el => {
obj[el.field] = ele[el.field]
......@@ -417,6 +447,57 @@ export default {
},
//批量导入end
//物料大类和子类的解析start
getTreeData() {
let data = {
conditions: []
};
Api.list(data).then((r) => {
this.treeData = r.result
});
},
getType1(val) {
let tempTreeList = this.$u.clone(this.treeData)
let rootName = ""
tempTreeList.forEach(ele => {
if (ele.upId == 0 && ele.id == val) {
rootName = ele.name
}
})
return rootName
},
getType2(val) {
let tempTreeList = this.$u.clone(this.treeData)
let childrenName = ""
tempTreeList.forEach(ele => {
if (ele.upId > 0 && ele.id == val) {
childrenName = ele.name
}
})
return childrenName
},
//获取编码名称
getcodeRuleData() {
let data = {
conditions: []
};
Api.pagedSlecet(data).then((r) => {
if (r.success) {
this.codeRuleData = r.result.items || []
}
});
},
getType3(val) {
let codeRuleDataList = this.$u.clone(this.codeRuleData)
let codeRuleName = ""
codeRuleDataList.forEach(ele => {
if (ele.id == val) {
codeRuleName = ele.name
}
})
return codeRuleName
},
//物料大类和子类的解析end
},
watch: {
nodeInfo: {
......
<template>
<div>
<DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action">
<div>
<DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action" exportTitle="工艺Bom">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
placeholder="请输入关键字物料名称"
v-model="easySearch.keys.value"
v-width="260"
/>
<Input placeholder="请输入关键字物料名称" v-model="easySearch.keys.value" v-width="260" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
......@@ -16,7 +12,7 @@
</Form>
</template>
<template slot="searchForm">
<Search :headid="hid"/>
<Search :headid="hid" />
</template>
<template slot="buttons">
<Button type="primary" @click="add" v-show="headerStatus==0||headerStatus==4">新增</Button>
......@@ -25,8 +21,9 @@
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :headid="hid" :productBomId="productBomId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
......@@ -46,25 +43,26 @@ export default {
action: Api.index,
easySearch: {
keys: {
op:
"nameMaterial",
op: "nameMaterial",
value: null
},
routingHeaderId: { op: "Equal", value: -1 }
routingHeaderId: {
op: "Equal",
value: -1
}
},
modal: false,
title: "新增",
detail: null,
curId: 0,
hid: 0,
columns: [
{
columns: [{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
high: true,
width: 100,
sortable:true
sortable: true
},
{
key: "routingDetailName",
......@@ -77,7 +75,7 @@ export default {
title: this.l("quantity"),
align: "right",
high: true,
width:80,
width: 80,
},
{
key: "materialType",
......@@ -86,7 +84,7 @@ export default {
easy: true,
high: true,
code: "mes_xingchi_resource.material.materialReType",
width:100,
width: 100,
},
{
key: "materialNumber",
......@@ -122,7 +120,7 @@ export default {
align: "left",
easy: true,
high: true,
hide:true,
hide: true,
},
{
key: "texture",
......@@ -157,30 +155,30 @@ export default {
title: this.l("creationTime"),
hide: true,
align: "left",
hide:true,
hide: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: true,
align: "left",
hide:true,
type:'user',
hide: true,
type: 'user',
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left",
hide:true,
hide: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
hide: true,
align: "left",
hide:true,
type:'user',
hide: true,
type: 'user',
},
{
title: "操作",
......@@ -188,38 +186,49 @@ export default {
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) }
"op", {
attrs: {
oprate: "detail"
},
on: {
click: () => this.view(params.row.id)
}
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) }
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row.id)
}
},
this.headerStatus == 4||this.headerStatus == 0 ? "编辑" : ""
this.headerStatus == 4 || this.headerStatus == 0 ? "编辑" : ""
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
"op", {
attrs: {
oprate: "delete"
},
on: {
click: () => this.remove(params.row.id)
}
},
this.headerStatus == 4||this.headerStatus == 0 ? "删除" : ""
this.headerStatus == 4 || this.headerStatus == 0 ? "删除" : ""
)
]);
}
}
],
headerStatus:-1,
productBomId:-1,
headerStatus: -1,
productBomId: -1,
};
},
created() {
......@@ -228,15 +237,18 @@ export default {
} else {
this.easySearch.routingHeaderId.value = this.$route.query.id;
}
this.hid=Number(this.easySearch.routingHeaderId.value)
this.headerStatus=this.$route.query.headerStatus
this.productBomId=Number(this.$route.query.productBomId)
this.hid = Number(this.easySearch.routingHeaderId.value)
this.headerStatus = this.$route.query.headerStatus
this.productBomId = Number(this.$route.query.productBomId)
},
mounted() {
console.log(this);
this.search();
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -293,5 +305,6 @@ export default {
}
};
</script>
<style lang="less">
</style>
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