Commit 08a656af authored by guoyou's avatar guoyou

Merge branch 'base-modify'

parents 378ae507 0e593ec8
......@@ -30,4 +30,79 @@ export function changeStatus(id) {
url: '/api/app/admin/buy_vehicle/status/' + id,
method: 'POST',
});
}
// 报名列表
export function applyList(params) {
return fetch({
url: 'api/activity/admin/activityLuckyDraw/page',
method: 'POST',
data: params
});
}
// 报名列表导出
export function excel(query) {
return fetch({
url: 'api/activity/admin/activityLuckyDraw/export',
method: 'post',
data: query,
responseType: 'blob'
});
}
// 中奖列表
export function applyListWin(params) {
return fetch({
url: '/api/activity/admin/activityWinningRecord/page',
method: 'POST',
data: params
});
}
// 中奖列表导出
export function excelWin(query) {
return fetch({
url: '/api/activity/admin/activityWinningRecord/export',
method: 'post',
data: query,
responseType: 'blob'
});
}
// 活动数据
export function applyListActive(params) {
return fetch({
url: '/api/activity/admin/activityAttendanceRecord/page',
method: 'POST',
data: params
});
}
// 活动数据
export function excelActive(query) {
return fetch({
url: '/api/activity/admin/activityAttendanceRecord/export',
method: 'post',
data: query,
responseType: 'blob'
});
}
// 奖品设置
export function savePrize(query) {
return fetch({
url: '/api/activity/admin/activityPrize/save',
method: 'post',
data: query
});
}
// 奖品详情
export function infoPrize(query) {
return fetch({
url: 'api/activity/admin/activityPrize/list',
method: 'get',
data: query
});
}
\ No newline at end of file
......@@ -131,3 +131,11 @@ export function exportExcel(query) {
responseType: 'blob'
});
}
export function postponeApi(param) {
return fetch({
url: 'api/order/baseOrder/bg/delay-rent-order',
method: 'post',
data: param
});
}
......@@ -648,6 +648,39 @@ export const asyncRouterMap = [{
}
]
},
{
path: '/casual',
component: Layout,
name: '发布会现金活动',
icon: 'setting',
authority: 'casual',
children: [
{
path: 'index',
component: _import('conference/activeData/index'),
name: '活动数据',
authority: 'index'
},
{
path: 'prizeLists',
component: _import('conference/prizeList/prizeLists'),
name: '中奖列表',
authority: 'prizeLists'
},
{
path: 'applyList',
component: _import('conference/apply/applyList'),
name: '报名列表',
authority: 'applyList'
},
{
path: 'awardSet',
component: _import('conference/award/awardSet'),
name: '奖品设置',
authority: 'awardSet'
}
]
},
{
path: '/applyManagements',
component: Layout,
......
<template>
<div class="app-container calendar-list-container">
<el-form :inline="true" label-width="100px" label-position="right">
<el-form-item label="选择日期">
<el-date-picker v-model="time" type="daterange" placeholder="选择日期范围" @change="changeTime"></el-date-picker>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="listQuery.phone" placeholder="请输入手机号" clearable style="width:200px"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="listQuery.status" clearable placeholder="请选择状态" @change="changeClass">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="search">搜索</el-button>
<el-button type="primary" @click="clearSearch">清空搜索</el-button>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出</el-button>
</el-form>
<div class="information">
<h4>数据概况.</h4>
<ul>
<li>
<p>{{information.attendNum}}</p>
<p>参与人数(次)</p>
</li>
<li>
<p>{{information.finishNum}}</p>
<p>完成任务数(个)</p>
</li>
<li>
<p>{{information.amount}}</p>
<p>已发放现金总额(次)</p>
</li>
</ul>
</div>
<el-table
:data="tableData"
border
header-align="center"
v-loading="loadingTab"
style="margin-top:20px"
>
<el-table-column label="序号" align="center" width="70">
<template scope="scope">
<span>{{scope.$index+(listQuery.page - 1) * listQuery.limit + 1}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="用户名" align="center"></el-table-column>
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
<el-table-column prop="positionName" label="身份" align="center"></el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template scope="scope">
<span>{{scope.row.status == 1 ? '未完成' : '已完成'}}</span>
</template>
</el-table-column>
<el-table-column prop="amount" label="当前金额(元)" align="center"></el-table-column>
<el-table-column prop="crtTime" label="邀请人数" align="center"></el-table-column>
<el-table-column prop="prizes" label="抽奖礼品" align="center"></el-table-column>
<el-table-column prop="attendTime" label="参加时间" align="center">
<template scope="scope">
<span>{{timeChange(scope.row.attendTime)}}</span>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</template>
<script>
import { formatDate } from 'utils/dateFormattor'
import { applyListActive, excelActive } from 'api/applyManagements'
export default {
created() {
this.getList()
},
data() {
return {
information: {},
excelLoading: false,
loadingTab: false,
tableData: [],
time: '',
total: null, //总页数
options: [
{
id: '',
name: '全部'
},
{
id: 0,
name: '未完成'
},
{
id: 1,
name: '已完成'
}
],
listQuery: {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2,
status: ''
}
}
},
methods: {
//时间戳
timeChange(val) {
return formatDate(new Date(val), 'yyyy-MM-dd hh:mm:ss')
},
//列表
getList() {
this.loadingTab = true
applyListActive(this.listQuery).then(data => {
if (data.status == 200) {
this.tableData = data.data.activityAttendanceRecordVos
this.total = data.data.totalCount
this.information = data.data.activityAttendanceRecordTotalVo
} else {
this.$message(data.message)
}
})
setTimeout(() => {
this.loadingTab = false
}, 300)
},
//是否中奖筛选
changeWin() {
this.listQuery.page = 1
this.getList()
},
//搜索
search() {
this.listQuery.page = 1
this.getList()
},
//抽奖类型筛选
changeClass() {
this.listQuery.page = 1
this.getList()
},
//清空搜索
clearSearch() {
this.listQuery = {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2
}
},
//导出
downloadExcel() {
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
excelActive(this.listQuery, {
responseType: 'arraybuffer'
}).then(res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName = '活动数据.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
})
},
//时间筛选
changeTime(val) {
this.listQuery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listQuery.startDate = value[0] + ' 00:00:00'
this.listQuery.endDate = value[1] + ' 23:59:59'
this.getList()
} else {
this.listQuery.startDate = null
this.listQuery.endDate = null
this.getList()
}
},
//页码
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
//分页
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
}
}
}
</script>
<style scoped>
.information {
border: 1px solid #ccc;
margin: 20px 0;
padding: 10px 20px;
}
.information h4 {
color: #333;
font-size: 16px;
font-weight: normal;
}
.information ul {
padding: 0;
border-top: 1px solid #eee;
padding: 10px 30px;
overflow: hidden;
}
.information li {
list-style: none;
text-align: center;
float: left;
width: 33.33%;
border-right: 1px solid #eee;
}
.information li:last-child {
border: none;
}
</style>
\ No newline at end of file
<template>
<div class="app-container calendar-list-container">
<el-form :inline="true" label-width="100px" label-position="right">
<el-form-item label="日期">
<el-date-picker v-model="time" type="daterange" placeholder="选择日期范围" @change="changeTime"></el-date-picker>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="listQuery.phone" placeholder="请输入手机号" clearable style="width:200px"></el-input>
</el-form-item>
<el-button type="primary" @click="search">搜索</el-button>
<el-button type="primary" @click="clearSearch">清空搜索</el-button>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出</el-button>
</el-form>
<el-table
:data="tableData"
border
header-align="center"
v-loading="loadingTab"
style="margin-top:20px"
>
<el-table-column label="序号" align="center" width="70">
<template scope="scope">
<span>{{scope.$index+(listQuery.page - 1) * listQuery.limit + 1}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
<el-table-column prop="ticketNum" label="人数" align="center"></el-table-column>
<el-table-column prop="crtTime" label="报名时间" align="center"></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</template>
<script>
import { applyList, excel } from 'api/applyManagements'
export default {
created() {
this.getList()
},
data() {
return {
excelLoading: false,
loadingTab: false,
tableData: [],
time: '',
total: null, //总页数
listQuery: {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2
}
}
},
methods: {
//列表
getList() {
this.loadingTab = true
applyList(this.listQuery).then(data => {
if (data.status == 200) {
this.tableData = data.data.data
this.total = data.data.totalCount
} else {
this.$message(data.message)
}
})
setTimeout(() => {
this.loadingTab = false
}, 300)
},
//搜索
search() {
this.listQuery.page = 1
this.getList()
},
//清空搜索
clearSearch() {
this.listQuery = {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2
}
},
//导出
downloadExcel() {
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
excel(this.listQuery, { responseType: 'arraybuffer' }).then(res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName = '报名列表.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
})
},
//时间筛选
changeTime(val) {
this.listQuery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listQuery.startDate = value[0] + ' 00:00:00'
this.listQuery.endDate = value[1] + ' 23:59:59'
this.getList()
} else {
this.listQuery.startDate = null
this.listQuery.endDate = null
this.getList()
}
},
//页码
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
//分页
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
}
}
}
</script>
<template>
<div class="app-container calendar-list-container">
<div class="online">
<h4>参与活动奖励抽奖</h4>
<table border="1">
<tr>
<td>宫格1</td>
<td>宫格2</td>
<td>宫格3</td>
</tr>
<tr>
<td>宫格4</td>
<td style="background:#20a0ff;color:#fff" @click="setOnline(1)">设置</td>
<td>宫格6</td>
</tr>
<tr>
<td>宫格7</td>
<td>宫格8</td>
<td>宫格9</td>
</tr>
</table>
</div>
<div class="local">
<h4>发布会现场奖品抽奖</h4>
<table border="1">
<tr>
<td>宫格1</td>
<td>宫格2</td>
<td>宫格3</td>
</tr>
<tr>
<td>宫格4</td>
<td style="background:#20a0ff;color:#fff" @click="setOnline(2)">设置</td>
<td>宫格6</td>
</tr>
<tr>
<td>宫格7</td>
<td>宫格8</td>
<td>宫格9</td>
</tr>
</table>
</div>
<el-dialog title="参与活动奖励抽奖设置" :visible.sync="dialogVisible" @close="closePop">
<ul>
<li>
<p></p>
<p>抽奖类型</p>
<p>奖品名称</p>
<p>奖品图片</p>
<p>奖品数量</p>
<p>中奖概率</p>
<p>最大中奖数</p>
</li>
<li v-for="(item,index) in table" :key="index">
<!-- 序号 -->
<p>宫格{{item.serialNumber}}</p>
<!-- 奖品类型 -->
<p>
<el-select v-model="item.prizeGoodsType" placeholder="请选择" @visible-change="discount(index)">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</p>
<!-- 奖品名称 -->
<p>
<el-input v-model="item.name" placeholder v-if="item.prizeGoodsType != 2" ref="prizeName"></el-input>
<el-select v-model="item.goodsId" placeholder="请选择" v-else ref="prizeTicket">
<el-option v-for="item in couponData" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
</p>
<!-- 奖品图片 -->
<p>
<el-upload
class="avatar-uploader"
:action="BASE_API + '/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:on-success="(response, file, fileList,id)=> handleSuccess(response, file, fileList,index)"
>
<img v-if="item.iconPath" :src="item.iconPath" style="width:50px;height:30px" ref="prizeImg"/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</p>
<!-- 奖品数量 -->
<p>
<el-input v-model="item.totalStock" placeholder ref="prizeNumber"></el-input>
</p>
<!-- 中奖概率 -->
<p>
<el-input v-model="item.probability" placeholder ref="prizeTheory"></el-input>
</p>
<!-- 最大中奖数 -->
<p>
<el-input v-model="item.dayMaxUse" placeholder ref="prizeNumberMax"></el-input>
</p>
</li>
</ul>
<p style="text-align:center">
<el-button type="primary" @click="save">保存</el-button>
</p>
</el-dialog>
</div>
</template>
<script>
import { getTitle } from 'api/cunponManagements'
import { savePrize, infoPrize } from 'api/applyManagements'
export default {
data() {
return {
demoImg:'',
or: '',
BASE_API: process.env.BASE_API,
couponData: [],
dialogVisible: false,
value4: '',
input: '',
iconPath: '',
options: [
{
id: 1,
name: '奖品'
},
{
id: 2,
name: '优惠券'
},
{
id: 0,
name: '谢谢参与'
}
],
table: [
{
serialNumber: '1',
name: '', //奖品名称
iconPath:'', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '2',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '3',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '4',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '5',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '6',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '7',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '8',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
}
]
}
},
created() {
this.getTitleFn()
},
methods: {
//优惠券
discount(val){
this.table[val].name = ''
this.table[val].goodsId = ''
// if (!this.table[val].goodsId ||) {
// this.table[val].goodsId = ''
// console.log(this.table);
// }
},
//图片上传
handleSuccess(res, file,list,id) {
this.table[id].iconPath = res.data
},
//弹窗关闭
closePop() {
this.table = [
{
serialNumber: '1',
name: '', //奖品名称
iconPath:
'https://xxtest.upyuns.com/image/admin/2019-12-05/37.jpg', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '2',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '3',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '4',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '5',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '6',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '7',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
},
{
serialNumber: '8',
name: '', //奖品名称
iconPath: '', //奖品图片
totalStock: '', //奖品数量
probability: '', //中奖概率
dayMaxUse: '', //最大次数
prizeGoodsType: '', //奖品类型
goodsId: '', //优惠券id
id: null
}
]
},
//设置弹窗
setOnline(val) {
this.or = val
this.dialogVisible = true
infoPrize().then(data => {
if (val == 1) {
if (data.data.onlinePrize != ''){
data.data.onlinePrize.forEach(element => {
if (!element.goodsId) {
element.goodsId = ''
}
if (!element.totalStock) {
element.totalStock = ''
}
if (!element.dayMaxUse) {
element.dayMaxUse = ''
}
});
}
this.table = data.data.onlinePrize
} else {
if (data.data.localePrize != ''){
data.data.localePrize.forEach(element => {
if (!element.goodsId) {
element.goodsId = ''
}
if (!element.totalStock) {
element.totalStock = ''
}
if (!element.dayMaxUse) {
element.dayMaxUse = ''
}
});
}
this.table = data.data.localePrize
}
})
},
//保存
save() {
var flig = true;
this.table.forEach(element => {
if(element.prizeGoodsType == 1 || element.prizeGoodsType === ''){
if (element.name === '' || element.iconPath === '' || element.totalStock === '' || element.probability === '' || element.dayMaxUse === '') {
flig = false
return false
}
}
if(element.prizeGoodsType == 2 || element.prizeGoodsType === ''){
if (element.goodsId === '' || element.iconPath === '' || element.totalStock === '' || element.probability === '' || element.dayMaxUse === '') {
flig = false
return false
}
}
if(element.prizeGoodsType == 0 || element.prizeGoodsType === ''){
if (element.name === '' || element.iconPath === '' || element.probability === '') {
flig = false
return false
}
}
if(!flig){
return true
}
});
// console.log(flig);
if(flig){
let params = []
this.table.forEach(element => {
let defaults = {
serialNumber: element.serialNumber,
name: element.name,
iconPath: element.iconPath,
dayMaxUse: element.dayMaxUse,
totalStock: element.totalStock,
probability: element.probability,
type: this.or,
prizeGoodsType: element.prizeGoodsType,
goodsId: element.goodsId,
id: element.id
}
params.push(defaults)
})
savePrize(params).then(data => {
if (data.status == 200) {
this.$message.success('设置成功')
this.dialogVisible = false
} else {
this.$message.error(data.message)
}
})
// console.log(params);
}else{
this.$message('必填项不能为空')
}
},
//优惠券列表
getTitleFn() {
getTitle().then(data => {
if (data.status == 200) {
this.couponData = data.data
} else {
this.$message.error('优惠券获取失败')
}
})
}
}
}
</script>
<style scoped>
.el-dialog--small {
width: 60% !important;
}
.avatar-uploader-icon {
width: auto;
height: auto;
}
li {
list-style: none;
overflow: hidden;
/* text-align: center; */
}
li p {
float: left;
margin-left: 10px;
}
li:nth-child(1) p {
color: #ccc;
}
li p:nth-child(1) {
width: 8%;
margin-top: 20px;
}
li p:nth-child(2) {
width: 18%;
}
li p:nth-child(3) {
width: 18%;
}
li p:nth-child(4) {
width: 8%;
}
li p:nth-child(5) {
width: 13%;
}
li p:nth-child(6) {
width: 13%;
}
li p:nth-child(7) {
width: 8%;
}
.online,
.local {
width: 49%;
display: inline-block;
}
.online {
float: left;
}
.local {
float: right;
}
h4 {
text-align: center;
font-size: 20px;
font-weight: 400;
}
table {
border: 1px solid #d9d9d9;
margin: 0 auto;
}
td {
width: 150px;
height: 150px;
text-align: center;
}
</style>
\ No newline at end of file
<template>
<div class="app-container calendar-list-container">
<el-form :inline="true" label-width="100px" label-position="right">
<el-form-item label="日期">
<el-date-picker v-model="time" type="daterange" placeholder="选择日期范围" @change="changeTime"></el-date-picker>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="listQuery.phone" placeholder="请输入手机号" clearable style="width:200px"></el-input>
</el-form-item>
<el-form-item label="类型">
<el-select v-model="listQuery.prizeType" clearable placeholder="请选择抽奖类型" @change="changeClass">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="search">搜索</el-button>
<el-button type="primary" @click="clearSearch">清空搜索</el-button>
<el-button type="primary" :loading="excelLoading" @click="downloadExcel">导出</el-button>
</el-form>
<div class="information">
<h4>数据概况.</h4>
<ul>
<li>
<p>{{information.onLineNum}}</p>
<p>线上抽奖触发(次)</p>
</li>
<li>
<p>{{information.onLineWineNum}}</p>
<p>线上中奖个数(个)</p>
</li>
<li>
<p>{{information.localeNum}}</p>
<p>现场抽奖触发(次)</p>
</li>
<li>
<p>{{information.localeWineNum}}</p>
<p>现场中奖个数(个)</p>
</li>
</ul>
</div>
<el-table
:data="tableData"
border
header-align="center"
v-loading="loadingTab"
style="margin-top:20px"
>
<el-table-column label="序号" align="center" width="70">
<template scope="scope">
<span>{{scope.$index+(listQuery.page - 1) * listQuery.limit + 1}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="用户名" align="center"></el-table-column>
<el-table-column prop="phone" label="电话" align="center"></el-table-column>
<el-table-column prop="positionName" label="身份" align="center"></el-table-column>
<el-table-column label="发放类型" align="center">
<template scope="scope">
<span>{{scope.row.prizeType == 1 ? '线上' : '现场'}}</span>
</template>
</el-table-column>
<el-table-column prop="prizeName" label="抽奖礼品" align="center"></el-table-column>
<el-table-column prop="expiryDateCode" label="兑换码" align="center">
<template scope="scope">
<span>{{scope.row.expiryDateCode || '无'}}</span>
</template>
</el-table-column>
<el-table-column prop="lotteryTime" label="中奖时间" align="center"></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30, 50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
style="margin-top:20px"
></el-pagination>
</div>
</template>
<script>
import { applyListWin, excelWin } from 'api/applyManagements'
export default {
created() {
this.getList()
},
data() {
return {
information: {},
excelLoading: false,
loadingTab: false,
tableData: [],
time: '',
total: null, //总页数
options: [
{
id: '',
name: '全部'
},
{
id: 1,
name: '线上'
},
{
id: 2,
name: '现场'
}
],
listQuery: {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 2,
prizeType: null,
hasWinning: 2
}
}
},
methods: {
//列表
getList() {
this.loadingTab = true
applyListWin(this.listQuery).then(data => {
if (data.status == 200) {
this.tableData = data.data.activityWinningRecords
this.total = data.data.totalCount
if (this.listQuery.page == 1) {
this.information =
data.data.activityWinningRecordTotalVo
}
} else {
this.$message(data.message)
}
})
setTimeout(() => {
this.loadingTab = false
}, 300)
},
//搜索
search() {
this.listQuery.page = 1
this.getList()
},
//抽奖类型筛选
changeClass() {
this.listQuery.page = 1
this.getList()
},
//清空搜索
clearSearch() {
this.listQuery = {
page: 1,
limit: 10,
startTime: null,
endTime: null,
phone: null,
activityId: 1
}
},
//导出
downloadExcel() {
this.excelLoading = true
var u = navigator.userAgent,
app = navigator.appVersion
excelWin(this.listQuery, { responseType: 'arraybuffer' }).then(
res => {
const content = res
const blob = new Blob([content], {
type: 'application/vnd.ms-excel'
})
const fileName = '中奖列表.xlsx'
if (u.indexOf('Edge') > -1) {
window.navigator.msSaveBlob(blob, fileName)
} else {
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
}
this.excelLoading = false
}
)
},
//时间筛选
changeTime(val) {
this.listQuery.page = 1
if (!!val) {
let value = val.split(' - ')
this.listQuery.startDate = value[0] + ' 00:00:00'
this.listQuery.endDate = value[1] + ' 23:59:59'
this.getList()
} else {
this.listQuery.startDate = null
this.listQuery.endDate = null
this.getList()
}
},
//页码
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
//分页
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
}
}
}
</script>
<style scoped>
.information {
border: 1px solid #ccc;
margin: 20px 0;
padding: 10px 20px;
}
.information h4 {
color: #333;
font-size: 16px;
font-weight: normal;
}
.information ul {
padding: 0;
border-top: 1px solid #eee;
padding: 10px 30px;
overflow: hidden;
}
.information li {
list-style: none;
text-align: center;
float: left;
width: 25%;
border-right: 1px solid #eee;
}
.information li:last-child {
border: none;
}
</style>
\ No newline at end of file
......@@ -67,7 +67,7 @@
<td>
<p>取:{{timestamp(new Date(orderDetailInfo.orderRentVehicleDetail.startTime))}}</p>
<p>还:{{timestamp(new Date(orderDetailInfo.orderRentVehicleDetail.endTime))}}</p>
<p v-show="orderDetailInfo.orderRentVehicleDetail.dayNum">租借天数{{orderDetailInfo.orderRentVehicleDetail.dayNum}}</p>
<p v-show="orderDetailInfo.orderRentVehicleDetail.dayNum">租借天数{{orderDetailInfo.orderRentVehicleDetail.dayNum+orderDetailInfo.orderRentVehicleDetail.delayAddDays}}</p>
</td>
<td>{{orderDetailInfo.startCompanyName}}</td>
<td>{{orderDetailInfo.endCompanyName}}</td>
......@@ -123,7 +123,9 @@
<td>
<el-button size="small" type="text" v-if="orderDetailInfo.status==4" @click="resetCar">重新配车</el-button>
</td>
<td></td>
<td>
<el-button size="small" type="text" v-if="orderDetailInfo.status==5 || orderDetailInfo.status==4" @click="postponePop = true">延期还车</el-button>
</td>
<td></td>
<td>
<el-button
......@@ -202,6 +204,20 @@
<el-button style="margin-top:20px" type="primary" @click="confirm('returnForm')">确定</el-button>
</el-form>
</el-dialog>
<!-- 延期还车 -->
<div class="modal_modal" v-show="postponePop"></div>
<el-dialog title="延期还车" :visible.sync="postponePop" :append-to-body="true" :modal="false" @close="closePostpone">
<el-date-picker
v-model="delayEndTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
<el-checkbox v-model="needDamageSafe" label="1" border>不计免赔</el-checkbox>
<p><el-button style="margin-top:20px" type="primary" @click="postponeBtn">确定</el-button></p>
</el-dialog>
</el-dialog>
</template>
......@@ -211,7 +227,7 @@ import ElInput from '../../../../node_modules/element-ui/packages/input/src/inpu
import ElCol from 'element-ui/packages/col/src/col'
import ElFormItem from '../../../../node_modules/element-ui/packages/form/src/form-item.vue'
import ElForm from '../../../../node_modules/element-ui/packages/form/src/form.vue'
import { editObj } from 'api/vehicle/vehicleInfo'
import { editObj,postponeApi} from 'api/vehicle/vehicleInfo'
import { getAll, updateEndCompany } from 'api/base_info/branch_company'
import {getYMD} from 'src/utils/dateUtils'
export default {
......@@ -225,6 +241,9 @@ export default {
},
data() {
return {
needDamageSafe:null,
delayEndTime:null,//延期还车时间
postponePop:false,
returnForm: {
endCompanyId: ''
},
......@@ -271,7 +290,34 @@ export default {
this.getAllFn()
},
methods: {
//延期还车弹窗关闭
closePostpone(){
this.delayEndTime = null
},
//延期还车
postponeBtn(){
if (!this.delayEndTime) {
this.$message.error("延期时间不能为空")
return false
}else{
let time = new Date(this.delayEndTime).getTime()
let params = {
no:this.orderDetailInfo.no,
delayEndTime:time,
needDamageSafe:this.needDamageSafe ? 1 : null
}
postponeApi(params).then(data=>{
if (data.status == 200) {
this.$message.success('操作成功')
this.postponePop = false
this.dialogVisible = false
this.$emit('rentOrderDetailDialogEvent', true)
}else{
this.$message.error(data.message)
}
})
}
},
orderInfo(val) {
if (this.orderDetailInfo.costDetail.children) {
let info = this.orderDetailInfo.costDetail.children.filter(item=>item.key == val)
......
......@@ -239,8 +239,12 @@ export default {
delete this.ruleForm.id
this.successApi()
} else {
this.ruleForm.startDate = this.ruleForm.date[0]
this.ruleForm.endDate = this.ruleForm.date[1]
this.ruleForm.startDate = this.format(
this.ruleForm.date[0]
)
this.ruleForm.endDate = this.format(
this.ruleForm.date[1]
)
!this.activeId
? ''
: (this.ruleForm.id = this.activeId)
......
......@@ -14,7 +14,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="车型简介" prop="intro">
<el-input class="cx" v-model="form.intro" :rows="9" type="textarea" placeholder="请输入车型简介" ></el-input>
<el-input class="cx" v-model="form.intro" :rows="9" type="textarea" placeholder="请输入车型简介"></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -165,6 +165,13 @@
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload>
</el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="全景链接">
<el-input v-model="form.panoramaUrl" type="text" placeholder="请输入全景链接"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="alt">
......@@ -290,675 +297,679 @@
}
</style>
<script>
// import Editor from "../../modal/editorTool";//富文本
import UE from '../../modal/Ueditor';//百度ue富文本
import {
getOneTypeById,
getAllParentLabel,
getLabelList,
updateVehicleModel,
addVehicleModel
} from 'api/vehicleType';
import rsCode from '../../../utils/rsCode';
import {
getToken
} from '../../../utils/auth';
import {mapGetters} from 'vuex';
import ElRow from "element-ui/packages/row/src/row";
import ElCol from "element-ui/packages/col/src/col";
import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
import ElRadio from "../../../../node_modules/element-ui/packages/radio/src/radio.vue";
// import Editor from "../../modal/editorTool";//富文本
import UE from '../../modal/Ueditor';//百度ue富文本
import {
getOneTypeById,
getAllParentLabel,
getLabelList,
updateVehicleModel,
addVehicleModel
} from 'api/vehicleType';
import rsCode from '../../../utils/rsCode';
import {
getToken
} from '../../../utils/auth';
import {mapGetters} from 'vuex';
import ElRow from "element-ui/packages/row/src/row";
import ElCol from "element-ui/packages/col/src/col";
import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
import ElRadio from "../../../../node_modules/element-ui/packages/radio/src/radio.vue";
export default {
props: ["oneRow", "title", "brandlist", "numberList", "vehicleTypeList_btn_edit"],
name: 'upkeepDialog',
components: {
ElRadio,
ElFormItem,
ElCol,
ElRow,
UE
export default {
props: ["oneRow", "title", "brandlist", "numberList", "vehicleTypeList_btn_edit"],
name: 'upkeepDialog',
components: {
ElRadio,
ElFormItem,
ElCol,
ElRow,
UE
},
data() {
return {
imgPosterFlag: false,
percent_poster: 0,
BASE_API: process.env.BASE_API,
percent: 0,//上传进度
imgFlag: false,
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
data() {
return {
imgPosterFlag: false,
percent_poster: 0,
BASE_API: process.env.BASE_API,
percent: 0,//上传进度
imgFlag: false,
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
labelList: [],//全部车型标签
fileList2: [],
activeName2: '',//房车详情
form: {
alt: '',
imgTitle: undefined,
imgKeyword: undefined,
imgDesc: undefined,
coverPic:'',
pPrice: 0,//普通会员
hPrice: 0,//黄金会员
zPrice: 0,//钻石会员
name: undefined,//房车名称
config: "",//房车配置
keyword: "",//房车关键标签
modelsDetails: "",//房车详情
modelParam: "",//房车参数
picture: "",//轮播图
price: 0,//租车价格
deposit: 20000,//总押金
vioDeposit: 0,//违章押金
hotSign: "2",//热门车型 1、热门 2、非热门
rentDiscountStatus: "0",//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
rentDiscountPrice: 0,//租车优惠价格 固定优化价格
buyPrice: 0,//购买价格
intro: '',
posterBackground: '',//海报背景
},
showDestinationVisible: false,//编辑目的地
showPathWayVisible: false,//编辑途径地
rules: {
name: {
type: 'string',
required: true,
message: '请输入车型名称',
trigger: 'blur'
}
},
checkList: [],//已选中的标签
allCompanies: {},
allCompaniesArr: [],
oneTypeDialogVisible: false,
allUpkeepItems: null,
dialogStatus: undefined,
allLabelList: [],//全部标签
showName: "",
configDialogVisible: false,//配置弹框
modalTitle: "修改房车配置",
configItem: {parent: {isMore: 0}},//待编辑配置数据
configItemChildren: [],//待配置的二级标签
childNameLists: [],
childName: "",
totalLabel: [],//关键标签id
canSelectLabel: [],//可选择的二级标签
selectedLabel: [],//已选中的标签
keywordDialogVisible: false,//关键标签弹框
}
},
created() {
},
watch: {
oneTypeDialogVisible(newValue, oldValue) {
if (!newValue) {
this.cleanForm();
}
},
labelList: [],//全部车型标签
fileList2: [],
activeName2: '',//房车详情
form: {
alt: '',
imgTitle: undefined,
imgKeyword: undefined,
imgDesc: undefined,
coverPic: '',
pPrice: 0,//普通会员
hPrice: 0,//黄金会员
zPrice: 0,//钻石会员
name: undefined,//房车名称
config: "",//房车配置
keyword: "",//房车关键标签
modelsDetails: "",//房车详情
modelParam: "",//房车参数
picture: "",//轮播图
price: 0,//租车价格
deposit: 20000,//总押金
vioDeposit: 0,//违章押金
hotSign: "2",//热门车型 1、热门 2、非热门
rentDiscountStatus: "0",//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
rentDiscountPrice: 0,//租车优惠价格 固定优化价格
buyPrice: 0,//购买价格
intro: '',
posterBackground: '',//海报背景
panoramaUrl:undefined,
},
mounted() {
this.cleanForm();
this.getAllTag();
this.oneTypeDialogVisible = true;
showDestinationVisible: false,//编辑目的地
showPathWayVisible: false,//编辑途径地
rules: {
name: {
type: 'string',
required: true,
message: '请输入车型名称',
trigger: 'blur'
}
},
computed: {
...mapGetters([
'elements',
'vehicleWarningMsgType'
]),
getHeaderWithToken() {
return {Authorization: getToken()};
}
},
methods: {
changeConfig() {
console.log(this.configItemChildren);
},
checkList: [],//已选中的标签
allCompanies: {},
allCompaniesArr: [],
oneTypeDialogVisible: false,
allUpkeepItems: null,
dialogStatus: undefined,
allLabelList: [],//全部标签
showName: "",
configDialogVisible: false,//配置弹框
modalTitle: "修改房车配置",
configItem: {parent: {isMore: 0}},//待编辑配置数据
configItemChildren: [],//待配置的二级标签
childNameLists: [],
childName: "",
totalLabel: [],//关键标签id
canSelectLabel: [],//可选择的二级标签
selectedLabel: [],//已选中的标签
keywordDialogVisible: false,//关键标签弹框
}
},
created() {
},
watch: {
oneTypeDialogVisible(newValue, oldValue) {
if (!newValue) {
this.cleanForm();
}
},
},
mounted() {
this.cleanForm();
this.getAllTag();
this.oneTypeDialogVisible = true;
},
computed: {
...mapGetters([
'elements',
'vehicleWarningMsgType'
]),
getHeaderWithToken() {
return {Authorization: getToken()};
}
},
methods: {
changeConfig() {
console.log(this.configItemChildren);
},
/**
* 获取全部一级、二级分类数据
* */
getAllTag() {
let listQuery = {sort: 1, page: 1, limit: 10};
let that = this;
getLabelList(listQuery).then(response => {
let listRs = undefined;
if (!this.$utils.isEmpty(response.data)) {
listRs = response.data;
response.data.map(function (item) {
item.childName = [];
})
}
this.labelList = listRs;
if (this.title == "编辑") {
let row = this.oneRow;
this.getOne(row.id);
} else {
this.activeName2 = "first";
let tagArr = [];
this.labelList.map(function (iitem) {
if (iitem.children.length > 0) {
tagArr.push(iitem.children[0].id);
}
});
this.form.brand = this.brandlist[0].id;
this.form.number = this.numberList[0].id;
this.labelList.map(function (iitem) {
let p = [];
let pp = [];
let aa = [];
iitem.childNameLists = [];
iitem.children.map(function (c) {
tagArr.map(function (ii) {
if (c.id == ii) {
p.push(c);
aa.push(c.name);
pp.push(c.id);
}
});
});
iitem.childNameList = p;
iitem.childNameLists = pp;
iitem.selectChild = aa.join(",");
});
/**
* 获取全部一级、二级分类数据
* 关键标签可选的二级分类
* */
getAllTag() {
let listQuery = {sort: 1, page: 1, limit: 10};
let that = this;
getLabelList(listQuery).then(response => {
let listRs = undefined;
if (!this.$utils.isEmpty(response.data)) {
listRs = response.data;
response.data.map(function (item) {
item.childName = [];
})
}
this.labelList = listRs;
if (this.title == "编辑") {
let row = this.oneRow;
this.getOne(row.id);
} else {
this.activeName2 = "first";
let tagArr = [];
this.labelList.map(function (iitem) {
if (iitem.children.length > 0) {
tagArr.push(iitem.children[0].id);
}
});
this.form.brand = this.brandlist[0].id;
this.form.number = this.numberList[0].id;
this.labelList.map(function (iitem) {
let p = [];
let pp = [];
let aa = [];
iitem.childNameLists = [];
iitem.children.map(function (c) {
tagArr.map(function (ii) {
if (c.id == ii) {
p.push(c);
aa.push(c.name);
pp.push(c.id);
}
});
});
iitem.childNameList = p;
iitem.childNameLists = pp;
iitem.selectChild = aa.join(",");
});
/**
* 关键标签可选的二级分类
* */
let labelArr = [];
that.labelList.map(function (i) {
i.childNameLists.map(function (ii) {
labelArr.push(ii)
});
});
that.totalLabel = labelArr;
let canSelectLabel = [];
that.labelList.map(function (i) {
i.children.map(function (ic) {
that.totalLabel.map(function (c) {
if (ic.id == c) {
canSelectLabel.push(ic);
}
})
})
});
this.canSelectLabel = canSelectLabel;
let labelArr = [];
that.labelList.map(function (i) {
i.childNameLists.map(function (ii) {
labelArr.push(ii)
});
});
that.totalLabel = labelArr;
let canSelectLabel = [];
that.labelList.map(function (i) {
i.children.map(function (ic) {
that.totalLabel.map(function (c) {
if (ic.id == c) {
canSelectLabel.push(ic);
}
})
})
});
this.canSelectLabel = canSelectLabel;
this.form.config = tagArr.join(",");
}
this.form.config = tagArr.join(",");
}
});
},
/**
* 封面图上传进度
* */
uploadProcess(event, file, fileList) {
this.imgFlag = true;
console.log(event.percent);
this.percent = Math.floor(event.percent);
},
/**
* 海报背景图上传进度
* */
uploadPosterProcess(event, file, fileList) {
this.imgPosterFlag = true;
console.log(event.percent);
this.percent_poster = Math.floor(event.percent);
},
/**
* 封面图上传
* **/
handleAvatarSuccess(res, file) {
this.percent = 0;
this.imgFlag = false;
this.form.coverPic = res.data;
},
/**
* 海报背景上传
* **/
handlePosterSuccess(res, file) {
this.percent_poster = 0;
this.imgPosterFlag = false;
this.form.posterBackground = res.data;
},
/**
* 创建
* */
create(formName) {
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
let params = {
number: this.form.number,//乘卧数量
brand: this.form.brand,//房车品牌
name: this.form.name,//房车名称
config: this.totalLabel.join(","),//房车配置
keyword: this.form.keyword,//房车关键标签
modelsDetails: this.form.modelsDetails,//房车详情
modelParam: JSON.stringify(this.form.modelParam),//房车参数
picture: this.form.picture,//轮播图
coverPic: this.form.coverPic,//封面图
posterBackground: this.form.posterBackground,//海报背景
price: this.form.price,//租车价格
deposit: this.form.deposit,//总押金
vioDeposit: this.form.vioDeposit,
hotSign: this.form.hotSign,//热门车型
rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
buyPrice: this.form.buyPrice,//购买价格
alt: this.form.alt,//seo 标签优化
intro: this.form.intro,
imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc,
panoramaUrl: this.form.panoramaUrl,
};
if (this.form.rentDiscountStatus == 2) {
params.rentDiscountPrice = this.form.pPrice + "," + this.form.hPrice + "," + this.form.zPrice//租车优惠价格 固定优化价格
}
console.log(params);
console.log(this.form);
addVehicleModel(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
});
},
/**
* 封面图上传进度
* */
uploadProcess(event, file, fileList) {
this.imgFlag = true;
console.log(event.percent);
this.percent = Math.floor(event.percent);
},
/**
* 海报背景图上传进度
* */
uploadPosterProcess(event, file, fileList) {
this.imgPosterFlag = true;
console.log(event.percent);
this.percent_poster = Math.floor(event.percent);
},
/**
* 封面图上传
* **/
handleAvatarSuccess(res, file) {
this.percent = 0;
this.imgFlag = false;
this.form.coverPic = res.data;
},
/**
* 海报背景上传
* **/
handlePosterSuccess(res, file) {
this.percent_poster = 0;
this.imgPosterFlag = false;
this.form.posterBackground = res.data;
},
/**
* 创建
* */
create(formName) {
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
let params = {
number: this.form.number,//乘卧数量
brand: this.form.brand,//房车品牌
name: this.form.name,//房车名称
config: this.totalLabel.join(","),//房车配置
keyword: this.form.keyword,//房车关键标签
modelsDetails: this.form.modelsDetails,//房车详情
modelParam: JSON.stringify(this.form.modelParam),//房车参数
picture: this.form.picture,//轮播图
coverPic: this.form.coverPic,//封面图
posterBackground: this.form.posterBackground,//海报背景
price: this.form.price,//租车价格
deposit: this.form.deposit,//总押金
vioDeposit: this.form.vioDeposit,
hotSign: this.form.hotSign,//热门车型
rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
buyPrice: this.form.buyPrice,//购买价格
alt: this.form.alt,//seo 标签优化
intro: this.form.intro,
imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc,
};
if (this.form.rentDiscountStatus == 2) {
params.rentDiscountPrice = this.form.pPrice + "," + this.form.hPrice + "," + this.form.zPrice//租车优惠价格 固定优化价格
}
console.log(params);
console.log(this.form);
addVehicleModel(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
});
this.$emit("oneDialogEvent", true);
} else {
this.$notify({
title: '创建失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
} else {
return;
}
this.$emit("oneDialogEvent", true);
} else {
this.$notify({
title: '创建失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
},
/**
* 编辑
* */
update(formName) {
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
let params = {
id: this.form.id,
number: this.form.number,//乘卧数量
brand: this.form.brand,//房车品牌
name: this.form.name,//房车名称
config: this.totalLabel.join(","),//房车配置
keyword: this.form.keyword,//房车关键标签
modelsDetails: this.form.modelsDetails,//房车详情
modelParam: JSON.stringify(this.form.modelParam),//房车参数
picture: this.form.picture,//轮播图
price: this.form.price,//租车价格
coverPic: this.form.coverPic,//封面图
posterBackground: this.form.posterBackground,//海报背景
deposit: this.form.deposit,//总押金
vioDeposit: this.form.vioDeposit,
hotSign: this.form.hotSign,//热门车型
rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
}
});
} else {
return;
}
});
},
/**
* 编辑
* */
update(formName) {
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
let params = {
id: this.form.id,
number: this.form.number,//乘卧数量
brand: this.form.brand,//房车品牌
name: this.form.name,//房车名称
config: this.totalLabel.join(","),//房车配置
keyword: this.form.keyword,//房车关键标签
modelsDetails: this.form.modelsDetails,//房车详情
modelParam: JSON.stringify(this.form.modelParam),//房车参数
picture: this.form.picture,//轮播图
price: this.form.price,//租车价格
coverPic: this.form.coverPic,//封面图
posterBackground: this.form.posterBackground,//海报背景
deposit: this.form.deposit,//总押金
vioDeposit: this.form.vioDeposit,
hotSign: this.form.hotSign,//热门车型
rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
// rentDiscountPrice:this.form.pPrice+","+this.form.hPrice+","+this.form.zPrice,//租车优惠价格 固定优化价格
buyPrice: this.form.buyPrice,//购买价格
alt: this.form.alt,//seo 标签优化
intro: this.form.intro,
imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc,
};
if (this.form.rentDiscountStatus == 2) {
params.rentDiscountPrice = this.form.pPrice + "," + this.form.hPrice + "," + this.form.zPrice//租车优惠价格 固定优化价格
}
console.log(params);
console.log(this.form);
updateVehicleModel(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
});
this.$emit("oneDialogEvent", true);
} else {
this.$notify({
title: '编辑失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
} else {
return;
}
buyPrice: this.form.buyPrice,//购买价格
alt: this.form.alt,//seo 标签优化
intro: this.form.intro,
imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc,
panoramaUrl:this.form.panoramaUrl
};
if (this.form.rentDiscountStatus == 2) {
params.rentDiscountPrice = this.form.pPrice + "," + this.form.hPrice + "," + this.form.zPrice//租车优惠价格 固定优化价格
}
console.log(params);
console.log(this.form);
updateVehicleModel(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
});
},
/**
* 关闭编辑车型
*/
cancel() {
this.cleanForm();
this.$emit("oneDialogEvent", false);
},
/**
* 编辑关键标签
* */
editLabe() {
this.keywordDialogVisible = true;
},
/**
* 删除房车参数
* */
delModelParam(index) {
this.form.modelParam.splice(index, 1);
},
/**
* 添加房车参数
* */
addModelParam() {
console.log(this.form.modelParam);
let c = {
key: "",
val: ""
};
this.form.modelParam.push(c);
},
/**
* 关闭关键标签配置
* */
cancelHandelLabel() {
this.keywordDialogVisible = false;
},
/**
* 更新关键标签
* */
updateLabel() {
let that = this;
this.keywordDialogVisible = false;
console.log(this.selectedLabel);
let a = [];
that.labelList.map(function (i) {
i.children.map(function (cc) {
that.selectedLabel.map(function (ii) {
if (ii == cc.id) {
a.push(cc.name);
}
})
});
this.$emit("oneDialogEvent", true);
} else {
this.$notify({
title: '编辑失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
that.form.keyword = a.join(",");
},
/**
* 关闭房车配置弹框
* */
cancelHandel() {
this.configDialogVisible = false;
},
/**
* 更新房车配置弹框
* **/
updateConfig() {
let that = this;
this.configDialogVisible = false;
if (this.configItem.parent.isMore == 0) {
//单选
console.log(this.childName);
that.labelList.map(function (i) {
if (i.parent.id == that.configItem.parent.id) {
i.children.map(function (ic) {
if (ic.id == that.childName) {
i.selectChild = ic.name;
let a = [];
i.childNameLists[0] = that.childName;
}
})
}
});
console.log(that.labelList);
} else {
if (this.childNameLists.length <= 0) {
return;
}
//多选
console.log(this.childNameLists);
that.labelList.map(function (i) {
let a = [];
if (i.parent.id == that.configItem.parent.id) {
i.children.map(function (ic) {
that.childNameLists.map(function (cc) {
if (cc == ic.id) {
a.push(ic.name);
}
});
i.selectChild = a.join(",");
i.childNameLists = that.childNameLists;
})
}
});
}
});
} else {
return;
}
});
},
/**
* 关闭编辑车型
*/
cancel() {
this.cleanForm();
this.$emit("oneDialogEvent", false);
},
/**
* 编辑关键标签
* */
editLabe() {
this.keywordDialogVisible = true;
},
/**
* 删除房车参数
* */
delModelParam(index) {
this.form.modelParam.splice(index, 1);
},
/**
* 添加房车参数
* */
addModelParam() {
console.log(this.form.modelParam);
let c = {
key: "",
val: ""
};
this.form.modelParam.push(c);
},
/**
* 关闭关键标签配置
* */
cancelHandelLabel() {
this.keywordDialogVisible = false;
},
/**
* 更新关键标签
* */
updateLabel() {
let that = this;
this.keywordDialogVisible = false;
console.log(this.selectedLabel);
let a = [];
that.labelList.map(function (i) {
i.children.map(function (cc) {
that.selectedLabel.map(function (ii) {
if (ii == cc.id) {
a.push(cc.name);
}
})
});
});
that.form.keyword = a.join(",");
},
/**
* 关闭房车配置弹框
* */
cancelHandel() {
this.configDialogVisible = false;
},
/**
* 更新房车配置弹框
* **/
updateConfig() {
debugger
let that = this;
this.configDialogVisible = false;
if (this.configItem.parent.isMore == 0) {
//单选
console.log(this.childName);
that.labelList.map(function (i) {
if (i.parent.id == that.configItem.parent.id) {
i.children.map(function (ic) {
if (ic.id == that.childName) {
i.selectChild = ic.name;
let a = [];
i.childNameLists[0] = that.childName;
}
let labelArr = [];
let labelStr = that.form.keyword.split(",");
that.labelList.map(function (i) {
i.childNameLists.map(function (ii) {
labelArr.push(ii)
});
})
}
});
console.log(that.labelList);
} else {
if (this.childNameLists.length <= 0) {
return;
}
//多选
console.log(this.childNameLists);
that.labelList.map(function (i) {
let a = [];
if (i.parent.id == that.configItem.parent.id) {
i.children.map(function (ic) {
that.childNameLists.map(function (cc) {
if (cc == ic.id) {
a.push(ic.name);
}
});
i.selectChild = a.join(",");
i.childNameLists = that.childNameLists;
})
}
});
}
let labelArr = [];
let labelStr = that.form.keyword.split(",");
that.labelList.map(function (i) {
i.childNameLists.map(function (ii) {
labelArr.push(ii)
});
// let c = i.selectChild.split(",");
// c.map(function (cc) {
// labelStr.push(cc);
// })
});
this.totalLabel = labelArr;//房车配置选中的全部标签id
});
this.totalLabel = labelArr;//房车配置选中的全部标签id
// that.form.keyword = labelStr.join(",");
that.form.keyword = "";// 改变房车配置时,清空关键标签显示的文字
that.selectedLabel = [];// 改变房车配置时,清空关键标签选中的id
that.form.keyword = "";// 改变房车配置时,清空关键标签显示的文字
that.selectedLabel = [];// 改变房车配置时,清空关键标签选中的id
let canSelectLabel = [];
that.labelList.map(function (i) {
i.children.map(function (ic) {
that.totalLabel.map(function (c) {
if (ic.id == c) {
canSelectLabel.push(ic);
}
})
})
});
this.canSelectLabel = canSelectLabel;//房车配置选中的全部标签,供关键标签选择使用
console.log(this.canSelectLabel);
console.log(this.totalLabel);
console.log(that.form.keyword);
},
/**
* editConfig
* */
editConfig(item) {
this.configDialogVisible = true;
this.childNameLists = [];
this.childName = undefined;
this.modalTitle = item.parent.name;
item.childNameList.map(function (ii) {
ii.showName = ii.id;
});
this.configItem = item;//待编辑配置信息
this.configItemChildren = item.children;//待配置的二级标签
this.childNameLists = item.childNameLists;
this.childName = item.childNameLists[0];
console.log(item);
},
/**
* 获取一条车型数据
* */
getOne(id) {
let that = this;
getOneTypeById(id).then(response => {
let item = response.data;
let pic = item.picture.split(",");
//轮播
let fileList2 = [];
pic.map(function (pp) {
let p = {
url: pp
};
fileList2.push(p);
});
this.fileList2 = fileList2;
let yhPrice = item.rentDiscountPrice ? item.rentDiscountPrice.split(",") : [];
if (item.rentDiscountPrice) {
item.pPrice = yhPrice.length >= 1 ? parseInt(yhPrice[0]) : 0;
item.hPrice = yhPrice.length >= 2 ? parseInt(yhPrice[1]) : 0;
item.zPrice = yhPrice.length >= 3 ? parseInt(yhPrice[2]) : 0;
}
item.rentDiscountStatus = item.rentDiscountStatus + "";
item.hotSign = item.hotSign + "";
item.brand = item.brand * 1;
item.number = item.number * 1;
item.modelParam = JSON.parse(item.modelParam);
let tagArr = response.data.config.split(",");
this.labelList.map(function (iitem) {
let p = [];
let pp = [];
let aa = [];
iitem.childNameLists = [];
iitem.children.map(function (c) {
tagArr.map(function (ii) {
if (c.id == ii) {
p.push(c);
aa.push(c.name);
pp.push(c.id);
}
});
});
iitem.childNameList = p;
iitem.childNameLists = pp;
iitem.selectChild = aa.join(",");
});
/**
* 关键标签可选的二级分类
* */
let labelArr = [];
that.labelList.map(function (i) {
i.childNameLists.map(function (ii) {
labelArr.push(ii)
});
});
that.totalLabel = labelArr;
let canSelectLabel = [];
that.labelList.map(function (i) {
i.children.map(function (ic) {
that.totalLabel.map(function (c) {
if (ic.id == c) {
canSelectLabel.push(ic);
}
})
})
});
this.canSelectLabel = canSelectLabel;
response.data.hotSign = response.data.hotSign ? response.data.hotSign : "2";
this.form = response.data;
this.activeName2 = "first";
})
},
/**
* 深拷贝
*/
objDeepCopy(source) {
var sourceCopy = source instanceof Array ? [] : {};
for (var item in source) {
sourceCopy[item] = typeof source[item] === 'object' ? objDeepCopy(source[item]) : source[item];
let canSelectLabel = [];
that.labelList.map(function (i) {
i.children.map(function (ic) {
that.totalLabel.map(function (c) {
if (ic.id == c) {
canSelectLabel.push(ic);
}
})
})
});
this.canSelectLabel = canSelectLabel;//房车配置选中的全部标签,供关键标签选择使用
console.log(this.canSelectLabel);
console.log(this.totalLabel);
console.log(that.form.keyword);
},
/**
* editConfig
* */
editConfig(item) {
this.configDialogVisible = true;
this.childNameLists = [];
this.childName = undefined;
this.modalTitle = item.parent.name;
item.childNameList.map(function (ii) {
ii.showName = ii.id;
});
this.configItem = item;//待编辑配置信息
this.configItemChildren = item.children;//待配置的二级标签
this.childNameLists = item.childNameLists;
this.childName = item.childNameLists[0];
console.log(item);
},
/**
* 获取一条车型数据
* */
getOne(id) {
let that = this;
getOneTypeById(id).then(response => {
let item = response.data;
let pic = item.picture.split(",");
//轮播
let fileList2 = [];
pic.map(function (pp) {
let p = {
url: pp
};
fileList2.push(p);
});
this.fileList2 = fileList2;
let yhPrice = item.rentDiscountPrice ? item.rentDiscountPrice.split(",") : [];
if (item.rentDiscountPrice) {
item.pPrice = yhPrice.length >= 1 ? parseInt(yhPrice[0]) : 0;
item.hPrice = yhPrice.length >= 2 ? parseInt(yhPrice[1]) : 0;
item.zPrice = yhPrice.length >= 3 ? parseInt(yhPrice[2]) : 0;
}
item.rentDiscountStatus = item.rentDiscountStatus + "";
item.hotSign = item.hotSign + "";
item.brand = item.brand * 1;
item.number = item.number * 1;
item.modelParam = JSON.parse(item.modelParam);
let tagArr = response.data.config.split(",");
this.labelList.map(function (iitem) {
let p = [];
let pp = [];
let aa = [];
iitem.childNameLists = [];
iitem.children.map(function (c) {
tagArr.map(function (ii) {
if (c.id == ii) {
p.push(c);
aa.push(c.name);
pp.push(c.id);
}
return sourceCopy;
},
querySearch(queryString, cb) {
let selectArry = [];
this.allCompaniesArr.map(function (item) {
item.value = item.name;
selectArry.push(item);
});
this.selectArry = selectArry;
var results = queryString ? selectArry.filter(this.createFilter(queryString)) : selectArry;
// 调用 callback 返回建议列表的数据
cb(results);
},
/**
* 富文本内容
* @param step
*/
editorReadyEvent(instance) {
let t = this;
instance.addListener('contentChange', () => {
t.form.modelsDetails = instance.getContent();
});
},
/**
* 删除banner
* */
handleRemove(file, fileList) {
let list = [];
fileList.map(function (item) {
if (item.url != file.url) {
list.push(item);
}
});
this.fileList2 = list;
let arr = [];
let picture = this.form.picture.split(",");
picture.map(function (item) {
if (item != file.url) {
arr.push(item);
}
});
this.form.picture = arr.join(",");
},
/**
* banner上传
* */
handleBannerSuccess(res, file) {
this.fileList2.push({url: res.data});
let c = [];
this.fileList2.map(function (i) {
c.push(i.url);
});
this.form.picture = c.join(",");
},
/**
* 清空旅游弹框数据
*/
cleanForm() {
this.activeName2 = "";
this.form = {
number: undefined,//乘卧数量
brand: undefined,//房车品牌
name: '',//房车名称
config:'',//房车配置
keyword: '',//房车关键标签
modelsDetails: '',//房车详情
modelParam: '',//房车参数
picture: '',//轮播图
coverPic: '',//封面图
posterBackground: '',//海报背景
price: undefined,//租车价格
deposit: 20000,//总押金
vioDeposit: '',
rentDiscountStatus: 0,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
buyPrice: undefined,//购买价格
alt: '',//seo 标签优化
intro: '',
imgTitle: '',
imgKeyword: '',
imgDesc: '',
pPrice: 0,//普通会员
hPrice: 0,//黄金会员
zPrice: 0,//钻石会员
hotSign: "2",//热门车型 1、热门 2、非热门
rentDiscountPrice: 0,//租车优惠价格 固定优化价格
});
});
iitem.childNameList = p;
iitem.childNameLists = pp;
iitem.selectChild = aa.join(",");
});
/**
* 关键标签可选的二级分类
* */
let labelArr = [];
that.labelList.map(function (i) {
i.childNameLists.map(function (ii) {
labelArr.push(ii)
});
});
that.totalLabel = labelArr;
let canSelectLabel = [];
that.labelList.map(function (i) {
i.children.map(function (ic) {
that.totalLabel.map(function (c) {
if (ic.id == c) {
canSelectLabel.push(ic);
}
}
})
})
});
this.canSelectLabel = canSelectLabel;
response.data.hotSign = response.data.hotSign ? response.data.hotSign : "2";
this.form = response.data;
this.activeName2 = "first";
})
},
/**
* 深拷贝
*/
objDeepCopy(source) {
var sourceCopy = source instanceof Array ? [] : {};
for (var item in source) {
sourceCopy[item] = typeof source[item] === 'object' ? objDeepCopy(source[item]) : source[item];
}
return sourceCopy;
},
querySearch(queryString, cb) {
let selectArry = [];
this.allCompaniesArr.map(function (item) {
item.value = item.name;
selectArry.push(item);
});
this.selectArry = selectArry;
var results = queryString ? selectArry.filter(this.createFilter(queryString)) : selectArry;
// 调用 callback 返回建议列表的数据
cb(results);
},
/**
* 富文本内容
* @param step
*/
editorReadyEvent(instance) {
let t = this;
instance.addListener('contentChange', () => {
t.form.modelsDetails = instance.getContent();
});
},
/**
* 删除banner
* */
handleRemove(file, fileList) {
let list = [];
fileList.map(function (item) {
if (item.url != file.url) {
list.push(item);
}
});
this.fileList2 = list;
let arr = [];
let picture = this.form.picture.split(",");
picture.map(function (item) {
if (item != file.url) {
arr.push(item);
}
});
this.form.picture = arr.join(",");
},
/**
* banner上传
* */
handleBannerSuccess(res, file) {
this.fileList2.push({url: res.data});
let c = [];
this.fileList2.map(function (i) {
c.push(i.url);
});
this.form.picture = c.join(",");
},
/**
* 清空旅游弹框数据
*/
cleanForm() {
this.activeName2 = "";
this.form = {
number: undefined,//乘卧数量
brand: undefined,//房车品牌
name: '',//房车名称
config: '',//房车配置
keyword: '',//房车关键标签
modelsDetails: '',//房车详情
modelParam: '',//房车参数
picture: '',//轮播图
coverPic: '',//封面图
posterBackground: '',//海报背景
price: undefined,//租车价格
deposit: 20000,//总押金
vioDeposit: '',
rentDiscountStatus: 0,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
buyPrice: undefined,//购买价格
alt: '',//seo 标签优化
intro: '',
imgTitle: '',
imgKeyword: '',
imgDesc: '',
pPrice: 0,//普通会员
hPrice: 0,//黄金会员
zPrice: 0,//钻石会员
hotSign: "2",//热门车型 1、热门 2、非热门
rentDiscountPrice: 0,//租车优惠价格 固定优化价格
}
}
}
}
</script>
<style>
.flex-aic {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment