活动页面完善
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Various Dev Server settings
|
// 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
|
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||||
autoOpenBrowser: true,
|
autoOpenBrowser: true,
|
||||||
errorOverlay: 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-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: '/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: '/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) {
|
beforeEnter (to, from, next) {
|
||||||
let token = Vue.cookie.get('token')
|
let token = Vue.cookie.get('token')
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,19 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="选择优惠券" center :visible.sync="visible" :before-close="handleClose">
|
<el-dialog
|
||||||
|
title="选择优惠券"
|
||||||
|
center
|
||||||
|
:visible.sync="visible"
|
||||||
|
:before-close="handleClose"
|
||||||
|
>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="sedSelectCou">确 定</el-button>
|
<el-button type="primary" @click="sedSelectCou">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
<el-table ref="multipleTable"
|
<el-table
|
||||||
|
ref="multipleTable"
|
||||||
:data="dataList"
|
:data="dataList"
|
||||||
border
|
border
|
||||||
v-loading="dataListLoading"
|
v-loading="dataListLoading"
|
||||||
@selection-change="selectionChangeHandle"
|
@selection-change="selectionChangeHandle"
|
||||||
style="width: 100%;">
|
style="width: 100%;"
|
||||||
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
type="selection"
|
type="selection"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
width="50">
|
width="50"
|
||||||
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="序号" width="70" align="center">
|
<el-table-column label="序号" width="70" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -24,13 +32,15 @@
|
|||||||
prop="couponName"
|
prop="couponName"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="优惠券名称">
|
label="优惠券名称"
|
||||||
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="couponAmount"
|
prop="couponAmount"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="面值">
|
label="面值"
|
||||||
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column header-align="center" align="center" label="商品图">
|
<!-- <el-table-column header-align="center" align="center" label="商品图">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -45,7 +55,8 @@
|
|||||||
:page-sizes="[10, 20, 50, 100]"
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
:page-size="pageSize"
|
:page-size="pageSize"
|
||||||
:total="totalPage"
|
:total="totalPage"
|
||||||
layout="total, sizes, prev, pager, next, jumper">
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -65,9 +76,9 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataForm: {
|
dataForm: {
|
||||||
key:''
|
key: ""
|
||||||
},
|
},
|
||||||
selectTitle:'',
|
selectTitle: "",
|
||||||
oldSelected: [],
|
oldSelected: [],
|
||||||
dataList: [],
|
dataList: [],
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
@@ -75,35 +86,36 @@
|
|||||||
totalPage: 0,
|
totalPage: 0,
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
}
|
dataIndex: null
|
||||||
},
|
};
|
||||||
create(){
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
create() {},
|
||||||
mounted() {
|
mounted() {
|
||||||
// console.log(454545)
|
// console.log(454545)
|
||||||
this.$bus.$on("ProListVisible", (val) => {
|
this.$bus.$on("ProListVisible", val => {
|
||||||
this.visible = true
|
this.visible = true;
|
||||||
});
|
});
|
||||||
this.$bus.$on("getCouListInMes", (data) => {
|
this.$bus.$on("getCouListInMes", data => {
|
||||||
this.oldSelected = data.List
|
this.oldSelected = data.List;
|
||||||
console.log(this.oldSelected, 'oldSelected')
|
this.selectTitle = data.opraName;
|
||||||
|
this.dataIndex = data.dataIndex;
|
||||||
|
console.log(data, "oldSelected");
|
||||||
});
|
});
|
||||||
},methods:{
|
},
|
||||||
|
methods: {
|
||||||
// 判断初始选中的产品
|
// 判断初始选中的产品
|
||||||
check() {
|
check() {
|
||||||
// console.log(this.oldSelected,'check')
|
// console.log(this.oldSelected,'check')
|
||||||
if (this.oldSelected.length > 0) {
|
if (this.oldSelected.length > 0) {
|
||||||
this.dataList.forEach((item) => {
|
this.dataList.forEach(item => {
|
||||||
this.oldSelected.forEach((item2) => {
|
this.oldSelected.forEach(item2 => {
|
||||||
if (item.id == item2.id) {
|
if (item.id == item2.id) {
|
||||||
this.dataListSelections.push(item)
|
this.dataListSelections.push(item);
|
||||||
this.$refs.multipleTable.toggleRowSelection(item)
|
this.$refs.multipleTable.toggleRowSelection(item);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
console.log(this.dataListSelections, 'dataListSelections')
|
// console.log(this.dataListSelections, 'dataListSelections')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
@@ -111,53 +123,64 @@
|
|||||||
},
|
},
|
||||||
sedSelectCou() {
|
sedSelectCou() {
|
||||||
// console.log(this.dataListSelections)
|
// console.log(this.dataListSelections)
|
||||||
this.$bus.$emit('haveSelectedCoupon', this.dataListSelections)
|
if (this.selectTitle == "manezeng") {
|
||||||
this.handleClose()
|
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() {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true;
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/book/coupon/list'),
|
url: this.$http.adornUrl("/book/coupon/list"),
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: this.$http.adornParams({
|
params: this.$http.adornParams({
|
||||||
'page': this.pageIndex,
|
page: this.pageIndex,
|
||||||
'limit': this.pageSize,
|
limit: this.pageSize,
|
||||||
'key': this.dataForm.key,
|
key: this.dataForm.key,
|
||||||
'currentState': "0"
|
currentState: "0"
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.page.list
|
this.dataList = data.page.list;
|
||||||
this.totalPage = data.page.totalCount
|
this.totalPage = data.page.totalCount;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.check() // 获取到已选中的数据
|
this.check(); // 获取到已选中的数据
|
||||||
|
});
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
this.dataList = []
|
this.dataList = [];
|
||||||
this.totalPage = 0
|
this.totalPage = 0;
|
||||||
}
|
}
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 每页数
|
// 每页数
|
||||||
sizeChangeHandle(val) {
|
sizeChangeHandle(val) {
|
||||||
this.pageSize = val
|
this.pageSize = val;
|
||||||
this.pageIndex = 1
|
this.pageIndex = 1;
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 当前页
|
// 当前页
|
||||||
currentChangeHandle(val) {
|
currentChangeHandle(val) {
|
||||||
this.pageIndex = val
|
this.pageIndex = val;
|
||||||
this.getDataList()
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 多选
|
// 多选
|
||||||
selectionChangeHandle(val) {
|
selectionChangeHandle(val) {
|
||||||
this.dataListSelections = val
|
this.dataListSelections = val;
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.el-form-item__label {
|
.el-form-item__label {
|
||||||
@@ -173,17 +196,28 @@
|
|||||||
width: 60px;
|
width: 60px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
line-height: 70px;
|
line-height: 70px;
|
||||||
|
}
|
||||||
}}
|
}
|
||||||
.pictureList {
|
.pictureList {
|
||||||
/deep/.el-upload--picture{ display: none;}
|
/deep/.el-upload--picture {
|
||||||
/deep/ .el-upload-list{ display: flex; justify-content:space-between; flex-wrap: wrap;
|
display: none;
|
||||||
|
}
|
||||||
|
/deep/ .el-upload-list {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
.el-upload-list__item {
|
.el-upload-list__item {
|
||||||
width:30%; padding: 5px 5px 5px 87px; height: 66px;
|
width: 30%;
|
||||||
img{width: 54px; height: 54px;}
|
padding: 5px 5px 5px 87px;
|
||||||
.el-upload-list__item-name{line-height: 54px;}
|
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-button type="primary" size="mini" @click="submit" :disabled="buttonDisable">批量合并发货</el-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<ul style="height: 500px; overflow-y:scroll;">
|
<ul style="">
|
||||||
<li class="flexbox " v-for="(de, index) in ruleForm.list" :key="index"
|
<li class="flexbox " v-for="(de, index) in ruleForm.list" :key="index"
|
||||||
style="border:1px solid #CFF3ED; margin-bottom: 5px;">
|
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;">
|
<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>
|
:disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||||
</span>
|
</span>
|
||||||
<span style="" v-if="tabChange.tabActiveName == 1">
|
<span style="" v-if="tabChange.tabActiveName == 1">
|
||||||
|
<el-badge :value="mergeList.length" class="item">
|
||||||
<router-link :to="{ path: 'buyorder-mergeorder', query: {} }">
|
<router-link :to="{ path: 'buyorder-mergeorder', query: {} }">
|
||||||
<el-button style="margin-left: 10px;" size="mini" v-if="isAuth('book:buyorder')" type="primary">合并发货</el-button>
|
<el-button style="margin-left: 10px;" size="mini" v-if="isAuth('book:buyorder')" type="primary">合并发货</el-button>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
</el-badge>
|
||||||
</span>
|
</span>
|
||||||
<span style="" v-if="tabChange.tabActiveName == 1">
|
<span style="" v-if="tabChange.tabActiveName == 1">
|
||||||
<el-button style="margin-left: 10px;" size="mini" v-if="isAuth('book:buyorder')" type="primary"
|
<el-button style="margin-left: 10px;" size="mini" v-if="isAuth('book:buyorder')" type="primary"
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
totalPage: 0,
|
totalPage: 0,
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
|
listIndex: -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
create(){
|
create(){
|
||||||
@@ -94,7 +95,7 @@
|
|||||||
this.$bus.$on("getListInMes", (data) => {
|
this.$bus.$on("getListInMes", (data) => {
|
||||||
this.selectTitle = data.selectTitle
|
this.selectTitle = data.selectTitle
|
||||||
this.oldSelected = data.ProductList
|
this.oldSelected = data.ProductList
|
||||||
|
this.listIndex = data.ProductListIndex
|
||||||
});
|
});
|
||||||
},methods:{
|
},methods:{
|
||||||
// 判断初始选中的产品
|
// 判断初始选中的产品
|
||||||
@@ -117,7 +118,8 @@
|
|||||||
},
|
},
|
||||||
sedSelectPro(){
|
sedSelectPro(){
|
||||||
console.log(this.dataListSelections)
|
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()
|
this.handleClose()
|
||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-form-item label="商品详情" prop="productDetails">
|
<el-form-item label="商品详情" prop="productDetails">
|
||||||
<quill-editor v-model="dataForm.productDetails" ref="myQuillEditor" :options="editorOption"
|
<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">
|
@ready="onEditorReady($event)" class="shangpin_editor">
|
||||||
</quill-editor>
|
</quill-editor>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -479,7 +479,7 @@
|
|||||||
this.visible = false
|
this.visible = false
|
||||||
this.swiperfileList = []
|
this.swiperfileList = []
|
||||||
this.$refs['dataForm'].resetFields()
|
this.$refs['dataForm'].resetFields()
|
||||||
this.$refs['dataForm'].reset()
|
// this.$refs['dataForm'].reset()
|
||||||
},
|
},
|
||||||
// 失去焦点事件
|
// 失去焦点事件
|
||||||
onEditorBlur(quill) {
|
onEditorBlur(quill) {
|
||||||
@@ -493,15 +493,7 @@
|
|||||||
onEditorReady(quill) {
|
onEditorReady(quill) {
|
||||||
// console.log('editor ready!', quill)
|
// console.log('editor ready!', quill)
|
||||||
},
|
},
|
||||||
// 内容改变事件
|
|
||||||
onEditorChange({
|
|
||||||
quill,
|
|
||||||
html,
|
|
||||||
text
|
|
||||||
}) {
|
|
||||||
console.log('editor change!', quill, html, text)
|
|
||||||
this.content = html
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
quillEditor
|
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