Commit cd8bfcf6 by 王志慧

Merge branch 'yc_v1.0.0' of http://192.168.3.233:8090/saas/scrm-micro-charge into yc_v1.0.0

2 parents b2c8dbe8 addd3bf9
...@@ -13,6 +13,16 @@ const getParkingSpaceListApi = params => { ...@@ -13,6 +13,16 @@ const getParkingSpaceListApi = params => {
}) })
} }
const getHistoryListApi = params => {
params.method = 'marketing.api.charge.parkingSpace.history.page'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
// 获取小区列表 // 获取小区列表
const getMerchantListApi = params => { const getMerchantListApi = params => {
params.method = 'marketing.api.charge.parkingSpace.getMerchantList' params.method = 'marketing.api.charge.parkingSpace.getMerchantList'
...@@ -34,6 +44,16 @@ const exportParkingSpaceListApi = params => { ...@@ -34,6 +44,16 @@ const exportParkingSpaceListApi = params => {
}) })
} }
const exportHistoryListApi = params => {
params.method = 'marketing.api.charge.parkingSpace.history.page.export'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
const addParkingSpaceApi = params => { const addParkingSpaceApi = params => {
params.method = 'marketing.api.charge.parkingSpace.create' params.method = 'marketing.api.charge.parkingSpace.create'
return http({ return http({
...@@ -96,8 +116,10 @@ const addFlagparkingSpace = params => { ...@@ -96,8 +116,10 @@ const addFlagparkingSpace = params => {
} }
export default { export default {
getParkingSpaceListApi, getParkingSpaceListApi,
getHistoryListApi,
getMerchantListApi, getMerchantListApi,
exportParkingSpaceListApi, exportParkingSpaceListApi,
exportHistoryListApi,
addParkingSpaceApi, addParkingSpaceApi,
getRadarListApi, getRadarListApi,
delParkingSpaceApi, delParkingSpaceApi,
......
import { Message } from 'element-ui' import { Message } from 'element-ui'
let util = {} let util = {}
util.cloneText = function (message) { util.cloneText = function(message) {
let input = document.createElement('input') let input = document.createElement('input')
input.value = message input.value = message
document.body.appendChild(input) document.body.appendChild(input)
...@@ -9,7 +9,7 @@ util.cloneText = function (message) { ...@@ -9,7 +9,7 @@ util.cloneText = function (message) {
document.body.removeChild(input) document.body.removeChild(input)
Message.success('复制成功') Message.success('复制成功')
} }
util.getBeforeDate = function (sign = '-') { util.getBeforeDate = function(sign = '-') {
let day = new Date() let day = new Date()
let month = day.getMonth() + 1 let month = day.getMonth() + 1
let date = day.getDate() let date = day.getDate()
...@@ -18,7 +18,7 @@ util.getBeforeDate = function (sign = '-') { ...@@ -18,7 +18,7 @@ util.getBeforeDate = function (sign = '-') {
var s = day.getFullYear() + sign + month + sign + date var s = day.getFullYear() + sign + month + sign + date
return s return s
} }
util.getTimeFomat = function (time, sign = '-') { util.getTimeFomat = function(time, sign = '-') {
let day = new Date(time) let day = new Date(time)
let month = day.getMonth() + 1 let month = day.getMonth() + 1
let date = day.getDate() let date = day.getDate()
...@@ -31,7 +31,7 @@ util.getTimeFomat = function (time, sign = '-') { ...@@ -31,7 +31,7 @@ util.getTimeFomat = function (time, sign = '-') {
var s = day.getFullYear() + sign + month + sign + date + ' ' + hour + ':' + mm var s = day.getFullYear() + sign + month + sign + date + ' ' + hour + ':' + mm
return s return s
} }
util.getBetweenDate = function (day, num, str = '-') { util.getBetweenDate = function(day, num, str = '-') {
var today = new Date(day) var today = new Date(day)
var nowTime = today.getTime() var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * (num - 1) var ms = 24 * 3600 * 1000 * (num - 1)
...@@ -43,7 +43,7 @@ util.getBetweenDate = function (day, num, str = '-') { ...@@ -43,7 +43,7 @@ util.getBetweenDate = function (day, num, str = '-') {
if (oDay.length <= 1) oDay = '0' + oDay if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay return oYear + str + oMoth + str + oDay
} }
util.getBeforeMonth = function (days) { util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1 let month = new Date().getMonth() + 1
let year = new Date().getFullYear() let year = new Date().getFullYear()
let arr = new Array() let arr = new Array()
...@@ -58,7 +58,7 @@ util.getBeforeMonth = function (days) { ...@@ -58,7 +58,7 @@ util.getBeforeMonth = function (days) {
} }
return arr return arr
} }
util.getPrevMonth = function () { util.getPrevMonth = function() {
let month = new Date().getMonth() let month = new Date().getMonth()
let year = new Date().getFullYear() let year = new Date().getFullYear()
if (month == 0) { if (month == 0) {
...@@ -67,7 +67,7 @@ util.getPrevMonth = function () { ...@@ -67,7 +67,7 @@ util.getPrevMonth = function () {
} }
return year + '年' + month + '月' return year + '年' + month + '月'
} }
util.getCurrentMonthLast = function (date) { util.getCurrentMonthLast = function(date) {
var endDate = new Date(date) var endDate = new Date(date)
var month = endDate.getMonth() var month = endDate.getMonth()
var nextMonth = ++month var nextMonth = ++month
...@@ -76,23 +76,23 @@ util.getCurrentMonthLast = function (date) { ...@@ -76,23 +76,23 @@ util.getCurrentMonthLast = function (date) {
var dateString = new Date(nextMonthFirstDay - oneDay) var dateString = new Date(nextMonthFirstDay - oneDay)
return dateString.toLocaleDateString().replace(new RegExp('/', 'g'), '-') //toLocaleDateString() 返回 如:2018/8/31 return dateString.toLocaleDateString().replace(new RegExp('/', 'g'), '-') //toLocaleDateString() 返回 如:2018/8/31
} }
util.openUrl = function (url) { util.openUrl = function(url) {
const link = document.createElement('a') const link = document.createElement('a')
link.href = url link.href = url
link.click() link.click()
} }
util.openTab = function (url) { util.openTab = function(url) {
const link = document.createElement('a') const link = document.createElement('a')
link.href = url link.href = url
link.target = '_blank' link.target = '_blank'
link.rel = 'opener' link.rel = 'opener'
link.click() link.click()
} }
util.isShowBtn = function (value, permissions) { util.isShowBtn = function(value, permissions) {
let isShowStatus = false let isShowStatus = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST']) const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menuLevel(menu) menuLevel(menu)
function menuLevel (item) { function menuLevel(item) {
item.forEach(itm => { item.forEach(itm => {
if (value && itm.path == value) { if (value && itm.path == value) {
isShowStatus = true isShowStatus = true
...@@ -100,11 +100,11 @@ util.isShowBtn = function (value, permissions) { ...@@ -100,11 +100,11 @@ util.isShowBtn = function (value, permissions) {
if ( if (
!value && !value &&
itm.path == itm.path ==
'/' + '/' +
location.pathname location.pathname
.split('/') .split('/')
.slice(-2) .slice(-2)
.join('/') && .join('/') &&
itm.meta && itm.meta &&
itm.meta.permissions.includes(permissions) itm.meta.permissions.includes(permissions)
) { ) {
...@@ -123,12 +123,12 @@ util.getArrayIsSubset = (arr2, arr1) => { ...@@ -123,12 +123,12 @@ util.getArrayIsSubset = (arr2, arr1) => {
return arr1.includes(item) return arr1.includes(item)
}) })
} }
util.downloadIamge = function (imgsrc, name = new Date().getTime()) { util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名 //下载图片地址和图片名
var image = new Image() var image = new Image()
// 解决跨域 Canvas 污染问题 // 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous') image.setAttribute('crossOrigin', 'anonymous')
image.onload = function () { image.onload = function() {
var canvas = document.createElement('canvas') var canvas = document.createElement('canvas')
canvas.width = image.width canvas.width = image.width
canvas.height = image.height canvas.height = image.height
...@@ -143,4 +143,72 @@ util.downloadIamge = function (imgsrc, name = new Date().getTime()) { ...@@ -143,4 +143,72 @@ util.downloadIamge = function (imgsrc, name = new Date().getTime()) {
} }
image.src = imgsrc image.src = imgsrc
} }
function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
util.exportFn = function(url) {
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
}
util.formatSeconds = function(value) {
var theTime = parseInt(value) // 需要转换的时间秒
var theTime1 = 0 // 分
var theTime2 = 0 // 小时
var theTime3 = 0 // 天
if (theTime > 60) {
theTime1 = parseInt(theTime / 60)
theTime = parseInt(theTime % 60)
if (theTime1 > 60) {
theTime2 = parseInt(theTime1 / 60)
theTime1 = parseInt(theTime1 % 60)
if (theTime2 > 24) {
//大于24小时
theTime3 = parseInt(theTime2 / 24)
theTime2 = parseInt(theTime2 % 24)
}
}
}
var result = ''
if (theTime > 0) {
result = '' + parseInt(theTime) + '秒'
}
if (theTime1 > 0) {
result = '' + parseInt(theTime1) + '分' + result
}
if (theTime2 > 0) {
result = '' + parseInt(theTime2) + '小时' + result
}
if (theTime3 > 0) {
result = '' + parseInt(theTime3) + '天' + result
}
return result
}
export default util export default util
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div :class="['date-item', { 'seleted-item': searchForm.curDate == item.value }]" v-for="(item, index) in scope.scope.dateList" :key="index">{{ item.name }}</div> <div :class="['date-item', { 'seleted-item': searchForm.curDate == item.value }]" v-for="(item, index) in scope.scope.dateList" :key="index">{{ item.name }}</div>
</div> </div>
<div slot="inputSlot"> <div slot="inputSlot">
<el-input placeholder="请输入完整车位编号" v-model.trim="searchForm.sno" :clearable="true" type="text"></el-input> <el-input placeholder="请输入完整车位编号" v-model.trim="searchForm.parkingNumber" :clearable="true" type="text"></el-input>
</div> </div>
</GLCombiForm> </GLCombiForm>
<div class="statusList"> <div class="statusList">
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
</div> </div>
<GLTable ref="statusTableRef" :beforeSearchFn="beforeSearchFn" :getListApi="getListApi" :noDataImg="url" :searchForm="realSearchForm" :pageConf="pageConf" :tableParams="tableParams"> <GLTable ref="statusTableRef" :beforeSearchFn="beforeSearchFn" :getListApi="getListApi" :noDataImg="url" :searchForm="realSearchForm" :pageConf="pageConf" :tableParams="tableParams">
<div slot="statusSlot" slot-scope="scope"> <div slot="statusSlot" slot-scope="scope">
<span class="status-class"></span> <span v-if="parkingStatusEnum[scope.scope.parkingStatus]" class="status-class" :style="{ 'background-color': parkingStatusEnum[scope.scope.parkingStatus].color }"></span>
<span>{{ scope.scope.goodsStatus == 1 ? '上架' : '下架' }}</span> <span>{{ parkingStatusEnum[scope.scope.parkingStatus] ? parkingStatusEnum[scope.scope.parkingStatus].name : '--' }}</span>
</div> </div>
</GLTable> </GLTable>
</div> </div>
...@@ -30,30 +30,26 @@ ...@@ -30,30 +30,26 @@
</template> </template>
<script> <script>
const STATUS_ENUM = { 1: '#EB4E4E', 2: '#2CCA74', 3: '#999999' } const PARKING_STATUS_ENUM = { 0: { color: '#999999', name: '未知' }, 1: { color: '#2CCA74', name: '空闲' }, 2: { color: '#EB4E4E', name: '占用' } }
import * as dayjs from 'dayjs' import url from '@/assets/empty.png'
import dayjs from 'dayjs'
import util from '@/utils/util' import util from '@/utils/util'
export default { export default {
name: 'repairList', name: 'statusList',
components: {}, components: {},
data() { data() {
return { return {
url: 'url', url: url,
searchForm: { searchForm: {
curDate: '', curDate: '',
operate: false, parkingNumber: '',
sn: '', searchDate: []
merchantName: '',
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: ''
}, },
realSearchForm: {},
parkingStatusEnum: PARKING_STATUS_ENUM,
searchFormList: [ searchFormList: [
{ {
name: 'sn', name: 'curDate',
addHtml: 'dateSelectSlot', addHtml: 'dateSelectSlot',
dateList: [ dateList: [
{ {
...@@ -79,18 +75,18 @@ export default { ...@@ -79,18 +75,18 @@ export default {
] ]
}, },
{ {
name: 'successDate', name: 'searchDate',
type: 'datePicker', type: 'datePicker',
labelWidth: 95, labelWidth: 95,
isClear: true, isClear: true,
pickerOptions: 'beforeRangePickerOptions' pickerOptions: 'beforeRangePickerOptions'
}, },
{ {
name: 'sn', name: 'parkingNumber',
addHtml: 'inputSlot' addHtml: 'inputSlot'
} }
], ],
getListApi: this.$apis.sendRepair.getSendRepairListApi, getListApi: this.$apis.parkingSpace.getHistoryListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: { tableParams: {
listName: 'data', listName: 'data',
...@@ -103,43 +99,48 @@ export default { ...@@ -103,43 +99,48 @@ export default {
}, },
{ {
label: '停车场区域', label: '停车场区域',
prop: 'merchantId', prop: 'parkingArea',
width: 180 width: 180
}, },
{ {
label: '所在楼层', label: '所在楼层',
prop: 'snType', prop: 'parkingFloor',
width: 180 width: 180
}, },
{ {
label: '楼栋', label: '楼栋',
prop: 'sn', prop: 'parkingBuilding',
width: 200 width: 100
}, },
{ {
label: '车位编号', label: '车位编号',
prop: 'customerPhone', prop: 'parkingNumber',
width: 200 width: 150
}, },
{ {
label: '车位状态', label: '车位状态',
prop: 'customerPhone', prop: 'parkingStatus',
addHtml: 'statusSlot', addHtml: 'statusSlot',
width: 200 width: 100
}, },
{ {
label: '雷达编号', label: '雷达编号',
prop: 'customerName', prop: 'radarNumber',
width: 140 width: 200
}, },
{ {
label: '开始-结束时间', label: '开始-结束时间',
prop: 'licensePlate', formatter: cell => {
width: 140 return dayjs(cell.startTime).format('YYYY/MM/DD HH:mm:ss') + '-' + dayjs(cell.endTime).format('YYYY/MM/DD HH:mm:ss')
},
width: 320
}, },
{ {
label: '状态时长', label: '状态时长',
prop: 'standNo' prop: 'duration',
formatter: cell => {
return util.formatSeconds(cell.duration)
}
} }
] ]
} }
...@@ -148,42 +149,6 @@ export default { ...@@ -148,42 +149,6 @@ export default {
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
changeChannelImg(e) {
console.log(e, 'conpl')
},
reVisitFn(row) {
this.curCollId = row.id
this.collVisible = true
},
closeDialogFn() {
this.collVisible = false
this.searchTable()
},
handleOk() {
this.$refs.sendNoticeRef.$refs.formRef.validate(valid => {
if (valid) {
console.log(this.basicForm)
const { pushFlag, pushPhonesList, sendTime } = this.basicForm
const params = {
pushFlag,
startTime: sendTime[0],
endTime: sendTime[1],
configType: 0,
pushPhones: pushPhonesList?.join(',') || ''
}
this.$apis.sendRepair.setNoticeApi(params).then(res => {
console.log(res)
if (res) {
this.$message.success('设置成功')
this.resetNoticeData()
}
})
}
})
},
handleCancel() {
this.resetNoticeData()
},
setTableFinishFun() { setTableFinishFun() {
this.$refs.statusTableRef.data.length ? (this.$refs.statusTableRef.tableHeightValues = '') : this.$refs.statusTableRef.setTableHeightFun() this.$refs.statusTableRef.data.length ? (this.$refs.statusTableRef.tableHeightValues = '') : this.$refs.statusTableRef.setTableHeightFun()
}, },
...@@ -197,30 +162,20 @@ export default { ...@@ -197,30 +162,20 @@ export default {
//重置表格 //重置表格
resetTable() { resetTable() {
this.searchForm = { this.searchForm = {
operate: false, curDate: '',
sn: '', parkingNumber: '',
merchantName: '', searchDate: []
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: ''
} }
this.realSearchForm = {}
this.searchTable() this.searchTable()
}, },
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.followTime.length) { if (this.searchForm.searchDate.length) {
params.beginFollowTime = new Date(this.searchForm.followTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.startTime = new Date(this.searchForm.searchDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endFollowTime = new Date(this.searchForm.followTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.endTime = new Date(this.searchForm.searchDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm.collisionTime.length) {
params.beginCollisionTime = new Date(this.searchForm.collisionTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCollisionTime = new Date(this.searchForm.collisionTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
delete params.followTime delete params.searchDate
delete params.collisionTime
return params return params
}, },
beforeSearchFn() { beforeSearchFn() {
...@@ -233,7 +188,7 @@ export default { ...@@ -233,7 +188,7 @@ export default {
const params = this.getParams() const params = this.getParams()
params.pageNum = 1 params.pageNum = 1
params.pageSize = 5000 params.pageSize = 5000
this.$apis.sendRepair.exportSendRepairListApi(params).then(res => { this.$apis.parkingSpace.exportHistoryListApi(params).then(res => {
util.exportFn(res) util.exportFn(res)
}) })
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!