From 542086a34c1d697fd4b4b8bb09d595dd68d3f299 Mon Sep 17 00:00:00 2001
From: Zones <765289303@qq.com>
Date: Tue, 7 Jul 2026 15:15:23 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=96=99=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/hj.js | 11 +-
components/nbd-anti-record.vue | 444 ------------------
components/nbd-record-card.vue | 362 +++++++++++++++
scanpages/hj/do_anti_rust.vue | 32 +-
scanpages/hj/make_right.vue | 704 +++++++++++++++++++++--------
scanpages/hj/material_sampling.vue | 177 +++++---
6 files changed, 1034 insertions(+), 696 deletions(-)
delete mode 100644 components/nbd-anti-record.vue
create mode 100644 components/nbd-record-card.vue
diff --git a/api/hj.js b/api/hj.js
index 69855fc..ca0c7e6 100644
--- a/api/hj.js
+++ b/api/hj.js
@@ -150,11 +150,18 @@ export const reqMaterialInfoByMaterialCode = (materialCode)=>get(`BaseInfo/GetMa
* @param {String} 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
*/
-export const reqSaveCuttingCheck = (data)=> post(`PreWeldInspection/SaveCuttingCheck`, data)
+export const reqSaveCuttingCheck = (data)=> post(`/PreWeldCuttingCheck/SaveRecord`, data)
/**
* 获取坡口类型列表
diff --git a/components/nbd-anti-record.vue b/components/nbd-anti-record.vue
deleted file mode 100644
index 30393e0..0000000
--- a/components/nbd-anti-record.vue
+++ /dev/null
@@ -1,444 +0,0 @@
-
-
-
-
- 加载中...
-
-
-
-
- 暂无防腐记录
-
-
-
-
-
-
-
-
-
-
-
- 防腐等级
- {{ latest.AnticorrosionLevel || '--' }}
-
-
- 中间漆
- {{ latest.IntermediatePaint || '--' }}
-
-
- 面漆
- {{ latest.Topcoat || '--' }}
-
-
- 漆膜厚度
- {{ latest.FilmThickness || '--' }}
-
-
- 喷砂情况
-
- {{ latest.SandBlasting || '--' }}
-
-
-
- 除锈喷砂情况
-
- {{ latest.RustSandBlasting || '--' }}
-
-
-
- 检查人
- {{ latest.CheckPersonName || '--' }}
-
-
- 检查时间
- {{ latest.CheckTime || '--' }}
-
-
- 检查结果
-
- {{ latest.CheckResult === '合格' ? '\u2713' : '\u2717'
- }}
- {{ latest.CheckResult || '--' }}
-
-
-
- 不合格原因
- {{ latest.UnqualifiedReason }}
-
-
- 整改要求
- {{ latest.RectifyRequirement
- }}
-
-
- 照片
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/components/nbd-record-card.vue b/components/nbd-record-card.vue
new file mode 100644
index 0000000..de2b9b8
--- /dev/null
+++ b/components/nbd-record-card.vue
@@ -0,0 +1,362 @@
+
+
+
+
+ 暂无{{ title }}记录
+
+
+
+
+
+
+
+
+
+
+
+ {{ field.label }}
+
+
+
+ {{ latest[field.key] || '--' }}
+
+
+
+
+
+ {{ tagPass(field, latest) ? '\u2713' : '\u2717' }}
+
+
+ {{ tagDisplayText(field, latest) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scanpages/hj/do_anti_rust.vue b/scanpages/hj/do_anti_rust.vue
index 5998f32..2efd0cd 100644
--- a/scanpages/hj/do_anti_rust.vue
+++ b/scanpages/hj/do_anti_rust.vue
@@ -162,7 +162,9 @@
-
+
+
+
@@ -179,7 +181,25 @@ import { onLoad } from '@dcloudio/uni-app'
import { storeToRefs } from 'pinia'
import { watch, nextTick } from 'vue'
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 { userInfo, currentProject } = storeToRefs(userStore)
@@ -265,12 +285,13 @@ const loadData = async (id) => {
form.value = res.data
}
if (res1.code === 1 && res1.data) {
+ antiList.value = res1.data
let antiData = res1.data
- if(antiData&&antiData.length>0){
+ if (antiData && antiData.length > 0) {
antiForm.value = {
...antiData[0],
CheckResult: '合格',
- UnqualifiedReason: '',
+ UnqualifiedReason: '',
RectifyRequirement: '',
Remark: ''
}
@@ -284,6 +305,7 @@ const loadData = async (id) => {
}
}
+// 提交
const handleSubmit = async () => {
if (!antiForm.value.PaintId) {
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;
}
}
-
-
diff --git a/scanpages/hj/make_right.vue b/scanpages/hj/make_right.vue
index 3e6317c..9deb433 100644
--- a/scanpages/hj/make_right.vue
+++ b/scanpages/hj/make_right.vue
@@ -2,203 +2,281 @@
- {{ form.WeldJointCode || '焊口编码' }}
+ {{ info.WeldJointCode || '--' }}
管线编码
- {{ form.PipelineCode || '--' }}
+ {{ info.PipelineCode || '--' }}
- 项目编号
- {{ form.ProjectName || form.ProjectId || '--' }}
+ 项目名称
+ {{ info.ProjectName || info.ProjectId || '--' }}
-
+
-
- *坡口类型名称
+
+
+ 坡口类型名称
-
- {{ form.GrooveTypeName || '请选择坡口类型' }}
+
+ {{ makeRightForm.GrooveTypeName || '请选择坡口类型' }}
+
坡口类型编码
- {{ form.GrooveTypeCode || '--' }}
+
+
+
+
坡口加工类型
-
+
-
-
-
-
-
-
-
+
坡口角度
-
- °
+
+
组对间隙
-
- mm
+
+
错边量
-
- mm
+
+
+
+
+
+ 焊缝余高
+
+
+
+
+
+
+ 焊缝高度
+
+
+
+
+
+
+ 焊缝宽度
+
+
+
+
+
+
+ 表面缺陷
+
+
-
+
+
-
+ 检查结果
+
+
+
+
+
+
+
+
+ 不合格原因
+
+
+
+
+
+
+ 整改要求
+
+
+
+
+
+
+
+ 备注
+
+
+
+
+
+
+
+ 照片
+
+
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+ 炉号
+
+ {{ item.HeatNo || '--' }}
+
+
+
+ 批号
+ {{ item.BatchNo || '--' }}
+
+
+ 规格
+ {{ item.MaterialSpec || '--' }}
+
+
+ 单位
+ {{ item.MaterialUnit || '--' }}
+
+
+ 材料描述
+ {{ item.MaterialDef || '--' }}
+
+
+
+
+
- 提交
+ 提交结果
-
-
-
diff --git a/scanpages/hj/material_sampling.vue b/scanpages/hj/material_sampling.vue
index c835ea4..f365917 100644
--- a/scanpages/hj/material_sampling.vue
+++ b/scanpages/hj/material_sampling.vue
@@ -24,7 +24,7 @@
- 下料长度
+ 下料长度
@@ -32,24 +32,40 @@
- 坡口形式
+ 坡口形式
-
+
坡口角度
+
+
+ 材料编码批次是否准确
+
+
+
+
+
+
+ 材料数量是否准确
+
+
+
+
-
+
+
+
+
+
+
@@ -143,38 +164,14 @@
›
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 提交校验结果
+ 提交结果
@@ -186,8 +183,38 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
import { storeToRefs } from 'pinia'
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 { userInfo, currentProject } = storeToRefs(userStore)
@@ -195,23 +222,19 @@ const { userInfo, currentProject } = storeToRefs(userStore)
const info = ref({})
const remark = ref('')
const formAttachUrl = ref('')
-const id = ref('')
const layingOffForm = ref({
CuttingLength: '',
GrooveForm: '',
GrooveAngle: '',
CheckResult: '合格',
+ IsMaterialCodeBatchNoAccurate: '准确',
+ IsMaterialQuantityAccurate: '准确',
UnqualifiedReason: '',
RectifyRequirement: '',
Remark: ''
})
-const check = ref({
- CodeBatch: true,
- Quantity: true
-})
-
// 照片组件引用
const photoRef = ref(null)
@@ -238,7 +261,7 @@ watch(() => layingOffForm.value.CheckResult, async (val) => {
const handleSubmit = () => {
uni.showModal({
title: '确认提交',
- content: '确定提交校验结果吗?',
+ content: '确定提交吗?',
success: async (res) => {
if (res.confirm) {
if (photoRef.value?.hasPending()) {
@@ -248,21 +271,24 @@ const handleSubmit = () => {
}
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 = {
- ProjectId: currentProject.value?.ProjectId,
- WeldJointId: info.value?.WeldJointId,
- IsMaterialCodeBatchNoAccurate: check.value.CodeBatch,
- IsMaterialQuantityAccurate: check.value.Quantity,
- CheckPerson: userInfo.value?.PersonId,
- CheckTime: checkTime,
- Remark: remark.value,
- CuttingAttachUrl1
+ ProjectId: currentProject.value?.ProjectId, // 项目ID
+ WeldJointId: info.value?.WeldJointId, // 焊口ID
+ CuttingLength: layingOffForm.value.CuttingLength, // 下料长度
+ GrooveForm: layingOffForm.value.GrooveForm, // 坡口形式
+ GrooveAngle: layingOffForm.value.GrooveAngle, // 坡口角度
+ IsMaterialCodeBatchNoAccurate: layingOffForm.value.IsMaterialCodeBatchNoAccurate === '准确', // 材料编码批次
+ IsMaterialQuantityAccurate: layingOffForm.value.IsMaterialQuantityAccurate === '准确', // 材料数量
+ 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)
uni.showToast({ title: '提交成功', icon: 'none' })
setTimeout(() => { uni.navigateBack() }, 1500)
@@ -273,15 +299,11 @@ const handleSubmit = () => {
onLoad((opt) => {
if (opt.id) {
- id.value = opt.id
+ getInfo(opt.id)
}
})
-onShow(() => {
- if (id.value) {
- getInfo(id.value)
- }
-})
+
const getInfo = async (id) => {
try {
@@ -289,7 +311,35 @@ const getInfo = async (id) => {
const res = await reqPreWeldJointByWeldJointId(id)
if (res.code === 1) {
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) {
console.error('获取焊口详情失败:', error)
@@ -307,13 +357,6 @@ const handleMutualCheck = (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 + '%'
-}