feat:样品库管理
This commit is contained in:
@@ -84,13 +84,25 @@
|
||||
>
|
||||
</u-col>
|
||||
<u-col span="6">
|
||||
<view class="field-name" v-html="selectedField.title" />
|
||||
<view class="x-bc">
|
||||
<view class="field-name" v-html="selectedField.title" />
|
||||
<u-button
|
||||
v-if="fillingWay.length > 1"
|
||||
type="primary"
|
||||
shape="circle"
|
||||
plain
|
||||
size="small"
|
||||
style="width: 15%"
|
||||
:text="`切换${currentFillingWay == 'collect' ? '录入' : '采集'}`"
|
||||
@click="switchFillingWay"
|
||||
></u-button>
|
||||
</view>
|
||||
<zzjc-num-keyboard
|
||||
ref="myKeyboard"
|
||||
v-show="selectedField.fillingWay == 'keyboard' && selectedField.type != 'select'"
|
||||
v-show="currentFillingWay == 'keyboard'"
|
||||
:numKeyboardParam="numKeyboardParam"
|
||||
></zzjc-num-keyboard>
|
||||
<view v-if="selectedField.fillingWay == 'collect'" class="y-f">
|
||||
<view v-if="currentFillingWay == 'collect'" class="y-f">
|
||||
<view class="auncel" @click="selectAuncel">
|
||||
<view class="code">{{ currentAuncel.code }}</view>
|
||||
<view class="auncel-title"> 杯号:{{ currentCupNum }} </view>
|
||||
@@ -123,7 +135,7 @@
|
||||
确认采集
|
||||
</u-button>
|
||||
</view>
|
||||
<view v-if="selectedField.fillingWay === 'input'" class="p8">
|
||||
<view v-if="currentFillingWay === 'input'" class="p8">
|
||||
<up-textarea v-model="inputValue" placeholder="请输入内容"></up-textarea>
|
||||
<view class="x-c mt20 pl100 pr100">
|
||||
<up-button @click="handleResetInputValue" style="width: 30%" :plain="true" text="清空"></up-button>
|
||||
@@ -354,7 +366,7 @@ const parameterClassifyChange = v => {
|
||||
|
||||
const fieldClick = (field, key) => {
|
||||
if (!field.isEdit) return
|
||||
if (field.fillingWay === 'input') {
|
||||
if (currentFillingWay.value === 'input') {
|
||||
inputValue.value = field.value
|
||||
}
|
||||
selectedField.value = field
|
||||
@@ -366,13 +378,26 @@ const fieldClick = (field, key) => {
|
||||
let decimalPosition = field.decimalPosition
|
||||
if (decimalPosition == null || decimalPosition < -1) decimalPosition = -1
|
||||
numKeyboardParam.decimal = decimalPosition
|
||||
if (field.fillingWay == 'collect') {
|
||||
if (currentFillingWay.value == 'collect') {
|
||||
listenDeviceData()
|
||||
} else {
|
||||
closeDeviceListener()
|
||||
}
|
||||
}
|
||||
|
||||
const currentFillingIndex = ref(0)
|
||||
const fillingWay = computed(() => {
|
||||
if (selectedField.value.fillingWay) {
|
||||
return selectedField.value.fillingWay.split(',')
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
})
|
||||
const currentFillingWay = computed(() => {
|
||||
return fillingWay.value[currentFillingIndex.value] || ''
|
||||
})
|
||||
const switchFillingWay = () => {
|
||||
currentFillingIndex.value = (currentFillingIndex.value + 1) % fillingWay.value.length
|
||||
}
|
||||
//自动切换到下一个字段
|
||||
const autoNextField = () => {
|
||||
let groupIndex = 0
|
||||
@@ -1053,9 +1078,13 @@ const listenNumKeyboard = () => {
|
||||
return
|
||||
}
|
||||
//自动补全小数位数
|
||||
const decimalPosition = selectedField.value.decimalPosition || 0
|
||||
const decimalPosition = selectedField.value.decimalPosition
|
||||
let val = res.val
|
||||
selectedField.value.value = handleRoundFiveNumber(val, decimalPosition)
|
||||
if (decimalPosition == null) {
|
||||
selectedField.value.value = val
|
||||
} else {
|
||||
selectedField.value.value = handleRoundFiveNumber(val, decimalPosition)
|
||||
}
|
||||
calcAnalysisValue(fieldGroup.value)
|
||||
//自动跳转下一个字段
|
||||
setTimeout(() => {
|
||||
@@ -1098,7 +1127,8 @@ const releaseDeviceControl = deviceId => {
|
||||
data: {
|
||||
deviceId: deviceId,
|
||||
isControl: false,
|
||||
controlRealName: userInfo.value.nickname
|
||||
controlRealName: userInfo.value.nickname,
|
||||
controlUserId: userInfo.value.id
|
||||
}
|
||||
}
|
||||
//发送控制数据
|
||||
@@ -1304,8 +1334,8 @@ onBackPress(() => {
|
||||
position: relative;
|
||||
.code {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 50px;
|
||||
top: 15px;
|
||||
left: 55px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1375,6 +1405,7 @@ onBackPress(() => {
|
||||
.field-name {
|
||||
font-size: 26px;
|
||||
padding: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.my-collapse {
|
||||
@@ -1401,6 +1432,7 @@ onBackPress(() => {
|
||||
}
|
||||
.field-name {
|
||||
font-size: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user