Commit da28db26 by 胡悦

警情中心和报表联调

1 parent d4314cad
......@@ -55,6 +55,7 @@
:type="item.dateType"
:value-format="item.format || 'yyyy-MM'"
:placeholder="item.placeholder"
:picker-options="item.pickerOptions || {}"
>
</el-date-picker>
</template>
......
......@@ -28,7 +28,9 @@ const SPECIALSHOP_API = {
}
// 试驾报表
const REPORT_API = {
REPORT_SEARCH: '/trialdrive/trialdrivereport/search'
REPORT_SEARCH: '/trialdrive/trialdrivereport/search',
REPORT_EXPORT: '/trialdrive/trialdrivereport/export',
REPORT_YEARS: '/trialdrive/trialdrivereport/years'
}
// 上牌资料审核
const VEHICLEDOC_API = {
......@@ -36,7 +38,8 @@ const VEHICLEDOC_API = {
DOC_BY_CONDITION: '/trialdrive/vehicleDoc/findVehDocByCondition',
CHENCK_SEARCH: '/trialdrive/approval/searchVehiclelicApp',
SAVE_DOC: '/trialdrive/vehicleDoc/saveOrUpdateVehDoc',
UPDATE_APPROVAL: '/trialdrive/approval/updateApproval'
UPDATE_APPROVAL: '/trialdrive/approval/updateApproval',
EXPORT_APPROVAL: '/trialdrive/approval/export'
}
// 试驾车辆管理接口
const VEHICLE_API = {
......@@ -61,4 +64,10 @@ const TEST_DRIVE_API = {
TEST_DRIVE_SEARCH: '/trialdrive/approval/searchFenceApp',
UPDATE_FENCE_APPROVAL: '/trialdrive/approval/updateApproval'
}
export { API, COMMON_API, SPECIALSHOP_API, VEHICLE_API, APPROVAL_API, REPORT_API, VEHICLEDOC_API, TEST_DRIVE_API }
// 警情中心
const TEARDOWN_API = {
TEAR_SEARCH: '/trialdrive/teardown/list',
TEAR_EXPORT: '/trialdrive/teardown/export'
}
export { API, COMMON_API, SPECIALSHOP_API, VEHICLE_API, APPROVAL_API, REPORT_API, VEHICLEDOC_API, TEST_DRIVE_API, TEARDOWN_API }
import { VEHICLE_API } from '@/config/config'
import { TEARDOWN_API } from '@/config/config'
import request from '@/services/request'
// 获取车辆列表
// 获取试驾围栏审核列表
function getList (params) {
const url = VEHICLE_API.VEHICLE_SEARCH
const url = TEARDOWN_API.TEAR_SEARCH
return request(params, url)
}
// 新增车辆
function addVehicle (params) {
const url = VEHICLE_API.VEHICLE_ADD
return request(params, url, 'post')
}
// 编辑车辆
function editVehicle (params) {
const url = VEHICLE_API.VEHICLE_EDIT
return request(params, url, 'post')
}
// 批量删除车辆
function deleteVehicle (params) {
const url = VEHICLE_API.VEHICLE_DELETE
return request(params, url)
}
// 解绑车辆
function unbindVehicle (params) {
const url = VEHICLE_API.VEHICLE_UNBIND
return request(params, url)
}
// 下载模板
function downloadtemplate (params) {
const url = VEHICLE_API.DOWNLOAD_TEMPLATE
return request(params, url)
}
// 导入车辆
function importVehicle (params) {
const url = VEHICLE_API.VEHICLE_IMPORT
return request(params, url)
}
// 导出车辆
function exportVehicle (params) {
const url = VEHICLE_API.VEHICLE_EXPORT
return request(params, url)
}
export { getList, addVehicle, downloadtemplate, editVehicle, deleteVehicle, unbindVehicle, importVehicle, exportVehicle }
export { getList }
......@@ -7,4 +7,10 @@ function getList (params) {
return request(params, url)
}
export { getList }
// 获取报表列表
function getYears (params) {
const url = REPORT_API.REPORT_YEARS
return request(params, url)
}
export { getList, getYears }
......@@ -38,60 +38,41 @@
ref="removeAlarmForm"
:tableParams="removeAlarmTableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:beforeSearchFn="beforeSearchFn"
:searchForm="searchDataForm"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in removeAlarmTableParams.tableOption.btnList"
:key="idx"
:type="j.type || 'text'"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
</div>
</div>
</template>
<script>
import { TEARDOWN_API } from '@/config/config'
import store from '@/store'
import { getList } from 'services/alarmCenter'
export default {
data() {
return {
searchForm: {},
searchDataForm: {},
todoFormList: [
{
label: '关键字:',
type: 'input',
inputType: 'text',
prop: 'status',
prop: 'keyWord',
placeholder: '特约店编码|店名称 | 设备号 | 车型',
},
{
label: '报警时间:',
type: 'daterange',
prop: 'daterange',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
// pickerOptions: {
// disabledDate(time) {
// return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
// }
// }
}
],
removeAlarmTableParams: {
......@@ -124,19 +105,29 @@ export default {
prop: 'configDesc'
}, {
label: '车架号',
prop: 'vin'
},{
prop: 'vin',
width: 150
}, {
label: '设备号',
prop: 'sns'
},{
prop: 'sn',
width: 100
}, {
label: '报警时间',
prop: 'alarmDate'
},{
prop: 'alarmTime',
width: 160
}, {
label: '拆除报警类型',
prop: 'alarmType'
},{
prop: 'alarmType',
width: 100,
formatter: (cellValue) => {
return {
1: '断电报警',
2: '光感报警'
}[cellValue.alarmType]
}
}, {
label: '报警次数',
prop: 'alarmTimes'
prop: 'alarmCount'
},
]
},
......@@ -145,81 +136,35 @@ export default {
{
id: 1,
name: '导出Excel',
type: 'default',
type: 'primary',
pType: 'export'
}
],
// 弹窗
removeAlarmVisible: false,
removeAlarmTitle: '',
removeAlarmForm: {},
removeAlarmData: [
{ label: '特约店名称:', prop: 'shopName', type: 'select', options: [{ label: '121', value: 'fdfa' }], clearable: true },
{ label: '车架号:', prop: 'vin', type: 'input', clearable: true },
{ label: '车型:', prop: 'modelId', type: 'select', options: [], clearable: true },
{ label: '配置:', prop: 'configDesc', type: 'input', clearable: true },
{ label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true },
{ label: '外色:', prop: 'color', type: 'input', clearable: true },
{ label: '内色:', prop: 'innerColor', type: 'input', clearable: true },
{ label: '服役类型:', prop: 'serveType', type: 'select', options: [], clearable: true },
{ label: '设备号:', prop: 'sn', type: 'input', clearable: true }
],
}
},
methods: {
beforeSearchFn() {
return new Promise((resolve, reject) => {
if (this.searchForm.daterange) {
this.searchDataForm.startTime = this.searchForm.daterange[0]
this.searchDataForm.endTime = this.searchForm.daterange[1]
}
if (this.searchForm.keyWord) this.searchDataForm.keyWord = this.searchForm.keyWord
resolve()
})
},
btnClick(pType, scope) {
switch (pType) {
case 'create':
break
case 'edit':
break
case 'view':
break
case 'delete':
this.$confirm('是否要删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
})
break
case 'unbind':
this.$confirm('是否要解绑, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
})
break
case 'import':
break
case 'export':
break
}
},
handleConfirm(type) {
console.log(type)
switch (type) {
case 'create':
break
case 'edit':
break
case 'import':
this.$Common.exportExcel({
url: `${store.state.baseURL}${TEARDOWN_API.TEAR_EXPORT}`,
method: 'GET',
data: this.searchDataForm,
fileName: '导出拆除预警Excel'
})
break
}
},
handleClose(type) {
this.btnClick(type)
}
},
}
</script>
......
......@@ -27,68 +27,53 @@
class="pull-right"
type="primary"
:size="btn_size"
@click="btnClick('export')"
>导出Excel</el-button>
</h3>
<basic-table
ref="roleTable"
ref="reportTable"
:tableParams="reportTableParams"
:searchForm="searchForm"
:beforeSearchFn="beforeSearchFn"
:searchForm="searchDataForm"
:getListApi="getListApi"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in reportTableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
</div>
</div>
</template>
<script>
import { getProvinceList } from 'services/common'
import { getList } from 'services/report'
import { REPORT_API } from '@/config/config'
import store from '@/store'
import { getList, getYears } from 'services/report'
export default {
data() {
const _this = this
return {
searchDataForm: {},
searchForm: {},
reportFormList: [
{
type: 'input',
inputType: 'text',
prop: 'shopCode',
prop: 'keyWord',
placeholder: '特约店编码|店名称',
},
{
type: 'singleDate',
dateType: 'month',
prop: 'shopName',
prop: 'date',
placeholder: '月份',
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date(_this.date).getTime()
}
}
}
],
reportTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
mutiSelectName: 'reportManage',
mutiSelectUniqueKey: 'shopCode',
listName: 'list',
tableOption: false,
tableColumns: [
......@@ -103,7 +88,8 @@ export default {
prop: 'vehicleTypeName'
}, {
label: '车架号VIN码',
prop: 'sn'
prop: 'sn',
width: 120
}, {
label: '时间',
prop: 'statDate'
......@@ -111,50 +97,46 @@ export default {
]
},
getListApi: getList,
list: {
"message": "success",
"code": 200,
"data": [
{
"id": 1,
"code": "11",
"name": "北京市",
"regionCode": "000003",
"regionName": "华北大区"
},
{
"id": 2,
"code": "12",
"name": "天津市",
"regionCode": "000003",
"regionName": "华北大区"
},
{
"id": 33,
"code": "81",
"name": "香港",
"regionCode": "000008",
"regionName": "港澳台大区"
},
{
"id": 34,
"code": "82",
"name": "澳门",
"regionCode": "000008",
"regionName": "港澳台大区"
}
]
}
date: ''
}
},
mounted() {
getProvinceList().then(res => {
console.log(res)
getYears({}).then(res => {
console.log(res.data[0])
this.date = `${res.data[0]}-01-01`
})
for (let i = 1; i <= 31; i++) {
this.reportTableParams.tableColumns.push({
label: `${i}日`,
prop: `dayNum${i}`
})
if (i == 31) {
this.reportTableParams.tableColumns.push({
label: '总计',
prop: 'summation'
})
}
}
},
methods: {
beforeSearchFn() {
return new Promise((resolve, reject) => {
if (this.searchForm.date) {
this.searchDataForm.year = this.searchForm.date.split('-')[0]
this.searchDataForm.month = this.searchForm.date.split('-')[1]
}
if (this.searchForm.keyWord) this.searchDataForm.keyWord = this.searchForm.keyWord
resolve()
})
},
btnClick(type, scope) {
this.$Common.exportExcel({
url: `${store.state.baseURL}${REPORT_API.REPORT_EXPORT}`,
method: 'GET',
data: this.searchDataForm,
fileName: '导出报表Excel'
})
}
},
}
......
......@@ -98,9 +98,8 @@
<el-button
v-for="(j, idx) in shopTableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
:type="j.type || 'text'"
:size="btn_size"
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
......@@ -135,7 +134,8 @@ export default {
prop: 'shopCode'
}, {
label: '特约店名称',
prop: 'shopName'
prop: 'shopName',
width: 150
}, {
label: '店级别',
prop: 'shopLevel'
......@@ -150,27 +150,26 @@ export default {
prop: 'city'
}, {
label: '详细地址',
prop: 'address'
prop: 'address',
width: 300
}, {
label: '店围栏名',
prop: 'fenceName'
prop: 'fenceName',
width: 180
}
],
tableOption: {
width: 300,
width: 120,
btnList: [
{
type: 'danger',
name: '删除',
pType: 'delete'
},
{
type: 'primary',
name: '编辑',
pType: 'edit'
},
{
type: 'primary',
name: '查看',
pType: 'view'
}
......@@ -223,13 +222,13 @@ export default {
case 'edit':
this.$router.push({
name: 'addShop',
query: {id: shopId}
query: { id: shopId }
})
break
case 'view':
this.$router.push({
name: 'addShop',
query: {id: shopId, readonlyStatus: true}
query: { id: shopId, readonlyStatus: true }
})
break
}
......
......@@ -208,7 +208,8 @@ export default {
prop: 'tempId'
}, {
label: '所属大区',
prop: 'area'
prop: 'area',
width: 100
}, {
label: '所属省',
prop: 'province'
......@@ -226,22 +227,27 @@ export default {
prop: 'shopLevel'
}, {
label: '车架号',
prop: 'vin'
prop: 'vin',
width: 150
}, {
label: '车型',
prop: 'modelName'
}, {
label: '配置',
prop: 'configDesc'
prop: 'configDesc',
width: 140
}, {
label: '车牌',
prop: 'licensePlate'
prop: 'licensePlate',
width: 120
}, {
label: '设备号',
prop: 'sns'
prop: 'sns',
width: 180
}, {
label: '安装日期',
prop: 'installedTime'
prop: 'installedTime',
width: 150
}
],
tableOption: {
......
......@@ -88,7 +88,9 @@ export default {
],
submitTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableOption: true,
tableOption: {
width: 110
},
listName: 'list',
tableColumns: [
{
......@@ -114,13 +116,16 @@ export default {
prop: 'vehicleType'
}, {
label: '车架号',
prop: 'vin'
prop: 'vin',
width: 150
}, {
label: '车型',
prop: 'modelName'
prop: 'modelName',
width: 120
}, {
label: '配置',
prop: 'configDesc'
prop: 'configDesc',
width: 150
}, {
label: '外色',
prop: 'color'
......
......@@ -21,7 +21,14 @@
>重置</el-button>
</slot>
</search-form>
<h3>上牌资料审核</h3>
<h3>上牌资料审核
<el-button
class="pull-right"
:size="btn_size"
type="primary"
@click="btnClick('export')"
>导出Excel</el-button>
</h3>
<basic-table
ref="vehicleCheckTable"
:tableParams="checkTableParams"
......@@ -65,6 +72,8 @@
<script>
import { getCheckList } from 'services/vehicledoc'
import { VEHICLEDOC_API } from '@/config/config'
import store from '@/store'
import { dictInfo } from 'services/common'
export default {
data() {
......@@ -95,7 +104,9 @@ export default {
],
checkTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableOption: true,
tableOption: {
width: 80
},
listName: 'list',
tableColumns: [
{
......@@ -121,13 +132,16 @@ export default {
prop: 'vehicleType'
}, {
label: '车架号',
prop: 'vin'
prop: 'vin',
width: 200
}, {
label: '车型',
prop: 'modelName'
prop: 'modelName',
width: 120
}, {
label: '配置',
prop: 'configDesc'
prop: 'configDesc',
width: 150
}, {
label: '外色',
prop: 'color'
......@@ -136,22 +150,26 @@ export default {
prop: 'innerColor'
}, {
label: '提交时间',
prop: 'submitTime'
prop: 'submitTime',
width: 150
}, {
label: '销售经理',
prop: 'saleManager'
}, {
label: '销售经理电话',
prop: 'saleManagerPhone'
prop: 'saleManagerPhone',
width: 100
}, {
label: '上牌备注',
prop: 'velRemark'
prop: 'velRemark',
width: 150
}, {
label: '审核结果',
prop: 'approvalResult'
}, {
label: '备注',
prop: 'remark'
prop: 'remark',
width: 150
}
]
},
......@@ -189,6 +207,14 @@ export default {
case 'view':
this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, approvalId: scope.approvalId, url: 'checkView' } })
break
case 'export':
this.$Common.exportExcel({
url: `${store.state.baseURL}${VEHICLEDOC_API.EXPORT_APPROVAL}`,
method: 'GET',
data: this.searchForm,
fileName: '导出资料审核Excel'
})
break
}
},
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!