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 {

View File

@@ -160,11 +160,16 @@ async function loadTaskDetail() {
label: item.fieldName,
fieldKey: item.fieldKey,
type: item.fieldType,
placeholder: '请输入'
placeholder: '请输入',
hidden:false
}
if (customConfig?.componentProps?.options) {
field.options = customConfig.componentProps.options
}
if(customConfig.hidden){
field.hidden = true
}
return field
})
formFields.value = [...staticFormSchema, ...dynamicFormSchema]
@@ -282,7 +287,6 @@ async function handleSave(change) {
let params = {}
const dynamicData = Object.fromEntries(Object.entries(realFormData.value).filter(([key]) => key !== 'assayTime'))
console.log(dynamicData)
if (change) {
// 计算样品数据
updateTableDataByConfigFields()
@@ -367,7 +371,7 @@ function saveHeadData() {
* todo 关联字段在动态字段的change事件处理
* */
function pickerConfirm(event, field) {
if (field.type == 'date') {
if (field.type == 'Date') {
field.value = nx.$dayjs(event.value).valueOf()
field.showPicker = false
return