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

产品

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