✨ 客户列表增加账单入口和权限

This commit is contained in:
caojia
2026-10-27 20:27:06 +08:00
parent db787ec7f7
commit acfdfd5cbf
4 changed files with 42 additions and 4 deletions
@@ -46,7 +46,7 @@ public class CustomerBillController extends BaseController
/**
* 查询指定客户的应收账单(分页)。客户ID来自路径并覆盖查询对象中的同名参数。
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:bill')")
@GetMapping("/list/{customerId}")
public AjaxResult billList(@PathVariable("customerId") Long customerId, ArBillQuery query)
{
@@ -73,7 +73,7 @@ public class CustomerBillController extends BaseController
/**
* 按当前筛选条件导出指定客户的全部应收账单,不受列表分页参数影响。
*/
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:export')")
@PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:bill') and @ss.hasPermi('customersupplier:customerinfo:export')")
@Log(title = "客户账单", businessType = BusinessType.EXPORT)
@PostMapping("/export/{customerId}")
public void export(HttpServletResponse response, @PathVariable("customerId") Long customerId, ArBillQuery query)
@@ -0,0 +1,13 @@
-- 客户信息列表-账单按钮权限
-- 权限标识:customersupplier:customerinfo:bill,挂在「客户管理」(menu_id=2313) 下
-- 默认不授予任何角色,需在系统管理-角色管理中按需授权。
INSERT INTO sys_menu (menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
SELECT '账单', 2313, 7, '', '', '', NULL, 1, 0, 'F', '0', '0', 'customersupplier:customerinfo:bill', '#', 'admin', NOW(), '客户信息列表账单按钮'
WHERE NOT EXISTS (
SELECT 1 FROM sys_menu WHERE perms = 'customersupplier:customerinfo:bill'
);
-- 若此前已执行过本脚本的旧版本,同步更新角色管理中显示的按钮名称。
UPDATE sys_menu
SET menu_name = '账单', remark = '客户信息列表账单按钮'
WHERE perms = 'customersupplier:customerinfo:bill';
@@ -14,7 +14,7 @@
<el-button
icon="Document"
@click="openBillDialog"
v-hasPermi="['customersupplier:customerinfo:list']"
v-hasPermi="['customersupplier:customerinfo:bill']"
>查看账单</el-button>
<el-button
type="primary"
@@ -200,11 +200,12 @@
</template>
</el-table-column>
<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="290" fixed="right">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="370" 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>-->
<el-button link type="primary" icon="Wallet" @click="handleCustomerMoney(scope.row)" v-hasPermi="['customersupplier:customerinfo:balance']">客户余额</el-button>
<el-button link type="primary" icon="Document" @click="handleViewBills(scope.row)" v-hasPermi="['customersupplier:customerinfo:bill']">账单</el-button>
<el-button link type="primary" icon="Document" @click="handleViewLog(scope.row)" v-hasPermi="['customersupplier:customerinfo:query']">日志</el-button>
</template>
@@ -293,6 +294,14 @@
:customer-code="logCustomer.customerCode"
/>
<customer-bill-list-dialog
v-if="billDialogVisible"
:key="billCustomer.customerId"
v-model="billDialogVisible"
:customer-id="billCustomer.customerId"
:customer-name="billCustomer.customerName"
/>
<!-- 右键复制列值 -->
<table-copy-menu
ref="copyMenuRef"
@@ -309,6 +318,7 @@ import { listPriceSetOption, batchBindCustomerPriceSet } from "@/api/customersup
import { useProducts, parseProductCodes } from '@/components/ProductSelect/useProducts'
import { useUsers } from '@/components/UserSelect/useUsers'
import CustomerLogDialog from './components/CustomerLogDialog.vue'
import CustomerBillListDialog from './customermoney/CustomerBillListDialog.vue'
import { useColumnSettings } from '@/utils/columnSettings'
const { proxy } = getCurrentInstance()
@@ -518,6 +528,21 @@ function handleCustomerMoney(row) {
})
}
/** 在客户信息列表内打开只读账单弹窗 */
const billDialogVisible = ref(false)
const billCustomer = ref({})
function handleViewBills(row) {
if (!row || !row.customerId) {
proxy.$modal.msgWarning('客户信息无效,无法查看账单')
return
}
billCustomer.value = {
customerId: row.customerId,
customerName: row.customerName || ''
}
billDialogVisible.value = true
}
/** ========== 批量绑定套餐 ========== */
const batchDialog = reactive({ visible: false, loading: false })