This commit is contained in:
2026-06-24 20:50:15 +08:00
parent 41623ecb32
commit 9e9826acbb
9 changed files with 738 additions and 586 deletions
+31 -197
View File
@@ -67,44 +67,22 @@
</view>
<!-- 焊前拍照 -->
<view class="info-group photo-section">
<view class="section">
<view class="section-header">
<text class="section-title">焊前拍照</text>
<text class="section-tip" v-if="beforePhotoList.length === 0">请拍摄焊接前照片</text>
</view>
<view class="photo-grid">
<view class="photo-item" v-for="(photo, index) in beforePhotoList" :key="photo._id">
<image class="photo-img" :src="photo.src" mode="aspectFill" @click="previewPhoto(beforePhotoList, index)"></image>
<view class="photo-tag" v-if="photo.uploaded">&#10003;</view>
<view class="photo-delete" @tap.stop="deletePhoto(beforePhotoList, index)">
<u-icon name="close" color="#fff" size="14"></u-icon>
</view>
</view>
<view class="photo-item photo-add" @click="handleTakeBeforePhoto" v-if="beforePhotoList.length < 6">
<u-icon name="camera" color="#ccc" size="40"></u-icon>
<text class="add-text">拍照</text>
</view>
<view class="section-body">
<nbd-photo-upload ref="beforePhotoRef" v-model:attachUrl="preWeldAttachUrl" typeName="WeldingDaily_Before" />
</view>
</view>
<!-- 焊后拍照 -->
<view class="info-group photo-section">
<view class="section">
<view class="section-header">
<text class="section-title">焊后拍照</text>
<text class="section-tip" v-if="afterPhotoList.length === 0">请拍摄焊接后照片</text>
</view>
<view class="photo-grid">
<view class="photo-item" v-for="(photo, index) in afterPhotoList" :key="photo._id">
<image class="photo-img" :src="photo.src" mode="aspectFill" @click="previewPhoto(afterPhotoList, index)"></image>
<view class="photo-tag" v-if="photo.uploaded">&#10003;</view>
<view class="photo-delete" @tap.stop="deletePhoto(afterPhotoList, index)">
<u-icon name="close" color="#fff" size="14"></u-icon>
</view>
</view>
<view class="photo-item photo-add" @click="handleTakeAfterPhoto" v-if="afterPhotoList.length < 6">
<u-icon name="camera" color="#ccc" size="40"></u-icon>
<text class="add-text">拍照</text>
</view>
<view class="section-body">
<nbd-photo-upload ref="afterPhotoRef" v-model:attachUrl="postWeldAttachUrl" typeName="WeldingDaily_After" />
</view>
</view>
@@ -127,14 +105,17 @@
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { reqGetWeldJointByWeldJointId, reqSaveWeldingDailyByWeldJointId, reqGetManualPointSave } from '@/api/hj.js'
import { reqWeldingLocation, uploadAttach } from '@/api/base.js'
import { baseFileUrl, parseAttachUrls } from '@/utils/request.js'
import { reqWeldingLocation } from '@/api/base.js'
import { useUserStore } from '@/store'
const userStore = useUserStore()
const { userInfo } = userStore
// ===== 表单数据 =====
const form = ref({})
const preWeldAttachUrl = ref('')
const postWeldAttachUrl = ref('')
// ===== 弹窗 =====
const showLocationPicker = ref(false)
@@ -146,79 +127,8 @@
{ BaseInfoName: '盖面', BaseInfoCode: 2 },
])
// ===== 照片数据 =====
const beforePhotoList = ref([])
const afterPhotoList = ref([])
let photoIdSeed = 0
// ===== 拍照(只存本地,等填报时统一上传) =====
const handleTakeBeforePhoto = () => takePhoto(beforePhotoList)
const handleTakeAfterPhoto = () => takePhoto(afterPhotoList)
const takePhoto = (listRef) => {
uni.chooseImage({
count: 1,
sourceType: ['camera'],
success: (res) => {
const tempPath = res.tempFilePaths[0]
const id = ++photoIdSeed
listRef.value.push({
_id: id,
src: tempPath,
uploaded: false
})
}
})
}
// ===== 是否需要上传(本地临时路径才需要) =====
const isLocalPath = (src) => src && !src.startsWith(baseFileUrl)
// ===== 批量上传 =====
const uploadAllPhotos = async (listRef, typeName) => {
const photos = listRef.value.filter(p => !p.uploaded && isLocalPath(p.src))
const urls = []
for (const photo of photos) {
photo.uploading = true
photo.progress = 0
try {
const result = await uploadAttach(photo.src, { typeName }, (progress) => {
photo.progress = progress
})
photo.uploading = false
photo.uploaded = true
photo.result = result
const url = Array.isArray(result) ? result[0] : result
if (url) {
urls.push(url)
photo.src = `${baseFileUrl}${url}`
}
} catch (e) {
photo.uploading = false
}
}
return urls
}
const hasPendingBefore = () => beforePhotoList.value.some(p => !p.uploaded && isLocalPath(p.src))
const hasPendingAfter = () => afterPhotoList.value.some(p => !p.uploaded && isLocalPath(p.src))
// ===== 预览照片 =====
const previewPhoto = (list, index) => {
const urls = list.map(p => p.src)
uni.previewImage({ current: index, urls })
}
// ===== 删除照片 =====
const deletePhoto = (list, index) => {
uni.showModal({
title: '确认删除',
content: '确定要删除这张照片吗?',
success: ({ confirm }) => {
if (confirm) list.splice(index, 1)
}
})
}
const beforePhotoRef = ref(null)
const afterPhotoRef = ref(null)
// ===== 弹窗 ========
const handleShowLocationSelect = () => {
@@ -254,29 +164,13 @@
content: '确定要填报吗?',
success: async ({ confirm }) => {
if (confirm) {
const needBefore = hasPendingBefore()
const needAfter = hasPendingAfter()
let PreWeldAttachUrl = form.value.PreWeldAttachUrl || ''
let PostWeldAttachUrl = form.value.PostWeldAttachUrl || ''
console.log(beforePhotoRef.value?.hasPending())
const needBefore = beforePhotoRef.value?.hasPending()
const needAfter = afterPhotoRef.value?.hasPending()
if (needBefore || needAfter) {
uni.showLoading({ title: '上传照片中...', mask: true })
if (needBefore) {
const urls = await uploadAllPhotos(beforePhotoList, 'WeldingDaily_Before')
if (urls.length) {
PreWeldAttachUrl = PreWeldAttachUrl
? PreWeldAttachUrl + ',' + urls.join(',')
: urls.join(',')
}
}
if (needAfter) {
const urls = await uploadAllPhotos(afterPhotoList, 'WeldingDaily_After')
if (urls.length) {
PostWeldAttachUrl = PostWeldAttachUrl
? PostWeldAttachUrl + ',' + urls.join(',')
: urls.join(',')
}
}
if (needBefore) await beforePhotoRef.value.uploadAll()
if (needAfter) await afterPhotoRef.value.uploadAll()
uni.hideLoading()
}
@@ -286,8 +180,8 @@
time: form.value.WeldingDateTemp,
weldingLocation: form.value.WeldingLocationId || '',
welderType: form.value.welderType,
PreWeldAttachUrl,
PostWeldAttachUrl
PreWeldAttachUrl: preWeldAttachUrl.value || form.value.PreWeldAttachUrl || '',
PostWeldAttachUrl: postWeldAttachUrl.value || form.value.PostWeldAttachUrl || ''
})
uni.showToast({ title: '保存成功', icon: 'none' })
setTimeout(() => { uni.navigateBack() }, 1500)
@@ -315,95 +209,35 @@
form.value.welderTypeName = "打底/盖面"
// 回显已有照片
beforePhotoList.value = parseAttachUrls(form.value.PreWeldAttachUrl, photoIdSeed)
photoIdSeed += beforePhotoList.value.length
afterPhotoList.value = parseAttachUrls(form.value.PostWeldAttachUrl, photoIdSeed)
photoIdSeed += afterPhotoList.value.length
preWeldAttachUrl.value = form.value.PreWeldAttachUrl || ''
postWeldAttachUrl.value = form.value.PostWeldAttachUrl || ''
})
})
</script>
<style scoped lang="scss">
.photo-section {
.section {
background: #ffffff;
margin: 24rpx;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
.section-header {
padding: 24rpx 32rpx 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 32rpx 16rpx;
.section-title {
font-size: 28rpx;
font-weight: 600;
color: #333;
}
.section-tip {
font-size: 24rpx;
color: #999;
}
}
.photo-grid {
display: flex;
flex-wrap: wrap;
.section-body {
padding: 0 24rpx 24rpx;
gap: 16rpx;
}
.photo-item {
width: 200rpx;
height: 200rpx;
border-radius: 12rpx;
overflow: hidden;
position: relative;
background: #f5f6f8;
.photo-img {
width: 100%;
height: 100%;
}
.photo-tag {
position: absolute;
top: 6rpx;
left: 6rpx;
width: 36rpx;
height: 36rpx;
border-radius: 50%;
background: rgba(0, 200, 83, 0.85);
color: #fff;
font-size: 22rpx;
display: flex;
align-items: center;
justify-content: center;
}
.photo-delete {
position: absolute;
top: 6rpx;
right: 6rpx;
width: 36rpx;
height: 36rpx;
border-radius: 50%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
}
}
.photo-add {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 2rpx dashed #ddd;
.add-text {
font-size: 24rpx;
color: #ccc;
margin-top: 8rpx;
}
}
}
</style>
+419 -358
View File
@@ -22,8 +22,9 @@
<text class="section__title">坡口类型</text>
</view>
<view class="card">
<view class="card__row" :class="{ 'card__row--warn': !form.GrooveTypeName }" @click="showGroovePicker = true">
<text class="card__label">坡口类型名称</text>
<view class="card__row" :class="{ 'card__row--warn': !form.GrooveTypeName }"
@click="showGroovePicker = true">
<text class="card__label"><text class="required">*</text>坡口类型名称</text>
<view class="card__value-wrap card__value-wrap--clickable">
<text class="card__value" :class="{ 'card__value--placeholder': !form.GrooveTypeName }">
{{ form.GrooveTypeName || '请选择坡口类型' }}
@@ -37,7 +38,9 @@
</view>
<view class="card__row">
<text class="card__label">坡口加工类型</text>
<text class="card__value">{{ form.GrooveProcessType || '--' }}</text>
<view class="card__value-wrap">
<input class="card__input" v-model="form.GrooveProcessType" type="digit" placeholder="请输入" />
</view>
</view>
</view>
</view>
@@ -52,412 +55,470 @@
<view class="card__row">
<text class="card__label">坡口角度</text>
<view class="card__value-wrap">
<text class="card__value">{{ form.GrooveAngle ?? '--' }}</text>
<input class="card__input" v-model="form.GrooveAngle" type="digit" placeholder="请输入" />
<text class="card__unit">°</text>
</view>
</view>
<view class="card__row">
<text class="card__label">组对间隙</text>
<view class="card__value-wrap">
<text class="card__value">{{ form.FitupGap ?? '--' }}</text>
<input class="card__input" v-model="form.FitupGap" type="digit" placeholder="请输入" />
<text class="card__unit">mm</text>
</view>
</view>
<view class="card__row">
<text class="card__label">错边量</text>
<view class="card__value-wrap">
<text class="card__value">{{ form.Misalignment ?? '--' }}</text>
<input class="card__input" v-model="form.Misalignment" type="digit" placeholder="请输入" />
<text class="card__unit">mm</text>
</view>
</view>
</view>
</view>
<!-- 坡口类型选择器 -->
<u-popup v-model="showGroovePicker" mode="bottom" border-radius="16">
<view class="picker-panel">
<view class="picker-panel__header">
<text class="picker-panel__cancel" @click="showGroovePicker = false">取消</text>
<text class="picker-panel__title">选择坡口类型</text>
<text class="picker-panel__confirm" @click="showGroovePicker = false">确定</text>
</view>
<scroll-view class="picker-panel__list" scroll-y>
<view class="picker-option" v-for="(item, idx) in grooveTypeOptions" :key="idx"
:class="{ 'picker-option--active': pickerSelected === idx }"
@click="selectGrooveType(idx)">
<view class="picker-option__main">
<text class="picker-option__label">{{ item.BaseInfoName }}</text>
<text class="picker-option__code">{{ item.BaseInfoCode }}</text>
</view>
<u-icon v-if="pickerSelected === idx" name="checkmark" :size="28" color="#2979ff" />
</view>
</scroll-view>
<!-- 备注 -->
<view class="section">
<view class="section__header">
<view class="section__bar"></view>
<text class="section__title">备注</text>
</view>
</u-popup>
<view class="card">
<view class="card__row">
<textarea class="remark-input" v-model="remark" placeholder="请输入备注信息(选填)" :maxlength="200" auto-height />
</view>
</view>
</view>
<!-- 现场照片 -->
<view class="section">
<view class="section__header">
<view class="section__bar"></view>
<text class="section__title">照片</text>
</view>
<view class="img-box">
<nbd-photo-upload ref="photoRef" v-model:attachUrl="attachUrl" typeName="MakeRight" />
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-bar">
<view class="submit-btn" @click="handleSubmit">
<text class="submit-btn__text">提交</text>
</view>
</view>
<!-- 坡口类型选择器 -->
<nbd-select v-model="showGroovePicker" title="选择坡口类型" :list="grooveTypeOptions" label-key="BaseInfoName"
value-key="BaseInfoCode" @confirm="selectGrooveType" />
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { storeToRefs } from 'pinia'
import { useUserStore } from '@/store'
import { reqPreWeldJointByWeldJointId, reqGetGrooveTypeList } from '@/api/hj'
import { ref, onMounted } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { storeToRefs } from 'pinia'
import { useUserStore } from '@/store'
import { reqPreWeldJointByWeldJointId, reqGetGrooveTypeList, reqSaveFitupCheck } from '@/api/hj'
const userStore = useUserStore()
const { currentProject } = storeToRefs(userStore)
const showGroovePicker = ref(false)
const pickerSelected = ref(-1)
const grooveTypeOptions = ref([])
const userStore = useUserStore()
const { userInfo, currentProject } = storeToRefs(userStore)
const form = ref({
WeldJointId: '',
WeldJointCode: '',
PipelineId: '',
PipelineCode: '',
ProjectId: '',
GrooveTypeId: '',
GrooveTypeCode: '',
GrooveTypeName: '',
GrooveProcessType: '',
GrooveAngle: '',
FitupGap: '',
Misalignment: ''
})
const showGroovePicker = ref(false)
const grooveTypeOptions = ref([])
const attachUrl = ref('')
const remark = ref('')
const photoRef = ref(null)
const fetchGrooveTypes = async () => {
try {
const res = await reqGetGrooveTypeList()
if (res.code === 1 && res.data) {
grooveTypeOptions.value = res.data
const form = ref({
WeldJointId: '',
WeldJointCode: '',
PipelineId: '',
PipelineCode: '',
ProjectId: '',
GrooveTypeId: '',
GrooveTypeCode: '',
GrooveTypeName: '',
GrooveProcessType: '',
GrooveAngle: '',
FitupGap: '',
Misalignment: ''
})
const fetchGrooveTypes = async () => {
try {
const res = await reqGetGrooveTypeList()
if (res.code === 1 && res.data) {
grooveTypeOptions.value = res.data
}
} catch (err) {
console.error('获取坡口类型列表失败:', err)
}
}
const selectGrooveType = (item) => {
form.value.GrooveTypeId = item.BaseInfoId
form.value.GrooveTypeCode = item.BaseInfoCode
form.value.GrooveTypeName = item.BaseInfoName
showGroovePicker.value = false
}
onMounted(() => {
fetchGrooveTypes()
})
onLoad((opt) => {
if (opt?.id) {
loadData(opt.id)
}
if (currentProject.value?.ProjectId) {
form.value.ProjectId = currentProject.value.ProjectId
}
})
const loadData = async (id) => {
try {
uni.showLoading({ title: '加载中...', mask: true })
const res = await reqPreWeldJointByWeldJointId(id)
if (res.code === 1 && res.data) {
form.value = res.data
attachUrl.value = res.data.FitupAttachUrl1 || ""
}
} catch (err) {
console.error('加载焊口数据失败:', err)
uni.showToast({ title: '加载失败', icon: 'none' })
} finally {
uni.hideLoading()
}
}
const handleSubmit = () => {
if (!form.value.GrooveTypeName) {
uni.showToast({ title: '请选择坡口类型', icon: 'none' })
return
}
uni.showModal({
title: '确认提交',
content: '确定提交组对检查结果吗?',
success: async (res) => {
if (res.confirm) {
if (photoRef.value?.hasPending()) {
uni.showLoading({ title: '上传照片中...', mask: true })
await photoRef.value.uploadAll()
uni.hideLoading()
}
const checkTime = new Date().toISOString()
const params = {
FitupCheckId: form.value.FitupCheckId || '',
ProjectId: form.value?.ProjectId,
WeldJointId: form.value.WeldJointId,
PipelineCode: form.value.PipelineCode || '',
WeldJointCode: form.value.WeldJointCode || '',
GrooveTypeId: form.value.GrooveTypeId,
GrooveTypeCode: form.value.GrooveTypeCode || '',
GrooveTypeName: form.value.GrooveTypeName || '',
GrooveProcessType: form.value.GrooveProcessType || '',
GrooveAngle: Number(form.value.GrooveAngle) || 0,
FitupGap: Number(form.value.FitupGap) || 0,
Misalignment: Number(form.value.Misalignment) || 0,
CheckPerson: userInfo.value?.PersonId || '',
CheckPersonName: userInfo.value?.PersonName || '',
CheckTime: checkTime,
FitupAttachUrl1: attachUrl.value || form.value.FitupAttachUrl1 || '',
Remark: remark.value || ''
}
console.log('提交参数:', params)
await reqSaveFitupCheck(params)
uni.showToast({ title: '提交成功', icon: 'none' })
setTimeout(() => { uni.navigateBack() }, 1500)
}
} catch (err) {
console.error('获取坡口类型列表失败:', err)
}
}
const selectGrooveType = (idx) => {
pickerSelected.value = idx
const item = grooveTypeOptions.value[idx]
form.value.GrooveTypeId = item.BaseInfoId
form.value.GrooveTypeCode = item.BaseInfoCode
form.value.GrooveTypeName = item.BaseInfoName
showGroovePicker.value = false
}
onMounted(() => {
fetchGrooveTypes()
})
onLoad((opt) => {
if (opt?.id) {
loadData(opt.id)
}
if (currentProject.value?.ProjectId) {
form.value.ProjectId = currentProject.value.ProjectId
}
})
const loadData = async (id) => {
try {
uni.showLoading({ title: '加载中...', mask: true })
const res = await reqPreWeldJointByWeldJointId(id)
if (res.code === 1 && res.data) {
form.value = res.data
}
} catch (err) {
console.error('加载焊口数据失败:', err)
uni.showToast({ title: '加载失败', icon: 'none' })
} finally {
uni.hideLoading()
}
}
}
</script>
<style lang="scss" scoped>
$primary: #2979ff;
$primary-light: #e8f0fe;
$primary-mid: #d0ddff;
$primary-dark: #1a56cc;
$bg: #f0f2f5;
$text: #0f1724;
$text-secondary: #6b7c93;
$border: #e8ecf1;
$card-bg: #ffffff;
$radius: 16rpx;
$shadow-sm: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
$shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
$primary: #2979ff;
$primary-light: #e8f0fe;
$primary-mid: #d0ddff;
$primary-dark: #1a56cc;
$bg: #f0f2f5;
$text: #0f1724;
$text-secondary: #6b7c93;
$border: #e8ecf1;
$card-bg: #ffffff;
$radius: 16rpx;
$shadow-sm: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
$shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
.detail-page {
min-height: 100vh;
background: $bg;
padding-bottom: 180rpx;
.detail-page {
min-height: 100vh;
background: $bg;
padding-bottom: 180rpx;
}
// ===== 焊口主标识 =====
.joint-hero {
position: relative;
margin: 24rpx;
padding: 36rpx 32rpx 28rpx;
background: $card-bg;
border-radius: $radius;
box-shadow: $shadow-md;
overflow: hidden;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4rpx;
background: linear-gradient(90deg, $primary, #6ba3ff, $primary);
background-size: 200% 100%;
animation: shimmer 3s ease-in-out infinite;
}
// ===== 焊口主标识 =====
.joint-hero {
@keyframes shimmer {
0%,
100% {
background-position: 0% 0;
}
50% {
background-position: 100% 0;
}
}
&__code {
display: block;
font-size: 52rpx;
font-weight: 800;
color: $text;
line-height: 1.2;
word-break: break-all;
font-family: monospace;
letter-spacing: 2rpx;
margin-bottom: 28rpx;
position: relative;
margin: 24rpx;
padding: 36rpx 32rpx 28rpx;
background: $card-bg;
border-radius: $radius;
box-shadow: $shadow-md;
overflow: hidden;
padding-left: 24rpx;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4rpx;
background: linear-gradient(90deg, $primary, #6ba3ff, $primary);
background-size: 200% 100%;
animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
0%, 100% { background-position: 0% 0; }
50% { background-position: 100% 0; }
}
&__code {
display: block;
font-size: 52rpx;
font-weight: 800;
color: $text;
line-height: 1.2;
word-break: break-all;
font-family: monospace;
letter-spacing: 2rpx;
margin-bottom: 28rpx;
position: relative;
padding-left: 24rpx;
&::before {
content: '';
position: absolute;
left: 0;
top: 6rpx;
bottom: 6rpx;
width: 4rpx;
background: $primary;
border-radius: 2rpx;
}
}
&__meta {
display: flex;
flex-wrap: wrap;
gap: 12rpx;
}
&__pill {
display: inline-flex;
width: 100%;
align-items: center;
gap: 8rpx;
background: $primary-light;
padding: 10rpx 18rpx;
border-radius: 10rpx;
border: 1rpx solid $primary-mid;
.pill-label {
font-size: 22rpx;
color: $text-secondary;
width: 60rpx;
}
.pill-value {
font-size: 24rpx;
font-weight: 600;
color: $primary-dark;
font-family: monospace;
}
top: 6rpx;
bottom: 6rpx;
width: 4rpx;
background: $primary;
border-radius: 2rpx;
}
}
// ===== 区块标题 =====
.section {
margin: 0 24rpx 20rpx;
&__header {
display: flex;
align-items: center;
gap: 12rpx;
margin-bottom: 14rpx;
padding: 0 6rpx;
}
&__bar {
width: 6rpx;
height: 26rpx;
background: linear-gradient(180deg, $primary, #6ba3ff);
border-radius: 3rpx;
flex-shrink: 0;
}
&__title {
font-size: 28rpx;
font-weight: 600;
color: $text;
letter-spacing: 0.5rpx;
}
}
// ===== 信息卡片 =====
.card {
background: $card-bg;
border-radius: $radius;
overflow: hidden;
box-shadow: $shadow-md;
&__row {
display: flex;
align-items: center;
padding: 22rpx 28rpx;
border-bottom: 1rpx solid $border;
&:last-child {
border-bottom: none;
}
&:active {
background: #fafbfc;
}
&--warn .card__label::before {
background: #ef4444;
}
}
&__label {
width: 180rpx;
font-size: 26rpx;
color: $text-secondary;
flex-shrink: 0;
position: relative;
padding-left: 16rpx;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 4rpx;
height: 16rpx;
background: $primary-mid;
border-radius: 2rpx;
}
}
&__value {
flex: 1;
font-size: 28rpx;
color: $text;
font-weight: 500;
text-align: right;
&--placeholder {
color: #b0bec5;
font-weight: 400;
}
}
&__value-wrap {
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8rpx;
&--clickable {
min-height: 48rpx;
}
}
&__unit {
font-size: 24rpx;
color: $text-secondary;
flex-shrink: 0;
}
}
// ===== 坡口类型选择器弹窗 =====
.picker-panel {
padding-bottom: env(safe-area-inset-bottom);
&__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 32rpx;
border-bottom: 1rpx solid $border;
}
&__cancel,
&__confirm {
font-size: 26rpx;
color: $text-secondary;
padding: 8rpx;
&:active {
opacity: 0.6;
}
}
&__confirm {
color: $primary;
font-weight: 600;
}
&__title {
font-size: 28rpx;
font-weight: 600;
color: $text;
}
&__list {
max-height: 560rpx;
}
}
.picker-option {
&__meta {
display: flex;
flex-wrap: wrap;
gap: 12rpx;
}
&__pill {
display: inline-flex;
width: 100%;
align-items: center;
justify-content: space-between;
padding: 28rpx 32rpx;
border-bottom: 1rpx solid #f5f5f5;
transition: background 0.2s;
gap: 8rpx;
background: $primary-light;
padding: 10rpx 18rpx;
border-radius: 10rpx;
border: 1rpx solid $primary-mid;
&:active {
background: #f8f9fa;
}
&--active {
background: $primary-light;
}
&__main {
flex: 1;
min-width: 0;
}
&__label {
font-size: 28rpx;
font-weight: 500;
color: $text;
display: block;
}
&__code {
.pill-label {
font-size: 22rpx;
color: $text-secondary;
margin-top: 4rpx;
display: block;
width: 60rpx;
}
.pill-value {
font-size: 24rpx;
font-weight: 600;
color: $primary-dark;
font-family: monospace;
}
}
}
// ===== 区块标题 =====
.section {
margin: 0 24rpx 20rpx;
&__header {
display: flex;
align-items: center;
gap: 12rpx;
margin-bottom: 14rpx;
padding: 0 6rpx;
}
&__bar {
width: 6rpx;
height: 26rpx;
background: linear-gradient(180deg, $primary, #6ba3ff);
border-radius: 3rpx;
flex-shrink: 0;
}
&__title {
font-size: 28rpx;
font-weight: 600;
color: $text;
letter-spacing: 0.5rpx;
}
.img-box {
padding: 20rpx;
border-radius: 16rpx;
background-color: #ffffff;
}
}
// ===== 信息卡片 =====
.card {
background: $card-bg;
border-radius: $radius;
overflow: hidden;
box-shadow: $shadow-md;
&__row {
display: flex;
align-items: center;
padding: 22rpx 28rpx;
border-bottom: 1rpx solid $border;
&:last-child {
border-bottom: none;
}
&:active {
background: #fafbfc;
}
&--warn .card__label::before {
background: #ef4444;
}
}
&__label {
width: 180rpx;
font-size: 26rpx;
color: $text-secondary;
flex-shrink: 0;
position: relative;
padding-left: 16rpx;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 4rpx;
height: 16rpx;
background: $primary-mid;
border-radius: 2rpx;
}
}
&__value {
flex: 1;
font-size: 28rpx;
color: $text;
font-weight: 500;
text-align: right;
&--placeholder {
color: #b0bec5;
font-weight: 400;
}
}
&__value-wrap {
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8rpx;
&--clickable {
min-height: 48rpx;
}
}
&__input {
flex: 1;
font-size: 28rpx;
color: $text;
text-align: right;
height: 48rpx;
padding: 0;
&::placeholder {
color: #b0bec5;
}
}
&__unit {
font-size: 24rpx;
color: $text-secondary;
flex-shrink: 0;
}
}
// ===== 备注 =====
.remark-input {
width: 100%;
font-size: 26rpx;
color: $text;
min-height: 120rpx;
padding: 8rpx 0;
line-height: 1.6;
&::placeholder {
color: #b0bec5;
}
}
// ===== 提交栏 =====
.submit-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
padding: 20rpx 24rpx;
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
background: linear-gradient(180deg, rgba($bg, 0) 0%, $bg 20%);
}
.submit-btn {
display: flex;
align-items: center;
justify-content: center;
padding: 24rpx;
background: linear-gradient(135deg, $primary, #5a9aff);
border-radius: 14rpx;
box-shadow: 0 6rpx 24rpx rgba($primary, 0.3);
&:active {
opacity: 0.9;
transform: scale(0.98);
}
&__text {
font-size: 30rpx;
font-weight: 600;
color: #fff;
letter-spacing: 2rpx;
}
}
</style>
+43 -16
View File
@@ -16,7 +16,7 @@
</view>
<!-- 坡口参数 - 测量仪表 -->
<view class="section">
<!-- <view class="section">
<view class="section__header">
<view class="section__bar"></view>
<text class="section__title">坡口参数</text>
@@ -50,10 +50,10 @@
</view>
</view>
</view>
</view>
</view> -->
<!-- 坡口类型 -->
<view class="section">
<!-- <view class="section">
<view class="section__header">
<view class="section__bar"></view>
<text class="section__title">坡口信息</text>
@@ -76,7 +76,7 @@
<text class="card__value">{{ info.GrooveProcessType || '--' }}</text>
</view>
</view>
</view>
</view> -->
<!-- 材料校验 -->
<view class="section">
@@ -96,11 +96,11 @@
'check-btn--fail': check.CodeBatch === false
}">
<template v-if="check.CodeBatch === true">
<text class="check-btn__icon"></text>
<text class="check-btn__icon">&#10003;</text>
<text class="check-btn__text">通过</text>
</template>
<template v-else>
<text class="check-btn__icon"></text>
<text class="check-btn__icon">&#10007;</text>
<text class="check-btn__text">不通过</text>
</template>
</view>
@@ -117,11 +117,11 @@
'check-btn--fail': check.Quantity === false
}">
<template v-if="check.Quantity === true">
<text class="check-btn__icon"></text>
<text class="check-btn__icon">&#10003;</text>
<text class="check-btn__text">通过</text>
</template>
<template v-else>
<text class="check-btn__icon"></text>
<text class="check-btn__icon">&#10007;</text>
<text class="check-btn__text">不通过</text>
</template>
</view>
@@ -148,6 +148,17 @@
</view>
</view>
<!-- 现场照片 -->
<view class="section">
<view class="section__header">
<view class="section__bar"></view>
<text class="section__title">照片</text>
</view>
<view class="img-box">
<nbd-photo-upload ref="photoRef" v-model:attachUrl="formAttachUrl" typeName="MaterialSampling" />
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-bar">
<view class="submit-btn" @click="handleSubmit">
@@ -165,18 +176,22 @@
import { reqPreWeldJointByWeldJointId, reqSaveCuttingCheck } from '@/api/hj'
const userStore = useUserStore()
const { userInfo, currentProject } = storeToRefs(userStore)
const info = ref({})
const remark = ref('')
const formAttachUrl = ref('')
// 校验状态:true=通过,false=不通过
const check = ref({
CodeBatch: true,
Quantity: true
})
// 照片组件引用
const photoRef = ref(null)
const toggleCheck = (key) => {
const val = check.value[key]
check.value[key] = val === true ? false : true
@@ -188,6 +203,13 @@
content: '确定提交校验结果吗?',
success: async (res) => {
if (res.confirm) {
if (photoRef.value?.hasPending()) {
uni.showLoading({ title: '上传照片中...', mask: true })
await photoRef.value.uploadAll()
uni.hideLoading()
}
const CuttingAttachUrl1 = formAttachUrl.value || info.value.CuttingAttachUrl1 || ''
const now = new Date()
const pad = (n) => String(n).padStart(2, '0')
const checkTime = `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`
@@ -199,14 +221,13 @@
IsMaterialQuantityAccurate: check.value.Quantity,
CheckPerson: userInfo.value?.PersonId,
CheckTime: checkTime,
Remark: remark.value
Remark: remark.value,
CuttingAttachUrl1
}
console.log('提交参数:', params)
await reqSaveCuttingCheck(params)
uni.showToast({ title: '提交成功', icon: 'none' })
setTimeout(() => {
uni.navigateBack()
}, 1500)
setTimeout(() => { uni.navigateBack() }, 1500)
}
}
})
@@ -222,7 +243,10 @@
try {
uni.showLoading({ title: '加载中...', mask: true })
const res = await reqPreWeldJointByWeldJointId(id)
if (res.code === 1) { info.value = res.data }
if (res.code === 1) {
info.value = res.data
formAttachUrl.value = res.data?.CuttingAttachUrl1 || ''
}
} catch (error) {
console.error('获取焊口详情失败:', error)
uni.showToast({ title: '加载失败', icon: 'none' })
@@ -231,7 +255,6 @@
}
}
// 模拟进度条宽度(0~100%
const gaugeWidth = (val, min, max) => {
if (!val && val !== 0) return '0%'
const num = parseFloat(val)
@@ -370,6 +393,11 @@
color: $text;
letter-spacing: 0.5rpx;
}
.img-box{
padding: 20rpx;
border-radius: 16rpx;
background-color: #ffffff;
}
}
// ===== 坡口参数仪表 =====
@@ -553,7 +581,6 @@
}
}
// ===== 校验按钮(二态切换) =====
.check-btn {
display: inline-flex;
align-items: center;