|
@@ -3,10 +3,10 @@
|
|
<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" @reset="toReset" @del="toDel">
|
|
|
|
|
|
+ <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>
|
|
</data-table>
|
|
</data-table>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -14,7 +14,7 @@
|
|
<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>
|
|
<detail-1 v-if="dialog.type == '1'" :form="form" @onSubmit="onSubmit"></detail-1>
|
|
- <info-1 :form="info" v-else></info-1>
|
|
|
|
|
|
+ <info-1 :form="form" v-if="dialog.type == '2'"></info-1>
|
|
</template>
|
|
</template>
|
|
</e-dialog>
|
|
</e-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -33,27 +33,34 @@ export default {
|
|
return {
|
|
return {
|
|
// 数据项
|
|
// 数据项
|
|
fields: [
|
|
fields: [
|
|
- { label: '名称', prop: 'name' },
|
|
|
|
- { label: '商品类型', prop: 'type_name' },
|
|
|
|
|
|
+ { label: '名称', prop: 'name', filter: true },
|
|
|
|
+ { label: '商品类型', prop: 'type_name', filter: true },
|
|
{ label: '库存数量', prop: 'num' },
|
|
{ label: '库存数量', prop: 'num' },
|
|
{ label: '商品单价', prop: 'money' },
|
|
{ label: '商品单价', prop: 'money' },
|
|
],
|
|
],
|
|
total: 0,
|
|
total: 0,
|
|
opera: [
|
|
opera: [
|
|
- { label: '详细信息', method: 'view' },
|
|
|
|
- { label: '信息变更', method: 'edit' },
|
|
|
|
|
|
+ { label: '详情', method: 'view' },
|
|
|
|
+ { label: '修改', method: 'edit' },
|
|
],
|
|
],
|
|
// 列表
|
|
// 列表
|
|
list: [
|
|
list: [
|
|
- { id: '1111', name: '手抓饼', type_name: '食品', num: '11111', money: '6', stock_type: '固定资产', brief: '十块钱俩' },
|
|
|
|
|
|
+ {
|
|
|
|
+ id: '1111',
|
|
|
|
+ name: '手抓饼',
|
|
|
|
+ type_name: '食品',
|
|
|
|
+ num: '11111',
|
|
|
|
+ money: '6',
|
|
|
|
+ stock_type: '固定资产',
|
|
|
|
+ brief: '十块钱俩',
|
|
|
|
+ img_url: [{ url: require('@a/logo.png') }, { url: require('@a/login-1.jpg') }, { url: require('@a/logo.png') }, { url: require('@a/login-1.jpg') }],
|
|
|
|
+ },
|
|
{ id: '1112', name: '烤冷面', type_name: '食品', num: '11111', money: '5', stock_type: '商品', brief: '十块钱也俩' },
|
|
{ id: '1112', name: '烤冷面', type_name: '食品', num: '11111', money: '5', stock_type: '商品', brief: '十块钱也俩' },
|
|
],
|
|
],
|
|
// 弹框
|
|
// 弹框
|
|
dialog: { title: '信息管理', show: false, type: '1' },
|
|
dialog: { title: '信息管理', show: false, type: '1' },
|
|
// 添加表单
|
|
// 添加表单
|
|
- form: {},
|
|
|
|
- //详情
|
|
|
|
- info: {},
|
|
|
|
|
|
+ form: { img_url: [] },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
@@ -69,7 +76,7 @@ export default {
|
|
},
|
|
},
|
|
// 详细信息
|
|
// 详细信息
|
|
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%' };
|
|
},
|
|
},
|
|
// 信息变更
|
|
// 信息变更
|
|
@@ -83,7 +90,9 @@ export default {
|
|
toDel() {},
|
|
toDel() {},
|
|
// 关闭弹框
|
|
// 关闭弹框
|
|
toClose() {
|
|
toClose() {
|
|
|
|
+ this.form = { img_url: [] };
|
|
this.dialog = { show: false };
|
|
this.dialog = { show: false };
|
|
|
|
+ this.search();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|