Commit 4628245e authored by 仇晓婷's avatar 仇晓婷

bom

parent 8d9738b9
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
style['text-align'] = column.align style['text-align'] = column.align
} }
if (column.width) { if (column.width) {
style['min-width'] = `${column.width}px` style['width'] = `${column.width}px`
} }
return style return style
}, },
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
data() { data() {
return { return {
data1: [], data1: [],
action: Api.lists,
isactive: 0, isactive: 0,
showFrom: true, showFrom: true,
showTable: false, showTable: false,
...@@ -90,12 +90,15 @@ export default { ...@@ -90,12 +90,15 @@ export default {
}, },
{ {
key: "creationTime", key: "creationTime",
title: "名称", title: "时间",
align: "left" align: "left"
} }
] ]
}; };
}, },
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() { mounted() {
this.load(this.eid); this.load(this.eid);
this.initFiled(); this.initFiled();
...@@ -105,11 +108,12 @@ export default { ...@@ -105,11 +108,12 @@ export default {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
if (r.result) { if (r.result) {
this.entity = r.result; this.entity = r.result;
let rootCategoryId = r.result.rootCategoryId;
let conditions = [ let conditions = [
{ {
conditionalType: "Equal", conditionalType: "Equal",
fieldName: "categoryId", fieldName: "categoryId",
fieldValue: this.rootCategoryId fieldValue: rootCategoryId
} }
]; ];
...@@ -165,7 +169,6 @@ export default { ...@@ -165,7 +169,6 @@ export default {
Api.categoryList({ conditions: conditions }).then(r => { Api.categoryList({ conditions: conditions }).then(r => {
this.data1 = r.result; this.data1 = r.result;
}); });
// this.$refs.grid.reload(this.easySearch);
} }
}, },
l(key) { l(key) {
......
...@@ -88,7 +88,8 @@ export default { ...@@ -88,7 +88,8 @@ export default {
code: 0, code: 0,
categoryId: this.nodeInfo.categoryId, //左侧树点击的id categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {}, customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId //左侧树点击的数据的最顶层id rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id
version: null
}, },
fileds: [], fileds: [],
checkList: [], checkList: [],
...@@ -145,6 +146,7 @@ export default { ...@@ -145,6 +146,7 @@ export default {
Api.get({ id: this.eid }).then(r => { Api.get({ id: this.eid }).then(r => {
if (r.result) { if (r.result) {
this.entity = r.result; this.entity = r.result;
this.entity.version = parseInt(r.result.version);
} }
}); });
}, },
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<FormItem :label="l('type')" prop="type"> <FormItem :label="l('type')" prop="type">
<!-- <Input v-model="entity.type"></Input> --> <!-- <Input v-model="entity.type"></Input> -->
<Dictionary <Dictionary
disabled
code="material.main.type" code="material.main.type"
v-model="entity.type" v-model="entity.type"
type="select" type="select"
...@@ -96,7 +97,7 @@ export default { ...@@ -96,7 +97,7 @@ export default {
mmcode: "", //物料编号 mmcode: "", //物料编号
drawingNo: "", drawingNo: "",
name: "", name: "",
type: "", //物料类型 type: 1, //物料类型
// productCode: "", //产品编号 // productCode: "", //产品编号
// status: null, // status: null,
// remark: "", // remark: "",
......
...@@ -20,6 +20,9 @@ export default { ...@@ -20,6 +20,9 @@ export default {
// return Api.post(`${technologyUrl}productinfo/batchdelete`,params); // return Api.post(`${technologyUrl}productinfo/batchdelete`,params);
// }, // },
list(params){
return Api.post(`${technologyUrl}productinfo/list`,params);
},
getbom(params){ getbom(params){
return Api.get(`${technologyUrl}productinfo/getbom`,params); return Api.get(`${technologyUrl}productinfo/getbom`,params);
}, },
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
<Filed :span="8" :name="l('mmcode')+':'">{{entity.mmcode}}</Filed> <Filed :span="8" :name="l('mmcode')+':'">{{entity.mmcode}}</Filed>
<Filed :span="8" :name="l('drawingNo')+':'">{{entity.drawingNo}}</Filed> <Filed :span="8" :name="l('drawingNo')+':'">{{entity.drawingNo}}</Filed>
<Filed :span="8" :name="l('name')+':'">{{entity.name}}</Filed> <Filed :span="8" :name="l('name')+':'">{{entity.name}}</Filed>
<Filed :span="8" :name="l('madeCompany')+':'">{{entity.madeCompanyTitle}}</Filed> <Filed :span="8" :name="l('version')+':'">
<State code="material.main.version" :value="parseInt(entity.version)" />
</Filed>
<!-- <Filed :span="8" :name="l('madeCompany')+':'">{{entity.madeCompanyTitle}}</Filed> -->
<Filed :span="8" :name="l('productUrl')+':'"> <Filed :span="8" :name="l('productUrl')+':'">
<a href="#" @click="seeImg(entity.productUrl)">查看图片</a> <a href="#" @click="seeImg(entity.productUrl)">查看图片</a>
</Filed> </Filed>
...@@ -26,7 +29,14 @@ ...@@ -26,7 +29,14 @@
</Row> </Row>
</div> </div>
<TreeGrid :columns="columns" :items="treeData"></TreeGrid> <TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide :mask-closable="false"> <Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
:fullscreen="fullscreen"
>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :parents="parents" /> <component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :parents="parents" />
</Modal> </Modal>
</div> </div>
...@@ -42,11 +52,13 @@ export default { ...@@ -42,11 +52,13 @@ export default {
title: "新增", title: "新增",
detail: null, detail: null,
curId: 0, curId: 0,
fullscreen: false,
entity: { entity: {
id: "", id: "",
levelId: 0, levelId: 0,
levelTitle: "", levelTitle: "",
bomId: 0 bomId: 0,
version: ""
}, },
parms: { parms: {
app: "technology", app: "technology",
...@@ -58,32 +70,58 @@ export default { ...@@ -58,32 +70,58 @@ export default {
columns: [ columns: [
{ {
key: "name", key: "name",
title: this.l("name"),
align: "left", align: "left",
high: true high: true
}, },
{
key: "type",
title: this.l("type"),
align: "left",
high: true,
align: "center",
width: 60,
render: (h, params) => {
return h("op", {
props: {
icon: params.row.type == 1 ? "md-git-merge" : "",
type: "icon"
},
on: {
click: () => this.bom(params.row)
}
});
}
},
{ {
key: "mmcode", key: "mmcode",
title: this.l("mmcode"), title: this.l("mmcode"),
align: "center", high: true,
high: true render: (h, params) => {
return h(
"a",
{
props: {},
on: {
click: () => this.details(params.row)
}
},
params.row.mmcode
);
}
}, },
{ {
key: "drawingNo", key: "drawingNo",
title: this.l("drawingNo"), title: this.l("drawingNo"),
align: "center",
high: true high: true
}, },
{ {
key: "count", key: "count",
title: this.l("count"), title: this.l("count"),
align: "center",
high: true high: true
}, },
{ {
key: "postion", key: "postion",
title: this.l("postion"), title: this.l("postion"),
align: "center",
high: true high: true
}, },
{ {
...@@ -97,7 +135,8 @@ export default { ...@@ -97,7 +135,8 @@ export default {
{ {
title: "操作", title: "操作",
key: "id", key: "id",
align: "left", width: 150,
align: "center",
render: (h, params) => { render: (h, params) => {
let actions = [ let actions = [
h( h(
...@@ -150,6 +189,15 @@ export default { ...@@ -150,6 +189,15 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
details(row) {
this.fullscreen = true;
this.curId = row.materialId;
// this.rootCategoryId = row.rootCategoryId;
this.title = "详情";
this.detail = () => import("../../../materiel/masterData/details");
this.rowsTable = [];
this.modal = true;
},
init() { init() {
Api.alltree({ id: this.parents.bomId, levelId: this.parents.id }).then( Api.alltree({ id: this.parents.bomId, levelId: this.parents.id }).then(
r => { r => {
...@@ -168,7 +216,7 @@ export default { ...@@ -168,7 +216,7 @@ export default {
this.modal = true; this.modal = true;
}, },
addBom() { addBom() {
console.log(this.entity); // console.log(this.entity);
this.curId = this.entity.id; this.curId = this.entity.id;
this.parents.upBomId = this.entity.bomId; this.parents.upBomId = this.entity.bomId;
this.parents.id = this.entity.levelId; this.parents.id = this.entity.levelId;
...@@ -187,6 +235,17 @@ export default { ...@@ -187,6 +235,17 @@ export default {
this.detail = () => import("./bomEdit"); this.detail = () => import("./bomEdit");
this.modal = true; this.modal = true;
}, },
bom(row) {
console.log(row);
this.curId = row.bomId;
this.eid = row.id;
this.parents.bomId = row.bomId;
this.parents.id = row.levelId;
this.parents.rootProductId = row.rootProductId;
this.title = "bom";
this.detail = () => import("./bom");
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) {
...@@ -198,6 +257,7 @@ export default { ...@@ -198,6 +257,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.parms.eid = r.result.productUrlList; this.parms.eid = r.result.productUrlList;
this.$emit("on-load"); this.$emit("on-load");
}); });
......
...@@ -51,8 +51,11 @@ export default { ...@@ -51,8 +51,11 @@ export default {
levelId: this.parents.id, levelId: this.parents.id,
levelTitle: this.parents.parentName, levelTitle: this.parents.parentName,
rootProductId: this.parents.rootProductId, rootProductId: this.parents.rootProductId,
upBomId: this.parents.upBomId upBomId: this.parents.upBomId,
type: 0,
count: 1
}, },
listData: [],
dataList: [], dataList: [],
downUrl: fileUrlDown, downUrl: fileUrlDown,
componaylist: [], componaylist: [],
...@@ -85,16 +88,33 @@ export default { ...@@ -85,16 +88,33 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() { created() {
this.getTree(); this.getList();
}, },
methods: { methods: {
change(e) { change(e) {
// console.log(e);
this.entity.name = e.name; this.entity.name = e.name;
this.entity.mmcode = e.mmcode; this.entity.mmcode = e.mmcode;
this.entity.drawingNo = e.drawingNo; this.entity.drawingNo = e.drawingNo;
this.entity.version = parseInt(e.version); this.entity.version = parseInt(e.version);
this.entity.materialId = e.materialId; this.entity.materialId = e.materialId;
let code = e.mmcode;
if (code) {
this.listData.forEach(a => {
if (a.mmcode == code) {
this.entity.type = 1;
}
});
}
},
getList() {
let conditions = [];
Api.list({ conditions: conditions }).then(r => {
if (r.success) {
this.listData = r.result;
} else {
this.$Message.error("保存失败");
}
});
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<Row> <Row>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('materialId')" prop="materialId"> <FormItem :label="l('materialId')" prop="materialId">
<Materiel v-model="entity.materialId" @on-change="change" :disabled='true'></Materiel> <Materiel v-model="entity.materialId" @on-change="change" :disabled="true"></Materiel>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
...@@ -44,7 +44,9 @@ export default { ...@@ -44,7 +44,9 @@ export default {
entity: { entity: {
id: this.eid, id: this.eid,
levelId: 0, levelId: 0,
levelTitle: "" levelTitle: "",
type: null,
count: 1
}, },
dataList: [], dataList: [],
downUrl: fileUrlDown, downUrl: fileUrlDown,
...@@ -70,7 +72,7 @@ export default { ...@@ -70,7 +72,7 @@ export default {
id: Number, id: Number,
parentName: String, parentName: String,
ids: String, ids: String,
rootProductId:Number, rootProductId: Number
} }
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
...@@ -83,7 +85,7 @@ export default { ...@@ -83,7 +85,7 @@ export default {
}, },
methods: { methods: {
load(v) { load(v) {
Api.getbom({ id: v}).then(r => { Api.getbom({ id: v }).then(r => {
this.entity = r.result; this.entity = r.result;
}); });
}, },
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<FormItem :label="l('type')" prop="type"> <FormItem :label="l('type')" prop="type">
<!-- <Input v-model="entity.type"></Input> --> <!-- <Input v-model="entity.type"></Input> -->
<Dictionary <Dictionary
disabled
code="material.main.type" code="material.main.type"
v-model="entity.type" v-model="entity.type"
type="select" type="select"
......
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