|
@@ -1,145 +1,15 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <!-- 筛选条件 -->
|
|
|
- <div>
|
|
|
- <Collapse :screen-form="searchForm">
|
|
|
- <template #right_btn>
|
|
|
- <el-button size="mini" @click="clearFn">清空</el-button>
|
|
|
- <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
|
|
|
- </template>
|
|
|
- <template #search>
|
|
|
- <el-form :model="searchForm" ref="searchForm" label-width="100px" size="mini" label-position="left">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
- <el-form-item label="经销商名称" prop="customerName">
|
|
|
- <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
- <el-form-item label="车牌" prop="carBrand">
|
|
|
- <el-input v-model="searchForm.carBrand" placeholder="请输入车牌"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </template>
|
|
|
- </Collapse>
|
|
|
- </div>
|
|
|
- <!-- 按钮 -->
|
|
|
- <div class="btn-group clearfix">
|
|
|
- <div class="fl">
|
|
|
- <el-button
|
|
|
- v-if="$checkBtnRole('add', $route.meta.roles)"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- class="add-right"
|
|
|
- @click="addDataList"
|
|
|
- >新增</el-button
|
|
|
- >
|
|
|
-
|
|
|
- <el-popconfirm
|
|
|
- v-if="$checkBtnRole('del', $route.meta.roles)"
|
|
|
- class="delClass"
|
|
|
- @onConfirm="delFn"
|
|
|
- title="这是一段内容确定删除吗?"
|
|
|
- >
|
|
|
- <el-button :disabled="ids.length < 1" slot="reference" type="danger" icon="el-icon-minus" size="mini"
|
|
|
- >批量删除</el-button
|
|
|
- >
|
|
|
- </el-popconfirm>
|
|
|
- </div>
|
|
|
- <div class="fr">
|
|
|
- <ExportButton :exUrl="'take-car-record/export'" :exParams="exParams" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 列表 -->
|
|
|
- <div class="mymain-container">
|
|
|
- <div class="table">
|
|
|
- <el-table
|
|
|
- v-loading="listLoading"
|
|
|
- :data="dataList"
|
|
|
- element-loading-text="Loading"
|
|
|
- @select="hanleSelect"
|
|
|
- @select-all="hanleSelect"
|
|
|
- border
|
|
|
- fit
|
|
|
- highlight-current-row
|
|
|
- stripe
|
|
|
- >
|
|
|
- <el-table-column type="selection" align="center" min-width="51"></el-table-column>
|
|
|
- <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
- <CopyButton :copyText="scope.row.customerName" />
|
|
|
- <span>{{ scope.row.customerName }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="left"
|
|
|
- label="车辆车牌号"
|
|
|
- prop="carBrand"
|
|
|
- min-width="160"
|
|
|
- show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="left"
|
|
|
- label="创建者"
|
|
|
- prop="createBy"
|
|
|
- min-width="160"
|
|
|
- show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="left"
|
|
|
- label="创建时间"
|
|
|
- prop="createTime"
|
|
|
- min-width="150"
|
|
|
- show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="left"
|
|
|
- label="更新者"
|
|
|
- prop="updateBy"
|
|
|
- min-width="160"
|
|
|
- show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="left"
|
|
|
- label="更新时间"
|
|
|
- prop="updateTime"
|
|
|
- min-width="160"
|
|
|
- show-overflow-tooltip
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip fixed="right">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" v-if="$checkBtnRole('edit', $route.meta.roles)" @click="editFn(scope.row)"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
- <el-popconfirm
|
|
|
- @onConfirm="delFn(scope.row.id)"
|
|
|
- v-if="$checkBtnRole('del', $route.meta.roles)"
|
|
|
- title="这是一段内容确定删除吗?"
|
|
|
- >
|
|
|
- <el-button type="text" slot="reference">删除</el-button>
|
|
|
- </el-popconfirm>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
- <!-- 分页 -->
|
|
|
- <div class="fr">
|
|
|
- <el-pagination
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-sizes="[10, 20, 30, 50]"
|
|
|
- :page-size="10"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="listTotal"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
+ <template-page
|
|
|
+ ref="pageRef"
|
|
|
+ :getList="getList"
|
|
|
+ :operation="operation()"
|
|
|
+ :optionsEvensGroup="optionsEvensGroup"
|
|
|
+ :exportList="exportList"
|
|
|
+ :columnParsing="columnParsing"
|
|
|
+ :tableAttributes="tableAttributes"
|
|
|
+ :tableEvents="tableEvents"
|
|
|
+ :operationColumnWidth="200"
|
|
|
+ >
|
|
|
<!-- 弹窗 -->
|
|
|
<el-dialog
|
|
|
title="提货车辆档案"
|
|
@@ -186,17 +56,68 @@
|
|
|
<el-button type="primary" @click="addDataListFn">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- </div>
|
|
|
+ </template-page>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getCarList, addDataListApi, delCarFn, editDataListApi } from '@/api/basic_data/taker'
|
|
|
+import TemplatePage from '@/components/template/template-page-1.vue'
|
|
|
+import {
|
|
|
+ getCarList,
|
|
|
+ addDataListApi,
|
|
|
+ delCarFn,
|
|
|
+ editDataListApi,
|
|
|
+ v2TakerCarRecordList,
|
|
|
+ v2TakerCarRecordListExport
|
|
|
+} from '@/api/basic_data/taker'
|
|
|
import { getDealerList } from '@/api/basic_data/dealer'
|
|
|
import { downloadFiles } from '@/utils/util'
|
|
|
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ TemplatePage
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 事件组合
|
|
|
+ optionsEvensGroup: [
|
|
|
+ [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ name: '新增',
|
|
|
+ click: () => {
|
|
|
+ this.addDataList()
|
|
|
+ },
|
|
|
+ isRole: this.$checkBtnRole('add', this.$route.meta.roles)
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ name: '批量删除',
|
|
|
+ click: async () => {
|
|
|
+ if (this.recordSelected.length === 0) {
|
|
|
+ this.$message.error('请选择需要删除的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.delFn()
|
|
|
+ },
|
|
|
+ isRole: this.$checkBtnRole('del', this.$route.meta.roles)
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ // 表格属性
|
|
|
+ tableAttributes: {
|
|
|
+ // 启用勾选列
|
|
|
+ selectColumn: true
|
|
|
+ },
|
|
|
+ // 表格事件
|
|
|
+ tableEvents: {
|
|
|
+ 'selection-change': this.selectionChange
|
|
|
+ },
|
|
|
+ recordSelected: [],
|
|
|
+
|
|
|
listLoading: false, // 列表加载loading
|
|
|
currentPage: 1, // 当前页码
|
|
|
pageSize: 10, // 每页数量
|
|
@@ -250,6 +171,55 @@ export default {
|
|
|
this.getDealerDataList({ pageNum: 1, pageSize: 10 })
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 列表请求函数
|
|
|
+ getList: v2TakerCarRecordList,
|
|
|
+ // 列表导出函数
|
|
|
+ exportList: v2TakerCarRecordListExport,
|
|
|
+ // 表格列解析渲染数据更改
|
|
|
+ columnParsing(item, defaultData) {
|
|
|
+ return defaultData
|
|
|
+ },
|
|
|
+ // 监听勾选变化
|
|
|
+ selectionChange(data) {
|
|
|
+ this.recordSelected = data
|
|
|
+ },
|
|
|
+ operation() {
|
|
|
+ return (h, { row, index, column }) => {
|
|
|
+ return (
|
|
|
+ <div class="operation-btns">
|
|
|
+ {this.$checkBtnRole('del', this.$route.meta.roles) ? (
|
|
|
+ <el-popconfirm
|
|
|
+ onOnConfirm={async () => {
|
|
|
+ this.delFn(row.id)
|
|
|
+ }}
|
|
|
+ title="是否确定需要删除该项内容?"
|
|
|
+ >
|
|
|
+ <el-button slot="reference" size="mini" type="text">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </el-popconfirm>
|
|
|
+ ) : (
|
|
|
+ ''
|
|
|
+ )}
|
|
|
+
|
|
|
+ {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ onClick={async () => {
|
|
|
+ this.editFn(row)
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
+ ) : (
|
|
|
+ ''
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 筛选部分数据或者单个
|
|
|
hanleSelect(selection) {
|
|
|
// this.ids = selection.map((k) => {
|
|
@@ -305,13 +275,14 @@ export default {
|
|
|
let res = arr.toString()
|
|
|
await delCarFn({ ids: res })
|
|
|
} else {
|
|
|
- let res = this.ids.toString()
|
|
|
+ let res = this.recordSelected.map(v => v.id).toString()
|
|
|
await delCarFn({ ids: res })
|
|
|
}
|
|
|
|
|
|
this.$message.success('删除成功')
|
|
|
this.ids = []
|
|
|
- this.getDataList()
|
|
|
+ // this.getDataList()
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
},
|
|
|
//获取经销商数据
|
|
|
async getDealerDataList(data) {
|
|
@@ -353,7 +324,8 @@ export default {
|
|
|
// carBrand: "",
|
|
|
// };
|
|
|
await this.$refs.addForm.resetFields()
|
|
|
- this.getDataList()
|
|
|
+ // this.getDataList()
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
this.dialogForm = false
|
|
|
},
|
|
|
//获取列表数据
|