feat:设备管理修改

This commit is contained in:
houjunxiang
2026-03-20 17:56:17 +08:00
parent f0dffc29fa
commit 904d1c4ea4
15 changed files with 564 additions and 468 deletions

View File

@@ -10,7 +10,7 @@
<view
class="label-my"
:style="{ fontWeight: checkFeadToDetailField(field.headToDetailField) ? 'bold' : 'normal' }"
>{{ field.label }}</view
><text v-if="field.required" style="color: red">*</text>{{ field.label }}</view
>
<view class="content-my">
<view v-if="field.type == 'title'" class="content-title">
@@ -34,7 +34,7 @@
:placeholder="field.placeholder"
:disabled="field.disabled || field.fillingWay == 'calculate'"
/>
<uni-data-select
<zxz-uni-data-select
v-if="field.type == 'Select'"
v-model="field.value"
:multiple="field.multiple"
@@ -162,6 +162,7 @@ async function loadTaskDetail() {
label: item.fieldName,
fieldKey: item.fieldKey,
type: item.fieldType,
required: customConfig.required,
placeholder: '请输入',
hidden: false
}
@@ -364,6 +365,14 @@ function looseEqual(a, b) {
// 保存抬头字段(带确认弹窗)
function saveHeadData() {
if (!realFormData.value['assayTime']) return nx.$helper.showToast('请选择分析时间')
// 校验动态字段是否为空
for (const field of formFields.value) {
if (field.required && (!field.value || field.value?.length === 0)) {
nx.$helper.showToast('请填写' + field.label)
return
}
}
if (checkPropertyEquality()) {
uni.showModal({
title: '提示',

File diff suppressed because it is too large Load Diff

View File

@@ -165,6 +165,10 @@ async function getDailyCheckRecord(id) {
res.checkUserName = nx.$store('user').userInfo.nickname
}
detailInfo.value = res
let files = res.businessFileRet.data.map((item) => {
return { id: item.fileId, name: item.fileName, url: item.fileUrl ,status: 'success',}
})
detailInfo.value.files = files
modalType.value = res.submitFlag
lockOrientation('landscape')

File diff suppressed because it is too large Load Diff

View File

@@ -150,6 +150,10 @@ async function getDetailInfo(id) {
res.checkUserName = nx.$store('user').userInfo.nickname
}
detailInfo.value = res
let files = res.businessFileRet.data.map((item) => {
return { id: item.fileId, name: item.fileName, url: item.fileUrl ,status: 'success',}
})
detailInfo.value.files = files
modalType.value = res.submitFlag
lockOrientation('landscape')
}

View File

@@ -8,26 +8,22 @@
</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">
<u-checkbox-group placement="column" v-model="selectRows">
<view v-for="(task, index) in taskList">
<up-radio :name="task.id">
<u-checkbox :name="task.id">
<template #label>
<view
class="x-f pb4 pl8 border-b full-width"
:class="{ active: current === index }"
@click="current = index"
>
<view class="x-f pb4 pl8 border-b full-width" @click="current = index">
<view class="fs20">{{ task.taskNo }}</view>
<view class="pl16 pr16">{{ task.taskName }}{{ task.assayOper }}</view>
<view class="pl32 pr32">{{ 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>
</u-checkbox>
</view>
</up-radio-group>
</u-checkbox-group>
</template>
<up-empty v-else text="暂无数据" mode="list"> </up-empty>
</scroll-view>
@@ -44,7 +40,7 @@ let emits = defineEmits(['confirm'])
const addConfigShow = ref(false)
function show() {
addConfigShow.value = true
selectRowId.value = undefined
selectRows.value = []
current.value = undefined
getAssayTaskList()
}
@@ -63,21 +59,40 @@ const getAssayTaskList = async () => {
function handleCancel() {
addConfigShow.value = false
}
const selectRowId = ref(undefined)
function handleAdd() {
if (!selectRowId.value) {
const selectRows = ref([])
async function handleAdd() {
// 1. 校验是否选择了数据
if (!selectRows.value || !selectRows.value.length) {
return uni.showToast({
title: '请选择任务单',
icon: 'none'
})
}
let sampleList = []
nx.$api.assayTask.getAssayTaskDetailList({ businessAssayTaskId: selectRowId.value }).then(res => {
const list = res || []
sampleList = list
try {
const requestPromises = selectRows.value.map(businessAssayTaskId => {
return nx.$api.assayTask.getAssayTaskDetailList({
businessAssayTaskId
})
})
const results = await Promise.all(requestPromises)
let sampleList = []
results.forEach(res => {
const list = res || []
sampleList = sampleList.concat(list)
})
// 5. 执行回调和关闭弹窗
emits('confirm', sampleList)
addConfigShow.value = false
})
} catch (error) {
console.error('批量获取详情失败:', error)
uni.showToast({
title: '数据加载失败',
icon: 'none'
})
}
}
defineExpose({
@@ -86,7 +101,7 @@ defineExpose({
</script>
<style lang="scss" scoped>
:deep(.u-radio__label-wrap) {
:deep(.u-checkbox__label-wrap) {
width: 100%;
}
.active {

View File

@@ -48,7 +48,7 @@
</up-row>
<up-row justify="space-around">
<up-col span="3.5">
<view class="p5">{{isHighTemperature?'使用':''}}温度</view>
<view class="p5">{{ isHighTemperature ? '使用' : '' }}温度</view>
<up-input v-model="formData.temperature"></up-input>
</up-col>
<up-col v-if="!isHighTemperature" span="3.5">
@@ -148,6 +148,7 @@ const detailSchema = [
{ label: '使用班组', value: 'deptName' }
]
const columns = ref([
{ title: '任务单号', key: 'taskNo', align: 'center' },
{ title: '样品名称', key: 'sampleName', align: 'center' },
{ title: '样品编号', key: 'sampleCode', align: 'center' },
{ title: '操作', key: 'action', width: '100px', align: 'center' }
@@ -167,7 +168,6 @@ function handleSampleSelect(dataList, type) {
const transformData = newData => {
if (type === 'sample') {
return {
id: newData.id,
detailType: 'sample',
sampleCode: newData.sampleCode,
sampleName: newData.sampleName,
@@ -176,16 +176,16 @@ function handleSampleSelect(dataList, type) {
}
} else {
return {
id: newData.id,
detailType: 'standard',
sampleCode: newData.code,
sampleName: newData.name
sampleName: newData.name,
taskId: newData.id
}
}
}
tableData.value = tableData.value.filter(item => item.detailType !== type)
for (const newData of dataList) {
const index = tableData.value.findIndex(item => item.id === newData.id)
const taskIdKey = type === 'sample' ? 'businessAssayTaskId' : 'id'
const index = tableData.value.findIndex(item => item.taskId === newData[taskIdKey])
const transformedItem = transformData(newData)
if (index > -1) {
@@ -206,7 +206,6 @@ const userId = nx.$store('user').userInfo['id']
const userName = nx.$store('user').userInfo['realname']
let detailInfo = ref({})
function handleScanResult(result) {
const codeObj = JSON.parse(result)
if (!pageLoading.value) {
@@ -244,12 +243,12 @@ function handleTestAction(id) {
getLastDailyCheckOfToday(id)
}
// 是否是高温设备
const isHighTemperature = computed(()=>{
if(detailInfo.value.customConfigJson&&detailInfo.value.customConfigJson.highTemperature){
return true
}else{
return false
}
const isHighTemperature = computed(() => {
if (detailInfo.value.customConfigJson && detailInfo.value.customConfigJson.highTemperature) {
return true
} else {
return false
}
})
// 获取设备详情
async function getDeviceInfo(id) {

View File

@@ -1,6 +1,6 @@
<template>
<view>
<navbar-back title="实验室管理系统【试剂耗材管理】" titleWidth="800" :autoBack="false" leftIcon="" leftText="">
<navbar-back title="实验室管理系统【物料管理】" titleWidth="800" :autoBack="false" leftIcon="" leftText="">
<u-icon @click="popupShow = true" size="28" color="#FFF" name="setting-fill" />
</navbar-back>

View File

@@ -1,5 +1,5 @@
<template>
<navbar-back title="试剂开封"></navbar-back>
<navbar-back title="物料开封"></navbar-back>
<view class="pl8 pr8 pt8">
<up-input
style="padding-top: 20px"
@@ -82,7 +82,8 @@ async function getMaterialList() {
code: materialCode.value,
usageStatus: 1,
openStatus:0,
openDueFalg:1
openDueFalg:1,
businessType:'open_seal'
}
const data = await nx.$api.material.queryMaterialInfo(params)

View File

@@ -1,5 +1,5 @@
<template>
<navbar-back title="物领用"></navbar-back>
<navbar-back title="物领用"></navbar-back>
<view class="pl8 pr8 pt8">
<view class="x-f">
<text class="pl6">领用人</text>
@@ -23,7 +23,14 @@
<uni-section v-if="materialList.length > 0" type="line" title="领用明细" titleFontSize="15px">
<template #right> <up-text type="error" size="18" bold :text="materialList.length"></up-text></template>
<scroll-view style="height: 55 vh" scroll-y scroll-with-animation>
<uni-card margin="5px" v-for="item in materialList" class="sample-item">
<uni-card margin="5px" v-for="(item, index) in materialList" class="sample-item">
<uni-icons
class="delete"
type="trash-filled"
color="#f56c6c"
size="40"
@click="handleDelete(index)"
></uni-icons>
<template v-if="item.standardSolutionFlag !== 1">
<view class="mt4">
<view
@@ -43,11 +50,11 @@
>
</template>
<template v-else>
<view class="mt4">
<view
>溶液编号<text class="black">{{ item.code }}</text></view
>
</view>
<view class="mt4">
<view
>溶液编号<text class="black">{{ item.code }}</text></view
>
</view>
<view class="mt4">
<view
>溶液名称<text class="black">{{ item.name }}</text></view
@@ -118,7 +125,8 @@ onShow(() => {
async function getMaterialList() {
if (materialCode.value === '') return
let params = {
code: materialCode.value
code: materialCode.value,
businessType: 'outbound'
}
const data = await nx.$api.material.queryMaterialInfo(params)
if (!data) return uni.showToast({ title: '未查询到该物料信息', icon: 'none' })
@@ -129,6 +137,11 @@ async function getMaterialList() {
materialList.value.push(data)
}
function handleDelete(index) {
console.log(index)
materialList.value.splice(index, 1)
}
async function handleSubmit() {
if (selectUserId.value === '') {
return uni.showToast({
@@ -138,7 +151,6 @@ async function handleSubmit() {
}
btnLoading.value = true
const selectUser = range.value.find(item => item.value === selectUserId.value)
console.log(selectUser)
let params = {
businessType: '领用出库',
@@ -169,7 +181,12 @@ onMounted(async () => {
<style lang="scss" scoped>
.sample-item {
position: relative;
pointer-events: none;
.delete {
position: absolute;
right: 10px;
top: 10px;
}
}
:deep(.uni-select__input-placeholder) {
font-size: 16px;

Some files were not shown because too many files have changed in this diff Show More