feat(wms报表): 添加列设置功能并重构表格组件
引入可配置的列设置功能,允许用户自定义表格显示列 创建CoilTable通用组件替换原有表格实现 添加列设置对话框和默认列配置初始化逻辑
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
<el-form-item prop="endTime">
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -56,40 +57,14 @@
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -101,7 +76,8 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
name: 'OutTemplate',
|
||||
@@ -112,6 +88,8 @@ export default {
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
props: {
|
||||
baseQueryParams: {
|
||||
@@ -147,6 +125,8 @@ export default {
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00`
|
||||
return {
|
||||
activeColumnConfig: 'coil-report-output',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -173,6 +153,8 @@ export default {
|
||||
'2019583429955104769',
|
||||
'2019583137616310273',
|
||||
],
|
||||
|
||||
outputColumns: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -200,6 +182,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
},
|
||||
// 统一查询入口
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
Promise.all([
|
||||
@@ -242,6 +232,10 @@ export default {
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user