This commit is contained in:
Sakura9701
2022-09-14 10:24:19 +08:00
parent 71d5a097e0
commit 9c6cc6a683
37 changed files with 4322 additions and 38 deletions

View File

@@ -46,7 +46,7 @@
filterable
allow-create
default-first-option
placeholder="请输入作者姓名">
placeholder="请输入出版社名称">
<el-option
v-for="item in publisherList"
:key="item.value + ''"
@@ -97,7 +97,7 @@
class="upload-demo"
action="http://localhost:9100/pb/oss/fileoss"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-remove="handleRemoveNovel"
:before-remove="beforeRemove"
:on-success="handleNovelSuccess"
multiple
@@ -242,7 +242,6 @@ export default {
},
methods: {
init(id) {
this.fileList = []
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
@@ -274,9 +273,14 @@ export default {
var checklist = data.book.type
var authorList = data.book.authorId
var publisherlish = data.book.publisherId
this.dataForm.publisherId = publisherlish.split(',')
if(data.book.authorId != ""){
this.dataForm.authorId = authorList.split(',')
}
if(data.book.publisherId != ""){
this.dataForm.publisherId = publisherlish.split(',')
}
this.dataForm.type = checklist.split(',')
this.dataForm.authorId = authorList.split(',')
console.log(this.dataForm.type)
if (data.book.images != "") {
var img = { name: '', url: data.book.images }

View File

@@ -0,0 +1,138 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="用户id" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户id"></el-input>
</el-form-item>
<el-form-item label="图书id" prop="bookId">
<el-input v-model="dataForm.bookId" placeholder="图书id"></el-input>
</el-form-item>
<el-form-item label="图书名称" prop="bookName">
<el-input v-model="dataForm.bookName" placeholder="图书名称"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-form-item label="删除标记" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder="删除标记"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
userId: '',
bookId: '',
bookName: '',
createTime: '',
updateTime: '',
sort: '',
delFlag: ''
},
dataRule: {
userId: [
{ required: true, message: '用户id不能为空', trigger: 'blur' }
],
bookId: [
{ required: true, message: '图书id不能为空', trigger: 'blur' }
],
bookName: [
{ required: true, message: '图书名称不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
updateTime: [
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '排序不能为空', trigger: 'blur' }
],
delFlag: [
{ required: true, message: '删除标记不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/book/bookbrowserecords/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.userId = data.bookBrowseRecords.userId
this.dataForm.bookId = data.bookBrowseRecords.bookId
this.dataForm.bookName = data.bookBrowseRecords.bookName
this.dataForm.createTime = data.bookBrowseRecords.createTime
this.dataForm.updateTime = data.bookBrowseRecords.updateTime
this.dataForm.sort = data.bookBrowseRecords.sort
this.dataForm.delFlag = data.bookBrowseRecords.delFlag
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/bookbrowserecords/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'userId': this.dataForm.userId,
'bookId': this.dataForm.bookId,
'bookName': this.dataForm.bookName,
'createTime': this.dataForm.createTime,
'updateTime': this.dataForm.updateTime,
'sort': this.dataForm.sort,
'delFlag': this.dataForm.delFlag
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,199 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:bookbrowserecords:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:bookbrowserecords:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="用户id">
</el-table-column>
<el-table-column
prop="bookId"
header-align="center"
align="center"
label="图书id">
</el-table-column>
<el-table-column
prop="bookName"
header-align="center"
align="center"
label="图书名称">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="delFlag"
header-align="center"
align="center"
label="删除标记">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './bookbrowserecords-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/bookbrowserecords/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/bookbrowserecords/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -1,5 +1,5 @@
<template>
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible" @close="handlereset">
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible" @close="handlereset">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="80px">
<!-- <el-form-item label="" prop="bookId">
@@ -13,16 +13,15 @@
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="dataForm.content" placeholder="内容" type="textarea"></el-input>
<el-button style="margin-top: 10px;" @click="fontchange(dataForm.content)" type="primary">文字转语音</el-button>
<el-button style="margin-top: 10px;" @click="fontchange(dataForm.content)" type="primary">文字转语音</el-button>
</el-form-item>
<el-form-item label="音频文件上传" prop="voices">
<el-upload class="upload-demo" action="http://localhost:9100/pb/oss/fileoss" :on-preview="handlePreview"
:on-remove="handleRemove" :on-success="handleVoicesSuccess" multiple :limit="3"
:file-list="fileListVoices">
:on-remove="handleRemove" :on-success="handleVoicesSuccess" multiple :limit="3" :file-list="fileListVoices">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
<audio controls="controls" hidden src="./static/audio/tsy.wav" ref="audio"></audio>
<audio id="resource" :src="dataForm.voices" controls autoplay="autoplay" v-show='true'></audio>
<audio controls="controls" hidden src="./static/audio/tsy.wav" ref="audio"></audio>
<audio id="resource" :src="dataForm.voices" controls v-show='true'></audio>
</el-form-item>
<!-- <el-form-item label="" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder=""></el-input>
@@ -30,6 +29,32 @@
<el-form-item label="" prop="updateTime">
<el-input v-model="dataForm.updateTime" placeholder=""></el-input>
</el-form-item> -->
<el-form-item label="图片表格" prop="otherContent">
<div class="mod-demo-ueditor">
<el-alert title="提示:" type="warning" :closable="false">
<div slot-scope="">
<p class="el-alert__description">1. 此Demo只提供UEditor官方使用文档入门部署和体验功能具体使用请参考http://fex.baidu.com/ueditor/
</p>
<p class="el-alert__description">2. 浏览器控制台报错请求后台配置项http错误上传功能将不能正常使用此错需要后台提供上传接口方法赋值给serverUrl属性
</p>
</div>
</el-alert>
<component :is="'script'" :id="ueId" class="ueditor-box" type="text/plain" style="width: 100%; height: 260px;">hello world!
</component>
<!-- 获取内容 -->
<p>
<el-button @click="getContent()">获得内容</el-button>
</p>
<el-dialog title="内容" :visible.sync="dialogVisible" :append-to-body="true">
{{ dataForm.otherContent }}
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</div>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
@@ -45,10 +70,15 @@
</template>
<script>
import ueditor from 'ueditor'
export default {
data() {
return {
visible: false,
ue: null,
ueId: `J_ueditorBox_${new Date().getTime()}`,
ueContent: '',
dialogVisible: false,
fileListVoices: [],
dataForm: {
id: 0,
@@ -57,6 +87,7 @@ export default {
number: '',
content: '',
voices: '',
otherContent:'',
createTime: '',
updateTime: '',
sort: '',
@@ -93,6 +124,9 @@ export default {
}
}
},
mounted(){
console.log(this.dataForm.otherContent)
},
methods: {
init(id) {
this.dataForm.id = id || 0
@@ -115,6 +149,13 @@ export default {
this.dataForm.updateTime = data.bookChapterContent.updateTime
this.dataForm.sort = data.bookChapterContent.sort
this.dataForm.delFlag = data.bookChapterContent.delFlag
this.dataForm.otherContent = data.bookChapterContent.otherContent
var uploadUrl = this.$http.adornUrl(`/ueditor/config?token=${this.$cookie.get('token')}`);
this.ue = ueditor.getEditor(this.ueId, {
serverUrl: uploadUrl, // 服务器统一请求接口路径
zIndex: 3000
})
this.setContentValue(this.dataForm.otherContent)
if (data.bookChapterContent.voices != "" && data.bookChapterContent.voices != null && data.bookChapterContent.voices != 'undefined') {
var voices = { name: '音频文件', url: data.bookChapterContent.voices }
@@ -132,6 +173,7 @@ export default {
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
this.getContent()
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/bookchaptercontent/${!this.dataForm.id ? 'save' : 'update'}`),
@@ -146,7 +188,8 @@ export default {
'createTime': this.dataForm.createTime,
'updateTime': this.dataForm.updateTime,
'sort': this.dataForm.sort,
'delFlag': this.dataForm.delFlag
'delFlag': this.dataForm.delFlag,
'otherContent':this.dataForm.otherContent
})
}).then(({ data }) => {
if (data && data.code === 0) {
@@ -185,25 +228,43 @@ export default {
},
handlereset() {
this.fileListVoices = [],
this.visible = false
this.visible = false,
this.setContentValue('')
},
fontchange(content){
this.$http({
url: this.$http.adornUrl('/book/bookchaptercontent/signVoices'),
method: 'get',
params: this.$http.adornParams({
'content':content
})
}).then(res => {
fontchange(content) {
this.$http({
url: this.$http.adornUrl('/book/bookchaptercontent/signVoices'),
method: 'get',
params: this.$http.adornParams({
'content': content
})
}).then(res => {
this.$message({
message: '成功',
type: 'success'
})
this.loading = false
this.dataForm.voices = res.data.voices
var voices = { name: '音频文件', url: res.data.voices }
var attr = []
attr.push(voices)
this.fileListVoices = attr
console.log(res)
})
}
},
// 富文本内容赋值
setContentValue(data) {
let vm = this
this.ue.ready(function () {
vm.ue.setContent(data)
})
},
getContent() {
this.dialogVisible = true
this.ue.ready(() => {
this.dataForm.otherContent = this.ue.getContent()
})
},
}
}
</script>

View File

@@ -0,0 +1,156 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="用户id" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户id"></el-input>
</el-form-item>
<el-form-item label="图书id" prop="bookId">
<el-input v-model="dataForm.bookId" placeholder="图书id"></el-input>
</el-form-item>
<el-form-item label="章节id" prop="chapterId">
<el-input v-model="dataForm.chapterId" placeholder="章节id"></el-input>
</el-form-item>
<el-form-item label="章节名称" prop="chapterName">
<el-input v-model="dataForm.chapterName" placeholder="章节名称"></el-input>
</el-form-item>
<el-form-item label="章节内容id" prop="contentId">
<el-input v-model="dataForm.contentId" placeholder="章节内容id"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item>
<el-form-item label="" prop="sort">
<el-input v-model="dataForm.sort" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder=""></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
userId: '',
bookId: '',
chapterId: '',
chapterName: '',
contentId: '',
createTime: '',
updateTime: '',
sort: '',
delFlag: ''
},
dataRule: {
userId: [
{ required: true, message: '用户id不能为空', trigger: 'blur' }
],
bookId: [
{ required: true, message: '图书id不能为空', trigger: 'blur' }
],
chapterId: [
{ required: true, message: '章节id不能为空', trigger: 'blur' }
],
chapterName: [
{ required: true, message: '章节名称不能为空', trigger: 'blur' }
],
contentId: [
{ required: true, message: '章节内容id不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
updateTime: [
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
delFlag: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/book/bookreadrate/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.userId = data.bookReadRate.userId
this.dataForm.bookId = data.bookReadRate.bookId
this.dataForm.chapterId = data.bookReadRate.chapterId
this.dataForm.chapterName = data.bookReadRate.chapterName
this.dataForm.contentId = data.bookReadRate.contentId
this.dataForm.createTime = data.bookReadRate.createTime
this.dataForm.updateTime = data.bookReadRate.updateTime
this.dataForm.sort = data.bookReadRate.sort
this.dataForm.delFlag = data.bookReadRate.delFlag
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/bookreadrate/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'userId': this.dataForm.userId,
'bookId': this.dataForm.bookId,
'chapterId': this.dataForm.chapterId,
'chapterName': this.dataForm.chapterName,
'contentId': this.dataForm.contentId,
'createTime': this.dataForm.createTime,
'updateTime': this.dataForm.updateTime,
'sort': this.dataForm.sort,
'delFlag': this.dataForm.delFlag
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,211 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:bookreadrate:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:bookreadrate:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="用户id">
</el-table-column>
<el-table-column
prop="bookId"
header-align="center"
align="center"
label="图书id">
</el-table-column>
<el-table-column
prop="chapterId"
header-align="center"
align="center"
label="章节id">
</el-table-column>
<el-table-column
prop="chapterName"
header-align="center"
align="center"
label="章节名称">
</el-table-column>
<el-table-column
prop="contentId"
header-align="center"
align="center"
label="章节内容id">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="delFlag"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './bookreadrate-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/bookreadrate/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/bookreadrate/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -0,0 +1,138 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="" prop="bookId">
<el-input v-model="dataForm.bookId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="书名" prop="bookName">
<el-input v-model="dataForm.bookName" placeholder="书名"></el-input>
</el-form-item>
<el-form-item label="" prop="userId">
<el-input v-model="dataForm.userId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="updateTime">
<el-input v-model="dataForm.updateTime" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="sort">
<el-input v-model="dataForm.sort" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder=""></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
bookId: '',
bookName: '',
userId: '',
createTime: '',
updateTime: '',
sort: '',
delFlag: ''
},
dataRule: {
bookId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
bookName: [
{ required: true, message: '书名不能为空', trigger: 'blur' }
],
userId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
updateTime: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
sort: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
delFlag: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/book/bookshelf/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.bookId = data.bookShelf.bookId
this.dataForm.bookName = data.bookShelf.bookName
this.dataForm.userId = data.bookShelf.userId
this.dataForm.createTime = data.bookShelf.createTime
this.dataForm.updateTime = data.bookShelf.updateTime
this.dataForm.sort = data.bookShelf.sort
this.dataForm.delFlag = data.bookShelf.delFlag
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/bookshelf/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'bookId': this.dataForm.bookId,
'bookName': this.dataForm.bookName,
'userId': this.dataForm.userId,
'createTime': this.dataForm.createTime,
'updateTime': this.dataForm.updateTime,
'sort': this.dataForm.sort,
'delFlag': this.dataForm.delFlag
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,199 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:bookshelf:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:bookshelf:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="bookId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="bookName"
header-align="center"
align="center"
label="书名">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="delFlag"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './bookshelf-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/bookshelf/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/bookshelf/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -0,0 +1,237 @@
<template>
<el-dialog
:title="!dataForm.orderId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="订单编号" prop="orderSn">
<el-input v-model="dataForm.orderSn" placeholder="订单编号"></el-input>
</el-form-item>
<el-form-item label="下单人ID" prop="userId">
<el-input v-model="dataForm.userId" placeholder="下单人ID"></el-input>
</el-form-item>
<el-form-item label="收货人姓名" prop="shippingUser">
<el-input v-model="dataForm.shippingUser" placeholder="收货人姓名"></el-input>
</el-form-item>
<el-form-item label="省" prop="province">
<el-input v-model="dataForm.province" placeholder="省"></el-input>
</el-form-item>
<el-form-item label="市" prop="city">
<el-input v-model="dataForm.city" placeholder="市"></el-input>
</el-form-item>
<el-form-item label="区" prop="district">
<el-input v-model="dataForm.district" placeholder="区"></el-input>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="dataForm.address" placeholder="地址"></el-input>
</el-form-item>
<el-form-item label="支付方式">
<el-input v-model="dataForm.paymentMethod" placeholder="支付方式"></el-input>
</el-form-item>
<el-form-item label="订单金额" prop="orderMoney">
<el-input v-model="dataForm.orderMoney" placeholder="订单金额"></el-input>
</el-form-item>
<el-form-item label="优惠金额" prop="districtMoney">
<el-input v-model="dataForm.districtMoney" placeholder="优惠金额"></el-input>
</el-form-item>
<el-form-item label="实收金额" prop="realMoney">
<el-input v-model="dataForm.realMoney" placeholder="实收金额"></el-input>
</el-form-item>
<el-form-item label="运费" prop="shippingMoney">
<el-input v-model="dataForm.shippingMoney" placeholder="运费"></el-input>
</el-form-item>
<el-form-item label="物流公司名称" prop="shippingCompName">
<el-input v-model="dataForm.shippingCompName" placeholder="物流公司名称"></el-input>
</el-form-item>
<el-form-item label="物流单号" prop="shippingSn">
<el-input v-model="dataForm.shippingSn" placeholder="物流单号"></el-input>
</el-form-item>
<el-form-item label="下单时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="下单时间"></el-input>
</el-form-item>
<el-form-item label="发货时间" prop="shippingTime">
<el-input v-model="dataForm.shippingTime" placeholder="发货时间"></el-input>
</el-form-item>
<el-form-item label="订单状态" prop="orderStatus">
<el-input v-model="dataForm.orderStatus" placeholder="订单状态"></el-input>
</el-form-item>
<el-form-item label="交易成功时间" prop="successTime">
<el-input v-model="dataForm.successTime" placeholder="交易成功时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
orderId: 0,
orderSn: '',
userId: '',
shippingUser: '',
province: '',
city: '',
district: '',
address: '',
paymentMethod: '',
orderMoney: '',
districtMoney: '',
realMoney: '',
shippingMoney: '',
shippingCompName: '',
shippingSn: '',
createTime: '',
shippingTime: '',
orderStatus: '',
successTime: ''
},
dataRule: {
orderSn: [
{ required: true, message: '订单编号 yyyymmddnnnnnnnn不能为空', trigger: 'blur' }
],
userId: [
{ required: true, message: '下单人ID不能为空', trigger: 'blur' }
],
shippingUser: [
{ required: true, message: '收货人姓名不能为空', trigger: 'blur' }
],
province: [
{ required: true, message: '省不能为空', trigger: 'blur' }
],
city: [
{ required: true, message: '市不能为空', trigger: 'blur' }
],
district: [
{ required: true, message: '区不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '地址不能为空', trigger: 'blur' }
],
paymentMethod: [
{ required: true, message: '支付方式 1支付宝2微信3ios内购不能为空', trigger: 'blur' }
],
orderMoney: [
{ required: true, message: '订单金额不能为空', trigger: 'blur' }
],
districtMoney: [
{ required: true, message: '优惠金额不能为空', trigger: 'blur' }
],
realMoney: [
{ required: true, message: '实收金额不能为空', trigger: 'blur' }
],
shippingMoney: [
{ required: true, message: '运费不能为空', trigger: 'blur' }
],
shippingCompName: [
{ required: true, message: '物流公司名称不能为空', trigger: 'blur' }
],
shippingSn: [
{ required: true, message: '物流单号不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '下单时间不能为空', trigger: 'blur' }
],
shippingTime: [
{ required: true, message: '发货时间不能为空', trigger: 'blur' }
],
orderStatus: [
{ required: true, message: '订单状态不能为空', trigger: 'blur' }
],
successTime: [
{ required: true, message: '交易成功时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.orderId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.orderId) {
this.$http({
url: this.$http.adornUrl(`/book/buyorder/info/${this.dataForm.orderId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.orderSn = data.buyOrder.orderSn
this.dataForm.userId = data.buyOrder.userId
this.dataForm.shippingUser = data.buyOrder.shippingUser
this.dataForm.province = data.buyOrder.province
this.dataForm.city = data.buyOrder.city
this.dataForm.district = data.buyOrder.district
this.dataForm.address = data.buyOrder.address
this.dataForm.paymentMethod = data.buyOrder.paymentMethod
this.dataForm.orderMoney = data.buyOrder.orderMoney
this.dataForm.districtMoney = data.buyOrder.districtMoney
this.dataForm.realMoney = data.buyOrder.realMoney
this.dataForm.shippingMoney = data.buyOrder.shippingMoney
this.dataForm.shippingCompName = data.buyOrder.shippingCompName
this.dataForm.shippingSn = data.buyOrder.shippingSn
this.dataForm.createTime = data.buyOrder.createTime
this.dataForm.shippingTime = data.buyOrder.shippingTime
this.dataForm.orderStatus = data.buyOrder.orderStatus
this.dataForm.successTime = data.buyOrder.successTime
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/buyorder/${!this.dataForm.orderId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'orderId': this.dataForm.orderId || undefined,
'orderSn': this.dataForm.orderSn,
'userId': this.dataForm.userId,
'shippingUser': this.dataForm.shippingUser,
'province': this.dataForm.province,
'city': this.dataForm.city,
'district': this.dataForm.district,
'address': this.dataForm.address,
'paymentMethod': this.dataForm.paymentMethod,
'orderMoney': this.dataForm.orderMoney,
'districtMoney': this.dataForm.districtMoney,
'realMoney': this.dataForm.realMoney,
'shippingMoney': this.dataForm.shippingMoney,
'shippingCompName': this.dataForm.shippingCompName,
'shippingSn': this.dataForm.shippingSn,
'createTime': this.dataForm.createTime,
'shippingTime': this.dataForm.shippingTime,
'orderStatus': this.dataForm.orderStatus,
'successTime': this.dataForm.successTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,198 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:buyorder:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:buyorder:delete')" type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50">
</el-table-column>
<el-table-column label="序号" width="70" align="center">
<template slot-scope="scope">
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="orderSn" header-align="center" align="center" label="订单编号">
</el-table-column>
<el-table-column prop="userId" header-align="center" align="center" label="下单人姓名">
</el-table-column>
<!-- <el-table-column
prop="shippingUser"
header-align="center"
align="center"
label="收货人姓名">
</el-table-column>
<el-table-column
prop="province"
header-align="center"
align="center"
label="省">
</el-table-column>
<el-table-column
prop="city"
header-align="center"
align="center"
label="市">
</el-table-column>
<el-table-column
prop="district"
header-align="center"
align="center"
label="区">
</el-table-column>
<el-table-column
prop="address"
header-align="center"
align="center"
label="地址">
</el-table-column> -->
<el-table-column prop="paymentMethod" header-align="center" align="center" label="支付方式">
</el-table-column>
<el-table-column prop="orderMoney" header-align="center" align="center" label="订单金额">
</el-table-column>
<el-table-column prop="districtMoney" header-align="center" align="center" label="优惠金额">
</el-table-column>
<el-table-column prop="realMoney" header-align="center" align="center" label="实收金额">
</el-table-column>
<el-table-column prop="shippingMoney" header-align="center" align="center" label="运费">
</el-table-column>
<el-table-column prop="shippingCompName" header-align="center" align="center" label="物流公司名称">
</el-table-column>
<el-table-column prop="shippingSn" header-align="center" align="center" label="物流单号">
</el-table-column>
<el-table-column prop="createTime" header-align="center" align="center" label="下单时间">
</el-table-column>
<el-table-column prop="shippingTime" header-align="center" align="center" label="发货时间">
</el-table-column>
<el-table-column prop="orderStatus" header-align="center" align="center" label="订单状态">
</el-table-column>
<el-table-column prop="successTime" header-align="center" align="center" label="交易成功时间">
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<router-link :to="{ path: 'order-buyorderdetail', query: { orderId: scope.row.orderId } }">
<el-button type="text" size="small">购买商品详情</el-button>
</router-link>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.orderId)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.orderId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './buyorder-add-or-update'
export default {
data() {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/buyorder/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.orderId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/buyorder/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -0,0 +1,155 @@
<template>
<el-dialog
:title="!dataForm.allOrderId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="订单表id" prop="orderId">
<el-input v-model="dataForm.orderId" placeholder="订单表id"></el-input>
</el-form-item>
<el-form-item label="用户id" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户id"></el-input>
</el-form-item>
<el-form-item label="商品id" prop="productId">
<el-input v-model="dataForm.productId" placeholder="商品id"></el-input>
</el-form-item>
<el-form-item label="商品名称" prop="productName">
<el-input v-model="dataForm.productName" placeholder="商品名称"></el-input>
</el-form-item>
<el-form-item label="商品数量" prop="quantity">
<el-input v-model="dataForm.quantity" placeholder="商品数量"></el-input>
</el-form-item>
<el-form-item label="商品单价" prop="productPrice">
<el-input v-model="dataForm.productPrice" placeholder="商品单价"></el-input>
</el-form-item>
<el-form-item label="商品重量" prop="weight">
<el-input v-model="dataForm.weight" placeholder="商品重量"></el-input>
</el-form-item>
<el-form-item label="商品类型" prop="productType">
<el-input v-model="dataForm.productType" placeholder="商品类型"></el-input>
</el-form-item>
<el-form-item label="下单时间" prop="creatTime">
<el-input v-model="dataForm.creatTime" placeholder="下单时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
allOrderId: 0,
orderId: '',
userId: '',
productId: '',
productName: '',
quantity: '',
productPrice: '',
weight: '',
productType: '',
creatTime: '' },
dataRule: {
orderId: [
{ required: true, message: '订单表id不能为空', trigger: 'blur' }
],
userId: [
{ required: true, message: '用户id不能为空', trigger: 'blur' }
],
productId: [
{ required: true, message: '商品id不能为空', trigger: 'blur' }
],
productName: [
{ required: true, message: '商品名称不能为空', trigger: 'blur' }
],
quantity: [
{ required: true, message: '商品数量不能为空', trigger: 'blur' }
],
productPrice: [
{ required: true, message: '商品单价不能为空', trigger: 'blur' }
],
weight: [
{ required: true, message: '商品重量不能为空', trigger: 'blur' }
],
productType: [
{ required: true, message: '商品类型不能为空', trigger: 'blur' }
],
creatTime: [
{ required: true, message: '下单时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.allOrderId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.allOrderId) {
this.$http({
url: this.$http.adornUrl(`/book/buyorderdetail/info/${this.dataForm.allOrderId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.orderId = data.buyOrderDetail.orderId
this.dataForm.userId = data.buyOrderDetail.userId
this.dataForm.productId = data.buyOrderDetail.productId
this.dataForm.productName = data.buyOrderDetail.productName
this.dataForm.quantity = data.buyOrderDetail.quantity
this.dataForm.productPrice = data.buyOrderDetail.productPrice
this.dataForm.weight = data.buyOrderDetail.weight
this.dataForm.productType = data.buyOrderDetail.productType
this.dataForm.creatTime = data.buyOrderDetail.creatTime
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/buyorderdetail/${!this.dataForm.allOrderId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'allOrderId': this.dataForm.allOrderId || undefined,
'orderId': this.dataForm.orderId,
'userId': this.dataForm.userId,
'productId': this.dataForm.productId,
'productName': this.dataForm.productName,
'quantity': this.dataForm.quantity,
'productPrice': this.dataForm.productPrice,
'weight': this.dataForm.weight,
'productType': this.dataForm.productType,
'creatTime': this.dataForm.creatTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,217 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:buyorderdetail:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:buyorderdetail:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="allOrderId"
header-align="center"
align="center"
label="订单详情id">
</el-table-column>
<el-table-column
prop="orderId"
header-align="center"
align="center"
label="订单表id">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="用户id">
</el-table-column>
<el-table-column
prop="productId"
header-align="center"
align="center"
label="商品id">
</el-table-column>
<el-table-column
prop="productName"
header-align="center"
align="center"
label="商品名称">
</el-table-column>
<el-table-column
prop="quantity"
header-align="center"
align="center"
label="商品数量">
</el-table-column>
<el-table-column
prop="productPrice"
header-align="center"
align="center"
label="商品单价">
</el-table-column>
<el-table-column
prop="weight"
header-align="center"
align="center"
label="商品重量">
</el-table-column>
<el-table-column
prop="productType"
header-align="center"
align="center"
label="商品类型">
</el-table-column>
<el-table-column
prop="creatTime"
header-align="center"
align="center"
label="下单时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.allOrderId)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.allOrderId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './buyorderdetail-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
query:{
orderId:0
}
}
},
components: {
AddOrUpdate
},
activated () {
this.query.orderId = this.$route.query.orderId;
console.log(this.$route.query.orderId)
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/buyorderdetail/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'orderId': this.query.orderId,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.allOrderId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/buyorderdetail/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -0,0 +1,129 @@
<template>
<el-dialog
:title="!dataForm.cartId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="用户id" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户id"></el-input>
</el-form-item>
<el-form-item label="商品id" prop="productId">
<el-input v-model="dataForm.productId" placeholder="商品id"></el-input>
</el-form-item>
<el-form-item label="商品数量" prop="productAmount">
<el-input v-model="dataForm.productAmount" placeholder="商品数量"></el-input>
</el-form-item>
<el-form-item label="商品单价" prop="price">
<el-input v-model="dataForm.price" placeholder="商品单价"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
cartId: 0,
userId: '',
productId: '',
productAmount: '',
price: '',
createTime: '',
updateTime: ''
},
dataRule: {
userId: [
{ required: true, message: '用户id不能为空', trigger: 'blur' }
],
productId: [
{ required: true, message: '商品id不能为空', trigger: 'blur' }
],
productAmount: [
{ required: true, message: '商品数量不能为空', trigger: 'blur' }
],
price: [
{ required: true, message: '商品单价不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
updateTime: [
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.cartId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.cartId) {
this.$http({
url: this.$http.adornUrl(`/book/ordercart/info/${this.dataForm.cartId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.userId = data.orderCart.userId
this.dataForm.productId = data.orderCart.productId
this.dataForm.productAmount = data.orderCart.productAmount
this.dataForm.price = data.orderCart.price
this.dataForm.createTime = data.orderCart.createTime
this.dataForm.updateTime = data.orderCart.updateTime
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/ordercart/${!this.dataForm.cartId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'cartId': this.dataForm.cartId || undefined,
'userId': this.dataForm.userId,
'productId': this.dataForm.productId,
'productAmount': this.dataForm.productAmount,
'price': this.dataForm.price,
'createTime': this.dataForm.createTime,
'updateTime': this.dataForm.updateTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,193 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:ordercart:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:ordercart:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="cartId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="用户id">
</el-table-column>
<el-table-column
prop="productId"
header-align="center"
align="center"
label="商品id">
</el-table-column>
<el-table-column
prop="productAmount"
header-align="center"
align="center"
label="商品数量">
</el-table-column>
<el-table-column
prop="price"
header-align="center"
align="center"
label="商品单价">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.cartId)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.cartId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './ordercart-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/ordercart/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.cartId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/ordercart/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -0,0 +1,147 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="用户id" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户id"></el-input>
</el-form-item>
<el-form-item label="充值金额" prop="rechargeAmount">
<el-input v-model="dataForm.rechargeAmount" placeholder="充值金额"></el-input>
</el-form-item>
<el-form-item label="充值渠道" prop="rechargeChannel">
<el-input v-model="dataForm.rechargeChannel" placeholder="充值渠道"></el-input>
</el-form-item>
<el-form-item label="订单号" prop="orderId">
<el-input v-model="dataForm.orderId" placeholder="订单号"></el-input>
</el-form-item>
<el-form-item label="实际充值金额" prop="realAmount">
<el-input v-model="dataForm.realAmount" placeholder="实际充值金额"></el-input>
</el-form-item>
<el-form-item label="充值状态" prop="rechargeStatus">
<el-input v-model="dataForm.rechargeStatus" placeholder="充值状态"></el-input>
</el-form-item>
<el-form-item label="下单时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="下单时间"></el-input>
</el-form-item>
<el-form-item label="支付成功时间" prop="successTime">
<el-input v-model="dataForm.successTime" placeholder="支付成功时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
userId: '',
rechargeAmount: '',
rechargeChannel: '',
orderId: '',
realAmount: '',
rechargeStatus: '',
createTime: '',
successTime: ''
},
dataRule: {
userId: [
{ required: true, message: '用户id不能为空', trigger: 'blur' }
],
rechargeAmount: [
{ required: true, message: '充值金额不能为空', trigger: 'blur' }
],
rechargeChannel: [
{ required: true, message: '充值渠道不能为空', trigger: 'blur' }
],
orderId: [
{ required: true, message: '订单号不能为空', trigger: 'blur' }
],
realAmount: [
{ required: true, message: '实际充值金额不能为空', trigger: 'blur' }
],
rechargeStatus: [
{ required: true, message: '充值状态不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '下单时间不能为空', trigger: 'blur' }
],
successTime: [
{ required: true, message: '支付成功时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/book/paypaymentorder/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.userId = data.payPaymentOrder.userId
this.dataForm.rechargeAmount = data.payPaymentOrder.rechargeAmount
this.dataForm.rechargeChannel = data.payPaymentOrder.rechargeChannel
this.dataForm.orderId = data.payPaymentOrder.orderId
this.dataForm.realAmount = data.payPaymentOrder.realAmount
this.dataForm.rechargeStatus = data.payPaymentOrder.rechargeStatus
this.dataForm.createTime = data.payPaymentOrder.createTime
this.dataForm.successTime = data.payPaymentOrder.successTime
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/paypaymentorder/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'userId': this.dataForm.userId,
'rechargeAmount': this.dataForm.rechargeAmount,
'rechargeChannel': this.dataForm.rechargeChannel,
'orderId': this.dataForm.orderId,
'realAmount': this.dataForm.realAmount,
'rechargeStatus': this.dataForm.rechargeStatus,
'createTime': this.dataForm.createTime,
'successTime': this.dataForm.successTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,205 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:paypaymentorder:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:paypaymentorder:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="用户id">
</el-table-column>
<el-table-column
prop="rechargeAmount"
header-align="center"
align="center"
label="充值金额">
</el-table-column>
<el-table-column
prop="rechargeChannel"
header-align="center"
align="center"
label="充值渠道">
</el-table-column>
<el-table-column
prop="orderId"
header-align="center"
align="center"
label="订单号">
</el-table-column>
<el-table-column
prop="realAmount"
header-align="center"
align="center"
label="实际充值金额">
</el-table-column>
<el-table-column
prop="rechargeStatus"
header-align="center"
align="center"
label="充值状态">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="下单时间">
</el-table-column>
<el-table-column
prop="successTime"
header-align="center"
align="center"
label="支付成功时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './paypaymentorder-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/paypaymentorder/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/paypaymentorder/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -0,0 +1,372 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="" prop="customerid">
<el-input v-model="dataForm.customerid" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="outTradeNo">
<el-input v-model="dataForm.outTradeNo" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="tradeNo">
<el-input v-model="dataForm.tradeNo" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="notifyTime">
<el-input v-model="dataForm.notifyTime" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="notifyType">
<el-input v-model="dataForm.notifyType" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="notifyId">
<el-input v-model="dataForm.notifyId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="appId">
<el-input v-model="dataForm.appId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="authAppId">
<el-input v-model="dataForm.authAppId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="charset">
<el-input v-model="dataForm.charset" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="version">
<el-input v-model="dataForm.version" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="signType">
<el-input v-model="dataForm.signType" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="sign">
<el-input v-model="dataForm.sign" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="outBizNo">
<el-input v-model="dataForm.outBizNo" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="buyerId">
<el-input v-model="dataForm.buyerId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="buyerLogonId">
<el-input v-model="dataForm.buyerLogonId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="sellerId">
<el-input v-model="dataForm.sellerId" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="sellerEmail">
<el-input v-model="dataForm.sellerEmail" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="tradeStatus">
<el-input v-model="dataForm.tradeStatus" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="totalAmount">
<el-input v-model="dataForm.totalAmount" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="receiptAmount">
<el-input v-model="dataForm.receiptAmount" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="invoiceAmount">
<el-input v-model="dataForm.invoiceAmount" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="buyerPayAmount">
<el-input v-model="dataForm.buyerPayAmount" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="pointAmount">
<el-input v-model="dataForm.pointAmount" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="refundFee">
<el-input v-model="dataForm.refundFee" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="subject">
<el-input v-model="dataForm.subject" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="body">
<el-input v-model="dataForm.body" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="gmtCreate">
<el-input v-model="dataForm.gmtCreate" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="gmtPayment">
<el-input v-model="dataForm.gmtPayment" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="gmtRefund">
<el-input v-model="dataForm.gmtRefund" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="gmtClose">
<el-input v-model="dataForm.gmtClose" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="fundBillList">
<el-input v-model="dataForm.fundBillList" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="voucherDetailList">
<el-input v-model="dataForm.voucherDetailList" placeholder=""></el-input>
</el-form-item>
<el-form-item label="" prop="relevanceoid">
<el-input v-model="dataForm.relevanceoid" placeholder=""></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
customerid: '',
outTradeNo: '',
tradeNo: '',
notifyTime: '',
notifyType: '',
notifyId: '',
appId: '',
authAppId: '',
charset: '',
version: '',
signType: '',
sign: '',
outBizNo: '',
buyerId: '',
buyerLogonId: '',
sellerId: '',
sellerEmail: '',
tradeStatus: '',
totalAmount: '',
receiptAmount: '',
invoiceAmount: '',
buyerPayAmount: '',
pointAmount: '',
refundFee: '',
subject: '',
body: '',
gmtCreate: '',
gmtPayment: '',
gmtRefund: '',
gmtClose: '',
fundBillList: '',
voucherDetailList: '',
relevanceoid: ''
},
dataRule: {
customerid: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
outTradeNo: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
tradeNo: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
notifyTime: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
notifyType: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
notifyId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
appId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
authAppId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
charset: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
version: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
signType: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
sign: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
outBizNo: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
buyerId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
buyerLogonId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
sellerId: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
sellerEmail: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
tradeStatus: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
totalAmount: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
receiptAmount: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
invoiceAmount: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
buyerPayAmount: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
pointAmount: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
refundFee: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
subject: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
body: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
gmtCreate: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
gmtPayment: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
gmtRefund: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
gmtClose: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
fundBillList: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
voucherDetailList: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
relevanceoid: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/book/payzfborder/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.customerid = data.payZfbOrder.customerid
this.dataForm.outTradeNo = data.payZfbOrder.outTradeNo
this.dataForm.tradeNo = data.payZfbOrder.tradeNo
this.dataForm.notifyTime = data.payZfbOrder.notifyTime
this.dataForm.notifyType = data.payZfbOrder.notifyType
this.dataForm.notifyId = data.payZfbOrder.notifyId
this.dataForm.appId = data.payZfbOrder.appId
this.dataForm.authAppId = data.payZfbOrder.authAppId
this.dataForm.charset = data.payZfbOrder.charset
this.dataForm.version = data.payZfbOrder.version
this.dataForm.signType = data.payZfbOrder.signType
this.dataForm.sign = data.payZfbOrder.sign
this.dataForm.outBizNo = data.payZfbOrder.outBizNo
this.dataForm.buyerId = data.payZfbOrder.buyerId
this.dataForm.buyerLogonId = data.payZfbOrder.buyerLogonId
this.dataForm.sellerId = data.payZfbOrder.sellerId
this.dataForm.sellerEmail = data.payZfbOrder.sellerEmail
this.dataForm.tradeStatus = data.payZfbOrder.tradeStatus
this.dataForm.totalAmount = data.payZfbOrder.totalAmount
this.dataForm.receiptAmount = data.payZfbOrder.receiptAmount
this.dataForm.invoiceAmount = data.payZfbOrder.invoiceAmount
this.dataForm.buyerPayAmount = data.payZfbOrder.buyerPayAmount
this.dataForm.pointAmount = data.payZfbOrder.pointAmount
this.dataForm.refundFee = data.payZfbOrder.refundFee
this.dataForm.subject = data.payZfbOrder.subject
this.dataForm.body = data.payZfbOrder.body
this.dataForm.gmtCreate = data.payZfbOrder.gmtCreate
this.dataForm.gmtPayment = data.payZfbOrder.gmtPayment
this.dataForm.gmtRefund = data.payZfbOrder.gmtRefund
this.dataForm.gmtClose = data.payZfbOrder.gmtClose
this.dataForm.fundBillList = data.payZfbOrder.fundBillList
this.dataForm.voucherDetailList = data.payZfbOrder.voucherDetailList
this.dataForm.relevanceoid = data.payZfbOrder.relevanceoid
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/payzfborder/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'customerid': this.dataForm.customerid,
'outTradeNo': this.dataForm.outTradeNo,
'tradeNo': this.dataForm.tradeNo,
'notifyTime': this.dataForm.notifyTime,
'notifyType': this.dataForm.notifyType,
'notifyId': this.dataForm.notifyId,
'appId': this.dataForm.appId,
'authAppId': this.dataForm.authAppId,
'charset': this.dataForm.charset,
'version': this.dataForm.version,
'signType': this.dataForm.signType,
'sign': this.dataForm.sign,
'outBizNo': this.dataForm.outBizNo,
'buyerId': this.dataForm.buyerId,
'buyerLogonId': this.dataForm.buyerLogonId,
'sellerId': this.dataForm.sellerId,
'sellerEmail': this.dataForm.sellerEmail,
'tradeStatus': this.dataForm.tradeStatus,
'totalAmount': this.dataForm.totalAmount,
'receiptAmount': this.dataForm.receiptAmount,
'invoiceAmount': this.dataForm.invoiceAmount,
'buyerPayAmount': this.dataForm.buyerPayAmount,
'pointAmount': this.dataForm.pointAmount,
'refundFee': this.dataForm.refundFee,
'subject': this.dataForm.subject,
'body': this.dataForm.body,
'gmtCreate': this.dataForm.gmtCreate,
'gmtPayment': this.dataForm.gmtPayment,
'gmtRefund': this.dataForm.gmtRefund,
'gmtClose': this.dataForm.gmtClose,
'fundBillList': this.dataForm.fundBillList,
'voucherDetailList': this.dataForm.voucherDetailList,
'relevanceoid': this.dataForm.relevanceoid
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,355 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:payzfborder:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:payzfborder:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="customerid"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="outTradeNo"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="tradeNo"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="notifyTime"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="notifyType"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="notifyId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="appId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="authAppId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="charset"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="signType"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="sign"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="outBizNo"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="buyerId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="buyerLogonId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="sellerId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="sellerEmail"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="tradeStatus"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="totalAmount"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="receiptAmount"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="invoiceAmount"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="buyerPayAmount"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="pointAmount"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="refundFee"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="subject"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="body"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="gmtCreate"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="gmtPayment"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="gmtRefund"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="gmtClose"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="fundBillList"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="voucherDetailList"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="relevanceoid"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './payzfborder-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/payzfborder/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/payzfborder/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -0,0 +1,129 @@
<template>
<el-dialog
:title="!dataForm.transactionId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="用户id" prop="userId">
<el-input v-model="dataForm.userId" placeholder="用户id"></el-input>
</el-form-item>
<el-form-item label="充值 支付 赠送优惠券....." prop="orderType">
<el-input v-model="dataForm.orderType" placeholder="充值 支付 赠送优惠券....."></el-input>
</el-form-item>
<el-form-item label="变动金额" prop="changeAmount">
<el-input v-model="dataForm.changeAmount" placeholder="变动金额"></el-input>
</el-form-item>
<el-form-item label="关联id" prop="relationId">
<el-input v-model="dataForm.relationId" placeholder="关联id"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="余额" prop="userBalance">
<el-input v-model="dataForm.userBalance" placeholder="余额"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
transactionId: 0,
userId: '',
orderType: '',
changeAmount: '',
relationId: '',
remark: '',
userBalance: ''
},
dataRule: {
userId: [
{ required: true, message: '用户id不能为空', trigger: 'blur' }
],
orderType: [
{ required: true, message: '充值 支付 赠送优惠券.....不能为空', trigger: 'blur' }
],
changeAmount: [
{ required: true, message: '变动金额不能为空', trigger: 'blur' }
],
relationId: [
{ required: true, message: '关联id不能为空', trigger: 'blur' }
],
remark: [
{ required: true, message: '备注不能为空', trigger: 'blur' }
],
userBalance: [
{ required: true, message: '余额不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.transactionId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.transactionId) {
this.$http({
url: this.$http.adornUrl(`/book/transactiondetails/info/${this.dataForm.transactionId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.userId = data.transactionDetails.userId
this.dataForm.orderType = data.transactionDetails.orderType
this.dataForm.changeAmount = data.transactionDetails.changeAmount
this.dataForm.relationId = data.transactionDetails.relationId
this.dataForm.remark = data.transactionDetails.remark
this.dataForm.userBalance = data.transactionDetails.userBalance
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/transactiondetails/${!this.dataForm.transactionId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'transactionId': this.dataForm.transactionId || undefined,
'userId': this.dataForm.userId,
'orderType': this.dataForm.orderType,
'changeAmount': this.dataForm.changeAmount,
'relationId': this.dataForm.relationId,
'remark': this.dataForm.remark,
'userBalance': this.dataForm.userBalance
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,193 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:transactiondetails:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:transactiondetails:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="transactionId"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
label="用户id">
</el-table-column>
<el-table-column
prop="orderType"
header-align="center"
align="center"
label="充值 支付 赠送优惠券.....">
</el-table-column>
<el-table-column
prop="changeAmount"
header-align="center"
align="center"
label="变动金额">
</el-table-column>
<el-table-column
prop="relationId"
header-align="center"
align="center"
label="关联id">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="userBalance"
header-align="center"
align="center"
label="余额">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.transactionId)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.transactionId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './transactiondetails-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/transactiondetails/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.transactionId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/transactiondetails/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>

View File

@@ -0,0 +1,170 @@
<template>
<div>
<el-tree :data="menus" :props="defaultProps" @node-click="handleNodeClick" show-checkbox node-key="catId"
:default-expanded-keys="expandedkey" :expand-on-click-node="false">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span>
<el-button v-if="node.level <= 2" type="text" size="mini" @click="() => append(data)">
Append
</el-button>
<el-button type="text" size="mini" @click="() => edit(data)">
edit
</el-button>
<el-button v-if="node.childNodes.length == 0" type="text" size="mini" @click="() => remove(node, data)">
Delete
</el-button>
</span>
</span>
</el-tree>
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="30%"
>
<el-form :model="category">
<el-form-item label="分类目录">
<el-input v-model="category.name" 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="submitData"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { SSL_OP_NO_TLSv1_1 } from 'constants'
export default {
data() {
return {
category:{name:"", parentCid: 0, catLevel: 0, showStatus: 1, sort: 0 ,catId: null},
dialogVisible:false,
dialogType:"",
menus: [],
title:'',
expandedkey: [],
defaultProps: {
children: 'children',
label: 'name'
}
}
},
created() {
this.getTreeList()
},
methods: {
handleNodeClick(data) {
console.log(data)
},
addLevel(){
console.log("提交的三级分类数据",this.category)
this.$http({
url: this.$http.adornUrl(`/book/shopcategory/save`),
method: 'post',
data: this.$http.adornData(this.category, false)
}).then(({ data }) => {
this.$message({
type: 'success',
message: '目录添加成功!'
});
this.dialogVisible = false
this.getTreeList()
this.expandedkey = [this.category.parentCid]
this.category = {}
})
},
getTreeList() {
this.$http({
url: this.$http.adornUrl(`/book/shopcategory/listTree`),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
this.menus = data.data;
})
},
append(data) {
this.dialogVisible = true
this.dialogType = 'add'
this.title = '添加分类'
this.category.parentCid = data.catId
this.category.showStatus = data.showStatus
this.category.catLevel = data.catLevel*1 + 1
},
edit(data){
this.dialogVisible = true
this.dialogType = 'edit'
this.title = '修改分类'
this.$http({
url: this.$http.adornUrl(`/book/shopcategory/info/${data.catId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
this.category.name = data.shopCategory.name
this.category.catId = data.shopCategory.catId
this.category.parentCid = data.shopCategory.parentCid
this.category.catLevel = data.shopCategory.catLevel
})
},
submitData(){
console.log(this.dialogType)
if(this.dialogType == 'add'){
this.addLevel()
}
if(this.dialogType == 'edit'){
this.editData()
}
},
editData(){
console.log("修改的三级分类数据",this.category)
this.$http({
url: this.$http.adornUrl(`/book/shopcategory/update`),
method: 'post',
data: this.$http.adornData(this.category, false)
}).then(({ data }) => {
this.$message({
type: 'success',
message: '目录修改成功!'
});
this.dialogVisible = false
this.getTreeList()
this.expandedkey = [this.category.parentCid]
this.category = {}
})
},
remove(node, data) {
console.log("remove",node,data)
var ids = [data.catId]
this.$confirm(`是否删除【${data.name}】目录?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/book/shopcategory/deleteCheck`),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({ data }) => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.getTreeList();
this.expandedkey = [node.parent.data.catId]
})
})
.catch(() => { });
},
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,228 @@
<template>
<el-dialog
:title="!dataForm.productId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
@close="handlereset">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="所属分类" prop="productPid">
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" @change="handleChange" clearable></el-cascader>
</el-form-item>
<el-form-item label="商品名称" prop="productName">
<el-input v-model="dataForm.productName" placeholder="商品名称"></el-input>
</el-form-item>
<el-form-item label="商品价格" prop="price">
<el-input v-model="dataForm.price" placeholder="商品价格"></el-input>
</el-form-item>
<el-form-item label="商品重量" prop="weight">
<el-input v-model="dataForm.weight" placeholder="商品重量"></el-input>
</el-form-item>
<el-form-item label="上架状态" prop="publishStatus">
<el-input v-model="dataForm.publishStatus" placeholder="上架状态"></el-input>
</el-form-item>
<el-form-item label="商品图" prop="productImages">
<el-upload
action="http://localhost:9100/pb/oss/fileoss"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:file-list="fileList"
:on-success="handlePicSuccess"
:on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<img width="100%" :src="dataForm.productImages" alt="">
</el-dialog>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item>
<el-form-item label="删除标记" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder="删除标记"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handlereset">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
categorys:'',
fileList:[],
dialogVisible: false,
props: {
value: "catId",
label: "name",
children: "children",
checkStrictly: true
},
dataForm: {
productId: 0,
productName: '',
price: '',
weight: '',
publishStatus: '',
productPid: '',
productImages: '',
createTime: '',
updateTime: '',
delFlag: '',
sort: '',
poids:[]
},
dataRule: {
// productName: [
// { required: true, message: '商品名称不能为空', trigger: 'blur' }
// ],
// price: [
// { required: true, message: '商品价格不能为空', trigger: 'blur' }
// ],
// weight: [
// { required: true, message: '商品重量不能为空', trigger: 'blur' }
// ],
// publishStatus: [
// { required: true, message: '上架状态不能为空', trigger: 'blur' }
// ],
// productPid: [
// { required: true, message: '商品父id不能为空', trigger: 'blur' }
// ],
// productImages: [
// { required: true, message: '商品图不能为空', trigger: 'blur' }
// ],
// level: [
// { required: true, message: '层级不能为空', trigger: 'blur' }
// ],
// createTime: [
// { required: true, message: '创建时间不能为空', trigger: 'blur' }
// ],
// updateTime: [
// { required: true, message: '更新时间不能为空', trigger: 'blur' }
// ],
// delFlag: [
// { required: true, message: '删除标记不能为空', trigger: 'blur' }
// ],
// sort: [
// { required: true, message: '排序不能为空', trigger: 'blur' }
// ]
}
}
},
created (){
this.getTreeList()
},
methods: {
init (id) {
this.dataForm.productId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.productId) {
this.$http({
url: this.$http.adornUrl(`/book/shopproduct/info/${this.dataForm.productId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.productName = data.shopProduct.productName
this.dataForm.price = data.shopProduct.price
this.dataForm.weight = data.shopProduct.weight
this.dataForm.publishStatus = data.shopProduct.publishStatus
this.dataForm.productPid = data.shopProduct.productPid
this.dataForm.productImages = data.shopProduct.productImages
this.dataForm.createTime = data.shopProduct.createTime
this.dataForm.updateTime = data.shopProduct.updateTime
this.dataForm.delFlag = data.shopProduct.delFlag
this.dataForm.sort = data.shopProduct.sort
this.dataForm.poids = data.shopProduct.poids
if (data.shopProduct.productImages != "") {
var img = { name: '', url: data.shopProduct.productImages }
var attr = []
attr.push(img)
this.fileList = attr
}
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/shopproduct/${!this.dataForm.productId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'productId': this.dataForm.productId || undefined,
'productName': this.dataForm.productName,
'price': this.dataForm.price,
'weight': this.dataForm.weight,
'publishStatus': this.dataForm.publishStatus,
'productPid': this.dataForm.poids[this.dataForm.poids.length-1],
'productImages': this.dataForm.productImages,
'createTime': this.dataForm.createTime,
'updateTime': this.dataForm.updateTime,
'delFlag': this.dataForm.delFlag,
'sort': this.dataForm.sort
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
getTreeList() {
this.$http({
url: this.$http.adornUrl(`/book/shopcategory/listTree`),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
this.categorys = data.data;
})
},
handlePictureCardPreview(file) {
this.dataForm.productImages = file.url;
this.dialogVisible = true;
},
handlePicSuccess(res, file) {
if (res.msg == "success") {
this.dataForm.productImages = res.url;
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
}
},
handleRemove(file) {
this.dataForm.productImages = '';
},
handlereset(){
this.fileList = [],
this.visible = false
},
}
}
</script>

View File

@@ -0,0 +1,248 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('book:shopproduct:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column label="序号" width="70" align="center">
<template slot-scope="scope">
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="publishStatus" header-align="center" align="center" label="状态">
<template slot-scope="scope">
<el-switch :active-value=1 :inactive-value=0 style="display: block" v-model="scope.row.publishStatus"
@change="SwitchChange(scope.row)" active-color="#13ce66" inactive-color="#ff4949" active-text="上架"
inactive-text="下架">
</el-switch>
</template>
</el-table-column>
<el-table-column
prop="productName"
header-align="center"
align="center"
label="商品名称">
</el-table-column>
<el-table-column
prop="price"
header-align="center"
align="center"
label="商品价格">
</el-table-column>
<el-table-column
prop="weight"
header-align="center"
align="center"
label="商品重量">
</el-table-column>
<!-- <el-table-column
prop="productPid"
header-align="center"
align="center"
label="商品父id">
</el-table-column> -->
<el-table-column header-align="center" align="center" label="商品图">
<template slot-scope="scope">
<img v-if="scope.row.productImages != ''" :src="scope.row.productImages" width="70" height="100" class="tableImg" />
</template>
</el-table-column>
<!-- <el-table-column
prop="level"
header-align="center"
align="center"
label="层级">
</el-table-column> -->
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<!-- <el-table-column
prop="delFlag"
header-align="center"
align="center"
label="删除标记">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column> -->
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.productId)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.productId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './shopproduct-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
publishStatus: false,
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/shopproduct/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.productId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/book/shopproduct/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
},
SwitchChange(event) {
/*点击时他会自动把你绑定的值变更,直接去请求数据就可以了*/
var parms = {
publishStatus: event.publishStatus,
productId: event.productId
}
console.log(parms)
this.$http({
url: this.$http.adornUrl('/book/shopproduct/update'),
method: 'post',
data: parms
}).then(res => {
this.$message({
message: '成功',
type: 'success'
})
this.loading = false
this.getDataList()
}).catch(error => {
this.loading = false
console.log(error)
})
console.log(event)
},
}
}
</script>