焊接日报

This commit is contained in:
2026-06-11 09:43:42 +08:00
parent 2c8af0f2e0
commit 06781c69e1
14 changed files with 713 additions and 24 deletions
+3 -2
View File
@@ -133,8 +133,9 @@
}
const handleItemClick = (item) => {
console.log('点击列表项:', item)
// TODO: 跳转详情
uni.navigateTo({
url: `/pipe/diankou/port_list?id=${item.PointBatchId}&code=${item.PointBatchCode}`
})
}
</script>
+113
View File
@@ -0,0 +1,113 @@
<template>
<view class="page-list">
<!-- 操作按钮区域 -->
<view class="action-bar">
<view class="action-btn" @click="handleAutoPoint">自动点口</view>
<view class="action-btn" @click="handleForceClose">强制关闭批</view>
<view class="action-btn" @click="handleAdjust">点口调整</view>
</view>
<!-- 批号信息 -->
<view class="batch-info">
<text class="batch-label">批号</text>
<text class="batch-value">{{ PointBatchCode || '--' }}</text>
<view class="batch-refresh" @click="handleRefresh">
<u-icon name="reload" :size="36" :class="{ rotating: loading }"></u-icon>
</view>
</view>
<!-- 列表内容 -->
<view class="list-scroll">
<!-- 加载中 -->
<view v-if="loading" class="loading-box">
<u-loading mode="circle" size="40"></u-loading>
<text class="loading-text">加载中...</text>
</view>
<!-- 数据列表 -->
<view v-else class="list-wrap">
<view v-for="(item, index) in listData" :key="item.id || index" class="card-item">
<view class="card-row">
<text class="card-label">管线号</text>
<text class="card-value">{{ item.PipelineCode || '--' }}</text>
</view>
<view class="card-row">
<text class="card-label">焊口代号</text>
<text class="card-value">{{ item.WeldJointCode || '--' }}</text>
</view>
<view class="card-row">
<text class="card-label">状态</text>
<view class="card-tag" :class="{ done: item.PointState == '1' }">
{{ item.PointState == '1' ? '已点' : '未点' }}
</view>
</view>
</view>
<!-- 空状态 -->
<u-empty v-if="listData.length === 0" mode="list" text="暂无数据"></u-empty>
</view>
</view>
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { reqGetPointBatchDetail } from '@/api/hj.js'
// ===== 参数 =====
const pointBatchId = ref('')
const PointBatchCode = ref('')
// ===== 列表数据 =====
const listData = ref([])
const loading = ref(false)
// 加载数据
const fetchData = async () => {
if (loading.value) return
loading.value = true
try {
const res = await reqGetPointBatchDetail(pointBatchId.value)
listData.value = res.data || []
} catch (error) {
console.error('加载数据失败:', error)
uni.showToast({ title: '加载失败,请重试', icon: 'none' })
} finally {
loading.value = false
}
}
const handleRefresh = () => {
fetchData()
}
// 自动点口
const handleAutoPoint = async () => {
// TODO: 调用自动点口 API
uni.showToast({ title: '自动点口成功', icon: 'none' })
fetchData()
}
// 强制关闭批
const handleForceClose = async () => {
// TODO: 调用强制关闭批 API
uni.showToast({ title: '强制关闭批成功', icon: 'none' })
fetchData()
}
// 点口调整
const handleAdjust = () => {
// TODO: 跳转到点口调整页面
uni.showToast({ title: '功能开发中', icon: 'none' })
}
// ===== 生命周期 =====
onLoad((opt) => {
pointBatchId.value = opt.id
PointBatchCode.value = opt.code
fetchData()
})
</script>
View File
+27
View File
@@ -0,0 +1,27 @@
<template>
<view class="page-grid">
<!-- 卡片列表 -->
<view class="grid-card">
<view class="grid-list">
<view class="grid-item" @click="handleClick('/pipe/pressure/condition')">
<view class="grid-icon">
<u-icon name="info-circle" :size="60" :color="$u.type.primary"></u-icon>
</view>
<text class="grid-text">试压前条件确认</text>
</view>
<view class="grid-item" @click="handleClick('/pipe/pressure/check')">
<view class="grid-icon">
<u-icon name="checkmark-circle" :size="60" :color="$u.type.primary"></u-icon>
</view>
<text class="grid-text">尾项检查及消项</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
const handleClick = (url) => {
uni.navigateTo({ url })
}
</script>
+208
View File
@@ -0,0 +1,208 @@
<template>
<view class="page-detail">
<!-- 信息列表 -->
<view class="info-group">
<view class="info-item">
<text class="info-label">管线</text>
<text class="info-value">{{ form.PipelineCode || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">焊口</text>
<text class="info-value">{{ form.WeldJointCode || '--' }}</text>
</view>
<view class="info-item info-link" @click="handleShowLocationSelect">
<text class="info-label">焊口位置</text>
<text
class="info-value">{{ form.WeldingLocationCode?`${form.WeldingLocationCode}(${form.WeldingLocationName})` : '请选择' }}</text>
<u-icon name="arrow-right" :size="28" color="#ccc"></u-icon>
</view>
<view class="info-item">
<text class="info-label">焊接日期</text>
<text class="info-value">{{ form.WeldingDate || '--' }}</text>
</view>
<view class="info-item info-link" @click="showTypePicker = true">
<text class="info-label">焊工类型</text>
<text class="info-value">{{ form.welderTypeName || '请选择' }}</text>
<u-icon name="arrow-right" :size="28" color="#ccc"></u-icon>
</view>
<view class="info-item">
<text class="info-label">焊工</text>
<text class="info-value">{{ form.welderName || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">材质1</text>
<text class="info-value">{{ form.Material1Code || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">材质2</text>
<text class="info-value">{{ form.Material2Code || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">达因</text>
<text class="info-value">{{ form.Size || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">外径</text>
<text class="info-value">{{ form.Dia || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">DN公称直径</text>
<text class="info-value">{{ form.DNDia || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">壁厚</text>
<text class="info-value">{{ form.Thickness || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">规格</text>
<text class="info-value">{{ form.Specification || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">焊接方法</text>
<text class="info-value">{{ form.WeldingMethodCode || '--' }}</text>
</view>
<view class="info-item">
<text class="info-label">焊缝类型</text>
<text class="info-value">{{ form.WeldTypeCode || '--' }}</text>
</view>
</view>
<!-- 底部按钮 -->
<view class="bottom-btns">
<u-button v-if="!form.WeldingDate" class="btn-submit" size="medium" type="primary"
@click="handleReport">填报</u-button>
<u-button v-if="form.WeldingDailyId" class="btn-point" size="medium" type="primary"
@click="handlePoint">点口</u-button>
<u-button class="btn-cancel" size="medium" @click="handleClose">取消</u-button>
</view>
<!-- 焊口位置选择弹窗 -->
<nbd-select v-model="showLocationPicker" :show-search="true" title="选择焊口位置" :list="locationList"
label-key="BaseInfoCode" value-key="BaseInfoId" @confirm="handleConfirmLocation" />
<!-- 焊工类型选择弹窗 -->
<nbd-select v-model="showTypePicker" title="选择焊工类型" :list="welderTypeList" label-key="BaseInfoName"
value-key="BaseInfoCode" @confirm="handleConfirmType" />
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import {
reqGetWeldJointByWeldJointId,
reqSaveWeldingDailyByWeldJointId,
reqGetManualPointSave
} from '@/api/hj.js'
import {
getWeldingLocation
} from '@/api/base.js'
import { useUserStore } from '@/store'
const userStroe = useUserStore()
const {userInfo} = userStroe
// ===== 表单数据 =====
const form = ref({})
// ===== 弹窗 =====
const showLocationPicker = ref(false)
const showTypePicker = ref(false)
const locationList = ref([])
const welderTypeList = ref([{
BaseInfoName: '打底/盖面',
BaseInfoCode: 0
},
{
BaseInfoName: '打底',
BaseInfoCode: 1
},
{
BaseInfoName: '盖面',
BaseInfoCode: 2
},
])
// ===== 弹窗 ========
// 焊口位置弹窗
const handleShowLocationSelect = () => {
getWeldingLocation().then(res => {
locationList.value = res.data
showLocationPicker.value = true
})
}
// ===== 选择回调 =====
const handleConfirmLocation = (item) => {
form.value.WeldingLocationCode = item.BaseInfoCode
form.value.WeldingLocationName = item.BaseInfoName
form.value.WeldingLocationId = item.BaseInfoId
showLocationPicker.value = false
}
const handleConfirmType = (item) => {
form.value.welderType = item.BaseInfoCode
form.value.welderTypeName = item.BaseInfoName
showTypePicker.value = false
}
// ===== 操作 =====
const handlePoint = async () => {
// TODO: 调用点口 API
const res = await reqGetManualPointSave(form.value.WeldJointId)
uni.showToast({
title: '点口成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
// 填报事件
const handleReport = async () => {
uni.showModal({
title: '信息提示',
content: '确定要填报吗?',
success: async (res) => {
if (res.confirm) {
// TODO: 调用填报 API
const result = await reqSaveWeldingDailyByWeldJointId(
form.value.WeldJointId,
userInfo.value.PersonId,
$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd'),
form.value.WeldingLocationId,
form.value.welderType
)
uni.showToast({
title: '保存成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
}
})
}
const handleClose = () => {
uni.navigateBack()
}
// ===== 生命周期 =====
onLoad((opt) => {
reqGetWeldJointByWeldJointId(opt.id).then(res => {
form.value = res.data || {}
if (form.value.CoverWelderName) {
form.value.welderName = form.value.CoverWelderName
}
if (form.value.BackingWelderName) {
form.value.welderName += '/' + form.value.BackingWelderName
}
form.value.welderType = 0
form.value.welderTypeName = "打底/盖面"
})
})
</script>