From b12f66d871593ec6f8e28aa63e45dbd92aab760b Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 11 四月 2023 15:54:36 +0800
Subject: [PATCH] 1.制造模型、采购管理模块下的动态列表完成
---
src/views/makeModel/processRoute.vue | 227 +++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 167 insertions(+), 60 deletions(-)
diff --git a/src/views/makeModel/processRoute.vue b/src/views/makeModel/processRoute.vue
index 89c4c18..572ae4c 100644
--- a/src/views/makeModel/processRoute.vue
+++ b/src/views/makeModel/processRoute.vue
@@ -40,8 +40,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
class="tableFixed"
:data="tableData"
:height="tableHeight"
@@ -53,69 +58,98 @@
:cell-style="this.$cellStyle"
@sort-change="sortChange"
>
+
+ <el-table-column
+ v-for="item in tableColumnSettingsArray"
+ v-if="item.show"
+ :key="item.id"
+ :sortable="item.sortable"
+ :prop="item.prop"
+ :min-width="item.minWidth"
+ :label="item.label"
+ :width="item.width"
+ show-tooltip-when-overflow
+ :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
+ >
+ <template slot-scope="{row}">
+ <div v-if="!row[item.prop]">/</div>
+ <div v-else-if="item.prop==='enable'">
+ <div v-if="row[item.prop]==='Y'">
+ <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+ 鏄�
+ </div>
+ <div v-if="row[item.prop]==='N'">
+ <i class="el-icon-info" style="margin-right: 2px" />
+ 鍚�
+ </div>
+ </div>
+ <div v-else>{{ row[item.prop] }}</div>
+ </template>
+ </el-table-column>
+
<!-- <el-table-column-->
<!-- type="selection"-->
<!-- width="50"-->
<!-- />-->
- <el-table-column
- prop="RowNum"
- width="50"
- label="搴忓彿"
- fixed
- />
- <el-table-column
- prop="code"
- label="缂栫爜"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="name"
- show-tooltip-when-overflow
- label="鍚嶇О"
- sortable="custom"
- />
- <el-table-column
- prop="description"
- label="宸ヨ壓璺嚎鎻忚堪"
- sortable="custom"
- show-tooltip-when-overflow
- >
- <template slot-scope="{row}">
- <div v-if="row.description">{{ row.description }}</div>
- <div v-else>/</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="enable"
- show-tooltip-when-overflow
- label="浣跨敤鐘舵��"
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.enable==='Y'">
- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
- 鏄�
- </div>
- <div v-if="row.enable==='N'">
- <i class="el-icon-info" style="margin-right: 2px" />
- 鍚�
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="lm_user"
- show-tooltip-when-overflow
- label="鍒涘缓浜哄憳"
- sortable="custom"
- />
- <el-table-column
- prop="lm_date"
- label="鍒涘缓鏃堕棿"
- show-tooltip-when-overflow
- sortable="custom"
- width="160"
- />
+ <!-- <el-table-column-->
+ <!-- prop="RowNum"-->
+ <!-- width="50"-->
+ <!-- label="搴忓彿"-->
+ <!-- fixed-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="code"-->
+ <!-- label="缂栫爜"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="name"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- label="鍚嶇О"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="description"-->
+ <!-- label="宸ヨ壓璺嚎鎻忚堪"-->
+ <!-- sortable="custom"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.description">{{ row.description }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="enable"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- label="浣跨敤鐘舵��"-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.enable==='Y'">-->
+ <!-- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
+ <!-- 鏄�-->
+ <!-- </div>-->
+ <!-- <div v-if="row.enable==='N'">-->
+ <!-- <i class="el-icon-info" style="margin-right: 2px" />-->
+ <!-- 鍚�-->
+ <!-- </div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_user"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- label="鍒涘缓浜哄憳"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_date"-->
+ <!-- label="鍒涘缓鏃堕棿"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- width="160"-->
+ <!-- />-->
<el-table-column
label="鎿嶄綔"
width="120"
@@ -314,11 +348,12 @@
import { validateCode } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
+import TableColumnSettings from '@/components/TableColumnSettings'
export default {
name: 'GYLX',
components: {
- Pagination
+ Pagination, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -342,6 +377,71 @@
],
total: 10,
tableData: [],
+ tableColumnSettingsArray: [
+ { minWidth: 50, width: false, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: 25, width: 50, prop: 'RowNum', label: '搴忓彿', id: 2, show: true, fixed: 'left', sortable: false }, // custom
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'code',
+ label: '缂栫爜',
+ id: 3,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'name',
+ label: '鍚嶇О',
+ id: 4,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 330,
+ width: false,
+ prop: 'description',
+ label: '宸ヨ壓璺嚎鎻忚堪',
+ id: 5,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'enable',
+ label: '浣跨敤鐘舵��',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'lm_user',
+ label: '鍒涘缓浜哄憳',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 160,
+ width: false,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
dialogVisible: false,
dialogForm: {
id: '',
@@ -390,6 +490,13 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+ this.$refs.tableDataRef.doLayout()
+ },
// 杩滅▼鎼滅储
querySearch(queryString, cb) {
const routeArr = this.routeArr
--
Gitblit v1.9.3