|
|
@@ -84,6 +84,7 @@
|
|
|
:fetch-get-equipment-detail="fetchGetOnlineEquipmentDetail"
|
|
|
:refresh-detail="refreshDetail"
|
|
|
:show-select-user-popup="showSelectUserPopupFn"
|
|
|
+ :show-batch-select-user-popup="showBatchSelectUserPopupFn"
|
|
|
:show-check-project-popup-fn="showCheckProjectPopup"
|
|
|
:handle-association-operation-manual="handleAssociationOperationManual"
|
|
|
@update-report-list="handleUpdateReportList"
|
|
|
@@ -97,7 +98,10 @@
|
|
|
</view> -->
|
|
|
|
|
|
<!-- 记录文件 Tab -->
|
|
|
- <view v-if="(currentTab === 3 && isInspectMode) || (currentTab === 2 && !isInspectMode)" class="tab-content">
|
|
|
+ <view
|
|
|
+ v-if="(currentTab === 3 && isInspectMode) || (currentTab === 2 && !isInspectMode)"
|
|
|
+ class="tab-content"
|
|
|
+ >
|
|
|
<OtherReport
|
|
|
:refresh-detail="refreshDetail"
|
|
|
:other-report-list="dataSource?.otherReportList"
|
|
|
@@ -171,6 +175,7 @@ import { EquipFuncName, requestFunc as equipRequestFunc } from '@/api/ApiRouter/
|
|
|
import NavBar from '@/components/NavBar/NavBar.vue'
|
|
|
|
|
|
import { getEquipPipeByTaskOrderId } from '@/api/pipe/pipeEquip'
|
|
|
+import eventBus from '@/utils/eventBus'
|
|
|
|
|
|
const currentTab = ref(0)
|
|
|
const dataSource = ref<any>({})
|
|
|
@@ -191,6 +196,7 @@ const recheckUserColumn = computed(() => [
|
|
|
])
|
|
|
const currentReckUser = ref<any>(null)
|
|
|
const currentCheckItem = ref<any>(null)
|
|
|
+const currentBatchCheckItems = ref<any[]>([])
|
|
|
|
|
|
const checkProjectList = ref<any[][]>([])
|
|
|
const selectTemplates = ref<Record<string, any[]>>({})
|
|
|
@@ -349,13 +355,13 @@ const fetchGetOnlineEquipmentDetail = async () => {
|
|
|
})
|
|
|
taskInfo.equipment = {
|
|
|
...equipResp.data,
|
|
|
- mainCheckerUser: equipment.mainCheckerUser
|
|
|
+ mainCheckerUser: equipment.mainCheckerUser,
|
|
|
}
|
|
|
}
|
|
|
// console.log('taskInfo......', taskInfo)
|
|
|
dataSource.value = taskInfo
|
|
|
if (reportDic?.otherReportList?.length && pageType !== 'OTHER_REPORT') {
|
|
|
- if(isInspectMode.value === true) {
|
|
|
+ if (isInspectMode.value === true) {
|
|
|
tabList.value[3] = { value: '项目文件', id: 'OTHER_REPORT' }
|
|
|
} else {
|
|
|
tabList.value[2] = { value: '项目文件', id: 'OTHER_REPORT' }
|
|
|
@@ -434,6 +440,44 @@ const showSelectUserPopupFn = async (checkItem: any) => {
|
|
|
// 关闭选择校核人弹窗
|
|
|
const closeSelectUserPopup = () => {
|
|
|
showSelectUserPopup.value = false
|
|
|
+ currentBatchCheckItems.value = []
|
|
|
+}
|
|
|
+
|
|
|
+// 显示批量选择校核人弹窗
|
|
|
+const showBatchSelectUserPopupFn = async (checkItems: any[]) => {
|
|
|
+ if (useOnline !== '1') {
|
|
|
+ uni.showToast({ title: '当前网络不可用', icon: 'error' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ currentBatchCheckItems.value = checkItems
|
|
|
+ currentCheckItem.value = null
|
|
|
+
|
|
|
+ try {
|
|
|
+ const mainCheckerUserId = dataSource.value?.equipment.mainCheckerUser?.id
|
|
|
+
|
|
|
+ const userRes: any = await requestFunc(TaskOrderFuncName.RecheckUserList, equipType, {
|
|
|
+ nickName: '',
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 200,
|
|
|
+ orderId: dataSource.value?.taskOrder?.id,
|
|
|
+ })
|
|
|
+ const checkerUserOptionList = (userRes?.data?.list || []).map((item: any) => ({
|
|
|
+ ...item,
|
|
|
+ label: item.nickname,
|
|
|
+ value: item.id,
|
|
|
+ }))
|
|
|
+
|
|
|
+ const defaultOption =
|
|
|
+ checkerUserOptionList.find((item: any) => item.value === mainCheckerUserId) || {}
|
|
|
+ currentReckUser.value = defaultOption
|
|
|
+ selectedUserValue.value = defaultOption.value
|
|
|
+ recheckUserGroupList.value = checkerUserOptionList
|
|
|
+
|
|
|
+ showSelectUserPopup.value = true
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取校核人列表失败:', error)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 用户选择变化
|
|
|
@@ -450,21 +494,26 @@ const confirmSelectUser = async () => {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
+ uni.showLoading({ title: '提交中...' })
|
|
|
const params = {
|
|
|
- id: currentCheckItem.value?.id,
|
|
|
recheckId: selectedUserValue.value,
|
|
|
+ reportList: currentBatchCheckItems.value.map((item: any) => ({ id: item.id })),
|
|
|
}
|
|
|
-
|
|
|
- // console.log('提交校核参数:.....', params)
|
|
|
const result: any = await requestFunc(TaskOrderFuncName.SubmitRecheck, equipType, params)
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
if (result?.code === 0) {
|
|
|
uni.showToast({ title: '提交校核成功', icon: 'success' })
|
|
|
- closeSelectUserPopup()
|
|
|
- refreshDetail()
|
|
|
} else {
|
|
|
- uni.showToast({ title: result?.msg || '提交失败', icon: 'error' })
|
|
|
+ uni.showToast({
|
|
|
+ title: result?.msg || '提交失败',
|
|
|
+ icon: 'none',
|
|
|
+ })
|
|
|
}
|
|
|
+ closeSelectUserPopup()
|
|
|
+ eventBus.emit('RefreshInspectProject')
|
|
|
} catch (error: any) {
|
|
|
+ uni.hideLoading()
|
|
|
console.error('提交校核失败:', error)
|
|
|
uni.showToast({ title: error?.msg || '提交失败', icon: 'error' })
|
|
|
}
|