|
@@ -55,7 +55,7 @@
|
|
|
<el-table-column :prop="item.prop" :label="item.label" v-for="(item,index) in table1" :key="index"/>
|
|
|
|
|
|
</el-table>
|
|
|
- <el-pagination
|
|
|
+ <!-- <el-pagination
|
|
|
:current-page.sync="pageInfo.curr"
|
|
|
:page-sizes="[15, 50, 100]"
|
|
|
:page-size="pageInfo.size"
|
|
@@ -64,10 +64,11 @@
|
|
|
:total="pageInfo.total"
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import dayjs from "dayjs"
|
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
import urlConfig from "@/apis/url-config";
|
|
@@ -121,10 +122,21 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
+ const current = dayjs(new Date()).format('YYYY-MM-DD');
|
|
|
+ this.parmValue.start_date = dayjs(current).subtract(30, 'days').format('YYYY-MM-DD')
|
|
|
+ this.parmValue.end_date = current
|
|
|
this.searchList();
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ getDiffDay(date_1, date_2){
|
|
|
+ let totalDays, diffDate
|
|
|
+ let myDate_1 = Date.parse(date_1)
|
|
|
+ let myDate_2 = Date.parse(date_2)
|
|
|
+ diffDate = Math.abs(myDate_1 - myDate_2)
|
|
|
+ totalDays = Math.floor(diffDate / (1000 * 3600 * 24))
|
|
|
+ return totalDays
|
|
|
+ },
|
|
|
//分页集合
|
|
|
handleSizeChange(val){
|
|
|
this.parmValue.size = val;
|
|
@@ -191,14 +203,28 @@ export default {
|
|
|
this.$message.warning("时间区间不完整!");
|
|
|
return;
|
|
|
}
|
|
|
- // return;
|
|
|
+
|
|
|
+
|
|
|
+ if(!this.parmValue.start_date && !this.parmValue.end_date){
|
|
|
+ this.$message.warning("请选择时间区间!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const { start_date, end_date } = this.parmValue
|
|
|
+ const diffDays = this.getDiffDay(start_date,end_date);
|
|
|
+
|
|
|
+ if(diffDays > 30){
|
|
|
+ this.$message.warning("时间区间不能超过31天!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.loading = true;
|
|
|
|
|
|
const res = await asyncRequest.reportzixuntotal(this.parmValue);
|
|
|
console.log(res)
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
- this.tableData = res.data.list;
|
|
|
- this.pageInfo.total = Number(res.data.count);
|
|
|
+ this.tableData = res.data;
|
|
|
+ // this.pageInfo.total = Number(res.data.count);
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|
|
|
} else {
|
|
@@ -217,6 +243,11 @@ export default {
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
};
|
|
|
+
|
|
|
+ const current = dayjs(new Date()).format('YYYY-MM-DD');
|
|
|
+ this.parmValue.start_date = dayjs(current).subtract(30, 'days').format('YYYY-MM-DD')
|
|
|
+ this.parmValue.end_date = current
|
|
|
+
|
|
|
// 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|