|
@@ -3,21 +3,18 @@
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
<el-col class="one">
|
|
<el-col class="one">
|
|
- <el-button type="primary" size="mini" @click="toAdd()">添加商品类型</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col class="two">
|
|
|
|
<data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView" @edit="toEdit">
|
|
<data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView" @edit="toEdit">
|
|
- <!-- <template #selfbtn>
|
|
|
|
- <el-button type="primary" size="mini" @click="toAdd()">添加商品类型</el-button>
|
|
|
|
- </template> -->
|
|
|
|
|
|
+ <template #selfbtn>
|
|
|
|
+ <el-button type="primary" size="mini" @click="toAdd()">添加商品类型</el-button>
|
|
|
|
+ </template>
|
|
</data-table>
|
|
</data-table>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
<e-dialog :dialog="dialog" @toClose="toClose">
|
|
<e-dialog :dialog="dialog" @toClose="toClose">
|
|
<template slot="info">
|
|
<template slot="info">
|
|
- <detail-1 v-if="dialog.type == '1'" :form="form" @onSubmit="onSubmit"></detail-1>
|
|
|
|
- <info-1 :form="info" v-else></info-1>
|
|
|
|
|
|
+ <detail-1 v-if="dialog.type == '1'" :form="form" @toSave="toSave"></detail-1>
|
|
|
|
+ <info-1 v-else-if="dialog.type == '2'" :form="form"></info-1>
|
|
</template>
|
|
</template>
|
|
</e-dialog>
|
|
</e-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -34,17 +31,15 @@ export default {
|
|
},
|
|
},
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
- // 数据项
|
|
|
|
fields: [
|
|
fields: [
|
|
- { label: '类型类别', prop: 'code' },
|
|
|
|
- { label: '类型名称', prop: 'name' },
|
|
|
|
|
|
+ { label: '类型类别', prop: 'code', filter: true },
|
|
|
|
+ { label: '类型名称', prop: 'name', filter: true },
|
|
],
|
|
],
|
|
total: 0,
|
|
total: 0,
|
|
opera: [
|
|
opera: [
|
|
- { label: '详细信息', method: 'view' },
|
|
|
|
- { label: '信息变更', method: 'edit' },
|
|
|
|
|
|
+ { label: '详情', method: 'view' },
|
|
|
|
+ { label: '修改', method: 'edit' },
|
|
],
|
|
],
|
|
- // 列表
|
|
|
|
list: [
|
|
list: [
|
|
{ id: '1115', code: '5', name: '水彩笔5' },
|
|
{ id: '1115', code: '5', name: '水彩笔5' },
|
|
{ id: '1116', code: '6', name: '水彩笔6' },
|
|
{ id: '1116', code: '6', name: '水彩笔6' },
|
|
@@ -52,26 +47,24 @@ export default {
|
|
],
|
|
],
|
|
// 弹框
|
|
// 弹框
|
|
dialog: { title: '信息管理', show: false, type: '1' },
|
|
dialog: { title: '信息管理', show: false, type: '1' },
|
|
- // 添加表单
|
|
|
|
|
|
+ // 表单
|
|
form: {},
|
|
form: {},
|
|
- //详情
|
|
|
|
- info: {},
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
methods: {
|
|
methods: {
|
|
- search() {},
|
|
|
|
|
|
+ search({ skip = 0, limit = 10, ...info } = {}) {},
|
|
// 添加
|
|
// 添加
|
|
toAdd() {
|
|
toAdd() {
|
|
this.dialog = { title: '信息管理', show: true, type: '1', widths: '40%' };
|
|
this.dialog = { title: '信息管理', show: true, type: '1', widths: '40%' };
|
|
},
|
|
},
|
|
// 提交保存
|
|
// 提交保存
|
|
- onSubmit(data) {
|
|
|
|
- this.toClose();
|
|
|
|
|
|
+ toSave({ data }) {
|
|
|
|
+ console.log(data);
|
|
},
|
|
},
|
|
// 详细信息
|
|
// 详细信息
|
|
toView({ data }) {
|
|
toView({ data }) {
|
|
- this.$set(this, `info`, data);
|
|
|
|
|
|
+ this.$set(this, `form`, data);
|
|
this.dialog = { title: '详细信息', show: true, type: '2', widths: '40%' };
|
|
this.dialog = { title: '详细信息', show: true, type: '2', widths: '40%' };
|
|
},
|
|
},
|
|
// 信息变更
|
|
// 信息变更
|
|
@@ -81,6 +74,7 @@ export default {
|
|
},
|
|
},
|
|
// 关闭弹框
|
|
// 关闭弹框
|
|
toClose() {
|
|
toClose() {
|
|
|
|
+ this.form = {};
|
|
this.dialog = { show: false };
|
|
this.dialog = { show: false };
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -100,10 +94,4 @@ export default {
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped>
|
|
|
|
-.main {
|
|
|
|
- .one {
|
|
|
|
- margin: 10px 0;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</style>
|
|
|
|
|
|
+<style lang="less" scoped></style>
|