From 4c4fe478fabb409c904802d53f121db090ec3dca Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 25 二月 2026 14:44:30 +0800
Subject: [PATCH] 业务管理:1.原材料标签打印内容调整;2.成品抽样页面优化;3.页面刷新保留筛选条件
---
src/components/Table/lims-table.vue | 39 ++++++++++++++++++++++++++-------------
1 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index cb4eb0f..6e3cec6 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -4,7 +4,7 @@
<el-table ref="multipleTable" v-loading="tableLoading" :border="border" :data="tableData"
:header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" :height="height"
:highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="rowStyle"
- :row-key="rowKey" :span-method="spanMethod" stripe style="width: 100%" tooltip-effect="dark" @row-click="rowClick"
+ :row-key="rowKey" :span-method="spanMethod" :show-summary="showSummary" :summary-method="summaryMethod" stripe style="width: 100%" tooltip-effect="dark" @row-click="rowClick"
@current-change="currentChange" @selection-change="handleSelectionChange" class="lims-table">
<el-table-column align="center" type="selection" width="55" v-if="isSelection" />
<el-table-column align="center" label="搴忓彿" type="index" width="60" :index="indexMethod" />
@@ -70,7 +70,7 @@
:disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain"
:style="{ color: o.name === '鍒犻櫎' ? '#f56c6c' : o.color }" :type="o.type | typeFn(scope.row)"
@click="o.clickFun(scope.row)" :key="key">
- {{ o.name }}
+ {{ typeof o.name === 'function'? o.name(scope.row) : o.name }}
</el-button>
<el-upload :action="javaApi + o.url + '?id=' + (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)"
:key="uploadKeys[scope.$index]"
@@ -260,6 +260,14 @@
};
},
},
+ showSummary: {
+ type: Boolean,
+ default: false
+ },
+ summaryMethod: {
+ type: Function,
+ default: null
+ }
},
data() {
return {
@@ -284,9 +292,13 @@
watch: {
tableData: {
handler() {
- // 褰撹〃鏍兼暟鎹彉鍖栨椂锛屽垵濮嬪寲 uploadKeys
this.tableData.forEach((_, index) => {
this.$set(this.uploadKeys, index, Date.now());
+ });
+ this.$nextTick(() => {
+ if (this.$refs.multipleTable) {
+ this.$refs.multipleTable.doLayout();
+ }
});
},
immediate: true
@@ -302,8 +314,8 @@
count += a.name.length;
}
});
- this.btnWidth = count * 18 + 60 + "px";
- return count * 18 + 60 + "px";
+ this.btnWidth = count * 15 + 60 + "px";
+ return count * 15 + 60 + "px";
},
getTitleWidth(row) {
if (row.label.includes('鏃堕棿') || row.label.includes('缂栧彿') || row.label.includes('鏍峰搧鍚嶇О') || row.label.includes('闆朵欢')) {
@@ -323,8 +335,6 @@
iconFn(row) {
if (row.name === "缂栬緫" || row.name === "淇敼") {
return "el-icon-edit";
- } else if (row.name === "鍒犻櫎") {
- return "el-icon-delete";
} else if (row.name === "鏌ョ湅") {
return "el-icon-view";
} else {
@@ -473,7 +483,7 @@
</script>
<style scoped>
-.el-table>>>.el-table__empty-text {
+.el-table ::v-deep .el-table__empty-text {
text-align: center;
}
@@ -481,7 +491,7 @@
color: rgb(64, 158, 255);
cursor: pointer;
}
->>>.cell {
+::v-deep .cell {
padding: 0 !important;
}
.cell {
@@ -492,19 +502,22 @@
padding-left: 10px !important;
}
-.lims-table .highlight-warning-row-border td:first-child {
+.lims-table >>>.highlight-warning-row-border td:first-child {
border-left: 4px solid #ffcd29;
}
-.lims-table .highlight-warning-row-border td:last-child {
+.lims-table >>>.highlight-warning-row-border td:last-child {
border-right: 4px solid #ffcd29;
}
-.lims-table .highlight-danger-row-border td:first-child {
+.lims-table >>>.highlight-danger-row-border td:first-child {
border-left: 4px solid #f56c6c;
}
-.lims-table .highlight-danger-row-border td:last-child {
+.lims-table >>>.highlight-danger-row-border td:last-child {
border-right: 4px solid #f56c6c;
}
+>>>.red-row td {
+ background: #FFCCCC !important;
+}
</style>
--
Gitblit v1.9.3