Commit f5c6af41 authored by renjintao's avatar renjintao

物料管理

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