|
@@ -3,40 +3,12 @@
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
<div slot="header" class="clearfix">
|
|
<div slot="header" class="clearfix">
|
|
<span>渠道管理</span>
|
|
<span>渠道管理</span>
|
|
- <el-button style="float: right; padding: 3px 0" type="text">增加</el-button>
|
|
|
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="add">增加</el-button>
|
|
</div>
|
|
</div>
|
|
<el-table
|
|
<el-table
|
|
- :data="channeList"
|
|
|
|
- style="width: 100%">
|
|
|
|
- <!--
|
|
|
|
- <el-table-column type="expand">
|
|
|
|
- <template slot-scope="props">
|
|
|
|
- <el-form label-position="left" inline class="demo-table-expand">
|
|
|
|
- <el-form-item label="商品名称">
|
|
|
|
- <span>{{ props.row.name }}</span>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="所属店铺">
|
|
|
|
- <span>{{ props.row.shop }}</span>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="商品 ID">
|
|
|
|
- <span>{{ props.row.id }}</span>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="店铺 ID">
|
|
|
|
- <span>{{ props.row.shopId }}</span>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="商品分类">
|
|
|
|
- <span>{{ props.row.category }}</span>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="店铺地址">
|
|
|
|
- <span>{{ props.row.address }}</span>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="商品描述">
|
|
|
|
- <span>{{ props.row.desc }}</span>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- -->
|
|
|
|
|
|
+ :data="channeList.list"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ height="700">
|
|
<el-table-column
|
|
<el-table-column
|
|
label="渠道 CODE"
|
|
label="渠道 CODE"
|
|
prop="code">
|
|
prop="code">
|
|
@@ -57,6 +29,7 @@
|
|
label="联系人电话"
|
|
label="联系人电话"
|
|
prop="mobileNo">
|
|
prop="mobileNo">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <!--
|
|
<el-table-column label="操作">
|
|
<el-table-column label="操作">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
@@ -68,19 +41,97 @@
|
|
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
|
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ -->
|
|
</el-table>
|
|
</el-table>
|
|
|
|
+ <el-pagination
|
|
|
|
+ background
|
|
|
|
+ layout="prev, pager, next"
|
|
|
|
+ :total="channeList.totalSize"
|
|
|
|
+ @current-change="changePage">
|
|
|
|
+ </el-pagination>
|
|
</el-card>
|
|
</el-card>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="增加"
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
+ width="50%"
|
|
|
|
+ center>
|
|
|
|
+ <el-form :model="channelForm" ref="channelEdit" label-position="left">
|
|
|
|
+ <el-form-item label="CDN 前缀" prop="cdnPrefix" label-width="90px" :rules="{required: true, message: 'CDN 前缀不能为空'}">
|
|
|
|
+ <el-input size="small" v-model="channelForm.cdnPrefix" autocomplete="off"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="CODE" prop="code" label-width="90px" :rules="{required: true, message: 'CODE 不能为空'}">
|
|
|
|
+ <el-input size="small" v-model="channelForm.code" autocomplete="off"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="渠道名字" prop="title" label-width="90px" :rules="{required: true, message: '渠道名字不能为空'}">
|
|
|
|
+ <el-input size="small" v-model="channelForm.title" autocomplete="off"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="联系人" prop="contact" label-width="90px">
|
|
|
|
+ <el-input size="small" v-model="channelForm.contact" autocomplete="off"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="联系人电话" prop="mobileNo" label-width="90px">
|
|
|
|
+ <el-input size="small" v-model="channelForm.mobileNo" autocomplete="off"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="setTable('channelEdit')">确 定</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { mapGetters } from 'vuex'
|
|
|
|
|
|
+import { mapGetters } from 'vuex';
|
|
export default {
|
|
export default {
|
|
|
|
+ data () {
|
|
|
|
+ return{
|
|
|
|
+ channelForm: {
|
|
|
|
+ cdnPrefix: '',
|
|
|
|
+ code: '',
|
|
|
|
+ title: '',
|
|
|
|
+ contact: '',
|
|
|
|
+ mobileNo: ''
|
|
|
|
+ },
|
|
|
|
+ dialogVisible: false,
|
|
|
|
+ page: ''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
...mapGetters(['channeList'])
|
|
...mapGetters(['channeList'])
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.$store.dispatch('getChannelList', {pageNo: 1, pageSize: 10 })
|
|
this.$store.dispatch('getChannelList', {pageNo: 1, pageSize: 10 })
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ add () {
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ },
|
|
|
|
+ // 分页
|
|
|
|
+ changePage (e) {
|
|
|
|
+ this.page = e;
|
|
|
|
+ this.$store.dispatch('getChannelList', {pageNo: e, pageSize: 10})
|
|
|
|
+ },
|
|
|
|
+ // 提交确认
|
|
|
|
+ setTable (formName) {
|
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.$store.dispatch('addChannelList', this.channelForm)
|
|
|
|
+ } else {
|
|
|
|
+ console.log('error submit!!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
+<style lang="less">
|
|
|
|
+ .el-pagination {
|
|
|
|
+ text-align: center;
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ }
|
|
|
|
+ .el-form-item__content {
|
|
|
|
+ width: 50%;
|
|
|
|
+ }
|
|
|
|
+</style>
|