|
|
@@ -1,5 +1,5 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { apisystemdzbcCarlist,apisystemdzbcCarexport,apisystemdzbcCarDel,apisystemdzbcCarAdd,apisystemdzbcCarUpdate } from '../../request/api.js'
|
|
|
+import { apisystemuserlist,apisystemdzbcCarlist,apisystemdzbcCarexport,apisystemdzbcCarDel,apisystemdzbcCarAdd,apisystemdzbcCarUpdate } from '../../request/api.js'
|
|
|
import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
interface RuleForm {
|
|
|
@@ -86,7 +86,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
|
|
|
import { ref,onMounted,reactive } from 'vue'
|
|
|
import { Search,Download,Tools,Plus,Check,Close } from "@element-plus/icons-vue";
|
|
|
-let searchWord=ref('')
|
|
|
+let carNum=ref('')
|
|
|
let total=ref(0)
|
|
|
let pageNum=ref(1)
|
|
|
let dialogVisible=ref(false)
|
|
|
@@ -136,14 +136,34 @@ const downExcell=()=>{
|
|
|
console.log(err)
|
|
|
})
|
|
|
}
|
|
|
+const searchClick=()=>{
|
|
|
+ pageNum.value=1
|
|
|
+ getTableData()
|
|
|
+
|
|
|
+}
|
|
|
const getTableData=()=>{
|
|
|
apisystemdzbcCarlist({
|
|
|
+ carNum:carNum.value,
|
|
|
pageSize:10,
|
|
|
pageNum:pageNum.value
|
|
|
}).then(res=>{
|
|
|
if(res.code==200){
|
|
|
total.value=res.total
|
|
|
- tableData.value=res.rows
|
|
|
+ tableData.value=res.rows.map(item=>{
|
|
|
+ let data=sijiList.value.filter(siji=>{
|
|
|
+ return item.driverId==siji.userId
|
|
|
+
|
|
|
+ })[0]
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(data){
|
|
|
+ item.nickName=data.nickName
|
|
|
+ }
|
|
|
+
|
|
|
+ return item
|
|
|
+
|
|
|
+ })
|
|
|
}
|
|
|
loading.value=false
|
|
|
|
|
|
@@ -164,9 +184,23 @@ const deleteItem=(id)=>{
|
|
|
console.log(err)
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+let sijiList=ref([])
|
|
|
onMounted(()=>{
|
|
|
- getTableData()
|
|
|
+
|
|
|
+ apisystemuserlist({
|
|
|
+ roleId:'1763484881548447746',
|
|
|
+ pageNum:1
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+
|
|
|
+ sijiList.value=res.rows
|
|
|
+ getTableData()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
|
|
|
@@ -192,7 +226,7 @@ onMounted(()=>{
|
|
|
<div class="common-search-box">
|
|
|
<div class="left-part">
|
|
|
<el-input
|
|
|
- v-model="searchWord"
|
|
|
+ v-model="carNum"
|
|
|
|
|
|
placeholder="搜索车牌号..."
|
|
|
style="width:260px"
|
|
|
@@ -205,9 +239,7 @@ onMounted(()=>{
|
|
|
|
|
|
</div>
|
|
|
<div class="right-part">
|
|
|
-
|
|
|
-
|
|
|
- <el-button :icon="Tools">筛选</el-button>
|
|
|
+ <!-- <el-button :icon="Tools">筛选</el-button> -->
|
|
|
<el-button :loading="excellloading" @click="downExcell" :icon="Download">{{ excellloading?'正在导出':'导出' }}</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -225,11 +257,11 @@ onMounted(()=>{
|
|
|
<el-table-column prop="driverId" label="司机">
|
|
|
<template #default="scope">
|
|
|
<div class="table-user-wrap">
|
|
|
- <div class="left-part">
|
|
|
+ <!-- <div class="left-part">
|
|
|
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div class="right-part">
|
|
|
- <div style="color:#000"></div>
|
|
|
+ <div style="color:#000">{{ scope.row.nickName }}</div>
|
|
|
<div style="color: #6B7280;">ID:{{ scope.row.driverId }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -239,8 +271,6 @@ onMounted(()=>{
|
|
|
<el-table-column prop="gps" label="GPS设备">
|
|
|
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="date" label="创建时间" />
|
|
|
<el-table-column fixed="right" label="操作" min-width="120">
|
|
|
<template #default="scope">
|
|
|
<el-button link type="primary" @click="addItem(scope.row)" size="small">
|
|
|
@@ -308,10 +338,24 @@ onMounted(()=>{
|
|
|
<el-input placeholder="GPS设备序列号" v-model="ruleForm.gps" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="司机">
|
|
|
- <el-input placeholder="司机" v-model="ruleForm.driverId" />
|
|
|
+
|
|
|
+ <el-select
|
|
|
+ placeholder="司机" v-model="ruleForm.driverId"
|
|
|
+
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in sijiList"
|
|
|
+ :key="item.nickName"
|
|
|
+ :label="item.nickName"
|
|
|
+ :value="item.userId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|