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 => {
})
}
const getHistoryListApi = params => {
params.method = 'marketing.api.charge.parkingSpace.history.page'
return http({
url: URL,
method: 'post',
data: params,
sign: true
})
}
// 获取小区列表
const getMerchantListApi = params => {
params.method = 'marketing.api.charge.parkingSpace.getMerchantList'
......@@ -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 => {
params.method = 'marketing.api.charge.parkingSpace.create'
return http({
......@@ -96,8 +116,10 @@ const addFlagparkingSpace = params => {
}
export default {
getParkingSpaceListApi,
getHistoryListApi,
getMerchantListApi,
exportParkingSpaceListApi,
exportHistoryListApi,
addParkingSpaceApi,
getRadarListApi,
delParkingSpaceApi,
......
import { Message } from 'element-ui'
let util = {}
util.cloneText = function (message) {
util.cloneText = function(message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
......@@ -9,7 +9,7 @@ util.cloneText = function (message) {
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function (sign = '-') {
util.getBeforeDate = function(sign = '-') {
let day = new Date()
let month = day.getMonth() + 1
let date = day.getDate()
......@@ -18,7 +18,7 @@ util.getBeforeDate = function (sign = '-') {
var s = day.getFullYear() + sign + month + sign + date
return s
}
util.getTimeFomat = function (time, sign = '-') {
util.getTimeFomat = function(time, sign = '-') {
let day = new Date(time)
let month = day.getMonth() + 1
let date = day.getDate()
......@@ -31,7 +31,7 @@ util.getTimeFomat = function (time, sign = '-') {
var s = day.getFullYear() + sign + month + sign + date + ' ' + hour + ':' + mm
return s
}
util.getBetweenDate = function (day, num, str = '-') {
util.getBetweenDate = function(day, num, str = '-') {
var today = new Date(day)
var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * (num - 1)
......@@ -43,7 +43,7 @@ util.getBetweenDate = function (day, num, str = '-') {
if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay
}
util.getBeforeMonth = function (days) {
util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1
let year = new Date().getFullYear()
let arr = new Array()
......@@ -58,7 +58,7 @@ util.getBeforeMonth = function (days) {
}
return arr
}
util.getPrevMonth = function () {
util.getPrevMonth = function() {
let month = new Date().getMonth()
let year = new Date().getFullYear()
if (month == 0) {
......@@ -67,7 +67,7 @@ util.getPrevMonth = function () {
}
return year + '年' + month + '月'
}
util.getCurrentMonthLast = function (date) {
util.getCurrentMonthLast = function(date) {
var endDate = new Date(date)
var month = endDate.getMonth()
var nextMonth = ++month
......@@ -76,23 +76,23 @@ util.getCurrentMonthLast = function (date) {
var dateString = new Date(nextMonthFirstDay - oneDay)
return dateString.toLocaleDateString().replace(new RegExp('/', 'g'), '-') //toLocaleDateString() 返回 如:2018/8/31
}
util.openUrl = function (url) {
util.openUrl = function(url) {
const link = document.createElement('a')
link.href = url
link.click()
}
util.openTab = function (url) {
util.openTab = function(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.isShowBtn = function (value, permissions) {
util.isShowBtn = function(value, permissions) {
let isShowStatus = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menuLevel(menu)
function menuLevel (item) {
function menuLevel(item) {
item.forEach(itm => {
if (value && itm.path == value) {
isShowStatus = true
......@@ -100,11 +100,11 @@ util.isShowBtn = function (value, permissions) {
if (
!value &&
itm.path ==
'/' +
location.pathname
.split('/')
.slice(-2)
.join('/') &&
'/' +
location.pathname
.split('/')
.slice(-2)
.join('/') &&
itm.meta &&
itm.meta.permissions.includes(permissions)
) {
......@@ -123,12 +123,12 @@ util.getArrayIsSubset = (arr2, arr1) => {
return arr1.includes(item)
})
}
util.downloadIamge = function (imgsrc, name = new Date().getTime()) {
util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function () {
image.onload = function() {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
......@@ -143,4 +143,72 @@ util.downloadIamge = function (imgsrc, name = new Date().getTime()) {
}
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
......@@ -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>
<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>
</GLCombiForm>
<div class="statusList">
......@@ -20,8 +20,8 @@
</div>
<GLTable ref="statusTableRef" :beforeSearchFn="beforeSearchFn" :getListApi="getListApi" :noDataImg="url" :searchForm="realSearchForm" :pageConf="pageConf" :tableParams="tableParams">
<div slot="statusSlot" slot-scope="scope">
<span class="status-class"></span>
<span>{{ scope.scope.goodsStatus == 1 ? '上架' : '下架' }}</span>
<span v-if="parkingStatusEnum[scope.scope.parkingStatus]" class="status-class" :style="{ 'background-color': parkingStatusEnum[scope.scope.parkingStatus].color }"></span>
<span>{{ parkingStatusEnum[scope.scope.parkingStatus] ? parkingStatusEnum[scope.scope.parkingStatus].name : '--' }}</span>
</div>
</GLTable>
</div>
......@@ -30,30 +30,26 @@
</template>
<script>
const STATUS_ENUM = { 1: '#EB4E4E', 2: '#2CCA74', 3: '#999999' }
import * as dayjs from 'dayjs'
const PARKING_STATUS_ENUM = { 0: { color: '#999999', name: '未知' }, 1: { color: '#2CCA74', name: '空闲' }, 2: { color: '#EB4E4E', name: '占用' } }
import url from '@/assets/empty.png'
import dayjs from 'dayjs'
import util from '@/utils/util'
export default {
name: 'repairList',
name: 'statusList',
components: {},
data() {
return {
url: 'url',
url: url,
searchForm: {
curDate: '',
operate: false,
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: ''
parkingNumber: '',
searchDate: []
},
realSearchForm: {},
parkingStatusEnum: PARKING_STATUS_ENUM,
searchFormList: [
{
name: 'sn',
name: 'curDate',
addHtml: 'dateSelectSlot',
dateList: [
{
......@@ -79,18 +75,18 @@ export default {
]
},
{
name: 'successDate',
name: 'searchDate',
type: 'datePicker',
labelWidth: 95,
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
name: 'sn',
name: 'parkingNumber',
addHtml: 'inputSlot'
}
],
getListApi: this.$apis.sendRepair.getSendRepairListApi,
getListApi: this.$apis.parkingSpace.getHistoryListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'data',
......@@ -103,43 +99,48 @@ export default {
},
{
label: '停车场区域',
prop: 'merchantId',
prop: 'parkingArea',
width: 180
},
{
label: '所在楼层',
prop: 'snType',
prop: 'parkingFloor',
width: 180
},
{
label: '楼栋',
prop: 'sn',
width: 200
prop: 'parkingBuilding',
width: 100
},
{
label: '车位编号',
prop: 'customerPhone',
width: 200
prop: 'parkingNumber',
width: 150
},
{
label: '车位状态',
prop: 'customerPhone',
prop: 'parkingStatus',
addHtml: 'statusSlot',
width: 200
width: 100
},
{
label: '雷达编号',
prop: 'customerName',
width: 140
prop: 'radarNumber',
width: 200
},
{
label: '开始-结束时间',
prop: 'licensePlate',
width: 140
formatter: cell => {
return dayjs(cell.startTime).format('YYYY/MM/DD HH:mm:ss') + '-' + dayjs(cell.endTime).format('YYYY/MM/DD HH:mm:ss')
},
width: 320
},
{
label: '状态时长',
prop: 'standNo'
prop: 'duration',
formatter: cell => {
return util.formatSeconds(cell.duration)
}
}
]
}
......@@ -148,42 +149,6 @@ export default {
created() {},
mounted() {},
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() {
this.$refs.statusTableRef.data.length ? (this.$refs.statusTableRef.tableHeightValues = '') : this.$refs.statusTableRef.setTableHeightFun()
},
......@@ -197,30 +162,20 @@ export default {
//重置表格
resetTable() {
this.searchForm = {
operate: false,
sn: '',
merchantName: '',
merchantNo: '',
snType: '',
followStatus: '',
followTime: '',
collisionTime: '',
followResult: ''
curDate: '',
parkingNumber: '',
searchDate: []
}
this.realSearchForm = {}
this.searchTable()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.followTime.length) {
params.beginFollowTime = new Date(this.searchForm.followTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endFollowTime = new Date(this.searchForm.followTime[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'
if (this.searchForm.searchDate.length) {
params.startTime = new Date(this.searchForm.searchDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.searchDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.followTime
delete params.collisionTime
delete params.searchDate
return params
},
beforeSearchFn() {
......@@ -233,7 +188,7 @@ export default {
const params = this.getParams()
params.pageNum = 1
params.pageSize = 5000
this.$apis.sendRepair.exportSendRepairListApi(params).then(res => {
this.$apis.parkingSpace.exportHistoryListApi(params).then(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!