修改字段
This commit is contained in:
+177
-160
@@ -11,6 +11,21 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 组对记录 -->
|
||||
<view class="section">
|
||||
<nbd-record-card title="组对" :list="fitupList" :fields="fitupFields" status-key="CheckResult"
|
||||
status-match="合格" />
|
||||
</view>
|
||||
<!-- 互检上一工序 -->
|
||||
<view class="nav-row" @click="handleMutualCheck">
|
||||
<view class="nav-row__left">
|
||||
<view class="nav-row__dot"></view>
|
||||
<text class="nav-row__label">互检上一工序</text>
|
||||
</view>
|
||||
<text class="nav-row__arrow">›</text>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 焊口信息 -->
|
||||
<view class="section">
|
||||
<view class="section__header">
|
||||
@@ -73,7 +88,8 @@
|
||||
<text class="card__label">焊口位置</text>
|
||||
<view class="card__value-wrap card__value-wrap--clickable">
|
||||
<text class="card__value" :class="{ 'card__value--placeholder': !form.WeldingLocationCode }">
|
||||
{{ form.WeldingLocationCode ? `${form.WeldingLocationCode}(${form.WeldingLocationName || '--'})` : '请选择' }}
|
||||
{{ form.WeldingLocationCode ? `${form.WeldingLocationCode}(${form.WeldingLocationName ||
|
||||
'--'})` : '请选择' }}
|
||||
</text>
|
||||
<u-icon name="arrow-right" :size="24" color="#bbb" />
|
||||
</view>
|
||||
@@ -113,201 +129,195 @@
|
||||
<view class="card__row card__row--stack">
|
||||
<text class="card__label">备注</text>
|
||||
<view class="card__value-wrap">
|
||||
<textarea class="remark-input" v-model="form.Remark" placeholder="请输入备注" :maxlength="200" auto-height />
|
||||
<textarea class="remark-input" v-model="form.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="beforePhotoRef" v-model:attachUrl="preWeldAttachUrl" typeName="WeldingDaily_Before" />
|
||||
<nbd-photo-upload ref="beforePhotoRef" v-model:attachUrl="preWeldAttachUrl"
|
||||
typeName="WeldingDaily_Before" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 焊后拍照 -->
|
||||
<view class="card__row card__row--stack">
|
||||
<text class="card__label">焊后拍照</text>
|
||||
<view class="card__value-wrap">
|
||||
<nbd-photo-upload ref="afterPhotoRef" v-model:attachUrl="postWeldAttachUrl" typeName="WeldingDaily_After" />
|
||||
<nbd-photo-upload ref="afterPhotoRef" v-model:attachUrl="postWeldAttachUrl"
|
||||
typeName="WeldingDaily_After" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 互检上一工序 -->
|
||||
<view class="nav-row" @click="handleMutualCheck">
|
||||
<view class="nav-row__left">
|
||||
<view class="nav-row__dot"></view>
|
||||
<text class="nav-row__label">互检上一工序</text>
|
||||
</view>
|
||||
<text class="nav-row__arrow">›</text>
|
||||
</view>
|
||||
|
||||
<!-- 组对记录 -->
|
||||
<view class="section">
|
||||
<nbd-record-card title="组对" :list="fitupList" :fields="fitupFields" status-key="CheckResult" status-match="合格" />
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-btns">
|
||||
<u-button v-if="!form.WeldingDate" class="btn-submit" size="medium" type="primary" @click="handleReport">填报</u-button>
|
||||
<u-button v-if="form.WeldingDailyId" class="btn-point" size="medium" type="primary" @click="handlePoint">点口</u-button>
|
||||
<u-button v-if="!form.WeldingDate" class="btn-submit" size="medium" type="primary"
|
||||
@click="handleReport">填报</u-button>
|
||||
<u-button v-if="form.WeldingDailyId" class="btn-point" size="medium" type="primary"
|
||||
@click="handlePoint">点口</u-button>
|
||||
<u-button class="btn-cancel" size="medium" @click="handleClose">取消</u-button>
|
||||
</view>
|
||||
|
||||
<!-- 焊口位置选择弹窗 -->
|
||||
<nbd-select v-model="showLocationPicker" :show-search="true" title="选择焊口位置" :list="locationList" label-key="BaseInfoCode" value-key="BaseInfoId" @confirm="handleConfirmLocation" />
|
||||
<nbd-select v-model="showLocationPicker" :show-search="true" title="选择焊口位置" :list="locationList"
|
||||
label-key="BaseInfoCode" value-key="BaseInfoId" @confirm="handleConfirmLocation" />
|
||||
|
||||
<!-- 焊工类型选择弹窗 -->
|
||||
<nbd-select v-model="showTypePicker" title="选择焊工类型" :list="welderTypeList" label-key="BaseInfoName" value-key="BaseInfoCode" @confirm="handleConfirmType" />
|
||||
<nbd-select v-model="showTypePicker" title="选择焊工类型" :list="welderTypeList" label-key="BaseInfoName"
|
||||
value-key="BaseInfoCode" @confirm="handleConfirmType" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { reqGetWeldJointByWeldJointId, reqSaveWeldingDailyByWeldJointId, reqGetManualPointSave, reqFitupCheckByWeldJointId } from '@/api/hj.js'
|
||||
import { reqWeldingLocation } from '@/api/base.js'
|
||||
import { useUserStore } from '@/store'
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { reqGetWeldJointByWeldJointId, reqSaveWeldingDailyByWeldJointId, reqGetManualPointSave, reqFitupCheckByWeldJointId } from '@/api/hj.js'
|
||||
import { reqWeldingLocation } from '@/api/base.js'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { userInfo } = userStore
|
||||
const userStore = useUserStore()
|
||||
const { userInfo } = userStore
|
||||
|
||||
// ===== 表单数据 =====
|
||||
const form = ref({})
|
||||
const preWeldAttachUrl = ref('')
|
||||
const postWeldAttachUrl = ref('')
|
||||
// ===== 表单数据 =====
|
||||
const form = ref({})
|
||||
const preWeldAttachUrl = ref('')
|
||||
const postWeldAttachUrl = ref('')
|
||||
|
||||
// ===== 弹窗 =====
|
||||
const showLocationPicker = ref(false)
|
||||
const showTypePicker = ref(false)
|
||||
const locationList = ref([])
|
||||
const welderTypeList = ref([
|
||||
{ BaseInfoName: '打底/盖面', BaseInfoCode: 0 },
|
||||
{ BaseInfoName: '打底', BaseInfoCode: 1 },
|
||||
{ BaseInfoName: '盖面', BaseInfoCode: 2 },
|
||||
])
|
||||
// ===== 弹窗 =====
|
||||
const showLocationPicker = ref(false)
|
||||
const showTypePicker = ref(false)
|
||||
const locationList = ref([])
|
||||
const welderTypeList = ref([
|
||||
{ BaseInfoName: '打底/盖面', BaseInfoCode: 0 },
|
||||
{ BaseInfoName: '打底', BaseInfoCode: 1 },
|
||||
{ BaseInfoName: '盖面', BaseInfoCode: 2 },
|
||||
])
|
||||
|
||||
const beforePhotoRef = ref(null)
|
||||
const afterPhotoRef = ref(null)
|
||||
const beforePhotoRef = ref(null)
|
||||
const afterPhotoRef = ref(null)
|
||||
|
||||
// ===== 组对记录 =====
|
||||
const weldJointId = ref('')
|
||||
const fitupList = ref([])
|
||||
const fitupFields = [
|
||||
{ label: '坡口类型名称', key: 'GrooveTypeName' },
|
||||
{ label: '坡口类型编码', key: 'GrooveTypeCode' },
|
||||
{ label: '坡口加工类型', key: 'GrooveProcessType' },
|
||||
{ label: '坡口角度', key: 'GrooveAngle' },
|
||||
{ label: '组对间隙', key: 'FitupGap' },
|
||||
{ label: '错边量', key: 'Misalignment' },
|
||||
{ label: '焊缝余高', key: 'WeldReinforcement' },
|
||||
{ label: '焊缝高度', key: 'WeldHeight' },
|
||||
{ label: '焊缝宽度', key: 'WeldWidth' },
|
||||
{ label: '表面缺陷', key: 'SurfaceDefect' },
|
||||
{ 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 weldJointId = ref('')
|
||||
const fitupList = ref([])
|
||||
const fitupFields = [
|
||||
{ label: '坡口类型名称', key: 'GrooveTypeName' },
|
||||
{ label: '坡口类型编码', key: 'GrooveTypeCode' },
|
||||
{ label: '坡口加工类型', key: 'GrooveProcessType' },
|
||||
{ label: '坡口角度', key: 'GrooveAngle' },
|
||||
{ label: '组对间隙', key: 'FitupGap' },
|
||||
{ label: '错边量', key: 'Misalignment' },
|
||||
{ label: '焊缝余高', key: 'WeldReinforcement' },
|
||||
{ label: '焊缝高度', key: 'WeldHeight' },
|
||||
{ label: '焊缝宽度', key: 'WeldWidth' },
|
||||
{ label: '表面缺陷', key: 'SurfaceDefect' },
|
||||
{ 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 handleShowLocationSelect = () => {
|
||||
reqWeldingLocation().then(res => {
|
||||
locationList.value = res.data
|
||||
showLocationPicker.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const handleConfirmLocation = (item) => {
|
||||
form.value.WeldingLocationCode = item.BaseInfoCode
|
||||
form.value.WeldingLocationName = item.BaseInfoName
|
||||
form.value.WeldingLocationId = item.BaseInfoId
|
||||
showLocationPicker.value = false
|
||||
}
|
||||
|
||||
const handleConfirmType = (item) => {
|
||||
form.value.welderType = item.BaseInfoCode
|
||||
form.value.welderTypeName = item.BaseInfoName
|
||||
showTypePicker.value = false
|
||||
}
|
||||
|
||||
// ===== 操作 =====
|
||||
const handlePoint = async () => {
|
||||
await reqGetManualPointSave(form.value.WeldJointId)
|
||||
uni.showToast({ title: '点口成功', icon: 'none' })
|
||||
setTimeout(() => { uni.navigateBack() }, 1500)
|
||||
}
|
||||
|
||||
const handleReport = () => {
|
||||
uni.showModal({
|
||||
title: '信息提示',
|
||||
content: '确定要填报吗?',
|
||||
success: async ({ confirm }) => {
|
||||
if (confirm) {
|
||||
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) await beforePhotoRef.value.uploadAll()
|
||||
if (needAfter) await afterPhotoRef.value.uploadAll()
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
await reqSaveWeldingDailyByWeldJointId({
|
||||
WeldJointId: form.value.WeldJointId,
|
||||
Personid: userInfo.PersonId,
|
||||
time: form.value.WeldingDateTemp,
|
||||
weldingLocation: form.value.WeldingLocationId || '',
|
||||
welderType: form.value.welderType,
|
||||
PreWeldAttachUrl: preWeldAttachUrl.value || form.value.PreWeldAttachUrl || '',
|
||||
PostWeldAttachUrl: postWeldAttachUrl.value || form.value.PostWeldAttachUrl || ''
|
||||
})
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
setTimeout(() => { uni.navigateBack() }, 1500)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleClose = () => { uni.navigateBack() }
|
||||
|
||||
const handleMutualCheck = () => {
|
||||
uni.navigateTo({ url: '/scanpages/hj/make_right?id=' + weldJointId.value })
|
||||
}
|
||||
|
||||
// ===== 生命周期 =====
|
||||
onLoad((opt) => {
|
||||
weldJointId.value = opt.id || ''
|
||||
|
||||
reqGetWeldJointByWeldJointId(opt.id).then(res => {
|
||||
form.value = res.data || {}
|
||||
if (form.value.CoverWelderName) {
|
||||
form.value.welderName = form.value.CoverWelderName
|
||||
}
|
||||
if (form.value.BackingWelderName) {
|
||||
form.value.welderName += '/' + form.value.BackingWelderName
|
||||
}
|
||||
const now = new Date()
|
||||
const today = `${now.getFullYear()}-${String(now.getMonth()+1).padStart(2,'0')}-${String(now.getDate()).padStart(2,'0')}`
|
||||
form.value.WeldingDateTemp = form.value.WeldingDate || today
|
||||
form.value.welderType = 0
|
||||
form.value.welderTypeName = "打底/盖面"
|
||||
|
||||
// 回显已有照片
|
||||
preWeldAttachUrl.value = form.value.PreWeldAttachUrl || ''
|
||||
postWeldAttachUrl.value = form.value.PostWeldAttachUrl || ''
|
||||
})
|
||||
|
||||
reqFitupCheckByWeldJointId(opt.id).then(res => {
|
||||
if (res.code === 1 && res.data) {
|
||||
fitupList.value = res.data
|
||||
}
|
||||
})
|
||||
// ===== 弹窗 ========
|
||||
const handleShowLocationSelect = () => {
|
||||
reqWeldingLocation().then(res => {
|
||||
locationList.value = res.data
|
||||
showLocationPicker.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const handleConfirmLocation = (item) => {
|
||||
form.value.WeldingLocationCode = item.BaseInfoCode
|
||||
form.value.WeldingLocationName = item.BaseInfoName
|
||||
form.value.WeldingLocationId = item.BaseInfoId
|
||||
showLocationPicker.value = false
|
||||
}
|
||||
|
||||
const handleConfirmType = (item) => {
|
||||
form.value.welderType = item.BaseInfoCode
|
||||
form.value.welderTypeName = item.BaseInfoName
|
||||
showTypePicker.value = false
|
||||
}
|
||||
|
||||
// ===== 操作 =====
|
||||
const handlePoint = async () => {
|
||||
await reqGetManualPointSave(form.value.WeldJointId)
|
||||
uni.showToast({ title: '点口成功', icon: 'none' })
|
||||
setTimeout(() => { uni.navigateBack() }, 1500)
|
||||
}
|
||||
|
||||
const handleReport = () => {
|
||||
uni.showModal({
|
||||
title: '信息提示',
|
||||
content: '确定要填报吗?',
|
||||
success: async ({ confirm }) => {
|
||||
if (confirm) {
|
||||
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) await beforePhotoRef.value.uploadAll()
|
||||
if (needAfter) await afterPhotoRef.value.uploadAll()
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
await reqSaveWeldingDailyByWeldJointId({
|
||||
WeldJointId: form.value.WeldJointId,
|
||||
Personid: userInfo.PersonId,
|
||||
time: form.value.WeldingDateTemp,
|
||||
weldingLocation: form.value.WeldingLocationId || '',
|
||||
welderType: form.value.welderType,
|
||||
PreWeldAttachUrl: preWeldAttachUrl.value || form.value.PreWeldAttachUrl || '',
|
||||
PostWeldAttachUrl: postWeldAttachUrl.value || form.value.PostWeldAttachUrl || ''
|
||||
})
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
setTimeout(() => { uni.navigateBack() }, 1500)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleClose = () => { uni.navigateBack() }
|
||||
|
||||
const handleMutualCheck = () => {
|
||||
uni.navigateTo({ url: '/scanpages/hj/make_right?id=' + weldJointId.value })
|
||||
}
|
||||
|
||||
// ===== 生命周期 =====
|
||||
onLoad((opt) => {
|
||||
weldJointId.value = opt.id || ''
|
||||
|
||||
reqGetWeldJointByWeldJointId(opt.id).then(res => {
|
||||
form.value = res.data || {}
|
||||
if (form.value.CoverWelderName) {
|
||||
form.value.welderName = form.value.CoverWelderName
|
||||
}
|
||||
if (form.value.BackingWelderName) {
|
||||
form.value.welderName += '/' + form.value.BackingWelderName
|
||||
}
|
||||
const now = new Date()
|
||||
const today = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`
|
||||
form.value.WeldingDateTemp = form.value.WeldingDate || today
|
||||
form.value.welderType = 0
|
||||
form.value.welderTypeName = "打底/盖面"
|
||||
|
||||
// 回显已有照片
|
||||
preWeldAttachUrl.value = form.value.PreWeldAttachUrl || ''
|
||||
postWeldAttachUrl.value = form.value.PostWeldAttachUrl || ''
|
||||
})
|
||||
|
||||
reqFitupCheckByWeldJointId(opt.id).then(res => {
|
||||
if (res.code === 1 && res.data) {
|
||||
fitupList.value = res.data
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -353,8 +363,15 @@ $shadow-md: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0%, 100% { background-position: 0% 0; }
|
||||
50% { background-position: 100% 0; }
|
||||
|
||||
0%,
|
||||
100% {
|
||||
background-position: 0% 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__code {
|
||||
|
||||
Reference in New Issue
Block a user