修改下名称硬盘/运费/其他--DDR
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!--表格-->
|
<!--表格-->
|
||||||
<div class="bg_white table_90 m-t-10 border-r-10 text-black f-12">
|
<div class="bg_white table_90 m-t-10 border-r-10 text-black f-12">
|
||||||
<vxe-table border resizable show-overflow ref="xTable" height="700" :scroll-x="{ enabled: false }"
|
<vxe-table border resizable show-overflow ref="xTable" :height="tableHeight" :scroll-x="{ enabled: false }"
|
||||||
:scroll-y="{ enabled: false }" :header-row-style="header_style" :data="tableData" :edit-config="editConfig">
|
:scroll-y="{ enabled: false }" :header-row-style="header_style" :data="tableData" :edit-config="editConfig">
|
||||||
<vxe-colgroup title="基本信息" header-align="center" fixed="left" resizable>
|
<vxe-colgroup title="基本信息" header-align="center" fixed="left" resizable>
|
||||||
<!-- <vxe-colgroup title="品牌" header-align="center">
|
<!-- <vxe-colgroup title="品牌" header-align="center">
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
<vxe-input v-model="row.process_cost" type="text"></vxe-input>
|
<vxe-input v-model="row.process_cost" type="text"></vxe-input>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="other_cost" title="硬盘/运费其他" width="80" header-align="center" align="right"
|
<vxe-column field="other_cost" title="硬盘/运费/其他/DDR" width="80" header-align="center" align="right"
|
||||||
:edit-render="{ autofocus: '.vxe-input--inner' }">
|
:edit-render="{ autofocus: '.vxe-input--inner' }">
|
||||||
<template #edit="{ row }">
|
<template #edit="{ row }">
|
||||||
<vxe-input v-model="row.other_cost" type="text"></vxe-input>
|
<vxe-input v-model="row.other_cost" type="text"></vxe-input>
|
||||||
@@ -336,13 +336,13 @@
|
|||||||
{{ row.remark1 }}
|
{{ row.remark1 }}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="remark2" title="绩效提成经营分析品线(二级)" width="80" header-align="center" align="right"
|
<vxe-column field="remark2" title="绩效提成经营分析品线(二级)" width="100" header-align="center" align="right"
|
||||||
:edit-render="{}">
|
:edit-render="{}">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.remark2}}
|
{{ row.remark2}}
|
||||||
</template>
|
</template>
|
||||||
<template #edit="{ row, $rowIndex }">
|
<template #edit="{ row, $rowIndex }">
|
||||||
<vxe-select v-model="row.remark2" @change="val => updateRemark(val, $rowIndex)">
|
<vxe-select v-model="row.remark2" @change="val => updateRemark(val, $rowIndex)" clearable>
|
||||||
<vxe-option v-for="item in remark_level" :key="item.remark_two" :value="item.remark_two" :label="item.remark_two"></vxe-option>
|
<vxe-option v-for="item in remark_level" :key="item.remark_two" :value="item.remark_two" :label="item.remark_two"></vxe-option>
|
||||||
</vxe-select>
|
</vxe-select>
|
||||||
</template>
|
</template>
|
||||||
@@ -383,15 +383,9 @@ import axios from 'axios'
|
|||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
tableHeight: 700, // 初始高度,后续会动态计算
|
||||||
loading: null,
|
loading: null,
|
||||||
fileList: [], //上传的文件列表
|
fileList: [], //上传的文件列表
|
||||||
header_style: {
|
|
||||||
'background-color': '#F5F7FA',
|
|
||||||
color: '#606266',
|
|
||||||
fontSize: '10px',
|
|
||||||
fontWeight: '600',
|
|
||||||
textAlign: 'center'
|
|
||||||
},
|
|
||||||
brand_list: [],
|
brand_list: [],
|
||||||
sku_list: [],
|
sku_list: [],
|
||||||
name_list: [],
|
name_list: [],
|
||||||
@@ -440,6 +434,16 @@ export default {
|
|||||||
remark_level:[]//绩效提成经营分析品线等级下拉选择
|
remark_level:[]//绩效提成经营分析品线等级下拉选择
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
// 初始化时计算表格高度
|
||||||
|
this.calculateTableHeight();
|
||||||
|
// 监听窗口大小变化
|
||||||
|
window.addEventListener('resize', this.calculateTableHeight);
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
// 移除事件监听,避免内存泄漏
|
||||||
|
window.removeEventListener('resize', this.calculateTableHeight);
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
// 取出页面标签
|
// 取出页面标签
|
||||||
@@ -458,10 +462,23 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 计算表格高度,使其自适应屏幕剩余空间
|
||||||
|
calculateTableHeight() {
|
||||||
|
// 获取视口高度
|
||||||
|
const viewportHeight = window.innerHeight;
|
||||||
|
// 获取表格容器上方元素的高度总和(这里需要根据实际布局调整)
|
||||||
|
const tableTopOffset = 150; // 估计值,包含搜索栏、按钮等上方元素的高度
|
||||||
|
// 计算表格可用高度
|
||||||
|
this.tableHeight = viewportHeight - tableTopOffset - 100; // 减去底部的边距和分页高度
|
||||||
|
// 确保高度不会太小
|
||||||
|
if (this.tableHeight < 300) {
|
||||||
|
this.tableHeight = 300;
|
||||||
|
}
|
||||||
|
},
|
||||||
updateRemark(val, rowIndex){
|
updateRemark(val, rowIndex){
|
||||||
// 根据选中的二级品线查找对应的一级品线
|
// 根据选中的二级品线查找对应的一级品线
|
||||||
const item = this.remark_level.find(i => i && i.remark_two === val.value);
|
const item = this.remark_level.find(i => i && i.remark_two === val.value);
|
||||||
this.tableData[rowIndex].remark1 = item.remark_one;
|
this.tableData[rowIndex].remark1 = val.value==null|| !val.value?'' :item.remark_one;
|
||||||
},
|
},
|
||||||
enlarge (e, row) {
|
enlarge (e, row) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
|
|||||||
@@ -225,7 +225,7 @@
|
|||||||
<vxe-input v-model="row.process_cost" type="text"></vxe-input>
|
<vxe-input v-model="row.process_cost" type="text"></vxe-input>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="other_cost" title="硬盘/运费其他" width="80" header-align="center" align="right"
|
<vxe-column field="other_cost" title="硬盘/运费/其他/DDR" width="80" header-align="center" align="right"
|
||||||
:edit-render="{ autofocus: '.vxe-input--inner' }">
|
:edit-render="{ autofocus: '.vxe-input--inner' }">
|
||||||
<template #edit="{ row }">
|
<template #edit="{ row }">
|
||||||
<vxe-input v-model="row.other_cost" type="text"></vxe-input>
|
<vxe-input v-model="row.other_cost" type="text"></vxe-input>
|
||||||
|
|||||||
Reference in New Issue
Block a user