|
@@ -1,8 +1,22 @@
|
|
<template>
|
|
<template>
|
|
<div id="index">
|
|
<div id="index">
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24" class="main animate__animated animate__backInRight"> test </el-col>
|
|
|
|
|
|
+ <el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
|
+ <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" @reset="toReset" @del="toDel">
|
|
|
|
+ </data-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <e-dialog :dialog="dialog" @toClose="toClose">
|
|
|
|
+ <template slot="info">
|
|
|
|
+ <detail-1 v-if="dialog.type == '1'" :form="form" @onSubmit="onSubmit"></detail-1>
|
|
|
|
+ <info-1 :form="info" v-else></info-1>
|
|
|
|
+ </template>
|
|
|
|
+ </e-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -11,12 +25,67 @@ import { mapState, createNamespacedHelpers } from 'vuex';
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
props: {},
|
|
props: {},
|
|
- components: {},
|
|
|
|
|
|
+ components: {
|
|
|
|
+ detail1: () => import('./parts/detail-1.vue'),
|
|
|
|
+ info1: () => import('./parts/info-1.vue'),
|
|
|
|
+ },
|
|
data: function () {
|
|
data: function () {
|
|
- return {};
|
|
|
|
|
|
+ return {
|
|
|
|
+ // 数据项
|
|
|
|
+ fields: [
|
|
|
|
+ { label: '名称', prop: 'name' },
|
|
|
|
+ { label: '商品类型', prop: 'type_name' },
|
|
|
|
+ { label: '库存数量', prop: 'num' },
|
|
|
|
+ { label: '商品单价', prop: 'money' },
|
|
|
|
+ ],
|
|
|
|
+ total: 0,
|
|
|
|
+ opera: [
|
|
|
|
+ { label: '详细信息', method: 'view' },
|
|
|
|
+ { label: '信息变更', method: 'edit' },
|
|
|
|
+ ],
|
|
|
|
+ // 列表
|
|
|
|
+ list: [
|
|
|
|
+ { id: '1111', name: '手抓饼', type_name: '食品', num: '11111', money: '6', stock_type: '固定资产', brief: '十块钱俩' },
|
|
|
|
+ { id: '1112', name: '烤冷面', type_name: '食品', num: '11111', money: '5', stock_type: '商品', brief: '十块钱也俩' },
|
|
|
|
+ ],
|
|
|
|
+ // 弹框
|
|
|
|
+ dialog: { title: '信息管理', show: false, type: '1' },
|
|
|
|
+ // 添加表单
|
|
|
|
+ form: {},
|
|
|
|
+ //详情
|
|
|
|
+ info: {},
|
|
|
|
+ };
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
- methods: {},
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ search() {},
|
|
|
|
+ // 添加
|
|
|
|
+ toAdd() {
|
|
|
|
+ this.dialog = { title: '信息管理', show: true, type: '1', widths: '40%' };
|
|
|
|
+ },
|
|
|
|
+ // 提交保存
|
|
|
|
+ onSubmit(data) {
|
|
|
|
+ this.toClose();
|
|
|
|
+ },
|
|
|
|
+ // 详细信息
|
|
|
|
+ toView({ data }) {
|
|
|
|
+ this.$set(this, `info`, data);
|
|
|
|
+ this.dialog = { title: '详细信息', show: true, type: '2', widths: '40%' };
|
|
|
|
+ },
|
|
|
|
+ // 信息变更
|
|
|
|
+ toEdit({ data }) {
|
|
|
|
+ this.$set(this, `form`, data);
|
|
|
|
+ this.dialog = { title: '信息管理', show: true, type: '1', widths: '40%' };
|
|
|
|
+ },
|
|
|
|
+ // 密码重置
|
|
|
|
+ toReset() {},
|
|
|
|
+ // 删除信息
|
|
|
|
+ toDel() {},
|
|
|
|
+ // 关闭弹框
|
|
|
|
+ toClose() {
|
|
|
|
+ this.dialog = { show: false };
|
|
|
|
+ },
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|
|
},
|
|
},
|
|
@@ -33,4 +102,10 @@ export default {
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.main {
|
|
|
|
+ .one {
|
|
|
|
+ margin: 10px 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|