Commit 2c993c5f authored by 仇晓婷's avatar 仇晓婷

产品

parent 0ce9adff
......@@ -1434,6 +1434,8 @@ export default {
drawingNo:'图号',
name:'名称',
productCode:'产品编号',
levelTitle:'产品分类',
madeCompanyTitle:'主承制单位',
status:'',
remark:'备注',
madeCompany:'主承制单位',
......
......@@ -41,7 +41,7 @@ export default {
this.showMenu = true;
},
productSearch(id, item, ids) {
console.log(item)
console.log(item);
this.parent.parentName = item.title;
this.parent.id = id;
this.parent.ids = ids;
......@@ -64,6 +64,7 @@ export default {
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
height: 87vh;
overflow: auto;
h4 {
height: 30px;
......@@ -103,7 +104,6 @@ export default {
overflow: auto;
padding: 10px;
height: 87vh;
overflow-y: hidden;
}
}
</style>
\ No newline at end of file
......@@ -5,7 +5,7 @@
ref="grid"
:action="action"
:conditions="easySearch"
type="card"
:type="typeInfo"
:high="false"
:span="6"
:lazy="true"
......@@ -24,7 +24,10 @@
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
<Button type="primary" @click="add">新增</Button>&nbsp;
</template>
<template slot="buttons">
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
</template>
<template slot="card" slot-scope="{row}">
<div class="body-card">
......@@ -49,7 +52,7 @@
<a @click="edit(row.id)">
<Icon type="md-create" />编辑
</a>&nbsp;
<a @click="remove(row)">
<a @click="remove(row.id)">
<Icon type="ios-trash" />删除
</a>&nbsp;
<a @click="view(row.id)">
......@@ -107,8 +110,116 @@ export default {
hide: true,
align: "left",
high: true
},
{
title: this.l("name"),
key: "name",
align: "left"
},
{
key: "mmcode",
title: this.l("mmcode"),
align: "center",
high: true
},
{
key: "productUrl",
title: this.l("productUrl"),
align: "left",
high: true,
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"a",
{
attrs: {
oprate: "detail"
// href: this.fileUrlPath,
// target: "_blank"
},
on: {
click: () => {
this.downFile(params.row.productUrl);
}
}
},
"查看图片"
)
]);
}
},
{
key: "levelTitle",
title: this.l("levelTitle"),
align: "left",
high: true
},
{
key: "drawingNo",
title: this.l("drawingNo"),
align: "right",
high: true
},
{
key: "madeCompanyTitle",
title: this.l("madeCompanyTitle"),
align: "center",
width: 260,
high: true
},
{
title: "操作",
key: "action",
width: 200,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "edit" },
on: {
click: () => this.bom(params.row.id)
}
},
"BOM"
),
h(
"op",
{
attrs: { oprate: "edit" },
on: {
click: () => this.edit(params.row.id)
}
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) }
},
"删除"
),
h(
"op",
{
attrs: { oprate: "view" },
on: {
click: () => this.view(params.row.id)
}
},
"详情"
)
]);
}
}
]
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式"
};
},
mounted() {
......@@ -119,6 +230,26 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
changeShwo() {
//显示模式切换
if (this.typeInfo == "card") {
this.typeInfo = "table";
this.iconInfo = "md-list";
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
},
downFile(url) {
let url1 = this.downUrl + url;
if (url) {
window.open(url1, "_blank");
} else {
this.$Message.error("暂无图片");
}
},
ok() {
this.$refs.grid.load();
this.modal = false;
......@@ -166,20 +297,11 @@ export default {
this.modal = true;
this.fullscreen = true;
},
remove(row) {
this.$Modal.confirm({
title: "删除",
content: "<p>您确定要删除此产品吗?</p>",
onOk: () => {
Api.delete(row.id).then(r => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
onCancel: () => {
this.$Message.success("取消删除");
remove(id) {
Api.delete(id).then(r => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
......
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