Commit df496f6a authored by 黄奎's avatar 黄奎

1

parent 5d7930b8
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<div class="query-box" style="border-bottom: none;"> <div class="query-box" style="border-bottom: none;">
<ul> <ul>
<li><span><em>{{$t('pub.date')}}</em> <li><span><em>{{$t('pub.date')}}</em>
<el-date-picker v-model="msg.MonthStr" type="month" placeholder="选择月" format="yyyy-MM" value-format="yyyy-MM"> <el-date-picker v-model="msg.MonthStr" type="month" placeholder="选择月" format="yyyy-MM"
value-format="yyyy-MM">
</el-date-picker> </el-date-picker>
</span> </span>
</li> </li>
<li> <li>
<input type="button" class="normalBtn" :value="$t('pub.searchBtn')" @click="getList()" /> <input type="button" class="normalBtn" :value="$t('pub.searchBtn')" @click="getList()" />
</li> </li>
...@@ -15,9 +15,31 @@ ...@@ -15,9 +15,31 @@
</div> </div>
<div style="width: 100%; overflow-x: auto;padding-bottom: 10px; margin-top: 10px; " class="ownScrollbarStyle"> <div style="width: 100%; overflow-x: auto;padding-bottom: 10px; margin-top: 10px; " class="ownScrollbarStyle">
<table v-loading="loading" class="">
<thead>
<tr>
<th style="text-align:center;">
{{msg.MonthStr}}
</th>
<template v-if="headerList&&headerList.length>0">
<template v-for="(hItem,hIndex) in headerList">
<th :key="`h_`+hIndex" style="width:50px;text-align:center;">
{{hItem.DayStr}}
</th>
</template>
</template>
</tr>
</thead>
<tbody v-for="(item,index) in dataList" :key="`d_`+index">
<tr>
<td style="text-align:center;">
{{item.CarName}}<br />
{{item.CarNo}}
</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
...@@ -27,8 +49,8 @@ ...@@ -27,8 +49,8 @@
loading: false, loading: false,
msg: { msg: {
MonthStr: "", MonthStr: "",
}, },
headerList: [], //表头
dataList: [], dataList: [],
} }
}, },
...@@ -38,12 +60,16 @@ ...@@ -38,12 +60,16 @@
methods: { methods: {
getList() { getList() {
this.loading = true; this.loading = true;
this.dataList = [];
this.headerList = [];
this.apipost('travel_post_GetTripCarPlanList', this.msg, res => { this.apipost('travel_post_GetTripCarPlanList', this.msg, res => {
this.loading = false; this.loading = false;
console.log("travel_post_GetTripCarPlanList", res) console.log("travel_post_GetTripCarPlanList", res)
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.dataList = res.data.data;
if (this.dataList && this.dataList.length > 0) {
this.headerList = this.dataList[0].SubList;
}
} else { } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
...@@ -52,17 +78,15 @@ ...@@ -52,17 +78,15 @@
}, },
mounted() { mounted() {
let myDate = new Date(); let myDate = new Date();
let nowDate = let yearStr = myDate.getFullYear();
myDate.getFullYear() + let monthStr = parseInt(myDate.getMonth() + 1);
"-" + this.msg.MonthStr = yearStr + "-" + (monthStr < 10 ? '0' + monthStr : monthStr);
parseInt(myDate.getMonth() + 1);
this.msg.MonthStr = nowDate;
this.getList(); this.getList();
}, },
} }
</script> </script>
<style> <style>
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment