|
@@ -0,0 +1,93 @@
|
|
|
+<template>
|
|
|
+ <div id="chanpinTypeList">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <el-col :span="12" class="topTitle">
|
|
|
+ <span>产品类型字典表</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="topAdd">
|
|
|
+ <el-button type="primary" size="mini" @click="addData()"><i class="el-icon-plus"></i></el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="list">
|
|
|
+ <template>
|
|
|
+ <el-table :data="chanpinTypeList" style="width: 100%">
|
|
|
+ <el-table-column label="序号" type="index" align="center"> </el-table-column>
|
|
|
+ <el-table-column prop="name" label="类别名称" align="center"> </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scoped">
|
|
|
+ <el-button type="text" size="small" @click="$router.push({ path: '/supermaket/chanpinTypeDetail', query: { id: scoped.row.id } })"
|
|
|
+ ><i class="el-icon-edit"></i
|
|
|
+ ></el-button>
|
|
|
+ <el-button type="text" size="small" @click="handleDelete(scoped.row)"><i class="el-icon-delete"></i></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-col :span="24" class="page">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'chanpinTypeList',
|
|
|
+ props: {
|
|
|
+ chanpinTypeList: null,
|
|
|
+ total: null,
|
|
|
+ },
|
|
|
+ components: {},
|
|
|
+ data: () => ({
|
|
|
+ currentPage: 1,
|
|
|
+ }),
|
|
|
+ created() {},
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ addData() {
|
|
|
+ this.$router.push({ path: '/supermaket/chanpinTypeDetail' });
|
|
|
+ },
|
|
|
+ handleDelete(item) {
|
|
|
+ this.$emit('delete', item);
|
|
|
+ },
|
|
|
+ handleClick(row) {
|
|
|
+ this.$emit('list', { data: row });
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ console.log(`每页 ${val} 条`);
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ console.log(`当前页: ${val}`);
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.top {
|
|
|
+ padding: 15px 0;
|
|
|
+ border-bottom: 1px solid #cccc;
|
|
|
+}
|
|
|
+.top .topTitle {
|
|
|
+ padding: 0 10px;
|
|
|
+}
|
|
|
+.top .topAdd {
|
|
|
+ padding: 0 10px 0 0;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+.page {
|
|
|
+ padding: 20px 0;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+</style>
|