|
@@ -41,19 +41,16 @@
|
|
|
|
|
|
<el-table v-loading="loading" :data="platPublicCarRankUnitList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="序号" width="50">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{(scope.$index + 1) + ((queryParams.pageNum - 1) * queryParams.pageSize)}}
|
|
|
- </template>
|
|
|
+ <el-table-column label="序号" width="50" type="index">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="单位排名" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.id > 3">后三名</span>
|
|
|
- <span v-if="scope.row.id < 4">前三名</span>
|
|
|
+ <span v-if="platPublicCarRankUnitList.indexOf(scope.row) < 4">前三名</span>
|
|
|
+ <span v-if="platPublicCarRankUnitList.indexOf(scope.row) > 3">后三名</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="公务车总数" align="center" prop="gwcCount" />
|
|
|
- <el-table-column label="公务车派车次数" align="center" prop="gwcPcd" />
|
|
|
+ <el-table-column label="公务车总数" align="center" prop="totalCarNum" />
|
|
|
+ <el-table-column label="公务车派车次数" align="center" prop="pcdNum" />
|
|
|
<el-table-column label="单位编码" align="center" prop="appEncode" />
|
|
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
@@ -86,11 +83,11 @@
|
|
|
<!-- 添加或修改公务用车对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="800px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
- <el-form-item label="公务车总数" prop="gwcCount">
|
|
|
- <el-input v-model="form.gwcCount" placeholder="请输入公务车总数" />
|
|
|
+ <el-form-item label="公务车总数" prop="totalCarNum">
|
|
|
+ <el-input v-model="form.totalCarNum" placeholder="请输入公务车总数" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="公务车派车次数" prop="gwcPcd">
|
|
|
- <el-input v-model="form.gwcPcd" placeholder="请输入公务车派车次数" />
|
|
|
+ <el-form-item label="公务车派车次数" prop="pcdNum">
|
|
|
+ <el-input v-model="form.pcdNum" placeholder="请输入公务车派车次数" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="具体单位">
|
|
|
<el-cascader :options="treeList" placeholder="请选择单位" v-model="form.appEncode" :props="props" @change="handleChange" style="width: 400px">
|
|
@@ -109,7 +106,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listPlatPublicCarRankUnit, getPlatPublicCarRankUnit, delPlatPublicCarRankUnit, addPlatPublicCarRankUnit, updatePlatPublicCarRankUnit } from "@/api/zcustom/unitRank";
|
|
|
+import {
|
|
|
+ listPlatPublicCarRankUnit,
|
|
|
+ getPlatPublicCarRankUnit,
|
|
|
+ delPlatPublicCarRankUnit,
|
|
|
+ addPlatPublicCarRankUnit,
|
|
|
+ updatePlatPublicCarRankUnit,
|
|
|
+ listAllPlatPublicCarRankUnit, getList
|
|
|
+} from '@/api/zcustom/unitRank'
|
|
|
import { getListTree } from '@/api/zcustom/platAppOrg'
|
|
|
|
|
|
export default {
|
|
@@ -162,10 +166,10 @@ export default {
|
|
|
delFlag: [
|
|
|
{ required: true, message: "删除标志不能为空", trigger: "blur" }
|
|
|
],
|
|
|
- gwcCount: [
|
|
|
+ totalCarNum: [
|
|
|
{ required: true, message: "公务车总数不能为空", trigger: "blur" }
|
|
|
],
|
|
|
- gwcPcd: [
|
|
|
+ pcdNum: [
|
|
|
{ required: true, message: "公务车派车次数不能为空", trigger: "blur" }
|
|
|
],
|
|
|
appEncode: [
|
|
@@ -190,9 +194,12 @@ export default {
|
|
|
/** 查询公务用车列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listPlatPublicCarRankUnit(this.queryParams).then(response => {
|
|
|
- this.platPublicCarRankUnitList = response.data.records;
|
|
|
- this.total = response.data.total;
|
|
|
+ getList(this.queryParams).then(response => {
|
|
|
+ this.platPublicCarRankUnitList = response.data;
|
|
|
+ let firstThree = this.platPublicCarRankUnitList.slice(0, 3); // 前三
|
|
|
+ let lastThree = this.platPublicCarRankUnitList.slice(-3); // 后三
|
|
|
+ let newList = firstThree.concat(lastThree);
|
|
|
+ this.platPublicCarRankUnitList = newList
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|