lanan-system-vue/src/views/rescue/rescueCw.vue

455 lines
14 KiB
Vue
Raw Normal View History

2024-08-16 13:46:48 +08:00
<template>
<div class="app-container">
2024-08-24 19:39:17 +08:00
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
2024-08-16 13:46:48 +08:00
<el-form-item label="客户车牌号" prop="licenseNum">
<el-input
v-model="queryParams.licenseNum"
placeholder="请输入车牌号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="司机名称" prop="driverName">
<el-input
v-model="queryParams.driverName"
placeholder="请输入司机名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="救援车辆" prop="driverCarNum">
<el-input
v-model="queryParams.driverCarNum"
placeholder="请输入救援车辆车牌号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
2024-08-24 19:39:17 +08:00
<el-form-item label="月份" prop="rescueStartMonth">
2024-08-16 13:46:48 +08:00
<el-date-picker
v-model="queryParams.rescueStartMonth"
value-format="yyyy-MM"
type="month"
2024-08-24 19:39:17 +08:00
placeholder="选择月份"
>
2024-08-16 13:46:48 +08:00
</el-date-picker>
</el-form-item>
<el-form-item label="收费类型" prop="feeType">
<el-select v-model="queryParams.feeType" placeholder="请选择收费类型" clearable>
<el-option
2024-08-24 19:39:17 +08:00
v-for="dict in this.getDictDatas(DICT_TYPE.FEE_TYPE)"
2024-08-16 13:46:48 +08:00
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
2024-08-24 19:39:17 +08:00
<el-form-item label="救援时间" prop="maintenanceTime">
2024-08-16 13:46:48 +08:00
<el-date-picker
v-model="time1"
type="daterange"
value-format="yyyy-MM-dd"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
2024-08-24 19:39:17 +08:00
:picker-options="pickerOptions"
>
2024-08-16 13:46:48 +08:00
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
2024-08-24 19:39:17 +08:00
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
2024-08-27 14:46:31 +08:00
:loading="exportLoading"
2024-08-24 19:39:17 +08:00
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<div style="display: flex;justify-content:right;font-weight: bold;font-size: 16px">
2024-08-16 13:46:48 +08:00
<span>
2024-08-24 19:39:17 +08:00
施救总金额{{ moneyManagementData.allMoney }}
2024-08-16 13:46:48 +08:00
</span>
<span style="margin-left: 3%">
2024-08-24 19:39:17 +08:00
出车次数{{ moneyManagementData.allNum }}
2024-08-16 13:46:48 +08:00
</span>
<span style="margin-left: 3%">
2024-08-24 19:39:17 +08:00
提成总金额{{ moneyManagementData.tcAll }}
2024-08-16 13:46:48 +08:00
</span>
<span style="margin-left: 3%">
2024-08-24 19:39:17 +08:00
燃油费小计{{ moneyManagementData.refuelMoney }}
2024-08-16 13:46:48 +08:00
</span>
</div>
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
2024-08-24 19:39:17 +08:00
<el-table-column label="序号" align="center">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="客户车牌号" align="center" prop="licenseNum" width="180"/>
<el-table-column label="司机" align="center" prop="driverName" width="180"/>
<el-table-column label="车牌号" align="center" prop="diverCarNum" width="180"/>
2024-08-16 13:46:48 +08:00
<el-table-column label="救援时间" align="center" prop="rescueTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.rescueTime, '{y}-{m}-{d} {h}:{m}') }}</span>
</template>
</el-table-column>
2024-08-24 19:39:17 +08:00
<el-table-column label="收费类型" align="center" prop="feeType" width="180">
2024-08-16 13:46:48 +08:00
<template slot-scope="scope">
2024-08-24 19:39:17 +08:00
<dict-tag :type="DICT_TYPE.FEE_TYPE" :value="scope.row.feeType"/>
2024-08-16 13:46:48 +08:00
</template>
</el-table-column>
2024-08-24 19:39:17 +08:00
<el-table-column label="施救金额(元)" align="center" prop="setMoney" width="180"/>
<el-table-column label="过关费(元)" align="center" prop="checkpointMoney" width="180"/>
<el-table-column label="应计提产值(元)" align="center" prop="upMoney" width="180"/>
<el-table-column label="提成比例" align="center" prop="royaltyRatio" width="180"/>
<el-table-column label="提成金额(元)" align="center" prop="royaltyMoney" width="180"/>
<el-table-column label="放空公里数" align="center" prop="emptyingDistance" width="180"/>
<el-table-column label="油补(元)" align="center" prop="oilSubsidy" width="180"/>
2024-08-16 13:46:48 +08:00
2024-08-24 19:39:17 +08:00
<el-table-column label="燃油费(元)" align="center" prop="fuelCost" width="180"/>
<el-table-column label="每公里油耗(L)" align="center" prop="oilConsumption" width="180"/>
<el-table-column label="工资(元)" align="center" prop="grossWages" width="180"/>
2024-08-16 13:46:48 +08:00
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
2024-08-27 14:46:31 +08:00
import { moneyManagement, moneyManagementData, exportManagement } from '@/api/rescue/info'
2024-08-24 19:39:17 +08:00
import { getmap } from '@/api/Map/map'
import Map from '../../components/Map/index'
2024-08-16 13:46:48 +08:00
export default {
2024-08-24 19:39:17 +08:00
name: 'Info',
dicts: ['dljy_type', 'fee_type', 'car_type', 'yes_no', 'jy_status', 'jy_order_status'],
2024-08-16 13:46:48 +08:00
data() {
return {
2024-08-27 14:46:31 +08:00
// 导出遮罩层
exportLoading: false,
2024-08-24 19:39:17 +08:00
pickerOptions: null,
chooseDriverId: '',
rescueInfoId: '',
2024-08-16 13:46:48 +08:00
// 遮罩层
loading: true,
2024-08-24 19:39:17 +08:00
ztlist: [],
2024-08-16 13:46:48 +08:00
// 选中数组
ids: [],
2024-08-24 19:39:17 +08:00
time1: [],
2024-08-16 13:46:48 +08:00
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 道路救援模块表格数据
infoList: [],
// 弹出层标题
2024-08-24 19:39:17 +08:00
title: '',
2024-08-16 13:46:48 +08:00
// 是否显示弹出层
open: false,
2024-08-24 19:39:17 +08:00
opens: false,
designateFlag: false,
zong: '',
repaymentForm: {},
repaymentOpen: false,
moneyManagementData: {},
2024-08-16 13:46:48 +08:00
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
connectionName: null,
isAppointment: null,
rescueType: null,
feeType: null,
carBrand: null,
destinationInfo: null,
rescueStatus: null,
rescueAmount: null,
2024-08-24 19:39:17 +08:00
rescueStart: null
2024-08-16 13:46:48 +08:00
},
// 表单参数
form: {},
2024-08-24 19:39:17 +08:00
driverList: [],
2024-08-16 13:46:48 +08:00
// 表单校验
rules: {
connectionName: [
2024-08-24 19:39:17 +08:00
{ required: true, message: '联系人名称不能为空', trigger: 'blur' }
2024-08-16 13:46:48 +08:00
],
connectionPhone: [
2024-08-24 19:39:17 +08:00
{ required: true, message: '联系人手机号不能为空', trigger: 'blur' }
2024-08-16 13:46:48 +08:00
],
licenseNum: [
2024-08-24 19:39:17 +08:00
{ required: true, message: '车牌号不能为空', trigger: 'blur' }
2024-08-16 13:46:48 +08:00
],
isAppointment: [
2024-08-24 19:39:17 +08:00
{ required: true, message: '是否为预约单不能为空', trigger: 'change' }
2024-08-16 13:46:48 +08:00
],
rescueType: [
2024-08-24 19:39:17 +08:00
{ required: true, message: '救援类型 1拖车2送油3搭电4换台5扣车不能为空', trigger: 'change' }
2024-08-16 13:46:48 +08:00
],
carType: [
2024-08-24 19:39:17 +08:00
{ required: true, message: '车辆类型 大中小不能为空', trigger: 'change' }
2024-08-16 13:46:48 +08:00
],
rescuePosition: [
2024-08-24 19:39:17 +08:00
{ required: true, message: '救援地点 详细描述不能为空', trigger: 'blur' }
2024-08-16 13:46:48 +08:00
],
feeType: [
2024-08-24 19:39:17 +08:00
{ required: true, message: '收费类型不能为空', trigger: 'change' }
]
2024-08-16 13:46:48 +08:00
}
2024-08-24 19:39:17 +08:00
}
2024-08-16 13:46:48 +08:00
},
2024-08-24 19:39:17 +08:00
components: {
2024-08-16 13:46:48 +08:00
Map
},
created() {
2024-08-24 19:39:17 +08:00
this.getList()
2024-08-16 13:46:48 +08:00
},
methods: {
2024-08-24 19:39:17 +08:00
cancelRepayment() {
2024-08-16 13:46:48 +08:00
this.repaymentForm = {}
this.repaymentOpen = false
},
2024-08-24 19:39:17 +08:00
repaymentSubmit() {
this.$refs['repaymentForm'].validate(valid => {
2024-08-16 13:46:48 +08:00
if (valid) {
2024-08-24 19:39:17 +08:00
returnOrder(this.repaymentForm).then(res => {
this.$modal.msgSuccess('还款成功')
this.repaymentOpen = false
2024-08-16 13:46:48 +08:00
this.repaymentForm = {}
2024-08-24 19:39:17 +08:00
this.getList()
2024-08-16 13:46:48 +08:00
})
}
2024-08-24 19:39:17 +08:00
})
2024-08-16 13:46:48 +08:00
},
2024-08-24 19:39:17 +08:00
repayment(data) {
2024-08-16 13:46:48 +08:00
this.repaymentOpen = true
this.repaymentForm.rescueOrderId = data.rescueOrderId
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
2024-08-24 19:39:17 +08:00
}
2024-08-16 13:46:48 +08:00
} else {
return {
rowspan: 0,
colspan: 0
2024-08-24 19:39:17 +08:00
}
2024-08-16 13:46:48 +08:00
}
}
},
2024-08-24 19:39:17 +08:00
driverOk() {
2024-08-16 13:46:48 +08:00
this.designateFlag = false
2024-08-24 19:39:17 +08:00
designateDriver(this.rescueInfoId, this.chooseDriverId).then(res => {
this.$message.success('指派成功')
2024-08-16 13:46:48 +08:00
this.getList()
})
},
/** 查询道路救援模块列表 */
getList() {
2024-08-24 19:39:17 +08:00
this.loading = true
2024-08-16 13:46:48 +08:00
moneyManagement(this.queryParams).then(response => {
2024-08-24 19:39:17 +08:00
this.infoList = response.data.records
this.total = response.data.total
this.loading = false
})
2024-08-16 13:46:48 +08:00
moneyManagementData(this.queryParams).then(response => {
2024-08-24 19:39:17 +08:00
this.moneyManagementData = response.data
})
2024-08-16 13:46:48 +08:00
},
getDriverList() {
getDriver().then(response => {
2024-08-24 19:39:17 +08:00
this.driverList = response.rows
})
2024-08-16 13:46:48 +08:00
},
// 取消按钮
cancel() {
2024-08-24 19:39:17 +08:00
this.open = false
this.reset()
2024-08-16 13:46:48 +08:00
},
// 表单重置
reset() {
this.form = {
id: null,
connectionName: null,
connectionPhone: null,
licenseNum: null,
isAppointment: null,
rescueTime: null,
rescueType: null,
carType: null,
rescuePosition: null,
rescueLongitude: null,
rescueLatitude: null,
feeType: null,
carBrand: null,
destinationInfo: null,
destinationLongitude: null,
destinationLatitude: null,
rescueStatus: null,
driverId: null,
rescueAmount: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
2024-08-24 19:39:17 +08:00
}
this.resetForm('form')
2024-08-16 13:46:48 +08:00
},
/** 搜索按钮操作 */
handleQuery() {
2024-08-24 19:39:17 +08:00
if (this.time1 && this.time1.length > 0) {
this.queryParams.rescueStart = this.time1[0]
this.queryParams.rescueEnd = this.time1[1]
2024-08-16 13:46:48 +08:00
}
2024-08-24 19:39:17 +08:00
this.queryParams.pageNo = 1
this.getList()
2024-08-16 13:46:48 +08:00
},
/** 重置按钮操作 */
resetQuery() {
2024-08-24 19:39:17 +08:00
this.time1 = []
this.resetForm('queryForm')
this.queryParams = {}
this.handleQuery()
2024-08-16 13:46:48 +08:00
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
2024-08-24 19:39:17 +08:00
this.single = selection.length !== 1
2024-08-16 13:46:48 +08:00
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
2024-08-24 19:39:17 +08:00
this.reset()
this.open = true
this.title = '添加道路救援模块'
2024-08-16 13:46:48 +08:00
},
2024-08-24 19:39:17 +08:00
pickDriver(row) {
2024-08-16 13:46:48 +08:00
},
2024-08-24 19:39:17 +08:00
designateDriver(row) {
2024-08-16 13:46:48 +08:00
this.designateFlag = true
this.rescueInfoId = row.id
2024-08-24 19:39:17 +08:00
this.getDriverList()
2024-08-16 13:46:48 +08:00
},
/** 修改按钮操作 */
handleUpdate(row) {
2024-08-24 19:39:17 +08:00
this.reset()
2024-08-16 13:46:48 +08:00
const id = row.id || this.ids
getInfo(id).then(response => {
2024-08-24 19:39:17 +08:00
this.form = response.data
this.open = true
this.title = '修改道路救援模块'
})
2024-08-16 13:46:48 +08:00
},
2024-08-24 19:39:17 +08:00
handleMap(row) {
2024-08-16 13:46:48 +08:00
this.rescueInfoId = row.id
2024-08-24 19:39:17 +08:00
routeInfo(row.id).then(res => {
2024-08-16 13:46:48 +08:00
this.ztlist = res.data
this.none(res.data)
})
2024-08-24 19:39:17 +08:00
getmap(row.id).then(res => {
let datas = []
res.data.forEach(it => {
let temp = [it.longitude, it.latitude]
2024-08-16 13:46:48 +08:00
datas.push(temp)
})
this.$refs.mapComponent.initMap(datas)
})
2024-08-24 19:39:17 +08:00
this.opens = true
2024-08-16 13:46:48 +08:00
},
2024-08-24 19:39:17 +08:00
none(arr) {
let sum = 0
for (var i = 0; i < arr.length; i++) {
sum += arr[i].distanceMeter
2024-08-16 13:46:48 +08:00
}
this.zong = sum
},
/** 提交按钮 */
submitForm() {
2024-08-24 19:39:17 +08:00
this.$refs['form'].validate(valid => {
2024-08-16 13:46:48 +08:00
if (valid) {
if (this.form.id != null) {
updateInfo(this.form).then(response => {
2024-08-24 19:39:17 +08:00
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
2024-08-16 13:46:48 +08:00
} else {
addInfo(this.form).then(response => {
2024-08-24 19:39:17 +08:00
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
2024-08-16 13:46:48 +08:00
}
}
2024-08-24 19:39:17 +08:00
})
2024-08-16 13:46:48 +08:00
},
/** 删除按钮操作 */
handleDelete(row) {
2024-08-24 19:39:17 +08:00
const ids = row.id || this.ids
2024-08-16 13:46:48 +08:00
this.$modal.confirm('是否确认删除道路救援模块编号为"' + ids + '"的数据项?').then(function() {
2024-08-24 19:39:17 +08:00
return delInfo(ids)
2024-08-16 13:46:48 +08:00
}).then(() => {
2024-08-24 19:39:17 +08:00
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
2024-08-16 13:46:48 +08:00
},
/** 导出按钮操作 */
2024-08-24 19:39:17 +08:00
async handleExport() {
2024-08-27 14:46:31 +08:00
try {
this.exportLoading = true
this.queryParams.pageNo = 1
this.queryParams.pageSize = 500
this.$modal.msgError("系统故障,联系管理员")
// const data = await exportManagement(this.queryParams)
// this.$download.excel(data, `救援财务报表_${new Date().getTime()}.xlsx`)
} catch {
} finally {
this.exportLoading = false
}
2024-08-16 13:46:48 +08:00
}
}
2024-08-24 19:39:17 +08:00
}
2024-08-16 13:46:48 +08:00
</script>
<style scoped>
2024-08-24 19:39:17 +08:00
.lang-for {
2024-08-16 13:46:48 +08:00
width: 100%;
margin: 10px auto;
}
</style>