Commit 30a9f6e0 authored by 陈明豪's avatar 陈明豪

bug修改67915

parent 637df8b7
...@@ -67,3 +67,11 @@ export function listOwner(query) { ...@@ -67,3 +67,11 @@ export function listOwner(query) {
params: query params: query
}) })
} }
// 获取服务器时间
export function getServerTime() {
return request({
url: '/business/statistics/getServerTime',
method: 'get'
})
}
...@@ -300,8 +300,8 @@ ...@@ -300,8 +300,8 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="left" prop="state" min-width="60px"> <el-table-column label="状态" align="left" prop="state" min-width="60px">
<template slot-scope="scope"> <template>
<span :style="showStatus(scope.row.authorizationExpirationDate) === '• 过期' ? 'color: #F8CA96' : 'color: #67C23A'">{{ showStatus(scope.row.authorizationExpirationDate) || '-' }}</span> <span style="color: #67C23A"> 有效</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="left" class-name="small-padding fixed-width" min-width="50"> <el-table-column label="操作" align="left" class-name="small-padding fixed-width" min-width="50">
...@@ -339,7 +339,7 @@ import ProgressColor from '@/views/data-statistics/other-components/progress-col ...@@ -339,7 +339,7 @@ import ProgressColor from '@/views/data-statistics/other-components/progress-col
import OverlongTool from '@/views/data-statistics/other-components/overlong-tool.vue' import OverlongTool from '@/views/data-statistics/other-components/overlong-tool.vue'
import ColumnarChart from '@/views/data-statistics/echars-components/columnarChart.vue' import ColumnarChart from '@/views/data-statistics/echars-components/columnarChart.vue'
import RadarChartForHospital from '@/views/data-statistics/echars-components/radar-chart-for-hospital.vue' import RadarChartForHospital from '@/views/data-statistics/echars-components/radar-chart-for-hospital.vue'
import { getHospitalStatistics, listHospital } from '@/api/business/statistics' import { getHospitalStatistics, getServerTime, listHospital } from '@/api/business/statistics'
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import EmptyTool from '@/views/data-statistics/other-components/emptyTool.vue' import EmptyTool from '@/views/data-statistics/other-components/emptyTool.vue'
import { moneyFormat } from '@/utils' import { moneyFormat } from '@/utils'
...@@ -393,12 +393,18 @@ export default { ...@@ -393,12 +393,18 @@ export default {
expiredState: '1', expiredState: '1',
orderByColumn: 'authorizationExpirationDate', orderByColumn: 'authorizationExpirationDate',
isAsc: 'ascending' isAsc: 'ascending'
} },
serverTime: undefined
} }
}, },
watch: {}, watch: {},
created() { created() {
this.loading = true this.loading = true
getServerTime().then(res => {
if (res) {
this.serverTime = res.data
}
})
this.getStatistics() this.getStatistics()
this.getHospitalList() this.getHospitalList()
// this.justTest() // this.justTest()
...@@ -475,8 +481,8 @@ export default { ...@@ -475,8 +481,8 @@ export default {
}, },
getHospitalExpireDays(date) { getHospitalExpireDays(date) {
const expirationDate = new Date(date) const expirationDate = new Date(date)
const now = new Date() const now = new Date(this.serverTime)
return (expirationDate - now) / (1 * 24 * 60 * 60 * 1000) return (expirationDate - now) / (24 * 60 * 60 * 1000)
}, },
/** 通过授权历史获取到期日期 */ /** 通过授权历史获取到期日期 */
addDays(date, str) { addDays(date, str) {
......
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