打印条码页面样式修改

This commit is contained in:
猫猫guowen
2025-09-15 10:33:41 +08:00
parent 78532dd751
commit 6cf3d4220f

View File

@@ -48,31 +48,16 @@
<!-- 右侧预览区域 --> <!-- 右侧预览区域 -->
<el-col :span="16"> <el-col :span="16">
<div class="preview-container"> <!-- 预览弹框 -->
<div class="section-header"> <el-dialog
<h3>标签预览</h3> title="标签预览"
<div class="header-actions"> :visible.sync="showPreview"
<el-button width="900px"
type="primary" :close-on-click-modal="false"
@click="submitForm" append-to-body
:disabled="!showPreview" >
:loading="submitLoading" <div class="preview-container">
icon="el-icon-printer" <div class="label-content">
>
保存并打印
</el-button>
</div>
</div>
<!-- 空状态提示 -->
<div v-show="!showPreview" class="empty-preview">
<i class="el-icon-document"></i>
<p>点击"预览"按钮查看标签效果</p>
</div>
<!-- 预览显示区域 -->
<div v-show="showPreview" class="preview-display">
<div class="label-content">
<div class="preview-box"> <div class="preview-box">
<div class="preview-content"> <div class="preview-content">
<div class="preview-row"> <div class="preview-row">
@@ -183,11 +168,15 @@
</div> </div>
</div> </div>
</vue-easy-print> </vue-easy-print>
</div> <div slot="footer" class="dialog-footer">
<el-button @click="showPreview = false">关 闭</el-button>
<el-button type="primary" @click="submitForm" :loading="submitLoading">保存并打印</el-button>
</div>
</el-dialog>
<!-- 历史数据区域 --> <!-- 历史数据区域 -->
<div class="list-container"> <div class="list-container" style="padding-bottom: 60px;">
<div class="section-header"> <div class="section-header" style="margin-bottom: 40px;">
<h3>历史数据</h3> <h3>历史数据</h3>
<div class="header-actions"> <div class="header-actions">
<el-button <el-button
@@ -209,7 +198,8 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
stripe stripe
border border
> style="width: 100%;margin-bottom: 40px;height: 550px;"
>
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>
<el-table-column <el-table-column
v-for="column in tableColumns" v-for="column in tableColumns"
@@ -269,22 +259,22 @@ const FORM_FIELDS = [
] ]
const TABLE_COLUMNS = [ const TABLE_COLUMNS = [
{ prop: 'model', label: '型号', width: 100 }, { prop: 'model', label: '型号', width: 120 },
{ prop: 'color', label: '颜色', width: 80 }, { prop: 'color', label: '颜色', width: 100 },
{ prop: 'serial', label: '序列号', width: 120 }, { prop: 'serial', label: '序列号', width: 150 },
{ prop: 'v', label: '电压', width: 80 }, { prop: 'v', label: '电压', width: 100 },
{ prop: 'hz', label: '功率', width: 80 }, { prop: 'hz', label: '功率', width: 100 },
{ prop: 'ph', label: '相位', width: 80 }, { prop: 'ph', label: '相位', width: 100 },
{ prop: 'nW', label: '净重', width: 80 }, { prop: 'nW', label: '净重', width: 100 },
{ prop: 'gW', label: '毛重', width: 80 }, { prop: 'gW', label: '毛重', width: 100 },
{ {
prop: 'type', prop: 'type',
label: '状态', label: '状态',
width: 80, width: 100,
formatter: (row) => row.type === '1' ? '未打印' : '已打印' formatter: (row) => row.type === '1' ? '未打印' : '已打印'
}, },
{ prop: 'spare1', label: '订单号', width: 120 }, { prop: 'spare1', label: '订单号', width: 150 },
{ prop: 'spare2', label: '机型', width: 100 }, { prop: 'spare2', label: '机型', width: 120 },
{ prop: 'spare3', label: '分箱', width: 100 } { prop: 'spare3', label: '分箱', width: 100 }
] ]
@@ -471,7 +461,7 @@ export default {
handleEdit(row) { handleEdit(row) {
this.form = { ...row } this.form = { ...row }
this.previewData = { ...row } this.previewData = { ...row }
this.showPreview = true // this.showPreview = true
}, },
// 删除按钮操作 // 删除按钮操作
@@ -616,6 +606,43 @@ export default {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.list-container {
background: #fff;
padding: 20px;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.section-header h3 {
margin: 0;
font-size: 16px;
font-weight: 500;
}
.header-actions {
display: flex;
gap: 10px;
}
.el-table {
margin-bottom: 20px;
}
.el-table .danger-text {
color: #F56C6C;
}
.el-table .danger-text:hover {
color: #f78989;
}
/* 容器样式 */ /* 容器样式 */
.form-container, .form-container,
.list-container, .list-container,
@@ -630,10 +657,36 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
} }
.list-container { .preview-container {
margin-bottom: 20px; padding: 20px;
height: 400px; }
overflow-y: auto;
.preview-box {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 20px;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
.preview-content {
flex: 1;
margin-right: 20px;
}
.preview-row {
margin-bottom: 15px;
}
.preview-label {
font-weight: bold;
margin-right: 10px;
}
.qrcode-container {
width: 180px;
height: 180px;
} }
.list-container .el-table { .list-container .el-table {