Commit da28db26 by 胡悦

警情中心和报表联调

1 parent d4314cad
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
:type="item.dateType" :type="item.dateType"
:value-format="item.format || 'yyyy-MM'" :value-format="item.format || 'yyyy-MM'"
:placeholder="item.placeholder" :placeholder="item.placeholder"
:picker-options="item.pickerOptions || {}"
> >
</el-date-picker> </el-date-picker>
</template> </template>
......
...@@ -28,7 +28,9 @@ const SPECIALSHOP_API = { ...@@ -28,7 +28,9 @@ const SPECIALSHOP_API = {
} }
// 试驾报表 // 试驾报表
const REPORT_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 = { const VEHICLEDOC_API = {
...@@ -36,7 +38,8 @@ const VEHICLEDOC_API = { ...@@ -36,7 +38,8 @@ const VEHICLEDOC_API = {
DOC_BY_CONDITION: '/trialdrive/vehicleDoc/findVehDocByCondition', DOC_BY_CONDITION: '/trialdrive/vehicleDoc/findVehDocByCondition',
CHENCK_SEARCH: '/trialdrive/approval/searchVehiclelicApp', CHENCK_SEARCH: '/trialdrive/approval/searchVehiclelicApp',
SAVE_DOC: '/trialdrive/vehicleDoc/saveOrUpdateVehDoc', SAVE_DOC: '/trialdrive/vehicleDoc/saveOrUpdateVehDoc',
UPDATE_APPROVAL: '/trialdrive/approval/updateApproval' UPDATE_APPROVAL: '/trialdrive/approval/updateApproval',
EXPORT_APPROVAL: '/trialdrive/approval/export'
} }
// 试驾车辆管理接口 // 试驾车辆管理接口
const VEHICLE_API = { const VEHICLE_API = {
...@@ -61,4 +64,10 @@ const TEST_DRIVE_API = { ...@@ -61,4 +64,10 @@ const TEST_DRIVE_API = {
TEST_DRIVE_SEARCH: '/trialdrive/approval/searchFenceApp', TEST_DRIVE_SEARCH: '/trialdrive/approval/searchFenceApp',
UPDATE_FENCE_APPROVAL: '/trialdrive/approval/updateApproval' 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' import request from '@/services/request'
// 获取车辆列表 // 获取试驾围栏审核列表
function getList (params) { function getList (params) {
const url = VEHICLE_API.VEHICLE_SEARCH const url = TEARDOWN_API.TEAR_SEARCH
return request(params, url) return request(params, url)
} }
// 新增车辆 export { getList }
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 }
...@@ -7,4 +7,10 @@ function getList (params) { ...@@ -7,4 +7,10 @@ function getList (params) {
return request(params, url) 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 @@ ...@@ -38,60 +38,41 @@
ref="removeAlarmForm" ref="removeAlarmForm"
:tableParams="removeAlarmTableParams" :tableParams="removeAlarmTableParams"
:getListApi="getListApi" :getListApi="getListApi"
:searchForm="searchForm" :beforeSearchFn="beforeSearchFn"
:searchForm="searchDataForm"
:hasNum="false" :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> </basic-table>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { TEARDOWN_API } from '@/config/config'
import store from '@/store'
import { getList } from 'services/alarmCenter' import { getList } from 'services/alarmCenter'
export default { export default {
data() { data() {
return { return {
searchForm: {}, searchForm: {},
searchDataForm: {},
todoFormList: [ todoFormList: [
{ {
label: '关键字:', label: '关键字:',
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
prop: 'status', prop: 'keyWord',
placeholder: '特约店编码|店名称 | 设备号 | 车型', placeholder: '特约店编码|店名称 | 设备号 | 车型',
}, },
{ {
label: '报警时间:', label: '报警时间:',
type: 'daterange', type: 'daterange',
prop: 'daterange', prop: 'daterange',
pickerOptions: { // pickerOptions: {
disabledDate(time) { // disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime() // return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
} // }
} // }
} }
], ],
removeAlarmTableParams: { removeAlarmTableParams: {
...@@ -124,19 +105,29 @@ export default { ...@@ -124,19 +105,29 @@ export default {
prop: 'configDesc' prop: 'configDesc'
}, { }, {
label: '车架号', label: '车架号',
prop: 'vin' prop: 'vin',
},{ width: 150
}, {
label: '设备号', label: '设备号',
prop: 'sns' prop: 'sn',
},{ width: 100
}, {
label: '报警时间', label: '报警时间',
prop: 'alarmDate' prop: 'alarmTime',
},{ width: 160
}, {
label: '拆除报警类型', label: '拆除报警类型',
prop: 'alarmType' prop: 'alarmType',
},{ width: 100,
formatter: (cellValue) => {
return {
1: '断电报警',
2: '光感报警'
}[cellValue.alarmType]
}
}, {
label: '报警次数', label: '报警次数',
prop: 'alarmTimes' prop: 'alarmCount'
}, },
] ]
}, },
...@@ -145,81 +136,35 @@ export default { ...@@ -145,81 +136,35 @@ export default {
{ {
id: 1, id: 1,
name: '导出Excel', name: '导出Excel',
type: 'default', type: 'primary',
pType: 'export' 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: { 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) { btnClick(pType, scope) {
switch (pType) { 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': case 'export':
this.$Common.exportExcel({
break url: `${store.state.baseURL}${TEARDOWN_API.TEAR_EXPORT}`,
} method: 'GET',
}, data: this.searchDataForm,
handleConfirm(type) { fileName: '导出拆除预警Excel'
console.log(type) })
switch (type) {
case 'create':
break
case 'edit':
break
case 'import':
break break
} }
}, },
handleClose(type) {
this.btnClick(type)
}
}, },
} }
</script> </script>
......
...@@ -27,68 +27,53 @@ ...@@ -27,68 +27,53 @@
class="pull-right" class="pull-right"
type="primary" type="primary"
:size="btn_size" :size="btn_size"
@click="btnClick('export')"
>导出Excel</el-button> >导出Excel</el-button>
</h3> </h3>
<basic-table <basic-table
ref="roleTable" ref="reportTable"
:tableParams="reportTableParams" :tableParams="reportTableParams"
:searchForm="searchForm" :beforeSearchFn="beforeSearchFn"
:searchForm="searchDataForm"
:getListApi="getListApi" :getListApi="getListApi"
:hasNum="false" :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> </basic-table>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getProvinceList } from 'services/common' import { REPORT_API } from '@/config/config'
import { getList } from 'services/report' import store from '@/store'
import { getList, getYears } from 'services/report'
export default { export default {
data() { data() {
const _this = this
return { return {
searchDataForm: {},
searchForm: {}, searchForm: {},
reportFormList: [ reportFormList: [
{ {
type: 'input', type: 'input',
inputType: 'text', inputType: 'text',
prop: 'shopCode', prop: 'keyWord',
placeholder: '特约店编码|店名称', placeholder: '特约店编码|店名称',
}, },
{ {
type: 'singleDate', type: 'singleDate',
dateType: 'month', dateType: 'month',
prop: 'shopName', prop: 'date',
placeholder: '月份', placeholder: '月份',
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date(_this.date).getTime()
}
}
} }
], ],
reportTableParams: { reportTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
mutiSelectName: 'reportManage',
mutiSelectUniqueKey: 'shopCode',
listName: 'list', listName: 'list',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
...@@ -103,7 +88,8 @@ export default { ...@@ -103,7 +88,8 @@ export default {
prop: 'vehicleTypeName' prop: 'vehicleTypeName'
}, { }, {
label: '车架号VIN码', label: '车架号VIN码',
prop: 'sn' prop: 'sn',
width: 120
}, { }, {
label: '时间', label: '时间',
prop: 'statDate' prop: 'statDate'
...@@ -111,50 +97,46 @@ export default { ...@@ -111,50 +97,46 @@ export default {
] ]
}, },
getListApi: getList, getListApi: getList,
list: { date: ''
"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": "港澳台大区"
}
]
}
} }
}, },
mounted() { mounted() {
getProvinceList().then(res => { getYears({}).then(res => {
console.log(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: { 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) { 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 @@ ...@@ -98,9 +98,8 @@
<el-button <el-button
v-for="(j, idx) in shopTableParams.tableOption.btnList" v-for="(j, idx) in shopTableParams.tableOption.btnList"
:key="idx" :key="idx"
:type="j.type" :type="j.type || 'text'"
size="mini" :size="btn_size"
plain
@click="btnClick(j.pType, scope.scope)" @click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button> >{{j.name}}</el-button>
</span> </span>
...@@ -135,7 +134,8 @@ export default { ...@@ -135,7 +134,8 @@ export default {
prop: 'shopCode' prop: 'shopCode'
}, { }, {
label: '特约店名称', label: '特约店名称',
prop: 'shopName' prop: 'shopName',
width: 150
}, { }, {
label: '店级别', label: '店级别',
prop: 'shopLevel' prop: 'shopLevel'
...@@ -150,27 +150,26 @@ export default { ...@@ -150,27 +150,26 @@ export default {
prop: 'city' prop: 'city'
}, { }, {
label: '详细地址', label: '详细地址',
prop: 'address' prop: 'address',
width: 300
}, { }, {
label: '店围栏名', label: '店围栏名',
prop: 'fenceName' prop: 'fenceName',
width: 180
} }
], ],
tableOption: { tableOption: {
width: 300, width: 120,
btnList: [ btnList: [
{ {
type: 'danger',
name: '删除', name: '删除',
pType: 'delete' pType: 'delete'
}, },
{ {
type: 'primary',
name: '编辑', name: '编辑',
pType: 'edit' pType: 'edit'
}, },
{ {
type: 'primary',
name: '查看', name: '查看',
pType: 'view' pType: 'view'
} }
...@@ -223,13 +222,13 @@ export default { ...@@ -223,13 +222,13 @@ export default {
case 'edit': case 'edit':
this.$router.push({ this.$router.push({
name: 'addShop', name: 'addShop',
query: {id: shopId} query: { id: shopId }
}) })
break break
case 'view': case 'view':
this.$router.push({ this.$router.push({
name: 'addShop', name: 'addShop',
query: {id: shopId, readonlyStatus: true} query: { id: shopId, readonlyStatus: true }
}) })
break break
} }
......
...@@ -208,7 +208,8 @@ export default { ...@@ -208,7 +208,8 @@ export default {
prop: 'tempId' prop: 'tempId'
}, { }, {
label: '所属大区', label: '所属大区',
prop: 'area' prop: 'area',
width: 100
}, { }, {
label: '所属省', label: '所属省',
prop: 'province' prop: 'province'
...@@ -226,22 +227,27 @@ export default { ...@@ -226,22 +227,27 @@ export default {
prop: 'shopLevel' prop: 'shopLevel'
}, { }, {
label: '车架号', label: '车架号',
prop: 'vin' prop: 'vin',
width: 150
}, { }, {
label: '车型', label: '车型',
prop: 'modelName' prop: 'modelName'
}, { }, {
label: '配置', label: '配置',
prop: 'configDesc' prop: 'configDesc',
width: 140
}, { }, {
label: '车牌', label: '车牌',
prop: 'licensePlate' prop: 'licensePlate',
width: 120
}, { }, {
label: '设备号', label: '设备号',
prop: 'sns' prop: 'sns',
width: 180
}, { }, {
label: '安装日期', label: '安装日期',
prop: 'installedTime' prop: 'installedTime',
width: 150
} }
], ],
tableOption: { tableOption: {
......
...@@ -88,7 +88,9 @@ export default { ...@@ -88,7 +88,9 @@ export default {
], ],
submitTableParams: { submitTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableOption: true, tableOption: {
width: 110
},
listName: 'list', listName: 'list',
tableColumns: [ tableColumns: [
{ {
...@@ -114,13 +116,16 @@ export default { ...@@ -114,13 +116,16 @@ export default {
prop: 'vehicleType' prop: 'vehicleType'
}, { }, {
label: '车架号', label: '车架号',
prop: 'vin' prop: 'vin',
width: 150
}, { }, {
label: '车型', label: '车型',
prop: 'modelName' prop: 'modelName',
width: 120
}, { }, {
label: '配置', label: '配置',
prop: 'configDesc' prop: 'configDesc',
width: 150
}, { }, {
label: '外色', label: '外色',
prop: 'color' prop: 'color'
......
...@@ -21,7 +21,14 @@ ...@@ -21,7 +21,14 @@
>重置</el-button> >重置</el-button>
</slot> </slot>
</search-form> </search-form>
<h3>上牌资料审核</h3> <h3>上牌资料审核
<el-button
class="pull-right"
:size="btn_size"
type="primary"
@click="btnClick('export')"
>导出Excel</el-button>
</h3>
<basic-table <basic-table
ref="vehicleCheckTable" ref="vehicleCheckTable"
:tableParams="checkTableParams" :tableParams="checkTableParams"
...@@ -65,6 +72,8 @@ ...@@ -65,6 +72,8 @@
<script> <script>
import { getCheckList } from 'services/vehicledoc' import { getCheckList } from 'services/vehicledoc'
import { VEHICLEDOC_API } from '@/config/config'
import store from '@/store'
import { dictInfo } from 'services/common' import { dictInfo } from 'services/common'
export default { export default {
data() { data() {
...@@ -95,7 +104,9 @@ export default { ...@@ -95,7 +104,9 @@ export default {
], ],
checkTableParams: { checkTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableOption: true, tableOption: {
width: 80
},
listName: 'list', listName: 'list',
tableColumns: [ tableColumns: [
{ {
...@@ -121,13 +132,16 @@ export default { ...@@ -121,13 +132,16 @@ export default {
prop: 'vehicleType' prop: 'vehicleType'
}, { }, {
label: '车架号', label: '车架号',
prop: 'vin' prop: 'vin',
width: 200
}, { }, {
label: '车型', label: '车型',
prop: 'modelName' prop: 'modelName',
width: 120
}, { }, {
label: '配置', label: '配置',
prop: 'configDesc' prop: 'configDesc',
width: 150
}, { }, {
label: '外色', label: '外色',
prop: 'color' prop: 'color'
...@@ -136,22 +150,26 @@ export default { ...@@ -136,22 +150,26 @@ export default {
prop: 'innerColor' prop: 'innerColor'
}, { }, {
label: '提交时间', label: '提交时间',
prop: 'submitTime' prop: 'submitTime',
width: 150
}, { }, {
label: '销售经理', label: '销售经理',
prop: 'saleManager' prop: 'saleManager'
}, { }, {
label: '销售经理电话', label: '销售经理电话',
prop: 'saleManagerPhone' prop: 'saleManagerPhone',
width: 100
}, { }, {
label: '上牌备注', label: '上牌备注',
prop: 'velRemark' prop: 'velRemark',
width: 150
}, { }, {
label: '审核结果', label: '审核结果',
prop: 'approvalResult' prop: 'approvalResult'
}, { }, {
label: '备注', label: '备注',
prop: 'remark' prop: 'remark',
width: 150
} }
] ]
}, },
...@@ -189,6 +207,14 @@ export default { ...@@ -189,6 +207,14 @@ export default {
case 'view': case 'view':
this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, approvalId: scope.approvalId, url: 'checkView' } }) this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, approvalId: scope.approvalId, url: 'checkView' } })
break 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!