|
@@ -5,10 +5,7 @@
|
|
|
<template #header>
|
|
|
<div class="text-18px">汇总分类</div>
|
|
|
</template>
|
|
|
- <div
|
|
|
- v-for="(item) in testOpt" :key="item.id" class="mb-4"
|
|
|
- :class="item.id === curItem?.id ? 'bg-slate-200' : ''" @click="handleItem(item)"
|
|
|
- >
|
|
|
+ <div v-for="(item) in testOpt" :key="item.id" class="mb-4" :class="item.id === curItem?.id ? 'bg-slate-200' : ''" @click="handleItem(item)">
|
|
|
<i class="ri-circle-fill" />
|
|
|
{{ item.className }}
|
|
|
</div>
|
|
@@ -18,24 +15,18 @@
|
|
|
<template #header>
|
|
|
<div class="w-50">
|
|
|
<el-select v-model="searchForm.contractId" placeholder="请选择" @change="changeContract">
|
|
|
- <el-option
|
|
|
- v-for="item in contractOptions" :key="item.id" :label="item.contractName"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
+ <el-option v-for="item in contractOptions" :key="item.id" :label="item.contractName" :value="item.id" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="ml-2 w-40">
|
|
|
- <el-select
|
|
|
- v-model="searchForm.detectionType" clearable block placeholder="检测类别"
|
|
|
- @change="changeType"
|
|
|
- >
|
|
|
+ <el-select v-model="searchForm.detectionType" clearable block placeholder="检测类别" @change="changeType">
|
|
|
<el-option v-for="item in typeData" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="ml-2 w-40">
|
|
|
<el-select v-model="searchForm.key1" clearable block placeholder="单位类型">
|
|
|
- <el-option label="测试1" value="1" />
|
|
|
- <el-option label="测试2" value="2" />
|
|
|
+ <el-option label="无接口1" value="1" />
|
|
|
+ <el-option label="无接口2" value="2" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="ml-2 w-64">
|
|
@@ -119,16 +110,20 @@
|
|
|
</hc-new-dialog>
|
|
|
|
|
|
<!-- 查阅关联 -->
|
|
|
- <hc-dialog
|
|
|
- v-model="isRelatedSearch" :footer="false" is-table title="查阅关联" widths="80%" :padding="false"
|
|
|
- @close="relatedSearchModalClose"
|
|
|
- >
|
|
|
+ <hc-dialog v-model="isRelatedSearch" :footer="false" is-table title="查阅关联" widths="80%" :padding="false" @close="relatedSearchModalClose">
|
|
|
<div class="hc-related-search-box relative mt-10px">
|
|
|
<hc-card-item title="样品信息">
|
|
|
<hc-table :column="relatedColumn1" :datas="relatedData1" :is-index="false" />
|
|
|
</hc-card-item>
|
|
|
<hc-card-item title="委托单信息" class="mt-14px">
|
|
|
- <hc-table :column="relatedColumn2" :datas="relatedData2" :is-index="false" />
|
|
|
+ <hc-table :column="relatedColumn2" :datas="relatedData2" :is-index="false">
|
|
|
+ <template #status="{ row }">
|
|
|
+ <el-tag v-if="row.status === 1" type="info" effect="dark">未上报</el-tag>
|
|
|
+ <el-tag v-if="row.status === 2" type="warning" effect="dark">已上报-待审批</el-tag>
|
|
|
+ <el-tag v-if="row.status === 3" type="primary" effect="dark">待试验</el-tag>
|
|
|
+ <el-tag v-if="row.status === 4" type="success" effect="dark">委托完成</el-tag>
|
|
|
+ </template>
|
|
|
+ </hc-table>
|
|
|
</hc-card-item>
|
|
|
<hc-card-item title="设备采集信息" class="mt-14px">
|
|
|
<hc-table :column="relatedColumn3" :datas="relatedData3" :is-index="false" />
|
|
@@ -141,11 +136,14 @@
|
|
|
<script setup>
|
|
|
import { onMounted, ref, watch } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
-import { download, getContractList, getPage, getSummaryList, removeByIds, save } from '~api/tentative/collect/test'
|
|
|
-import { arrToId, getArrValue, isString } from 'js-fast-way'
|
|
|
+import { arrToId, getArrValue, getObjVal, isNullES, isString } from 'js-fast-way'
|
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
|
import { getDictionary } from '~api/other'
|
|
|
import { toPdfPage } from '~uti/btn-auth'
|
|
|
+import dataApi from '~api/tentative/detect/test'
|
|
|
+import testSampleApi from '~api/tentative/material/testSample'
|
|
|
+import commissionApi from '~api/tentative/detect/commission'
|
|
|
+import { download, getContractList, getPage, getSummaryList, removeByIds, save } from '~api/tentative/collect/test'
|
|
|
|
|
|
//变量
|
|
|
const useAppState = useAppStore()
|
|
@@ -275,7 +273,7 @@ const tableColumn = ref([
|
|
|
{ key: 'classIdName', name: '汇总类别' },
|
|
|
{ key: 'detectionTypeName', name: '检测类型' },
|
|
|
{ key: 'summaryDateName', name: '汇总日期' },
|
|
|
- { key: 'key1', name: '单位类型' },
|
|
|
+ { key: 'no-key', name: '单位类型' },
|
|
|
{ key: 'action', name: '操作', width: 100 },
|
|
|
])
|
|
|
|
|
@@ -423,34 +421,53 @@ const downClick = async () => {
|
|
|
const isRelatedSearch = ref(false)
|
|
|
const relatedSearchClick = (row) => {
|
|
|
isRelatedSearch.value = true
|
|
|
+ //获取样品信息
|
|
|
+ getSampleList(row.id)
|
|
|
+ //获取委托单
|
|
|
+ getCommissionData(row.entrustId)
|
|
|
+ //获取关联设备
|
|
|
+ getAcquisitionData(row.loadDataId)
|
|
|
}
|
|
|
|
|
|
//样品信息
|
|
|
const relatedColumn1 = [
|
|
|
- { key: 'key1', name: '取样名称' },
|
|
|
- { key: 'key2', name: '取样日期' },
|
|
|
- { key: 'key3', name: '取样编号' },
|
|
|
- { key: 'key4', name: '规格型号' },
|
|
|
- { key: 'key5', name: '试样数量' },
|
|
|
- { key: 'key6', name: '计算单位' },
|
|
|
- { key: 'key7', name: '拟用部位' },
|
|
|
- { key: 'key8', name: '代表数量' },
|
|
|
- { key: 'key9', name: '取样人' },
|
|
|
- { key: 'key10', name: '入库时间' },
|
|
|
- { key: 'key11', name: '试验时间' },
|
|
|
- { key: 'key12', name: '样品处理' },
|
|
|
- { key: 'key13', name: '时间(或处理原因)' },
|
|
|
+ { key: 'materialName', name: '样品名称' },
|
|
|
+ { key: 'samplingDate', name: '取样日期' },
|
|
|
+ { key: 'specificationNumber', name: '样品编号' },
|
|
|
+ { key: 'specificationModel', name: '规格型号' },
|
|
|
+ { key: 'materialCount', name: '试样数量' },
|
|
|
+ { key: 'calculationUnit', name: '计算单位' },
|
|
|
+ { key: 'proposedPosition', name: '拟用部位' },
|
|
|
+ { key: 'representativeCount', name: '代表数量' },
|
|
|
+ { key: 'userName', name: '取样人' },
|
|
|
+ { key: 'carryTime', name: '入库时间', align: 'center' },
|
|
|
+ { key: 'createTime', name: '试验时间', align: 'center' },
|
|
|
+ { key: 'no-key', name: '样品处理' },
|
|
|
+ { key: 'no-key', name: '时间(或处理原因)' },
|
|
|
]
|
|
|
const relatedData1 = ref([])
|
|
|
+const getSampleList = async (id) => {
|
|
|
+ relatedData1.value = []
|
|
|
+ if (isNullES(id) || id == 0) return
|
|
|
+ const { data } = await dataApi.getSampleList({ id })
|
|
|
+ relatedData1.value = getArrValue(data)
|
|
|
+}
|
|
|
|
|
|
//委托单信息
|
|
|
const relatedColumn2 = [
|
|
|
- { key: 'key1', name: '委托单位' },
|
|
|
- { key: 'key2', name: '委托单编号' },
|
|
|
- { key: 'key3', name: '委托名称' },
|
|
|
- { key: 'key4', name: '委托状态' },
|
|
|
+ { key: 'entrustInfo', name: '委托单位' },
|
|
|
+ { key: 'entrustNo', name: '委托单编号' },
|
|
|
+ { key: 'entrustName', name: '委托单名称' },
|
|
|
+ { key: 'status', name: '委托单状态', width: 120, align: 'center' },
|
|
|
]
|
|
|
const relatedData2 = ref([])
|
|
|
+const getCommissionData = async (id) => {
|
|
|
+ relatedData2.value = []
|
|
|
+ if (isNullES(id) || id == 0) return
|
|
|
+ const { data } = await commissionApi.detail(id)
|
|
|
+ const res = getObjVal(data)
|
|
|
+ relatedData2.value = res ? [res] : []
|
|
|
+}
|
|
|
|
|
|
//设备采集信息
|
|
|
const relatedColumn3 = [
|
|
@@ -484,10 +501,18 @@ const relatedColumn3 = [
|
|
|
{ key: 'key23', name: '试验结果是否合格', width: 100, align: 'center' },
|
|
|
]
|
|
|
const relatedData3 = ref([])
|
|
|
+const getAcquisitionData = async (id) => {
|
|
|
+ relatedData3.value = []
|
|
|
+ if (isNullES(id) || id == 0) return
|
|
|
+ console.log(11)
|
|
|
+}
|
|
|
|
|
|
//关闭关联查阅
|
|
|
const relatedSearchModalClose = () => {
|
|
|
isRelatedSearch.value = false
|
|
|
+ relatedData1.value = []
|
|
|
+ relatedData2.value = []
|
|
|
+ relatedData3.value = []
|
|
|
}
|
|
|
</script>
|
|
|
|