135 行
4.6 KiB
HTML
可执行文件
135 行
4.6 KiB
HTML
可执行文件
<!--[1.8.20]-->
|
|
<!doctype html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport"
|
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.css">
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
[v-cloak] {
|
|
display: none;
|
|
}
|
|
|
|
th {
|
|
background-color: #f5f7fa !important;
|
|
}
|
|
|
|
th>.cell,
|
|
td>.cell {
|
|
text-align: center;
|
|
}
|
|
|
|
#blessing-merchant {
|
|
padding: 40px;
|
|
}
|
|
|
|
.el-pagination {
|
|
margin-top: 20px;
|
|
text-align: right;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="blessing-merchant">
|
|
<el-table :data="tableData" border style="width: 100%">
|
|
<el-table-column type="index" label="序号" width="60">
|
|
</el-table-column>
|
|
<el-table-column prop="storetag_name" label="门店名称">
|
|
</el-table-column>
|
|
<el-table-column prop="address" label="门店地址">
|
|
</el-table-column>
|
|
<el-table-column prop="manager_name" label="店长">
|
|
</el-table-column>
|
|
<el-table-column prop="mobile" label="联系方式">
|
|
</el-table-column>
|
|
<el-table-column label="权限">
|
|
<template slot-scope="scope">
|
|
<el-switch v-model="scope.row.s_status" active-value="1" inactive-value="0"
|
|
@change="switchChange(scope.row.id, $event)"></el-switch>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-pagination background layout="prev, pager, next" :page-size="limit" :current-page="page" :total="total"
|
|
:hide-on-single-page="true" @current-change="currentChange">
|
|
</el-pagination>
|
|
</div>
|
|
<script type="text/javascript" charset="utf-8" src="/Public/vue/js/vue2.5.16.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="/Public/vue/element-ui.js?v=2.13.2"></script>
|
|
<script type="text/javascript" charset="utf-8" src="/Public/js/common.js"></script>
|
|
<script type="text/javascript">
|
|
var app = new Vue({
|
|
el: '#blessing-merchant',
|
|
data() {
|
|
return {
|
|
tableData: [], //表格数据
|
|
page: 1, //当前页数
|
|
limit: 10, //每页数量
|
|
total: 0 //数据总数
|
|
}
|
|
},
|
|
methods: {
|
|
/**
|
|
* @description 获取门店列表
|
|
*/
|
|
getData() {
|
|
this.sendRequest('Blessing/Merchant/blessingPlugList', {
|
|
data: {
|
|
page: this.page,
|
|
limit: this.limit
|
|
},
|
|
success: (response) => {
|
|
if (response.status == 1) {
|
|
this.tableData = response.data.data
|
|
this.total = response.data.total
|
|
} else {
|
|
this.$message.error(response.message)
|
|
}
|
|
}
|
|
})
|
|
},
|
|
/**
|
|
* @description 分页事件
|
|
* @param {Number} page 当前分页数
|
|
*/
|
|
currentChange(page) {
|
|
this.page = page
|
|
this.getData()
|
|
},
|
|
/**
|
|
* @description 列表店铺权限开关事件
|
|
* @param {Number} id 门店ID
|
|
* @param {Number} status 当前开关状态值
|
|
*/
|
|
switchChange(id, status) {
|
|
this.sendRequest('Blessing/Merchant/plugStoreSave', {
|
|
data: {
|
|
store_id: id,
|
|
status: status
|
|
},
|
|
success: (response) => {
|
|
if (response.status == 1) {
|
|
this.$message.success(response.message)
|
|
} else {
|
|
this.$message.error(response.message)
|
|
}
|
|
}
|
|
})
|
|
}
|
|
},
|
|
created() {
|
|
this.getData()
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
|
|
</html> |