活动页面完善
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: '192.168.110.169', // can be overwritten by process.env.HOST
|
||||
host: '192.168.110.157', // can be overwritten by process.env.HOST
|
||||
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: true,
|
||||
errorOverlay: true,
|
||||
|
||||
24412
package-lock.json
generated
24412
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -45,7 +45,8 @@ const mainRoutes = {
|
||||
{ path: '/buyorder-mergeorder', component: _import('modules/order/buyorder-mergeorder'), name: 'buyorder-mergeorder', meta: { title: '合并发货', isTab: true } },
|
||||
{ path: '/buyorder-print', component: _import('modules/order/buyorder-print'), name: 'buyorder-print', meta: { title: '打印面单', isTab: true } },
|
||||
{ path: '/activity-list', component: _import('modules/activity/activityList'), name: 'activity-list', meta: { title: '活动列表', isTab: true } },
|
||||
{ path: '/user-point-memery', component: _import('modules/user/user-point-memery'), name: 'activity-list', meta: { title: '充/扣记录', isTab: true } },
|
||||
{ path: '/user-point-memery', component: _import('modules/user/user-point-memery'), name: 'user-point-memery', meta: { title: '充/扣记录', isTab: true } },
|
||||
{ path: '/xieyi_list', component: _import('modules/xieyi/xieyi'), name: 'xieyi_list', meta: { title: '协议管理', isTab: true } },
|
||||
],
|
||||
beforeEnter (to, from, next) {
|
||||
let token = Vue.cookie.get('token')
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,37 +1,47 @@
|
||||
<template>
|
||||
<el-dialog title="选择优惠券" center :visible.sync="visible" :before-close="handleClose">
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="sedSelectCou">确 定</el-button>
|
||||
</span>
|
||||
<el-table ref="multipleTable"
|
||||
<el-dialog
|
||||
title="选择优惠券"
|
||||
center
|
||||
:visible.sync="visible"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="sedSelectCou">确 定</el-button>
|
||||
</span>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
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>
|
||||
<el-table-column
|
||||
prop="couponName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="优惠券名称">
|
||||
label="优惠券名称"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="couponAmount"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="面值">
|
||||
</el-table-column>
|
||||
label="面值"
|
||||
>
|
||||
</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="30" height="30" class="tableImg" />
|
||||
@@ -45,145 +55,169 @@
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
deliverOrder: {
|
||||
type: Object,
|
||||
value: {}
|
||||
}
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataForm:{
|
||||
key:''
|
||||
},
|
||||
selectTitle:'',
|
||||
oldSelected:[],
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
deliverOrder: {
|
||||
type: Object,
|
||||
value: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ""
|
||||
},
|
||||
selectTitle: "",
|
||||
oldSelected: [],
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
dataIndex: null
|
||||
};
|
||||
},
|
||||
create() {},
|
||||
mounted() {
|
||||
// console.log(454545)
|
||||
this.$bus.$on("ProListVisible", val => {
|
||||
this.visible = true;
|
||||
});
|
||||
this.$bus.$on("getCouListInMes", data => {
|
||||
this.oldSelected = data.List;
|
||||
this.selectTitle = data.opraName;
|
||||
this.dataIndex = data.dataIndex;
|
||||
console.log(data, "oldSelected");
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 判断初始选中的产品
|
||||
check() {
|
||||
// console.log(this.oldSelected,'check')
|
||||
if (this.oldSelected.length > 0) {
|
||||
this.dataList.forEach(item => {
|
||||
this.oldSelected.forEach(item2 => {
|
||||
if (item.id == item2.id) {
|
||||
this.dataListSelections.push(item);
|
||||
this.$refs.multipleTable.toggleRowSelection(item);
|
||||
}
|
||||
});
|
||||
});
|
||||
// console.log(this.dataListSelections, 'dataListSelections')
|
||||
}
|
||||
},
|
||||
create(){
|
||||
|
||||
handleClose() {
|
||||
this.$emit("CouponListClose", false);
|
||||
},
|
||||
mounted(){
|
||||
// console.log(454545)
|
||||
this.$bus.$on("ProListVisible", (val) => {
|
||||
this.visible = true
|
||||
});
|
||||
this.$bus.$on("getCouListInMes", (data) => {
|
||||
this.oldSelected = data.List
|
||||
console.log(this.oldSelected, 'oldSelected')
|
||||
|
||||
});
|
||||
},methods:{
|
||||
// 判断初始选中的产品
|
||||
check(){
|
||||
// console.log(this.oldSelected,'check')
|
||||
if(this.oldSelected.length > 0){
|
||||
this.dataList.forEach((item) => {
|
||||
this.oldSelected.forEach((item2) => {
|
||||
if(item.id == item2.id){
|
||||
this.dataListSelections.push(item)
|
||||
this.$refs.multipleTable.toggleRowSelection(item)
|
||||
}
|
||||
})
|
||||
})
|
||||
console.log(this.dataListSelections, 'dataListSelections')
|
||||
}
|
||||
},
|
||||
handleClose(){
|
||||
this.$emit("CouponListClose", false);
|
||||
},
|
||||
sedSelectCou(){
|
||||
sedSelectCou() {
|
||||
// console.log(this.dataListSelections)
|
||||
this.$bus.$emit('haveSelectedCoupon', this.dataListSelections)
|
||||
this.handleClose()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/coupon/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key,
|
||||
'currentState': "0"
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
this.$nextTick(()=> {
|
||||
this.check() // 获取到已选中的数据
|
||||
|
||||
})
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
if (this.selectTitle == "manezeng") {
|
||||
this.$bus.$emit("haveSelectedCoupon", {
|
||||
list: this.dataListSelections,
|
||||
dataIndex: this.dataIndex,
|
||||
selectTitle: this.selectTitle
|
||||
});
|
||||
this.dataIndex = 0;
|
||||
this.selectTitle = [];
|
||||
} else if (this.selectTitle == "zhuce") {
|
||||
this.$bus.$emit("haveSelectedCoupon", { list: this.dataListSelections, selectTitle:'zhuce' });
|
||||
} else {
|
||||
this.$bus.$emit("haveSelectedCoupon", this.dataListSelections);
|
||||
}
|
||||
this.handleClose();
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/coupon/list"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
key: this.dataForm.key,
|
||||
currentState: "0"
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list;
|
||||
this.totalPage = data.page.totalCount;
|
||||
this.$nextTick(() => {
|
||||
this.check(); // 获取到已选中的数据
|
||||
});
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.el-form-item__label {
|
||||
font-size: 12px;
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
.el-uploadfeng {
|
||||
/deep/ .el-upload-list__item {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
}
|
||||
.el-uploadfeng {
|
||||
/deep/ .el-upload-list__item {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
/deep/ .el-upload--picture-card {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 70px;
|
||||
|
||||
}}
|
||||
.pictureList{
|
||||
/deep/.el-upload--picture{ display: none;}
|
||||
/deep/ .el-upload-list{ display: flex; justify-content:space-between; flex-wrap: wrap;
|
||||
.el-upload-list__item{
|
||||
width:30%; padding: 5px 5px 5px 87px; height: 66px;
|
||||
img{width: 54px; height: 54px;}
|
||||
.el-upload-list__item-name{line-height: 54px;}
|
||||
|
||||
/deep/ .el-upload--picture-card {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 70px;
|
||||
}
|
||||
}
|
||||
.pictureList {
|
||||
/deep/.el-upload--picture {
|
||||
display: none;
|
||||
}
|
||||
/deep/ .el-upload-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
.el-upload-list__item {
|
||||
width: 30%;
|
||||
padding: 5px 5px 5px 87px;
|
||||
height: 66px;
|
||||
img {
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
}
|
||||
.el-upload-list__item-name {
|
||||
line-height: 54px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<el-button type="primary" size="mini" @click="submit" :disabled="buttonDisable">批量合并发货</el-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<ul style="height: 500px; overflow-y:scroll;">
|
||||
<ul style="">
|
||||
<li class="flexbox " v-for="(de, index) in ruleForm.list" :key="index"
|
||||
style="border:1px solid #CFF3ED; margin-bottom: 5px;">
|
||||
<div class="flexbox" style="align-items: center; padding: 0 10px; width: 34px; border-right: 1px solid #CFF3ED;">
|
||||
|
||||
@@ -52,9 +52,11 @@
|
||||
:disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</span>
|
||||
<span style="" v-if="tabChange.tabActiveName == 1">
|
||||
<el-badge :value="mergeList.length" class="item">
|
||||
<router-link :to="{ path: 'buyorder-mergeorder', query: {} }">
|
||||
<el-button style="margin-left: 10px;" size="mini" v-if="isAuth('book:buyorder')" type="primary">合并发货</el-button>
|
||||
</router-link>
|
||||
</el-badge>
|
||||
</span>
|
||||
<span style="" v-if="tabChange.tabActiveName == 1">
|
||||
<el-button style="margin-left: 10px;" size="mini" v-if="isAuth('book:buyorder')" type="primary"
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
listIndex: -1
|
||||
}
|
||||
},
|
||||
create(){
|
||||
@@ -94,7 +95,7 @@
|
||||
this.$bus.$on("getListInMes", (data) => {
|
||||
this.selectTitle = data.selectTitle
|
||||
this.oldSelected = data.ProductList
|
||||
|
||||
this.listIndex = data.ProductListIndex
|
||||
});
|
||||
},methods:{
|
||||
// 判断初始选中的产品
|
||||
@@ -117,7 +118,8 @@
|
||||
},
|
||||
sedSelectPro(){
|
||||
console.log(this.dataListSelections)
|
||||
this.$bus.$emit('haveSelected', {title:this.selectTitle,list:this.dataListSelections})
|
||||
this.$bus.$emit('haveSelected', {title:this.selectTitle,list:this.dataListSelections, listIndex: this.listIndex})
|
||||
this.listIndex = null
|
||||
this.handleClose()
|
||||
},
|
||||
// 获取数据列表
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
</div>
|
||||
<el-form-item label="商品详情" prop="productDetails">
|
||||
<quill-editor v-model="dataForm.productDetails" ref="myQuillEditor" :options="editorOption"
|
||||
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"
|
||||
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
|
||||
@ready="onEditorReady($event)" class="shangpin_editor">
|
||||
</quill-editor>
|
||||
</el-form-item>
|
||||
@@ -479,7 +479,7 @@
|
||||
this.visible = false
|
||||
this.swiperfileList = []
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.$refs['dataForm'].reset()
|
||||
// this.$refs['dataForm'].reset()
|
||||
},
|
||||
// 失去焦点事件
|
||||
onEditorBlur(quill) {
|
||||
@@ -493,15 +493,7 @@
|
||||
onEditorReady(quill) {
|
||||
// console.log('editor ready!', quill)
|
||||
},
|
||||
// 内容改变事件
|
||||
onEditorChange({
|
||||
quill,
|
||||
html,
|
||||
text
|
||||
}) {
|
||||
console.log('editor change!', quill, html, text)
|
||||
this.content = html
|
||||
}
|
||||
|
||||
},
|
||||
components: {
|
||||
quillEditor
|
||||
|
||||
199
src/views/modules/xieyi/add-update.vue
Normal file
199
src/views/modules/xieyi/add-update.vue
Normal file
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-dialog
|
||||
title="编辑协议"
|
||||
:visible.sync="visible"
|
||||
width="50%" @close="handlereset"
|
||||
>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="dataForm.title" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="dataForm.type" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="协议内容" prop="content">
|
||||
<quill-editor v-model="dataForm.content" ref="myQuillEditor" :options="editorOption"
|
||||
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)"
|
||||
@ready="onEditorReady($event)" class="shangpin_editor">
|
||||
</quill-editor>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handlereset">取消</el-button>
|
||||
<el-button type="primary" @click="subMit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
quillEditor
|
||||
} from 'vue-quill-editor'
|
||||
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
export default {
|
||||
props: {
|
||||
// visible: {
|
||||
// type: Boolean,
|
||||
// value: false
|
||||
// },
|
||||
// details: {
|
||||
// type: Object,
|
||||
// value: {}
|
||||
// },
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
visible:false,
|
||||
dataForm:{
|
||||
content:'',
|
||||
title:'',
|
||||
id: 0,
|
||||
type:''
|
||||
},
|
||||
dataRule: {
|
||||
title: [{
|
||||
required: true,
|
||||
message: '请填写标题',
|
||||
trigger: 'blur'
|
||||
}],},
|
||||
options: [{
|
||||
value: 'member',
|
||||
label: '会员协议'
|
||||
}, {
|
||||
value: 'pay',
|
||||
label: '充值协议'
|
||||
}],
|
||||
editorOption: {
|
||||
modules: {
|
||||
toolbar: [
|
||||
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
|
||||
['blockquote', 'code-block'], // 引用 代码块
|
||||
[{
|
||||
header: 1
|
||||
}, {
|
||||
header: 2
|
||||
}], // 1、2 级标题
|
||||
[{
|
||||
list: 'ordered'
|
||||
}, {
|
||||
list: 'bullet'
|
||||
}], // 有序、无序列表
|
||||
[{
|
||||
script: 'sub'
|
||||
}, {
|
||||
script: 'super'
|
||||
}], // 上标/下标
|
||||
[{
|
||||
indent: '-1'
|
||||
}, {
|
||||
indent: '+1'
|
||||
}], // 缩进
|
||||
[{
|
||||
direction: 'rtl'
|
||||
}], // 文本方向
|
||||
[{
|
||||
size: ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36']
|
||||
}], // 字体大小
|
||||
[{
|
||||
header: [1, 2, 3, 4, 5, 6]
|
||||
}], // 标题
|
||||
[{
|
||||
color: []
|
||||
}, {
|
||||
background: []
|
||||
}], // 字体颜色、字体背景颜色
|
||||
// [{ font: ['songti'] }], // 字体种类
|
||||
[{
|
||||
align: []
|
||||
}], // 对齐方式
|
||||
['clean'], // 清除文本格式
|
||||
['image', 'video'] // 链接、图片、视频
|
||||
]
|
||||
},
|
||||
placeholder: '请输入正文'
|
||||
},
|
||||
}
|
||||
},methods:{
|
||||
init(row){
|
||||
this.dataForm = row
|
||||
this.visible = true
|
||||
},
|
||||
handlereset() {
|
||||
this.visible = false
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.$emit('refreshDataList')
|
||||
// this.$refs['dataForm'].reset()
|
||||
},
|
||||
subMit(){
|
||||
// 表单提交
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/sys/agreement/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'title': this.dataForm.title,
|
||||
'content': this.dataForm.content,
|
||||
'type': this.dataForm.type
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$refs['dataForm'].resetFields()
|
||||
// this.$refs['dataForm'].reset()
|
||||
this.$emit('refreshDataList')
|
||||
this.handleClose()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
handleClose(){
|
||||
this.$emit("Close", false)
|
||||
// this.details = { content:'', title:'', id: 0, type:''}
|
||||
// this.$refs['dataForm'].resetFields()
|
||||
},
|
||||
// 失去焦点事件
|
||||
onEditorBlur(quill) {
|
||||
console.log('editor blur!', quill)
|
||||
},
|
||||
// 获得焦点事件
|
||||
onEditorFocus(quill) {
|
||||
//console.log('editor focus!', quill)
|
||||
},
|
||||
// 准备富文本编辑器
|
||||
onEditorReady(quill) {
|
||||
// console.log('editor ready!', quill)
|
||||
},
|
||||
|
||||
},components:{
|
||||
quillEditor
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
120
src/views/modules/xieyi/xieyi.vue
Normal file
120
src/views/modules/xieyi/xieyi.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<!-- <el-button size="mini" v-if="isAuth('book:coupon:save')" type="primary" @click="addOrUpdateHandle">新增</el-button> -->
|
||||
<el-button style="margin-bottom: 10px" size="mini" v-if="isAuth('book:coupon:save')" type="primary" @click="addOrUpdateHandle(details)">新增</el-button>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
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="序号" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="名称" width="500">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row)">修改</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 './add-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataList: [],
|
||||
details:{ content:'',
|
||||
title:'',
|
||||
id: 0,
|
||||
type:''},
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/sys/agreement/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
// 'page': this.pageIndex,
|
||||
// 'limit': this.pageSize,
|
||||
// 'key': this.dataForm.key,
|
||||
// 'currentState': this.couponActiveName
|
||||
})
|
||||
}).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()
|
||||
},
|
||||
addOrUpdateHandle (row) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row)
|
||||
})
|
||||
//this.addOrUpdateVisible = true
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user