This commit is contained in:
2026-07-06 16:46:07 +08:00
parent ae914b5c24
commit 21d11697a0
8 changed files with 899 additions and 1378 deletions
+49 -22
View File
@@ -55,7 +55,7 @@
<view class="card">
<!-- 防腐等级/涂漆代码下拉选择 -->
<view class="card__row" @click="showPaintCodePicker = true">
<text class="card__label">防腐等级</text>
<text class="card__label required">防腐等级</text>
<view class="card__value-wrap card__value-wrap--clickable">
<text class="card__value" :class="{ 'card__value--placeholder': !antiForm.AnticorrosionLevel }">
{{ antiForm.AnticorrosionLevel || '请选择防腐等级' }}
@@ -79,7 +79,7 @@
</view>
<!-- 漆膜厚度 -->
<view class="card__row">
<text class="card__label">漆膜厚度</text>
<text class="card__label required">漆膜厚度</text>
<view class="card__value-wrap">
<input class="card__input" v-model="antiForm.FilmThickness" type="digit"
placeholder="请输入漆膜厚度" />
@@ -107,7 +107,7 @@
</view>
</view>
<!-- 自检 -->
<!-- 自检 -->
<view class="section">
<view class="section__header">
<view class="section__bar"></view>
@@ -118,14 +118,13 @@
<view class="card__row">
<text class="card__label">自检结果</text>
<view class="card__value-wrap card__value-wrap--clickable">
<nbd-check-btn v-model="antiForm.CheckResult" passKey="合格" failKey="不合格" passText="合格" failText="不合格" />
<nbd-check-btn v-model="antiForm.CheckResult" passKey="合格" failKey="不合格" passText="合格"
failText="不合格" />
</view>
</view>
<view
class="fail-section"
:class="{ 'is-visible': failVisible, 'is-enter': failAnimating, 'is-leave': failLeaving }"
>
<view class="fail-section"
:class="{ 'is-visible': failVisible, 'is-enter': failAnimating, 'is-leave': failLeaving }">
<!-- 不合格原因 -->
<view class="card__row card__row--stack">
<text class="card__label">不合格原因</text>
@@ -164,10 +163,10 @@
<!-- 防腐记录 -->
<nbd-anti-record :params="{ materialCode: form.MaterialCode, projectId: currentProject.ProjectId }" />
<nbd-submit-bar text="提交" :loading="submitting" @click="handleSubmit" />
<nbd-submit-bar text="提交" :loading="submitting" @click="handleSubmit" />
</view>
<nbd-select v-model="showPaintCodePicker" title="选择防腐等级" :list="paintCodeList" label-key="PaintCode" value-key="Id"
@@ -180,7 +179,7 @@ import { onLoad } from '@dcloudio/uni-app'
import { storeToRefs } from 'pinia'
import { watch, nextTick } from 'vue'
import { useUserStore } from '@/store'
import { reqMaterialInfoByMaterialCode, reqPaintCodeList, reqSaveAntiCorrosionCheck } from '@/api/hj.js'
import { reqMaterialInfoByMaterialCode, reqPaintCodeList, reqSaveAntiCorrosionCheck , reqGetAntiCorrosionCheck } from '@/api/hj.js'
const userStore = useUserStore()
const { userInfo, currentProject } = storeToRefs(userStore)
@@ -258,10 +257,25 @@ onLoad((opt) => {
const loadData = async (id) => {
try {
uni.showLoading({ title: '加载中...', mask: true })
const res = await reqMaterialInfoByMaterialCode(encodeURIComponent(id))
const [res, res1] = await Promise.all([
reqMaterialInfoByMaterialCode(encodeURIComponent(id)),
reqGetAntiCorrosionCheck({ materialCode: id, projectId: currentProject.value.ProjectId })
])
if (res.code === 1 && res.data) {
form.value = res.data
}
if (res1.code === 1 && res1.data) {
let antiData = res1.data
if(antiData&&antiData.length>0){
antiForm.value = {
...antiData[0],
CheckResult: '合格',
UnqualifiedReason: '',
RectifyRequirement: '',
Remark: ''
}
}
}
} catch (err) {
console.error('加载焊口数据失败:', err)
uni.showToast({ title: '加载失败', icon: 'none' })
@@ -271,15 +285,15 @@ const loadData = async (id) => {
}
const handleSubmit = async () => {
// if (!antiForm.value.PaintId) {
// uni.showToast({ title: '请选择防腐等级', icon: 'none' })
// return
// }
if( !antiForm.value.UnqualifiedReason && antiForm.value.CheckResult === '不合格') {
if (!antiForm.value.PaintId) {
uni.showToast({ title: '请选择防腐等级', icon: 'none' })
return
}
if (!antiForm.value.UnqualifiedReason && antiForm.value.CheckResult === '不合格') {
uni.showToast({ title: '请输入不合格原因', icon: 'none' })
return
}
if( !antiForm.value.RectifyRequirement && antiForm.value.CheckResult === '不合格') {
if (!antiForm.value.RectifyRequirement && antiForm.value.CheckResult === '不合格') {
uni.showToast({ title: '请输入整改要求', icon: 'none' })
return
}
@@ -311,7 +325,7 @@ const handleSubmit = async () => {
CreateUser: userInfo.PersonId, // 创建人员
AttachUrl1: files.value, // 照片
}
console.log("提交数据==============>",data)
console.log("提交数据==============>", data)
try {
const res = await reqSaveAntiCorrosionCheck(data)
if (res.code === 1) {
@@ -448,6 +462,7 @@ $shadow-md: 0 2rpx 12rpx rgba(0, 0, 0, 0.04), 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
opacity: 0;
transform: translateY(24rpx);
}
to {
opacity: 1;
transform: translateY(0);
@@ -455,9 +470,12 @@ $shadow-md: 0 2rpx 12rpx rgba(0, 0, 0, 0.04), 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
}
@keyframes breathe {
0%, 100% {
0%,
100% {
opacity: 0.6;
}
50% {
opacity: 1;
}
@@ -468,8 +486,13 @@ $shadow-md: 0 2rpx 12rpx rgba(0, 0, 0, 0.04), 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
margin: 0 24rpx 20rpx;
animation: fadeUp 0.5s ease-out both;
&:nth-child(2) { animation-delay: 0.05s; }
&:nth-child(3) { animation-delay: 0.15s; }
&:nth-child(2) {
animation-delay: 0.05s;
}
&:nth-child(3) {
animation-delay: 0.15s;
}
&__header {
display: flex;
@@ -599,6 +622,10 @@ $shadow-md: 0 2rpx 12rpx rgba(0, 0, 0, 0.04), 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
background: $primary-mid;
border-radius: 2rpx;
}
&.required::before {
background: #ff0000;
}
}
&__value {
File diff suppressed because it is too large Load Diff