diff --git a/.gitignore b/.gitignore index 9217064..5617b0b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ node_modules/ *.sln # GitNexus本地图谱不提交,刷新后可重新生成 - rqrq .gitnexus +.claude +/CLAUDE.md +/AGENTS.md diff --git a/src/views/modules/haianWarehouse/automatedWarehouse/autoIssueTask54.vue b/src/views/modules/haianWarehouse/automatedWarehouse/autoIssueTask54.vue index 840e9a7..668fbcc 100644 --- a/src/views/modules/haianWarehouse/automatedWarehouse/autoIssueTask54.vue +++ b/src/views/modules/haianWarehouse/automatedWarehouse/autoIssueTask54.vue @@ -1,7 +1,7 @@ @@ -179,6 +182,7 @@ export default { totalPage: 0, dataListLoading: false, height: 280, + detailHeight: 220, currentTask: {}, activeTab: 'label', labelList: [], @@ -188,15 +192,56 @@ export default { } }, mounted () { - this.$nextTick(() => { - this.height = Math.max(220, window.innerHeight - 460) - }) + // 跟随窗口与查询区换行重算高度;观察查询区避免表格自身高度变化触发循环 - rqrq + window.addEventListener('resize', this.updateTableHeights) + if (window.ResizeObserver) { + this.queryResizeObserver = new window.ResizeObserver(this.updateTableHeights) + this.queryResizeObserver.observe(this.$refs.queryForm.$el) + } + this.updateTableHeights() }, activated () { + // keep-alive 页面重新显示时恢复真实尺寸,再按当前工厂查询 - rqrq + this.updateTableHeights() this.queryData.site = this.$store.state.user.site this.getDataList() }, + beforeDestroy () { + // 释放窗口与尺寸观察监听,避免关闭页签后继续访问已销毁表格 - rqrq + window.removeEventListener('resize', this.updateTableHeights) + if (this.queryResizeObserver) { + this.queryResizeObserver.disconnect() + } + }, methods: { + // 扣除查询区、分页、边距后,主表与下方页签各占一半;详情表扣除页签头,数据在表内滚动 - rqrq + updateTableHeights () { + this.$nextTick(() => { + if (this._isDestroyed || !this.$el.offsetWidth || !this.$refs.mainTable) { + return + } + const pagination = this.$refs.pagination.$el + const paginationStyle = window.getComputedStyle(pagination) + const panelStyle = window.getComputedStyle(this.$refs.detailPanel) + const tabHeader = this.$refs.detailTabs.$el.querySelector('.el-tabs__header') + const headerStyle = window.getComputedStyle(tabHeader) + const number = value => parseFloat(value) || 0 + const paginationHeight = pagination.offsetHeight + number(paginationStyle.marginTop) + number(paginationStyle.marginBottom) + const panelSpacing = number(panelStyle.marginTop) + number(panelStyle.marginBottom) + const availableHeight = window.innerHeight - this.$refs.mainTable.$el.getBoundingClientRect().top - paginationHeight - panelSpacing - 20 + this.height = Math.max(140, Math.floor(availableHeight / 2)) + const panelPadding = number(panelStyle.paddingTop) + number(panelStyle.paddingBottom) + number(panelStyle.borderTopWidth) + number(panelStyle.borderBottomWidth) + const headerHeight = tabHeader.offsetHeight + number(headerStyle.marginTop) + number(headerStyle.marginBottom) + this.detailHeight = Math.max(60, this.height - panelPadding - headerHeight) + // 切换页签后重排当前表格,防止隐藏页签首次显示时列宽或滚动条错位 - rqrq + this.$nextTick(() => { + if (this._isDestroyed) return + this.$refs.mainTable.doLayout() + const detailTable = this.activeTab === 'move' ? this.$refs.moveTable : this.$refs.labelTable + if (detailTable) detailTable.doLayout() + }) + }) + }, // 查询主表:先写 site 再请求,失败清空列表避免展示过期数据 - rqrq getDataList () { if (this.dataListLoading) { @@ -324,9 +369,12 @@ export default { }) }, clearDetail () { + // 清空选择后旧请求会被任务ID校验忽略,固定详情区的 loading 必须同步复位 - rqrq this.currentTask = {} this.labelList = [] this.moveList = [] + this.labelListLoading = false + this.moveListLoading = false }, formatCount (value) { if (value === null || value === undefined || value === '') { @@ -367,13 +415,13 @@ export default { } return '' }, - // 发料状态来自任务标签:P 已开始请求、U 待核实,均不能显示成未发料 - rqrq + // 发料展示统一四态;P请求已开始、U结果待核实均为处理中,U另有悬浮提示,后台防重语义保留 - rqrq getIssueFlagLabel (flag) { if (flag === 'P') { - return '请求已开始' + return '处理中' } if (flag === 'U') { - return '待核实' + return '处理中' } if (flag === 'S') { return '成功' @@ -381,7 +429,7 @@ export default { if (flag === 'F') { return '失败' } - return '未发' + return '未发料' }, // 不确定状态使用警示色,提示先核实 IFS,禁止据此自动补发 - rqrq getIssueFlagTag (flag) { @@ -425,26 +473,9 @@ export default { padding: 10px; border: 1px solid #ebeef5; background: #fff; + box-sizing: border-box; } -.detail-empty { - color: #909399; - padding: 16px 0; - text-align: center; -} -.detail-header { - margin-bottom: 8px; - line-height: 22px; -} -.detail-error { - color: #F56C6C; - margin-bottom: 8px; -} -.detail-tip { - margin-top: 8px; - color: #909399; - font-size: 12px; -} -/deep/ .el-table .error-row { + /deep/ .el-table .error-row { background: #fef0f0; }