feat:样品分析
This commit is contained in:
@@ -8,20 +8,18 @@
|
||||
<up-badge v-if="taskList.length > 0" class="ml5" :value="taskList.length" type="warning"></up-badge>
|
||||
</view>
|
||||
<u-gap height="5" bg-color="#0055A2"></u-gap>
|
||||
<scroll-view
|
||||
style="height: 75vh"
|
||||
scroll-y
|
||||
scroll-with-animation
|
||||
class="content-main-left"
|
||||
:scroll-top="scrollTop"
|
||||
>
|
||||
<TaskItem
|
||||
v-for="(task, index) in taskList"
|
||||
:key="index"
|
||||
:task="task"
|
||||
:active="current === index"
|
||||
@click="switchTask(index)"
|
||||
/>
|
||||
<scroll-view style="height: 75vh" scroll-y scroll-with-animation class="content-main-left">
|
||||
<template v-if="taskList.length > 0">
|
||||
<TaskItem
|
||||
v-for="(task, index) in taskList"
|
||||
:key="index"
|
||||
:task="task"
|
||||
:seq="index + 1"
|
||||
:active="current === index"
|
||||
@click="switchTask(index)"
|
||||
/>
|
||||
</template>
|
||||
<up-empty v-else text="暂无数据" mode="list"> </up-empty>
|
||||
</scroll-view>
|
||||
</u-col>
|
||||
<u-col span="8">
|
||||
@@ -31,56 +29,54 @@
|
||||
<u-gap height="5" bg-color="#0055A2"></u-gap>
|
||||
<view>
|
||||
<scroll-view scroll-y scroll-with-animation style="height: calc(75vh - 60px)">
|
||||
<block v-for="(sample, index) in sampleList" :key="index">
|
||||
<view v-if="currentTask.reviewCount === sample.reviewCount" class="p5 fs16">
|
||||
<u-row>
|
||||
<u-col span="3" class="text-center">
|
||||
<u-row>
|
||||
<u-col span="6" class="text-center">
|
||||
<u-checkbox
|
||||
v-model="sample.checked"
|
||||
v-if="
|
||||
sample.sampleProcessNo === currentNode &&
|
||||
<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">
|
||||
<u-row>
|
||||
<u-col span="3" class="text-center">
|
||||
<u-row>
|
||||
<u-col span="6" class="text-center">
|
||||
<!-- v-if="
|
||||
sample.rollbackStatus !== 'running' &&
|
||||
sample.rollbackStatus !== 'finished'
|
||||
"
|
||||
@change="() => selectSample(sample)"
|
||||
></u-checkbox>
|
||||
</u-col>
|
||||
<u-col span="6" class="text-center">
|
||||
<view
|
||||
><text>【{{ sample.sort }}】</text></view
|
||||
>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</u-col>
|
||||
<u-col span="9">
|
||||
<view class="sample_desc">
|
||||
<view>
|
||||
<view
|
||||
><text class="pl10">{{ sample.sampleCode }}</text></view
|
||||
>
|
||||
" -->
|
||||
<u-checkbox :name="sample.id"></u-checkbox>
|
||||
</u-col>
|
||||
<u-col span="6" class="text-center">
|
||||
<view
|
||||
><text>【{{ index + 1 }}】</text></view
|
||||
>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</u-col>
|
||||
<u-col span="9">
|
||||
<view class="sample_desc">
|
||||
<view>
|
||||
<text class="pl10">
|
||||
{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
|
||||
</text>
|
||||
<view
|
||||
><text class="pl10">{{ sample.sampleCode }}</text></view
|
||||
>
|
||||
<view>
|
||||
<text class="pl10">
|
||||
{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="sample_desc_warn" v-if="sample.sampleProcessNo !== currentNode">
|
||||
<!-- <view class="sample_desc_warn" v-if="sample.sampleProcessNo !== currentNode">
|
||||
当前节点:{{ getProcessNameShow(sample.sampleProcessNo) }}
|
||||
</view>
|
||||
<view class="sample_desc_warn" v-if="sample.rollbackStatus === 'revoke'"> 样品退回被驳回 </view>
|
||||
<view class="sample_desc_warn" v-if="sample.rollbackStatus === 'running'"> 样品退回审批中 </view>
|
||||
<view class="sample_desc_warn" v-if="sample.rollbackStatus === 'finished'">
|
||||
样品已退回,请联系管理员处理
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-line class="p5" color="#bbb" />
|
||||
</view>
|
||||
</block>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-line class="p5" color="#bbb" />
|
||||
</view>
|
||||
</block>
|
||||
</u-checkbox-group>
|
||||
</scroll-view>
|
||||
<view class="content-main-right-operation">
|
||||
<u-row>
|
||||
@@ -114,7 +110,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { ref, computed, getCurrentInstance } from 'vue'
|
||||
import { onLoad, onBackPress } from '@dcloudio/uni-app'
|
||||
import nx from '@/nx'
|
||||
import { useScreenOrientation } from '@/nx/hooks/useScreenOrientation'
|
||||
@@ -126,13 +122,11 @@ const currentNode = ref('F31')
|
||||
const dicSampleProcessCodeList = ref([])
|
||||
const showRollbackModalFlag = ref(false)
|
||||
const rollbackContent = ref('')
|
||||
const scrollTop = ref(0)
|
||||
const current = ref(0)
|
||||
const currentTask = ref({})
|
||||
const currentTaskNo = ref('')
|
||||
const currentTaskType = ref('')
|
||||
const taskList = ref([])
|
||||
const sampleList = ref([])
|
||||
const checkedSampleCodes = ref([])
|
||||
|
||||
// 计算属性
|
||||
const userInfo = computed(() => nx.$store('user').userInfo)
|
||||
@@ -141,14 +135,8 @@ const userInfo = computed(() => nx.$store('user').userInfo)
|
||||
const customBack = () => {
|
||||
uni.reLaunch({ url: '/pages/analysis/index/index' })
|
||||
}
|
||||
|
||||
const selectSample = sample => {
|
||||
sample.checked = !sample.checked
|
||||
}
|
||||
|
||||
const showRollbackModal = () => {
|
||||
const checkedSampleList = sampleList.value.filter(item => item.checked)
|
||||
if (checkedSampleList.length === 0) {
|
||||
if (checkedSampleCodes.length === 0) {
|
||||
uni.showToast({ title: '请选择要退回的样品!', icon: 'none' })
|
||||
return
|
||||
}
|
||||
@@ -156,7 +144,6 @@ const showRollbackModal = () => {
|
||||
}
|
||||
|
||||
const applyRollbackSample = () => {
|
||||
const checkedSampleList = sampleList.value.filter(item => item.checked)
|
||||
if (!rollbackContent.value.trim()) {
|
||||
uni.showToast({ title: '请输入退回说明!', icon: 'none' })
|
||||
return
|
||||
@@ -170,14 +157,13 @@ const applyRollbackSample = () => {
|
||||
confirmColor: '#0055A2',
|
||||
success: res => {
|
||||
if (res.cancel) return
|
||||
const detailIdList = checkedSampleList.map(item => item.id)
|
||||
const data = {
|
||||
remark: rollbackContent.value,
|
||||
taskId: currentTask.value.id,
|
||||
detailIds: detailIdList.join(',')
|
||||
detailIds: checkedSampleCodes.value.join(',')
|
||||
}
|
||||
nx.$api.assayTask.createRollbackApply(data).then(() => {
|
||||
getAssayTaskDetail(currentTaskNo.value)
|
||||
getAssayTaskDetail(currentTask.value.id)
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -200,9 +186,9 @@ const checkWork = () => {
|
||||
}
|
||||
|
||||
const startWork = () => {
|
||||
if (!checkWork()) return
|
||||
// if (!checkWork()) return
|
||||
uni.navigateTo({
|
||||
url: `/pages/analysis/sample/sample-work-detail?currentTaskNo=${currentTaskNo.value}`
|
||||
url: `/pages/analysis/sample/sample-work-detail?currentTaskId=${currentTask.value.id}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -210,38 +196,33 @@ const switchTask = async index => {
|
||||
if (index === current.value) return
|
||||
current.value = index
|
||||
rollbackContent.value = ''
|
||||
|
||||
const task = taskList.value[index]
|
||||
currentTask.value = task
|
||||
currentTaskNo.value = task.taskNo
|
||||
currentTaskType.value = task.taskType
|
||||
getAssayTaskDetail(task.taskNo)
|
||||
getAssayTaskDetail(task.id)
|
||||
checkedSampleCodes.value = []
|
||||
}
|
||||
|
||||
const getAssayTask = () => {
|
||||
rollbackContent.value = ''
|
||||
const param = {
|
||||
finishStatus: 'waiting',
|
||||
assayOper: userInfo.value.nickname
|
||||
taskStatus: 'submit'
|
||||
// assayOper: userInfo.value.nickname
|
||||
}
|
||||
nx.$api.auncel.getAssayTaskList(param).then(res => {
|
||||
nx.$api.assayTask.getAssayTaskList(param).then(res => {
|
||||
if (res) {
|
||||
taskList.value = res
|
||||
taskList.value = res.list
|
||||
if (taskList.value.length > 0) {
|
||||
const first = taskList.value[0]
|
||||
currentTask.value = first
|
||||
currentTaskNo.value = first.taskNo
|
||||
currentTaskType.value = first.taskType
|
||||
getAssayTaskDetail(first.taskNo)
|
||||
currentTask.value = taskList.value[0]
|
||||
getAssayTaskDetail(currentTask.value.id)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getAssayTaskDetail = taskNo => {
|
||||
const getAssayTaskDetail = businessAssayTaskId => {
|
||||
sampleList.value = []
|
||||
nx.$api.assayTask.getAssayTaskDetailListByTaskNo({ taskNo }).then(res => {
|
||||
const list = res.result || []
|
||||
nx.$api.assayTask.getAssayTaskDataList({ businessAssayTaskId }).then(res => {
|
||||
const list = res || []
|
||||
list.forEach(item => (item.checked = false))
|
||||
sampleList.value = list
|
||||
})
|
||||
@@ -262,8 +243,8 @@ const getProcessNameShow = val => {
|
||||
onLoad(() => {
|
||||
const { lockOrientation } = useScreenOrientation()
|
||||
lockOrientation('landscape')
|
||||
getDicSampleProcessCodeList()
|
||||
// getAssayTask()
|
||||
// getDicSampleProcessCodeList()
|
||||
getAssayTask()
|
||||
})
|
||||
|
||||
onBackPress(() => {
|
||||
|
||||
Reference in New Issue
Block a user