feat:样品分析计算
This commit is contained in:
9
App.vue
9
App.vue
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { onLaunch, onShow, onError } from '@dcloudio/uni-app'
|
||||
import { onLaunch, onShow, onError,onHide } from '@dcloudio/uni-app'
|
||||
|
||||
import { NxInit } from './nx'
|
||||
import $store from '@/nx/store'
|
||||
@@ -29,7 +29,12 @@ onError(err => {
|
||||
console.log('AppOnError:', err)
|
||||
})
|
||||
|
||||
onShow(() => {})
|
||||
onShow(() => {
|
||||
console.log('显示')
|
||||
})
|
||||
onHide(()=>{
|
||||
console.log('隐藏了')
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -264,7 +264,16 @@ const rollbackAssayTask = data => {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 手动配料 post 参数与自动下发配料一致
|
||||
const manualIngredients = data => {
|
||||
return request({
|
||||
url: '/qms/bus/sample/analysis/manualIngredients',
|
||||
method: 'POST',
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
/*
|
||||
* 查询回收率配置*/
|
||||
const queryConRecoveryRateList = param => {
|
||||
@@ -311,5 +320,6 @@ export default {
|
||||
rollbackAssayTask,
|
||||
submitTask,
|
||||
taskIngredients,
|
||||
queryQmsDicSampleProcessCodeList
|
||||
queryQmsDicSampleProcessCodeList,
|
||||
manualIngredients
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -82,7 +82,7 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import nx from '@/nx'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { calcRowAnalysisValue } from '@/nx/helper/calcAnalysisValue'
|
||||
import { calcRowAnalysisValue, evaluateGetFromFormula } from '@/nx/helper/calcAnalysisValue'
|
||||
import tools from '@/nx/utils/tools'
|
||||
|
||||
const pageLoading = ref(false)
|
||||
@@ -162,7 +162,6 @@ async function loadTaskDetail() {
|
||||
type: item.fieldType,
|
||||
placeholder: '请输入',
|
||||
hidden: false
|
||||
|
||||
}
|
||||
if (customConfig?.componentProps?.options) {
|
||||
field.options = customConfig.componentProps.options
|
||||
@@ -208,7 +207,7 @@ async function updateTableDataByConfigFields() {
|
||||
const columnObj = tab.columns.find(c => {
|
||||
if (c.formula) {
|
||||
let FromKey = c.formula.split(':')
|
||||
return FromKey[1] === key
|
||||
return FromKey[1] === key || FromKey[0] === 'GetFrom'
|
||||
}
|
||||
return false
|
||||
})
|
||||
@@ -216,9 +215,21 @@ async function updateTableDataByConfigFields() {
|
||||
tab.tableData.forEach(row => {
|
||||
// 赋值配置列参与计算
|
||||
if (row[columnObj.fieldIndex]) {
|
||||
row[columnObj.fieldIndex].value = formData[key]
|
||||
calcRowAnalysisValue(row, columnObj, tab.columns)
|
||||
if (columnObj.formula.startsWith('From')) {
|
||||
row[columnObj.fieldIndex].value = dynamicFormData[key]
|
||||
}
|
||||
if (columnObj.formula.startsWith('GetFrom')) {
|
||||
row[columnObj.fieldIndex].value = evaluateGetFromFormula(
|
||||
columnObj.formula,
|
||||
true,
|
||||
realFormData.value,
|
||||
columnObj,
|
||||
row,
|
||||
tab.columns
|
||||
)
|
||||
}
|
||||
}
|
||||
calcRowAnalysisValue(row, columnObj, tab.columns, realFormData.value)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -320,13 +331,16 @@ function checkPropertyEquality() {
|
||||
for (const column of allColumns) {
|
||||
const formula = column.formula
|
||||
if (!formula) continue
|
||||
const target = formula.split(':')[1]
|
||||
const originalValue = dynamicFormData.value[target]
|
||||
const currentValue = realFormData.value[target]
|
||||
for (const [key, value] of Object.entries(dynamicFormData.value)) {
|
||||
if (formula.includes(key)) {
|
||||
const originalValue = value
|
||||
const currentValue = realFormData.value[key]
|
||||
if (!looseEqual(originalValue, currentValue)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user