功能调整

This commit is contained in:
huhao
2026-08-18 18:05:16 +08:00
parent b342fb971b
commit 47559d6ed2
17 changed files with 2677 additions and 246 deletions
+70 -4
View File
@@ -29,6 +29,48 @@
failText="不合格" />
</view>
</view>
<view class="card__row">
<text class="card__label">焊缝余高</text>
<view class="card__value-wrap">
<input class="card__input" v-model="form.WeldReinforcement" type="digit"
placeholder="请输入焊缝余高" />
</view>
</view>
<view class="card__row">
<text class="card__label">焊缝高度</text>
<view class="card__value-wrap">
<input class="card__input" v-model="form.WeldHeight" type="digit"
placeholder="请输入焊缝高度" />
</view>
</view>
<view class="card__row">
<text class="card__label">焊缝宽度</text>
<view class="card__value-wrap">
<input class="card__input" v-model="form.WeldWidth" type="digit"
placeholder="请输入焊缝宽度" />
</view>
</view>
<view class="card__row">
<text class="card__label">表面缺陷</text>
<view class="card__value-wrap">
<input class="card__input" v-model="form.SurfaceDefect" type="text"
placeholder="请输入表面缺陷" />
</view>
</view>
<view class="card__row">
<text class="card__label">预热温度</text>
<view class="card__value-wrap">
<input class="card__input" v-model="form.PreheatTemperature" type="digit"
placeholder="请输入预热温度" />
</view>
</view>
<view class="card__row">
<text class="card__label">层间温度</text>
<view class="card__value-wrap">
<input class="card__input" v-model="form.InterpassTemperature" type="digit"
placeholder="请输入层间温度" />
</view>
</view>
<view class="card__row">
<text class="card__label">检测人</text>
<view class="card__value-wrap">
@@ -59,8 +101,9 @@
<!-- 提交按钮 -->
<view class="submit-bar">
<view class="btn-primary-gradient" @click="handleSubmit">
<text class="btn-primary-gradient__text">提交结果</text>
<view class="btn-primary-gradient" :class="{ 'btn-primary-gradient--disabled': submitting }"
@click="handleSubmit">
<text class="btn-primary-gradient__text">{{ submitting ? '提交中...' : '提交结果' }}</text>
</view>
</view>
</view>
@@ -95,11 +138,18 @@
const info = ref({})
const recordList = ref([])
const photoRef = ref(null)
const submitting = ref(false)
const form = ref({
qualifiedText: '合格',
Remark: '',
AttachUrl: ''
AttachUrl: '',
WeldReinforcement: '',
WeldHeight: '',
WeldWidth: '',
SurfaceDefect: '',
PreheatTemperature: '',
InterpassTemperature: ''
})
const checkPersonName = computed(() => userInfo.value?.PersonName || '')
@@ -172,7 +222,14 @@
}
}
const toNum = (val) => {
if (val === '' || val === null || val === undefined) return null
const n = Number(val)
return Number.isNaN(n) ? null : n
}
const handleSubmit = () => {
if (submitting.value) return
const jointId = info.value.WeldJointId || id.value
if (!jointId) {
uni.showToast({
@@ -195,6 +252,7 @@
confirm
}) => {
if (!confirm) return
submitting.value = true
try {
if (photoRef.value?.hasPending()) {
uni.showLoading({
@@ -205,6 +263,7 @@
uni.hideLoading()
}
await reqSaveWeldAppearanceCheck({
AppearanceCheckId: null,
ProjectId: currentProject.value?.ProjectId || info.value.ProjectId,
WeldJointId: jointId,
IsQualified: form.value.qualifiedText === '合格',
@@ -213,7 +272,12 @@
CreateUser: userInfo.value?.PersonId,
Remark: form.value.Remark || '',
AttachUrl: form.value.AttachUrl,
AppearanceCheckId: ''
WeldReinforcement: toNum(form.value.WeldReinforcement),
WeldHeight: toNum(form.value.WeldHeight),
WeldWidth: toNum(form.value.WeldWidth),
SurfaceDefect: form.value.SurfaceDefect || '',
PreheatTemperature: toNum(form.value.PreheatTemperature),
InterpassTemperature: toNum(form.value.InterpassTemperature)
})
uni.showToast({
title: '提交成功',
@@ -224,6 +288,8 @@
}, 1500)
} catch (error) {
console.error('保存焊缝外观检测失败:', error)
} finally {
submitting.value = false
}
}
})