Commit 0e670986 authored by 仇晓婷's avatar 仇晓婷

物料分类

parent 7566c7da
......@@ -203,7 +203,7 @@ export default {
var arr = r.result;
this.checkList = arr.filter(function(item) {
delete item["id"];
return item
return item;
});
}
});
......@@ -222,7 +222,8 @@ export default {
required: false,
isunique: false,
fieldType: 3,
categoryId: 0
categoryId: 0,
action: 1
};
this.checkList.push(obj);
},
......
......@@ -35,12 +35,7 @@
<Table border :columns="columns" :data="checkList" class="tableCommon" height="300">
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<Input
v-if="row.fieldType==3"
v-model="row.title"
placeholder="请输入"
@on-blur="setRow(row,index)"
/>
<Input v-else v-model="row.title" placeholder="请输入" @on-blur="setRow(row,index)" />
</template>
<template slot-scope="{ row, index }" slot="note">
<div v-if="row.fieldType==1">{{row.note}}</div>
......@@ -131,7 +126,8 @@ export default {
{
title: "属性名称",
key: "title",
align: "center"
align: "center",
slot: "title"
},
{
title: "备注",
......@@ -181,7 +177,6 @@ export default {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.tableData();
this.get();
},
methods: {
......@@ -189,11 +184,18 @@ export default {
Api.get({ id: this.nodeInfo.id }).then(r => {
if (r.result) {
this.entity = r.result;
this.tableData();
}
});
},
tableData() {
let conditions = [];
let conditions = [
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.id
}
];
Api.listTable({ conditions: conditions }).then(r => {
if (r.result) {
console.log(r);
......@@ -208,6 +210,7 @@ export default {
this.$set(this.checkList, index, row);
},
addNew() {
let arr = this.$u.clone(this.checkList);
let obj = {
title: "",
note: "",
......@@ -215,16 +218,18 @@ export default {
required: false,
isunique: false,
fieldType: 3,
categoryId: 0
categoryId: 0,
action: 1
};
this.checkList.push(obj);
arr.push(obj);
this.checkList = arr;
},
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
let categoryDto = this.entity;
let pro = this.checkList;
Api.create({ categoryDto: categoryDto, pro: pro })
Api.update({ categoryDto: categoryDto, pro: pro })
.then(r => {
if (r.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