下料完成
This commit is contained in:
@@ -150,11 +150,18 @@ export const reqMaterialInfoByMaterialCode = (materialCode)=>get(`BaseInfo/GetMa
|
|||||||
* @param {String} WeldJointId
|
* @param {String} WeldJointId
|
||||||
*/
|
*/
|
||||||
export const reqPreWeldJointByWeldJointId = (WeldJointId)=>get(`PreWeldInspection/getPreWeldJointByWeldJointId?WeldJointId=${WeldJointId}`)
|
export const reqPreWeldJointByWeldJointId = (WeldJointId)=>get(`PreWeldInspection/getPreWeldJointByWeldJointId?WeldJointId=${WeldJointId}`)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存焊前基础信息(材料编码及炉批号校验、材料数量校验)
|
* 获取下料检查记录
|
||||||
|
* @param {String} weldJointId
|
||||||
|
*/
|
||||||
|
export const reqCuttingCheckByWeldJointId = (weldJointId)=>get(`/PreWeldCuttingCheck/GetRecordsByWeldJointId?weldJointId=${weldJointId}`)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存下料检查记录
|
||||||
* @param {Object} data
|
* @param {Object} data
|
||||||
*/
|
*/
|
||||||
export const reqSaveCuttingCheck = (data)=> post(`PreWeldInspection/SaveCuttingCheck`, data)
|
export const reqSaveCuttingCheck = (data)=> post(`/PreWeldCuttingCheck/SaveRecord`, data)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取坡口类型列表
|
* 获取坡口类型列表
|
||||||
|
|||||||
@@ -1,444 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="anti-record">
|
|
||||||
<!-- 加载中 -->
|
|
||||||
<view v-if="loading" class="anti-record__loading">
|
|
||||||
<text class="anti-record__loading-text">加载中...</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 无记录 -->
|
|
||||||
<view v-else-if="!loading && list.length === 0" class="anti-record__empty">
|
|
||||||
<text class="anti-record__empty-text">暂无防腐记录</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 有记录 -->
|
|
||||||
<template v-else>
|
|
||||||
<view class="anti-record__section" :style="{ ...props.customStyle }">
|
|
||||||
<view class="anti-record__header">
|
|
||||||
<view class="anti-record__bar"></view>
|
|
||||||
<text class="anti-record__title">防腐记录</text>
|
|
||||||
<text v-if="list.length > 1" class="anti-record__more" @click="showPopup = true">查看全部({{ list.length
|
|
||||||
}})</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 最新一条记录 -->
|
|
||||||
<view class="anti-record__card" v-if="latest">
|
|
||||||
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">防腐等级</text>
|
|
||||||
<text class="anti-record__value">{{ latest.AnticorrosionLevel || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">中间漆</text>
|
|
||||||
<text class="anti-record__value">{{ latest.IntermediatePaint || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">面漆</text>
|
|
||||||
<text class="anti-record__value">{{ latest.Topcoat || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">漆膜厚度</text>
|
|
||||||
<text class="anti-record__value">{{ latest.FilmThickness || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">喷砂情况</text>
|
|
||||||
<view class="anti-record__value">
|
|
||||||
{{ latest.SandBlasting || '--' }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">除锈喷砂情况</text>
|
|
||||||
<view class="anti-record__value">
|
|
||||||
{{ latest.RustSandBlasting || '--' }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">检查人</text>
|
|
||||||
<text class="anti-record__value">{{ latest.CheckPersonName || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">检查时间</text>
|
|
||||||
<text class="anti-record__value">{{ latest.CheckTime || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">检查结果</text>
|
|
||||||
<view class="anti-record__tag"
|
|
||||||
:class="latest.CheckResult === '合格' ? 'anti-record__tag--pass' : 'anti-record__tag--fail'">
|
|
||||||
<text class="anti-record__tag-icon">{{ latest.CheckResult === '合格' ? '\u2713' : '\u2717'
|
|
||||||
}}</text>
|
|
||||||
<text class="anti-record__tag-text">{{ latest.CheckResult || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row" v-if="latest.CheckResult !== '合格'">
|
|
||||||
<view class="anti-record__label">不合格原因</view>
|
|
||||||
<text class="anti-record__value">{{ latest.UnqualifiedReason }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row" v-if="latest.CheckResult !== '合格'">
|
|
||||||
<view class="anti-record__label">整改要求</view>
|
|
||||||
<text class="anti-record__value">{{ latest.RectifyRequirement
|
|
||||||
}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row--stack">
|
|
||||||
<text class="anti-record__label--stack">照片</text>
|
|
||||||
<view class="anti-record__value--stack">
|
|
||||||
<nbd-photo-view :attachUrl="latest.AttachUrl1" :cols="4" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 弹窗:全部记录 -->
|
|
||||||
<u-popup v-model="showPopup" mode="bottom" :safe-area-inset-bottom="true">
|
|
||||||
<view class="anti-record__popup">
|
|
||||||
<view class="anti-record__popup-hd">
|
|
||||||
<text class="anti-record__popup-title">全部防腐记录</text>
|
|
||||||
<text class="anti-record__popup-close" @click="showPopup = false">✕</text>
|
|
||||||
</view>
|
|
||||||
<scroll-view class="anti-record__popup-bd" scroll-y>
|
|
||||||
<view v-for="(item, index) in list" :key="index"
|
|
||||||
class="anti-record__card anti-record__card--popup"
|
|
||||||
:class="item.CheckResult === '合格' ? 'anti-record__card--pass' : 'anti-record__card--fail'">
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">防腐等级</text>
|
|
||||||
<text class="anti-record__value">{{ item.AnticorrosionLevel || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">中间漆</text>
|
|
||||||
<text class="anti-record__value">{{ item.IntermediatePaint || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">面漆</text>
|
|
||||||
<text class="anti-record__value">{{ item.Topcoat || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">漆膜厚度</text>
|
|
||||||
<text class="anti-record__value">{{ item.FilmThickness || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">喷砂情况</text>
|
|
||||||
<view class="anti-record__value">
|
|
||||||
{{ item.SandBlasting || '--' }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">除锈喷砂情况</text>
|
|
||||||
<view class="anti-record__value">
|
|
||||||
{{ item.RustSandBlasting || '--' }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">检查人</text>
|
|
||||||
<text class="anti-record__value">{{ item.CheckPersonName || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">检查时间</text>
|
|
||||||
<text class="anti-record__value">{{ item.CheckTime || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row">
|
|
||||||
<text class="anti-record__label">检查结果</text>
|
|
||||||
<view class="anti-record__tag"
|
|
||||||
:class="item.CheckResult === '合格' ? 'anti-record__tag--pass' : 'anti-record__tag--fail'">
|
|
||||||
<text class="anti-record__tag-icon">{{ item.CheckResult === '合格' ? '\u2713' :
|
|
||||||
'\u2717'
|
|
||||||
}}</text>
|
|
||||||
<text class="anti-record__tag-text">{{ item.CheckResult || '--' }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row" v-if="item.CheckResult === '不合格'">
|
|
||||||
<text class="anti-record__label">不合格原因</text>
|
|
||||||
<view class="anti-record__value">{{ item.UnqualifiedReason
|
|
||||||
}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row" v-if="item.CheckResult === '不合格'">
|
|
||||||
<text class="anti-record__label">整改要求</text>
|
|
||||||
<view class="anti-record__value-">{{ item.RectifyRequirement
|
|
||||||
}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="anti-record__row--stack">
|
|
||||||
<text class="anti-record__label--stack">照片</text>
|
|
||||||
<view class="anti-record__value--stack">
|
|
||||||
<nbd-photo-view :attachUrl="item.AttachUrl1" :cols="4" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</template>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, computed, watch } from 'vue'
|
|
||||||
import { reqGetAntiCorrosionCheck } from '@/api/hj.js'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
params: { type: Object, default: () => ({}) },
|
|
||||||
customStyle: { type: Object, default: () => ({}) },
|
|
||||||
})
|
|
||||||
|
|
||||||
const list = ref([])
|
|
||||||
const loading = ref(false)
|
|
||||||
const showPopup = ref(false)
|
|
||||||
|
|
||||||
const latest = computed(() => list.value[0] || null)
|
|
||||||
|
|
||||||
const fetchRecords = async () => {
|
|
||||||
|
|
||||||
const { materialCode, projectId } = props.params
|
|
||||||
if (!materialCode || !projectId) return
|
|
||||||
loading.value = true
|
|
||||||
|
|
||||||
try {
|
|
||||||
const res = await reqGetAntiCorrosionCheck(props.params)
|
|
||||||
if (res.code === 1 && res.data) {
|
|
||||||
list.value = res.data
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('获取防腐记录失败:', err)
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const materialCode = computed(() => props.params?.materialCode)
|
|
||||||
const projectId = computed(() => props.params?.projectId)
|
|
||||||
|
|
||||||
watch([materialCode, projectId], fetchRecords, { immediate: true })
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$primary: #2979ff;
|
|
||||||
$bg: #f4f2ee;
|
|
||||||
$card-bg: #fff;
|
|
||||||
$card-shadow: 0 2rpx 16rpx rgba(0, 0, 0, 0.06);
|
|
||||||
$text: #1a1a2e;
|
|
||||||
$text-secondary: #8e99a4;
|
|
||||||
|
|
||||||
.anti-record {
|
|
||||||
|
|
||||||
&__loading,
|
|
||||||
&__empty {
|
|
||||||
padding: 40rpx 24rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__loading-text,
|
|
||||||
&__empty-text {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: $text-secondary;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__section {
|
|
||||||
margin: 0 24rpx 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__bar {
|
|
||||||
width: 6rpx;
|
|
||||||
height: 32rpx;
|
|
||||||
border-radius: 3rpx;
|
|
||||||
background: $primary;
|
|
||||||
margin-right: 14rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
color: $text;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__more {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: $primary;
|
|
||||||
padding: 6rpx 16rpx;
|
|
||||||
background: rgba($primary, 0.08);
|
|
||||||
border-radius: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__card {
|
|
||||||
position: relative;
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
background: $card-bg;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
box-shadow: $card-shadow;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 6rpx;
|
|
||||||
transition: background 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--pass::before {
|
|
||||||
background: #22c55e;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--fail::before {
|
|
||||||
background: #ef4444;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 8rpx 0;
|
|
||||||
|
|
||||||
&+& {
|
|
||||||
border-top: 1rpx solid #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--stack {
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
|
|
||||||
.anti-record__value {
|
|
||||||
margin-top: 8rpx;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__label {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: $text-secondary;
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-right: 24rpx;
|
|
||||||
width: 160rpx;
|
|
||||||
|
|
||||||
&--stack {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: $text-secondary;
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-right: 24rpx;
|
|
||||||
width: 140rpx;
|
|
||||||
margin-top: 8rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__value {
|
|
||||||
color: $text;
|
|
||||||
flex: 1;
|
|
||||||
text-align: left;
|
|
||||||
font-family: "SF Mono", "Menlo", "Consolas", monospace;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #0f1724;
|
|
||||||
letter-spacing: 0.3rpx;
|
|
||||||
|
|
||||||
&--stack {
|
|
||||||
padding-left: 20rpx;
|
|
||||||
padding-bottom: 8rpx;
|
|
||||||
padding-top: 8rpx;
|
|
||||||
font-family: "SF Mono", "Menlo", "Consolas", monospace;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #0f1724;
|
|
||||||
letter-spacing: 0.3rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__tag {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6rpx;
|
|
||||||
padding: 6rpx 16rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
min-width: 100rpx;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
&--pass {
|
|
||||||
background: #ebf9f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--fail {
|
|
||||||
background: #fef2f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-icon {
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--pass &-icon {
|
|
||||||
color: #22c55e;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--fail &-icon {
|
|
||||||
color: #ef4444;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-text {
|
|
||||||
font-size: 24rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--pass &-text {
|
|
||||||
color: #16a34a;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--fail &-text {
|
|
||||||
color: #dc2626;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===== 弹窗 =====
|
|
||||||
&__popup {
|
|
||||||
background: #fff;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height: 80vh;
|
|
||||||
border-radius: 24rpx 24rpx 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__popup-hd {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 24rpx 28rpx 12rpx;
|
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__popup-title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
color: $text;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__popup-close {
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: $text-secondary;
|
|
||||||
padding: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__popup-bd {
|
|
||||||
flex: 1;
|
|
||||||
box-sizing: border-box;
|
|
||||||
overflow-y: auto;
|
|
||||||
background: #f5f5f5;
|
|
||||||
padding: 12rpx 20rpx 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__card--popup {
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
box-shadow: $card-shadow;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__card--popup:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -0,0 +1,362 @@
|
|||||||
|
<template>
|
||||||
|
<view class="record-card">
|
||||||
|
<!-- 加载中 -->
|
||||||
|
<view v-if="list.length === 0" class="record-card__empty">
|
||||||
|
<text class="record-card__empty-text">暂无{{ title }}记录</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 有记录 -->
|
||||||
|
<template v-else>
|
||||||
|
<view class="record-card__section" :style="{ ...props.customStyle }">
|
||||||
|
<view class="record-card__header">
|
||||||
|
<view class="record-card__bar"></view>
|
||||||
|
<text class="record-card__title">{{ title }}记录</text>
|
||||||
|
<text v-if="list.length > 1" class="record-card__more" @click="showPopup = true">查看全部({{ list.length }})</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 最新一条记录 -->
|
||||||
|
<view class="record-card__card" v-if="latest"
|
||||||
|
:class="cardStatus(latest) === 'pass' ? 'record-card__card--pass' : 'record-card__card--fail'">
|
||||||
|
<view v-for="field in fields" :key="field.key">
|
||||||
|
<view v-if="isVisible(field, latest)" :class="field.type === 'photo' ? 'record-card__row--stack' : 'record-card__row'">
|
||||||
|
<text :class="field.type === 'photo' ? 'record-card__label--stack' : 'record-card__label'">{{ field.label }}</text>
|
||||||
|
|
||||||
|
<!-- text(默认) -->
|
||||||
|
<text v-if="!field.type || field.type === 'text'" class="record-card__value">
|
||||||
|
{{ latest[field.key] || '--' }}
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<!-- tag -->
|
||||||
|
<view v-else-if="field.type === 'tag'" class="record-card__tag"
|
||||||
|
:style="tagBgStyle(field, latest)">
|
||||||
|
<text class="record-card__tag-icon" :style="tagIconStyle(field, latest)">
|
||||||
|
{{ tagPass(field, latest) ? '\u2713' : '\u2717' }}
|
||||||
|
</text>
|
||||||
|
<text class="record-card__tag-text" :style="tagTextStyle(field, latest)">
|
||||||
|
{{ tagDisplayText(field, latest) }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- photo -->
|
||||||
|
<view v-else-if="field.type === 'photo'" class="record-card__value--stack">
|
||||||
|
<nbd-photo-view :attachUrl="latest[field.key]" :cols="field.cols || 4" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 弹窗:全部记录 -->
|
||||||
|
<u-popup v-model="showPopup" mode="bottom" :safe-area-inset-bottom="true">
|
||||||
|
<view class="record-card__popup">
|
||||||
|
<view class="record-card__popup-hd">
|
||||||
|
<text class="record-card__popup-title">全部{{ title }}记录</text>
|
||||||
|
<text class="record-card__popup-close" @click="showPopup = false">✕</text>
|
||||||
|
</view>
|
||||||
|
<scroll-view class="record-card__popup-bd" scroll-y>
|
||||||
|
<view v-for="(item, index) in list" :key="index"
|
||||||
|
class="record-card__card record-card__card--popup"
|
||||||
|
:class="cardStatus(item) === 'pass' ? 'record-card__card--pass' : 'record-card__card--fail'">
|
||||||
|
<view v-for="field in fields" :key="field.key">
|
||||||
|
<view v-if="isVisible(field, item)" :class="field.type === 'photo' ? 'record-card__row--stack' : 'record-card__row'">
|
||||||
|
<text :class="field.type === 'photo' ? 'record-card__label--stack' : 'record-card__label'">{{ field.label }}</text>
|
||||||
|
|
||||||
|
<!-- text -->
|
||||||
|
<text v-if="!field.type || field.type === 'text'" class="record-card__value">
|
||||||
|
{{ item[field.key] || '--' }}
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<!-- tag -->
|
||||||
|
<view v-else-if="field.type === 'tag'" class="record-card__tag"
|
||||||
|
:style="tagBgStyle(field, item)">
|
||||||
|
<text class="record-card__tag-icon" :style="tagIconStyle(field, item)">
|
||||||
|
{{ tagPass(field, item) ? '\u2713' : '\u2717' }}
|
||||||
|
</text>
|
||||||
|
<text class="record-card__tag-text" :style="tagTextStyle(field, item)">
|
||||||
|
{{ tagDisplayText(field, item) }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- photo -->
|
||||||
|
<view v-else-if="field.type === 'photo'" class="record-card__value--stack">
|
||||||
|
<nbd-photo-view :attachUrl="item[field.key]" :cols="field.cols || 4" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
fields: { type: Array, default: () => [] },
|
||||||
|
list: { type: Array, default: () => [] },
|
||||||
|
title: { type: String, default: '' },
|
||||||
|
customStyle: { type: Object, default: () => ({}) },
|
||||||
|
statusKey: { type: String, default: '' },
|
||||||
|
statusMatch: { default: '合格' },
|
||||||
|
})
|
||||||
|
|
||||||
|
const showPopup = ref(false)
|
||||||
|
|
||||||
|
const latest = computed(() => props.list[0] || null)
|
||||||
|
|
||||||
|
// ---- 字段可见性 ----
|
||||||
|
const isVisible = (field, item) => {
|
||||||
|
const cond = field.showWhen
|
||||||
|
if (!cond) return true
|
||||||
|
const val = item[cond.key]
|
||||||
|
if (cond.notEqual !== undefined) return val !== cond.notEqual
|
||||||
|
if (cond.equal !== undefined) return val === cond.equal
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- tag 辅助 ----
|
||||||
|
const tagPass = (field, item) => item[field.key] === field.tagMatch
|
||||||
|
|
||||||
|
const tagIconStyle = (field, item) => ({
|
||||||
|
color: tagPass(field, item)
|
||||||
|
? (field.passColor || '#22c55e')
|
||||||
|
: (field.failColor || '#ef4444'),
|
||||||
|
})
|
||||||
|
|
||||||
|
const tagTextStyle = (field, item) => ({
|
||||||
|
color: tagPass(field, item)
|
||||||
|
? (field.passColor || '#16a34a')
|
||||||
|
: (field.failColor || '#dc2626'),
|
||||||
|
})
|
||||||
|
|
||||||
|
const tagBgStyle = (field, item) => ({
|
||||||
|
background: tagPass(field, item)
|
||||||
|
? (field.passBg || '#ebf9f0')
|
||||||
|
: (field.failBg || '#fef2f2'),
|
||||||
|
})
|
||||||
|
|
||||||
|
const tagDisplayText = (field, item) =>
|
||||||
|
tagPass(field, item)
|
||||||
|
? (field.tagPassText ?? item[field.key] ?? '--')
|
||||||
|
: (field.tagFailText ?? item[field.key] ?? '--')
|
||||||
|
|
||||||
|
// ---- 卡片状态 ----
|
||||||
|
const cardStatus = (item) => {
|
||||||
|
if (!props.statusKey) return ''
|
||||||
|
return item[props.statusKey] === props.statusMatch ? 'pass' : 'fail'
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$primary: #2979ff;
|
||||||
|
$card-bg: #fff;
|
||||||
|
$card-shadow: 0 2rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||||
|
$text: #1a1a2e;
|
||||||
|
$text-secondary: #8e99a4;
|
||||||
|
|
||||||
|
.record-card {
|
||||||
|
|
||||||
|
&__loading,
|
||||||
|
&__empty {
|
||||||
|
padding: 40rpx 24rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__loading-text,
|
||||||
|
&__empty-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: $text-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
&__header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
padding: 0 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__bar {
|
||||||
|
width: 6rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
border-radius: 3rpx;
|
||||||
|
background: $primary;
|
||||||
|
margin-right: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: $text;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__more {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $primary;
|
||||||
|
padding: 6rpx 16rpx;
|
||||||
|
background: rgba($primary, 0.08);
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__card {
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
background: $card-bg;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
box-shadow: $card-shadow;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 6rpx;
|
||||||
|
transition: background 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--pass::before {
|
||||||
|
background: #22c55e;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--fail::before {
|
||||||
|
background: #ef4444;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8rpx 0;
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
|
||||||
|
&--stack {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.record-card__value {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__label {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: $text-secondary;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
width: 160rpx;
|
||||||
|
|
||||||
|
&--stack {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: $text-secondary;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
width: 140rpx;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__value {
|
||||||
|
color: $text;
|
||||||
|
flex: 1;
|
||||||
|
text-align: left;
|
||||||
|
font-family: "SF Mono", "Menlo", "Consolas", monospace;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #0f1724;
|
||||||
|
letter-spacing: 0.3rpx;
|
||||||
|
|
||||||
|
&--stack {
|
||||||
|
padding-left: 20rpx;
|
||||||
|
padding-bottom: 8rpx;
|
||||||
|
padding-top: 8rpx;
|
||||||
|
font-family: "SF Mono", "Menlo", "Consolas", monospace;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #0f1724;
|
||||||
|
letter-spacing: 0.3rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__tag {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6rpx;
|
||||||
|
padding: 6rpx 16rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
min-width: 100rpx;
|
||||||
|
justify-content: center;
|
||||||
|
// background 由 tagBgStyle() 内联控制
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
font-size: 22rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
// color 由 tagIconStyle() 内联控制
|
||||||
|
}
|
||||||
|
|
||||||
|
&-text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
// color 由 tagTextStyle() 内联控制
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===== 弹窗 =====
|
||||||
|
&__popup {
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 80vh;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__popup-hd {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 24rpx 28rpx 12rpx;
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__popup-title {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__popup-close {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: $text-secondary;
|
||||||
|
padding: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__popup-bd {
|
||||||
|
flex: 1;
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow-y: auto;
|
||||||
|
background: #f5f5f5;
|
||||||
|
padding: 12rpx 20rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__card--popup {
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 12rpx;
|
||||||
|
box-shadow: $card-shadow;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__card--popup:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -162,7 +162,9 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 防腐记录 -->
|
<!-- 防腐记录 -->
|
||||||
<nbd-anti-record :params="{ materialCode: form.MaterialCode, projectId: currentProject.ProjectId }" />
|
<view class="section">
|
||||||
|
<nbd-record-card title="防腐" :list="antiList" :fields="antiFields" status-key="CheckResult" status-match="合格" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -179,7 +181,25 @@ import { onLoad } from '@dcloudio/uni-app'
|
|||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { watch, nextTick } from 'vue'
|
import { watch, nextTick } from 'vue'
|
||||||
import { useUserStore } from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
import { reqMaterialInfoByMaterialCode, reqPaintCodeList, reqSaveAntiCorrosionCheck , reqGetAntiCorrosionCheck } from '@/api/hj.js'
|
import { reqMaterialInfoByMaterialCode, reqPaintCodeList, reqSaveAntiCorrosionCheck, reqGetAntiCorrosionCheck } from '@/api/hj.js'
|
||||||
|
|
||||||
|
// 防腐记录字段
|
||||||
|
const antiFields = [
|
||||||
|
{ label: '防腐等级', key: 'AnticorrosionLevel' },
|
||||||
|
{ label: '中间漆', key: 'IntermediatePaint' },
|
||||||
|
{ label: '面漆', key: 'Topcoat' },
|
||||||
|
{ label: '漆膜厚度', key: 'FilmThickness' },
|
||||||
|
{ label: '喷砂情况', key: 'SandBlasting' },
|
||||||
|
{ label: '除锈喷砂情况', key: 'RustSandBlasting' },
|
||||||
|
{ label: '检查人', key: 'CheckPersonName' },
|
||||||
|
{ label: '检查时间', key: 'CheckTime' },
|
||||||
|
{ label: '检查结果', key: 'CheckResult', type: 'tag', tagMatch: '合格' },
|
||||||
|
{ label: '不合格原因', key: 'UnqualifiedReason', showWhen: { key: 'CheckResult', notEqual: '合格' } },
|
||||||
|
{ label: '整改要求', key: 'RectifyRequirement', showWhen: { key: 'CheckResult', notEqual: '合格' } },
|
||||||
|
{ label: '照片', key: 'AttachUrl1', type: 'photo', cols: 4 },
|
||||||
|
]
|
||||||
|
|
||||||
|
const antiList = ref([])
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { userInfo, currentProject } = storeToRefs(userStore)
|
const { userInfo, currentProject } = storeToRefs(userStore)
|
||||||
@@ -265,12 +285,13 @@ const loadData = async (id) => {
|
|||||||
form.value = res.data
|
form.value = res.data
|
||||||
}
|
}
|
||||||
if (res1.code === 1 && res1.data) {
|
if (res1.code === 1 && res1.data) {
|
||||||
|
antiList.value = res1.data
|
||||||
let antiData = res1.data
|
let antiData = res1.data
|
||||||
if(antiData&&antiData.length>0){
|
if (antiData && antiData.length > 0) {
|
||||||
antiForm.value = {
|
antiForm.value = {
|
||||||
...antiData[0],
|
...antiData[0],
|
||||||
CheckResult: '合格',
|
CheckResult: '合格',
|
||||||
UnqualifiedReason: '',
|
UnqualifiedReason: '',
|
||||||
RectifyRequirement: '',
|
RectifyRequirement: '',
|
||||||
Remark: ''
|
Remark: ''
|
||||||
}
|
}
|
||||||
@@ -284,6 +305,7 @@ const loadData = async (id) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 提交
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
if (!antiForm.value.PaintId) {
|
if (!antiForm.value.PaintId) {
|
||||||
uni.showToast({ title: '请选择防腐等级', icon: 'none' })
|
uni.showToast({ title: '请选择防腐等级', icon: 'none' })
|
||||||
@@ -480,6 +502,4 @@ $shadow-md: 0 2rpx 12rpx rgba(0, 0, 0, 0.04), 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+527
-177
@@ -2,203 +2,281 @@
|
|||||||
<view class="detail-page">
|
<view class="detail-page">
|
||||||
<!-- 焊口主标识 -->
|
<!-- 焊口主标识 -->
|
||||||
<view class="joint-hero">
|
<view class="joint-hero">
|
||||||
<text class="joint-hero__code">{{ form.WeldJointCode || '焊口编码' }}</text>
|
<text class="joint-hero__code">{{ info.WeldJointCode || '--' }}</text>
|
||||||
<view class="joint-hero__meta">
|
<view class="joint-hero__meta">
|
||||||
<view class="joint-hero__pill">
|
<view class="joint-hero__pill">
|
||||||
<text class="pill-label">管线编码</text>
|
<text class="pill-label">管线编码</text>
|
||||||
<text class="pill-value">{{ form.PipelineCode || '--' }}</text>
|
<text class="pill-value">{{ info.PipelineCode || '--' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="joint-hero__pill">
|
<view class="joint-hero__pill">
|
||||||
<text class="pill-label">项目编号</text>
|
<text class="pill-label">项目名称</text>
|
||||||
<text class="pill-value">{{ form.ProjectName || form.ProjectId || '--' }}</text>
|
<text class="pill-value">{{ info.ProjectName || info.ProjectId || '--' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 坡口类型 -->
|
<!-- 组对填报 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section__header">
|
<view class="section__header">
|
||||||
<view class="section__bar"></view>
|
<view class="section__bar"></view>
|
||||||
<text class="section__title">坡口类型</text>
|
<text class="section__title">组对填报</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<view class="card__row" :class="{ 'card__row--warn': !form.GrooveTypeName }"
|
<!-- 坡口类型名称 -->
|
||||||
@click="showGroovePicker = true">
|
<view class="card__row" @click="showPaintCodePicker = true">
|
||||||
<text class="card__label"><text class="required">*</text>坡口类型名称</text>
|
<text class="card__label">坡口类型名称</text>
|
||||||
<view class="card__value-wrap card__value-wrap--clickable">
|
<view class="card__value-wrap card__value-wrap--clickable">
|
||||||
<text class="card__value" :class="{ 'card__value--placeholder': !form.GrooveTypeName }">
|
<text class="card__value" :class="{ 'card__value--placeholder': !makeRightForm.GrooveTypeName }">
|
||||||
{{ form.GrooveTypeName || '请选择坡口类型' }}
|
{{ makeRightForm.GrooveTypeName || '请选择坡口类型' }}
|
||||||
</text>
|
</text>
|
||||||
<u-icon name="arrow-down" :size="24" color="#bbb" />
|
<u-icon name="arrow-down" :size="24" color="#bbb" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 坡口类型编码 -->
|
||||||
<view class="card__row">
|
<view class="card__row">
|
||||||
<text class="card__label">坡口类型编码</text>
|
<text class="card__label">坡口类型编码</text>
|
||||||
<text class="card__value">{{ form.GrooveTypeCode || '--' }}</text>
|
<view class="card__value-wrap">
|
||||||
|
<input class="card__input" v-model="makeRightForm.GrooveForm" type="text"
|
||||||
|
placeholder="请输入坡口形式" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 坡口加工类型 -->
|
||||||
<view class="card__row">
|
<view class="card__row">
|
||||||
<text class="card__label">坡口加工类型</text>
|
<text class="card__label">坡口加工类型</text>
|
||||||
<view class="card__value-wrap">
|
<view class="card__value-wrap">
|
||||||
<input class="card__input" v-model="form.GrooveProcessType" type="digit" placeholder="请输入" />
|
<input class="card__input" v-model="makeRightForm.GrooveAngle" type="digit"
|
||||||
|
placeholder="请输入坡口角度" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<!-- 坡口角度 -->
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 坡口参数 -->
|
|
||||||
<view class="section">
|
|
||||||
<view class="section__header">
|
|
||||||
<view class="section__bar"></view>
|
|
||||||
<text class="section__title">坡口参数</text>
|
|
||||||
</view>
|
|
||||||
<view class="card">
|
|
||||||
<view class="card__row">
|
<view class="card__row">
|
||||||
<text class="card__label">坡口角度</text>
|
<text class="card__label">坡口角度</text>
|
||||||
<view class="card__value-wrap">
|
<view class="card__value-wrap">
|
||||||
<input class="card__input" v-model="form.GrooveAngle" type="digit" placeholder="请输入" />
|
<nbd-check-btn v-model="makeRightForm.IsMaterialCodeBatchNoAccurate" passKey="准确" failKey="不准确"
|
||||||
<text class="card__unit">°</text>
|
passText="准确" failText="不准确" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 组对间隙 -->
|
||||||
<view class="card__row">
|
<view class="card__row">
|
||||||
<text class="card__label">组对间隙</text>
|
<text class="card__label">组对间隙</text>
|
||||||
<view class="card__value-wrap">
|
<view class="card__value-wrap">
|
||||||
<input class="card__input" v-model="form.FitupGap" type="digit" placeholder="请输入" />
|
<nbd-check-btn v-model="makeRightForm.IsMaterialQuantityAccurate" passKey="准确" failKey="不准确"
|
||||||
<text class="card__unit">mm</text>
|
passText="准确" failText="不准确" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 错边量 -->
|
||||||
<view class="card__row">
|
<view class="card__row">
|
||||||
<text class="card__label">错边量</text>
|
<text class="card__label">错边量</text>
|
||||||
<view class="card__value-wrap">
|
<view class="card__value-wrap">
|
||||||
<input class="card__input" v-model="form.Misalignment" type="digit" placeholder="请输入" />
|
<nbd-check-btn v-model="makeRightForm.IsMaterialQuantityAccurate" passKey="准确" failKey="不准确"
|
||||||
<text class="card__unit">mm</text>
|
passText="准确" failText="不准确" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 焊缝余高 -->
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">焊缝余高</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<nbd-check-btn v-model="makeRightForm.IsMaterialQuantityAccurate" passKey="准确" failKey="不准确"
|
||||||
|
passText="准确" failText="不准确" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 焊缝高度 -->
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">焊缝高度</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<nbd-check-btn v-model="makeRightForm.IsMaterialQuantityAccurate" passKey="准确" failKey="不准确"
|
||||||
|
passText="准确" failText="不准确" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 焊缝宽度 -->
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">焊缝宽度</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<nbd-check-btn v-model="makeRightForm.IsMaterialQuantityAccurate" passKey="准确" failKey="不准确"
|
||||||
|
passText="准确" failText="不准确" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 表面缺陷 -->
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">表面缺陷</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<nbd-check-btn v-model="makeRightForm.IsMaterialQuantityAccurate" passKey="准确" failKey="不准确"
|
||||||
|
passText="准确" failText="不准确" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 备注 -->
|
<!-- 检查信息 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section__header">
|
<view class="section__header">
|
||||||
<view class="section__bar"></view>
|
<view class="section__bar"></view>
|
||||||
<text class="section__title">备注</text>
|
<text class="section__title">检查信息</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
|
<!-- 检查结果 -->
|
||||||
<view class="card__row">
|
<view class="card__row">
|
||||||
<textarea class="remark-input" v-model="remark" placeholder="请输入备注信息(选填)" :maxlength="200" auto-height />
|
<text class="card__label">检查结果</text>
|
||||||
|
<view class="card__value-wrap card__value-wrap--clickable">
|
||||||
|
<nbd-check-btn v-model="makeRightForm.CheckResult" passKey="合格" failKey="不合格" passText="合格"
|
||||||
|
failText="不合格" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<textarea class="remark-input" v-model="makeRightForm.UnqualifiedReason" placeholder="请输入"
|
||||||
|
:maxlength="200" auto-height />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 整改要求 -->
|
||||||
|
<view class="card__row card__row--stack">
|
||||||
|
<text class="card__label">整改要求</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<textarea class="remark-input" v-model="makeRightForm.RectifyRequirement" placeholder="请输入"
|
||||||
|
:maxlength="200" auto-height />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 备注 -->
|
||||||
|
<view class="card__row card__row--stack">
|
||||||
|
<text class="card__label">备注</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<textarea class="remark-input" v-model="makeRightForm.Remark" placeholder="请输入备注信息(选填)"
|
||||||
|
:maxlength="200" auto-height />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 照片 -->
|
||||||
|
<view class="card__row card__row--stack">
|
||||||
|
<text class="card__label">照片</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<nbd-photo-upload ref="photoRef" v-model:attachUrl="formAttachUrl" typeName="AntiRust" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 现场照片 -->
|
<!-- 下料记录 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section__header">
|
<nbd-record-card title="下料" :list="cuttingList" :fields="cuttingFields" status-key="CheckResult"
|
||||||
<view class="section__bar"></view>
|
status-match="合格" />
|
||||||
<text class="section__title">照片</text>
|
|
||||||
</view>
|
|
||||||
<view class="img-box">
|
|
||||||
<nbd-photo-upload ref="photoRef" v-model:attachUrl="attachUrl" typeName="MakeRight" />
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<block v-for="(item, index) in info.preWeldMaterialItems" :key="item.MaterialCode || index">
|
||||||
|
<!-- 材料信息 -->
|
||||||
|
<view class="section">
|
||||||
|
<view class="section__header">
|
||||||
|
<view class="section__bar"></view>
|
||||||
|
<text class="section__title">{{ item.MaterialName || item.MaterialCode || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="card">
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">炉号</text>
|
||||||
|
<text class="card__value">
|
||||||
|
{{ item.HeatNo || '--' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">批号</text>
|
||||||
|
<text class="card__value">{{ item.BatchNo || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">规格</text>
|
||||||
|
<text class="card__value">{{ item.MaterialSpec || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">单位</text>
|
||||||
|
<text class="card__value">{{ item.MaterialUnit || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="card__row card__row--stack">
|
||||||
|
<text class="card__label">材料描述</text>
|
||||||
|
<text class="card__value">{{ item.MaterialDef || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
<!-- 提交按钮 -->
|
<!-- 提交按钮 -->
|
||||||
<view class="submit-bar">
|
<view class="submit-bar">
|
||||||
<view class="btn-primary-gradient" @click="handleSubmit">
|
<view class="btn-primary-gradient" @click="handleSubmit">
|
||||||
<text class="btn-primary-gradient__text">提交</text>
|
<text class="btn-primary-gradient__text">提交结果</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 坡口类型选择器 -->
|
|
||||||
<nbd-select v-model="showGroovePicker" title="选择坡口类型" :list="grooveTypeOptions" label-key="BaseInfoName"
|
|
||||||
value-key="BaseInfoCode" @confirm="selectGrooveType" />
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, watch, nextTick } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useUserStore } from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
import { reqPreWeldJointByWeldJointId, reqGetGrooveTypeList, reqSaveFitupCheck } from '@/api/hj'
|
|
||||||
|
|
||||||
|
import { reqPreWeldJointByWeldJointId, reqSaveCuttingCheck, reqCuttingCheckByWeldJointId, reqGetAntiCorrosionCheck } from '@/api/hj'
|
||||||
|
|
||||||
|
const cuttingFields = [
|
||||||
|
{ label: '下料长度', key: 'CuttingLength' },
|
||||||
|
{ label: '坡口形式', key: 'GrooveForm' },
|
||||||
|
{ label: '坡口角度', key: 'GrooveAngle' },
|
||||||
|
{ label: '材料编码批次', key: 'IsMaterialCodeBatchNoAccurate', type: 'tag', tagMatch: true, tagPassText: '准确', tagFailText: '不准确' },
|
||||||
|
{ label: '材料数量', key: 'IsMaterialQuantityAccurate', type: 'tag', tagMatch: true, tagPassText: '准确', tagFailText: '不准确' },
|
||||||
|
{ label: '检查人', key: 'CheckPersonName' },
|
||||||
|
{ label: '检查时间', key: 'CheckTime' },
|
||||||
|
{ label: '检查结果', key: 'CheckResult', type: 'tag', tagMatch: '合格' },
|
||||||
|
{ label: '不合格原因', key: 'UnqualifiedReason', showWhen: { key: 'CheckResult', notEqual: '合格' } },
|
||||||
|
{ label: '整改要求', key: 'RectifyRequirement', showWhen: { key: 'CheckResult', notEqual: '合格' } },
|
||||||
|
{ label: '照片', key: 'AttachUrl1', type: 'photo', cols: 4 },
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
const cuttingList = ref([])
|
||||||
|
const antiListMap = ref({})
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { userInfo, currentProject } = storeToRefs(userStore)
|
const { userInfo, currentProject } = storeToRefs(userStore)
|
||||||
|
|
||||||
const showGroovePicker = ref(false)
|
const info = ref({})
|
||||||
const grooveTypeOptions = ref([])
|
|
||||||
const attachUrl = ref('')
|
|
||||||
const remark = ref('')
|
const remark = ref('')
|
||||||
|
const formAttachUrl = ref('')
|
||||||
|
const id = ref('')
|
||||||
|
const makeRightForm = ref({
|
||||||
|
GrooveTypeId: '', // 坡口类型ID
|
||||||
|
GrooveTypeName: '', // 坡口类型名称
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 照片组件引用
|
||||||
const photoRef = ref(null)
|
const photoRef = ref(null)
|
||||||
|
|
||||||
const form = ref({
|
const failVisible = ref(layingOffForm.value.CheckResult === '不合格')
|
||||||
WeldJointId: '',
|
const failAnimating = ref(false)
|
||||||
WeldJointCode: '',
|
const failLeaving = ref(false)
|
||||||
PipelineId: '',
|
|
||||||
PipelineCode: '',
|
|
||||||
ProjectId: '',
|
|
||||||
GrooveTypeId: '',
|
|
||||||
GrooveTypeCode: '',
|
|
||||||
GrooveTypeName: '',
|
|
||||||
GrooveProcessType: '',
|
|
||||||
GrooveAngle: '',
|
|
||||||
FitupGap: '',
|
|
||||||
Misalignment: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
const fetchGrooveTypes = async () => {
|
watch(() => layingOffForm.value.CheckResult, async (val) => {
|
||||||
try {
|
if (val === '不合格') {
|
||||||
const res = await reqGetGrooveTypeList()
|
failVisible.value = true
|
||||||
if (res.code === 1 && res.data) {
|
await nextTick()
|
||||||
grooveTypeOptions.value = res.data
|
failAnimating.value = true
|
||||||
}
|
failLeaving.value = false
|
||||||
} catch (err) {
|
} else {
|
||||||
console.error('获取坡口类型列表失败:', err)
|
failLeaving.value = true
|
||||||
}
|
failAnimating.value = false
|
||||||
}
|
setTimeout(() => {
|
||||||
const selectGrooveType = (item) => {
|
failVisible.value = false
|
||||||
form.value.GrooveTypeId = item.BaseInfoId
|
failLeaving.value = false
|
||||||
form.value.GrooveTypeCode = item.BaseInfoCode
|
}, 250)
|
||||||
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 = () => {
|
const handleSubmit = () => {
|
||||||
if (!form.value.GrooveTypeName) {
|
|
||||||
uni.showToast({ title: '请选择坡口类型', icon: 'none' })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认提交',
|
title: '确认提交',
|
||||||
content: '确定提交组对检查结果吗?',
|
content: '确定提交吗?',
|
||||||
success: async (res) => {
|
success: async (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
if (photoRef.value?.hasPending()) {
|
if (photoRef.value?.hasPending()) {
|
||||||
@@ -206,36 +284,92 @@ const handleSubmit = () => {
|
|||||||
await photoRef.value.uploadAll()
|
await photoRef.value.uploadAll()
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
}
|
}
|
||||||
|
const CuttingAttachUrl1 = formAttachUrl.value || info.value.CuttingAttachUrl1 || ''
|
||||||
|
|
||||||
const checkTime = new Date().toISOString()
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
FitupCheckId: form.value.FitupCheckId || '',
|
ProjectId: currentProject.value?.ProjectId, // 项目ID
|
||||||
ProjectId: form.value?.ProjectId,
|
WeldJointId: info.value?.WeldJointId, // 焊口ID
|
||||||
WeldJointId: form.value.WeldJointId,
|
CuttingLength: layingOffForm.value.CuttingLength, // 下料长度
|
||||||
PipelineCode: form.value.PipelineCode || '',
|
GrooveForm: layingOffForm.value.GrooveForm, // 坡口形式
|
||||||
WeldJointCode: form.value.WeldJointCode || '',
|
GrooveAngle: layingOffForm.value.GrooveAngle, // 坡口角度
|
||||||
GrooveTypeId: form.value.GrooveTypeId,
|
IsMaterialCodeBatchNoAccurate: layingOffForm.value.IsMaterialCodeBatchNoAccurate, // 材料编码批次
|
||||||
GrooveTypeCode: form.value.GrooveTypeCode || '',
|
IsMaterialQuantityAccurate: layingOffForm.value.IsMaterialQuantityAccurate, // 材料数量
|
||||||
GrooveTypeName: form.value.GrooveTypeName || '',
|
CheckPerson: userInfo.value?.PersonId, // 检查人员
|
||||||
GrooveProcessType: form.value.GrooveProcessType || '',
|
CheckTime: uni.formatTime(new Date().getTime(), 'YYYY-MM-DD HH:mm'), // 检查时间
|
||||||
GrooveAngle: Number(form.value.GrooveAngle) || 0,
|
CreateUser: userInfo.value?.PersonId, // 创建人员
|
||||||
FitupGap: Number(form.value.FitupGap) || 0,
|
CheckResult: layingOffForm.value.CheckResult, // 检查结果
|
||||||
Misalignment: Number(form.value.Misalignment) || 0,
|
Remark: remark.value, // 备注
|
||||||
CheckPerson: userInfo.value?.PersonId || '',
|
UnqualifiedReason: layingOffForm.value.UnqualifiedReason, // 不合格原因
|
||||||
CheckPersonName: userInfo.value?.PersonName || '',
|
RectifyRequirement: layingOffForm.value.RectifyRequirement, // 整改要求
|
||||||
CheckTime: checkTime,
|
AttachUrl1: CuttingAttachUrl1,
|
||||||
FitupAttachUrl1: attachUrl.value || form.value.FitupAttachUrl1 || '',
|
}
|
||||||
Remark: remark.value || ''
|
|
||||||
}
|
|
||||||
console.log('提交参数:', params)
|
console.log('提交参数:', params)
|
||||||
await reqSaveFitupCheck(params)
|
await reqSaveCuttingCheck(params)
|
||||||
uni.showToast({ title: '提交成功', icon: 'none' })
|
uni.showToast({ title: '提交成功', icon: 'none' })
|
||||||
setTimeout(() => { uni.navigateBack() }, 1500)
|
setTimeout(() => { uni.navigateBack() }, 1500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onLoad((opt) => {
|
||||||
|
if (opt.id) {
|
||||||
|
id.value = opt.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
if (id.value) {
|
||||||
|
getInfo(id.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const getInfo = async (id) => {
|
||||||
|
try {
|
||||||
|
uni.showLoading({ title: '加载中...', mask: true })
|
||||||
|
const res = await reqPreWeldJointByWeldJointId(id)
|
||||||
|
if (res.code === 1) {
|
||||||
|
info.value = res.data
|
||||||
|
// 获取下料记录
|
||||||
|
if (info.value.WeldJointId) {
|
||||||
|
const cuttingRes = await reqCuttingCheckByWeldJointId(info.value.WeldJointId)
|
||||||
|
if (cuttingRes.code === 1 && cuttingRes.data) {
|
||||||
|
cuttingList.value = cuttingRes.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取防腐记录(每个材料一条)
|
||||||
|
const materials = info.value.preWeldMaterialItems || []
|
||||||
|
if (materials.length > 0) {
|
||||||
|
const antiResults = await Promise.all(
|
||||||
|
materials.map(m => reqGetAntiCorrosionCheck({
|
||||||
|
materialCode: m.MaterialCode,
|
||||||
|
projectId: currentProject.value.ProjectId
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
const map = {}
|
||||||
|
antiResults.forEach((r, i) => {
|
||||||
|
if (r.code === 1 && r.data) map[materials[i].MaterialCode] = r.data
|
||||||
|
})
|
||||||
|
antiListMap.value = map
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取焊口详情失败:', error)
|
||||||
|
uni.showToast({ title: '加载失败', icon: 'none' })
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleMutualCheck = (id) => {
|
||||||
|
if (!id) {
|
||||||
|
uni.showToast({ title: '缺少材料信息', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.navigateTo({ url: `/scanpages/hj/do_anti_rust?id=${id}` })
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -348,54 +482,131 @@ $shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== 卡片页面覆盖(继承 page.scss 公共 .card 样式)=====
|
// ===== 坡口参数仪表 =====
|
||||||
.card__row {
|
.spec-grid {
|
||||||
&:active {
|
background: $card-bg;
|
||||||
background: #fafbfc;
|
border-radius: $radius;
|
||||||
}
|
|
||||||
|
|
||||||
&--warn .card__label::before {
|
|
||||||
background: #ef4444;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.card__value {
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
&--placeholder {
|
|
||||||
color: #b0bec5;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.card__value-wrap {
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card__input {
|
|
||||||
text-align: right;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
&::placeholder {
|
|
||||||
color: #b0bec5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===== 备注 =====
|
|
||||||
.remark-input {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: $text;
|
|
||||||
min-height: 120rpx;
|
|
||||||
padding: 8rpx 0;
|
padding: 8rpx 0;
|
||||||
line-height: 1.6;
|
box-shadow: $shadow-md;
|
||||||
|
|
||||||
&::placeholder {
|
.spec-item {
|
||||||
color: #b0bec5;
|
padding: 24rpx 28rpx;
|
||||||
|
border-bottom: 1rpx solid $border;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__header {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__label {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $text-secondary;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__value {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: $text;
|
||||||
|
line-height: 1;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__unit {
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: $text-secondary;
|
||||||
|
margin-left: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__bar-track {
|
||||||
|
height: 8rpx;
|
||||||
|
background: #f0f2f5;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__bar-fill {
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
background: linear-gradient(90deg, $primary, #6ba3ff);
|
||||||
|
transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 12rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.35);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.fill--amber {
|
||||||
|
background: linear-gradient(90deg, #f59e0b, #fbbf24);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.fill--teal {
|
||||||
|
background: linear-gradient(90deg, #14b8a6, #2dd4bf);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== 提交栏 =====
|
|
||||||
|
// ===== 校验卡片 =====
|
||||||
|
.check-card {
|
||||||
|
background: $card-bg;
|
||||||
|
border-radius: $radius;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: $shadow-md;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 22rpx 28rpx;
|
||||||
|
border-bottom: 1rpx solid $border;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__left {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__label {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: $text;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__desc {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: $text-secondary;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__action {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===== 提交栏(悬浮底部) =====
|
||||||
.submit-bar {
|
.submit-bar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -403,7 +614,146 @@ $shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
padding: 20rpx 24rpx;
|
padding: 20rpx 24rpx;
|
||||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||||
background: linear-gradient(180deg, rgba($bg, 0) 0%, $bg 20%);
|
background: linear-gradient(180deg, rgba(240, 242, 245, 0) 0%, $bg 20%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===== 备注输入框 =====
|
||||||
|
.remark-card {
|
||||||
|
background: $card-bg;
|
||||||
|
border-radius: $radius;
|
||||||
|
padding: 24rpx 28rpx;
|
||||||
|
box-shadow: $shadow-md;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.remark-input {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 120rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: $text;
|
||||||
|
line-height: 1.6;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
|
&::placeholder {
|
||||||
|
color: #b0bec5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.remark-count {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 16rpx;
|
||||||
|
right: 24rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: $text-secondary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ================================================================
|
||||||
|
// 材料质检区块 —— 三合一 section
|
||||||
|
// ================================================================
|
||||||
|
|
||||||
|
// section 容器:微背景 + 内边距聚合三个子元素
|
||||||
|
.section {
|
||||||
|
background: #fafbfc;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 24rpx 0 0;
|
||||||
|
margin-bottom: 28rpx;
|
||||||
|
box-shadow: $shadow-md;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- 材料详情卡片 ----
|
||||||
|
// 底部圆角清零,与下方 nav-row 无缝衔接
|
||||||
|
.card {
|
||||||
|
border-radius: $radius $radius 0 0;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编码类字段(炉号 / 批号 / 规格 / 单位)→ monospace
|
||||||
|
.card__value {
|
||||||
|
font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: $text;
|
||||||
|
letter-spacing: 0.3rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 材料描述 → 回退系统字体
|
||||||
|
.card__row--stack .card__value {
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: normal;
|
||||||
|
color: $text-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- 互检导航按钮 ----
|
||||||
|
.nav-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 0;
|
||||||
|
padding: 24rpx 28rpx;
|
||||||
|
background: $card-bg;
|
||||||
|
border-radius: 0;
|
||||||
|
border-top: 1rpx solid $border;
|
||||||
|
box-shadow: none;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
margin-bottom: 28rpx;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
background: #f5f7fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__dot {
|
||||||
|
width: 10rpx;
|
||||||
|
height: 10rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: $primary;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__label {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: $text;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__arrow {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: $text-secondary;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 1;
|
||||||
|
margin-right: -4rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- 防腐记录 ----
|
||||||
|
// 覆盖组件内部边距(已由父 .section 聚合)
|
||||||
|
:deep(.anti-record__section) {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 防腐记录卡片底部圆角收口,与 section 容器对齐
|
||||||
|
:deep(.anti-record__card) {
|
||||||
|
border-radius: 0 0 $radius $radius;
|
||||||
|
border-top: 1rpx solid $border;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 防腐记录 header 缩进对齐,隐藏蓝色竖条(父 section header 已承载标题层级)
|
||||||
|
:deep(.anti-record__header) {
|
||||||
|
padding: 20rpx 28rpx 12rpx;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.anti-record__bar) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<view class="card">
|
<view class="card">
|
||||||
<!-- 下料长度 -->
|
<!-- 下料长度 -->
|
||||||
<view class="card__row" @click="showPaintCodePicker = true">
|
<view class="card__row" @click="showPaintCodePicker = true">
|
||||||
<text class="card__label required">下料长度</text>
|
<text class="card__label">下料长度</text>
|
||||||
<view class="card__value-wrap">
|
<view class="card__value-wrap">
|
||||||
<input class="card__input" v-model="layingOffForm.CuttingLength" type="digit"
|
<input class="card__input" v-model="layingOffForm.CuttingLength" type="digit"
|
||||||
placeholder="请输入下料长度" />
|
placeholder="请输入下料长度" />
|
||||||
@@ -32,24 +32,40 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 坡口形式 -->
|
<!-- 坡口形式 -->
|
||||||
<view class="card__row">
|
<view class="card__row">
|
||||||
<text class="card__label required">坡口形式</text>
|
<text class="card__label">坡口形式</text>
|
||||||
<view class="card__value-wrap">
|
<view class="card__value-wrap">
|
||||||
<input class="card__input" v-model="layingOffForm.GrooveForm" type="text"
|
<input class="card__input" v-model="layingOffForm.GrooveForm" type="text"
|
||||||
placeholder="请输入坡口形式" />
|
placeholder="请输入坡口形式" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 坡口角度 -->
|
<!-- 坡口角度 -->
|
||||||
<view class="card__row required">
|
<view class="card__row">
|
||||||
<text class="card__label">坡口角度</text>
|
<text class="card__label">坡口角度</text>
|
||||||
<view class="card__value-wrap">
|
<view class="card__value-wrap">
|
||||||
<input class="card__input" v-model="layingOffForm.GrooveAngle" type="digit"
|
<input class="card__input" v-model="layingOffForm.GrooveAngle" type="digit"
|
||||||
placeholder="请输入坡口角度" />
|
placeholder="请输入坡口角度" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 材料编码批次是否准确 -->
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">材料编码批次是否准确</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<nbd-check-btn v-model="layingOffForm.IsMaterialCodeBatchNoAccurate" passKey="准确" failKey="不准确" passText="准确"
|
||||||
|
failText="不准确" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 材料数量是否准确 -->
|
||||||
|
<view class="card__row">
|
||||||
|
<text class="card__label">材料数量是否准确</text>
|
||||||
|
<view class="card__value-wrap">
|
||||||
|
<nbd-check-btn v-model="layingOffForm.IsMaterialQuantityAccurate" passKey="准确" failKey="不准确" passText="准确"
|
||||||
|
failText="不准确" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 检查信息 -->
|
<!-- 检查信息 -->
|
||||||
<view class="section">
|
<view class="section">
|
||||||
<view class="section__header">
|
<view class="section__header">
|
||||||
<view class="section__bar"></view>
|
<view class="section__bar"></view>
|
||||||
@@ -97,12 +113,17 @@
|
|||||||
<view class="card__row card__row--stack">
|
<view class="card__row card__row--stack">
|
||||||
<text class="card__label">照片</text>
|
<text class="card__label">照片</text>
|
||||||
<view class="card__value-wrap">
|
<view class="card__value-wrap">
|
||||||
<nbd-photo-upload ref="photoRef" v-model:attachUrl="files" typeName="AntiRust" />
|
<nbd-photo-upload ref="photoRef" v-model:attachUrl="formAttachUrl" typeName="AntiRust" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 下料记录 -->
|
||||||
|
<view class="section">
|
||||||
|
<nbd-record-card title="下料" :list="cuttingList" :fields="cuttingFields" status-key="CheckResult" status-match="合格" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<block v-for="(item, index) in info.preWeldMaterialItems" :key="item.MaterialCode || index">
|
<block v-for="(item, index) in info.preWeldMaterialItems" :key="item.MaterialCode || index">
|
||||||
<!-- 材料信息 -->
|
<!-- 材料信息 -->
|
||||||
@@ -143,38 +164,14 @@
|
|||||||
<text class="nav-row__arrow">›</text>
|
<text class="nav-row__arrow">›</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 防腐记录 -->
|
<!-- 防腐记录 -->
|
||||||
<nbd-anti-record :custom-style="{ margin: '0rpx'}" :params="{ materialCode: item.MaterialCode, projectId: currentProject.ProjectId }" />
|
<nbd-record-card title="防腐" :list="antiListMap[item.MaterialCode] || []" :fields="antiFields" :custom-style="{ margin: '0rpx'}" status-key="CheckResult" status-match="合格" />
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<!-- 备注 -->
|
|
||||||
<view class="section">
|
|
||||||
<view class="section__header">
|
|
||||||
<view class="section__bar"></view>
|
|
||||||
<text class="section__title">备注</text>
|
|
||||||
</view>
|
|
||||||
<view class="remark-card">
|
|
||||||
<textarea class="remark-input" v-model="remark" placeholder="请输入备注信息(选填)" :maxlength="200"
|
|
||||||
auto-height />
|
|
||||||
<text class="remark-count">{{ remark.length }}/200</text>
|
|
||||||
</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-bar">
|
||||||
<view class="btn-primary-gradient" @click="handleSubmit">
|
<view class="btn-primary-gradient" @click="handleSubmit">
|
||||||
<text class="btn-primary-gradient__text">提交校验结果</text>
|
<text class="btn-primary-gradient__text">提交结果</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -186,8 +183,38 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
|
|||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useUserStore } from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
|
|
||||||
import { reqPreWeldJointByWeldJointId, reqSaveCuttingCheck } from '@/api/hj'
|
import { reqPreWeldJointByWeldJointId, reqSaveCuttingCheck, reqCuttingCheckByWeldJointId, reqGetAntiCorrosionCheck } from '@/api/hj'
|
||||||
|
|
||||||
|
const cuttingFields = [
|
||||||
|
{ label: '下料长度', key: 'CuttingLength' },
|
||||||
|
{ label: '坡口形式', key: 'GrooveForm' },
|
||||||
|
{ label: '坡口角度', key: 'GrooveAngle' },
|
||||||
|
{ label: '材料编码批次', key: 'IsMaterialCodeBatchNoAccurate', type: 'tag', tagMatch: true, tagPassText: '准确', tagFailText: '不准确' },
|
||||||
|
{ label: '材料数量', key: 'IsMaterialQuantityAccurate', type: 'tag', tagMatch: true, tagPassText: '准确', tagFailText: '不准确' },
|
||||||
|
{ label: '检查人', key: 'CheckPersonName' },
|
||||||
|
{ label: '检查时间', key: 'CheckTime' },
|
||||||
|
{ label: '检查结果', key: 'CheckResult', type: 'tag', tagMatch: '合格' },
|
||||||
|
{ label: '不合格原因', key: 'UnqualifiedReason', showWhen: { key: 'CheckResult', notEqual: '合格' } },
|
||||||
|
{ label: '整改要求', key: 'RectifyRequirement', showWhen: { key: 'CheckResult', notEqual: '合格' } },
|
||||||
|
{ label: '照片', key: 'AttachUrl1', type: 'photo', cols: 4 },
|
||||||
|
]
|
||||||
|
const antiFields = [
|
||||||
|
{ label: '防腐等级', key: 'AnticorrosionLevel' },
|
||||||
|
{ label: '中间漆', key: 'IntermediatePaint' },
|
||||||
|
{ label: '面漆', key: 'Topcoat' },
|
||||||
|
{ label: '漆膜厚度', key: 'FilmThickness' },
|
||||||
|
{ label: '喷砂情况', key: 'SandBlasting' },
|
||||||
|
{ label: '除锈喷砂情况', key: 'RustSandBlasting' },
|
||||||
|
{ label: '检查人', key: 'CheckPersonName' },
|
||||||
|
{ label: '检查时间', key: 'CheckTime' },
|
||||||
|
{ label: '检查结果', key: 'CheckResult', type: 'tag', tagMatch: '合格' },
|
||||||
|
{ label: '不合格原因', key: 'UnqualifiedReason', showWhen: { key: 'CheckResult', notEqual: '合格' } },
|
||||||
|
{ label: '整改要求', key: 'RectifyRequirement', showWhen: { key: 'CheckResult', notEqual: '合格' } },
|
||||||
|
{ label: '照片', key: 'AttachUrl1', type: 'photo', cols: 4 },
|
||||||
|
]
|
||||||
|
|
||||||
|
const cuttingList = ref([])
|
||||||
|
const antiListMap = ref({})
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { userInfo, currentProject } = storeToRefs(userStore)
|
const { userInfo, currentProject } = storeToRefs(userStore)
|
||||||
@@ -195,23 +222,19 @@ const { userInfo, currentProject } = storeToRefs(userStore)
|
|||||||
const info = ref({})
|
const info = ref({})
|
||||||
const remark = ref('')
|
const remark = ref('')
|
||||||
const formAttachUrl = ref('')
|
const formAttachUrl = ref('')
|
||||||
const id = ref('')
|
|
||||||
const layingOffForm = ref({
|
const layingOffForm = ref({
|
||||||
CuttingLength: '',
|
CuttingLength: '',
|
||||||
GrooveForm: '',
|
GrooveForm: '',
|
||||||
GrooveAngle: '',
|
GrooveAngle: '',
|
||||||
CheckResult: '合格',
|
CheckResult: '合格',
|
||||||
|
IsMaterialCodeBatchNoAccurate: '准确',
|
||||||
|
IsMaterialQuantityAccurate: '准确',
|
||||||
UnqualifiedReason: '',
|
UnqualifiedReason: '',
|
||||||
RectifyRequirement: '',
|
RectifyRequirement: '',
|
||||||
Remark: ''
|
Remark: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const check = ref({
|
|
||||||
CodeBatch: true,
|
|
||||||
Quantity: true
|
|
||||||
})
|
|
||||||
|
|
||||||
// 照片组件引用
|
// 照片组件引用
|
||||||
const photoRef = ref(null)
|
const photoRef = ref(null)
|
||||||
|
|
||||||
@@ -238,7 +261,7 @@ watch(() => layingOffForm.value.CheckResult, async (val) => {
|
|||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认提交',
|
title: '确认提交',
|
||||||
content: '确定提交校验结果吗?',
|
content: '确定提交吗?',
|
||||||
success: async (res) => {
|
success: async (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
if (photoRef.value?.hasPending()) {
|
if (photoRef.value?.hasPending()) {
|
||||||
@@ -248,21 +271,24 @@ const handleSubmit = () => {
|
|||||||
}
|
}
|
||||||
const CuttingAttachUrl1 = formAttachUrl.value || info.value.CuttingAttachUrl1 || ''
|
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())}`
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
ProjectId: currentProject.value?.ProjectId,
|
ProjectId: currentProject.value?.ProjectId, // 项目ID
|
||||||
WeldJointId: info.value?.WeldJointId,
|
WeldJointId: info.value?.WeldJointId, // 焊口ID
|
||||||
IsMaterialCodeBatchNoAccurate: check.value.CodeBatch,
|
CuttingLength: layingOffForm.value.CuttingLength, // 下料长度
|
||||||
IsMaterialQuantityAccurate: check.value.Quantity,
|
GrooveForm: layingOffForm.value.GrooveForm, // 坡口形式
|
||||||
CheckPerson: userInfo.value?.PersonId,
|
GrooveAngle: layingOffForm.value.GrooveAngle, // 坡口角度
|
||||||
CheckTime: checkTime,
|
IsMaterialCodeBatchNoAccurate: layingOffForm.value.IsMaterialCodeBatchNoAccurate === '准确', // 材料编码批次
|
||||||
Remark: remark.value,
|
IsMaterialQuantityAccurate: layingOffForm.value.IsMaterialQuantityAccurate === '准确', // 材料数量
|
||||||
CuttingAttachUrl1
|
CheckPerson: userInfo.value?.PersonId, // 检查人员
|
||||||
|
CheckTime: uni.formatTime(new Date().getTime(), 'YYYY-MM-DD HH:mm'), // 检查时间
|
||||||
|
CreateUser: userInfo.value?.PersonId, // 创建人员
|
||||||
|
CheckResult: layingOffForm.value.CheckResult, // 检查结果
|
||||||
|
Remark: remark.value, // 备注
|
||||||
|
UnqualifiedReason: layingOffForm.value.UnqualifiedReason, // 不合格原因
|
||||||
|
RectifyRequirement: layingOffForm.value.RectifyRequirement, // 整改要求
|
||||||
|
AttachUrl1: CuttingAttachUrl1,
|
||||||
}
|
}
|
||||||
console.log('提交参数:', params)
|
|
||||||
await reqSaveCuttingCheck(params)
|
await reqSaveCuttingCheck(params)
|
||||||
uni.showToast({ title: '提交成功', icon: 'none' })
|
uni.showToast({ title: '提交成功', icon: 'none' })
|
||||||
setTimeout(() => { uni.navigateBack() }, 1500)
|
setTimeout(() => { uni.navigateBack() }, 1500)
|
||||||
@@ -273,15 +299,11 @@ const handleSubmit = () => {
|
|||||||
|
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
if (opt.id) {
|
if (opt.id) {
|
||||||
id.value = opt.id
|
getInfo(opt.id)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onShow(() => {
|
|
||||||
if (id.value) {
|
|
||||||
getInfo(id.value)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const getInfo = async (id) => {
|
const getInfo = async (id) => {
|
||||||
try {
|
try {
|
||||||
@@ -289,7 +311,35 @@ const getInfo = async (id) => {
|
|||||||
const res = await reqPreWeldJointByWeldJointId(id)
|
const res = await reqPreWeldJointByWeldJointId(id)
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
info.value = res.data
|
info.value = res.data
|
||||||
formAttachUrl.value = res.data?.CuttingAttachUrl1 || ''
|
// 获取下料记录
|
||||||
|
if (info.value.WeldJointId) {
|
||||||
|
const cuttingRes = await reqCuttingCheckByWeldJointId(info.value.WeldJointId)
|
||||||
|
if (cuttingRes.code === 1 && cuttingRes.data) {
|
||||||
|
cuttingList.value = cuttingRes.data
|
||||||
|
if (cuttingList.value.length > 0) {
|
||||||
|
layingOffForm.value.CuttingLength = cuttingList.value[0].CuttingLength
|
||||||
|
layingOffForm.value.GrooveForm = cuttingList.value[0].GrooveForm
|
||||||
|
layingOffForm.value.GrooveAngle = cuttingList.value[0].GrooveAngle
|
||||||
|
layingOffForm.value.IsMaterialCodeBatchNoAccurate = cuttingList.value[0].IsMaterialCodeBatchNoAccurate?'准确' : '不准确'
|
||||||
|
layingOffForm.value.IsMaterialQuantityAccurate = cuttingList.value[0].IsMaterialQuantityAccurate?'准确' : '不准确'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取防腐记录(每个材料一条)
|
||||||
|
const materials = info.value.preWeldMaterialItems || []
|
||||||
|
if (materials.length > 0) {
|
||||||
|
const antiResults = await Promise.all(
|
||||||
|
materials.map(m => reqGetAntiCorrosionCheck({
|
||||||
|
materialCode: m.MaterialCode,
|
||||||
|
projectId: currentProject.value.ProjectId
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
const map = {}
|
||||||
|
antiResults.forEach((r, i) => {
|
||||||
|
if (r.code === 1 && r.data) map[materials[i].MaterialCode] = r.data
|
||||||
|
})
|
||||||
|
antiListMap.value = map
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取焊口详情失败:', error)
|
console.error('获取焊口详情失败:', error)
|
||||||
@@ -307,13 +357,6 @@ const handleMutualCheck = (id) => {
|
|||||||
uni.navigateTo({ url: `/scanpages/hj/do_anti_rust?id=${id}` })
|
uni.navigateTo({ url: `/scanpages/hj/do_anti_rust?id=${id}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
const gaugeWidth = (val, min, max) => {
|
|
||||||
if (!val && val !== 0) return '0%'
|
|
||||||
const num = parseFloat(val)
|
|
||||||
if (isNaN(num)) return '0%'
|
|
||||||
const pct = Math.min(Math.max((num - min) / (max - min) * 100, 0), 100)
|
|
||||||
return pct + '%'
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -643,7 +686,7 @@ $shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
|||||||
border-top: 1rpx solid $border;
|
border-top: 1rpx solid $border;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
transition: background 0.2s ease;
|
transition: background 0.2s ease;
|
||||||
|
margin-bottom: 28rpx;
|
||||||
&:active {
|
&:active {
|
||||||
background: #f5f7fa;
|
background: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user