diff --git a/src/api/l2/stop.js b/src/api/l2/stop.js index a2f77ee..113d8c4 100644 --- a/src/api/l2/stop.js +++ b/src/api/l2/stop.js @@ -83,4 +83,15 @@ export function getStoppageSummary(data) { data, url: '/api/stoppage/calc' }) +} + +/** + * 查询停机类型 + * @returns + */ +export function listStoppageTypes() { + return l2Request({ + method: 'get', + url: '/api/stoppage/types' + }) } \ No newline at end of file diff --git a/src/views/l2/pdo/index.vue b/src/views/l2/pdo/index.vue index 4c878a1..e1aa46a 100644 --- a/src/views/l2/pdo/index.vue +++ b/src/views/l2/pdo/index.vue @@ -32,6 +32,8 @@ Print + Print Tag Edit @@ -155,6 +157,17 @@ + + + +
+ +
+ +
@@ -166,6 +179,7 @@ import PdoDataCorrection from './components/DataCorrection.vue' import PdoLabelPrint from './components/LabelPrint.vue' import PdoSummary from './components/PdoSummary.vue' import QualityCertificate from './components/QualityCertificate.vue' +import MaterialTag from '../plan/components/MaterialTag.vue' export default { name: 'PdoManagement', @@ -175,7 +189,8 @@ export default { PdoDataCorrection, // 注册数据修正组件 PdoLabelPrint, // 注册标签打印组件 PdoSummary, - QualityCertificate // 注册质保书组件 + QualityCertificate, // 注册质保书组件 + MaterialTag }, data() { return { @@ -184,6 +199,8 @@ export default { total: 0, printOpen: false, certificateVisible: false, // 质保书对话框显示状态 Quality certificate dialog visibility state + printTagDialogVisible: false, + printTagContent: null, tableData: [], tableLoading: false, btnLoading: false, @@ -287,6 +304,75 @@ export default { this.formData = JSON.parse(JSON.stringify(row)); this.printOpen = true }, + handlePrintTag(row) { + if (!row) return + // 将 PDO 字段映射到 MaterialTag 期望字段 + this.printTagContent = { + planid: row.planId || row.planid || '', + coilid: row.exitMatId || row.coilid || '', + steelGrade: row.steelGrade || '', + status: row.status || '', + entryThick: row.entryThick, + entryWidth: row.entryWidth, + entryLength: row.entryLength, + entryWeight: row.entryWeight, + exitThick: row.exitThickness, + exitWidth: row.exitWidth, + exitLength: row.exitLength, + exitWeight: row.exitNetWeight, + yieldPoint: row.yieldPoint, + orderNo: row.orderNo || '' + } + this.printTagDialogVisible = true + }, + doPrintTag() { + this.$nextTick(() => { + this.printElementOnly(this.$refs.printTagRef) + }) + }, + printElementOnly(el) { + if (!el) return + + const printWindow = window.open('', '_blank', 'noopener,noreferrer') + if (!printWindow) { + this.$message && this.$message.error('Failed to open print window') + return + } + + const styles = Array.from(document.querySelectorAll('link[rel="stylesheet"], style')) + .map(node => node.outerHTML) + .join('\n') + + const html = '' + + '' + + '' + + '' + + '' + + 'Print' + + styles + + '' + + '' + + '' + + '
' + el.innerHTML + '
' + + ' + + diff --git a/src/views/l2/plan/index.vue b/src/views/l2/plan/index.vue index 9059cb2..6ad56ed 100644 --- a/src/views/l2/plan/index.vue +++ b/src/views/l2/plan/index.vue @@ -61,6 +61,9 @@ Delete + + Print Tag + @@ -128,6 +131,7 @@
+
@@ -229,6 +233,17 @@ + + +
+ +
+ +
+ @@ -366,6 +381,7 @@ import SetupForm from './components/setupForm.vue' import SetupPane from './components/setupPane.vue' import PlanRecommendPanel from './components/PlanRecommendPanel.vue' import ProcessRecommendPanel from './components/ProcessRecommendPanel.vue' +import MaterialTag from './components/MaterialTag.vue' // 标准日期格式化方法(优化时间处理逻辑,适配接口日期格式) function parseTime(time, format = "{yyyy}-{mm}-{dd} {hh}:{ii}:{ss}") { @@ -397,7 +413,7 @@ function parseTime(time, format = "{yyyy}-{mm}-{dd} {hh}:{ii}:{ss}") { }; // 补零格式化(确保月/日/时/分/秒为两位数) - return format.replace(/{([ymdhisa])+}/g, (result, key) => { + return format.replace(/{([ymdhisa])+}/g, (_result, key) => { const value = formatObj[key]; return value.toString().length < 2 ? "0" + value : value; }); @@ -409,7 +425,8 @@ export default { SetupForm, SetupPane, PlanRecommendPanel, - ProcessRecommendPanel + ProcessRecommendPanel, + MaterialTag }, data() { return { @@ -434,6 +451,8 @@ export default { planList: [], loading: false, btnLoading: false, + printTagDialogVisible: false, + printTagContent: null, // 弹窗状态(新增/编辑弹窗显隐+标题) Dialog state (add/edit dialog visibility + title) dialogVisible: false, dialogTitle: "Add Plan", // 新增计划 @@ -647,6 +666,59 @@ export default { if (!this.$refs.setupFormRef) return this.$refs.setupFormRef.applyAll() }, + handlePrintTag(plan) { + if (!plan) return + this.printTagContent = { ...plan } + this.printTagDialogVisible = true + }, + doPrintTag() { + this.$nextTick(() => { + this.printElementOnly(this.$refs.printTagRef) + }) + }, + printElementOnly(el) { + if (!el) return + + const printWindow = window.open('', '_blank', 'noopener,noreferrer') + if (!printWindow) { + this.$message && this.$message.error('Failed to open print window') + return + } + + const styles = Array.from(document.querySelectorAll('link[rel="stylesheet"], style')) + .map(node => node.outerHTML) + .join('\n') + + const html = '' + + '' + + '' + + '' + + '' + + 'Print' + + styles + + '' + + '' + + '' + + '
' + el.innerHTML + '
' + + '