parent
523931deef
commit
1a56d37fca
@ -1,260 +1,299 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="车牌号">
|
<el-form-item label="车牌号">
|
||||||
<el-input v-model="query.ticketno" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.ticketno" placeholder="请输入" clearable> </el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="司机名称">
|
<el-form-item label="司机名称">
|
||||||
<el-input v-model="query.drivername" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.drivername" placeholder="请输入" clearable> </el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="JNPF-common-head-right">
|
<div class="JNPF-common-head-right">
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
@click="reset()"/>
|
@click="reset()" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<screenfull isContainer/>
|
<screenfull isContainer />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
|
||||||
<el-table-column prop="id" label="ID" width="0" align="left"
|
@selection-change="handleSelectionChange">
|
||||||
/>
|
<!-- <el-table-column prop="id" label="ID" width="0" align="left" /> -->
|
||||||
<el-table-column prop="ticketno" label="车牌号" width="0" align="left"
|
<el-table-column prop="ticketno" label="车牌号" width="0" align="left" />
|
||||||
/>
|
<el-table-column prop="drivername" label="司机名称" width="0" align="left" />
|
||||||
<el-table-column prop="drivername" label="司机名称" width="0" align="left"
|
<el-table-column prop="contact" label="手机号" width="0" align="left" />
|
||||||
/>
|
<el-table-column prop="vehiclephotos" label="车辆照片" width="0" align="left">
|
||||||
<el-table-column prop="contact" label="手机号" width="0" align="left"
|
|
||||||
/>
|
<template slot-scope="scope">
|
||||||
<el-table-column prop="vehiclephotos" label="车辆照片" width="0" align="left"
|
<span v-for="(item,index) in JSON.parse(scope.row.vehiclephotos)" :key="index">
|
||||||
/>
|
<el-popover placement="left" trigger="click" width="300">
|
||||||
<el-table-column prop="creatorusername" label="录入人" width="0" align="left"
|
<img :src="`/dev${item.url}`" width="100%" />
|
||||||
/>
|
<img
|
||||||
<el-table-column prop="creatortime" label="创建时间" width="0" align="left"
|
slot="reference"
|
||||||
/>
|
:src="`/dev${item.url}`"
|
||||||
<el-table-column label="操作" fixed="right"
|
:alt="`/dev${item.url}`"
|
||||||
width="100" >
|
style="max-height: 70px;max-width: 70px; padding: 5px"
|
||||||
<template slot-scope="scope">
|
/>
|
||||||
<el-button type="text"
|
</el-popover>
|
||||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
</span>
|
||||||
</el-button>
|
</template>
|
||||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
|
||||||
</el-button>
|
</el-table-column>
|
||||||
</template>
|
<el-table-column prop="creatorusername" label="录入人" width="0" align="left" />
|
||||||
</el-table-column>
|
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
|
||||||
</JNPF-table>
|
<el-table-column label="操作" fixed="right" width="100">
|
||||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
<template slot-scope="scope">
|
||||||
</div>
|
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
||||||
</div>
|
</el-button>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
</el-button>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
</template>
|
||||||
</div>
|
</el-table-column>
|
||||||
|
</JNPF-table>
|
||||||
|
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||||
|
@pagination="initData" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
||||||
|
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
||||||
|
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
import {
|
||||||
import JNPFForm from './Form'
|
getDictionaryDataSelector
|
||||||
import ExportBox from './ExportBox'
|
} from '@/api/systemData/dictionary'
|
||||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
import JNPFForm from './Form'
|
||||||
import Detail from './Detail'
|
import ExportBox from './ExportBox'
|
||||||
|
import {
|
||||||
|
getDataInterfaceRes
|
||||||
|
} from '@/api/systemData/dataInterface'
|
||||||
|
import Detail from './Detail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {JNPFForm, ExportBox,Detail},
|
components: {
|
||||||
data() {
|
JNPFForm,
|
||||||
return {
|
ExportBox,
|
||||||
detailVisible: false,
|
Detail
|
||||||
query: {
|
},
|
||||||
ticketno:undefined,
|
data() {
|
||||||
drivername:undefined,
|
return {
|
||||||
},
|
detailVisible: false,
|
||||||
treeProps: {
|
query: {
|
||||||
children: 'children',
|
ticketno: undefined,
|
||||||
label: 'fullName',
|
drivername: undefined,
|
||||||
value: 'id'
|
},
|
||||||
},
|
treeProps: {
|
||||||
list: [],
|
children: 'children',
|
||||||
listLoading: true,
|
label: 'fullName',
|
||||||
multipleSelection: [], total: 0,
|
value: 'id'
|
||||||
listQuery: {
|
},
|
||||||
currentPage: 1,
|
list: [],
|
||||||
pageSize: 20,
|
listLoading: true,
|
||||||
sort: "desc",
|
multipleSelection: [],
|
||||||
sidx: "",
|
total: 0,
|
||||||
},
|
listQuery: {
|
||||||
formVisible: false,
|
currentPage: 1,
|
||||||
exportBoxVisible: false,
|
pageSize: 20,
|
||||||
columnList: [
|
sort: "desc",
|
||||||
{prop: 'ticketno', label: '车牌号'},
|
sidx: "",
|
||||||
{prop: 'drivername', label: '司机名称'},
|
},
|
||||||
{prop: 'contact', label: '手机号'},
|
formVisible: false,
|
||||||
{prop: 'creatorusername', label: '录入人'},
|
exportBoxVisible: false,
|
||||||
{prop: 'creatortime', label: '创建时间'},
|
columnList: [{
|
||||||
],
|
prop: 'ticketno',
|
||||||
}
|
label: '车牌号'
|
||||||
},
|
},
|
||||||
computed: {
|
{
|
||||||
menuId() {
|
prop: 'drivername',
|
||||||
return this.$route.meta.modelId || ''
|
label: '司机名称'
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
created() {
|
prop: 'contact',
|
||||||
this.initData()
|
label: '手机号'
|
||||||
},
|
},
|
||||||
methods: {
|
{
|
||||||
goDetail(id){
|
prop: 'creatorusername',
|
||||||
this.detailVisible = true
|
label: '录入人'
|
||||||
this.$nextTick(() => {
|
},
|
||||||
this.$refs.Detail.init(id)
|
{
|
||||||
})
|
prop: 'creatortime',
|
||||||
},
|
label: '创建时间'
|
||||||
sortChange({column, prop, order}) {
|
},
|
||||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
],
|
||||||
this.listQuery.sidx = !order ? '' : prop
|
}
|
||||||
this.initData()
|
},
|
||||||
},
|
computed: {
|
||||||
initData() {
|
menuId() {
|
||||||
this.listLoading = true;
|
return this.$route.meta.modelId || ''
|
||||||
let _query = {
|
}
|
||||||
...this.listQuery,
|
},
|
||||||
...this.query,
|
created() {
|
||||||
menuId:this.menuId
|
this.initData()
|
||||||
};
|
},
|
||||||
request({
|
methods: {
|
||||||
url: `/api/example/Vehicle/getList`,
|
goDetail(id) {
|
||||||
method: 'post',
|
this.detailVisible = true
|
||||||
data: _query
|
this.$nextTick(() => {
|
||||||
}).then(res => {
|
this.$refs.Detail.init(id)
|
||||||
var _list =[];
|
})
|
||||||
for(let i=0;i<res.data.list.length;i++){
|
},
|
||||||
let _data = res.data.list[i];
|
sortChange({
|
||||||
_list.push(_data)
|
column,
|
||||||
}
|
prop,
|
||||||
this.list = _list
|
order
|
||||||
this.total = res.data.pagination.total
|
}) {
|
||||||
|
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||||
|
this.listQuery.sidx = !order ? '' : prop
|
||||||
|
this.initData()
|
||||||
|
},
|
||||||
|
initData() {
|
||||||
|
this.listLoading = true;
|
||||||
|
let _query = {
|
||||||
|
...this.listQuery,
|
||||||
|
...this.query,
|
||||||
|
menuId: this.menuId
|
||||||
|
};
|
||||||
|
request({
|
||||||
|
url: `/api/example/Vehicle/getList`,
|
||||||
|
method: 'post',
|
||||||
|
data: _query
|
||||||
|
}).then(res => {
|
||||||
|
var _list = [];
|
||||||
|
for (let i = 0; i < res.data.list.length; i++) {
|
||||||
|
let _data = res.data.list[i];
|
||||||
|
_list.push(_data)
|
||||||
|
}
|
||||||
|
this.list = _list
|
||||||
|
this.total = res.data.pagination.total
|
||||||
|
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/Vehicle/${id}`,
|
url: `/api/example/Vehicle/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.initData()
|
this.initData()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {});
|
||||||
});
|
},
|
||||||
},
|
handleSelectionChange(val) {
|
||||||
handleSelectionChange(val) {
|
const res = val.map(item => item.id)
|
||||||
const res = val.map(item => item.id)
|
this.multipleSelection = res
|
||||||
this.multipleSelection = res
|
},
|
||||||
},
|
handleBatchRemoveDel() {
|
||||||
handleBatchRemoveDel() {
|
if (!this.multipleSelection.length) {
|
||||||
if (!this.multipleSelection.length) {
|
this.$message({
|
||||||
this.$message({
|
type: 'error',
|
||||||
type: 'error',
|
message: '请选择一条数据',
|
||||||
message: '请选择一条数据',
|
duration: 1500,
|
||||||
duration: 1500,
|
})
|
||||||
})
|
return
|
||||||
return
|
}
|
||||||
}
|
const ids = this.multipleSelection.join()
|
||||||
const ids = this.multipleSelection.join()
|
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
type: 'warning'
|
||||||
type: 'warning'
|
}).then(() => {
|
||||||
}).then(() => {
|
request({
|
||||||
request({
|
url: `/api/example/Vehicle/batchRemove/${ids}`,
|
||||||
url: `/api/example/Vehicle/batchRemove/${ids}`,
|
method: 'DELETE'
|
||||||
method: 'DELETE'
|
}).then(res => {
|
||||||
}).then(res => {
|
this.$message({
|
||||||
this.$message({
|
type: 'success',
|
||||||
type: 'success',
|
message: res.msg,
|
||||||
message: res.msg,
|
onClose: () => {
|
||||||
onClose: () => {
|
this.initData()
|
||||||
this.initData()
|
}
|
||||||
}
|
});
|
||||||
});
|
})
|
||||||
})
|
}).catch(() => {})
|
||||||
}).catch(() => {
|
},
|
||||||
})
|
addOrUpdateHandle(id, isDetail) {
|
||||||
},
|
this.formVisible = true
|
||||||
addOrUpdateHandle(id, isDetail) {
|
this.$nextTick(() => {
|
||||||
this.formVisible = true
|
this.$refs.JNPFForm.init(id, isDetail)
|
||||||
this.$nextTick(() => {
|
})
|
||||||
this.$refs.JNPFForm.init(id, isDetail)
|
},
|
||||||
})
|
exportData() {
|
||||||
},
|
this.exportBoxVisible = true
|
||||||
exportData() {
|
this.$nextTick(() => {
|
||||||
this.exportBoxVisible = true
|
this.$refs.ExportBox.init(this.columnList)
|
||||||
this.$nextTick(() => {
|
})
|
||||||
this.$refs.ExportBox.init(this.columnList)
|
},
|
||||||
})
|
download(data) {
|
||||||
},
|
let query = {
|
||||||
download(data) {
|
...data,
|
||||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
...this.listQuery,
|
||||||
request({
|
...this.query,
|
||||||
url: `/api/example/Vehicle/Actions/Export`,
|
menuId: this.menuId
|
||||||
method: 'GET',
|
}
|
||||||
data: query
|
request({
|
||||||
}).then(res => {
|
url: `/api/example/Vehicle/Actions/Export`,
|
||||||
if (!res.data.url) return
|
method: 'GET',
|
||||||
this.jnpf.downloadFile(res.data.url)
|
data: query
|
||||||
this.$refs.ExportBox.visible = false
|
}).then(res => {
|
||||||
this.exportBoxVisible = false
|
if (!res.data.url) return
|
||||||
})
|
this.jnpf.downloadFile(res.data.url)
|
||||||
},
|
this.$refs.ExportBox.visible = false
|
||||||
search() {
|
this.exportBoxVisible = false
|
||||||
this.listQuery = {
|
})
|
||||||
currentPage: 1,
|
},
|
||||||
pageSize: 20,
|
search() {
|
||||||
sort: "desc",
|
this.listQuery = {
|
||||||
sidx: "",
|
currentPage: 1,
|
||||||
}
|
pageSize: 20,
|
||||||
this.initData()
|
sort: "desc",
|
||||||
},
|
sidx: "",
|
||||||
refresh(isrRefresh) {
|
}
|
||||||
this.formVisible = false
|
this.initData()
|
||||||
if (isrRefresh) this.reset()
|
},
|
||||||
},
|
refresh(isrRefresh) {
|
||||||
reset() {
|
this.formVisible = false
|
||||||
for (let key in this.query) {
|
if (isrRefresh) this.reset()
|
||||||
this.query[key] = undefined
|
},
|
||||||
}
|
reset() {
|
||||||
this.search()
|
for (let key in this.query) {
|
||||||
}
|
this.query[key] = undefined
|
||||||
}
|
}
|
||||||
}
|
this.search()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in new issue