⚡ 优化表格工具栏、附件文件名展示与合同金额两位小数
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<basic-container class="loading-manage-page">
|
||||
<div v-if="!isStandalonePage" class="loading-manage-page__search">
|
||||
<div v-if="!isStandalonePage && searchVisible" class="loading-manage-page__search">
|
||||
<el-form :model="searchForm" label-position="right" label-width="88px">
|
||||
<div class="loading-manage-page__search-grid">
|
||||
<el-form-item label="配载单号">
|
||||
@@ -228,17 +228,13 @@
|
||||
<el-button type="primary" plain @click="handleExport">批量导出</el-button>
|
||||
<el-button type="primary" plain @click="handleBatchComplete">批量完成</el-button>
|
||||
</div>
|
||||
<div class="loading-manage-page__toolbar-right">
|
||||
<el-tooltip content="刷新" placement="top">
|
||||
<el-button :icon="Refresh" text @click="loadTable" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="表格密度" placement="top">
|
||||
<el-button :icon="Rank" text @click="toggleTableSize" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="列设置" placement="top">
|
||||
<el-button :icon="Setting" text @click="handleColumnSetting" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<table-header-tools
|
||||
:columns="columnSettingOptions"
|
||||
v-model:visible-column-keys="visibleColumnKeys"
|
||||
v-model:table-size="tableSize"
|
||||
v-model:search-visible="searchVisible"
|
||||
@refresh="loadTable"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
@@ -254,7 +250,12 @@
|
||||
>
|
||||
<el-table-column type="selection" width="52" fixed="left" align="center" />
|
||||
<el-table-column type="index" label="序号" width="58" fixed="left" align="center" />
|
||||
<el-table-column label="配载单号" prop="loadingNo" min-width="170">
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('loadingNo')"
|
||||
label="配载单号"
|
||||
prop="loadingNo"
|
||||
min-width="170"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
type="primary"
|
||||
@@ -264,7 +265,12 @@
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="运单号" prop="loadingSubNos" min-width="220">
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('loadingSubNos')"
|
||||
label="运单号"
|
||||
prop="loadingSubNos"
|
||||
min-width="220"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span class="loading-manage-page__sub-nos">
|
||||
<template v-if="splitText(row.loadingSubNos).length">
|
||||
@@ -283,11 +289,40 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="车牌号" prop="vehicleNo" min-width="170" show-overflow-tooltip />
|
||||
<el-table-column label="司机" prop="driverName" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="联系电话" prop="driverPhone" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="承运类型" prop="carrierType" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="发货地" prop="departureAddress" min-width="180">
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('vehicleNo')"
|
||||
label="车牌号"
|
||||
prop="vehicleNo"
|
||||
min-width="170"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('driverName')"
|
||||
label="司机"
|
||||
prop="driverName"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('driverPhone')"
|
||||
label="联系电话"
|
||||
prop="driverPhone"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('carrierType')"
|
||||
label="承运类型"
|
||||
prop="carrierType"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('departureAddress')"
|
||||
label="发货地"
|
||||
prop="departureAddress"
|
||||
min-width="180"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tooltip
|
||||
v-if="formatFullRouteAddress(row, 'departure')"
|
||||
@@ -304,7 +339,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="途经地" prop="transitAddress" min-width="190">
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('transitAddress')"
|
||||
label="途经地"
|
||||
prop="transitAddress"
|
||||
min-width="190"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tooltip
|
||||
v-if="formatFullRouteAddress(row, 'transit')"
|
||||
@@ -321,7 +361,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="到货地" prop="arrivalAddress" min-width="180">
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('arrivalAddress')"
|
||||
label="到货地"
|
||||
prop="arrivalAddress"
|
||||
min-width="180"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tooltip
|
||||
v-if="formatFullRouteAddress(row, 'arrival')"
|
||||
@@ -338,20 +383,40 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="承运商" prop="carrierName" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="运输方式" prop="transportType" min-width="150" show-overflow-tooltip>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('carrierName')"
|
||||
label="承运商"
|
||||
prop="carrierName"
|
||||
min-width="160"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('transportType')"
|
||||
label="运输方式"
|
||||
prop="transportType"
|
||||
min-width="150"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ transportTypeLabel(row.transportType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据来源" prop="dataSource" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('dataSource')"
|
||||
label="数据来源"
|
||||
prop="dataSource"
|
||||
min-width="130"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('createUserName')"
|
||||
label="创建人"
|
||||
prop="createUserName"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('createTime')"
|
||||
label="创建时间"
|
||||
prop="createTime"
|
||||
min-width="170"
|
||||
@@ -359,6 +424,7 @@
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('updateTime')"
|
||||
label="更新时间"
|
||||
prop="updateTime"
|
||||
min-width="170"
|
||||
@@ -366,12 +432,20 @@
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('currentProcessNode')"
|
||||
label="过程节点"
|
||||
prop="currentProcessNode"
|
||||
min-width="130"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="状态" prop="businessStatus" width="110" fixed="right" align="center">
|
||||
<el-table-column
|
||||
v-if="isColumnVisible('businessStatus')"
|
||||
label="状态"
|
||||
prop="businessStatus"
|
||||
width="110"
|
||||
fixed="right"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span :class="['loading-manage-page__status', `is-${row.businessStatus || 'unknown'}`]">
|
||||
{{ statusText(row) }}
|
||||
@@ -484,12 +558,16 @@
|
||||
<div class="loading-detail__field loading-detail__attachment-field">
|
||||
<span class="loading-detail__label">附件</span>
|
||||
<span class="loading-detail__value"
|
||||
><el-link
|
||||
><span
|
||||
v-for="file in detailAttachments"
|
||||
:key="file.url || file.name"
|
||||
type="primary"
|
||||
class="attachment-file-name"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="previewAttachment(file)"
|
||||
>{{ file.name }}</el-link
|
||||
@keydown.enter="previewAttachment(file)"
|
||||
@keydown.space.prevent="previewAttachment(file)"
|
||||
>{{ file.name }}</span
|
||||
><span v-if="!detailAttachments.length">-</span></span
|
||||
>
|
||||
</div>
|
||||
@@ -1720,7 +1798,8 @@ import {
|
||||
} from '@/option/business/loading-manage';
|
||||
import { option as waybillOption } from '@/option/business/waybill-manage';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Location, Rank, Refresh, Search, Setting } from '@element-plus/icons-vue';
|
||||
import { Location, Rank, Search } from '@element-plus/icons-vue';
|
||||
import TableHeaderTools from '@/components/table-header-tools/main.vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { isMobile } from '@/utils/validate';
|
||||
import { normalizeMapSearchResults, searchAmapPlaceText } from '@/utils/map-search';
|
||||
@@ -1917,10 +1996,31 @@ const uniqueText = (rows, prop) =>
|
||||
),
|
||||
].join('、');
|
||||
|
||||
const LOADING_TABLE_COLUMNS = [
|
||||
{ prop: 'loadingNo', label: '配载单号' },
|
||||
{ prop: 'loadingSubNos', label: '运单号' },
|
||||
{ prop: 'vehicleNo', label: '车牌号' },
|
||||
{ prop: 'driverName', label: '司机' },
|
||||
{ prop: 'driverPhone', label: '联系电话' },
|
||||
{ prop: 'carrierType', label: '承运类型' },
|
||||
{ prop: 'departureAddress', label: '发货地' },
|
||||
{ prop: 'transitAddress', label: '途经地' },
|
||||
{ prop: 'arrivalAddress', label: '到货地' },
|
||||
{ prop: 'carrierName', label: '承运商' },
|
||||
{ prop: 'transportType', label: '运输方式' },
|
||||
{ prop: 'dataSource', label: '数据来源' },
|
||||
{ prop: 'createUserName', label: '创建人' },
|
||||
{ prop: 'createTime', label: '创建时间' },
|
||||
{ prop: 'updateTime', label: '更新时间' },
|
||||
{ prop: 'currentProcessNode', label: '过程节点' },
|
||||
{ prop: 'businessStatus', label: '状态' },
|
||||
];
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Rank,
|
||||
Search,
|
||||
TableHeaderTools,
|
||||
VoucherExecutionDetail,
|
||||
PunchRecordPhotos,
|
||||
},
|
||||
@@ -1928,11 +2028,12 @@ export default {
|
||||
return {
|
||||
Rank,
|
||||
Location,
|
||||
Refresh,
|
||||
Search,
|
||||
Setting,
|
||||
loading: false,
|
||||
tableSize: 'default',
|
||||
searchVisible: true,
|
||||
columnSettingOptions: LOADING_TABLE_COLUMNS,
|
||||
visibleColumnKeys: LOADING_TABLE_COLUMNS.map(column => column.prop),
|
||||
tableData: [],
|
||||
page: {
|
||||
currentPage: 1,
|
||||
@@ -2247,13 +2348,8 @@ export default {
|
||||
selectionChange(rows) {
|
||||
this.selectionRows = rows || [];
|
||||
},
|
||||
toggleTableSize() {
|
||||
const order = ['default', 'small', 'large'];
|
||||
const index = order.indexOf(this.tableSize);
|
||||
this.tableSize = order[(index + 1) % order.length];
|
||||
},
|
||||
handleColumnSetting() {
|
||||
ElMessage.info('列设置按原型保留入口,当前默认展示全部列表字段');
|
||||
isColumnVisible(prop) {
|
||||
return this.visibleColumnKeys.includes(prop);
|
||||
},
|
||||
statusText(row) {
|
||||
return row.businessStatusName || loadingStatusMap[row.businessStatus] || '未知';
|
||||
@@ -4472,8 +4568,7 @@ export default {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.loading-manage-page__toolbar-left,
|
||||
.loading-manage-page__toolbar-right {
|
||||
.loading-manage-page__toolbar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
Reference in New Issue
Block a user