refactor(物料管理): 移除表格列冗余的show-overflow-tooltip属性并调整列可见性

移除el-table-column中重复的show-overflow-tooltip属性,简化代码
将columns数组中多个列的visible属性从false改为true以显示更多列
This commit is contained in:
2025-12-31 15:29:23 +08:00
parent 5132b24a37
commit fb7b633420

View File

@@ -39,21 +39,21 @@
highlight-current-row
@sort-change="sortChange">
<el-table-column prop="id" label="主键ID" align="center" v-if="columns.showColumn('id')" />
<el-table-column prop="inboundNo" label="入库单号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('inboundNo')" />
<el-table-column prop="materialCode" label="物料编码" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('materialCode')" />
<el-table-column prop="materialName" label="物料名称" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('materialName')" />
<el-table-column prop="locationCode" label="库位编码" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('locationCode')" />
<el-table-column prop="locationName" label="库位名称" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('locationName')" />
<el-table-column prop="inboundNo" label="入库单号" align="center" v-if="columns.showColumn('inboundNo')" />
<el-table-column prop="materialCode" label="物料编码" align="center" v-if="columns.showColumn('materialCode')" />
<el-table-column prop="materialName" label="物料名称" align="center" v-if="columns.showColumn('materialName')" />
<el-table-column prop="locationCode" label="库位编码" align="center" v-if="columns.showColumn('locationCode')" />
<el-table-column prop="locationName" label="库位名称" align="center" v-if="columns.showColumn('locationName')" />
<el-table-column prop="quantity" label="入库数量" align="center" v-if="columns.showColumn('quantity')" />
<el-table-column prop="transactionType" label="入库类型" align="center" v-if="columns.showColumn('transactionType')">
<template #default="scope">
<dict-tag :options="options.transactionTypeOptions" :value="scope.row.transactionType" />
</template>
</el-table-column>
<el-table-column prop="locationCode" label="库位编码" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('locationCode')" />
<el-table-column prop="batchNo" label="批次号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('batchNo')" />
<el-table-column prop="operator" label="操作员" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('operator')" />
<el-table-column prop="createdTime" label="创建时间" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
<el-table-column prop="locationCode" label="库位编码" align="center" v-if="columns.showColumn('locationCode')" />
<el-table-column prop="batchNo" label="批次号" align="center" v-if="columns.showColumn('batchNo')" />
<el-table-column prop="operator" label="操作员" align="center" v-if="columns.showColumn('operator')" />
<el-table-column prop="createdTime" label="创建时间" v-if="columns.showColumn('createdTime')" />
<el-table-column label="操作" width="160">
<template #default="scope">
<el-button
@@ -365,17 +365,17 @@ const columns = ref([
{ visible: true, align: 'center', type: '', prop: 'supplierCode', label: '供应商编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'expiryDate', label: '有效期至', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'productionDate', label: '生产日期', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'batchNo', label: '批次号', showOverflowTooltip: true },
{ visible: false, align: 'center', type: 'dict', prop: 'transactionType', label: '入库类型', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'id', label: '主键ID' },
{ visible: false, align: 'center', type: '', prop: 'quantity', label: '入库数量' },
{ visible: false, align: 'center', type: '', prop: 'locationName', label: '库位名称', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'locationCode', label: '库位编码', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'warehouseName', label: '仓库名称', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'warehouseCode', label: '仓库编码', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'materialName', label: '物料名称', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'materialCode', label: '物料编码', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'inboundNo', label: '入库单号', showOverflowTooltip: true }
{ visible: true, align: 'center', type: '', prop: 'batchNo', label: '批次号', showOverflowTooltip: true },
{ visible: true, align: 'center', type: 'dict', prop: 'transactionType', label: '入库类型', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'id', label: '主键ID' },
{ visible: true, align: 'center', type: '', prop: 'quantity', label: '入库数量' },
{ visible: true, align: 'center', type: '', prop: 'locationName', label: '库位名称', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'locationCode', label: '库位编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'warehouseName', label: '仓库名称', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'warehouseCode', label: '仓库编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'materialName', label: '物料名称', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'materialCode', label: '物料编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'inboundNo', label: '入库单号', showOverflowTooltip: true }
//{ visible: false, prop: 'actions', label: '操作', type: 'slot', width: '160' }
])
const total = ref(0)