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

产品

parent d555e978
...@@ -22,4 +22,8 @@ export default { ...@@ -22,4 +22,8 @@ export default {
materiallist(params){ materiallist(params){
return Api.post(`${systemUrl}/material/materiallist`,params);//物料 return Api.post(`${systemUrl}/material/materiallist`,params);//物料
}, },
alltree(params){
return Api.post(`${technologyUrl}productinfo/alltree`,params); //bom树
},
} }
\ No newline at end of file
<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="add()" class="mb10">新增Bom</Button>
</div> </div>-->
<div class="new-detail"> <div class="new-detail">
<Row> <Row>
<Filed :span="8" :name="l('levelId')+':'">{{entity.levelId}}</Filed> <Filed :span="8" :name="l('levelId')+':'">{{entity.levelId}}</Filed>
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
"op", "op",
{ {
attrs: { oprate: "add" }, attrs: { oprate: "add" },
on: { click: () => this.add(params.row) } on: { click: () => this.add(params.row.id) }
}, },
"新增" "新增"
), ),
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
"op", "op",
{ {
attrs: { oprate: "edit" }, attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row) } on: { click: () => this.edit(params.row.id) }
}, },
"编辑" "编辑"
), ),
...@@ -99,21 +99,16 @@ export default { ...@@ -99,21 +99,16 @@ export default {
if (this.eid > 0) { if (this.eid > 0) {
this.load(this.eid); this.load(this.eid);
} }
this.init();
}, },
methods: { methods: {
// init() { init() {
// Api.getpaged().then(r => { Api.alltree({ id: this.eid }).then(r => {
// this.treeData = []; this.treeData = r.result;
// this.treeData = this.$u.toTree( });
// r.result.items, },
// 0, add(id) {
// undefined, this.curId = id;
// "parent_Id"
// );
// });
// },
add() {
this.curId = 0;
this.title = "新增"; this.title = "新增";
this.detail = () => import("./bomAdd"); this.detail = () => import("./bomAdd");
this.modal = true; this.modal = true;
...@@ -124,21 +119,11 @@ export default { ...@@ -124,21 +119,11 @@ export default {
this.detail = () => import("./bomEdit"); this.detail = () => import("./bomEdit");
this.modal = true; this.modal = true;
}, },
remove(id) {
remove(row) { Api.delete(id).then(r => {
this.$Modal.confirm({ if (r.success) {
title: "删除", this.init();
content: "<p>您确定要删除此物料吗?</p>", this.$Message.success("删除成功");
onOk: () => {
// Api.delete(row.id).then(r => {
// if (r.success) {
// this.$refs.grid.load();
// this.$Message.success("删除成功");
// }
// });
},
onCancel: () => {
this.$Message.success("取消删除");
} }
}); });
}, },
...@@ -157,7 +142,8 @@ export default { ...@@ -157,7 +142,8 @@ export default {
} }
}, },
ok() { ok() {
// this.$refs.grid.load(); this.init();
// this.load(this.eid);
this.modal = false; this.modal = false;
this.curId = 0; this.curId = 0;
}, },
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120"> <Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row> <Row>
<Col :span="12">
<!-- <FormItem label="层级类型" prop="levelTitle">
<Input v-model="entity.levelTitle" ></Input>
</FormItem>-->
</Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('materialId')" prop="materialId"> <FormItem :label="l('materialId')" prop="materialId">
<Select v-model="entity.materialId" filterable clearable @on-change="change"> <Select v-model="entity.materialId" filterable clearable @on-change="change">
...@@ -49,7 +44,7 @@ export default { ...@@ -49,7 +44,7 @@ export default {
return { return {
disabled: false, disabled: false,
entity: { entity: {
upId: this.eid id: this.eid
}, },
dataList: [], dataList: [],
downUrl: fileUrlDown, downUrl: fileUrlDown,
...@@ -108,7 +103,7 @@ export default { ...@@ -108,7 +103,7 @@ export default {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
if (v) { if (v) {
this.disabled = true; this.disabled = true;
Api.create(this.entity) Api.update(this.entity)
.then(r => { .then(r => {
this.disabled = false; this.disabled = false;
if (r.success) { if (r.success) {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('name')" prop="name"> <FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input> <Input v-model="entity.name" disabled></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
data2: [], data2: [],
selectdata1: [], selectdata1: [],
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], materialId: [{ required: true, message: "必填", trigger: "blur" }],
levelId: [ levelId: [
{ required: true, message: "必填", trigger: "change", type: "string" } { required: true, message: "必填", trigger: "change", type: "string" }
] ]
...@@ -202,6 +202,7 @@ export default { ...@@ -202,6 +202,7 @@ export default {
this.$refs.edit.dep = r.result.levelId; this.$refs.edit.dep = r.result.levelId;
this.$refs.edit.label = r.result.levelTitle; this.$refs.edit.label = r.result.levelTitle;
this.entity.materialId = r.result.materialId; this.entity.materialId = r.result.materialId;
this.entity.levelId = r.result.levelId+'';
}); });
}, },
handleSubmit() { handleSubmit() {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
:columns="columns" :columns="columns"
ref="grid" ref="grid"
:action="action" :action="action"
:conditions="easySearch"
type="card" type="card"
:high="false" :high="false"
:span="6" :span="6"
...@@ -38,7 +39,7 @@ ...@@ -38,7 +39,7 @@
</div> </div>
</Col> </Col>
<Col span="17" class="c"> <Col span="17" class="c">
<div>产品分类:{{row.productClass}}</div> <div>产品分类:{{row.levelTitle}}</div>
<div>图号:{{row.drawingNo}}</div> <div>图号:{{row.drawingNo}}</div>
<div>主制单位:{{row.madeCompanyTitle}}</div> <div>主制单位:{{row.madeCompanyTitle}}</div>
<p class="a-icon"> <p class="a-icon">
...@@ -90,7 +91,9 @@ export default { ...@@ -90,7 +91,9 @@ export default {
action: Api.index, action: Api.index,
fullscreen: false, fullscreen: false,
easySearch: { easySearch: {
keys: { op: "mmcode,name,productCode", value: null } keys: { op: "mmcode,name,productCode", value: null },
levelId: { op: "In", value: this.id }
// levelTitle: { op: "In", value: this.parentName }
}, },
modal: false, modal: false,
title: "新增", title: "新增",
...@@ -109,8 +112,8 @@ export default { ...@@ -109,8 +112,8 @@ export default {
}; };
}, },
mounted() { mounted() {
this.$refs.grid.reload(); this.$refs.grid.reload(this.easySearch);
console.log(this); // console.log(this);
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
......
...@@ -160,8 +160,8 @@ export default { ...@@ -160,8 +160,8 @@ export default {
this.expand = !this.expand; this.expand = !this.expand;
}, },
change(v, b) { change(v, b) {
// console.log(v); console.log(v);
// console.log(b); console.log(b);
let ids = []; let ids = [];
ids.push(b.value); ids.push(b.value);
if (b.children) { if (b.children) {
......
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