Commit 5a2ae32b authored by kangzhenfei's avatar kangzhenfei

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product

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