Commit 7e87c011 authored by 仇晓婷's avatar 仇晓婷

产品

parent c36ec4b3
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
version: "", version: "",
productUrl: "", productUrl: "",
productUrlList: "", productUrlList: "",
levelId: null, levelId: this.parents.id,
levelTitle: "" levelTitle: ""
}, },
dataList: [], dataList: [],
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
created() { created() {
this.treeCompany(); this.treeCompany();
this.parms.eid = this.$u.guid(); this.parms.eid = this.$u.guid();
this.entity.levelId = this.parents.id; // this.entity.levelId = this.parents.id;
}, },
methods: { methods: {
treeCompany() { treeCompany() {
......
...@@ -13,14 +13,14 @@ export default { ...@@ -13,14 +13,14 @@ export default {
update(params){ update(params){
return Api.post(`${technologyUrl}productinfo/update`,params); return Api.post(`${technologyUrl}productinfo/update`,params);
}, },
delete(id) { delete(id,levelId) {
return Api.delete(`${technologyUrl}productinfo/delete`,{params:{id:id}}); return Api.delete(`${technologyUrl}productinfo/delete`,{params:{id:id,levelId:levelId}});
}, },
// deletes(params) { // deletes(params) {
// return Api.post(`${technologyUrl}productinfo/batchdelete`,params); // return Api.post(`${technologyUrl}productinfo/batchdelete`,params);
// }, // },
deleteBom(id) { deleteBom(id,levelId) {
return Api.delete(`${technologyUrl}productbom/delete`,{params:{id:id}}); return Api.delete(`${technologyUrl}productinfo/deletebom`,{params:{id:id,levelId:levelId}});
}, },
materiallist(params){ materiallist(params){
return Api.post(`${systemUrl}/material/materiallist`,params);//物料 return Api.post(`${systemUrl}/material/materiallist`,params);//物料
......
<template> <template>
<div class="bom"> <div class="bom">
<!-- <div class="btn"> <div class="btn">
<Button type="primary" @click="add()" class="mb10">新增Bom</Button> <Button type="primary" @click="addBom" class="mb10">新增Bom</Button>
</div>--> </div>
<div class="new-detail"> <div class="new-detail">
<Row> <Row>
<Filed :span="8" :name="l('levelId')+':'">{{entity.levelTitle}}</Filed> <Filed :span="8" :name="l('levelId')+':'">{{entity.levelTitle}}</Filed>
...@@ -42,7 +42,11 @@ export default { ...@@ -42,7 +42,11 @@ export default {
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
entity: {}, entity: {
id: "",
levelId: 0,
levelTitle: ""
},
parms: { parms: {
app: "technology", app: "technology",
eid: "", eid: "",
...@@ -107,7 +111,7 @@ export default { ...@@ -107,7 +111,7 @@ export default {
"op", "op",
{ {
attrs: { oprate: "edit" }, attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) } on: { click: () => this.edit(params.row) }
}, },
"编辑" "编辑"
), ),
...@@ -126,7 +130,7 @@ export default { ...@@ -126,7 +130,7 @@ export default {
] ]
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
props: { props: {
...@@ -157,14 +161,25 @@ export default { ...@@ -157,14 +161,25 @@ export default {
this.detail = () => import("./bomAdd"); this.detail = () => import("./bomAdd");
this.modal = true; this.modal = true;
}, },
edit(id) { addBom() {
this.curId = id; console.log(this.entity);
this.curId = this.entity.id;
this.parents.id = this.entity.levelId;
this.parents.parentName = this.entity.levelTitle;
this.title = "新增";
this.detail = () => import("./bomAdd");
this.modal = true;
},
edit(row) {
this.curId = row.id;
this.parents.id = row.levelId;
this.parents.parentName = row.levelTitle;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import("./bomEdit"); this.detail = () => import("./bomEdit");
this.modal = true; this.modal = true;
}, },
remove(row) { remove(row) {
Api.deleteBom({ id: row.id, levelId: row.levelId }).then(r => { Api.deleteBom(row.id, row.levelId).then(r => {
if (r.success) { if (r.success) {
this.init(); this.init();
this.$Message.success("删除成功"); this.$Message.success("删除成功");
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() { created() {
this.getTree(); // this.getTree();
}, },
methods: { methods: {
getTree() { getTree() {
......
...@@ -65,7 +65,12 @@ export default { ...@@ -65,7 +65,12 @@ export default {
}; };
}, },
props: { props: {
eid: Number eid: Number,
parents: {
id: Number,
parentName: String,
ids: String
}
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
...@@ -77,11 +82,10 @@ export default { ...@@ -77,11 +82,10 @@ export default {
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v, levelId: this.parents.id }).then(r => {
this.entity = r.result; this.entity = r.result;
}); });
}, },
change(e) { change(e) {
// console.log(e); // console.log(e);
this.entity.name = e.name; this.entity.name = e.name;
......
...@@ -311,7 +311,7 @@ export default { ...@@ -311,7 +311,7 @@ export default {
this.fullscreen = true; this.fullscreen = true;
}, },
remove(row) { remove(row) {
Api.delete({ id: row.id, levelId: row.levelId }).then(r => { Api.delete(row.id, row.levelId).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.$Message.success("删除成功"); 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