|
@@ -20,20 +20,13 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <!-- <c-dialog :dialog="dialog" @toClose="toClose">
|
|
|
- <template slot="info">
|
|
|
- <el-col :span="24" class="dialog_1" v-if="dialog.type == '1'">
|
|
|
- <video :src="info.path" controls autoplay></video>
|
|
|
- </el-col>
|
|
|
- </template>
|
|
|
- </c-dialog> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { is_use, pro_type } from '@common/src/layout/site';
|
|
|
+import { is_use, goods_type } from '@common/src/layout/site';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-const { mapActions } = createNamespacedHelpers('program');
|
|
|
+// const { mapActions } = createNamespacedHelpers('program');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
@@ -46,8 +39,9 @@ export default {
|
|
|
total: 0,
|
|
|
fields: [
|
|
|
{ label: '序号', options: { type: 'index' } },
|
|
|
+ { label: '商品名称', model: 'name', isSearch: true },
|
|
|
{
|
|
|
- label: '节目类型',
|
|
|
+ label: '商品类型',
|
|
|
model: 'type',
|
|
|
type: 'select',
|
|
|
format: (i) => {
|
|
@@ -57,10 +51,9 @@ export default {
|
|
|
},
|
|
|
isSearch: true,
|
|
|
},
|
|
|
- { label: '名称', model: 'name', isSearch: true },
|
|
|
- { label: '视频流', model: 'path', isSearch: true },
|
|
|
- { label: '排序', model: 'sort', isSearch: true },
|
|
|
-
|
|
|
+ { label: '价格', model: 'price' },
|
|
|
+ { label: '规格', model: 'spec' },
|
|
|
+ { label: '库存', model: 'stock' },
|
|
|
{
|
|
|
label: '是否启用',
|
|
|
model: 'is_use',
|
|
@@ -74,17 +67,13 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
opera: [
|
|
|
+ { label: '生成桌码', method: 'code' },
|
|
|
{ label: '修改', method: 'edit' },
|
|
|
{ label: '删除', method: 'del', confirm: true, type: 'danger' },
|
|
|
- // { label: '观看', method: 'view' },
|
|
|
],
|
|
|
is_useList: is_use,
|
|
|
- // 节目类型
|
|
|
- typeList: pro_type,
|
|
|
- // 详细信息
|
|
|
- info: {},
|
|
|
- // 弹框
|
|
|
- dialog: { title: '观看', show: false, type: '1' },
|
|
|
+ // 商品类型
|
|
|
+ typeList: goods_type,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -92,44 +81,35 @@ export default {
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
- ...mapActions(['query', 'fetch', 'delete']),
|
|
|
+ // ...mapActions(['query', 'fetch', 'delete']),
|
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
- let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `list`, res.data);
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
- }
|
|
|
+ // let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
|
|
|
+ // if (this.$checkRes(res)) {
|
|
|
+ // this.$set(this, `list`, res.data);
|
|
|
+ // this.$set(this, `total`, res.total);
|
|
|
+ // }
|
|
|
},
|
|
|
btSearch(query) {
|
|
|
this.$set(this, `searchInfo`, query);
|
|
|
this.search();
|
|
|
},
|
|
|
+ // 生成桌码
|
|
|
+ code() {
|
|
|
+ console.log('1');
|
|
|
+ },
|
|
|
// 添加
|
|
|
toAdd() {
|
|
|
- this.$router.push({ path: '/tvadmin/add' });
|
|
|
+ this.$router.push({ path: '/goods/add' });
|
|
|
},
|
|
|
// 修改
|
|
|
toEdit({ data }) {
|
|
|
- this.$router.push({ path: '/tvadmin/add', query: { id: data._id } });
|
|
|
+ this.$router.push({ path: '/goods/add', query: { id: data._id } });
|
|
|
},
|
|
|
// 删除信息
|
|
|
async toDel({ data }) {
|
|
|
- let res = await this.delete(data.id);
|
|
|
- if (this.$checkRes(res, `刪除信息成功`, `${res.errmsg}`)) this.search();
|
|
|
+ // let res = await this.delete(data.id);
|
|
|
+ // if (this.$checkRes(res, `刪除信息成功`, `${res.errmsg}`)) this.search();
|
|
|
},
|
|
|
- // // 观看
|
|
|
- // async toView({ data }) {
|
|
|
- // let res = await this.fetch(data.id);
|
|
|
- // if (this.$checkRes(res)) {
|
|
|
- // this.$set(this, `info`, res.data);
|
|
|
- // this.$set(this, `dialog`, { title: res.data.name, show: true, type: '1' });
|
|
|
- // }
|
|
|
- // },
|
|
|
- // // 关闭弹框
|
|
|
- // toClose() {
|
|
|
- // this.$set(this, `info`, {});
|
|
|
- // this.$set(this, `dialog`, { title: '观看', show: false, type: '1' });
|
|
|
- // },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|