Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e10c70e819 |
@@ -60,14 +60,17 @@ const Get_C_KNO3_bySValue = function (sValue, weight, operator) {
|
|||||||
|
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
const Get_C_KNO3 = function (sValue, weight, operator) {
|
const Get_C_KNO3 = function (weight, sValue, operator) {
|
||||||
//判断sValue是数字
|
//判断sValue是数字
|
||||||
|
const S = number(sValue)
|
||||||
|
const W = number(weight)
|
||||||
|
console.log(S, W)
|
||||||
|
|
||||||
if (sValue === 0 || weight === 0) {
|
//如果样重为0就不计算
|
||||||
|
if (W === 0) {
|
||||||
|
console.log('结束')
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
let S = number(sValue)
|
|
||||||
const W = number(weight)
|
|
||||||
if (W === 0) return ''
|
if (W === 0) return ''
|
||||||
const V = ((W * S) / 100) * 22 - 75
|
const V = ((W * S) / 100) * 22 - 75
|
||||||
if (operator === '<' && V < 0) {
|
if (operator === '<' && V < 0) {
|
||||||
|
|||||||
@@ -54,9 +54,8 @@
|
|||||||
class="u-tab-item"
|
class="u-tab-item"
|
||||||
:class="[currentSampleIndex === index ? 'u-tab-item-active' : '']"
|
:class="[currentSampleIndex === index ? 'u-tab-item-active' : '']"
|
||||||
:data-current="index"
|
:data-current="index"
|
||||||
@tap.stop="switchSample(index, false)"
|
@tap.stop="switchSample(index)"
|
||||||
>
|
>
|
||||||
<!-- sample.rollbackStatus === 'in_progress' ? 'u-tab-item-disabled' : '' 退回disabled暂不显示 -->
|
|
||||||
<u-badge type="warning" :value="index + 1"></u-badge>
|
<u-badge type="warning" :value="index + 1"></u-badge>
|
||||||
<view class="ml20">
|
<view class="ml20">
|
||||||
<view>
|
<view>
|
||||||
@@ -151,18 +150,6 @@
|
|||||||
<view class="pt10">
|
<view class="pt10">
|
||||||
<scroll-view class="content-right-scroll" scroll-y scroll-with-animation :scroll-top="scrollFieldTop">
|
<scroll-view class="content-right-scroll" scroll-y scroll-with-animation :scroll-top="scrollFieldTop">
|
||||||
<view>
|
<view>
|
||||||
<!-- <template v-for="(fields, groupIndex) in fieldGroup" :key="'group_' + groupIndex"> -->
|
|
||||||
<!-- <view> -->
|
|
||||||
<!-- 组名 -->
|
|
||||||
<!-- <view class="my-collapse" @click="fields.open = !fields.open">
|
|
||||||
<text class="title">{{ fields.title }}</text>
|
|
||||||
<u-icon :name="fields.open ? 'arrow-up' : 'arrow-down'"></u-icon>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
class="content"
|
|
||||||
:id="'elId' + groupIndex"
|
|
||||||
:style="{ height: fields.open ? collaHeights[groupIndex] + 'px' : '0' }"
|
|
||||||
> -->
|
|
||||||
<up-collapse ref="collapseRef" :value="activeCollapses" :border="false">
|
<up-collapse ref="collapseRef" :value="activeCollapses" :border="false">
|
||||||
<template v-for="(fields, groupIndex) in currentGroup">
|
<template v-for="(fields, groupIndex) in currentGroup">
|
||||||
<up-collapse-item v-if="fields.label !== '全部'">
|
<up-collapse-item v-if="fields.label !== '全部'">
|
||||||
@@ -185,32 +172,6 @@
|
|||||||
v-html="field.title"
|
v-html="field.title"
|
||||||
></view>
|
></view>
|
||||||
<view class="content-my">
|
<view class="content-my">
|
||||||
<!--
|
|
||||||
如果是select,渲染2个组件:1个input、1个picker.
|
|
||||||
field.valueText用于显示picker选中的文本
|
|
||||||
1,键盘输入,2、天平,3、自动计算,4、文本输入
|
|
||||||
-->
|
|
||||||
<!-- <u-input
|
|
||||||
border="bottom"
|
|
||||||
style="width: 120px"
|
|
||||||
v-if="field.fillingWay == 'input'"
|
|
||||||
v-model="field.value"
|
|
||||||
placeholder="请输入"
|
|
||||||
/> -->
|
|
||||||
|
|
||||||
<!-- <view v-if="field.type === 'select'" class="x-bc select-my" @click="field.showPicker = true">
|
|
||||||
<text v-if="field.valueText">{{ field.valueText }}</text>
|
|
||||||
<text v-else>请选择</text>
|
|
||||||
<u-icon name="arrow-down" size="20"></u-icon>
|
|
||||||
</view>
|
|
||||||
<u-picker
|
|
||||||
v-if="field.type === 'select'"
|
|
||||||
:show="field.showPicker"
|
|
||||||
:columns="[field.options]"
|
|
||||||
keyName="dictValue"
|
|
||||||
@cancel="field.showPicker = false"
|
|
||||||
@confirm="event => dicPickerConfirm(event, field)"
|
|
||||||
/> -->
|
|
||||||
<!--普通输入框 使用文本显示-->
|
<!--普通输入框 使用文本显示-->
|
||||||
<view class="content-my-text" v-if="field.dataType != 'select'">
|
<view class="content-my-text" v-if="field.dataType != 'select'">
|
||||||
<text v-if="!field.value" class="content-my-text-placeholder">{{
|
<text v-if="!field.value" class="content-my-text-placeholder">{{
|
||||||
@@ -239,9 +200,6 @@
|
|||||||
</up-collapse-item>
|
</up-collapse-item>
|
||||||
</template>
|
</template>
|
||||||
</up-collapse>
|
</up-collapse>
|
||||||
<!-- </view>
|
|
||||||
</view> -->
|
|
||||||
<!-- </template> -->
|
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<u-button class="btn-operation" type="success" @click="saveDetail()">保存样品数据</u-button>
|
<u-button class="btn-operation" type="success" @click="saveDetail()">保存样品数据</u-button>
|
||||||
@@ -467,7 +425,7 @@ const autoNextSample = indexParam => {
|
|||||||
|
|
||||||
if (sample.rollbackStatus !== 'in_progress') {
|
if (sample.rollbackStatus !== 'in_progress') {
|
||||||
// 找到了合法的样品,切换
|
// 找到了合法的样品,切换
|
||||||
switchSample(index, true)
|
switchSample(index)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
index++
|
index++
|
||||||
@@ -475,16 +433,7 @@ const autoNextSample = indexParam => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//手动切换样品
|
//手动切换样品
|
||||||
const switchSample = async (index, autoFlag) => {
|
const switchSample = async index => {
|
||||||
// if (!autoFlag) {
|
|
||||||
// const shouldContinue = await tools.showPromiseModal(
|
|
||||||
// '提示',
|
|
||||||
// `请确认样品【${currentSampleData.value.sampleCode}】数据已经保存,是否继续?`
|
|
||||||
// )
|
|
||||||
// if (!shouldContinue) {
|
|
||||||
// return // 用户点了取消,直接退出
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//重置天平归0
|
//重置天平归0
|
||||||
weightDataIsToZero.value = false
|
weightDataIsToZero.value = false
|
||||||
if (index === currentSampleIndex.value) return
|
if (index === currentSampleIndex.value) return
|
||||||
@@ -991,9 +940,18 @@ function setValueToField() {
|
|||||||
field.value = value
|
field.value = value
|
||||||
let symbol = getFieldSymbol(field)
|
let symbol = getFieldSymbol(field)
|
||||||
field.symbol = symbol
|
field.symbol = symbol
|
||||||
|
if (!getField(field)) {
|
||||||
|
field.hidden = 1
|
||||||
|
} else {
|
||||||
|
field.hidden = 0
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function getField(field) {
|
||||||
|
const fieldObj = currentSampleData.value[field.fieldIndex]
|
||||||
|
return fieldObj
|
||||||
|
}
|
||||||
function getFieldValue(field) {
|
function getFieldValue(field) {
|
||||||
const fieldValue = currentSampleData.value[field.fieldIndex]?.value
|
const fieldValue = currentSampleData.value[field.fieldIndex]?.value
|
||||||
if (fieldValue) {
|
if (fieldValue) {
|
||||||
|
|||||||
@@ -331,10 +331,10 @@ function checkPropertyEquality() {
|
|||||||
for (const column of allColumns) {
|
for (const column of allColumns) {
|
||||||
const formula = column.formula
|
const formula = column.formula
|
||||||
if (!formula) continue
|
if (!formula) continue
|
||||||
for (const [key, value] of Object.entries(dynamicFormData.value)) {
|
for (const [key, value] of Object.entries(realFormData.value)) {
|
||||||
if (formula.includes(key)) {
|
if (formula.includes(key)) {
|
||||||
const originalValue = value
|
const currentValue = value
|
||||||
const currentValue = realFormData.value[key]
|
const originalValue = dynamicFormData.value[key]
|
||||||
if (!looseEqual(originalValue, currentValue)) {
|
if (!looseEqual(originalValue, currentValue)) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user