diff --git a/api/base.js b/api/base.js index 289cc26..0a0c38d 100644 --- a/api/base.js +++ b/api/base.js @@ -36,11 +36,30 @@ export const reqGetGrooveTypeList = ()=>get(`BaseInfo/GetGrooveType`) */ export const reqGetWeldTypeList = () => get(`BaseInfo/GetWeldType`) +/** + * 按关键字分页查询入库明细条码 + * @param {object} data + * @param {string} data.barCodeKeyword - 条码关键字 + * @param {number} data.pageIndex - 页码(从 1 开始) + * @param {number} data.pageSize - 每页条数 + */ +export const reqGetInputDetailBarCodes = (data = {}) => get('BaseInfo/GetInputDetailBarCodes', { + barCodeKeyword: data.barCodeKeyword ?? '', + pageIndex: data.pageIndex ?? 1, + pageSize: data.pageSize ?? 20, +}) + /** * 获取焊接方法列表 */ export const reqGetWeldingMethodList = () => get(`BaseInfo/GetWeldingMethod`) +/** + * 按类型获取焊接耗材 + * @param {number} consumablesType - 焊材类型:1焊丝,2焊条 + */ +export const reqGetWeldingConsumables = (consumablesType) => get('BaseInfo/GetWeldingConsumables', { consumablesType }) + /** * 附件上传 * @param {string} filePath - 本地文件路径 diff --git a/api/hj.js b/api/hj.js index cd5d7cf..3bcea7b 100644 --- a/api/hj.js +++ b/api/hj.js @@ -1,6 +1,7 @@ import { get, - post + post, + request } from '@/utils/request.js' /** @@ -15,8 +16,18 @@ export const reqHJIndexData = (projectId) => get(`HJGLIndex/GetJGLIndexItem?proj export const reqGetWeldJointByWeldJointId = (id) => get(`PipeJoint/getWeldJointByWeldJointId?WeldJointId=${id}`) /** - * 焊接日报填报(提交时传 WeldTypeId / WeldingMethodId,后端同步更新焊口对应字段) - * @param {Object} data - { WeldJointId, Personid, time, weldingLocation, welderType, WeldTypeId, WeldingMethodId, PreWeldAttachUrl, PostWeldAttachUrl } + * 搜索筛选焊口(下料/组对等中间页) + * @param {Object} params - { projectId, keyword?, pageIndex?, pageSize? } + */ +export const reqPipeJointWeldedJoints = (params = {}) => request('PipeJoint/GetWeldedJoints', { + method: 'GET', + data: params, + loading: false, +}) + +/** + * 焊接日报填报(提交时传 WeldTypeId/WeldTypeCode、WeldingMethodId/WeldingMethodCode,后端同步更新焊口对应字段) + * @param {Object} data - { WeldJointId, Personid, time, weldingLocation, welderType, WeldTypeId, WeldTypeCode, WeldingMethodId, WeldingMethodCode, WeldingWire, WeldingRod, PreWeldAttachUrl, PostWeldAttachUrl } */ export const reqSaveWeldingDailyByWeldJointId = (data={}) => post( `PreWeldingDaily/SaveWeldingDailyByWeldJointId`,data @@ -205,8 +216,9 @@ export const reqGetAntiCorrosionCheck = (params = {}) => { // ========================= 日报审核 ==================================== /** * 获取焊接日报待审核列表 - * @param {Object} params - { projectId, unitWorkId?, weldingDate?, pipelineCode?, welderCode?, pageIndex? } - * pageIndex 从 1 开始,小于等于 0 时返回全部记录 + * @param {Object} params - { projectId, unitWorkId?, weldingDate?, pipelineCode?, welderCode?, pageIndex?, pageSize? } + * pageIndex 从 1 开始;小于等于 0 时返回全部记录 + * 响应 data.pageCount 为总记录数(不是总页数) */ export const reqPendingWeldingDailyList = (params = {}) => get('/PreWeldingDaily/GetPendingWeldingDailyTempDetailList', params) @@ -217,13 +229,19 @@ export const reqPendingWeldingDailyList = (params = {}) => get('/PreWeldingDaily export const reqPendingWeldingDailyDetail = (tempDetailId) => get(`/PreWeldingDaily/GetPendingWeldingDailyTempDetail?tempDetailId=${tempDetailId}`) /** - * 批量审核通过焊接日报待审核明细 + * 班组批量审核焊接日报待审核明细(状态 0 → 1) + * @param {Object} data - { TempDetailIds: string[], AuditMan: string } + */ +export const reqTeamAuditWeldingDaily = (data = {}) => post(`/PreWeldingDaily/TeamAuditPendingWeldingDailyTempDetails`, data) + +/** + * 专工批量审核焊接日报待审核明细(状态 1 → 2) * @param {Object} data - { TempDetailIds: string[], AuditMan: string } */ export const reqAuditWeldingDaily = (data = {}) => post(`/PreWeldingDaily/AuditPendingWeldingDailyTempDetails`, data) /** - * 批量删除(驳回)焊接日报待审核明细 + * 批量删除未审核明细(仅状态 0) * @param {Object} data - { TempDetailIds: string[] } */ export const reqDeleteWeldingDaily = (data = {}) => post(`/PreWeldingDaily/DeletePendingWeldingDailyTempDetails`, data) @@ -243,7 +261,26 @@ export const reqWeldAppearanceJointDetail = (weldJointId) => get('/WeldAppearanc /** * 保存焊缝外观检测记录 - * @param {Object} data - { AppearanceCheckId?, ProjectId, WeldJointId, IsQualified, CheckPerson, CheckTime, Remark, AttachUrl, CreateUser } + * @param {Object} data - { AppearanceCheckId?, ProjectId, WeldJointId, IsQualified, CheckPerson, CheckTime, Remark, AttachUrl, CreateUser, WeldReinforcement, WeldHeight, WeldWidth, SurfaceDefect, PreheatTemperature, InterpassTemperature } */ export const reqSaveWeldAppearanceCheck = (data = {}) => post('/WeldAppearanceCheck/SaveRecord', data) +// ========================= 焊接任务单 ==================================== +/** + * 按班组查询任务单列表 + * @param {Object} params - { projectId, teamGroupId?, unitWorkId? } + */ +export const reqWeldTaskListByTeamGroup = (params = {}) => get('WeldTask/GetTaskListByTeamGroup', params) + +/** + * 查询任务单详情(含 Joints) + * @param {Object} params - { projectId, taskCode, unitWorkId? } + */ +export const reqWeldTaskDetail = (params = {}) => get('WeldTask/GetTaskDetail', params) + +/** + * 根据任务单生成出库申请 + * @param {Object} data - { ProjectId, TaskCode, PersonId } + */ +export const reqWeldTaskGenerateOutPlan = (data = {}) => post('WeldTask/GenerateOutPlan', data) + diff --git a/components/nbd-history-card.vue b/components/nbd-history-card.vue index 9da0381..f64bce2 100644 --- a/components/nbd-history-card.vue +++ b/components/nbd-history-card.vue @@ -28,6 +28,10 @@ + + {{ field.label }} + {{ latest[field.key] || '--' }} + 检测人 {{ latest.CheckPersonName || '--' }} @@ -71,6 +75,10 @@ + + {{ field.label }} + {{ item[field.key] || '--' }} + 检测人 {{ item.CheckPersonName || '--' }} @@ -117,6 +125,15 @@ const showPopup = ref(false) const latest = computed(() => props.list[0] || null) + const extraFields = [ + { label: '焊缝余高', key: 'WeldReinforcement' }, + { label: '焊缝高度', key: 'WeldHeight' }, + { label: '焊缝宽度', key: 'WeldWidth' }, + { label: '表面缺陷', key: 'SurfaceDefect' }, + { label: '预热温度', key: 'PreheatTemperature' }, + { label: '层间温度', key: 'InterpassTemperature' }, + ] + const isPass = (item) => item?.IsQualified === true const qualifiedText = (item) => { diff --git a/pages.json b/pages.json index 65ce0e7..4d90c3c 100644 --- a/pages.json +++ b/pages.json @@ -3,6 +3,7 @@ "autoscan": true, "custom": { "^nbd-print-prop$": "@/scanpages/components/nbd-print-prop.vue", + "^nbd-print-prop-qr$": "@/scanpages/components/nbd-print-prop-qr.vue", "^u-(.*)": "uview-pro/components/u-$1/u-$1.vue", "^nbd-(.*)": "@/components/nbd-$1.vue" } @@ -169,6 +170,30 @@ "style": { "navigationBarTitleText": "焊缝检测" } + }, + { + "path": "hj/barcode_search", + "style": { + "navigationBarTitleText": "条码查询" + } + }, + { + "path": "hj/weld_joint_search", + "style": { + "navigationBarTitleText": "选择焊口" + } + }, + { + "path": "hj/weld_task_list", + "style": { + "navigationBarTitleText": "焊接任务单" + } + }, + { + "path": "hj/weld_task_detail", + "style": { + "navigationBarTitleText": "任务单详情" + } } ] } diff --git a/pages/index/index.vue b/pages/index/index.vue index 39ad7b9..c733b0e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -337,4 +337,10 @@ } }) } + + const handleSkipByPath = (path) => { + uni.navigateTo({ + url: path + }) + } \ No newline at end of file diff --git a/scanpages/components/nbd-print-prop-qr.vue b/scanpages/components/nbd-print-prop-qr.vue new file mode 100644 index 0000000..105312d --- /dev/null +++ b/scanpages/components/nbd-print-prop-qr.vue @@ -0,0 +1,748 @@ + + + + + diff --git a/scanpages/hj/barcode_search.vue b/scanpages/hj/barcode_search.vue new file mode 100644 index 0000000..ce5c1d2 --- /dev/null +++ b/scanpages/hj/barcode_search.vue @@ -0,0 +1,291 @@ + + + + + diff --git a/scanpages/hj/daily_audit.vue b/scanpages/hj/daily_audit.vue index cbe391a..54e9e79 100644 --- a/scanpages/hj/daily_audit.vue +++ b/scanpages/hj/daily_audit.vue @@ -2,38 +2,43 @@ - - - - - - - - - - - - - {{ weldingDate || '焊接日期' }} + + + + + + {{ selectedUnitWork?.BaseInfoName || '单位工程' }} - - + + + + + + + + {{ weldingDate || '焊接日期' }} + + + + + + + + + + + + - - - - {{ selectedUnitWork?.BaseInfoName || '单位工程' }} - - + @refresherrefresh="handleRefresh" @scrolltolower="loadMore"> @@ -45,7 +50,9 @@ {{ item.WeldJointCode || '--' }} - 待审核 + + {{ item.AuditStateText || '待审核' }} + @@ -78,10 +85,16 @@ + + + 加载中... + + + — 没有更多了 — + - @@ -91,10 +104,12 @@ 已选 {{ selectedIds.length }} 项 - 删除 - 审核通过 + 删除 + 班组审核 + 专工审核 @@ -125,6 +140,7 @@ } from '@/api/base.js' import { reqPendingWeldingDailyList, + reqTeamAuditWeldingDaily, reqAuditWeldingDaily, reqDeleteWeldingDaily } from '@/api/hj.js' @@ -136,6 +152,9 @@ currentProject } = storeToRefs(userStore) const canEdit = computed(() => menuStore.canEditFunc('dailyAudit')) + const submitting = ref(false) + + const uniqIds = (ids) => [...new Set((ids || []).filter(Boolean))] // ===== 筛选条件 ===== const pipelineCode = ref('') @@ -144,12 +163,12 @@ const onDateChange = (e) => { weldingDate.value = e.detail.value - fetchData() + resetAndLoad() } const onDateClear = () => { weldingDate.value = '' - fetchData() + resetAndLoad() } // ===== 单位工程选择 ===== @@ -170,44 +189,73 @@ const handleUnitWorkConfirm = (item) => { selectedUnitWork.value = item?.BaseInfoId ? item : null showUnitWorkSelect.value = false - fetchData() + resetAndLoad() } // ===== 列表数据 ===== const listData = ref([]) const loading = ref(false) const refreshing = ref(false) + const hasMore = ref(true) + const currentPage = ref(1) + const pageSize = 20 - // 加载待审核列表(不分页,一次拉全部待审核记录) - const fetchData = async () => { - if (loading.value) return + const fetchData = async (isRefresh = false) => { + if (loading.value || (!isRefresh && !hasMore.value)) return loading.value = true - refreshing.value = true + if (isRefresh) refreshing.value = true try { const res = await reqPendingWeldingDailyList({ projectId: currentProject.value?.ProjectId, unitWorkId: selectedUnitWork.value?.BaseInfoId || '', weldingDate: weldingDate.value || '', pipelineCode: pipelineCode.value || '', - welderCode: welderCode.value || '' + welderCode: welderCode.value || '', + pageIndex: currentPage.value, + pageSize }) - listData.value = res.data?.list || res.data?.getDataList || (Array.isArray(res.data) ? res.data : []) - // 刷新后清空已选(原记录可能已不存在) - selectedIds.value = [] + const pageData = res.data?.list || res.data?.getDataList || (Array.isArray(res.data) ? res.data : []) + if (isRefresh) { + listData.value = pageData + selectedIds.value = [] + } else { + listData.value = [...listData.value, ...pageData] + } + const totalCount = Number(res.data?.totalCount ?? res.data?.pageCount ?? 0) + if (totalCount > 0) { + hasMore.value = listData.value.length < totalCount + } else { + hasMore.value = pageData.length >= pageSize + } } catch (error) { console.error('加载待审核日报失败:', error) + if (!isRefresh && currentPage.value > 1) currentPage.value-- } finally { loading.value = false refreshing.value = false } } + const resetAndLoad = () => { + currentPage.value = 1 + hasMore.value = true + listData.value = [] + fetchData(true) + } + const handleRefresh = () => { - fetchData() + resetAndLoad() } const handleSearch = () => { - fetchData() + resetAndLoad() + } + + const loadMore = () => { + if (!loading.value && hasMore.value) { + currentPage.value++ + fetchData(false) + } } // ===== 勾选 ===== @@ -233,57 +281,79 @@ if (isAllSelected.value) { selectedIds.value = [] } else { - selectedIds.value = listData.value.map(item => item.TempDetailId) + selectedIds.value = uniqIds(listData.value.map(item => item.TempDetailId)) } } - // ===== 批量操作 ===== - const handleBatchAudit = () => { + const getSelectedIds = () => { + const ids = uniqIds(selectedIds.value) + if (!ids.length) { + uni.showToast({ + title: '请先选择要操作的日报', + icon: 'none' + }) + return [] + } + return ids + } + + const runBatch = ({ + title, + request + }) => { + if (submitting.value) return + const ids = getSelectedIds() + if (!ids.length) return uni.showModal({ title: '信息提示', - content: `确定审核通过选中的 ${selectedIds.value.length} 条日报吗?`, + content: `确定${title}选中的 ${ids.length} 条日报吗?`, success: async ({ confirm }) => { if (!confirm) return + submitting.value = true try { - await reqAuditWeldingDaily({ - TempDetailIds: selectedIds.value, - AuditMan: userInfo.value?.PersonId - }) + await request(ids) } catch (err) { - return // 报错已由 request.js 统一 toast + submitting.value = false + return } uni.showToast({ - title: '审核成功', + title: '操作成功', icon: 'none' }) - fetchData() + submitting.value = false + resetAndLoad() } }) } + const handleTeamAudit = () => { + runBatch({ + title: '班组审核', + request: (ids) => reqTeamAuditWeldingDaily({ + TempDetailIds: ids, + AuditMan: userInfo.value?.PersonId + }) + }) + } + + const handleProfessionalAudit = () => { + runBatch({ + title: '专工审核', + request: (ids) => reqAuditWeldingDaily({ + TempDetailIds: ids, + AuditMan: userInfo.value?.PersonId + }) + }) + } + const handleBatchDelete = () => { - uni.showModal({ - title: '信息提示', - content: `确定删除选中的 ${selectedIds.value.length} 条日报吗?`, - success: async ({ - confirm - }) => { - if (!confirm) return - try { - await reqDeleteWeldingDaily({ - TempDetailIds: selectedIds.value - }) - } catch (err) { - return // 报错已由 request.js 统一 toast - } - uni.showToast({ - title: '删除成功', - icon: 'none' - }) - fetchData() - } + runBatch({ + title: '删除', + request: (ids) => reqDeleteWeldingDaily({ + TempDetailIds: ids + }) }) } @@ -315,48 +385,57 @@ // ===== 生命周期 ===== onShow(() => { - fetchData() + resetAndLoad() }) diff --git a/scanpages/hj/daily_audit_detail.vue b/scanpages/hj/daily_audit_detail.vue index 20b5b3a..1717fff 100644 --- a/scanpages/hj/daily_audit_detail.vue +++ b/scanpages/hj/daily_audit_detail.vue @@ -100,6 +100,26 @@ 提交时间 {{ fmtDateTime(form.SubmitDate) }} + + 审核状态 + {{ form.AuditStateText || '--' }} + + + 班组审核人 + {{ form.TeamAuditManName || '--' }} + + + 班组审核时间 + {{ fmtDateTime(form.TeamAuditDate) }} + + + 专工审核人 + {{ form.ProfessionalAuditManName || '--' }} + + + 专工审核时间 + {{ fmtDateTime(form.ProfessionalAuditDate) }} + 焊前拍照 @@ -126,8 +146,12 @@ - 删除 - 审核通过 + 删除 + 班组审核 + 专工审核 @@ -146,6 +170,7 @@ } from '@/store' import { reqPendingWeldingDailyDetail, + reqTeamAuditWeldingDaily, reqAuditWeldingDaily, reqDeleteWeldingDaily } from '@/api/hj.js' @@ -159,28 +184,35 @@ const tempDetailId = ref('') const form = ref({}) + const submitting = ref(false) + const auditState = computed(() => Number(form.value.AuditState)) + const isTeamPending = computed(() => auditState.value === 0) + const isProfessionalPending = computed(() => auditState.value === 1 && !!form.value.TeamAuditDate) - // ===== 操作 ===== - const handleAudit = () => { + const runAction = ({ + title, + request + }) => { + if (submitting.value) return uni.showModal({ title: '信息提示', - content: '确定审核通过该日报吗?', + content: `确定${title}该日报吗?`, success: async ({ confirm }) => { if (!confirm) return + submitting.value = true try { - await reqAuditWeldingDaily({ - TempDetailIds: [tempDetailId.value], - AuditMan: userInfo.PersonId - }) + await request() } catch (err) { - return // 报错已由 request.js 统一 toast + submitting.value = false + return } uni.showToast({ - title: '审核成功', + title: '操作成功', icon: 'none' }) + submitting.value = false setTimeout(() => { uni.navigateBack() }, 1500) @@ -188,7 +220,28 @@ }) } + const handleTeamAudit = () => { + runAction({ + title: '班组审核', + request: () => reqTeamAuditWeldingDaily({ + TempDetailIds: [tempDetailId.value], + AuditMan: userInfo.PersonId + }) + }) + } + + const handleProfessionalAudit = () => { + runAction({ + title: '专工审核', + request: () => reqAuditWeldingDaily({ + TempDetailIds: [tempDetailId.value], + AuditMan: userInfo.PersonId + }) + }) + } + const handleDelete = () => { + if (submitting.value) return uni.showModal({ title: '信息提示', content: '确定删除该日报吗?', @@ -196,17 +249,20 @@ confirm }) => { if (!confirm) return + submitting.value = true try { await reqDeleteWeldingDaily({ TempDetailIds: [tempDetailId.value] }) } catch (err) { - return // 报错已由 request.js 统一 toast + submitting.value = false + return } uni.showToast({ title: '删除成功', icon: 'none' }) + submitting.value = false setTimeout(() => { uni.navigateBack() }, 1500) @@ -247,6 +303,7 @@ .detail-page { background: #f0f2f5; + padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); } // ===== 焊口主标识(同 daily_paper) ===== @@ -338,4 +395,20 @@ } } } + + .bottom-btns { + padding: 16rpx 20rpx; + padding-bottom: calc(16rpx + env(safe-area-inset-bottom)); + gap: 12rpx; + z-index: 20; + + :deep(.u-btn) { + flex: 1; + min-width: 0; + height: 64rpx; + margin: 0; + padding: 0 8rpx !important; + font-size: 24rpx; + } + } diff --git a/scanpages/hj/daily_paper.vue b/scanpages/hj/daily_paper.vue index 8e64419..cb8c404 100644 --- a/scanpages/hj/daily_paper.vue +++ b/scanpages/hj/daily_paper.vue @@ -133,6 +133,26 @@ + + + 焊丝 + + + {{ wireDisplay || '请选择' }} + + + + + + + 焊条 + + + {{ rodDisplay || '请选择' }} + + + + 备注 @@ -185,6 +205,14 @@ + + + + + + @@ -192,7 +220,7 @@ import { ref, computed } from 'vue' import { onLoad } from '@dcloudio/uni-app' import { reqGetWeldJointByWeldJointId, reqSaveWeldingDailyByWeldJointId, reqGetManualPointSave, reqFitupCheckByWeldJointId } from '@/api/hj.js' -import { reqWeldingLocation, reqGetWeldTypeList, reqGetWeldingMethodList } from '@/api/base.js' +import { reqWeldingLocation, reqGetWeldTypeList, reqGetWeldingMethodList, reqGetWeldingConsumables } from '@/api/base.js' import { useUserStore, useMenuStore } from '@/store' @@ -211,9 +239,13 @@ const showLocationPicker = ref(false) const showTypePicker = ref(false) const showWeldTypePicker = ref(false) const showWeldingMethodPicker = ref(false) +const showWirePicker = ref(false) +const showRodPicker = ref(false) const locationList = ref([]) const weldTypeList = ref([]) const weldingMethodList = ref([]) +const wireList = ref([]) +const rodList = ref([]) const welderTypeList = ref([ { BaseInfoName: '打底/盖面', BaseInfoCode: 0 }, { BaseInfoName: '打底', BaseInfoCode: 1 }, @@ -227,16 +259,8 @@ 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: '合格' }, @@ -294,6 +318,56 @@ const handleConfirmWeldingMethod = (item) => { showWeldingMethodPicker.value = false } +const CONSUMABLE_WIRE = 1 +const CONSUMABLE_ROD = 2 + +const pickConsumableId = (item) => item?.BaseInfoId || item?.Id || '' +const pickConsumableCode = (item) => item?.BaseInfoCode || item?.Code || '' +const pickConsumableName = (item) => item?.BaseInfoName || item?.Name || pickConsumableCode(item) + +const normalizeConsumables = (list) => (Array.isArray(list) ? list : []).map((item) => ({ + ...item, + BaseInfoId: pickConsumableId(item), + BaseInfoCode: pickConsumableCode(item), + BaseInfoName: pickConsumableName(item), +})) + +const fetchConsumables = async (type) => { + const res = await reqGetWeldingConsumables(type) + return normalizeConsumables(res.data) +} + +const handleShowWireSelect = () => { + fetchConsumables(CONSUMABLE_WIRE).then((list) => { + wireList.value = list + showWirePicker.value = true + }) +} + +const handleConfirmWire = (item) => { + form.value.WeldingWire = item.BaseInfoId + form.value.WeldingWireCode = item.BaseInfoCode + form.value.WeldingWireName = item.BaseInfoName + showWirePicker.value = false +} + +const handleShowRodSelect = () => { + fetchConsumables(CONSUMABLE_ROD).then((list) => { + rodList.value = list + showRodPicker.value = true + }) +} + +const handleConfirmRod = (item) => { + form.value.WeldingRod = item.BaseInfoId + form.value.WeldingRodCode = item.BaseInfoCode + form.value.WeldingRodName = item.BaseInfoName + showRodPicker.value = false +} + +const wireDisplay = computed(() => form.value.WeldingWireCode || form.value.WeldingWireName || '') +const rodDisplay = computed(() => form.value.WeldingRodCode || form.value.WeldingRodName || '') + // ===== 操作 ===== const handlePoint = async () => { await reqGetManualPointSave(form.value.WeldJointId) @@ -329,7 +403,11 @@ const handleReport = () => { welderType: form.value.welderType, // 同步更新焊口焊缝类型 / 焊接方法 WeldTypeId: form.value.WeldTypeId || '', + WeldTypeCode: form.value.WeldTypeCode || '', WeldingMethodId: form.value.WeldingMethodId || '', + WeldingMethodCode: form.value.WeldingMethodCode || '', + WeldingWire: form.value.WeldingWire || '', + WeldingRod: form.value.WeldingRod || '', PreWeldAttachUrl: preWeldAttachUrl.value || form.value.PreWeldAttachUrl || '', PostWeldAttachUrl: postWeldAttachUrl.value || form.value.PostWeldAttachUrl || '' }) @@ -350,14 +428,16 @@ const handleMutualCheck = () => { const fillTypeMethodIds = async () => { const needWeldType = form.value.WeldTypeCode && !form.value.WeldTypeId const needMethod = form.value.WeldingMethodCode && !form.value.WeldingMethodId - if (!needWeldType && !needMethod) return + const needWire = (form.value.WeldingWireCode && !form.value.WeldingWire) || (form.value.WeldingWire && !form.value.WeldingWireCode) + const needRod = (form.value.WeldingRodCode && !form.value.WeldingRod) || (form.value.WeldingRod && !form.value.WeldingRodCode) + if (!needWeldType && !needMethod && !needWire && !needRod) return try { - const tasks = [] - if (needWeldType) tasks.push(reqGetWeldTypeList()) - else tasks.push(Promise.resolve(null)) - if (needMethod) tasks.push(reqGetWeldingMethodList()) - else tasks.push(Promise.resolve(null)) - const [typeRes, methodRes] = await Promise.all(tasks) + const [typeRes, methodRes, wireRes, rodRes] = await Promise.all([ + needWeldType ? reqGetWeldTypeList() : Promise.resolve(null), + needMethod ? reqGetWeldingMethodList() : Promise.resolve(null), + needWire ? fetchConsumables(CONSUMABLE_WIRE) : Promise.resolve(null), + needRod ? fetchConsumables(CONSUMABLE_ROD) : Promise.resolve(null), + ]) if (typeRes?.data) { const hit = typeRes.data.find(i => i.BaseInfoCode === form.value.WeldTypeCode) if (hit) { @@ -372,8 +452,28 @@ const fillTypeMethodIds = async () => { form.value.WeldingMethodName = hit.BaseInfoName } } + if (wireRes) { + const hit = wireRes.find(i => + i.BaseInfoId === form.value.WeldingWire || i.BaseInfoCode === form.value.WeldingWireCode + ) + if (hit) { + form.value.WeldingWire = hit.BaseInfoId + form.value.WeldingWireCode = hit.BaseInfoCode + form.value.WeldingWireName = hit.BaseInfoName + } + } + if (rodRes) { + const hit = rodRes.find(i => + i.BaseInfoId === form.value.WeldingRod || i.BaseInfoCode === form.value.WeldingRodCode + ) + if (hit) { + form.value.WeldingRod = hit.BaseInfoId + form.value.WeldingRodCode = hit.BaseInfoCode + form.value.WeldingRodName = hit.BaseInfoName + } + } } catch (e) { - console.error('回填焊缝类型/焊接方法ID失败:', e) + console.error('回填焊缝类型/焊接方法/焊材ID失败:', e) } } diff --git a/scanpages/hj/make_right.vue b/scanpages/hj/make_right.vue index 1a64771..734b483 100644 --- a/scanpages/hj/make_right.vue +++ b/scanpages/hj/make_right.vue @@ -33,15 +33,6 @@ 组对填报 - - - 坡口加工类型 - - - - - 组对间隙 @@ -161,14 +152,13 @@ - - 提交结果 + + {{ submitting ? '提交中...' : '提交结果' }} - + + diff --git a/scanpages/hj/weld_task_detail.vue b/scanpages/hj/weld_task_detail.vue new file mode 100644 index 0000000..9611c05 --- /dev/null +++ b/scanpages/hj/weld_task_detail.vue @@ -0,0 +1,323 @@ + + + + + diff --git a/scanpages/hj/weld_task_list.vue b/scanpages/hj/weld_task_list.vue new file mode 100644 index 0000000..d0a4ea7 --- /dev/null +++ b/scanpages/hj/weld_task_list.vue @@ -0,0 +1,150 @@ + + + diff --git a/utils/constant.js b/utils/constant.js index d10044f..d38cd15 100644 --- a/utils/constant.js +++ b/utils/constant.js @@ -54,8 +54,7 @@ export const defaultApps = [{ name: '下料抽检', icon: 'xialiaochoujianjilu', menuId: "", - path: "/scanpages/hj/material_sampling", - isScan: true, + path: "/scanpages/hj/weld_joint_search?target=%2Fscanpages%2Fhj%2Fmaterial_sampling&title=%E4%B8%8B%E6%96%99%E6%8A%BD%E6%A3%80", funcKey: 'sampling', prefix: 'nbd-icon', selected: false @@ -64,8 +63,7 @@ export const defaultApps = [{ name: '组对抽查', icon: 'zudui', menuId: "", - path: "/scanpages/hj/make_right", - isScan: true, + path: "/scanpages/hj/weld_joint_search?target=%2Fscanpages%2Fhj%2Fmake_right&title=%E7%BB%84%E5%AF%B9%E6%8A%BD%E6%9F%A5", funcKey: 'makeRight', prefix: 'nbd-icon', selected: false @@ -97,6 +95,22 @@ export const defaultApps = [{ isScan: true, prefix: 'nbd-icon', selected: false + }, + { + name: '条码查询', + icon: 'saoyisao', + menuId: '', + path: '/scanpages/hj/barcode_search', + prefix: 'nbd-icon', + selected: false + }, + { + name: '焊接任务单', + icon: 'daiban', + menuId: '', + path: '/scanpages/hj/weld_task_list', + prefix: 'nbd-icon', + selected: false } ]