feat:样品分析计算
This commit is contained in:
9
App.vue
9
App.vue
@@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { onLaunch, onShow, onError } from '@dcloudio/uni-app'
|
import { onLaunch, onShow, onError,onHide } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
import { NxInit } from './nx'
|
import { NxInit } from './nx'
|
||||||
import $store from '@/nx/store'
|
import $store from '@/nx/store'
|
||||||
@@ -29,7 +29,12 @@ onError(err => {
|
|||||||
console.log('AppOnError:', err)
|
console.log('AppOnError:', err)
|
||||||
})
|
})
|
||||||
|
|
||||||
onShow(() => {})
|
onShow(() => {
|
||||||
|
console.log('显示')
|
||||||
|
})
|
||||||
|
onHide(()=>{
|
||||||
|
console.log('隐藏了')
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
const isDev = process.env.NODE_ENV === 'development'
|
const isDev = process.env.NODE_ENV === 'development'
|
||||||
// 正式环境
|
// 正式环境
|
||||||
const BaseUrl = isDev ? 'http://172.17.19.29:48080/admin-api' : 'http://172.17.19.29:48080/admin-api'
|
const BaseUrl = isDev ? 'http://172.17.19.29:48080/admin-api' : 'http://172.17.19.29:48080/admin-api'
|
||||||
const upgradeBaseUrl = isDev? 'http://172.17.19.29:48080/admin-api':'http://172.17.19.29:48080/admin-api'
|
const upgradeBaseUrl = isDev ? 'http://172.17.19.29:48080/admin-api' : 'http://172.17.19.29:48080/admin-api'
|
||||||
const websocketUrl = isDev ? 'ws://172.17.19.11:30330' : 'ws://172.17.19.11:30330'
|
const websocketUrl = isDev ? 'ws://172.17.19.11:30330' : 'ws://172.17.19.11:30330'
|
||||||
|
|
||||||
// 公司测试环境
|
// 公司测试环境
|
||||||
|
|||||||
@@ -264,7 +264,16 @@ const rollbackAssayTask = data => {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 手动配料 post 参数与自动下发配料一致
|
||||||
|
const manualIngredients = data => {
|
||||||
|
return request({
|
||||||
|
url: '/qms/bus/sample/analysis/manualIngredients',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* 查询回收率配置*/
|
* 查询回收率配置*/
|
||||||
const queryConRecoveryRateList = param => {
|
const queryConRecoveryRateList = param => {
|
||||||
@@ -311,5 +320,6 @@ export default {
|
|||||||
rollbackAssayTask,
|
rollbackAssayTask,
|
||||||
submitTask,
|
submitTask,
|
||||||
taskIngredients,
|
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 { ref, computed } from 'vue'
|
||||||
import nx from '@/nx'
|
import nx from '@/nx'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
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'
|
import tools from '@/nx/utils/tools'
|
||||||
|
|
||||||
const pageLoading = ref(false)
|
const pageLoading = ref(false)
|
||||||
@@ -161,15 +161,14 @@ async function loadTaskDetail() {
|
|||||||
fieldKey: item.fieldKey,
|
fieldKey: item.fieldKey,
|
||||||
type: item.fieldType,
|
type: item.fieldType,
|
||||||
placeholder: '请输入',
|
placeholder: '请输入',
|
||||||
hidden:false
|
hidden: false
|
||||||
|
|
||||||
}
|
}
|
||||||
if (customConfig?.componentProps?.options) {
|
if (customConfig?.componentProps?.options) {
|
||||||
field.options = customConfig.componentProps.options
|
field.options = customConfig.componentProps.options
|
||||||
}
|
}
|
||||||
if(customConfig.hidden){
|
if (customConfig.hidden) {
|
||||||
field.hidden = true
|
field.hidden = true
|
||||||
}
|
}
|
||||||
return field
|
return field
|
||||||
})
|
})
|
||||||
formFields.value = [...staticFormSchema, ...dynamicFormSchema]
|
formFields.value = [...staticFormSchema, ...dynamicFormSchema]
|
||||||
@@ -208,7 +207,7 @@ async function updateTableDataByConfigFields() {
|
|||||||
const columnObj = tab.columns.find(c => {
|
const columnObj = tab.columns.find(c => {
|
||||||
if (c.formula) {
|
if (c.formula) {
|
||||||
let FromKey = c.formula.split(':')
|
let FromKey = c.formula.split(':')
|
||||||
return FromKey[1] === key
|
return FromKey[1] === key || FromKey[0] === 'GetFrom'
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
@@ -216,9 +215,21 @@ async function updateTableDataByConfigFields() {
|
|||||||
tab.tableData.forEach(row => {
|
tab.tableData.forEach(row => {
|
||||||
// 赋值配置列参与计算
|
// 赋值配置列参与计算
|
||||||
if (row[columnObj.fieldIndex]) {
|
if (row[columnObj.fieldIndex]) {
|
||||||
row[columnObj.fieldIndex].value = formData[key]
|
if (columnObj.formula.startsWith('From')) {
|
||||||
calcRowAnalysisValue(row, columnObj, tab.columns)
|
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,11 +331,14 @@ 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
|
||||||
const target = formula.split(':')[1]
|
for (const [key, value] of Object.entries(dynamicFormData.value)) {
|
||||||
const originalValue = dynamicFormData.value[target]
|
if (formula.includes(key)) {
|
||||||
const currentValue = realFormData.value[target]
|
const originalValue = value
|
||||||
if (!looseEqual(originalValue, currentValue)) {
|
const currentValue = realFormData.value[key]
|
||||||
return true
|
if (!looseEqual(originalValue, currentValue)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user