feat:待审数据
This commit is contained in:
@@ -40,25 +40,22 @@
|
||||
>
|
||||
<u-col span="2" class="text-center" :style="sampleStyle(sample)">
|
||||
<view>
|
||||
<text>【{{ sample.sort }}】</text>
|
||||
<text>【{{ index + 1 }}】</text>
|
||||
</view>
|
||||
</u-col>
|
||||
<u-col span="5">
|
||||
<view>
|
||||
<text class="pl5">{{ sample.sampleCode }}</text>
|
||||
<text class="pl5">{{ sample.sampleAssayCode }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="pl5">
|
||||
{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="sample.sampleWeight">
|
||||
<text class="pl5">{{ sample.sampleWeight }} g</text>
|
||||
</view>
|
||||
</u-col>
|
||||
<u-col span="5">
|
||||
<view>
|
||||
<text style="padding-left: 10px">{{ sample.remarks }}</text>
|
||||
<text style="padding-left: 10px">{{ sample.assayProject }}</text>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
@@ -70,7 +67,7 @@
|
||||
<u-row>
|
||||
<u-col span="3"></u-col>
|
||||
<u-col span="6">
|
||||
<u-button class="btn-operation" type="primary" @click="previewPDF" v-if="currentTaskId.value">
|
||||
<u-button class="btn-operation" type="primary" @click="previewPDF" v-if="currentTask.id">
|
||||
任务单预览
|
||||
</u-button>
|
||||
</u-col>
|
||||
@@ -84,7 +81,7 @@
|
||||
<sample-detail-popup
|
||||
ref="sampleDetailPopup"
|
||||
v-model:showPopup="showDetailPopup"
|
||||
:detailPopupParam="detailPopupParam"
|
||||
:detailId="detailId"
|
||||
></sample-detail-popup>
|
||||
</view>
|
||||
</template>
|
||||
@@ -102,14 +99,12 @@ const scrollTop = ref(0)
|
||||
const current = ref(0)
|
||||
const currentTask = ref({})
|
||||
const currentTaskId = ref('')
|
||||
const currentTaskNo = ref('')
|
||||
const conAssayTask = ref('')
|
||||
const reviewNum = ref(0)
|
||||
const selectedIndex = ref(-1)
|
||||
const taskList = ref([])
|
||||
const sampleList = ref([])
|
||||
const showDetailPopup = ref(false)
|
||||
const detailPopupParam = ref({ taskDetailId: '' })
|
||||
const detailId = ref('')
|
||||
|
||||
// 计算属性
|
||||
const userInfo = computed(() => nx.$store('user').userInfo)
|
||||
@@ -135,66 +130,51 @@ const switchTask = async index => {
|
||||
selectedIndex.value = -1
|
||||
const task = taskList.value[index]
|
||||
currentTask.value = task
|
||||
currentTaskNo.value = task.taskNo
|
||||
currentTaskId.value = task.id
|
||||
getAssayTaskDetail(task.taskNo)
|
||||
getAssayTaskDetail(task.id)
|
||||
}
|
||||
|
||||
const showSampleDetail = (detailId, index) => {
|
||||
const showSampleDetail = (id, index) => {
|
||||
selectedIndex.value = index
|
||||
console.log('detailId', detailId)
|
||||
detailPopupParam.value = { taskDetailId: detailId }
|
||||
detailId.value = id
|
||||
showDetailPopup.value = true
|
||||
}
|
||||
|
||||
const getAssayTask = () => {
|
||||
taskList.value = []
|
||||
sampleList.value = []
|
||||
current.value = 0
|
||||
const param = {
|
||||
finishStatus: 'finished',
|
||||
wfStatus: 'running',
|
||||
taskAssignStatus: 'submitted',
|
||||
taskAssayStatus: 'submitted',
|
||||
finishStatus: 'not_start',
|
||||
flowStatus: 'not_start',
|
||||
assayOper: userInfo.value.realname
|
||||
}
|
||||
nx.$api.assayTask.getAssayTaskList(param).then(res => {
|
||||
taskList.value = res
|
||||
if (taskList.value.length > 0) {
|
||||
current.value = 0
|
||||
currentTask.value = taskList.value[0]
|
||||
currentTaskNo.value = taskList.value[0].taskNo
|
||||
currentTaskId.value = taskList.value[0].id
|
||||
getAssayTaskDetail(currentTaskNo.value)
|
||||
} else {
|
||||
current.value = 0
|
||||
currentTask.value = {}
|
||||
currentTaskNo.value = ''
|
||||
currentTaskId.value = ''
|
||||
getAssayTaskDetail(currentTask.value.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getAssayTaskDetail = taskNo => {
|
||||
const getAssayTaskDetail = businessAssayTaskId => {
|
||||
reviewNum.value = 0
|
||||
nx.$api.assayTaskTemplateKey
|
||||
.getAssayTaskDetailListByTaskNo({ taskNo })
|
||||
.then(res => {
|
||||
sampleList.value = res.result || []
|
||||
if (res.additionalProperties?.conAssayTask) {
|
||||
conAssayTask.value = res.additionalProperties.conAssayTask
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err)
|
||||
})
|
||||
nx.$api.assayTask.getAssayTaskDataList({ businessAssayTaskId }).then(res => {
|
||||
sampleList.value = res || []
|
||||
})
|
||||
}
|
||||
|
||||
const previewPDF = () => {
|
||||
const url = `/pages/analysis/sample/pdf-preview?taskId=${currentTaskId.value}&reportKey=${conAssayTask.value.assayTaskTemplateKey}`
|
||||
const { id, configReportTemplateKey } = currentTask.value
|
||||
const url = `/pages/analysis/sample/pdf-preview?businessAssayTaskId=${id}&reportKey=${configReportTemplateKey}`
|
||||
uni.navigateTo({ url })
|
||||
}
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
// getAssayTask()
|
||||
getAssayTask()
|
||||
})
|
||||
|
||||
onBackPress(() => {
|
||||
|
||||
Reference in New Issue
Block a user