|
|
@@ -44,6 +44,9 @@
|
|
|
:order-id="orderId"
|
|
|
:order-item-id="orderItemId"
|
|
|
:equip-id="equipId"
|
|
|
+ v-model:current-pipe-set-index="currentPipeSetIndex"
|
|
|
+ :pipe-set-list="pipeSetList"
|
|
|
+ :current-pipe-set="currentPipeSet"
|
|
|
@update="handleBaseInfoUpdate"
|
|
|
/>
|
|
|
</view>
|
|
|
@@ -58,6 +61,9 @@
|
|
|
:order-id="orderId"
|
|
|
:order-item-id="orderItemId"
|
|
|
:equip-id="equipId"
|
|
|
+ v-model:current-pipe-set-index="currentPipeSetIndex"
|
|
|
+ :pipe-set-list="pipeSetList"
|
|
|
+ :current-pipe-set="currentPipeSet"
|
|
|
@update="handleEquipmentInfoUpdate"
|
|
|
/>
|
|
|
</view>
|
|
|
@@ -154,11 +160,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, computed, onMounted, watch } from 'vue'
|
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
|
-import {
|
|
|
- getFilterReport,
|
|
|
- getReportTemplateInfo,
|
|
|
- getReportTemplateBlob,
|
|
|
-} from '@/api/task'
|
|
|
+import { getFilterReport, getReportTemplateInfo, getReportTemplateBlob } from '@/api/task'
|
|
|
import { PressureCheckerMyTaskStatus, PressureReportType, EquipmentType } from '@/utils/dictMap'
|
|
|
import { isMainChecker, canViewCheckItem } from '@/utils/equipmentPermissions'
|
|
|
import { useUserStore } from '@/store/user'
|
|
|
@@ -183,16 +185,18 @@ import { TaskOrderFuncName, requestFunc } from '@/api/ApiRouter/taskOrder'
|
|
|
import { EquipFuncName, requestFunc as equipRequestFunc } from '@/api/ApiRouter/equipment'
|
|
|
import NavBar from '@/components/NavBar/NavBar.vue'
|
|
|
|
|
|
-
|
|
|
import { getEquipPipeByTaskOrderId } from '@/api/pipe/pipeEquip'
|
|
|
|
|
|
-
|
|
|
-
|
|
|
const currentTab = ref(0)
|
|
|
const dataSource = ref<any>({})
|
|
|
const pageLoading = ref(false)
|
|
|
const tabList = ref<any[]>([])
|
|
|
const isInspectMode = ref(false)
|
|
|
+const currentPipeSetIndex = ref(0)
|
|
|
+const pipeSetList = ref<any[]>([])
|
|
|
+const currentPipeSet = computed(() => {
|
|
|
+ return pipeSetList.value[currentPipeSetIndex.value] || null
|
|
|
+})
|
|
|
const showSelectUserPopup = ref(false)
|
|
|
const showCheckProject = ref(false)
|
|
|
const recheckUserGroupList = ref<any[]>([])
|
|
|
@@ -292,7 +296,7 @@ const initTabList = () => {
|
|
|
|
|
|
if (isInspectMode.value === true) {
|
|
|
tabs.push({ value: '检验项目', id: 'INSPECT' })
|
|
|
- }
|
|
|
+ }
|
|
|
// else {
|
|
|
// tabs.push({ value: '历年报告', id: 'HISTORY_REPORT' })
|
|
|
// }
|
|
|
@@ -350,19 +354,9 @@ const fetchGetOnlineEquipmentDetail = async () => {
|
|
|
)
|
|
|
.filter((item: any) => canViewCheckItem(item, userInfo.value, equipment))
|
|
|
|
|
|
- let equipResp = {}
|
|
|
- if (equipType === EquipmentType.PIPE) {
|
|
|
- equipResp = await getEquipPipeByTaskOrderId({ taskOrderId: orderId })
|
|
|
- } else {
|
|
|
- equipResp = await equipRequestFunc(EquipFuncName.EquipDetail, equipType, { id: equip.equipId })
|
|
|
- }
|
|
|
-
|
|
|
const taskInfo = {
|
|
|
...result.data,
|
|
|
- equipment: {
|
|
|
- ...equipResp.data,
|
|
|
- mainCheckerUser: equipment.mainCheckerUser
|
|
|
- },
|
|
|
+ equipment: {},
|
|
|
reportList: filteredReportList,
|
|
|
otherReportList: reportDic.otherReportList,
|
|
|
isMainChecker: isMain,
|
|
|
@@ -371,6 +365,22 @@ const fetchGetOnlineEquipmentDetail = async () => {
|
|
|
canViewAll: isMain,
|
|
|
},
|
|
|
}
|
|
|
+ let equipResp = {}
|
|
|
+ if (equipType === EquipmentType.PIPE) {
|
|
|
+ equipResp = await getEquipPipeByTaskOrderId({ taskOrderId: orderId })
|
|
|
+ taskInfo.equipment.pipeSetList = equipResp.data
|
|
|
+ taskInfo.equipment.mainCheckerUser = equipment.mainCheckerUser
|
|
|
+ pipeSetList.value = equipResp.data || []
|
|
|
+ } else {
|
|
|
+ equipResp = await equipRequestFunc(EquipFuncName.EquipDetail, equipType, {
|
|
|
+ id: equip.equipId,
|
|
|
+ })
|
|
|
+ taskInfo.equipment = {
|
|
|
+ ...equipResp.data,
|
|
|
+ mainCheckerUser: equipment.mainCheckerUser
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log('taskInfo......', taskInfo)
|
|
|
dataSource.value = taskInfo
|
|
|
if (reportDic?.otherReportList?.length && pageType !== 'OTHER_REPORT') {
|
|
|
tabList.value[3] = { value: '项目文件', id: 'OTHER_REPORT' }
|
|
|
@@ -433,7 +443,8 @@ const showSelectUserPopupFn = async (checkItem: any) => {
|
|
|
value: item.id,
|
|
|
}))
|
|
|
|
|
|
- const defaultOption = checkerUserOptionList.find((item: any) => item.value === mainCheckerUserId) || {}
|
|
|
+ const defaultOption =
|
|
|
+ checkerUserOptionList.find((item: any) => item.value === mainCheckerUserId) || {}
|
|
|
currentReckUser.value = defaultOption
|
|
|
selectedUserValue.value = defaultOption.value
|
|
|
recheckUserGroupList.value = checkerUserOptionList
|