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

产品bom优化

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