This commit is contained in:
wuweihua
2026-09-22 10:15:22 +08:00
30 changed files with 1089 additions and 122 deletions
@@ -365,6 +365,10 @@ async function getList() {
total.value = res?.total || 0
} catch (e) {
console.error('BasicTable 加载失败', e)
// 查询失败时清空旧结果,避免用户误以为旧列表是本次查询结果。
tableData.value = []
total.value = 0
selectionList.value = []
} finally {
loading.value = false
}
@@ -0,0 +1,74 @@
<template>
<el-popover :width="240" placement="bottom-end" trigger="click" popper-class="column-settings-popper">
<template #reference>
<el-button circle plain icon="Operation" title="列设置" />
</template>
<div class="column-settings">
<div class="column-settings__header">
<span class="column-settings__title">列展示设置</span>
<el-button link type="primary" size="small" @click="emit('reset')">恢复默认</el-button>
</div>
<el-checkbox-group :model-value="checkedKeys" @change="onChange" class="column-settings__body">
<el-checkbox
v-for="c in columns"
:key="c.key"
:value="c.key"
:disabled="c.fixed"
>{{ c.label }}</el-checkbox>
</el-checkbox-group>
</div>
</el-popover>
</template>
<script setup name="ColumnSettings">
/**
* 表格列设置弹窗(与 useColumnSettings 配合):
* <column-settings :columns="columnDefs" :visible-map="colVisible" @toggle="toggleColumn" @reset="resetColumns" />
* 注意:reference 不要嵌套 el-tooltip——两个 popper 组件嵌套会导致引用解析异常。
*/
const props = defineProps({
columns: { type: Array, default: () => [] },
visibleMap: { type: Object, required: true }
})
const emit = defineEmits(['toggle', 'reset'])
const checkedKeys = computed(() =>
props.columns.filter(c => props.visibleMap[c.key] !== false).map(c => c.key)
)
/** el-checkbox-group 回传当前全量勾选值,逐列 diff 后通知父级修改 */
function onChange(keys) {
props.columns.forEach(c => {
if (c.fixed) return
const next = keys.includes(c.key)
if ((props.visibleMap[c.key] !== false) !== next) {
emit('toggle', c.key, next)
}
})
}
</script>
<style scoped>
.column-settings__header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
padding-bottom: 8px;
border-bottom: 1px solid var(--el-border-color-lighter);
}
.column-settings__title {
font-weight: 600;
font-size: 13px;
}
.column-settings__body {
display: flex;
flex-direction: column;
max-height: 320px;
overflow-y: auto;
}
.column-settings__body :deep(.el-checkbox) {
margin-right: 0;
height: 28px;
}
</style>
+3
View File
@@ -57,6 +57,8 @@ import UserName from '@/components/UserName'
import ProductSelect from '@/components/ProductSelect'
// 多值输入组件(一个字段搜索多个值,如订单号批量搜索)
import MultiValueInput from '@/components/MultiValueInput'
// 表格列设置组件(自定义列显隐)
import ColumnSettings from '@/components/ColumnSettings'
const app = createApp(App)
@@ -87,6 +89,7 @@ app.component('UserSelect', UserSelect)
app.component('UserName', UserName)
app.component('ProductSelect', ProductSelect)
app.component('MultiValueInput', MultiValueInput)
app.component('ColumnSettings', ColumnSettings)
app.use(router)
app.use(store)
+15
View File
@@ -200,6 +200,21 @@ export const dynamicRoutes = [
meta: { title: '供应商编辑', activeMenu: '/customersuppliermanagement/supplierinfo' }
}
]
},
{
// 兼容旧入口 /ar/bill/log;正式菜单路由由数据库菜单生成,当前菜单路径为 /ar/log。
path: '/ar/bill/log',
component: Layout,
hidden: true,
permissions: ['ar:log:list'],
children: [
{
path: '',
component: () => import('@/views/ar/bill/log.vue'),
name: 'ArBillLogCompat',
meta: { title: '应收日志', activeMenu: '/ar/log' }
}
]
}
]
+57
View File
@@ -0,0 +1,57 @@
/**
* 表格列显隐偏好(localStorage 持久化)。
*
* @param {string} storageKey 存储键(页面级唯一,如 'customer-list')
* @param {Array<{key:string,label:string,fixed?:boolean,defaultVisible?:boolean}>} columns 列定义
* @returns {{colVisible: object, isColVisible: Function, resetColumns: Function}}
* colVisible 响应式显隐映射,模板中 v-if="isColVisible('xxx')"
* resetColumns 恢复默认(供列设置弹窗调用)
*/
const PREFIX = 'bms:columnSettings:'
export function useColumnSettings(storageKey, columns) {
const defaults = {}
columns.forEach(c => {
defaults[c.key] = c.defaultVisible !== false
})
let saved = {}
try {
saved = JSON.parse(localStorage.getItem(PREFIX + storageKey) || '{}') || {}
} catch (e) {
saved = {}
}
// 仅接受当前列定义中存在的 key(兼容历史存储与列增减)
const colVisible = reactive({ ...defaults })
columns.forEach(c => {
if (Object.prototype.hasOwnProperty.call(saved, c.key)) {
colVisible[c.key] = !!saved[c.key]
}
// 固定列强制可见
if (c.fixed) colVisible[c.key] = true
})
watch(colVisible, val => {
localStorage.setItem(PREFIX + storageKey, JSON.stringify(val))
}, { deep: true })
function isColVisible(key) {
return colVisible[key] !== false
}
/** 单列显隐切换(供 ColumnSettings 组件 @toggle 调用) */
function toggleColumn(key, visible) {
if (Object.prototype.hasOwnProperty.call(colVisible, key) || columns.some(c => c.key === key)) {
colVisible[key] = !!visible
}
}
function resetColumns() {
columns.forEach(c => {
colVisible[c.key] = c.fixed ? true : c.defaultVisible !== false
})
}
return { colVisible, isColVisible, toggleColumn, resetColumns }
}
@@ -1,5 +1,5 @@
<template>
<el-drawer :model-value="modelValue" :title="detail?.billNo || '应收账单详情'" size="1000px" append-to-body destroy-on-close @update:model-value="$emit('update:modelValue', $event)">
<el-drawer class="bill-detail-drawer" :model-value="modelValue" :title="detail?.billNo || '应收账单详情'" size="min(1000px, 100vw)" append-to-body destroy-on-close @update:model-value="$emit('update:modelValue', $event)">
<div v-loading="loading">
<el-empty v-if="!detail" description="暂无详情" />
<template v-else>
@@ -37,6 +37,7 @@
<el-table-column prop="detailNo" label="#" width="55" align="center" />
<el-table-column prop="orderNo" label="订单号" min-width="180" show-overflow-tooltip />
<el-table-column prop="trackingNo" label="运单号" min-width="160" show-overflow-tooltip />
<el-table-column prop="transferNo" label="转单号" min-width="160" show-overflow-tooltip />
<el-table-column label="产品" min-width="150"><template #default="{ row }">{{ row.productName || row.productCode || '-' }}</template></el-table-column>
<el-table-column label="目的地" min-width="120"><template #default="{ row }">{{ row.countryName || row.countryCode || '-' }}</template></el-table-column>
<el-table-column label="重量/尺寸" min-width="170"><template #default="{ row }">{{ row.chargeWeight || '-' }} kg / {{ dimensions(row) }}</template></el-table-column>
@@ -139,6 +140,7 @@ function mask(value) { if (!value) return '-'; return value.length <= 4 ? '****'
</script>
<style scoped>
:deep(.bill-detail-drawer) { max-width: 100vw; }
.summary { margin-bottom: 18px; }
.total { color: #f56c6c; font-size: 16px; font-weight: 600; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; font-weight: 600; }
@@ -6,7 +6,7 @@
<el-col :span="8"><el-form-item label="客户" prop="customerId"><customer-select v-model="generateForm.customerId" placeholder="请选择客户" @change="handleCustomerChange" /></el-form-item></el-col>
<el-col :span="8"><el-form-item label="币种" prop="currency"><el-select v-model="generateForm.currency" placeholder="请选择币种" style="width: 100%;" @change="handleCurrencyChange"><el-option label="人民币 CNY" value="CNY" /><el-option label="美元 USD" value="USD" /></el-select></el-form-item></el-col>
<el-col :span="8"><el-form-item label="账单截止日" prop="cutoffDate"><el-date-picker v-model="generateForm.cutoffDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择账单截止日" style="width: 100%;" @change="resetPreview" /></el-form-item></el-col>
<el-col :span="8"><el-form-item label="订单/运单号"><el-input v-model="generateForm.orderOrTrackingNo" placeholder="请输入订单号或运单号" clearable /></el-form-item></el-col>
<el-col :span="8"><el-form-item label="单号"><el-input v-model="generateForm.orderOrTrackingNo" placeholder="请输入订单号、运单号或转单号" clearable /></el-form-item></el-col>
</el-row>
</el-form>
<div class="payee-card" v-loading="bankAccountLoading">
@@ -60,6 +60,7 @@
<el-table-column type="selection" width="50" fixed="left" :selectable="isMainRowSelectable" />
<el-table-column prop="orderNo" label="订单号" min-width="150" show-overflow-tooltip />
<el-table-column prop="trackingNo" label="运单号" min-width="140" show-overflow-tooltip />
<el-table-column prop="transferNo" label="转单号" min-width="140" show-overflow-tooltip />
<el-table-column prop="customerName" label="客户" min-width="130" show-overflow-tooltip />
<el-table-column prop="bizDate" label="业务日期" width="105" :formatter="formatDateColumn" />
<el-table-column prop="productName" label="产品" min-width="140" show-overflow-tooltip />
@@ -87,13 +88,14 @@
<el-dialog v-model="excludeDialogOpen" title="选择排除订单" width="1100px" append-to-body destroy-on-close @close="handleExcludeDialogClose">
<div class="exclude-toolbar">
<el-input v-model="excludeKeyword" clearable placeholder="请输入订单号或运单号" class="exclude-search-input" />
<el-input v-model="excludeKeyword" clearable placeholder="请输入订单号、运单号或转单号" class="exclude-search-input" />
<el-button type="primary" :loading="excludeLoading" @click="queryExcludeRows">查询</el-button>
</div>
<el-table ref="excludeTableRef" v-loading="excludeLoading" :data="excludeRowsPage" row-key="billId" border stripe max-height="420" empty-text="暂无符合条件的订单" @selection-change="handleExcludeSelectionChange">
<el-table-column type="selection" width="50" fixed="left" />
<el-table-column prop="orderNo" label="订单号" min-width="220" show-overflow-tooltip />
<el-table-column prop="trackingNo" label="运单号" min-width="180" show-overflow-tooltip />
<el-table-column prop="transferNo" label="转单号" min-width="180" show-overflow-tooltip />
<el-table-column prop="customerName" label="客户" min-width="150" show-overflow-tooltip />
<el-table-column prop="bizDate" label="业务日期" width="120" :formatter="formatDateColumn" />
<el-table-column prop="incomeTotal" label="应收金额" width="130" align="right" :formatter="formatNumberColumn" />
@@ -110,6 +110,8 @@
<el-button icon="Refresh" @click="resetReceiptQuery">重置</el-button>
<el-button type="success" icon="Plus" @click="handleAddReceipt"
v-hasPermi="['customersupplier:customerinfo:add']">登记收款</el-button>
<el-button type="warning" icon="Download" @click="handleExportReceipt"
v-hasPermi="['customersupplier:customerinfo:export']">导出</el-button>
</el-form-item>
</el-form>
@@ -220,6 +222,8 @@
<el-form-item>
<el-button type="primary" icon="Search" @click="getFlowList">搜索</el-button>
<el-button icon="Refresh" @click="resetFlowQuery">重置</el-button>
<el-button type="warning" icon="Download" @click="handleExportFlow"
v-hasPermi="['customersupplier:customerinfo:export']">导出</el-button>
</el-form-item>
</el-form>
@@ -296,6 +300,8 @@
<el-form-item>
<el-button type="primary" icon="Search" @click="getCreditFlowList">搜索</el-button>
<el-button icon="Refresh" @click="resetCreditFlowQuery">重置</el-button>
<el-button type="warning" icon="Download" @click="handleExportCreditFlow"
v-hasPermi="['customersupplier:customerinfo:export']">导出</el-button>
</el-form-item>
</el-form>
@@ -918,7 +924,7 @@
</el-dialog>
<!-- ====== 余额核销账单弹窗 ====== -->
<el-dialog title="余额核销账单" v-model="woDialog.visible" width="560px" append-to-body>
<el-dialog title="余额核销账单" v-model="woDialog.visible" width="560px" append-to-body v-loading="woDialog.accountLoading">
<el-descriptions :column="1" border size="small" v-if="woDialog.bill">
<el-descriptions-item label="账单号">{{ woDialog.bill.billNo }}</el-descriptions-item>
<el-descriptions-item label="账单名称">{{ woDialog.bill.billName || '-' }}</el-descriptions-item>
@@ -931,13 +937,12 @@
</el-descriptions>
<el-form :model="woDialog.form" label-width="110px" class="wo-form">
<el-form-item label="本次核销金额" required>
<el-input-number
<el-input
v-model="woDialog.form.writeoffAmount"
:precision="2"
:step="100"
:min="0.01"
controls-position="right"
inputmode="decimal"
clearable
style="width: 220px;"
placeholder="请输入核销金额"
/>
<span class="wo-form-unit">CNY</span>
</el-form-item>
@@ -1356,6 +1361,39 @@ function resetReceiptQuery() {
getReceiptList()
}
/** 导出收款记录(按当前筛选,全量导出) */
function handleExportReceipt() {
const cid = route.query.customerId
if (!cid) return
const params = proxy.addDateRange({ ...receiptQuery }, receiptDateRange.value)
delete params.pageNum
delete params.pageSize
proxy.download('customersupplier/customermoney/receipt/export', params,
`收款记录_${new Date().getTime()}.xlsx`)
}
/** 导出余额流水(按当前筛选,全量导出) */
function handleExportFlow() {
const cid = route.query.customerId
if (!cid) return
const params = proxy.addDateRange({ ...flowQuery }, flowDateRange.value)
delete params.pageNum
delete params.pageSize
proxy.download('customersupplier/customermoney/flow/export', params,
`余额流水_${new Date().getTime()}.xlsx`)
}
/** 导出额度流水(按当前筛选,全量导出) */
function handleExportCreditFlow() {
const cid = route.query.customerId
if (!cid) return
const params = proxy.addDateRange({ ...creditFlowQuery }, creditFlowDateRange.value)
delete params.pageNum
delete params.pageSize
proxy.download('customersupplier/customermoney/credit/flow/export', params,
`额度流水_${new Date().getTime()}.xlsx`)
}
/** 审核通过 */
function handleConfirmReceipt(row) {
proxy.$modal.confirm(`是否确认审核通过收款单「${row.receiptNo}」?审核通过后金额将计入客户余额。`).then(() => {
@@ -1812,7 +1850,8 @@ function loadBillWriteoffData() {
/* ---- 核销弹窗 ---- */
const woSubmitLoading = ref(false)
const woDialog = reactive({ visible: false, bill: null, form: {} })
const woDialog = reactive({ visible: false, bill: null, form: {}, accountLoading: false })
let writeoffAccountRequestSerial = 0
/** 核销后余额预览(不为负则可提交) */
const woAfterBalance = computed(() => {
const balance = Number(currentAccount.value.balance) || 0
@@ -1820,27 +1859,53 @@ const woAfterBalance = computed(() => {
return formatMoney(balance - amount)
})
function openWriteoffDialog(row) {
// 先刷新账户余额,避免用过期余额核销
listAccount(route.query.customerId).then(res => {
accountList.value = res.data || []
})
async function openWriteoffDialog(row) {
const customerId = Number(route.query.customerId)
if (!customerId) {
proxy.$modal.msgError('缺少客户ID,无法发起核销')
return
}
woDialog.bill = row
const balance = Number(currentAccount.value.balance) || 0
const unwritten = Number(row.unwrittenAmount) || 0
woDialog.form = {
arBillId: row.arBillId,
customerId: Number(route.query.customerId),
writeoffAmount: Math.min(unwritten, balance > 0 ? balance : unwritten),
customerId,
// 余额接口返回前先显示 0,避免使用旧余额或在余额为 0 时错误带出整笔未核销金额。
writeoffAmount: 0,
writeoffDate: proxy.parseTime(new Date(), '{y}-{m}-{d}'),
remark: ''
}
woDialog.visible = true
// 必须等待余额刷新完成后再计算默认金额,避免异步请求尚未返回就读取旧余额。
const requestSerial = ++writeoffAccountRequestSerial
woDialog.accountLoading = true
try {
const res = await listAccount(customerId)
if (requestSerial !== writeoffAccountRequestSerial) return
accountList.value = res.data || []
const balance = Math.max(0, Number(currentAccount.value.balance) || 0)
woDialog.form.writeoffAmount = Math.min(unwritten, balance)
} catch (e) {
if (requestSerial !== writeoffAccountRequestSerial) return
woDialog.form.writeoffAmount = 0
proxy.$modal.msgError('账户余额刷新失败,请稍后重试')
} finally {
if (requestSerial === writeoffAccountRequestSerial) woDialog.accountLoading = false
}
}
function submitWriteoff() {
if (woDialog.accountLoading) {
proxy.$modal.msgWarning('正在刷新账户余额,请稍候')
return
}
const bill = woDialog.bill
const amount = Number(woDialog.form.writeoffAmount)
const rawAmount = typeof woDialog.form.writeoffAmount === 'string'
? woDialog.form.writeoffAmount.trim()
: woDialog.form.writeoffAmount
const amount = Number(rawAmount)
if (!(amount > 0)) {
proxy.$modal.msgError('核销金额必须大于0')
return
@@ -115,49 +115,50 @@
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
<column-settings :columns="columnDefs" :visible-map="colVisible" @toggle="toggleColumn" @reset="resetColumns" />
</el-row>
<el-table v-loading="loading" :data="customerList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table v-loading="loading" border :data="customerList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left" />
<!-- <el-table-column label="客户ID" align="center" prop="customerId" />-->
<el-table-column label="客户编码" align="center" prop="customerCode" />
<el-table-column label="客户名称" align="center" prop="customerName" />
<el-table-column label="对外代码" align="center" prop="customerCodeDw" />
<el-table-column label="统一社会信用代码" align="center" prop="creditCode" />
<el-table-column label="业务类型" align="center" prop="customerType">
<el-table-column v-if="isColVisible('customerCode')" label="客户编码" align="center" prop="customerCode" />
<el-table-column v-if="isColVisible('customerName')" label="客户名称" align="center" prop="customerName" :show-overflow-tooltip="true" />
<el-table-column v-if="isColVisible('customerCodeDw')" label="对外代码" align="center" prop="customerCodeDw" />
<el-table-column v-if="isColVisible('creditCode')" label="统一社会信用代码" align="center" prop="creditCode" />
<el-table-column v-if="isColVisible('customerType')" label="业务类型" align="center" prop="customerType">
<template #default="scope">
<dict-tag :options="customer_type" :value="scope.row.customerType" />
</template>
</el-table-column>
<el-table-column label="启用状态" align="center" prop="isEnable">
<el-table-column v-if="isColVisible('isEnable')" label="启用状态" align="center" prop="isEnable">
<template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.isEnable" />
</template>
</el-table-column>
<el-table-column label="业务员" align="center" prop="salesUserId">
<el-table-column v-if="isColVisible('salesUserId')" label="业务员" align="center" prop="salesUserId">
<template #default="scope"><user-name :user-id="scope.row.salesUserId" /></template>
</el-table-column>
<el-table-column label="资金额度" align="center" prop="ed" />
<el-table-column label="回款账期" align="center" prop="zq" />
<el-table-column label="结算员" align="center" prop="settlementUserId">
<el-table-column v-if="isColVisible('ed')" label="资金额度" align="center" prop="ed" />
<el-table-column v-if="isColVisible('zq')" label="回款账期" align="center" prop="zq" />
<el-table-column v-if="isColVisible('settlementUserId')" label="结算员" align="center" prop="settlementUserId">
<template #default="scope"><user-name :user-id="scope.row.settlementUserId" /></template>
</el-table-column>
<el-table-column label="客服" align="center" prop="serviceUserId">
<el-table-column v-if="isColVisible('serviceUserId')" label="客服" align="center" prop="serviceUserId">
<template #default="scope"><user-name :user-id="scope.row.serviceUserId" /></template>
</el-table-column>
<el-table-column label="结算方式" align="center" prop="settlementType">
<el-table-column v-if="isColVisible('settlementType')" label="结算方式" align="center" prop="settlementType">
<template #default="scope">
<dict-tag :options="settlement_type" :value="scope.row.settlementType" />
</template>
</el-table-column>
<el-table-column label="临时额度" align="center" prop="tempEd" />
<el-table-column label="账户余额(CNY)" align="center" prop="accountBalance" width="130">
<el-table-column v-if="isColVisible('tempEd')" label="临时额度" align="center" prop="tempEd" />
<el-table-column v-if="isColVisible('accountBalance')" label="账户余额(CNY)" align="center" prop="accountBalance" width="130">
<template #default="scope">{{ formatBalance(scope.row.accountBalance) }}</template>
</el-table-column>
<el-table-column label="重量阈值" align="center" prop="weightThreshold" />
<el-table-column label="抛比" align="center" prop="throwRatio" />
<el-table-column label="信用额度" align="center" prop="creditEd">
<el-table-column v-if="isColVisible('weightThreshold')" label="重量阈值" align="center" prop="weightThreshold" />
<el-table-column v-if="isColVisible('throwRatio')" label="抛比" align="center" prop="throwRatio" />
<el-table-column v-if="isColVisible('creditEd')" label="信用额度" align="center" prop="creditEd">
<template #default="scope">
<span v-if="Number(scope.row.creditEd) < 0" style="color: var(--el-color-danger); font-weight: 600;"
title="已用额度超过授信总额(如临时额度已到期),客户回款核销后恢复">
@@ -166,7 +167,7 @@
<span v-else>{{ scope.row.creditEd }}</span>
</template>
</el-table-column>
<el-table-column label="绑定产品" align="center" prop="productIds" min-width="180">
<el-table-column v-if="isColVisible('productIds')" label="绑定产品" align="center" prop="productIds" min-width="180">
<template #default="scope">
<span v-if="productNames(scope.row.productIds)" :title="productNames(scope.row.productIds)">
{{ productNames(scope.row.productIds) }}
@@ -174,8 +175,8 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="备注说明" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240">
<el-table-column v-if="isColVisible('remark')" label="备注说明" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240" fixed="right">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['customersupplier:customerinfo:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['customersupplier:customerinfo:remove']">删除</el-button>
@@ -198,9 +199,34 @@
<script setup name="Customer">
import { listCustomer, delCustomer } from "@/api/customersuppliermanagement/customerinfo/customer.js"
import { useProducts, parseProductIds } from '@/components/ProductSelect/useProducts'
import { useColumnSettings } from '@/utils/columnSettings'
const { proxy } = getCurrentInstance()
/** 可自定义列(默认全部可见;选择列固定、操作列固定右侧不参与设置) */
const columnDefs = [
{ key: 'customerCode', label: '客户编码' },
{ key: 'customerName', label: '客户名称' },
{ key: 'customerCodeDw', label: '对外代码' },
{ key: 'creditCode', label: '统一社会信用代码' },
{ key: 'customerType', label: '业务类型' },
{ key: 'isEnable', label: '启用状态' },
{ key: 'salesUserId', label: '业务员' },
{ key: 'ed', label: '资金额度' },
{ key: 'zq', label: '回款账期' },
{ key: 'settlementUserId', label: '结算员' },
{ key: 'serviceUserId', label: '客服' },
{ key: 'settlementType', label: '结算方式' },
{ key: 'tempEd', label: '临时额度' },
{ key: 'accountBalance', label: '账户余额(CNY)' },
{ key: 'weightThreshold', label: '重量阈值' },
{ key: 'throwRatio', label: '抛比' },
{ key: 'creditEd', label: '信用额度' },
{ key: 'productIds', label: '绑定产品' },
{ key: 'remark', label: '备注说明' }
]
const { colVisible, isColVisible, toggleColumn, resetColumns } = useColumnSettings('customer-info-list', columnDefs)
const customerList = ref([])
const loading = ref(true)
const showSearch = ref(true)
@@ -96,53 +96,54 @@
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
<column-settings :columns="columnDefs" :visible-map="colVisible" @toggle="toggleColumn" @reset="resetColumns" />
</el-row>
<el-table v-loading="loading" :data="supplierList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="供应商编码" align="center" prop="supplierCode" />
<el-table-column label="供应商名称" align="center" prop="supplierName" />
<el-table-column label="对外代码" align="center" prop="supplierCodeDw" />
<el-table-column label="统一社会信用代码" align="center" prop="creditCode" />
<el-table-column label="供应商类型" align="center" prop="supplierType">
<el-table v-loading="loading" border :data="supplierList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left" />
<el-table-column v-if="isColVisible('supplierCode')" label="供应商编码" align="center" prop="supplierCode" />
<el-table-column v-if="isColVisible('supplierName')" label="供应商名称" align="center" prop="supplierName" :show-overflow-tooltip="true" />
<el-table-column v-if="isColVisible('supplierCodeDw')" label="对外代码" align="center" prop="supplierCodeDw" />
<el-table-column v-if="isColVisible('creditCode')" label="统一社会信用代码" align="center" prop="creditCode" />
<el-table-column v-if="isColVisible('supplierType')" label="供应商类型" align="center" prop="supplierType">
<template #default="scope">{{ formatOption(supplierTypeOptions, scope.row.supplierType) }}</template>
</el-table-column>
<el-table-column label="启用状态" align="center" prop="isEnable">
<el-table-column v-if="isColVisible('isEnable')" label="启用状态" align="center" prop="isEnable">
<template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.isEnable" />
</template>
</el-table-column>
<el-table-column label="采购员" align="center" prop="purchaserUserId">
<el-table-column v-if="isColVisible('purchaserUserId')" label="采购员" align="center" prop="purchaserUserId">
<template #default="scope"><user-name :user-id="scope.row.purchaserUserId" /></template>
</el-table-column>
<el-table-column label="应付额度" align="center" prop="ed" />
<el-table-column label="应付账期" align="center" prop="zq" />
<el-table-column label="结算员" align="center" prop="settlementUserId">
<el-table-column v-if="isColVisible('ed')" label="应付额度" align="center" prop="ed" />
<el-table-column v-if="isColVisible('zq')" label="应付账期" align="center" prop="zq" />
<el-table-column v-if="isColVisible('settlementUserId')" label="结算员" align="center" prop="settlementUserId">
<template #default="scope"><user-name :user-id="scope.row.settlementUserId" /></template>
</el-table-column>
<el-table-column label="跟单员" align="center" prop="serviceUserId">
<el-table-column v-if="isColVisible('serviceUserId')" label="跟单员" align="center" prop="serviceUserId">
<template #default="scope"><user-name :user-id="scope.row.serviceUserId" /></template>
</el-table-column>
<el-table-column label="结算方式" align="center" prop="settlementType">
<el-table-column v-if="isColVisible('settlementType')" label="结算方式" align="center" prop="settlementType">
<template #default="scope">
<dict-tag :options="settlement_type" :value="scope.row.settlementType" />
</template>
</el-table-column>
<el-table-column label="临时额度" align="center" prop="tempEd" />
<el-table-column label="应付余额" align="center" prop="accountBalance" />
<el-table-column label="外币应付余额" align="center" prop="foreignCurrencyBalance" />
<el-table-column label="信用额度" align="center" prop="creditEd" />
<el-table-column label="重量阈值" align="center" prop="weightThreshold" />
<el-table-column label="抛比" align="center" prop="throwRatio" />
<el-table-column label="合作开始日期" align="center" prop="cooperationStartDate">
<el-table-column v-if="isColVisible('tempEd')" label="临时额度" align="center" prop="tempEd" />
<el-table-column v-if="isColVisible('accountBalance')" label="应付余额" align="center" prop="accountBalance" />
<el-table-column v-if="isColVisible('foreignCurrencyBalance')" label="外币应付余额" align="center" prop="foreignCurrencyBalance" />
<el-table-column v-if="isColVisible('creditEd')" label="信用额度" align="center" prop="creditEd" />
<el-table-column v-if="isColVisible('weightThreshold')" label="重量阈值" align="center" prop="weightThreshold" />
<el-table-column v-if="isColVisible('throwRatio')" label="抛比" align="center" prop="throwRatio" />
<el-table-column v-if="isColVisible('cooperationStartDate')" label="合作开始日期" align="center" prop="cooperationStartDate">
<template #default="scope">{{ formatDateOnly(scope.row.cooperationStartDate) }}</template>
</el-table-column>
<el-table-column label="合作状态" align="center" prop="cooperationStatus">
<el-table-column v-if="isColVisible('cooperationStatus')" label="合作状态" align="center" prop="cooperationStatus">
<template #default="scope">{{ formatOption(cooperationStatusOptions, scope.row.cooperationStatus) }}</template>
</el-table-column>
<el-table-column label="绑定渠道ID" align="center" prop="channelIds" />
<el-table-column label="备注说明" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<el-table-column v-if="isColVisible('channelIds')" label="绑定渠道ID" align="center" prop="channelIds" />
<el-table-column v-if="isColVisible('remark')" label="备注说明" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['customersupplier:supplierinfo:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['customersupplier:supplierinfo:remove']">删除</el-button>
@@ -162,9 +163,37 @@
<script setup name="Supplier">
import { listSupplier, delSupplier } from "@/api/customersuppliermanagement/supplierinfo/supplier.js"
import { useColumnSettings } from '@/utils/columnSettings'
const { proxy } = getCurrentInstance()
/** 可自定义列(默认全部可见;选择列固定、操作列固定右侧不参与设置) */
const columnDefs = [
{ key: 'supplierCode', label: '供应商编码' },
{ key: 'supplierName', label: '供应商名称' },
{ key: 'supplierCodeDw', label: '对外代码' },
{ key: 'creditCode', label: '统一社会信用代码' },
{ key: 'supplierType', label: '供应商类型' },
{ key: 'isEnable', label: '启用状态' },
{ key: 'purchaserUserId', label: '采购员' },
{ key: 'ed', label: '应付额度' },
{ key: 'zq', label: '应付账期' },
{ key: 'settlementUserId', label: '结算员' },
{ key: 'serviceUserId', label: '跟单员' },
{ key: 'settlementType', label: '结算方式' },
{ key: 'tempEd', label: '临时额度' },
{ key: 'accountBalance', label: '应付余额' },
{ key: 'foreignCurrencyBalance', label: '外币应付余额' },
{ key: 'creditEd', label: '信用额度' },
{ key: 'weightThreshold', label: '重量阈值' },
{ key: 'throwRatio', label: '抛比' },
{ key: 'cooperationStartDate', label: '合作开始日期' },
{ key: 'cooperationStatus', label: '合作状态' },
{ key: 'channelIds', label: '绑定渠道ID' },
{ key: 'remark', label: '备注说明' }
]
const { colVisible, isColVisible, toggleColumn, resetColumns } = useColumnSettings('supplier-info-list', columnDefs)
const supplierList = ref([])
const loading = ref(true)
const showSearch = ref(true)
@@ -69,16 +69,16 @@ const schemas = computed(() => [
width: '100%',
props: { maxlength: 50 }
},
// {
// label: '税模式',
// prop: 'taxMode',
// component: 'select',
// placeholder: '请选择',
// dict: 'bms_tax_mode',
// span: 12,
// width: '100%',
// rules: [{ required: true, message: '请选择税模式', trigger: 'change' }]
// },
{
label: '税模式',
prop: 'taxMode',
component: 'select',
placeholder: '请选择',
dict: 'bms_tax_mode',
span: 12,
width: '100%',
rules: [{ required: true, message: '请选择税模式', trigger: 'change' }]
},
{
label: '生效日期',
prop: 'effectiveDate',
@@ -113,7 +113,7 @@ const columns = [
{ prop: 'serviceLevel', label: '时效等级', width: 90, align: 'center' },
{ prop: 'cargoAttr', label: '走货属性', minWidth: 120, slot: 'cargoAttr' },
{ prop: 'destRegion', label: '目的区域', width: 90, align: 'center' },
// { prop: 'taxMode', label: '税模式', width: 90, align: 'center', dict: 'bms_tax_mode' },
{ prop: 'taxMode', label: '税模式', width: 90, align: 'center', dict: 'bms_tax_mode' },
{ prop: 'effectiveDate', label: '生效日期', width: 120, align: 'center' },
{ prop: 'expireDate', label: '失效日期', width: 120, align: 'center' },
{ prop: 'countryCount', label: '国家数', width: 80, align: 'center' },
@@ -125,15 +125,15 @@ const columns = [
const searchColumns = [
{ prop: 'productCode', label: '产品代码', component: 'input', placeholder: '产品代码' },
{ prop: 'productName', label: '产品名称', component: 'input', placeholder: '产品名称' }
// {
// prop: 'taxMode',
// label: '税模式',
// component: 'select',
// dict: 'bms_tax_mode',
// placeholder: '税模式',
// clearable: true
// }
{ prop: 'productName', label: '产品名称', component: 'input', placeholder: '产品名称' },
{
prop: 'taxMode',
label: '税模式',
component: 'select',
dict: 'bms_tax_mode',
placeholder: '税模式',
clearable: true
}
]
function queryList(params) {