|
@@ -52,10 +52,24 @@
|
|
border
|
|
border
|
|
style="width: 100%; margin-top: 20px"
|
|
style="width: 100%; margin-top: 20px"
|
|
>
|
|
>
|
|
- <el-table-column v-for="(item,index) in table1" :key="index" :prop="item.prop" :label="item.label" />
|
|
|
|
|
|
+ <el-table-column v-for="(item,index) in table1" :key="index" :prop="item.prop" :label="item.label">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span v-if="item._slot_ && item._slot_ === 'companyNo'">
|
|
|
|
+ {{getCompanyWithCode(currentCompany).code || '--'}}
|
|
|
|
+ </span>
|
|
|
|
|
|
|
|
+ <span v-else-if="item._slot_ && item._slot_ === 'companyName'">
|
|
|
|
+ {{getCompanyWithCode(currentCompany).name || '--'}}
|
|
|
|
+ </span>
|
|
|
|
+
|
|
|
|
+ <span v-else>
|
|
|
|
+ {{scope.row[item.prop]}}
|
|
|
|
+ </span>
|
|
|
|
+
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- <el-pagination
|
|
|
|
|
|
+ <!-- <el-pagination
|
|
:current-page.sync="pageInfo.curr"
|
|
:current-page.sync="pageInfo.curr"
|
|
:page-sizes="[15, 50, 100]"
|
|
:page-sizes="[15, 50, 100]"
|
|
:page-size="pageInfo.size"
|
|
:page-size="pageInfo.size"
|
|
@@ -64,10 +78,11 @@
|
|
:total="pageInfo.total"
|
|
:total="pageInfo.total"
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
- />
|
|
|
|
|
|
+ /> -->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
+import dayjs from "dayjs"
|
|
import mixinPage from '@/mixins/elPaginationHandle'
|
|
import mixinPage from '@/mixins/elPaginationHandle'
|
|
import resToken from '@/mixins/resToken'
|
|
import resToken from '@/mixins/resToken'
|
|
import urlConfig from '@/apis/url-config'
|
|
import urlConfig from '@/apis/url-config'
|
|
@@ -122,10 +137,23 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
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
|
|
|
|
+
|
|
|
|
+ console.log(this.parmValue)
|
|
this.searchList()
|
|
this.searchList()
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
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) {
|
|
handleSizeChange(val) {
|
|
this.parmValue.size = val
|
|
this.parmValue.size = val
|
|
@@ -192,6 +220,15 @@ export default {
|
|
this.$message.warning('时间区间不完整!')
|
|
this.$message.warning('时间区间不完整!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ const { start_date, end_date } = this.parmValue
|
|
|
|
+ const diffDays = this.getDiffDay(start_date,end_date);
|
|
|
|
+
|
|
|
|
+ if(diffDays > 30){
|
|
|
|
+ this.$message.warning("时间区间不能超过31天!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
// return;
|
|
// return;
|
|
this.loading = true
|
|
this.loading = true
|
|
|
|
|
|
@@ -201,7 +238,8 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
if (res && res.code === 0 && res.data) {
|
|
if (res && res.code === 0 && res.data) {
|
|
- this.tableData = res.data.list
|
|
|
|
|
|
+ this.tableData = res.data
|
|
|
|
+ console.log(this.tableData)
|
|
this.pageInfo.total = Number(res.data.count)
|
|
this.pageInfo.total = Number(res.data.count)
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
await this.logout()
|
|
await this.logout()
|
|
@@ -221,6 +259,11 @@ export default {
|
|
page: 1, // 页码
|
|
page: 1, // 页码
|
|
size: 15 // 每页显示条数
|
|
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 = {
|
|
this.pageInfo = {
|
|
size: 15,
|
|
size: 15,
|