Commit 875464ee authored by renjintao's avatar renjintao

materialIndex

parent ae0ef794
...@@ -177,6 +177,7 @@ export default { ...@@ -177,6 +177,7 @@ export default {
}, },
watch: { watch: {
eid(v) { eid(v) {
alert(v)
if (v != 0) { if (v != 0) {
this.load(v); this.load(v);
} }
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<Button type="primary" @click="add">入库</Button> <Button type="primary" @click="add">入库</Button>
</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="fscreeen">
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :storeId="storeId" :mcode="mCode" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
</Content> </Content>
</Layout> </Layout>
...@@ -53,10 +53,13 @@ export default { ...@@ -53,10 +53,13 @@ export default {
easySearch: { easySearch: {
keys: { op: "name,storeTitle", value: null } keys: { op: "name,storeTitle", value: null }
}, },
fscreeen: false,
modal: false, modal: false,
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
storeId:null,
mCode: "",
columns: [ columns: [
{ {
key: "name", key: "name",
...@@ -71,10 +74,9 @@ export default { ...@@ -71,10 +74,9 @@ export default {
align: "right", align: "right",
high: true, high: true,
render: (h, params) => { render: (h, params) => {
let minNum=0 let minNum = 0;
if(params.row.minNum) if (params.row.minNum) {
{ minNum = params.row.minNum;
minNum=params.row.minNum
} }
return h( return h(
"Tooltip", "Tooltip",
...@@ -84,7 +86,7 @@ export default { ...@@ -84,7 +86,7 @@ export default {
placement: "top", placement: "top",
disabled: params.row.total > minNum ? true : false disabled: params.row.total > minNum ? true : false
}, },
class:params.row.total > minNum ? "" : "red" class: params.row.total > minNum ? "" : "red"
}, },
params.row.total params.row.total
); );
...@@ -128,7 +130,7 @@ export default { ...@@ -128,7 +130,7 @@ export default {
"op", "op",
{ {
attrs: { oprate: "detail" }, attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) } on: { click: () => this.view(params.row) }
}, },
"查看" "查看"
) )
...@@ -181,6 +183,7 @@ export default { ...@@ -181,6 +183,7 @@ export default {
ok() { ok() {
this.$refs.grid.load(); this.$refs.grid.load();
this.modal = false; this.modal = false;
this.fscreeen = false;
this.curId = 0; this.curId = 0;
}, },
search() { search() {
...@@ -190,6 +193,7 @@ export default { ...@@ -190,6 +193,7 @@ export default {
this.curId = 0; this.curId = 0;
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.fscreeen = false;
this.modal = true; this.modal = true;
}, },
copy(id) { copy(id) {
...@@ -198,10 +202,13 @@ export default { ...@@ -198,10 +202,13 @@ export default {
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
}, },
view(id) { view(row) {
this.curId = id; this.curId = row.id;
this.storeId=row.storeId;
this.mCode = row.materialCode;
this.title = "详情"; this.title = "详情";
this.detail = () => import("./itemIndex"); this.detail = () => import("./itemIndex");
this.fscreeen = true;
this.modal = true; this.modal = true;
}, },
edit(id) { edit(id) {
...@@ -238,6 +245,7 @@ export default { ...@@ -238,6 +245,7 @@ export default {
this.curId = row.id; this.curId = row.id;
this.title = "设置最低库存"; this.title = "设置最低库存";
this.detail = () => import("./setNum"); this.detail = () => import("./setNum");
this.fscreeen = false;
this.modal = true; this.modal = true;
}, },
l(key) { l(key) {
......
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"> <span class="mr20">物料名称:{{materialName}}</span><span class="mr20">物料编号:{{mcode}}</span><span class="mr20">库位:{{storeTitle}}</span>
<template slot="easySearch"> <DataGrid
<Form ref="formInline" :model="easySearch" inline> :columns="columns"
<FormItem prop="keys"> ref="grid"
<Input placeholder="请输入关键字名称//入库编号/" v-model="easySearch.keys.value" /> :action="action"
</FormItem> :conditions="easySearch"
<FormItem> :tool="false"
<Button type="primary" @click="search">查询</Button> :height="treeHeight"
</FormItem> ></DataGrid>
</Form>
</template>
</DataGrid>
</div> </div>
</template> </template>
<script> <script>
...@@ -25,33 +22,31 @@ export default { ...@@ -25,33 +22,31 @@ export default {
}, },
data() { data() {
return { return {
action: Api.index, action: Api.indexStockitem,
easySearch: { easySearch: {
keys: { op: "name,storeTitle,code,materialCode", value: null } materialCode: { op: "Equal", value: this.mcode },
storeId: { op: "In", value: this.storeId }
}, },
data: [],
treeHeight: 300,
curId: 0, curId: 0,
columns: [ columns: [
{ {
key: "name", key: "code",
title: this.l("name"), title: this.l("code"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ key: "total", title: this.l("total"), align: "right", high: true },
{ {
key: "originalManufacturer", key: "nowTotal",
title: this.l("originalManufacturer"), title: this.l("nowTotal"),
align: "left", align: "right",
high: true high: true
}, },
{ key: "batch", title: this.l("batch"), align: "left", high: true }, { key: "batch", title: this.l("batch"), align: "left", high: true },
{
key: "unitPrice",
title: this.l("unitPrice"),
align: "left",
high: true
},
{ {
key: "certificateOfApproval", key: "certificateOfApproval",
title: this.l("certificateOfApproval"), title: this.l("certificateOfApproval"),
...@@ -59,31 +54,18 @@ export default { ...@@ -59,31 +54,18 @@ export default {
high: true high: true
}, },
{ {
key: "storeTitle", key: "unitPrice",
title: this.l("storeTitle"), title: this.l("unitPrice"),
align: "left", align: "right",
easy: true,
high: true
},
{ key: "total", title: this.l("total"), align: "left", high: true },
{ key: "nowTotal", title: this.l("nowTotal"), align: "left", high: true },
{ key: "remark", title: this.l("remark"), align: "left", high: true },
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true high: true
}, },
{ {
key: "materialCode", key: "originalManufacturer",
title: this.l("materialCode"), title: this.l("originalManufacturer"),
align: "left", align: "left",
easy: true,
high: true high: true
}, },
{ key: "remark", title: this.l("remark"), align: "left", high: true },
{ {
key: "creationTime", key: "creationTime",
title: this.l("creationTime"), title: this.l("creationTime"),
...@@ -96,16 +78,39 @@ export default { ...@@ -96,16 +78,39 @@ export default {
align: "left", align: "left",
high: true high: true
} }
] ],
materialName:'',
storeTitle:'',
}; };
}, },
props: {
eid: Number,
storeId:Number,
mcode: String
},
created() {
this.treeHeight = window.innerHeight - 150;
},
mounted() { mounted() {
console.log(this); this.load();
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.treeHeight = window.screenHeight - 150;
})();
};
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
load() {
Api.get({ id: this.eid }).then(r => {
this.materialName=r.result.name
this.storeTitle=r.result.storeTitle
});
},
ok() { ok() {
this.$refs.grid.load(); this.$refs.grid.load();
this.modal = false; this.modal = false;
...@@ -123,6 +128,13 @@ export default { ...@@ -123,6 +128,13 @@ export default {
let vkey = "stock_item" + "." + key; let vkey = "stock_item" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
} }
},
watch: {
eid(v) {
if (v != 0) {
// this.load(v);
}
}
} }
}; };
</script> </script>
......
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