|
@@ -113,7 +113,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view
|
|
<view
|
|
|
class="child-pipe-info"
|
|
class="child-pipe-info"
|
|
|
- @click="handleRouteToEquipmentDetail(childPipe, 'EQUIPMENT')"
|
|
|
|
|
|
|
+ @click="handleRouteToEquipmentDetail(pipeSet, 'EQUIPMENT')"
|
|
|
>
|
|
>
|
|
|
<view class="info-box">
|
|
<view class="info-box">
|
|
|
<text class="info-label">
|
|
<text class="info-label">
|
|
@@ -308,6 +308,14 @@
|
|
|
/>
|
|
/>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <EndDatePrompt
|
|
|
|
|
+ v-model:visible="showEndDatePrompt"
|
|
|
|
|
+ :loading="endDateLoading"
|
|
|
|
|
+ title="选择结束检验时间"
|
|
|
|
|
+ formatter="YYYY-MM-DD"
|
|
|
|
|
+ @confirm="handleEndDateConfirm"
|
|
|
|
|
+ />
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -332,10 +340,12 @@ import {
|
|
|
getPipeTaskItemListByOrderId,
|
|
getPipeTaskItemListByOrderId,
|
|
|
addInspectProject,
|
|
addInspectProject,
|
|
|
getInputIdByEquipId,
|
|
getInputIdByEquipId,
|
|
|
|
|
+ savePipeInputEndCheckDate,
|
|
|
} from '@/api/pipe/pipeTaskOrder'
|
|
} from '@/api/pipe/pipeTaskOrder'
|
|
|
import { updateEquipPipeSafetyManager } from '@/api/pipe/pipeEquip'
|
|
import { updateEquipPipeSafetyManager } from '@/api/pipe/pipeEquip'
|
|
|
import NavBar from '@/components/NavBar/NavBar.vue'
|
|
import NavBar from '@/components/NavBar/NavBar.vue'
|
|
|
import PipeCheckProject from '@/pages/taskOnline/components/PipeCheckProject.vue'
|
|
import PipeCheckProject from '@/pages/taskOnline/components/PipeCheckProject.vue'
|
|
|
|
|
+import EndDatePrompt from '@/components/EndDatePrompt/EndDatePrompt.vue'
|
|
|
|
|
|
|
|
interface PopupData {
|
|
interface PopupData {
|
|
|
text: string
|
|
text: string
|
|
@@ -411,6 +421,10 @@ const currentSelectedItems = ref<any[]>([])
|
|
|
const equipDataForPopup = ref<any>({})
|
|
const equipDataForPopup = ref<any>({})
|
|
|
const mainCheckerUser = ref<any>({})
|
|
const mainCheckerUser = ref<any>({})
|
|
|
|
|
|
|
|
|
|
+const showEndDatePrompt = ref(false)
|
|
|
|
|
+const endDatePromptContext = ref<{ item: any; pageType: string }>({ item: {}, pageType: '' })
|
|
|
|
|
+const endDateLoading = ref(false)
|
|
|
|
|
+
|
|
|
const currentSafeManager = computed(() => ({
|
|
const currentSafeManager = computed(() => ({
|
|
|
name: currentItem.value?.securityMan || '',
|
|
name: currentItem.value?.securityMan || '',
|
|
|
phone: currentItem.value?.securityManPhone || '',
|
|
phone: currentItem.value?.securityManPhone || '',
|
|
@@ -425,11 +439,14 @@ onShow(() => {
|
|
|
fetchPipeSetList()
|
|
fetchPipeSetList()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const endCheckDate = ref()
|
|
|
|
|
+
|
|
|
const fetchPipeSetList = async () => {
|
|
const fetchPipeSetList = async () => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
try {
|
|
try {
|
|
|
const res = await getPipeTaskItemListByOrderId({ id: orderId.value })
|
|
const res = await getPipeTaskItemListByOrderId({ id: orderId.value })
|
|
|
pipeSetList.value = res?.data?.orderItems || []
|
|
pipeSetList.value = res?.data?.orderItems || []
|
|
|
|
|
+ endCheckDate.value = res?.data?.endCheckDate || ''
|
|
|
mainCheckerUser.value = res?.data?.manager
|
|
mainCheckerUser.value = res?.data?.manager
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('获取管道工程列表失败:', error)
|
|
console.error('获取管道工程列表失败:', error)
|
|
@@ -865,20 +882,65 @@ const handleUpdateSafetyManagerConfirm = async (params: { name: string; phone: s
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const handleRouteToEquipmentDetail = async (item: any, pageType: string) => {
|
|
|
|
|
- uni.showLoading({ title: '加载中' })
|
|
|
|
|
|
|
+const navigateToEquipmentDetail = async (item: any, pageType: string, inputId?: string) => {
|
|
|
const equipPipeId = item.id
|
|
const equipPipeId = item.id
|
|
|
- const inputIdResp = await getInputIdByEquipId({ equipId: equipPipeId })
|
|
|
|
|
- if (inputIdResp.code != 0 || inputIdResp.data == '') {
|
|
|
|
|
- uni.showToast({ title: '查找设备信息失败', icon: 'none' })
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ let finalInputId = inputId
|
|
|
|
|
+ if (!finalInputId) {
|
|
|
|
|
+ uni.showLoading({ title: '加载中' })
|
|
|
|
|
+ const inputIdResp = await getInputIdByEquipId({ equipId: equipPipeId })
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
|
+ if (inputIdResp.code != 0 || inputIdResp.data == '') {
|
|
|
|
|
+ uni.showToast({ title: '查找设备信息失败', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ finalInputId = inputIdResp.data
|
|
|
}
|
|
}
|
|
|
- uni.hideLoading()
|
|
|
|
|
- const inputId = inputIdResp.data
|
|
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: `/pages/equipment/detail/equipmentDetail?orderId=${orderId.value}&orderItemId=${inputId}&equipId=${equipPipeId}&pageType=${pageType}&useOnline=1&canEdit=${true}`,
|
|
|
|
|
|
|
+ url: `/pages/equipment/detail/equipmentDetail?orderId=${orderId.value}&orderItemId=${finalInputId}&equipId=${equipPipeId}&pageType=${pageType}&useOnline=1&canEdit=${true}`,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const handleRouteToEquipmentDetail = (item: any, pageType: string) => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ pageType === 'INSPECT' &&
|
|
|
|
|
+ (endCheckDate.value == null || endCheckDate.value == '')
|
|
|
|
|
+ ) {
|
|
|
|
|
+ // 记录录入时,结束检验时间为空则弹出日期选择器供用户填写
|
|
|
|
|
+ endDatePromptContext.value = { item, pageType }
|
|
|
|
|
+ showEndDatePrompt.value = true
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ navigateToEquipmentDetail(item, pageType)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleEndDateConfirm = async (value: string) => {
|
|
|
|
|
+ const { item, pageType } = endDatePromptContext.value
|
|
|
|
|
+ endDateLoading.value = true
|
|
|
|
|
+ try {
|
|
|
|
|
+ // inputId 取自 getInputIdByEquipId,作为保存接口的 id 参数
|
|
|
|
|
+ const inputIdResp = await getInputIdByEquipId({ equipId: item.id })
|
|
|
|
|
+ if (inputIdResp.code != 0 || inputIdResp.data == '') {
|
|
|
|
|
+ uni.showToast({ title: '查找设备信息失败', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const inputId = inputIdResp.data
|
|
|
|
|
+
|
|
|
|
|
+ const res = await savePipeInputEndCheckDate({ id: inputId, endCheckDate: value })
|
|
|
|
|
+ if (res?.code !== 0) {
|
|
|
|
|
+ uni.showToast({ title: res?.msg || '保存结束检验时间失败', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 保存成功后更新本地数据并跳转页面(复用 inputId 避免重复查询)
|
|
|
|
|
+ endCheckDate.value = value
|
|
|
|
|
+ showEndDatePrompt.value = false
|
|
|
|
|
+ navigateToEquipmentDetail(item, pageType, inputId)
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ uni.showToast({ title: '保存失败', icon: 'none' })
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ endDateLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|