Compare commits

..

17 Commits

Author SHA1 Message Date
刘泉佳 3f019c9ac5 feat: 客商档案列表风险列与表单客商名称风险提示
列表新增客商风险列(批量查询,标签按后端 riskLevelName 转义,悬浮显示风险项明细);客商档案表单名称框下高风险/黑名单红字提示(失焦/回显/OCR/金蝶回填触发,查询失败静默)
2026-10-21 17:37:48 +08:00
刘泉佳 90edc4b864 fix: 特批附件归口佐证材料区上传并修复类型被重置为其他文件 2026-10-21 15:48:51 +08:00
刘泉佳 d05f8fd636 feat: 提交审核流统一超时30秒 2026-10-21 12:08:00 +08:00
刘泉佳 d968c418a8 feat: 放宽审批通过接口超时以等待合规推送 2026-10-21 12:07:55 +08:00
刘泉佳 d100e7a271 fix: 复制合同剔除特批附件并主动查询客商风险 2026-10-21 12:07:28 +08:00
刘泉佳 447b2d9d76 fix: 推送合规失败不再重复弹出提示 2026-10-20 22:08:57 +08:00
刘泉佳 603038d5ff fix: 合同详情展示附件类型并在变更页提示风险客商 2026-10-20 22:06:50 +08:00
刘泉佳 673c47771b :feat: 项目立项审批通过展示HCS推送失败原因并增加遮罩 2026-10-20 21:46:03 +08:00
刘泉佳 3168d365d0 :feat: 合同审批通过展示HCS推送失败原因并增加遮罩 2026-10-20 21:45:59 +08:00
刘泉佳 0c4bb7cd82 :feat: 项目立项与合同列表展示金蝶ID并支持同步状态搜索
- 项目立项列表新增金蝶项目ID/金蝶项目编号列
- 合同列表新增金蝶合同ID列
- 两个列表新增是否同步金蝶、是否同步合规搜索条件
2026-10-20 11:05:26 +08:00
刘泉佳 fb91768585 :fix: 客商审核通过后推送金蝶失败原因以警告提示展示 2026-10-15 21:03:30 +08:00
刘泉佳 411fdd2425 :feat: 项目立项与合同列表新增批量推送合规按钮 2026-10-15 19:42:02 +08:00
刘泉佳 7ea96bcdc0 Merge branch 'refs/heads/feature/bfi-api-rate' into feature/hcs-api-p0-web
# Conflicts:
#	src/option/business/contract-manage.js
2026-10-15 04:13:05 +08:00
刘泉佳 b7af496a43 feat: 付款申请收款方风险客商提示条与特批附件提交校验(C101-1 风险查询联动) 2026-10-14 10:03:18 +08:00
刘泉佳 9e5f53702f feat: 合同客商风险管控前端接入——风险提示条与特批说明附件类型
1. 合同表单甲乙方选择后风险提示移至基本信息备注后(橙黄提示条+红色风险客商提示文案,按设计稿),改用后端 risky 统一判定(修复原 fdRiskLevel 等级值匹配不中的问题),展示后端 riskTip 完整风险明细
2. 合同详情基本信息备注后新增风险客商提示行(按推送留痕 hcs_risk_level/hcs_black_status 判定)
3. 附件类型兜底选项增加特批说明(高风险/黑名单客商合同必传,与后端 fileType 校验对齐;正式选项需在业务字典 contract_attachment_type 配置)
2026-10-11 18:08:27 +08:00
刘泉佳 8640238cbe 🔥 移除合规对账功能 2026-10-11 16:27:09 +08:00
刘泉佳 ef1a43f947 feat: 立项与合同HCS前端接入——列表合规状态列/推送合规/合规对账弹窗、合同详情合规信息面板与特批发起、甲乙方客商风险提示、合规主数据页 2026-10-09 19:46:56 +08:00
70 changed files with 1540 additions and 3508 deletions
-16
View File
@@ -124,19 +124,3 @@
另:自定义组件接模板字符串时,切出的模板里 `row.content` 要替换成 `content`(插槽作用域不存在于独立组件里),否则报 `Cannot read properties of undefined (reading 'content')`。
- 校验:编译三个 .vue 的 template + scss 全过;临时验证页 `__route-change-verify.html` 与 8899 端口静态服务已删除/停止。
- 未处理(等用户确认):备注列的 `show-overflow-tooltip` 保持原样(属全站约定),用户若要求连备注一起去掉再单独改。
## 16:45 付款申请表单「结算单号」字段交互歧义修复(方案 A)
- 现象(用户截图圈出):`/payment/payment-application/form` 结算单号是 `el-select multiple`,placeholder 写「请输入」但**打不进去字**,必须先猜到要点右边「选择」才有效。
- 根因(双重的):
1. 该 `el-select` 的 `:model-value` 绑只读 computed `referenceSettlementNos`(= 已选单号本身),**options 就是它自己** → 点开下拉、点选项,值不变;代码里 `handleSettlementSelectVisible` 甚至主动 blur 掉下拉。真正改值的只有右侧「选择」按钮。
2. placeholder 写「请输入」但控件不可输入(未开 `filterable`),且 `.el-tag__close{display:none}` 藏了删除叉 → 视觉上更像输入框。全站规矩是「请输入/请选择」二选一,这里是选择语义。
- 落地(只改 `views/payment/payment-application-form.vue`,全站 `openReference`/`referenceSettlementNos` 无第二处引用):
- 模板:`el-select` → `el-input readonly` + 外层 `el-tooltip`,`:model-value="referenceDisplayText"`,`placeholder="请输入"`,`:disabled="readonly"`,**`@click="!readonly && openReference()"` 让整框可点开弹窗**;右侧「选择」按钮保留。
- 新增 computed:`referenceSettlementCount`、`referenceDisplayText`(单张显示单号;**多张只显示 `已选 N 张结算单`**,完整单号靠 tooltip,明细看下方「结算信息」表)。
- 删除 `handleSettlementSelectVisible` 方法与 `settlementNoSelectRef`;样式 `.payment-form-page__settlement-select{,:deep(...)}` → `.payment-form-page__settlement-input`(+ `cursor:pointer` / disabled 时 `not-allowed`)。
- ⚠️ 踩坑:第一版把「共 N 张」做成 `el-input` 的 `#suffix` 插槽 → span=6 的窄列里后缀挤占宽度,单号被截成 `JS202610`,比不改还差。**窄列(≤span6)不要在输入框内塞后缀/前缀,把信息编进 `:model-value` 文本本身**。
- 验证(项目根临时 html + `vue/dist/vue.esm-bundler.js`,用完即删):
- ⚠️ 临时页必须 import `vue/dist/vue.esm-bundler.js`,默认 `vue` 是 runtime-only,字符串 template 报 “runtime compilation is not supported”。
- 4 态实测:空值 placeholder 正确 / 单张显单号 / 多张显「已选 3 张结算单」且不截断 / 查看态 disabled 且按钮隐藏;输入框宽 132px、行高 32px。
- 点击探针验证:可编辑态点 `.el-input` 命中 1 次(el-tooltip 不拦截 click),查看态命中 0 次 ✓。
-7
View File
@@ -1,7 +0,0 @@
# 2026-10-15
## 10:46 付款申请表单「结算单号」修复丢失 → 重放并提交
- 现象:用户反馈昨天改好的「结算单号」(只读输入框 + 整框可点开选择弹窗)今天又变回旧的 `el-select` 写法。
- 根因:昨天的改动**一直没有 commit**,是纯工作区改动;用户 pull(HEAD 到 9919fb9,两个 settlement 样式提交包含该文件旧版)后被覆盖。教训同 2026-09-18「漏提交新文件」一役:**本仓库改动必须尽快显式 commit**,`git status` 干净 ≠ 改动还在。
- 处理:按昨天方案 A 原样重放 4 处修改(模板 el-select→el-input readonly+tooltip+整框可点、新增 `referenceSettlementCount`/`referenceDisplayText` computed、删 `handleSettlementSelectVisible`、样式类改名 `__settlement-input` + cursor 规则),curl 自检 vue/style 均 200。
- **这次只提交该单文件**:`git commit -m ":bug: ..." -- src/views/payment/payment-application-form.vue` → `db03ced`(`.workbuddy/memory` 不入库,留在工作区)。尚未 push,等用户确认。
+1 -1
View File
@@ -66,7 +66,7 @@
## 表单 / 自检 / 导出
- placeholder 只写 `请输入`/`请选择`;例外:`请输入或选择车辆`、日期区间 `起`/`止`、示例值。校验 message 须带字段名。
- `business-crud-page.vue`:option 经 `cloneOption` 克隆,独立表单页走 `PageAvueForm`。
- 自检:`curl "localhost:2888/src/xxx.vue"` 与 `"...?vue&type=style&index=0&scoped=true&lang.scss"`(200 / 500)。`vite build` 在 `facelogin.vue` 被沙箱中断,不能作唯一校验。dev `VITE_APP_API=/api` 代理 `172.16.203.228:8000`。
- 自检:`curl "localhost:2889/src/xxx.vue"` 与 `"...?vue&type=style&index=0&scoped=true&lang.scss"`(200 / 500)。`vite build` 在 `facelogin.vue` 被沙箱中断,不能作唯一校验。dev `VITE_APP_API=/api` 代理 `172.16.203.228:8000`。
- 导出:前端 `exportColumns` 后端未用,以 `XxxExportExcel.java` 为准;BladeX `BeanUtil` 类型不兼容静默跳过(`Date` → `LocalDateTime` 丢值,用 `DateUtil.fromDate`)。
## Element Plus 图标两种用法的机制差异(易误判)
+95 -415
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -36,6 +36,8 @@ export const approve = id =>
url: `${baseUrl}/approve`,
method: 'post',
params: { id },
// 审批通过后同步推送合规(附件转传可达 20s+),覆盖全局 10s 超时
timeout: 120000,
});
export const reject = id =>
+96
View File
@@ -0,0 +1,96 @@
import request from '@/axios';
const baseUrl = '/blade-transport/hcs';
// 合规推送涉及 HCS 远程多次调用(风险校验+附件转传+起草),可达 20s+,覆盖全局 10s 超时
export const repush = (bizType, id) =>
request({
url: `${baseUrl}/sync/${bizType}/${id}`,
method: 'post',
timeout: 60000,
});
// 批量推送为逐条同步推送,耗时随勾选行数线性增长,进一步放宽超时
export const repushBatch = (bizType, ids) =>
request({
url: `${baseUrl}/sync/${bizType}/batch`,
method: 'post',
data: ids,
timeout: 300000,
});
export const getTemplates = () =>
request({
url: `${baseUrl}/master-data/template`,
method: 'get',
});
export const refreshMasterData = () =>
request({
url: `${baseUrl}/master-data/refresh`,
method: 'post',
timeout: 60000,
});
export const getRisk = customerCode =>
request({
url: `${baseUrl}/risk`,
method: 'get',
params: { customerCode },
timeout: 30000,
});
// 客商风险批量查询(客商列表页展示用):入参编号数组,后端逐个查 C101-1,单个失败跳过
export const getRiskBatch = customerCodes =>
request({
url: `${baseUrl}/risk/batch`,
method: 'get',
params: { customerCodes: (customerCodes || []).join(',') },
timeout: 60000,
});
// 客商风险按名称查询(客商档案表单展示用):名称反查编号后口径同编号查询
export const getRiskByName = customerName =>
request({
url: `${baseUrl}/risk/by-name`,
method: 'get',
params: { customerName },
timeout: 30000,
});
export const uploadAttachment = formData =>
request({
url: `${baseUrl}/attachment/upload`,
method: 'post',
data: formData,
timeout: 60000,
});
export const downloadAttachment = (fdId, name) =>
request({
url: `${baseUrl}/attachment/download`,
method: 'get',
params: { fdId, name },
responseType: 'blob',
timeout: 120000,
});
export const applyContractSpec = data =>
request({
url: `${baseUrl}/contract/spec-apply`,
method: 'post',
data,
timeout: 60000,
});
export const confirmContractSpec = (id, result) =>
request({
url: `${baseUrl}/contract/spec/confirm`,
method: 'post',
params: { id, result },
});
export const unwrapData = response => {
const data = response?.data?.data ?? response?.data;
return data && typeof data === 'object' && 'data' in data ? data.data : data;
};
+2
View File
@@ -43,6 +43,8 @@ export const approve = id =>
url: `${baseUrl}/approve`,
method: 'post',
params: { id },
// 审批通过后同步推送合规(远程多次调用),覆盖全局 10s 超时
timeout: 60000,
});
export const reject = id =>
-7
View File
@@ -10,13 +10,6 @@ export const getReferenceAmount = (paymentType, referenceId, excludeId) =>
method: 'get',
params: { paymentType, referenceId, excludeId: excludeId || undefined },
});
/** 按合同查询可选项目预付核销列表(审批通过且仍有可核销余额) */
export const getProjectAdvanceWriteOffOptions = params =>
request({
url: `${baseUrl}/project-advance-write-off-options`,
method: 'get',
params,
});
export const save = data => request({ url: `${baseUrl}/save`, method: 'post', data });
export const remove = id => request({ url: `${baseUrl}/remove`, method: 'post', params: { id } });
export const submit = data => request({ url: `${baseUrl}/submit`, method: 'post', data });
-2
View File
@@ -24,8 +24,6 @@ export const getContractList = (current, size, params) =>
export const getFeeOptions = () => request({ url: `${baseUrl}/fee-options`, method: 'get' });
export const getNextNo = () => request({ url: `${baseUrl}/next-no`, method: 'get' });
export const getCandidateDetails = (current, size, params) =>
request({
url: `${baseUrl}/candidate-details`,
-55
View File
@@ -1,55 +0,0 @@
import request from '@/axios';
const baseUrl = '/blade-transport/settlement-import';
export const getOptions = () => request({ url: `${baseUrl}/options`, method: 'get' });
export const getNextCode = () => request({ url: `${baseUrl}/next-code`, method: 'get' });
export const getList = (current, size, params) =>
request({
url: `${baseUrl}/list`,
method: 'get',
params: { current, size, ...params },
});
export const getDetail = id =>
request({ url: `${baseUrl}/detail`, method: 'get', params: { id } });
export const exportTemplate = () =>
request({
url: `${baseUrl}/export-template`,
method: 'get',
responseType: 'blob',
});
export const parseFile = file => {
const data = new FormData();
data.append('file', file);
return request({
url: `${baseUrl}/parse`,
method: 'post',
data,
timeout: 120000,
});
};
export const validate = data =>
request({ url: `${baseUrl}/validate`, method: 'post', data, timeout: 120000 });
export const exportFailures = data =>
request({
url: `${baseUrl}/export-failures`,
method: 'post',
data,
responseType: 'blob',
timeout: 120000,
});
export const saveDraft = data =>
request({ url: `${baseUrl}/draft`, method: 'post', data, timeout: 120000 });
export const confirm = data =>
request({ url: `${baseUrl}/confirm`, method: 'post', data, timeout: 120000 });
export const voidBatch = data => request({ url: `${baseUrl}/void`, method: 'post', data });
+5
View File
@@ -1,5 +1,8 @@
import request from '@/axios';
/** 提交审核流(MK)统一超时:客商/项目/合同/预结算/正式结算/付款/开票/收票/汇票付款 */
export const MK_SUBMIT_TIMEOUT = 30000;
/**
* 调用 MK processSubmit 提交审核流
* @param {Object} data
@@ -15,6 +18,7 @@ export const processSubmit = data => {
url: '/blade-system/businessProcess/processSubmit',
method: 'post',
data,
timeout: MK_SUBMIT_TIMEOUT,
});
};
@@ -28,6 +32,7 @@ export const processDelete = data => {
url: '/blade-system/businessProcess/processDelete',
method: 'post',
data,
timeout: MK_SUBMIT_TIMEOUT,
});
};
+1 -3
View File
@@ -77,8 +77,7 @@ export const syncOaDepartment = (
size = 20,
signal,
incremental = false,
modifiedSince,
companyOaId
modifiedSince
) => {
return request({
url: '/blade-system/dept/sync-oa-department',
@@ -88,7 +87,6 @@ export const syncOaDepartment = (
size,
incremental: !!incremental,
modifiedSince: modifiedSince || undefined,
companyOaId: companyOaId || undefined,
},
timeout: 60000,
signal,
+12 -1
View File
@@ -1,4 +1,4 @@
export const transportTypeOptions = [
export const transportTypeOptions = [
{ label: '公路运输', value: '公路运输' },
{ label: '铁路运输', value: '铁路运输' },
{ label: '水路运输', value: '水路运输' },
@@ -143,6 +143,17 @@ export const contractArchiveStatusOptions = [
{ label: '已归档', value: '已归档' },
];
export const hcsSyncStatusOptions = [
{ label: '待推送', value: 'unsynced' },
{ label: '已推送', value: 'synced' },
{ label: '推送失败', value: 'failed' },
];
export const yesNoOptions = [
{ label: '是', value: true },
{ label: '否', value: false },
];
export const nodeOptions = [
{ label: '接单', value: '接单' },
{ label: '到场', value: '到场' },
+46
View File
@@ -7,9 +7,11 @@ import {
createCrudOption,
effectiveTypeOptions,
nonNegativeRule,
hcsSyncStatusOptions,
selectRule,
signTypeOptions,
textRule,
yesNoOptions,
} from './common';
const contractSettlementModeOptions = [
@@ -606,6 +608,50 @@ export const option = createCrudOption([
addDisplay: false,
editDisplay: false,
},
{
label: '合规状态',
prop: 'hcsSyncStatus',
type: 'select',
search: true,
searchOrder: 6,
searchPlaceholder: '请选择',
slot: true,
dicData: hcsSyncStatusOptions,
minWidth: 110,
addDisplay: false,
editDisplay: false,
},
{
label: '金蝶合同ID',
prop: 'kingdeeId',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '是否同步金蝶',
prop: 'kingdeeSynced',
type: 'select',
search: true,
searchPlaceholder: '请选择',
searchOrder: 7,
dicData: yesNoOptions,
hide: true,
addDisplay: false,
editDisplay: false,
},
{
label: '是否同步合规',
prop: 'hcsSynced',
type: 'select',
search: true,
searchPlaceholder: '请选择',
searchOrder: 8,
dicData: yesNoOptions,
hide: true,
addDisplay: false,
editDisplay: false,
},
{
label: '当前节点',
prop: 'currentNode',
+54 -2
View File
@@ -3,6 +3,7 @@ import {
businessModeOptions,
businessTypeOptions,
createCrudOption,
hcsSyncStatusOptions,
nonNegativeRule,
projectApprovalStatusOptions,
projectSourceOptions,
@@ -10,6 +11,7 @@ import {
selectRule,
settlementModeOptions,
textRule,
yesNoOptions,
} from './common';
const projectEffectiveTypeOptions = [
@@ -97,8 +99,7 @@ export const config = {
action: 'startChange',
label: '变更',
statusProp: 'approvalStatus',
// 立项通过、变更通过后均可再次发起变更
status: ['approved', 'change_approved'],
status: ['approved'],
permission: 'project_apply_change',
},
],
@@ -406,6 +407,57 @@ export const option = createCrudOption([
addDisplay: false,
editDisplay: false,
},
{
label: '合规状态',
prop: 'hcsSyncStatus',
type: 'select',
search: true,
searchPlaceholder: '请选择',
searchOrder: 1,
slot: true,
dicData: hcsSyncStatusOptions,
minWidth: 110,
addDisplay: false,
editDisplay: false,
},
{
label: '金蝶项目ID',
prop: 'kingdeeId',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '金蝶项目编号',
prop: 'kingdeeNumber',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '是否同步金蝶',
prop: 'kingdeeSynced',
type: 'select',
search: true,
searchPlaceholder: '请选择',
searchOrder: 2,
dicData: yesNoOptions,
hide: true,
addDisplay: false,
editDisplay: false,
},
{
label: '是否同步合规',
prop: 'hcsSynced',
type: 'select',
search: true,
searchPlaceholder: '请选择',
searchOrder: 3,
dicData: yesNoOptions,
hide: true,
addDisplay: false,
editDisplay: false,
},
{
label: '生效类型',
prop: 'effectiveType',
@@ -35,8 +35,8 @@ export const sourceColumns = [
];
export const detailColumns = [
{ label: '单据号', prop: 'documentNo', minWidth: 180, link: true },
{ label: '运单号', prop: 'waybillNo', minWidth: 160, link: true },
{ label: '单据号', prop: 'documentNo', minWidth: 180 },
{ label: '运单号', prop: 'waybillNo', minWidth: 160 },
{ label: '车号', prop: 'vehicleNo', minWidth: 130 },
{ label: '发货地址', prop: 'departureAddress', minWidth: 180 },
{ label: '到货地址', prop: 'arrivalAddress', minWidth: 180 },
+1 -1
View File
@@ -40,7 +40,7 @@ export const settlementSummaryColumns = [
export const settlementDetailColumns = [
{ label: '单据号', prop: 'documentNo', minWidth: 180, link: true },
{ label: '运单号', prop: 'waybillNo', minWidth: 160, link: true },
{ label: '运单号', prop: 'waybillNo', minWidth: 160 },
{ label: '车号', prop: 'vehicleNo', minWidth: 130 },
{ label: '发货地址', prop: 'departureAddress', minWidth: 180 },
{ label: '到货地址', prop: 'arrivalAddress', minWidth: 180 },
-15
View File
@@ -119,21 +119,6 @@ export default [
},
],
},
{
path: '/settlement/settlement-import/form',
component: Layout,
children: [
{
path: '',
name: '新增导入结算单',
meta: {
keepAlive: false,
activeMenu: '/settlement/settlement-import',
},
component: loadView(() => import('@/views/settlement/settlement-import-form.vue')),
},
],
},
{
path: '/settlement/transport-reconciliation/form',
component: Layout,
+13 -65
View File
@@ -61,18 +61,9 @@ export const MK_BIZ = {
const MK_SWITCH_NAME = '开启MK';
/** 进程内缓存,避免每次提交都打字典;登录后同一会话开关一般不变 */
let mkEnabledCache = null;
let mkEnabledPromise = null;
let mkTemplateListCache = null;
async function loadMkTemplateList(force = false) {
if (!force && mkTemplateListCache) {
return mkTemplateListCache;
}
async function loadMkTemplateList() {
const res = await getDictionary({ code: 'mk_template' });
mkTemplateListCache = res?.data?.data || [];
return mkTemplateListCache;
return res?.data?.data || [];
}
/** 业务字典 mk_template:名称「开启MK」且键值为 1 时才请求 MK */
@@ -81,37 +72,10 @@ export function isMkEnabled(list = []) {
return String(matched?.dictKey ?? '').trim() === '1';
}
/** 清除 MK 开关缓存(字典变更后可调用) */
export function clearMkEnabledCache() {
mkEnabledCache = null;
mkEnabledPromise = null;
mkTemplateListCache = null;
}
/**
* 加载业务字典并判断是否开启 MK
* @param {boolean} [force=false] 是否强制刷新缓存
*/
export async function loadMkEnabled(force = false) {
if (!force && mkEnabledCache !== null) {
return mkEnabledCache;
}
if (!force && mkEnabledPromise) {
return mkEnabledPromise;
}
mkEnabledPromise = loadMkTemplateList(force)
.then(list => {
mkEnabledCache = isMkEnabled(list);
return mkEnabledCache;
})
.catch(error => {
mkEnabledCache = false;
throw error;
})
.finally(() => {
mkEnabledPromise = null;
});
return mkEnabledPromise;
/** 加载业务字典并判断是否开启 MK */
export async function loadMkEnabled() {
const list = await loadMkTemplateList();
return isMkEnabled(list);
}
export async function resolveMkTemplateCode(dictName, list) {
@@ -135,22 +99,19 @@ export function isMkApprovedStatus(bizType, approvalStatus) {
}
/**
* 提交 MK 审核流。未开启 MK 时直接跳过,不请求流程实例相关接口。
* 提交 MK 审核流
* @param {Object} options
* @param {string} options.bizType 业务类型
* @param {string|number} options.bizId 业务主键
* @param {string|number} options.bizId 业务主键(后端据此生成/复用 formInstanceId)
* @param {string} [options.subjectName] 标题后缀
* @param {string} [options.approvalStatus] 提交前的审批状态
* @param {boolean} [options.mkEnabled] 调用方已知开关时传入,false 时立即跳过
* @returns {Promise<boolean>} true=已发起/复用 MK 流程,false=未开启或已跳过
* @param {string} [options.approvalStatus] 提交前的审批状态(须在业务 submit 改状态前取值;通过态强制新建实例)
*/
export async function submitMkApprovalFlow({
bizType,
bizId,
subjectName = '',
approvalStatus = '',
mkEnabled,
} = {}) {
}) {
const conf = MK_BIZ[bizType];
if (!conf) {
return Promise.reject(new Error(`不支持的MK业务类型:${bizType}`));
@@ -158,29 +119,17 @@ export async function submitMkApprovalFlow({
if (bizId == null || bizId === '') {
return Promise.reject(new Error('业务id不能为空'));
}
// 调用方显式关闭,或字典未开启:不请求 hasMkProcessInstance / processSubmit 等 MK 接口
if (mkEnabled === false) {
return false;
}
const enabled = mkEnabled === true ? true : await loadMkEnabled();
if (!enabled) {
return false;
}
const list = await loadMkTemplateList();
if (!isMkEnabled(list)) {
mkEnabledCache = false;
return false;
return;
}
const bizIdText = String(bizId);
const forceNewFormInstance = isMkApprovedStatus(bizType, approvalStatus);
// 审核通过后再提交必须新建流程;其余场景已有有效实例则跳过
if (!forceNewFormInstance) {
const existsRes = await hasMkProcessInstance({ bizId: bizIdText });
if (existsRes?.data?.data) {
return true;
return;
}
}
if ((conf.rejected || []).includes(approvalStatus)) {
@@ -190,12 +139,11 @@ export async function submitMkApprovalFlow({
const subject = subjectName
? `${conf.subjectPrefix}:${subjectName}`
: `${conf.subjectPrefix}:${bizIdText}`;
await processSubmit({
return processSubmit({
templateCode,
bizId: bizIdText,
subject,
bizType,
forceNewFormInstance,
});
return true;
}
-32
View File
@@ -1,35 +1,3 @@
/**
* 合并列表搜索条件:新条件覆盖旧条件,本次显式清空的字段从查询中移除。
*/
export const applyIncomingSearch = (current = {}, incoming = {}) => {
const merged = { ...current, ...incoming };
Object.keys(incoming || {}).forEach(key => {
const value = incoming[key];
if (
value === '' ||
value === null ||
value === undefined ||
(Array.isArray(value) && value.length === 0)
) {
delete merged[key];
}
});
return merged;
};
/**
* 启停状态下拉「全部」在数字类型下会被转成 0/-1,不能当作查询条件。
* 状态 0 表示草稿等有效值的页面不要调用。
*/
export const omitInvalidListStatus = (params = {}) => {
const values = { ...params };
const status = values.status;
if (status === 0 || status === '0' || status === -1 || status === '-1') {
delete values.status;
}
return values;
};
export const normalizeSearchRangeParams = (params = {}, rangeMap = {}) => {
const values = { ...params };
-51
View File
@@ -1,51 +0,0 @@
import { getList as getReceivablePayableDetailList } from '@/api/settlement/receivable-payable-detail';
import { getList as getWaybillList } from '@/api/business/waybill-manage';
// 结算明细的「单据号」是应收应付明细单据号(应收 YS…/应付 YF…),按结算类型落到对应菜单页
const SETTLEMENT_DETAIL_PATHS = {
receivable: '/settlement/receivable-detail',
payable: '/settlement/payable-detail',
};
const unwrapPage = response => {
const body = response?.data || response || {};
return body?.data || body;
};
const firstRecordId = data => (Array.isArray(data) ? data : data?.records || [])[0]?.id || '';
export const settlementDetailPath = settlementType =>
SETTLEMENT_DETAIL_PATHS[settlementType] || SETTLEMENT_DETAIL_PATHS.payable;
/**
* 结算明细行「单据号」对应的应收应付明细ID:已落库的明细自带 sourceDetailId,未落库的行按单据号回查。
*/
export const resolveReceivablePayableDetailId = async (row = {}, settlementType) => {
if (row.sourceDetailId) return row.sourceDetailId;
if (!row.documentNo) return '';
try {
const data = unwrapPage(
await getReceivablePayableDetailList(1, 1, {
documentNo: row.documentNo,
settlementType,
})
);
return firstRecordId(data);
} catch (error) {
return '';
}
};
/**
* 结算明细行「运单号」对应的运单ID:总单来源的明细没有 waybillId(运单号列存的是总单号),按运单号回查。
*/
export const resolveWaybillId = async (row = {}) => {
if (row.waybillId) return row.waybillId;
if (!row.waybillNo) return '';
try {
const data = unwrapPage(await getWaybillList(1, 1, { waybillNo: row.waybillNo }));
return firstRecordId(data);
} catch (error) {
return '';
}
};
+1 -2
View File
@@ -150,7 +150,6 @@ import { mapGetters } from 'vuex';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { formatUpdateUserName } from '@/utils/audit';
import { omitInvalidListStatus } from '@/utils/search-range';
import { getToken, isAdministrator } from '@/utils/auth';
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
@@ -1183,7 +1182,7 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, omitInvalidListStatus({ ...params, ...this.query }))
getList(page.currentPage, page.pageSize, { ...params, ...this.query })
.then(res => {
const data = res.data.data;
this.page.total = data.total;
+1 -2
View File
@@ -104,7 +104,6 @@ import { mapGetters } from 'vuex';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { formatUpdateUserName } from '@/utils/audit';
import { omitInvalidListStatus } from '@/utils/search-range';
import { getToken } from '@/utils/auth';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
@@ -508,7 +507,7 @@ export default {
this.onLoad(this.page, this.query);
},
buildQuery(params = {}) {
const values = omitInvalidListStatus({ ...params, ...this.query });
const values = { ...params, ...this.query };
const rangeMap = {
effectiveDateRange: ['effectiveDateStart', 'effectiveDateEnd'],
expiryDateRange: ['expiryDateStart', 'expiryDateEnd'],
+1 -2
View File
@@ -63,7 +63,6 @@
<script>
import { getList, getDetail, submit, remove, changeStatus } from '@/api/base/customer-type';
import { omitInvalidListStatus } from '@/utils/search-range';
import { mapGetters } from 'vuex';
export default {
@@ -291,7 +290,7 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, omitInvalidListStatus(Object.assign(params, this.query))).then(res => {
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
+1 -2
View File
@@ -97,7 +97,6 @@ import { exportBlob } from '@/api/common';
import { getDictionaryAll } from '@/api/system/dictbiz';
import { getDeptTree } from '@/api/system/dept';
import { downloadXls } from '@/utils/util';
import { omitInvalidListStatus } from '@/utils/search-range';
import { getToken } from '@/utils/auth';
import { Download } from '@element-plus/icons-vue';
import { mapGetters } from 'vuex';
@@ -570,7 +569,7 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, omitInvalidListStatus(Object.assign(params, this.query))).then(res => {
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
+1 -2
View File
@@ -82,7 +82,6 @@
import { mapGetters } from 'vuex';
import { changeStatus, getDetail, getList, remove, submit } from '@/api/base/measurement-unit';
import { createOption } from '@/option/base/measurement-unit';
import { omitInvalidListStatus } from '@/utils/search-range';
import { isAdministrator } from '@/utils/auth';
export default {
@@ -219,7 +218,7 @@ export default {
},
onLoad(page = this.page, params = this.query) {
this.loading = true;
return getList(page.currentPage, page.pageSize, omitInvalidListStatus(params))
return getList(page.currentPage, page.pageSize, params)
.then(res => {
const pageData = res.data.data || {};
this.data = pageData.records || [];
+1 -2
View File
@@ -270,7 +270,6 @@ import { mapGetters } from 'vuex';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { formatUpdateUserName } from '@/utils/audit';
import { omitInvalidListStatus } from '@/utils/search-range';
import { getToken, isAdministrator } from '@/utils/auth';
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
@@ -1637,7 +1636,7 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, omitInvalidListStatus({ ...params, ...this.query }))
getList(page.currentPage, page.pageSize, { ...params, ...this.query })
.then(res => {
const data = res.data.data;
this.page.total = data.total;
+1 -2
View File
@@ -150,7 +150,6 @@ import { mapGetters } from 'vuex';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { formatUpdateUserName } from '@/utils/audit';
import { omitInvalidListStatus } from '@/utils/search-range';
import { getToken, isAdministrator } from '@/utils/auth';
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
@@ -1158,7 +1157,7 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, omitInvalidListStatus({ ...params, ...this.query }))
getList(page.currentPage, page.pageSize, { ...params, ...this.query })
.then(res => {
const data = res.data.data;
this.page.total = data.total;
+7 -52
View File
@@ -396,11 +396,8 @@ export default {
return this.selectionList.map(item => item.id).join(',');
},
},
created() {
// 超管默认查全部组织,不预填组织筛选;普通用户预填当前组织。
if (!this.isAdmin) {
this.applyDefaultDeptSearch();
}
created() {
this.applyDefaultDeptSearch();
this.initDeptTree();
},
methods: {
@@ -458,23 +455,10 @@ export default {
normalizeListQuery(params = {}) {
// 搜索条件优先于缓存的 query,避免默认组织 ID 覆盖用户新选择的组织。
const query = { ...this.query, ...params };
// 本次搜索显式带了组织字段时,以本次为准(含清空);否则沿用缓存。
const hasDeptInParams =
Object.prototype.hasOwnProperty.call(params, 'deptId') ||
Object.prototype.hasOwnProperty.call(params, 'searchDeptId');
const rawDeptId = hasDeptInParams
? params.deptId ?? params.searchDeptId
: query.deptId ?? query.searchDeptId;
const rawDeptId = query.deptId ?? query.searchDeptId;
delete query.searchDeptId;
if (rawDeptId !== undefined && rawDeptId !== null && String(rawDeptId).trim() !== '') {
// 级联可能回传路径数组,统一取末级并保持字符串,避免雪花 ID 精度丢失。
const deptValue = Array.isArray(rawDeptId) ? rawDeptId.at(-1) : rawDeptId;
query.deptId = String(deptValue ?? '')
.split(',')[0]
.trim();
if (!query.deptId) {
delete query.deptId;
}
query.deptId = String(rawDeptId).split(',')[0].trim();
} else {
delete query.deptId;
}
@@ -482,23 +466,6 @@ export default {
return query;
},
applyDefaultDeptSearch() {
// 超管默认不限组织,避免预填组织后新增落在其他组织时列表看不见。
if (this.isAdmin) {
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
if (deptColumn) {
deptColumn.searchValue = undefined;
}
const nextQuery = { ...this.query };
delete nextQuery.deptId;
delete nextQuery.searchDeptId;
this.query = nextQuery;
this.$nextTick(() => {
if (this.$refs.crud?.searchForm) {
this.$refs.crud.searchForm.searchDeptId = undefined;
}
});
return;
}
const deptId = this.defaultDeptId();
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
if (!deptId || !deptColumn) return;
@@ -510,11 +477,6 @@ export default {
}
});
},
resolveDeptName(deptId) {
if (!deptId) return '';
const matched = this.deptOptions.find(item => String(item.value) === String(deptId));
return matched ? String(matched.label || '').trim() : '';
},
resetAddressQuery() {
this.addressQuery = {
addressName: '',
@@ -971,8 +933,7 @@ export default {
}
api.submit(submitRow).then(
() => {
this.page.currentPage = 1;
this.onLoad(this.page, this.query);
this.onLoad(this.page);
this.$message({ type: 'success', message: '操作成功!' });
done();
},
@@ -990,7 +951,7 @@ export default {
}
api.submit(submitRow).then(
() => {
this.onLoad(this.page, this.query);
this.onLoad(this.page);
this.$message({ type: 'success', message: '操作成功!' });
done();
},
@@ -1045,13 +1006,7 @@ export default {
beforeOpen(done, type) {
this.dialogReadonly = type === 'view';
if (type === 'add') {
const form = {};
// 超管若当前按某组织筛选,新增默认归属该组织,避免保存后被筛选条件滤掉。
if (this.isAdmin && this.query.deptId) {
form.deptId = String(this.query.deptId);
form.deptName = this.resolveDeptName(form.deptId);
}
this.form = form;
this.form = {};
done();
return;
}
@@ -205,7 +205,9 @@ export const defaultContractAttachmentTypeOptions = [
{ label: '双章归档文件', value: '双章归档文件' },
{ label: '其他文件', value: CONTRACT_ATTACHMENT_TYPE_OTHER },
];
// 特批附件归口附件(佐证材料等)区上传:高风险/黑名单客商合同必传,后端按 fileType=特批附件 校验并挂特批面板(与后端 HcsSyncConstant.ATTACHMENT_TYPE_SPEC_EXPLANATION 对齐)
export const defaultContractSupportingAttachmentTypeOptions = [
{ label: '特批附件', value: '特批附件' },
{ label: '其他文件', value: CONTRACT_ATTACHMENT_TYPE_OTHER },
];
/** @deprecated 兼容旧引用,实际选项由业务字典动态加载 */
@@ -299,6 +301,8 @@ export const resolveContractAttachmentType = (
item => String(item.label) === aliasedFileType || String(item.label) === rawFileType
);
if (matchedByLabel) return matchedByLabel.value;
// 行已带类型但字典未命中(如历史保存值、字典缺失)时保留原值,避免重开页面时被降级为其他文件
if (rawFileType) return aliasedFileType;
const fileName = normalizeAttachmentTypeText(attachmentName(row));
if (!fileName) return otherType;
const matched = list
@@ -641,7 +645,7 @@ export default {
this.contractAttachmentTypeOptions
);
} else {
this.uploadDialogType = this.defaultAttachmentType;
this.uploadDialogType = this.uploadDialogType || this.defaultAttachmentType;
}
this.$message.success('上传成功');
},
@@ -0,0 +1,271 @@
<template>
<section class="contract-manage-form__section contract-manage-form__section--panel hcs-contract-panel">
<div class="contract-manage-form__attachment-head">
<div class="dialog-section-title">合规信息</div>
<div>
<el-button
v-if="canApplySpec"
type="warning"
plain
:loading="specApplying"
@click="openSpecDialog"
>
发起特批
</el-button>
<el-button
v-if="isSpecProcessing"
type="primary"
plain
@click="confirmSpecResult"
>
确认特批结果
</el-button>
</div>
</div>
<el-descriptions :column="3" class="contract-manage-detail__descriptions">
<el-descriptions-item label="合规同步状态">
<el-tooltip
v-if="hcsSyncMsg"
placement="top"
:content="hcsSyncMsg"
>
<el-tag :type="syncTagType" class="status-text">{{ syncLabel }}</el-tag>
</el-tooltip>
<el-tag v-else :type="syncTagType" class="status-text">{{ syncLabel }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="合规合同ID">{{
contract.hcsFdId || '-'
}}</el-descriptions-item>
<el-descriptions-item label="客商风险">
<template v-if="contract.hcsRiskLevel || contract.hcsBlackStatus">
<el-tag
v-if="isBlacklist"
type="danger"
class="status-text"
>黑名单</el-tag
>
<span v-if="contract.hcsRiskLevel" class="hcs-contract-panel__risk">{{
`风险等级:${contract.hcsRiskLevel}`
}}</span>
<span v-if="!contract.hcsRiskLevel && !isBlacklist">-</span>
</template>
<span v-else>-</span>
</el-descriptions-item>
<el-descriptions-item label="特批状态">
<el-tag v-if="specLabel" :type="specTagType" class="status-text">{{ specLabel }}</el-tag>
<span v-else>-</span>
</el-descriptions-item>
<el-descriptions-item label="特批说明" :span="2">{{
contract.hcsSpecMsg || '-'
}}</el-descriptions-item>
</el-descriptions>
<el-dialog
v-model="specDialogVisible"
title="发起合同特批"
width="640px"
append-to-body
destroy-on-close
class="hcs-contract-panel__spec-dialog"
@closed="resetSpecDialog"
>
<el-alert
title="高风险客商合同需经集团特批后方可签约推送;请上传特批申请材料及内部审批流程附件。"
type="warning"
:closable="false"
class="hcs-contract-panel__spec-alert"
/>
<el-upload
drag
multiple
:show-file-list="false"
:http-request="uploadMaterial"
:on-error="() => uploadFailed()"
class="hcs-contract-panel__spec-upload"
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">将特批材料拖到此处,或<em>点击上传到合同系统</em></div>
</el-upload>
<el-table :data="materials" border class="hcs-contract-panel__spec-table">
<el-table-column type="index" label="序号" width="70" align="center" />
<el-table-column prop="name" label="文件名" min-width="220" show-overflow-tooltip />
<el-table-column prop="fdId" label="合规附件ID" min-width="240" show-overflow-tooltip />
<el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="{ $index }">
<el-link type="danger" @click="materials.splice($index, 1)">删除</el-link>
</template>
</el-table-column>
</el-table>
<template #footer>
<el-button type="primary" :loading="specApplying" @click="submitSpec">确认发起</el-button>
<el-button @click="specDialogVisible = false">取消</el-button>
</template>
</el-dialog>
</section>
</template>
<script>
import { UploadFilled } from '@element-plus/icons-vue';
import {
applyContractSpec,
confirmContractSpec,
uploadAttachment,
} from '@/api/business/hcs';
const SYNC_STATUS_OPTIONS = [
{ label: '待推送', value: 'unsynced', type: 'info' },
{ label: '已推送', value: 'synced', type: 'success' },
{ label: '推送失败', value: 'failed', type: 'danger' },
];
const SPEC_STATUS_OPTIONS = [
{ label: '待特批', value: 'need', type: 'warning' },
{ label: '特批中', value: 'processing', type: 'warning' },
{ label: '特批通过', value: 'approved', type: 'success' },
{ label: '特批驳回', value: 'rejected', type: 'danger' },
];
export default {
name: 'HcsContractPanel',
components: { UploadFilled },
props: {
// 合同详情行(须含 id/hcsSyncStatus/hcsFdId/hcsRiskLevel/hcsBlackStatus/hcsSpecStatus 等)
contract: { type: Object, required: true },
},
emits: ['refresh'],
data() {
return {
specDialogVisible: false,
specApplying: false,
materials: [],
};
},
computed: {
syncLabel() {
return SYNC_STATUS_OPTIONS.find(item => item.value === this.contract.hcsSyncStatus)?.label || '-';
},
syncTagType() {
return SYNC_STATUS_OPTIONS.find(item => item.value === this.contract.hcsSyncStatus)?.type || 'info';
},
hcsSyncMsg() {
return this.contract.hcsSyncMsg || '';
},
isBlacklist() {
return String(this.contract.hcsBlackStatus || '').toLowerCase() === 'yes';
},
specLabel() {
return SPEC_STATUS_OPTIONS.find(item => item.value === this.contract.hcsSpecStatus)?.label || '';
},
specTagType() {
return SPEC_STATUS_OPTIONS.find(item => item.value === this.contract.hcsSpecStatus)?.type || 'info';
},
isSpecProcessing() {
return this.contract.hcsSpecStatus === 'processing';
},
canApplySpec() {
return ['need', 'rejected'].includes(this.contract.hcsSpecStatus);
},
},
methods: {
openSpecDialog() {
this.specDialogVisible = true;
},
resetSpecDialog() {
this.materials = [];
},
// 自定义上传:直传合同合规系统(C103-2),成功记录合规附件ID
uploadMaterial(options) {
const file = options.file;
if (file.size / 1024 / 1024 > 50) {
this.$message.warning('单文件大小不能超过 50MB');
return;
}
const formData = new FormData();
formData.append('fdFile', file);
uploadAttachment(formData)
.then(response => {
const fdId = response?.data?.data || response?.data;
if (!fdId || typeof fdId !== 'string') {
this.$message.error(response?.data?.msg || '上传合同系统失败');
return;
}
this.materials.push({ fdId, name: file.name });
this.$message.success(`已上传合同系统:${file.name}`);
})
.catch(error => {
this.$message.error(error?.response?.data?.msg || '上传合同系统失败');
});
},
uploadFailed() {
this.$message.error('上传合同系统失败');
},
submitSpec() {
if (!this.materials.length) {
this.$message.warning('请先上传特批申请材料');
return;
}
this.specApplying = true;
applyContractSpec({
contractId: this.contract.id,
attachments: this.materials.map(item => ({ fdId: item.fdId, name: item.name })),
})
.then(response => {
if (response?.data?.success === false) {
this.$message.error(response?.data?.msg || '特批发起失败');
return;
}
this.$message.success(response?.data?.data || '特批发起成功,等待集团审批');
this.specDialogVisible = false;
this.$emit('refresh');
})
.catch(error => {
this.$message.error(error?.response?.data?.msg || '特批发起失败');
})
.finally(() => {
this.specApplying = false;
});
},
confirmSpecResult() {
this.$prompt('请输入集团特批结果(approved=通过 / rejected=驳回)', '确认特批结果', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^(approved|rejected)$/,
inputErrorMessage: '请输入 approved 或 rejected',
}).then(({ value }) => {
confirmContractSpec(this.contract.id, value).then(() => {
this.$message.success('特批结果已确认');
this.$emit('refresh');
});
});
},
},
};
</script>
<style lang="scss" scoped>
.hcs-contract-panel__risk {
margin-left: 8px;
color: #606266;
}
.hcs-contract-panel__spec-alert {
margin-bottom: 12px;
}
.hcs-contract-panel__spec-upload {
margin-bottom: 12px;
:deep(.el-upload) {
width: 100%;
}
:deep(.el-upload-dragger) {
width: 100%;
}
}
.hcs-contract-panel__spec-table {
margin-bottom: 4px;
}
</style>
+22 -2
View File
@@ -203,6 +203,11 @@
placeholder="请输入其他事项说明"
/>
</el-form-item>
<!-- 风险客商提示:合同已推送合规并留痕高风险/黑名单时展示,变更提交同样要求特批附件 -->
<div v-if="riskTipText" class="contract-manage-form__risk-tip">
<div class="contract-manage-form__risk-tip-title">风险客商提示:</div>
<div class="contract-manage-form__risk-tip-content">{{ riskTipText }}</div>
</div>
</section>
<contract-attachment-section
@@ -332,7 +337,7 @@
<script>
import * as api from '@/api/business/contract-manage';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
import { submitMkApprovalFlow } from '@/utils/mk-approval';
import BillingPlanEditor from './components/billing-plan-editor.vue';
import ContractAttachmentSection, {
isContractSealMaterialLocation,
@@ -489,6 +494,17 @@ export default {
pageTitle() {
return this.$route.query.name || '合同变更';
},
// 高风险/黑名单客商提示:按合同推送合规留痕 hcs_risk_level/hcs_black_status 判定(与合同详情口径一致)
riskTipText() {
const riskLevel = String(this.form.hcsRiskLevel || '').trim();
const blacklist = String(this.form.hcsBlackStatus || '').toLowerCase() === 'yes';
if (riskLevel !== '2' && !blacklist) return '';
const parties = [this.form.partyA, this.form.partyB]
.map(name => String(name || '').trim())
.filter(Boolean)
.join('、');
return `【${parties || '相对方'}】:被列入外部黑名单;涉贪污受贿裁判相关提及方(3年以上及其他);被执行人信息;买卖合同纠纷;劳动纠纷;重大纠纷。提交变更前须上传「特批附件」类型附件`;
},
changeAttachmentLocationOptions() {
return ['用印材料', '附件(佐证材料等)', '变更材料'];
},
@@ -738,7 +754,7 @@ export default {
removeCustomPeriodRow(index) { if (index <= 0) return; const periods = [...(this.settlementRule.customPeriods || [])]; periods.splice(index, 1); this.settlementRule.customPeriods = normalizeCustomPeriods(periods); },
validateCustomPeriods(periods = [], label) { const rows = normalizeCustomPeriods(periods); if (!rows.length) { this.$message.warning(`${label}:请至少配置一段自定义周期`); return false; } for (let index = 0; index < rows.length; index += 1) { const row = rows[index]; const startDay = Number(row.startDay); const endDay = Number(row.endDay); if (!Number.isFinite(startDay) || startDay < 1 || startDay > 31) { this.$message.warning(`${label}:请选择第${index + 1}行运单区间开始日`); return false; } if (!Number.isFinite(endDay) || endDay < 1 || endDay > 31) { this.$message.warning(`${label}:请选择第${index + 1}行运单区间结束日`); return false; } if (endDay < startDay) { this.$message.warning(`${label}:第${index + 1}行结束日不能早于开始日`); return false; } if (index > 0 && startDay !== Number(rows[index - 1].endDay) + 1) { this.$message.warning(`${label}:自定义多周期区间必须连续,不允许重叠或存在日期缺口`); return false; } } return true; },
validateSettlementRule(rule, label) { if (Number(rule.autoGenerate) !== 1) return true; if (!rule.billStartDate || !rule.settlementType) { this.$message.warning(`${label}:请完整填写账单起始日和结算类型`); return false; } if (rule.settlementType === '月结' && !rule.billCycleType) { this.$message.warning(`${label}:请选择结算周期`); return false; } if (rule.settlementType === '月结' && rule.billCycleType === '固定截单日' && !rule.billCutoffDay) { this.$message.warning(`${label}:请选择账单截单日`); return false; } if (rule.settlementType === '月结' && rule.billCycleType === '自定义多周期') return this.validateCustomPeriods(rule.customPeriods, label); if (rule.settlementType === '固定天数周期结算' && !rule.cycleDays) { this.$message.warning(`${label}:请选择周期天数`); return false; } return true; },
async submit() { await this.$refs.formRef.validate(); const total = this.paymentRatioRows.reduce((sum, row) => sum + Number(row.ratioLimit || 0), 0); if (this.paymentRatioRows.length && Math.abs(total - 100) > 0.0001) { this.$message.warning('付款比例上限合计必须等于100%'); return; } if (this.settlementConfigTab === 'pre') this.preSettlementConfig = { ...this.settlementRule }; else this.formalSettlementConfig = { ...this.settlementRule }; if (!this.validateSettlementRule(this.preSettlementConfig, '预结算配置') || !this.validateSettlementRule(this.formalSettlementConfig, '正式结算配置')) return; const settlementRule = { preSettlementConfig: this.preSettlementConfig, formalSettlementConfig: this.formalSettlementConfig }; await api.submitChange({ ...this.form, settlementCurrency: String(this.form.settlementCurrency || '').trim() || 'RMB', copyCount: normalizeOptionalPositiveInteger(this.form.copyCount), invoiceCycle: normalizeOptionalPositiveInteger(this.form.invoiceCycle), paymentDays: normalizeOptionalPositiveInteger(this.form.paymentDays), contractAmount: normalizeOptionalAmount(this.form.contractAmount), startDate: this.period[0], endDate: this.period[1], feeGenerationMode: this.feeGenerationMode, billingEnabled: this.feeGenerationMode === 'system' ? 1 : 0, billingPlanJson: JSON.stringify(this.plans), settlementRuleJson: JSON.stringify(settlementRule), preSettlementConfigJson: JSON.stringify(this.preSettlementConfig), formalSettlementConfigJson: JSON.stringify(this.formalSettlementConfig), paymentRatioJson: JSON.stringify(this.paymentRatioRows), contractFileJson: JSON.stringify(this.contractFileRows), attachmentsJson: JSON.stringify(this.attachments), changeContent: this.form.changeContent, changeReason: this.form.changeReason, changeAttachmentsJson: JSON.stringify(this.changeMaterials) }); await submitMkApprovalFlow({ bizType: 'contract-manage', bizId: this.form.id, subjectName: this.form.contractName || '', approvalStatus: this.form.approvalStatus || 'change_rejected', mkEnabled: await loadMkEnabled().catch(() => false) }); this.$message.success('变更已提交'); this.$router.back(); },
async submit() { await this.$refs.formRef.validate(); const total = this.paymentRatioRows.reduce((sum, row) => sum + Number(row.ratioLimit || 0), 0); if (this.paymentRatioRows.length && Math.abs(total - 100) > 0.0001) { this.$message.warning('付款比例上限合计必须等于100%'); return; } if (this.settlementConfigTab === 'pre') this.preSettlementConfig = { ...this.settlementRule }; else this.formalSettlementConfig = { ...this.settlementRule }; if (!this.validateSettlementRule(this.preSettlementConfig, '预结算配置') || !this.validateSettlementRule(this.formalSettlementConfig, '正式结算配置')) return; const settlementRule = { preSettlementConfig: this.preSettlementConfig, formalSettlementConfig: this.formalSettlementConfig }; await api.submitChange({ ...this.form, settlementCurrency: String(this.form.settlementCurrency || '').trim() || 'RMB', copyCount: normalizeOptionalPositiveInteger(this.form.copyCount), invoiceCycle: normalizeOptionalPositiveInteger(this.form.invoiceCycle), paymentDays: normalizeOptionalPositiveInteger(this.form.paymentDays), contractAmount: normalizeOptionalAmount(this.form.contractAmount), startDate: this.period[0], endDate: this.period[1], feeGenerationMode: this.feeGenerationMode, billingEnabled: this.feeGenerationMode === 'system' ? 1 : 0, billingPlanJson: JSON.stringify(this.plans), settlementRuleJson: JSON.stringify(settlementRule), preSettlementConfigJson: JSON.stringify(this.preSettlementConfig), formalSettlementConfigJson: JSON.stringify(this.formalSettlementConfig), paymentRatioJson: JSON.stringify(this.paymentRatioRows), contractFileJson: JSON.stringify(this.contractFileRows), attachmentsJson: JSON.stringify(this.attachments), changeContent: this.form.changeContent, changeReason: this.form.changeReason, changeAttachmentsJson: JSON.stringify(this.changeMaterials) }); await submitMkApprovalFlow({ bizType: 'contract-manage', bizId: this.form.id, subjectName: this.form.contractName || '', approvalStatus: this.form.approvalStatus || 'change_rejected' }); this.$message.success('变更已提交'); this.$router.back(); },
},
};
</script>
@@ -762,6 +778,10 @@ export default {
}
.contract-basic-section__date-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; width: 360px; max-width: 100%; }
.contract-basic-section__date-range span { color: #606266; }
// 风险客商提示条(基本信息备注后):橙黄背景 + 红色文字,与合同新增页一致
.contract-manage-form__risk-tip { margin: 0 0 18px; padding: 10px 16px; background: #faecd8; border-radius: 4px; }
.contract-manage-form__risk-tip-title { color: #f56c6c; font-weight: 600; line-height: 22px; }
.contract-manage-form__risk-tip-content { color: #f56c6c; line-height: 22px; }
.contract-basic-section__date-range :deep(.el-date-editor) { width: auto; min-width: 0; }
.contract-basic-section :deep(.el-form-item) { align-items: center; }
.contract-basic-section :deep(.el-form-item__label) { flex: 0 0 96px !important; width: 96px !important; height: auto; padding-right: 12px; white-space: normal; word-break: break-all; line-height: 18px; }
+250 -14
View File
@@ -32,6 +32,14 @@
>
批量导出
</el-button>
<el-button
type="warning"
plain
:loading="hcsRepushingId === 'batch'"
@click="handleHcsBatchRepush"
>
<el-icon class="el-icon--left"><Position /></el-icon>批量推送合规
</el-button>
</template>
<template #header>
@@ -72,6 +80,18 @@
</el-tag>
</template>
<template #hcsSyncStatus="{ row }">
<el-tooltip v-if="row.hcsSyncMsg" placement="top" :content="row.hcsSyncMsg">
<el-tag :type="hcsSyncTagType(row.hcsSyncStatus)" class="status-text">
{{ hcsSyncLabel(row.hcsSyncStatus) }}
</el-tag>
</el-tooltip>
<el-tag v-else-if="row.hcsSyncStatus" :type="hcsSyncTagType(row.hcsSyncStatus)" class="status-text">
{{ hcsSyncLabel(row.hcsSyncStatus) }}
</el-tag>
<span v-else>-</span>
</template>
<template #menu="{ row }">
<el-link
v-if="hasPermission(`${config.permission}_view`)"
@@ -92,6 +112,9 @@
>
{{ operation.label }}
</el-link>
<el-link v-if="canHcsRepush(row)" type="warning" @click="handleHcsRepush(row)">
{{ hcsRepushingId === row.id ? '推送中…' : '推送合规' }}
</el-link>
<el-link v-if="canDelete(row)" type="danger" @click="removeRow(row)">删除</el-link>
</template>
</avue-crud>
@@ -180,9 +203,18 @@
<el-descriptions-item label="其他事项说明" :span="3">{{
detailValue('remark')
}}</el-descriptions-item>
<el-descriptions-item v-if="detailRiskTipText" label="风险客商提示" :span="3">
<span style="color: #f56c6c">{{ detailRiskTipText }}</span>
</el-descriptions-item>
</el-descriptions>
</section>
<hcs-contract-panel
v-if="!isPublicViewPage"
:contract="detailRow"
@refresh="initDetailPage"
/>
<contract-attachment-section
title="用印材料"
description
@@ -302,6 +334,7 @@
<contract-attachment-section
title="附件(佐证材料等)"
description
attachment-type
readonly
:rows="detailAttachmentRows"
:preview="previewAttachment"
@@ -448,6 +481,7 @@
clearable
:loading="contractPartyLoading"
@visible-change="visible => visible && loadContractPartyOptions()"
@change="queryPartyRisk('partyA')"
>
<el-option
v-for="item in contractPartyAOptions"
@@ -465,6 +499,7 @@
clearable
:loading="contractPartyLoading"
@visible-change="visible => visible && loadContractPartyOptions()"
@change="queryPartyRisk('partyB')"
>
<el-option
v-for="item in contractPartyBOptions"
@@ -619,6 +654,11 @@
placeholder="请输入其他事项说明"
/>
</el-form-item>
<!-- 风险客商提示(基本信息备注后):外部客商高风险/黑名单时展示,文案由后端 riskTip 拼装 -->
<div v-if="partyRiskText" class="contract-manage-form__risk-tip">
<div class="contract-manage-form__risk-tip-title">风险客商提示:</div>
<div class="contract-manage-form__risk-tip-content">{{ partyRiskText }}</div>
</div>
</section>
<contract-attachment-section
@@ -1046,6 +1086,8 @@ import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import { exportBlob } from '@/api/common';
import * as api from '@/api/business/contract-manage';
import { repush as hcsRepush, repushBatch as hcsRepushBatch, getRisk } from '@/api/business/hcs';
import { Position } from '@element-plus/icons-vue';
import { getMkPublicDetail } from '@/api/mk-process';
import { getList as getProjectList } from '@/api/business/project-apply';
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
@@ -1066,6 +1108,7 @@ import ContractAttachmentSection, {
isContractSupportingAttachmentLocation,
normalizeContractFileRows,
} from './components/contract-attachment-section.vue';
import HcsContractPanel from './components/hcs-contract-panel.vue';
import PdfPreview from '@/components/pdf-preview/main.vue';
import { ElImageViewer, ElCascader } from 'element-plus';
import { OpenFileViewer } from '@open-file-viewer/vue';
@@ -1171,6 +1214,11 @@ const createCopiedDetail = (detail = {}) => {
Object.keys(form).forEach(prop => {
if (Object.prototype.hasOwnProperty.call(detail, prop)) form[prop] = detail[prop];
});
// 特批附件属于原合同的特批佐证,复制后须对新合同重新上传,否则会绕过高风险/黑名单校验
const stripSpecAttachments = value => {
const rows = parseArray(value).filter(item => item?.fileType !== '特批附件');
return rows.length ? JSON.stringify(rows) : '';
};
return {
...form,
contractNo: '',
@@ -1178,8 +1226,8 @@ const createCopiedDetail = (detail = {}) => {
archiveStatus: '未归档',
feeGenerationMode: detail.feeGenerationMode || '',
billingEnabled: detail.billingEnabled,
contractFileJson: detail.contractFileJson || '',
attachmentsJson: detail.attachmentsJson || '',
contractFileJson: stripSpecAttachments(detail.contractFileJson),
attachmentsJson: stripSpecAttachments(detail.attachmentsJson),
billingPlanJson: detail.billingPlanJson || '',
paymentRatioJson: detail.paymentRatioJson || '',
settlementRuleJson: detail.settlementRuleJson || '',
@@ -1238,9 +1286,11 @@ export default {
ContractAttachmentSection,
BillingPlanEditor,
ChangeRecordDetailDialog,
HcsContractPanel,
ElImageViewer,
OpenFileViewer,
PdfPreview,
Position,
},
data() {
return {
@@ -1316,6 +1366,9 @@ export default {
contractCategoryDictOptions: [],
contractPartyAOptions: [],
contractPartyBOptions: [],
// 合规客商风险(C101-1 展示用):甲方/乙方选择后即时查询
contractPartyCodeMap: {},
partyRisk: {},
contractPartyLoading: false,
contractPartyRequestId: 0,
organizationOptions: [],
@@ -1354,6 +1407,8 @@ export default {
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
detailLoading: false,
detailRow: {},
// 合规(HCS)推送/对账状态
hcsRepushingId: null,
detailContractFileRows: [],
detailAttachmentRows: [],
detailBillingPlanRows: [],
@@ -1530,6 +1585,32 @@ export default {
const endDate = this.detailRow.endDate || '-';
return `${startDate} 至 ${endDate}`;
},
// 高风险/黑名单客商签约提示(C101-1,签约前提示;强制拦截在后端提交校验与推送链路)
partyRiskText() {
const parts = [];
['partyA', 'partyB'].forEach(prop => {
const risk = this.partyRisk[prop];
if (!risk?.risky) return;
// riskTip 由后端按风险项拼装(【公司名称】:黑名单;涉诉;被执行人等),缺失时兜底通用提示
parts.push(
risk.riskTip ||
`${prop === 'partyA' ? '甲方' : '乙方'}[${this.form[prop] || ''}]为高风险/黑名单客商`
);
});
if (!parts.length) return '';
return `${parts.join(';')},按集团规定不可直接签约,提交前须上传「特批附件」类型附件,审批通过后将自动发起合同特批`;
},
// 详情风险客商提示(基本信息备注后展示):按推送留痕 hcs_risk_level/hcs_black_status 判定(甲乙取高/任一),文案与后端 riskTip 一致
detailRiskTipText() {
const riskLevel = String(this.detailRow.hcsRiskLevel || '').trim();
const blacklist = String(this.detailRow.hcsBlackStatus || '').toLowerCase() === 'yes';
if (riskLevel !== '2' && !blacklist) return '';
const parties = [this.detailRow.partyA, this.detailRow.partyB]
.map(name => String(name || '').trim())
.filter(Boolean)
.join('、');
return `【${parties || '相对方'}】:被列入外部黑名单;涉贪污受贿裁判相关提及方(3年以上及其他);被执行人信息;买卖合同纠纷;劳动纠纷;重大纠纷`;
},
detailLegalSealText() {
const value = this.detailRow.legalSealFlag;
if (value === undefined || value === null || value === '') return '-';
@@ -1651,6 +1732,84 @@ export default {
if (stage === 'terminated') return 'danger';
return 'info';
},
// ==================== 合规(HCS)推送/对账(照“同步金蝶”按钮模式) ====================
hcsSyncLabel(value) {
return { unsynced: '待推送', synced: '已推送', failed: '推送失败' }[value] || value;
},
hcsSyncTagType(value) {
return { unsynced: 'info', synced: 'success', failed: 'danger' }[value] || 'info';
},
canHcsRepush(row) {
return (
['approved', 'change_approved'].includes(row.approvalStatus) &&
row.hcsSyncStatus !== 'synced'
);
},
handleHcsRepush(row) {
if (this.hcsRepushingId) return;
this.$confirm('确定推送该数据到合同合规系统?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.hcsRepushingId = row.id;
hcsRepush('contract', row.id)
.then(res => {
if (res.data?.success === false) {
this.$message.error(res.data?.msg || '推送合规失败');
return;
}
this.$message.success(res.data?.data || '推送合规成功');
this.onLoad(this.page, this.query);
})
.catch(error => {
// 拦截器已弹出后端 msg(如特批审核中禁止重推),此处不再重复提示
if (!error?._notified) {
this.$message.error(error?.response?.data?.msg || '推送合规失败');
}
})
.finally(() => {
this.hcsRepushingId = null;
});
});
},
handleHcsBatchRepush() {
if (this.hcsRepushingId) return;
if (!this.selectionList.length) {
this.$message.warning('请选择至少一条数据');
return;
}
const invalidCount = this.selectionList.filter(item => !this.canHcsRepush(item)).length;
if (invalidCount) {
this.$message.warning(`选中数据中有${invalidCount}条不符合推送条件(仅审批通过且未同步的可推送),请重新选择`);
return;
}
this.$confirm(`确定将选中的${this.selectionList.length}条数据推送到合同合规系统?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.hcsRepushingId = 'batch';
hcsRepushBatch('contract', this.selectionList.map(item => item.id))
.then(res => {
if (res.data?.success === false) {
this.$message.error(res.data?.msg || '批量推送合规失败');
return;
}
this.$message.success(res.data?.data || '批量推送合规完成');
this.onLoad(this.page, this.query);
})
.catch(error => {
// 拦截器已弹出后端 msg,此处不再重复提示
if (!error?._notified) {
this.$message.error(error?.response?.data?.msg || '批量推送合规失败');
}
})
.finally(() => {
this.hcsRepushingId = null;
});
});
},
canEdit(row) {
return (
this.hasPermission(`${this.config.permission}_edit`) &&
@@ -1986,9 +2145,7 @@ export default {
bizType: 'contract-manage',
bizId: id,
subjectName: saved.contractName || submit.contractName || '',
approvalStatus:
previousApprovalStatus || saved.approvalStatus || submit.approvalStatus || '',
mkEnabled: this.mkEnabled,
approvalStatus: previousApprovalStatus || saved.approvalStatus || submit.approvalStatus || '',
})
);
}
@@ -2027,7 +2184,6 @@ export default {
bizId: payload.id || this.form.id,
subjectName: payload.contractName || this.form.contractName || '',
approvalStatus: this.form.approvalStatus || 'change_rejected',
mkEnabled: this.mkEnabled,
}).then(() => {
this.$message.success('已重新提交变更审批');
this.closeForm();
@@ -2212,8 +2368,21 @@ export default {
])
.then(responses => {
if (requestId !== this.contractPartyRequestId) return;
const names = responses
.flatMap(extractRecords)
const records = responses.flatMap(extractRecords);
// 名称→客商编码映射,供 C101-1 风险查询使用(§9-U6 编码体系联调确认)
const codeMap = {};
records.forEach(item => {
const code = item.customerCode;
if (!code) return;
[item.fullName, item.shortName, item.customerName]
.map(name => String(name || '').trim())
.filter(Boolean)
.forEach(name => {
codeMap[name] = code;
});
});
this.contractPartyCodeMap = codeMap;
const names = records
.map(item => item.fullName || item.shortName || item.customerName || item.customerCode)
.map(name => String(name || '').trim())
.filter(Boolean);
@@ -2221,11 +2390,40 @@ export default {
const options = [...new Set(names)].map(name => ({ label: name, value: name }));
this.contractPartyAOptions = options;
this.contractPartyBOptions = options;
// 复制/编辑回填的甲乙方不会触发下拉 change,加载选项后主动查一次 C101-1 风险
['partyA', 'partyB'].forEach(prop => {
if (this.form[prop]) this.queryPartyRisk(prop);
});
})
.finally(() => {
if (requestId === this.contractPartyRequestId) this.contractPartyLoading = false;
});
},
// C101-1 客商风险查询(展示用,强校验在后端提交/推送链路):失败静默不阻塞填写
queryPartyRisk(prop) {
const name = this.form[prop];
const code = name ? this.contractPartyCodeMap[name] : null;
if (!code) {
this.partyRisk = { ...this.partyRisk, [prop]: null };
return;
}
getRisk(code)
.then(res => {
const risk = res?.data?.data ?? res?.data ?? {};
this.partyRisk = {
...this.partyRisk,
[prop]: {
customerKind: risk.customerKind || '',
// risky 由后端统一判定:外部客商高风险(等级=2)或黑名单;内部组织客商默认无风险恒为 false
risky: risk.risky === true,
riskTip: risk.riskTip || '',
},
};
})
.catch(() => {
this.partyRisk = { ...this.partyRisk, [prop]: null };
});
},
loadOrganizationOptions() {
if (this.organizationLoading) return;
this.organizationLoading = true;
@@ -3004,14 +3202,29 @@ export default {
bizId: row.id,
subjectName: row.contractName || '',
approvalStatus: row.approvalStatus || '',
mkEnabled: this.mkEnabled,
})
)
: request();
afterMk.then(() => {
this.$message.success(operation.successMessage || `${operation.label}成功`);
this.onLoad(this.page, this.query);
});
// 合同通过会同步等待附件转传 + 合规推送,加遮罩防重复点击
const loading =
operation.action === 'approve'
? this.$loading({
lock: true,
text: '正在推送合规,请稍候…',
background: 'rgba(255, 255, 255, 0.6)',
})
: null;
afterMk
.then(res => {
// data=false 表示审批已通过但合规推送失败,msg 带具体原因(照正式结算单审批)
if (operation.action === 'approve' && res?.data?.data === false) {
this.$message.warning(res.data.msg);
} else {
this.$message.success(operation.successMessage || `${operation.label}成功`);
}
this.onLoad(this.page, this.query);
})
.finally(() => loading && loading.close());
};
if (operation.prompt) {
this.$prompt(operation.prompt, operation.label, {
@@ -3108,6 +3321,29 @@ export default {
vertical-align: bottom;
}
.contract-manage-form__risk-alert {
width: 100%;
}
// 风险客商提示条(基本信息备注后):橙黄背景 + 红色文字(设计稿 2026-10)
.contract-manage-form__risk-tip {
margin: 0 0 18px;
padding: 10px 16px;
background: #faecd8;
border-radius: 4px;
.contract-manage-form__risk-tip-title {
color: #f56c6c;
font-weight: 600;
line-height: 22px;
}
.contract-manage-form__risk-tip-content {
color: #f56c6c;
line-height: 22px;
}
}
.contract-manage-page {
&__expiry-search {
display: flex;
@@ -3342,7 +3578,7 @@ export default {
:deep(.el-form-item) {
align-items: center;
//margin-bottom: 24px;
margin-bottom: 24px;
}
:deep(.el-form-item__label) {
+100
View File
@@ -0,0 +1,100 @@
<template>
<basic-container class="hcs-master-data-page">
<div class="hcs-master-data-page__head">
<div class="dialog-section-title">合规主数据(HCS)</div>
<el-button type="primary" :loading="refreshing" @click="handleRefresh">刷新缓存</el-button>
</div>
<el-tabs v-model="activeTab">
<el-tab-pane label="合同模板" name="template" />
</el-tabs>
<el-table v-loading="loading" :data="templates" border>
<el-table-column type="index" label="序号" width="70" align="center" />
<el-table-column prop="fdId" label="模板ID(fdTemplateId)" min-width="320" show-overflow-tooltip />
<el-table-column prop="fdName" label="模板名称" min-width="220" show-overflow-tooltip />
<el-table-column prop="fdStatus" label="状态" width="100" align="center" />
<el-table-column prop="fdContractCharacter" label="合同性质" min-width="140" align="center" />
<el-table-column label="创建时间" min-width="170" align="center">
<template #default="{ row }">{{ formatTime(row.fdCreateTime) }}</template>
</el-table-column>
</el-table>
<el-alert
class="hcs-master-data-page__tip"
title="合同类别与合规模板的对应关系由 Nacos 配置 thirdParty.hcs.contract.template-mapping 维护;此列表用于核对映射的模板ID 是否存在。"
type="info"
:closable="false"
/>
</basic-container>
</template>
<script>
import { getTemplates, refreshMasterData } from '@/api/business/hcs';
export default {
name: 'HcsMasterData',
data() {
return {
activeTab: 'template',
loading: false,
refreshing: false,
templates: [],
};
},
created() {
this.loadTemplates();
},
methods: {
loadTemplates() {
this.loading = true;
getTemplates()
.then(response => {
const data = response?.data?.data ?? response?.data;
this.templates = Array.isArray(data) ? data : [];
})
.catch(() => {
this.$message.error('合规模板列表加载失败');
})
.finally(() => {
this.loading = false;
});
},
handleRefresh() {
this.refreshing = true;
refreshMasterData()
.then(response => {
this.$message.success(response?.data?.data || '合规主数据缓存已刷新');
this.loadTemplates();
})
.catch(error => {
this.$message.error(error?.response?.data?.msg || '刷新失败');
})
.finally(() => {
this.refreshing = false;
});
},
formatTime(value) {
if (!value) return '-';
return this.$dayjs(Number(value)).format('YYYY-MM-DD HH:mm:ss');
},
},
};
</script>
<style lang="scss" scoped>
.hcs-master-data-page__head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
.dialog-section-title {
margin-bottom: 0;
}
}
.hcs-master-data-page__tip {
margin-top: 12px;
}
</style>
+7 -29
View File
@@ -79,7 +79,7 @@
<p>{{ timeRange(row) }}</p>
<p>{{ goodsSummary(row) }}</p>
<p>创建人:{{ row.createUserName || '-' }}</p>
<p>创建时间:{{ formatDate(row.createTime) }}</p>
<p>创建时间:{{ row.createTime || '-' }}</p>
</section>
<section class="route-progress">
<div class="route-track">
@@ -155,7 +155,6 @@
<script>
import * as api from '@/api/business/master-order';
import { splitRegionTokens } from '@/utils/region-address';
import TableHeaderTools from '@/components/table-header-tools/main.vue';
import MasterOrderEditor from './components/master-order-editor.vue';
import MasterOrderDispatch from './components/master-order-dispatch.vue';
@@ -333,10 +332,6 @@ export default {
? `${String(row.planStartTime).slice(0, 10)} - ${String(row.planEndTime).slice(0, 10)}`
: '-';
},
// 创建时间只展示日期。
formatDate(value) {
return value ? String(value).slice(0, 10) : '-';
},
goodsSummary(row) {
const item = (row.goods || [])[0] || {};
if (!item.cargoName && !item.cargoType) return '-';
@@ -396,26 +391,6 @@ export default {
}`;
return `${city} ${district}`;
},
// 悬停气泡里的地址:起讫点若只保存了名称或详细地址的一半,气泡就会显示成
// “柳南区”“安徽”这类残缺地址,故把两个字段互为补充后展示。
completeAddress(name, address) {
const rawName = String(name || '').trim();
const rawAddress = String(address || '').trim();
if (!rawName) return rawAddress;
if (!rawAddress) return rawName;
// 详细地址已含省市,本身就是完整地址,不再拼接名称,避免重复卡片上已有的站点名。
if (/(?:省|自治区|特别行政区|市)/.test(rawAddress)) return rawAddress;
const normalizedName = rawName.replace(/\s+/g, '');
const normalizedAddress = rawAddress.replace(/\s+/g, '');
if (normalizedAddress.includes(normalizedName)) return rawAddress;
if (normalizedName.includes(normalizedAddress)) return rawName;
// “珠海1号港口”与“珠海港口1号”这类同字异序写法只保留一个。
if ([...normalizedName].sort().join('') === [...normalizedAddress].sort().join('')) {
return normalizedName.length >= normalizedAddress.length ? rawName : rawAddress;
}
// 区域在前、详细地址在后。
return splitRegionTokens(rawName) ? `${rawName}${rawAddress}` : `${rawAddress}${rawName}`;
},
routeNodeName(value, address, transportType, region = {}) {
const text = String(value || '').trim();
if (!text) return '-';
@@ -482,12 +457,15 @@ export default {
if (this.isStationLikeName(rawAddress) && !this.isStationLikeName(rawName)) {
return {
name: rawAddress,
address: this.completeAddress(rawName, rawAddress) || regionText || rawAddress,
address: rawName || regionText || rawAddress,
};
}
const displayName = rawName || rawAddress || '-';
const tipAddress =
this.completeAddress(rawName, rawAddress) || regionText || rawAddress || displayName;
(rawAddress && rawAddress !== displayName ? rawAddress : '') ||
regionText ||
rawAddress ||
displayName;
return { name: displayName, address: tipAddress };
}
return {
@@ -497,7 +475,7 @@ export default {
siteCode,
nextTransportType,
}),
address: this.completeAddress(rawName, rawAddress) || regionText || '-',
address: rawAddress || rawName || regionText || '-',
};
},
routeNodes(row = {}) {
+1 -3
View File
@@ -416,7 +416,6 @@ import { getList as getProjectList } from '@/api/business/project-apply';
import { getDeptTree } from '@/api/system/dept';
import { exportBlob } from '@/api/common';
import { config, option } from '@/option/business/process-config';
import { applyIncomingSearch } from '@/utils/search-range';
import { getToken, isAdministrator } from '@/utils/auth';
import { downloadXls } from '@/utils/util';
import { mapGetters } from 'vuex';
@@ -604,8 +603,7 @@ export default {
});
},
normalizeListQuery(params = {}) {
// 新条件覆盖旧条件,清空的筛选项不再沿用上一次的值。
const query = applyIncomingSearch(this.query, params);
const query = { ...params, ...this.query };
const rawDeptId = query.deptId ?? query.searchDeptId;
delete query.searchDeptId;
if (rawDeptId !== undefined && rawDeptId !== null && String(rawDeptId).trim() !== '') {
+146 -18
View File
@@ -52,12 +52,37 @@
>
批量删除
</el-button>
<el-button
type="warning"
plain
v-if="!readonlyScope"
:loading="hcsRepushingId === 'batch'"
@click="handleHcsBatchRepush"
>
<el-icon class="el-icon--left"><Position /></el-icon>批量推送合规
</el-button>
</template>
<template #approvalStatus="{ row }">
{{ displayStatus(row, 'approvalStatus') }}
</template>
<template #hcsSyncStatus="{ row }">
<el-tooltip v-if="row.hcsSyncMsg" placement="top" :content="row.hcsSyncMsg">
<el-tag :type="hcsSyncTagType(row.hcsSyncStatus)" class="status-text">
{{ hcsSyncLabel(row.hcsSyncStatus) }}
</el-tag>
</el-tooltip>
<el-tag
v-else-if="row.hcsSyncStatus"
:type="hcsSyncTagType(row.hcsSyncStatus)"
class="status-text"
>
{{ hcsSyncLabel(row.hcsSyncStatus) }}
</el-tag>
<span v-else>-</span>
</template>
<template #header>
<div class="project-apply-page__risk-search">
<span class="project-apply-page__risk-label">
@@ -128,6 +153,13 @@
>
{{ operation.label }}
</el-link>
<el-link
v-if="canHcsRepush(row)"
type="warning"
@click="handleHcsRepush(row)"
>
{{ hcsRepushingId === row.id ? '推送中…' : '推送合规' }}
</el-link>
<el-link type="danger" v-if="canDelete(row)" @click="rowDel(row)"> 删除 </el-link>
</template>
</avue-crud>
@@ -224,7 +256,7 @@
placeholder="请选择"
filterable
clearable
:disabled="dialogReadonly"
:disabled="isBasicInfoReadonly"
/>
</el-form-item>
<el-form-item label="平台公司" prop="undertakeDeptId">
@@ -236,7 +268,7 @@
collapse-tags-tooltip
clearable
filterable
:disabled="dialogReadonly"
:disabled="isBasicInfoReadonly"
@change="handleUndertakeDeptChange"
>
<el-option
@@ -916,6 +948,8 @@
import { exportBlob } from '@/api/common';
import { defineAsyncComponent } from 'vue';
import * as api from '@/api/business/project-apply';
import { repush as hcsRepush, repushBatch as hcsRepushBatch } from '@/api/business/hcs';
import { Position } from '@element-plus/icons-vue';
import { getMkPublicDetail } from '@/api/mk-process';
import {
getList as getCustomerArchiveList,
@@ -1060,6 +1094,7 @@ export default {
ElImageViewer,
OpenFileViewer,
PdfPreview,
Position,
},
data() {
const validateAmount = (rule, value, callback) => {
@@ -1121,6 +1156,8 @@ export default {
{ label: '高风险', value: 'high', statKey: 'high' },
{ label: '中风险', value: 'medium', statKey: 'medium' },
],
// 合规(HCS)推送状态
hcsRepushingId: null,
page: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
@@ -1612,6 +1649,85 @@ export default {
return this.canOperation(operation, row);
});
},
// ==================== 合规(HCS)推送/对账(照“同步金蝶”按钮模式) ====================
hcsSyncLabel(value) {
return { unsynced: '待推送', synced: '已推送', failed: '推送失败' }[value] || value;
},
hcsSyncTagType(value) {
return { unsynced: 'info', synced: 'success', failed: 'danger' }[value] || 'info';
},
canHcsRepush(row) {
return (
!this.readonlyScope &&
['approved', 'change_approved'].includes(row.approvalStatus) &&
row.hcsSyncStatus !== 'synced'
);
},
handleHcsRepush(row) {
if (this.hcsRepushingId) return;
this.$confirm('确定推送该数据到合同合规系统?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.hcsRepushingId = row.id;
hcsRepush('project', row.id)
.then(res => {
if (res.data?.success === false) {
this.$message.error(res.data?.msg || '推送合规失败');
return;
}
this.$message.success(res.data?.data || '推送合规成功');
this.onLoad(this.page, this.query);
})
.catch(error => {
// 拦截器已弹出后端 msg,此处不再重复提示
if (!error?._notified) {
this.$message.error(error?.response?.data?.msg || '推送合规失败');
}
})
.finally(() => {
this.hcsRepushingId = null;
});
});
},
handleHcsBatchRepush() {
if (this.hcsRepushingId) return;
if (!this.selectionList.length) {
this.$message.warning('请选择至少一条数据');
return;
}
const invalidCount = this.selectionList.filter(item => !this.canHcsRepush(item)).length;
if (invalidCount) {
this.$message.warning(`选中数据中有${invalidCount}条不符合推送条件(仅审批通过且未同步的可推送),请重新选择`);
return;
}
this.$confirm(`确定将选中的${this.selectionList.length}条数据推送到合同合规系统?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.hcsRepushingId = 'batch';
hcsRepushBatch('project', this.selectionList.map(item => item.id))
.then(res => {
if (res.data?.success === false) {
this.$message.error(res.data?.msg || '批量推送合规失败');
return;
}
this.$message.success(res.data?.data || '批量推送合规完成');
this.onLoad(this.page, this.query);
})
.catch(error => {
// 拦截器已弹出后端 msg,此处不再重复提示
if (!error?._notified) {
this.$message.error(error?.response?.data?.msg || '批量推送合规失败');
}
})
.finally(() => {
this.hcsRepushingId = null;
});
});
},
canOperation(operation, row) {
const permission = operation.permission || `${this.config.permission}_${operation.action}`;
if (!this.hasPermission(permission) || this.readonlyScope || row.readonly) return false;
@@ -1750,17 +1866,33 @@ export default {
bizId: row.id,
subjectName: row.projectName || '',
approvalStatus: row.approvalStatus || '',
mkEnabled: this.mkEnabled,
}).then(() => request())
: request();
afterMk.then(res => {
if (res.data?.success === false || res.data?.data === false) {
this.$message.error(res.data?.msg || `${operation.label}失败,请联系管理员`);
return;
}
this.$message.success(`${operation.label}成功`);
this.onLoad(this.page, this.query);
});
// 项目通过会同步等待合规推送,加遮罩防重复点击
const loading =
operation.action === 'approve'
? this.$loading({
lock: true,
text: '正在推送合规,请稍候…',
background: 'rgba(255, 255, 255, 0.6)',
})
: null;
afterMk
.then(res => {
// data=false 表示审批已通过但合规推送失败,msg 带具体原因(照正式结算单审批)
if (operation.action === 'approve' && res.data?.data === false) {
this.$message.warning(res.data?.msg);
this.onLoad(this.page, this.query);
return;
}
if (res.data?.success === false) {
this.$message.error(res.data?.msg || `${operation.label}失败,请联系管理员`);
return;
}
this.$message.success(`${operation.label}成功`);
this.onLoad(this.page, this.query);
})
.finally(() => loading && loading.close());
};
if (operation.prompt) {
this.$prompt(operation.prompt, operation.label, {
@@ -1957,7 +2089,6 @@ export default {
bizId: id,
subjectName: name,
approvalStatus: status,
mkEnabled: this.mkEnabled,
}).then(() => {
this.$message.success('提交成功!');
this.closeProjectForm();
@@ -2029,7 +2160,6 @@ export default {
bizId: id,
subjectName: this.form.projectName || '',
approvalStatus: this.form.approvalStatus || 'change_rejected',
mkEnabled: this.mkEnabled,
}).then(() => {
this.$message.success('提交成功!');
this.closeProjectForm();
@@ -2493,8 +2623,7 @@ export default {
loadDeptOptions() {
getDeptTree().then(res => {
const deptTree = res.data.data || [];
// 新增/编辑/重大补录/项目变更均可选择业务部门,排除外部组织
const businessDeptTree = ['add', 'edit', 'majorSupplement', 'change'].includes(this.dialogType)
const businessDeptTree = ['add', 'edit', 'majorSupplement'].includes(this.dialogType)
? this.excludeExternalOrganization(deptTree)
: deptTree;
this.deptOptions = this.flattenDept(businessDeptTree);
@@ -2507,9 +2636,8 @@ export default {
const list = res.data.data || [];
this.platformCompanyOptions = list.map(item => ({
label: item.deptName || item.fullName || item.title || item.name,
// 雪花 ID 必须以字符串绑定,避免 JS Number 精度丢失导致多选提交异常
value: item.id == null || item.id === '' ? '' : String(item.id),
})).filter(item => item.value);
value: item.id,
}));
this.ensureCurrentPlatformOption();
});
},
+1 -2
View File
@@ -140,7 +140,7 @@ import * as api from '@/api/payment/billPayment';
import * as billLedgerApi from '@/api/payment/billLedger';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { getMkPublicDetail } from '@/api/mk-process';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
import { submitMkApprovalFlow } from '@/utils/mk-approval';
const emptyForm = () => ({
id: null,
@@ -348,7 +348,6 @@ export default {
bizId: this.form.id,
subjectName: this.form.paymentNo || this.form.billNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: await loadMkEnabled().catch(() => false),
});
this.$message.success('提交成功');
this.goBack();
-1
View File
@@ -132,7 +132,6 @@ export default {
bizId: row.id,
subjectName: row.paymentNo || row.billNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
});
this.$message.success('提交成功');
this.loadTable();
@@ -492,7 +492,7 @@ import { getDictionary } from '@/api/system/dictbiz';
import { invoiceApplicationDetailColumns } from '@/option/payment/invoiceApplication';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { getMkPublicDetail } from '@/api/mk-process';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
import { submitMkApprovalFlow } from '@/utils/mk-approval';
let localId = 0;
const emptyLine = () => ({
@@ -1208,7 +1208,6 @@ export default {
bizId: this.form.id,
subjectName: this.form.applicationNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: await loadMkEnabled().catch(() => false),
});
this.$message.success('提交成功');
this.goBack();
-11
View File
@@ -384,7 +384,6 @@ export default {
bizId: row.id,
subjectName: row.applicationNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
});
this.$message.success('提交成功');
this.loadTable();
@@ -505,16 +504,6 @@ export default {
tip: row.kingdeeLockFailReason || '系统将自动补偿重锁',
};
}
// 金蝶解锁终态标识:删单解锁的源单已作废,此标签用于区分人工作废与金蝶删单
if (row.kingdeeUnlockTime) {
const isDelete = row.kingdeeUnlockOperationName === '金蝶删单';
return {
show: true,
type: isDelete ? 'danger' : 'warning',
label: row.kingdeeUnlockOperationName || '金蝶解锁',
tip: `${row.kingdeeUnlockOperator || '-'} 于 ${this.$dayjs(row.kingdeeUnlockTime).format('YYYY-MM-DD HH:mm:ss')} 解锁`,
};
}
return { show: false };
},
displayValue(value) {
+1 -2
View File
@@ -219,7 +219,7 @@ import * as api from '@/api/payment/invoiceReceipt';
import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/main.vue';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { getMkPublicDetail } from '@/api/mk-process';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
import { submitMkApprovalFlow } from '@/utils/mk-approval';
const emptyForm = () => ({
id: null,
@@ -571,7 +571,6 @@ export default {
bizId: this.form.id,
subjectName: this.form.invoiceNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: await loadMkEnabled().catch(() => false),
});
this.$message.success('提交成功');
this.goBack();
-1
View File
@@ -341,7 +341,6 @@ export default {
bizId: row.id,
subjectName: row.invoiceNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
});
this.$message.success('提交成功');
this.loadTable();
+109 -85
View File
@@ -36,20 +36,25 @@
<el-col v-if="isSettlementRelatedType" :span="6"
><el-form-item label="结算单号" prop="referenceId">
<div class="payment-form-page__settlement-nos">
<el-tooltip
:content="referenceLabel"
placement="top"
:disabled="!referenceLabel || referenceSettlementCount < 2"
<el-select
ref="settlementNoSelectRef"
:model-value="referenceSettlementNos"
multiple
collapse-tags
collapse-tags-tooltip
:max-collapse-tags="1"
:disabled="readonly"
placeholder="请输入"
class="payment-form-page__settlement-select"
@visible-change="handleSettlementSelectVisible"
>
<el-input
:model-value="referenceDisplayText"
readonly
:disabled="readonly"
placeholder="请输入"
class="payment-form-page__settlement-input"
@click="!readonly && openReference()"
<el-option
v-for="item in referenceSettlementLinks"
:key="`${item.id || item.settlementNo}`"
:label="item.settlementNo"
:value="item.settlementNo"
/>
</el-tooltip>
</el-select>
<el-button
v-if="!readonly"
class="payment-form-page__settlement-select-btn"
@@ -218,6 +223,11 @@
show-word-limit /></el-form-item
></el-col>
</el-row>
<!-- 风险客商提示(基本信息备注后,同合同新增页):收款方外部客商高风险/黑名单时展示,文案由后端 riskTip 拼装 -->
<div v-if="payeeRiskText" class="payment-form-page__risk-tip">
<div class="payment-form-page__risk-tip-title">风险客商提示:</div>
<div class="payment-form-page__risk-tip-content">{{ payeeRiskText }}</div>
</div>
</section-card>
<section-card v-if="isSettlementRelatedType" title="结算信息">
<el-table :data="settlementRows" border
@@ -664,6 +674,7 @@ import * as billLedgerApi from '@/api/payment/billLedger';
import { getDictionary } from '@/api/system/dictbiz';
import { getList as getProjectList } from '@/api/business/project-apply';
import { getDetail as getContractDetail } from '@/api/business/contract-manage';
import { getRisk as getCustomerRisk } from '@/api/business/hcs';
import * as formalApi from '@/api/settlement/formalSettlement';
import * as preApi from '@/api/settlement/preSettlement';
import {
@@ -673,7 +684,7 @@ import {
import { readSettlementTransfer, removeSettlementTransfer } from '@/utils/settlement-transfer';
import { formatContractOptionLabel } from '@/utils/contract';
import { downloadFileByUrl } from '@/utils/util';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
import { submitMkApprovalFlow } from '@/utils/mk-approval';
import {
downloadKingdeeInvoiceFile,
isKingdeePathAttachment,
@@ -688,9 +699,6 @@ const attachmentViewerPlugins = [
fallbackPlugin(),
];
const paymentApplicationListRoute = '/payment/payment-application';
const paymentApplicationListRefreshKey = 'payment-application-list-refresh';
const ATTACHMENT_MATERIALS = {
weighingSlip: { key: 'weighingSlip', label: '磅单', keywords: ['磅单'] },
entrustOrder: { key: 'entrustOrder', label: '委托单', keywords: ['委托单'] },
@@ -815,6 +823,11 @@ export default {
contractPaymentRatioLimit: null,
contractPaymentRatioExceeded: false,
payeeCustomerLevel: '',
// 收款方 C101-1 风险查询留档:risky=高风险/黑名单,tip=后端拼装提示文案
payeeRisky: false,
payeeRiskTip: '',
payeeRiskLevel: '',
payeeBlackStatus: '',
attachmentRuleLoading: false,
attachmentImagePreviewVisible: false,
attachmentImagePreviewUrls: [],
@@ -950,14 +963,6 @@ export default {
referenceSettlementNos() {
return this.referenceSettlementLinks.map(item => item.settlementNo).filter(Boolean);
},
referenceSettlementCount() {
return this.referenceSettlementNos.length;
},
// 结算单号展示:单张显示单号;多张仅提示数量,明细在下方「结算信息」表,悬停可看全部单号
referenceDisplayText() {
if (this.referenceSettlementCount > 1) return `已选 ${this.referenceSettlementCount} 张结算单`;
return this.referenceLabel;
},
settlementRows() {
if (this.referenceRows.length) {
return this.referenceRows.map(item => ({
@@ -986,11 +991,22 @@ export default {
];
},
highRiskPayee() {
// 收款方 C101-1 高风险/黑名单,或客商等级 D/E/F(本地评级口径),命中须上传特批附件
if (this.payeeRisky) return true;
const level = String(this.payeeCustomerLevel || '')
.trim()
.toUpperCase();
return ['D', 'D级', 'E', 'E级', 'F', 'F级'].includes(level) || level.includes('高风险');
},
// 高风险/黑名单收款方提示(C101-1,同合同新增页风险客商提示口径;强制拦截在后端提交校验与金蝶推送门禁)
payeeRiskText() {
if (!this.payeeRisky) return '';
const levelMap = { 0: '低风险', 1: '中风险', 2: '高风险' };
const level = levelMap[this.payeeRiskLevel] || '未知';
const blacklist = String(this.payeeBlackStatus || '').trim().toLowerCase() === 'yes' ? '是' : '否';
const tip = this.payeeRiskTip || `收款方[${this.form.payeeName || ''}]为高风险/黑名单客商`;
return `风险等级:${level}|黑名单:${blacklist}。${tip},按集团规定不可直接付款,提交前须上传「特批附件」类型附件,审批通过后将自动发起付款特批`;
},
requiredAttachmentMaterials() {
if (this.form.paymentType === 'project_advance') {
return [ATTACHMENT_MATERIALS.contract];
@@ -1233,7 +1249,7 @@ export default {
];
}
const referenceRow = this.createReferenceRow(data);
this.referenceRows = this.restoreReferenceRows(data, referenceRow);
this.referenceRows = referenceRow.settlementNo ? [referenceRow] : [];
this.paymentRecords = data.paymentRecords || [];
},
async initialize() {
@@ -1256,7 +1272,7 @@ export default {
invoices: data.invoices || [],
};
const referenceRow = this.createReferenceRow(data);
this.referenceRows = this.restoreReferenceRows(data, referenceRow);
this.referenceRows = referenceRow.settlementNo ? [referenceRow] : [];
this.paymentRecords = data.paymentRecords || [];
if (this.form.paymentType === 'project_advance') {
await this.loadProjectOptions();
@@ -1474,33 +1490,6 @@ export default {
this.$refs.formRef?.clearValidate();
});
},
restoreReferenceRows(data, fallbackRow) {
const relations = Array.isArray(data?.settlements) ? data.settlements : [];
const rows = relations
.map(item => {
const isPre = item.preSettlementId !== undefined && item.preSettlementId !== null && item.preSettlementId !== '';
const settlementNo = item.preSettlementNo || item.formalSettlementNo || '';
if (!settlementNo) return null;
return {
id: isPre ? item.preSettlementId : item.formalSettlementId,
settlementNo,
referenceType: isPre ? 'pre' : 'formal',
settlementAmount: Number(Number(item.settlementAmount || 0).toFixed(2)),
payableAmount: Number(Number(item.payableAmount ?? item.settlementAmount ?? 0).toFixed(2)),
appliedAmount: Number(Number(item.appliedAmount || 0).toFixed(2)),
fixedAppliedAmount: this.readonly,
};
})
.filter(Boolean);
if (rows.length > 1) {
this.form.preSettlementIds = rows.filter(item => item.referenceType === 'pre').map(item => item.id);
this.form.settlementIds = rows.filter(item => item.referenceType === 'formal').map(item => item.id);
if (this.form.preSettlementIds.length) this.form.preSettlementId = this.form.preSettlementIds[0];
if (this.form.settlementIds.length) this.form.settlementId = this.form.settlementIds[0];
return rows;
}
return fallbackRow?.settlementNo ? [fallbackRow] : [];
},
createReferenceRow(row) {
const settlementAmount = Number(row.settlementAmount || 0);
const appliedAmount = Number(row.advanceAppliedAmount || row.appliedPaymentAmount || 0);
@@ -1509,13 +1498,11 @@ export default {
id: row.preSettlementId || row.settlementId || row.id,
settlementNo: row.preSettlementNo || row.formalSettlementNo || row.settlementNo || '',
referenceType: isPre ? 'pre' : 'formal',
settlementAmount: Number(Number(settlementAmount || 0).toFixed(2)),
payableAmount: Number(
(row.payableAmount === undefined || row.payableAmount === null
settlementAmount,
payableAmount:
row.payableAmount === undefined || row.payableAmount === null
? Math.max(0, settlementAmount - appliedAmount)
: Number(row.payableAmount || 0)
).toFixed(2)
),
: Number(row.payableAmount || 0),
};
},
createInvoiceRows(invoices = [], settlementNo = '') {
@@ -1573,24 +1560,9 @@ export default {
}
const first = rows[0];
this.form.invoices = [];
const paymentType =
this.form.paymentType === 'settlement_payment' ? 'settlement_payment' : 'progress_advance';
const amountResponses = await Promise.all(
rows.map(item => {
const referenceId = item.preSettlementId || item.id;
if (!this.isValidReferenceId(referenceId)) return Promise.resolve(null);
return api.getReferenceAmount(paymentType, referenceId, this.form.id).catch(() => null);
})
this.referenceRows = rows.map(item =>
this.createReferenceRow({ ...item, referenceType: 'pre' })
);
this.referenceRows = rows.map((item, index) => {
const amount = this.unwrapData(amountResponses[index]) || {};
return this.createReferenceRow({
...item,
referenceType: 'pre',
settlementAmount: amount.settlementAmount ?? item.settlementAmount,
payableAmount: amount.payableAmount,
});
});
const settlementAmount = this.referenceRows.reduce(
(total, item) => total + Number(item.settlementAmount || 0),
0
@@ -1601,6 +1573,8 @@ export default {
);
const paymentRatio = Number(this.form.paymentRatio || 0);
// 尾款付款场景下选择预结算单时保留尾款付款类型,不强制改为进度预付
const paymentType =
this.form.paymentType === 'settlement_payment' ? 'settlement_payment' : 'progress_advance';
this.amountSyncing = true;
Object.assign(this.form, {
paymentType,
@@ -2015,6 +1989,10 @@ export default {
const preserveCurrentValue = autoSelectDefault === false;
this.receiptAccountOptions = [];
this.payeeCustomerLevel = '';
this.payeeRisky = false;
this.payeeRiskTip = '';
this.payeeRiskLevel = '';
this.payeeBlackStatus = '';
if (!partyBName) {
if (!preserveCurrentValue) this.clearReceiptAccount();
return;
@@ -2046,6 +2024,19 @@ export default {
}
const detail = this.unwrapData(await getCustomerArchiveDetail(customer.id));
this.payeeCustomerLevel = detail.customerLevel || '';
// 收款方实时查 C101-1 客商风险(后端对内部组织客商默认返回无风险):高风险/黑名单在
// 基本信息"风险客商提示"条常驻展示并要求特批附件;查询失败不阻断填写,提交时后端强校验兜底
if (detail.customerCode) {
try {
const risk = this.unwrapData(await getCustomerRisk(detail.customerCode)) || {};
this.payeeRisky = Boolean(risk.risky);
this.payeeRiskTip = risk.riskTip || '';
this.payeeRiskLevel = risk.fdRiskLevel || '';
this.payeeBlackStatus = risk.fdBlackStatus || '';
} catch (error) {
// 忽略风险查询异常,提交时后端 C101-1 强校验兜底
}
}
this.receiptAccountOptions = (detail.receiptAccounts || [])
.filter(item => item.accountName || item.accountHolderName || item.bankAccount)
.map(item => ({
@@ -2335,6 +2326,13 @@ export default {
}
return Promise.all(loaders);
},
handleSettlementSelectVisible(visible) {
// 结算单号仅做展示,通过「选择」按钮维护,避免下拉改值
if (!visible) return;
this.$nextTick(() => {
this.$refs.settlementNoSelectRef?.blur?.();
});
},
handleReferenceSearch() {
this.formalPage.current = 1;
this.prePage.current = 1;
@@ -2747,6 +2745,15 @@ export default {
// 提交前静默保存,避免同时弹出「保存成功」与材料缺失 toast
const saved = await this.saveDraft({ showSuccess: false });
if (!saved) return;
// 高风险/黑名单收款方必须上传特批附件(与后端提交强校验同口径)
if (
this.missingAttachmentMaterials.some(
item => item.key === ATTACHMENT_MATERIALS.specialApproval.key
)
) {
this.$message.warning('收款方为高风险/黑名单客商,必须上传「特批附件」类型附件后再提交审批');
return;
}
const previousApprovalStatus = this.form.approvalStatus || '';
await api.submit({ id: this.form.id });
await submitMkApprovalFlow({
@@ -2754,17 +2761,14 @@ export default {
bizId: this.form.id,
subjectName: this.form.paymentNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: await loadMkEnabled().catch(() => false),
});
this.$message.success('提交成功');
// 通知列表页(keep-alive)重新拉取数据
sessionStorage.setItem(paymentApplicationListRefreshKey, '1');
this.goBack();
},
goBack() {
removeSettlementTransfer(this.$route.query.transferToken);
this.$router.$avueRouter?.closeTag?.();
this.$router.push(paymentApplicationListRoute);
this.$router.push('/payment/payment-application');
},
formatMoney(value) {
const amount = Number(value);
@@ -2778,6 +2782,26 @@ export default {
.payment-form-page__form {
padding-bottom: 72px;
}
// 风险客商提示条(基本信息备注后,同合同新增页):橙黄背景 + 红色文字
.payment-form-page__risk-tip {
margin: 0 0 18px;
padding: 10px 16px;
background: #faecd8;
border-radius: 4px;
.payment-form-page__risk-tip-title {
color: #f56c6c;
font-weight: 600;
line-height: 22px;
}
.payment-form-page__risk-tip-content {
color: #f56c6c;
line-height: 22px;
}
}
.payment-form-page__settlement-nos {
display: flex;
align-items: center;
@@ -2785,15 +2809,15 @@ export default {
width: 100%;
min-height: 32px;
}
.payment-form-page__settlement-input {
.payment-form-page__settlement-select {
flex: 1;
min-width: 0;
}
.payment-form-page__settlement-input :deep(.el-input__inner) {
cursor: pointer;
.payment-form-page__settlement-select :deep(.el-select__wrapper) {
width: 100%;
}
.payment-form-page__settlement-input.is-disabled :deep(.el-input__inner) {
cursor: not-allowed;
.payment-form-page__settlement-select :deep(.el-tag__close) {
display: none;
}
.payment-form-page__settlement-select-btn {
flex-shrink: 0;
-35
View File
@@ -152,9 +152,6 @@ import organizationSearch from '@/mixins/organization-search';
import { getMKApprovalUrl } from '@/api/system/business-process';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
const paymentApplicationListRoute = '/payment/payment-application';
const paymentApplicationListRefreshKey = 'payment-application-list-refresh';
export default {
name: 'PaymentApplication',
mixins: [organizationSearch],
@@ -196,28 +193,7 @@ export default {
this.mkEnabled = false;
});
},
activated() {
this.consumeListRefreshFlag();
},
watch: {
$route(to, from) {
if (
to.path === paymentApplicationListRoute &&
from?.path?.includes('/payment-application/form')
) {
this.consumeListRefreshFlag();
}
},
},
methods: {
/** 表单提交成功后带标记返回时,重新拉取列表 */
consumeListRefreshFlag() {
if (!sessionStorage.getItem(paymentApplicationListRefreshKey)) {
return;
}
sessionStorage.removeItem(paymentApplicationListRefreshKey);
this.onLoad(this.page);
},
hasPermission(code) {
return this.permission?.[code] !== false;
},
@@ -320,7 +296,6 @@ export default {
bizId: row.id,
subjectName: row.paymentNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
});
this.$message.success('提交成功');
this.refreshChange();
@@ -466,16 +441,6 @@ export default {
tip: row.kingdeeLockFailReason || '系统将自动补偿重锁',
};
}
// 金蝶解锁终态标识:后端按 unlocked 锁记录回填(付款申请不作废,仅此标识可区分金蝶删单与推送失败)
if (row.kingdeeUnlockTime) {
const isDelete = row.kingdeeUnlockOperationName === '金蝶删单';
return {
show: true,
type: isDelete ? 'danger' : 'warning',
label: row.kingdeeUnlockOperationName || '金蝶解锁',
tip: `${row.kingdeeUnlockOperator || '-'} 于 ${this.$dayjs(row.kingdeeUnlockTime).format('YYYY-MM-DD HH:mm:ss')} 解锁`,
};
}
return { show: false };
},
displayValue(value) {
+1 -15
View File
@@ -46,9 +46,6 @@
<el-table-column label="金蝶未认领金额" min-width="140" align="right">
<template #default="{ row }">{{ formatMoney(row.unclaimedAmount) }}</template>
</el-table-column>
<el-table-column label="剩余可认领金额" min-width="140" align="right">
<template #default="{ row }">{{ formatMoney(flowRemaining(row)) }}</template>
</el-table-column>
<el-table-column prop="summary" label="摘要" min-width="180" show-overflow-tooltip />
</el-table>
<el-row :gutter="32" class="receipt-claim-batch-form-page__claim-info">
@@ -301,21 +298,10 @@ export default {
0
);
},
flowRemaining(flow) {
return Math.max(Number(flow.unclaimedAmount || 0) - Number(flow.claimedAmount || 0), 0);
},
maxAllocation(row) {
const current = Number(row.settlement.allocations?.[row.flow.id] || 0);
const otherTotal = this.settlementAllocatedTotal(row.settlement) - current;
// 流水维度:该流水其余分摊已占用部分同样挤占剩余可认领金额
const flowOtherTotal = this.flowAllocatedTotal(row.flow.id) - current;
return Math.max(
Math.min(
this.settlementRemaining(row.settlement) - otherTotal,
this.flowRemaining(row.flow) - flowOtherTotal
),
0
);
return Math.max(this.settlementRemaining(row.settlement) - otherTotal, 0);
},
handleAllocationChange(settlement) {
const total = this.settlementAllocatedTotal(settlement);
@@ -14,7 +14,7 @@
label-width="auto"
>
<el-row :gutter="24">
<el-col v-for="field in visibleFields" :key="field.prop" :span="6">
<el-col v-for="field in fields" :key="field.prop" :span="6">
<el-form-item :label="field.label" :prop="field.prop">
<el-date-picker
v-if="field.type === 'date' && editable"
@@ -64,12 +64,6 @@
:precision="2"
:controls="false"
/>
<span
v-else-if="field.prop === 'formalSettlementNo'"
:class="{ 'form-readonly--code': form.formalSettlementNo }"
>
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
</span>
<span v-else-if="field.money">{{ formatMoney(form[field.prop]) }}</span>
<span v-else-if="field.type === 'contract'">{{
displayValue(form.contractName)
@@ -252,36 +246,24 @@
:index="detailIndexMethod"
/>
<el-table-column
v-for="item in detailDisplayColumns"
:key="item.key"
:label="item.kind === 'fee' ? item.name : item.column.label"
:prop="item.kind === 'fee' ? undefined : item.column.prop"
:min-width="item.kind === 'fee' ? 130 : item.column.minWidth"
v-for="column in detailTableColumns"
:key="column.prop"
v-bind="column"
align="center"
show-overflow-tooltip
>
<template #default="{ row }">
<span v-if="item.kind === 'fee'">
{{ formatMoney(parseFeeItems(row.feeItemsJson || row.feeItems)[item.name]) }}
<span v-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
<span v-else-if="column.prop === 'transportQuantity'">
{{ formatDetailTransportQuantity(row[column.prop]) }}
</span>
<el-link
v-else-if="item.column.link && row[item.column.prop] && !publicMode"
type="primary"
@click.stop="handleDetailLink(row, item.column)"
>
{{ row[item.column.prop] }}
</el-link>
<span v-else-if="item.column.money">{{ formatMoney(row[item.column.prop]) }}</span>
<span v-else-if="item.column.prop === 'transportQuantity'">
{{ formatDetailTransportQuantity(row[item.column.prop]) }}
<span v-else-if="column.prop === 'mileage'">
{{ formatDetailMileage(row[column.prop]) }}
</span>
<span v-else-if="item.column.prop === 'mileage'">
{{ formatDetailMileage(row[item.column.prop]) }}
<span v-else-if="column.prop === 'transportType'">
{{ transportTypeName(row[column.prop]) }}
</span>
<span v-else-if="item.column.prop === 'transportType'">
{{ transportTypeName(row[item.column.prop]) }}
</span>
<span v-else>{{ displayValue(row[item.column.prop]) }}</span>
<span v-else>{{ displayValue(row[column.prop]) }}</span>
</template>
</el-table-column>
<el-table-column v-if="editable" label="操作" width="150" fixed="right" align="center">
@@ -396,16 +378,6 @@
</div>
</section-card>
<project-advance-write-off
ref="projectAdvanceWriteOffRef"
v-model="projectAdvanceWriteOffs"
:editable="editable"
:contract-id="form.contractId"
:settlement-amount="form.settlementAmount"
settlement-type="formal"
:settlement-id="form.id"
/>
<section-card title="发票信息">
<div class="formal-editor__invoice-claim">
<el-form inline label-position="right" label-width="auto" @submit.prevent>
@@ -1015,11 +987,6 @@ import {
getDetailFees as getPreSettlementDetailFees,
} from '@/api/settlement/preSettlement';
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
import {
resolveReceivablePayableDetailId,
resolveWaybillId,
settlementDetailPath,
} from '@/utils/settlement-detail-link';
import { getBfiExchangeRate } from '@/api/base/currency';
import {
createFormalSettlementForm,
@@ -1037,7 +1004,6 @@ import { h } from 'vue';
import { InfoFilled } from '@element-plus/icons-vue';
import { mapGetters } from 'vuex';
import { formatContractOptionLabel } from '@/utils/contract';
import { normalizeCurrencyCode } from '@/utils/currency';
import { downloadFileByUrl } from '@/utils/util';
import {
downloadKingdeeInvoiceFile,
@@ -1045,16 +1011,12 @@ import {
viewKingdeeInvoiceFile,
} from '@/utils/kingdee-attachment';
import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/main.vue';
import ProjectAdvanceWriteOff from './project-advance-write-off.vue';
import * as XLSX from 'xlsx';
import { isAdministrator } from '@/utils/auth';
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
const LOCAL_CURRENCY_HIDDEN_FIELDS = ['exchangeRateDate', 'exchangeRate', 'localSettlementAmount'];
export default {
name: 'FormalSettlementEditor',
components: { InfoFilled, KingdeeInvoicePoolDialog, ProjectAdvanceWriteOff },
components: { InfoFilled, KingdeeInvoicePoolDialog },
props: {
modelValue: Boolean,
recordId: [String, Number],
@@ -1083,7 +1045,6 @@ export default {
receiptClaims: [],
adjustments: [],
changeRecords: [],
projectAdvanceWriteOffs: [],
attachments: [],
selectedAttachmentRows: [],
invoices: [],
@@ -1222,34 +1183,6 @@ export default {
title() {
return this.readonly ? '查看正式结算单' : this.recordId ? '编辑正式结算单' : '新增正式结算单';
},
detailFeeItemNames() {
const names = new Set();
this.details.forEach(row => {
Object.keys(this.parseFeeItems(row.feeItemsJson || row.feeItems)).forEach(name =>
names.add(name)
);
});
return Array.from(names);
},
detailDisplayColumns() {
const columns = this.detailTableColumns;
const unitPriceIndex = columns.findIndex(column => column.prop === 'unitPrice');
const beforeColumns = unitPriceIndex < 0 ? columns : columns.slice(0, unitPriceIndex + 1);
const afterColumns = unitPriceIndex < 0 ? [] : columns.slice(unitPriceIndex + 1);
return [
...beforeColumns.map(column => ({ kind: 'field', key: column.prop, column })),
...this.detailFeeItemNames.map(name => ({ kind: 'fee', key: `fee-${name}`, name })),
...afterColumns.map(column => ({ kind: 'field', key: column.prop, column })),
];
},
// 币种为空按人民币处理,与后端预结算/正式结算对空币种的默认取值一致
isLocalCurrencySettlement() {
return normalizeCurrencyCode(this.form.currency) === 'RMB';
},
visibleFields() {
if (!this.isLocalCurrencySettlement) return this.fields;
return this.fields.filter(field => !LOCAL_CURRENCY_HIDDEN_FIELDS.includes(field.prop));
},
summaryTotal() {
return this.summaryFees.reduce((total, row) => total + Number(row.settlementAmount || 0), 0);
},
@@ -1342,13 +1275,6 @@ export default {
}
this.adjustments = data.adjustments || [];
this.changeRecords = data.changeRecords || [];
this.projectAdvanceWriteOffs = (data.projectAdvanceWriteOffs || []).map(row => ({
...row,
writeOffAmount: Number(row.writeOffAmount || 0),
projectAdvanceAmount: Number(row.projectAdvanceAmount || 0),
availableWriteOffAmount: Number(row.availableWriteOffAmount || 0),
createTime: row.paymentCreateTime || row.createTime,
}));
this.attachments = this.parseAttachments(data.attachmentsJson);
this.selectedAttachmentRows = [];
this.invoices = data.invoices || [];
@@ -1379,7 +1305,6 @@ export default {
this.receiptClaims = [];
this.adjustments = [];
this.changeRecords = [];
this.projectAdvanceWriteOffs = [];
this.attachments = [];
this.selectedAttachmentRows = [];
this.invoices = [];
@@ -2106,21 +2031,6 @@ export default {
this.appliedDetailQuery = { ...this.detailQuery };
this.detailPage.current = 1;
},
// 结算明细的「单据号」跳到该应收应付单据在应收明细/应付明细页的详情,「运单号」跳到运单详情
async handleDetailLink(row, column) {
if (column.prop === 'documentNo') {
const settlementType = row.settlementType || this.form.settlementType || 'payable';
const detailId = await resolveReceivablePayableDetailId(row, settlementType);
if (!detailId) return this.$message.info('当前记录未找到对应的应收/应付明细');
this.$router.push({ path: settlementDetailPath(settlementType), query: { detailId } });
return;
}
if (column.prop === 'waybillNo') {
const waybillId = await resolveWaybillId(row);
if (!waybillId) return this.$message.info('当前记录未找到对应的运单详情');
this.$router.push({ path: '/business/waybill-manage/detail', query: { id: waybillId } });
}
},
resetDetailQuery(apply = true) {
this.detailQuery = { documentNo: '', waybillNo: '', batchNo: '', cargoName: '' };
if (apply) this.handleDetailQuery();
@@ -2639,7 +2549,6 @@ export default {
matchedAmount: Number(row.matchedAmount || 0),
attachmentJson: row.attachmentJson || '',
})),
projectAdvanceWriteOffs: this.$refs.projectAdvanceWriteOffRef?.toSavePayload?.() || [],
remark: this.form.remark,
};
},
@@ -2648,9 +2557,6 @@ export default {
},
async handleDraftSave() {
// 保存草稿:不做表单校验,直接落草稿并返回列表刷新
if (this.$refs.projectAdvanceWriteOffRef?.validateBeforeSave?.() === false) {
return;
}
this.draftSaving = true;
try {
await save({
@@ -2678,9 +2584,6 @@ export default {
return this.$message.warning('请完善手工费用的费用类型和费用项');
}
if (!this.validateInvoices()) return;
if (this.$refs.projectAdvanceWriteOffRef?.validateBeforeSave?.() === false) {
return;
}
// 附件类型仅做提示,不阻断正式结算单新增/保存提交。
// this.validateAttachments();
this.saving = true;
@@ -2961,9 +2864,6 @@ export default {
</script>
<style scoped lang="scss">
.form-readonly--code {
color: var(--el-color-primary);
}
.formal-editor--page {
padding-bottom: 72px;
}
@@ -295,16 +295,6 @@ export default {
tip: row.kingdeeLockFailReason || '系统将自动补偿重锁',
};
}
// 金蝶解锁终态标识:删单解锁的源单已作废,此标签用于区分人工作废与金蝶删单
if (row.kingdeeUnlockTime) {
const isDelete = row.kingdeeUnlockOperationName === '金蝶删单';
return {
show: true,
type: isDelete ? 'danger' : 'warning',
label: row.kingdeeUnlockOperationName || '金蝶解锁',
tip: `${row.kingdeeUnlockOperator || '-'} 于 ${this.$dayjs(row.kingdeeUnlockTime).format('YYYY-MM-DD HH:mm:ss')} 解锁`,
};
}
return { show: false };
},
displayValue(value) {
@@ -16,7 +16,7 @@
class="pre-settlement-editor__form"
>
<el-row :gutter="24">
<el-col v-for="field in visibleFormFields" :key="field.prop" :span="field.span || 6">
<el-col v-for="field in formFields" :key="field.prop" :span="field.span || 6">
<el-form-item :label="field.label" :prop="field.prop">
<el-input
v-if="field.type === 'contract'"
@@ -40,7 +40,7 @@
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
:disabled="!editable"
:disabled="!editable || form.currency === 'RMB'"
placeholder="请选择"
@change="handleExchangeRateDateChange"
/>
@@ -50,7 +50,7 @@
:min="0"
:precision="2"
:controls="false"
:disabled="!editable"
:disabled="!editable || form.currency === 'RMB'"
@change="recalculateLocalAmount"
/>
<el-input
@@ -66,11 +66,7 @@
<span v-else-if="field.prop === 'settlementType'" class="form-readonly">
{{ settlementTypeName }}
</span>
<span
v-else-if="field.prop === 'preSettlementNo'"
class="form-readonly"
:class="{ 'form-readonly--code': form.preSettlementNo }"
>
<span v-else-if="field.prop === 'preSettlementNo'" class="form-readonly">
{{ form.preSettlementNo || (!form.id ? '系统自动生成' : '-') }}
</span>
<span v-else-if="field.prop === 'createTime'" class="form-readonly">
@@ -247,52 +243,60 @@
:index="detailIndexMethod"
/>
<el-table-column
v-for="item in detailDisplayColumns"
:key="item.key"
:label="item.kind === 'fee' ? item.name : item.column.label"
:prop="item.kind === 'fee' ? undefined : item.column.prop"
:min-width="item.kind === 'fee' ? 130 : item.column.minWidth"
v-for="column in visibleDetailColumns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
:min-width="column.minWidth"
align="center"
show-overflow-tooltip
>
<template #default="{ row }">
<span v-if="item.kind === 'fee'">
{{
formatMoney(
parseFeeItems(row.feeItemsJson)[item.name],
row.currency || form.currency
)
}}
</span>
<el-link
v-else-if="item.column.link && row[item.column.prop] && !publicMode"
v-if="column.link && row[column.prop]"
type="primary"
@click.stop="handleDetailLink(row, item.column)"
@click="openAdjustDialog(row, true)"
>
{{ row[item.column.prop] }}
{{ row[column.prop] }}
</el-link>
<span v-else-if="item.column.money && item.column.prop === 'unitPrice'">
<span v-else-if="column.money && column.prop === 'unitPrice'">
{{ formatUnitPrice(row) }}
</span>
<span v-else-if="item.column.money">
{{ formatMoney(row[item.column.prop], row.currency || form.currency) }}
<span v-else-if="column.money">
{{ formatMoney(row[column.prop], row.currency || form.currency) }}
</span>
<span v-else-if="item.column.prop === 'transportQuantityText'">
<span v-else-if="column.prop === 'transportQuantityText'">
{{ formatQuantity(row) }}
</span>
<span v-else-if="item.column.prop === 'mileage'">
{{ formatDetailMileage(row[item.column.prop]) }}
<span v-else-if="pageMode && column.prop === 'mileage'">
{{ formatDetailMileage(row[column.prop]) }}
</span>
<span v-else-if="item.column.prop === 'transportType'">
{{ transportTypeName(row[item.column.prop]) }}
<span v-else-if="column.prop === 'transportType'">
{{ transportTypeName(row[column.prop]) }}
</span>
<span v-else-if="item.column.prop === 'cargoName'">
<span v-else-if="column.prop === 'cargoName'">
{{ formatCargoNames(row) }}
</span>
<span v-else-if="item.column.prop === 'cargoType'">
<span v-else-if="column.prop === 'cargoType'">
{{ formatCargoTypes(row) }}
</span>
<span v-else>{{ displayValue(row[item.column.prop]) }}</span>
<span v-else>{{ displayValue(row[column.prop]) }}</span>
</template>
</el-table-column>
<el-table-column
v-for="feeItem in detailFeeItemNames"
:key="`fee-${feeItem}`"
:label="feeItem"
min-width="130"
align="center"
>
<template #default="{ row }">
{{
formatMoney(
parseFeeItems(row.feeItemsJson)[feeItem],
row.currency || form.currency
)
}}
</template>
</el-table-column>
<el-table-column label="操作" :width="editable ? 150 : 90" fixed="right" align="center">
@@ -417,16 +421,6 @@
</div>
</section-card>
<project-advance-write-off
ref="projectAdvanceWriteOffRef"
v-model="projectAdvanceWriteOffs"
:editable="editable"
:contract-id="form.contractId"
:settlement-amount="form.settlementAmount"
settlement-type="pre"
:settlement-id="form.id"
/>
<section-card v-if="form.id && readonly" title="预付信息">
<el-table :data="advances" border>
<el-table-column type="index" label="序号" width="64" align="center" />
@@ -782,13 +776,12 @@
</el-table-column>
<el-table-column label="里程(KM)" min-width="140" align="center">
<template #default="{ row }">
<span v-if="adjustDialog.readonly">{{ formatDetailMileage(row.mileage) }}</span>
<el-input-number
v-else
v-model="row.mileage"
:min="0"
:precision="2"
:controls="false"
:disabled="adjustDialog.readonly"
@change="recalculateAdjustRow(row, 'mileage')"
/>
</template>
@@ -946,27 +939,19 @@ import { h } from 'vue';
import { mapGetters } from 'vuex';
import { InfoFilled } from '@element-plus/icons-vue';
import ChangeRecordDetailDialog from '@/components/change-record-detail-dialog/main.vue';
import ProjectAdvanceWriteOff from './project-advance-write-off.vue';
import { getMkPublicDetail } from '@/api/mk-process';
import {
adjustDetail,
getCandidateDetails,
getContractList,
getContractOptions,
getDetail,
getDetailFees,
getFeeOptions,
getNextNo,
removeDetail,
save,
submit,
} from '@/api/settlement/preSettlement';
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
import {
resolveReceivablePayableDetailId,
resolveWaybillId,
settlementDetailPath,
} from '@/utils/settlement-detail-link';
import { getBfiExchangeRate } from '@/api/base/currency';
import { getDictionary } from '@/api/system/dictbiz';
import {
@@ -989,18 +974,14 @@ import {
settlementSummaryColumns,
} from '@/option/settlement/preSettlementTable';
import { formatContractOptionLabel } from '@/utils/contract';
import { normalizeCurrencyCode } from '@/utils/currency';
import { downloadFileByUrl } from '@/utils/util';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
import { submitMkApprovalFlow } from '@/utils/mk-approval';
import * as XLSX from 'xlsx';
import { isAdministrator } from '@/utils/auth';
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
const LOCAL_CURRENCY_HIDDEN_FIELDS = ['exchangeRateDate', 'exchangeRate', 'localSettlementAmount'];
export default {
name: 'PreSettlementEditor',
components: { InfoFilled, ChangeRecordDetailDialog, ProjectAdvanceWriteOff },
components: { InfoFilled, ChangeRecordDetailDialog },
props: {
modelValue: {
type: Boolean,
@@ -1103,7 +1084,6 @@ export default {
size: 10,
},
advances: [],
projectAdvanceWriteOffs: [],
changeRecords: [],
attachments: [],
attachmentTypeOptions: [],
@@ -1208,14 +1188,6 @@ export default {
settlementTypeName() {
return this.form.settlementType === 'receivable' ? '应收' : '应付';
},
// 币种为空按人民币处理,与后端 normalizeRate 的取默认值一致
isLocalCurrencySettlement() {
return normalizeCurrencyCode(this.form.currency) === 'RMB';
},
visibleFormFields() {
if (!this.isLocalCurrencySettlement) return this.formFields;
return this.formFields.filter(field => !LOCAL_CURRENCY_HIDDEN_FIELDS.includes(field.prop));
},
contractDialogCategory() {
return '承运商合同';
},
@@ -1237,17 +1209,6 @@ export default {
});
return Array.from(names);
},
detailDisplayColumns() {
const columns = this.visibleDetailColumns;
const unitPriceIndex = columns.findIndex(column => column.prop === 'unitPrice');
const beforeColumns = unitPriceIndex < 0 ? columns : columns.slice(0, unitPriceIndex + 1);
const afterColumns = unitPriceIndex < 0 ? [] : columns.slice(unitPriceIndex + 1);
return [
...beforeColumns.map(column => ({ kind: 'field', key: column.prop, column })),
...this.detailFeeItemNames.map(name => ({ kind: 'fee', key: `fee-${name}`, name })),
...afterColumns.map(column => ({ kind: 'field', key: column.prop, column })),
];
},
// 按 preSettlementDetailId 分组的明细数据(用于拼接货物名称和类型)
groupedDetails() {
const groups = {};
@@ -1322,11 +1283,6 @@ export default {
},
async initialize() {
this.resetEditor();
// 新增页在保存前没有创建人/创建日期,先按当前登录用户与当前时间展示将要落库的值
if (!this.recordId) {
this.form.createUserName = this.userInfo?.realName || this.userInfo?.userName || '';
this.form.createTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
}
if (!this.publicMode) {
await this.loadFeeOptions();
await this.loadFeeCategoryOptions();
@@ -1337,36 +1293,15 @@ export default {
else if (this.initialData) {
await this.applyInitialData();
this.form.exchangeRateDate = this.$dayjs().format('YYYY-MM-DD');
await this.refreshPreSettlementNo();
await this.fetchBfiExchangeRate();
} else if (!this.publicMode) {
await this.refreshPreSettlementNo();
}
},
async refreshPreSettlementNo() {
if (this.form.id) return;
const response = await getNextNo();
this.form.preSettlementNo = response.data?.data || '';
},
async applyInitialData() {
const rows = Array.isArray(this.initialData?.rows) ? this.initialData.rows : [];
if (!rows.length) return;
const first = rows[0];
const settlementType = this.initialData.settlementType || first.settlementType || 'payable';
const contractId = first.contractId || '';
let contractPartyA = first.payerName || '';
let contractPartyB = first.payeeName || '';
if (contractId && (!contractPartyA || !contractPartyB)) {
try {
const { data } = await getContractOptions(first.contractNo || '');
const matched = (data?.data || []).find(item => String(item.id) === String(contractId));
contractPartyA = contractPartyA || matched?.partyA || '';
contractPartyB = contractPartyB || matched?.partyB || '';
} catch (error) {
contractPartyA = '';
contractPartyB = '';
}
}
if (!this.contractOptions.some(item => String(item.id) === String(contractId))) {
this.contractOptions.push({
id: contractId,
@@ -1377,8 +1312,8 @@ export default {
deptId: first.deptId,
deptName: first.deptName,
settlementType,
partyA: contractPartyA,
partyB: contractPartyB,
partyA: first.payerName,
partyB: first.payeeName,
});
}
this.handleContractChange(contractId);
@@ -1390,8 +1325,8 @@ export default {
projectName: first.projectName || this.form.projectName,
deptId: first.deptId || this.form.deptId,
deptName: first.deptName || this.form.deptName,
payerName: this.form.payerName || contractPartyA,
payeeName: this.form.payeeName || contractPartyB,
payerName: first.payerName || this.form.payerName,
payeeName: first.payeeName || this.form.payeeName,
settlementType,
currency: first.currency || 'RMB',
localCurrency: first.localCurrency || 'RMB',
@@ -1461,7 +1396,6 @@ export default {
this.appliedDetailQuery = { ...this.detailQuery };
this.detailPage = { current: 1, size: 10 };
this.advances = [];
this.projectAdvanceWriteOffs = [];
this.changeRecords = [];
this.attachments = [];
this.selectedAttachmentRows = [];
@@ -1501,13 +1435,6 @@ export default {
createUserName: row.createUserName || detail.createUserName,
createTime: row.createTime || detail.createTime,
}));
this.projectAdvanceWriteOffs = (detail.projectAdvanceWriteOffs || []).map(row => ({
...row,
writeOffAmount: Number(row.writeOffAmount || 0),
projectAdvanceAmount: Number(row.projectAdvanceAmount || 0),
availableWriteOffAmount: Number(row.availableWriteOffAmount || 0),
createTime: row.paymentCreateTime || row.createTime,
}));
this.changeRecords = detail.changeRecords || [];
this.attachments = this.parseAttachments(detail.attachmentsJson);
this.sortAttachments();
@@ -1652,7 +1579,6 @@ export default {
this.form.payerName = '';
this.form.payeeName = '';
this.summaryFees = [];
this.projectAdvanceWriteOffs = [];
return;
}
this.form.contractId = contract.id;
@@ -1663,12 +1589,10 @@ export default {
this.form.deptId = contract.deptId;
this.form.deptName = contract.deptName;
this.form.settlementType = contract.settlementType || 'payable';
// 部分候选合同只带 id/名称,缺甲方乙方;此时保留已带出的收付方,不要清成 undefined
if (contract.partyA) this.form.payerName = contract.partyA;
if (contract.partyB) this.form.payeeName = contract.partyB;
this.form.payerName = contract.partyA;
this.form.payeeName = contract.partyB;
this.form.currency = contract.settlementCurrency || 'RMB';
this.summaryFees = [];
this.projectAdvanceWriteOffs = [];
if (this.form.currency !== 'RMB') {
this.form.exchangeRateDate = this.$dayjs().format('YYYY-MM-DD');
this.fetchBfiExchangeRate();
@@ -1689,9 +1613,6 @@ export default {
this.$message.warning(`请完善结算合计第${invalidManualFeeIndex + 1}行的费用类型和费用项`);
return;
}
if (this.$refs.projectAdvanceWriteOffRef?.validateBeforeSave?.() === false) {
return;
}
const stateKey = shouldSubmit ? 'submitting' : 'saving';
this[stateKey] = true;
try {
@@ -1702,14 +1623,13 @@ export default {
if (shouldSubmit) {
const previousApprovalStatus = this.form.approvalStatus || '';
await submit({ id: this.form.id });
const mkStarted = await submitMkApprovalFlow({
await submitMkApprovalFlow({
bizType: 'pre-settlement',
bizId: this.form.id,
subjectName: this.form.preSettlementNo || this.form.contractName || '',
approvalStatus: previousApprovalStatus,
mkEnabled: await loadMkEnabled().catch(() => false),
});
this.$message.success(mkStarted ? '审批流程已发起' : '提交成功');
this.$message.success('审批流程已发起');
this.visible = false;
this.$emit('success', this.form.id);
return;
@@ -1739,7 +1659,6 @@ export default {
remark: row.remark,
manualFlag: row.manualFlag || 0,
})),
projectAdvanceWriteOffs: this.$refs.projectAdvanceWriteOffRef?.toSavePayload?.() || [],
};
},
addSummaryFee() {
@@ -1796,7 +1715,7 @@ export default {
return option?.dictValue || value;
},
formatDetailMileage(value) {
if (value === undefined || value === null || value === '' || Number(value) === -1) return '-';
if (value === undefined || value === null || value === '' || Number(value) === -1) return '';
return value;
},
removeSummaryFee(index) {
@@ -2068,21 +1987,6 @@ export default {
this.appliedDetailQuery = { ...this.detailQuery };
this.detailPage.current = 1;
},
// 结算明细的「单据号」跳到该应收应付单据在应收明细/应付明细页的详情,「运单号」跳到运单详情
async handleDetailLink(row, column) {
if (column.prop === 'documentNo') {
const settlementType = row.settlementType || this.form.settlementType || 'payable';
const detailId = await resolveReceivablePayableDetailId(row, settlementType);
if (!detailId) return this.$message.info('当前记录未找到对应的应收/应付明细');
this.$router.push({ path: settlementDetailPath(settlementType), query: { detailId } });
return;
}
if (column.prop === 'waybillNo') {
const waybillId = await resolveWaybillId(row);
if (!waybillId) return this.$message.info('当前记录未找到对应的运单详情');
this.$router.push({ path: '/business/waybill-manage/detail', query: { id: waybillId } });
}
},
resetDetailQuery() {
this.detailQuery = {
documentNo: '',
@@ -3088,10 +2992,6 @@ export default {
line-height: 32px;
color: #303133;
}
.form-readonly--code {
color: var(--el-color-primary);
}
}
.dialog-section-title {
@@ -1,300 +0,0 @@
<template>
<section-card title="项目预付核销">
<template v-if="editable" #extra>
<el-button type="primary" :disabled="!contractId" @click="openSelectDialog">选择</el-button>
</template>
<el-table :data="rows" border>
<el-table-column type="index" label="序号" width="64" align="center" />
<el-table-column
prop="paymentNo"
label="预付单号"
min-width="160"
align="center"
show-overflow-tooltip
/>
<el-table-column label="项目预付金额" min-width="140" align="center">
<template #default="{ row }">{{ formatMoney(row.projectAdvanceAmount) }}</template>
</el-table-column>
<el-table-column label="可核销金额" min-width="140" align="center">
<template #default="{ row }">{{ formatMoney(row.availableWriteOffAmount) }}</template>
</el-table-column>
<el-table-column label="本次核销金额" min-width="160" align="center">
<template #default="{ row }">
<el-input-number
v-if="editable"
v-model="row.writeOffAmount"
:min="0"
:precision="2"
:controls="false"
class="project-advance-write-off__amount"
@change="handleAmountChange(row)"
/>
<span v-else>{{ formatMoney(row.writeOffAmount) }}</span>
</template>
</el-table-column>
<el-table-column
prop="kingdeeBillNo"
label="金蝶预付单号"
min-width="160"
align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.kingdeeBillNo || '-' }}</template>
</el-table-column>
<el-table-column
prop="createUserName"
label="创建人"
min-width="120"
align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.createUserName || '-' }}</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center">
<template #default="{ row }">{{ formatDateTime(row.createTime || row.paymentCreateTime) }}</template>
</el-table-column>
<el-table-column v-if="editable" label="操作" width="90" align="center" fixed="right">
<template #default="{ $index }">
<el-link type="danger" @click="removeRow($index)">删除</el-link>
</template>
</el-table-column>
</el-table>
<el-dialog
v-model="dialog.visible"
title="选择项目预付单"
width="960px"
append-to-body
destroy-on-close
class="dialog-form-title"
@closed="handleDialogClosed"
>
<el-table
v-loading="dialog.loading"
:data="dialog.rows"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" :selectable="rowSelectable" />
<el-table-column type="index" label="序号" width="64" align="center" />
<el-table-column
prop="paymentNo"
label="预付单号"
min-width="160"
align="center"
show-overflow-tooltip
/>
<el-table-column label="项目预付金额" min-width="140" align="center">
<template #default="{ row }">{{ formatMoney(row.projectAdvanceAmount) }}</template>
</el-table-column>
<el-table-column label="可核销金额" min-width="140" align="center">
<template #default="{ row }">{{ formatMoney(row.availableWriteOffAmount) }}</template>
</el-table-column>
<el-table-column
prop="kingdeeBillNo"
label="金蝶预付单号"
min-width="160"
align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.kingdeeBillNo || '-' }}</template>
</el-table-column>
<el-table-column
prop="createUserName"
label="创建人"
min-width="120"
align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.createUserName || '-' }}</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center">
<template #default="{ row }">{{ formatDateTime(row.createTime) }}</template>
</el-table-column>
</el-table>
<template #footer>
<el-button @click="dialog.visible = false">取消</el-button>
<el-button type="primary" :disabled="!dialog.selection.length" @click="confirmSelect">
确定
</el-button>
</template>
</el-dialog>
</section-card>
</template>
<script>
import { getProjectAdvanceWriteOffOptions } from '@/api/payment/paymentApplication';
export default {
name: 'ProjectAdvanceWriteOff',
props: {
modelValue: {
type: Array,
default: () => [],
},
editable: {
type: Boolean,
default: true,
},
contractId: {
type: [String, Number],
default: '',
},
settlementAmount: {
type: [String, Number],
default: 0,
},
settlementType: {
type: String,
required: true,
},
settlementId: {
type: [String, Number],
default: '',
},
},
emits: ['update:modelValue'],
data() {
return {
dialog: {
visible: false,
loading: false,
rows: [],
selection: [],
},
};
},
computed: {
rows: {
get() {
return Array.isArray(this.modelValue) ? this.modelValue : [];
},
set(value) {
this.$emit('update:modelValue', value);
},
},
},
methods: {
formatMoney(value) {
const amount = Number(value);
return Number.isFinite(amount) ? amount.toFixed(2) : '0.00';
},
formatDateTime(value) {
if (!value) return '-';
return this.$dayjs(value).format('YYYY-MM-DD HH:mm:ss');
},
money(value) {
const amount = Number(value);
return Number.isFinite(amount) ? Number(amount.toFixed(2)) : 0;
},
openSelectDialog() {
if (!this.contractId) {
this.$message.warning('请先选择合同');
return;
}
this.dialog.visible = true;
this.loadOptions();
},
async loadOptions() {
this.dialog.loading = true;
try {
const res = await getProjectAdvanceWriteOffOptions({
contractId: this.contractId,
excludeSettlementType: this.settlementType,
excludeSettlementId: this.settlementId || undefined,
});
this.dialog.rows = res?.data?.data || [];
} finally {
this.dialog.loading = false;
}
},
rowSelectable(row) {
const selectedIds = new Set(this.rows.map(item => String(item.paymentApplicationId)));
return !selectedIds.has(String(row.paymentApplicationId));
},
handleSelectionChange(list) {
this.dialog.selection = list || [];
},
confirmSelect() {
const nextRows = [...this.rows];
const existed = new Set(nextRows.map(item => String(item.paymentApplicationId)));
this.dialog.selection.forEach(item => {
const id = String(item.paymentApplicationId);
if (existed.has(id)) return;
nextRows.push({
paymentApplicationId: item.paymentApplicationId,
paymentNo: item.paymentNo,
projectAdvanceAmount: this.money(item.projectAdvanceAmount),
availableWriteOffAmount: this.money(item.availableWriteOffAmount),
writeOffAmount: this.money(item.availableWriteOffAmount),
kingdeeBillNo: item.kingdeeBillNo || '',
createUserName: item.createUserName || '',
createTime: item.createTime,
paymentCreateTime: item.createTime,
});
});
this.rows = nextRows;
this.dialog.visible = false;
this.validateTotal();
},
handleDialogClosed() {
this.dialog.rows = [];
this.dialog.selection = [];
},
handleAmountChange(row) {
const available = this.money(row.availableWriteOffAmount);
let amount = this.money(row.writeOffAmount);
if (amount < 0) amount = 0;
if (amount > available) {
amount = available;
this.$message.warning('本次核销金额不能超过可核销金额');
}
row.writeOffAmount = amount;
this.validateTotal();
},
validateTotal() {
const total = this.rows.reduce((sum, row) => sum + this.money(row.writeOffAmount), 0);
const settlementAmount = this.money(this.settlementAmount);
if (settlementAmount > 0 && total > settlementAmount) {
this.$message.warning('项目预付核销合计不能超过结算单金额');
return false;
}
return true;
},
validateBeforeSave() {
for (const row of this.rows) {
const amount = this.money(row.writeOffAmount);
if (amount <= 0) {
this.$message.warning(`预付单${row.paymentNo || ''}本次核销金额必须大于0`);
return false;
}
if (amount > this.money(row.availableWriteOffAmount)) {
this.$message.warning(`预付单${row.paymentNo || ''}本次核销金额不能超过可核销金额`);
return false;
}
}
return this.validateTotal();
},
removeRow(index) {
const nextRows = [...this.rows];
nextRows.splice(index, 1);
this.rows = nextRows;
},
toSavePayload() {
return this.rows.map(row => ({
paymentApplicationId: row.paymentApplicationId,
writeOffAmount: this.money(row.writeOffAmount),
}));
},
},
};
</script>
<style scoped lang="scss">
.project-advance-write-off__amount {
width: 100%;
}
:deep(.project-advance-write-off__amount .el-input__inner) {
text-align: right;
}
</style>
File diff suppressed because it is too large Load Diff
@@ -1278,13 +1278,10 @@ export default {
delete snapshot._externalKey;
delete snapshot.feeItems;
snapshot.feeItemsJson = row.feeItemsJson || JSON.stringify(row.feeItems || {});
snapshot.actualDepartureTime = this.normalizeExternalDateTime(row.actualDepartureTime);
snapshot.actualCompletionTime = this.normalizeExternalDateTime(row.actualCompletionTime);
return snapshot;
});
},
serializeExternalRows() {
const duplicateIds = new Set(this.duplicateRows.map(row => String(row.id)));
return this.externalDetails.map(row => {
const snapshot = { ...row };
delete snapshot._sourceRows;
@@ -1293,7 +1290,6 @@ export default {
snapshot.feeItemsJson = row.feeItemsJson || JSON.stringify(row.feeItems || {});
snapshot.actualDepartureTime = this.normalizeExternalDateTime(row.actualDepartureTime);
snapshot.actualCompletionTime = this.normalizeExternalDateTime(row.actualCompletionTime);
snapshot.suspectedDuplicate = duplicateIds.has(String(row.id));
return snapshot;
});
},
@@ -1340,11 +1336,6 @@ export default {
}
},
async handleComplete() {
const unmatchedInternal = this.internalDetails.filter(item => item.matchResult !== 'matched').length;
const unmatchedExternal = this.externalDetails.filter(item => item.matchStatus !== 'matched').length;
if (this.duplicateRows.length || unmatchedInternal || unmatchedExternal) {
return this.$message.warning('所有内外部账单明细必须一一匹配且不存在疑似重复');
}
if (
Number(this.form.differenceCount || 0) !== 0 ||
Number(this.form.differenceQuantity || 0) !== 0 ||
@@ -1703,11 +1694,8 @@ export default {
},
normalizeExternalDateTime(value) {
if (!value) return null;
const text = String(value).trim();
if (!text) return null;
const date = this.$dayjs(text);
if (date.isValid()) return date.format('YYYY-MM-DD HH:mm:ss');
return text.length === 10 ? `${text} 00:00:00` : text.replace('T', ' ');
const text = String(value);
return text.length === 10 ? `${text}T00:00:00` : text;
},
refreshLocalStats() {
const internalQuantity = this.internalDetails.reduce(
@@ -368,7 +368,6 @@ export default {
bizId: row.id,
subjectName: row.formalSettlementNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
});
this.$message.success('提交成功');
this.loadTable();
-1
View File
@@ -661,7 +661,6 @@ export default {
bizId: row.id,
subjectName: row.preSettlementNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
});
this.$message.success('提交成功');
this.loadTable();
@@ -520,7 +520,7 @@
:index="transferIndexMethod"
/>
<el-table-column
v-for="column in transferTableColumns"
v-for="column in tableColumns.slice(0, 13)"
:key="column.prop"
:prop="column.prop"
:label="column.label"
@@ -1174,13 +1174,6 @@ export default {
columns.splice(totalIndex, 0, ...dynamicColumns);
return columns;
},
// 批量转结算弹窗只展示前 13 列。预结算单号、正式结算单号正是本操作要生成的单号,
// 候选行上必为空,故不占列
transferTableColumns() {
return this.tableColumns
.filter(column => !['preSettlementNo', 'formalSettlementNo'].includes(column.prop))
.slice(0, 13);
},
columnSettingOptions() {
return this.displayTableColumns.map(column => ({
prop: column.prop,
@@ -1719,12 +1712,11 @@ export default {
this.$router.push({ path, query: { detailNo } });
},
async openRouteDetail(detailId = this.$route.query.detailId) {
// 结算明细点「单据号」会带 detailId 跳到本页;只有当前停在应收/应付明细页时才自动展开详情
const routePath =
this.settlementType === 'payable'
? '/settlement/payable-detail'
: '/settlement/receivable-detail';
if (!detailId || this.$route.path !== routePath) {
if (
!detailId ||
this.settlementType !== 'payable' ||
this.$route.path !== '/settlement/payable-detail'
) {
return;
}
let row = this.rows.find(item => String(item.id) === String(detailId));
@@ -1737,9 +1729,7 @@ export default {
if (data.records?.[0]) row = this.decorateRow(data.records[0]);
}
if (!row) {
this.$message.info(
`当前记录未找到对应的${this.settlementType === 'payable' ? '应付' : '应收'}明细`
);
this.$message.info('当前记录未找到对应的应付明细');
return;
}
await this.openDetailDialog(row);
@@ -2691,12 +2681,12 @@ export default {
return `${Number(value).toFixed(2)} ${currency}`;
},
formatDetailCell(row, prop) {
if (prop === 'mileage' && Number(row?.[prop]) === -1) {
return '-';
}
if (
prop === 'mileage' &&
(row?.[prop] === null || row?.[prop] === undefined || row?.[prop] === '')
(row?.[prop] === null ||
row?.[prop] === undefined ||
row?.[prop] === '' ||
Number(row[prop]) === -1)
) {
return '';
}
@@ -1,49 +0,0 @@
<template>
<basic-container class="settlement-import-form-page">
<div class="settlement-import-form-page__title">{{ pageTitle }}</div>
<settlement-import-page />
</basic-container>
</template>
<script setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import SettlementImportPage from './components/settlement-import-page.vue';
const route = useRoute();
const pageTitle = computed(() => (route.query.id ? '编辑导入结算单' : '新增导入结算单'));
</script>
<style scoped lang="scss">
.settlement-import-form-page {
:deep(.basic-container__card) {
background: #fff;
}
:deep(.basic-container__card > .el-card__body) {
padding: 0;
background: #fff;
}
}
.settlement-import-form-page__title {
position: relative;
padding: 16px 24px 12px 36px;
border-bottom: 1px solid #eff1f7;
background: #fff;
color: #303133;
font-size: 18px;
font-weight: 600;
&::before {
position: absolute;
top: 16px;
left: 24px;
width: 4px;
height: 22px;
border-radius: 2px;
background: #409eff;
content: '';
}
}
</style>
-531
View File
@@ -1,531 +0,0 @@
<template>
<basic-container class="settlement-import-page">
<section v-show="searchVisible" class="settlement-import-page__search">
<el-form :model="query" label-position="right" label-width="160px" @submit.prevent>
<div class="settlement-import-page__search-grid">
<el-form-item v-for="field in visibleSearchFields" :key="field.prop" :label="field.label">
<el-select
v-if="field.type === 'select'"
v-model="query[field.prop]"
clearable
filterable
allow-create
default-first-option
placeholder="请选择"
>
<el-option
v-for="item in field.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-input v-else v-model="query[field.prop]" clearable placeholder="请输入" />
</el-form-item>
<div class="settlement-import-page__search-actions">
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="resetSearch">重置</el-button>
<el-button text :icon="searchExpanded ? ArrowUp : ArrowDown" @click="toggleSearch">
{{ searchExpanded ? '收起' : '展开' }}
</el-button>
</div>
</div>
</el-form>
</section>
<section class="settlement-import-page__table-panel">
<div class="settlement-import-page__toolbar">
<div class="settlement-import-page__toolbar-left">
<el-button
v-if="hasPermission('settlement_import_add')"
type="primary"
@click="openCreate"
>
新增
</el-button>
</div>
</div>
<el-table v-loading="loading" :data="rows" border class="settlement-import-page__table">
<el-table-column type="index" label="序号" width="64" align="center" />
<el-table-column prop="batchNo" label="导入批次号" min-width="160">
<template #default="{ row }">
<el-link type="primary" @click="openDetail(row)">{{ row.batchNo || '-' }}</el-link>
</template>
</el-table-column>
<el-table-column prop="settlementTypeName" label="导入类型" min-width="100">
<template #default="{ row }">
{{ row.settlementTypeName || settlementTypeLabel(row.settlementType) }}
</template>
</el-table-column>
<el-table-column prop="settlementBillTypeName" label="结算单" min-width="110">
<template #default="{ row }">
{{ row.settlementBillTypeName || settlementBillTypeLabel(row.settlementBillType) }}
</template>
</el-table-column>
<el-table-column prop="projectName" label="项目" min-width="140" show-overflow-tooltip />
<el-table-column prop="customerName" label="客户" min-width="140" show-overflow-tooltip />
<el-table-column prop="carrierName" label="承运商" min-width="140" show-overflow-tooltip />
<el-table-column label="明细行数" width="100" align="center">
<template #default="{ row }">
{{ row.waybillCount ?? row.detailCount ?? 0 }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="170" />
<el-table-column prop="createUserName" label="创建人" min-width="120">
<template #default="{ row }">{{ row.createUserName || '-' }}</template>
</el-table-column>
<el-table-column label="操作" width="160" fixed="right">
<template #default="{ row }">
<div class="settlement-import-page__row-actions">
<el-link type="primary" @click="openDetail(row)">详情</el-link>
<el-link
v-if="row.importStatus !== 'voided' && hasPermission('settlement_import_void')"
type="danger"
@click="openVoid(row)"
>
作废
</el-link>
</div>
</template>
</el-table-column>
</el-table>
<div class="settlement-import-page__pagination">
<el-pagination
background
v-model:current-page="page.current"
v-model:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:page-sizes="[10, 20, 50, 100]"
:total="page.total"
@current-change="loadTable"
@size-change="handleSizeChange"
/>
</div>
</section>
<el-dialog v-model="detailVisible" title="导入结算单详情" width="640px" append-to-body>
<el-descriptions :column="2" border>
<el-descriptions-item label="导入批次号">{{ detail.batchNo || '-' }}</el-descriptions-item>
<el-descriptions-item label="导入类型">
{{ detail.settlementTypeName || settlementTypeLabel(detail.settlementType) }}
</el-descriptions-item>
<el-descriptions-item label="结算单">
{{ detail.settlementBillTypeName || settlementBillTypeLabel(detail.settlementBillType) }}
</el-descriptions-item>
<el-descriptions-item label="运单类型">
{{ detail.waybillModeName || waybillModeLabel(detail.waybillMode) }}
</el-descriptions-item>
<el-descriptions-item label="项目">{{ detail.projectName || '-' }}</el-descriptions-item>
<el-descriptions-item label="客户">{{ detail.customerName || '-' }}</el-descriptions-item>
<el-descriptions-item label="客户合同">
{{ detail.customerContractName || '-' }}
</el-descriptions-item>
<el-descriptions-item label="承运商">{{ detail.carrierName || '-' }}</el-descriptions-item>
<el-descriptions-item label="承运商合同">
{{ detail.carrierContractName || '-' }}
</el-descriptions-item>
<el-descriptions-item label="明细行数">
{{ detail.waybillCount ?? detail.detailCount ?? 0 }}
</el-descriptions-item>
<el-descriptions-item label="导入状态">
{{ detail.importStatusName || detail.importStatus || '-' }}
</el-descriptions-item>
<el-descriptions-item label="创建人">{{ detail.createUserName || '-' }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ detail.createTime || '-' }}</el-descriptions-item>
<el-descriptions-item label="备注" :span="2">{{ detail.remark || '-' }}</el-descriptions-item>
<el-descriptions-item label="关联结算单" :span="2">
<el-link
v-if="detail.formalSettlementId"
type="primary"
@click="goFormalSettlement(detail)"
>
{{ detail.formalSettlementNo || detail.formalSettlementId }}
</el-link>
<el-link
v-else-if="detail.preSettlementId"
type="primary"
@click="goPreSettlement(detail)"
>
{{ detail.preSettlementNo || detail.preSettlementId }}
</el-link>
<span v-else>-</span>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<el-button @click="detailVisible = false">关闭</el-button>
<el-button
v-if="detail.importStatus === 'draft'"
type="primary"
@click="editDraft(detail)"
>
编辑草稿
</el-button>
</template>
</el-dialog>
<el-dialog v-model="voidVisible" title="作废导入结算单" width="480px" append-to-body>
<el-form
ref="voidFormRef"
:model="voidForm"
:rules="voidRules"
label-position="right"
label-width="auto"
>
<el-form-item label="作废原因" prop="reason">
<el-input
v-model="voidForm.reason"
type="textarea"
:rows="4"
maxlength="200"
show-word-limit
placeholder="请输入作废原因"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="voidVisible = false">取消</el-button>
<el-button type="danger" :loading="voidLoading" @click="submitVoid">确认作废</el-button>
</template>
</el-dialog>
</basic-container>
</template>
<script>
import { ArrowDown, ArrowUp } from '@element-plus/icons-vue';
import { mapGetters } from 'vuex';
import * as api from '@/api/settlement/settlementImport';
const emptyQuery = () => ({
batchNo: '',
settlementType: '',
projectName: '',
customerName: '',
carrierName: '',
});
const SETTLEMENT_TYPE_OPTIONS = [
{ label: '全部', value: '' },
{ label: '应收正式结算单', value: 'receivable' },
{ label: '应付正式结算单', value: 'payable' },
];
const SETTLEMENT_IMPORT_LIST_REFRESH_KEY = 'settlement-import-list-refresh';
export default {
name: 'SettlementImport',
data() {
return {
ArrowDown,
ArrowUp,
searchVisible: true,
searchExpanded: false,
loading: false,
query: emptyQuery(),
rows: [],
page: { current: 1, size: 10, total: 0 },
batchNoOptions: [],
detailVisible: false,
detail: {},
voidVisible: false,
voidLoading: false,
voidForm: { id: null, reason: '' },
voidRules: {
reason: [
{ required: true, message: '请输入作废原因', trigger: 'blur' },
{ max: 200, message: '作废原因不能超过200个字', trigger: 'blur' },
],
},
};
},
computed: {
...mapGetters(['permission', 'userInfo']),
isAdmin() {
const authority = this.userInfo?.authority || '';
return String(authority).includes('admin');
},
searchFields() {
return [
{
prop: 'batchNo',
label: '导入批次号',
type: 'select',
options: this.batchNoOptions,
},
{
prop: 'settlementType',
label: '导入类型',
type: 'select',
options: SETTLEMENT_TYPE_OPTIONS,
},
{ prop: 'projectName', label: '项目', type: 'input' },
{ prop: 'customerName', label: '客户', type: 'input' },
{ prop: 'carrierName', label: '承运商', type: 'input' },
];
},
visibleSearchFields() {
return this.searchExpanded ? this.searchFields : this.searchFields.slice(0, 4);
},
},
created() {
this.loadOptions();
this.loadTable();
},
activated() {
this.consumeListRefresh();
},
watch: {
$route(to, from) {
if (
to.path === '/settlement/settlement-import' &&
from?.path === '/settlement/settlement-import/form'
) {
this.consumeListRefresh();
}
},
},
methods: {
consumeListRefresh() {
if (sessionStorage.getItem(SETTLEMENT_IMPORT_LIST_REFRESH_KEY) !== '1') {
return;
}
sessionStorage.removeItem(SETTLEMENT_IMPORT_LIST_REFRESH_KEY);
this.page.current = 1;
this.loadOptions();
this.loadTable();
},
hasPermission(code) {
return this.isAdmin || this.validData(this.permission?.[code], false);
},
settlementTypeLabel(value) {
return (
SETTLEMENT_TYPE_OPTIONS.find(item => item.value === value)?.label || value || '-'
);
},
settlementBillTypeLabel(value) {
if (value === 'pre') return '预结算单';
return '正式结算单';
},
waybillModeLabel(value) {
if (value === 'history') return '历史运单';
return '新运单';
},
unwrapData(response) {
const body = response?.data || response || {};
return body?.data !== undefined ? body.data : body;
},
async loadOptions() {
try {
const response = await api.getOptions();
const options = this.unwrapData(response) || {};
const batchNos = Array.isArray(options.batchNos) ? options.batchNos : [];
this.batchNoOptions = [
{ label: '全部', value: '' },
...batchNos.map(item => {
if (typeof item === 'string') {
return { label: item, value: item };
}
const value = item.id ?? item.value ?? item.name ?? item.batchNo ?? '';
const label = item.name ?? item.label ?? item.batchNo ?? value;
return { label: String(label || ''), value: String(value || '') };
}),
];
} catch (error) {
this.batchNoOptions = [{ label: '全部', value: '' }];
}
},
async loadTable() {
this.loading = true;
try {
const response = await api.getList(this.page.current, this.page.size, {
batchNo: this.query.batchNo || undefined,
settlementType: this.query.settlementType || undefined,
projectName: this.query.projectName || undefined,
customerName: this.query.customerName || undefined,
carrierName: this.query.carrierName || undefined,
});
const data = this.unwrapData(response) || {};
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();
},
toggleSearch() {
this.searchExpanded = !this.searchExpanded;
},
handleSizeChange() {
this.page.current = 1;
this.loadTable();
},
openCreate() {
this.$router.push({ path: '/settlement/settlement-import/form' });
},
async openDetail(row) {
if (!row?.id) return;
try {
const response = await api.getDetail(row.id);
this.detail = this.unwrapData(response) || { ...row };
} catch (error) {
this.detail = { ...row };
}
this.detailVisible = true;
},
editDraft(row) {
this.detailVisible = false;
this.$router.push({
path: '/settlement/settlement-import/form',
query: { id: row.id },
});
},
goFormalSettlement(row) {
if (!row?.formalSettlementId) return;
this.detailVisible = false;
this.$router.push({
path: '/settlement/formal-settlement/form',
query: {
mode: 'view',
id: row.formalSettlementId,
name: '正式结算详情',
},
});
},
goPreSettlement(row) {
if (!row?.preSettlementId) return;
this.detailVisible = false;
this.$router.push({
path: '/settlement/pre-settlement/form',
query: {
mode: 'view',
id: row.preSettlementId,
name: '预结算详情',
},
});
},
openVoid(row) {
this.voidForm = { id: row.id, reason: '' };
this.voidVisible = true;
this.$nextTick(() => this.$refs.voidFormRef?.clearValidate());
},
async submitVoid() {
await this.$refs.voidFormRef?.validate();
this.voidLoading = true;
try {
await api.voidBatch({
id: this.voidForm.id,
reason: String(this.voidForm.reason || '').trim(),
});
this.$message.success('作废成功');
this.voidVisible = false;
this.loadTable();
this.loadOptions();
} finally {
this.voidLoading = false;
}
},
},
};
</script>
<style scoped lang="scss">
.settlement-import-page__search {
padding: 12px 12px 4px;
background: #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.settlement-import-page__search-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px 24px;
align-items: start;
}
.settlement-import-page__search :deep(.el-form-item) {
margin-bottom: 8px;
}
.settlement-import-page__search :deep(.el-form-item__label) {
white-space: nowrap;
}
.settlement-import-page__search :deep(.el-input),
.settlement-import-page__search :deep(.el-select) {
width: 100%;
}
.settlement-import-page__search-actions {
grid-column: 1 / -1;
display: flex;
justify-content: flex-end;
align-items: center;
gap: 8px;
margin-bottom: 8px;
}
.settlement-import-page__table-panel {
margin-top: 8px;
background: #fff;
}
.settlement-import-page__toolbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0 0;
}
.settlement-import-page__toolbar-left {
display: flex;
gap: 8px;
}
.settlement-import-page__table {
--el-table-border-color: #eff1f7;
}
.settlement-import-page__table :deep(.el-table__body tr:nth-child(even) > td.el-table__cell),
.settlement-import-page__table
:deep(.el-table__body tr:nth-child(even) > td.el-table-fixed-column--left),
.settlement-import-page__table
:deep(.el-table__body tr:nth-child(even) > td.el-table-fixed-column--right) {
background: #fafafa;
}
.settlement-import-page__row-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.settlement-import-page__pagination {
display: flex;
justify-content: flex-end;
padding: 12px 0;
}
.settlement-import-page :deep(.basic-container__card > .el-card__body) {
padding: 0;
}
@media (max-width: 1200px) {
.settlement-import-page__search-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 760px) {
.settlement-import-page__search-grid {
grid-template-columns: 1fr;
}
}
</style>
+31 -105
View File
@@ -153,12 +153,7 @@
/>
<div class="oa-sync-meta" v-if="oaSyncStage === 'clear'">当前阶段:{{ oaSyncStageLabel }}</div>
<div class="oa-sync-meta" v-else>
当前阶段:{{ oaSyncStageLabel }}
<template v-if="oaSyncStage === 'department' && oaSyncProgress.companyTotal">
,公司 {{ oaSyncProgress.companyIndex || 0 }} / {{ oaSyncProgress.companyTotal }}
<template v-if="oaSyncProgress.companyOaId">(oaId={{ oaSyncProgress.companyOaId }})</template>
</template>
,第 {{ oaSyncProgress.current || 0 }} / {{ oaSyncTotalPage }} 页
当前阶段:{{ oaSyncStageLabel }},第 {{ oaSyncProgress.current || 0 }} / {{ oaSyncTotalPage }} 页
</div>
<div class="oa-sync-stats">
<div class="oa-sync-stat">
@@ -170,9 +165,6 @@
<span class="oa-sync-stat__value oa-sync-stat__value--skip">{{ oaSyncProgress.skipped }}</span>
</div>
</div>
<div v-if="oaSyncProgress.dumpFilePath" class="oa-sync-meta">
原始数据 JSON:{{ oaSyncProgress.dumpFilePath }}
</div>
</div>
<template #footer>
<span class="dialog-footer">
@@ -261,10 +253,6 @@ export default {
total: 0,
synced: 0,
skipped: 0,
dumpFilePath: '',
companyOaId: '',
companyIndex: 0,
companyTotal: 0,
},
parentId: 0,
page: {
@@ -298,9 +286,7 @@ export default {
{
label: '组织名称',
prop: 'deptName',
minWidth: 320,
align: 'left',
headerAlign: 'left',
minWidth: 160,
order: 80,
search: true,
searchOrder: 2,
@@ -652,18 +638,12 @@ export default {
}
const totalPage = this.oaSyncTotalPage;
const current = Number(this.oaSyncProgress.current) || 0;
if (this.oaSyncStage === 'department') {
const companyTotal = Math.max(1, Number(this.oaSyncProgress.companyTotal) || 1);
const companyIndex = Math.max(1, Number(this.oaSyncProgress.companyIndex) || 1);
const companyBase = ((companyIndex - 1) / companyTotal) * 50;
const pageRatio = totalPage > 0 ? Math.min(1, current / totalPage) : 0;
const companyPagePercent = (pageRatio * 50) / companyTotal;
return Math.min(99, Math.round(50 + companyBase + companyPagePercent));
}
const stageBase = this.oaSyncStage === 'department' ? 50 : 0;
if (totalPage <= 0) {
return 0;
return stageBase;
}
return Math.min(49, Math.round((current / totalPage) * 50));
const stagePercent = Math.min(50, Math.round((current / totalPage) * 50));
return Math.min(99, stageBase + stagePercent);
},
oaSyncProgressStatus() {
if (this.oaSyncStatus === 'done') {
@@ -677,7 +657,25 @@ export default {
},
methods: {
handleOaOrgFullSync() {
this.startOaOrgSync({ clearNonTop: false, incremental: false });
this.$confirm(
'全量同步将拉取 OA 全部公司/部门;已存在且 OA 更新时间一致的记录会跳过。是否清除后同步?选择“是”将保留顶级「外部组织」与集团锚点(id=135/GWWL),删除其余组织后再同步;选择“否”则直接全量同步。',
'全量同步',
{
confirmButtonText: '是',
cancelButtonText: '否',
distinguishCancelAndClose: true,
closeOnClickModal: false,
type: 'warning',
}
)
.then(() => {
this.startOaOrgSync({ clearNonTop: true, incremental: false });
})
.catch(action => {
if (action === 'cancel') {
this.startOaOrgSync({ clearNonTop: false, incremental: false });
}
});
},
handleOaOrgIncrementalSync() {
this.$confirm(
@@ -711,10 +709,6 @@ export default {
total: 0,
synced: 0,
skipped: 0,
dumpFilePath: '',
companyOaId: '',
companyIndex: 0,
companyTotal: 0,
};
this.runOaOrgSyncPages();
},
@@ -726,25 +720,6 @@ export default {
error?.name === 'AbortError'
);
},
applyOaOrgSyncPage(page, current, size) {
this.oaSyncProgress.current = page.current || current;
this.oaSyncProgress.size = page.size || size;
this.oaSyncProgress.total = page.total || 0;
this.oaSyncProgress.synced += page.syncedCount || 0;
this.oaSyncProgress.skipped += page.skippedCount || 0;
if (page.dumpFilePath) {
this.oaSyncProgress.dumpFilePath = page.dumpFilePath;
}
if (page.companyOaId != null) {
this.oaSyncProgress.companyOaId = page.companyOaId || '';
}
if (page.companyIndex != null) {
this.oaSyncProgress.companyIndex = page.companyIndex || 0;
}
if (page.companyTotal != null) {
this.oaSyncProgress.companyTotal = page.companyTotal || 0;
}
},
async runOaOrgSyncStage(syncApi) {
const size = 20;
const incremental = this.oaSyncMode === 'incremental';
@@ -762,57 +737,17 @@ export default {
if (!modifiedSince && page.modifiedSince) {
modifiedSince = page.modifiedSince;
}
this.applyOaOrgSyncPage(page, current, size);
this.oaSyncProgress.current = page.current || current;
this.oaSyncProgress.size = page.size || size;
this.oaSyncProgress.total = page.total || 0;
this.oaSyncProgress.synced += page.syncedCount || 0;
this.oaSyncProgress.skipped += page.skippedCount || 0;
if (page.finished) {
break;
}
current += 1;
}
},
/**
* 部门阶段:公司同步完成后,按公司 oaId 轮询;当前公司部门拉完后切换下一公司并重置页码
*/
async runOaOrgDepartmentSyncStage() {
const size = 20;
const incremental = this.oaSyncMode === 'incremental';
let current = 1;
let modifiedSince = '';
let companyOaId = '';
while (!this.oaSyncCancelled) {
const res = await syncOaDepartment(
current,
size,
this.oaSyncController?.signal,
incremental,
modifiedSince,
companyOaId
);
const page = res?.data?.data || {};
if (!modifiedSince && page.modifiedSince) {
modifiedSince = page.modifiedSince;
}
if (page.companyOaId) {
companyOaId = page.companyOaId;
}
this.applyOaOrgSyncPage(page, current, size);
if (page.finished) {
break;
}
if (page.companyFinished && page.nextCompanyOaId) {
companyOaId = page.nextCompanyOaId;
current = 1;
this.oaSyncProgress.current = 0;
this.oaSyncProgress.total = 0;
// 单公司部门拉完并重建层级后刷新树,便于中途核对挂载结果
this.parentId = 0;
this.data = [];
this.$refs.crud?.refreshTable?.();
this.onLoad(this.page, this.query);
continue;
}
current += 1;
}
},
async runOaOrgSyncPages() {
try {
if (this.oaSyncClearNonTop) {
@@ -832,10 +767,7 @@ export default {
this.oaSyncStage = 'department';
this.oaSyncProgress.current = 0;
this.oaSyncProgress.total = 0;
this.oaSyncProgress.companyOaId = '';
this.oaSyncProgress.companyIndex = 0;
this.oaSyncProgress.companyTotal = 0;
await this.runOaOrgDepartmentSyncStage();
await this.runOaOrgSyncStage(syncOaDepartment);
if (this.oaSyncCancelled) {
this.oaSyncStatus = 'cancelled';
return;
@@ -1520,12 +1452,6 @@ export default {
</script>
<style scoped>
/* 覆盖全站表格居中:树形组织名称需左对齐,展开后缩进才可读 */
:deep(.el-table th.el-table__cell.is-left .cell),
:deep(.el-table td.el-table__cell.is-left .cell) {
text-align: left;
}
.carrier-search-form {
padding: 12px 12px 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
-8
View File
@@ -364,9 +364,6 @@
<span class="oa-sync-stat__value oa-sync-stat__value--skip">{{ oaSyncProgress.skipped }}</span>
</div>
</div>
<div v-if="oaSyncProgress.dumpFilePath" class="oa-sync-meta">
原始数据 JSON:{{ oaSyncProgress.dumpFilePath }}
</div>
</div>
<template #footer>
<span class="dialog-footer">
@@ -453,7 +450,6 @@ export default {
total: 0,
synced: 0,
skipped: 0,
dumpFilePath: '',
},
page: {
pageSize: 10,
@@ -716,7 +712,6 @@ export default {
total: 0,
synced: 0,
skipped: 0,
dumpFilePath: '',
};
this.runOaSyncPages();
},
@@ -751,9 +746,6 @@ export default {
this.oaSyncProgress.total = page.total || 0;
this.oaSyncProgress.synced += page.syncedCount || 0;
this.oaSyncProgress.skipped += page.skippedCount || 0;
if (page.dumpFilePath) {
this.oaSyncProgress.dumpFilePath = page.dumpFilePath;
}
if (page.finished) {
this.oaSyncStatus = 'done';
break;
+2 -2
View File
@@ -158,7 +158,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
import { excelOption, exportColumns, option } from '@/option/vehicle/accident-record';
@@ -550,7 +550,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
handleTemplate() {
exportBlob(
@@ -468,11 +468,7 @@ import {
publish,
changeStatus,
} from '@/api/vehicle/credit-score-quantification';
import {
applyIncomingSearch,
normalizeSearchRangeParams,
omitInvalidListStatus,
} from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { mapGetters } from 'vuex';
import { isAdministrator } from '@/utils/auth';
@@ -1328,9 +1324,7 @@ export default {
});
},
buildQuery(params = {}) {
return omitInvalidListStatus(
normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap)
);
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
},
};
+129 -76
View File
@@ -47,6 +47,29 @@
{{ row.customerCode }}
</el-button>
</template>
<template #customerRisk="{ row }">
<el-tooltip
v-if="customerRiskMap[row.customerCode] && customerRiskMap[row.customerCode].risky"
placement="top"
effect="dark"
popper-class="customer-risk-popper"
>
<template #content>
<div>{{ customerRiskMap[row.customerCode].riskTip || '该客商为高风险/黑名单客商' }}</div>
</template>
<el-tag type="danger" class="status-text">
{{ customerRiskLabel(customerRiskMap[row.customerCode]) }}
</el-tag>
</el-tooltip>
<el-tag
v-else-if="customerRiskMap[row.customerCode]"
:type="customerRiskMap[row.customerCode].fdRiskLevel === '1' ? 'warning' : 'success'"
class="status-text"
>
{{ customerRiskLabel(customerRiskMap[row.customerCode]) }}
</el-tag>
<span v-else>-</span>
</template>
<template #accessType="{ row }">
<el-tag
class="status-text"
@@ -208,7 +231,7 @@
v-if="
hasPermission('customer_archive_sync') &&
row.approvalStatus === 'approved' &&
!['synced', 'exist'].includes(row.kingdeeStatus)
row.kingdeeStatus === 'failed'
"
@click="handleSyncKingdee(row)"
>
@@ -332,7 +355,19 @@
maxlength="100"
show-word-limit
:disabled="kingdeeLocked"
@blur="checkArchiveNameRisk"
/>
<el-tooltip
v-if="archiveNameRisky"
placement="top"
effect="dark"
popper-class="customer-risk-popper"
>
<template #content>
<div>{{ archiveNameRiskTip || '该客商为高风险/黑名单客商' }}</div>
</template>
<div class="archive-name-risk">高风险/黑名单客商</div>
</el-tooltip>
</el-form-item>
</el-col>
<el-col :span="6">
@@ -486,7 +521,7 @@
:options="deptTree"
:props="deptCascaderProps"
disabled
placeholder="广西现代物流集团有限公司"
placeholder="桂物物流集团"
/>
</el-form-item>
</el-col>
@@ -1557,6 +1592,7 @@ import {
queryKingdeeCustomer,
syncKingdee,
} from '@/api/vehicle/customer-archive';
import { getRiskBatch, getRiskByName } from '@/api/business/hcs';
import {
getList as getCreditScoreQuantificationList,
getDetail as getCreditScoreQuantificationDetail,
@@ -1588,7 +1624,7 @@ const customerArchiveListRoute = '/vehicle/customer-archive';
const customerArchiveFormRoute = '/vehicle/customer-archive/form';
const customerArchiveListRefreshKey = 'customer-archive-list-refresh';
/** 客商所属组织固定为顶层组织 */
const FIXED_OWNER_DEPT_NAME = '广西现代物流集团有限公司';
const FIXED_OWNER_DEPT_NAME = '桂物物流集团';
const createTimeRangeMap = {
createTimeRange: ['createTimeStart', 'createTimeEnd'],
@@ -1662,6 +1698,9 @@ export default {
deptSearchInitialized: false,
loading: true,
data: [],
customerRiskMap: {},
archiveNameRisky: false,
archiveNameRiskTip: '',
page: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
@@ -1791,8 +1830,6 @@ export default {
},
/** 业务字典 mk_template「开启MK」=1 */
mkEnabled: false,
/** 是否已完成 MK 开关加载,避免提交时误判 */
_mkEnabledResolved: false,
formRules: {
customerCode: [{ max: 20, message: '客商编号最多20个字符', trigger: 'blur' }],
fullName: [{ required: true, message: '请输入客商名称', trigger: 'blur' }],
@@ -1873,7 +1910,7 @@ export default {
editBtn: false,
selection: true,
dialogClickModal: false,
menuWidth: 400,
menuWidth: 320,
column: [
{
label: '客商编号',
@@ -1922,6 +1959,12 @@ export default {
{ label: '内部组织', value: 'internal' },
],
},
{
label: '客商风险',
prop: 'customerRisk',
slot: true,
minWidth: 100,
},
{
label: '客户性质',
prop: 'customerNature',
@@ -2043,6 +2086,7 @@ export default {
search: true,
searchOrder: 6,
searchValue: '',
dataType: 'number',
minWidth: 100,
dicData: [
{ label: '全部', value: '' },
@@ -2341,13 +2385,7 @@ export default {
sessionStorage.setItem(customerArchiveListRefreshKey, '1');
},
hasPermission(code) {
if (this.isAdmin) {
return true;
}
const permission = this.permission || {};
const value = permission[code];
// 不依赖 Avue validData,避免权限值为 true 以外的真值时被误判
return value === true || value === 'true' || value === 1 || value === '1';
return this.isAdmin || this.validData(this.permission[code], false);
},
mergeSelectOptions(target, values) {
const list = Array.isArray(values) ? values : values ? [values] : [];
@@ -2471,6 +2509,7 @@ export default {
form.kingdeeStatus = 'exist';
// 工商信息以金蝶为准,直接覆盖(后续字段锁定)
if (customer.name) form.fullName = customer.name;
if (customer.name) this.checkArchiveNameRisk();
if (customer.artificialperson) form.legalPerson = customer.artificialperson;
if (customer.bizpartnerAddress) form.registeredDetailAddress = customer.bizpartnerAddress;
if (customer.regcapital) {
@@ -3107,15 +3146,12 @@ export default {
});
},
initMkEnabled() {
this._mkEnabledResolved = false;
loadMkEnabled()
.then(enabled => {
this.mkEnabled = !!enabled;
this._mkEnabledResolved = true;
})
.catch(() => {
this.mkEnabled = false;
this._mkEnabledResolved = true;
});
},
initScoreQuantificationOptions() {
@@ -3215,7 +3251,7 @@ export default {
);
},
/**
* 客商所属组织固定为顶层「广西现代物流集团有限公司」,表单不可编辑。
* 客商所属组织固定为顶层「桂物物流集团」,表单不可编辑。
*/
applyFixedOwnerDept() {
if (!this.isArchivePage || this.readonly) {
@@ -3898,6 +3934,7 @@ export default {
const scope = this.getBusinessLicenseOcrValue(result, ['经营范围']);
if (code) this.archiveForm.unifiedCreditCode = code.replace(/\s/g, '').toUpperCase();
if (name) this.archiveForm.fullName = name;
if (name) this.checkArchiveNameRisk();
if (legalPerson) this.archiveForm.legalPerson = legalPerson;
if (address) {
this.archiveForm.registeredAddress = address;
@@ -4281,6 +4318,7 @@ export default {
this.selectedQualificationFiles = [];
if (this.isPublicViewPage) this.ensurePublicViewOptions(this.archiveForm);
this.applyFixedOwnerDept();
this.checkArchiveNameRisk();
this.archiveBox = true;
this.loadChangeRecords();
if (this.reviewMode) this.openReviewScore();
@@ -4299,6 +4337,7 @@ export default {
this.ocrQualificationUploadFiles = [];
this.selectedQualificationFiles = [];
this.applyFixedOwnerDept();
this.checkArchiveNameRisk();
this.archiveBox = true;
},
resetArchive() {
@@ -4491,34 +4530,15 @@ export default {
});
},
/**
* 列表 / 新增 / 编辑提交共用:
* 未开启 MK 时仅走本地提交审批(与新增一致,不请求 MK 流程);
* 开启 MK 时先提交审核流,再更新客商审批状态。
* 列表 / 新增 / 编辑提交共用:开启 MK 时提交审核流,并更新客商审批状态
*/
submitCustomerApproval(id, fullName = '', approvalStatus = '') {
const submitLocal = () => submitApproval(id);
const run = enabled => {
this.mkEnabled = !!enabled;
this._mkEnabledResolved = true;
if (!this.mkEnabled) {
return submitLocal();
}
return submitMkApprovalFlow({
bizType: 'customer-archive',
bizId: id,
subjectName: fullName,
approvalStatus,
mkEnabled: true,
}).then(submitLocal);
};
// 与列表按钮一致:以页面 mkEnabled 为准,未开启时不请求 MK
if (this._mkEnabledResolved) {
return run(this.mkEnabled);
}
return loadMkEnabled()
.then(enabled => run(enabled))
.catch(() => run(false));
return submitMkApprovalFlow({
bizType: 'customer-archive',
bizId: id,
subjectName: fullName,
approvalStatus,
}).then(() => submitApproval(id));
},
openReviewScore() {
const scores = this.archiveForm.scores || [];
@@ -5296,9 +5316,19 @@ export default {
this.onLoad(this.page);
},
searchChange(params, done) {
// 搜索区所属组织级联返回的是 ID 路径数组,取末级 ID 转成部门名称传给后端(与列表接口 deptName 字段一致)
if (Array.isArray(params.deptName)) {
const path = params.deptName.filter(
item => item !== undefined && item !== null && item !== ''
);
const deptId = path.length ? path[path.length - 1] : '';
params.deptName = deptId
? this.deptOptions.find(item => String(item.value) === String(deptId))?.rawLabel || ''
: '';
}
this.query = this.buildQuery(params);
this.page.currentPage = 1;
this.onLoad(this.page, this.query);
this.onLoad(this.page);
done();
},
selectionChange(list) {
@@ -5325,12 +5355,52 @@ export default {
const pageData = res.data.data;
this.page.total = pageData.total;
this.data = pageData.records;
this.loadCustomerRisk(this.data);
this.selectionClear();
})
.finally(() => {
this.loading = false;
});
},
// 客商风险标签文案:后端 riskLevelName 转义(黑名单/高风险/中风险/低风险),缺失时兜底
customerRiskLabel(risk) {
if (!risk) return '';
return risk.riskLevelName || (risk.risky ? '风险客商' : '正常');
},
// 客商名称风险校验(C101-1,仅展示不作为安全边界):名称失焦/回显时查询,
// risky 在名称框下展示红色提示,悬浮见风险项明细;查询失败静默不阻断填写,提交链路由后端强校验兜底
checkArchiveNameRisk() {
this.archiveNameRisky = false;
this.archiveNameRiskTip = '';
const customerName = String(this.archiveForm.fullName || '').trim();
if (!customerName) return;
getRiskByName(customerName)
.then(res => {
const risk = (res.data && res.data.data) || {};
this.archiveNameRisky = risk.risky === true;
this.archiveNameRiskTip = risk.riskTip || '';
})
.catch(() => {
// 忽略风险查询异常,表单正常填写
});
},
// 客商列表风险批量查询(C101-1,仅展示不作为安全边界):失败静默,行内显示"-",提交链路由后端强校验兜底
loadCustomerRisk(rows) {
this.customerRiskMap = {};
const customerCodes = [...new Set(rows.map(row => row.customerCode).filter(Boolean))];
if (!customerCodes.length) return;
getRiskBatch(customerCodes)
.then(res => {
const riskMap = {};
((res.data && res.data.data) || []).forEach(risk => {
if (risk && risk.customerCode) riskMap[risk.customerCode] = risk;
});
this.customerRiskMap = riskMap;
})
.catch(() => {
// 忽略风险查询异常,列表正常展示
});
},
handleExport() {
this.$confirm('是否导出客商档案数据?', '提示', {
confirmButtonText: '确定',
@@ -5359,38 +5429,7 @@ export default {
};
},
buildQuery(params = {}) {
// 新条件覆盖旧条件;本次显式清空的字段必须从查询里去掉,避免第二次搜索仍带着上一次的客商名称。
const merged = { ...this.query, ...params };
Object.keys(params).forEach(key => {
const value = params[key];
if (
value === '' ||
value === null ||
value === undefined ||
(Array.isArray(value) && value.length === 0)
) {
delete merged[key];
}
});
if (Array.isArray(merged.deptName)) {
const path = merged.deptName.filter(
item => item !== undefined && item !== null && item !== ''
);
const deptId = path.length ? path[path.length - 1] : '';
merged.deptName = deptId
? this.deptOptions.find(item => String(item.value) === String(deptId))?.rawLabel || ''
: '';
if (!merged.deptName) {
delete merged.deptName;
}
}
const values = normalizeSearchRangeParams(merged, createTimeRangeMap);
// 状态下拉「全部」会被数字类型转成 0/-1,二次搜索会把列表滤空。
const status = values.status;
if (status === 0 || status === '0' || status === -1 || status === '-1') {
delete values.status;
}
return values;
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
},
};
@@ -5426,6 +5465,20 @@ export default {
color: var(--el-color-danger);
}
// 风险客商悬浮提示:popper 挂在 body 下,需用 :global 约束宽度
:global(.customer-risk-popper) {
max-width: 360px;
line-height: 1.6;
}
// 客商名称框下方的高风险/黑名单提示(对齐表单错误文案形态)
.archive-name-risk {
color: var(--el-color-danger);
font-size: 12px;
line-height: 1.5;
cursor: default;
}
.fund-use-risk-none {
color: #c0c4cc;
}
+2 -2
View File
@@ -220,7 +220,7 @@ import { downloadXls } from '@/utils/util';
import { handleImportExcel } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { getUploadHeaders } from '@/utils/upload';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { mapGetters } from 'vuex';
import { ElLoading } from 'element-plus';
import { excelOption, exportColumns, option } from '@/option/vehicle/insurance-record';
@@ -409,7 +409,7 @@ export default {
: integerPart;
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
validateRow(row) {
if (row.startDate && row.endDate && row.endDate < row.startDate) {
+2 -2
View File
@@ -195,7 +195,7 @@ import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { formatUpdateUserName } from '@/utils/audit';
import { getToken, isAdministrator } from '@/utils/auth';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
@@ -903,7 +903,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
handleTemplate() {
exportBlob(
+6 -4
View File
@@ -168,7 +168,7 @@ import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { formatUpdateUserName } from '@/utils/audit';
import { getToken, isAdministrator } from '@/utils/auth';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
@@ -371,8 +371,9 @@ export default {
placeholder: '日期时间选择器',
},
{
label: '里程/航程数',
label: '里程/航程数(公里)',
prop: 'mileage',
renderHeader: () => '里程/航程数',
type: 'input',
minWidth: 130,
slot: true,
@@ -390,7 +391,6 @@ export default {
],
value: '公里',
hide: true,
display: false,
},
{
label: '备注',
@@ -565,10 +565,12 @@ export default {
const mileageUnit = vehicleType === '船舶' ? '海里' : '公里';
const vehicleTypeColumn = this.findColumn(this.option.column, 'vehicleType');
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
const mileageColumn = this.findColumn(this.option.column, 'mileage');
const mileageUnitColumn = this.findColumn(this.option.column, 'mileageUnit');
vehicleNoColumn.placeholder =
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
vehicleTypeColumn.disabled = Boolean(this.form.id);
mileageColumn.label = `里程/航程数(${mileageUnit})`;
mileageUnitColumn.value = mileageUnit;
this.form.mileageUnit = mileageUnit;
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
@@ -831,7 +833,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
handleTemplate() {
exportBlob(
+2 -2
View File
@@ -210,7 +210,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
import { excelOption, exportColumns, option } from '@/option/vehicle/mileage-record';
@@ -607,7 +607,7 @@ export default {
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(
{ ...applyIncomingSearch(this.query, params), vehicleType: '车辆' },
{ ...params, ...this.query, vehicleType: '车辆' },
createTimeRangeMap
);
},
@@ -155,7 +155,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
import { excelOption, exportColumns, option } from '@/option/vehicle/tire-replacement-record';
@@ -500,7 +500,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
handleTemplate() {
exportBlob(
@@ -130,7 +130,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
import { excelOption, exportColumns, option } from '@/option/vehicle/transport-change-record';
@@ -478,7 +478,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
handleTemplate() {
exportBlob(
+2 -2
View File
@@ -197,7 +197,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
@@ -673,7 +673,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
},
handleTemplate() {
exportBlob(
+22 -22
View File
@@ -49,28 +49,28 @@ export default ({ mode, command }) => {
__VUE_I18N_LEGACY_API__: true,
__INTLIFY_PROD_DEVTOOLS__: false,
},
server: {
port: 2888,
proxy: {
'/api': {
// 本地网关默认 80 端口(blade-gateway bootstrap.yml);开发时需先启动网关及 blade-auth/blade-system 等服务
// 注意:本机 8080 一般是 Nacos,不是业务网关
target: 'http://localhost',
// target: 'http://172.16.203.228:8000', // 仅联调远程网关时启用(且不要 rewrite)
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
},
},
},
// server: {
// port: 2889,
// proxy: {
// '/api': {
// target: 'http://172.16.203.228:8000',
// changeOrigin: true,
// },
// },
// },
server: {
port: 2888,
proxy: {
'/api': {
// 本地网关默认 80 端口(blade-gateway bootstrap.yml);开发时需先启动网关及 blade-auth/blade-system 等服务
// 注意:本机 8080 一般是 Nacos,不是业务网关
target: 'http://localhost',
// target: 'http://172.16.203.228:8000', // 仅联调远程网关时启用(且不要 rewrite)
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
},
},
},
//server: {
// port: 2889,
// proxy: {
// '/api': {
// target: 'http://172.16.203.221:8000',
// changeOrigin: true,
// },
// },
//},
resolve: {
alias: {
'~': resolve(__dirname, './'),