You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bsdgy-front/src/pages/shop/IncreaseWelcomeList.vue

147 lines
3.7 KiB
Vue

5 years ago
<template>
<div>
<Row class="search-row">
5 years ago
<i-col span="24"
class="search-col">
<Row class="row-style">
<Button @click="handleEdit"
type="primary">配置欢迎语</Button>
</Row>
5 years ago
</i-col>
</Row>
5 years ago
<Table :columns="columns1"
5 years ago
:data="data"
5 years ago
style="margin-top: 20px;"
size="small">
5 years ago
<template slot-scope="{ row, index }"
5 years ago
slot="action">
<Button type="primary"
size="small"
5 years ago
@click="handleEdit(row, index)">修改</Button>
5 years ago
<Button type="error"
size="small"
5 years ago
@click="handleDelete(row, index)">删除</Button>
5 years ago
</template>
</Table>
5 years ago
<Page :total="total"
:current="pageNum"
:page-size="pageSize"
show-elevator
show-total
placement="top"
@on-change="handlePage"
class="ks-page"></Page>
5 years ago
</div>
</template>
<script>
5 years ago
import data from '../../utils/PhoneRegionData'
import http from '../../services/store/IncreaseStoreManager'
5 years ago
5 years ago
import staff from '../../services/staff/staff'
5 years ago
5 years ago
export default {
5 years ago
name: 'IncreaseWelcomeList',
inject: ['setMenuName'],
5 years ago
data () {
5 years ago
let _this = this
5 years ago
return {
loading: true,
// 分页
total: 0,
pageSize: 10,
5 years ago
data: [],
5 years ago
pageNum: 1,
columns1: [
5 years ago
{
width: 60,
align: 'center',
title: '序号',
render (h, params) {
console.log(params)
let num = parseInt(params.index) + 1
console.log(_this.pageSize)
if (_this.pageSize > 1) {
num += (_this.pageNum - 1) * _this.pageSize
}
return h('span', num)
},
},
{
title: '欢迎语',
key: 'scheduleVO.description',
render (h, params) {
return h('span', params.row.scheduleVO.description)
},
},
{
title: '配置范围',
key: 'shop',
render (h, params) {
return h(
'span',
params.row.companyName +
'等' +
(params.row.companyCount || 0) +
'家公司'
)
},
},
{ title: '配置时间', key: 'createTime' },
{ title: '修改时间', key: 'updateTime' },
{ title: '操作', slot: 'action' },
5 years ago
],
5 years ago
formValidate: {},
}
5 years ago
},
mounted () {
5 years ago
this.setMenuName('门店推广', '欢迎语')
this.handlePaginate()
5 years ago
},
methods: {
// 分页刷新
handlePaginate () {
5 years ago
this.loading = true
let params = {
pageNum: this.pageNum,
pageSize: this.pageSize,
userId: JSON.parse(sessionStorage.getItem('loginInfo')).userId,
categoryCode: 'welcome',
5 years ago
}
5 years ago
http.getWelcomeList(params, (res) => {
const data = res.data.results.this || {}
this.data = data.list || []
this.totalSize = data.total || 0
this.loading = false
})
5 years ago
},
5 years ago
//切页处理
handlePage: function (value) {
5 years ago
this.pageNum = value
5 years ago
},
5 years ago
// 新增或修改
handleEdit (row) {
5 years ago
this.$router.push({
path: '/shop/increase/welcome/edit',
query: { id: row.id },
})
5 years ago
},
// 删除
handleDelete (row) {
5 years ago
let _this = this;
this.$Modal.confirm({
title: '删除欢迎语',
content: '您确定要删除该欢迎语?',
onOk: () => {
http.deleteWelcome({ id: row.scheduleId }).then(_this.handlePaginate)
},
onCancel: () => {
}
});
5 years ago
},
5 years ago
},
5 years ago
}
5 years ago
</script>
5 years ago
<style scoped></style>