Commit 631d074d by jack

优化界面展示

1 parent 75741934
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<!-- 按钮区域 end --> <!-- 按钮区域 end -->
<!-- 列表 开始 --> <!-- 列表 开始 -->
<glsx-table ref="glsxTable" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList"> <glsx-table ref="glsxTable" v-loading="loading" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList">
<div slot="operate" slot-scope="{scope}"> <div slot="operate" slot-scope="{scope}">
<el-link type="primary" :underline="false" @click="lookDetail(scope)">详情</el-link> <el-link type="primary" :underline="false" @click="lookDetail(scope)">详情</el-link>
</div> </div>
...@@ -122,6 +122,7 @@ export default { ...@@ -122,6 +122,7 @@ export default {
showPopover: false, showPopover: false,
mileageDate: [], mileageDate: [],
cloading: false, cloading: false,
loading:false
}; };
}, },
...@@ -145,11 +146,15 @@ export default { ...@@ -145,11 +146,15 @@ export default {
console.log(this.searchForm); console.log(this.searchForm);
oParams.pageSize = options ? options.pageSize || 10 : 10; oParams.pageSize = options ? options.pageSize || 10 : 10;
oParams.pageNumber = options ? options.pageNumber || 1 : 1; oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true
GETMILEAGESTATISTICS(oParams).then((res) => { GETMILEAGESTATISTICS(oParams).then((res) => {
this.loading = false
let { data } = res; let { data } = res;
let { list, totalElements } = data; let { list, totalElements } = data;
this.pageTotal = totalElements || 0; this.pageTotal = totalElements || 0;
this.tableData = list || []; this.tableData = list || [];
}).catch(error => {
this.loading = false
}); });
}, },
...@@ -226,6 +231,8 @@ export default { ...@@ -226,6 +231,8 @@ export default {
// 重置 // 重置
rest() { rest() {
this.searchForm = {}; this.searchForm = {};
this.searchText = '';
this.preText = 'orderNo'
this.getList(); this.getList();
this.$refs.glsxTable.rest(); this.$refs.glsxTable.rest();
}, },
......
...@@ -8,17 +8,13 @@ ...@@ -8,17 +8,13 @@
<div class="search_box"> <div class="search_box">
<el-form :model="searchForm" :inline="true" size="medium"> <el-form :model="searchForm" :inline="true" size="medium">
<el-form-item label="关键字:"> <el-form-item label="关键字:">
<el-input v-model="searchForm.keyWord" placeholder="特约店编码|店名称|车架号|车型"></el-input> <el-input v-model="searchForm.keywords" placeholder="特约店编码|店名称|车架号|车型"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="年份:"> <el-form-item label="年份:">
<el-select v-model="searchForm.year" placeholder="请选择" @change="onChange"> <el-date-picker v-model="searchForm.dataRange" type="month" placeholder="选择月" value-format="yyyy-MM" @change="initColumn">
<el-option v-for="(item,index) in yearList" :key="`year_${index}`" :label="`${item}年`" :value="item"></el-option> </el-date-picker>
<!-- <el-option label="2020年" value="2020"></el-option>
<el-option label="2019年" value="2019"></el-option>
<el-option label="2018年" value="2018"></el-option> -->
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="月份:"> <!-- <el-form-item label="月份:">
<el-select v-model="searchForm.month" placeholder="请选择" @change="onChange"> <el-select v-model="searchForm.month" placeholder="请选择" @change="onChange">
<el-option label="1月" value="1"></el-option> <el-option label="1月" value="1"></el-option>
<el-option label="2月" value="2"></el-option> <el-option label="2月" value="2"></el-option>
...@@ -33,7 +29,7 @@ ...@@ -33,7 +29,7 @@
<el-option label="11月" value="11"></el-option> <el-option label="11月" value="11"></el-option>
<el-option label="12月" value="12"></el-option> <el-option label="12月" value="12"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList()">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="getList()">搜索</el-button>
</el-form-item> </el-form-item>
...@@ -74,26 +70,40 @@ ...@@ -74,26 +70,40 @@
<script> <script>
import GlsxTable from "@/components/glsx-table"; import GlsxTable from "@/components/glsx-table";
import { OIL_STATISTICS_SEARCH,OIL_YEARS_LIST,OIL_STATISTICS_EXPORT } from "services/report"; import {
OIL_STATISTICS_SEARCH,
OIL_YEARS_LIST,
OIL_STATISTICS_EXPORT,
} from "services/report";
import moment from "moment"; import moment from "moment";
import {deepClone} from '@/utils/util' import { deepClone } from "@/utils/util";
export default { export default {
data() { data() {
return { return {
searchForm: {}, searchForm: {},
tableData: [], tableData: [],
columnList: [ columnList: [
{ label: "特约店代码", prop: "shopCode",fixed:'left',width:'100px' }, {
{ label: "特约店名称", prop: "shopName",fixed:'left',width:'100px' }, label: "特约店代码",
{ label: "车型", prop: "modelName",fixed:'left',width:'160px' }, prop: "shopCode",
{ label: "设备号", prop: "sn",fixed:'left',width:'160px' }, fixed: "left",
{ label: "车架号VIN码", prop: "vin",fixed:'left',width:'160px' }, width: "100px",
{ label: "时间", prop: "statDate",fixed:'left',width:'100px' }, },
{
label: "特约店名称",
prop: "shopName",
fixed: "left",
width: "100px",
},
{ label: "车型", prop: "modelName", fixed: "left", width: "160px" },
{ label: "设备号", prop: "sn", fixed: "left", width: "160px" },
{ label: "车架号VIN码", prop: "vin", fixed: "left", width: "160px" },
{ label: "时间", prop: "statDate", fixed: "left", width: "100px" },
], ],
tableColumnList:[], tableColumnList: [],
pageTotal: 0, pageTotal: 0,
yearList:[], yearList: [],
dloading:false dloading: false,
}; };
}, },
components: { components: {
...@@ -105,10 +115,17 @@ export default { ...@@ -105,10 +115,17 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
// 获取查询参数 // 获取查询参数
getParams() { getParams() {
let oParams = deepClone(this.searchForm); let oParams = deepClone(this.searchForm);
let o = oParams.dataRange;
if(o){
oParams.year = o.split('-')[0]
oParams.month = o.split('-')[1]
delete oParams.dataRange
}
return oParams; return oParams;
}, },
...@@ -133,37 +150,36 @@ export default { ...@@ -133,37 +150,36 @@ export default {
/** 初始化 表格日期 */ /** 初始化 表格日期 */
initColumn(e) { initColumn(e) {
console.log(e) let y = e?e.split('-')[0] : moment().date();
let y = this.searchForm.year || moment().date(); let m = e?e.split('-')[1] : moment().month() + 1;
let m = this.searchForm.month || moment().month() + 1;
let day = moment(`${y}-${m}`, "YYYY-MM").daysInMonth(); let day = moment(`${y}-${m}`, "YYYY-MM").daysInMonth();
let list = deepClone(this.columnList); let list = deepClone(this.columnList);
for(let i = 1,len = day;i<=len;i++){ for (let i = 1, len = day; i <= len; i++) {
let o = {label:`${i}日`,prop:`dayNum${i}`} let o = { label: `${i}日`, prop: `dayNum${i}` };
list.push(o) list.push(o);
} }
list.push({label:'总计',prop:'summation'}) list.push({ label: "总计", prop: "summation" });
this.tableColumnList = list this.tableColumnList = list;
}, },
//监听月份和年份 切换 //监听月份和年份 切换
onChange(){ // onChange() {
this.initColumn(); // this.initColumn();
}, // },
// 重置 // 重置
rest(){ rest() {
this.searchForm = {}; this.searchForm = {};
this.getList(); this.getList();
this.$refs.glsxTable.rest(); this.$refs.glsxTable.rest();
}, },
// 获取年份 // 获取年份
getYear(){ getYear() {
OIL_YEARS_LIST().then(res => { OIL_YEARS_LIST().then((res) => {
this.yearList = res.data || [] this.yearList = res.data || [];
}) });
}, },
// 导出excel // 导出excel
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!