下料完成
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
<view class="card">
|
||||
<!-- 下料长度 -->
|
||||
<view class="card__row" @click="showPaintCodePicker = true">
|
||||
<text class="card__label required">下料长度</text>
|
||||
<text class="card__label">下料长度</text>
|
||||
<view class="card__value-wrap">
|
||||
<input class="card__input" v-model="layingOffForm.CuttingLength" type="digit"
|
||||
placeholder="请输入下料长度" />
|
||||
@@ -32,24 +32,40 @@
|
||||
</view>
|
||||
<!-- 坡口形式 -->
|
||||
<view class="card__row">
|
||||
<text class="card__label required">坡口形式</text>
|
||||
<text class="card__label">坡口形式</text>
|
||||
<view class="card__value-wrap">
|
||||
<input class="card__input" v-model="layingOffForm.GrooveForm" type="text"
|
||||
placeholder="请输入坡口形式" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 坡口角度 -->
|
||||
<view class="card__row required">
|
||||
<view class="card__row">
|
||||
<text class="card__label">坡口角度</text>
|
||||
<view class="card__value-wrap">
|
||||
<input class="card__input" v-model="layingOffForm.GrooveAngle" type="digit"
|
||||
placeholder="请输入坡口角度" />
|
||||
</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 class="section">
|
||||
<view class="section__header">
|
||||
<view class="section__bar"></view>
|
||||
@@ -97,12 +113,17 @@
|
||||
<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="files" typeName="AntiRust" />
|
||||
<nbd-photo-upload ref="photoRef" v-model:attachUrl="formAttachUrl" typeName="AntiRust" />
|
||||
</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">
|
||||
<!-- 材料信息 -->
|
||||
@@ -143,38 +164,14 @@
|
||||
<text class="nav-row__arrow">›</text>
|
||||
</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>
|
||||
</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="btn-primary-gradient" @click="handleSubmit">
|
||||
<text class="btn-primary-gradient__text">提交校验结果</text>
|
||||
<text class="btn-primary-gradient__text">提交结果</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -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 + '%'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -643,7 +686,7 @@ $shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
border-top: 1rpx solid $border;
|
||||
box-shadow: none;
|
||||
transition: background 0.2s ease;
|
||||
|
||||
margin-bottom: 28rpx;
|
||||
&:active {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user