+ 进样时间改进输入框,使提示文字始终可见
+ 操作规程新增 L389-101 + 删除标水页面和设置页面
This commit is contained in:
@@ -44,7 +44,6 @@
|
||||
color: red;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script src="../statics/modules/jquery.min.js"></script>
|
||||
<script>
|
||||
@@ -60,8 +59,8 @@
|
||||
}
|
||||
]
|
||||
|
||||
let info = {}
|
||||
$(() => {
|
||||
let info = {}
|
||||
let count = databases.length
|
||||
let interval = setInterval(() => {
|
||||
if (count == 0) {
|
||||
@@ -94,92 +93,92 @@
|
||||
searchDevice(keyword)
|
||||
searchStandard(keyword)
|
||||
})
|
||||
})
|
||||
|
||||
function searchDevice(keyword) {
|
||||
let device = info.device.filter((value) => {
|
||||
return value.id.toLowerCase().includes(keyword)
|
||||
})
|
||||
if (device.length > 0) {
|
||||
let table_device = createDeviceTable(device)
|
||||
$("#content").append(table_device)
|
||||
}
|
||||
function searchDevice(keyword) {
|
||||
let device = info.device.filter((value) => {
|
||||
return value.id.toLowerCase().includes(keyword)
|
||||
})
|
||||
if (device.length > 0) {
|
||||
let table_device = createDeviceTable(device)
|
||||
$("#content").append(table_device)
|
||||
}
|
||||
}
|
||||
|
||||
function searchStandard(keyword) {
|
||||
let standard = info.standard.filter((value) => {
|
||||
return value.batch.toLowerCase().includes(keyword)
|
||||
})
|
||||
if (standard.length > 0) {
|
||||
let table_standard = createStandardTable(standard)
|
||||
$("#content").append(table_standard)
|
||||
}
|
||||
function searchStandard(keyword) {
|
||||
let standard = info.standard.filter((value) => {
|
||||
return value.batch.toLowerCase().includes(keyword)
|
||||
})
|
||||
if (standard.length > 0) {
|
||||
let table_standard = createStandardTable(standard)
|
||||
$("#content").append(table_standard)
|
||||
}
|
||||
}
|
||||
|
||||
function createDeviceTable(data) {
|
||||
return createTable(data, `设备信息(${data.length}条)`, ["名称", "编号", "有效期至"], hidden = ["where"])
|
||||
function createDeviceTable(data) {
|
||||
return createTable(data, `设备信息(${data.length}条)`, ["名称", "编号", "有效期至"], ["where"])
|
||||
}
|
||||
|
||||
function createStandardTable(data) {
|
||||
return createTable(data, `对照品信息(${data.length}条)`, ["批号", "有效期至", "含量丨纯度"], ["kind"])
|
||||
}
|
||||
|
||||
function createTable(data, captionText, header, hidden = []) {
|
||||
let table = document.createElement("table")
|
||||
table.setAttribute("class", "pure-table")
|
||||
|
||||
let caption = document.createElement("caption")
|
||||
caption.innerText = captionText
|
||||
table.appendChild(caption)
|
||||
|
||||
let tr = document.createElement("tr")
|
||||
for (const headerText of header) {
|
||||
let th = document.createElement("th")
|
||||
th.innerText = headerText
|
||||
tr.appendChild(th)
|
||||
}
|
||||
table.appendChild(tr)
|
||||
|
||||
function createStandardTable(data) {
|
||||
return createTable(data, `对照品信息(${data.length}条)`, ["批号", "有效期至", "含量丨纯度"], hidden = ["kind"])
|
||||
}
|
||||
|
||||
function createTable(data, captionText, header, hidden = []) {
|
||||
let table = document.createElement("table")
|
||||
table.setAttribute("class", "pure-table")
|
||||
|
||||
let caption = document.createElement("caption")
|
||||
caption.innerText = captionText
|
||||
table.appendChild(caption)
|
||||
|
||||
data.forEach(element => {
|
||||
let tr = document.createElement("tr")
|
||||
for (const headerText of header) {
|
||||
let th = document.createElement("th")
|
||||
th.innerText = headerText
|
||||
tr.appendChild(th)
|
||||
for (const key in element) {
|
||||
if (Object.hasOwnProperty.call(element, key)) {
|
||||
if (hidden.includes(key)) {
|
||||
continue
|
||||
}
|
||||
const value = element[key]
|
||||
let td = document.createElement("td")
|
||||
td.innerHTML = (key == "expir") ? checkExpir(value) : value
|
||||
tr.appendChild(td)
|
||||
}
|
||||
}
|
||||
table.appendChild(tr)
|
||||
})
|
||||
|
||||
data.forEach(element => {
|
||||
let tr = document.createElement("tr")
|
||||
for (const key in element) {
|
||||
if (Object.hasOwnProperty.call(element, key)) {
|
||||
if (hidden.includes(key)) {
|
||||
continue
|
||||
}
|
||||
const value = element[key]
|
||||
let td = document.createElement("td")
|
||||
td.innerHTML = (key == "expir") ? checkExpir(value) : value
|
||||
tr.appendChild(td)
|
||||
}
|
||||
}
|
||||
table.appendChild(tr)
|
||||
})
|
||||
return table
|
||||
}
|
||||
|
||||
return table
|
||||
function checkExpir(value) {
|
||||
let date = new Date()
|
||||
let array = value.split(".")
|
||||
date.setFullYear(array[0], array[1] - 1, array[2])
|
||||
|
||||
let day = (date - Date.now()) / 86400000
|
||||
|
||||
if (day <= 0) {
|
||||
return `<span class='expired'>${value}</span>`
|
||||
}
|
||||
|
||||
function checkExpir(value) {
|
||||
let date = new Date()
|
||||
let array = value.split(".")
|
||||
date.setFullYear(array[0], array[1] - 1, array[2])
|
||||
|
||||
let day = (date - Date.now()) / 86400000
|
||||
|
||||
if (day <= 0) {
|
||||
return `<span class='expired'>${value}</span>`
|
||||
}
|
||||
|
||||
if (day <= 7) {
|
||||
return `<span class='expir7'>${value}</span>`
|
||||
}
|
||||
|
||||
if (day <= 30) {
|
||||
return `<span class='expir30'>${value}</span>`
|
||||
}
|
||||
|
||||
return value
|
||||
if (day <= 7) {
|
||||
return `<span class='expir7'>${value}</span>`
|
||||
}
|
||||
})
|
||||
|
||||
if (day <= 30) {
|
||||
return `<span class='expir30'>${value}</span>`
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user