Commit f5c6af41 authored by renjintao's avatar renjintao

物料管理

parent 8018f5c3
This diff is collapsed.
<template>
<div class="master-data">
<div class="master-data">
<!-- <Table border :columns="columns" :data="dataColumns" :height="tableHeight"></Table> -->
<DataGrid
:columns="columns"
ref="grid"
:conditions="easySearch"
:action="action"
:high="false"
:height="tableHeight"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入编码/名称" v-width="200" v-model="easySearch.keys.value" clearable />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<DataGrid :columns="columns" ref="grid" :conditions="easySearch" :action="action" :high="false" :height="tableHeight">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入编码/名称" v-width="200" v-model="easySearch.keys.value" clearable />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
</DataGrid>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "masterData",
props: ["root"],
data() {
return {
action: Api.index,
tableHeight: "",
dataColumns: [],
easySearch: {
keys: { op: "code,name", value: null },
id: { op: "In", value: "" }
},
columns: [
// {
// key: "index",
// title: "#",
// align: "left",
// width: 60
// },
{
key: "code",
title: "编码",
align: "left"
},
{
key: "name",
title: "名称",
align: "left"
},
{
key: "status",
title: "状态",
align: "left",
code: "materail.category.status"
},
{
key: "description",
title: "描述",
align: "left"
},
{
title: "操作",
key: "action",
width: 260,
align: "left",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
name: "masterData",
props: ["root"],
data() {
return {
action: Api.index,
tableHeight: "",
dataColumns: [],
easySearch: {
keys: {
op: "code,name",
value: null
},
id: {
op: "In",
value: ""
}
},
columns: [
// {
// key: "index",
// title: "#",
// align: "left",
// width: 60
// },
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }
key: "code",
title: "编码",
align: "left"
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
key: "name",
title: "名称",
align: "left"
},
"删除"
)
]);
}
}
]
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.tableHeight = window.innerHeight - 220;
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
{
key: "status",
title: "状态",
align: "left",
code: "materail.category.status"
},
{
key: "description",
title: "描述",
align: "left"
},
{
title: "操作",
key: "action",
width: 260,
align: "left",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row)
}
},
"编辑"
),
h(
"op", {
attrs: {
oprate: "delete"
},
on: {
click: () => this.remove(params.row.id)
}
},
"删除"
)
]);
}
}
]
};
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
this.tableHeight = window.innerHeight - 220;
})();
};
},
methods: {
search() {
// alert(JSON.stringify(this.easySearch));
console.log(this.easySearch);
this.$refs.grid.reload(this.easySearch);
},
edit(row) {
this.$emit("on-edit", row);
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight;
this.tableHeight = window.innerHeight - 220;
})();
};
},
remove(id) {
Api.delete(id).then(r => {
if (r.success) {
this.$refs.grid.reload(this.easySearch);
this.$Message.success("删除成功");
methods: {
search() {
// alert(JSON.stringify(this.easySearch));
console.log(this.easySearch);
this.$refs.grid.reload(this.easySearch);
},
edit(row) {
this.$emit("on-edit", row);
},
remove(id) {
Api.delete(id).then(r => {
if (r.success) {
this.$refs.grid.reload(this.easySearch);
this.$Message.success("删除成功");
}
});
}
});
}
},
watch: {
root: {
handler(newName, oldName) {
if (newName.id) {
this.easySearch.id.value = newName.ids;
this.$refs.grid.reload(this.easySearch);
} else {
this.easySearch.id.value = "-1";
},
watch: {
root: {
handler(newName, oldName) {
if (newName.id) {
this.easySearch.id.value = newName.ids;
this.$refs.grid.reload(this.easySearch);
} else {
this.easySearch.id.value = "-1";
}
},
immediate: true,
deep: true
}
},
immediate: true,
deep: true
}
}
};
</script>
<style lang="less" scoped>
.spare-parts {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file
</style>
This diff is collapsed.
This diff is collapsed.
......@@ -27,7 +27,7 @@ window.apsUrl = `http://${systemApi.aps}:10111/api/services/app`;//aps排产(61)
window.technologyUrl =`http://${address}:10000/technology/`;//新工艺规程接口
window.iconImg = `/imgicon/`;
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.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