fix(wms/coil/materialWarning): 优化标签打印逻辑,格式化更新时间
重构打印标签的处理流程,直接调用子组件打印方法替代手动操作DOM,同时将更新时间格式化为年月日格式
This commit is contained in:
@@ -334,16 +334,13 @@ export default {
|
||||
|
||||
/** 打印标签 */
|
||||
handlePrintLabel(row) {
|
||||
this.labelRender.data = row;
|
||||
this.labelRender.type = getCoilTagPrintType(row);
|
||||
this.labelRender.data = {
|
||||
...row,
|
||||
updateTime: row.updateTime?.split(' ')[0] || '',
|
||||
};
|
||||
this.$nextTick(() => {
|
||||
const el = this.$refs.labelRender && this.$refs.labelRender.$el;
|
||||
if (el) {
|
||||
el.style.display = 'block';
|
||||
window.print();
|
||||
el.style.display = 'none';
|
||||
}
|
||||
});
|
||||
this.$refs.labelRender.printLabel();
|
||||
})
|
||||
},
|
||||
|
||||
handleExport() {
|
||||
|
||||
Reference in New Issue
Block a user