|
@@ -126,12 +126,12 @@
|
|
|
v-if="detailData.resultList?.length > 0"
|
|
v-if="detailData.resultList?.length > 0"
|
|
|
ref="table"
|
|
ref="table"
|
|
|
:needPage="false"
|
|
:needPage="false"
|
|
|
- :columns="columns"
|
|
|
|
|
|
|
+ :columns="qcColumns"
|
|
|
:toolkit="[]"
|
|
:toolkit="[]"
|
|
|
:datasource="detailData.resultList"
|
|
:datasource="detailData.resultList"
|
|
|
row-key="id"
|
|
row-key="id"
|
|
|
height="300px"
|
|
height="300px"
|
|
|
- @header-dragend="handleHeaderDragend"
|
|
|
|
|
|
|
+ @header-dragend="onQcHeaderDragend"
|
|
|
>
|
|
>
|
|
|
<template v-slot:technicalDrawings="{ row }">
|
|
<template v-slot:technicalDrawings="{ row }">
|
|
|
<fileMain v-model="row.technicalDrawings" type="view"></fileMain>
|
|
<fileMain v-model="row.technicalDrawings" type="view"></fileMain>
|
|
@@ -201,12 +201,32 @@
|
|
|
created() {
|
|
created() {
|
|
|
this.requestDict('产地');
|
|
this.requestDict('产地');
|
|
|
this.requestDict('生产类型');
|
|
this.requestDict('生产类型');
|
|
|
|
|
+ // 副表(质检清单)列宽缓存,独立 key
|
|
|
|
|
+ this.loadScopedColumnWidth('qc');
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ // 主表:收货单物品清单(v=1)
|
|
|
|
|
+ // 标准 mixin 列宽持久化流程:列宽由 cacheKeyUrl+'Cols' 缓存 + applyColumnWidth 应用
|
|
|
columns() {
|
|
columns() {
|
|
|
- // 标准 mixin 列宽持久化流程:列宽由 cacheKeyUrl+'Cols' 缓存 + applyColumnWidth 应用
|
|
|
|
|
this.columnsVersion; // mixin 触发重算
|
|
this.columnsVersion; // mixin 触发重算
|
|
|
- return this.applyColumnWidth([
|
|
|
|
|
|
|
+ return this.applyColumnWidth(
|
|
|
|
|
+ this.buildColumns(1).filter((col) => col.show !== false)
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ // 副表:质检清单(v=2)——独立 scope 缓存,避免与主表列宽互相污染
|
|
|
|
|
+ qcColumns() {
|
|
|
|
|
+ this.columnsVersion; // mixin 触发重算
|
|
|
|
|
+ return this.applyScopedColumnWidth(
|
|
|
|
|
+ this.buildColumns(2).filter((col) => col.show !== false),
|
|
|
|
|
+ 'qc'
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ // 列定义工厂:v=1 收货单物品清单,v=2 质检清单
|
|
|
|
|
+ // show: v != 2 → 只在物品清单显示;show: v == 2 → 只在质检清单显示
|
|
|
|
|
+ buildColumns(v) {
|
|
|
|
|
+ return [
|
|
|
{
|
|
{
|
|
|
width: 45,
|
|
width: 45,
|
|
|
type: 'index',
|
|
type: 'index',
|
|
@@ -665,10 +685,16 @@
|
|
|
: '';
|
|
: '';
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- ]);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
|
|
+ ];
|
|
|
|
|
+ },
|
|
|
|
|
+ // 质检清单(副表)表头拖拽列宽:只写本表 scope 的本地缓存,不污染主表列配置
|
|
|
|
|
+ onQcHeaderDragend(newWidth, oldWidth, column) {
|
|
|
|
|
+ this.persistScopedColumnWidth(
|
|
|
|
|
+ 'qc',
|
|
|
|
|
+ column && (column.property || column.columnKey),
|
|
|
|
|
+ newWidth
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
async open(row) {
|
|
async open(row) {
|
|
|
this.form = row;
|
|
this.form = row;
|
|
|
this.activeComp = 'main';
|
|
this.activeComp = 'main';
|