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
+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;