Commit 37a8c0f6 authored by 仇晓婷's avatar 仇晓婷

物料优化

parent 106c7aee
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div v-if="theme=='list'" class="flex fd userSelect"> <div v-if="theme=='list'" class="flex fd userSelect">
<div class="fg1 users"> <div class="fg1 users">
<dl v-for="(g,i) in group"> <dl v-for="(g,i) in group" :key="i">
<dt :class="{checked:g.opened}" class="flex fc-b"> <dt :class="{checked:g.opened}" class="flex fc-b">
<div class="ib fg"> <div class="ib fg">
<Checkbox v-model="g.checked" @on-change="checkAll(g,i)"> <Checkbox v-model="g.checked" @on-change="checkAll(g,i)">
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<dd <dd
v-show="g.opened" v-show="g.opened"
v-for="(li,j) in g.children" v-for="(li,j) in g.children"
:key="j"
@click="checkItem(i,j,li)" @click="checkItem(i,j,li)"
:class="{checked:li.checked}" :class="{checked:li.checked}"
>{{li.userName}}</dd> >{{li.userName}}</dd>
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
<Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed> <Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed>
<Filed :span="8" name="名称:">{{entity.name}}</Filed> <Filed :span="8" name="名称:">{{entity.name}}</Filed>
<Filed :span="8" name="状态:"> <Filed :span="8" name="状态:">
<State code="materail.category.status" :value="parseInt(entity.status)" /> <State code="materail.main.status" :value="parseInt(entity.status)" />
</Filed>
<Filed :span="8" name="版本:">
<State code="material.main.version" :value="parseInt(entity.version)" />
</Filed> </Filed>
<Filed :span="8" name="版本:">{{entity.version}}</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed> <Filed :span="8" name="描述:">{{entity.description}}</Filed>
</Row> </Row>
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
......
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
<Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed> <Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed>
<Filed :span="8" name="名称:">{{entity.name}}</Filed> <Filed :span="8" name="名称:">{{entity.name}}</Filed>
<Filed :span="8" name="状态:"> <Filed :span="8" name="状态:">
<State code="materail.category.status" :value="parseInt(entity.status)" /> <State code="material.main.status" :value="parseInt(entity.status)" />
</Filed>
<Filed :span="8" name="版本:">
<State code="material.main.version" :value="parseInt(entity.version)" />
</Filed> </Filed>
<Filed :span="8" name="版本:">{{entity.version}}</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed> <Filed :span="8" name="描述:">{{entity.description}}</Filed>
</Row> </Row>
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
......
...@@ -136,11 +136,11 @@ export default { ...@@ -136,11 +136,11 @@ export default {
align: "left", align: "left",
code: "material.main.version" code: "material.main.version"
}, },
{ // {
key: "description", // key: "description",
title: "描述", // title: "描述",
align: "left" // align: "left"
}, // },
{ {
key: "creationTime", key: "creationTime",
title: "创建时间", title: "创建时间",
...@@ -226,6 +226,8 @@ export default { ...@@ -226,6 +226,8 @@ export default {
return data; return data;
}, },
onSelect(a, b) { onSelect(a, b) {
// console.log(a);
// console.log(b);
//批量选择 //批量选择
this.rootCategoryId = a[0].rootCategoryId; this.rootCategoryId = a[0].rootCategoryId;
this.selectRows = a; this.selectRows = a;
...@@ -265,7 +267,7 @@ export default { ...@@ -265,7 +267,7 @@ export default {
}); });
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);
var col = { var col = {
key: u.field, key: u.field,
title: u.title title: u.title
...@@ -379,9 +381,10 @@ export default { ...@@ -379,9 +381,10 @@ export default {
} }
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" >
.spare-parts { .master-data {
width: 100%; .ivu-footer-toolbar-right {
height: 100%; margin-right: 72% !important;
}
} }
</style> </style>
\ No newline at end of file
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
<Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed> <Filed :span="8" name="编码:">{{!entity.code?'未分配':entity.code}}</Filed>
<Filed :span="8" name="名称:">{{entity.name}}</Filed> <Filed :span="8" name="名称:">{{entity.name}}</Filed>
<Filed :span="8" name="状态:"> <Filed :span="8" name="状态:">
<State code="materail.category.status" :value="parseInt(entity.status)" /> <State code="material.main.status" :value="parseInt(entity.status)" />
</Filed>
<Filed :span="8" name="版本:">
<State code="material.main.version" :value="parseInt(entity.version)" />
</Filed> </Filed>
<Filed :span="8" name="版本:">{{entity.version}}</Filed>
<Filed :span="8" name="描述:">{{entity.description}}</Filed> <Filed :span="8" name="描述:">{{entity.description}}</Filed>
</Row> </Row>
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
...@@ -28,14 +30,26 @@ ...@@ -28,14 +30,26 @@
</Filed> </Filed>
</Row> </Row>
</div> </div>
<Table <DataGrid
v-if="osrOneList2"
:columns="cols"
ref="grid"
:conditions="easySearch"
:action="action"
:initsearch="sets"
:tool="false"
:page="false"
:height="300"
:format="formatFun"
/>
<!-- <Table
:loading="loading" :loading="loading"
border border
:columns="cols" :columns="cols"
:data="dataList" :data="dataList"
class="tableCommon" class="tableCommon"
v-if="osrOneList2" v-if="osrOneList2"
></Table> ></Table>-->
<Process ref="userProcess" schemaIdVal="b6303ddc-8b5e-40a3-a51b-294657d1d913" /> <Process ref="userProcess" schemaIdVal="b6303ddc-8b5e-40a3-a51b-294657d1d913" />
<div slot="footer"> <div slot="footer">
<Button @click="modalInfo">取消</Button> <Button @click="modalInfo">取消</Button>
...@@ -68,12 +82,13 @@ export default { ...@@ -68,12 +82,13 @@ export default {
components: { components: {
Process Process
}, },
props: ["eid", "rootCategoryId", "rowsTable"], props: ["eid", "rootCategoryId", "nodeInfo", "rowsTable"],
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
data() { data() {
return { return {
action: Api.index,
rowId: "", rowId: "",
entity: {}, entity: {},
metCodesStrTxt: "", metCodesStrTxt: "",
...@@ -83,6 +98,17 @@ export default { ...@@ -83,6 +98,17 @@ export default {
divHeight: "300px", divHeight: "300px",
osrOneList1: false, //一条数据显示 osrOneList1: false, //一条数据显示
osrOneList2: false, osrOneList2: false,
sets: v => {
v.categoryId = this.nodeInfo.categoryId;
v.rootCategoryId = this.nodeInfo.rootCategoryId;
},
easySearch: {
keys: { op: "code,name", value: null },
categoryId: {
op: "In",
value: this.nodeInfo.ids
}
},
info: true, info: true,
ruleValidate: {}, ruleValidate: {},
orderSearchForm: { orderSearchForm: {
...@@ -138,13 +164,22 @@ export default { ...@@ -138,13 +164,22 @@ export default {
{ {
key: "version", key: "version",
title: "版本", title: "版本",
align: "left" align: "left",
}, render: (h, params) => {
{ return h("state", {
key: "description", props: {
title: "描述", code: "material.main.version",
align: "left" type: "text",
value: params.row.status + ""
} }
});
}
}
// {
// key: "description",
// title: "描述",
// align: "left"
// }
] ]
}; };
}, },
...@@ -159,7 +194,6 @@ export default { ...@@ -159,7 +194,6 @@ export default {
this.osrOneList1 = false; this.osrOneList1 = false;
this.osrOneList2 = true; this.osrOneList2 = true;
this.getTable(); this.getTable();
this.dataList = this.rowsTable;
} }
}, },
mounted() { mounted() {
...@@ -172,6 +206,11 @@ export default { ...@@ -172,6 +206,11 @@ export default {
}; };
}, },
methods: { methods: {
//格式化原始数据
formatFun(data) {
data = this.rowsTable;
return data;
},
getDetails(v) { getDetails(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
if (r.result) { if (r.result) {
...@@ -239,6 +278,19 @@ export default { ...@@ -239,6 +278,19 @@ export default {
if (u.dataType == 3) { if (u.dataType == 3) {
col.code = u.note; col.code = u.note;
} }
if (u.dataType == 4) {
col.type = "date";
}
if (u.unitName && (u.dataType == 1 || u.dataType == 2)) {
var units = this.$store.getters.dictionaryByKey(
"material.main.unitName"
);
let item = units.filter(p => {
return p.code == u.unitName;
});
// console.log(units, item);
col.title += "(" + item[0].name + ")";
}
return col; return col;
}); });
this.cols = this.cols.concat(extra); this.cols = this.cols.concat(extra);
...@@ -302,6 +354,13 @@ export default { ...@@ -302,6 +354,13 @@ export default {
modalInfo() { modalInfo() {
this.$emit("on-close"); this.$emit("on-close");
} }
},
watch: {
rootCategoryId(v) {
if (v) {
this.easySearch.categoryId.value = "-1";
}
}
} }
}; };
</script> </script>
......
...@@ -41,6 +41,7 @@ export default { ...@@ -41,6 +41,7 @@ export default {
this.showMenu = true; this.showMenu = true;
}, },
productSearch(id, item, ids) { productSearch(id, item, ids) {
console.log(item)
this.parent.parentName = item.title; this.parent.parentName = item.title;
this.parent.id = id; this.parent.id = id;
this.parent.ids = ids; this.parent.ids = ids;
......
<template>
<div class="bom">
<Layout>
<Sider width="300">
<div class="p-list">ddd</div>
</Sider>
<Content>ff</Content>
</Layout>
</div>
</template>
<style lang="less">
.bom {
.ivu-layout-sider {
background: rgba(255, 255, 255, 1);
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 90vh;
padding: 10px;
overflow: auto;
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
padding: 10px;
height: 90vh;
overflow: auto;
}
}
</style>
\ No newline at end of file
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<Col :span="12">名称:{{row.name}}</Col> <Col :span="12">名称:{{row.name}}</Col>
<Col :span="12" class="btn-click">物料编号:{{row.mmcode}}</Col> <Col :span="12" class="btn-click">物料编号:{{row.mmcode}}</Col>
</Row> </Row>
<Row class="row-down"> <Row class="row-down" :gutter="20">
<Col span="7"> <Col span="7">
<div class="img-i"> <div class="img-i">
<img :src="downUrl +row.productUrl" /> <img :src="downUrl +row.productUrl" />
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
<div>图号:{{row.drawingNo}}</div> <div>图号:{{row.drawingNo}}</div>
<div>主制单位:{{row.madeCompanyTitle}}</div> <div>主制单位:{{row.madeCompanyTitle}}</div>
<p class="a-icon"> <p class="a-icon">
<a @click="bom(row.id)">
<Icon type="ios-brush" />BOM
</a>&nbsp;
<a @click="edit(row.id)"> <a @click="edit(row.id)">
<Icon type="md-create" />编辑 <Icon type="md-create" />编辑
</a>&nbsp; </a>&nbsp;
...@@ -57,7 +60,7 @@ ...@@ -57,7 +60,7 @@
</div> </div>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide :fullscreen="fullscreen">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :parents="parent" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :parents="parent" />
</Modal> </Modal>
</div> </div>
...@@ -85,6 +88,7 @@ export default { ...@@ -85,6 +88,7 @@ export default {
data() { data() {
return { return {
action: Api.index, action: Api.index,
fullscreen: false,
easySearch: { easySearch: {
keys: { op: "mmcode,name,productCode", value: null } keys: { op: "mmcode,name,productCode", value: null }
}, },
...@@ -121,28 +125,43 @@ export default { ...@@ -121,28 +125,43 @@ export default {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
add() { add() {
if (this.parent.id) {
this.curId = 0; this.curId = 0;
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
this.fullscreen = false;
} else {
this.$Message.error("请先选择产品分类");
}
}, },
copy(id) { copy(id) {
this.curId = id; this.curId = id;
this.title = "克隆"; this.title = "克隆";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
this.fullscreen = false;
}, },
view(id) { view(id) {
this.curId = id; this.curId = id;
this.title = "详情"; this.title = "详情";
this.detail = () => import("./detail"); this.detail = () => import("./detail");
this.modal = true; this.modal = true;
this.fullscreen = false;
}, },
edit(id) { edit(id) {
this.curId = id; this.curId = id;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import("./edit"); this.detail = () => import("./edit");
this.modal = true; this.modal = true;
this.fullscreen = false;
},
bom(id) {
this.curId = id;
this.title = "BOM";
this.detail = () => import("./bom");
this.modal = true;
this.fullscreen = true;
}, },
remove(row) { remove(row) {
this.$Modal.confirm({ this.$Modal.confirm({
......
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