Browse Source

优化部分显示,优化导出

dev
qb 1 month ago
parent
commit
013fa92c84
  1. 2
      src/option/distribution/VehicleArrivalManagement.js
  2. 21
      src/utils/exportData.js
  3. 124
      src/views/basic/forklift/basicForklift.vue
  4. 100
      src/views/basicdata/team/basicdataTeamGroup.vue
  5. 108
      src/views/basicdata/warehouse/warehouse/basicdataWarehouse.vue
  6. 33
      src/views/distribution/artery/VehicleStowageDetails.vue
  7. 11
      src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue

2
src/option/distribution/VehicleArrivalManagement.js

@ -360,7 +360,7 @@ export const columnList = [
label: '操作',
type: 6,
values: '',
width: '250',
width: '300',
checkarr: [],
fixed: 'right',
sortable: false,

21
src/utils/exportData.js

@ -9,17 +9,25 @@ export function exportExcel(columnList = [], listData = [], name = 'excel') {
const blackArr = ['序号', '复选框', '操作', '全选'];
const _columnData = columnList.filter(item => !blackArr.includes(item.label));
const data = [];
const marginList = [];
for (let j = 0; j < listData.length; j++) {
const item = listData[j];
const arr = [];
for (let i = 0; i < columnList.length; i++) {
const val = columnList[i];
for (let i = 0; i < _columnData.length; i++) {
const val = _columnData[i];
if (blackArr.includes(val.label) || val.head) continue;
if (val.isColumnMerge && isNumber(item.mergeColumnIndex) && item.mergeColumnIndex > 1) {
marginList.push({ s: { r: j, c: i }, e: { r: j + item.mergeColumnIndex, c: i } });
}
if (j === 0) headers.push(val.label);
arr.push(item[val.prop] || item[val.prop] === 0 ? item[val.prop] : '');
}
@ -56,7 +64,7 @@ export function exportExcel(columnList = [], listData = [], name = 'excel') {
let valueWidth = 0;
if (value)
if (/.*[\u4e00-\u9fa5]+.*$/.test(value)) {
valueWidth = parseFloat(value.trim().toString().length * 2.1) + 4;
valueWidth = parseFloat(value.trim().toString().length * 1.5) + 4;
} else {
valueWidth = parseFloat(value.toString().length * 1.1) + 4;
}
@ -75,9 +83,9 @@ export function exportExcel(columnList = [], listData = [], name = 'excel') {
// 3.对比每列最大值
let aotuWidth = [];
rowsWidth.map((row, index) => {
rowsWidth.forEach((row, index) => {
let maxWidth = [];
row.map((value, i) => {
row.forEach((value, i) => {
if (index === 0) {
maxWidth.push({
wch: value,
@ -94,6 +102,7 @@ export function exportExcel(columnList = [], listData = [], name = 'excel') {
// 4.给excel设置自适应宽度
ws['!cols'] = aotuWidth;
ws['!merges'] = marginList;
const excludes = ['!cols', '!fullref', '!merges', '!ref', '!rows'];
console.log('ws :>> ', ws);
for (let key in ws) {
@ -102,7 +111,7 @@ export function exportExcel(columnList = [], listData = [], name = 'excel') {
ws[key].s = {
alignment: {
// horizontal: 'center', //水平居中对齐
// vertical: 'center', // 垂直居中
vertical: 'center', // 垂直居中
wrapText: true,
},
border: {

124
src/views/basic/forklift/basicForklift.vue

@ -46,76 +46,64 @@
</el-form-item>
</el-form>
</div>
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain
> </el-button
>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="Download" @click="handleExportData" circle></el-button>
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
</el-row>
<el-row>
<!-- 列表模块 -->
<tablecmt
class="tableNode"
:columnList="columnList"
:tableData="data"
:loading="loading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<el-text
type="primary"
text
icon="el-icon-view"
@click="handleView(slotProps.scope.row)"
>查看</el-text
>
<el-text
type="primary"
text
icon="el-icon-edit"
@click="handleEdit(slotProps.scope.row)"
>编辑</el-text
>
<el-text type="primary" text icon="el-icon-delete" @click="rowDel(slotProps.scope.row)"
>删除</el-text
>
</template>
</tablecmt>
</el-row>
<el-row>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain
> </el-button
>
</el-pagination>
</div>
</el-row>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="Download" @click="handleExportData" circle></el-button>
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
<!-- 列表模块 -->
<tablecmt
class="tableNode"
:columnList="columnList"
:tableData="data"
:loading="loading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<el-text type="primary" text icon="el-icon-view" @click="handleView(slotProps.scope.row)"
>查看</el-text
>
<el-text type="primary" text icon="el-icon-edit" @click="handleEdit(slotProps.scope.row)"
>编辑</el-text
>
<el-text type="primary" text icon="el-icon-delete" @click="rowDel(slotProps.scope.row)"
>删除</el-text
>
</template>
</tablecmt>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120, 5000]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
<!-- 表单模块 -->
<el-dialog
:title="title"

100
src/views/basicdata/team/basicdataTeamGroup.vue

@ -14,64 +14,48 @@
</el-form-item>
</el-form>
</div>
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain
> </el-button
>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="Download" @click="handleExportData" circle></el-button>
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain
> </el-button
>
</div>
</el-row>
<el-row>
<!-- 列表模块 -->
<tablecmt
class="tableNode"
:columnList="columnList"
:tableData="data"
:loading="loading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<el-text
type="primary"
text
icon="el-icon-view"
@click="handleView(slotProps.scope.row)"
>查看</el-text
>
<el-text
type="primary"
text
icon="el-icon-view"
@click="handleList(slotProps.scope.row)"
>人员列表</el-text
>
<el-text
type="primary"
text
icon="el-icon-edit"
@click="handleEdit(slotProps.scope.row)"
>编辑</el-text
>
<el-text type="primary" text icon="el-icon-delete" @click="rowDel(slotProps.scope.row)"
>删除</el-text
>
</template>
</tablecmt>
</el-row>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="Download" @click="handleExportData" circle></el-button>
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
<!-- 列表模块 -->
<tablecmt
class="tableNode"
:columnList="columnList"
:tableData="data"
:loading="loading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<el-text type="primary" text icon="el-icon-view" @click="handleView(slotProps.scope.row)"
>查看</el-text
>
<el-text type="primary" text icon="el-icon-view" @click="handleList(slotProps.scope.row)"
>人员列表</el-text
>
<el-text type="primary" text icon="el-icon-edit" @click="handleEdit(slotProps.scope.row)"
>编辑</el-text
>
<el-text type="primary" text icon="el-icon-delete" @click="rowDel(slotProps.scope.row)"
>删除</el-text
>
</template>
</tablecmt>
<el-row>
<div class="avue-crud__pagination" style="width: 100%">
<!-- 分页模块 -->
@ -81,7 +65,7 @@
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-sizes="[30, 50, 80, 120, 5000]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"

108
src/views/basicdata/warehouse/warehouse/basicdataWarehouse.vue

@ -37,7 +37,7 @@
<el-tab-pane label="到期" :name="3">到期</el-tab-pane>
</el-tabs>
<div>
<div class="el_top_btn">
<div class="el_top_btn mt10">
<div>
<el-button
type="primary"
@ -62,66 +62,58 @@
</div>
</div>
<el-row>
<!-- 列表模块 -->
<tablecmt
class="tableNode"
:columnList="details.columnList"
:tableData="data"
:checkselect="selectList"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<div class="ElBtnClass">
<el-text
v-if="accessControl.Expand_configuration"
@click="Expandconfiguration(slotProps.scope.row)"
>扩展配置</el-text
>
<el-text
v-if="accessControl.warehouseWarehouse_view"
@click="view(slotProps.scope)"
>查看</el-text
>
<el-text
v-if="accessControl.warehouseWarehouse_edit"
@click="edit(slotProps.scope)"
>编辑</el-text
>
<el-text
v-if="accessControl.warehouseWarehouse_delete"
@click="DeleteInformation(slotProps.scope)"
>删除</el-text
>
</div>
</template>
<!-- 列表模块 -->
<tablecmt
class="tableNode mt10"
:columnList="details.columnList"
:tableData="data"
:checkselect="selectList"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<div class="ElBtnClass">
<el-text
v-if="accessControl.Expand_configuration"
@click="Expandconfiguration(slotProps.scope.row)"
>扩展配置</el-text
>
<el-text v-if="accessControl.warehouseWarehouse_view" @click="view(slotProps.scope)"
>查看</el-text
>
<el-text v-if="accessControl.warehouseWarehouse_edit" @click="edit(slotProps.scope)"
>编辑</el-text
>
<el-text
v-if="accessControl.warehouseWarehouse_delete"
@click="DeleteInformation(slotProps.scope)"
>删除</el-text
>
</div>
</template>
</tablecmt>
</el-row>
</template>
</tablecmt>
<!-- 分页模块 -->
<el-row class="el-fy">
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div></div>
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</el-row>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div></div>
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120, 500]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
</div>

33
src/views/distribution/artery/VehicleStowageDetails.vue

@ -212,21 +212,6 @@
</template>
</template>
</tablecmt>
<div style="overflow: hidden; width: 0; height: 0">
<tablecmt
ref="exportColumnListNode"
:columnList="tableColumnList"
:tableData="detailsRenderData"
:arraySpanMethod="row => arraySpanMethod(row)"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '运单号'">
{{ slotProps.scope.row.waybillNo }}
</template>
</template>
</tablecmt>
</div>
</el-tab-pane>
<el-tab-pane label="日 志 跟 踪" name="tab2">
@ -487,6 +472,7 @@ import { useStore } from 'vuex';
import { ElMessage, ElMessageBox } from 'element-plus';
import { exportExcelByDom } from '@/utils/export';
import { dateNow } from '@/utils/date';
import { exportExcel } from '@/utils/exportData';
/** 被合并的列 */
const mergeColumn = [];
@ -1158,20 +1144,13 @@ const handleBatchDelete = () => {
const handleExport = () => {
console.log('exportColumnListNode.value.$el :>> ', exportColumnListNode.value.$el);
console.log('detailsRenderData.value :>> ', detailsRenderData.value);
exportExcelByDom(exportColumnListNode.value.$el, `${details.form.carsNo} - ${dateNow()}.xlsx`);
exportExcel(
details.detailsColumnList,
detailsRenderData.value,
`${details.form.carsNo} - ${dateNow()}.xlsx`
);
};
// watch(
// () => $route.query,
// () => {
// console.log('1231 :>> ', 1231);
// if ($route.path !== '/distribution/artery/VehicleStowageDetails') return;
// onLoad();
// },
// {
// immediate: true,
// }
// );
onLoad();
</script>

11
src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue

@ -55,8 +55,13 @@
</el-button>
<!-- 修改运单收货人 -->
<el-button type="danger" icon="Edit" @click="Modifywaybillrecipient"
>修改运单收货人
<el-button
type="danger"
icon="Edit"
@click="Modifywaybillrecipient"
v-if="$store.getters.permission.distributionStockArticleSelf_changeWaybill"
>
修改运单收货人
</el-button>
<!-- 修改收货单位 -->
@ -186,7 +191,7 @@
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120,200]"
:page-sizes="[30, 50, 80, 120, 200]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"

Loading…
Cancel
Save