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

产品

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