代码更新

This commit is contained in:
2022-09-14 10:53:22 +08:00
parent fafff4b0e4
commit 66ec2c6905
10 changed files with 75 additions and 105 deletions

View File

@@ -248,37 +248,8 @@ export default {
}
},
tableRowClassName({ row, rowIndex }) {
// 将每行的检验有效期时间格式化
const vDate = row.beginuse_date
const vDateStr = vDate.replace(/-/g, '')
// 获取当前时间并格式化
var myDate = new Date()
// 以下操作是为了补时间缺的0
const month = myDate.getMonth() + 1
const date = myDate.getDate()
const stryear = myDate.getFullYear().toString()
const strmonth = (myDate.getMonth() + 1).toString()
const strdate = myDate.getDate().toString()
var c
var x
var b
b = stryear
if (month < 10) {
c = ('0' + strmonth)
} else {
c = strmonth
}
if (date < 10) {
x = ('0' + strdate)
} else {
x = strdate
}
const vnowDate = b + c + x
// 将字符串转换成int类型进行相减
const a = parseInt(vDateStr) - parseInt(vnowDate)
// 进行比较符合条件表格就变化颜色
const stylejson = {}
if (a < 15) {
if (row.is_red !== undefined) {
stylejson.background = '#e0838f'
stylejson.color = 'green'
return stylejson

View File

@@ -217,37 +217,8 @@ export default {
return true
},
tableRowClassName({ row, rowIndex }) {
// 将每行的检验有效期时间格式化
const vDate = row.next_docimasy_date
const vDateStr = vDate.replace(/-/g, '')
// 获取当前时间并格式化
var myDate = new Date()
// 以下操作是为了补时间缺的0
const month = myDate.getMonth() + 1
const date = myDate.getDate()
const stryear = myDate.getFullYear().toString()
const strmonth = (myDate.getMonth() + 1).toString()
const strdate = myDate.getDate().toString()
var c
var x
var b
b = stryear
if (month < 10) {
c = ('0' + strmonth)
} else {
c = strmonth
}
if (date < 10) {
x = ('0' + strdate)
} else {
x = strdate
}
const vnowDate = b + c + x
// 将字符串转换成int类型进行相减
const a = parseInt(vDateStr) - parseInt(vnowDate)
// 进行比较符合条件表格就变化颜色
const stylejson = {}
if (a < 15) {
if (row.is_red !== undefined) {
stylejson.background = '#e0838f'
stylejson.color = 'green'
return stylejson

View File

@@ -216,38 +216,8 @@ export default {
return true
},
tableRowClassName({ row, rowIndex }) {
// 将每行的检验有效期时间格式化
const vDate = row.valid_term
const vDateStr = vDate.replace(/-/g, '')
// 获取当前时间并格式化
var myDate = new Date()
// 以下操作是为了补时间缺的0
const month = myDate.getMonth() + 1
const date = myDate.getDate()
const stryear = myDate.getFullYear().toString()
const strmonth = (myDate.getMonth() + 1).toString()
const strdate = myDate.getDate().toString()
var c
var x
var b
b = stryear
if (month < 10) {
c = ('0' + strmonth)
} else {
c = strmonth
}
if (date < 10) {
x = ('0' + strdate)
} else {
x = strdate
}
const vnowDate = b + c + x
// 将字符串转换成int类型进行相减
const a = parseInt(vDateStr) - parseInt(vnowDate)
debugger
// 进行比较符合条件表格就变化颜色
const stylejson = {}
if (a < 30) {
if (row.is_red !== undefined) {
stylejson.background = '#e0838f'
stylejson.color = 'green'
return stylejson