<template>
|
<div class="main_app">
|
<QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
|
<div class="table_btns">
|
<el-button type="primary" @click="handleEdit()">新增</el-button>
|
</div>
|
<el-table v-loading="loading" :data="list" stripe border>
|
<el-table-column prop="code" label="套餐名称" align="center" min-width="120" show-overflow-tooltip />
|
<el-table-column prop="" label="套餐类型" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="" label="次数" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="" label="有效期" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="" label="价格" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="" label="总发行数量" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="" label="已售售量" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="" label="销售渠道" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="" label="销售时段" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column prop="" label="状态" align="center" min-width="100" show-overflow-tooltip />
|
<el-table-column label="操作" fixed="right" align="center" min-width="80" show-overflow-tooltip>
|
<template v-slot="{ row }">
|
<span @click="handleDetail(row)" class="primaryColor pointer">查看详情</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="table_btns">
|
<Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
|
</div>
|
<!-- -->
|
<Edit v-if="isShowEdit" @close="isShowEdit = false" @success="getList" ref="EditRef" />
|
<ComboDetail v-if="isShowDetail" ref="DetailRef" />
|
</div>
|
</template>
|
|
<script>
|
import BasePageTemp from '@/components/base/BasePageTemp'
|
import TableLayout from '@/layouts/TableLayout'
|
import Edit from './components/Edit'
|
import ComboDetail from './components/ComboDetail.vue'
|
export default {
|
extends: BasePageTemp,
|
components: {
|
TableLayout,
|
Edit,
|
ComboDetail
|
},
|
data() {
|
return {
|
loading: false,
|
isShowEdit: false,
|
isShowDetail: false,
|
queryFormConfig: {
|
formItems: [
|
{
|
filed: 'name',
|
type: 'input',
|
label: '套餐名称',
|
},
|
{
|
filed: 'type',
|
type: 'select',
|
label: '适用项目',
|
labelCode: 'name',
|
valueCode: 'id',
|
options: []
|
},
|
{
|
filed: 'status',
|
type: 'select',
|
label: '状态',
|
options: []
|
},
|
],
|
online: true
|
},
|
list: [{}]
|
}
|
},
|
created() {
|
// this.getList()
|
// this.initData()
|
},
|
methods: {
|
handleSub() {
|
this.$refs.ruleForm.validate((valid) => {
|
if (valid) {
|
alert('submit!')
|
}
|
})
|
},
|
handleEdit() {
|
this.isShowEdit = true
|
this.$nextTick(() => {
|
this.$refs.EditRef.isShowModal = true
|
})
|
},
|
handleDetail(row) {
|
this.isShowDetail = true
|
this.$nextTick(() => {
|
this.$refs.DetailRef.isShowModal = true
|
// this.$refs.DetailRef.getDetail(row.id)
|
})
|
},
|
handleEx() {
|
this.$dialog.exportConfirm('确认导出吗?')
|
.then(() => {
|
this.loading = true
|
ywOutinboundEx({
|
page: this.pagination.page,
|
capacity: 1000000,
|
model: this.filters
|
})
|
.then(response => {
|
this.download(response)
|
})
|
.catch(e => {
|
this.$tip.apiFailed(e)
|
})
|
.finally(() => {
|
this.loading = false
|
})
|
})
|
.catch(() => { })
|
},
|
initData() {
|
getStoreList({ capacity: 9999, page: 1, model: {} }).then(res => {
|
this.queryFormConfig.formItems[1].options = res.records || []
|
})
|
},
|
getList(page) {
|
const { pagination, filters } = this
|
this.loading = true
|
if (page) { pagination.page = page }
|
ywOutinboundPage({
|
model: {
|
...filters,
|
inOut: 0
|
},
|
// sorts: [{ direction: 'DESC', property: 'param1' }],
|
capacity: pagination.pageSize,
|
page: page,
|
}).then(res => {
|
this.loading = false
|
this.list = res.records || []
|
this.list.forEach(item => {
|
item.typeName = this.StoreTypeOps[item.type].name
|
})
|
this.pagination.total = res.total || 0
|
}, () => {
|
this.loading = false
|
})
|
},
|
clear() {
|
this.filters = { inOut: 0 }
|
this.pagination.pageSize = 10
|
this.pagination.page = 1
|
this.getList()
|
},
|
handleSizeChange(capacity) {
|
this.pagination.pageSize = capacity
|
this.getList()
|
}
|
}
|
}
|
</script>
|
|
<style></style>
|