From 9e9826acbb196b4c0f1420642c20b2d8c7a5e1b7 Mon Sep 17 00:00:00 2001
From: Zones <765289303@qq.com>
Date: Wed, 24 Jun 2026 20:50:15 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E5=AF=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.claude/settings.json | 7 +
api/hj.js | 8 +-
assets/css/page.scss | 7 +-
components/nbd-photo-upload.vue | 211 ++++++++
pages/index/index.vue | 26 +-
scanpages/hj/daily_paper.vue | 228 ++-------
scanpages/hj/make_right.vue | 777 ++++++++++++++++-------------
scanpages/hj/material_sampling.vue | 59 ++-
utils/request.js | 1 +
9 files changed, 738 insertions(+), 586 deletions(-)
create mode 100644 .claude/settings.json
create mode 100644 components/nbd-photo-upload.vue
diff --git a/.claude/settings.json b/.claude/settings.json
new file mode 100644
index 0000000..7d752e4
--- /dev/null
+++ b/.claude/settings.json
@@ -0,0 +1,7 @@
+{
+ "permissions": {
+ "allow": [
+ "Bash(git checkout *)"
+ ]
+ }
+}
diff --git a/api/hj.js b/api/hj.js
index ec9b04b..680f360 100644
--- a/api/hj.js
+++ b/api/hj.js
@@ -160,4 +160,10 @@ export const reqSaveCuttingCheck = (data)=> post(`PreWeldInspection/SaveCuttingC
* 获取坡口类型列表
* TODO: 确认接口地址
*/
-export const reqGetGrooveTypeList = ()=>get(`BaseInfo/GetGrooveTypeList`)
\ No newline at end of file
+export const reqGetGrooveTypeList = ()=>get(`BaseInfo/GetGrooveType`)
+
+/**
+ * 保存组对抽查记录
+ *
+ */
+export const reqSaveFitupCheck = (data)=>post(`PreWeldInspection/SaveFitupCheck`, data)
diff --git a/assets/css/page.scss b/assets/css/page.scss
index 06b6e1c..aef8ab6 100644
--- a/assets/css/page.scss
+++ b/assets/css/page.scss
@@ -372,12 +372,15 @@
}
}
- .edit-grid {
+ .edit-scroll {
flex: 1;
min-height: 0;
overflow: hidden;
+ }
+
+ .edit-grid {
display: grid;
- grid-template-columns: repeat(4, calc(25% - 20rpx));
+ grid-template-columns: repeat(4, 1fr);
gap: 20rpx;
padding: 24rpx 0 160rpx;
box-sizing: border-box;
diff --git a/components/nbd-photo-upload.vue b/components/nbd-photo-upload.vue
new file mode 100644
index 0000000..452f42c
--- /dev/null
+++ b/components/nbd-photo-upload.vue
@@ -0,0 +1,211 @@
+
+
+
+
+
+ ✓
+
+
+
+
+
+
+
+
+
+ 拍照
+
+
+
+
+
+
+
+
diff --git a/pages/index/index.vue b/pages/index/index.vue
index b85a642..4717906 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -110,21 +110,23 @@
-
-
-
-
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
- {{ item.name }}
-
-
+
+ 没有匹配的应用
-
- 没有匹配的应用
-
取消
diff --git a/scanpages/hj/daily_paper.vue b/scanpages/hj/daily_paper.vue
index 354c3d8..b3bed84 100644
--- a/scanpages/hj/daily_paper.vue
+++ b/scanpages/hj/daily_paper.vue
@@ -67,44 +67,22 @@
-
+
-
-
-
- ✓
-
-
-
-
-
-
- 拍照
-
+
+
-
+
-
-
-
- ✓
-
-
-
-
-
-
- 拍照
-
+
+
@@ -127,14 +105,17 @@
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { reqGetWeldJointByWeldJointId, reqSaveWeldingDailyByWeldJointId, reqGetManualPointSave } from '@/api/hj.js'
- import { reqWeldingLocation, uploadAttach } from '@/api/base.js'
- import { baseFileUrl, parseAttachUrls } from '@/utils/request.js'
+ import { reqWeldingLocation } from '@/api/base.js'
import { useUserStore } from '@/store'
+
+
const userStore = useUserStore()
const { userInfo } = userStore
// ===== 表单数据 =====
const form = ref({})
+ const preWeldAttachUrl = ref('')
+ const postWeldAttachUrl = ref('')
// ===== 弹窗 =====
const showLocationPicker = ref(false)
@@ -146,79 +127,8 @@
{ BaseInfoName: '盖面', BaseInfoCode: 2 },
])
- // ===== 照片数据 =====
- const beforePhotoList = ref([])
- const afterPhotoList = ref([])
- let photoIdSeed = 0
-
- // ===== 拍照(只存本地,等填报时统一上传) =====
- const handleTakeBeforePhoto = () => takePhoto(beforePhotoList)
- const handleTakeAfterPhoto = () => takePhoto(afterPhotoList)
-
- const takePhoto = (listRef) => {
- uni.chooseImage({
- count: 1,
- sourceType: ['camera'],
- success: (res) => {
- const tempPath = res.tempFilePaths[0]
- const id = ++photoIdSeed
- listRef.value.push({
- _id: id,
- src: tempPath,
- uploaded: false
- })
- }
- })
- }
-
- // ===== 是否需要上传(本地临时路径才需要) =====
- const isLocalPath = (src) => src && !src.startsWith(baseFileUrl)
-
- // ===== 批量上传 =====
- const uploadAllPhotos = async (listRef, typeName) => {
- const photos = listRef.value.filter(p => !p.uploaded && isLocalPath(p.src))
- const urls = []
- for (const photo of photos) {
- photo.uploading = true
- photo.progress = 0
- try {
- const result = await uploadAttach(photo.src, { typeName }, (progress) => {
- photo.progress = progress
- })
- photo.uploading = false
- photo.uploaded = true
- photo.result = result
- const url = Array.isArray(result) ? result[0] : result
- if (url) {
- urls.push(url)
- photo.src = `${baseFileUrl}${url}`
- }
- } catch (e) {
- photo.uploading = false
- }
- }
- return urls
- }
-
- const hasPendingBefore = () => beforePhotoList.value.some(p => !p.uploaded && isLocalPath(p.src))
- const hasPendingAfter = () => afterPhotoList.value.some(p => !p.uploaded && isLocalPath(p.src))
-
- // ===== 预览照片 =====
- const previewPhoto = (list, index) => {
- const urls = list.map(p => p.src)
- uni.previewImage({ current: index, urls })
- }
-
- // ===== 删除照片 =====
- const deletePhoto = (list, index) => {
- uni.showModal({
- title: '确认删除',
- content: '确定要删除这张照片吗?',
- success: ({ confirm }) => {
- if (confirm) list.splice(index, 1)
- }
- })
- }
+ const beforePhotoRef = ref(null)
+ const afterPhotoRef = ref(null)
// ===== 弹窗 ========
const handleShowLocationSelect = () => {
@@ -254,29 +164,13 @@
content: '确定要填报吗?',
success: async ({ confirm }) => {
if (confirm) {
- const needBefore = hasPendingBefore()
- const needAfter = hasPendingAfter()
- let PreWeldAttachUrl = form.value.PreWeldAttachUrl || ''
- let PostWeldAttachUrl = form.value.PostWeldAttachUrl || ''
-
+ console.log(beforePhotoRef.value?.hasPending())
+ const needBefore = beforePhotoRef.value?.hasPending()
+ const needAfter = afterPhotoRef.value?.hasPending()
if (needBefore || needAfter) {
uni.showLoading({ title: '上传照片中...', mask: true })
- if (needBefore) {
- const urls = await uploadAllPhotos(beforePhotoList, 'WeldingDaily_Before')
- if (urls.length) {
- PreWeldAttachUrl = PreWeldAttachUrl
- ? PreWeldAttachUrl + ',' + urls.join(',')
- : urls.join(',')
- }
- }
- if (needAfter) {
- const urls = await uploadAllPhotos(afterPhotoList, 'WeldingDaily_After')
- if (urls.length) {
- PostWeldAttachUrl = PostWeldAttachUrl
- ? PostWeldAttachUrl + ',' + urls.join(',')
- : urls.join(',')
- }
- }
+ if (needBefore) await beforePhotoRef.value.uploadAll()
+ if (needAfter) await afterPhotoRef.value.uploadAll()
uni.hideLoading()
}
@@ -286,8 +180,8 @@
time: form.value.WeldingDateTemp,
weldingLocation: form.value.WeldingLocationId || '',
welderType: form.value.welderType,
- PreWeldAttachUrl,
- PostWeldAttachUrl
+ PreWeldAttachUrl: preWeldAttachUrl.value || form.value.PreWeldAttachUrl || '',
+ PostWeldAttachUrl: postWeldAttachUrl.value || form.value.PostWeldAttachUrl || ''
})
uni.showToast({ title: '保存成功', icon: 'none' })
setTimeout(() => { uni.navigateBack() }, 1500)
@@ -315,95 +209,35 @@
form.value.welderTypeName = "打底/盖面"
// 回显已有照片
- beforePhotoList.value = parseAttachUrls(form.value.PreWeldAttachUrl, photoIdSeed)
- photoIdSeed += beforePhotoList.value.length
- afterPhotoList.value = parseAttachUrls(form.value.PostWeldAttachUrl, photoIdSeed)
- photoIdSeed += afterPhotoList.value.length
+ preWeldAttachUrl.value = form.value.PreWeldAttachUrl || ''
+ postWeldAttachUrl.value = form.value.PostWeldAttachUrl || ''
})
})
diff --git a/scanpages/hj/make_right.vue b/scanpages/hj/make_right.vue
index 14d1fdb..a58abe0 100644
--- a/scanpages/hj/make_right.vue
+++ b/scanpages/hj/make_right.vue
@@ -22,8 +22,9 @@
坡口类型
-
- 坡口类型名称
+
+ *坡口类型名称
{{ form.GrooveTypeName || '请选择坡口类型' }}
@@ -37,7 +38,9 @@
坡口加工类型
- {{ form.GrooveProcessType || '--' }}
+
+
+
@@ -52,412 +55,470 @@
坡口角度
- {{ form.GrooveAngle ?? '--' }}
+
°
组对间隙
- {{ form.FitupGap ?? '--' }}
+
mm
错边量
- {{ form.Misalignment ?? '--' }}
+
mm
-
-
-
-
-
-
-
- {{ item.BaseInfoName }}
- {{ item.BaseInfoCode }}
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 提交
+
+
+
+
+
diff --git a/scanpages/hj/material_sampling.vue b/scanpages/hj/material_sampling.vue
index 31c5fb1..cbfd881 100644
--- a/scanpages/hj/material_sampling.vue
+++ b/scanpages/hj/material_sampling.vue
@@ -16,7 +16,7 @@
-
+
-
+
@@ -96,11 +96,11 @@
'check-btn--fail': check.CodeBatch === false
}">
- ✓
+ ✓
通过
- ✕
+ ✗
不通过
@@ -117,11 +117,11 @@
'check-btn--fail': check.Quantity === false
}">
- ✓
+ ✓
通过
- ✕
+ ✗
不通过
@@ -148,6 +148,17 @@
+
+
+
+
+
+
+
+
@@ -165,18 +176,22 @@
import { reqPreWeldJointByWeldJointId, reqSaveCuttingCheck } from '@/api/hj'
+
const userStore = useUserStore()
const { userInfo, currentProject } = storeToRefs(userStore)
const info = ref({})
const remark = ref('')
+ const formAttachUrl = ref('')
- // 校验状态:true=通过,false=不通过
const check = ref({
CodeBatch: true,
Quantity: true
})
+ // 照片组件引用
+ const photoRef = ref(null)
+
const toggleCheck = (key) => {
const val = check.value[key]
check.value[key] = val === true ? false : true
@@ -188,6 +203,13 @@
content: '确定提交校验结果吗?',
success: async (res) => {
if (res.confirm) {
+ if (photoRef.value?.hasPending()) {
+ uni.showLoading({ title: '上传照片中...', mask: true })
+ await photoRef.value.uploadAll()
+ uni.hideLoading()
+ }
+ const CuttingAttachUrl1 = formAttachUrl.value || info.value.CuttingAttachUrl1 || ''
+
const now = new Date()
const pad = (n) => String(n).padStart(2, '0')
const checkTime = `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`
@@ -199,14 +221,13 @@
IsMaterialQuantityAccurate: check.value.Quantity,
CheckPerson: userInfo.value?.PersonId,
CheckTime: checkTime,
- Remark: remark.value
+ Remark: remark.value,
+ CuttingAttachUrl1
}
console.log('提交参数:', params)
await reqSaveCuttingCheck(params)
uni.showToast({ title: '提交成功', icon: 'none' })
- setTimeout(() => {
- uni.navigateBack()
- }, 1500)
+ setTimeout(() => { uni.navigateBack() }, 1500)
}
}
})
@@ -222,7 +243,10 @@
try {
uni.showLoading({ title: '加载中...', mask: true })
const res = await reqPreWeldJointByWeldJointId(id)
- if (res.code === 1) { info.value = res.data }
+ if (res.code === 1) {
+ info.value = res.data
+ formAttachUrl.value = res.data?.CuttingAttachUrl1 || ''
+ }
} catch (error) {
console.error('获取焊口详情失败:', error)
uni.showToast({ title: '加载失败', icon: 'none' })
@@ -231,7 +255,6 @@
}
}
- // 模拟进度条宽度(0~100%)
const gaugeWidth = (val, min, max) => {
if (!val && val !== 0) return '0%'
const num = parseFloat(val)
@@ -370,6 +393,11 @@
color: $text;
letter-spacing: 0.5rpx;
}
+ .img-box{
+ padding: 20rpx;
+ border-radius: 16rpx;
+ background-color: #ffffff;
+ }
}
// ===== 坡口参数仪表 =====
@@ -553,7 +581,6 @@
}
}
- // ===== 校验按钮(二态切换) =====
.check-btn {
display: inline-flex;
align-items: center;
diff --git a/utils/request.js b/utils/request.js
index 2c069a6..326bfb4 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -160,6 +160,7 @@ export const parseAttachUrls = (urlStr, startId = 0) => {
return urlStr.split(',').filter(Boolean).map(url => ({
_id: ++id,
src: `${baseFileUrl}${url}`,
+ _attachUrl: url,
uploaded: true
}))
}