Commit ea156ea0 authored by 仇晓婷's avatar 仇晓婷

产品bom优化

parent 48a82e92
......@@ -58,20 +58,20 @@ export default {
levelId: 0,
levelTitle: "",
bomId: 0,
version: ""
version: "",
},
parms: {
app: "technology",
eid: "",
name: "",
field: ""
field: "",
},
treeData: [],
columns: [
{
key: "name",
align: "left",
high: true
high: true,
},
{
key: "type",
......@@ -84,13 +84,13 @@ export default {
return h("op", {
props: {
icon: params.row.type == 1 ? "md-git-merge" : "",
type: "icon"
type: "icon",
},
on: {
click: () => this.bom(params.row)
}
click: () => this.bom(params.row),
},
});
}
},
},
{
key: "mmcode",
......@@ -102,34 +102,34 @@ export default {
{
props: {},
on: {
click: () => this.details(params.row)
}
click: () => this.details(params.row),
},
},
params.row.mmcode
);
}
},
},
{
key: "drawingNo",
title: this.l("drawingNo"),
high: true
high: true,
},
{
key: "count",
title: this.l("count"),
high: true
high: true,
},
{
key: "postion",
title: this.l("postion"),
high: true
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
easy: true,
high: true
high: true,
},
{
......@@ -143,7 +143,7 @@ export default {
"op",
{
attrs: { oprate: "add" },
on: { click: () => this.add(params.row) }
on: { click: () => this.add(params.row) },
},
params.row.type == 1 ? "" : "新增"
),
......@@ -151,7 +151,7 @@ export default {
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) }
on: { click: () => this.edit(params.row) },
},
"编辑"
),
......@@ -159,15 +159,15 @@ export default {
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row) }
on: { click: () => this.remove(params.row) },
},
"删除"
)
),
];
return h("div", { class: "action" }, actions);
}
}
]
},
},
],
};
},
async fetch({ store, params }) {
......@@ -179,8 +179,8 @@ export default {
id: Number,
parentName: String,
ids: String,
bomId: Number
}
bomId: Number,
},
},
mounted() {
if (this.eid > 0) {
......@@ -198,7 +198,7 @@ export default {
this.modal = true;
},
init() {
Api.alltree({ id: this.bomId, levelId: this.parents.id }).then(r => {
Api.alltree({ id: this.bomId, levelId: this.parents.id }).then((r) => {
this.treeData = r.result;
});
},
......@@ -210,6 +210,7 @@ export default {
this.parents.rootProductId = row.rootProductId;
this.title = "新增";
this.detail = () => import("./bomAdd");
this.fullscreen = false;
this.modal = true;
},
addBom() {
......@@ -221,6 +222,7 @@ export default {
this.parents.rootProductId = this.entity.rootProductId;
this.title = "新增";
this.detail = () => import("./bomAdd");
this.fullscreen = false;
this.modal = true;
},
edit(row) {
......@@ -230,6 +232,7 @@ export default {
this.parents.rootProductId = row.rootProductId;
this.title = "编辑";
this.detail = () => import("./bomEdit");
this.fullscreen = false;
this.modal = true;
},
bom(row) {
......@@ -238,10 +241,11 @@ export default {
this.parents.bomId = row.bomId;
this.title = "bom";
this.detail = () => import("./bomDetail");
this.fullscreen = false;
this.modal = true;
},
remove(row) {
Api.deleteBom(row.bomId, row.levelId, row.rootProductId).then(r => {
Api.deleteBom(row.bomId, row.levelId, row.rootProductId).then((r) => {
if (r.success) {
this.init();
this.$Message.success("删除成功");
......@@ -249,7 +253,7 @@ export default {
});
},
load(v) {
Api.get({ id: v, levelId: this.parents.id }).then(r => {
Api.get({ id: v, levelId: this.parents.id }).then((r) => {
this.entity = r.result;
this.entity.version = parseInt(r.result.version);
this.parms.eid = r.result.productUrlList;
......@@ -282,15 +286,15 @@ export default {
l(key) {
key = "product_info" + "." + key;
return this.$t(key);
}
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
},
},
};
</script>
<style lang="less">
......
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