功能调整
This commit is contained in:
+25
-58
@@ -33,15 +33,6 @@
|
||||
<text class="section__title">组对填报</text>
|
||||
</view>
|
||||
<view class="card">
|
||||
<!-- 坡口加工类型 -->
|
||||
<view class="card__row">
|
||||
<text class="card__label">坡口加工类型</text>
|
||||
<view class="card__value-wrap">
|
||||
<input class="card__input" v-model="makeRightForm.GrooveProcessType" type="text"
|
||||
placeholder="请输入坡口加工类型" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 组对间隙 -->
|
||||
<view class="card__row">
|
||||
<text class="card__label">组对间隙</text>
|
||||
@@ -161,14 +152,13 @@
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view v-if="canEdit" class="submit-bar">
|
||||
<view class="btn-primary-gradient" @click="handleSubmit">
|
||||
<text class="btn-primary-gradient__text">提交结果</text>
|
||||
<view class="btn-primary-gradient" :class="{ 'btn-primary-gradient--disabled': submitting }"
|
||||
@click="handleSubmit">
|
||||
<text class="btn-primary-gradient__text">{{ submitting ? '提交中...' : '提交结果' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<nbd-select v-model="showGrooveTypePicker" title="选择坡口类型" :list="grooveTypeList" label-key="BaseInfoName"
|
||||
value-key="BaseInfoCode" @confirm="selectGrooveType" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -178,11 +168,11 @@ import { storeToRefs } from 'pinia'
|
||||
import { useUserStore, useMenuStore } from '@/store'
|
||||
|
||||
import { reqPreWeldJointByWeldJointId, reqSaveFitupCheck, reqCuttingCheckByWeldJointId, reqFitupCheckByWeldJointId } from '@/api/hj'
|
||||
import { reqGetGrooveTypeList } from '@/api/base'
|
||||
|
||||
const cuttingFields = [
|
||||
{ label: '下料长度', key: 'CuttingLength' },
|
||||
{ label: '坡口形式', key: 'GrooveForm' },
|
||||
{ label: '坡口加工类型', key: 'GrooveProcessType' },
|
||||
{ label: '材料编码批次', key: 'IsMaterialCodeBatchNoAccurate', type: 'tag', tagMatch: true, tagPassText: '准确', tagFailText: '不准确' },
|
||||
{ label: '材料数量', key: 'IsMaterialQuantityAccurate', type: 'tag', tagMatch: true, tagPassText: '准确', tagFailText: '不准确' },
|
||||
{ label: '检查人', key: 'CheckPersonName' },
|
||||
@@ -194,7 +184,6 @@ const cuttingFields = [
|
||||
]
|
||||
|
||||
const fitupFields = [
|
||||
{ label: '坡口加工类型', key: 'GrooveProcessType' },
|
||||
{ label: '组对间隙', key: 'FitupGap' },
|
||||
{ label: '错边量', key: 'Misalignment' },
|
||||
{ label: '检查人', key: 'CheckPersonName' },
|
||||
@@ -218,8 +207,6 @@ const remark = ref('')
|
||||
const formAttachUrl = ref('')
|
||||
const id = ref('')
|
||||
const makeRightForm = ref({
|
||||
GrooveTypeId: '', // 坡口类型ID
|
||||
GrooveProcessType: '', // 坡口加工类型
|
||||
FitupGap: '', // 组对间隙
|
||||
Misalignment: '', // 错边量
|
||||
CheckResult: '合格', // 检查结果
|
||||
@@ -228,12 +215,9 @@ const makeRightForm = ref({
|
||||
Remark: '', // 备注
|
||||
})
|
||||
|
||||
|
||||
const showGrooveTypePicker = ref(false)
|
||||
const grooveTypeList = ref([])
|
||||
|
||||
// 照片组件引用
|
||||
const photoRef = ref(null)
|
||||
const submitting = ref(false)
|
||||
|
||||
const failVisible = ref(makeRightForm.value.CheckResult === '不合格')
|
||||
const failAnimating = ref(false)
|
||||
@@ -262,63 +246,48 @@ const handleSubmit = () => {
|
||||
uni.showToast({ title: '当前岗位仅可查看', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (submitting.value) return
|
||||
uni.showModal({
|
||||
title: '确认提交',
|
||||
content: '确定提交吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
if (!res.confirm) return
|
||||
submitting.value = true
|
||||
try {
|
||||
if (photoRef.value?.hasPending()) {
|
||||
uni.showLoading({ title: '上传照片中...', mask: true })
|
||||
await photoRef.value.uploadAll()
|
||||
uni.hideLoading()
|
||||
}
|
||||
const CuttingAttachUrl1 = formAttachUrl.value||''
|
||||
|
||||
|
||||
const params = {
|
||||
ProjectId: currentProject.value?.ProjectId, // 项目ID
|
||||
WeldJointId: info.value?.WeldJointId, // 焊口ID
|
||||
GrooveTypeId: makeRightForm.value.GrooveTypeId, // 坡口类型ID
|
||||
GrooveProcessType: makeRightForm.value.GrooveProcessType, // 坡口加工类型
|
||||
FitupGap: makeRightForm.value.FitupGap, // 组对间隙
|
||||
Misalignment: makeRightForm.value.Misalignment, // 错边量
|
||||
CheckTime: uni.formatTime(new Date().getTime(), 'YYYY-MM-DD HH:mm'), // 检查时间
|
||||
CreateUser: userInfo.value?.PersonId, // 创建人员
|
||||
CheckPerson: userInfo.value?.PersonId, // 检查人员
|
||||
CheckResult: makeRightForm.value.CheckResult, // 检查结果
|
||||
Remark: remark.value, // 备注
|
||||
UnqualifiedReason: makeRightForm.value.UnqualifiedReason, // 不合格原因
|
||||
RectifyRequirement: makeRightForm.value.RectifyRequirement, // 整改要求
|
||||
FitupCheckId: null,
|
||||
ProjectId: currentProject.value?.ProjectId,
|
||||
WeldJointId: info.value?.WeldJointId,
|
||||
FitupGap: makeRightForm.value.FitupGap,
|
||||
Misalignment: makeRightForm.value.Misalignment,
|
||||
CheckTime: uni.formatTime(new Date().getTime(), 'YYYY-MM-DD HH:mm'),
|
||||
CreateUser: userInfo.value?.PersonId,
|
||||
CheckPerson: userInfo.value?.PersonId,
|
||||
CheckResult: makeRightForm.value.CheckResult,
|
||||
Remark: makeRightForm.value.Remark || '',
|
||||
UnqualifiedReason: makeRightForm.value.UnqualifiedReason,
|
||||
RectifyRequirement: makeRightForm.value.RectifyRequirement,
|
||||
AttachUrl1: CuttingAttachUrl1,
|
||||
}
|
||||
console.log('提交参数:', params)
|
||||
await reqSaveFitupCheck(params)
|
||||
uni.showToast({ title: '提交成功', icon: 'none' })
|
||||
setTimeout(() => { uni.navigateBack() }, 1500)
|
||||
} catch (error) {
|
||||
console.error('保存组对抽查失败:', error)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const selectGrooveType = (item) => {
|
||||
makeRightForm.value.GrooveTypeId = item.BaseInfoId
|
||||
makeRightForm.value.GrooveProcessType = item.BaseInfoName
|
||||
showGrooveTypePicker.value = false
|
||||
}
|
||||
|
||||
const fetchGrooveTypes = async () => {
|
||||
try {
|
||||
const res = await reqGetGrooveTypeList()
|
||||
if (res.code === 1 && res.data) {
|
||||
grooveTypeList.value = res.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取坡口类型列表失败:', err)
|
||||
}
|
||||
}
|
||||
|
||||
onLoad((opt) => {
|
||||
fetchGrooveTypes()
|
||||
if (opt.id) {
|
||||
id.value = opt.id
|
||||
getInfo(opt.id)
|
||||
@@ -341,8 +310,6 @@ const getInfo = async (id) => {
|
||||
if (fitupRes.code === 1 && fitupRes.data) {
|
||||
fitupList.value = fitupRes.data
|
||||
if (fitupRes.data.length > 0) {
|
||||
makeRightForm.value.GrooveTypeId = fitupRes.data[0].GrooveTypeId
|
||||
makeRightForm.value.GrooveProcessType = fitupRes.data[0].GrooveProcessType
|
||||
makeRightForm.value.FitupGap = fitupRes.data[0].FitupGap
|
||||
makeRightForm.value.Misalignment = fitupRes.data[0].Misalignment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user