feat:设备使用记录
This commit is contained in:
@@ -99,8 +99,7 @@ function getPageData() {
|
||||
pageNo: 1,
|
||||
pageSize: 999,
|
||||
collectDeviceType: 'balance',
|
||||
deviceStatus: '0',
|
||||
isEnable: '1',
|
||||
deviceStatus: "{\"Enable\":\"1\"}",
|
||||
deployLocation: deployLocation.value === '全部' ? '' : deployLocation.value
|
||||
})
|
||||
.then(res => {
|
||||
|
||||
@@ -230,6 +230,7 @@ import request from '@/nx/request'
|
||||
import {
|
||||
calcAnalysisValue,
|
||||
handleRoundFiveNumber,
|
||||
handleEfficaciousNumber,
|
||||
calcRowAnalysisValue,
|
||||
evaluateGetFromFormula,
|
||||
math,
|
||||
@@ -655,6 +656,7 @@ const saveAuncelData = () => {
|
||||
}, 100)
|
||||
}
|
||||
let dynamicFormData = reactive({})
|
||||
|
||||
const saveDetail = async () => {
|
||||
//检查杯号
|
||||
if (!checkBh()) return
|
||||
@@ -677,7 +679,14 @@ const saveDetail = async () => {
|
||||
if (item.calcMethod === 'calculateAverageValue') {
|
||||
item.value = calcAverageValue(sourceKey, currentAssayType.value.tableData)
|
||||
} else {
|
||||
item.value = handleRoundFiveNumber(row[sourceKey].value, row.decimalPosition)
|
||||
const rowObj = row[selectedField.value.fieldIndex]
|
||||
const isProject = rowObj.type === 'project'
|
||||
const flagValue = handleRoundFiveNumber(row[sourceKey].value, row.decimalPosition)
|
||||
if (isProject) {
|
||||
item.value = handleEfficaciousNumber(flagValue, rowObj.decimalPosition, rowObj.effectiveDigit)
|
||||
} else {
|
||||
item.value = flagValue
|
||||
}
|
||||
}
|
||||
// 如果处理后的值不为空,重新赋值该字段到其他样品类型下的样品上,并触发每一个样品的计算
|
||||
for (const col of currentAssayType.value.columns) {
|
||||
@@ -710,9 +719,16 @@ const saveDetail = async () => {
|
||||
function calcAverageValue(fieldIndex, tableData) {
|
||||
const rows = tableData.map(row => row[fieldIndex])
|
||||
const decimalPosition = rows[0].decimalPosition
|
||||
const isProject = rows[0].type === 'project'
|
||||
const effectiveDigit = rows[0].effectiveDigit
|
||||
const values = rows.map(row => Number(row.value))
|
||||
if (values.some(item => item == null)) return null
|
||||
return handleRoundFiveNumber(math.mean(values), decimalPosition)
|
||||
const flagValue = handleRoundFiveNumber(math.mean(values), decimalPosition)
|
||||
if (isProject) {
|
||||
return handleEfficaciousNumber(flagValue, decimalPosition, effectiveDigit)
|
||||
} else {
|
||||
return flagValue
|
||||
}
|
||||
}
|
||||
|
||||
// 表格数据更新后重新计算
|
||||
@@ -1113,12 +1129,19 @@ const listenNumKeyboard = () => {
|
||||
}
|
||||
//自动补全小数位数
|
||||
const decimalPosition = selectedField.value.decimalPosition
|
||||
const isProject = selectedField.value.type === 'project'
|
||||
const effectiveDigit = currentSampleData.value[selectedField.value.fieldIndex]?.effectiveDigit || decimalPosition
|
||||
let val = res.val
|
||||
const symbol = res.symbol
|
||||
if (decimalPosition == null) {
|
||||
selectedField.value.value = val
|
||||
} else {
|
||||
selectedField.value.value = handleRoundFiveNumber(val, decimalPosition)
|
||||
const flagValue = handleRoundFiveNumber(val, decimalPosition)
|
||||
if (isProject) {
|
||||
selectedField.value.value = handleEfficaciousNumber(flagValue, decimalPosition, effectiveDigit)
|
||||
} else {
|
||||
selectedField.value.value = flagValue
|
||||
}
|
||||
}
|
||||
if (symbol) {
|
||||
selectedField.value.symbol = symbol
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ import request from '@/nx/request'
|
||||
|
||||
export function list(params) {
|
||||
return request({
|
||||
url: '/lims/bus/deviceBusCalibration/queryPageList',
|
||||
url: '/qms/device-calibration/page',
|
||||
method: 'GET',
|
||||
params
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<up-sticky>
|
||||
<navbar-back :title="`(${deviceText})设备信息`"></navbar-back>
|
||||
<navbar-back :title="`(${deviceText})设备信息`" titleWidth="800"></navbar-back>
|
||||
</up-sticky>
|
||||
<up-tabs lineWidth="30" :list="tabs" @click="tabClick"></up-tabs>
|
||||
<scroll-view scroll-y="true" class="content">
|
||||
@@ -77,7 +77,7 @@ function tabClick(e) {
|
||||
background-color: #f0f2f5;
|
||||
height: 100%;
|
||||
.content {
|
||||
height: 75vh;
|
||||
// height: 75vh;
|
||||
}
|
||||
}
|
||||
:deep(.u-tabs__wrapper__nav__item__text) {
|
||||
|
||||
@@ -4,14 +4,12 @@ export function getColumn(isFold) {
|
||||
{
|
||||
label: '设备名称',
|
||||
name: 'deviceName',
|
||||
width: isFold ? 200 : 130,
|
||||
fixed: true
|
||||
width: isFold ? 200 : 130
|
||||
},
|
||||
{
|
||||
label: '别名',
|
||||
name: 'alias',
|
||||
width: isFold ? 120 : 90,
|
||||
fixed: true
|
||||
width: isFold ? 120 : 90
|
||||
},
|
||||
{
|
||||
label: '设备状态',
|
||||
@@ -27,17 +25,17 @@ export function getColumn(isFold) {
|
||||
{
|
||||
label: '规格型号',
|
||||
name: 'modelNo',
|
||||
width: isFold ? 160 : 130
|
||||
width: isFold ? 180 : 150
|
||||
},
|
||||
{
|
||||
label: '使用班组',
|
||||
name: 'deptName',
|
||||
width: isFold ? 140 : 100
|
||||
width: isFold ? 180 : 150
|
||||
},
|
||||
{
|
||||
label: '负责人',
|
||||
name: 'managerUserName',
|
||||
width: isFold ? 100 : 90
|
||||
width: isFold ? 150 : 120
|
||||
},
|
||||
{
|
||||
name: 'operation',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
96
pages/device/deviceBusUseRecord/SampleSelectPopup.vue
Normal file
96
pages/device/deviceBusUseRecord/SampleSelectPopup.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-popup :show="addConfigShow" round="10" @close="addConfigShow = false">
|
||||
<view class="text-center">样品选择</view>
|
||||
<view class="x-bc mt8">
|
||||
<up-button size="small" style="width: 60px" text="取消" @click="handleCancel"></up-button>
|
||||
<up-button size="small" style="width: 60px" type="primary" text="确认" @click="handleAdd"></up-button>
|
||||
</view>
|
||||
<scroll-view style="height: 60vh" scroll-y scroll-with-animation class="mt16 pl16">
|
||||
<template v-if="taskList.length > 0">
|
||||
<up-radio-group v-model="selectRowId" placement="column">
|
||||
<view v-for="(task, index) in taskList">
|
||||
<up-radio :name="task.id">
|
||||
<template #label>
|
||||
<view
|
||||
class="x-f pb4 pl8 border-b full-width"
|
||||
:class="{ active: current === index }"
|
||||
@click="current = index"
|
||||
>
|
||||
<view class="fs20">{{ task.taskNo }}</view>
|
||||
<view class="pl16 pr16">{{ task.taskName }}{{ task.assayOper }}</view>
|
||||
<view class="x-f">
|
||||
<u-icon name="clock"></u-icon>
|
||||
<text class="ml5">{{ nx.$helper.formateToDateTime(task.taskAssignTime) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</up-radio>
|
||||
</view>
|
||||
</up-radio-group>
|
||||
</template>
|
||||
<up-empty v-else text="暂无数据" mode="list"> </up-empty>
|
||||
</scroll-view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
|
||||
import nx from '@/nx'
|
||||
|
||||
let emits = defineEmits(['confirm'])
|
||||
const addConfigShow = ref(false)
|
||||
function show() {
|
||||
addConfigShow.value = true
|
||||
selectRowId.value = undefined
|
||||
current.value = undefined
|
||||
getAssayTaskList()
|
||||
}
|
||||
const userInfo = computed(() => nx.$store('user').userInfo)
|
||||
const taskList = ref([])
|
||||
const current = ref(undefined)
|
||||
const getAssayTaskList = async () => {
|
||||
const param = {
|
||||
taskAssignStatus: 'submitted',
|
||||
taskAssayStatusList: ['not_start', 'saved'],
|
||||
assayOperator: userInfo.value.nickname
|
||||
}
|
||||
const res = await nx.$api.assayTask.getAssayTaskList(param)
|
||||
taskList.value = res
|
||||
}
|
||||
function handleCancel() {
|
||||
addConfigShow.value = false
|
||||
}
|
||||
const selectRowId = ref(undefined)
|
||||
function handleAdd() {
|
||||
if (!selectRowId.value) {
|
||||
return uni.showToast({
|
||||
title: '请选择任务单',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
let sampleList = []
|
||||
nx.$api.assayTask.getAssayTaskDetailList({ businessAssayTaskId: selectRowId.value }).then(res => {
|
||||
const list = res || []
|
||||
sampleList = list
|
||||
emits('confirm', sampleList)
|
||||
addConfigShow.value = false
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.u-radio__label-wrap) {
|
||||
width: 100%;
|
||||
}
|
||||
.active {
|
||||
color: #0055a2;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
80
pages/device/deviceBusUseRecord/StandardSelectPopup.vue
Normal file
80
pages/device/deviceBusUseRecord/StandardSelectPopup.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-popup :show="addConfigShow" round="10" @close="addConfigShow = false">
|
||||
<view class="text-center">标准物质选择</view>
|
||||
<view class="x-bc mt8">
|
||||
<up-button size="small" style="width: 60px" text="取消" @click="handleCancel"></up-button>
|
||||
<up-button size="small" style="width: 60px" type="primary" text="确认" @click="handleAdd"></up-button>
|
||||
</view>
|
||||
<scroll-view style="height: 60vh" scroll-y scroll-with-animation class="mt16 pl16">
|
||||
<template v-if="standardList.length > 0">
|
||||
<u-checkbox-group placement="column" v-model="selectRows">
|
||||
<view v-for="(item, index) in standardList">
|
||||
<u-checkbox :name="item.id">
|
||||
<template #label>
|
||||
<view class="x-f p8 border-b">
|
||||
<view>{{ item.name }}</view>
|
||||
<view class="pl16 pr16">{{ item.code }}</view>
|
||||
<view class="pl16 pr16">{{ item.modelNo }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</u-checkbox>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
</template>
|
||||
<up-empty v-else text="暂无数据" mode="list"> </up-empty>
|
||||
</scroll-view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import nx from '@/nx'
|
||||
|
||||
let emits = defineEmits(['confirm'])
|
||||
const addConfigShow = ref(false)
|
||||
function show() {
|
||||
addConfigShow.value = true
|
||||
selectRows.value = []
|
||||
current.value = undefined
|
||||
getList()
|
||||
}
|
||||
const standardList = ref([])
|
||||
const current = ref(undefined)
|
||||
const getList = async () => {
|
||||
standardList.value = []
|
||||
const param = {
|
||||
standardMaterialFlag: 1,
|
||||
pageNo: 1,
|
||||
pageSize: 1000
|
||||
}
|
||||
const { list } = await nx.$api.material.queryMaterialInformation(param)
|
||||
standardList.value = list
|
||||
}
|
||||
function handleCancel() {
|
||||
addConfigShow.value = false
|
||||
}
|
||||
const selectRows = ref([])
|
||||
function handleAdd() {
|
||||
if (selectRows.value.length === 0) {
|
||||
return uni.showToast({
|
||||
title: '请选择标准物质',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
let list = standardList.value.filter(item => selectRows.value.includes(item.id))
|
||||
emits('confirm', list)
|
||||
addConfigShow.value = false
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.u-checkbox__label-wrap) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -9,7 +9,7 @@
|
||||
</up-col>
|
||||
<up-col span="6"
|
||||
>开始时间:
|
||||
<text class="value">{{ detailInfo.useTimeStart }}</text>
|
||||
<text class="value">{{ nx.$helper.formateToDateTime(detailInfo.useTimeStart) }}</text>
|
||||
</up-col>
|
||||
</up-row>
|
||||
<up-row>
|
||||
@@ -19,7 +19,7 @@
|
||||
</up-col>
|
||||
<up-col span="6"
|
||||
>结束时间:
|
||||
<text class="value">{{ detailInfo.useTimeEnd }}</text>
|
||||
<text class="value">{{ nx.$helper.formateToDateTime(detailInfo.useTimeEnd) }}</text>
|
||||
</up-col>
|
||||
</up-row>
|
||||
<up-row>
|
||||
@@ -42,16 +42,19 @@
|
||||
<text class="value">{{ detailInfo.humidity }}</text>
|
||||
</up-col>
|
||||
<up-col span="6"
|
||||
>样品类别/个数/任务:
|
||||
<text class="value">{{ detailInfo.useRemark }}</text>
|
||||
>检测项目:
|
||||
<text class="value">{{ detailInfo.useItem }}</text>
|
||||
</up-col>
|
||||
</up-row>
|
||||
<u-table2 class="mt8" height="300px" :data="tableData" :columns="columns" stripe border> </u-table2>
|
||||
</scroll-view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch, computed } from 'vue'
|
||||
import nx from '@/nx'
|
||||
import { getDetailList } from './useRecord.api'
|
||||
|
||||
const props = defineProps({
|
||||
show: {
|
||||
@@ -77,8 +80,18 @@ function handleClose() {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
const columns = ref([
|
||||
{ title: '样品名称', key: 'sampleName', align: 'center' },
|
||||
{ title: '样品编号', key: 'sampleCode', align: 'center' }
|
||||
])
|
||||
const tableData = ref([])
|
||||
async function getUseRecordDetailList(id) {
|
||||
const res = await getDetailList({ parentId: id })
|
||||
tableData.value = res
|
||||
}
|
||||
function handleOpen() {
|
||||
detailInfo.value = props.checkInfo
|
||||
getUseRecordDetailList(props.checkInfo.id)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -101,4 +114,7 @@ function handleOpen() {
|
||||
:deep(.uicon-close) {
|
||||
font-size: 22px !important;
|
||||
}
|
||||
:deep(.u-popup__content__close--top-right) {
|
||||
top: 30px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user