Commit 875464ee authored by renjintao's avatar renjintao

materialIndex

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