feat:天平调整

This commit is contained in:
houjunxiang
2026-01-16 21:11:48 +08:00
parent 6ecbf27b25
commit 3fdc27eb74
6 changed files with 115 additions and 36 deletions

View File

@@ -52,13 +52,11 @@
v-for="(sample, index) in sampleDataList"
:key="index"
class="u-tab-item"
:class="[
currentSampleIndex === index ? 'u-tab-item-active' : '',
]"
:class="[currentSampleIndex === index ? 'u-tab-item-active' : '']"
:data-current="index"
@tap.stop="switchSample(index, false)"
>
<!-- sample.rollbackStatus === 'in_progress' ? 'u-tab-item-disabled' : '' 退回disabled暂不显示 -->
<!-- sample.rollbackStatus === 'in_progress' ? 'u-tab-item-disabled' : '' 退回disabled暂不显示 -->
<u-badge type="warning" :value="index + 1"></u-badge>
<view class="ml20">
<view>
@@ -69,7 +67,7 @@
</view>
</scroll-view>
<u-button
v-if="taskIngredientsStatus === 'allow_submit'||taskIsIngredients == '0'"
v-if="taskIngredientsStatus === 'allow_submit' || taskIsIngredients == '0'"
class="btn-operation"
type="primary"
@click="submitTask()"
@@ -362,7 +360,7 @@ const customBack = () => {
}
const navRightClick = () => {
let url = `/pages/analysis/sample/sample-work-edit-task?currentTaskId=${ taskId.value}&configReportTemplateKey=${configReportTemplateKey.value}`
let url = `/pages/analysis/sample/sample-work-edit-task?currentTaskId=${taskId.value}&configReportTemplateKey=${configReportTemplateKey.value}`
uni.navigateTo({
url: url
})
@@ -770,10 +768,10 @@ function updateTableDataByConfigFields() {
if (!columnObj) continue
tab.tableData.forEach(row => {
// 赋值配置列参与计算
if(row[columnObj.fieldIndex]){
row[columnObj.fieldIndex].value = dynamicFormData[key]
calcRowAnalysisValue(row, columnObj, tab.columns)
}
if (row[columnObj.fieldIndex]) {
row[columnObj.fieldIndex].value = dynamicFormData[key]
calcRowAnalysisValue(row, columnObj, tab.columns)
}
})
}
}
@@ -788,7 +786,7 @@ function setValueToSample() {
nx.$test.object(currentSampleData.value[item.fieldIndex])
) {
currentSampleData.value[item.fieldIndex].value = item.value
currentSampleData.value[item.fieldIndex].symbol = item.symbol
currentSampleData.value[item.fieldIndex].symbol = item.symbol
}
})
}
@@ -931,7 +929,7 @@ async function getSampleAnalysisByTaskId() {
businessAssayTasNo,
formValue,
ingredientsStatus,
isIngredients
isIngredients
} = await nx.$api.assayTask.batchSampleAndQcAnalysisByTaskId(taskId.value)
title.value = '样品分析-任务单编号:' + businessAssayTasNo
taskIngredientsStatus.value = ingredientsStatus
@@ -965,8 +963,8 @@ function setValueToField() {
group.fields.forEach(field => {
let value = getFieldValue(field)
field.value = value
let symbol = getFieldSymbol(field)
field.symbol = symbol
let symbol = getFieldSymbol(field)
field.symbol = symbol
})
}
}
@@ -1050,6 +1048,7 @@ const listenDeviceData = () => {
switch (res.deviceType) {
case 'balance':
if (currentAuncel.value.id === res.deviceId) {
console.log('天平信息', res)
currentAuncel.value.weightData = res.weightData
currentAuncel.value.weightUnit = res.weightUnit
currentAuncel.value.weightStable = res.weightStable
@@ -1077,6 +1076,7 @@ const listenDeviceData = () => {
//控制设备状态
uni.$on('controlDevice', res => {
if (currentAuncel.value.id === res.deviceId) {
console.log('控制', res.deviceId)
currentAuncel.value.id = ''
currentAuncel.value.name = ''
currentAuncel.value.code = ''
@@ -1442,7 +1442,8 @@ onBackPress(() => {
.weight {
font-size: 42px;
width: 100%;
padding: 0 60px;
padding-right: 80px;
line-height: 1;
}
.weight-data {