Compare commits
14 Commits
84d9e098ba
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 50ab33f369 | |||
| bcbc45bb03 | |||
| ff9fb9168b | |||
| 986feff7b7 | |||
| 3e7110ca8c | |||
| b4e12a671f | |||
| 5bb072223f | |||
| 3d6e297147 | |||
| 82fbb99593 | |||
| 17c482e21a | |||
| 2684624979 | |||
| 2131e99ec4 | |||
| 6e5b15f203 | |||
| fbfd5cde89 |
@@ -0,0 +1,6 @@
|
|||||||
|
# 2026-09-10
|
||||||
|
|
||||||
|
- 移除 project-apply 的 fund-risk-stats 请求(后端未实现端点,每次列表加载都弹 No endpoint 报错):删除 onLoad 内 refreshFundRiskStats 调用与该方法、data 中 fundRiskStats;头部风险标签去掉「(数量)」只留「高风险/中风险」;api/business/project-apply.js 保留 getFundRiskStats 定义并注释「后端就绪后恢复」。
|
||||||
|
EOF2
|
||||||
|
}
|
||||||
|
cat >> /Users/gxwebsoft/VUE/tms-erp-web-ws/.workbuddy/memory/2026-09-10.md <<'EOF'
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# 2026-09-11
|
||||||
|
|
||||||
|
## 上传证件区域固定宽度导致跨机器错位(transportCapacity)
|
||||||
|
- 现象:driver.vue 新增弹窗的身份证/大头照上传框在本机对齐,他人电脑不对齐。
|
||||||
|
- 根因:`--large` 上传框写死 `width:240px`(ship 写 248px),而弹窗 `width:90%` + `el-col :span=6` 列宽是弹性的、上方输入框 `width:100%`;列宽随分辨率 / Windows 系统缩放 / 浏览器缩放变化,240px 只在特定宽度下恰好等于列宽。叠加 `labelWidth:auto` 靠 JS 实测字体(苹方 vs 微软雅黑)宽度,label 列宽也不同 → 起始位置漂移。
|
||||||
|
- 修复:三个文件改为 `width:100%; max-width:240px; flex:none`(ship 保留 248px 上限),窄屏跟随列宽、宽屏保持比例上限,左边缘恒与输入框对齐。
|
||||||
|
- `src/views/transportCapacity/driver.vue`(.driver-uploader--large)
|
||||||
|
- `src/views/transportCapacity/vehicle.vue`(.vehicle-uploader--large)
|
||||||
|
- `src/views/transportCapacity/ship.vue`(.ship-uploader--large)
|
||||||
|
- 用 @vue/compiler-sfc(脚本放项目根目录)验证三个 SFC 编译通过。
|
||||||
|
- 教训:本项目所有「固定 px 宽度的上传/控件」都要配 `max-width` + `width:100%`,否则高分屏/低分屏下必然错位。
|
||||||
|
|
||||||
|
## 合同详情由弹窗改为独立页面(contract-manage)
|
||||||
|
- 路由:新增 `/business/contract-manage/detail`(`src/router/views/index.js`,name『合同详情』,meta `keepAlive:false` + `activeMenu:'/business/contract-manage'`),组件仍复用 `contract-manage.vue`(与 form 页同一套路)。
|
||||||
|
- 页面内三分支:`v-if="!isFormPage && !isDetailPage"`(列表)/ `v-else-if="isFormPage"`(表单)/ `v-else`(详情)。**v-else 必须紧邻 form 分支的 `</template>`**,中间不能插其它组件,否则 Vue 编译报「v-else 无相邻 v-if」——弹窗类组件(billing-plan-editor / 附件预览 / 变更记录详情 / 流程)放在三个分支之后。
|
||||||
|
- 关键改动:`openDetail` 改 `router.push({ path:'/business/contract-manage/detail', query:{ id, name } })`;新增 `initDetailPage()`(按 query.id 拉详情,`resetDetailState()` 先清空)、`closeDetailPage()`(closeTag + 回列表)、`isDetailPage` / `detailPageTitle` computed;`created` 与 `$route.fullPath` watch 都要加 `else if (this.isDetailPage)`。
|
||||||
|
- 样式:`.contract-manage-detail--page { max-height:none; overflow:visible }`,去掉弹窗的 74vh 限制;底栏复用 `.contract-manage-page__footer`(fixed 浮动),只读详情页按钮保留「关闭」。
|
||||||
|
- 校验方式:dev server 已运行时 `curl "http://localhost:2889/src/views/business/contract-manage.vue"` 返回 200 即 Vite 编译通过(比整包 build 快)。
|
||||||
|
|
||||||
|
## 只给「查看弹窗」加宽 label(temporary-credit-limit)
|
||||||
|
- 场景:详情页长 label(「剩余项目资金使用额度(万元)」)换行超 2 行撑坏详情表格,但又不能影响新增/编辑页。
|
||||||
|
- **关键发现:Avue 的 `avue-form` 在 detail 模式下根节点会挂 `.avue--detail` 类**(源码 `node_modules/@smallwei/avue/lib/packages/element-plus/form/index3.js` 中 `class: normalizeClass([b(), { 'avue--detail': isDetail }])`)。所以「只针对详情态」的选择器就是:
|
||||||
|
```scss
|
||||||
|
.temporary-credit-limit-dialog .avue--detail .el-form-item__label { width:210px !important; flex:0 0 210px !important; }
|
||||||
|
```
|
||||||
|
新增/编辑弹窗无 `.avue--detail`,天然不受影响,不需要在 option 里做 mode 判断。
|
||||||
|
- 校验样式块编译:dev server 请求 `?vue&type=style&index=1&lang.scss`(**lang 必须写 scss,写 css 会 500**),grep 规则确认产物。
|
||||||
|
- 结论备忘:长 label 优先「加宽 + 换行 ≤2 行」,不要用单行省略 + tooltip —— 详情是纯阅读场景,hover 才能看全字段名的可发现性差。
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
# 2026-09-17 工作日志
|
||||||
|
|
||||||
|
## 配载管理(loading-manage):弹窗全部改为独立表单页/详情页
|
||||||
|
|
||||||
|
- 需求:`/business/loading-manage` 不再用弹窗,改成与新增合同(`/business/contract-manage/form?mode=add&name=新增合同管理`)一致的独立页面。
|
||||||
|
- 现状:新增/编辑**已经**是独立页(组件内 `isStandaloneFormPage` + `/business/loading-manage/form` 路由),但「详情」和「重新派单」仍是 el-dialog(用户截图即详情弹窗)。
|
||||||
|
- 改动(3 个文件):
|
||||||
|
1. `src/router/views/index.js`:新增 `/business/loading-manage/detail`(name 配载单详情,`meta.keepAlive:false, activeMenu:'/business/loading-manage'`),组件仍是 `loading-manage.vue`。
|
||||||
|
2. `src/views/business/loading-manage.vue`:
|
||||||
|
- computed 新增 `isStandaloneDetailPage`(path==='/business/loading-manage/detail')、`isStandalonePage`(form|detail 并集,作为隐藏列表容器的统一开关)、`detailPageTitle`、`formPageDefaultTitle`(add/edit/reassign 映射);`isStandaloneFormPage` 放行 `mode=reassign`。
|
||||||
|
- 模板中所有控制「是否独立页/是否弹窗」的 `isStandaloneFormPage` 改为 `isStandalonePage`;顶部标题按详情/表单取 `detailPageTitle`/`formPageTitle`。
|
||||||
|
- 新增 `gotoLoadingDetail(row)`(push `/detail?id=&name=配载单详情`,替换「配载单号」链接与操作列「详情」)、`gotoLoadingReassign(row)`(push `/form?mode=reassign&id=&name=重新派单`)、`initStandaloneDetailPage()`;`initStandaloneFormPage` 模式透传 edit/reassign;`openLoadingDialog` 对 add/edit/reassign 一律转独立页;`closeLoadingDialog` 判据改 `isStandalonePage`。
|
||||||
|
- `mounted` / `watch $route` 增加详情页分支(直接打开与页内切换都要 init);detail 分支除 id 变化外,`dialogMode !== 'view'` 也重新 init(防止从表单页切详情时残留表单态)。
|
||||||
|
- 兼容旧链接:`/business/loading-manage?detailId=x` 仍可用,会 replace 到详情页。
|
||||||
|
- 样式:底栏去掉写死的 `gap:8px`(全站统一 12px);页面模式的内容区解除 `max-height:78vh` 内嵌滚动盒 —— 原 `:global(.loading-manage-form-page .loading-manage-dialog__body)` 权重 (0,2,0) 低于 scoped 规则 (0,3,0) 一直没生效,改为 `.loading-manage-page .loading-manage-form-dialog.loading-manage-form-page .loading-manage-dialog__body` (0,4,0),内容改随 `#avue-view` 自然滚动(与合同页一致)。
|
||||||
|
3. `src/views/business/components/waybill-manage-page.vue`:`openLoadingDetail` 由 `/business/loading-manage?detailId=` 改为 push `/business/loading-manage/detail?id=&name=配载单详情`。
|
||||||
|
- 校验:dev server(2889)单独编译 4 个模块均 HTTP 200(含 scoped scss);`vite build` 仍会在无关文件 `src/page/login/facelogin.vue` 被沙箱敏感内容保护中断。
|
||||||
|
- 踩坑:**`<style scoped lang="scss">` 顶层写 `//` 注释**会让该样式模块编译 500(`Unexpected '/'. Escaping special characters with \ may help.`),已实测确认;顶层必须用 `/* */`。
|
||||||
|
- 未做:登录态无法在浏览器实测(无测试账号),需用户点 `/business/loading-manage` → 详情/重新派单 自测;`voucher-manage-detail` 跳配载时带的 `?loadingNo=` 参数本来就未被列表消费(历史遗留)。
|
||||||
|
|
||||||
|
## 运单管理详情:打卡时间轴改为按打卡顺序展示
|
||||||
|
|
||||||
|
- 文件:`src/views/business/components/waybill-manage-page.vue`(详情页「执行详情 → 打卡详情」tab)
|
||||||
|
- 需求:时间轴不再固定按流程节点顺序(发货/在途/到货/卸货/签收/回单),改为按打卡时间先后展示。
|
||||||
|
- 实现(不改后端、不改原始数据):
|
||||||
|
1. 新增 computed `orderedWaybillPunchRecords`:映射出 `punchedAt`(毫秒时间戳)后排序 —— **已打卡记录按打卡时间升序排在前**,未打卡记录保持后端返回的节点顺序排在其后;时间相同用原索引稳定排序。
|
||||||
|
2. 新增 method `waybillPunchRecordTimestamp(record)`:`punched === false` 或 `statusName === '未打卡'` 直接返回 null(防止后端返回计划时间造成误序);优先 `this.$dayjs(text).valueOf()`,失败兜底 `new Date(text.replace(/-/g,'/'))`(兼容 Safari)。
|
||||||
|
3. 模板 `el-timeline` 的 `v-for` 改用 `orderedWaybillPunchRecords`;`key` 由 `record.nodeCode || record.id || index` 改为 `${nodeCode||id||'punch'}-${index}`,避免同节点多次打卡(在途)时 key 重复。
|
||||||
|
- 校验:项目根目录临时脚本 `_verify-sfc.mjs`(@vue/compiler-sfc parse + compileScript + compileTemplate)通过,已删除脚本。
|
||||||
|
- 注意:`getPunchRecords`(`src/api/business/waybill-manage.js` → `/punch-records`)后端未提供节点排序字段,排序只能在前端做。
|
||||||
|
|
||||||
|
## 保险记录批量导入:前端归一化日期格式
|
||||||
|
|
||||||
|
- 文件:`src/views/vehicle/insurance-record.vue`(仅此一个文件)
|
||||||
|
- 背景:保险记录批量导入是**后端驱动**——前端 `handleImport` 经 `importBlob` 把原始 Excel 直接 POST 到 `/blade-transport/insurance-record/import-insurance-record`,前端不解析行。后端只认 `2026-09-01`,`2026-9-1` 导入失败。
|
||||||
|
- 决策:用户选择**前端归一化**(不动后端)。把 `openImportDialog` 改为自写 `httpRequest`:用 `xlsx` 读取 Excel → 把日期列(开始日期/结束日期/开票日期)`2026-9-1` 归一为 `2026-09-01` → 重写成新 File 再交给 `handleImportExcel` 上传;复用其失败明细下载与成功刷新逻辑。无日期列时回退为原文件(行为不变)。
|
||||||
|
- 关键方法:`normalizeExcelDates` / `readExcelRows` / `writeExcelFile` / `normalizeDateString`(正则 `^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?$`,用 `new Date` 校验合法性后补零;非法/已标准格式返回 null 保持原值)。
|
||||||
|
- 校验:本机 dev(localhost:2889)待用户部署自测。注意所有单元格经 `sheet_to_json(raw:false)` 后均为字符串,与 transport-plan-import 的客户端解析模式一致。
|
||||||
|
|
||||||
|
## 车/船务模块导出 xlsx「创建时间/更新时间」为空(后端 tms-api 修复)
|
||||||
|
|
||||||
|
- 现象:`/vehicle/insurance-record` 批量导出的 xlsx 里「创建时间」「更新时间」两列空白,「更新人」有值。用户要求车/船务模块所有页面统一修。
|
||||||
|
- 定位:导出由**后端**生成(前端只传查询参数,`exportColumns` 参数后端未使用)。实测 `~/Downloads/保险记录2026-09-17 20_46_08.xlsx`:K/M 列单元格无 `<v>` 节点(值 null),E/F/J 日期列是数值 46266.0(带 numFmt `yyyy-MM-dd`,WPS 显示为日期)。
|
||||||
|
- 根因:Service 用 BladeX `org.springblade.core.tool.utils.BeanUtil`(**继承 Spring `BeanUtils`**)做 `copyProperties`。实体 `TenantEntity.createTime/updateTime` 是 `java.util.Date`,导出类字段是 `java.time.LocalDateTime` → Spring BeanUtils **类型不兼容静默跳过**,值为 null。而「更新人」是手动 `UserCache.getUserRealName(...)` 赋值的,所以有值。(Hutool 的 BeanUtil 能转 Date→LocalDateTime,但本项目用的是 BladeX 版本,不能。)
|
||||||
|
- 佐证:项目里正常的导出(Waybill / LoadingManage / CustomerArchive / CommonCargo)时间字段一律用 `java.util.Date`,并在 Service 里手动 `excel.setCreateTime(record.getCreateTime())`。
|
||||||
|
- 修复(后端仓库 `/Users/gxwebsoft/JAVA/tms-api`,blade-transport 模块):在 13 个导出方法里补显式赋值(Date→LocalDateTime 用 BladeX `DateUtil.fromDate`,`Func.isEmpty` 判空),不改 Excel 类字段类型(避免影响自定义 converter 与导入模板)。
|
||||||
|
```java
|
||||||
|
excel.setCreateTime(Func.isEmpty(x.getCreateTime()) ? null : DateUtil.fromDate(x.getCreateTime()));
|
||||||
|
excel.setUpdateTime(Func.isEmpty(x.getUpdateTime()) ? null : DateUtil.fromDate(x.getUpdateTime()));
|
||||||
|
```
|
||||||
|
- 涉及文件(13 个 Service + 1 新建 Excel 类 + 设备台账 controller/接口):InsuranceRecord / ViolationRecord / MaintenanceRecord / MaintenancePlan / TireReplacementRecord / AccidentRecord / AnnualInspectionRecord / MileageRecord / TransportChangeRecord / EtcRecord / OilElectricRecord / OtherExpenseRecord / EquipmentLedger。
|
||||||
|
- 设备台账特殊:原 `EquipmentLedgerExcel` 根本没有审计列(前端列表有),新建 `EquipmentLedgerExportExcel extends EquipmentLedgerExcel`(创建时间/更新人/更新时间),导出链路改用新类,**导入模板仍用旧类不受影响**。
|
||||||
|
- 未验证:本机无 mvn(仅 IDEA 内置),且离线模式缺 `blade-bom` 无法编译;用 javap 确认 `DateUtil.fromDate(Date)` 存在 + 逐行 grep 复核代替。需用户在 IDEA 里编译并重新部署后自测。
|
||||||
|
- 同类隐患(本次未改,其他模块):TemporaryCreditLimit、ProcessConfig、CommonRoute、CommonAddress、ContractManage、ProjectApply、ShippingTemplate 的导出 Excel 也是 LocalDateTime 且未手动 set 时间。
|
||||||
|
|
||||||
|
## 保险记录保额 -1 问题排查(未结案,待用户验证 DB 环境)
|
||||||
|
|
||||||
|
- 症状:新增弹窗保额不填 → 再开编辑弹窗显示 -1,触发「不能小于 0」校验。
|
||||||
|
- 已排除:前端(源码/dist 构建/git 全历史)、后端 tms-api + tms-erp-api-ws(源码/编译产物 javap/git 历史)均无任何 -1 赋值逻辑;保额为 formslot el-input,空值传 ''。
|
||||||
|
- 关键链路:编辑弹窗 beforeOpen 走 `/detail` 接口(getOne 原生查询),**不经过**列表 SQL 的 `CASE WHEN insured_amount<0 THEN 0` 兜底——所以表格显示 0、弹窗显示原始值。
|
||||||
|
- 数据库截图(用户 Navicat):该行 insured_amount=NULL,全表无负数 → 说明用户浏览的库与后端实际连接的库**不是同一个/DDL 不一致**。系统存在「空数值=-1」惯例(MaintenanceRecordMapper 里程 `CASE WHEN mileage=-1 THEN NULL`;前端 waybill-manage.js/process-config.js 均有 `Number(v)===-1?'':v` 掩码)→ 后端真实库的 insured_amount 列默认值很可能是 -1,MP 插入排除 null 列 → 默认值 -1 入库。
|
||||||
|
- 待验证:在后端 Nacos 数据源指向的库执行 `SHOW CREATE TABLE blade_insurance_record` + `SELECT insured_amount FROM blade_insurance_record WHERE policy_no='11111' AND vehicle_no='沪AE31312'`。
|
||||||
|
- 修复方案(待确认):1) ALTER 列默认值改 NULL + UPDATE 存量负数为 NULL;2) 前端 beforeOpen 对 insuredAmount/premium 做 null/-1 → '' 归一(参照 waybill-manage normalizeNumericDisplayValue);3) 列表 SQL 的 CASE 兜底与 detail 不一致,可顺手统一。
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
# 2026-09-18
|
||||||
|
|
||||||
|
## 修复:改成独立整页后点左侧菜单仍弹出旧弹窗(loading-manage / project-apply)
|
||||||
|
|
||||||
|
**现象**:配载单管理、项目管理已改为「新增/编辑/详情走独立整页」,但从独立页返回或直接点左侧菜单时,页面上仍会盖出一个老的 `el-dialog`(新增项目管理 / 配载单)。
|
||||||
|
|
||||||
|
**根因**(已读 Vue runtime-core 源码确认):
|
||||||
|
- `src/router/tab.js` 按 `tabKey`(默认 fullPath)为每个标签建一个具名 wrapper 组件放进 `wrapperMap`,`src/page/index/layout.vue` 用 `<keep-alive :include="$store.getters.tagsKeep">` 缓存 —— 每个标签页一个实例,全部缓存不销毁。
|
||||||
|
- 组件被 deactivate 后**仍会随 `$route`(全局响应式)重新渲染**;此时 `isStandalonePage` 变 false,`<component :is="isStandalonePage ? 'div' : 'el-dialog'">` 由 div 翻回 `el-dialog`,而 `v-model`(`projectBox`/`dialogVisible`)仍是 true,`append-to-body` 使弹窗 Teleport 到 body。
|
||||||
|
- `KeepAlive.deactivate` 调 `move(vnode, storageContainer, ..., moveType=OUT)`,但 `TeleportImpl.move`(`moveTeleport`)忽略传入的 moveType、一律按 REORDER 处理 → **teleport 出去的 DOM 不会被搬回 storage container**,永久残留在 `document.body` 上并显示出来。
|
||||||
|
|
||||||
|
**修法**(不回退 tab.js 的 `return wrapper` 提交 c1c4fa1,改修根因):
|
||||||
|
- 独立页容器固定为 `<div v-if="isXxxPage">`,不再按路由回退成 `el-dialog`。
|
||||||
|
- 页内其它 `append-to-body` 二级弹窗加 `deactivated()` / `beforeUnmount()` → `closeInnerDialogs()` 把 v-model 置 false。
|
||||||
|
|
||||||
|
**改动文件**:
|
||||||
|
- `src/views/business/loading-manage.vue`:容器改 `<div v-if="isStandalonePage">`;删 `dialogVisible`、`dialogTitle`、`resetLoadingDialog`、`clearLoadingDialog`、页脚弹窗分支(含「清空」);`watch.$route` 简化;新增 `closeInnerDialogs()`(routeChange / commonAddress / candidateSearch)+ `deactivated`/`beforeUnmount`。
|
||||||
|
- `src/views/business/project-apply.vue`:容器改 `<div v-if="isProjectFormPage">`;删 `projectFormContainer`/`projectFormContainerProps`、`projectBox`、`resetProjectDialog`、`handleCancelProject`;`closeProjectForm` 简化为直接 push 列表;新增 `closeInnerDialogs()`(changeRecordDetail / 附件文档预览 / 图片预览 / 选人)+ `deactivated`/`beforeUnmount`。
|
||||||
|
|
||||||
|
**校验**:dev server(2889) curl 两个 .vue 及其 scoped style 模块,均 HTTP 200(500 才是编译失败)。`vite build` 因沙箱敏感内容保护会在 facelogin.vue 中断,未用。
|
||||||
|
|
||||||
|
**遗留同类风险(未改,已告知用户)**:`business/components/waybill-manage-page.vue`(`detailContainer` 在 PageDetail / el-dialog 间切)、`settlement/components/{pre,formal}-settlement-editor.vue`、`transport-reconciliation-editor.vue`(`pageMode ? 'div':'el-dialog'`)、`business/components/waybill-import-dialog.vue`(`standalone`/`createPage`)。统一修法:容器类型在 `created()` 锁定,不随路由/prop 翻转。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 追加修复:运单详情弹窗残留(waybill-manage-page.vue)
|
||||||
|
|
||||||
|
用户复现路径:打开 `/business/waybill-manage/detail?id=xxx` → 点「配载管理」菜单 → 页面上又冒出运单详情弹窗。与上面同一根因:`detailContainer()` 随 `isStandaloneWaybillDetailPage` 在 PageDetail / el-dialog 间翻转,`:append-to-body="!isStandaloneWaybillDetailPage"` 随之为 true,`v-model="detailBox"` 仍 true → Teleport 进 body 搬不回来。
|
||||||
|
|
||||||
|
**改动**(`src/views/business/components/waybill-manage-page.vue`):
|
||||||
|
- data 新增三个锁定标志 `formPageLocked` / `detailPageLocked` / `formModeLocked`,在 `created()` 一次性从 `isStandaloneWaybillFormPage` / `isStandaloneWaybillDetailPage` / `$route.query.mode` 取值。
|
||||||
|
- 模板里所有形态判定(根 class、`v-if="!detailPageLocked"` 的列表容器、`form-page-title`、`status`、独立表单页按钮块、分页 `v-show`、`:append-to-body`、detail-page class、内容 `v-if="detailBox || detailPageLocked"`、独立页 footer / 弹窗 footer slot)全部改读锁定标志。
|
||||||
|
- `detailContainer()` / `crudContainer()` / `pageFormOption()`(含 `boxType`)改读锁定标志,避免缓存实例的 option 变形。
|
||||||
|
- 新增 `closeInnerDialogs()`(关 detailBox、里程补录、附件文档/图片预览、变更路线、常用地址、流程图、运输路线/地址/站点/地图、常用货物、货物导入、过程配置、Excel 导入)+ `deactivated()` / `beforeUnmount()`。
|
||||||
|
|
||||||
|
**关键验证**:`onDeactivated` 在子组件里也会触发 —— apiLifecycle 的 `injectHook` 会向上遍历父链,发现 KeepAlive 父级就把钩子注入到根实例(runtime-core 的 `injectToKeepAliveRoot`),所以写在子组件 waybill-manage-page 上的 `deactivated` 有效。
|
||||||
|
|
||||||
|
**校验**:dev server curl 该 .vue 与 scoped style 均 200。仍未 commit。
|
||||||
|
|
||||||
|
**未提交**:上述改动 + 上一轮 loading-manage 独立页改造均未 commit。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 排查(未改码):配载单详情页反复弹「运单管理不存在」
|
||||||
|
|
||||||
|
用户截图:打开 `/business/loading-manage/detail?id=2097607162718441474&name=配载单详情`,连续弹出 6-7 条红色「运单管理不存在」,标签栏堆了一串「运单管理详情」。
|
||||||
|
|
||||||
|
**文案来源**:前端 src 里没有这句话,是后端 `BusinessException` 的 msg,被 `src/axios.js` 的响应拦截器(`status !== 200` → `ElMessage.error(message)`)统一弹出。
|
||||||
|
|
||||||
|
**主因(通道 A)**:`views/business/waybill-manage-detail.vue` 只有 23 行,写了 `:detail-id="$route.query.id"` —— 直接绑全局 `$route`,**没有路径守卫**。`waybill-manage-page.vue` 的 `detailId` watcher 是 `immediate` 且对任何非空 id 都 `openDetail({id})`。于是:
|
||||||
|
1. 之前打开过的每个运单详情标签(`/business/waybill-manage/detail?id=A`、`?id=B`…)各是一个被 keep-alive 缓存的独立实例;
|
||||||
|
2. 跳到配载单详情后,这些实例被 deactivate 但仍随 `$route` 重渲染 → `$route.query.id` 变成配载单 id;
|
||||||
|
3. prop 变化 → `openDetail({id: 配载单id})` → `getDetail(配载单id)` 去查运单 → 后端「运单管理不存在」→ 拦截器弹一次。**几个旧标签就几条提示**;
|
||||||
|
4. 且被污染实例的 `isStandaloneWaybillDetailPage` 仍是 live computed(false) → `openDetail` 走 `$router.push` 分支 → 又生成新的「运单管理详情」标签(标签栏那串的来源)。
|
||||||
|
|
||||||
|
同理风险:`waybill-manage.vue:6` 与 `transport-plan.vue:6` 的 `:detail-id="$route.query.detailId"`(`business-crud-page.vue:7356` 会 push `/business/loading-manage?detailId=id`,正好会污染运单列表实例)。
|
||||||
|
|
||||||
|
**次因(通道 B)**:`loading-manage.vue` 的 `restoreWaybillRows` 会用 `waybillIdsJson` 里的每个运单 id 并发 `getWaybillDetail(id)`,若历史运单已被删/失效,也会报同一句文案且并发多条。单条 `.catch(() => null)` 挡不住拦截器已弹出的提示。
|
||||||
|
|
||||||
|
**区分方法**:Network 里看报错请求的 `id` —— 等于 `2097607162718441474`(配载单 id)→ 通道 A;是别的数字(运单 id)→ 通道 B。或先关掉所有「运单管理详情」标签再复现,通道 A 会消失。
|
||||||
|
|
||||||
|
**待确认的修法**(用户要求先报不改):
|
||||||
|
1. `waybill-manage-page.vue`:`created()` 锁 `routePathLocked = this.$route.path`,`detailId` watcher 首行加 `if (this.$route.path !== this.routePathLocked) return;`。
|
||||||
|
2. `openDetail()` 的 push 分支加同样守卫(防其它调用路径)。
|
||||||
|
3. 宿主 view 绑定加路径守卫(`waybill-manage-detail.vue` / `waybill-manage.vue` / `transport-plan.vue`)双保险。
|
||||||
|
4. 可选:`getWaybillDetail` 支持静默模式,供 `restoreWaybillRows` 用,避免历史脏数据刷屏。
|
||||||
|
|
||||||
|
## 修复(已执行):「运单管理不存在」误报 + 误开标签
|
||||||
|
|
||||||
|
用户确认后按上方案落地,5 个文件:
|
||||||
|
|
||||||
|
1. `src/views/business/components/waybill-manage-page.vue`
|
||||||
|
- `data()` 新增 `routePathLocked: this.$route.path` —— **必须放 data,不能放 created**:Vue Options API 顺序是 data → computed → watch(immediate) → created(已在 runtime-core `applyOptions` 源码中核实)。放 created 会让首个 immediate watcher 读到空值。
|
||||||
|
- 新增 computed `isOwnedRouteActive() { return this.$route.path === this.routePathLocked; }`
|
||||||
|
- `detailId` watcher 首行加 `if (!this.isOwnedRouteActive) return;`
|
||||||
|
- `openDetail` 的 `$router.push` 分支同样加守卫。
|
||||||
|
2. `src/views/business/components/transport-plan-page.vue`:完全同构的写法(`:detail-id` host 一致),加同样的 `routePathLocked` + `isOwnedRouteActive` + watcher 守卫。
|
||||||
|
3. `src/views/business/waybill-manage-detail.vue`:`:detail-id="$route.query.id"` → `:detail-id="detailId"`,computed 做 `this.$route.path === '/business/waybill-manage/detail'` 守卫。
|
||||||
|
4. `src/views/business/waybill-manage.vue`:同上,守卫 `/business/waybill-manage`(保留旧链接 `?detailId=` 兼容)。
|
||||||
|
5. `src/views/business/transport-plan.vue`:同上,守卫 `/business/transport-plan`。
|
||||||
|
|
||||||
|
**验证**:
|
||||||
|
- dev server curl 5 个 .vue + 2 个 scoped style 全部 HTTP 200。
|
||||||
|
- 用 `@vue/server-renderer` 写了临时 mjs(已删)模拟带 `$route` 的 app,确认 **data() 里访问 `this.$route` 可行**:immediate watcher 触发时 `routePathLocked` 已是正确路径、首次加载不被拦截。
|
||||||
|
- `$route` 是 vue-router 挂在 `app.config.globalProperties` 上的 getter(vue-router.mjs:1498),组件实例化时已就绪。
|
||||||
|
|
||||||
|
**未做(第 4 条可选)**:给 `getWaybillDetail` 加静默模式供 `restoreWaybillRows` 使用(历史失效运单仍会刷多条红字),待用户定夺。
|
||||||
|
|
||||||
|
**另注**:`business-crud-page.vue:6651` 有同构的 `detailId` immediate watcher,但全项目只有上述 3 个宿主 view 传 `:detail-id`,它暂无调用方,未动。
|
||||||
|
|
||||||
|
**仍未 commit。**
|
||||||
|
|
||||||
|
## 修复(已执行):合同详情页整页空白 —— 路由表重复定义
|
||||||
|
|
||||||
|
**现象**:主订单详情点合同编号 → `/business/contract-manage/detail?id=...&name=合同详情` 内容区空白(侧栏/标签正常)。
|
||||||
|
|
||||||
|
**定位过程(关键:真实浏览器复现,不猜)**
|
||||||
|
1. 静态排查全部排除:`contract-manage.vue` 及其 26 个依赖 HTTP 200、模块 `import()` 成功、无循环依赖、详情分支引用的 24 个成员全部有定义。
|
||||||
|
2. dev 环境登录态无法直接拿(验证码 + `admin/admin` 报 `error_code 2004 用户密码强度过低`),改为**注入式复现**:
|
||||||
|
- `agent-browser open <目标 URL>`(落 `/login`);
|
||||||
|
- eval 取 `document.getElementById('app').__vue_app__.config.globalProperties` 拿 `$router` / `$store`;
|
||||||
|
- 写 cookie `saber3-access-token`(注意 token 走 **js-cookie**,不是 localStorage)+ `$store.state.user.token`;
|
||||||
|
- 覆写 `XMLHttpRequest.prototype.open/send` 让所有 `/api/**` 返回 `{code:200,data:{...}}`(defineProperty 伪造 readyState/status/responseText 后手动触发 `onloadend`)。
|
||||||
|
- 再 `$router.push(...)` 做 SPA 跳转。
|
||||||
|
3. 复现出空白,并拿到决定性证据:
|
||||||
|
- `/business/contract-manage/detail` → `$route.matched.length === 1`(只有 Layout,name undefined),`#avue-view.children.length === 0`,innerHTML 为 `<!---->`。
|
||||||
|
- 对照 `/business/contract-manage/change`(结构相同但未重复定义)→ `matched.length === 2`(Layout + 合同变更),内容完整渲染。
|
||||||
|
- `$router.getRoutes()` 里 detail 有 **3 条**记录:2 个 Layout 父记录 + 1 个子记录(`合同详情`)。
|
||||||
|
|
||||||
|
**根因**:`src/router/views/index.js` 中 `/business/contract-manage/detail` **被复制粘贴定义了两次**,两次的子路由都叫 `合同详情`。vue-router 的 `addRoute` 遇到重名会 `removeRoute(name)` 把先注册的子记录删掉,但**不会把它从父记录的 `children` 数组里摘除**;于是第一条 Layout 壳记录留在 matcher 列表里且排在前面,`resolve('/business/contract-manage/detail')` 命中这个"无有效子路由"的壳 → matched 只有 1 层 → `page/index/index.vue` 里 `#avue-view` 的二级 `<router-view>` 无匹配 → 内容区空白。
|
||||||
|
(`getRoutes()` 计数是判据:form / change 都是 2 条 = 父 + 子(健康),detail 是 3 条 = 2 父 + 1 子(坏)。)
|
||||||
|
|
||||||
|
**修复**:删除重复块(原 314-325 行),只保留 159-169 行那一份。
|
||||||
|
|
||||||
|
**验证**:
|
||||||
|
- 重复扫描脚本(正则匹配「顶层 path + `component: Layout` + 首个子路由 name」):views/index.js 27 条 Layout 子路由中仅 `合同详情` 重复;page/index.js 无重复 → 已清零。
|
||||||
|
- 修复后浏览器复验:detail → `matched.length === 2`(Layout + 合同详情)、`#avue-view.children.length === 1`,正文完整渲染「基本信息 / 签约类型 / 合同编号 HT-2026-001 / … / 变更记录」。
|
||||||
|
- 全量回归:48 条 business/vehicle/payment/settlement 路由 `resolve()` 后 `matched.length` 全部 ≥ 2,`bad: []`。
|
||||||
|
- `curl` 校验:`views/index.js`、`contract-manage.vue` 均 200。
|
||||||
|
- 残留报错均为 mock 数据形状不符所致(所有接口都返回同一个合同对象,导致 `tree.reduce` / `feeCategories.find` 之类失败),非真实缺陷。
|
||||||
|
|
||||||
|
**未 commit**(连同 1、2 轮改动一起待确认)。
|
||||||
+19
-100
@@ -1,108 +1,27 @@
|
|||||||
# 项目长期记忆(tms-erp-web-ws / Saber3 客商模块)
|
# 项目长期记忆(tms-erp-web-ws / Saber3)
|
||||||
|
|
||||||
## 设计约定(已确认)
|
后端:`/Users/gxwebsoft/JAVA/tms-api`(`tms-erp-api-ws` 滞后,别看错仓库)。
|
||||||
|
|
||||||
### 表单 placeholder 统一为「请输入 / 请选择」(不带字段名)
|
## 列表 / 表单 / 详情三态同组件分流
|
||||||
- **规范**:输入框 placeholder 只写动作词 `请输入` / `请选择`,**后面不跟字段名称**(label 已说明是什么字段,重复无意义)。
|
`/xxx`、`/xxx/form`、`/xxx/detail` 指向同一 `.vue`;form/detail 在 `src/router/views/index.js` 是 `component: Layout` + 空 `children.path` + `meta:{keepAlive:false}`(detail 另带 `activeMenu`)。组件内按 `$route.path` 分流,必须 `watch:{$route}` 重新 init;标签标题取 `query.name`;独立页容器固定 `<div v-if>`,不用 `el-dialog`。
|
||||||
- 已生效页面:waybill-manage、transport-plan、shipping-template、temporary-credit-limit(搜索栏 + 弹窗表单)、**driver.vue**(2026-09-09 补齐 18 处)。
|
|
||||||
- **3 类例外必须保留,不要误简化**:
|
|
||||||
1. 复合操作:如 `请输入或选择车辆`(既可键盘输入又可点按钮弹窗选车),丢掉会损失语义。
|
|
||||||
2. 日期区间的 `起` / `止`:是起止标记,不是字段提示。
|
|
||||||
3. 默认值说明:如资格证号 `默认身份证号`、车牌号 `如:京A12345`,属于示例/默认值提示,非「请输入」格式。
|
|
||||||
- **校验错误提示 message 保持带字段名**(如「请选择准驾车型」「请输入档案编号」),与 placeholder 定位不同——报错必须指明具体哪个字段,不能只说「请选择」。
|
|
||||||
- Avue 配置化表单:在 option 各列加 `placeholder`;搜索栏可用通用工具 `withSearchPlaceholders([...])`(见 temporary-credit-limit.js)。
|
|
||||||
- 批量改法:Python 脚本按**完整 placeholder 字符串**做精确替换,每规则校验 `count > 0` 否则中断,避免误伤;改完用 `@vue/compiler-sfc` 的 parse + compileTemplate + compileScript 验证(脚本须放项目根目录下跑,放 /tmp 解析不到 node_modules)。
|
|
||||||
|
|
||||||
### 弹窗分组:统一用全局 `<section-card>`
|
## ⚠️ keep-alive 三坑
|
||||||
- 弹窗 body 背景由 `src/styles/element-ui.scss` 全局 `.el-dialog__body { background:#f5f6fa; padding:16px }` 统一灰底。
|
背景(`router/tab.js` + `page/index/index.vue`):按 `fullPath` 建 wrapper,`<keep-alive :include="tagsKeep">` 缓存,**每标签一实例、永不销毁**,deactivate 后**仍随全局 `$route` 重渲染**。
|
||||||
- 每组 = 白底卡片:4px 主色竖条 + 8px 间距 + 圆角 6px + 淡阴影。组件全局注册 `<section-card title="...">`,支持 `#title` / `#extra` slot。
|
|
||||||
- 仅 3 项的小分组用 `el-col :span="8"` 均分一行。
|
|
||||||
|
|
||||||
### Avue 内置弹窗用 section-card:dialogCustomClass 透明化 avue-form
|
**坑一:独立页容器禁用 `<component :is>` 在 div / el-dialog 间切换。** `append-to-body` 走 Teleport,`TeleportImpl.move` 忽略 `moveType`,不会把 DOM 搬回缓存容器 → 切菜单冒出旧弹窗。修法:固定 `<div v-if>` + `deactivated(){closeInnerDialogs()}` + `beforeUnmount()`(写在子组件也生效)。已修 loading-manage / project-apply / waybill-manage-page;未修 `settlement/components/{pre,formal}-settlement-editor.vue`、`transport-reconciliation-editor.vue`、`waybill-import-dialog.vue`。
|
||||||
- option 顶层加 `dialogCustomClass:'xxx-dialog'`,再在 `element-ui.scss` 写三条:
|
|
||||||
1. `.xxx-dialog .avue-form { background:transparent; box-shadow:none; padding:0 }`
|
|
||||||
2. `.xxx-dialog .avue-form__group > .el-col > .el-form-item { margin-bottom:0 }`
|
|
||||||
3. `.xxx-dialog .avue-dialog__footer, .avue-crud__dialog .xxx-dialog .avue-dialog__footer { margin-top:0 !important }`
|
|
||||||
|
|
||||||
### 弹窗底部操作栏浮动(全局 CSS)
|
**坑二:宿主 view 直绑全局 `$route.query.*` 给子组件 prop。** 缓存实例被灌入当前页 id → 拿错 id 查后端(批量弹「运单管理不存在」),live computed 还会误 push 标签。修法:`routePathLocked` 锁路径 + watcher / push 前判 `isOwnedRouteActive` + 宿主绑定加路径守卫。⚠️ `routePathLocked` **必须放 `data()`**(Options API 顺序 data → computed → watch(immediate) → created;放 created 会读到空值、挡掉首次加载)。已修 waybill-manage-page / transport-plan-page + 三个宿主 view。
|
||||||
- `.el-dialog__body { max-height:calc(100vh - 200px); overflow-y:auto; overflow-x:hidden }`
|
|
||||||
- `.el-dialog__footer { margin:0; padding:12px 20px; background:#fff; border-top:1px solid #ebeef5; box-shadow:0 -2px 8px rgba(0,0,0,.04) }`
|
|
||||||
- Avue 内置弹窗 footer 真实 class 是 `.avue-dialog__footer`,须 `position:sticky; bottom:0; flex:none; background:#fff` 贴底。
|
|
||||||
|
|
||||||
### 上传证件区域尺寸(transportCapacity)
|
**坑三:路由表重复定义 → 内容区整页空白(2026-09-18)。** `/business/contract-manage/detail` 在 `router/views/index.js` 定义两次、子路由同名 `合同详情`。重名 `addRoute` 会 `removeRoute(name)` 移除旧子记录,但**不从父记录 children 里摘除**,第一条 Layout 壳记录留在 matcher 且靠前 → `resolve()` 命中它 → `$route.matched.length === 1` → 二级 router-view 无匹配 → 侧栏/标签正常但内容空白。修法:删重复定义。排查:扫「顶层 path + 首个子路由 name」重复项。
|
||||||
- 身份证/行驶证/道路运输证等固定 **240×151px**(1.586:1)。
|
|
||||||
- scoped 覆盖 `.xxx-uploader--large { width:240px }` 与 `--large .el-upload { width:100%; height:151px }`。
|
|
||||||
|
|
||||||
### 上传图片点击放大预览
|
## 样式硬规则
|
||||||
- `src/components/image-upload-field/main.vue` 用 `<el-image preview-src-list fit="contain" preview-teleported :z-index="3000" @click.stop>`,阻止冒泡到 el-upload。
|
- 底栏 `flex; justify-content:flex-end`,**不写 gap**(靠 EP 默认 `.el-button+.el-button{margin-left:12px}`);浮动底栏必须 `position:fixed`(祖先 overflow:hidden 使 sticky 失效)+ `:global(.avue--collapse .x){left:60px}`、`:global(.avue-layout--horizontal .x){left:0}`,`:global()` 要包整个选择器。
|
||||||
|
- 按钮层级:次要=无 type;中间步骤=`primary plain`;主操作=`primary`(禁绿、禁两个蓝实心)。顺序 `[辅助][取消][保存草稿][提交]`。
|
||||||
|
- 独立页标题 `.archive-page-form__title`;分组用全局 `<section-card>`;上传证件区 `width:100%; max-width:240px` + `.el-upload{height:151px}`。
|
||||||
|
- ⚠️ `<style scoped lang="scss">` 顶层禁 `//` 注释(Vite5 + sass `Unexpected '/'` → 500),顶层用 `/* */`。其余见 `src/styles/element-ui.scss` 与 `AGENTS.md` 4.4。
|
||||||
|
|
||||||
### 独立表单页标题 `archive-page-form__title`
|
## 表单 / 自检 / 导出
|
||||||
- 样式全局化到 `src/styles/element-ui.scss`:18px/600/#303133 + margin-bottom:20px + 4px 主色竖条 + 8px 间距。
|
- placeholder 只写 `请输入`/`请选择`;例外:`请输入或选择车辆`、日期区间 `起`/`止`、示例值。校验 message 须带字段名。
|
||||||
- business-crud-page 系列通过 `formPageTitle` prop 注入;loading-manage / master-order 手写前置标题。
|
- `business-crud-page.vue`:option 经 `cloneOption` 克隆,独立表单页走 `PageAvueForm`。
|
||||||
|
- 自检:`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-ui.scss` 全局兜底:`.el-table .el-table__body td.el-table__cell .cell > .el-input-number/.el-input/.el-select/.el-date-editor/.el-cascader { width:100% }`。
|
|
||||||
|
|
||||||
### 业务状态标签文字化
|
|
||||||
- 全站"状态语义"的 `el-tag` 加 `class="status-text"`,转为普通文字,不带颜色/背景/边框/圆点。
|
|
||||||
- 实现:`element-ui.scss` 末尾 `.el-tag.status-text { ... }`。
|
|
||||||
|
|
||||||
### 弹窗 / 独立表单页底栏按钮统一规则
|
|
||||||
- **排序**:从左到右按次→主排(次要居左、主操作居右),主操作永远放最后。
|
|
||||||
- 顺序模板:`[可选辅助工具(如同步/导入)][取消][保存草稿][提交/确认]`
|
|
||||||
- **容器布局(2026-08-27 改为「去 gap」)**:`display:flex; justify-content:flex-end;`(**不写 `gap`**)。按钮间距统一由 Element Plus 全局默认的相邻按钮 `.el-button+.el-button{margin-left:12px}` 提供,全站恒为 12px。原各 footer 写死的 `gap:8/12px` 已全部移除。`src/styles/element-ui.scss` 里 `.el-dialog__footer .el-button + .el-button` 也已从 `8px` 改 `12px`,与之一致。弹窗关闭按钮继承 Element Plus 自带 `.el-dialog__footer` 全局规则(见上条),独立页用 `.archive-form__footer` 配 `.archive-page-form & { position:fixed; right:0; left:230px; bottom:0; z-index:10; margin:0; padding:12px 24px; border-top:1px solid #eff1f7; background:#fff; box-shadow:0 -2px 8px rgba(0,0,0,.06); }`。
|
|
||||||
- **⚠️ 浮动底部必须用 `position:fixed`,不能用 `position:sticky`**:本项目布局 `.app-main` / `.basic-container` 祖先带 `overflow:hidden`,会导致 `sticky` 永不触发(footer 不吸底)。固定写法照搬 customer-archive:
|
|
||||||
```scss
|
|
||||||
.xxx-actions {
|
|
||||||
position: fixed; right: 0; left: 230px; bottom: 0; margin: 0; z-index: 10;
|
|
||||||
/* flex-end + padding + border-top + 白底 + 上投影 */
|
|
||||||
}
|
|
||||||
:global(.avue--collapse .xxx-actions) { left: 60px; } /* 侧栏折叠 */
|
|
||||||
:global(.avue-layout--horizontal .xxx-actions) { left: 0; } /* 横向布局 */
|
|
||||||
```
|
|
||||||
注意 `:global()` 要把「整个选择器」包进去(customer-archive 写法),不要只包前缀,否则 scoped 会在中间选择器上追加 data 属性导致不匹配。
|
|
||||||
- **颜色层级 3 档**:
|
|
||||||
| 语义 | type | 备注 |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| 次要(取消 / 关闭) | 不写 type(默认) | 灰描边 |
|
|
||||||
- **全站底部操作栏「返回」已统一改为「取消」**:独立表单页返回列表、弹窗关闭、主从编辑器返回等场景一律写「取消」;仅只读查看 / 纯关闭场景保留「关闭」。
|
|
||||||
| 中间步骤(保存草稿 / 按匹配结果更新) | `type="primary" plain` | 蓝描边 |
|
|
||||||
| 主操作(提交 / 完成对账 / 复评确认) | `type="primary"` | 蓝实心 |
|
|
||||||
- **禁区**:
|
|
||||||
- 保存草稿和主操作不允许同为 `type="primary"`,否则两个蓝实心无视觉层级。
|
|
||||||
- 主操作禁止用 `type="success"`(绿)。全站统一深蓝实心。
|
|
||||||
- **生效页面(已按规则统一)**:
|
|
||||||
- `business/project-apply.vue`(footer + 变更 footer)
|
|
||||||
- `vehicle/customer-archive.vue` 全部 5 处 footer(`archive-form__footer` 主表单页 + `contact-dialog`/`receipt-dialog`/`invoice-dialog` 子弹窗 + `score-detail-dialog` 含总分合计)
|
|
||||||
- `business/components/business-crud-page.vue` 的 PageAvueForm 独立表单页(`#menu-form-before` slot 新增 `取消` 按钮,shipping-template 模式验证通过;影响 `/business/waybill-manage/form`、`/business/transport-plan/form`、`/business/shipping-template/form` 三处独立表单页)
|
|
||||||
- `business/components/master-order-editor.vue` 主 `<footer>`(取消 default + 暂存/确认创建 plain + 创建并调度 primary;`position:fixed` 浮动,含 `avue--collapse`/`avue-layout--horizontal` 左偏移)
|
|
||||||
- **payment 模块**表单页(`__actions` 均 `flex-end` + `position:fixed` 浮动,含 `avue--collapse`/`avue-layout--horizontal` 左偏移):
|
|
||||||
- `payment-application-form.vue`(`[取消][保存 plain][提交]`)
|
|
||||||
- `invoice-application-form.vue` / `invoice-receipt-form.vue`(`[取消][同步 plain][保存 plain][提交]`)
|
|
||||||
- `bill-ledger-form.vue`(`[取消][确认 primary]`)
|
|
||||||
- `bill-payment-form.vue`(`[取消][保存 plain][提交]`)
|
|
||||||
- `receipt-flow-form.vue`(`[取消][确认 primary]`)
|
|
||||||
- `receipt-claim-record-form.vue`(单「关闭」按钮,居中→右对齐浮动)
|
|
||||||
- **settlement 模块**:
|
|
||||||
- `settlement/components/pre-settlement-editor.vue`(弹窗 + pageMode 两处 footer:保存加 `plain`;`&__page-actions` 加 `position:fixed` 浮动,含 `avue--collapse`/`avue-layout--horizontal` 左偏移)
|
|
||||||
- `settlement/components/formal-settlement-editor.vue`(`.formal-editor__page-actions` 加 `position:fixed` 浮动,含 `avue--collapse`/`avue-layout--horizontal` 左偏移;按钮已 `[取消][提交]` 合规)
|
|
||||||
- `settlement/receivable-payable-detail.vue`(生成费用弹窗「上一步」改 `plain`)
|
|
||||||
- **已合规未动**:`settlement/components/transport-reconciliation-editor.vue`(`[取消][保存草稿 plain][按匹配结果更新账单 plain][完成对账 primary]`)、`settlement/components/settlement-adjustment-editor.vue`(弹窗 `[取消][保存 primary]`)、`business/temporary-credit-limit.vue`。
|
|
||||||
- **Avue-form footer 结构注意**:`#menu-form-before` slot 内容在 Avue 内置按钮之**左**;`#menu-form` slot 在 Avue 内置按钮之**右**。要实现 `[次要][Avue 主操作]` 顺序,把次要按钮放进 `#menu-form-before`,主操作保留 Avue 内置即可。
|
|
||||||
- **Avue 表单 footer 按钮去图标(统一纯文字)**:Avue 的 `avue-form` 提交/清空按钮内置图标(`submitIcon: 'el-icon-check'`、`emptyIcon: 'el-icon-delete'`),且 Avue 源码用 `|| 'el-icon-xxx'` 兜底,无法通过 option 配置去掉。已在 `business-crud-page.vue` 样式里用 `:global(.business-crud-form-page-dialog .avue-form__menu .el-icon){display:none}` 统一隐藏,仅作用于独立表单页(PageAvueForm 容器),不影响其它弹窗。新增/编辑弹窗内的 Avue 表单若也要去图标,复用此选择器即可。
|
|
||||||
- **复杂 footer 例外**:当 footer 需要在按钮组左侧展示「总分合计 / 数量统计」等聚合信息时,块用 `flex:1` 推自己到最左,按钮组按上述规则排在右半边(参考 `score-detail-dialog`)。
|
|
||||||
|
|
||||||
## 关键文件
|
|
||||||
- `src/components/section-card/main.vue`
|
|
||||||
- `src/styles/element-ui.scss`
|
|
||||||
- `src/views/vehicle/customer-archive.vue`
|
|
||||||
- `src/views/transportCapacity/{driver,vehicle,ship}.vue`
|
|
||||||
- `src/views/business/project-apply.vue`
|
|
||||||
|
|
||||||
## 环境注意
|
|
||||||
- Vite 代理跨域:`axios.withCredentials=true`,改 `.env`/`vite.config.mjs` 须重启 dev。
|
|
||||||
|
|
||||||
## business-crud-page 复用模式
|
|
||||||
- option 由 prop `crudOption` 经 `cloneOption` 克隆。
|
|
||||||
- 独立表单页走 `PageAvueForm`,不包 el-dialog。
|
|
||||||
- 自定义详情弹窗:`config.detailButton=true` + `detailSections:[{title, fields}]`。
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export const submit = api.submit;
|
|||||||
export const remove = api.remove;
|
export const remove = api.remove;
|
||||||
|
|
||||||
// 项目资金使用风险统计(高风险 / 中风险数量),供列表头部快速筛选标签使用
|
// 项目资金使用风险统计(高风险 / 中风险数量),供列表头部快速筛选标签使用
|
||||||
|
// 暂未启用:后端 /fund-risk-stats 端点尚未实现,列表页已移除调用,等后端就绪后恢复
|
||||||
export const getFundRiskStats = params =>
|
export const getFundRiskStats = params =>
|
||||||
request({
|
request({
|
||||||
url: `${baseUrl}/fund-risk-stats`,
|
url: `${baseUrl}/fund-risk-stats`,
|
||||||
|
|||||||
@@ -31,10 +31,16 @@ export const add = row => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const syncIamAccounts = () => {
|
export const syncIamAccounts = (current = 1, size = 50, signal) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/blade-system/user/sync-iam-accounts',
|
url: '/blade-system/user/sync-iam-accounts',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
current,
|
||||||
|
size,
|
||||||
|
},
|
||||||
|
timeout: 60000,
|
||||||
|
signal,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import { getToken } from '@/utils/auth';
|
|||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
import { generateIframePath, processUrlForQuery, isURL } from './router';
|
import { generateIframePath, processUrlForQuery, isURL } from './router';
|
||||||
import { wrapViewLoader } from '@/utils/chunk-reload';
|
import { wrapViewLoader } from '@/utils/chunk-reload';
|
||||||
|
|
||||||
|
// 保持懒加载,避免 eager 与 store 循环依赖(Cannot access 'store' before initialization)
|
||||||
const modules = import.meta.glob('../**/**/*.vue');
|
const modules = import.meta.glob('../**/**/*.vue');
|
||||||
|
|
||||||
// 将多级路由扁平化为二级路由,支持 keep-alive 跨层级缓存
|
// 将多级路由扁平化为二级路由,支持 keep-alive 跨层级缓存
|
||||||
|
|||||||
+58
-38
@@ -1,5 +1,8 @@
|
|||||||
import Layout from '@/page/index/index.vue';
|
import Layout from '@/page/index/index.vue';
|
||||||
import Store from '@/store/';
|
import Store from '@/store/';
|
||||||
|
import { wrapViewLoader } from '@/utils/chunk-reload';
|
||||||
|
|
||||||
|
const loadView = loader => wrapViewLoader(loader);
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
@@ -10,7 +13,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '汇票付款表单',
|
name: '汇票付款表单',
|
||||||
meta: { keepAlive: false, activeMenu: '/payment/bill-payment' },
|
meta: { keepAlive: false, activeMenu: '/payment/bill-payment' },
|
||||||
component: () => import('@/views/payment/bill-payment-form.vue'),
|
component: loadView(() => import('@/views/payment/bill-payment-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -22,7 +25,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '汇票台账表单',
|
name: '汇票台账表单',
|
||||||
meta: { keepAlive: false, activeMenu: '/payment/bill-ledger' },
|
meta: { keepAlive: false, activeMenu: '/payment/bill-ledger' },
|
||||||
component: () => import('@/views/payment/bill-ledger-form.vue'),
|
component: loadView(() => import('@/views/payment/bill-ledger-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -34,7 +37,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '认领记录详情',
|
name: '认领记录详情',
|
||||||
meta: { keepAlive: false, activeMenu: '/payment/receipt-claim-record' },
|
meta: { keepAlive: false, activeMenu: '/payment/receipt-claim-record' },
|
||||||
component: () => import('@/views/payment/receipt-claim-record-form.vue'),
|
component: loadView(() => import('@/views/payment/receipt-claim-record-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -46,7 +49,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '收款流水认领',
|
name: '收款流水认领',
|
||||||
meta: { keepAlive: false, activeMenu: '/payment/receipt-flow' },
|
meta: { keepAlive: false, activeMenu: '/payment/receipt-flow' },
|
||||||
component: () => import('@/views/payment/receipt-flow-form.vue'),
|
component: loadView(() => import('@/views/payment/receipt-flow-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -58,7 +61,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '收票登记',
|
name: '收票登记',
|
||||||
meta: { keepAlive: false, activeMenu: '/payment/invoice-receipt' },
|
meta: { keepAlive: false, activeMenu: '/payment/invoice-receipt' },
|
||||||
component: () => import('@/views/payment/invoice-receipt-form.vue'),
|
component: loadView(() => import('@/views/payment/invoice-receipt-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -70,7 +73,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '开票申请',
|
name: '开票申请',
|
||||||
meta: { keepAlive: false, activeMenu: '/payment/invoice-application' },
|
meta: { keepAlive: false, activeMenu: '/payment/invoice-application' },
|
||||||
component: () => import('@/views/payment/invoice-application-form.vue'),
|
component: loadView(() => import('@/views/payment/invoice-application-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -82,7 +85,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '付款申请',
|
name: '付款申请',
|
||||||
meta: { keepAlive: false, activeMenu: '/payment/payment-application' },
|
meta: { keepAlive: false, activeMenu: '/payment/payment-application' },
|
||||||
component: () => import('@/views/payment/payment-application-form.vue'),
|
component: loadView(() => import('@/views/payment/payment-application-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -97,7 +100,7 @@ export default [
|
|||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
activeMenu: '/settlement/pre-settlement',
|
activeMenu: '/settlement/pre-settlement',
|
||||||
},
|
},
|
||||||
component: () => import('@/views/settlement/pre-settlement-form.vue'),
|
component: loadView(() => import('@/views/settlement/pre-settlement-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -112,7 +115,7 @@ export default [
|
|||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
activeMenu: '/settlement/formal-settlement',
|
activeMenu: '/settlement/formal-settlement',
|
||||||
},
|
},
|
||||||
component: () => import('@/views/settlement/formal-settlement-form.vue'),
|
component: loadView(() => import('@/views/settlement/formal-settlement-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -127,7 +130,7 @@ export default [
|
|||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
activeMenu: '/settlement/transport-reconciliation',
|
activeMenu: '/settlement/transport-reconciliation',
|
||||||
},
|
},
|
||||||
component: () => import('@/views/settlement/transport-reconciliation-form.vue'),
|
component: loadView(() => import('@/views/settlement/transport-reconciliation-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -139,7 +142,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '执行凭证批次详情',
|
name: '执行凭证批次详情',
|
||||||
meta: { keepAlive: false, activeMenu: '/business/voucher-manage' },
|
meta: { keepAlive: false, activeMenu: '/business/voucher-manage' },
|
||||||
component: () => import('@/views/business/voucher-manage-detail.vue'),
|
component: loadView(() => import('@/views/business/voucher-manage-detail.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -151,7 +154,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '新增合同管理',
|
name: '新增合同管理',
|
||||||
meta: { keepAlive: false },
|
meta: { keepAlive: false },
|
||||||
component: () => import('@/views/business/contract-manage.vue'),
|
component: loadView(() => import('@/views/business/contract-manage.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -163,7 +166,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '合同详情',
|
name: '合同详情',
|
||||||
meta: { keepAlive: false, activeMenu: '/business/contract-manage' },
|
meta: { keepAlive: false, activeMenu: '/business/contract-manage' },
|
||||||
component: () => import('@/views/business/contract-manage.vue'),
|
component: loadView(() => import('@/views/business/contract-manage.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -175,7 +178,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '新增项目申请',
|
name: '新增项目申请',
|
||||||
meta: { keepAlive: false },
|
meta: { keepAlive: false },
|
||||||
component: () => import('@/views/business/project-apply.vue'),
|
component: loadView(() => import('@/views/business/project-apply.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -187,7 +190,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '新增编辑运单管理',
|
name: '新增编辑运单管理',
|
||||||
meta: { keepAlive: false },
|
meta: { keepAlive: false },
|
||||||
component: () => import('@/views/business/waybill-manage.vue'),
|
component: loadView(() => import('@/views/business/waybill-manage.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -199,7 +202,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '运单管理详情',
|
name: '运单管理详情',
|
||||||
meta: { keepAlive: false, activeMenu: '/business/waybill-manage' },
|
meta: { keepAlive: false, activeMenu: '/business/waybill-manage' },
|
||||||
component: () => import('@/views/business/waybill-manage-detail.vue'),
|
component: loadView(() => import('@/views/business/waybill-manage-detail.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -211,7 +214,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '导入运单',
|
name: '导入运单',
|
||||||
meta: { keepAlive: false, activeMenu: '/business/waybill-import' },
|
meta: { keepAlive: false, activeMenu: '/business/waybill-import' },
|
||||||
component: () => import('@/views/business/waybill-import.vue'),
|
component: loadView(() => import('@/views/business/waybill-import.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -223,7 +226,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '新建导入运单',
|
name: '新建导入运单',
|
||||||
meta: { keepAlive: false, activeMenu: '/business/waybill-import' },
|
meta: { keepAlive: false, activeMenu: '/business/waybill-import' },
|
||||||
component: () => import('@/views/business/waybill-import-form.vue'),
|
component: loadView(() => import('@/views/business/waybill-import-form.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -235,6 +238,18 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '新增编辑配载管理',
|
name: '新增编辑配载管理',
|
||||||
meta: { keepAlive: false },
|
meta: { keepAlive: false },
|
||||||
|
component: loadView(() => import('@/views/business/loading-manage.vue')),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/business/loading-manage/detail',
|
||||||
|
component: Layout,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: '配载单详情',
|
||||||
|
meta: { keepAlive: false, activeMenu: '/business/loading-manage' },
|
||||||
component: () => import('@/views/business/loading-manage.vue'),
|
component: () => import('@/views/business/loading-manage.vue'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -247,7 +262,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '新增编辑运输计划',
|
name: '新增编辑运输计划',
|
||||||
meta: { keepAlive: false },
|
meta: { keepAlive: false },
|
||||||
component: () => import('@/views/business/transport-plan.vue'),
|
component: loadView(() => import('@/views/business/transport-plan.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -259,7 +274,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '导入运输计划',
|
name: '导入运输计划',
|
||||||
meta: { keepAlive: false, activeMenu: '/business/transport-plan' },
|
meta: { keepAlive: false, activeMenu: '/business/transport-plan' },
|
||||||
component: () => import('@/views/business/transport-plan-import.vue'),
|
component: loadView(() => import('@/views/business/transport-plan-import.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -271,7 +286,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '计划调度',
|
name: '计划调度',
|
||||||
meta: { keepAlive: false, activeMenu: '/business/transport-plan' },
|
meta: { keepAlive: false, activeMenu: '/business/transport-plan' },
|
||||||
component: () => import('@/views/business/transport-plan-dispatch.vue'),
|
component: loadView(() => import('@/views/business/transport-plan-dispatch.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -283,7 +298,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '新增编辑运单模板',
|
name: '新增编辑运单模板',
|
||||||
meta: { keepAlive: false },
|
meta: { keepAlive: false },
|
||||||
component: () => import('@/views/business/shipping-template.vue'),
|
component: loadView(() => import('@/views/business/shipping-template.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -295,7 +310,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '新增客商档案',
|
name: '新增客商档案',
|
||||||
meta: { keepAlive: false },
|
meta: { keepAlive: false },
|
||||||
component: () => import('@/views/vehicle/customer-archive.vue'),
|
component: loadView(() => import('@/views/vehicle/customer-archive.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -307,7 +322,7 @@ export default [
|
|||||||
path: '',
|
path: '',
|
||||||
name: '合同变更',
|
name: '合同变更',
|
||||||
meta: { keepAlive: false },
|
meta: { keepAlive: false },
|
||||||
component: () => import('@/views/business/contract-manage-change.vue'),
|
component: loadView(() => import('@/views/business/contract-manage-change.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -323,7 +338,7 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
i18n: 'dashboard',
|
i18n: 'dashboard',
|
||||||
},
|
},
|
||||||
component: () => import(/* webpackChunkName: "views" */ '@/views/wel/index.vue'),
|
component: loadView(() => import(/* webpackChunkName: "views" */ '@/views/wel/index.vue')),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'dashboard',
|
path: 'dashboard',
|
||||||
@@ -332,7 +347,7 @@ export default [
|
|||||||
i18n: 'dashboard',
|
i18n: 'dashboard',
|
||||||
menu: false,
|
menu: false,
|
||||||
},
|
},
|
||||||
component: () => import(/* webpackChunkName: "views" */ '@/views/wel/dashboard.vue'),
|
component: loadView(() => import(/* webpackChunkName: "views" */ '@/views/wel/dashboard.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -347,7 +362,7 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
i18n: 'test',
|
i18n: 'test',
|
||||||
},
|
},
|
||||||
component: () => import(/* webpackChunkName: "views" */ '@/views/util/test.vue'),
|
component: loadView(() => import(/* webpackChunkName: "views" */ '@/views/util/test.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -362,8 +377,9 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
i18n: 'dict',
|
i18n: 'dict',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: loadView(() =>
|
||||||
import(/* webpackChunkName: "views" */ '@/views/util/demo/dict-horizontal.vue'),
|
import(/* webpackChunkName: "views" */ '@/views/util/demo/dict-horizontal.vue')
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -378,8 +394,9 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
i18n: 'dict',
|
i18n: 'dict',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: loadView(() =>
|
||||||
import(/* webpackChunkName: "views" */ '@/views/util/demo/dict-vertical.vue'),
|
import(/* webpackChunkName: "views" */ '@/views/util/demo/dict-vertical.vue')
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -394,7 +411,7 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
i18n: 'info',
|
i18n: 'info',
|
||||||
},
|
},
|
||||||
component: () => import(/* webpackChunkName: "views" */ '@/views/system/userinfo.vue'),
|
component: loadView(() => import(/* webpackChunkName: "views" */ '@/views/system/userinfo.vue')),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -409,8 +426,9 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
i18n: 'work',
|
i18n: 'work',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: loadView(() =>
|
||||||
import(/* webpackChunkName: "views" */ '@/views/work/process/leave/form.vue'),
|
import(/* webpackChunkName: "views" */ '@/views/work/process/leave/form.vue')
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'handle/:taskId/:processInstanceId/:businessId',
|
path: 'handle/:taskId/:processInstanceId/:businessId',
|
||||||
@@ -418,8 +436,9 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
i18n: 'work',
|
i18n: 'work',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: loadView(() =>
|
||||||
import(/* webpackChunkName: "views" */ '@/views/work/process/leave/handle.vue'),
|
import(/* webpackChunkName: "views" */ '@/views/work/process/leave/handle.vue')
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'detail/:processInstanceId/:businessId',
|
path: 'detail/:processInstanceId/:businessId',
|
||||||
@@ -427,8 +446,9 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
i18n: 'work',
|
i18n: 'work',
|
||||||
},
|
},
|
||||||
component: () =>
|
component: loadView(() =>
|
||||||
import(/* webpackChunkName: "views" */ '@/views/work/process/leave/detail.vue'),
|
import(/* webpackChunkName: "views" */ '@/views/work/process/leave/detail.vue')
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3020,6 +3020,10 @@ export default {
|
|||||||
Location,
|
Location,
|
||||||
OfficeBuilding,
|
OfficeBuilding,
|
||||||
Search,
|
Search,
|
||||||
|
// 实例所属路由的路径快照,用于在 watcher / 跳转前判断当前路由是否还是自己的。
|
||||||
|
// 必须放 data:Options API 的顺序是 data → computed → watch(immediate) → created,
|
||||||
|
// 放 created 的话首个 immediate watcher 会读到空值,把首次加载也挡掉。
|
||||||
|
routePathLocked: this.$route.path,
|
||||||
form: {},
|
form: {},
|
||||||
suppressTransportTypeClear: false,
|
suppressTransportTypeClear: false,
|
||||||
query: {},
|
query: {},
|
||||||
@@ -3596,6 +3600,11 @@ export default {
|
|||||||
!this.dialogReadonly
|
!this.dialogReadonly
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
// 当前路由是否仍属于本实例(tab.js 按 fullPath 建实例,一个实例只对应一个 path)。
|
||||||
|
// 实例被 keep-alive 缓存后 $route 已跑到别的页面时,不能用「当前页面的 id」去查本页数据。
|
||||||
|
isOwnedRouteActive() {
|
||||||
|
return this.$route.path === this.routePathLocked;
|
||||||
|
},
|
||||||
billingCargoTypeCascaderProps() {
|
billingCargoTypeCascaderProps() {
|
||||||
return {
|
return {
|
||||||
label: 'cargoName',
|
label: 'cargoName',
|
||||||
@@ -3673,6 +3682,9 @@ export default {
|
|||||||
detailId: {
|
detailId: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(id) {
|
handler(id) {
|
||||||
|
// 宿主 view 传的是全局 $route.query.detailId,必须确认当前路由还是自己的,
|
||||||
|
// 否则跳到别的页面后会把「别人的 id」灌进来触发详情请求。
|
||||||
|
if (!this.isOwnedRouteActive) return;
|
||||||
if (id !== undefined && id !== null && id !== '') {
|
if (id !== undefined && id !== null && id !== '') {
|
||||||
this.$nextTick(() => this.openDetail({ id }));
|
this.$nextTick(() => this.openDetail({ id }));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,13 +199,17 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog v-model="detailVisible" title="导入运单详情" width="90%" append-to-body>
|
<el-dialog v-model="detailVisible" title="导入运单详情" width="90%" append-to-body>
|
||||||
|
<section-card class="waybill-search">
|
||||||
<el-form :inline="true" :model="detailQuery"
|
<el-form :inline="true" :model="detailQuery"
|
||||||
><el-form-item label="车牌号/船号"
|
>
|
||||||
|
<el-form-item label="车牌号/船号"
|
||||||
><el-input v-model="detailQuery.vehicleNo" clearable /></el-form-item
|
><el-input v-model="detailQuery.vehicleNo" clearable /></el-form-item
|
||||||
><el-form-item label="司机/船长姓名"
|
><el-form-item label="司机/船长姓名"
|
||||||
><el-input v-model="detailQuery.driverName" clearable placeholder="请输入" /></el-form-item
|
><el-input v-model="detailQuery.driverName" clearable placeholder="请输入" /></el-form-item
|
||||||
><el-button type="primary" @click="loadDetails">查询</el-button></el-form
|
><el-button type="primary" @click="loadDetails">查询</el-button></el-form
|
||||||
>
|
>
|
||||||
|
</section-card>
|
||||||
|
|
||||||
<el-table :data="details" border
|
<el-table :data="details" border
|
||||||
><el-table-column type="index" label="序号" width="65" /><el-table-column
|
><el-table-column type="index" label="序号" width="65" /><el-table-column
|
||||||
prop="batchNo"
|
prop="batchNo"
|
||||||
@@ -593,6 +597,7 @@ import { getList as getDriverList } from '@/api/transportCapacity/driver';
|
|||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import * as api from '@/api/business/waybill-manage';
|
import * as api from '@/api/business/waybill-manage';
|
||||||
import { downloadXls } from '@/utils/util';
|
import { downloadXls } from '@/utils/util';
|
||||||
|
import SectionCard from '@/components/section-card/main.vue';
|
||||||
|
|
||||||
const props = defineProps({ modelValue: Boolean, standalone: Boolean, createPage: Boolean });
|
const props = defineProps({ modelValue: Boolean, standalone: Boolean, createPage: Boolean });
|
||||||
const emit = defineEmits(['update:modelValue', 'closed']);
|
const emit = defineEmits(['update:modelValue', 'closed']);
|
||||||
@@ -1617,4 +1622,7 @@ const confirmImport = async () => {
|
|||||||
:global(.avue-layout--horizontal .waybill-import-create__footer) {
|
:global(.avue-layout--horizontal .waybill-import-create__footer) {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
.waybill-search .el-form-item{
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,21 +3,21 @@
|
|||||||
:class="[
|
:class="[
|
||||||
'waybill-manage-page',
|
'waybill-manage-page',
|
||||||
{
|
{
|
||||||
'waybill-manage-page--form-page': isStandaloneWaybillFormPage,
|
'waybill-manage-page--form-page': formPageLocked,
|
||||||
'waybill-manage-page--detail-page': isStandaloneWaybillDetailPage,
|
'waybill-manage-page--detail-page': detailPageLocked,
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
v-if="!isStandaloneWaybillDetailPage"
|
v-if="!detailPageLocked"
|
||||||
:is="crudContainer"
|
:is="crudContainer"
|
||||||
:option="pageFormOption"
|
:option="pageFormOption"
|
||||||
:form-page-title="isStandaloneWaybillFormPage ? formPageTitle : undefined"
|
:form-page-title="formPageLocked ? formPageTitle : undefined"
|
||||||
:table-loading="loading"
|
:table-loading="loading"
|
||||||
:data="data"
|
:data="data"
|
||||||
v-model:page="page"
|
v-model:page="page"
|
||||||
v-model="form"
|
v-model="form"
|
||||||
:status="isStandaloneWaybillFormPage ? dialogReadonly : undefined"
|
:status="formPageLocked ? dialogReadonly : undefined"
|
||||||
ref="crud"
|
ref="crud"
|
||||||
:permission="permissionList"
|
:permission="permissionList"
|
||||||
:before-open="beforeOpen"
|
:before-open="beforeOpen"
|
||||||
@@ -1546,7 +1546,7 @@
|
|||||||
</el-link>
|
</el-link>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="isStandaloneWaybillFormPage"
|
v-if="formPageLocked"
|
||||||
class="waybill-manage-page__standalone-menu-actions"
|
class="waybill-manage-page__standalone-menu-actions"
|
||||||
>
|
>
|
||||||
<el-button class="waybill-manage-page__form-close" @click="closeCrudDialog">
|
<el-button class="waybill-manage-page__form-close" @click="closeCrudDialog">
|
||||||
@@ -1747,7 +1747,7 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<empty-pagination
|
<empty-pagination
|
||||||
v-show="!isStandaloneWaybillFormPage && !isStandaloneWaybillDetailPage"
|
v-show="!formPageLocked && !detailPageLocked"
|
||||||
:page="page"
|
:page="page"
|
||||||
@size-change="sizeChange"
|
@size-change="sizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
@@ -1758,18 +1758,18 @@
|
|||||||
:is="detailContainer"
|
:is="detailContainer"
|
||||||
v-model="detailBox"
|
v-model="detailBox"
|
||||||
:title="`${config.title}详情`"
|
:title="`${config.title}详情`"
|
||||||
:append-to-body="!isStandaloneWaybillDetailPage"
|
:append-to-body="!detailPageLocked"
|
||||||
top="10px"
|
top="10px"
|
||||||
width="96%"
|
width="96%"
|
||||||
show-close
|
show-close
|
||||||
:class="[
|
:class="[
|
||||||
'waybill-manage-page__detail-dialog',
|
'waybill-manage-page__detail-dialog',
|
||||||
{ 'waybill-manage-page__detail-page': isStandaloneWaybillDetailPage },
|
{ 'waybill-manage-page__detail-page': detailPageLocked },
|
||||||
$attrs.option?.dialogCustomClass,
|
$attrs.option?.dialogCustomClass,
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<div v-loading="detailLoading" class="waybill-manage-page__detail-content">
|
<div v-loading="detailLoading" class="waybill-manage-page__detail-content">
|
||||||
<template v-if="detailBox || isStandaloneWaybillDetailPage">
|
<template v-if="detailBox || detailPageLocked">
|
||||||
<section-card class="waybill-manage-page__waybill-detail-summary">
|
<section-card class="waybill-manage-page__waybill-detail-summary">
|
||||||
<div class="waybill-manage-page__waybill-heading">
|
<div class="waybill-manage-page__waybill-heading">
|
||||||
<strong>运单详情</strong>
|
<strong>运单详情</strong>
|
||||||
@@ -1923,6 +1923,12 @@
|
|||||||
}}</strong
|
}}</strong
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="!waybillIsCarrier(detailRow)"
|
||||||
|
class="waybill-manage-page__waybill-detail-field"
|
||||||
|
>
|
||||||
|
<span>里程(km)</span><strong>{{ detailRow.mileage || '-' }}</strong>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="waybillIsNonRoadTransport(detailRow)">
|
<template v-else-if="waybillIsNonRoadTransport(detailRow)">
|
||||||
<div class="waybill-manage-page__waybill-detail-field">
|
<div class="waybill-manage-page__waybill-detail-field">
|
||||||
@@ -2029,8 +2035,8 @@
|
|||||||
<div v-loading="waybillPunchRecordsLoading">
|
<div v-loading="waybillPunchRecordsLoading">
|
||||||
<el-timeline v-if="waybillPunchRecords.length">
|
<el-timeline v-if="waybillPunchRecords.length">
|
||||||
<el-timeline-item
|
<el-timeline-item
|
||||||
v-for="(record, index) in waybillPunchRecords"
|
v-for="(record, index) in orderedWaybillPunchRecords"
|
||||||
:key="record.nodeCode || record.id || index"
|
:key="`${record.nodeCode || record.id || 'punch'}-${index}`"
|
||||||
:timestamp="record.punchTime || record.statusName || '未打卡'"
|
:timestamp="record.punchTime || record.statusName || '未打卡'"
|
||||||
:type="record.punched ? 'primary' : 'info'"
|
:type="record.punched ? 'primary' : 'info'"
|
||||||
:color="record.punched ? '#2b6ce8' : '#c0c4cc'"
|
:color="record.punched ? '#2b6ce8' : '#c0c4cc'"
|
||||||
@@ -2217,10 +2223,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isStandaloneWaybillDetailPage" class="waybill-manage-page__detail-footer">
|
<div v-if="detailPageLocked" class="waybill-manage-page__detail-footer">
|
||||||
<el-button type="primary" @click="closeDetail">关闭</el-button>
|
<el-button type="primary" @click="closeDetail">关闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="!isStandaloneWaybillDetailPage" #footer>
|
<template v-if="!detailPageLocked" #footer>
|
||||||
<el-button type="primary" @click="closeDetail">关闭</el-button>
|
<el-button type="primary" @click="closeDetail">关闭</el-button>
|
||||||
</template>
|
</template>
|
||||||
</component>
|
</component>
|
||||||
@@ -3512,9 +3518,26 @@ export default {
|
|||||||
selectionList: [],
|
selectionList: [],
|
||||||
attachmentUploadMode: false,
|
attachmentUploadMode: false,
|
||||||
standaloneFormKey: '',
|
standaloneFormKey: '',
|
||||||
|
// 实例所属路由的路径快照:用于判断当前 $route 是否还是「本实例自己的路由」。
|
||||||
|
// 必须在 data 里初始化,不能放 created —— Vue 的 Options API 执行顺序是
|
||||||
|
// data → computed → watch(immediate) → created,放 created 会被首个
|
||||||
|
// immediate watcher 读到空值,把本该执行的首次加载也挡掉。
|
||||||
|
routePathLocked: this.$route.path,
|
||||||
|
// 页面形态(列表 / 独立表单页 / 独立详情页)在实例创建时锁定一次,之后不再随 $route 变化。
|
||||||
|
// 原因:标签页 keep-alive 只会让实例 deactivate,实例仍会随 $route(全局响应式)重新渲染;
|
||||||
|
// 若形态跟着路由翻回列表/弹窗态,缓存实例会渲染出 append-to-body 的 el-dialog —— 弹窗被
|
||||||
|
// Teleport 到 body 后,KeepAlive.deactivate 的 move 搬不动它,DOM 会永久残留在页面上,
|
||||||
|
// 表现为“从运单详情/独立表单离开后点其它菜单,详情弹窗又冒出来”。
|
||||||
|
formPageLocked: false,
|
||||||
|
detailPageLocked: false,
|
||||||
|
// 同上:表单模式(add / edit)也一次性锁定,避免缓存实例随 $route 变 query 导致 option 变形
|
||||||
|
formModeLocked: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.formPageLocked = this.isStandaloneWaybillFormPage;
|
||||||
|
this.detailPageLocked = this.isStandaloneWaybillDetailPage;
|
||||||
|
this.formModeLocked = this.$route.query.mode || '';
|
||||||
if (this.config.enableAllDept && this.isAdmin) {
|
if (this.config.enableAllDept && this.isAdmin) {
|
||||||
this.allDept = 1;
|
this.allDept = 1;
|
||||||
}
|
}
|
||||||
@@ -3538,6 +3561,14 @@ export default {
|
|||||||
this.consumeTemplateCreatePayload();
|
this.consumeTemplateCreatePayload();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 标签切走(实例被 keep-alive 缓存)或销毁时,收起本页所有 append-to-body 的弹窗。
|
||||||
|
// 否则 Teleport 出去的弹窗 DOM 会一直留在 body 上,盖住后续打开的页面。
|
||||||
|
deactivated() {
|
||||||
|
this.closeInnerDialogs();
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
this.closeInnerDialogs();
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['permission', 'userInfo']),
|
...mapGetters(['permission', 'userInfo']),
|
||||||
permissionList() {
|
permissionList() {
|
||||||
@@ -3545,6 +3576,25 @@ export default {
|
|||||||
addBtn: this.canCreate,
|
addBtn: this.canCreate,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
// 打卡时间轴按打卡时间先后展示:已打卡记录按打卡时间升序在前,
|
||||||
|
// 未打卡记录保持流程节点原顺序排在其后。
|
||||||
|
orderedWaybillPunchRecords() {
|
||||||
|
const records = Array.isArray(this.waybillPunchRecords) ? this.waybillPunchRecords : [];
|
||||||
|
return records
|
||||||
|
.map((record, index) => ({
|
||||||
|
record,
|
||||||
|
index,
|
||||||
|
punchedAt: this.waybillPunchRecordTimestamp(record),
|
||||||
|
}))
|
||||||
|
.sort((a, b) => {
|
||||||
|
const aPunched = a.punchedAt !== null;
|
||||||
|
const bPunched = b.punchedAt !== null;
|
||||||
|
if (aPunched && bPunched) return a.punchedAt - b.punchedAt || a.index - b.index;
|
||||||
|
if (aPunched !== bPunched) return aPunched ? -1 : 1;
|
||||||
|
return a.index - b.index;
|
||||||
|
})
|
||||||
|
.map(item => item.record);
|
||||||
|
},
|
||||||
isStandaloneWaybillPage() {
|
isStandaloneWaybillPage() {
|
||||||
return this.standaloneFormPage && standaloneWaybillFormPaths.includes(this.$route.path);
|
return this.standaloneFormPage && standaloneWaybillFormPaths.includes(this.$route.path);
|
||||||
},
|
},
|
||||||
@@ -3554,8 +3604,15 @@ export default {
|
|||||||
isStandaloneWaybillDetailPage() {
|
isStandaloneWaybillDetailPage() {
|
||||||
return this.standaloneDetailPage && this.$route.path === standaloneWaybillDetailRoute;
|
return this.standaloneDetailPage && this.$route.path === standaloneWaybillDetailRoute;
|
||||||
},
|
},
|
||||||
|
// 容器形态读实例创建时锁定的标志,不随 $route 翻转(详见 data 中 formPageLocked 的说明)
|
||||||
|
// 当前路由是否仍属于本实例(tab.js 按 fullPath 建实例,一个实例只对应一个 path)。
|
||||||
|
// 被 keep-alive 缓存后如果 $route 已经跑到别的页面上,就不该再用「当前页面的 id」
|
||||||
|
// 去触发本实例的请求或跳转,否则会拿别的单据 id 查自己的接口。
|
||||||
|
isOwnedRouteActive() {
|
||||||
|
return this.$route.path === this.routePathLocked;
|
||||||
|
},
|
||||||
detailContainer() {
|
detailContainer() {
|
||||||
return this.isStandaloneWaybillDetailPage ? 'PageDetail' : 'el-dialog';
|
return this.detailPageLocked ? 'PageDetail' : 'el-dialog';
|
||||||
},
|
},
|
||||||
formPageTitle() {
|
formPageTitle() {
|
||||||
if (this.isStandaloneWaybillFormPage) {
|
if (this.isStandaloneWaybillFormPage) {
|
||||||
@@ -3567,13 +3624,13 @@ export default {
|
|||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
crudContainer() {
|
crudContainer() {
|
||||||
return this.isStandaloneWaybillFormPage ? 'PageAvueForm' : 'avue-crud';
|
return this.formPageLocked ? 'PageAvueForm' : 'avue-crud';
|
||||||
},
|
},
|
||||||
pageFormOption() {
|
pageFormOption() {
|
||||||
if (!this.isStandaloneWaybillFormPage) return this.option;
|
if (!this.formPageLocked) return this.option;
|
||||||
const base = {
|
const base = {
|
||||||
...this.option,
|
...this.option,
|
||||||
boxType: this.$route.query.mode === 'edit' ? 'edit' : 'add',
|
boxType: this.formModeLocked === 'edit' ? 'edit' : 'add',
|
||||||
menuBtn: true,
|
menuBtn: true,
|
||||||
submitBtn: true,
|
submitBtn: true,
|
||||||
emptyBtn: false,
|
emptyBtn: false,
|
||||||
@@ -3821,6 +3878,10 @@ export default {
|
|||||||
detailId: {
|
detailId: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(id) {
|
handler(id) {
|
||||||
|
// 宿主 view 传的是全局 $route.query.id / detailId,实例被缓存后仍会被重渲染,
|
||||||
|
// 必须确认当前路由还是自己的:否则跳到别的详情页时会把「别的单据 id」灌进来,
|
||||||
|
// 触发 openDetail 用错 id 查运单 → 报「运单管理不存在」。
|
||||||
|
if (!this.isOwnedRouteActive) return;
|
||||||
if (id !== undefined && id !== null && id !== '') {
|
if (id !== undefined && id !== null && id !== '') {
|
||||||
this.$nextTick(() => this.openDetail({ id }));
|
this.$nextTick(() => this.openDetail({ id }));
|
||||||
}
|
}
|
||||||
@@ -3837,6 +3898,25 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 页面被 keep-alive 缓存/卸载时调用,关闭本页所有 append-to-body 的弹窗,
|
||||||
|
// 避免 Teleport 出去的 DOM 残留在 body 上盖住后续页面(详见 data 里的说明)。
|
||||||
|
closeInnerDialogs() {
|
||||||
|
this.detailBox = false;
|
||||||
|
this.mileageDialog.visible = false;
|
||||||
|
this.attachmentDocumentPreviewVisible = false;
|
||||||
|
this.attachmentImagePreviewVisible = false;
|
||||||
|
this.waybillRouteChangeBox = false;
|
||||||
|
this.waybillCommonAddressBox = false;
|
||||||
|
this.flowBox = false;
|
||||||
|
this.transportRouteBox = false;
|
||||||
|
this.transportAddressBox = false;
|
||||||
|
this.transportStationBox = false;
|
||||||
|
this.transportMapBox = false;
|
||||||
|
this.commonCargoBox = false;
|
||||||
|
this.cargoImportBox = false;
|
||||||
|
this.waybillProcessConfigBox = false;
|
||||||
|
this.excelBox = false;
|
||||||
|
},
|
||||||
initStandaloneFormPage() {
|
initStandaloneFormPage() {
|
||||||
if (!this.isStandaloneWaybillFormPage) return;
|
if (!this.isStandaloneWaybillFormPage) return;
|
||||||
const mode = this.$route.query.mode === 'edit' ? 'edit' : 'add';
|
const mode = this.$route.query.mode === 'edit' ? 'edit' : 'add';
|
||||||
@@ -4384,6 +4464,9 @@ export default {
|
|||||||
},
|
},
|
||||||
openDetail(row) {
|
openDetail(row) {
|
||||||
if (!this.isStandaloneWaybillDetailPage) {
|
if (!this.isStandaloneWaybillDetailPage) {
|
||||||
|
// 已不在自己的路由上(被缓存后路由切走):此时 row.id 极可能是别的单据的 id,
|
||||||
|
// 再 push 会生成一堆错误的「运单管理详情」标签
|
||||||
|
if (!this.isOwnedRouteActive) return;
|
||||||
this.$router.push({ path: standaloneWaybillDetailRoute, query: { id: row.id } });
|
this.$router.push({ path: standaloneWaybillDetailRoute, query: { id: row.id } });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -4463,7 +4546,10 @@ export default {
|
|||||||
this.$message.info('当前配载单暂无详情数据');
|
this.$message.info('当前配载单暂无详情数据');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$router.push({ path: '/business/loading-manage', query: { detailId: id } });
|
this.$router.push({
|
||||||
|
path: '/business/loading-manage/detail',
|
||||||
|
query: { id, name: '配载单详情' },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
loadWaybillDetailProcessNodes(projectId) {
|
loadWaybillDetailProcessNodes(projectId) {
|
||||||
this.waybillDetailProcessNodes = [];
|
this.waybillDetailProcessNodes = [];
|
||||||
@@ -4492,6 +4578,19 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(() => []);
|
.catch(() => []);
|
||||||
},
|
},
|
||||||
|
// 解析打卡时间(支持常见日期字符串格式),未打卡或无有效时间返回 null
|
||||||
|
waybillPunchRecordTimestamp(record = {}) {
|
||||||
|
if (record.punched === false || record.statusName === '未打卡') return null;
|
||||||
|
const raw = record.punchTime || record.punchAt || record.punchDateTime || '';
|
||||||
|
const text = String(raw).trim();
|
||||||
|
if (!text) return null;
|
||||||
|
const parsed = this.$dayjs ? this.$dayjs(text) : null;
|
||||||
|
if (parsed && typeof parsed.isValid === 'function' && parsed.isValid()) {
|
||||||
|
return parsed.valueOf();
|
||||||
|
}
|
||||||
|
const fallback = new Date(text.replace(/-/g, '/')).getTime();
|
||||||
|
return Number.isNaN(fallback) ? null : fallback;
|
||||||
|
},
|
||||||
loadWaybillPunchRecords() {
|
loadWaybillPunchRecords() {
|
||||||
const waybillId = this.detailRow?.id;
|
const waybillId = this.detailRow?.id;
|
||||||
if (!waybillId || this.waybillPunchRecordsLoading) return;
|
if (!waybillId || this.waybillPunchRecordsLoading) return;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<basic-container class="loading-manage-page">
|
<basic-container class="loading-manage-page">
|
||||||
<div v-if="!isStandaloneFormPage" class="loading-manage-page__search">
|
<div v-if="!isStandalonePage" class="loading-manage-page__search">
|
||||||
<el-form :model="searchForm" label-position="right" label-width="88px">
|
<el-form :model="searchForm" label-position="right" label-width="88px">
|
||||||
<div class="loading-manage-page__search-grid">
|
<div class="loading-manage-page__search-grid">
|
||||||
<el-form-item label="配载单号">
|
<el-form-item label="配载单号">
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!isStandaloneFormPage" class="loading-manage-page__toolbar">
|
<div v-if="!isStandalonePage" class="loading-manage-page__toolbar">
|
||||||
<div class="loading-manage-page__toolbar-left">
|
<div class="loading-manage-page__toolbar-left">
|
||||||
<el-button type="primary" @click="openLoadingDialog('add')">新建配载</el-button>
|
<el-button type="primary" @click="openLoadingDialog('add')">新建配载</el-button>
|
||||||
<el-button type="primary" plain @click="handleExport">批量导出</el-button>
|
<el-button type="primary" plain @click="handleExport">批量导出</el-button>
|
||||||
@@ -242,7 +242,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-if="!isStandaloneFormPage"
|
v-if="!isStandalonePage"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
@@ -259,7 +259,7 @@
|
|||||||
<el-link
|
<el-link
|
||||||
type="primary"
|
type="primary"
|
||||||
class="loading-manage-page__link"
|
class="loading-manage-page__link"
|
||||||
@click="openLoadingDialog('view', row)"
|
@click="gotoLoadingDetail(row)"
|
||||||
>{{ row.loadingNo }}</el-link
|
>{{ row.loadingNo }}</el-link
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
@@ -363,7 +363,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div v-if="!isStandaloneFormPage" class="loading-manage-page__pagination">
|
<div v-if="!isStandalonePage" class="loading-manage-page__pagination">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
v-model:current-page="page.currentPage"
|
v-model:current-page="page.currentPage"
|
||||||
v-model:page-size="page.pageSize"
|
v-model:page-size="page.pageSize"
|
||||||
@@ -376,27 +376,19 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<component
|
<!--
|
||||||
:is="isStandaloneFormPage ? 'div' : 'el-dialog'"
|
配载单的新增/编辑/重新派单/详情全部是独立整页,这里固定渲染普通容器,不再按路由切换 el-dialog。
|
||||||
:model-value="isStandaloneFormPage ? undefined : dialogVisible"
|
原因:标签页 keep-alive 会把本页实例缓存下来,若容器随 $route 由 div 变回 el-dialog,
|
||||||
:title="isStandaloneFormPage ? undefined : dialogTitle"
|
被缓存的实例会在离开本页后渲染出 append-to-body 的弹窗并永久停留在 body 上(Vue 的
|
||||||
:append-to-body="isStandaloneFormPage ? undefined : true"
|
KeepAlive.deactivate → Teleport.move 不会搬走 append-to-body 的弹窗 DOM),表现为“点左侧菜单又弹出弹窗”。
|
||||||
:destroy-on-close="isStandaloneFormPage ? undefined : true"
|
-->
|
||||||
:width="isStandaloneFormPage ? undefined : '96%'"
|
<div
|
||||||
:top="isStandaloneFormPage ? undefined : '3vh'"
|
v-if="isStandalonePage"
|
||||||
:class="[
|
class="loading-manage-dialog loading-manage-form-dialog loading-manage-form-page"
|
||||||
'loading-manage-dialog',
|
|
||||||
{ 'loading-manage-form-dialog': isStandaloneFormPage },
|
|
||||||
{ 'loading-manage-form-page': isStandaloneFormPage },
|
|
||||||
]"
|
|
||||||
:modal="isStandaloneFormPage ? undefined : true"
|
|
||||||
:show-close="isStandaloneFormPage ? undefined : true"
|
|
||||||
:close-on-click-modal="isStandaloneFormPage ? undefined : true"
|
|
||||||
:close-on-press-escape="isStandaloneFormPage ? undefined : true"
|
|
||||||
@update:model-value="value => !isStandaloneFormPage && (dialogVisible = value)"
|
|
||||||
@closed="resetLoadingDialog"
|
|
||||||
>
|
>
|
||||||
<div v-if="isStandaloneFormPage" class="archive-page-form__title">{{ formPageTitle }}</div>
|
<div class="archive-page-form__title">{{
|
||||||
|
isStandaloneDetailPage ? detailPageTitle : formPageTitle
|
||||||
|
}}</div>
|
||||||
<div v-loading="dialogLoading" class="loading-manage-dialog__body">
|
<div v-loading="dialogLoading" class="loading-manage-dialog__body">
|
||||||
<div v-if="dialogReadonly" class="loading-detail">
|
<div v-if="dialogReadonly" class="loading-detail">
|
||||||
<section-card title="配载单详情">
|
<section-card title="配载单详情">
|
||||||
@@ -1229,27 +1221,12 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="isStandaloneFormPage" class="loading-manage-dialog__footer">
|
|
||||||
<template v-if="dialogReadonly">
|
|
||||||
<el-button @click="closeLoadingDialog">关闭</el-button>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<el-button @click="closeLoadingDialog">关闭</el-button>
|
|
||||||
<el-button type="primary" plain :loading="dialogSaving === 'draft'" @click="saveDraft">
|
|
||||||
暂存
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" :loading="dialogSaving === 'submit'" @click="submitLoading">
|
|
||||||
{{ dialogMode === 'reassign' ? '确认派单' : '确认' }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<template v-if="!isStandaloneFormPage" #footer>
|
|
||||||
<div class="loading-manage-dialog__footer">
|
<div class="loading-manage-dialog__footer">
|
||||||
<template v-if="dialogReadonly">
|
<template v-if="dialogReadonly">
|
||||||
<el-button @click="closeLoadingDialog">关闭</el-button>
|
<el-button @click="closeLoadingDialog">关闭</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-button @click="clearLoadingDialog">清空</el-button>
|
<el-button @click="closeLoadingDialog">关闭</el-button>
|
||||||
<el-button type="primary" plain :loading="dialogSaving === 'draft'" @click="saveDraft">
|
<el-button type="primary" plain :loading="dialogSaving === 'draft'" @click="saveDraft">
|
||||||
暂存
|
暂存
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -1258,8 +1235,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</div>
|
||||||
</component>
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="routeChangeVisible"
|
v-model="routeChangeVisible"
|
||||||
title="变更运输路线"
|
title="变更运输路线"
|
||||||
@@ -1268,7 +1244,7 @@
|
|||||||
width="78%"
|
width="78%"
|
||||||
class="loading-route-change-dialog"
|
class="loading-route-change-dialog"
|
||||||
>
|
>
|
||||||
<el-tabs v-model="routeChangeTab">
|
<el-tabs type="border-card" v-model="routeChangeTab">
|
||||||
<el-tab-pane label="变更路线" name="change">
|
<el-tab-pane label="变更路线" name="change">
|
||||||
<section-card title="关联子运单地址">
|
<section-card title="关联子运单地址">
|
||||||
<el-table :data="routeChangeRows" border>
|
<el-table :data="routeChangeRows" border>
|
||||||
@@ -1634,7 +1610,6 @@ export default {
|
|||||||
searchExpanded: false,
|
searchExpanded: false,
|
||||||
searchForm: createSearchForm(),
|
searchForm: createSearchForm(),
|
||||||
selectionRows: [],
|
selectionRows: [],
|
||||||
dialogVisible: false,
|
|
||||||
dialogMode: 'add',
|
dialogMode: 'add',
|
||||||
dialogLoading: false,
|
dialogLoading: false,
|
||||||
dialogSaving: '',
|
dialogSaving: '',
|
||||||
@@ -1704,15 +1679,6 @@ export default {
|
|||||||
if (!this.taskCarrierLoading && !this.taskCarrierOptions.length) return '暂无可用承运商合同';
|
if (!this.taskCarrierLoading && !this.taskCarrierOptions.length) return '暂无可用承运商合同';
|
||||||
return '请选择';
|
return '请选择';
|
||||||
},
|
},
|
||||||
dialogTitle() {
|
|
||||||
const titleMap = {
|
|
||||||
add: '新建配载',
|
|
||||||
edit: '编辑配载单',
|
|
||||||
view: '配载单详情',
|
|
||||||
reassign: '重新派单',
|
|
||||||
};
|
|
||||||
return titleMap[this.dialogMode] || '配载管理';
|
|
||||||
},
|
|
||||||
detailStatusType() {
|
detailStatusType() {
|
||||||
const typeMap = {
|
const typeMap = {
|
||||||
pending: 'success',
|
pending: 'success',
|
||||||
@@ -1741,32 +1707,65 @@ export default {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
// 独立表单页:/business/loading-manage/form?mode=add|edit|reassign
|
||||||
isStandaloneFormPage() {
|
isStandaloneFormPage() {
|
||||||
return (
|
return (
|
||||||
this.$route.path === '/business/loading-manage/form' &&
|
this.$route.path === '/business/loading-manage/form' &&
|
||||||
['add', 'edit'].includes(this.$route.query.mode)
|
['add', 'edit', 'reassign'].includes(this.$route.query.mode)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
// 独立详情页:/business/loading-manage/detail?id=xxx
|
||||||
|
isStandaloneDetailPage() {
|
||||||
|
return this.$route.path === '/business/loading-manage/detail';
|
||||||
|
},
|
||||||
|
// 列表容器隐藏搜索栏 / 工具栏 / 表格 / 分页的统一开关
|
||||||
|
isStandalonePage() {
|
||||||
|
return this.isStandaloneFormPage || this.isStandaloneDetailPage;
|
||||||
|
},
|
||||||
|
formPageDefaultTitle() {
|
||||||
|
const titleMap = {
|
||||||
|
add: '新增配载管理',
|
||||||
|
edit: '编辑配载管理',
|
||||||
|
reassign: '重新派单',
|
||||||
|
};
|
||||||
|
return titleMap[this.$route.query.mode] || '新增配载管理';
|
||||||
|
},
|
||||||
formPageTitle() {
|
formPageTitle() {
|
||||||
return (
|
return this.$route.query.name || this.formPageDefaultTitle;
|
||||||
this.$route.query.name || `${this.$route.query.mode === 'edit' ? '编辑' : '新增'}配载管理`
|
},
|
||||||
);
|
detailPageTitle() {
|
||||||
|
return this.$route.query.name || '配载单详情';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadTransportTypeOptions();
|
this.loadTransportTypeOptions();
|
||||||
this.loadTable();
|
this.loadTable();
|
||||||
if (this.isStandaloneFormPage) {
|
if (this.isStandalonePage) {
|
||||||
this.syncStandaloneTagTitle();
|
this.syncStandaloneTagTitle();
|
||||||
this.initStandaloneFormPage();
|
if (this.isStandaloneDetailPage) this.initStandaloneDetailPage();
|
||||||
|
else this.initStandaloneFormPage();
|
||||||
}
|
}
|
||||||
|
// 兼容旧链接:/business/loading-manage?detailId=xxx 直接跳独立详情页
|
||||||
const detailId = this.$route.query.detailId;
|
const detailId = this.$route.query.detailId;
|
||||||
if (detailId) this.openLoadingDialog('view', { id: detailId });
|
if (detailId) this.gotoLoadingDetail({ id: detailId });
|
||||||
|
},
|
||||||
|
// 标签切走(实例被 keep-alive 缓存)或销毁时,先收起页内子弹窗
|
||||||
|
deactivated() {
|
||||||
|
this.closeInnerDialogs();
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
this.closeInnerDialogs();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route(to, from) {
|
$route(to, from) {
|
||||||
if (this.isStandaloneFormPage) {
|
if (!this.isStandalonePage) return;
|
||||||
this.syncStandaloneTagTitle();
|
this.syncStandaloneTagTitle();
|
||||||
|
if (this.isStandaloneDetailPage) {
|
||||||
|
// 记录变化或上一个页面不是详情态(例如从表单页/列表页进来)时重新拉取详情
|
||||||
|
const idChanged = String(to.query.id || '') !== String(from?.query?.id || '');
|
||||||
|
if (idChanged || this.dialogMode !== 'view') this.initStandaloneDetailPage();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
to.query.mode !== from?.query?.mode ||
|
to.query.mode !== from?.query?.mode ||
|
||||||
String(to.query.id || '') !== String(from?.query.id || '') ||
|
String(to.query.id || '') !== String(from?.query.id || '') ||
|
||||||
@@ -1774,18 +1773,15 @@ export default {
|
|||||||
) {
|
) {
|
||||||
this.initStandaloneFormPage();
|
this.initStandaloneFormPage();
|
||||||
}
|
}
|
||||||
} else if (from?.query?.mode && this.dialogVisible) {
|
|
||||||
this.closeLoadingDialog();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
'$route.query.detailId'(detailId) {
|
'$route.query.detailId'(detailId) {
|
||||||
if (detailId) this.openLoadingDialog('view', { id: detailId });
|
if (detailId) this.gotoLoadingDetail({ id: detailId });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
syncStandaloneTagTitle() {
|
syncStandaloneTagTitle() {
|
||||||
if (!this.isStandaloneFormPage) return;
|
if (!this.isStandalonePage) return;
|
||||||
const title = this.$route.query.mode === 'edit' ? '编辑配载管理' : '新增配载管理';
|
const title = this.isStandaloneDetailPage ? this.detailPageTitle : this.formPageDefaultTitle;
|
||||||
if (this.$route.query.name === title) return;
|
if (this.$route.query.name === title) return;
|
||||||
this.$store.commit('SET_TAG', {
|
this.$store.commit('SET_TAG', {
|
||||||
fullPath: this.$route.fullPath,
|
fullPath: this.$route.fullPath,
|
||||||
@@ -2189,9 +2185,9 @@ export default {
|
|||||||
},
|
},
|
||||||
handleRowAction(type, row) {
|
handleRowAction(type, row) {
|
||||||
const actionMap = {
|
const actionMap = {
|
||||||
view: () => this.openLoadingDialog('view', row),
|
view: () => this.gotoLoadingDetail(row),
|
||||||
edit: () => this.openLoadingDialog('edit', row),
|
edit: () => this.openLoadingDialog('edit', row),
|
||||||
reassign: () => this.openLoadingDialog('reassign', row),
|
reassign: () => this.gotoLoadingReassign(row),
|
||||||
delete: () => this.deleteLoading(row),
|
delete: () => this.deleteLoading(row),
|
||||||
start: () => this.startLoading(row),
|
start: () => this.startLoading(row),
|
||||||
cancel: () => this.cancelLoading(row),
|
cancel: () => this.cancelLoading(row),
|
||||||
@@ -2199,9 +2195,44 @@ export default {
|
|||||||
};
|
};
|
||||||
actionMap[type]?.();
|
actionMap[type]?.();
|
||||||
},
|
},
|
||||||
|
// 详情改为独立页面(与新增/编辑一致)
|
||||||
|
gotoLoadingDetail(row = {}) {
|
||||||
|
const id = row.id || row.loadingId || row.loadingManageId;
|
||||||
|
if (!id) {
|
||||||
|
ElMessage.info('当前配载单暂无详情数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.isStandaloneDetailPage && String(this.$route.query.id || '') === String(id)) return;
|
||||||
|
this.$router.push({
|
||||||
|
path: '/business/loading-manage/detail',
|
||||||
|
query: { id, name: '配载单详情' },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 重新派单改为独立页面
|
||||||
|
gotoLoadingReassign(row = {}) {
|
||||||
|
if (!row.id) {
|
||||||
|
ElMessage.warning('配载单不存在,无法重新派单');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$router.push({
|
||||||
|
path: '/business/loading-manage/form',
|
||||||
|
query: { mode: 'reassign', id: row.id, name: '重新派单' },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async initStandaloneDetailPage() {
|
||||||
|
if (!this.isStandaloneDetailPage) return;
|
||||||
|
const id = this.$route.query.id;
|
||||||
|
if (!id) {
|
||||||
|
ElMessage.warning('缺少配载单参数,无法查看详情');
|
||||||
|
this.closeLoadingDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await this.openLoadingDialog('view', { id });
|
||||||
|
},
|
||||||
async initStandaloneFormPage() {
|
async initStandaloneFormPage() {
|
||||||
if (!this.isStandaloneFormPage) return;
|
if (!this.isStandaloneFormPage) return;
|
||||||
const mode = this.$route.query.mode === 'edit' ? 'edit' : 'add';
|
const queryMode = this.$route.query.mode;
|
||||||
|
const mode = ['edit', 'reassign'].includes(queryMode) ? queryMode : 'add';
|
||||||
const copyId = mode === 'add' ? this.$route.query.copyId : '';
|
const copyId = mode === 'add' ? this.$route.query.copyId : '';
|
||||||
await this.openLoadingDialog(mode, {
|
await this.openLoadingDialog(mode, {
|
||||||
id: copyId || this.$route.query.id,
|
id: copyId || this.$route.query.id,
|
||||||
@@ -2222,7 +2253,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async openLoadingDialog(mode, row) {
|
async openLoadingDialog(mode, row) {
|
||||||
if (['add', 'edit'].includes(mode) && !this.isStandaloneFormPage) {
|
// 列表页进入新增/编辑/重新派单:统一走独立页面
|
||||||
|
if (['add', 'edit', 'reassign'].includes(mode) && !this.isStandaloneFormPage) {
|
||||||
|
if (mode === 'reassign') {
|
||||||
|
this.gotoLoadingReassign(row || {});
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/business/loading-manage/form',
|
path: '/business/loading-manage/form',
|
||||||
query: {
|
query: {
|
||||||
@@ -2234,7 +2270,6 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.dialogMode = mode;
|
this.dialogMode = mode;
|
||||||
this.dialogVisible = true;
|
|
||||||
this.dialogLoading = true;
|
this.dialogLoading = true;
|
||||||
this.resetDialogData();
|
this.resetDialogData();
|
||||||
if (mode === 'add') this.candidateQuery.transportType = 'road';
|
if (mode === 'add') this.candidateQuery.transportType = 'road';
|
||||||
@@ -2267,17 +2302,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
closeLoadingDialog() {
|
closeLoadingDialog() {
|
||||||
if (this.isStandaloneFormPage) {
|
if (!this.isStandalonePage) return;
|
||||||
this.$router.$avueRouter?.closeTag?.();
|
this.$router.$avueRouter?.closeTag?.();
|
||||||
this.$router.push({ path: '/business/loading-manage', query: {} });
|
this.$router.push({ path: '/business/loading-manage', query: {} });
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.dialogVisible = false;
|
|
||||||
},
|
|
||||||
resetLoadingDialog() {
|
|
||||||
this.resetDialogData();
|
|
||||||
this.dialogSaving = '';
|
|
||||||
this.dialogLoading = false;
|
|
||||||
},
|
},
|
||||||
resetDialogData() {
|
resetDialogData() {
|
||||||
this.detailAmap?.destroy?.();
|
this.detailAmap?.destroy?.();
|
||||||
@@ -2299,10 +2326,11 @@ export default {
|
|||||||
this.processProjectId = '';
|
this.processProjectId = '';
|
||||||
this.processProjectOptions = [];
|
this.processProjectOptions = [];
|
||||||
},
|
},
|
||||||
clearLoadingDialog() {
|
// 离开本页(标签缓存/卸载)时收起页内子弹窗,避免 append-to-body 的弹窗 DOM 残留在 body 上
|
||||||
this.resetDialogData();
|
closeInnerDialogs() {
|
||||||
if (this.dialogMode === 'add') this.candidateQuery.transportType = 'road';
|
this.routeChangeVisible = false;
|
||||||
this.loadCandidateWaybills();
|
this.commonAddressVisible = false;
|
||||||
|
this.candidateSearchVisible = false;
|
||||||
},
|
},
|
||||||
restoreRouteAndCargo() {
|
restoreRouteAndCargo() {
|
||||||
const routeRows = parseJsonArray(this.dialogForm.routeJson);
|
const routeRows = parseJsonArray(this.dialogForm.routeJson);
|
||||||
@@ -3433,7 +3461,6 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-manage-dialog__table-toolbar {
|
.loading-manage-dialog__table-toolbar {
|
||||||
@@ -3767,7 +3794,9 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: #f5f6fa;
|
background: #f5f6fa;
|
||||||
}
|
}
|
||||||
:global(.loading-manage-form-page .loading-manage-dialog__body) {
|
/* 独立页面(新增/编辑/重新派单/详情):内容随 #avue-view 自然滚动,不做内嵌 78vh 滚动盒。
|
||||||
|
此处权重必须高于 .loading-manage-dialog .loading-manage-dialog__body,故带上 .loading-manage-page 外壳。 */
|
||||||
|
:global(.loading-manage-page .loading-manage-form-dialog.loading-manage-form-page .loading-manage-dialog__body) {
|
||||||
max-height: none;
|
max-height: none;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- 同 waybill-manage-detail.vue:只在当前路由属于本页时才透传 detailId,
|
||||||
|
避免标签页缓存的实例被其它页面的 detailId 污染后误开详情。 -->
|
||||||
<transport-plan-page
|
<transport-plan-page
|
||||||
:api="api"
|
:api="api"
|
||||||
:config="config"
|
:config="config"
|
||||||
:crud-option="option"
|
:crud-option="option"
|
||||||
:detail-id="$route.query.detailId"
|
:detail-id="detailId"
|
||||||
:menu-width="220"
|
:menu-width="220"
|
||||||
standalone-form-page
|
standalone-form-page
|
||||||
/>
|
/>
|
||||||
@@ -14,6 +16,8 @@ import TransportPlanPage from './components/transport-plan-page.vue';
|
|||||||
import * as api from '@/api/business/transport-plan';
|
import * as api from '@/api/business/transport-plan';
|
||||||
import { config, option } from '@/option/business/transport-plan';
|
import { config, option } from '@/option/business/transport-plan';
|
||||||
|
|
||||||
|
const listRoutePath = '/business/transport-plan';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { TransportPlanPage },
|
components: { TransportPlanPage },
|
||||||
data() {
|
data() {
|
||||||
@@ -23,5 +27,10 @@ export default {
|
|||||||
option,
|
option,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
detailId() {
|
||||||
|
return this.$route.path === listRoutePath ? this.$route.query.detailId : '';
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!--
|
||||||
|
detailId 必须做路由守卫:本组件对应 /business/waybill-manage/detail,
|
||||||
|
而 $route 是全局响应式的。标签页 keep-alive 会缓存本实例,路由切到别的详情页后
|
||||||
|
实例仍会重渲染,若无守卫就会把「当前页面的 id」灌进子组件,导致它拿别的单据 id
|
||||||
|
去查运单 → 报「运单管理不存在」,并误生成一个又一个运单详情标签。
|
||||||
|
-->
|
||||||
<waybill-manage-page
|
<waybill-manage-page
|
||||||
:api="api"
|
:api="api"
|
||||||
:config="config"
|
:config="config"
|
||||||
:crud-option="option"
|
:crud-option="option"
|
||||||
:detail-id="$route.query.id"
|
:detail-id="detailId"
|
||||||
:menu-width="250"
|
:menu-width="250"
|
||||||
standalone-detail-page
|
standalone-detail-page
|
||||||
/>
|
/>
|
||||||
@@ -14,10 +20,17 @@ import WaybillManagePage from './components/waybill-manage-page.vue';
|
|||||||
import * as api from '@/api/business/waybill-manage';
|
import * as api from '@/api/business/waybill-manage';
|
||||||
import { config, option } from '@/option/business/waybill-manage';
|
import { config, option } from '@/option/business/waybill-manage';
|
||||||
|
|
||||||
|
const detailRoutePath = '/business/waybill-manage/detail';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { WaybillManagePage },
|
components: { WaybillManagePage },
|
||||||
data() {
|
data() {
|
||||||
return { api, config, option };
|
return { api, config, option };
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
detailId() {
|
||||||
|
return this.$route.path === detailRoutePath ? this.$route.query.id : '';
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- 同 waybill-manage-detail.vue:保留旧链接 /business/waybill-manage?detailId=xxx 的能力,
|
||||||
|
但只在当前路由确实属于本页时才透传,避免被其它页面的 detailId 污染。 -->
|
||||||
<waybill-manage-page
|
<waybill-manage-page
|
||||||
:api="api"
|
:api="api"
|
||||||
:config="config"
|
:config="config"
|
||||||
:crud-option="option"
|
:crud-option="option"
|
||||||
:detail-id="$route.query.detailId"
|
:detail-id="detailId"
|
||||||
:menu-width="250"
|
:menu-width="250"
|
||||||
standalone-form-page
|
standalone-form-page
|
||||||
/>
|
/>
|
||||||
@@ -14,6 +16,8 @@ import WaybillManagePage from './components/waybill-manage-page.vue';
|
|||||||
import * as api from '@/api/business/waybill-manage';
|
import * as api from '@/api/business/waybill-manage';
|
||||||
import { config, option } from '@/option/business/waybill-manage';
|
import { config, option } from '@/option/business/waybill-manage';
|
||||||
|
|
||||||
|
const listRoutePath = '/business/waybill-manage';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { WaybillManagePage },
|
components: { WaybillManagePage },
|
||||||
data() {
|
data() {
|
||||||
@@ -23,5 +27,10 @@ export default {
|
|||||||
option,
|
option,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
detailId() {
|
||||||
|
return this.$route.path === listRoutePath ? this.$route.query.detailId : '';
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -882,7 +882,7 @@ export default {
|
|||||||
item.receiverName !== first.receiverName
|
item.receiverName !== first.receiverName
|
||||||
);
|
);
|
||||||
if (incompatible) {
|
if (incompatible) {
|
||||||
this.$message.warning('合并开票的结算单必须属于同一合同、项目、组织及收付款方');
|
this.$message.warning('合并开票的结算单必须属于同一合同');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.form.settlements = rows.map(item => ({
|
this.form.settlements = rows.map(item => ({
|
||||||
@@ -1260,7 +1260,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.invoice-form-page__dialog-search {
|
.invoice-form-page__dialog-search {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-start;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,7 +216,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="settlementDialog.keyword"
|
v-model="settlementDialog.keyword"
|
||||||
clearable
|
clearable
|
||||||
placeholder="结算单号、项目或合同"
|
placeholder="3结算单号、项目或合同"
|
||||||
@keyup.enter="loadSettlementCandidates"
|
@keyup.enter="loadSettlementCandidates"
|
||||||
/>
|
/>
|
||||||
<el-button type="primary" @click="loadSettlementCandidates">查询</el-button>
|
<el-button type="primary" @click="loadSettlementCandidates">查询</el-button>
|
||||||
|
|||||||
@@ -22,14 +22,6 @@
|
|||||||
@tree-load="treeLoad"
|
@tree-load="treeLoad"
|
||||||
>
|
>
|
||||||
<template #menu-left>
|
<template #menu-left>
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
:loading="iamSyncLoading"
|
|
||||||
v-if="userInfo.authority.includes('admin')"
|
|
||||||
@click="handleIamOrganizationSync"
|
|
||||||
>同步组织
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@@ -135,7 +127,6 @@ import {
|
|||||||
add,
|
add,
|
||||||
getDept,
|
getDept,
|
||||||
getDeptTree,
|
getDeptTree,
|
||||||
syncIamOrganizations,
|
|
||||||
} from '@/api/system/dept';
|
} from '@/api/system/dept';
|
||||||
import { getLeaderList } from '@/api/system/user';
|
import { getLeaderList } from '@/api/system/user';
|
||||||
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
|
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
|
||||||
@@ -168,7 +159,6 @@ export default {
|
|||||||
selectionList: [],
|
selectionList: [],
|
||||||
query: {},
|
query: {},
|
||||||
loading: true,
|
loading: true,
|
||||||
iamSyncLoading: false,
|
|
||||||
parentId: 0,
|
parentId: 0,
|
||||||
page: {
|
page: {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@@ -708,26 +698,6 @@ export default {
|
|||||||
done(row);
|
done(row);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleIamOrganizationSync() {
|
|
||||||
this.$confirm('确定从IAM同步组织信息?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.iamSyncLoading = true;
|
|
||||||
return syncIamOrganizations();
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
const count = res?.data?.data ?? 0;
|
|
||||||
this.$message.success(`IAM组织同步完成,共处理${count}条`);
|
|
||||||
this.parentId = 0;
|
|
||||||
this.onLoad(this.page, this.query);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.iamSyncLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleDelete() {
|
handleDelete() {
|
||||||
if (this.selectionList.length === 0) {
|
if (this.selectionList.length === 0) {
|
||||||
this.$message.warning('请选择至少一条数据');
|
this.$message.warning('请选择至少一条数据');
|
||||||
|
|||||||
+218
-15
@@ -340,6 +340,45 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
v-model="oaSyncVisible"
|
||||||
|
width="480px"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="!oaSyncRunning"
|
||||||
|
:show-close="!oaSyncRunning"
|
||||||
|
class="oa-sync-dialog"
|
||||||
|
@close="closeOaSyncDialog"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<span class="dialog-title">{{ oaSyncDialogTitle }}</span>
|
||||||
|
</template>
|
||||||
|
<div class="oa-sync-body">
|
||||||
|
<el-progress
|
||||||
|
:percentage="oaSyncPercent"
|
||||||
|
:status="oaSyncProgressStatus"
|
||||||
|
:stroke-width="12"
|
||||||
|
/>
|
||||||
|
<div class="oa-sync-meta">当前进度:第 {{ oaSyncProgress.current || 0 }} / {{ oaSyncTotalPage }} 页</div>
|
||||||
|
<div class="oa-sync-stats">
|
||||||
|
<div class="oa-sync-stat">
|
||||||
|
<span class="oa-sync-stat__label">同步成功</span>
|
||||||
|
<span class="oa-sync-stat__value oa-sync-stat__value--success">{{ oaSyncProgress.synced }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="oa-sync-stat">
|
||||||
|
<span class="oa-sync-stat__label">跳过</span>
|
||||||
|
<span class="oa-sync-stat__value oa-sync-stat__value--skip">{{ oaSyncProgress.skipped }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button v-if="oaSyncRunning" @click="cancelOaSync">取消</el-button>
|
||||||
|
<el-button v-else type="primary" @click="closeOaSyncDialog">关闭</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 认证日志组件 -->
|
<!-- 认证日志组件 -->
|
||||||
<auth-log ref="authLog" />
|
<auth-log ref="authLog" />
|
||||||
<!-- 认证锁定配置组件 -->
|
<!-- 认证锁定配置组件 -->
|
||||||
@@ -403,6 +442,18 @@ export default {
|
|||||||
query: {},
|
query: {},
|
||||||
loading: true,
|
loading: true,
|
||||||
iamSyncLoading: false,
|
iamSyncLoading: false,
|
||||||
|
oaSyncVisible: false,
|
||||||
|
oaSyncRunning: false,
|
||||||
|
oaSyncCancelled: false,
|
||||||
|
oaSyncStatus: 'running',
|
||||||
|
oaSyncController: null,
|
||||||
|
oaSyncProgress: {
|
||||||
|
current: 0,
|
||||||
|
size: 50,
|
||||||
|
total: 0,
|
||||||
|
synced: 0,
|
||||||
|
skipped: 0,
|
||||||
|
},
|
||||||
page: {
|
page: {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
@@ -453,6 +504,46 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo', 'permission']),
|
...mapGetters(['userInfo', 'permission']),
|
||||||
|
oaSyncDialogTitle() {
|
||||||
|
if (this.oaSyncStatus === 'done') {
|
||||||
|
return '同步完成';
|
||||||
|
}
|
||||||
|
if (this.oaSyncStatus === 'cancelled') {
|
||||||
|
return '已取消同步';
|
||||||
|
}
|
||||||
|
if (this.oaSyncStatus === 'error') {
|
||||||
|
return '同步失败';
|
||||||
|
}
|
||||||
|
return '同步人员';
|
||||||
|
},
|
||||||
|
oaSyncTotalPage() {
|
||||||
|
const total = Number(this.oaSyncProgress.total) || 0;
|
||||||
|
const size = Number(this.oaSyncProgress.size) || 50;
|
||||||
|
if (total <= 0) {
|
||||||
|
return this.oaSyncProgress.current || 0;
|
||||||
|
}
|
||||||
|
return Math.max(1, Math.ceil(total / size));
|
||||||
|
},
|
||||||
|
oaSyncPercent() {
|
||||||
|
if (this.oaSyncStatus === 'done') {
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
const totalPage = this.oaSyncTotalPage;
|
||||||
|
const current = Number(this.oaSyncProgress.current) || 0;
|
||||||
|
if (totalPage <= 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return Math.min(100, Math.round((current / totalPage) * 100));
|
||||||
|
},
|
||||||
|
oaSyncProgressStatus() {
|
||||||
|
if (this.oaSyncStatus === 'done') {
|
||||||
|
return 'success';
|
||||||
|
}
|
||||||
|
if (this.oaSyncStatus === 'error') {
|
||||||
|
return 'exception';
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
},
|
||||||
// 所属组织级联配置:checkStrictly 为 false 时只能选择最后一级(叶子节点)
|
// 所属组织级联配置:checkStrictly 为 false 时只能选择最后一级(叶子节点)
|
||||||
deptCascaderProps() {
|
deptCascaderProps() {
|
||||||
return {
|
return {
|
||||||
@@ -564,24 +655,88 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleIamSync() {
|
handleIamSync() {
|
||||||
this.$confirm('确定从IAM同步人员信息?', '提示', {
|
this.$confirm('确定从OA同步人员及组织信息?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
}).then(() => {
|
||||||
.then(() => {
|
this.startOaSync();
|
||||||
this.iamSyncLoading = true;
|
|
||||||
return syncIamAccounts();
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
const count = res?.data?.data ?? 0;
|
|
||||||
this.$message.success(`IAM人员同步完成,共处理${count}条`);
|
|
||||||
this.onLoad(this.page, this.query);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.iamSyncLoading = false;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
startOaSync() {
|
||||||
|
this.iamSyncLoading = true;
|
||||||
|
this.oaSyncVisible = true;
|
||||||
|
this.oaSyncRunning = true;
|
||||||
|
this.oaSyncCancelled = false;
|
||||||
|
this.oaSyncStatus = 'running';
|
||||||
|
this.oaSyncController = new AbortController();
|
||||||
|
this.oaSyncProgress = {
|
||||||
|
current: 0,
|
||||||
|
size: 50,
|
||||||
|
total: 0,
|
||||||
|
synced: 0,
|
||||||
|
skipped: 0,
|
||||||
|
};
|
||||||
|
this.runOaSyncPages();
|
||||||
|
},
|
||||||
|
isOaSyncCanceledError(error) {
|
||||||
|
return (
|
||||||
|
this.oaSyncCancelled ||
|
||||||
|
error?.code === 'ERR_CANCELED' ||
|
||||||
|
error?.name === 'CanceledError' ||
|
||||||
|
error?.name === 'AbortError'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
async runOaSyncPages() {
|
||||||
|
const size = 50;
|
||||||
|
let current = 1;
|
||||||
|
try {
|
||||||
|
while (!this.oaSyncCancelled) {
|
||||||
|
const res = await syncIamAccounts(current, size, this.oaSyncController?.signal);
|
||||||
|
const page = res?.data?.data || {};
|
||||||
|
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) {
|
||||||
|
this.oaSyncStatus = 'done';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
current += 1;
|
||||||
|
}
|
||||||
|
if (this.oaSyncCancelled && this.oaSyncStatus === 'running') {
|
||||||
|
this.oaSyncStatus = 'cancelled';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (this.isOaSyncCanceledError(error)) {
|
||||||
|
this.oaSyncStatus = 'cancelled';
|
||||||
|
} else {
|
||||||
|
this.oaSyncStatus = 'error';
|
||||||
|
this.$message.error(error?.message || 'OA人员同步失败');
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
this.oaSyncRunning = false;
|
||||||
|
this.iamSyncLoading = false;
|
||||||
|
if (this.oaSyncStatus === 'done' || this.oaSyncStatus === 'cancelled') {
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancelOaSync() {
|
||||||
|
if (!this.oaSyncRunning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.oaSyncCancelled = true;
|
||||||
|
this.oaSyncController?.abort();
|
||||||
|
},
|
||||||
|
closeOaSyncDialog() {
|
||||||
|
if (this.oaSyncRunning) {
|
||||||
|
this.cancelOaSync();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.oaSyncVisible = false;
|
||||||
|
},
|
||||||
handleSetLeader(row) {
|
handleSetLeader(row) {
|
||||||
const tip = row.isLeader === 1 ? '确定取消用户的主管职务?' : '确定设置用户为主管职务?';
|
const tip = row.isLeader === 1 ? '确定取消用户的主管职务?' : '确定设置用户为主管职务?';
|
||||||
const message = row.isLeader === 1 ? '取消主管成功!' : '设置主管成功!';
|
const message = row.isLeader === 1 ? '取消主管成功!' : '设置主管成功!';
|
||||||
@@ -1150,14 +1305,16 @@ export default {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-edit-dialog .dialog-title {
|
.user-edit-dialog .dialog-title,
|
||||||
|
.oa-sync-dialog .dialog-title {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-edit-dialog .dialog-title::before {
|
.user-edit-dialog .dialog-title::before,
|
||||||
|
.oa-sync-dialog .dialog-title::before {
|
||||||
width: 4px;
|
width: 4px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
@@ -1165,6 +1322,52 @@ export default {
|
|||||||
content: '';
|
content: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.oa-sync-body {
|
||||||
|
padding: 8px 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oa-sync-meta {
|
||||||
|
margin-top: 12px;
|
||||||
|
color: #606266;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oa-sync-stats {
|
||||||
|
display: flex;
|
||||||
|
gap: 16px;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oa-sync-stat {
|
||||||
|
flex: 1;
|
||||||
|
padding: 12px 16px;
|
||||||
|
background: #fafafa;
|
||||||
|
border: 1px solid #eff1f7;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oa-sync-stat__label {
|
||||||
|
display: block;
|
||||||
|
color: #909399;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oa-sync-stat__value {
|
||||||
|
display: block;
|
||||||
|
margin-top: 6px;
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oa-sync-stat__value--success {
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oa-sync-stat__value--skip {
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
.user-edit-dialog .el-form-item {
|
.user-edit-dialog .el-form-item {
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1892,10 +1892,13 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 大尺寸模式:缩成 1.586:1 比例,左对齐(不再 100% 占栏)
|
// 大尺寸模式:跟随列宽自适应(最大 240px,约 1.586:1 证件比例),
|
||||||
|
// 保证不同分辨率 / 系统缩放下都与上方输入框左右对齐
|
||||||
:deep(.driver-uploader--large) {
|
:deep(.driver-uploader--large) {
|
||||||
display: block;
|
display: block;
|
||||||
width: 240px;
|
width: 100%;
|
||||||
|
max-width: 240px;
|
||||||
|
flex: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1349,9 +1349,13 @@ export default {
|
|||||||
height: 151px;
|
height: 151px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 大尺寸模式:跟随列宽自适应(最大 248px),
|
||||||
|
// 保证不同分辨率 / 系统缩放下都与上方输入框左右对齐
|
||||||
:deep(.ship-uploader--large) {
|
:deep(.ship-uploader--large) {
|
||||||
display: block;
|
display: block;
|
||||||
width: 248px;
|
width: 100%;
|
||||||
|
max-width: 248px;
|
||||||
|
flex: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,15 @@
|
|||||||
@on-load="onLoad"
|
@on-load="onLoad"
|
||||||
>
|
>
|
||||||
<template #menu-left>
|
<template #menu-left>
|
||||||
|
<el-button
|
||||||
|
v-if="hasPermission('equipment_ledger_delete')"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
plain
|
||||||
|
@click="handleDelete"
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="hasPermission('equipment_ledger_import')"
|
v-if="hasPermission('equipment_ledger_import')"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -310,6 +319,23 @@ export default {
|
|||||||
this.$message.success('操作成功');
|
this.$message.success('操作成功');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleDelete() {
|
||||||
|
if (this.selectionList.length === 0) {
|
||||||
|
this.$message.warning('请选择至少一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$confirm('确认删除选中的数据?删除后将不可恢复!', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => remove(this.ids))
|
||||||
|
.then(() => {
|
||||||
|
this.onLoad(this.page);
|
||||||
|
this.$message.success('操作成功');
|
||||||
|
this.$refs.crud.toggleSelection();
|
||||||
|
});
|
||||||
|
},
|
||||||
beforeOpen(done, type) {
|
beforeOpen(done, type) {
|
||||||
this.boxType = type;
|
this.boxType = type;
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ import { getList as getOcrTemplateList } from '@/api/base/insurance-ocr-template
|
|||||||
import { getDeptTree } from '@/api/system/dept';
|
import { getDeptTree } from '@/api/system/dept';
|
||||||
import { exportBlob } from '@/api/common';
|
import { exportBlob } from '@/api/common';
|
||||||
import { downloadXls } from '@/utils/util';
|
import { downloadXls } from '@/utils/util';
|
||||||
import { openImportDialog } from '@/utils/import-excel';
|
import { handleImportExcel } from '@/utils/import-excel';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { getUploadHeaders } from '@/utils/upload';
|
import { getUploadHeaders } from '@/utils/upload';
|
||||||
import { normalizeSearchRangeParams } from '@/utils/search-range';
|
import { normalizeSearchRangeParams } from '@/utils/search-range';
|
||||||
@@ -540,7 +540,96 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleImport() {
|
handleImport() {
|
||||||
openImportDialog(this, '保险记录');
|
const column = this.findColumn(this.excelOption.column, 'excelFile');
|
||||||
|
if (!column) {
|
||||||
|
this.$message.error('导入配置异常,请稍后重试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 上传前先归一化日期列(2026-9-1 → 2026-09-01),兼容两种格式
|
||||||
|
column.httpRequest = async (uploadOption, uploadColumn) => {
|
||||||
|
try {
|
||||||
|
const normalizedFile = await this.normalizeExcelDates(uploadOption.file);
|
||||||
|
await handleImportExcel(
|
||||||
|
this,
|
||||||
|
{ ...uploadOption, file: normalizedFile },
|
||||||
|
uploadColumn,
|
||||||
|
'保险记录',
|
||||||
|
null,
|
||||||
|
{ timeout: 60000 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
this.$message.error(error.message || '导入失败');
|
||||||
|
if (typeof uploadOption.onError === 'function') {
|
||||||
|
uploadOption.onError(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.excelBox = true;
|
||||||
|
},
|
||||||
|
// 读取 Excel,把指定日期列统一归一化为 YYYY-MM-DD,再写回新文件
|
||||||
|
async normalizeExcelDates(file) {
|
||||||
|
const rows = await this.readExcelRows(file);
|
||||||
|
const dateHeaders = ['开始日期', '结束日期', '开票日期'];
|
||||||
|
const headerIndex = (rows[0] || []).reduce((map, label, index) => {
|
||||||
|
const key = String(label || '').trim();
|
||||||
|
if (key) map[key] = index;
|
||||||
|
return map;
|
||||||
|
}, {});
|
||||||
|
const targetIndexes = dateHeaders
|
||||||
|
.map(label => headerIndex[label])
|
||||||
|
.filter(index => index !== undefined);
|
||||||
|
if (!targetIndexes.length) return file;
|
||||||
|
rows.forEach((row, rowIndex) => {
|
||||||
|
if (rowIndex === 0) return;
|
||||||
|
targetIndexes.forEach(index => {
|
||||||
|
if (row[index] !== undefined && row[index] !== '') {
|
||||||
|
const normalized = this.normalizeDateString(String(row[index]));
|
||||||
|
if (normalized) row[index] = normalized;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return this.writeExcelFile(rows, file.name);
|
||||||
|
},
|
||||||
|
async readExcelRows(file) {
|
||||||
|
const XLSX = await import('xlsx');
|
||||||
|
const buffer = await file.arrayBuffer();
|
||||||
|
const workbook = XLSX.read(buffer, { type: 'array', cellDates: false });
|
||||||
|
const worksheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||||
|
return XLSX.utils.sheet_to_json(worksheet, {
|
||||||
|
header: 1,
|
||||||
|
defval: '',
|
||||||
|
raw: false,
|
||||||
|
blankrows: false,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async writeExcelFile(rows, fileName) {
|
||||||
|
const XLSX = await import('xlsx');
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, XLSX.utils.aoa_to_sheet(rows), 'Sheet1');
|
||||||
|
const binary = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
||||||
|
return new File([binary], fileName || 'insurance-record.xlsx', {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 兼容 YYYY-M-D / YYYY-MM-DD / YYYY/M/D / YYYY.年.月.日,非法或已标准格式原样返回 null
|
||||||
|
normalizeDateString(value) {
|
||||||
|
const text = String(value || '').trim();
|
||||||
|
if (!text) return null;
|
||||||
|
const match = text.match(/^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?$/);
|
||||||
|
if (!match) return null;
|
||||||
|
const year = Number(match[1]);
|
||||||
|
const month = Number(match[2]);
|
||||||
|
const day = Number(match[3]);
|
||||||
|
const date = new Date(year, month - 1, day);
|
||||||
|
if (
|
||||||
|
date.getFullYear() !== year ||
|
||||||
|
date.getMonth() !== month - 1 ||
|
||||||
|
date.getDate() !== day
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const pad = n => String(n).padStart(2, '0');
|
||||||
|
return `${year}-${pad(month)}-${pad(day)}`;
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.$confirm('是否导出保险记录数据?', '提示', {
|
this.$confirm('是否导出保险记录数据?', '提示', {
|
||||||
|
|||||||
+13
-13
@@ -47,26 +47,26 @@ export default ({ mode, command }) => {
|
|||||||
__VUE_I18N_LEGACY_API__: true,
|
__VUE_I18N_LEGACY_API__: true,
|
||||||
__INTLIFY_PROD_DEVTOOLS__: false,
|
__INTLIFY_PROD_DEVTOOLS__: false,
|
||||||
},
|
},
|
||||||
server: {
|
|
||||||
port: 2888,
|
|
||||||
proxy: {
|
|
||||||
'/api': {
|
|
||||||
target: 'http://localhost',
|
|
||||||
//target: 'https://saber3.bladex.cn/api',
|
|
||||||
changeOrigin: true,
|
|
||||||
rewrite: path => path.replace(/^\/api/, ''),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// server: {
|
// server: {
|
||||||
// port: 2889,
|
// port: 2888,
|
||||||
// proxy: {
|
// proxy: {
|
||||||
// '/api': {
|
// '/api': {
|
||||||
// target: 'http://172.16.203.228:8000',
|
// target: 'http://localhost',
|
||||||
|
// //target: 'https://saber3.bladex.cn/api',
|
||||||
// changeOrigin: true,
|
// changeOrigin: true,
|
||||||
|
// rewrite: path => path.replace(/^\/api/, ''),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
|
server: {
|
||||||
|
port: 2889,
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://172.16.203.228:8000',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'~': resolve(__dirname, './'),
|
'~': resolve(__dirname, './'),
|
||||||
|
|||||||
Reference in New Issue
Block a user