From aae53f420a50b06095d25989da1e59d2deaaab87 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 11 四月 2023 10:00:34 +0800
Subject: [PATCH] 1.设备管理模块动态列表完成
---
src/views/deviceManager/maintainPosition.vue | 220 +++++--
src/views/deviceManager/checkRecord.vue | 227 +++++--
src/views/deviceManager/checkStandard.vue | 202 ++++--
src/views/deviceManager/maintainStandard.vue | 188 ++++--
src/views/deviceManager/checkPosition.vue | 267 ++++++--
src/views/basicSettings/organizationList.vue | 5
src/views/deviceManager/maintainRecord.vue | 252 +++++---
src/views/deviceManager/repairRecord.vue | 271 ++++++---
8 files changed, 1,072 insertions(+), 560 deletions(-)
diff --git a/src/views/basicSettings/organizationList.vue b/src/views/basicSettings/organizationList.vue
index ee40e34..04678a1 100644
--- a/src/views/basicSettings/organizationList.vue
+++ b/src/views/basicSettings/organizationList.vue
@@ -466,16 +466,11 @@
},
methods: {
tableColumnUpdate(val, isCopyTrue) {
- console.log(val, isCopyTrue, 1111)
if (isCopyTrue) {
this.tableColumnSettingsArray = val
}
-
this.tableTimeStampKey = new Date().getTime()
-
- // this.$nextTick(() => {
this.$refs.tableDataRef.doLayout()
- // })
},
async getOrganizationSearch() {
const res = await OrganizationSearch(this.form)
diff --git a/src/views/deviceManager/checkPosition.vue b/src/views/deviceManager/checkPosition.vue
index fc6df39..b0e661b 100644
--- a/src/views/deviceManager/checkPosition.vue
+++ b/src/views/deviceManager/checkPosition.vue
@@ -73,8 +73,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
:data="tableData"
:height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
border
@@ -86,83 +91,113 @@
: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==='cycle'">{{ cycleArr.find(i=>i.code===row[item.prop]).name }}</div>
+ <div v-else-if="item.prop==='isscan'">
+ <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"
- fixed
- label="搴忓彿"
- />
- <el-table-column
- prop="code"
- label="閮ㄤ綅缂栫爜"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="name"
- label="閮ㄤ綅鍚嶇О"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="description"
- label="鐐规瑕佹眰"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.description">{{ row.description }}</div>
- <div v-else>/</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="isscan"
- label="閫夋嫨鎵爜"
- sortable="custom"
- show-tooltip-when-overflow
- >
- <template slot-scope="{row}">
- <div v-if="row.isscan==='Y'">
- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
- 鏄�
- </div>
- <div v-if="row.isscan==='N'">
- <i class="el-icon-info" style="margin-right: 2px" />
- 鍚�
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="cycle"
- label="鐐规鍛ㄦ湡"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.cycle==='Y'">骞�</div>
- <div v-if="row.cycle==='S'">瀛�</div>
- <div v-if="row.cycle==='M'">鏈�</div>
- <div v-if="row.cycle==='W'">鍛�</div>
- <div v-if="row.cycle==='D'">鏃�</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="lm_user"
- label="鍒涘缓浜哄憳"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="lm_date"
- label="鍒涘缓鏃堕棿"
- show-tooltip-when-overflow
- width="160"
- sortable="custom"
- />
+ <!-- <el-table-column-->
+ <!-- prop="RowNum"-->
+ <!-- width="50"-->
+ <!-- fixed-->
+ <!-- label="搴忓彿"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="code"-->
+ <!-- label="閮ㄤ綅缂栫爜"-->
+ <!-- sortable="custom"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="name"-->
+ <!-- label="閮ㄤ綅鍚嶇О"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="description"-->
+ <!-- label="鐐规瑕佹眰"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.description">{{ row.description }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="isscan"-->
+ <!-- label="閫夋嫨鎵爜"-->
+ <!-- sortable="custom"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.isscan==='Y'">-->
+ <!-- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
+ <!-- 鏄�-->
+ <!-- </div>-->
+ <!-- <div v-if="row.isscan==='N'">-->
+ <!-- <i class="el-icon-info" style="margin-right: 2px" />-->
+ <!-- 鍚�-->
+ <!-- </div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="cycle"-->
+ <!-- label="鐐规鍛ㄦ湡"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.cycle==='Y'">骞�</div>-->
+ <!-- <div v-if="row.cycle==='S'">瀛�</div>-->
+ <!-- <div v-if="row.cycle==='M'">鏈�</div>-->
+ <!-- <div v-if="row.cycle==='W'">鍛�</div>-->
+ <!-- <div v-if="row.cycle==='D'">鏃�</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_user"-->
+ <!-- label="鍒涘缓浜哄憳"-->
+ <!-- sortable="custom"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_date"-->
+ <!-- label="鍒涘缓鏃堕棿"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- width="160"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
<el-table-column
label="鎿嶄綔"
fixed="right"
@@ -278,11 +313,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: 'Zzjg',
components: {
- Pagination, ImportPicker
+ Pagination, ImportPicker, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -316,6 +352,82 @@
total: 10,
tableData: [],
+ tableColumnSettingsArray: [
+ { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: false, width: 55, 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: false,
+ width: 110,
+ prop: 'isscan',
+ label: '閫夋嫨鎵爜',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'cycle',
+ label: '鐐规鍛ㄦ湡',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'lm_user',
+ label: '鍒涘缓浜哄憳',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 9,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
+
dialogVisible: false,
dialogForm: {
id: '',
@@ -363,6 +475,13 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+ this.$refs.tableDataRef.doLayout()
+ },
async getDeviceCheckItemSearch() {
const res = await DeviceCheckItemSearch(this.form)
this.tableData = res.data
diff --git a/src/views/deviceManager/checkRecord.vue b/src/views/deviceManager/checkRecord.vue
index bd258ea..3125985 100644
--- a/src/views/deviceManager/checkRecord.vue
+++ b/src/views/deviceManager/checkRecord.vue
@@ -87,8 +87,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
class="tableFixed"
:data="tableData"
:height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
@@ -100,92 +105,38 @@
:cell-style="this.$cellStyle"
@sort-change="sortChange"
>
- <el-table-column
- prop="RowNum"
- width="50"
- fixed
- label="搴忓彿"
- />
- <el-table-column
- prop="djwo"
- label="鐐规鍗曞彿"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="org_name"
- label="鐢熶骇杞﹂棿"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="eqp_code"
- label="璁惧缂栧彿"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="eqp_name"
- label="璁惧鍚嶇О"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="stanedcode"
- label="鐐规鏍囧噯缂栫爜"
- width="160"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="stanedname"
- label="鐐规鏍囧噯鍚嶇О"
- show-tooltip-when-overflow
- width="160"
- sortable="custom"
- />
- <el-table-column
- prop="chk_user"
- label="鐐规浜哄憳"
- width="160"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.chk_user&&row.chk_user!=='null'">{{ row.chk_user }}</div>
- <div v-else>/</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="chk_result"
- label="鐐规缁撴灉"
- width="160"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.chk_result==='OK'" style="display: flex;align-items: center">
- <!-- <div style="margin-right: 5px;width:10px;height: 10px;border-radius: 50%;background-color: #42b983" />-->
- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
- 姝e父
+ <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==='chk_result'">
+ <div v-if="row[item.prop]==='OK'" style="display: flex;align-items: center">
+ <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+ 姝e父
+ </div>
+ <div v-if="row[item.prop]==='NG'" style="display: flex;align-items: center">
+ <i class="el-icon-info" style="margin-right: 2px" />
+ 寮傚父
+ </div>
</div>
- <div v-if="row.chk_result==='NG'" style="display: flex;align-items: center">
- <!-- <div style="margin-right: 5px;width:10px;height: 10px;border-radius: 50%;background-color: red" />-->
- <i class="el-icon-info" style="margin-right: 2px" />
- 寮傚父
- </div>
+ <div v-else>{{ row[item.prop] }}</div>
</template>
</el-table-column>
+
<el-table-column
- prop="chk_date"
- label="鐐规鏃堕棿"
- show-tooltip-when-overflow
- width="160"
- sortable="custom"
- />
- <el-table-column
- label="鏌ョ湅璁板綍"
+ label="鏄庣粏"
width="120"
fixed="right"
>
@@ -318,11 +269,12 @@
import { ShopSearch } from '@/api/kanbanManager'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
+import TableColumnSettings from '@/components/TableColumnSettings'
export default {
name: 'Zzjg',
components: {
- Pagination, ImportPicker
+ Pagination, ImportPicker, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -344,9 +296,110 @@
rows: 20 // 姣忛〉澶氬皯鏉�
},
wkshopSelectArr: [],
-
total: 10,
tableData: [],
+ tableColumnSettingsArray: [
+ // { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: false, width: 55, prop: 'RowNum', label: '搴忓彿', id: 2, show: true, fixed: 'left', sortable: false }, // custom
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'djwo',
+ label: '鐐规鍗曞彿',
+ id: 3,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 130,
+ prop: 'org_code',
+ label: '鐢熶骇杞﹂棿缂栫爜',
+ id: 4,
+ show: false,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'org_name',
+ label: '鐢熶骇杞﹂棿',
+ id: 5,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'eqp_code',
+ label: '璁惧缂栫爜',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'eqp_name',
+ label: '璁惧鍚嶇О',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 130,
+ prop: 'stanedcode',
+ label: '鐐规鏍囧噯缂栫爜',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: 130,
+ width: false,
+ prop: 'stanedname',
+ label: '鐐规鏍囧噯鍚嶇О',
+ id: 9,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'chk_user',
+ label: '鐐规浜哄憳',
+ id: 10,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 110,
+ prop: 'chk_result',
+ label: '鐐规缁撴灉',
+ id: 11,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'chk_date',
+ label: '鐐规鏃堕棿',
+ id: 12,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
dialogVisible: false,
// dialogForm: {
// OrgType: '',
@@ -379,6 +432,14 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+
+ this.$refs.tableDataRef.doLayout()
+ },
handleRequest() {
this.getDeviceCheckTakeSearch().then(res => {
if (res.code === '200') {
diff --git a/src/views/deviceManager/checkStandard.vue b/src/views/deviceManager/checkStandard.vue
index 2835420..e0dd316 100644
--- a/src/views/deviceManager/checkStandard.vue
+++ b/src/views/deviceManager/checkStandard.vue
@@ -47,8 +47,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
:data="tableData"
:height="tableHeight+'px'"
border
@@ -60,91 +65,49 @@
:cell-style="this.$cellStyle"
@sort-change="sortChange"
>
- <!-- <el-table-column-->
- <!-- type="selection"-->
- <!-- width="50"-->
- <!-- />-->
- <el-table-column
- prop="RowNum"
- width="50"
- fixed
- label="搴忓彿"
- />
- <el-table-column
- prop="code"
- label="鏍囧噯缂栫爜"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="name"
- label="鏍囧噯鍚嶇О"
- show-tooltip-when-overflow
- sortable="custom"
- />
<el-table-column
- prop="description"
- label="鏍囧噯鎻忚堪"
- sortable="custom"
+ 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.description">{{ row.description }}</div>
- <div v-else>/</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="iscontr"
- label="鐐规绠℃帶"
- sortable="custom"
- show-tooltip-when-overflow
- >
- <template slot-scope="{row}">
- <div v-if="row.iscontr==='Y'">
- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
- 鏄�
+ <div v-if="!row[item.prop]">/</div>
+ <div v-else-if="item.prop==='is_checkeqp'">
+ <i
+ v-if="row[item.prop]==='Y'"
+ :style="{color:$store.state.settings.theme}"
+ class="el-icon-share"
+ @click="checkeqpClick(row)"
+ />
+ <i
+ v-if="row[item.prop]==='N'"
+ class="el-icon-share"
+ style="color: rgb(180 ,181, 185)"
+ @click="checkeqpClick(row)"
+ />
</div>
- <div v-if="row.iscontr==='N'">
- <i class="el-icon-info" style="margin-right: 2px" />
- 鍚�
+ <div v-else-if="item.prop==='iscontr'">
+ <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
- prop="is_checkeqp"
- label="鍏宠仈璁惧"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <i
- v-if="row.is_checkeqp==='Y'"
- :style="{color:$store.state.settings.theme}"
- class="el-icon-share"
- @click="checkeqpClick(row)"
- />
- <i
- v-if="row.is_checkeqp==='N'"
- class="el-icon-share"
- style="color: rgb(180 ,181, 185)"
- @click="checkeqpClick(row)"
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="lm_user"
- label="鍒涘缓浜哄憳"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="lm_date"
- label="鍒涘缓鏃堕棿"
- width="160"
- sortable="custom"
- show-tooltip-when-overflow
- />
+
<el-table-column
label="鎿嶄綔"
fixed="right"
@@ -488,11 +451,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: 'Zzjg',
components: {
- Pagination, ImportPicker
+ Pagination, ImportPicker, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -517,6 +481,82 @@
],
total: 10,
tableData: [],
+ tableColumnSettingsArray: [
+ { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: false, width: 55, 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: false,
+ width: 110,
+ prop: 'iscontr',
+ label: '鐐规绠℃帶',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'is_checkeqp',
+ label: '鍏宠仈璁惧',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'lm_user',
+ label: '鍒涘缓浜哄憳',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 9,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
+
dialogVisible: false,
dialogForm: {
code: '',
@@ -578,6 +618,14 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+
+ this.$refs.tableDataRef.doLayout()
+ },
handleRequest() {
this.getDeviceCheckStandArdSearch().then(res => {
if (res.code === '200') {
diff --git a/src/views/deviceManager/maintainPosition.vue b/src/views/deviceManager/maintainPosition.vue
index 8b119c8..f52a2ea 100644
--- a/src/views/deviceManager/maintainPosition.vue
+++ b/src/views/deviceManager/maintainPosition.vue
@@ -47,8 +47,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
:data="tableData"
:height="tableHeight+'px'"
border
@@ -64,67 +69,97 @@
<!-- type="selection"-->
<!-- width="50"-->
<!-- />-->
+
<el-table-column
- prop="RowNum"
- width="50"
- fixed
- label="搴忓彿"
- />
- <el-table-column
- prop="code"
- label="閮ㄤ綅缂栫爜"
- sortable="custom"
+ 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
- />
- <el-table-column
- prop="name"
- label="閮ㄤ綅鍚嶇О"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="description"
- label="淇濆吇瑕佹眰"
- sortable="custom"
- show-tooltip-when-overflow
+ :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
>
<template slot-scope="{row}">
- <div v-if="row.description">{{ row.description }}</div>
- <div v-else>/</div>
+ <div v-if="!row[item.prop]">/</div>
+ <div v-else-if="item.prop==='cycle'">{{ cycleArr.find(i=>i.code===row[item.prop]).name }}</div>
+ <div v-else-if="item.prop==='isscan'">
+ <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
- prop="isscan"
- label="閫夋嫨鎵爜"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.isscan==='Y'">
- <!-- <svg-icon icon-class="circleYes" style="margin-right: 2px" />-->
- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
- 鏄�
- </div>
- <div v-if="row.isscan==='N'">
- <!-- <svg-icon icon-class="circleNo" style="margin-right: 2px" />-->
- <i class="el-icon-info" style="margin-right: 2px" />
- 鍚�
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="lm_user"
- label="鍒涘缓浜哄憳"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="lm_date"
- label="鍒涘缓鏃堕棿"
- width="160"
- show-tooltip-when-overflow
- sortable="custom"
- />
+
+ <!-- <el-table-column-->
+ <!-- prop="RowNum"-->
+ <!-- width="50"-->
+ <!-- fixed-->
+ <!-- label="搴忓彿"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="code"-->
+ <!-- label="閮ㄤ綅缂栫爜"-->
+ <!-- sortable="custom"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="name"-->
+ <!-- label="閮ㄤ綅鍚嶇О"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- 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="isscan"-->
+ <!-- label="閫夋嫨鎵爜"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.isscan==='Y'">-->
+ <!-- <!– <svg-icon icon-class="circleYes" style="margin-right: 2px" />–>-->
+ <!-- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
+ <!-- 鏄�-->
+ <!-- </div>-->
+ <!-- <div v-if="row.isscan==='N'">-->
+ <!-- <!– <svg-icon icon-class="circleNo" style="margin-right: 2px" />–>-->
+ <!-- <i class="el-icon-info" style="margin-right: 2px" />-->
+ <!-- 鍚�-->
+ <!-- </div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_user"-->
+ <!-- label="鍒涘缓浜哄憳"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_date"-->
+ <!-- label="鍒涘缓鏃堕棿"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- />-->
<el-table-column
label="鎿嶄綔"
width="120"
@@ -220,11 +255,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: 'Zzjg',
components: {
- Pagination, ImportPicker
+ Pagination, ImportPicker, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -250,6 +286,71 @@
total: 10,
tableData: [],
+ tableColumnSettingsArray: [
+ { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: false, width: 55, 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: false,
+ width: 110,
+ prop: 'isscan',
+ label: '閫夋嫨鎵爜',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'lm_user',
+ label: '鍒涘缓浜哄憳',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
dialogVisible: false,
dialogForm: {
id: '',
@@ -289,6 +390,13 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+ this.$refs.tableDataRef.doLayout()
+ },
async getDeviceMaiItemSearch() {
const res = await DeviceMaiItemSearch(this.form)
this.tableData = res.data
diff --git a/src/views/deviceManager/maintainRecord.vue b/src/views/deviceManager/maintainRecord.vue
index a336921..67d5aa0 100644
--- a/src/views/deviceManager/maintainRecord.vue
+++ b/src/views/deviceManager/maintainRecord.vue
@@ -87,8 +87,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
class="tableFixed"
:data="tableData"
:height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
@@ -100,107 +105,40 @@
:cell-style="this.$cellStyle"
@sort-change="sortChange"
>
+
<el-table-column
- prop="RowNum"
- width="50"
- fixed
- label="搴忓彿"
- />
- <el-table-column
- prop="bywo"
- width="160"
+ 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
- label="淇濆吇鍗曞彿"
- sortable="custom"
- />
- <el-table-column
- prop="org_name"
- label="鐢熶骇杞﹂棿"
- min-width="120"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="eqp_code"
- label="璁惧缂栧彿"
- show-tooltip-when-overflow
- sortable="custom"
- min-width="120"
- />
- <el-table-column
- prop="eqp_name"
- min-width="120"
- label="璁惧鍚嶇О"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="stanedcode"
- label="淇濆吇鏍囧噯缂栫爜"
- width="160"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="stanedname"
- label="淇濆吇鏍囧噯鍚嶇О"
- width="160"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="maint_cyc"
- label="淇濆吇鍛ㄦ湡"
- width="110"
- show-tooltip-when-overflow
- sortable="custom"
+ :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
>
<template slot-scope="{row}">
- <div v-if="row.maint_cyc==='M'">鏈�</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="maint_user"
- label="淇濆吇浜哄憳"
- width="160"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.maint_user">{{ row.maint_user }}</div>
- <div v-else>/</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="maint_result"
- label="淇濆吇缁撴灉"
- width="160"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.maint_result==='OK'" style="display: flex;align-items: center">
- <!-- <div style="margin-right: 5px;width:10px;height: 10px;border-radius: 50%;background-color: #42b983" />-->
- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
- 姝e父
+ <div v-if="!row[item.prop]">/</div>
+
+ <div v-else-if="item.prop==='maint_cyc'">{{ cycleArr.find(i=>i.code===row[item.prop]).name }}</div>
+ <div v-else-if="item.prop==='maint_result'">
+ <div v-if="row[item.prop]==='OK'" style="display: flex;align-items: center">
+ <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+ 姝e父
+ </div>
+ <div v-if="row[item.prop]==='NG'" style="display: flex;align-items: center">
+ <i class="el-icon-info" style="margin-right: 2px" />
+ 寮傚父
+ </div>
</div>
- <div v-if="row.maint_result==='NG'" style="display: flex;align-items: center">
- <!-- <div style="margin-right: 5px;width:10px;height: 10px;border-radius: 50%;background-color: red" />-->
- <i class="el-icon-info" style="margin-right: 2px" />
- 寮傚父
- </div>
+ <div v-else>{{ row[item.prop] }}</div>
</template>
</el-table-column>
+
<el-table-column
- prop="maint_date"
- label="淇濆吇鏃堕棿"
- show-tooltip-when-overflow
- width="160"
- sortable="custom"
- />
- <el-table-column
- label="鏌ョ湅璁板綍"
- width="80"
+ label="鏄庣粏"
+ width="120"
fixed="right"
>
<template slot-scope="{row}">
@@ -321,11 +259,12 @@
import { ShopSearch } from '@/api/kanbanManager'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
+import TableColumnSettings from '@/components/TableColumnSettings'
export default {
name: 'Zzjg',
components: {
- Pagination, ImportPicker
+ Pagination, ImportPicker, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -348,12 +287,129 @@
rows: 20 // 姣忛〉澶氬皯鏉�
},
wkshopSelectArr: [],
+ cycleArr: [
+ { code: 'Y', name: '骞�' },
+ { code: 'S', name: '瀛�' },
+ { code: 'M', name: '鏈�' },
+ { code: 'W', name: '鍛�' }
+ ],
repairresultArr: [
{ code: 'OK', name: '鍚堟牸' },
{ code: 'NG', name: '涓嶈壇' }
],
total: 10,
tableData: [],
+ tableColumnSettingsArray: [
+ // { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: false, width: 55, prop: 'RowNum', label: '搴忓彿', id: 2, show: true, fixed: 'left', sortable: false }, // custom
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'bywo',
+ label: '淇濆吇鍗曞彿',
+ id: 3,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 130,
+ prop: 'org_code',
+ label: '鐢熶骇杞﹂棿缂栫爜',
+ id: 4,
+ show: false,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'org_name',
+ label: '鐢熶骇杞﹂棿',
+ id: 5,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'eqp_code',
+ label: '璁惧缂栫爜',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'eqp_name',
+ label: '璁惧鍚嶇О',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 130,
+ prop: 'stanedcode',
+ label: '淇濆吇鏍囧噯缂栫爜',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: 130,
+ width: false,
+ prop: 'stanedname',
+ label: '淇濆吇鏍囧噯鍚嶇О',
+ id: 9,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'maint_cyc',
+ label: '淇濆吇鍛ㄦ湡',
+ id: 10,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 110,
+ prop: 'maint_user',
+ label: '淇濆吇浜哄憳',
+ id: 10,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 110,
+ prop: 'maint_result',
+ label: '淇濆吇缁撴灉',
+ id: 11,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'maint_date',
+ label: '淇濆吇鏃堕棿',
+ id: 12,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
dialogVisible: false,
// dialogForm: {
// OrgType: '',
@@ -394,6 +450,14 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+
+ this.$refs.tableDataRef.doLayout()
+ },
handleRequest() {
this.getDeviceRepairTakeSearch().then(res => {
if (res.code === '200') {
diff --git a/src/views/deviceManager/maintainStandard.vue b/src/views/deviceManager/maintainStandard.vue
index 851e830..738380c 100644
--- a/src/views/deviceManager/maintainStandard.vue
+++ b/src/views/deviceManager/maintainStandard.vue
@@ -39,8 +39,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
:data="tableData"
:height="tableHeight+'px'"
border
@@ -52,82 +57,40 @@
:cell-style="this.$cellStyle"
@sort-change="sortChange"
>
- <!-- <el-table-column-->
- <!-- type="selection"-->
- <!-- width="50"-->
- <!-- />-->
- <el-table-column
- prop="RowNum"
- width="50"
- fixed
- label="搴忓彿"
- />
- <el-table-column
- prop="code"
- label="鏍囧噯缂栫爜"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="name"
- label="鏍囧噯鍚嶇О"
- show-tooltip-when-overflow
- sortable="custom"
- />
<el-table-column
- prop="description"
- label="鏍囧噯鎻忚堪"
- sortable="custom"
+ 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.description">{{ row.description }}</div>
- <div v-else>/</div>
+ <div v-if="!row[item.prop]">/</div>
+ <div v-else-if="item.prop==='main_cycle'">{{ cycleArr.find(i=>i.code===row[item.prop]).name }}</div>
+ <div v-else-if="item.prop==='is_repaireqp'">
+ <i
+ v-if="row[item.prop]==='Y'"
+ :style="{color:$store.state.settings.theme}"
+ class="el-icon-share"
+ @click="checkeqpClick(row)"
+ />
+ <i
+ v-if="row[item.prop]==='N'"
+ class="el-icon-share"
+ style="color: rgb(180 ,181, 185)"
+ @click="checkeqpClick(row)"
+ />
+ </div>
+ <div v-else>{{ row[item.prop] }}</div>
</template>
</el-table-column>
- <el-table-column
- prop="main_cycle"
- label="淇濆吇鍛ㄦ湡"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.main_cycle==='Y'">骞�</div>
- <div v-if="row.main_cycle==='S'">瀛�</div>
- <div v-if="row.main_cycle==='M'">鏈�</div>
- <div v-if="row.main_cycle==='W'">鍛�</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="is_repaireqp"
- label="鍏宠仈璁惧"
- sortable="custom"
- show-tooltip-when-overflow
- >
- <template slot-scope="{row}">
- <i v-if="row.is_repaireqp==='Y'" :style="{color:$store.state.settings.theme}" class="el-icon-share" @click="checkeqpClick(row)" />
- <i
- v-if="row.is_repaireqp==='N'"
- class="el-icon-share"
- style="color: rgb(180 ,181, 185)"
- @click="checkeqpClick(row)"
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="lm_user"
- label="鍒涘缓浜哄憳"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="lm_date"
- label="鍒涘缓鏃堕棿"
- show-tooltip-when-overflow
- width="160"
- sortable="custom"
- />
+
<el-table-column
label="鎿嶄綔"
fixed="right"
@@ -446,11 +409,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: 'Zzjg',
components: {
- Pagination, ImportPicker
+ Pagination, ImportPicker, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -478,6 +442,82 @@
],
total: 10,
tableData: [],
+ tableColumnSettingsArray: [
+ { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: false, width: 55, 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: false,
+ width: 110,
+ prop: 'main_cycle',
+ label: '淇濆吇鍛ㄦ湡',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'is_repaireqp',
+ label: '鍏宠仈璁惧',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'lm_user',
+ label: '鍒涘缓浜哄憳',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 9,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
+
dialogVisible: false,
dialogForm: {
code: '',
@@ -539,6 +579,14 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+
+ this.$refs.tableDataRef.doLayout()
+ },
handleRequest() {
this.getDeviceRepairStandArdSearch().then(res => {
if (res.code === '200') {
diff --git a/src/views/deviceManager/repairRecord.vue b/src/views/deviceManager/repairRecord.vue
index a1f9707..41b935b 100644
--- a/src/views/deviceManager/repairRecord.vue
+++ b/src/views/deviceManager/repairRecord.vue
@@ -108,8 +108,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
class="tableFixed"
:data="tableData"
:height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
@@ -122,113 +127,36 @@
@sort-change="sortChange"
>
<el-table-column
- prop="RowNum"
- width="50"
- fixed
- label="搴忓彿"
- />
- <el-table-column
- prop="repair_code"
- label="缁翠慨鍗曞彿"
+ 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
- min-width="160"
- sortable="custom"
- />
- <el-table-column
- prop="wksp_name"
- label="鎵�灞炶溅闂�"
- show-tooltip-when-overflow
- min-width="120"
- sortable="custom"
- />
- <el-table-column
- prop="eqp_code"
- width="120"
- label="璁惧缂栫爜"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="eqp_name"
- label="璁惧鍚嶇О"
- width="120"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="request_person"
- label="鎶ヤ慨浜�"
- sortable="custom"
- show-tooltip-when-overflow
- width="100"
- />
- <el-table-column
- prop="request_date"
- label="鎶ヤ慨鏃堕棿"
- show-tooltip-when-overflow
- width="160"
- sortable="custom"
- />
- <el-table-column
- prop="repair_person"
- label="缁翠慨浜�"
- show-tooltip-when-overflow
- width="100"
- sortable="custom"
- />
- <el-table-column
- prop="repair_date"
- label="缁翠慨瀹屾垚鏃堕棿"
- show-tooltip-when-overflow
- width="160"
- sortable="custom"
- />
- <el-table-column
- prop="cycleDate"
- show-tooltip-when-overflow
- label="缁翠慨鏃堕暱"
- width="120"
- sortable="custom"
+ :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
>
<template slot-scope="{row}">
- <div>{{ row.cycleDate }} 灏忔椂</div>
+ <div v-if="!row[item.prop]">/</div>
+ <div v-else-if="item.prop==='verify_result'">
+ <div v-if="row[item.prop]==='閫氳繃'" style="display: flex;align-items: center">
+ <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+ 閫氳繃
+ </div>
+ <div v-if="row[item.prop]==='涓嶉�氳繃'" style="display: flex;align-items: center">
+ <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
- prop="verify_person"
- label="楠岃瘉浜�"
- width="100"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="verify_date"
- label="楠岃瘉鏃堕棿"
- show-tooltip-when-overflow
- width="160"
- sortable="custom"
- />
- <el-table-column
- prop="verify_result"
- label="楠岃瘉缁撴灉"
+ label="鏄庣粏"
width="120"
- show-tooltip-when-overflow
- sortable="custom"
- >
- <template slot-scope="{row}">
- <div v-if="row.verify_result==='閫氳繃'" style="display: flex;align-items: center">
- <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
- 閫氳繃
- </div>
- <div v-if="row.verify_result==='涓嶉�氳繃'" style="display: flex;align-items: center">
- <i class="el-icon-info" style="margin-right: 2px" />
- 涓嶉�氳繃
- </div>
- </template>
- </el-table-column>
- <el-table-column
- label="鏌ョ湅璁板綍"
- width="80"
fixed="right"
>
<template slot-scope="{row}">
@@ -403,11 +331,12 @@
import { ShopSearch } from '@/api/kanbanManager'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
+import TableColumnSettings from '@/components/TableColumnSettings'
export default {
name: 'Zzjg',
components: {
- Pagination, ImportPicker
+ Pagination, ImportPicker, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -434,6 +363,138 @@
wkshopSelectArr: [],
total: 10,
tableData: [],
+
+ tableColumnSettingsArray: [
+ // { minWidth: false, width: 55, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
+ { minWidth: false, width: 55, prop: 'RowNum', label: '搴忓彿', id: 2, show: true, fixed: 'left', sortable: false }, // custom
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'repair_code',
+ label: '缁翠慨鍗曞彿',
+ id: 3,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 130,
+ prop: 'wksp_code',
+ label: '鎵�灞炶溅闂寸紪鐮�',
+ id: 4,
+ show: false,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'wksp_name',
+ label: '鎵�灞炶溅闂�',
+ id: 5,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'eqp_code',
+ label: '璁惧缂栫爜',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'eqp_name',
+ label: '璁惧鍚嶇О',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 110,
+ prop: 'request_person',
+ label: '鎶ヤ慨浜�',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 160,
+ prop: 'request_date',
+ label: '淇濅慨鏃堕棿',
+ id: 9,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'repair_person',
+ label: '缁翠慨浜�',
+ id: 10,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 160,
+ prop: 'repair_date',
+ label: '缁翠慨瀹屾垚鏃堕棿',
+ id: 11,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 110,
+ prop: 'cycleDate',
+ label: '缁翠慨鏃堕暱',
+ id: 12,
+ show: true,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: false,
+ width: 110,
+ prop: 'verify_person',
+ label: '楠岃瘉浜�',
+ id: 13,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'verify_date',
+ label: '楠岃瘉鏃堕棿',
+ id: 14,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
+ prop: 'verify_result',
+ label: '楠岃瘉缁撴灉',
+ id: 15,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
+
dialogVisible: false,
dialogData1: {},
dialogData2: {},
@@ -470,6 +531,14 @@
this.baseUrl = process.env.VUE_APP_BASE_API_FILE
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+ this.tableTimeStampKey = new Date().getTime()
+
+ this.$refs.tableDataRef.doLayout()
+ },
handleRequest() {
this.getDeviceUpdateSearch().then(res => {
if (res.code === '200') {
--
Gitblit v1.9.3