feat:分析管理
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<view class="s-verify-wrapper" @tap.stop>
|
<view class="s-verify-wrapper" @tap.stop>
|
||||||
<view class="s-verify-header">
|
<view class="s-verify-header">
|
||||||
<text class="s-verify-title">安全验证</text>
|
<text class="s-verify-title">安全验证</text>
|
||||||
<view class="s-verify-close" @tap="handleClose">×</view>
|
<!-- <view class="s-verify-close" @tap="handleClose">×</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="s-verify-body">
|
<view class="s-verify-body">
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
// 在此不用配置接口前缀
|
// 在此不用配置接口前缀
|
||||||
const isDev = process.env.NODE_ENV === 'development'
|
const isDev = process.env.NODE_ENV === 'development'
|
||||||
const BaseUrl = isDev ? 'http://192.168.26.190:48080/admin-api' : 'http://172.33.199.28:8088/api'
|
const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||||
|
// const BaseUrl = isDev ? 'http://192.168.26.190:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||||
|
|
||||||
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
||||||
const upgradeBaseUrl = 'http://172.33.199.28:8088'
|
const upgradeBaseUrl = 'http://192.168.26.116:888'
|
||||||
|
|
||||||
const tenantId = '1'
|
const tenantId = '1'
|
||||||
export const clientId = 'lsky_lims'
|
export const clientId = 'lsky_lims'
|
||||||
@@ -31,5 +32,5 @@ export function getUpgradeBaseUrl() {
|
|||||||
}
|
}
|
||||||
export function getWebSocketUrl() {
|
export function getWebSocketUrl() {
|
||||||
// return uni.getStorageSync('base_url').replace('/api', '') + '/ws'
|
// return uni.getStorageSync('base_url').replace('/api', '') + '/ws'
|
||||||
return 'ws://192.168.26.190:8330'
|
return 'ws://192.168.26.116:888/ws'
|
||||||
}
|
}
|
||||||
|
|||||||
224
manifest.json
224
manifest.json
@@ -1,31 +1,31 @@
|
|||||||
{
|
{
|
||||||
"name": "凉山矿业设备管理系统",
|
"name" : "实验室管理系统",
|
||||||
"appid": "__UNI__460BC4C",
|
"appid" : "__UNI__4B3B4B0",
|
||||||
"description": "凉山矿业设备管理系统",
|
"description" : "实验室管理系统",
|
||||||
"versionName": "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode": "100",
|
"versionCode" : "100",
|
||||||
"transformPx": false,
|
"transformPx" : false,
|
||||||
"app-plus": {
|
"app-plus" : {
|
||||||
"usingComponents": true,
|
"usingComponents" : true,
|
||||||
"nvueCompiler": "uni-app",
|
"nvueCompiler" : "uni-app",
|
||||||
"compilerVersion": 3,
|
"compilerVersion" : 3,
|
||||||
"splashscreen": {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender": true,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting": true,
|
"waiting" : true,
|
||||||
"autoclose": true,
|
"autoclose" : true,
|
||||||
"delay": 0
|
"delay" : 0
|
||||||
},
|
},
|
||||||
"modules": {
|
"modules" : {
|
||||||
"LivePusher": {},
|
"LivePusher" : {},
|
||||||
"Camera": {}
|
"Camera" : {}
|
||||||
},
|
},
|
||||||
"distribute": {
|
"distribute" : {
|
||||||
"android": {
|
"android" : {
|
||||||
"packagename": "tech.zzjc.mas.lskylims",
|
"packagename" : "tech.zzjc.mas.zgtylims",
|
||||||
"keystore": "zzjc_android.jks",
|
"keystore" : "zzjc_android.jks",
|
||||||
"password": "zzjc@20190226",
|
"password" : "zzjc@20190226",
|
||||||
"aliasname": "app",
|
"aliasname" : "app",
|
||||||
"permissions": [
|
"permissions" : [
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
|
||||||
@@ -50,134 +50,134 @@
|
|||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ios": {
|
"ios" : {
|
||||||
"dSYMs": false
|
"dSYMs" : false
|
||||||
},
|
},
|
||||||
"sdkConfigs": {},
|
"sdkConfigs" : {},
|
||||||
"icons": {
|
"icons" : {
|
||||||
"android": {
|
"android" : {
|
||||||
"hdpi": "unpackage/res/icons/72x72.png",
|
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||||
},
|
},
|
||||||
"ios": {
|
"ios" : {
|
||||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||||
"ipad": {
|
"ipad" : {
|
||||||
"app": "unpackage/res/icons/76x76.png",
|
"app" : "unpackage/res/icons/76x76.png",
|
||||||
"app@2x": "unpackage/res/icons/152x152.png",
|
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||||
"notification": "unpackage/res/icons/20x20.png",
|
"notification" : "unpackage/res/icons/20x20.png",
|
||||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||||
"settings": "unpackage/res/icons/29x29.png",
|
"settings" : "unpackage/res/icons/29x29.png",
|
||||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
"spotlight": "unpackage/res/icons/40x40.png",
|
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||||
},
|
},
|
||||||
"iphone": {
|
"iphone" : {
|
||||||
"app@2x": "unpackage/res/icons/120x120.png",
|
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||||
"app@3x": "unpackage/res/icons/180x180.png",
|
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 可选,JSON对象,应用UserAgent相关配置 **/
|
/* 可选,JSON对象,应用UserAgent相关配置 **/
|
||||||
"useragent": {
|
"useragent" : {
|
||||||
/* 可选,字符串类型,设置的默认userAgent值 */
|
/* 可选,字符串类型,设置的默认userAgent值 */
|
||||||
"value": "LIMS-PDA/1.0.8",
|
"value" : "LIMS-PDA/1.0.0",
|
||||||
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
||||||
"concatenate": true
|
"concatenate" : true
|
||||||
},
|
},
|
||||||
/* 可选,JSON对象,Android平台应用UserAgent相关配置,优先级高于useragent配置 */
|
/* 可选,JSON对象,Android平台应用UserAgent相关配置,优先级高于useragent配置 */
|
||||||
"useragent_android": {
|
"useragent_android" : {
|
||||||
/* 可选,字符串类型,设置的默认userAgent值 */
|
/* 可选,字符串类型,设置的默认userAgent值 */
|
||||||
"value": "LIMS-PDA/1.0.8",
|
"value" : "LIMS-PDA/1.0.0",
|
||||||
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
||||||
"concatenate": true
|
"concatenate" : true
|
||||||
},
|
},
|
||||||
/* 可选,JSON对象,iOS平台应用UserAgent相关配置,优先级高于useragent配置 */
|
/* 可选,JSON对象,iOS平台应用UserAgent相关配置,优先级高于useragent配置 */
|
||||||
"useragent_ios": {
|
"useragent_ios" : {
|
||||||
/* 可选,字符串类型,设置的默认userAgent值 */
|
/* 可选,字符串类型,设置的默认userAgent值 */
|
||||||
"value": "LIMS-PDA/1.0.8",
|
"value" : "LIMS-PDA/1.0.0",
|
||||||
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
/* 可选,Boolean类型,是否将value值作为追加值连接到系统默认userAgent值之后 */
|
||||||
"concatenate": true
|
"concatenate" : true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"quickapp": {},
|
"quickapp" : {},
|
||||||
"mp-weixin": {
|
"mp-weixin" : {
|
||||||
"appid": "",
|
"appid" : "",
|
||||||
"setting": {
|
"setting" : {
|
||||||
"urlCheck": false,
|
"urlCheck" : false,
|
||||||
"minified": false
|
"minified" : false
|
||||||
},
|
},
|
||||||
"optimization": {
|
"optimization" : {
|
||||||
"subPackages": true
|
"subPackages" : true
|
||||||
},
|
},
|
||||||
"usingComponents": true,
|
"usingComponents" : true,
|
||||||
"mergeVirtualHostAttributes": true
|
"mergeVirtualHostAttributes" : true
|
||||||
},
|
},
|
||||||
"mp-alipay": {
|
"mp-alipay" : {
|
||||||
"usingComponents": true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"mp-baidu": {
|
"mp-baidu" : {
|
||||||
"usingComponents": true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"mp-toutiao": {
|
"mp-toutiao" : {
|
||||||
"usingComponents": true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"uniStatistics": {
|
"uniStatistics" : {
|
||||||
"enable": false
|
"enable" : false
|
||||||
},
|
},
|
||||||
"vueVersion": "3",
|
"vueVersion" : "3",
|
||||||
"h5": {
|
"h5" : {
|
||||||
"devServer": {
|
"devServer" : {
|
||||||
"port": 33888,
|
"port" : 33888,
|
||||||
"https": false,
|
"https" : false,
|
||||||
"proxy": {
|
"proxy" : {
|
||||||
"/api": {
|
"/api" : {
|
||||||
// "target" : "http://mas.new.will-way.cn/api/",
|
// "target" : "http://mas.new.will-way.cn/api/",
|
||||||
//"target" : "http://192.168.31.180:9090/",
|
//"target" : "http://192.168.31.180:9090/",
|
||||||
"target": "http://127.0.0.1:9999/",
|
"target" : "http://127.0.0.1:9999/",
|
||||||
"changeOrigin": true,
|
"changeOrigin" : true,
|
||||||
"ws": true,
|
"ws" : true,
|
||||||
"pathRewrite": {
|
"pathRewrite" : {
|
||||||
"^/api": ""
|
"^/api" : ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/sys": {
|
"/sys" : {
|
||||||
// "target" : "http://mas.new.will-way.cn/api/",
|
// "target" : "http://mas.new.will-way.cn/api/",
|
||||||
//"target" : "http://192.168.31.180:9090/",
|
//"target" : "http://192.168.31.180:9090/",
|
||||||
"target": "http://127.0.0.1:9999/sys",
|
"target" : "http://127.0.0.1:9999/sys",
|
||||||
"changeOrigin": true,
|
"changeOrigin" : true,
|
||||||
"ws": true,
|
"ws" : true,
|
||||||
"pathRewrite": {
|
"pathRewrite" : {
|
||||||
"^/api": ""
|
"^/api" : ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/report": {
|
"/report" : {
|
||||||
"target": "http://127.0.0.1:9999/report/",
|
"target" : "http://127.0.0.1:9999/report/",
|
||||||
"changeOrigin": true,
|
"changeOrigin" : true,
|
||||||
"ws": true,
|
"ws" : true,
|
||||||
"pathRewrite": {
|
"pathRewrite" : {
|
||||||
"^/api": ""
|
"^/api" : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"optimization": {
|
"optimization" : {
|
||||||
"treeShaking": {
|
"treeShaking" : {
|
||||||
"enable": true
|
"enable" : true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"router": {
|
"router" : {
|
||||||
"base": "./"
|
"base" : "./"
|
||||||
},
|
},
|
||||||
"template": "template.h5.html"
|
"template" : "template.h5.html"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,12 +46,11 @@ export function calcAnalysisValue(group) {
|
|||||||
if (formulaVal.startsWith('Get')) {
|
if (formulaVal.startsWith('Get')) {
|
||||||
//计算公式为Get开头的,都是执行方法
|
//计算公式为Get开头的,都是执行方法
|
||||||
v = eval(formulaVal)
|
v = eval(formulaVal)
|
||||||
} else if (formulaVal.startsWith('From')) {
|
|
||||||
} else {
|
} else {
|
||||||
v = math.evaluate(formulaVal).toString()
|
v = math.evaluate(formulaVal).toString()
|
||||||
v = isFinite(v) ? v.toString() : ''
|
v = isFinite(v) ? v.toString() : ''
|
||||||
}
|
}
|
||||||
ele.value = handleRoundFiveNumber(v, ele.dataType)
|
ele.value = handleRoundFiveNumber(v, ele.decimalPosition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -86,7 +85,6 @@ export function calcRowAnalysisValue(row, columnObj, dynamicsColumns) {
|
|||||||
if (formulaVal.startsWith('Get')) {
|
if (formulaVal.startsWith('Get')) {
|
||||||
formulaVal = formulaVal.replace(')', ",'" + row.conBaseSampleId + "')")
|
formulaVal = formulaVal.replace(')', ",'" + row.conBaseSampleId + "')")
|
||||||
v = eval(formulaVal)
|
v = eval(formulaVal)
|
||||||
} else if (formulaVal.startsWith('From')) {
|
|
||||||
} else {
|
} else {
|
||||||
v = math.evaluate(formulaVal).toString()
|
v = math.evaluate(formulaVal).toString()
|
||||||
v = isFinite(v) ? v : 0
|
v = isFinite(v) ? v : 0
|
||||||
@@ -330,10 +328,14 @@ function accAdd(arg1, arg2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 通过配置项分组
|
// 通过配置项分组
|
||||||
export function groupByField(list, groupKey = 'groupDictionaryBusinessKey') {
|
export function groupByField(list, cupNumFieldIndex, groupKey = 'groupDictionaryBusinessKey') {
|
||||||
const groupMap = new Map()
|
const groupMap = new Map()
|
||||||
list.unshift({ groupDictionaryBusinessKey: 'all', groupDictionaryBusinessName: '全部' })
|
list.unshift({ groupDictionaryBusinessKey: 'all', groupDictionaryBusinessName: '全部' })
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
|
// 赋值杯号fieldindex
|
||||||
|
if (item.title === '杯号') {
|
||||||
|
cupNumFieldIndex.value = item.fieldIndex
|
||||||
|
}
|
||||||
const key = item[groupKey]
|
const key = item[groupKey]
|
||||||
if (!key) continue // 跳过没有 group 的项(可选)
|
if (!key) continue // 跳过没有 group 的项(可选)
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ function handleDeviceData(res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleDeviceStatus(res) {
|
function handleDeviceStatus(res) {
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
if (res.deviceType === 'balance') {
|
if (res.deviceType === 'balance') {
|
||||||
auncelList.value.forEach(item => {
|
auncelList.value.forEach(item => {
|
||||||
if (item.id === res.deviceId) {
|
if (item.id === res.deviceId) {
|
||||||
|
|||||||
@@ -75,7 +75,8 @@
|
|||||||
></zzjc-num-keyboard>
|
></zzjc-num-keyboard>
|
||||||
<view v-if="selectedField.fillingWay == 'collect'" class="y-f">
|
<view v-if="selectedField.fillingWay == 'collect'" class="y-f">
|
||||||
<view class="auncel" @click="selectAuncel">
|
<view class="auncel" @click="selectAuncel">
|
||||||
<view class="auncel-title"> {{ currentAuncel.code }}</view>
|
<view class="code">{{ currentAuncel.code }}</view>
|
||||||
|
<view class="auncel-title"> 杯号:{{ currentCupNum }} </view>
|
||||||
<view class="auncel-weight">
|
<view class="auncel-weight">
|
||||||
<view class="weight">
|
<view class="weight">
|
||||||
<view
|
<view
|
||||||
@@ -379,26 +380,23 @@ const autoNextField = () => {
|
|||||||
const autoNextSample = () => {
|
const autoNextSample = () => {
|
||||||
if (sampleDataList.value.length <= currentSampleIndex.value + 1) return
|
if (sampleDataList.value.length <= currentSampleIndex.value + 1) return
|
||||||
const index = currentSampleIndex.value + 1
|
const index = currentSampleIndex.value + 1
|
||||||
groupFieldIndex.value = ''
|
|
||||||
selectedField.value = {}
|
|
||||||
switchSample(index, true)
|
switchSample(index, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//手动切换样品
|
//手动切换样品
|
||||||
const switchSample = async (index, autoFlag) => {
|
const switchSample = async (index, autoFlag) => {
|
||||||
if (!autoFlag) {
|
// if (!autoFlag) {
|
||||||
const shouldContinue = await tools.showPromiseModal(
|
// const shouldContinue = await tools.showPromiseModal(
|
||||||
'提示',
|
// '提示',
|
||||||
`请确认样品【${currentSampleData.value.sampleCode}】数据已经保存,是否继续?`
|
// `请确认样品【${currentSampleData.value.sampleCode}】数据已经保存,是否继续?`
|
||||||
)
|
// )
|
||||||
if (!shouldContinue) {
|
// if (!shouldContinue) {
|
||||||
return // 用户点了取消,直接退出
|
// return // 用户点了取消,直接退出
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
//重置天平归0
|
//重置天平归0
|
||||||
weightDataIsToZero.value = false
|
weightDataIsToZero.value = false
|
||||||
if (index === currentSampleIndex.value) return
|
if (index === currentSampleIndex.value) return
|
||||||
setValueToSample()
|
|
||||||
currentSampleIndex.value = index
|
currentSampleIndex.value = index
|
||||||
// 如果为0,意味着尚未初始化
|
// 如果为0,意味着尚未初始化
|
||||||
if (menuHeight.value === 0 || menuItemHeight.value === 0) {
|
if (menuHeight.value === 0 || menuItemHeight.value === 0) {
|
||||||
@@ -670,7 +668,7 @@ const saveAuncelData = () => {
|
|||||||
weightDataIsToZero.value = false
|
weightDataIsToZero.value = false
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
const dynamicFormData = {}
|
let dynamicFormData = reactive({})
|
||||||
const saveDetail = async () => {
|
const saveDetail = async () => {
|
||||||
//检查杯号
|
//检查杯号
|
||||||
if (!checkBh()) return
|
if (!checkBh()) return
|
||||||
@@ -713,7 +711,7 @@ const saveDetail = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await nx.$api.assayTask.saveBatchSmpleAndQcAnalysis(params)
|
await nx.$api.assayTask.saveBatchSmpleAndQcAnalysis(params)
|
||||||
getSampleAnalysisByTaskId()
|
// getSampleAnalysisByTaskId()
|
||||||
autoNextSample()
|
autoNextSample()
|
||||||
}
|
}
|
||||||
// 计算表格列平均值
|
// 计算表格列平均值
|
||||||
@@ -759,10 +757,6 @@ function setValueToSample() {
|
|||||||
) {
|
) {
|
||||||
currentSampleData.value[item.fieldIndex].value = item.value
|
currentSampleData.value[item.fieldIndex].value = item.value
|
||||||
}
|
}
|
||||||
// 初始化的时候保存杯号到样品中后续自动生成杯号用
|
|
||||||
if (item.title === cupNumKey && currentSampleIndex.value == 0) {
|
|
||||||
currentSampleData.value.cupNum = item.value
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -782,7 +776,7 @@ const submitTask = () => {
|
|||||||
|
|
||||||
nx.$api.assayTask.submitTask(params).then(res => {
|
nx.$api.assayTask.submitTask(params).then(res => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/analysis/sample/sample-report'
|
url: '/pages/analysis/sample/sample-report-search'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -792,23 +786,22 @@ const submitTask = () => {
|
|||||||
//自动生成杯号(仅顺序称重):第一杯:手填,后续杯 = 上一杯 + 1
|
//自动生成杯号(仅顺序称重):第一杯:手填,后续杯 = 上一杯 + 1
|
||||||
const autoGenerateCupNum = () => {
|
const autoGenerateCupNum = () => {
|
||||||
let cupNum = 0
|
let cupNum = 0
|
||||||
let current = currentSampleIndex.value
|
let currentIndex = currentSampleIndex.value
|
||||||
//第一杯
|
//第一杯
|
||||||
if (current === 0) return
|
if (currentIndex === 0) return
|
||||||
//取上一个样品的杯号
|
//取上一个样品的杯号
|
||||||
const sample = sampleDataList.value[current - 1]
|
const sample = sampleDataList.value[currentIndex - 1]
|
||||||
cupNum = sample.cupNum
|
cupNum = sample[cupNumFieldIndex.value].value
|
||||||
//杯号赋值到当前样品
|
//杯号赋值到当前样品
|
||||||
putCupNum(Number(cupNum) + 1, current, Number(cupNum))
|
putCupNum(Number(cupNum) + 1, currentIndex, Number(cupNum))
|
||||||
}
|
}
|
||||||
|
|
||||||
const putCupNum = (cupNum, sampleIndex, lastCupNum) => {
|
const putCupNum = (cupNum, sampleIndex, lastCupNum) => {
|
||||||
sampleDataList.value[sampleIndex].cupNum = cupNum
|
|
||||||
for (const fields of fieldGroup.value) {
|
for (const fields of fieldGroup.value) {
|
||||||
if (typeof fields === 'undefined') continue
|
if (typeof fields === 'undefined') continue
|
||||||
//杯号
|
//杯号
|
||||||
for (const field of fields.fields) {
|
for (const field of fields.fields) {
|
||||||
if (field.title === cupNumKey) {
|
if (field.fieldIndex === cupNumFieldIndex.value) {
|
||||||
if (typeof field.value === 'undefined' || field.value === null || field.value === '') {
|
if (typeof field.value === 'undefined' || field.value === null || field.value === '') {
|
||||||
field.value = cupNum
|
field.value = cupNum
|
||||||
return true
|
return true
|
||||||
@@ -817,33 +810,32 @@ const putCupNum = (cupNum, sampleIndex, lastCupNum) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//处理筛上筛下
|
//处理筛上筛下
|
||||||
if (lastCupNum && lastCupNum === sampleIndex) {
|
// if (lastCupNum && lastCupNum === sampleIndex) {
|
||||||
//上一个杯号 == 默认杯号
|
// //上一个杯号 == 默认杯号
|
||||||
cupNum = sampleIndex * 2 + 1
|
// cupNum = sampleIndex * 2 + 1
|
||||||
}
|
// }
|
||||||
for (const fields of fieldGroup.value) {
|
// for (const fields of fieldGroup.value) {
|
||||||
if (typeof fields === 'undefined') continue
|
// if (typeof fields === 'undefined') continue
|
||||||
//杯号-筛下
|
// //杯号-筛下
|
||||||
for (const field of fields.fields) {
|
// for (const field of fields.fields) {
|
||||||
if (field.dicKey === cupNumKey + '_down') {
|
// if (field.dicKey === cupNumKey + '_down') {
|
||||||
if (typeof field.value === 'undefined' || field.value === null || field.value === '') {
|
// if (typeof field.value === 'undefined' || field.value === null || field.value === '') {
|
||||||
field.value = cupNum
|
// field.value = cupNum
|
||||||
cupNum++
|
// cupNum++
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
//杯号-筛上
|
// //杯号-筛上
|
||||||
for (const field of fields.fields) {
|
// for (const field of fields.fields) {
|
||||||
if (field.dicKey === cupNumKey + '_up') {
|
// if (field.dicKey === cupNumKey + '_up') {
|
||||||
if (typeof field.value === 'undefined' || field.value === null || field.value === '') {
|
// if (typeof field.value === 'undefined' || field.value === null || field.value === '') {
|
||||||
field.value = cupNum
|
// field.value = cupNum
|
||||||
return true
|
// return true
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadConRecoveryList = () => {
|
const loadConRecoveryList = () => {
|
||||||
@@ -880,6 +872,8 @@ const activeAssayTypeKey = ref('')
|
|||||||
const activeAssayTypeIndex = ref(0)
|
const activeAssayTypeIndex = ref(0)
|
||||||
//元素结果范围
|
//元素结果范围
|
||||||
let conRangeElementAnalysisList = ref([])
|
let conRangeElementAnalysisList = ref([])
|
||||||
|
// 杯号fieldIndex
|
||||||
|
const cupNumFieldIndex = ref('')
|
||||||
const currentAssayType = computed(() => {
|
const currentAssayType = computed(() => {
|
||||||
return assayGroups.value.find(item => item.value === activeAssayTypeKey.value)
|
return assayGroups.value.find(item => item.value === activeAssayTypeKey.value)
|
||||||
})
|
})
|
||||||
@@ -894,12 +888,22 @@ watch(
|
|||||||
() => currentAssayType.value,
|
() => currentAssayType.value,
|
||||||
() => {
|
() => {
|
||||||
sampleDataList.value = currentAssayType.value.tableData
|
sampleDataList.value = currentAssayType.value.tableData
|
||||||
fieldGroup.value = groupByField(currentAssayType.value.columns)
|
fieldGroup.value = groupByField(currentAssayType.value.columns, cupNumFieldIndex)
|
||||||
|
|
||||||
setValueToField()
|
setValueToField()
|
||||||
// getDomHeight()
|
// getDomHeight()
|
||||||
activeCollapses.value = fieldGroup.value.map((_, index) => index)
|
activeCollapses.value = fieldGroup.value.map((_, index) => index)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
const currentCupNum = computed(() => {
|
||||||
|
for (const item of fieldGroup.value) {
|
||||||
|
const field = item.fields.find(field => field.fieldIndex === cupNumFieldIndex.value)
|
||||||
|
if (field) {
|
||||||
|
return field.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
})
|
||||||
const currentGroup = computed(() => {
|
const currentGroup = computed(() => {
|
||||||
if (!currentAssayType.value || curParameterKey.value === 'all') {
|
if (!currentAssayType.value || curParameterKey.value === 'all') {
|
||||||
return fieldGroup.value
|
return fieldGroup.value
|
||||||
@@ -936,10 +940,11 @@ function handleAssayTypeChange({ index, value }) {
|
|||||||
}
|
}
|
||||||
// 获取任务指派单数据
|
// 获取任务指派单数据
|
||||||
async function getSampleAnalysisByTaskId() {
|
async function getSampleAnalysisByTaskId() {
|
||||||
const { assayTaskAnalysisDataList, configAssayMethodProjectRangeList, businessAssayTasNo } =
|
const { assayTaskAnalysisDataList, configAssayMethodProjectRangeList, businessAssayTasNo, formValue } =
|
||||||
await nx.$api.assayTask.batchSampleAndQcAnalysisByTaskId(taskId.value)
|
await nx.$api.assayTask.batchSampleAndQcAnalysisByTaskId(taskId.value)
|
||||||
title.value = '样品分析-任务指派单:' + businessAssayTasNo
|
title.value = '样品分析-任务指派单:' + businessAssayTasNo
|
||||||
// 处理分析数据
|
// 处理分析数据
|
||||||
|
|
||||||
assayGroups.value = assayTaskAnalysisDataList.map(group => {
|
assayGroups.value = assayTaskAnalysisDataList.map(group => {
|
||||||
// 必须深拷贝 datas!防止多个表格共享引用
|
// 必须深拷贝 datas!防止多个表格共享引用
|
||||||
const tableData = JSON.parse(JSON.stringify(group.datas || []))
|
const tableData = JSON.parse(JSON.stringify(group.datas || []))
|
||||||
@@ -955,6 +960,7 @@ async function getSampleAnalysisByTaskId() {
|
|||||||
: []
|
: []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
dynamicFormData = formValue ? JSON.parse(formValue) : {}
|
||||||
// 默认激活第一个 类型
|
// 默认激活第一个 类型
|
||||||
if (!activeAssayTypeKey.value) {
|
if (!activeAssayTypeKey.value) {
|
||||||
activeAssayTypeKey.value = assayGroups.value.length > 0 ? assayGroups.value[0].value : ''
|
activeAssayTypeKey.value = assayGroups.value.length > 0 ? assayGroups.value[0].value : ''
|
||||||
@@ -1120,19 +1126,7 @@ const listenNumKeyboard = () => {
|
|||||||
//自动补全小数位数
|
//自动补全小数位数
|
||||||
const decimalPosition = selectedField.value.decimalPosition || 0
|
const decimalPosition = selectedField.value.decimalPosition || 0
|
||||||
let val = res.val
|
let val = res.val
|
||||||
//判断val小数位,如果小于设定位数,则补全
|
selectedField.value.value = handleRoundFiveNumber(val, decimalPosition)
|
||||||
if (decimalPosition > 0) {
|
|
||||||
if (val === '') val = '0'
|
|
||||||
if (typeof val === 'number') val += ''
|
|
||||||
let dotLen = 0
|
|
||||||
if (val.indexOf('.') > 0) dotLen = val.length - val.indexOf('.') - 1
|
|
||||||
else val += '.'
|
|
||||||
while (dotLen < decimalPosition) {
|
|
||||||
dotLen++
|
|
||||||
val += '0'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
selectedField.value.value = val
|
|
||||||
const dicKey = selectedField.value.dicKey
|
const dicKey = selectedField.value.dicKey
|
||||||
if (dicKey && dicKey === 'bh_down') {
|
if (dicKey && dicKey === 'bh_down') {
|
||||||
autoFillBhUp(val)
|
autoFillBhUp(val)
|
||||||
@@ -1335,11 +1329,18 @@ onBackPress(() => {
|
|||||||
background-position: center;
|
background-position: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
.code {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
left: 50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.auncel-title {
|
.auncel-title {
|
||||||
flex: 3;
|
flex: 3;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const formFields = ref([])
|
|||||||
const staticFormSchema = [
|
const staticFormSchema = [
|
||||||
{ label: '指派单号', fieldKey: 'businessAssayTaskId', hidden: true },
|
{ label: '指派单号', fieldKey: 'businessAssayTaskId', hidden: true },
|
||||||
{ type: 'title', value: '分析原始记录单' },
|
{ type: 'title', value: '分析原始记录单' },
|
||||||
{ label: '检测方法', type: 'Input', fieldKey: 'configAssayMethodName', disabled: true },
|
{ label: '检测方法', type: 'Input', fieldKey: 'configAssayMethodName' },
|
||||||
{ label: '分析人', type: 'Input', fieldKey: 'assayOperator', disabled: true },
|
{ label: '分析人', type: 'Input', fieldKey: 'assayOperator', disabled: true },
|
||||||
{ label: '检测时间', type: 'date', fieldKey: 'assayTime' }
|
{ label: '检测时间', type: 'date', fieldKey: 'assayTime' }
|
||||||
]
|
]
|
||||||
@@ -294,10 +294,11 @@ function getDynamicFormSchemaFormData(obj) {
|
|||||||
}
|
}
|
||||||
// 检查动态字段值在空白样或者标样的(影响计算配置字段)中是否变化
|
// 检查动态字段值在空白样或者标样的(影响计算配置字段)中是否变化
|
||||||
function checkPropertyEquality() {
|
function checkPropertyEquality() {
|
||||||
if (configQCSampleMethodInfos.value.length === 0) return false
|
let allColumns = tabs.value.flatMap(tab => tab.columns)
|
||||||
for (const config of configQCSampleMethodInfos.value) {
|
for (const column of allColumns) {
|
||||||
const target = config.target
|
const formula = column.formula
|
||||||
if (!target) continue
|
if (!formula) continue
|
||||||
|
const target = formula.split(':')[1]
|
||||||
const originalValue = dynamicFormData.value[target]
|
const originalValue = dynamicFormData.value[target]
|
||||||
const currentValue = realFormData.value[target]
|
const currentValue = realFormData.value[target]
|
||||||
console.log('checkPropertyEquality', originalValue, currentValue)
|
console.log('checkPropertyEquality', originalValue, currentValue)
|
||||||
|
|||||||
Reference in New Issue
Block a user