diff --git a/api/hj.js b/api/hj.js
index cea2b6e..a8e3d1c 100644
--- a/api/hj.js
+++ b/api/hj.js
@@ -137,3 +137,27 @@ export const reqTestPackageNoList = (unitWorkId, isFinish, testPackageNo)=>get(`
* @param {String} ptp_Id
*/
export const reqTestPackageDetail = (ptp_Id)=>get(`TestPackage/GetTestPackageDetail?ptp_Id=${ptp_Id}`)
+
+
+// =========================== 扫码 ========================================
+/**
+ * 获取材料详情 (入库单管理)
+ * @param {String} materialCode
+ */
+export const reqMaterialInfoByMaterialCode = (materialCode)=>get(`BaseInfo/GetMaterialInfoByMaterialCode?materialCode=${materialCode}`)
+/**
+ * 获取焊前基础信息
+ * @param {String} WeldJointId
+ */
+export const reqPreWeldJointByWeldJointId = (WeldJointId)=>get(`PreWeldInspection/getPreWeldJointByWeldJointId?WeldJointId=${WeldJointId}`)
+/**
+ * 保存焊前基础信息(材料编码及炉批号校验、材料数量校验)
+ * @param {Object} data
+ */
+export const reqSaveCuttingCheck = (data)=> post(`PreWeldInspection/SaveCuttingCheck`, data)
+
+/**
+ * 获取坡口类型列表
+ * TODO: 确认接口地址
+ */
+export const reqGetGrooveTypeList = ()=>get(`BaseInfo/GetGrooveTypeList`)
\ No newline at end of file
diff --git a/assets/css/page.scss b/assets/css/page.scss
index 574717b..84a0a37 100644
--- a/assets/css/page.scss
+++ b/assets/css/page.scss
@@ -2,45 +2,108 @@
// 登录
.login {
+ display: flex;
+ flex-direction: column;
width: 100vw;
height: 100vh;
- background-color: $u-bg-white;
+ background: #f0f2f5;
+ overflow: hidden;
- .sys-name {
- font-size: 48rpx;
- font-weight: 700;
- color: #333333;
- position: absolute;
- top: 300rpx;
- width: 100%;
- text-align: center;
+ // 顶部区域:背景图 + Logo + 标题
+ .login-header {
+ flex-shrink: 0;
+
+ &__bg {
+ display: block;
+ width: 100%;
+ height: auto;
+ }
+ }
+
+ // 表单卡片
+ .login-card {
+ flex: 1;
+ position: relative;
+ z-index: 1;
+ margin: -40rpx 32rpx 0;
+ background: #ffffff;
+ border-radius: 24rpx 24rpx 0 0;
+ padding: 48rpx 40rpx 0;
+ box-shadow: 0 -4rpx 24rpx rgba(0, 0, 0, 0.08);
+
+ &__brand {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 24rpx;
+ margin-bottom: 40rpx;
+ }
+
+ .login-logo {
+ display: block;
+ width: 100rpx;
+ height: 100rpx;
+ flex-shrink: 0;
+ }
+
+ .sys-name {
+ font-size: 36rpx;
+ font-weight: 700;
+ color: #1a1a2e;
+ letter-spacing: 2rpx;
+ }
}
.login-form {
- position: absolute;
- bottom: 240rpx;
- right: 60rpx;
- left: 60rpx;
+ :deep(.u-form-item) {
+ margin-bottom: 24rpx;
+ }
+
+ :deep(.u-form-item__body) {
+ padding: 18rpx 28rpx;
+ background: #f5f6f8;
+ border-radius: 14rpx;
+ border: 1rpx solid transparent;
+ transition: border-color 0.25s;
+ }
+
+ :deep(.u-input__input) {
+ font-size: 30rpx;
+ color: #1a1a2e;
+
+ &::placeholder {
+ color: #b0bec5;
+ }
+ }
+
+ :deep(.u-button--primary) {
+ height: 92rpx;
+ background: linear-gradient(135deg, #2979ff, #5a9aff);
+ border-radius: 14rpx;
+ font-size: 32rpx;
+ font-weight: 600;
+ letter-spacing: 2rpx;
+ box-shadow: 0 6rpx 24rpx rgba(41, 121, 255, 0.35);
+ border: none;
+
+ &::after {
+ border: none;
+ }
+
+ &:active {
+ opacity: 0.9;
+ transform: scale(0.98);
+ }
+ }
}
}
// 首页
.home {
- &-navbar{
- padding-top: 40px;
- height: 85px;
- background-color: var(--u-type-primary);
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
+ display: flex;
+ flex-direction: column;
+ height: 100vh;
- &-title {
- font-size: 32rpx;
- color: #ffffff;
- position: relative;
- }
- }
.u-border-bottom:after {
border: none;
}
@@ -61,11 +124,12 @@
height: 85px;
background-color: $u-type-primary;
padding: 40px 20rpx 0;
+ flex-shrink: 0;
&-title {
flex: 1;
text-align: center;
- font-size: 28rpx;
+ font-size: 14px;
color: #ffffff;
}
@@ -84,6 +148,7 @@
justify-content: flex-start;
align-items: center;
padding: 0 20rpx;
+ flex-shrink: 0;
}
&-icon {
@@ -102,6 +167,13 @@
margin-left: 60rpx;
}
+ &-scroll {
+ flex: 1;
+ overflow-y: auto;
+ height: 0;
+ padding-bottom: 10px;
+ }
+
&-hj {
margin: 20rpx;
background: #fff;
@@ -299,14 +371,15 @@
}
.edit-grid {
- width: 100%;
- overflow-y: scroll;
+ flex: 1;
+ min-height: 0;
+ overflow: hidden;
display: grid;
grid-template-columns: repeat(4, calc(25% - 20rpx));
gap: 20rpx;
- padding: 24rpx 0;
- min-height: 0;
+ padding: 24rpx 0 160rpx;
box-sizing: border-box;
+ align-content: flex-start;
}
.edit-item {
@@ -327,6 +400,10 @@
border: 2rpx solid $u-type-primary;
}
+ &.hidden {
+ display: none;
+ }
+
.icon-box {
width: 96rpx;
height: 96rpx;
@@ -361,6 +438,41 @@
}
}
+ // 搜索框
+ .edit-search {
+ display: flex;
+ align-items: center;
+ gap: 12rpx;
+ margin: 16rpx 0 8rpx;
+ padding: 18rpx 24rpx;
+ background: #f5f6f8;
+ border-radius: 12rpx;
+
+ &__input {
+ flex: 1;
+ font-size: 26rpx;
+ color: #333;
+ background: transparent;
+ border: none;
+ outline: none;
+
+ &::placeholder {
+ color: #b0bec5;
+ }
+ }
+ }
+
+ // 空状态
+ .edit-empty {
+ grid-column: 1 / -1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 60rpx 0;
+ font-size: 26rpx;
+ color: #999;
+ }
+
.edit-btns {
display: flex;
gap: 24rpx;
diff --git a/assets/icon/nbd-icon.css b/assets/icon/nbd-icon.css
index 703c758..b9876f6 100644
--- a/assets/icon/nbd-icon.css
+++ b/assets/icon/nbd-icon.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "nbd-icon"; /* Project id 5193086 */
- src: url('//at.alicdn.com/t/c/font_5193086_dyc00qt3bz.woff2?t=1781056075220') format('woff2'),
- url('//at.alicdn.com/t/c/font_5193086_dyc00qt3bz.woff?t=1781056075220') format('woff'),
- url('//at.alicdn.com/t/c/font_5193086_dyc00qt3bz.ttf?t=1781056075220') format('truetype');
+ src: url('//at.alicdn.com/t/c/font_5193086_0r8nbjxfoygi.woff2?t=1781694668587') format('woff2'),
+ url('//at.alicdn.com/t/c/font_5193086_0r8nbjxfoygi.woff?t=1781694668587') format('woff'),
+ url('//at.alicdn.com/t/c/font_5193086_0r8nbjxfoygi.ttf?t=1781694668587') format('truetype');
}
.nbd-icon {
@@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
+.nbd-icon-zudui:before {
+ content: "\e619";
+}
+
+.nbd-icon-xialiaochoujianjilu:before {
+ content: "\e609";
+}
+
.nbd-icon-a-facheguanli:before {
content: "\e683";
}
diff --git a/pages.json b/pages.json
index 77b9b5e..642d5af 100644
--- a/pages.json
+++ b/pages.json
@@ -123,6 +123,29 @@
}
}
]
+ },
+ {
+ "root": "scanpages",
+ "pages": [
+ {
+ "path": "hj/materials_detail",
+ "style": {
+ "navigationBarTitleText": "材料详情"
+ }
+ },
+ {
+ "path": "hj/material_sampling",
+ "style": {
+ "navigationBarTitleText": "下料抽检"
+ }
+ },
+ {
+ "path": "hj/make_right",
+ "style": {
+ "navigationBarTitleText": "组队抽查"
+ }
+ }
+ ]
}
],
"tabBar": {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index a2ba51a..b85a642 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -19,95 +19,99 @@
待办
-
-
-
-
- 工厂焊接一次合格率
- {{ hjIndexData?.GCFirstPassRate|| '--'}}
+
+
+
+
+
+ 工厂焊接一次合格率
+ {{ hjIndexData?.GCFirstPassRate|| '--'}}
+
+
+ 现场焊接一次合格率
+ {{ hjIndexData?.XCFirstPassRate || '--' }}
+
-
- 现场焊接一次合格率
- {{ hjIndexData?.XCFirstPassRate || '--' }}
+
+
+ 工厂预制进度
+ {{ hjIndexData?.GCProgress|| '--' }}
+
+
+ 现场焊接进度
+ {{ hjIndexData?.XCProgress || '--'}}
+
+
+
+
+ 工厂焊工功效
+ {{ hjIndexData?.GCWelderEfficacy || '--'}}
+
+
+ 现场焊接功效
+ {{ hjIndexData?.XCWelderEfficacy || '--'}}
+
-
-
- 工厂预制进度
- {{ hjIndexData?.GCProgress|| '--' }}
-
-
- 现场焊接进度
- {{ hjIndexData?.XCProgress || '--'}}
-
-
-
-
- 工厂焊工功效
- {{ hjIndexData?.GCWelderEfficacy || '--'}}
-
-
- 现场焊接功效
- {{ hjIndexData?.XCWelderEfficacy || '--'}}
-
+
-
-
-
-
-
-
-
- 快捷应用
-
-
-
-
-
-
-
+
+
+
+
+
+ 快捷应用
- {{ item.name }}
+
- 请选择应用
-
-
-
-
-
-
-
-
-
-
- 业务查询
-
-
-
-
-
-
+
+
+
+
+
+ {{ item.name }}
- {{ item.name }}
+ 请选择应用
-
+
+
+
+
+
+
+ 业务查询
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
-
+
选择快捷应用
-
-
+
+
+
+
+
-
+
+ 没有匹配的应用
+
+
取消
确定
@@ -151,8 +158,11 @@
} from 'pinia';
import {
- scanToSkipUrl
+ parseScanResult
} from '@/utils/scanUtils.js'
+ import {
+ getUrlParam
+ } from '@/utils/request.js'
const userStore = useUserStore()
const menuStore = useMenuStore()
@@ -180,14 +190,17 @@
const projectNameKeyword = ref('')
const showProject = ref(false)
const showEditQuick = ref(false)
+ const keyword = ref('')
const currentProjectName = computed(() => currentProject.value?.ProjectName || '')
- const handleSkipByPath = (path)=>{
- uni.navigateTo({
- url: path
- })
- }
+ // 搜索过滤后的编辑列表
+ const filteredEditCache = computed(() => {
+ const kw = keyword.value.trim().toLowerCase()
+ if (!kw) return editCache.value
+ return editCache.value.filter(item => item.name.toLowerCase().includes(kw))
+ })
+
const handleSkip = (item) => {
if (!currentProject.value.ProjectId) {
handleShowProjectSelect()
@@ -197,6 +210,10 @@
})
return
}
+ if (item.isScan) {
+ handleMenuScan(item.path)
+ return
+ }
uni.navigateTo({
url: item.path
})
@@ -205,6 +222,7 @@
// 打开编辑弹窗
const openEditQuick = () => {
menuStore.openEdit()
+ keyword.value = ''
showEditQuick.value = true
}
@@ -243,23 +261,69 @@
projectNameKeyword.value = keyword
}
+ /**
+ * 菜单扫一扫
+ */
+ const handleMenuScan = (path) => {
+ wx.scanCode({
+ scanType: ['datamatrix', 'barCode', 'qrCode', 'wxCode', 'pdf417'],
+ success(res) {
+ // 获取路径给的ID
+ let id = getUrlParam(res.result, 'id')
+ uni.navigateTo({
+ url: path + (id ? `?id=${id}` : '')
+ })
+ },
+ fail(err) {
+ console.log(err)
+ uni.showToast({
+ title: '扫码失败,请重试',
+ icon: 'none'
+ })
+ }
+ })
+ }
+
/**
* 扫一扫
*/
const handleScan = () => {
- uni.scanCode({
+ // 调起条码扫描
+ wx.scanCode({
+ scanType: ['datamatrix', 'barCode', 'qrCode', 'wxCode', 'pdf417'],
success(res) {
- console.log('扫码结果:', res)
- const result = res.result || ''
- const url = scanToSkipUrl(result)
- if (url) {
- uni.navigateTo({ url })
- } else {
- uni.showToast({ title: '无法识别的二维码/条形码', icon: 'none' })
+ console.log('扫码结果==>', res)
+
+ if (res.scanType != 'QR_CODE') {
+ uni.navigateTo({
+ url: '/scanpages/hj/materials_detail?id=' + res.result
+ })
+ }
+ if (res.scanType == 'QR_CODE') {
+ const result = res.result || ''
+
+ // 优先按 URL 规则解析(焊接接头等)
+ const parsed = parseScanResult(result)
+ if (parsed) {
+ uni.navigateTo({
+ url: `${parsed.path}?${parsed.query}`
+ })
+ return
+ }else{
+ uni.showToast({
+ title: '无对应业务',
+ icon: 'none'
+ })
+ }
+
}
},
fail(err) {
- console.error('扫码失败:', err)
+ console.log(err)
+ uni.showToast({
+ title: '扫码失败,请重试',
+ icon: 'none'
+ })
}
})
}
diff --git a/pages/login/index.vue b/pages/login/index.vue
index 2fec4ab..9a417cd 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -1,26 +1,35 @@
-
- 施工管理系统
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 登录
-
-
+
+
+
+
+ 管道安装管理系统
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 登录
+
+
+
diff --git a/scanpages/hj/make_right.vue b/scanpages/hj/make_right.vue
new file mode 100644
index 0000000..14d1fdb
--- /dev/null
+++ b/scanpages/hj/make_right.vue
@@ -0,0 +1,463 @@
+
+
+
+
+ {{ form.WeldJointCode || '焊口编码' }}
+
+
+ 管线编码
+ {{ form.PipelineCode || '--' }}
+
+
+ 项目编号
+ {{ form.ProjectName || form.ProjectId || '--' }}
+
+
+
+
+
+
+
+
+
+ 坡口类型名称
+
+
+ {{ form.GrooveTypeName || '请选择坡口类型' }}
+
+
+
+
+
+ 坡口类型编码
+ {{ form.GrooveTypeCode || '--' }}
+
+
+ 坡口加工类型
+ {{ form.GrooveProcessType || '--' }}
+
+
+
+
+
+
+
+
+
+ 坡口角度
+
+ {{ form.GrooveAngle ?? '--' }}
+ °
+
+
+
+ 组对间隙
+
+ {{ form.FitupGap ?? '--' }}
+ mm
+
+
+
+ 错边量
+
+ {{ form.Misalignment ?? '--' }}
+ mm
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.BaseInfoName }}
+ {{ item.BaseInfoCode }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scanpages/hj/material_sampling.vue b/scanpages/hj/material_sampling.vue
new file mode 100644
index 0000000..31c5fb1
--- /dev/null
+++ b/scanpages/hj/material_sampling.vue
@@ -0,0 +1,686 @@
+
+
+
+
+ {{ info.WeldJointCode || '--' }}
+
+
+ 管线编码
+ {{ info.PipelineCode || '--' }}
+
+
+ 项目名称
+ {{ info.ProjectName || info.ProjectId || '--' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 坡口类型名称
+
+ {{ info.GrooveTypeName || '--' }}
+
+
+
+ 坡口类型编号
+
+ {{ info.GrooveTypeCode || '--' }}
+
+
+
+ 坡口加工类型
+ {{ info.GrooveProcessType || '--' }}
+
+
+
+
+
+
+
+
+
+
+ 材料编码及炉批号校验
+ 核对实物编码与批次信息
+
+
+
+
+ ✓
+ 通过
+
+
+ ✕
+ 不通过
+
+
+
+
+
+
+ 材料数量校验
+ 核对实物数量与单据一致
+
+
+
+
+ ✓
+ 通过
+
+
+ ✕
+ 不通过
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 提交校验结果
+
+
+
+
+
+
+
+
diff --git a/scanpages/hj/materials_detail.vue b/scanpages/hj/materials_detail.vue
new file mode 100644
index 0000000..3505119
--- /dev/null
+++ b/scanpages/hj/materials_detail.vue
@@ -0,0 +1,270 @@
+
+
+
+
+ 扫描结果
+
+ {{ info.MaterialCode || '--' }}
+
+
+
+
+
+
+
+
+ 编码
+ {{ info.Code || '--' }}
+
+
+ 炉号
+ {{ info.HeatNo || '--' }}
+
+
+ 批号
+ {{ info.BatchNo || '--' }}
+
+
+ 名称
+ {{ info.MaterialName || '--' }}
+
+
+ 规格
+
+ {{ info.MaterialSpec || '--' }}
+
+
+
+ 单位
+
+ {{ info.MaterialUnit || '--' }}
+
+
+
+
+
+
+
+
+
+ {{ info.MaterialDef }}
+
+
+
+
+
+
+
+
diff --git a/static/images/bg.jpg b/static/images/bg.jpg
new file mode 100644
index 0000000..49a7e54
Binary files /dev/null and b/static/images/bg.jpg differ
diff --git a/static/images/logo.png b/static/images/logo.png
new file mode 100644
index 0000000..c7209b6
Binary files /dev/null and b/static/images/logo.png differ
diff --git a/static/logo.png b/static/logo.png
deleted file mode 100644
index b5771e2..0000000
Binary files a/static/logo.png and /dev/null differ
diff --git a/store/modules/menu.js b/store/modules/menu.js
index f311fed..1fb95d8 100644
--- a/store/modules/menu.js
+++ b/store/modules/menu.js
@@ -17,7 +17,7 @@ export const useMenuStore = defineStore('menu', () => {
const buildAppsList = () => {
return defaultApps.map(app => ({
...app,
- selected: quickAppIds.value.includes(app.menuId)
+ selected: quickAppIds.value.includes(app.path)
}))
}
@@ -62,7 +62,7 @@ export const useMenuStore = defineStore('menu', () => {
// 只持久化快捷应用的 menuId 列表
quickAppIds.value = appsList.value
.filter(app => app.selected)
- .map(app => app.menuId)
+ .map(app => app.path)
}
/**
diff --git a/store/modules/user.js b/store/modules/user.js
index a7ea0f1..55e9b39 100644
--- a/store/modules/user.js
+++ b/store/modules/user.js
@@ -22,8 +22,8 @@ export const useUserStore = defineStore('user', () => {
const currentProject = ref(null)
// 监听 currentProject 变化,获取菜单权限
- watch(() => currentProject.value?.ProjectId, (newId) => {
- if (newId) {
+ watch(() => currentProject.value?.ProjectId, (newId,oldId) => {
+ if (newId!==oldId) {
// 项目变化 请求菜单权限
const menuStore = useMenuStore()
const userId = userInfo.value?.PersonId
diff --git a/utils/constant.js b/utils/constant.js
index a854c0e..8cb14f8 100644
--- a/utils/constant.js
+++ b/utils/constant.js
@@ -49,5 +49,23 @@ export const defaultApps = [{
path: "/pipe/precast/list",
prefix: 'nbd-icon',
selected: false
+ },
+ {
+ name: '下料抽检',
+ icon: 'xialiaochoujianjilu',
+ menuId: "",
+ path: "/scanpages/hj/material_sampling",
+ isScan: true,
+ prefix: 'nbd-icon',
+ selected: false
+ },
+ {
+ name: '组队抽查',
+ icon: 'zudui',
+ menuId: "",
+ path: "/scanpages/hj/make_right",
+ isScan: true,
+ prefix: 'nbd-icon',
+ selected: false
}
]
diff --git a/utils/scanUtils.js b/utils/scanUtils.js
index 08d3be4..e28e7d4 100644
--- a/utils/scanUtils.js
+++ b/utils/scanUtils.js
@@ -1,7 +1,23 @@
import {getUrlParam} from './request'
-export const scanToSkipUrl = (str)=>{
- // 焊接日报跳转
- if(str.includes('weldjoint')){
- return `/pipe/weld/daily_paper?id=${getUrlParam(str,"id")}`
- }
+
+/**
+ * 解析扫码结果,返回跳转页面路径
+ * @param {string} str 扫码结果字符串
+ * @returns {{ path: string, query: string } | null} 返回 { path, query } 或 null(材料编码场景)
+ */
+export const parseScanResult = (str) => {
+ if (!str) return null
+
+ // 焊接接头二维码:https://sggl.sedin.com.cn/StaticPage/HJGL/index.html?id=xxx&weldjoint=1
+ // if (str.includes('weldjoint')) {
+ // const id = getUrlParam(str, 'id')
+ // if (id) {
+ // return { path: '/scanpages/hj/material_sampling', query: `id=${id}` }
+ // }
+ // }
+
+ // 后续可在此扩展其他扫码类型...
+
+ // 非 URL 格式,视为材料编码
+ return null
}
\ No newline at end of file