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 || '--'}} - + + 项目管道实时预制率 (包含工厂和现场的预制口) + {{ hjIndexData?.PipePrefabricationRate || '--'}} - - 项目管道实时预制率 (包含工厂和现场的预制口) - {{ hjIndexData?.PipePrefabricationRate || '--'}} - - - - - - - - 快捷应用 - - - - - - - + + + + + + 快捷应用 - {{ 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 @@ + + + + + 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 @@ +