899a8c1c2b
- 票据账册搜索改用 el-check-tag 实现快捷筛选,提升用户交互体验 - 查询按钮增加图标,重置按钮同样添加图标及文字说明 - 调整票据搜索表单标签宽度由160px统一为88px,优化界面一致性 - 全站多处搜索栏表单标签宽度由160px改为88px,涵盖多页面及组件 - 修复业务组件内el-autocomplete输入框宽度适配,避免placeholder被裁剪 - 业务页面货物名称表格列宽由150调整为240,改善显示效果 - 修正系统部门操作列宽度避免按钮竖排溢出问题 - 修改多个表单页和搜索板块样式,确保标签宽度和对齐一致 - 调整表单按钮等样式,提升整体页面美观性和操作友好度
270 lines
8.4 KiB
Vue
270 lines
8.4 KiB
Vue
<template>
|
|
<basic-container class="receipt-flow-page">
|
|
<section class="receipt-flow-page__search">
|
|
<el-form :model="query" label-position="right" label-width="88px" @submit.prevent>
|
|
<div class="receipt-flow-page__search-grid">
|
|
<el-form-item label="认领通知单">
|
|
<el-input v-model="query.receiptNoticeNo" clearable placeholder="请输入" />
|
|
</el-form-item>
|
|
<el-form-item label="对方户名">
|
|
<el-input v-model="query.counterpartyName" clearable placeholder="请输入" />
|
|
</el-form-item>
|
|
<el-form-item label="对方开户行">
|
|
<el-input v-model="query.counterpartyBank" clearable placeholder="请输入" />
|
|
</el-form-item>
|
|
<el-form-item label="对方账号">
|
|
<el-input v-model="query.counterpartyAccount" clearable placeholder="请输入" />
|
|
</el-form-item>
|
|
<el-form-item v-show="searchExpanded" label="摘要">
|
|
<el-input v-model="query.summary" clearable placeholder="请输入" />
|
|
</el-form-item>
|
|
<el-form-item v-show="searchExpanded" label="认领状态">
|
|
<el-select v-model="query.claimStatus" clearable placeholder="请选择">
|
|
<el-option
|
|
v-for="item in claimStatusOptions"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item v-show="searchExpanded" label="交易时间">
|
|
<el-date-picker
|
|
v-model="query.transactionTimeRange"
|
|
type="datetimerange"
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
range-separator="~"
|
|
start-placeholder="开始时间"
|
|
end-placeholder="结束时间"
|
|
clearable
|
|
/>
|
|
</el-form-item>
|
|
</div>
|
|
<div class="receipt-flow-page__search-actions">
|
|
<el-button @click="searchExpanded = !searchExpanded">
|
|
{{ searchExpanded ? '折叠' : '展开' }}
|
|
</el-button>
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
<el-button @click="resetSearch">重置</el-button>
|
|
</div>
|
|
</el-form>
|
|
</section>
|
|
|
|
<section class="receipt-flow-page__table-panel">
|
|
<div class="receipt-flow-page__toolbar">
|
|
<div />
|
|
<el-button
|
|
v-if="hasPermission('receipt_flow_sync')"
|
|
type="primary"
|
|
:loading="syncing"
|
|
@click="handleSync"
|
|
>
|
|
手动同步流水
|
|
</el-button>
|
|
</div>
|
|
<el-table v-loading="loading" :data="rows" border>
|
|
<el-table-column type="index" label="序号" width="64" align="center" />
|
|
<el-table-column
|
|
v-for="column in columns"
|
|
:key="column.prop"
|
|
v-bind="column"
|
|
align="center"
|
|
show-overflow-tooltip
|
|
>
|
|
<template #default="{ row }">
|
|
<el-link v-if="column.link && canClaim(row)" type="primary" @click="openClaim(row)">
|
|
{{ displayValue(row[column.prop]) }}
|
|
</el-link>
|
|
<span v-else-if="column.link">{{ displayValue(row[column.prop]) }}</span>
|
|
<el-tag v-else-if="column.status" :type="statusType(row.claimStatus)" class="status-text">
|
|
{{ displayValue(row[column.prop]) }}
|
|
</el-tag>
|
|
<span v-else-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
|
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="120" fixed="right" align="center">
|
|
<template #default="{ row }">
|
|
<el-link v-if="canClaim(row)" type="primary" @click="openClaim(row)">认领</el-link>
|
|
<span v-else>-</span>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<div class="receipt-flow-page__pagination">
|
|
<el-pagination
|
|
v-model:current-page="page.current"
|
|
v-model:page-size="page.size"
|
|
:total="page.total"
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
@current-change="loadTable"
|
|
@size-change="handleSizeChange"
|
|
/>
|
|
</div>
|
|
</section>
|
|
</basic-container>
|
|
</template>
|
|
|
|
<script>
|
|
import { mapGetters } from 'vuex';
|
|
import * as api from '@/api/payment/receiptFlow';
|
|
import { receiptFlowTableColumns } from '@/option/payment/receiptFlow';
|
|
|
|
const emptyQuery = () => ({
|
|
receiptNoticeNo: '',
|
|
counterpartyName: '',
|
|
counterpartyBank: '',
|
|
counterpartyAccount: '',
|
|
summary: '',
|
|
claimStatus: '',
|
|
transactionTimeRange: [],
|
|
});
|
|
|
|
export default {
|
|
name: 'ReceiptFlow',
|
|
data() {
|
|
return {
|
|
query: emptyQuery(),
|
|
claimStatusOptions: api.claimStatusOptions,
|
|
columns: receiptFlowTableColumns,
|
|
rows: [],
|
|
loading: false,
|
|
syncing: false,
|
|
searchExpanded: false,
|
|
page: { current: 1, size: 10, total: 0 },
|
|
};
|
|
},
|
|
computed: {
|
|
...mapGetters(['permission', 'userInfo']),
|
|
isAdmin() {
|
|
const authority = this.userInfo?.authority;
|
|
return Array.isArray(authority)
|
|
? authority.includes('admin')
|
|
: String(authority || '').includes('admin');
|
|
},
|
|
},
|
|
mounted() {
|
|
this.loadTable();
|
|
},
|
|
methods: {
|
|
unwrapData(response) {
|
|
const body = response?.data || response || {};
|
|
return body?.data || body;
|
|
},
|
|
async loadTable() {
|
|
this.loading = true;
|
|
try {
|
|
const range = this.query.transactionTimeRange || [];
|
|
const data = this.unwrapData(
|
|
await api.getList(this.page.current, this.page.size, {
|
|
...this.query,
|
|
transactionTimeRange: undefined,
|
|
transactionStartTime: range[0],
|
|
transactionEndTime: range[1],
|
|
})
|
|
);
|
|
this.rows = data.records || [];
|
|
this.page.total = Number(data.total || 0);
|
|
} finally {
|
|
this.loading = false;
|
|
}
|
|
},
|
|
handleSearch() {
|
|
this.page.current = 1;
|
|
this.loadTable();
|
|
},
|
|
resetSearch() {
|
|
this.query = emptyQuery();
|
|
this.handleSearch();
|
|
},
|
|
handleSizeChange() {
|
|
this.page.current = 1;
|
|
this.loadTable();
|
|
},
|
|
async handleSync() {
|
|
this.syncing = true;
|
|
try {
|
|
const syncedCount = Number(this.unwrapData(await api.sync()) || 0);
|
|
this.$message.success(`流水同步完成,共同步${syncedCount}条`);
|
|
await this.loadTable();
|
|
} finally {
|
|
this.syncing = false;
|
|
}
|
|
},
|
|
openClaim(row) {
|
|
this.$router.push({
|
|
path: '/payment/receipt-flow/form',
|
|
query: { mode: 'add', id: row.id },
|
|
});
|
|
},
|
|
hasPermission(code) {
|
|
return this.isAdmin || this.validData(this.permission?.[code], false);
|
|
},
|
|
canClaim(row) {
|
|
return this.hasPermission('receipt_flow_claim') && Number(row.remainingAmount || 0) > 0;
|
|
},
|
|
statusType(status) {
|
|
return { claimed: 'success', partial: 'warning', unclaimed: 'info' }[status] || '';
|
|
},
|
|
displayValue(value) {
|
|
return value === null || value === undefined || value === '' ? '-' : value;
|
|
},
|
|
formatMoney(value) {
|
|
return Number(value || 0).toFixed(2);
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.receipt-flow-page__search {
|
|
padding: 12px 12px 4px;
|
|
background: #fff;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
|
}
|
|
.receipt-flow-page__search-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
gap: 8px 24px;
|
|
}
|
|
.receipt-flow-page__search :deep(.el-form-item) {
|
|
margin-bottom: 8px;
|
|
}
|
|
.receipt-flow-page__search :deep(.el-input),
|
|
.receipt-flow-page__search :deep(.el-select),
|
|
.receipt-flow-page__search :deep(.el-date-editor) {
|
|
width: 100%;
|
|
}
|
|
.receipt-flow-page__search-actions {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 8px;
|
|
margin-bottom: 8px;
|
|
}
|
|
.receipt-flow-page__table-panel {
|
|
margin-top: 8px;
|
|
}
|
|
.receipt-flow-page__toolbar {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 12px 0;
|
|
}
|
|
.receipt-flow-page__pagination {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
padding: 16px 0;
|
|
}
|
|
.receipt-flow-page :deep(.el-table) {
|
|
--el-table-border-color: #eff1f7;
|
|
}
|
|
.receipt-flow-page :deep(.el-table__row:nth-child(even) > td.el-table__cell) {
|
|
background: #fafafa;
|
|
}
|
|
@media (max-width: 1200px) {
|
|
.receipt-flow-page__search-grid {
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
}
|
|
}
|
|
</style>
|