|
@@ -6,52 +6,65 @@
|
|
|
<el-button class="tab-item" :type="tabType===0?'primary':''" @click="tabClick(0)">正常</el-button>
|
|
|
<el-button class="tab-item" :type="tabType===1?'danger':''" @click="tabClick(1)">识别异常</el-button>
|
|
|
</div>
|
|
|
- <div class="search-block">
|
|
|
- <div class="block">
|
|
|
- <span class="lable">{{ tabType===0?'装货开始时间':'开始时间' }}</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="conditions.startLoadTime"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="选择装货开始始时间"
|
|
|
- style="width:200px;"
|
|
|
- />
|
|
|
+ <div class="head-rt">
|
|
|
+ <div class="search-block">
|
|
|
+ <div class="block">
|
|
|
+ <span class="lable">{{ tabType===0?'装货开始时间':'开始时间' }}</span>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="conditions.startLoadTime"
|
|
|
+ type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="选择装货开始始时间"
|
|
|
+ style="width:200px;"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="block">
|
|
|
+ <span class="lable">{{ tabType===0?'装货结束时间':'结束时间' }}</span>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="conditions.endLoadTime"
|
|
|
+ type="datetime"
|
|
|
+ style="width:200px;"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="选择装货结束时间"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div v-if="tabType===0" class="block">
|
|
|
+ <span class="lable">卸货开始时间</span>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="conditions.startUnLoadTime"
|
|
|
+ type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="选择装货开始始时间"
|
|
|
+ style="width:200px;"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div v-if="tabType===0" class="block">
|
|
|
+ <span class="lable">卸货结束时间</span>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="conditions.endUnLoadTime"
|
|
|
+ type="datetime"
|
|
|
+ style="width:200px;"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="选择装货结束时间"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="block">
|
|
|
- <span class="lable">{{ tabType===0?'装货结束时间':'结束时间' }}</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="conditions.endLoadTime"
|
|
|
- type="datetime"
|
|
|
- style="width:200px;"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="选择装货结束时间"
|
|
|
- />
|
|
|
+ <div class="search-block">
|
|
|
+ <div class="block">
|
|
|
+ <span class="lable">车牌</span>
|
|
|
+ <el-input v-model.trim="conditions.carPlate" placeholder="请输入内容车牌" style="width:150px;" />
|
|
|
+ </div>
|
|
|
+ <el-select v-model="conditions.transEvaluate" placeholder="请选择结论" style="width:120px;margin-left:10px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in transEvaluates"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <div class="block"><el-button type="primary" @click="search">查询</el-button></div>
|
|
|
+ <div class="block"><el-button type="primary" @click="exportExcel">导出EXCEL</el-button></div>
|
|
|
</div>
|
|
|
- <div v-if="tabType===0" class="block">
|
|
|
- <span class="lable">卸货开始时间</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="conditions.startUnLoadTime"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="选择装货开始始时间"
|
|
|
- style="width:200px;"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div v-if="tabType===0" class="block">
|
|
|
- <span class="lable">卸货结束时间</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="conditions.endUnLoadTime"
|
|
|
- type="datetime"
|
|
|
- style="width:200px;"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="选择装货结束时间"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="block">
|
|
|
- <span class="lable">车牌</span>
|
|
|
- <el-input v-model.trim="conditions.carPlate" placeholder="请输入内容车牌" style="width:150px;" />
|
|
|
- </div>
|
|
|
- <div class="block"><el-button type="primary" @click="search">查询</el-button></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<template v-if="tabType===0">
|
|
@@ -114,10 +127,10 @@
|
|
|
row-class-name="CustomRowClassName"
|
|
|
>
|
|
|
<el-table-column type="index" width="55" label="序号" />
|
|
|
- <el-table-column prop="transAbnormarlTime" label="车牌" min-width="140">
|
|
|
+ <el-table-column prop="transAbnormarlLicense" label="车牌" min-width="140">
|
|
|
<template #default="scope">{{ scope.row.transAbnormarlLicense }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column property="transLoadTime" label="抓拍图片" min-width="180">
|
|
|
+ <el-table-column property="transAbnormarlPicurl" label="抓拍图片" min-width="180">
|
|
|
<template #default="scope">
|
|
|
<div v-if="scope.row.transAbnormarlPicurl" class="snap-image__preview">
|
|
|
<el-image
|
|
@@ -134,7 +147,7 @@
|
|
|
<el-table-column property="transAbnormarlTime" label="运输异常时间" min-width="120">
|
|
|
<template #default="scope">{{ parseTime(scope.row.transAbnormarlTime,'{y}-{m}-{d} {h}:{i}:{s}') }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column property="transAbnormarlTime" label="运输类型" min-width="120">
|
|
|
+ <el-table-column property="transAbnormarType" label="运输类型" min-width="120">
|
|
|
<template #default="scope">{{ scope.row.transAbnormarType===0?'装货':"卸货" }}</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -154,7 +167,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { parseTime } from '@/utils'
|
|
|
-import { getAllinfoByPage, getAbnormarlinfoByPage } from '@/api/trans'
|
|
|
+import { getAllinfoByPage, getAbnormarlinfoByPage, getAllinfoist } from '@/api/trans'
|
|
|
export default {
|
|
|
name: 'GoafCameraAlarm',
|
|
|
data() {
|
|
@@ -167,13 +180,27 @@ export default {
|
|
|
endLoadTime: '',
|
|
|
startUnLoadTime: '',
|
|
|
endUnLoadTime: '',
|
|
|
- carPlate: ''
|
|
|
+ carPlate: '',
|
|
|
+ transEvaluate: ''
|
|
|
},
|
|
|
+ transEvaluates: [
|
|
|
+ { value: 0, label: '正常' },
|
|
|
+ { value: 1, label: '超时' },
|
|
|
+ { value: 2, label: '超重' },
|
|
|
+ { value: 3, label: '超时|超重' }
|
|
|
+ ],
|
|
|
dataList: [],
|
|
|
total: 0
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ const date = new Date()
|
|
|
+ const today = `${date.getFullYear()}, ${date.getMonth() + 1}, ${date.getDate()}`
|
|
|
+ const tomorrow = `${date.getFullYear()}, ${date.getMonth() + 1}, ${date.getDate() + 1}`
|
|
|
+ const startLoadTime = parseTime(today)
|
|
|
+ const endLoadTime = parseTime(tomorrow)
|
|
|
+ this.conditions.startLoadTime = startLoadTime
|
|
|
+ this.conditions.endLoadTime = endLoadTime
|
|
|
this.getData()
|
|
|
},
|
|
|
methods: {
|
|
@@ -256,6 +283,54 @@ export default {
|
|
|
}
|
|
|
this.getData()
|
|
|
},
|
|
|
+ // 导出EXCEL
|
|
|
+ async exportExcel() {
|
|
|
+ const params = {
|
|
|
+ page: this.conditions.page,
|
|
|
+ limit: this.conditions.limit,
|
|
|
+ startLoadTime: this.conditions.startLoadTime,
|
|
|
+ endLoadTime: this.conditions.endLoadTime,
|
|
|
+ transLicense: this.conditions.carPlate,
|
|
|
+ startUnLoadTime: this.conditions.startUnLoadTime,
|
|
|
+ endUnLoadTime: this.conditions.endUnLoadTime
|
|
|
+ }
|
|
|
+ for (const key in params) {
|
|
|
+ if (this.isNull(params[key])) {
|
|
|
+ delete params[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var { data } = await getAllinfoist(params).catch(() => { this.$message.error('导出异常') })
|
|
|
+ if (data && data.length < 1) return this.$message.error('没有可导出的数据')
|
|
|
+
|
|
|
+ const enums = { 'index': '序号', 'date': '日期', 'transLicense': '车牌', 'transLoadTime': '装货时间', 'transUnloadTime': '卸货时间', 'transTimeInterval': '时差(分钟)', 'transEvaluate': '结论' }
|
|
|
+ const tHeader = Object.values(enums)
|
|
|
+ const filterVal = Object.keys(enums)
|
|
|
+
|
|
|
+ data = this.formatJson(filterVal, data)
|
|
|
+
|
|
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
|
+ excel.export_json_to_excel({
|
|
|
+ header: tHeader,
|
|
|
+ data,
|
|
|
+ filename: this.filename || `运输信息${parseTime(params.startLoadTime, '{y}-{m}-{d}')}_${parseTime(params.endLoadTime, '{y}-{m}-{d}')}`,
|
|
|
+ autoWidth: this.autoWidth,
|
|
|
+ bookType: this.bookType
|
|
|
+ })
|
|
|
+ this.downloadLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ formatJson(filterVal, jsonData) {
|
|
|
+ return jsonData.map((v, index) => filterVal.map(j => {
|
|
|
+ if (j === 'index') return index + 1
|
|
|
+ if (j === 'data') return parseTime(v.transLoadTime, '{y}-{m}-{d}')
|
|
|
+ if (j === 'transEvaluate') {
|
|
|
+ return this.formateTransEvaluate(v[j])
|
|
|
+ } else {
|
|
|
+ return v[j]
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ },
|
|
|
handleSizeChange(limit) {
|
|
|
this.conditions.limit = limit
|
|
|
this.getData()
|
|
@@ -312,12 +387,16 @@ export default {
|
|
|
border-radius: 0;
|
|
|
}
|
|
|
}
|
|
|
+ .head-rt{
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
.search-block{
|
|
|
display: flex;
|
|
|
justify-content:flex-end;
|
|
|
align-items: center;
|
|
|
flex-wrap: wrap;
|
|
|
flex: 1;
|
|
|
+ padding-bottom: 5px;
|
|
|
.block{
|
|
|
margin-left: 10px;
|
|
|
.lable{
|