feat:样品分析

This commit is contained in:
houjunxiang
2025-11-15 18:09:04 +08:00
parent d3f6ad4bf6
commit 00e21aebd3
60 changed files with 299 additions and 200 deletions

View File

@@ -25,44 +25,35 @@
<u-col span="8">
<view class="content-title-name">
<text>样品列表</text>
<up-badge v-if="sampleList.length > 0" class="ml5" :value="sampleList.length" type="warning"></up-badge>
</view>
<u-gap height="5" bg-color="#0055A2"></u-gap>
<view>
<scroll-view scroll-y scroll-with-animation style="height: calc(75vh - 60px)">
<u-checkbox-group placement="column" v-model="checkedSampleCodes">
<block v-for="(sample, index) in sampleList" :key="index">
<view v-if="currentTask.reviewCount === sample.reviewCount" class="p5 fs16">
<view v-if="currentTask.reviewCount === sample.reviewCount" class="sample-item">
<u-row>
<u-col span="2" class="text-center">
<u-row>
<u-col span="6" class="text-center">
<!-- v-if="
sample.rollbackStatus !== 'running' &&
sample.rollbackStatus !== 'finished'
" -->
<u-checkbox :name="sample.id"></u-checkbox>
<u-col span="4" class="text-center">
<u-checkbox :disabled="sampleDisabled(sample.rollbackStatus)" :name="sample.id"></u-checkbox>
</u-col>
<u-col span="6" class="text-center">
<u-col span="8" class="text-center">
<view
><text>{{ index + 1 }}</text></view
>
</u-col>
</u-row>
</u-col>
<u-col span="10" class="flex">
<u-col span="10">
<u-row>
<u-col span="6">
<view class="sample_desc">
<view>
<view
><text class="pl10">{{ sample.sampleAssayCode }}</text></view
>
<view>
<text class="pl10">
{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
</text>
</view>
</view>
<u-col span="4">
<view>
{{ sample.sampleAssayCode }}
</view>
<view>
{{ sample.sampleName }}
</view>
</u-col>
<u-col span="6">
@@ -73,7 +64,12 @@
</u-row>
</u-col>
</u-row>
<u-line class="p5" color="#bbb" />
<u-icon
v-if="sample.rollbackStatus"
class="sample-status"
:name="`/static/images/status/${sampleReturnIcon(sample.rollbackStatus)}.png`"
size="45"
/>
</view>
</block>
</u-checkbox-group>
@@ -111,7 +107,7 @@
<script setup>
import { ref, computed, getCurrentInstance } from 'vue'
import { onLoad, onBackPress } from '@dcloudio/uni-app'
import { onLoad, onBackPress, onPullDownRefresh } from '@dcloudio/uni-app'
import nx from '@/nx'
import { useScreenOrientation } from '@/nx/hooks/useScreenOrientation'
import { getDataSourceTypeShow } from '../common'
@@ -128,6 +124,21 @@ const taskList = ref([])
const sampleList = ref([])
const checkedSampleCodes = ref([])
const sampleReturnIcon = rollbackStatus => {
switch (rollbackStatus) {
case 'returned':
return 'return_returned'
case 'rejected':
return 'return_rejected'
case 'in_progress':
return 'return_in_progress'
default:
return ''
}
}
const sampleDisabled = rollbackStatus => {
return rollbackStatus === 'returned' || rollbackStatus === 'in_progress'
}
// 计算属性
const userInfo = computed(() => nx.$store('user').userInfo)
@@ -135,6 +146,12 @@ const userInfo = computed(() => nx.$store('user').userInfo)
const customBack = () => {
uni.reLaunch({ url: '/pages/analysis/index/index' })
}
onPullDownRefresh(() => {
getAssayTask().finally(() => {
uni.stopPullDownRefresh()
uni.showToast({ title: '刷新成功', icon: 'none' })
})
})
const showRollbackModal = () => {
if (checkedSampleCodes.value.length === 0) {
uni.showToast({ title: '请选择要退回的样品!', icon: 'none' })
@@ -149,23 +166,14 @@ const applyRollbackSample = () => {
return
}
showRollbackModalFlag.value = false
uni.showModal({
title: '提示',
content: '发起申请,退回已勾选的样品,是否继续?',
cancelColor: '#0055A2',
confirmColor: '#0055A2',
success: res => {
if (res.cancel) return
const data = {
remark: rollbackContent.value,
taskId: currentTask.value.id,
detailIds: checkedSampleCodes.value.join(',')
}
nx.$api.assayTask.createRollbackApply(data).then(() => {
getAssayTaskDetail(currentTask.value.id)
})
}
const data = {
backDesc: rollbackContent.value,
idList: checkedSampleCodes.value
}
nx.$api.assayTask.rollbackAssayTask(data).then(() => {
getAssayTaskDetail(currentTask.value.id)
showRollbackModalFlag.value = false
checkedSampleCodes.value = []
})
}
@@ -202,27 +210,26 @@ const switchTask = async index => {
checkedSampleCodes.value = []
}
const getAssayTask = () => {
const getAssayTask = async () => {
rollbackContent.value = ''
const param = {
taskAssignStatus: 'submitted',
taskAssayStatusList: ['not_start', 'saved']
// assayOper: userInfo.value.nickname
}
nx.$api.assayTask.getAssayTaskList(param).then(res => {
if (res) {
taskList.value = res
if (taskList.value.length > 0) {
currentTask.value = taskList.value[0]
getAssayTaskDetail(currentTask.value.id)
}
const res = await nx.$api.assayTask.getAssayTaskList(param)
if (res) {
taskList.value = res
if (taskList.value.length > 0) {
currentTask.value = taskList.value[0]
getAssayTaskDetail(currentTask.value.id)
}
})
}
}
const getAssayTaskDetail = businessAssayTaskId => {
sampleList.value = []
nx.$api.assayTask.getAssayTaskDataList({ businessAssayTaskId }).then(res => {
nx.$api.assayTask.getAssayTaskDetailList({ businessAssayTaskId }).then(res => {
const list = res || []
list.forEach(item => (item.checked = false))
sampleList.value = list
@@ -270,6 +277,16 @@ onBackPress(() => {
background-color: #f6f6f6;
}
.sample-item {
position: relative;
border-bottom: 1px solid #eee;
padding: 4px;
.sample-status {
position: absolute;
top: 0;
right: 0;
}
}
.content-main-right-operation {
height: 50px;
padding-top: 10px;
@@ -279,14 +296,4 @@ onBackPress(() => {
font-size: 18px;
width: 95%;
}
.sample_desc {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.sample_desc_warn {
color: red;
padding-right: 10px;
}
</style>