feat:设备使用记录
This commit is contained in:
@@ -99,8 +99,7 @@ function getPageData() {
|
||||
pageNo: 1,
|
||||
pageSize: 999,
|
||||
collectDeviceType: 'balance',
|
||||
deviceStatus: '0',
|
||||
isEnable: '1',
|
||||
deviceStatus: "{\"Enable\":\"1\"}",
|
||||
deployLocation: deployLocation.value === '全部' ? '' : deployLocation.value
|
||||
})
|
||||
.then(res => {
|
||||
|
||||
@@ -230,6 +230,7 @@ import request from '@/nx/request'
|
||||
import {
|
||||
calcAnalysisValue,
|
||||
handleRoundFiveNumber,
|
||||
handleEfficaciousNumber,
|
||||
calcRowAnalysisValue,
|
||||
evaluateGetFromFormula,
|
||||
math,
|
||||
@@ -655,6 +656,7 @@ const saveAuncelData = () => {
|
||||
}, 100)
|
||||
}
|
||||
let dynamicFormData = reactive({})
|
||||
|
||||
const saveDetail = async () => {
|
||||
//检查杯号
|
||||
if (!checkBh()) return
|
||||
@@ -677,7 +679,14 @@ const saveDetail = async () => {
|
||||
if (item.calcMethod === 'calculateAverageValue') {
|
||||
item.value = calcAverageValue(sourceKey, currentAssayType.value.tableData)
|
||||
} else {
|
||||
item.value = handleRoundFiveNumber(row[sourceKey].value, row.decimalPosition)
|
||||
const rowObj = row[selectedField.value.fieldIndex]
|
||||
const isProject = rowObj.type === 'project'
|
||||
const flagValue = handleRoundFiveNumber(row[sourceKey].value, row.decimalPosition)
|
||||
if (isProject) {
|
||||
item.value = handleEfficaciousNumber(flagValue, rowObj.decimalPosition, rowObj.effectiveDigit)
|
||||
} else {
|
||||
item.value = flagValue
|
||||
}
|
||||
}
|
||||
// 如果处理后的值不为空,重新赋值该字段到其他样品类型下的样品上,并触发每一个样品的计算
|
||||
for (const col of currentAssayType.value.columns) {
|
||||
@@ -710,9 +719,16 @@ const saveDetail = async () => {
|
||||
function calcAverageValue(fieldIndex, tableData) {
|
||||
const rows = tableData.map(row => row[fieldIndex])
|
||||
const decimalPosition = rows[0].decimalPosition
|
||||
const isProject = rows[0].type === 'project'
|
||||
const effectiveDigit = rows[0].effectiveDigit
|
||||
const values = rows.map(row => Number(row.value))
|
||||
if (values.some(item => item == null)) return null
|
||||
return handleRoundFiveNumber(math.mean(values), decimalPosition)
|
||||
const flagValue = handleRoundFiveNumber(math.mean(values), decimalPosition)
|
||||
if (isProject) {
|
||||
return handleEfficaciousNumber(flagValue, decimalPosition, effectiveDigit)
|
||||
} else {
|
||||
return flagValue
|
||||
}
|
||||
}
|
||||
|
||||
// 表格数据更新后重新计算
|
||||
@@ -1113,12 +1129,19 @@ const listenNumKeyboard = () => {
|
||||
}
|
||||
//自动补全小数位数
|
||||
const decimalPosition = selectedField.value.decimalPosition
|
||||
const isProject = selectedField.value.type === 'project'
|
||||
const effectiveDigit = currentSampleData.value[selectedField.value.fieldIndex]?.effectiveDigit || decimalPosition
|
||||
let val = res.val
|
||||
const symbol = res.symbol
|
||||
if (decimalPosition == null) {
|
||||
selectedField.value.value = val
|
||||
} else {
|
||||
selectedField.value.value = handleRoundFiveNumber(val, decimalPosition)
|
||||
const flagValue = handleRoundFiveNumber(val, decimalPosition)
|
||||
if (isProject) {
|
||||
selectedField.value.value = handleEfficaciousNumber(flagValue, decimalPosition, effectiveDigit)
|
||||
} else {
|
||||
selectedField.value.value = flagValue
|
||||
}
|
||||
}
|
||||
if (symbol) {
|
||||
selectedField.value.symbol = symbol
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user