From 995788e4042ba9b2886a8e03ca201f2268359f58 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 11 四月 2023 13:57:17 +0800
Subject: [PATCH] 1.物料管理模块下的动态列表完成
---
src/views/materialManager/storehouseDefine.vue | 178 +++++++++++++++++++------
src/views/purchasesManager/purchasesList.vue | 26 ++-
src/views/materialManager/locationDefine.vue | 208 ++++++++++++++++++++++-------
3 files changed, 312 insertions(+), 100 deletions(-)
diff --git a/src/views/materialManager/locationDefine.vue b/src/views/materialManager/locationDefine.vue
index c282a92..b76b0db 100644
--- a/src/views/materialManager/locationDefine.vue
+++ b/src/views/materialManager/locationDefine.vue
@@ -71,8 +71,13 @@
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
class="tableFixed"
:data="tableData"
border
@@ -84,58 +89,77 @@
: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>{{ 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"
- 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="stock_name"
- label="鎵�灞炰粨搴�"
- show-tooltip-when-overflow
- sortable="custom"
- />
- <el-table-column
- prop="lm_user"
- label="鍒涘缓浜哄憳"
- sortable="custom"
- show-tooltip-when-overflow
- />
- <el-table-column
- prop="lm_date"
- label="鍒涘缓鏃堕棿"
- sortable="custom"
- width="160"
- show-tooltip-when-overflow
- />
+ <!-- <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"-->
+ <!-- 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="stock_name"-->
+ <!-- label="鎵�灞炰粨搴�"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_user"-->
+ <!-- label="鍒涘缓浜哄憳"-->
+ <!-- sortable="custom"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="lm_date"-->
+ <!-- label="鍒涘缓鏃堕棿"-->
+ <!-- sortable="custom"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
<el-table-column
label="鎿嶄綔"
width="120"
@@ -227,11 +251,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: 'KWDY',
components: {
- Pagination
+ Pagination, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -255,6 +280,81 @@
stockArr: [], // 鎵�灞炰粨搴撴暟缁�
// stockArr2: [], // 鎵�灞炰粨搴撴暟缁勫璇濇
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: 'stock_code',
+ label: '鎵�灞炰粨搴撶紪鐮�',
+ id: 6,
+ show: false,
+ fixed: false,
+ sortable: true
+ }, {
+ minWidth: 110,
+ width: false,
+ prop: 'stock_name',
+ label: '鎵�灞炰粨搴�',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'lm_user',
+ label: '鍒涘缓浜哄憳',
+ id: 8,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 9,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
+
dialogVisible: false,
dialogForm: {
'id': '',
@@ -287,6 +387,15 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+
+ this.tableTimeStampKey = new Date().getTime()
+
+ this.$refs.tableDataRef.doLayout()
+ },
handleRequest() {
this.getStorageDefSearch().then(res => {
if (res.code === '200') {
@@ -294,7 +403,6 @@
}
})
},
-
async getStorageDefSearch() {
const res = await StorageDefSearch(this.form)
this.tableData = res.data
diff --git a/src/views/materialManager/storehouseDefine.vue b/src/views/materialManager/storehouseDefine.vue
index 07ecdcf..1082367 100644
--- a/src/views/materialManager/storehouseDefine.vue
+++ b/src/views/materialManager/storehouseDefine.vue
@@ -48,8 +48,13 @@
/>
</div>
<div class="elTableDiv">
+ <TableColumnSettings
+ :list1="tableColumnSettingsArray"
+ @tableColumnUpdate="tableColumnUpdate"
+ />
<el-table
ref="tableDataRef"
+ :key="tableTimeStampKey"
class="tableFixed"
:data="tableData"
border
@@ -61,52 +66,72 @@
: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>{{ 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"
- show-tooltip-when-overflow
- label="浠撳簱缂栫爜"
- sortable="custom"
- />
- <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="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"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- label="浠撳簱缂栫爜"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <!-- <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="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"
@@ -186,11 +211,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: 'CKDY',
components: {
- Pagination, ImportPicker
+ Pagination, ImportPicker, TableColumnSettings
},
directives: { elDragDialog, waves },
data() {
@@ -209,6 +235,63 @@
},
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: 'lm_user',
+ label: '鍒涘缓浜哄憳',
+ id: 6,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: 110,
+ width: false,
+ prop: 'lm_date',
+ label: '鍒涘缓鏃堕棿',
+ id: 7,
+ show: true,
+ fixed: false,
+ sortable: true
+ }
+ ],
+ tableTimeStampKey: new Date().getTime(), // 琛ㄦ牸key
+
dialogVisible: false,
dialogForm: {
id: '',
@@ -248,6 +331,15 @@
this.getHeight()
},
methods: {
+ tableColumnUpdate(val, isCopyTrue) {
+ if (isCopyTrue) {
+ this.tableColumnSettingsArray = val
+ }
+
+ this.tableTimeStampKey = new Date().getTime()
+
+ this.$refs.tableDataRef.doLayout()
+ },
async getWareHouseDefSearch() {
const res = await WareHouseDefSearch(this.form)
this.tableData = res.data
diff --git a/src/views/purchasesManager/purchasesList.vue b/src/views/purchasesManager/purchasesList.vue
index 17ff06d..28989c4 100644
--- a/src/views/purchasesManager/purchasesList.vue
+++ b/src/views/purchasesManager/purchasesList.vue
@@ -367,7 +367,7 @@
prop="quantity"
/>
<el-table-column
- label="绱Н鍒拌揣鏁伴噺"
+ label="绱鍒拌揣鏁伴噺"
show-tooltip-when-overflow
prop="countarrivalquantity"
/>
@@ -381,6 +381,18 @@
<div v-else>/</div>
</template>
</el-table-column>
+
+ <el-table-column
+ label="绱閫�璐ф暟閲�"
+ show-tooltip-when-overflow
+ prop="countreturnquantity"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.countreturnquantity">{{ row.countreturnquantity }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
<el-table-column
label="棰勮鍒拌揣鏃ユ湡"
show-tooltip-when-overflow
@@ -478,12 +490,12 @@
rows: 20 // 姣忛〉澶氬皯鏉�
},
mesorderstusArr: [
- { label: '鏂拌鍗�', value: 'NEW' },
- { label: '閮ㄥ垎鍒拌揣', value: 'BINARIVE' },
- { label: '宸插埌璐�', value: 'INARIVE' },
- { label: '閮ㄥ垎鍏ュ簱', value: 'BINSTOG' },
- { label: '宸插叆搴�', value: 'INSTOG' },
- { label: '宸插叧闂�', value: 'CLOSED' }
+ { label: '姝e父', value: 'NEW' },
+ // { label: '閮ㄥ垎鍒拌揣', value: 'BINARIVE' },
+ // { label: '宸插埌璐�', value: 'INARIVE' },
+ // { label: '閮ㄥ垎鍏ュ簱', value: 'BINSTOG' },
+ // { label: '宸插叆搴�', value: 'INSTOG' },
+ { label: '鍏抽棴', value: 'CLOSED' }
],
total: 10,
tableData: [],
--
Gitblit v1.9.3