Commit 39f0089b authored by hanfeng's avatar hanfeng

Merge remote-tracking branch 'origin/base-modify' into base-modify-hf

parents f5a45cbf f1d54f2a
module.exports = {
NODE_ENV: '"development"',
<<<<<<< HEAD
<<<<<<< HEAD
BASE_API:'"https://xxtest.upyuns.com"',//'"https://dev.dfangche.com"',//'"https://xxfcmgmt.upyuns.com"(正)',//http://10.1.37.192:9527(何), //https://xxtest.upyuns.com(测),10.1.37.246:9527(韩), 10.1.37.244(李斌)10.1.37.248:8765(小威)
=======
BASE_API:'"https://xxtest.upyuns.com"',//'"https://xxtest.upyuns.com"',//'"https://dev.dfangche.com"',//'"https://xxfcmgmt.upyuns.com"(正)',//http://10.1.37.192:9527(何), //https://xxtest.upyuns.com(测),10.1.37.246:9527(韩), 10.1.37.244(李斌)10.1.37.248:8765(小威)
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
=======
BASE_API:'"https://xxtest.upyuns.com"',//'"https://xxtest.upyuns.com"',//'"https://xxtest.upyuns.com"',//'"https://dev.dfangche.com"',//'"https://xxfcmgmt.upyuns.com"(正)',//http://10.1.37.192:9527(何), //https://xxtest.upyuns.com(测),10.1.37.246:9527(韩), 10.1.37.244(李斌)10.1.37.248:8765(小威)
>>>>>>> 4ae432b1473866a6dc59f10c1ec4b5c66a9ad5cc
BASE_API:'"https://xxtest.upyuns.com"',//'"https://dev.dfangche.com"',//'"https://xxfcmgmt.upyuns.com"(正)',//http://10.1.37.192:9527(何), //https://xxtest.upyuns.com(测),10.1.37.246:9527(韩), 10.1.37.244(李斌)10.1.37.248:8765(小威)
APP_ORIGIN: '"https://wallstreetcn.com"'
}
......@@ -5,29 +5,29 @@
<el-col :span="8">
<el-form-item label="峰会封面:">
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-progress="uploadProcess"
list-type="picture"
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-progress="uploadProcess"
list-type="picture"
>
<el-progress
v-show="imgFlag == true"
type="circle"
:percentage="percent"
style="margin-top: 20px"
v-show="imgFlag == true"
type="circle"
:percentage="percent"
style="margin-top: 20px"
></el-progress>
<img
v-if="$utils.isString(form.banner) && !$utils.isEmpty(form.banner) && !imgFlag"
:src="form.banner"
style="width:300px;max-height:300px;"
v-if="$utils.isString(form.banner) && !$utils.isEmpty(form.banner) && !imgFlag"
:src="form.banner"
style="width:300px;max-height:300px;"
/>
<i
v-else-if="!imgFlag"
class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
v-else-if="!imgFlag"
class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
</el-upload>
</el-form-item>
......@@ -37,12 +37,12 @@
<el-col>
<el-form-item label="峰会图片:">
<el-upload
:action="BASE_API+'/api/universal/file/app/unauth/pictureZip'"
list-type="picture-card"
:file-list="list"
:on-success="handlePictureCardPreview"
:on-remove="handleRemoveZip"
:before-upload="beforeAvatarUpload"
:action="BASE_API+'/api/universal/file/app/unauth/pictureZip'"
list-type="picture-card"
:file-list="list"
:on-success="handlePictureCardPreview"
:on-remove="handleRemoveZip"
:before-upload="beforeAvatarUpload"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -54,13 +54,13 @@
<el-col>
<el-form-item label="峰会视频:">
<el-upload
:action="BASE_API+'/api/universal/file/app/unauth/uploadVideo'"
list-type="picture-card"
:headers="getHeaderWithToken"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-upload="videoUpload"
:on-success="vidioSuccess"
:action="BASE_API+'/api/universal/file/app/unauth/uploadVideo'"
list-type="picture-card"
:headers="getHeaderWithToken"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-upload="videoUpload"
:on-success="vidioSuccess"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -91,290 +91,279 @@
</template>
<script>
import ElRow from 'element-ui/packages/row/src/row'
import ElInput from '../../../../node_modules/element-ui/packages/input/src/input.vue'
import ElCol from 'element-ui/packages/col/src/col'
import ElFormItem from '../../../../node_modules/element-ui/packages/form/src/form-item.vue'
import { getToken } from 'src/utils/auth'
import { mapGetters } from 'vuex'
import { one, save } from 'src/api/summit/activityShow'
import ElRow from 'element-ui/packages/row/src/row'
import ElInput from '../../../../node_modules/element-ui/packages/input/src/input.vue'
import ElCol from 'element-ui/packages/col/src/col'
import ElFormItem from '../../../../node_modules/element-ui/packages/form/src/form-item.vue'
import { getToken } from 'src/utils/auth'
import { mapGetters } from 'vuex'
import { one, save } from 'src/api/summit/activityShow'
export default {
props: ['reviewRow'],
name: 'reviewPopup',
components: {
ElFormItem,
ElCol,
ElInput,
ElRow
},
data() {
return {
imgDialogVisible: false,
dialogVisible: false,
dialogImageUrl: undefined,
result: false,
imgFlag: false,
BASE_API: process.env.BASE_API,
percent: 0, //上传进度
list: [], //压缩包
oldList: '',
oldVadio: '',
vadio: [], //视频
activeId: '', //峰会id
form: {
id: undefined,
banner: undefined,
videoPath: undefined,
picturePath: undefined
}
}
},
watch: {
dialogVisible(newValue, oldValue) {
if (!newValue) {
this.$emit('reviewDialogEvent', this.result)
}
}
},
computed: {
...mapGetters(['elements']),
getHeaderWithToken() {
return { Authorization: getToken() }
}
},
// watch: {
// dialogVisible(newValue, oldValue) {
// if (!newValue) {
// this.$emit('summitDialogEvent', this.result)
// }
// }
// },
mounted() {
this.getOrderInfo()
console.log(this.reviewRow)
},
methods: {
vidioSuccess(res, file, fileList) {
if (res.status == 200) {
this.$notify({
title: '提示',
message: res.message,
type: 'success',
duration: 2000
})
this.vadio = fileList
}
export default {
props: ['reviewRow'],
name: 'reviewPopup',
components: {
ElFormItem,
ElCol,
ElInput,
ElRow
},
beforeAvatarUpload(file) {
var index = file.name.lastIndexOf('.')
var ext = file.name.substr(index + 1)
<<<<<<< HEAD
console.log(ext)
=======
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
if (ext != 'zip') {
this.$message.error('上传压缩包只能是 zip 格式!')
return false
data() {
return {
imgDialogVisible: false,
dialogVisible: false,
dialogImageUrl: undefined,
result: false,
imgFlag: false,
BASE_API: process.env.BASE_API,
percent: 0, //上传进度
list: [], //压缩包
oldList: '',
oldVadio: '',
vadio: [], //视频
activeId: '', //峰会id
form: {
id: undefined,
banner: undefined,
videoPath: undefined,
picturePath: undefined
}
}
return true
},
videoUpload(file) {
const isJPG = file.type === 'video/mp4'
if (!isJPG) {
this.$message.error('上传压缩包只能是 mp4 格式!')
watch: {
dialogVisible(newValue, oldValue) {
if (!newValue) {
this.$emit('reviewDialogEvent', this.result)
}
}
return isJPG
},
getOrderInfo() {
one(this.reviewRow.id).then(res => {
this.form = res.data
this.activeId = res.data.id //峰会id
this.oldList = res.data.picturePath || '' //压缩包
this.oldVadio = res.data.videoPath || '' //视频
this.dialogVisible = true
this.imgDialogVisible = true
})
},
cre() {
let zipPic = []
this.list.forEach(element => {
<<<<<<< HEAD
zipPic.push(element.url)
=======
zipPic.push(element.response.data)
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
})
let mp4Vadio = []
this.vadio.forEach(element => {
mp4Vadio.push(element.response.data)
})
computed: {
...mapGetters(['elements']),
let params = {
id: this.activeId, //回顾id
banner: this.form.banner,
activityId: this.reviewRow.id, //峰会id
videoPath: this.oldVadio
? mp4Vadio == ''
? this.oldVadio
: mp4Vadio.join(',') + ',' + this.oldVadio
: mp4Vadio.join(','),
picturePath: this.oldList
? zipPic == ''
? this.oldList
: zipPic.join(',') + ',' + this.oldList
: zipPic.join(',')
getHeaderWithToken() {
return { Authorization: getToken() }
}
<<<<<<< HEAD
=======
// console.log(params);
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
save(params).then(res => {
this.responseResult(res)
})
},
responseResult(res) {
if (res.status === 200) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
// watch: {
// dialogVisible(newValue, oldValue) {
// if (!newValue) {
// this.$emit('summitDialogEvent', this.result)
// }
// }
// },
mounted() {
this.getOrderInfo()
console.log(this.reviewRow)
},
methods: {
vidioSuccess(res, file, fileList) {
if (res.status == 200) {
this.$notify({
title: '提示',
message: res.message,
type: 'success',
duration: 2000
})
this.vadio = fileList
}
},
beforeAvatarUpload(file) {
var index = file.name.lastIndexOf('.')
var ext = file.name.substr(index + 1)
if (ext != 'zip') {
this.$message.error('上传压缩包只能是 zip 格式!')
return false
}
return true
},
videoUpload(file) {
const isJPG = file.type === 'video/mp4'
if (!isJPG) {
this.$message.error('上传压缩包只能是 mp4 格式!')
}
return isJPG
},
getOrderInfo() {
one(this.reviewRow.id).then(res => {
this.form = res.data
this.activeId = res.data.id //峰会id
this.oldList = res.data.picturePath || '' //压缩包
this.oldVadio = res.data.videoPath || '' //视频
this.dialogVisible = true
this.imgDialogVisible = true
})
this.setSummitDialogEvent(true)
} else {
this.$notify({
title: '失败',
message: '操作失败!',
type: 'error',
duration: 2000
},
cre() {
let zipPic = []
this.list.forEach(element => {
zipPic.push(element.response.data)
})
}
},
/**
* 弹框-取消
* */
cancelHandel() {
this.setSummitDialogEvent(false)
},
setSummitDialogEvent(e) {
this.cleanForm()
this.result = e
this.dialogVisible = false
},
/**
* 封面图上传
* **/
handleAvatarSuccess(res, file) {
this.percent = 0
this.imgFlag = false
this.form.banner = res.data
},
/**
* 封面图上传进度
* */
uploadProcess(event, file, fileList) {
this.imgFlag = true
this.percent = Math.floor(event.percent)
},
handlePreview(file) {
this.form.videoPath = file.data
this.imgDialogVisible = true
},
handleRemoveZip(file, fileList) {
this.list = fileList
},
handleRemove(file, fileList) {
this.vadio = fileList
},
let mp4Vadio = []
this.vadio.forEach(element => {
mp4Vadio.push(element.response.data)
})
let params = {
id: this.activeId, //回顾id
banner: this.form.banner,
activityId: this.reviewRow.id, //峰会id
videoPath: this.oldVadio
? mp4Vadio == ''
? this.oldVadio
: mp4Vadio.join(',') + ',' + this.oldVadio
: mp4Vadio.join(','),
picturePath: this.oldList
? zipPic == ''
? this.oldList
: zipPic.join(',') + ',' + this.oldList
: zipPic.join(',')
}
// console.log(params);
handlePictureCardPreview(res, file, fileList) {
if (res.status == 200) {
this.$notify({
title: '提示',
message: '上传成功',
type: 'success'
save(params).then(res => {
this.responseResult(res)
})
},
responseResult(res) {
if (res.status === 200) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
this.setSummitDialogEvent(true)
} else {
this.$notify({
title: '失败',
message: '操作失败!',
type: 'error',
duration: 2000
})
}
},
/**
* 弹框-取消
* */
cancelHandel() {
this.setSummitDialogEvent(false)
},
setSummitDialogEvent(e) {
this.cleanForm()
this.result = e
this.dialogVisible = false
},
/**
* 封面图上传
* **/
handleAvatarSuccess(res, file) {
this.percent = 0
this.imgFlag = false
this.form.banner = res.data
},
/**
* 封面图上传进度
* */
uploadProcess(event, file, fileList) {
this.imgFlag = true
this.percent = Math.floor(event.percent)
},
handlePreview(file) {
this.form.videoPath = file.data
this.imgDialogVisible = true
},
handleRemoveZip(file, fileList) {
this.list = fileList
}
},
cleanForm() {
this.form = {
id: undefined,
banner: undefined,
activityId: undefined,
banner: undefined,
videoPath: undefined,
picturePath: undefined
},
handleRemove(file, fileList) {
this.vadio = fileList
},
handlePictureCardPreview(res, file, fileList) {
if (res.status == 200) {
this.$notify({
title: '提示',
message: '上传成功',
type: 'success'
})
this.list = fileList
}
},
cleanForm() {
this.form = {
id: undefined,
banner: undefined,
activityId: undefined,
banner: undefined,
videoPath: undefined,
picturePath: undefined
}
}
}
}
}
</script>
<style>
.label-text {
margin-left: 10px;
margin-right: 20px;
}
.label-text {
margin-left: 10px;
margin-right: 20px;
}
.label-title {
margin-top: 10px;
}
.label-title {
margin-top: 10px;
}
.orderDetail tr th {
background: #eef1f6;
}
.orderDetail tr th {
background: #eef1f6;
}
.orderDetail tr td,
.orderDetail tr th {
width: 500px;
text-align: center;
border: 1px solid #dfe6ec;
margin-left: 100px;
margin-right: 100px;
padding: 10px;
}
.orderDetail tr td,
.orderDetail tr th {
width: 500px;
text-align: center;
border: 1px solid #dfe6ec;
margin-left: 100px;
margin-right: 100px;
padding: 10px;
}
.label-value {
margin-left: 80px;
margin-right: 100px;
}
.label-value {
margin-left: 80px;
margin-right: 100px;
}
#license-img {
width: 50px;
height: 50px;
}
#license-img {
width: 50px;
height: 50px;
}
.order-details .el-form-item {
margin-bottom: 10px !important;
}
.order-details .el-form-item {
margin-bottom: 10px !important;
}
.el-dialog__footer .dialog-footer1 {
position: relative;
text-align: center;
}
.el-dialog__footer .dialog-footer1 {
position: relative;
text-align: center;
}
.fhjj {
width: 500px;
}
.fhjj {
width: 500px;
}
.content {
margin-left: 4%;
}
.content {
margin-left: 4%;
}
.height {
margin-bottom: 2%;
}
.height {
margin-bottom: 2%;
}
. el-form-item__content {
margin-left: 5% !important;
}
. el-form-item__content {
margin-left: 5% !important;
}
.status {
margin-top: 4%;
}
.status {
margin-top: 4%;
}
</style>
<template>
<el-dialog
:title="title"
:visible.sync="dialogVisible"
class="order-details"
:close-on-click-modal="false"
:title="title"
:visible.sync="dialogVisible"
class="order-details"
:close-on-click-modal="false"
>
<div>
<!-- <el-form :model="ruleForm2" :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm"> -->
......@@ -21,29 +21,29 @@
<el-col :span="8">
<el-form-item label="封面图:">
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-progress="uploadProcess"
list-type="picture"
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-progress="uploadProcess"
list-type="picture"
>
<el-progress
v-show="imgFlag == true"
type="circle"
:percentage="percent"
style="margin-top: 20px"
v-show="imgFlag == true"
type="circle"
:percentage="percent"
style="margin-top: 20px"
></el-progress>
<img
v-if="$utils.isString(form.banner) && !$utils.isEmpty(form.banner) && !imgFlag"
:src="form.banner"
style="width:300px;max-height:300px;"
v-if="$utils.isString(form.banner) && !$utils.isEmpty(form.banner) && !imgFlag"
:src="form.banner"
style="width:300px;max-height:300px;"
/>
<i
v-else-if="!imgFlag"
class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
v-else-if="!imgFlag"
class="el-icon-plus avatar-uploader-icon"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"
></i>
</el-upload>
</el-form-item>
......@@ -53,10 +53,10 @@
<el-col :span="16">
<el-form-item label="峰会时间:">
<el-date-picker
v-model="form.startTime"
type="datetime"
:editable="true"
placeholder="开始时间"
v-model="form.startTime"
type="datetime"
:editable="true"
placeholder="开始时间"
></el-date-picker>-
<el-date-picker v-model="form.endTime" type="datetime" :editable="true" placeholder="选择日期"></el-date-picker>
</el-form-item>
......@@ -105,16 +105,7 @@
<el-form-item label="活动id:">
<!-- <el-input v-model="form.rid" placeholder="请输入签到/抽奖活动的id"></el-input> -->
<el-select v-model="form.rid" placeholder="请选择签到/抽奖活动id">
<<<<<<< HEAD
<el-option
v-for="(item,index) in optionsId"
:key="index"
:label="item"
:value="item"
></el-option>
=======
<el-option v-for="(item,index) in optionsId" :key="index" :label="item" :value="item"></el-option>
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
</el-select>
</el-form-item>
</el-col>
......@@ -123,29 +114,29 @@
<el-tabs v-model="activeNameTab">
<el-tab-pane label="峰会主题" name="first">
<UE
:editorId="activeName"
:defaultMsg="form.content"
:config="config"
ref="ue"
@ready="editorReadyEvent"
:editorId="activeName"
:defaultMsg="form.content"
:config="config"
ref="ue"
@ready="editorReadyEvent"
></UE>
</el-tab-pane>
<el-tab-pane label="诚邀莅临" name="second">
<UE
:editorId="activeNameShare"
:defaultMsg="form.actDesc "
:config="config"
ref="ue"
@ready="editorReadyEventShare"
:editorId="activeNameShare"
:defaultMsg="form.actDesc "
:config="config"
ref="ue"
@ready="editorReadyEventShare"
></UE>
</el-tab-pane>
<el-tab-pane label="公司简章" name="third">
<UE
:editorId="activeNameFirm"
:defaultMsg="form.companyDesc"
:config="config"
ref="ue"
@ready="editorReadyEventFirm"
:editorId="activeNameFirm"
:defaultMsg="form.companyDesc"
:config="config"
ref="ue"
@ready="editorReadyEventFirm"
></UE>
</el-tab-pane>
</el-tabs>
......@@ -155,18 +146,14 @@
<div>
<el-row>
<el-col>
<<<<<<< HEAD
<el-form-item label="房车介绍:">
=======
<el-form-item label="房车介绍:" style="margin-top:20px">
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
<el-upload
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
list-type="picture-card"
:file-list="fileList2"
:on-success="handleBannerSuccess"
:on-remove="handleRemove"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
list-type="picture-card"
:file-list="fileList2"
:on-success="handleBannerSuccess"
:on-remove="handleRemove"
:headers="getHeaderWithToken"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -175,13 +162,13 @@
<el-row class="height" v-for="(item, index) in processJson" :key="index">
<el-col :span="6">
<el-time-select
v-model="item.time"
:picker-options="{
v-model="item.time"
:picker-options="{
start: '06:00',
step: '00:15',
end: '23:59'
}"
placeholder="选择/输入时间"
placeholder="选择/输入时间"
></el-time-select>
</el-col>
<el-col :span="8">
......@@ -189,10 +176,10 @@
</el-col>
<el-col class="content" :span="8">
<el-button
type="danger"
size="small"
style="margin-left: 10px;"
@click="deleteItem(item,index)"
type="danger"
size="small"
style="margin-left: 10px;"
@click="deleteItem(item,index)"
>删除</el-button>
</el-col>
</el-row>
......@@ -221,476 +208,448 @@
</template>
<script>
import ElRow from 'element-ui/packages/row/src/row'
import ElInput from '../../../../node_modules/element-ui/packages/input/src/input.vue'
import ElCol from 'element-ui/packages/col/src/col'
import ElFormItem from '../../../../node_modules/element-ui/packages/form/src/form-item.vue'
import { getOne, update, add, activityIds } from 'src/api/summit/activity'
import { getToken } from 'src/utils/auth'
import { mapGetters } from 'vuex'
import UE from '../../modal/Ueditor' // 百度ue富文本
import { formatDate } from 'utils/dateFormattor'
export default {
props: ['popupShow', 'popupRow', 'titleNme'],
name: 'summitPopup',
components: {
ElFormItem,
ElCol,
ElInput,
ElRow,
UE
},
data() {
return {
optionsId: [],
statusRadio: '0',
activeNameTab: 'first',
fileList2: [],
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
dialogVisible: false,
title: '',
BASE_API: process.env.BASE_API,
percent: 0, // 上传进度
percents: 0, // 上传进度
imgFlag: false,
imgFlags: false,
activeName: '',
activeNameShare: '',
activeNameFirm: '',
rules: {},
form: {
title: undefined,
banner: undefined,
startTime: undefined,
endTime: undefined,
bmCloseTime: undefined,
address: undefined,
longitude: undefined,
latitude: undefined,
state: '默认',
status: 0,
rid: undefined,
content: '', // 峰会主题
contentFirm: '',
actDesc: '', // 诚邀莅临
companyDesc: '', // 公司简章
vehicleImgs: [], // 房车介绍
processJson: []
},
result: false,
processJson: [{ time: undefined, content: '' }]
}
},
mounted() {
this.cleanForm()
this.getOrderInfo()
},
created() {
activityIds().then(data => {
if (data.status == 200) {
<<<<<<< HEAD
this.optionsId = data.data;
=======
this.optionsId = data.data
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
}
})
},
computed: {
...mapGetters(['elements']),
getHeaderWithToken() {
return { Authorization: getToken() }
}
},
watch: {
dialogVisible(newValue) {
if (!newValue) {
this.$emit('summitDialogEvent', this.result)
}
}
},
methods: {
handleBannerSuccess(res, file, fileList) {
console.log(fileList);
this.fileList2 = fileList
// this.form.vehicleImgs = this.fileList2
import ElRow from 'element-ui/packages/row/src/row'
import ElInput from '../../../../node_modules/element-ui/packages/input/src/input.vue'
import ElCol from 'element-ui/packages/col/src/col'
import ElFormItem from '../../../../node_modules/element-ui/packages/form/src/form-item.vue'
import { getOne, update, add, activityIds } from 'src/api/summit/activity'
import { getToken } from 'src/utils/auth'
import { mapGetters } from 'vuex'
import UE from '../../modal/Ueditor' // 百度ue富文本
import { formatDate } from 'utils/dateFormattor'
export default {
props: ['popupShow', 'popupRow', 'titleNme'],
name: 'summitPopup',
components: {
ElFormItem,
ElCol,
ElInput,
ElRow,
UE
},
handleRemove(res, file, fileList) {
this.fileList2 = file
},
getOrderInfo() {
this.title = this.titleNme
if (this.title === '编辑峰会') {
this.$nextTick(() => {
this.dialogVisible = true
this.activeName = 'first'
this.activeNameShare = 'second'
this.activeNameFirm = 'three'
})
getOne(this.popupRow.id).then(res => {
res.data.state = this.getState(res.data.status)
this.form = res.data
this.form.bmCloseTime = Number(res.data.bmCloseTime)
let introduce = this.form.vehicleImgs.split(',')
this.statusRadio = res.data.status
introduce.forEach(element => {
this.fileList2.push({ name: '峰会介绍', url: element })
})
if (res.data.processJson) {
this.processJson = JSON.parse(res.data.processJson)
}
})
}
if (this.title === '创建峰会') {
this.dialogVisible = true
this.activeName = 'first'
this.activeNameShare = 'second'
this.activeNameFirm = 'three'
data() {
return {
optionsId: [],
statusRadio: '0',
activeNameTab: 'first',
fileList2: [],
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
dialogVisible: false,
title: '',
BASE_API: process.env.BASE_API,
percent: 0, // 上传进度
percents: 0, // 上传进度
imgFlag: false,
imgFlags: false,
activeName: '',
activeNameShare: '',
activeNameFirm: '',
rules: {},
form: {
title: undefined,
banner: undefined,
startTime: undefined,
endTime: undefined,
bmCloseTime: undefined,
address: undefined,
longitude: undefined,
latitude: undefined,
state: '默认',
status: 0,
rid: undefined,
content: '', // 峰会主题
contentFirm: '',
actDesc: '', // 诚邀莅临
companyDesc: '', // 公司简章
vehicleImgs: [], // 房车介绍
processJson: []
},
result: false,
processJson: [{ time: undefined, content: '' }]
}
},
editorReadyEvent(instance) {
const t = this
instance.addListener('contentChange', () => {
console.log(t.activeName)
if (t.activeName === 'first') {
t.form.content = instance.getContent()
}
})
},
editorReadyEventShare(instance) {
const t = this
instance.addListener('contentChange', () => {
if (t.activeNameShare === 'second') {
t.form.actDesc = instance.getContent()
}
})
mounted() {
this.cleanForm()
this.getOrderInfo()
},
editorReadyEventFirm(instance) {
const t = this
instance.addListener('contentChange', () => {
if (t.activeNameFirm == 'three') {
t.form.companyDesc = instance.getContent()
created() {
activityIds().then(data => {
if (data.status == 200) {
this.optionsId = data.data
}
})
},
/**
* 封面图上传进度
* */
uploadProcess(event, file, fileList) {
this.imgFlag = true
this.percent = Math.floor(event.percent)
},
/**
* 封面图上传
* **/
handleAvatarSuccess(res, file) {
this.percent = 0
this.imgFlag = false
this.form.banner = res.data
},
getState(status) {
if (this.$utils.isInteger(status)) {
<<<<<<< HEAD
console.log(status);
=======
console.log(status)
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
if (status == 0) {
return '默认'
} else {
return '自定义'
}
computed: {
...mapGetters(['elements']),
getHeaderWithToken() {
return { Authorization: getToken() }
}
return ''
},
setSummitDialogEvent(e) {
this.cleanForm()
this.result = e
this.dialogVisible = false
},
addTag() {
const t = {
time: null,
content: ''
watch: {
dialogVisible(newValue) {
if (!newValue) {
this.$emit('summitDialogEvent', this.result)
}
}
this.processJson.push(t)
},
/**
* 保存修改
*
* */
update1() {
if (!this.form.title) {
this.$notify({
title: '失败',
message: '标题不能为空',
type: 'error',
duration: 2000
})
return false
} else if (!this.form.startTime) {
this.$notify({
title: '失败',
message: '开始时间不能为空',
type: 'error',
duration: 2000
})
} else if (!this.form.endTime) {
this.$notify({
title: '失败',
message: '结束时间不能为空',
type: 'error',
duration: 2000
})
} else if (!this.form.bmCloseTime) {
this.$notify({
title: '失败',
message: '报名截止时间不能为空',
type: 'error',
duration: 2000
})
} else {
typeof this.form.endTime == 'number'
? (this.form.endTime = this.form.endTime)
: (this.form.endTime = this.form.endTime.getTime())
typeof this.form.startTime == 'number'
? (this.form.startTime = this.form.startTime)
: (this.form.startTime = this.form.startTime.getTime())
typeof this.form.bmCloseTime == 'number'
? (this.form.bmCloseTime = this.form.bmCloseTime)
: (this.form.bmCloseTime = this.form.bmCloseTime.getTime())
let pic = []
<<<<<<< HEAD
if (!!this.form.vehicleImgs) {
this.form.vehicleImgs.forEach(element => {
pic.push(element.url)
methods: {
handleBannerSuccess(res, file, fileList) {
console.log(fileList);
this.fileList2 = fileList
// this.form.vehicleImgs = this.fileList2
},
handleRemove(res, file, fileList) {
this.fileList2 = file
},
getOrderInfo() {
this.title = this.titleNme
if (this.title === '编辑峰会') {
this.$nextTick(() => {
this.dialogVisible = true
this.activeName = 'first'
this.activeNameShare = 'second'
this.activeNameFirm = 'three'
})
=======
if (this.fileList2 != '') {
console.log(this.fileList2);
this.fileList2.forEach(element => {
if (!!element.response) {
pic.push(element.response.data)
}else{
pic.push(element.url);
getOne(this.popupRow.id).then(res => {
res.data.state = this.getState(res.data.status)
this.form = res.data
this.form.bmCloseTime = Number(res.data.bmCloseTime)
let introduce = this.form.vehicleImgs.split(',')
this.statusRadio = res.data.status
introduce.forEach(element => {
this.fileList2.push({ name: '峰会介绍', url: element })
})
if (res.data.processJson) {
this.processJson = JSON.parse(res.data.processJson)
}
});
console.log(pic);
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
this.form.vehicleImgs = pic.join(',')
})
}
this.form.processJson = this.processJson
update(this.form).then(res => {
this.responseResult(res)
})
this.dataProcessing()
}
},
create() {
if (!this.form.title) {
this.$notify({
title: '失败',
message: '标题不能为空',
type: 'error',
duration: 2000
})
return false
} else if (!this.form.startTime) {
this.$notify({
title: '失败',
message: '开始时间不能为空',
type: 'error',
duration: 2000
if (this.title === '创建峰会') {
this.dialogVisible = true
this.activeName = 'first'
this.activeNameShare = 'second'
this.activeNameFirm = 'three'
}
},
editorReadyEvent(instance) {
const t = this
instance.addListener('contentChange', () => {
console.log(t.activeName)
if (t.activeName === 'first') {
t.form.content = instance.getContent()
}
})
} else if (!this.form.endTime) {
this.$notify({
title: '失败',
message: '结束时间不能为空',
type: 'error',
duration: 2000
},
editorReadyEventShare(instance) {
const t = this
instance.addListener('contentChange', () => {
if (t.activeNameShare === 'second') {
t.form.actDesc = instance.getContent()
}
})
} else if (!this.form.bmCloseTime) {
this.$notify({
title: '失败',
message: '报名截止时间不能为空',
type: 'error',
duration: 2000
},
editorReadyEventFirm(instance) {
const t = this
instance.addListener('contentChange', () => {
if (t.activeNameFirm == 'three') {
t.form.companyDesc = instance.getContent()
}
})
} else {
// this.form.processJson = this.processJson
this.form.endTime = this.form.endTime.getTime()
this.form.startTime = this.form.startTime.getTime()
this.form.bmCloseTime = this.form.bmCloseTime.getTime()
let pic = []
<<<<<<< HEAD
if (!!this.form.vehicleImgs) {
this.form.vehicleImgs.forEach(element => {
pic.push(element.url)
},
/**
* 封面图上传进度
* */
uploadProcess(event, file, fileList) {
this.imgFlag = true
this.percent = Math.floor(event.percent)
},
/**
* 封面图上传
* **/
handleAvatarSuccess(res, file) {
this.percent = 0
this.imgFlag = false
this.form.banner = res.data
},
getState(status) {
if (this.$utils.isInteger(status)) {
console.log(status)
if (status == 0) {
return '默认'
} else {
return '自定义'
}
}
return ''
},
setSummitDialogEvent(e) {
this.cleanForm()
this.result = e
this.dialogVisible = false
},
addTag() {
const t = {
time: null,
content: ''
}
this.processJson.push(t)
},
/**
* 保存修改
*
* */
update1() {
if (!this.form.title) {
this.$notify({
title: '失败',
message: '标题不能为空',
type: 'error',
duration: 2000
})
return false
} else if (!this.form.startTime) {
this.$notify({
title: '失败',
message: '开始时间不能为空',
type: 'error',
duration: 2000
})
} else if (!this.form.endTime) {
this.$notify({
title: '失败',
message: '结束时间不能为空',
type: 'error',
duration: 2000
})
} else if (!this.form.bmCloseTime) {
this.$notify({
title: '失败',
message: '报名截止时间不能为空',
type: 'error',
duration: 2000
})
} else {
typeof this.form.endTime == 'number'
? (this.form.endTime = this.form.endTime)
: (this.form.endTime = this.form.endTime.getTime())
typeof this.form.startTime == 'number'
? (this.form.startTime = this.form.startTime)
: (this.form.startTime = this.form.startTime.getTime())
typeof this.form.bmCloseTime == 'number'
? (this.form.bmCloseTime = this.form.bmCloseTime)
: (this.form.bmCloseTime = this.form.bmCloseTime.getTime())
let pic = []
if (this.fileList2 != '') {
console.log(this.fileList2);
this.fileList2.forEach(element => {
if (!!element.response) {
pic.push(element.response.data)
}else{
pic.push(element.url);
}
});
console.log(pic);
this.form.vehicleImgs = pic.join(',')
}
this.form.processJson = this.processJson
update(this.form).then(res => {
this.responseResult(res)
})
this.form.vehicleImgs = pic.join(',')
this.dataProcessing()
}
=======
if (this.fileList2 != '') {
this.fileList2.forEach(element => {
pic.push(element.response.data);
});
this.form.vehicleImgs = pic.join(',')
},
create() {
if (!this.form.title) {
this.$notify({
title: '失败',
message: '标题不能为空',
type: 'error',
duration: 2000
})
return false
} else if (!this.form.startTime) {
this.$notify({
title: '失败',
message: '开始时间不能为空',
type: 'error',
duration: 2000
})
} else if (!this.form.endTime) {
this.$notify({
title: '失败',
message: '结束时间不能为空',
type: 'error',
duration: 2000
})
} else if (!this.form.bmCloseTime) {
this.$notify({
title: '失败',
message: '报名截止时间不能为空',
type: 'error',
duration: 2000
})
} else {
// this.form.processJson = this.processJson
this.form.endTime = this.form.endTime.getTime()
this.form.startTime = this.form.startTime.getTime()
this.form.bmCloseTime = this.form.bmCloseTime.getTime()
let pic = []
if (this.fileList2 != '') {
this.fileList2.forEach(element => {
pic.push(element.response.data);
});
this.form.vehicleImgs = pic.join(',')
}
// if (!!this.form.vehicleImgs) {
// this.form.vehicleImgs.forEach(element => {
// pic.push(element.url)
// })
// this.form.vehicleImgs = pic.join(',')
// }
this.dataProcessing()
add(this.form).then(res => {
this.responseResult(res)
})
}
// if (!!this.form.vehicleImgs) {
// this.form.vehicleImgs.forEach(element => {
// pic.push(element.url)
// })
// this.form.vehicleImgs = pic.join(',')
// }
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
this.dataProcessing()
add(this.form).then(res => {
this.responseResult(res)
})
}
},
dataProcessing() {
if (this.form.state === '默认') {
this.form.status = '0'
<<<<<<< HEAD
}else{
=======
} else {
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
this.form.status = this.statusRadio
}
this.form.processJson = JSON.stringify(this.processJson)
},
/**
* 请求结果判断
* */
responseResult(res) {
if (res.status === 200) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
},
dataProcessing() {
if (this.form.state === '默认') {
this.form.status = '0'
} else {
this.form.status = this.statusRadio
}
this.form.processJson = JSON.stringify(this.processJson)
},
/**
* 请求结果判断
* */
responseResult(res) {
if (res.status === 200) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
this.setSummitDialogEvent(true)
} else {
this.$notify({
title: '失败',
message: '操作失败!',
type: 'error',
duration: 2000
})
}
},
/**
* 删除时间
* */
deleteItem(obj, index) {
this.processJson.splice(index, 1)
},
/**
* 弹框-取消
* */
cancelHandel() {
this.setSummitDialogEvent(false)
},
this.setSummitDialogEvent(true)
} else {
this.$notify({
title: '失败',
message: '操作失败!',
type: 'error',
duration: 2000
})
}
},
/**
* 删除时间
* */
deleteItem(obj, index) {
this.processJson.splice(index, 1)
},
/**
* 弹框-取消
* */
cancelHandel() {
this.setSummitDialogEvent(false)
},
cleanForm() {
this.form = {
title: undefined,
banner: undefined,
startTime: undefined,
endTime: undefined,
bmCloseTime: undefined,
address: undefined,
longitude: undefined,
latitude: undefined,
state: '默认',
rid: undefined,
content: '', // 峰会主题
contentFirm: '',
actDesc: '', // 诚邀莅临
companyDesc: '', // 公司简章
vehicleImgs: [], // 房车介绍
processJson: []
cleanForm() {
this.form = {
title: undefined,
banner: undefined,
startTime: undefined,
endTime: undefined,
bmCloseTime: undefined,
address: undefined,
longitude: undefined,
latitude: undefined,
state: '默认',
rid: undefined,
content: '', // 峰会主题
contentFirm: '',
actDesc: '', // 诚邀莅临
companyDesc: '', // 公司简章
vehicleImgs: [], // 房车介绍
processJson: []
}
}
}
}
}
</script>
<style>
.label-text {
margin-left: 10px;
margin-right: 20px;
}
.label-text {
margin-left: 10px;
margin-right: 20px;
}
.label-title {
margin-top: 10px;
}
.label-title {
margin-top: 10px;
}
.orderDetail tr th {
background: #eef1f6;
}
.orderDetail tr th {
background: #eef1f6;
}
.orderDetail tr td,
.orderDetail tr th {
width: 500px;
text-align: center;
border: 1px solid #dfe6ec;
margin-left: 100px;
margin-right: 100px;
padding: 10px;
}
.orderDetail tr td,
.orderDetail tr th {
width: 500px;
text-align: center;
border: 1px solid #dfe6ec;
margin-left: 100px;
margin-right: 100px;
padding: 10px;
}
.label-value {
margin-left: 80px;
margin-right: 100px;
}
.label-value {
margin-left: 80px;
margin-right: 100px;
}
#license-img {
width: 50px;
height: 50px;
}
#license-img {
width: 50px;
height: 50px;
}
.order-details .el-form-item {
margin-bottom: 10px !important;
}
.order-details .el-form-item {
margin-bottom: 10px !important;
}
.el-dialog__footer .dialog-footer1 {
position: relative;
text-align: center;
}
.el-dialog__footer .dialog-footer1 {
position: relative;
text-align: center;
}
.fhjj {
width: 500px;
}
.fhjj {
width: 500px;
}
.content {
margin-left: 4%;
}
.content {
margin-left: 4%;
}
.height {
margin-bottom: 2%;
}
.height {
margin-bottom: 2%;
}
/* . el-form-item__content {
margin-left: 5% !important;
} */
/* . el-form-item__content {
margin-left: 5% !important;
} */
.status {
margin-top: 4%;
}
.steLine .el-row {
margin-bottom: 10px;
}
.status {
margin-top: 4%;
}
.steLine .el-row {
margin-bottom: 10px;
}
</style>
......@@ -4,37 +4,37 @@
<el-form :rules="rules4Query" ref="queryForm" :inline="inline" :model="listQuery">
<el-row>
<el-col :span="5">
<el-form-item label="用途">
<el-select class="filter-item" v-model="listQuery.bookType" placeholder="请选择">
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<el-option v-for="val in bookTypeList" :key="val.id" :label="val.name" :value="val.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="用途">
<el-select class="filter-item" v-model="listQuery.bookType" placeholder="请选择">
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<el-option v-for="val in bookTypeList" :key="val.id" :label="val.name" :value="val.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="车辆编码">
<el-input type="number" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
</el-form-item>
<el-form-item label="车辆编码">
<el-input type="number" v-model.number="listQuery.code" placeholder="请输入车辆编码"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="车牌号">
<el-input v-model="listQuery.numberPlate" placeholder="请输入车牌号"></el-input>
</el-form-item>
<el-form-item label="车牌号">
<el-input v-model="listQuery.numberPlate" placeholder="请输入车牌号"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="申请状态">
<el-select class="filter-item" v-model="listQuery.status" placeholder="请选择申请状态">
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<!-- <el-option v-for="(val, key, index) in statusList " :key="val.code" :label="val.val"
:value="val.code"></el-option>-->
<el-option
v-for="(val, index) in statusList "
:key="index"
:label="val.val"
:value="val.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="申请状态">
<el-select class="filter-item" v-model="listQuery.status" placeholder="请选择申请状态">
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<!-- <el-option v-for="(val, key, index) in statusList " :key="val.code" :label="val.val"
:value="val.code"></el-option>-->
<el-option
v-for="(val, index) in statusList "
:key="index"
:label="val.val"
:value="val.code"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
......@@ -42,10 +42,10 @@
<el-col :span="5">
<el-form-item label="所属大区">
<el-select
class="filter-item"
v-model="listQuery.zoneId"
placeholder="请选择"
@change="getProvinceRegions"
class="filter-item"
v-model="listQuery.zoneId"
placeholder="请选择"
@change="getProvinceRegions"
>
<el-option :key="undefined" label="全部" :value="undefined"></el-option>
<el-option v-for="val in getAllZoneList" :key="val.id" :label="val.name" :value="val.id"></el-option>
......@@ -54,51 +54,51 @@
</el-col>
<el-col :span="5">
<el-form-item label="提车公司" prop="subordinateBranch">
<el-autocomplete
class="inline-input"
v-model="listQuery.liftCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
<el-autocomplete
class="inline-input"
v-model="listQuery.liftCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="提车时间" prop="bookStartDate4Query">
<el-date-picker
v-model="bookStartDate4Query"
type="month"
:editable="true"
format="yyyy-MM"
placeholder="请选择预约提车时间"
v-model="bookStartDate4Query"
type="month"
:editable="true"
format="yyyy-MM"
placeholder="请选择预约提车时间"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="还车时间" prop="bookEndDate4Query">
<el-date-picker
v-model="bookEndDate4Query"
type="month"
:editable="true"
format="yyyy-MM"
placeholder="请选择预约还车时间"
v-model="bookEndDate4Query"
type="month"
:editable="true"
format="yyyy-MM"
placeholder="请选择预约还车时间"
></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" v-waves @click="reloadPage">重置</el-button>
<el-button class="filter-item" type="primary" v-waves @click="reloadPage">重置</el-button>
</el-form>
</div>
<el-table
:key="tableKey"
:data="list"
v-loading.body="listLoading"
border
fit
highlight-current-row
style="width: 100%"
:key="tableKey"
:data="list"
v-loading.body="listLoading"
border
fit
highlight-current-row
style="width: 100%"
>
<el-table-column align="center" label="车牌号" width="110">
<template scope="scope">
......@@ -131,24 +131,16 @@
<span v-if="scope.row.bookType==10">其他</span>
</template>
</el-table-column>
<<<<<<< HEAD
<el-table-column align="center" label="预定时间" width="220">
<template scope="scope">
<span>{{scope.row.bookStartDate}}{{scope.row.bookEndDate}}</span>
</template>
</el-table-column>
=======
<el-table-column align="center" label="预定取/还时间" width="200">
<template scope="scope">
<span>{{scope.row.bookStartDate}}</span> <br/><span>{{scope.row.bookEndDate}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="实际取/还时间" width="200">
<template scope="scope">
<span>{{scope.row.actualStartDate}}</span> <br/><span>{{scope.row.actualEndDate}}</span>
</template>
<el-table-column align="center" label="实际取/还时间" width="200">
<template scope="scope">
<span>{{scope.row.actualStartDate}}</span> <br/><span>{{scope.row.actualEndDate}}</span>
</template>
</el-table-column>
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
<!-- <el-table-column align="center" label="预定时间" width="220">
<template scope="scope">
<span
......@@ -252,47 +244,47 @@
<template scope="scope">
<!-- <el-button size="small" type="success" @click="handleBookInfo(scope.row)">预订信息</el-button> -->
<el-button
size="small"
class="el-button el-button--text el-button--small"
v-if="scope.row.status==3"
@click="illegalInquiry(scope.row)"
size="small"
class="el-button el-button--text el-button--small"
v-if="scope.row.status==3"
@click="illegalInquiry(scope.row)"
>违章记录</el-button>
<el-button
v-if="bookRecord_btn_prove&&scope.row.status==1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleProve(scope.row)"
v-if="bookRecord_btn_prove&&scope.row.status==1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleProve(scope.row)"
>通过</el-button>
<el-button
v-if="bookRecord_btn_reject&&scope.row.status==1"
size="small"
class="el-button el-button--text el-button--small"
style="color: red;"
@click="handleReject(scope.row)"
v-if="bookRecord_btn_reject&&scope.row.status==1"
size="small"
class="el-button el-button--text el-button--small"
style="color: red;"
@click="handleReject(scope.row)"
>驳回</el-button>
<template v-if="scope.row.vehicleDepartureLogVo==undefined">
<el-button
v-if="bookRecord_btn_lift&&scope.row.liftStatus==1&&scope.row.status==2"
size="small"
class="el-button el-button--text el-button--small"
@click="handleLift(scope.row)"
v-if="bookRecord_btn_lift&&scope.row.liftStatus==1&&scope.row.status==2"
size="small"
class="el-button el-button--text el-button--small"
@click="handleLift(scope.row)"
>出车</el-button>
</template>
<template v-if="scope.row.vehicleDepartureLogVo!=undefined">
<el-button
v-if="bookRecord_btn_ret&&scope.row.vehicleDepartureLogVo.state==0&&scope.row.retStatus==1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleRet(scope.row)"
v-if="bookRecord_btn_ret&&scope.row.vehicleDepartureLogVo.state==0&&scope.row.retStatus==1"
size="small"
class="el-button el-button--text el-button--small"
@click="handleRet(scope.row)"
>收车</el-button>
</template>
<template v-if="scope.row.vehicleDepartureLogVo==undefined">
<el-button
v-if="bookRecord_btn_unbook&&scope.row.status==2"
size="small"
class="el-button el-button--text el-button--small"
style="color: red;"
@click="handleUnbook(scope.row)"
v-if="bookRecord_btn_unbook&&scope.row.status==2"
size="small"
class="el-button el-button--text el-button--small"
style="color: red;"
@click="handleUnbook(scope.row)"
>取消预定</el-button>
</template>
</template>
......@@ -301,13 +293,13 @@
<div v-show="!listLoading" class="pagination-container">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30,40,50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30,40,50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div>
......@@ -337,11 +329,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="车辆编号">
<<<<<<< HEAD
<span>{{detailItem.vehicleId}}</span>
=======
<span>{{detailItem.code}}</span>
>>>>>>> ed66af1f93f55e2551b0b09c15e1697c72ecb84b
</el-form-item>
</el-col>
<!-- <el-col :span="7">
......@@ -418,7 +406,7 @@
<el-col :span="8">
<el-form-item label="操作时间">
<span
v-if="detailItem.vehicleDepartureLogVo"
v-if="detailItem.vehicleDepartureLogVo"
>{{detailItem.vehicleDepartureLogVo.departureTime}}</span>
</el-form-item>
</el-col>
......@@ -427,18 +415,18 @@
<el-col :span="24">
<el-form-item label="提车公里数">
<span
v-if="detailItem.vehicleDepartureLogVo"
v-if="detailItem.vehicleDepartureLogVo"
>{{detailItem.vehicleDepartureLogVo.mileageStart?detailItem.vehicleDepartureLogVo.mileageStart+'KM':''}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin-left: 20px;" v-if="departurePicList.length>0">
<el-col
:span="3"
v-for="(item, index) in departurePicList"
:key="index"
:offset="index%6 > 0 ? 1 : 0"
style="margin-bottom:10px"
:span="3"
v-for="(item, index) in departurePicList"
:key="index"
:offset="index%6 > 0 ? 1 : 0"
style="margin-bottom:10px"
>
<el-card>
<img :src="item" class="image" />
......@@ -451,11 +439,11 @@
<el-form-item label="还车分公司">
<span>{{detailItem.retCompanyName}}</span>
<el-button
size="mini"
type="primary"
style="padding: 7px 9px;"
@click="resetReturn = true"
v-show="detailItem.status == 2 || detailItem.status == 5"
size="mini"
type="primary"
style="padding: 7px 9px;"
@click="resetReturn = true"
v-show="detailItem.status == 2 || detailItem.status == 5"
>更换</el-button>
</el-form-item>
</el-col>
......@@ -467,7 +455,7 @@
<el-col :span="8">
<el-form-item label="操作时间">
<span
v-if="detailItem.vehicleDepartureLogVo"
v-if="detailItem.vehicleDepartureLogVo"
>{{detailItem.vehicleDepartureLogVo.arrivalTime}}</span>
</el-form-item>
</el-col>
......@@ -476,18 +464,18 @@
<el-col :span="24">
<el-form-item label="还车公里数">
<span
v-if="detailItem.vehicleDepartureLogVo"
v-if="detailItem.vehicleDepartureLogVo"
>{{detailItem.vehicleDepartureLogVo.mileageEnd?detailItem.vehicleDepartureLogVo.mileageEnd+'KM':''}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row style="margin-left: 20px;" v-if="arrivalPicList.length>0">
<el-col
:span="3"
v-for="(item, index) in arrivalPicList"
:key="index"
:offset="index%6 > 0 ? 1 : 0"
style="margin-bottom:10px"
:span="3"
v-for="(item, index) in arrivalPicList"
:key="index"
:offset="index%6 > 0 ? 1 : 0"
style="margin-bottom:10px"
>
<el-card>
<img :src="item" class="image" />
......@@ -541,39 +529,39 @@
<!-- 出车对话框相关html元素 -->
<el-dialog title="出车" :visible.sync="dialogForm4LiftVisible">
<el-form
:model="departureForm"
:rules="departureFormrules"
ref="departureForm"
label-width="120px"
:model="departureForm"
:rules="departureFormrules"
ref="departureForm"
label-width="120px"
>
<el-form-item label="车牌号">
<el-input v-model="departureForm.numberPlate" disabled></el-input>
</el-form-item>
<el-form-item label="出车时间">
<el-date-picker
v-model="departureForm.departureDate"
type="date"
disabled
format="yyyy-MM-dd"
placeholder="选择日期"
v-model="departureForm.departureDate"
type="date"
disabled
format="yyyy-MM-dd"
placeholder="选择日期"
></el-date-picker>
</el-form-item>
<el-form-item label="出车分公司">
<el-autocomplete
class="inline-input"
v-model="departureForm.departureBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
class="inline-input"
v-model="departureForm.departureBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
></el-autocomplete>
</el-form-item>
<el-form-item label="目的地分公司" prop="expectArrivalBranchCompanyName">
<el-autocomplete
class="inline-input"
v-model="departureForm.expectArrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
class="inline-input"
v-model="departureForm.expectArrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
></el-autocomplete>
</el-form-item>
<el-form-item label="用途">
......@@ -601,13 +589,13 @@
<el-col>
<el-form-item label="出车截图" :style="{display:'block'}" required>
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleDepartureRemove"
:file-list="departurePicList"
:on-success="handleDepartureSuccess"
list-type="picture-card"
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleDepartureRemove"
:file-list="departurePicList"
:on-success="handleDepartureSuccess"
list-type="picture-card"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -629,20 +617,20 @@
</el-form-item>
<el-form-item label="收车时间">
<el-date-picker
v-model="arrivalForm.arrivalDate"
type="date"
disabled
format="yyyy-MM-dd"
placeholder="选择日期"
v-model="arrivalForm.arrivalDate"
type="date"
disabled
format="yyyy-MM-dd"
placeholder="选择日期"
></el-date-picker>
</el-form-item>
<el-form-item label="还车分公司">
<el-autocomplete
class="inline-input"
v-model="arrivalForm.arrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
class="inline-input"
v-model="arrivalForm.arrivalBranchCompanyName"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
disabled
></el-autocomplete>
</el-form-item>
<el-form-item label="收车人" prop="recycleMan">
......@@ -661,13 +649,13 @@
<el-col>
<el-form-item label="收车截图" :style="{display:'block'}" required>
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleArrivalRemove"
:file-list="arrivalPicList"
:on-success="handleArrivalSuccess"
list-type="picture-card"
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleArrivalRemove"
:file-list="arrivalPicList"
:on-success="handleArrivalSuccess"
list-type="picture-card"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -687,13 +675,13 @@
<el-col>
<el-form-item label="违章截图" :style="{display:'block'}">
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleRemove"
:file-list="fileList2"
:on-success="handleSuccess"
list-type="picture-card"
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleRemove"
:file-list="fileList2"
:on-success="handleSuccess"
list-type="picture-card"
>
<i class="el-icon-plus"></i>
</el-upload>
......@@ -704,10 +692,10 @@
<el-col>
<el-form-item label="违章罚款">
<el-input
v-model="price"
type="number"
placeholder="请输入违章罚款金额"
style="width: 50%;margin-right:10px"
v-model="price"
type="number"
placeholder="请输入违章罚款金额"
style="width: 50%;margin-right:10px"
></el-input>
</el-form-item>
</el-col>
......@@ -722,413 +710,413 @@
</template>
<script>
import {
page,
prove,
reject,
getObj,
lift,
ret,
unbook,
getOneIllegalRow,
saveOrderViolation,
departureVehicle,
arrivalVehicle
} from 'api/vehicle/bookRecord'
import {
page,
prove,
reject,
getObj,
lift,
ret,
unbook,
getOneIllegalRow,
saveOrderViolation,
departureVehicle,
arrivalVehicle
} from 'api/vehicle/bookRecord'
import {
getAllCompany,
getAll,
updateById
} from 'api/base_info/branch_company/'
import { getAllZone } from 'api/base_info/constant/'
import { getAllBranchCompanyByZoneId } from 'api/order/rentVehicle'
import { formatDate } from 'utils/dateFormattor'
import {
getAllCompany,
getAll,
updateById
} from 'api/base_info/branch_company/'
import { getAllZone } from 'api/base_info/constant/'
import { getAllBranchCompanyByZoneId } from 'api/order/rentVehicle'
import { formatDate } from 'utils/dateFormattor'
import rsCode from '../../../utils/rsCode'
import rsCode from '../../../utils/rsCode'
import { mapGetters } from 'vuex'
import { mapGetters } from 'vuex'
import { toEast8Date, deepCopyDate, newEast8Date } from 'utils/dateUtils'
import { getToken } from '../../../utils/auth'
import {
BOOK_RECORD_STATUS_APPLY,
BOOK_RECORD_STATUS_PROVED,
BOOK_RECORD_STATUS_LIFT
} from '../../../store/modules/baseInfo'
import { toEast8Date, deepCopyDate, newEast8Date } from 'utils/dateUtils'
import { getToken } from '../../../utils/auth'
import {
BOOK_RECORD_STATUS_APPLY,
BOOK_RECORD_STATUS_PROVED,
BOOK_RECORD_STATUS_LIFT
} from '../../../store/modules/baseInfo'
import bookInfoViewer from '../bookInfoViewer'
import accItemSelector from '../accompanyingItem/accItemSelector.vue'
import bookInfoViewer from '../bookInfoViewer'
import accItemSelector from '../accompanyingItem/accItemSelector.vue'
export default {
name: 'bookRecord',
components: {
bookInfoViewer,
accItemSelector
},
data() {
return {
returnForm: {
retCompany: ''
},
allCompaniesArr: [],
resetReturn: false, //更改换成地点loading
rejectVisible: false,
rejectFrom: {
vehicleBookRecordId: '',
rejectRemark: ''
},
rejectRules: {
rejectRemark: {
type: 'string',
required: true,
message: '请输入拒绝原因',
trigger: 'blur'
}
},
BASE_API: process.env.BASE_API,
departureFormrules: {
checkMan: {
required: true,
message: '请输入验车人',
trigger: 'blur'
export default {
name: 'bookRecord',
components: {
bookInfoViewer,
accItemSelector
},
data() {
return {
returnForm: {
retCompany: ''
},
checkManTel: [
{
allCompaniesArr: [],
resetReturn: false, //更改换成地点loading
rejectVisible: false,
rejectFrom: {
vehicleBookRecordId: '',
rejectRemark: ''
},
rejectRules: {
rejectRemark: {
type: 'string',
required: true,
message: '请输入验车人联系方式',
message: '请输入拒绝原因',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号'
}
],
mileage: {
type: 'number',
required: true,
message: '请输入公里数',
trigger: 'blur'
}
},
departureForm: {
vehicleId: null,
departureBranchCompanyId: null, //出发地分公司id
departureBranchCompanyName: '', //出发地分公司名称
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
mileage: null,
numberPlate: null,
expectArrivalBranchCompanyId: null, //目的地分公司id
expectArrivalBranchCompanyName: '', //目的地分公司名称
bookRecordId: null,
departurePic: '',
remark: null,
bookStartDate: null
},
departurePicList: [],
arrivalPicList: [],
arrivalForm: {
vehicleId: null,
numberPlate: null,
arrivalDate: null,
recycleMan: null,
recycleManTel: null,
mileage: null,
arrivalBranchCompanyId: null,
arrivalBranchCompanyName: '',
arrivalPic: '',
remark: '',
bookRecordId: null
},
arrivalFormrules: {
recycleMan: {
required: true,
message: '请输入收车人',
trigger: 'blur'
},
recycleManTel: [
{
BASE_API: process.env.BASE_API,
departureFormrules: {
checkMan: {
required: true,
message: '请输入收车人联系方式',
message: '请输入验车人',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号'
checkManTel: [
{
required: true,
message: '请输入验车人联系方式',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号'
}
],
mileage: {
type: 'number',
required: true,
message: '请输入公里数',
trigger: 'blur'
}
],
mileage: {
type: 'number',
required: true,
message: '请输入收车公里数',
trigger: 'blur'
}
},
statusList: [
{
code: '1',
val: '申请中'
},
{
code: '3',
val: '待出行'
},
{
code: '4',
val: '驳回'
},
{
code: '5',
val: '出行中'
},
{
code: '6',
val: '取消预订'
},
{
code: '7',
val: '已完成'
}
],
activeId: '',
bookTypeList: [
{
id: '1',
name: '租车'
},
{
id: '2',
name: '用户租赁'
},
{
id: '3',
name: '维修'
},
{
id: '4',
name: '展览'
},
{
id: '5',
name: '旅游'
},
{
id: '6',
name: '保养'
},
{
id: '7',
name: '预约中'
departureForm: {
vehicleId: null,
departureBranchCompanyId: null, //出发地分公司id
departureBranchCompanyName: '', //出发地分公司名称
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
mileage: null,
numberPlate: null,
expectArrivalBranchCompanyId: null, //目的地分公司id
expectArrivalBranchCompanyName: '', //目的地分公司名称
bookRecordId: null,
departurePic: '',
remark: null,
bookStartDate: null
},
{
id: '8',
name: '禁用'
departurePicList: [],
arrivalPicList: [],
arrivalForm: {
vehicleId: null,
numberPlate: null,
arrivalDate: null,
recycleMan: null,
recycleManTel: null,
mileage: null,
arrivalBranchCompanyId: null,
arrivalBranchCompanyName: '',
arrivalPic: '',
remark: '',
bookRecordId: null
},
{
id: '9',
name: '客户用车'
},
{
id: '10',
name: '其他'
}
],
detailId: '',
illegalVisible: false,
price: undefined, //违章罚款金额
fileList2: [], //违章截图
detailItem: {},
dialogDetailVisible: false,
baranchQuery: {
zoneId: null
},
allZoneArr: [], //全部片区
allBranchCompany: [],
state2: '', //搜索-分公司名称
rules4Query: {},
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
flag: false,
zoneId: undefined,
liftCompany: undefined,
liftCompanyName: "",
numberPlate: undefined,
selectedMonth: undefined,
status: undefined,
bookType: undefined,
bookStartDate: undefined,
bookEndDate: undefined
},
inline: true,
dialogFormVisible: false,
dialogStatus: '',
bookRecord_btn_prove: false,
bookRecord_btn_unbook: false,
bookRecord_btn_reject: false,
bookRecord_btn_lift: false,
bookRecord_btn_ret: false,
dialogForm4LiftVisible: false,
dialogForm4RetVisible: false,
allCompanies: {},
tableKey: 0,
form4Lift: {
state1: '',
id: undefined,
mileageLift: undefined,
liftCompany: undefined,
liftRemark: undefined
},
rules4Lift: {
liftCompany: [
{
arrivalFormrules: {
recycleMan: {
required: true,
message: '请选择提车分公司',
trigger: 'blur',
type: 'integer'
}
],
mileageLift: [
{
required: true,
message: '请输入当前里程数',
trigger: 'blur',
type: 'integer'
message: '请输入收车人',
trigger: 'blur'
},
{
validator: (rule, value, callback) => {
if (
this.$utils.isUndefined(value) ||
this.$utils.isNull(value)
) {
return callback()
}
if (!this.$utils.isInteger(value)) {
return callback(new Error('里程数必须为整数'))
}
if (value < 0 || value > 9999999999) {
return callback(
new Error(
'里程数合法范围:[0 - 9999999999]'
)
)
}
callback()
recycleManTel: [
{
required: true,
message: '请输入收车人联系方式',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号'
}
],
mileage: {
type: 'number',
required: true,
message: '请输入收车公里数',
trigger: 'blur'
}
],
retRemark: [
},
statusList: [
{
min: 0,
max: 2000,
message: '长度小于 2000 个字符',
trigger: 'blur'
}
]
},
form4Ret: {
id: undefined,
mileageRet: undefined,
haveViolation: undefined,
retCompany: undefined,
retRemark: undefined
},
rules4Ret: {
retCompany: [
code: '1',
val: '申请中'
},
{
required: true,
message: '请选择提车分公司',
trigger: 'blur',
type: 'integer'
code: '3',
val: '待出行'
},
{
code: '4',
val: '驳回'
},
{
code: '5',
val: '出行中'
},
{
code: '6',
val: '取消预订'
},
{
code: '7',
val: '已完成'
}
],
mileageRet: [
activeId: '',
bookTypeList: [
{
required: true,
message: '请输入当前里程数',
trigger: 'blur',
type: 'integer'
id: '1',
name: '租车'
},
{
validator: (rule, value, callback) => {
if (
this.$utils.isUndefined(value) ||
this.$utils.isNull(value)
) {
return callback()
}
if (!this.$utils.isInteger(value)) {
return callback(new Error('里程数必须为整数'))
}
if (value < 0 || value > 9999999999) {
return callback(
new Error(
'里程数合法范围:[0 - 9999999999]'
id: '2',
name: '用户租赁'
},
{
id: '3',
name: '维修'
},
{
id: '4',
name: '展览'
},
{
id: '5',
name: '旅游'
},
{
id: '6',
name: '保养'
},
{
id: '7',
name: '预约中'
},
{
id: '8',
name: '禁用'
},
{
id: '9',
name: '客户用车'
},
{
id: '10',
name: '其他'
}
],
detailId: '',
illegalVisible: false,
price: undefined, //违章罚款金额
fileList2: [], //违章截图
detailItem: {},
dialogDetailVisible: false,
baranchQuery: {
zoneId: null
},
allZoneArr: [], //全部片区
allBranchCompany: [],
state2: '', //搜索-分公司名称
rules4Query: {},
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 20,
flag: false,
zoneId: undefined,
liftCompany: undefined,
liftCompanyName: "",
numberPlate: undefined,
selectedMonth: undefined,
status: undefined,
bookType: undefined,
bookStartDate: undefined,
bookEndDate: undefined
},
inline: true,
dialogFormVisible: false,
dialogStatus: '',
bookRecord_btn_prove: false,
bookRecord_btn_unbook: false,
bookRecord_btn_reject: false,
bookRecord_btn_lift: false,
bookRecord_btn_ret: false,
dialogForm4LiftVisible: false,
dialogForm4RetVisible: false,
allCompanies: {},
tableKey: 0,
form4Lift: {
state1: '',
id: undefined,
mileageLift: undefined,
liftCompany: undefined,
liftRemark: undefined
},
rules4Lift: {
liftCompany: [
{
required: true,
message: '请选择提车分公司',
trigger: 'blur',
type: 'integer'
}
],
mileageLift: [
{
required: true,
message: '请输入当前里程数',
trigger: 'blur',
type: 'integer'
},
{
validator: (rule, value, callback) => {
if (
this.$utils.isUndefined(value) ||
this.$utils.isNull(value)
) {
return callback()
}
if (!this.$utils.isInteger(value)) {
return callback(new Error('里程数必须为整数'))
}
if (value < 0 || value > 9999999999) {
return callback(
new Error(
'里程数合法范围:[0 - 9999999999]'
)
)
)
}
callback()
}
callback()
},
trigger: 'blur'
}
],
retRemark: [
{
min: 0,
max: 2000,
message: '长度小于 2000 个字符',
trigger: 'blur'
}
]
},
form4Ret: {
id: undefined,
mileageRet: undefined,
haveViolation: undefined,
retCompany: undefined,
retRemark: undefined
},
rules4Ret: {
retCompany: [
{
required: true,
message: '请选择提车分公司',
trigger: 'blur',
type: 'integer'
}
],
mileageRet: [
{
required: true,
message: '请输入当前里程数',
trigger: 'blur',
type: 'integer'
},
trigger: 'blur'
{
validator: (rule, value, callback) => {
if (
this.$utils.isUndefined(value) ||
this.$utils.isNull(value)
) {
return callback()
}
if (!this.$utils.isInteger(value)) {
return callback(new Error('里程数必须为整数'))
}
if (value < 0 || value > 9999999999) {
return callback(
new Error(
'里程数合法范围:[0 - 9999999999]'
)
)
}
callback()
},
trigger: 'blur'
}
],
retRemark: [
{
min: 0,
max: 2000,
message: '长度小于 2000 个字符',
trigger: 'blur'
}
]
},
selectedAccItem: undefined
}
},
created() {
let t = this;
getAll().then(response => {
this.allCompaniesArr = response.data;
let query = localStorage.getItem("bookRecord");
if(query !="null" && query){
let queryJson = JSON.parse(query);
if(queryJson.page){
t.listQuery.page = queryJson.page;
}
],
retRemark: [
{
min: 0,
max: 2000,
message: '长度小于 2000 个字符',
trigger: 'blur'
if(queryJson.limit){
t.listQuery.limit = queryJson.limit;
}
if(queryJson.flag){
t.listQuery.flag = queryJson.flag;
}
if(queryJson.zoneId){
t.listQuery.zoneId = queryJson.zoneId;
}
if(queryJson.liftCompany){
t.listQuery.liftCompany = queryJson.liftCompany;
}
if(queryJson.liftCompanyName){
t.listQuery.liftCompanyName = queryJson.liftCompanyName;
}
if(queryJson.numberPlate){
t.listQuery.numberPlate = queryJson.numberPlate;
}
if(queryJson.selectedMonth){
t.listQuery.selectedMonth = queryJson.selectedMonth;
}
if(queryJson.status){
t.listQuery.status = queryJson.status;
}
if(queryJson.bookType){
t.listQuery.bookType = queryJson.bookType;
}
]
},
selectedAccItem: undefined
}
},
created() {
let t = this;
getAll().then(response => {
this.allCompaniesArr = response.data;
let query = localStorage.getItem("bookRecord");
if(query !="null" && query){
let queryJson = JSON.parse(query);
if(queryJson.page){
t.listQuery.page = queryJson.page;
}
if(queryJson.limit){
t.listQuery.limit = queryJson.limit;
}
if(queryJson.flag){
t.listQuery.flag = queryJson.flag;
}
if(queryJson.zoneId){
t.listQuery.zoneId = queryJson.zoneId;
}
if(queryJson.liftCompany){
t.listQuery.liftCompany = queryJson.liftCompany;
}
if(queryJson.liftCompanyName){
t.listQuery.liftCompanyName = queryJson.liftCompanyName;
}
if(queryJson.numberPlate){
t.listQuery.numberPlate = queryJson.numberPlate;
}
if(queryJson.selectedMonth){
t.listQuery.selectedMonth = queryJson.selectedMonth;
}
if(queryJson.status){
t.listQuery.status = queryJson.status;
}
if(queryJson.bookType){
t.listQuery.bookType = queryJson.bookType;
}
// if(queryJson.liftCompany){
// t.allCompaniesArr.map(function (item) {
// if(item.id == queryJson.liftCompany){
......@@ -1136,812 +1124,812 @@ export default {
// }
// });
// }
}
this.getList()
});
getAllCompany(codeAndBranchCompany => {
//初始化公司列表
this.allCompanies = codeAndBranchCompany
});
this.bookRecord_btn_prove = this.elements['bookRecord:btn_prove']
this.bookRecord_btn_reject = this.elements['bookRecord:btn_reject']
this.bookRecord_btn_unbook = this.elements['bookRecord:btn_unbook']
this.bookRecord_btn_lift = this.elements['bookRecord:btn_lift']
this.bookRecord_btn_ret = this.elements['bookRecord:btn_ret']
},
computed: {
...mapGetters(['elements', 'bookRecordStatus']),
getHeaderWithToken() {
return { Authorization: getToken() }
},
//获取大区列表
getAllZoneList() {
return getAllZone()
},
selectedMonth4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.selectedMonth) &&
this.listQuery.selectedMonth !== ''
) {
return toEast8Date(this.listQuery.selectedMonth)
}
return undefined
this.getList()
});
getAllCompany(codeAndBranchCompany => {
//初始化公司列表
this.allCompanies = codeAndBranchCompany
});
this.bookRecord_btn_prove = this.elements['bookRecord:btn_prove']
this.bookRecord_btn_reject = this.elements['bookRecord:btn_reject']
this.bookRecord_btn_unbook = this.elements['bookRecord:btn_unbook']
this.bookRecord_btn_lift = this.elements['bookRecord:btn_lift']
this.bookRecord_btn_ret = this.elements['bookRecord:btn_ret']
},
computed: {
...mapGetters(['elements', 'bookRecordStatus']),
getHeaderWithToken() {
return { Authorization: getToken() }
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.selectedMonth = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.selectedMonth = undefined
//获取大区列表
getAllZoneList() {
return getAllZone()
},
selectedMonth4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.selectedMonth) &&
this.listQuery.selectedMonth !== ''
) {
return toEast8Date(this.listQuery.selectedMonth)
}
return undefined
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.selectedMonth = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.selectedMonth = undefined
}
}
}
},
bookStartDate4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.bookStartDate) &&
this.listQuery.bookStartDate !== ''
) {
return toEast8Date(this.listQuery.bookStartDate)
},
bookStartDate4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.bookStartDate) &&
this.listQuery.bookStartDate !== ''
) {
return toEast8Date(this.listQuery.bookStartDate)
}
return undefined
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.bookStartDate = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.bookStartDate = undefined
}
}
return undefined
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.bookStartDate = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.bookStartDate = undefined
bookEndDate4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.bookEndDate) &&
this.listQuery.bookEndDate !== ''
) {
return toEast8Date(this.listQuery.bookEndDate)
}
return undefined
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.bookEndDate = formatDate(date, 'yyyy-MM')
} else {
this.listQuery.bookEndDate = undefined
}
}
}
},
bookEndDate4Query: {
get: function() {
if (
this.$utils.isString(this.listQuery.bookEndDate) &&
this.listQuery.bookEndDate !== ''
) {
return toEast8Date(this.listQuery.bookEndDate)
methods: {
/**
* 重置
* */
reloadPage() {
this.listQuery = {
page: 1,
limit: 20,
flag: false,
zoneId: undefined,
liftCompany: undefined,
liftCompanyName: "",
numberPlate: undefined,
selectedMonth: undefined,
status: undefined,
bookType: undefined,
bookStartDate: undefined,
bookEndDate: undefined
};
if(this.listQuery){
localStorage.setItem("bookRecord", JSON.stringify(this.listQuery));
}
return undefined
this.getList();
},
set: function(date) {
if (this.$utils.isDate(date)) {
this.listQuery.bookEndDate = formatDate(date, 'yyyy-MM')
confirm() {
if (this.returnForm.retCompany == '') {
this.$notify({
title: '失败',
message: '还车地点不能为空',
type: 'error',
duration: 2000
})
} else {
this.listQuery.bookEndDate = undefined
this.returnForm.id = this.activeId
updateById(this.returnForm).then(data => {
if (data.status == 200) {
this.$notify({
title: '成功',
message: '修改还车地点成功',
type: 'success',
duration: 2000
})
this.resetReturn = false;
this.dialogDetailVisible = false;
this.getList();
} else {
this.$notify({
title: '失败',
message: data.message,
type: 'error',
duration: 2000
})
}
})
}
}
}
},
methods: {
/**
* 重置
* */
reloadPage() {
this.listQuery = {
page: 1,
limit: 20,
flag: false,
zoneId: undefined,
liftCompany: undefined,
liftCompanyName: "",
numberPlate: undefined,
selectedMonth: undefined,
status: undefined,
bookType: undefined,
bookStartDate: undefined,
bookEndDate: undefined
};
if(this.listQuery){
localStorage.setItem("bookRecord", JSON.stringify(this.listQuery));
}
this.getList();
},
confirm() {
if (this.returnForm.retCompany == '') {
this.$notify({
title: '失败',
message: '还车地点不能为空',
type: 'error',
duration: 2000
},
/**
* 确定
* */
okHandler() {
let arr = []
this.fileList2.map(function(item) {
arr.push(item.url)
})
} else {
this.returnForm.id = this.activeId
updateById(this.returnForm).then(data => {
if (data.status == 200) {
let params = {
illegalPic: arr.join(','),
illegalAmount: this.price,
id: this.detailId
}
saveOrderViolation(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '修改还车地点成功',
message: '创建成功',
type: 'success',
duration: 2000
})
this.resetReturn = false;
this.dialogDetailVisible = false;
this.getList();
this.illegalVisible = false
this.getList()
} else {
this.$notify({
title: '失败',
message: data.message,
title: '创建失败',
message: '操作失败!',
type: 'error',
duration: 2000
})
}
})
}
},
/**
* 确定
* */
okHandler() {
let arr = []
this.fileList2.map(function(item) {
arr.push(item.url)
})
let params = {
illegalPic: arr.join(','),
illegalAmount: this.price,
id: this.detailId
}
saveOrderViolation(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
})
this.illegalVisible = false
this.getList()
} else {
this.$notify({
title: '创建失败',
message: '操作失败!',
type: 'error',
duration: 2000
})
}
})
},
/**
* 上传成功
* */
handleSuccess(res, file) {
let c = { url: res.data }
this.fileList2.push(c)
this.showLoadingBody = false
},
/**
* 删除违章图片
* */
handleRemove(file, fileList1) {
this.fileList2 = fileList1
},
/**
* 出车上传成功
* */
handleDepartureSuccess(res, file) {
let c = { url: res.data }
this.departurePicList.push(c)
this.showLoadingBody = false
},
/**
* 删除出车图片
* */
handleDepartureRemove(file, fileList2) {
this.departurePicList = fileList2
},
/**
* 上传成功
* */
handleArrivalSuccess(res, file) {
let c = { url: res.data }
this.arrivalPicList.push(c)
this.showLoadingBody = false
},
/**
* 删除违章图片
* */
handleArrivalRemove(file, fileList3) {
this.arrivalPicList = fileList3
},
/**
* 操作-违章查询按钮,显示违章弹框
*/
illegalInquiry(row) {
var t = this
this.fileList2 = []
this.price = ''
if (row.vehicleDepartureLogVo.illegalPic) {
let arr = row.vehicleDepartureLogVo.illegalPic.split(',')
let fileList2 = []
let p = {}
arr.map(function(item) {
p = {
url: item
}
fileList2.push(p)
})
t.fileList2 = fileList2
}
if (row.vehicleDepartureLogVo.illegalAmount) {
t.price = parseFloat(row.vehicleDepartureLogVo.illegalAmount)
}
this.detailId = row.vehicleDepartureLogVo.id
this.illegalVisible = true
},
/**
* 弹框-取消
* */
cancel() {
this.illegalVisible = false
},
handleDetail(row) {
this.activeId = row.id
var t = this
this.detailItem = row
if (row.vehicleDepartureLogVo != undefined) {
if (
row.vehicleDepartureLogVo.departurePic != undefined &&
row.vehicleDepartureLogVo.departurePic != ''
) {
let arr = row.vehicleDepartureLogVo.departurePic.split(',')
let departurePicList = []
},
/**
* 上传成功
* */
handleSuccess(res, file) {
let c = { url: res.data }
this.fileList2.push(c)
this.showLoadingBody = false
},
/**
* 删除违章图片
* */
handleRemove(file, fileList1) {
this.fileList2 = fileList1
},
/**
* 出车上传成功
* */
handleDepartureSuccess(res, file) {
let c = { url: res.data }
this.departurePicList.push(c)
this.showLoadingBody = false
},
/**
* 删除出车图片
* */
handleDepartureRemove(file, fileList2) {
this.departurePicList = fileList2
},
/**
* 上传成功
* */
handleArrivalSuccess(res, file) {
let c = { url: res.data }
this.arrivalPicList.push(c)
this.showLoadingBody = false
},
/**
* 删除违章图片
* */
handleArrivalRemove(file, fileList3) {
this.arrivalPicList = fileList3
},
/**
* 操作-违章查询按钮,显示违章弹框
*/
illegalInquiry(row) {
var t = this
this.fileList2 = []
this.price = ''
if (row.vehicleDepartureLogVo.illegalPic) {
let arr = row.vehicleDepartureLogVo.illegalPic.split(',')
let fileList2 = []
let p = {}
arr.map(function(item) {
departurePicList.push(item)
p = {
url: item
}
fileList2.push(p)
})
t.departurePicList = departurePicList
} else {
t.departurePicList = []
t.fileList2 = fileList2
}
if (
row.vehicleDepartureLogVo.arrivalPic != undefined &&
row.vehicleDepartureLogVo.arrivalPic != ''
) {
let Arr = row.vehicleDepartureLogVo.arrivalPic.split(',')
let arrivalPicList = []
let p = {}
Arr.map(function(item) {
arrivalPicList.push(item)
})
t.arrivalPicList = arrivalPicList
if (row.vehicleDepartureLogVo.illegalAmount) {
t.price = parseFloat(row.vehicleDepartureLogVo.illegalAmount)
}
this.detailId = row.vehicleDepartureLogVo.id
this.illegalVisible = true
},
/**
* 弹框-取消
* */
cancel() {
this.illegalVisible = false
},
handleDetail(row) {
this.activeId = row.id
var t = this
this.detailItem = row
if (row.vehicleDepartureLogVo != undefined) {
if (
row.vehicleDepartureLogVo.departurePic != undefined &&
row.vehicleDepartureLogVo.departurePic != ''
) {
let arr = row.vehicleDepartureLogVo.departurePic.split(',')
let departurePicList = []
let p = {}
arr.map(function(item) {
departurePicList.push(item)
})
t.departurePicList = departurePicList
} else {
t.departurePicList = []
}
if (
row.vehicleDepartureLogVo.arrivalPic != undefined &&
row.vehicleDepartureLogVo.arrivalPic != ''
) {
let Arr = row.vehicleDepartureLogVo.arrivalPic.split(',')
let arrivalPicList = []
let p = {}
Arr.map(function(item) {
arrivalPicList.push(item)
})
t.arrivalPicList = arrivalPicList
} else {
t.arrivalPicList = []
}
} else {
t.departurePicList = []
t.arrivalPicList = []
}
} else {
t.departurePicList = []
t.arrivalPicList = []
}
this.dialogDetailVisible = true
},
//监听change事件
getProvinceRegions(item) {
this.listQuery.zoneId = item
this.baranchQuery.zoneId = item
this.dialogDetailVisible = true
},
//监听change事件
getProvinceRegions(item) {
this.listQuery.zoneId = item
this.baranchQuery.zoneId = item
// this.listQuery.liftCompany = undefined
// getAllBranchCompanyByZoneId(this.baranchQuery).then(response => {
// this.allBranchCompany = response.data
// })
},
getAllBranchCompanyChange(item) {
this.listQuery.liftCompany = item
},
querySearch(queryString, cb) {
let selectArry = []
let iitem = {
value: '全部',
name: '全部'
}
selectArry.push(iitem)
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)
},
createFilter(queryString) {
return restaurant => {
return restaurant.name.indexOf(queryString.toLowerCase()) != -1
}
},
/**
* 提车分公司
* */
handleSelect(item) {
if (item.value == "全部") {
this.listQuery.liftCompany = undefined;
} else {
this.listQuery.liftCompany = item.id;
}
},
cancelDialog4Lift(formName) {
this.dialogForm4LiftVisible = false
this.$refs[formName].resetFields()
},
cancelDialog4Ret(formName) {
this.dialogForm4RetVisible = false
this.$refs[formName].resetFields()
},
/**
* 出车弹框-确定
* */
liftOk(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
if (Number(this.departureForm.mileage) > 999999) {
this.$notify({
title: '警告',
message: '公里数不能大于999999',
type: 'warning',
duration: 2000
})
return false
}
var arr = []
this.departurePicList.map(function(item) {
arr.push(item.url)
})
this.departureForm.departurePic = arr.join(',')
departureVehicle(this.departureForm).then(response => {
if (response.status == 200) {
this.dialogForm4LiftVisible = false
this.$notify({
title: '成功',
message: '出车成功',
type: 'success',
duration: 2000
})
this.cleanDepartureForm()
this.getList()
} else {
},
getAllBranchCompanyChange(item) {
this.listQuery.liftCompany = item
},
querySearch(queryString, cb) {
let selectArry = []
let iitem = {
value: '全部',
name: '全部'
}
selectArry.push(iitem)
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)
},
createFilter(queryString) {
return restaurant => {
return restaurant.name.indexOf(queryString.toLowerCase()) != -1
}
},
/**
* 提车分公司
* */
handleSelect(item) {
if (item.value == "全部") {
this.listQuery.liftCompany = undefined;
} else {
this.listQuery.liftCompany = item.id;
}
},
cancelDialog4Lift(formName) {
this.dialogForm4LiftVisible = false
this.$refs[formName].resetFields()
},
cancelDialog4Ret(formName) {
this.dialogForm4RetVisible = false
this.$refs[formName].resetFields()
},
/**
* 出车弹框-确定
* */
liftOk(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
if (Number(this.departureForm.mileage) > 999999) {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
title: '警告',
message: '公里数不能大于999999',
type: 'warning',
duration: 2000
})
return false
}
})
} else {
return false
}
})
},
handleBookInfo(row) {
this.$refs.bookInfoViewer.handleBookInfo(row.vehicle)
},
handleAccItemInfo(row) {
this.selectedAccItem = row.accItemAndAmount
this.$refs.accItemSelector.show()
},
checkIfBooked(bookedDate, [startDateStr, endDateStr]) {
if (
this.$utils.isInteger(bookedDate) &&
this.$utils.isString(startDateStr) &&
startDateStr !== '' &&
this.$utils.isString(endDateStr) &&
endDateStr !== ''
) {
let startDate = toEast8Date(startDateStr)
let endDate = toEast8Date(endDateStr)
for (
;
this.$utils.toDateString(startDate, 'yyyy-MM-dd') <=
this.$utils.toDateString(endDate, 'yyyy-MM-dd');
startDate.setDate(startDate.getDate() + 1)
var arr = []
this.departurePicList.map(function(item) {
arr.push(item.url)
})
this.departureForm.departurePic = arr.join(',')
departureVehicle(this.departureForm).then(response => {
if (response.status == 200) {
this.dialogForm4LiftVisible = false
this.$notify({
title: '成功',
message: '出车成功',
type: 'success',
duration: 2000
})
this.cleanDepartureForm()
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
})
} else {
return false
}
})
},
handleBookInfo(row) {
this.$refs.bookInfoViewer.handleBookInfo(row.vehicle)
},
handleAccItemInfo(row) {
this.selectedAccItem = row.accItemAndAmount
this.$refs.accItemSelector.show()
},
checkIfBooked(bookedDate, [startDateStr, endDateStr]) {
if (
this.$utils.isInteger(bookedDate) &&
this.$utils.isString(startDateStr) &&
startDateStr !== '' &&
this.$utils.isString(endDateStr) &&
endDateStr !== ''
) {
if ((bookedDate & (1 << (startDate.getDate() - 1))) !== 0) {
return true
let startDate = toEast8Date(startDateStr)
let endDate = toEast8Date(endDateStr)
for (
;
this.$utils.toDateString(startDate, 'yyyy-MM-dd') <=
this.$utils.toDateString(endDate, 'yyyy-MM-dd');
startDate.setDate(startDate.getDate() + 1)
) {
if ((bookedDate & (1 << (startDate.getDate() - 1))) !== 0) {
return true
}
}
}
}
return false
},
checkIfApply(code) {
return code === BOOK_RECORD_STATUS_APPLY
},
checkIfProved(code) {
return code === BOOK_RECORD_STATUS_PROVED
},
checkIfLift(code) {
return code === BOOK_RECORD_STATUS_LIFT
},
getList() {
this.listLoading = true
for (var key in this.listQuery) {
if (this.listQuery[key] === '') {
this.listQuery[key] = undefined
}
}
page(this.listQuery).then(response => {
this.list = response.data.data
this.total = response.data.totalCount
this.listLoading = false
})
},
getBookRecordStatus: function(data) {
this.bookRecordStatus['3'].val = '待出行'
this.bookRecordStatus['4'].val = '驳回'
this.bookRecordStatus['5'].val = '出行中'
this.bookRecordStatus['7'].val = '已完成'
if (data) {
if (!this.$utils.isInteger(data.status)) {
return '未知'
return false
},
checkIfApply(code) {
return code === BOOK_RECORD_STATUS_APPLY
},
checkIfProved(code) {
return code === BOOK_RECORD_STATUS_PROVED
},
checkIfLift(code) {
return code === BOOK_RECORD_STATUS_LIFT
},
getList() {
this.listLoading = true
for (var key in this.listQuery) {
if (this.listQuery[key] === '') {
this.listQuery[key] = undefined
}
}
if (
data.status == 2 &&
(data.vehicleDepartureLogVo == undefined ||
data.vehicleDepartureLogVo == null)
) {
return this.bookRecordStatus['3'].val
page(this.listQuery).then(response => {
this.list = response.data.data
this.total = response.data.totalCount
this.listLoading = false
})
},
getBookRecordStatus: function(data) {
this.bookRecordStatus['3'].val = '待出行'
this.bookRecordStatus['4'].val = '驳回'
this.bookRecordStatus['5'].val = '出行中'
this.bookRecordStatus['7'].val = '已完成'
if (data) {
if (!this.$utils.isInteger(data.status)) {
return '未知'
}
if (
data.status == 2 &&
(data.vehicleDepartureLogVo == undefined ||
data.vehicleDepartureLogVo == null)
) {
return this.bookRecordStatus['3'].val
}
if (
data.status == 2 &&
data.vehicleDepartureLogVo != undefined &&
data.vehicleDepartureLogVo != null &&
data.vehicleDepartureLogVo.state == 0
) {
return this.bookRecordStatus['5'].val
}
if (
data.status == 2 &&
data.vehicleDepartureLogVo != undefined &&
data.vehicleDepartureLogVo != null &&
data.vehicleDepartureLogVo.state == 1
) {
return this.bookRecordStatus['7'].val
}
return this.bookRecordStatus[data.status + ''].val
}
return ''
},
getAllBookRecordStatus: function() {
console.log(this.bookRecordStatus)
return this.bookRecordStatus
},
getDatePeriodStr([startDate, endDate]) {
if (
data.status == 2 &&
data.vehicleDepartureLogVo != undefined &&
data.vehicleDepartureLogVo != null &&
data.vehicleDepartureLogVo.state == 0
this.$utils.isString(startDate) &&
startDate !== '' &&
this.$utils.isString(endDate) &&
endDate !== ''
) {
return this.bookRecordStatus['5'].val
return (
formatDate(toEast8Date(startDate), 'yyyy-MM-dd') +
' 至 ' +
formatDate(toEast8Date(endDate), 'yyyy-MM-dd')
)
}
if (
data.status == 2 &&
data.vehicleDepartureLogVo != undefined &&
data.vehicleDepartureLogVo != null &&
data.vehicleDepartureLogVo.state == 1
) {
return this.bookRecordStatus['7'].val
return '未知'
},
/**
* 清空出车弹框数据
*/
cleanDepartureForm() {
this.departureForm = {
vehicleId: null,
departureBranchCompanyId: null, //出发地分公司id
departureBranchCompanyName: '', //出发地分公司名称
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
mileage: null,
numberPlate: null,
expectArrivalBranchCompanyId: null, //目的地分公司id
expectArrivalBranchCompanyName: '', //目的地分公司名称
bookRecordId: null,
departurePic: '',
remark: null,
bookStartDate: null
}
return this.bookRecordStatus[data.status + ''].val
}
return ''
},
getAllBookRecordStatus: function() {
console.log(this.bookRecordStatus)
return this.bookRecordStatus
},
getDatePeriodStr([startDate, endDate]) {
if (
this.$utils.isString(startDate) &&
startDate !== '' &&
this.$utils.isString(endDate) &&
endDate !== ''
) {
return (
formatDate(toEast8Date(startDate), 'yyyy-MM-dd') +
' 至 ' +
formatDate(toEast8Date(endDate), 'yyyy-MM-dd')
)
}
return '未知'
},
/**
* 清空出车弹框数据
*/
cleanDepartureForm() {
this.departureForm = {
vehicleId: null,
departureBranchCompanyId: null, //出发地分公司id
departureBranchCompanyName: '', //出发地分公司名称
use: null,
user: null,
userTel: null,
checkMan: null,
checkManTel: null,
mileage: null,
numberPlate: null,
expectArrivalBranchCompanyId: null, //目的地分公司id
expectArrivalBranchCompanyName: '', //目的地分公司名称
bookRecordId: null,
departurePic: '',
remark: null,
bookStartDate: null
}
},
cleanArrivalForm() {
this.arrivalForm = {
vehicleId: null,
numberPlate: null,
arrivalDate: null,
recycleMan: null,
recycleManTel: null,
mileage: null,
arrivalBranchCompanyId: null,
arrivalBranchCompanyName: '',
arrivalPic: '',
remark: '',
bookRecordId: null
}
},
/**
* 搜索按钮
* */
handleFilter() {
this.listQuery.page = 1
this.$refs.queryForm.validate(valid => {
if (valid) {
if(this.listQuery){
localStorage.setItem("bookRecord", JSON.stringify(this.listQuery));
}
this.getList()
} else {
return false
},
cleanArrivalForm() {
this.arrivalForm = {
vehicleId: null,
numberPlate: null,
arrivalDate: null,
recycleMan: null,
recycleManTel: null,
mileage: null,
arrivalBranchCompanyId: null,
arrivalBranchCompanyName: '',
arrivalPic: '',
remark: '',
bookRecordId: null
}
})
},
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
},
handleProve(row) {
this.$confirm('确定批准申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
prove(row.id).then(response => {
if (
response.code ===
rsCode.code.VEHICLE_BOOKED_INFO_ALREADY_CHANGED
) {
this.$notify({
title: '失败',
message:
rsCode.msg[
rsCode.code
.VEHICLE_BOOKED_INFO_ALREADY_CHANGED
],
type: 'error',
duration: 2000
})
} else if (
response.code ===
rsCode.code.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
) {
this.$notify({
title: '失败',
message:
rsCode.msg[
rsCode.code
.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
],
type: 'error',
duration: 2000
})
} else if (response.code === rsCode.RS_CODE_SUC) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
if (this.dialogDetailVisible) {
this.dialogDetailVisible = false
},
/**
* 搜索按钮
* */
handleFilter() {
this.listQuery.page = 1
this.$refs.queryForm.validate(valid => {
if (valid) {
if(this.listQuery){
localStorage.setItem("bookRecord", JSON.stringify(this.listQuery));
}
this.getList()
} else {
return false
}
this.getList()
})
})
},
rejectBtn(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
reject(this.rejectFrom).then(response => {
if (response.code == 1) {
},
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
},
handleProve(row) {
this.$confirm('确定批准申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
prove(row.id).then(response => {
if (
response.code ===
rsCode.code.VEHICLE_BOOKED_INFO_ALREADY_CHANGED
) {
this.$notify({
title: '失败',
message:
rsCode.msg[
rsCode.code
.VEHICLE_BOOKED_INFO_ALREADY_CHANGED
],
type: 'error',
duration: 2000
})
} else if (
response.code ===
rsCode.code.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
) {
this.$notify({
title: '失败',
message:
rsCode.msg[
rsCode.code
.VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
],
type: 'error',
duration: 2000
})
} else if (response.code === rsCode.RS_CODE_SUC) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
this.getList()
if (this.rejectVisible) {
this.rejectVisible = false
}
if (this.dialogDetailVisible) {
this.dialogDetailVisible = false
}
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
this.getList()
})
} else {
return false
}
})
},
handleReject(row) {
this.rejectVisible = true
this.rejectFrom.vehicleBookRecordId = row.id
this.rejectFrom.rejectRemark = ''
},
/**
* 操作-出车
* @param row
*/
handleLift(row) {
this.cleanDepartureForm()
this.departurePicList = []
if (row.bookType == 1) {
this.departureForm.use = '租车'
} else if (row.bookType == 2) {
this.departureForm.use = '用户租赁'
} else if (row.bookType == 3) {
this.departureForm.use = '维修'
} else if (row.bookType == 4) {
this.departureForm.use = '展览'
} else if (row.bookType == 5) {
this.departureForm.use = '旅游'
} else if (row.bookType == 6) {
this.departureForm.use = '保养'
} else if (row.bookType == 7) {
this.departureForm.use = '预约中'
} else if (row.bookType == 8) {
this.departureForm.use = '禁用'
} else if (row.bookType == 9) {
this.departureForm.use = '客户用车'
} else if (row.bookType == 10) {
this.departureForm.use = '其他'
}
this.departureForm.bookRecordId = row.id
this.departureForm.vehicleId = row.vehicleId
this.departureForm.numberPlate = row.numberPlate
this.departureForm.departureDate = Date()
this.departureForm.departureBranchCompanyId = row.liftCompany
this.departureForm.departureBranchCompanyName = row.liftCompanyName
this.departureForm.user = row.vehicleUsername
this.departureForm.userTel = row.vehicleUserPhone
// if(row.vehicleDepartureLogVo!=undefined){
// this.departureForm.user = row.vehicleDepartureLogVo.user?row.vehicleDepartureLogVo.user:''
// this.departureForm.userTel = row.vehicleDepartureLogVo.userTel?row.vehicleDepartureLogVo.userTel:''
// }else{
// this.departureForm.user = ''
// this.departureForm.userTel = ''
// }
this.departureForm.expectArrivalBranchCompanyId = row.retCompany
this.departureForm.expectArrivalBranchCompanyName =
row.retCompanyName
this.dialogForm4LiftVisible = true
},
/**
* 操作-收车
* @param row
*/
handleRet(row) {
this.arrivalPicList = []
this.arrivalForm.bookRecordId = row.id
this.arrivalForm.vehicleId = row.vehicleId
this.arrivalForm.numberPlate = row.numberPlate
this.arrivalForm.arrivalDate = Date()
this.arrivalForm.arrivalBranchCompanyId = row.retCompany
this.arrivalForm.arrivalBranchCompanyName = row.retCompanyName
this.dialogForm4RetVisible = true
},
ret(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
if (Number(this.arrivalForm.mileage) > 999999) {
this.$notify({
title: '警告',
message: '公里数不能大于999999',
type: 'warning',
duration: 2000
})
},
rejectBtn(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
reject(this.rejectFrom).then(response => {
if (response.code == 1) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
this.getList()
if (this.rejectVisible) {
this.rejectVisible = false
}
if (this.dialogDetailVisible) {
this.dialogDetailVisible = false
}
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
})
} else {
return false
}
var arr = []
this.arrivalPicList.map(function(item) {
arr.push(item.url)
})
this.arrivalForm.arrivalPic = arr.join(',')
arrivalVehicle(this.arrivalForm).then(response => {
if (response.status == 200) {
this.dialogForm4RetVisible = false
this.$notify({
title: '成功',
message: '收车成功',
type: 'success',
duration: 2000
})
this.cleanArrivalForm()
this.getList()
} else {
})
},
handleReject(row) {
this.rejectVisible = true
this.rejectFrom.vehicleBookRecordId = row.id
this.rejectFrom.rejectRemark = ''
},
/**
* 操作-出车
* @param row
*/
handleLift(row) {
this.cleanDepartureForm()
this.departurePicList = []
if (row.bookType == 1) {
this.departureForm.use = '租车'
} else if (row.bookType == 2) {
this.departureForm.use = '用户租赁'
} else if (row.bookType == 3) {
this.departureForm.use = '维修'
} else if (row.bookType == 4) {
this.departureForm.use = '展览'
} else if (row.bookType == 5) {
this.departureForm.use = '旅游'
} else if (row.bookType == 6) {
this.departureForm.use = '保养'
} else if (row.bookType == 7) {
this.departureForm.use = '预约中'
} else if (row.bookType == 8) {
this.departureForm.use = '禁用'
} else if (row.bookType == 9) {
this.departureForm.use = '客户用车'
} else if (row.bookType == 10) {
this.departureForm.use = '其他'
}
this.departureForm.bookRecordId = row.id
this.departureForm.vehicleId = row.vehicleId
this.departureForm.numberPlate = row.numberPlate
this.departureForm.departureDate = Date()
this.departureForm.departureBranchCompanyId = row.liftCompany
this.departureForm.departureBranchCompanyName = row.liftCompanyName
this.departureForm.user = row.vehicleUsername
this.departureForm.userTel = row.vehicleUserPhone
// if(row.vehicleDepartureLogVo!=undefined){
// this.departureForm.user = row.vehicleDepartureLogVo.user?row.vehicleDepartureLogVo.user:''
// this.departureForm.userTel = row.vehicleDepartureLogVo.userTel?row.vehicleDepartureLogVo.userTel:''
// }else{
// this.departureForm.user = ''
// this.departureForm.userTel = ''
// }
this.departureForm.expectArrivalBranchCompanyId = row.retCompany
this.departureForm.expectArrivalBranchCompanyName =
row.retCompanyName
this.dialogForm4LiftVisible = true
},
/**
* 操作-收车
* @param row
*/
handleRet(row) {
this.arrivalPicList = []
this.arrivalForm.bookRecordId = row.id
this.arrivalForm.vehicleId = row.vehicleId
this.arrivalForm.numberPlate = row.numberPlate
this.arrivalForm.arrivalDate = Date()
this.arrivalForm.arrivalBranchCompanyId = row.retCompany
this.arrivalForm.arrivalBranchCompanyName = row.retCompanyName
this.dialogForm4RetVisible = true
},
ret(formName) {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
if (Number(this.arrivalForm.mileage) > 999999) {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
title: '警告',
message: '公里数不能大于999999',
type: 'warning',
duration: 2000
})
return false
}
})
} else {
return false
}
})
},
handleUnbook(row) {
this.$confirm('确定取消预定?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var obj = {
vehicleBookRecordId: row.id
}
var arr = []
this.arrivalPicList.map(function(item) {
arr.push(item.url)
})
this.arrivalForm.arrivalPic = arr.join(',')
arrivalVehicle(this.arrivalForm).then(response => {
if (response.status == 200) {
this.dialogForm4RetVisible = false
this.$notify({
title: '成功',
message: '收车成功',
type: 'success',
duration: 2000
})
this.cleanArrivalForm()
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
})
} else {
return false
}
})
},
handleUnbook(row) {
this.$confirm('确定取消预定?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var obj = {
vehicleBookRecordId: row.id
}
unbook(obj)
.then(response => {
if (response.code == 1) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
unbook(obj)
.then(response => {
if (response.code == 1) {
this.$notify({
title: '成功',
message: '操作成功',
type: 'success',
duration: 2000
})
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
})
}
})
this.getList()
} else {
this.$notify({
title: '失败',
message: response.message,
type: 'error',
duration: 2000
.catch(response => {
console.log(response)
})
}
})
.catch(response => {
console.log(response)
})
})
})
}
}
}
}
</script>
<style scoped>
.order-details .el-form-item {
margin-bottom: 0px !important;
}
.order-details hr {
height: 1px;
background-color: #ccc;
border: none;
}
.image {
width: 100%;
height: 110px;
display: block;
}
.el-card__body,
.el-card {
padding: 0px !important;
width: 150px;
text-align: center;
}
.modal_modal {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0.5;
background: #000;
z-index: 2001;
}
.order-details .el-form-item {
margin-bottom: 0px !important;
}
.order-details hr {
height: 1px;
background-color: #ccc;
border: none;
}
.image {
width: 100%;
height: 110px;
display: block;
}
.el-card__body,
.el-card {
padding: 0px !important;
width: 150px;
text-align: center;
}
.modal_modal {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0.5;
background: #000;
z-index: 2001;
}
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
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