From 06781c69e1f89259c2444b907357b1652c99cb70 Mon Sep 17 00:00:00 2001 From: Zones <765289303@qq.com> Date: Thu, 11 Jun 2026 09:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=84=8A=E6=8E=A5=E6=97=A5=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/base.js | 7 +- api/hj.js | 27 ++++- assets/css/page.scss | 236 ++++++++++++++++++++++++++++++++++++- pages.json | 25 ++++ pages/index/index.vue | 19 ++- pipe/diankou/list.vue | 5 +- pipe/diankou/port_list.vue | 113 ++++++++++++++++++ pipe/packaging/list.vue | 0 pipe/pressure/index.vue | 27 +++++ pipe/weld/daily_paper.vue | 208 ++++++++++++++++++++++++++++++++ store/modules/menu.js | 35 +++++- utils/constant.js | 4 +- utils/request.js | 24 +++- utils/scanUtils.js | 7 ++ 14 files changed, 713 insertions(+), 24 deletions(-) create mode 100644 pipe/diankou/port_list.vue create mode 100644 pipe/packaging/list.vue create mode 100644 pipe/pressure/index.vue create mode 100644 pipe/weld/daily_paper.vue create mode 100644 utils/scanUtils.js diff --git a/api/base.js b/api/base.js index 6c9cc47..b54dcfb 100644 --- a/api/base.js +++ b/api/base.js @@ -6,4 +6,9 @@ import { /** * 请求单位工程 */ -export const reqProjectWorkArea = (projectId)=>get(`BaseInfo/getProjectWorkArea?projectId=${projectId}`) \ No newline at end of file +export const reqProjectWorkArea = (projectId)=>get(`BaseInfo/getProjectWorkArea?projectId=${projectId}`) + +/** + * 获取焊口位置 + */ +export const getWeldingLocation = ()=>get(`BaseInfo/getWeldingLocation`) diff --git a/api/hj.js b/api/hj.js index 66da851..61bbc4d 100644 --- a/api/hj.js +++ b/api/hj.js @@ -6,9 +6,32 @@ import { /** * 获取焊接首页数据 */ -export const reqHJIndexData = (projectId)=>get(`HJGLIndex/GetJGLIndexItem?projectId=${projectId}`) +export const reqHJIndexData = (projectId) => get(`HJGLIndex/GetJGLIndexItem?projectId=${projectId}`) /** * 获取点口管理列表 */ -export const reqGetNotEndPointBatch = (unitWorkId,projectId)=>get(`NDETrust/getNotEndPointBatch?unitWorkId=${unitWorkId}&projectId=${projectId}`) \ No newline at end of file +export const reqGetNotEndPointBatch = (unitWorkId, projectId) => get( + `NDETrust/getNotEndPointBatch?unitWorkId=${unitWorkId}&projectId=${projectId}`) + +/** + * 获取点口详情列表 + */ +export const reqGetPointBatchDetail = (id) => get(`NDETrust/getPointBatchDetail?pointBatchId=${id}`) + +/** + * 获取焊接日报详情 + */ +export const reqGetWeldJointByWeldJointId = (id) => get(`PipeJoint/getWeldJointByWeldJointId?WeldJointId=${id}`) + +/** + * 焊接日报填报 + */ +export const reqSaveWeldingDailyByWeldJointId = (data) => get( + `PreWeldingDaily/SaveWeldingDailyByWeldJointId?WeldJointId=${data.WeldJointId||''}&Personid=${data.Personid||''}&time=${data.time||''}&weldingLocation=${data.weldingLocation||''}&welderType=${data.welderType||''}` +) + +/** + * 点口 + */ +export const reqGetManualPointSave = (weldJointId)=>get(`NDETrust/getManualPointSave?weldJointId=${weldJointId}`) \ No newline at end of file diff --git a/assets/css/page.scss b/assets/css/page.scss index 41d8387..90583a0 100644 --- a/assets/css/page.scss +++ b/assets/css/page.scss @@ -27,7 +27,6 @@ // 首页 .home { padding-top: 80px; - padding-bottom: 60rpx; .u-border-bottom:after { border: none; } @@ -448,7 +447,7 @@ // 列表区域 .list-scroll { flex: 1; - overflow: hidden; + overflow-y: auto; } // 加载中 @@ -468,7 +467,7 @@ } .list-wrap { - padding: 24rpx; + padding: 24rpx 24rpx 60rpx; } // 列表项:序号 + 标题 + 箭头 @@ -524,4 +523,233 @@ color: #ccc; font-size: 24rpx; } -} \ No newline at end of file + + // 操作按钮区域 + .action-bar { + display: flex; + justify-content: space-between; + padding: 20rpx 24rpx; + background: #ffffff; + + .action-btn { + flex: 1; + text-align: center; + padding: 16rpx 0; + background: $u-type-primary; + color: #ffffff; + font-size: 28rpx; + border-radius: 8rpx; + margin: 0 8rpx; + + &:active { + opacity: 0.7; + } + } + } + + // 批号信息 + .batch-info { + display: flex; + align-items: center; + padding: 24rpx; + background: #ffffff; + margin-top: 2rpx; + + .batch-refresh { + margin-left: auto; + display: flex; + align-items: center; + + .rotating { + animation: rotate 1s linear infinite; + } + } + + .batch-label { + width: 160rpx; + font-size: 28rpx; + color: #333; + } + + .batch-value { + flex: 1; + font-size: 28rpx; + color: #666; + } + } + + // 卡片项 + .card-item { + background: #ffffff; + border-radius: 16rpx; + padding: 28rpx; + margin-bottom: 20rpx; + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); + + &:last-child { + margin-bottom: 0; + } + + .card-row { + display: flex; + align-items: center; + padding: 16rpx 0; + + &:not(:last-child) { + border-bottom: 1rpx solid #f5f6f8; + } + } + + .card-label { + width: 160rpx; + font-size: 28rpx; + color: #666; + flex-shrink: 0; + } + + .card-value { + flex: 1; + font-size: 28rpx; + color: #333; + text-align: right; + } + + .card-tag { + display: inline-block; + padding: 6rpx 20rpx; + border-radius: 20rpx; + font-size: 24rpx; + background: rgba(244, 67, 54, 0.1); + color: #f44336; + margin-left: auto; + + &.done { + background: rgba(76, 175, 80, 0.1); + color: #4caf50; + } + } + } +} + +// 详情页通用样式 +.page-detail { + min-height: 100vh; + background: #f5f6f8; + padding-bottom: 180rpx; +} + +// 信息分组 +.info-group { + background: #ffffff; + margin: 24rpx; + border-radius: 16rpx; + overflow: hidden; +} + +.info-item { + display: flex; + align-items: center; + padding: 28rpx 32rpx; + border-bottom: 1rpx solid #f5f6f8; + + &:last-child { + border-bottom: none; + } + + .info-label { + width: 200rpx; + font-size: 28rpx; + color: #666; + flex-shrink: 0; + } + + .info-value { + flex: 1; + font-size: 28rpx; + color: #333; + text-align: right; + } + + &.info-link { + .info-value { + color: #999; + } + + &:active { + background: #f8f9fa; + } + } +} + +// 底部按钮 +.bottom-btns { + position: fixed; + left: 30rpx; + right: 30rpx; + bottom: 40rpx; + display: flex; + justify-content: space-between; + align-items: center; + gap: 16rpx; + + .u-size-medium { + height: 80rpx; + font-size: 28rpx; + border-radius: 8rpx; + width: 45% !important; + margin: 0; + } + +} +// 网格页面(试压管理等) +.page-grid { + min-height: 100vh; + background: #f5f6f8; + padding: 24rpx; +} + +.grid-card { + background: #ffffff; + border-radius: 16rpx; + padding: 24rpx; +} + +.grid-list { + display: flex; + flex-wrap: wrap; + gap: 16rpx; +} + +.grid-item { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + flex: 1; + min-width: 45%; + padding: 32rpx 16rpx; + border-radius: 12rpx; + transition: all 0.2s; + + &:active { + background: #f0f3ff; + transform: scale(0.98); + } + + .grid-icon { + display: flex; + align-items: center; + justify-content: center; + } + + .grid-text { + margin-top: 20rpx; + font-size: 26rpx; + color: #666; + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 100%; + } +} diff --git a/pages.json b/pages.json index c3d5b98..c78112c 100644 --- a/pages.json +++ b/pages.json @@ -37,6 +37,31 @@ "style": { "navigationBarTitleText": "点口管理" } + }, + { + "path": "diankou/port_list", + "style": { + "navigationBarTitleText": "点口管理" + } + }, + { + "path": "weld/daily_paper", + "style": { + "navigationBarTitleText": "焊接日报" + } + }, + { + "path": "pressure/index", + "style": { + "navigationBarTitleText": "试压管理" + } + }, + { + "path": "packaging/list", + "style": { + "navigationBarTitleText": "包装管理", + "enablePullDownRefresh": true + } } ] } diff --git a/pages/index/index.vue b/pages/index/index.vue index 533d40e..e97e0a2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -90,7 +90,8 @@ - + {{ item.name }} @@ -147,6 +148,10 @@ storeToRefs } from 'pinia'; + import { + scanToSkipUrl + } from '@/utils/scanUtils.js' + const userStore = useUserStore() const menuStore = useMenuStore() const largeStore = useLargeStore() @@ -180,7 +185,7 @@ const currentProjectName = computed(() => currentProject.value?.ProjectName || '') const handleSkip = (item) => { - if(!currentProject.value.ProjectId){ + if (!currentProject.value.ProjectId) { handleShowProjectSelect() uni.showToast({ title: '请选择一个项目', @@ -241,12 +246,14 @@ uni.scanCode({ onlyFromCamera: true, success(res) { - console.log('条码类型:' + res.scanType); - console.log('条码内容:' + res.result); + const result = res.result || '' + uni.navigateTo({ + url:scanToSkipUrl(result) + }) }, fail(err) { - console.log("扫码失败了====>", err) + console.error('扫码失败:', err) } - }); + }) } \ No newline at end of file diff --git a/pipe/diankou/list.vue b/pipe/diankou/list.vue index 8d790cc..b380614 100644 --- a/pipe/diankou/list.vue +++ b/pipe/diankou/list.vue @@ -133,8 +133,9 @@ } const handleItemClick = (item) => { - console.log('点击列表项:', item) - // TODO: 跳转详情 + uni.navigateTo({ + url: `/pipe/diankou/port_list?id=${item.PointBatchId}&code=${item.PointBatchCode}` + }) } diff --git a/pipe/diankou/port_list.vue b/pipe/diankou/port_list.vue new file mode 100644 index 0000000..b4fa2b6 --- /dev/null +++ b/pipe/diankou/port_list.vue @@ -0,0 +1,113 @@ + + + diff --git a/pipe/packaging/list.vue b/pipe/packaging/list.vue new file mode 100644 index 0000000..e69de29 diff --git a/pipe/pressure/index.vue b/pipe/pressure/index.vue new file mode 100644 index 0000000..c31ab01 --- /dev/null +++ b/pipe/pressure/index.vue @@ -0,0 +1,27 @@ + + + diff --git a/pipe/weld/daily_paper.vue b/pipe/weld/daily_paper.vue new file mode 100644 index 0000000..04908f1 --- /dev/null +++ b/pipe/weld/daily_paper.vue @@ -0,0 +1,208 @@ + + + \ No newline at end of file diff --git a/store/modules/menu.js b/store/modules/menu.js index 650213c..f311fed 100644 --- a/store/modules/menu.js +++ b/store/modules/menu.js @@ -3,24 +3,42 @@ import { } from 'pinia' import { ref, - computed + computed, + watch } from 'vue' import {pastelColors,defaultApps} from '@/utils/constant.js' import {reqMenuPowerList} from '@/api/auth.js' export const useMenuStore = defineStore('menu', () => { - // 应用列表(默认配置 + 持久化) - const appsList = ref([...defaultApps]) + // 持久化:仅缓存快捷应用的 menuId 列表,不缓存全部菜单 + const quickAppIds = ref([]) + + // 根据默认配置 + 持久化状态重建应用列表 + const buildAppsList = () => { + return defaultApps.map(app => ({ + ...app, + selected: quickAppIds.value.includes(app.menuId) + })) + } + + // 应用列表(从默认配置构建 + 持久化 selected 状态) + const appsList = ref(buildAppsList()) + // 持久化恢复后,appsList 需重新根据 quickAppIds 构建 + watch(quickAppIds, (ids) => { + if (ids && ids.length > 0) { + appsList.value = buildAppsList() + } + }, { deep: true }) // 编辑时的临时缓存 const editCache = ref([]) // 菜单的权限列表(后端返回的有权限的菜单 code 数组) const menuProwerList = ref([]) // 快捷应用列表(已选择的) - const quickApps = computed(() => appsList.value.filter(app => app.selected&&hasMenuPermission(app.menuId))) + const quickApps = computed(() => appsList.value.filter(app => app.selected && hasMenuPermission(app.menuId))) // 业务查询列表(未选择的) - const queryApps = computed(() => appsList.value.filter(app => !app.selected&&hasMenuPermission(app.menuId))) + const queryApps = computed(() => appsList.value.filter(app => !app.selected && hasMenuPermission(app.menuId))) /** * 打开编辑弹窗(备份当前状态) @@ -41,6 +59,10 @@ export const useMenuStore = defineStore('menu', () => { */ const confirmEdit = () => { appsList.value = editCache.value.map(app => ({ ...app })) + // 只持久化快捷应用的 menuId 列表 + quickAppIds.value = appsList.value + .filter(app => app.selected) + .map(app => app.menuId) } /** @@ -79,6 +101,7 @@ export const useMenuStore = defineStore('menu', () => { return { appsList, + quickAppIds, editCache, quickApps, quickAppsWithPermission, @@ -96,7 +119,7 @@ export const useMenuStore = defineStore('menu', () => { enabled: true, strategies: [{ key: 'menu', - paths: ['appsList'], + paths: ['quickAppIds'], }] }, }) diff --git a/utils/constant.js b/utils/constant.js index 4e0340b..4e89c5c 100644 --- a/utils/constant.js +++ b/utils/constant.js @@ -22,6 +22,7 @@ export const defaultApps = [{ name: '试压管理', icon: 'shiyabao', menuId: '55976B16-2C33-406E-B514-2FE42D031071', + path: '/pipe/pressure/index', prefix: 'nbd-icon', selected: false }, @@ -29,6 +30,7 @@ export const defaultApps = [{ name: '包装管理', icon: 'baozhuangguanli', menuId: "25DED954-10C9-47CC-99F2-C44FDE9E0A81", + path: "/pipe/packaging/list", prefix: 'nbd-icon', selected: false }, @@ -46,4 +48,4 @@ export const defaultApps = [{ prefix: 'nbd-icon', selected: false } -] \ No newline at end of file +] diff --git a/utils/request.js b/utils/request.js index 0cc4d12..f621c3b 100644 --- a/utils/request.js +++ b/utils/request.js @@ -137,11 +137,31 @@ export function request(options) { } // GET 快捷方法 -export function get(url, params = {}) { +export const get = (url, params = {}) => { return request({ url, method: 'GET', data: params }) } // POST 快捷方法 -export function post(url, data = {}) { +export const post = (url, data = {}) => { return request({ url, method: 'POST', data }) } + + +export const getUrlParam = (url, name) => { + if (!url || !name) return null; + + // 构造正则:匹配 ?name= 或 &name= 后面的值 + // [?&] : 匹配起始分隔符 + // ${name}: 匹配具体的参数名 + // = : 匹配等号 + // ([^&]*) : 捕获组,匹配直到下一个 & 或字符串结束的内容 + const regex = new RegExp(`[?&]${name}=([^&]*)`, 'i'); // 'i' 表示忽略大小写 + + const match = url.match(regex); + + if (match && match[1]) { + return decodeURIComponent(match[1]); + } + + return null; +}; \ No newline at end of file diff --git a/utils/scanUtils.js b/utils/scanUtils.js new file mode 100644 index 0000000..08d3be4 --- /dev/null +++ b/utils/scanUtils.js @@ -0,0 +1,7 @@ +import {getUrlParam} from './request' +export const scanToSkipUrl = (str)=>{ + // 焊接日报跳转 + if(str.includes('weldjoint')){ + return `/pipe/weld/daily_paper?id=${getUrlParam(str,"id")}` + } +} \ No newline at end of file