Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f067518c0e | |||
| 11460f3378 | |||
| 7f543937fb | |||
| 6a87066097 | |||
| 79aa4f9fae | |||
| f1e2313e4c | |||
| acbc9d3322 | |||
| dbeb174ae2 | |||
| 764c0f4581 | |||
| 1a9cd55d66 | |||
| 38e53e01af | |||
| 6ff672211f | |||
| 1bbc97758d | |||
| c1813e308f | |||
| 716ce43862 | |||
| 14c6ad0a31 | |||
| 1972115173 | |||
| 006dc95bf0 | |||
| d187da68d2 | |||
| 70bb94a2e6 | |||
| f78e61b433 |
@@ -55,3 +55,161 @@
|
|||||||
- api 新增 `getFundRiskStats` → GET /blade-transport/project-apply/fund-risk-stats。
|
- api 新增 `getFundRiskStats` → GET /blade-transport/project-apply/fund-risk-stats。
|
||||||
- 后端契约(未改,待确认数据来源):ProjectApplyVO 补齐 `fundUseRisk`(high/medium/none)、`fundUseRiskName`、`fundUseRate`、`usedFundLimit`/`remainingFundLimit`;列表 selectProjectApplyPage 填充每行风险 + buildQuery 支持 `fundUseRisk` 过滤;新增 `/fund-risk-stats` 返回 {high,medium,none}。
|
- 后端契约(未改,待确认数据来源):ProjectApplyVO 补齐 `fundUseRisk`(high/medium/none)、`fundUseRiskName`、`fundUseRate`、`usedFundLimit`/`remainingFundLimit`;列表 selectProjectApplyPage 填充每行风险 + buildQuery 支持 `fundUseRisk` 过滤;新增 `/fund-risk-stats` 返回 {high,medium,none}。
|
||||||
- ⚠️ 关键阻塞:系统里项目与任何费用表(运输计划/运单/账单/客商)均无关联字段,`usedFundLimit`(已使用资金) 无真实取数来源;临时额度模块的 project-apply/list 返回里 usedFundLimit 实际为空。需业务方确认「已使用资金」口径后才能算风险等级,否则列表风险列全空、统计为 0。
|
- ⚠️ 关键阻塞:系统里项目与任何费用表(运输计划/运单/账单/客商)均无关联字段,`usedFundLimit`(已使用资金) 无真实取数来源;临时额度模块的 project-apply/list 返回里 usedFundLimit 实际为空。需业务方确认「已使用资金」口径后才能算风险等级,否则列表风险列全空、统计为 0。
|
||||||
|
|
||||||
|
## 合同文件「批量下载」按钮与标题同排(contract-manage.vue 内联 AttachmentSection)
|
||||||
|
- 需求:编辑页「合同文件」分组里「批量下载」按钮目前独立一行、靠右偏上,高度与标题区错位;要放到「合同文件」标题右侧同排、垂直居中。
|
||||||
|
- 修复:`const AttachmentSection = defineComponent(...)` 内联组件 render() —— 原结构是 `div.dialog-section-title`(标题) 与 `div.contract-manage-form__attachment-head`(批量下载按钮) 两个并列 div;改为把标题与按钮放进同一个 `contract-manage-form__attachment-head` flex 容器(标题左、按钮右)。
|
||||||
|
- 样式:`:deep(.contract-manage-form__attachment-head)` 由 `justify-content:flex-end` 改为 `space-between` + `align-items:center`,并 `.dialog-section-title { margin-bottom:0 }` 抵消标题自身 20px 下边距(2674 行 `:deep(.dialog-section-title)` 会命中子组件渲染的标题)。
|
||||||
|
- 注意:AttachmentSection 用 render 函数产出 DOM,不带当前组件 scoped data 属性,因此样式必须走 `:deep()`;scoped 的 `&__billing-head, &__attachment-head`(2723) 只作用于当前组件模板内(计费信息),对子组件 DOM 无效。
|
||||||
|
- 影响:4 处使用(编辑/详情 × 合同文件/其它附件)布局统一变为「标题 + 批量下载」同排。
|
||||||
|
- 主人二次反馈「下面的其它附件也一样」——确认 L463(编辑/其它附件 description) / L765(详情/其它附件 description+readonly) 与 L313(编辑/合同文件) / L671(详情/合同文件) 都走同一份 render+样式,无需新代码;指挥浏览器 Cmd+Shift+R 硬刷即可看到效果(render 函数组件的 :deep() 样式改 HMR 经常不传播)。
|
||||||
|
|
||||||
|
## 合同格式下拉改读业务字典 contractFormat(contract-manage.vue)
|
||||||
|
- 需求:新增/编辑合同管理页「合同格式」下拉由硬编码改为读取业务字典 `contractFormat`。
|
||||||
|
- 原实现:`option/business/contract-manage.js` 里 `contractFormat` 列 `dicData` 硬编码 `[{label:'电子合同',value:'电子合同'},{label:'纸质合同',value:'纸质合同'}]`,view 里 `contractFormatOptions` computed 直接 `columnOptions('contractFormat')` 读 column.dicData。
|
||||||
|
- 修复(4 处):
|
||||||
|
1. data 加 `contractFormatDictOptions: []`(与 settlementModeDictOptions 并列)。
|
||||||
|
2. computed `contractFormatOptions` 改为优先 `contractFormatDictOptions`,为空回退 `columnOptions('contractFormat')`(保留静态兜底)。
|
||||||
|
3. `loadSettlementDictionaries` 的 `Promise.all` 追加 `getBizDictionary({ code: 'contractFormat' })`,用 `records()` 映射 `{label:dictValue,value:dictKey}` 填充 `contractFormatDictOptions`;再**条件覆盖** column.dicData(仅当字典非空时),避免字典未配时清掉静态兜底。
|
||||||
|
4. `detailValue` 的字典映射分支加入 `prop === 'contractFormat'`,详情页「合同格式」也走 `displayStatus` 显示 label。
|
||||||
|
- 后端契约:`getBizDictionary` → `GET /blade-system/dict-biz/dictionary?code=contractFormat`,返回 `List<DictBiz>{code,dictKey,dictValue,remark}`(DictBizController#dictionary 按 code 精确匹配)。字典 code 按用户口述用驼峰 `contractFormat`(现有 settle_method 为下划线,若后台实际是 `contract_format` 需调整 code)。
|
||||||
|
- 参考模式:与 `settlementMode`(settle_method)完全一致。
|
||||||
|
|
||||||
|
## 合同类别 contractCategory 也读业务字典(contract-manage.vue,续上)
|
||||||
|
- 需求:模板里 label 实为「合同类型」(prop `contractCategory`),下拉由硬编码 `common.js#contractCategoryOptions`(客户合同/承运商合同/补充协议,value 中文)改为读业务字典 `contractCategory`。
|
||||||
|
- 修复(3 处,与 contractFormat 同模式):
|
||||||
|
1. data 加 `contractCategoryDictOptions: []`。
|
||||||
|
2. computed `contractCategoryOptions` 改为优先 `contractCategoryDictOptions`,空回退 `columnOptions('contractCategory')`(静态兜底)。
|
||||||
|
3. `loadSettlementDictionaries` 的 `Promise.all` 追加 `getBizDictionary({ code: 'contractCategory' })`,映射填充后**条件覆盖** `contractCategory` 列 dicData(仅非空时)。
|
||||||
|
- 列表页列显示/搜索下拉、详情页(detailValue 已有 `prop==='contractCategory'` 分支走 displayStatus)均因 column.dicData 覆盖而自动跟随业务字典。
|
||||||
|
- 注意:`config.defaultForm.contractCategory: '客户合同'`(option/contract-manage.js)为硬编码中文默认值,若业务字典 dictKey 非中文需同步调整。
|
||||||
|
|
||||||
|
## 车辆新增弹窗:所有组织移位 + 使用部门 + 长期有效清空(vehicle.vue + 后端)
|
||||||
|
- 需求(transportCapacity/vehicle):①所有组织移到「基础车辆信息」区末尾;②新增「使用部门」字段(后端 transport_vehicle 无该字段,需加);③车牌号三段(省/号码/颜色)包成整体输入框+减宽;④勾选「长期有效」清空对应日期且不可编辑。
|
||||||
|
- 用户确认:所有组织+使用部门放「基础车辆信息」区末尾;使用部门用部门下拉(复用 getDeptTree→organizationOptions,存部门名,仅部门名非级联);车牌号包成整体输入框+减宽;长期有效 4 组全部统一清空(强制报废/行驶证/道路运输证/年审)。
|
||||||
|
- 前端(vehicle.vue):
|
||||||
|
1. emptyForm 加 `useDepartment: ''`。
|
||||||
|
2. 删「基础车辆信息」首行的「所有组织」(原 span24),在区末新增一行:`使用部门`(span8, el-select+organizationOptions, 存 rawLabel) + `所有组织`(span8, el-cascader)。organizationOptions 由 initDeptTree 填充。
|
||||||
|
3. `.plate-group` 由 grid(112px 1fr 112px) 改为 flex 整体输入框:外层 border+radius+focus-within 变化;内部 el-select/el-input 去 box-shadow、无边框,第一/最后 select flex 0 0 30%、中间 input flex 1,子项间用 `::before` 竖线分隔。
|
||||||
|
4. 4 组 date-picker 加 `:disabled="xxxLongTerm === 1"`(行驶证/道路运输证原缺,补上),checkbox 加 `@change="handleLongTermChange(日期prop, longterm prop)"`;新增方法 handleLongTermChange(勾选时清空日期并 validateField)。
|
||||||
|
5. formRules:drivingLicenseEndDate / roadTransportCertEndDate 由 required 改为 validator(新增 validateDrivingLicenseEndDate / validateRoadTransportCertEndDate,longTerm===1 时跳过必填),annualReview 原 validator 已支持。
|
||||||
|
- 后端(tms-erp-api-ws,新增 use_department 列):
|
||||||
|
- `TransportVehicle.java` 加 `private String useDepartment`。
|
||||||
|
- `blade_transport_vehicle.sql` 建表加 `use_department varchar(50)`。
|
||||||
|
- `TransportVehicleExcel.java` 加 `使用部门` 列。
|
||||||
|
- `TransportVehicleMapper.xml` resultMap + BaseColumn + QueryCondition(useDepartment LIKE) 各加。
|
||||||
|
- `TransportVehicleServiceImpl.prepare()` trim useDepartment;validate() 加长度≤50 校验。
|
||||||
|
- 新增增量迁移 `doc/sql/transport/blade_transport_vehicle_use_department_patch_20260909.sql`(ALTER ADD use_department AFTER organization_name)。
|
||||||
|
- 注意:VO 继承 entity 无需改;Wrapper BeanUtil 同名透传。已上线库须执行 patch SQL(建表脚本是 DROP+CREATE,勿直接跑)。
|
||||||
|
- 后续补充(vehicle.vue「车辆资质图片」区输入框对齐):第一行原 span `6/8/10` 不等宽(行驶证档案编号 6 / 行驶证有效期 8 / 道路运输证号 10)导致输入框宽度不齐,统一改为 `8/8/8`,与下方各行 span=8 一致。仅改 2 处 span,无逻辑改动。
|
||||||
|
|
||||||
|
## 车辆车牌号:改为单一 input 输入框(vehicle.vue,3 段 → 1 段)
|
||||||
|
- 需求:基础车辆信息区「车牌号」原本是「省简称 select + 号码 input + 车牌颜色 select」三段拼装(plateProvince/plateNoBody/plateColor),改为**单个 el-input** 直接输入完整车牌号(如 京A12345)。
|
||||||
|
- 改动(vehicle.vue):
|
||||||
|
1. 模板:`plate-group` 三段 → `<el-input v-model="vehicleForm.plateNo" maxlength="8" show-word-limit placeholder="如:京A12345" @input="handlePlateNoInput" @blur="validatePlateFormat">`。删除 `.plate-group` 样式(含 focus-within、竖线分隔、child flex 占比等整段)。
|
||||||
|
2. emptyForm:删 `plateProvince`、`plateNoBody`,保留 `plateNo`、`plateColor`(后端字段继续存历史车牌颜色)。
|
||||||
|
3. data:删 `plateProvinceOptions`、`plateColorOptions` 暴露;常量 `plateProvinceOptions`(31 省简称数组)整段删除;`plateColorOptions` 常量删除。
|
||||||
|
4. validatePlateNo 重写:直接校验 `value`(完整车牌号),正则 `/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼港澳]{1}[A-Z][A-Z0-9挂学警港澳]{5,6}$/`,错误提示改为「请输入标准车牌号(如:京A12345)」。
|
||||||
|
5. syncPlateNo / splitPlateNo 重写:splitPlateNo 改为 noop(保留以兼容 OCR 后回调链路);syncPlateNo 改为 trim+upperCase 单一字段。
|
||||||
|
6. handlePlateBodyInput 改名为 handlePlateNoInput,新增 validatePlateFormat 失焦校验。
|
||||||
|
7. 车辆认证审核弹窗只读详情同步删「车牌颜色」展示(与录入表单一致)。
|
||||||
|
- 后端不动:`plate_no` / `plate_color` 字段保留(数据库兼容历史车牌颜色),Service 无强制校验。
|
||||||
|
- 受影响:OCR 自动识别(行驶证/机动车销售统一发票)后续调用链路无需改,因 syncPlateNo 仍对 plateNo 做归一化。
|
||||||
|
|
||||||
|
## 车辆新增/编辑弹窗:输入框宽度统一(vehicle.vue,前后两区)
|
||||||
|
- 需求(transportCapacity/vehicle):新增/编辑弹窗「基础车辆信息」+「车辆资质图片」两个 section 各输入框宽度要一致;截图红框重点为车牌号、外廓尺寸、所有组织/使用部门。
|
||||||
|
- 根因:基础区原本列宽混乱(车牌号 span10 / 车辆类型 span6 / 外廓尺寸 span6,其余 span6),行内 3 列与 2 列混排;图片区文本字段全 span6,与基础区不一致。
|
||||||
|
- 改动(vehicle.vue 仅模板 el-col span):
|
||||||
|
1. 「基础车辆信息」区所有字段统一为 **span=8(3 列布局)**:车牌号、车辆类型、外廓尺寸、核定载质量、准牵引总质量、业务关系、能源类型、强制报废日期、海关备案号、所有组织、使用部门。
|
||||||
|
2. 「车辆资质图片」区文本/日期字段(行驶证档案编号、行驶证有效期、道路运输证号、道路运输证有效期、道路运输年审有效期、机动车登记编号、机动车登记日期)统一为 **span=8**。
|
||||||
|
- 不改:只读「车辆认证审核」弹窗(L140 起的 span6 只读详情 + large 图片上传)与新增弹窗内「证件图片」上传控件(固定尺寸)保持 span6。外廓尺寸为复合控件(长/宽/高三 input),口径同 span8。
|
||||||
|
- ⚠️ 注意:操作中曾误删核定载质量 el-col 标签(453-460 行开始时少 el-col、尾部多一个 `</el-col>`),已修复为完整 `<el-col :span="8">...`。
|
||||||
|
- 后续纠偏(2026-09-09 傍晚):主人反馈「为什么不是按4列显示」——上一步把"基础车辆信息/车辆资质图片"两区误改成 3 列(span8)。同项目惯例 driver.vue/customer-archive.vue 全为 **4 列(span6,仅复合长字段 span12)**,故统一重排为 4 列:
|
||||||
|
- 基础车辆信息:`车牌号(6)+车辆类型(6)+外廓尺寸(12)` → `核定载质量/准牵引总质量/业务关系/能源类型(4×6)` → `强制报废日期/海关备案号/所有组织/使用部门(4×6)`
|
||||||
|
- 车辆资质图片:`行驶证有效期/道路运输证号/道路运输证有效期/道路运输年审有效期(4×6)` → `机动车登记编号/机动车登记日期/行驶证档案编号(3×6)`,图片上传控件仍 span6
|
||||||
|
- 该区 span8 已全部移除,编辑表单区仅剩外廓尺寸 span12(复合控件长/宽/高)+ 图片上传 span6。
|
||||||
|
- 宽度微调(2026-09-09 傍晚2):主人圈出「所有组织」字段宽度与同行不一致。根因:`.vehicle-form` 里的 `:deep(...){width:100%}` 选择器只列了 `el-select / el-input / el-input-number / el-date-editor`,**漏了 `el-cascader`**(所有组织用的就是级联选择器,默认不撑满整列)。已补 `:deep(.el-cascader)` 进该规则,全表单仅此一处用到 el-cascader,故所有组织与同行等宽。
|
||||||
|
|
||||||
|
## 司机弹窗:补 placeholder + 每行统一 3 列(transportCapacity/driver.vue)
|
||||||
|
- 需求:新增/编辑司机弹窗 ①输入框无提示文案;②基础身份信息 3 列,其它 4 列 / 6 列行不统一。
|
||||||
|
- 改动(仅 1819 行 driver.vue 的 126-540 行 `<driver-dialog>` 模板,script/style 不动):
|
||||||
|
1. **基础身份信息**:行结构不动,7 个 el-form-item 控件补 placeholder(司机姓名/身份证号/出生年月/性别/民族/学历/详细地址)。住址已有「请选择省市区」、驾驶车辆已有「请输入或选择车辆」,不动。
|
||||||
|
2. **驾驶证信息**:第一行 4 列(:span=6)拆为两行 — 行 1(准驾车型 / 档案编号 / 有效期 date-range,:span=8)+ 行 2(长期有效,:span=8)。起/止 placeholder 保留简短「起」「止」,符合主人 1.B 偏好(保留原 date-range 二联结构,不改 daterange)。
|
||||||
|
3. **从业资格证信息**:第一行 4 列拆为两行 — 行 1(从业资格认证类型 / 资格证号 / 有效期,:span=8)+ 行 2(长期有效,:span=8)。资格证号 placeholder 保留「默认身份证号」不动。
|
||||||
|
4. **司机联系信息**:一行 6 列拆为两行 — 行 1(司机类型 / 手机号 / 紧急联系人姓名,:span=8)+ 行 2(紧急联系人手机号 / 与联系人关系 / 所属组织,:span=8)。所属组织已有 placeholder,不动。
|
||||||
|
- 决策点(主人确认):1.B(保留原 date-range 二联 + 第三列留空后拆行的方案);2 保留;3.A(驾驶证主页/副页、封面页/内容页两组上传图仍 :span=12,与占整行宽的原貌一致)。
|
||||||
|
- 校验:node 脚本统计 4 个 section-card / 13 个 el-row / 31 个 el-col / 24 个 el-form-item,全平衡。改动只在 driver.vue 一文件,~25 处 Edit 调用。
|
||||||
|
|
||||||
|
## 新增/修改司机弹窗改为 4 列布局(driver.vue,16:xx)
|
||||||
|
- 主人要求 /transportCapacity/driver 新增司机弹窗改 4 列显示。原文件各分组已是 span=6(4 列栅格)但每行只放 3 个字段,第 4 列空置。
|
||||||
|
- 重排结果(仅删行断 + 移动字段顺序,字段/校验/逻辑零改动):
|
||||||
|
1. 基础身份信息:行1 司机姓名/身份证号/出生年月/性别;行2 民族/学历/住址/详细地址;行3 驾驶车辆/岗位;行4 三张证件照(不变)。
|
||||||
|
2. 驾驶证信息:行1 准驾车型/档案编号/有效期/长期有效;上传主页/副页 span 12→6。
|
||||||
|
3. 从业资格证信息:行1 类型/资格证号/有效期/长期有效;上传封面页/内容页 span 12→6。
|
||||||
|
4. 司机联系信息:行1 司机类型/手机号/紧急联系人姓名/紧急联系人手机号;行2 与联系人关系/所属组织。
|
||||||
|
- 注意:此前日志记录的「3 列 span=8」方案已被后续改动覆盖为 span=6,本次以当前文件实际状态为准。
|
||||||
|
|
||||||
|
## 客商档案:客商类型→客商分类 + 新增客商类型(customer-archive.vue)
|
||||||
|
- ⚠️ 补救(17:34):data 里的 `customerKindOptions`/`customerKindMap` 定义一度丢失(模板 v-for 空 → 下拉显示「无数据」,主人截图反馈),已补回 data(customerTypeOptions 之后)。其余 8 处改动经 grep 确认完好。
|
||||||
|
- 需求:原「客商类型」(prop `customerType`,字典 customer_type:客户/承运商,多选)改名「客商分类」;另新增「客商类型」字段,取值为 外部客商 / 内部组织。
|
||||||
|
- 约定:prop `customerType` 不动(其它页面 loading-manage / dept / business-crud-page 都以 `customerType:'承运商'` 作为后端查询参数),只改中文标签。
|
||||||
|
- 新增字段 prop = **`customerKind`**(前端自定义命名,后端尚无对应字段,需后端在客商表加列并透传),值 `external`(外部客商) / `internal`(内部组织),单选下拉,默认 `external`。
|
||||||
|
- 改动点(8 处,全在 `src/views/vehicle/customer-archive.vue`):
|
||||||
|
1. 表单:227 行 label 改「客商分类」;其后新增一个 `el-col :span="6"` 表单项「客商类型」prop `customerKind`(el-select + `customerKindOptions`)。
|
||||||
|
2. data 新增 `customerKindOptions` / `customerKindMap`(external/internal ↔ 中文)。
|
||||||
|
3. formRules:`customerType` 提示文案改「请选择客商分类」。
|
||||||
|
4. 列表列:「客户类型」label 改「客商分类」;新增「客商类型」列(prop customerKind,type select,dicData 内外部,minWidth 120,**未加 search**)。
|
||||||
|
5. `emptyArchive()` 加 `customerKind: 'external'`。
|
||||||
|
6. `normalizeDetail()` 加 `customerKind: detail.customerKind || 'external'`。
|
||||||
|
7. 变更记录 `getChangeFieldLabel`:`customerType:'客商分类'`,新增 `customerKind:'客商类型'`。
|
||||||
|
8. `formatChangeFieldValue`:别名映射加 `客商分类/客户类型 → customerType`、`客商类型 → customerKind`;valueMap 加 `customerKind:{external:'外部客商',internal:'内部组织'}`。
|
||||||
|
- 校验:用 @vue/compiler-sfc 编译模板,0 错误。
|
||||||
|
|
||||||
|
## 上传证件项 label 贴顶修复(全局 archive-form 垂直居中提升)
|
||||||
|
- 症状:driver.vue 司机弹窗「驾驶证主页/副页」「封面页/内容页」等证件上传项(el-form-item 内容高 151px)label 文字贴顶,普通 32px 控件行看不出来。
|
||||||
|
- 根因:`archive-form` class 被 driver / vehicle / ship / credit-score-quantification / loading-manage / waybill-import-dialog 等 8+ 页面复用,但「label 与控件垂直居中」规则 `.archive-form :deep(.el-form-item){align-items:center}` 锁在 customer-archive.vue 的 scoped 样式里,其它页面拿不到;flex 容器默认 stretch,label(32px) 在高控件行内贴顶。
|
||||||
|
- 修复:规则提升到 `src/styles/element-ui.scss` 全局(紧跟 is-required 星号配套规则之后):`.archive-form .el-form-item { align-items:center }`。全站 archive-form 表单一并生效,label 与控件垂直居中。SCSS 编译通过。
|
||||||
|
|
||||||
|
## 司机弹窗「驾驶证信息」:有效期必填、长期有效不必填(transportCapacity/driver.vue)
|
||||||
|
- 需求:驾驶证信息区「有效期」(起/止,prop `drivingLicenseEndDate`)要必填(显示红*),「长期有效」复选框(prop `drivingLicenseLongTerm`)不必填(去掉红*)。
|
||||||
|
- 改动(formRules 两处):
|
||||||
|
1. `drivingLicenseEndDate` 规则加 `required: true`(`{ required: true, validator: this.validateDrivingLicenseEndDate, trigger: 'change' }`)——仅用于渲染红*,实际校验仍走自定义 validator。
|
||||||
|
2. 删除 `drivingLicenseLongTerm` 的 `{ required: true, message: '请选择驾驶证是否长期有效' }` 规则块。
|
||||||
|
- 关键机制(Element Plus 2.14 + async-validator 4.2.5 已核实):
|
||||||
|
- 红* 由 `form-item` 的 `isRequired = normalizedRules.some(rule => rule.required)` 决定,只要规则对象带 `required` 就显示。
|
||||||
|
- async-validator 的 `rule.validate` 中,若存在 `rule.validator`,直接走自定义 validator 并 return,**不会**再执行 required 空值检查 → 勾「长期有效」时止日被清空/disabled 也不会误报必填。
|
||||||
|
- 校验逻辑保持原样:起始日期恒必填;`longTerm !== 1` 时止日必填。
|
||||||
|
- 未同步:「从业资格证信息」区仍是「有效期无红* + 长期有效有红*」的旧形态(待主人确认是否一并统一)。
|
||||||
|
|
||||||
|
## 司机弹窗 placeholder 统一为「请输入/请选择」(transportCapacity/driver.vue)
|
||||||
|
- 需求:新增/修改司机弹窗输入框 placeholder 去掉后面的字段名称,只保留「请输入」「请选择」。
|
||||||
|
- 改动:18 处 placeholder 简化(7 处 → `请输入`,10 处 → `请选择`,1 处动态 cascader `driverForm.addressRegion || '请选择省市区'` → `|| '请选择'`)。
|
||||||
|
- **保留 4 处**(主人明确确认):
|
||||||
|
1. 驾驶车辆 `请输入或选择车辆` —— 复合操作(既可输入又可点按钮选车),去掉会丢语义。
|
||||||
|
2. 日期范围 `起` / `止` —— 起止标记,非字段提示。
|
||||||
|
3. 资格证号 `默认身份证号` —— 默认值说明,非「请输入」格式。
|
||||||
|
- 未动:表单**校验错误提示 message 仍带字段名**(如「请选择准驾车型」),因报错需指明具体字段,与 placeholder 定位不同;主人未要求,暂保持。
|
||||||
|
- 做法:Python 脚本按完整 placeholder 字符串精确替换(18 规则全命中,未匹配即 exit 1 中断),比逐个 Edit 高效且不会误伤。
|
||||||
|
- 校验:`@vue/compiler-sfc` parse + compileTemplate + compileScript 三项全通过。注意脚本必须放在**项目根目录**下运行(放 /tmp 解析不到 node_modules 里的 @vue/compiler-sfc)。
|
||||||
|
- ⚠️ git diff 显示的 `drivingLicenseLongTerm` 校验规则变动是**本次之前工作区已有的未提交改动**(见上一条日志),非本次引入,勿混淆。
|
||||||
|
|
||||||
|
## 「自动生成结算单」开关加 ? 悬浮提示(3 处)
|
||||||
|
- 需求:开关「开启」后面加问号图标,hover 提示「开启时,系统根据配置规则归集运单,定时生成结算单」。
|
||||||
|
- 改动文件(同一文案,为保持全站一致):
|
||||||
|
1. `src/views/business/components/business-crud-page.vue`(1884 行附近,`.business-crud-page__settlement-switch`)
|
||||||
|
2. `src/views/business/contract-manage.vue`(357 行附近,`.contract-manage-form__settlement-switch`)
|
||||||
|
3. `src/views/business/contract-manage-change.vue`(55 行,`.settlement-switch`,原为单行长标签已拆行)
|
||||||
|
- 写法:`<el-radio :label="1">开启</el-radio>` 后插 `<el-tooltip content="..." placement="top"><el-icon class="settlement-switch-tip"><QuestionFilled /></el-icon></el-tooltip>`,再接「关闭」radio。
|
||||||
|
- 样式:`.settlement-switch-tip { margin:0 4px; color:#a8abb2; cursor:help; font-size:14px }`,各文件 scoped 样式内一份(contract-manage 写在 `&__settlement-switch` 内)。
|
||||||
|
- 注意:图标走 main.js 全局注册(@element-plus/icons-vue 全量注册),无需 import;写法与 `project-apply.vue` 的 `__label-tip` 一致。
|
||||||
|
- 这三个大文件本身已存在 prettier 格式问题(改动前 git HEAD 版本同样 fail),非本次引入。
|
||||||
|
|
||||||
|
## 车辆认证审核弹窗排版对齐新增弹窗(vehicle.vue)
|
||||||
|
- 诊断 `/project-apply/fund-risk-stats` No endpoint:前端已定义 getFundRiskStats(api/business/project-apply.js:13),后端未实现;方案已给(后端补 R<{high,medium}> / 前端 catch 降级),待主人选。
|
||||||
|
- vehicle.vue 认证审核弹窗重排对齐新增弹窗:取消独立「尺寸重量」卡片,外廓尺寸改长/宽/高组合(span12,dimension-group);基础信息 3 行×4 列(车牌号/车辆类型/外廓尺寸;载质量/牵引质量/业务关系/能源类型;强制报废日期/海关备案号/所有组织/使用部门);证件信息按新增「车辆资质图片」行分布(止+运输证号+止+年审 / 登记编号+登记日期+档案编号+行驶证起 / 运输证起 / 备注整行);label「所属组织」改「所有组织」对齐新增;dimension-group 样式复制进 .certification-audit 作用域。@vue/compiler-sfc 编译校验通过。
|
||||||
|
- vehicle.vue 行驶证有效期必填星号:原规则是纯 validator(Element Plus 不渲染星号),改为 data 内 baseRules + computed formRules,drivingLicenseEndDate 动态返回 required 规则(长期有效=1 时返回 [],星号与校验同步消失);删除 validateDrivingLicenseEndDate。经验:Element Plus 星号只在规则含 required:true 时渲染,且 el-form-item 的 :required 属性会被注入为 {required} 规则并产生英文默认提示,不宜用它控制星号。
|
||||||
|
- 备注:车辆保存的「车牌颜色不能为空」「行驶证有效期:必填」均为后端校验(前端无对应规则),需后端改。
|
||||||
|
- driver.vue 从业资格证有效期对齐驾驶证:单日期改 date-range 起/止(列宽 6+6+6+6 → 6+6+8+4),新增 qualificationStartDate 字段(emptyForm + handleSubmit normalize);qualificationEndDate 规则加 required:true(渲染星号,validator 豁免长期);删除 qualificationLongTerm 的 required 规则(长期有效不必填);勾长期后起止均 disabled(比驾驶证更严,驾驶证起仍可编辑)。⚠️ 后端需新增 qualification_start_date 字段否则起日期无法存取。
|
||||||
|
- driver.vue 补充:驾驶证「有效期起」加 :disabled(长期=1 时禁用);驾驶证与从业资格证两个 validator 统一在「长期有效=1」时直接 callback() 放行(起止都不校验、不提示)。禁用不清空旧值,提交时保留原日期(后端以 longTerm 为准)。
|
||||||
|
- contract-manage-change.vue「合同文件」批量下载按钮上移:标题与按钮合并进 .section-head(flex space-between 同排),与「其它附件/计费信息」分区一致;删除无引用的 .attachment-head 样式。
|
||||||
|
- contract-manage-change.vue「自动生成结算单」问号提示图标位置:原 icon 夹在开启/关闭 radio 之间,因 .el-radio 默认 margin-right:32px 导致离开启远、贴关闭;修复 = 开启 radio margin-right 清零 + icon margin 改 0 32px 0 8px。
|
||||||
|
|||||||
@@ -2,6 +2,17 @@
|
|||||||
|
|
||||||
## 设计约定(已确认)
|
## 设计约定(已确认)
|
||||||
|
|
||||||
|
### 表单 placeholder 统一为「请输入 / 请选择」(不带字段名)
|
||||||
|
- **规范**:输入框 placeholder 只写动作词 `请输入` / `请选择`,**后面不跟字段名称**(label 已说明是什么字段,重复无意义)。
|
||||||
|
- 已生效页面: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>`
|
### 弹窗分组:统一用全局 `<section-card>`
|
||||||
- 弹窗 body 背景由 `src/styles/element-ui.scss` 全局 `.el-dialog__body { background:#f5f6fa; padding:16px }` 统一灰底。
|
- 弹窗 body 背景由 `src/styles/element-ui.scss` 全局 `.el-dialog__body { background:#f5f6fa; padding:16px }` 统一灰底。
|
||||||
- 每组 = 白底卡片:4px 主色竖条 + 8px 间距 + 圆角 6px + 淡阴影。组件全局注册 `<section-card title="...">`,支持 `#title` / `#extra` slot。
|
- 每组 = 白底卡片:4px 主色竖条 + 8px 间距 + 圆角 6px + 淡阴影。组件全局注册 `<section-card title="...">`,支持 `#title` / `#extra` slot。
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -58,3 +58,14 @@ export const changeStatus = (id, status) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getBfiExchangeRate = (currencyCode, effectdate) => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-transport/bfi/exchange-rate',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
currencyCode,
|
||||||
|
effectdate,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import request from '@/axios';
|
||||||
|
|
||||||
|
export const getList = (current, size, params) => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/measurement-unit/list',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
current,
|
||||||
|
size,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getDetail = id => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/measurement-unit/detail',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const remove = ids => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/measurement-unit/remove',
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
ids,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const submit = row => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/measurement-unit/submit',
|
||||||
|
method: 'post',
|
||||||
|
data: row,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export const changeStatus = (id, status) => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/measurement-unit/status',
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
id,
|
||||||
|
status,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -92,13 +92,12 @@ export const createCrudApi = baseUrl => ({
|
|||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reassign(id) {
|
reassign(data) {
|
||||||
|
const payload = data && typeof data === 'object' ? data : { id: data };
|
||||||
return request({
|
return request({
|
||||||
url: `${baseUrl}/reassign`,
|
url: `${baseUrl}/reassign`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: {
|
data: payload,
|
||||||
id,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
batchComplete(ids) {
|
batchComplete(ids) {
|
||||||
|
|||||||
@@ -13,11 +13,14 @@ export const getDetail = (id, waybillId) =>
|
|||||||
...(waybillId === undefined ? {} : { waybillId }),
|
...(waybillId === undefined ? {} : { waybillId }),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
export const getVoucherImages = waybillId =>
|
export const getVoucherImages = (waybillId, params = {}) =>
|
||||||
request({
|
request({
|
||||||
url: '/blade-transport/process-config/voucher-images',
|
url: '/blade-transport/process-config/voucher-images',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { waybillId },
|
params: {
|
||||||
|
waybillId,
|
||||||
|
...params,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
export const submit = api.submit;
|
export const submit = api.submit;
|
||||||
export const remove = api.remove;
|
export const remove = api.remove;
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ const api = createCrudApi(baseUrl);
|
|||||||
|
|
||||||
export const getList = api.getList;
|
export const getList = api.getList;
|
||||||
export const getDetail = api.getDetail;
|
export const getDetail = api.getDetail;
|
||||||
|
export const getChangeRecordDetail = (id, recordIndex) =>
|
||||||
|
request({
|
||||||
|
url: `${baseUrl}/change-record/detail`,
|
||||||
|
method: 'get',
|
||||||
|
params: { id, recordIndex },
|
||||||
|
});
|
||||||
export const submit = api.submit;
|
export const submit = api.submit;
|
||||||
export const remove = api.remove;
|
export const remove = api.remove;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export const replaceFolderByObject = (voucherId, plateNo, fileInfo) =>
|
|||||||
export const removeFolder = (voucherId, plateNo) =>
|
export const removeFolder = (voucherId, plateNo) =>
|
||||||
request({ url: `${baseUrl}/folder-remove`, method: 'post', params: { voucherId, plateNo } });
|
request({ url: `${baseUrl}/folder-remove`, method: 'post', params: { voucherId, plateNo } });
|
||||||
export const submit = data => request({ url: `${baseUrl}/submit`, method: 'post', data });
|
export const submit = data => request({ url: `${baseUrl}/submit`, method: 'post', data });
|
||||||
|
export const changeWaybillBatch = data =>
|
||||||
|
request({ url: `${baseUrl}/change-waybill-batch`, method: 'post', data });
|
||||||
export const createUploadDraft = data =>
|
export const createUploadDraft = data =>
|
||||||
request({ url: `${baseUrl}/upload-draft`, method: 'post', data });
|
request({ url: `${baseUrl}/upload-draft`, method: 'post', data });
|
||||||
export const completeUploadFile = data =>
|
export const completeUploadFile = data =>
|
||||||
|
|||||||
@@ -26,6 +26,13 @@ export const maintainMileage = data =>
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
|
/** 运单打卡记录 + 司机上传凭证图 */
|
||||||
|
export const getPunchRecords = waybillId =>
|
||||||
|
request({
|
||||||
|
url: `${baseUrl}/punch-records`,
|
||||||
|
method: 'get',
|
||||||
|
params: { waybillId },
|
||||||
|
});
|
||||||
export const roadLoading = ids =>
|
export const roadLoading = ids =>
|
||||||
request({
|
request({
|
||||||
url: `${baseUrl}/road-loading`,
|
url: `${baseUrl}/road-loading`,
|
||||||
@@ -36,6 +43,7 @@ export const roadLoading = ids =>
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const getImportBatches = params => request({ url: `${baseUrl}/import-batch/list`, method: 'get', params });
|
export const getImportBatches = params => request({ url: `${baseUrl}/import-batch/list`, method: 'get', params });
|
||||||
|
export const getImportBatchNextCode = () => request({ url: `${baseUrl}/import-batch/next-code`, method: 'get' });
|
||||||
export const getImportDetails = params => request({ url: `${baseUrl}/import-batch/details`, method: 'get', params });
|
export const getImportDetails = params => request({ url: `${baseUrl}/import-batch/details`, method: 'get', params });
|
||||||
export const removeImportBatches = ids => request({ url: `${baseUrl}/import-batch/remove`, method: 'post', params: { ids } });
|
export const removeImportBatches = ids => request({ url: `${baseUrl}/import-batch/remove`, method: 'post', params: { ids } });
|
||||||
export const getImportOptions = () => request({ url: `${baseUrl}/import-batch/options`, method: 'get' });
|
export const getImportOptions = () => request({ url: `${baseUrl}/import-batch/options`, method: 'get' });
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ export const syncKingdee = id =>
|
|||||||
request({ url: `${baseUrl}/sync-kingdee`, method: 'post', params: { id } });
|
request({ url: `${baseUrl}/sync-kingdee`, method: 'post', params: { id } });
|
||||||
export const syncKingdeeBatch = ids =>
|
export const syncKingdeeBatch = ids =>
|
||||||
request({ url: `${baseUrl}/sync-kingdee-batch`, method: 'post', data: ids });
|
request({ url: `${baseUrl}/sync-kingdee-batch`, method: 'post', data: ids });
|
||||||
|
export const syncKingdeeResult = () =>
|
||||||
|
request({ url: `${baseUrl}/sync-kingdee-result`, method: 'post' });
|
||||||
|
|
||||||
export const paymentTypeOptions = [
|
export const paymentTypeOptions = [
|
||||||
{ label: '项目预付', value: 'project_advance' },
|
{ label: '项目预付', value: 'project_advance' },
|
||||||
@@ -36,5 +38,8 @@ export const approvalStatusOptions = [
|
|||||||
export const kingdeeStatusOptions = [
|
export const kingdeeStatusOptions = [
|
||||||
{ label: '未生成', value: 'unsynced' },
|
{ label: '未生成', value: 'unsynced' },
|
||||||
{ label: '已生成', value: 'synced' },
|
{ label: '已生成', value: 'synced' },
|
||||||
|
{ label: '付款中', value: 'paying' },
|
||||||
|
{ label: '已付款', value: 'paid' },
|
||||||
|
{ label: '已关闭', value: 'closed' },
|
||||||
{ label: '生成失败', value: 'failed' },
|
{ label: '生成失败', value: 'failed' },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ export const complete = id =>
|
|||||||
request({ url: `${baseUrl}/complete`, method: 'post', params: { id } });
|
request({ url: `${baseUrl}/complete`, method: 'post', params: { id } });
|
||||||
export const completeWithData = data =>
|
export const completeWithData = data =>
|
||||||
request({ url: `${baseUrl}/complete-with-data`, method: 'post', data });
|
request({ url: `${baseUrl}/complete-with-data`, method: 'post', data });
|
||||||
export const template = mode =>
|
export const template = (mode, params) =>
|
||||||
request({ url: `${baseUrl}/template`, method: 'get', params: { mode }, responseType: 'blob' });
|
request({ url: `${baseUrl}/template`, method: 'get', params: { mode, ...params }, responseType: 'blob' });
|
||||||
|
|
||||||
const importFile = (url, id, file) => {
|
const importFile = (url, id, file) => {
|
||||||
const data = new FormData();
|
const data = new FormData();
|
||||||
|
|||||||
@@ -78,3 +78,10 @@ export const getDeptLazyTree = parentId => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getPlatformCompanySelect = () => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-system/dept/platform-company-select',
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import request from '@/axios';
|
||||||
|
|
||||||
|
const baseUrl = '/blade-transport/vehicle-dispatch';
|
||||||
|
|
||||||
|
export const getList = (current, size, params) =>
|
||||||
|
request({ url: `${baseUrl}/list`, method: 'get', params: { ...params, current, size } });
|
||||||
|
|
||||||
|
export const getDetail = id => request({ url: `${baseUrl}/detail`, method: 'get', params: { id } });
|
||||||
|
|
||||||
|
export const submit = row => request({ url: `${baseUrl}/submit`, method: 'post', data: row });
|
||||||
|
|
||||||
|
export const remove = ids => request({ url: `${baseUrl}/remove`, method: 'post', params: { ids } });
|
||||||
|
|
||||||
|
export const submitApproval = id =>
|
||||||
|
request({ url: `${baseUrl}/submit-approval`, method: 'post', params: { id } });
|
||||||
|
|
||||||
|
export const approve = id => request({ url: `${baseUrl}/approve`, method: 'post', params: { id } });
|
||||||
|
|
||||||
|
export const exportVehicleDispatch = params =>
|
||||||
|
request({
|
||||||
|
url: `${baseUrl}/export-vehicle-dispatch`,
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
responseType: 'blob',
|
||||||
|
});
|
||||||
@@ -47,3 +47,11 @@ export const update = row => {
|
|||||||
data: row,
|
data: row,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getExpiryStat = params => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-transport/annual-inspection-record/expiry-stat',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -0,0 +1,133 @@
|
|||||||
|
const dimensionOptions = [
|
||||||
|
{ label: '重量', value: '重量' },
|
||||||
|
{ label: '体积', value: '体积' },
|
||||||
|
{ label: '数量', value: '数量' },
|
||||||
|
];
|
||||||
|
|
||||||
|
const statusOptions = [
|
||||||
|
{ label: '启用', value: 1 },
|
||||||
|
{ label: '停用', value: 2 },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const createOption = () => ({
|
||||||
|
height: 'auto',
|
||||||
|
calcHeight: 32,
|
||||||
|
dialogWidth: 680,
|
||||||
|
labelPosition: 'right',
|
||||||
|
labelWidth: 'auto',
|
||||||
|
tip: false,
|
||||||
|
searchBtnText: '查询',
|
||||||
|
emptyBtnText: '重置',
|
||||||
|
saveBtnText: '提交',
|
||||||
|
updateBtnText: '提交',
|
||||||
|
searchShow: true,
|
||||||
|
searchMenuSpan: 24,
|
||||||
|
searchIcon: true,
|
||||||
|
searchIndex: 4,
|
||||||
|
searchMenuPosition: 'right',
|
||||||
|
border: true,
|
||||||
|
index: true,
|
||||||
|
indexLabel: '序号',
|
||||||
|
indexWidth: 70,
|
||||||
|
addBtn: false,
|
||||||
|
viewBtn: false,
|
||||||
|
editBtn: false,
|
||||||
|
delBtn: false,
|
||||||
|
selection: true,
|
||||||
|
dialogClickModal: false,
|
||||||
|
menuWidth: 240,
|
||||||
|
menuFixed: 'right',
|
||||||
|
column: [
|
||||||
|
{
|
||||||
|
label: '计量单位',
|
||||||
|
prop: 'unitName',
|
||||||
|
minWidth: 150,
|
||||||
|
search: true,
|
||||||
|
searchOrder: 3,
|
||||||
|
searchSpan: 6,
|
||||||
|
maxlength: 50,
|
||||||
|
showWordLimit: true,
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '请输入计量单位', trigger: 'blur' },
|
||||||
|
{ max: 50, message: '计量单位不能超过50个字', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '计量维度',
|
||||||
|
prop: 'dimension',
|
||||||
|
type: 'select',
|
||||||
|
minWidth: 130,
|
||||||
|
search: true,
|
||||||
|
searchOrder: 2,
|
||||||
|
searchSpan: 6,
|
||||||
|
dicData: dimensionOptions,
|
||||||
|
rules: [{ required: true, message: '请选择计量维度', trigger: 'change' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '备注',
|
||||||
|
prop: 'remark',
|
||||||
|
type: 'textarea',
|
||||||
|
minRows: 2,
|
||||||
|
span: 24,
|
||||||
|
minWidth: 200,
|
||||||
|
maxlength: 200,
|
||||||
|
showWordLimit: true,
|
||||||
|
overHidden: true,
|
||||||
|
rules: [{ max: 200, message: '备注不能超过200个字', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '状态',
|
||||||
|
prop: 'status',
|
||||||
|
type: 'select',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 1,
|
||||||
|
searchSpan: 6,
|
||||||
|
slot: true,
|
||||||
|
dataType: 'number',
|
||||||
|
dicData: statusOptions,
|
||||||
|
clearable: true,
|
||||||
|
value: 1,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
minWidth: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '创建人',
|
||||||
|
prop: 'createUserName',
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '更新人',
|
||||||
|
prop: 'updateUserName',
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '创建时间',
|
||||||
|
prop: 'createTime',
|
||||||
|
type: 'datetime',
|
||||||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
sortable: true,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '更新时间',
|
||||||
|
prop: 'updateTime',
|
||||||
|
type: 'datetime',
|
||||||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
sortable: true,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
@@ -41,7 +41,7 @@ export const planStatusOptions = [
|
|||||||
export const waybillStatusOptions = [
|
export const waybillStatusOptions = [
|
||||||
{ label: '草稿', value: 'draft' },
|
{ label: '草稿', value: 'draft' },
|
||||||
{ label: '待执行', value: 'pending' },
|
{ label: '待执行', value: 'pending' },
|
||||||
{ label: '进行中', value: 'processing' },
|
{ label: '进行中', value: 'running' },
|
||||||
{ label: '已完成', value: 'completed' },
|
{ label: '已完成', value: 'completed' },
|
||||||
{ label: '已取消', value: 'cancelled' },
|
{ label: '已取消', value: 'cancelled' },
|
||||||
];
|
];
|
||||||
@@ -97,6 +97,11 @@ export const businessTypeOptions = [
|
|||||||
{ label: '普通业务', value: '普通业务' },
|
{ label: '普通业务', value: '普通业务' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const businessModeOptions = [
|
||||||
|
{ label: '国内运输', value: '国内运输' },
|
||||||
|
{ label: '跨境运输', value: '跨境运输' },
|
||||||
|
];
|
||||||
|
|
||||||
export const settlementModeOptions = [
|
export const settlementModeOptions = [
|
||||||
{ label: '先票后款', value: '先票后款' },
|
{ label: '先票后款', value: '先票后款' },
|
||||||
{ label: '先款后票', value: '先款后票' },
|
{ label: '先款后票', value: '先款后票' },
|
||||||
@@ -125,12 +130,18 @@ export const contractApprovalStatusOptions = [
|
|||||||
{ label: '草稿', value: 'draft' },
|
{ label: '草稿', value: 'draft' },
|
||||||
{ label: '审批中', value: 'reviewing' },
|
{ label: '审批中', value: 'reviewing' },
|
||||||
{ label: '已驳回', value: 'rejected' },
|
{ label: '已驳回', value: 'rejected' },
|
||||||
|
{ label: '已撤回', value: 'withdrawn' },
|
||||||
{ label: '审批通过', value: 'approved' },
|
{ label: '审批通过', value: 'approved' },
|
||||||
{ label: '变更审批中', value: 'change_reviewing' },
|
{ label: '变更审批中', value: 'change_reviewing' },
|
||||||
{ label: '变更驳回', value: 'change_rejected' },
|
{ label: '变更驳回', value: 'change_rejected' },
|
||||||
{ label: '变更审批通过', value: 'change_approved' },
|
{ label: '变更审批通过', value: 'change_approved' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const contractArchiveStatusOptions = [
|
||||||
|
{ label: '未归档', value: '未归档' },
|
||||||
|
{ label: '已归档', value: '已归档' },
|
||||||
|
];
|
||||||
|
|
||||||
export const nodeOptions = [
|
export const nodeOptions = [
|
||||||
{ label: '接单', value: '接单' },
|
{ label: '接单', value: '接单' },
|
||||||
{ label: '到场', value: '到场' },
|
{ label: '到场', value: '到场' },
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
auditColumns,
|
auditColumns,
|
||||||
contractApprovalStatusOptions,
|
contractApprovalStatusOptions,
|
||||||
|
contractArchiveStatusOptions,
|
||||||
contractCategoryOptions,
|
contractCategoryOptions,
|
||||||
contractStageOptions,
|
contractStageOptions,
|
||||||
createCrudOption,
|
createCrudOption,
|
||||||
@@ -27,6 +28,12 @@ const listDicFormatter = res => {
|
|||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const projectNameDicFormatter = res => {
|
||||||
|
const list = listDicFormatter(res);
|
||||||
|
// 过滤掉 projectName 为空的记录
|
||||||
|
return list.filter(item => item && item.projectName && String(item.projectName).trim());
|
||||||
|
};
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
title: '合同管理',
|
title: '合同管理',
|
||||||
permission: 'contract_manage',
|
permission: 'contract_manage',
|
||||||
@@ -42,7 +49,7 @@ export const config = {
|
|||||||
batchDelete: false,
|
batchDelete: false,
|
||||||
enableProjectSelect: true,
|
enableProjectSelect: true,
|
||||||
projectQueryParams: {
|
projectQueryParams: {
|
||||||
approvalStatuses: 'approved,change_approved',
|
contractSelectable: true,
|
||||||
},
|
},
|
||||||
actions: ['copy'],
|
actions: ['copy'],
|
||||||
statusProp: 'approvalStatus',
|
statusProp: 'approvalStatus',
|
||||||
@@ -65,6 +72,10 @@ export const config = {
|
|||||||
['legalSealFlag', '是否需要加盖法人章'],
|
['legalSealFlag', '是否需要加盖法人章'],
|
||||||
['copyCount', '一式(份)'],
|
['copyCount', '一式(份)'],
|
||||||
['paymentDays', '回款账期(天)'],
|
['paymentDays', '回款账期(天)'],
|
||||||
|
['contractAmount', '合同金额'],
|
||||||
|
['templateFlag', '是否范本'],
|
||||||
|
['originalContractNo', '原件合同编号'],
|
||||||
|
['electronicSealFlag', '是否电子章'],
|
||||||
['remark', '备注', 2],
|
['remark', '备注', 2],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -78,6 +89,7 @@ export const config = {
|
|||||||
['effectiveType', '生效类型'],
|
['effectiveType', '生效类型'],
|
||||||
['contractStage', '合同阶段'],
|
['contractStage', '合同阶段'],
|
||||||
['approvalStatus', '审核状态'],
|
['approvalStatus', '审核状态'],
|
||||||
|
['archiveStatus', '归档状态'],
|
||||||
['currentNode', '当前节点'],
|
['currentNode', '当前节点'],
|
||||||
['currentProcessor', '当前处理人'],
|
['currentProcessor', '当前处理人'],
|
||||||
],
|
],
|
||||||
@@ -98,7 +110,7 @@ export const config = {
|
|||||||
},
|
},
|
||||||
deleteStatus: ['draft'],
|
deleteStatus: ['draft'],
|
||||||
deleteStage: ['draft'],
|
deleteStage: ['draft'],
|
||||||
editStatus: ['draft', 'rejected', 'change_rejected'],
|
editStatus: ['draft', 'withdrawn', 'rejected', 'change_rejected'],
|
||||||
operations: [
|
operations: [
|
||||||
{
|
{
|
||||||
action: 'flow',
|
action: 'flow',
|
||||||
@@ -265,8 +277,8 @@ export const option = createCrudOption([
|
|||||||
formslot: true,
|
formslot: true,
|
||||||
order: 165,
|
order: 165,
|
||||||
dicUrl:
|
dicUrl:
|
||||||
'/blade-transport/project-apply/list?current=1&size=9999&approvalStatuses=approved,change_approved',
|
'/blade-transport/project-apply/list?current=1&size=9999&contractSelectable=true',
|
||||||
dicFormatter: listDicFormatter,
|
dicFormatter: projectNameDicFormatter,
|
||||||
props: {
|
props: {
|
||||||
label: 'projectName',
|
label: 'projectName',
|
||||||
value: 'projectName',
|
value: 'projectName',
|
||||||
@@ -479,6 +491,47 @@ export const option = createCrudOption([
|
|||||||
order: 50,
|
order: 50,
|
||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '合同金额',
|
||||||
|
prop: 'contractAmount',
|
||||||
|
type: 'number',
|
||||||
|
min: 0,
|
||||||
|
precision: 2,
|
||||||
|
hide: true,
|
||||||
|
order: 45,
|
||||||
|
minWidth: 130,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '是否范本',
|
||||||
|
prop: 'templateFlag',
|
||||||
|
type: 'select',
|
||||||
|
dicData: [
|
||||||
|
{ label: '否', value: 0 },
|
||||||
|
{ label: '是', value: 1 },
|
||||||
|
],
|
||||||
|
hide: true,
|
||||||
|
order: 40,
|
||||||
|
minWidth: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '原件合同编号',
|
||||||
|
prop: 'originalContractNo',
|
||||||
|
hide: true,
|
||||||
|
order: 35,
|
||||||
|
minWidth: 160,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '是否电子章',
|
||||||
|
prop: 'electronicSealFlag',
|
||||||
|
type: 'select',
|
||||||
|
dicData: [
|
||||||
|
{ label: '否', value: 0 },
|
||||||
|
{ label: '是', value: 1 },
|
||||||
|
],
|
||||||
|
hide: true,
|
||||||
|
order: 30,
|
||||||
|
minWidth: 110,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '创建时间',
|
label: '创建时间',
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
@@ -516,6 +569,19 @@ export const option = createCrudOption([
|
|||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
editDisplay: false,
|
editDisplay: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '归档状态',
|
||||||
|
prop: 'archiveStatus',
|
||||||
|
type: 'select',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 5,
|
||||||
|
searchPlaceholder: '请选择',
|
||||||
|
slot: true,
|
||||||
|
dicData: contractArchiveStatusOptions,
|
||||||
|
minWidth: 110,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '当前节点',
|
label: '当前节点',
|
||||||
prop: 'currentNode',
|
prop: 'currentNode',
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
auditColumns,
|
auditColumns,
|
||||||
|
businessModeOptions,
|
||||||
businessTypeOptions,
|
businessTypeOptions,
|
||||||
createCrudOption,
|
createCrudOption,
|
||||||
nonNegativeRule,
|
nonNegativeRule,
|
||||||
@@ -129,7 +130,7 @@ export const option = createCrudOption([
|
|||||||
hide: true,
|
hide: true,
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
maxlength: 20,
|
maxlength: 20,
|
||||||
rules: textRule('项目简称', 20, true),
|
rules: textRule('项目简称', 20),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '项目类型',
|
label: '项目类型',
|
||||||
@@ -168,16 +169,16 @@ export const option = createCrudOption([
|
|||||||
rules: textRule('业务部门', 50, true),
|
rules: textRule('业务部门', 50, true),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '承办部门',
|
label: '平台公司',
|
||||||
prop: 'undertakeDeptName',
|
prop: 'undertakeDeptName',
|
||||||
search: true,
|
search: true,
|
||||||
searchPlaceholder: '请输入',
|
searchPlaceholder: '请输入',
|
||||||
searchOrder: 8,
|
searchOrder: 8,
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
rules: textRule('承办部门', 50, true),
|
rules: textRule('平台公司', 50, true),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '承办部门ID',
|
label: '平台公司ID',
|
||||||
prop: 'undertakeDeptId',
|
prop: 'undertakeDeptId',
|
||||||
hide: true,
|
hide: true,
|
||||||
},
|
},
|
||||||
@@ -191,6 +192,15 @@ export const option = createCrudOption([
|
|||||||
formatter: row => formatUserRealName(row, 'principal'),
|
formatter: row => formatUserRealName(row, 'principal'),
|
||||||
rules: textRule('项目负责人', 50, true),
|
rules: textRule('项目负责人', 50, true),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '资金使用风险',
|
||||||
|
prop: 'fundUseRisk',
|
||||||
|
slot: true,
|
||||||
|
minWidth: 150,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
hide: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '项目负责人ID',
|
label: '项目负责人ID',
|
||||||
prop: 'principalUserId',
|
prop: 'principalUserId',
|
||||||
@@ -305,6 +315,15 @@ export const option = createCrudOption([
|
|||||||
hide: true,
|
hide: true,
|
||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '业务模式',
|
||||||
|
prop: 'businessMode',
|
||||||
|
type: 'select',
|
||||||
|
dicData: businessModeOptions,
|
||||||
|
hide: true,
|
||||||
|
minWidth: 120,
|
||||||
|
rules: [selectRule('业务模式')],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '项目规模(万元)',
|
label: '项目规模(万元)',
|
||||||
prop: 'projectScale',
|
prop: 'projectScale',
|
||||||
@@ -323,6 +342,15 @@ export const option = createCrudOption([
|
|||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
rules: [nonNegativeRule('预计利润')],
|
rules: [nonNegativeRule('预计利润')],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '利润率(%)',
|
||||||
|
prop: 'profitRate',
|
||||||
|
type: 'number',
|
||||||
|
precision: 2,
|
||||||
|
hide: true,
|
||||||
|
minWidth: 120,
|
||||||
|
rules: [nonNegativeRule('利润率')],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '资金需求(万元)',
|
label: '资金需求(万元)',
|
||||||
prop: 'fundDemand',
|
prop: 'fundDemand',
|
||||||
@@ -414,14 +442,5 @@ export const option = createCrudOption([
|
|||||||
span: 24,
|
span: 24,
|
||||||
hide: true,
|
hide: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '资金使用风险',
|
|
||||||
prop: 'fundUseRisk',
|
|
||||||
slot: true,
|
|
||||||
minWidth: 130,
|
|
||||||
addDisplay: false,
|
|
||||||
editDisplay: false,
|
|
||||||
hide: false,
|
|
||||||
},
|
|
||||||
...auditColumns.map(column => ({ ...column, hide: true })),
|
...auditColumns.map(column => ({ ...column, hide: true })),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import {
|
|||||||
approvalStatusOptions,
|
approvalStatusOptions,
|
||||||
auditColumns,
|
auditColumns,
|
||||||
createCrudOption,
|
createCrudOption,
|
||||||
futureDateRule,
|
|
||||||
nonNegativeRule,
|
nonNegativeRule,
|
||||||
textRule,
|
textRule,
|
||||||
withSearchPlaceholders,
|
withSearchPlaceholders,
|
||||||
@@ -17,6 +16,12 @@ const listDicFormatter = res => {
|
|||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const projectNameDicFormatter = res => {
|
||||||
|
const list = listDicFormatter(res);
|
||||||
|
// 过滤掉 projectName 为空的记录
|
||||||
|
return list.filter(item => item && item.projectName && String(item.projectName).trim());
|
||||||
|
};
|
||||||
|
|
||||||
const userDicFormatter = res =>
|
const userDicFormatter = res =>
|
||||||
listDicFormatter(res).map(user => ({
|
listDicFormatter(res).map(user => ({
|
||||||
...user,
|
...user,
|
||||||
@@ -52,30 +57,25 @@ export const config = {
|
|||||||
detailAlignCenter: true,
|
detailAlignCenter: true,
|
||||||
detailSections: [
|
detailSections: [
|
||||||
{
|
{
|
||||||
title: '申请信息',
|
title: '项目额度信息',
|
||||||
fields: [
|
fields: [
|
||||||
['applicationNo', '申请单号', 1],
|
['projectName', '项目名称', 1],
|
||||||
['projectName', '项目', 1],
|
|
||||||
['projectCode', '项目编号', 1],
|
['projectCode', '项目编号', 1],
|
||||||
['undertakeDeptName', '承办部门', 1],
|
['undertakeDeptName', '承办部门', 1],
|
||||||
['applyDeptName', '申请部门', 1],
|
|
||||||
['applicantName', '申请人', 1],
|
|
||||||
['approvalStatus', '审批状态', 1],
|
|
||||||
['currentNode', '当前节点', 1],
|
|
||||||
['currentProcessor', '当前处理人', 1],
|
|
||||||
['validUntil', '申请有效期至', 1],
|
|
||||||
['remark', '备注', 1],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '额度信息',
|
|
||||||
fields: [
|
|
||||||
['projectFundLimit', '项目资金使用额度(万元)', 1],
|
['projectFundLimit', '项目资金使用额度(万元)', 1],
|
||||||
['usedFundLimit', '已使用项目资金使用额度(万元)', 1],
|
['usedFundLimit', '已使用项目资金使用额度(万元)', 1],
|
||||||
['remainingFundLimit', '剩余项目资金使用额度(万元)', 1],
|
['remainingFundLimit', '剩余项目资金使用额度(万元)', 1],
|
||||||
['applyLimit', '申请临时额度(万元)', 1],
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '临时额度信息',
|
||||||
|
fields: [
|
||||||
|
['applyLimit', '申请临时额度(万元)', 1],
|
||||||
|
['validUntil', '申请有效期至', 1],
|
||||||
|
['remark', '备注', 4],
|
||||||
|
],
|
||||||
|
showAttachment: true,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
operations: [
|
operations: [
|
||||||
{
|
{
|
||||||
@@ -134,6 +134,14 @@ export const option = {
|
|||||||
editDisplay: false,
|
editDisplay: false,
|
||||||
editDisabled: true,
|
editDisabled: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
prop: 'projectQuotaInfoTitle',
|
||||||
|
formslot: true,
|
||||||
|
span: 24,
|
||||||
|
hide: true,
|
||||||
|
labelWidth: 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '项目名称',
|
label: '项目名称',
|
||||||
prop: 'projectName',
|
prop: 'projectName',
|
||||||
@@ -142,7 +150,7 @@ export const option = {
|
|||||||
searchType: 'select',
|
searchType: 'select',
|
||||||
formslot: true,
|
formslot: true,
|
||||||
dicUrl: '/blade-transport/project-apply/list?current=1&size=9999',
|
dicUrl: '/blade-transport/project-apply/list?current=1&size=9999',
|
||||||
dicFormatter: listDicFormatter,
|
dicFormatter: projectNameDicFormatter,
|
||||||
props: {
|
props: {
|
||||||
label: 'projectName',
|
label: 'projectName',
|
||||||
value: 'projectName',
|
value: 'projectName',
|
||||||
@@ -210,6 +218,14 @@ export const option = {
|
|||||||
value: 0,
|
value: 0,
|
||||||
rules: [nonNegativeRule('剩余项目资金使用额度')],
|
rules: [nonNegativeRule('剩余项目资金使用额度')],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
prop: 'temporaryCreditInfoTitle',
|
||||||
|
formslot: true,
|
||||||
|
span: 24,
|
||||||
|
hide: true,
|
||||||
|
labelWidth: 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '申请临时额度(万元)',
|
label: '申请临时额度(万元)',
|
||||||
prop: 'applyLimit',
|
prop: 'applyLimit',
|
||||||
@@ -232,9 +248,27 @@ export const option = {
|
|||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请选择申请有效期至', trigger: 'change' },
|
{ required: true, message: '请选择申请有效期至', trigger: 'change' },
|
||||||
futureDateRule('申请有效期至'),
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '备注',
|
||||||
|
prop: 'remark',
|
||||||
|
type: 'textarea',
|
||||||
|
span: 24,
|
||||||
|
minRows: 2,
|
||||||
|
hide: true,
|
||||||
|
placeholder: '请输入',
|
||||||
|
maxlength: 200,
|
||||||
|
showWordLimit: true,
|
||||||
|
rules: textRule('备注', 200),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '附件',
|
||||||
|
prop: 'attachmentsJson',
|
||||||
|
formslot: true,
|
||||||
|
span: 24,
|
||||||
|
hide: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '申请部门',
|
label: '申请部门',
|
||||||
prop: 'applyDeptName',
|
prop: 'applyDeptName',
|
||||||
@@ -298,25 +332,6 @@ export const option = {
|
|||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
editDisplay: false,
|
editDisplay: false,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '临时额度信息',
|
|
||||||
prop: 'remark',
|
|
||||||
type: 'textarea',
|
|
||||||
span: 24,
|
|
||||||
minRows: 2,
|
|
||||||
hide: true,
|
|
||||||
placeholder: '请输入',
|
|
||||||
maxlength: 200,
|
|
||||||
showWordLimit: true,
|
|
||||||
rules: textRule('临时额度信息', 200),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '附件',
|
|
||||||
prop: 'attachmentsJson',
|
|
||||||
formslot: true,
|
|
||||||
span: 24,
|
|
||||||
hide: true,
|
|
||||||
},
|
|
||||||
...auditColumns.map(column => ({ ...column, hide: true })),
|
...auditColumns.map(column => ({ ...column, hide: true })),
|
||||||
])),
|
])),
|
||||||
dialogWidth: '96%',
|
dialogWidth: '96%',
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ const listDicFormatter = res => {
|
|||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const projectNameDicFormatter = res => {
|
||||||
|
const list = listDicFormatter(res);
|
||||||
|
// 过滤掉 projectName 为空的记录
|
||||||
|
return list.filter(item => item && item.projectName && String(item.projectName).trim());
|
||||||
|
};
|
||||||
|
|
||||||
const parseGoodsRows = value => {
|
const parseGoodsRows = value => {
|
||||||
if (!value) return [];
|
if (!value) return [];
|
||||||
if (Array.isArray(value)) return value;
|
if (Array.isArray(value)) return value;
|
||||||
@@ -209,7 +215,7 @@ export const config = {
|
|||||||
statusProp: 'businessStatus',
|
statusProp: 'businessStatus',
|
||||||
statusTextProp: 'businessStatusName',
|
statusTextProp: 'businessStatusName',
|
||||||
deleteStatus: ['draft', 'waiting_dispatch'],
|
deleteStatus: ['draft', 'waiting_dispatch'],
|
||||||
editStatus: ['draft', 'waiting_dispatch'],
|
editStatus: ['draft', 'waiting_dispatch', 'dispatching'],
|
||||||
detailButton: true,
|
detailButton: true,
|
||||||
detailSections: [
|
detailSections: [
|
||||||
{
|
{
|
||||||
@@ -364,7 +370,7 @@ export const option = {
|
|||||||
span: 6,
|
span: 6,
|
||||||
order: 400,
|
order: 400,
|
||||||
dicUrl: '/blade-transport/project-apply/list?current=1&size=9999',
|
dicUrl: '/blade-transport/project-apply/list?current=1&size=9999',
|
||||||
dicFormatter: listDicFormatter,
|
dicFormatter: projectNameDicFormatter,
|
||||||
props: {
|
props: {
|
||||||
label: 'projectName',
|
label: 'projectName',
|
||||||
value: 'projectName',
|
value: 'projectName',
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ const transportTypeDict = {
|
|||||||
|
|
||||||
const isEmpty = value => value === undefined || value === null || value === '';
|
const isEmpty = value => value === undefined || value === null || value === '';
|
||||||
const normalizeNumericDisplayValue = value => (Number(value) === -1 ? '' : value);
|
const normalizeNumericDisplayValue = value => (Number(value) === -1 ? '' : value);
|
||||||
|
const formatMoneyDisplay = value => {
|
||||||
|
if (isEmpty(value) || Number(value) === -1) return '';
|
||||||
|
const number = Number(value);
|
||||||
|
if (!Number.isFinite(number)) return '';
|
||||||
|
return number.toFixed(2);
|
||||||
|
};
|
||||||
|
|
||||||
const parseJsonArray = value => {
|
const parseJsonArray = value => {
|
||||||
if (Array.isArray(value)) return value;
|
if (Array.isArray(value)) return value;
|
||||||
@@ -92,14 +98,32 @@ const getProcessConfigNodes = row => {
|
|||||||
|
|
||||||
const isAcceptProcessNode = node => node.key === 'accept' || node.name === '接单';
|
const isAcceptProcessNode = node => node.key === 'accept' || node.name === '接单';
|
||||||
|
|
||||||
|
const isTruthyFlag = value => {
|
||||||
|
if (value === true || value === 1) return true;
|
||||||
|
if (value === false || value === 0 || value === null || value === undefined || value === '') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ['true', '1', 'yes'].includes(String(value).trim().toLowerCase());
|
||||||
|
};
|
||||||
|
|
||||||
const requiresDriverAcceptConfirmation = row =>
|
const requiresDriverAcceptConfirmation = row =>
|
||||||
getProcessConfigNodes(row).some(
|
getProcessConfigNodes(row).some(node => {
|
||||||
node =>
|
if (!isAcceptProcessNode(node) || node.enabled === false) return false;
|
||||||
isAcceptProcessNode(node) &&
|
if (node.confirmMode === 'no_confirm_accept') return false;
|
||||||
node.enabled !== false &&
|
// 与后端一致:是否确认=是 即需接单(不强制依赖 confirmDriver)
|
||||||
node.confirmMode === 'yes' &&
|
return node.confirmMode === 'yes' || !node.confirmMode;
|
||||||
node.confirmDriver === true
|
});
|
||||||
);
|
|
||||||
|
const getDriverRejectReason = row => {
|
||||||
|
if (!row) return '';
|
||||||
|
const reason =
|
||||||
|
row.driverRejectReason ||
|
||||||
|
row.driverRefuseReason ||
|
||||||
|
row.acceptRejectReason ||
|
||||||
|
row.rejectReason ||
|
||||||
|
'';
|
||||||
|
return String(reason || '').trim();
|
||||||
|
};
|
||||||
|
|
||||||
const isDriverRejectedStatus = value => {
|
const isDriverRejectedStatus = value => {
|
||||||
if (value === null || value === undefined || typeof value === 'boolean') return false;
|
if (value === null || value === undefined || typeof value === 'boolean') return false;
|
||||||
@@ -122,6 +146,7 @@ const isDriverRejectedStatus = value => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const hasDriverRejectRecord = row => {
|
const hasDriverRejectRecord = row => {
|
||||||
|
if (String(row.driverAcceptStatus || '').toLowerCase() === 'rejected') return true;
|
||||||
const rejectRecordValues = [
|
const rejectRecordValues = [
|
||||||
row.driverRejectTime,
|
row.driverRejectTime,
|
||||||
row.driverRejectedTime,
|
row.driverRejectedTime,
|
||||||
@@ -161,9 +186,16 @@ const hasDriverRejectRecord = row => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isDriverRejectedWaybill = row =>
|
const isDriverRejectedWaybill = row =>
|
||||||
requiresDriverAcceptConfirmation(row) && hasDriverRejectRecord(row);
|
(row.requireAccept === true ||
|
||||||
|
row.requireAccept === 1 ||
|
||||||
|
requiresDriverAcceptConfirmation(row)) &&
|
||||||
|
hasDriverRejectRecord(row);
|
||||||
|
|
||||||
const hasDriverAcceptRecord = row => {
|
const hasDriverAcceptRecord = row => {
|
||||||
|
if (String(row.driverAcceptStatus || '').toLowerCase() === 'accepted') return true;
|
||||||
|
if (['rejected', 'pending'].includes(String(row.driverAcceptStatus || '').toLowerCase())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const recordValues = [
|
const recordValues = [
|
||||||
row.driverAcceptTime,
|
row.driverAcceptTime,
|
||||||
row.driverAcceptedTime,
|
row.driverAcceptedTime,
|
||||||
@@ -172,6 +204,7 @@ const hasDriverAcceptRecord = row => {
|
|||||||
row.driverAcceptedBy,
|
row.driverAcceptedBy,
|
||||||
row.acceptUserId,
|
row.acceptUserId,
|
||||||
row.acceptUserName,
|
row.acceptUserName,
|
||||||
|
row.driverAcceptDriverId,
|
||||||
];
|
];
|
||||||
if (recordValues.some(value => value !== null && value !== undefined && value !== '')) {
|
if (recordValues.some(value => value !== null && value !== undefined && value !== '')) {
|
||||||
return true;
|
return true;
|
||||||
@@ -315,10 +348,10 @@ const formatUnitPrice = row => {
|
|||||||
return billingUnit ? `${billingPrice}(${billingUnit})` : billingPrice;
|
return billingUnit ? `${billingPrice}(${billingUnit})` : billingPrice;
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatAmount = (row, props) => getFirstValue(row, props);
|
const formatAmount = (row, props) => formatMoneyDisplay(getFirstValue(row, props));
|
||||||
|
|
||||||
const sumAmount = list =>
|
const sumAmount = (rows = []) =>
|
||||||
list.reduce((sum, item) => {
|
rows.reduce((sum, item) => {
|
||||||
const value = getFirstValue(item, ['freightAmount', 'amount', 'totalAmount']);
|
const value = getFirstValue(item, ['freightAmount', 'amount', 'totalAmount']);
|
||||||
return isEmpty(value) ? sum : sum + Number(value || 0);
|
return isEmpty(value) ? sum : sum + Number(value || 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
@@ -337,7 +370,7 @@ const calculateFreightTotal = rows => {
|
|||||||
return sum + Number(item.unitPrice || 0) * Number(item.quantity || 0);
|
return sum + Number(item.unitPrice || 0) * Number(item.quantity || 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
if (!hasAmountField) return '';
|
if (!hasAmountField) return '';
|
||||||
return Number.isFinite(total) ? Number(total.toFixed(2)).toString() : '';
|
return Number.isFinite(total) ? total.toFixed(2) : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatFreight = row => {
|
const formatFreight = row => {
|
||||||
@@ -345,9 +378,9 @@ const formatFreight = row => {
|
|||||||
if (!isEmpty(value)) return value;
|
if (!isEmpty(value)) return value;
|
||||||
const freight = parseJsonObject(row.freightJson);
|
const freight = parseJsonObject(row.freightJson);
|
||||||
const freightValue = getFirstValue(freight, ['freightAmount', 'transportFee']);
|
const freightValue = getFirstValue(freight, ['freightAmount', 'transportFee']);
|
||||||
if (!isEmpty(freightValue)) return freightValue;
|
if (!isEmpty(freightValue)) return formatMoneyDisplay(freightValue);
|
||||||
const total = sumAmount(Array.isArray(freight.freightItems) ? freight.freightItems : []);
|
const total = sumAmount(Array.isArray(freight.freightItems) ? freight.freightItems : []);
|
||||||
return total ? total : '';
|
return total ? formatMoneyDisplay(total) : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatOtherFeeTotal = row => {
|
const formatOtherFeeTotal = row => {
|
||||||
@@ -364,10 +397,10 @@ const formatFreightTotal = row => {
|
|||||||
const otherFeeTotal = !isEmpty(otherFee) ? otherFee : formatOtherFeeTotal(row);
|
const otherFeeTotal = !isEmpty(otherFee) ? otherFee : formatOtherFeeTotal(row);
|
||||||
if (!isEmpty(calculated)) {
|
if (!isEmpty(calculated)) {
|
||||||
const total = Number(calculated || 0) + Number(otherFeeTotal || 0);
|
const total = Number(calculated || 0) + Number(otherFeeTotal || 0);
|
||||||
return Number.isFinite(total) ? Number(total.toFixed(2)).toString() : calculated;
|
return Number.isFinite(total) ? total.toFixed(2) : calculated;
|
||||||
}
|
}
|
||||||
const value = getFirstValue(freight, ['totalFreightAmount', 'totalFreight', 'totalAmount']);
|
const value = getFirstValue(freight, ['totalFreightAmount', 'totalFreight', 'totalAmount']);
|
||||||
if (!isEmpty(value)) return value;
|
if (!isEmpty(value)) return formatMoneyDisplay(value);
|
||||||
return formatAmount(row, ['freightTotal', 'totalFreight', 'totalAmount']);
|
return formatAmount(row, ['freightTotal', 'totalFreight', 'totalAmount']);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -425,26 +458,26 @@ export const config = {
|
|||||||
statusProp: 'businessStatus',
|
statusProp: 'businessStatus',
|
||||||
statusTextProp: 'businessStatusName',
|
statusTextProp: 'businessStatusName',
|
||||||
formatStatus(row, prop, defaultText) {
|
formatStatus(row, prop, defaultText) {
|
||||||
if (
|
if (prop !== 'businessStatus') return defaultText;
|
||||||
prop === 'businessStatus' &&
|
const status = String(row.businessStatus || '');
|
||||||
requiresDriverAcceptConfirmation(row) &&
|
const terminalStatuses = ['draft', 'completed', 'cancelled', 'waiting_dispatch', 'dispatching'];
|
||||||
isInProgressStatus(row, defaultText) &&
|
const needAccept =
|
||||||
!hasDriverAcceptRecord(row)
|
row.requireAccept === true ||
|
||||||
) {
|
row.requireAccept === 1 ||
|
||||||
|
requiresDriverAcceptConfirmation(row);
|
||||||
|
// 需司机接单且尚未接单 → 待执行(含库中仍为 running 的历史数据展示校正)
|
||||||
|
if (needAccept && !hasDriverAcceptRecord(row) && !terminalStatuses.includes(status)) {
|
||||||
return '待执行';
|
return '待执行';
|
||||||
}
|
}
|
||||||
if (
|
if (status === 'pending') return '待执行';
|
||||||
prop === 'businessStatus' &&
|
if (status === 'running' || status === 'processing') return '进行中';
|
||||||
row.businessStatus === 'pending' &&
|
|
||||||
!requiresDriverAcceptConfirmation(row)
|
|
||||||
) {
|
|
||||||
return '进行中';
|
|
||||||
}
|
|
||||||
return defaultText;
|
return defaultText;
|
||||||
},
|
},
|
||||||
canReassign(row) {
|
canReassign(row) {
|
||||||
return isDriverRejectedWaybill(row);
|
return isDriverRejectedWaybill(row);
|
||||||
},
|
},
|
||||||
|
getDriverRejectReason,
|
||||||
|
isDriverRejectedWaybill,
|
||||||
canEdit(row) {
|
canEdit(row) {
|
||||||
// 进行中的运单不允许编辑
|
// 进行中的运单不允许编辑
|
||||||
if (isInProgressStatus(row, row.businessStatusName)) {
|
if (isInProgressStatus(row, row.businessStatusName)) {
|
||||||
|
|||||||
@@ -67,9 +67,7 @@ export const feeDetailBaseColumns = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const feeDetailTailColumns = [
|
export const feeDetailTailColumns = [
|
||||||
{ label: '原总金额', prop: 'originalAmountText', minWidth: 120 },
|
{ label: '结算金额', prop: 'originalAmountText', minWidth: 120 },
|
||||||
{ label: '调整金额', prop: 'adjustAmountText', minWidth: 120 },
|
|
||||||
{ label: '调整后总金额', prop: 'afterAmountText', minWidth: 140 },
|
|
||||||
{ label: '备注', prop: 'remark', minWidth: 160 },
|
{ label: '备注', prop: 'remark', minWidth: 160 },
|
||||||
{ label: '最后录入人', prop: 'updateUserName', minWidth: 120 },
|
{ label: '最后录入人', prop: 'updateUserName', minWidth: 120 },
|
||||||
{ label: '最后录入时间', prop: 'updateTime', minWidth: 170 },
|
{ label: '最后录入时间', prop: 'updateTime', minWidth: 170 },
|
||||||
|
|||||||
@@ -76,6 +76,11 @@ export const option = {
|
|||||||
prop: 'posts',
|
prop: 'posts',
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '驾驶车辆',
|
||||||
|
prop: 'drivingVehicle',
|
||||||
|
minWidth: 130,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '所属组织',
|
label: '所属组织',
|
||||||
prop: 'organizationName',
|
prop: 'organizationName',
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const option = {
|
|||||||
label: '车牌号',
|
label: '车牌号',
|
||||||
prop: 'plateNo',
|
prop: 'plateNo',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 6,
|
searchOrder: 7,
|
||||||
slot: true,
|
slot: true,
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
},
|
},
|
||||||
@@ -29,7 +29,7 @@ export const option = {
|
|||||||
label: '业务关系',
|
label: '业务关系',
|
||||||
prop: 'businessRelation',
|
prop: 'businessRelation',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 5,
|
searchOrder: 6,
|
||||||
searchValue: '',
|
searchValue: '',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
dicData: [
|
dicData: [
|
||||||
@@ -50,11 +50,18 @@ export const option = {
|
|||||||
slot: true,
|
slot: true,
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '使用部门',
|
||||||
|
prop: 'useDepartment',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 3,
|
||||||
|
minWidth: 140,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '车辆类型',
|
label: '车辆类型',
|
||||||
prop: 'vehicleType',
|
prop: 'vehicleType',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 4,
|
searchOrder: 5,
|
||||||
type: 'select',
|
type: 'select',
|
||||||
dicData: [
|
dicData: [
|
||||||
{ label: '全部', value: '' },
|
{ label: '全部', value: '' },
|
||||||
@@ -108,7 +115,7 @@ export const option = {
|
|||||||
label: '车辆状态',
|
label: '车辆状态',
|
||||||
prop: 'status',
|
prop: 'status',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 3,
|
searchOrder: 4,
|
||||||
type: 'select',
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
dicData: [
|
dicData: [
|
||||||
|
|||||||
@@ -0,0 +1,181 @@
|
|||||||
|
const approvalStatusOptions = [
|
||||||
|
{ label: '草稿', value: 'draft' },
|
||||||
|
{ label: '审批中', value: 'reviewing' },
|
||||||
|
{ label: '已驳回', value: 'rejected' },
|
||||||
|
{ label: '审批通过', value: 'approved' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const statusName = status =>
|
||||||
|
approvalStatusOptions.find(item => item.value === status)?.label || status || '-';
|
||||||
|
|
||||||
|
export const option = {
|
||||||
|
height: 'auto',
|
||||||
|
calcHeight: 32,
|
||||||
|
dialogWidth: 1200,
|
||||||
|
labelPosition: 'right',
|
||||||
|
labelWidth: 'auto',
|
||||||
|
tip: false,
|
||||||
|
searchBtnText: '查询',
|
||||||
|
emptyBtnText: '重置',
|
||||||
|
saveBtnText: '提交',
|
||||||
|
updateBtnText: '提交',
|
||||||
|
searchShow: true,
|
||||||
|
searchMenuSpan: 24,
|
||||||
|
searchIndex: 4,
|
||||||
|
searchMenuPosition: 'right',
|
||||||
|
border: true,
|
||||||
|
index: true,
|
||||||
|
indexLabel: '序号',
|
||||||
|
indexWidth: 70,
|
||||||
|
addBtn: false,
|
||||||
|
editBtn: false,
|
||||||
|
delBtn: false,
|
||||||
|
viewBtn: false,
|
||||||
|
selection: false,
|
||||||
|
dialogClickModal: false,
|
||||||
|
menuFixed: 'right',
|
||||||
|
menuWidth: 320,
|
||||||
|
column: [
|
||||||
|
// ========== 表格列(顺序固定)==========
|
||||||
|
{
|
||||||
|
label: '申请单号',
|
||||||
|
prop: 'applicationNo',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 5,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
minWidth: 180,
|
||||||
|
slot: true,
|
||||||
|
addDisplay: true,
|
||||||
|
editDisabled: true,
|
||||||
|
disabled: true,
|
||||||
|
placeholder: '保存后自动生成',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '车牌号',
|
||||||
|
prop: 'plateNo',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 4,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
minWidth: 120,
|
||||||
|
formslot: true,
|
||||||
|
rules: [{ required: true, message: '请选择车牌号', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '所属组织',
|
||||||
|
prop: 'organizationName',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 3,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
minWidth: 140,
|
||||||
|
disabled: true,
|
||||||
|
placeholder: '选择车牌号后自动填充',
|
||||||
|
rules: [{ required: true, message: '请输入所属组织', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '使用部门',
|
||||||
|
prop: 'useDepartment',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 2,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
minWidth: 140,
|
||||||
|
formslot: true,
|
||||||
|
span: 12,
|
||||||
|
rules: [{ required: true, message: '请选择使用部门', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '车辆类型',
|
||||||
|
prop: 'vehicleType',
|
||||||
|
minWidth: 110,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '审批状态',
|
||||||
|
prop: 'approvalStatus',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 1,
|
||||||
|
type: 'select',
|
||||||
|
dicData: approvalStatusOptions,
|
||||||
|
slot: true,
|
||||||
|
minWidth: 120,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '当前节点',
|
||||||
|
prop: 'currentNode',
|
||||||
|
minWidth: 120,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '当前处理人',
|
||||||
|
prop: 'currentProcessor',
|
||||||
|
minWidth: 130,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '创建人',
|
||||||
|
prop: 'createUserName',
|
||||||
|
minWidth: 120,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '创建时间',
|
||||||
|
prop: 'createTime',
|
||||||
|
type: 'datetime',
|
||||||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
minWidth: 170,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
},
|
||||||
|
// ========== 新增/编辑表单专用(不进表格)==========
|
||||||
|
{
|
||||||
|
label: '申请人',
|
||||||
|
prop: 'applicantName',
|
||||||
|
hide: true,
|
||||||
|
display: true,
|
||||||
|
addDisplay: true,
|
||||||
|
editDisplay: true,
|
||||||
|
viewDisplay: true,
|
||||||
|
disabled: true,
|
||||||
|
span: 12,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '申请时间',
|
||||||
|
prop: 'applyTime',
|
||||||
|
type: 'datetime',
|
||||||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
hide: true,
|
||||||
|
display: true,
|
||||||
|
addDisplay: true,
|
||||||
|
editDisplay: true,
|
||||||
|
viewDisplay: true,
|
||||||
|
disabled: true,
|
||||||
|
span: 12,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '备注',
|
||||||
|
prop: 'remark',
|
||||||
|
type: 'textarea',
|
||||||
|
hide: true,
|
||||||
|
span: 24,
|
||||||
|
maxlength: 200,
|
||||||
|
showWordLimit: true,
|
||||||
|
rules: [{ max: 200, message: '备注不能超过200个字', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '附件',
|
||||||
|
prop: 'attachments',
|
||||||
|
hide: true,
|
||||||
|
span: 24,
|
||||||
|
minWidth: 100,
|
||||||
|
formslot: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
@@ -70,14 +70,16 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '输入车牌号/船号查询选择',
|
placeholder: '请选择车牌号/船号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号/船号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号/船号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -75,14 +75,16 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '输入车牌号/船号查询选择',
|
placeholder: '请选择车牌号/船号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号/船号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号/船号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -105,6 +107,7 @@ export const option = {
|
|||||||
type: 'date',
|
type: 'date',
|
||||||
format: 'YYYY-MM-DD',
|
format: 'YYYY-MM-DD',
|
||||||
valueFormat: 'YYYY-MM-DD',
|
valueFormat: 'YYYY-MM-DD',
|
||||||
|
slot: true,
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '请输入',
|
placeholder: '请输入',
|
||||||
@@ -191,23 +194,12 @@ export const option = {
|
|||||||
formslot: true,
|
formslot: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '检测评定开始日期',
|
label: '检测评定日期',
|
||||||
prop: 'inspectionAssessmentDateStart',
|
prop: 'inspectionAssessmentDateRange',
|
||||||
type: 'date',
|
|
||||||
format: 'YYYY-MM-DD',
|
|
||||||
valueFormat: 'YYYY-MM-DD',
|
|
||||||
search: true,
|
|
||||||
hide: true,
|
|
||||||
addDisplay: false,
|
|
||||||
editDisplay: false,
|
|
||||||
viewDisplay: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '检测评定结束日期',
|
|
||||||
prop: 'inspectionAssessmentDateEnd',
|
|
||||||
type: 'date',
|
type: 'date',
|
||||||
format: 'YYYY-MM-DD',
|
format: 'YYYY-MM-DD',
|
||||||
valueFormat: 'YYYY-MM-DD',
|
valueFormat: 'YYYY-MM-DD',
|
||||||
|
searchRange: true,
|
||||||
search: true,
|
search: true,
|
||||||
hide: true,
|
hide: true,
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
|
|||||||
@@ -54,9 +54,11 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
searchOrder: 4,
|
searchOrder: 4,
|
||||||
span: 12,
|
span: 12,
|
||||||
order: 10,
|
order: 10,
|
||||||
|
|||||||
@@ -49,14 +49,16 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号',
|
label: '车牌号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '输入车牌号模糊查询选择',
|
placeholder: '请选择车牌号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -78,17 +78,20 @@ export const option = {
|
|||||||
prop: 'policyFile',
|
prop: 'policyFile',
|
||||||
formslot: true,
|
formslot: true,
|
||||||
hide: true,
|
hide: true,
|
||||||
|
viewDisplay: false,
|
||||||
span: 24,
|
span: 24,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号/船号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号/船号', trigger: 'change' },
|
||||||
{ max: 50, message: '最多 50 个字符', trigger: 'blur' },
|
{ max: 50, message: '最多 50 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -108,6 +111,7 @@ export const option = {
|
|||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入保单号', trigger: 'blur' },
|
{ required: true, message: '请输入保单号', trigger: 'blur' },
|
||||||
{ max: 80, message: '最多 80 个字符', trigger: 'blur' },
|
{ max: 80, message: '最多 80 个字符', trigger: 'blur' },
|
||||||
|
{ pattern: /^[a-zA-Z0-9]+$/, message: '保单号只能输入数字、字母', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,13 +40,15 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号',
|
label: '车牌号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
searchSpan: 6,
|
searchSpan: 6,
|
||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -92,13 +92,15 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
placeholder: '输入车牌号/船号查询选择',
|
placeholder: '请选择车牌号/船号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号/船号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号/船号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,16 +17,6 @@ export const vehicleTypeDic = [
|
|||||||
{ label: '船舶', value: '船舶' },
|
{ label: '船舶', value: '船舶' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const expenseTypeDic = [
|
|
||||||
{ label: '过路费', value: '过路费' },
|
|
||||||
{ label: '停车费', value: '停车费' },
|
|
||||||
{ label: '维修费', value: '维修费' },
|
|
||||||
{ label: '保险费', value: '保险费' },
|
|
||||||
{ label: '年检费', value: '年检费' },
|
|
||||||
{ label: '装卸费', value: '装卸费' },
|
|
||||||
{ label: '其他', value: '其他' },
|
|
||||||
];
|
|
||||||
|
|
||||||
export const option = {
|
export const option = {
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
calcHeight: 32,
|
calcHeight: 32,
|
||||||
@@ -68,14 +58,16 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '输入车牌号/船号查询选择',
|
placeholder: '请选择车牌号/船号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号/船号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号/船号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -95,7 +87,7 @@ export const option = {
|
|||||||
label: '费用类型',
|
label: '费用类型',
|
||||||
prop: 'expenseType',
|
prop: 'expenseType',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
dicData: expenseTypeDic,
|
dicData: [],
|
||||||
search: true,
|
search: true,
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
span: 12,
|
span: 12,
|
||||||
|
|||||||
@@ -49,14 +49,16 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号',
|
label: '车牌号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '输入车牌号查询选择',
|
placeholder: '请选择车牌号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -47,11 +47,13 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
placeholder: '输入车牌号/船号模糊查询选择',
|
placeholder: '请选择车牌号/船号',
|
||||||
rules: [{ max: 30, message: '最多 30 个字符', trigger: 'blur' }],
|
rules: [{ max: 30, message: '最多 30 个字符', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,14 +70,16 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '输入车牌号/船号查询选择',
|
placeholder: '请选择车牌号/船号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号/船号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号/船号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -117,13 +119,13 @@ export const option = {
|
|||||||
{
|
{
|
||||||
label: '日期',
|
label: '日期',
|
||||||
prop: 'violationTime',
|
prop: 'violationTime',
|
||||||
type: 'datetime',
|
type: 'date',
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
format: 'YYYY-MM-DD',
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
minWidth: 170,
|
minWidth: 140,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
rules: [{ required: true, message: '请选择时间', trigger: 'click' }],
|
rules: [{ required: true, message: '请选择日期', trigger: 'click' }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '地点',
|
label: '地点',
|
||||||
|
|||||||
@@ -2,11 +2,35 @@ import router from './router/';
|
|||||||
import store from './store';
|
import store from './store';
|
||||||
import { tabKeyOf } from '@/router/tab';
|
import { tabKeyOf } from '@/router/tab';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
|
import {
|
||||||
|
isChunkLoadError,
|
||||||
|
reloadForChunkError,
|
||||||
|
setPendingRoutePath,
|
||||||
|
} from '@/utils/chunk-reload';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
import NProgress from 'nprogress'; // progress bar
|
import NProgress from 'nprogress'; // progress bar
|
||||||
import 'nprogress/nprogress.css'; // progress bar style
|
import 'nprogress/nprogress.css'; // progress bar style
|
||||||
NProgress.configure({ showSpinner: false });
|
NProgress.configure({ showSpinner: false });
|
||||||
const lockPage = '/lock'; //锁屏页
|
const lockPage = '/lock'; //锁屏页
|
||||||
|
|
||||||
|
// 懒加载 chunk / CSS 失败时整页刷新,避免菜单点击后卡死
|
||||||
|
router.onError(error => {
|
||||||
|
if (!isChunkLoadError(error)) return;
|
||||||
|
if (reloadForChunkError()) {
|
||||||
|
ElMessage.warning('页面资源加载失败,正在重新加载…');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('unhandledrejection', event => {
|
||||||
|
if (!isChunkLoadError(event.reason)) return;
|
||||||
|
if (reloadForChunkError()) {
|
||||||
|
event.preventDefault();
|
||||||
|
ElMessage.warning('页面资源加载失败,正在重新加载…');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
|
setPendingRoutePath(to.fullPath);
|
||||||
const meta = to.meta || {};
|
const meta = to.meta || {};
|
||||||
const isMenu = meta.menu === undefined ? to.query.menu : meta.menu;
|
const isMenu = meta.menu === undefined ? to.query.menu : meta.menu;
|
||||||
store.commit('SET_IS_MENU', isMenu === undefined);
|
store.commit('SET_IS_MENU', isMenu === undefined);
|
||||||
|
|||||||
@@ -155,6 +155,18 @@ export default [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/business/contract-manage/detail',
|
||||||
|
component: Layout,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: '合同详情',
|
||||||
|
meta: { keepAlive: false, activeMenu: '/business/contract-manage' },
|
||||||
|
component: () => import('@/views/business/contract-manage.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/business/project-apply/form',
|
path: '/business/project-apply/form',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|||||||
@@ -1085,6 +1085,14 @@ td.el-table-fixed-column--right {
|
|||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============ archive-form:label 与控件垂直居中(全站复用) ============
|
||||||
|
// archive-form class 被 driver / vehicle / ship / credit-score-quantification / loading-manage 等
|
||||||
|
// 多个页面复用,但「垂直居中」规则原本锁在 customer-archive.vue 的 scoped 样式里,
|
||||||
|
// 其它页面拿不到 → 高控件行(证件上传 151px)label 贴顶。提升为全局统一生效。
|
||||||
|
.archive-form .el-form-item {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
//.el-form-item {
|
//.el-form-item {
|
||||||
// margin-bottom: 15px !important;
|
// margin-bottom: 15px !important;
|
||||||
//}
|
//}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* 懒加载 chunk / CSS preload 失败后的整页恢复。
|
||||||
|
* 常见于:部署后旧 hash 失效、静态服务空闲断连、代理 CONNECTION_RESET。
|
||||||
|
*/
|
||||||
|
|
||||||
|
const RELOAD_FLAG = 'app:chunk-reload-ts';
|
||||||
|
const RELOAD_COOLDOWN_MS = 10000;
|
||||||
|
|
||||||
|
const CHUNK_ERROR_RE =
|
||||||
|
/Failed to fetch dynamically imported module|Importing a module script failed|Unable to preload CSS|error loading dynamically imported module|Loading CSS chunk|Loading chunk .+ failed|ChunkLoadError/i;
|
||||||
|
|
||||||
|
/** 最近一次路由跳转目标,供 onError 时整页落到正确地址 */
|
||||||
|
let pendingFullPath = '';
|
||||||
|
|
||||||
|
export function setPendingRoutePath(fullPath = '') {
|
||||||
|
pendingFullPath = fullPath || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isChunkLoadError(error) {
|
||||||
|
if (!error) return false;
|
||||||
|
const message = error.message || String(error);
|
||||||
|
return CHUNK_ERROR_RE.test(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {boolean} 是否已触发刷新(冷却期内返回 false,避免死循环)
|
||||||
|
*/
|
||||||
|
export function reloadForChunkError(targetPath) {
|
||||||
|
const now = Date.now();
|
||||||
|
const last = Number(sessionStorage.getItem(RELOAD_FLAG) || 0);
|
||||||
|
if (now - last < RELOAD_COOLDOWN_MS) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sessionStorage.setItem(RELOAD_FLAG, String(now));
|
||||||
|
const path = targetPath || pendingFullPath || window.location.pathname + window.location.search + window.location.hash;
|
||||||
|
window.location.assign(path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -20,6 +20,16 @@
|
|||||||
批量删除
|
批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<div class="insurance-ocr-template-page__search">
|
<div class="insurance-ocr-template-page__search">
|
||||||
|
<el-select
|
||||||
|
v-model="query.vehicleType"
|
||||||
|
clearable
|
||||||
|
placeholder="车船类型"
|
||||||
|
style="width: 140px"
|
||||||
|
@change="search"
|
||||||
|
>
|
||||||
|
<el-option label="车辆" value="车辆" />
|
||||||
|
<el-option label="船舶" value="船舶" />
|
||||||
|
</el-select>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="query.name"
|
v-model="query.name"
|
||||||
clearable
|
clearable
|
||||||
@@ -42,6 +52,7 @@
|
|||||||
<el-table-column type="selection" width="48" />
|
<el-table-column type="selection" width="48" />
|
||||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||||
<el-table-column prop="name" label="模板名称" min-width="220" show-overflow-tooltip />
|
<el-table-column prop="name" label="模板名称" min-width="220" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="vehicleType" label="车船类型" min-width="110" />
|
||||||
<el-table-column label="已配置字段" min-width="150">
|
<el-table-column label="已配置字段" min-width="150">
|
||||||
<template #default="{ row }">{{ getMappingCount(row.mappingConfig) }}</template>
|
<template #default="{ row }">{{ getMappingCount(row.mappingConfig) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -94,6 +105,12 @@
|
|||||||
<el-form-item label="模板名称" prop="name">
|
<el-form-item label="模板名称" prop="name">
|
||||||
<el-input v-model="form.name" maxlength="100" show-word-limit />
|
<el-input v-model="form.name" maxlength="100" show-word-limit />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="车船类型" prop="vehicleType">
|
||||||
|
<el-radio-group v-model="form.vehicleType">
|
||||||
|
<el-radio label="车辆">车辆</el-radio>
|
||||||
|
<el-radio label="船舶">船舶</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="字段映射" required>
|
<el-form-item label="字段映射" required>
|
||||||
<el-table :data="mappingRows" border class="insurance-ocr-template-page__mapping-table">
|
<el-table :data="mappingRows" border class="insurance-ocr-template-page__mapping-table">
|
||||||
<el-table-column prop="key" label="键名" width="180" align="center" />
|
<el-table-column prop="key" label="键名" width="180" align="center" />
|
||||||
@@ -165,8 +182,8 @@ export default {
|
|||||||
readonly: false,
|
readonly: false,
|
||||||
data: [],
|
data: [],
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
query: { name: '' },
|
query: { name: '', vehicleType: '' },
|
||||||
form: { id: '', name: '' },
|
form: { id: '', name: '', vehicleType: '车辆' },
|
||||||
mappingRows: createMappingRows(),
|
mappingRows: createMappingRows(),
|
||||||
page: {
|
page: {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@@ -176,6 +193,7 @@ export default {
|
|||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
name: [{ required: true, message: '请输入模板名称', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入模板名称', trigger: 'blur' }],
|
||||||
|
vehicleType: [{ required: true, message: '请选择车船类型', trigger: 'change' }],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -218,6 +236,7 @@ export default {
|
|||||||
},
|
},
|
||||||
resetSearch() {
|
resetSearch() {
|
||||||
this.query.name = '';
|
this.query.name = '';
|
||||||
|
this.query.vehicleType = '';
|
||||||
this.search();
|
this.search();
|
||||||
},
|
},
|
||||||
currentChange(currentPage) {
|
currentChange(currentPage) {
|
||||||
@@ -235,18 +254,23 @@ export default {
|
|||||||
openDialog(row, readonly = false) {
|
openDialog(row, readonly = false) {
|
||||||
this.readonly = readonly;
|
this.readonly = readonly;
|
||||||
if (!row?.id) {
|
if (!row?.id) {
|
||||||
|
this.form = { id: '', name: '', vehicleType: '车辆' };
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getDetail(row.id).then(res => {
|
getDetail(row.id).then(res => {
|
||||||
const detail = res.data.data || {};
|
const detail = res.data.data || {};
|
||||||
this.form = { id: detail.id, name: detail.name || '' };
|
this.form = {
|
||||||
|
id: detail.id,
|
||||||
|
name: detail.name || '',
|
||||||
|
vehicleType: detail.vehicleType || '车辆',
|
||||||
|
};
|
||||||
this.mappingRows = createMappingRows(detail.mappingConfig);
|
this.mappingRows = createMappingRows(detail.mappingConfig);
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.form = { id: '', name: '' };
|
this.form = { id: '', name: '', vehicleType: '车辆' };
|
||||||
this.mappingRows = createMappingRows();
|
this.mappingRows = createMappingRows();
|
||||||
this.readonly = false;
|
this.readonly = false;
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
@@ -264,6 +288,7 @@ export default {
|
|||||||
submit({
|
submit({
|
||||||
id: this.form.id || undefined,
|
id: this.form.id || undefined,
|
||||||
name: String(this.form.name || '').trim(),
|
name: String(this.form.name || '').trim(),
|
||||||
|
vehicleType: this.form.vehicleType || '车辆',
|
||||||
mappingConfig: JSON.stringify(
|
mappingConfig: JSON.stringify(
|
||||||
this.mappingRows.map(item => ({ key: item.key, value: String(item.value || '').trim() }))
|
this.mappingRows.map(item => ({ key: item.key, value: String(item.value || '').trim() }))
|
||||||
),
|
),
|
||||||
@@ -311,7 +336,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
width: 380px;
|
width: 520px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__mapping-table {
|
&__mapping-table {
|
||||||
|
|||||||
@@ -0,0 +1,255 @@
|
|||||||
|
<template>
|
||||||
|
<basic-container class="measurement-unit-page">
|
||||||
|
<avue-crud
|
||||||
|
:option="option"
|
||||||
|
:table-loading="loading"
|
||||||
|
:data="data"
|
||||||
|
v-model:page="page"
|
||||||
|
v-model="form"
|
||||||
|
ref="crud"
|
||||||
|
:permission="permissionList"
|
||||||
|
:before-open="beforeOpen"
|
||||||
|
@row-save="rowSave"
|
||||||
|
@row-update="rowUpdate"
|
||||||
|
@search-change="searchChange"
|
||||||
|
@search-reset="searchReset"
|
||||||
|
@selection-change="selectionChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
@refresh-change="refreshChange"
|
||||||
|
@on-load="onLoad"
|
||||||
|
>
|
||||||
|
<template #menu-left>
|
||||||
|
<el-button
|
||||||
|
v-if="hasPermission('measurement_unit_add')"
|
||||||
|
type="primary"
|
||||||
|
@click="$refs.crud.rowAdd()"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="hasPermission('measurement_unit_delete')"
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
:disabled="!selectionList.length"
|
||||||
|
@click="handleDelete"
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<template #dimension="{ row }">
|
||||||
|
{{ row.dimension || '-' }}
|
||||||
|
</template>
|
||||||
|
<template #status="{ row }">
|
||||||
|
<el-tag :type="row.status === 1 ? 'primary' : 'info'" class="status-text">
|
||||||
|
{{ row.status === 1 ? '启用' : '停用' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
<template #menu="{ row, index }">
|
||||||
|
<el-link
|
||||||
|
v-if="hasPermission('measurement_unit_edit')"
|
||||||
|
type="primary"
|
||||||
|
@click="$refs.crud.rowEdit(row, index)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="hasPermission('measurement_unit_status')"
|
||||||
|
type="primary"
|
||||||
|
@click="handleStatus(row)"
|
||||||
|
>
|
||||||
|
{{ row.status === 1 ? '停用' : '启用' }}
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="hasPermission('measurement_unit_delete')"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(row.id)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</avue-crud>
|
||||||
|
<empty-pagination
|
||||||
|
:page="page"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
@load="onLoad(page, query)"
|
||||||
|
/>
|
||||||
|
</basic-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import { changeStatus, getDetail, getList, remove, submit } from '@/api/base/measurement-unit';
|
||||||
|
import { createOption } from '@/option/base/measurement-unit';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {},
|
||||||
|
query: {},
|
||||||
|
loading: true,
|
||||||
|
data: [],
|
||||||
|
page: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageSizes: [10, 20, 50, 100],
|
||||||
|
currentPage: 1,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
selectionList: [],
|
||||||
|
option: createOption(),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['permission', 'userInfo']),
|
||||||
|
permissionList() {
|
||||||
|
return {
|
||||||
|
addBtn: this.hasPermission('measurement_unit_add'),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
ids() {
|
||||||
|
return this.selectionList.map(item => item.id).join(',');
|
||||||
|
},
|
||||||
|
isAdmin() {
|
||||||
|
return String(this.userInfo?.authority || '').includes('admin');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
hasPermission(code) {
|
||||||
|
return this.isAdmin || this.permission?.[code] === true;
|
||||||
|
},
|
||||||
|
normalizeRow(row) {
|
||||||
|
row.unitName = String(row.unitName || '').trim();
|
||||||
|
row.dimension = String(row.dimension || '').trim();
|
||||||
|
row.remark = String(row.remark || '').trim();
|
||||||
|
if (!row.status) row.status = 1;
|
||||||
|
return row;
|
||||||
|
},
|
||||||
|
rowSave(row, done, loading) {
|
||||||
|
submit(this.normalizeRow(row)).then(
|
||||||
|
() => {
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
this.$message.success('操作成功');
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
() => loading()
|
||||||
|
);
|
||||||
|
},
|
||||||
|
rowUpdate(row, index, done, loading) {
|
||||||
|
submit(this.normalizeRow(row)).then(
|
||||||
|
() => {
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
this.$message.success('操作成功');
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
() => loading()
|
||||||
|
);
|
||||||
|
},
|
||||||
|
handleDelete(ids = '') {
|
||||||
|
const targetIds = ids || this.ids;
|
||||||
|
if (!targetIds) {
|
||||||
|
this.$message.warning('请选择至少一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$confirm('确定删除所选数据,删除后不可恢复?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => remove(targetIds))
|
||||||
|
.then(() => {
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
this.$message.success('操作成功');
|
||||||
|
this.selectionList = [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleStatus(row) {
|
||||||
|
const nextStatus = row.status === 1 ? 2 : 1;
|
||||||
|
const actionName = nextStatus === 1 ? '启用' : '停用';
|
||||||
|
this.$confirm(`是否确认${actionName}该计量单位?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => changeStatus(row.id, nextStatus))
|
||||||
|
.then(() => {
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
this.$message.success('操作成功');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
beforeOpen(done, type) {
|
||||||
|
if (['edit', 'view'].includes(type)) {
|
||||||
|
getDetail(this.form.id).then(res => {
|
||||||
|
this.form = res.data.data || {};
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.form.status = 1;
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
searchReset() {
|
||||||
|
this.query = {};
|
||||||
|
this.page.currentPage = 1;
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
},
|
||||||
|
searchChange(params, done) {
|
||||||
|
this.query = { ...params };
|
||||||
|
this.page.currentPage = 1;
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
selectionChange(list) {
|
||||||
|
this.selectionList = list;
|
||||||
|
},
|
||||||
|
currentChange(currentPage) {
|
||||||
|
this.page.currentPage = currentPage;
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
},
|
||||||
|
sizeChange(pageSize) {
|
||||||
|
this.page.pageSize = pageSize;
|
||||||
|
this.page.currentPage = 1;
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
},
|
||||||
|
refreshChange() {
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
},
|
||||||
|
onLoad(page = this.page, params = this.query) {
|
||||||
|
this.loading = true;
|
||||||
|
return getList(page.currentPage, page.pageSize, params)
|
||||||
|
.then(res => {
|
||||||
|
const pageData = res.data.data || {};
|
||||||
|
this.data = pageData.records || [];
|
||||||
|
this.page.total = pageData.total || 0;
|
||||||
|
this.selectionList = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.measurement-unit-page {
|
||||||
|
:deep(.avue-crud__menu) {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.avue-crud__search .el-form-item__label) {
|
||||||
|
min-width: 160px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.avue-crud__menu-column) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.avue-crud__menu .el-link) {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -251,7 +251,12 @@ export default {
|
|||||||
prop: 'regionLevel',
|
prop: 'regionLevel',
|
||||||
type: 'radio',
|
type: 'radio',
|
||||||
dicUrl: '/blade-system/dict/dictionary?code=region',
|
dicUrl: '/blade-system/dict/dictionary?code=region',
|
||||||
dicFormatter: list => list.filter(item => Number(item.dictKey) !== 0),
|
dicFormatter: response => {
|
||||||
|
const list = Array.isArray(response) ? response : response?.data;
|
||||||
|
return (Array.isArray(list) ? list : [])
|
||||||
|
.filter(item => Number(item.dictKey) !== 0)
|
||||||
|
.map(item => ({ ...item, dictKey: Number(item.dictKey) }));
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
label: 'dictValue',
|
label: 'dictValue',
|
||||||
value: 'dictKey',
|
value: 'dictKey',
|
||||||
|
|||||||
@@ -229,32 +229,38 @@
|
|||||||
</div></template
|
</div></template
|
||||||
></el-table-column
|
></el-table-column
|
||||||
>
|
>
|
||||||
<el-table-column label="保底计费重量" width="240"
|
<el-table-column width="240"
|
||||||
|
><template #header
|
||||||
|
><span class="billing-plan-editor__column-title"
|
||||||
|
>保底计费重量<el-tooltip content="实际计量值小于保底数值时按保底计费" placement="top"
|
||||||
|
><el-icon class="billing-plan-editor__default-tip"><InfoFilled /></el-icon></el-tooltip></span></template
|
||||||
><template #default="{ row }"
|
><template #default="{ row }"
|
||||||
><div v-if="readonly && usesRangeMinimum(row)" class="limit-list">
|
><div v-if="readonly && usesRangeMinimum(row)" class="limit-list">
|
||||||
<span v-for="(item, rangeIndex) in getRanges(row)" :key="rangeIndex">{{
|
<span v-for="(item, rangeIndex) in getRanges(row)" :key="rangeIndex">{{
|
||||||
displayValue(item.minimumBillingWeight)
|
rangeIndex === 0
|
||||||
|
? displayValue(item.minimumBillingWeight || row.minimumBillingWeight)
|
||||||
|
: ''
|
||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
<span v-else-if="readonly">{{ displayValue(row.minimumBillingWeight) }}</span>
|
<span v-else-if="readonly">{{ displayValue(row.minimumBillingWeight) }}</span>
|
||||||
<div v-else-if="usesRangeMinimum(row)" class="limit-list">
|
<div v-else-if="usesRangeMinimum(row)" class="limit-list">
|
||||||
<el-input
|
<template v-for="(item, rangeIndex) in getRanges(row)" :key="rangeIndex">
|
||||||
v-for="(item, rangeIndex) in getRanges(row)"
|
<el-input
|
||||||
:key="rangeIndex"
|
v-if="rangeIndex === 0"
|
||||||
v-model="item.minimumBillingWeight"
|
v-model="item.minimumBillingWeight"
|
||||||
:disabled="!canEditMinimum(row)"
|
:disabled="!canEditMinimum(row)"
|
||||||
:placeholder="canEditMinimum(row) ? '请输入保底计费重量' : '无需配置'"
|
:placeholder="canEditMinimum(row) ? '请输入' : '无需配置'"
|
||||||
@input="value => rangeMinimumInput(row, rangeIndex, value)"
|
@input="value => rangeMinimumInput(row, rangeIndex, value)"
|
||||||
/>
|
/>
|
||||||
|
<div v-else class="limit-placeholder" />
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<el-input
|
<el-input
|
||||||
v-else
|
v-else
|
||||||
v-model="row.minimumBillingWeight"
|
v-model="row.minimumBillingWeight"
|
||||||
:disabled="!canEditMinimum(row)"
|
:disabled="!canEditMinimum(row)"
|
||||||
:placeholder="
|
:placeholder="
|
||||||
canEditMinimum(row)
|
canEditMinimum(row) ? '请输入' : '仅按重量、按吨·公里可填写'
|
||||||
? '实际计量值小于保底数值时按保底计费'
|
|
||||||
: '仅按重量、按吨·公里可填写'
|
|
||||||
"
|
"
|
||||||
@input="value => decimalInput(row, 'minimumBillingWeight', value)" /></template
|
@input="value => decimalInput(row, 'minimumBillingWeight', value)" /></template
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
@@ -297,9 +303,6 @@
|
|||||||
<el-descriptions-item label="目的地">{{
|
<el-descriptions-item label="目的地">{{
|
||||||
displayValue(matchForm.destination)
|
displayValue(matchForm.destination)
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="运输方式">{{
|
|
||||||
transportModeLabel(matchForm.transportMode)
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="货物类型">{{
|
<el-descriptions-item label="货物类型">{{
|
||||||
displayValue(matchForm.cargoType)
|
displayValue(matchForm.cargoType)
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
@@ -334,21 +337,6 @@
|
|||||||
@visible-change="v => v && ensureRegions()"
|
@visible-change="v => v && ensureRegions()"
|
||||||
@change="v => matchRegionChange('destination', v)" /></el-form-item
|
@change="v => matchRegionChange('destination', v)" /></el-form-item
|
||||||
></el-col>
|
></el-col>
|
||||||
<el-col :span="12"
|
|
||||||
><el-form-item label="运输方式"
|
|
||||||
><el-select
|
|
||||||
v-model="matchForm.transportMode"
|
|
||||||
:loading="transportModeLoading"
|
|
||||||
:disabled="readonly"
|
|
||||||
placeholder="请选择运输方式"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
><el-option
|
|
||||||
v-for="item in transportModeOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value" /></el-select></el-form-item
|
|
||||||
></el-col>
|
|
||||||
<el-col :span="12"
|
<el-col :span="12"
|
||||||
><el-form-item label="货物类型"
|
><el-form-item label="货物类型"
|
||||||
><el-cascader
|
><el-cascader
|
||||||
@@ -560,30 +548,24 @@ export default {
|
|||||||
return next;
|
return next;
|
||||||
},
|
},
|
||||||
normalizeRanges(row) {
|
normalizeRanges(row) {
|
||||||
const ranges = Array.isArray(row.limitRanges)
|
const rawRanges = Array.isArray(row.limitRanges) ? row.limitRanges : [];
|
||||||
? row.limitRanges
|
const ranges = rawRanges
|
||||||
.map(item => ({
|
.map((item, index) => ({
|
||||||
lowerLimit: item?.lowerLimit ?? '',
|
lowerLimit: item?.lowerLimit ?? '',
|
||||||
upperLimit: item?.upperLimit ?? '',
|
upperLimit: item?.upperLimit ?? '',
|
||||||
unitPrice:
|
unitPrice:
|
||||||
item?.unitPrice === undefined || item?.unitPrice === ''
|
item?.unitPrice === undefined || item?.unitPrice === ''
|
||||||
? row.unitPrice ?? ''
|
? row.unitPrice ?? ''
|
||||||
: item.unitPrice,
|
: item.unitPrice,
|
||||||
minimumBillingWeight:
|
minimumBillingWeight: this.resolveRangeMinimum(row, item, index),
|
||||||
item?.minimumBillingWeight === undefined || item?.minimumBillingWeight === ''
|
}))
|
||||||
? this.usesRangeMinimum(row)
|
.filter(
|
||||||
? row.minimumBillingWeight ?? ''
|
item =>
|
||||||
: ''
|
item.lowerLimit !== '' ||
|
||||||
: item.minimumBillingWeight,
|
item.upperLimit !== '' ||
|
||||||
}))
|
item.unitPrice !== '' ||
|
||||||
.filter(
|
item.minimumBillingWeight !== ''
|
||||||
item =>
|
);
|
||||||
item.lowerLimit !== '' ||
|
|
||||||
item.upperLimit !== '' ||
|
|
||||||
item.unitPrice !== '' ||
|
|
||||||
item.minimumBillingWeight !== ''
|
|
||||||
)
|
|
||||||
: [];
|
|
||||||
if (
|
if (
|
||||||
!ranges.length &&
|
!ranges.length &&
|
||||||
(row.lowerLimit !== '' ||
|
(row.lowerLimit !== '' ||
|
||||||
@@ -598,9 +580,23 @@ export default {
|
|||||||
minimumBillingWeight: this.usesRangeMinimum(row) ? row.minimumBillingWeight ?? '' : '',
|
minimumBillingWeight: this.usesRangeMinimum(row) ? row.minimumBillingWeight ?? '' : '',
|
||||||
});
|
});
|
||||||
return ranges.length
|
return ranges.length
|
||||||
? ranges
|
? ranges.map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
minimumBillingWeight: this.usesRangeMinimum(row)
|
||||||
|
? index === 0
|
||||||
|
? item.minimumBillingWeight
|
||||||
|
: ''
|
||||||
|
: '',
|
||||||
|
}))
|
||||||
: [{ lowerLimit: '', upperLimit: '', unitPrice: '', minimumBillingWeight: '' }];
|
: [{ lowerLimit: '', upperLimit: '', unitPrice: '', minimumBillingWeight: '' }];
|
||||||
},
|
},
|
||||||
|
resolveRangeMinimum(row, item, index) {
|
||||||
|
if (!this.usesRangeMinimum(row) || index !== 0) return '';
|
||||||
|
if (item?.minimumBillingWeight !== undefined && item?.minimumBillingWeight !== '') {
|
||||||
|
return item.minimumBillingWeight;
|
||||||
|
}
|
||||||
|
return row.minimumBillingWeight ?? '';
|
||||||
|
},
|
||||||
syncLegacyLimit(row) {
|
syncLegacyLimit(row) {
|
||||||
const first = row.limitRanges?.[0] || {};
|
const first = row.limitRanges?.[0] || {};
|
||||||
row.lowerLimit = first.lowerLimit ?? '';
|
row.lowerLimit = first.lowerLimit ?? '';
|
||||||
@@ -803,11 +799,16 @@ export default {
|
|||||||
if (index === 0) row.unitPrice = target.value;
|
if (index === 0) row.unitPrice = target.value;
|
||||||
},
|
},
|
||||||
rangeMinimumInput(row, index, value) {
|
rangeMinimumInput(row, index, value) {
|
||||||
|
if (index !== 0) return;
|
||||||
row.limitRanges = this.getRanges(row);
|
row.limitRanges = this.getRanges(row);
|
||||||
const target = { value };
|
const target = { value };
|
||||||
this.decimalInput(target, 'value', value);
|
this.decimalInput(target, 'value', value);
|
||||||
row.limitRanges[index].minimumBillingWeight = target.value;
|
row.limitRanges[0].minimumBillingWeight = target.value;
|
||||||
if (index === 0) row.minimumBillingWeight = target.value;
|
row.minimumBillingWeight = target.value;
|
||||||
|
row.limitRanges = row.limitRanges.map((item, rangeIndex) => ({
|
||||||
|
...item,
|
||||||
|
minimumBillingWeight: rangeIndex === 0 ? target.value : '',
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
addRule() {
|
addRule() {
|
||||||
this.draft.rules.push(defaultRule());
|
this.draft.rules.push(defaultRule());
|
||||||
@@ -929,15 +930,22 @@ export default {
|
|||||||
plan.transportModeLabel = transportMode?.label || plan.transportMode;
|
plan.transportModeLabel = transportMode?.label || plan.transportMode;
|
||||||
plan.rules = plan.rules.map(rule => {
|
plan.rules = plan.rules.map(rule => {
|
||||||
const ranges = this.canEditLimit(rule) ? this.getRanges(rule) : [];
|
const ranges = this.canEditLimit(rule) ? this.getRanges(rule) : [];
|
||||||
|
const normalizedRanges = ranges.map((item, rangeIndex) => ({
|
||||||
|
...item,
|
||||||
|
minimumBillingWeight:
|
||||||
|
this.usesRangeMinimum(rule) && rangeIndex === 0 ? item.minimumBillingWeight || '' : '',
|
||||||
|
}));
|
||||||
return {
|
return {
|
||||||
...rule,
|
...rule,
|
||||||
unitPrice: this.usesRangeUnitPrice(rule) ? ranges[0]?.unitPrice || '' : rule.unitPrice,
|
unitPrice: this.usesRangeUnitPrice(rule)
|
||||||
limitRanges: ranges,
|
? normalizedRanges[0]?.unitPrice || ''
|
||||||
lowerLimit: ranges[0]?.lowerLimit || '',
|
: rule.unitPrice,
|
||||||
upperLimit: ranges[0]?.upperLimit || '',
|
limitRanges: normalizedRanges,
|
||||||
|
lowerLimit: normalizedRanges[0]?.lowerLimit || '',
|
||||||
|
upperLimit: normalizedRanges[0]?.upperLimit || '',
|
||||||
minimumBillingWeight: this.canEditMinimum(rule)
|
minimumBillingWeight: this.canEditMinimum(rule)
|
||||||
? this.usesRangeMinimum(rule)
|
? this.usesRangeMinimum(rule)
|
||||||
? ranges[0]?.minimumBillingWeight || ''
|
? normalizedRanges[0]?.minimumBillingWeight || ''
|
||||||
: rule.minimumBillingWeight
|
: rule.minimumBillingWeight
|
||||||
: '',
|
: '',
|
||||||
};
|
};
|
||||||
@@ -950,9 +958,6 @@ export default {
|
|||||||
this.matchIndex = index;
|
this.matchIndex = index;
|
||||||
this.matchForm = { ...defaultRule().matchCondition, ...(row.matchCondition || {}) };
|
this.matchForm = { ...defaultRule().matchCondition, ...(row.matchCondition || {}) };
|
||||||
this.matchVisible = true;
|
this.matchVisible = true;
|
||||||
this.ensureTransportModes().then(() => {
|
|
||||||
this.matchForm.transportMode = this.normalizeTransportMode(this.matchForm.transportMode);
|
|
||||||
});
|
|
||||||
this.ensureRegions();
|
this.ensureRegions();
|
||||||
this.ensureCargo().then(() => {
|
this.ensureCargo().then(() => {
|
||||||
const path = this.resolveCargoPath(this.matchForm);
|
const path = this.resolveCargoPath(this.matchForm);
|
||||||
@@ -977,21 +982,6 @@ export default {
|
|||||||
});
|
});
|
||||||
return this.transportModeRequest;
|
return this.transportModeRequest;
|
||||||
},
|
},
|
||||||
normalizeTransportMode(value) {
|
|
||||||
const transportMode = String(value || '').trim();
|
|
||||||
if (!transportMode) return '';
|
|
||||||
const option = this.transportModeOptions.find(item => {
|
|
||||||
const optionValue = String(item.value || '').trim();
|
|
||||||
const optionLabel = String(item.label || '').trim();
|
|
||||||
return (
|
|
||||||
optionValue === transportMode ||
|
|
||||||
optionLabel === transportMode ||
|
|
||||||
optionLabel.includes(transportMode) ||
|
|
||||||
transportMode.includes(optionLabel)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
return option?.value || transportMode;
|
|
||||||
},
|
|
||||||
ensureRegions() {
|
ensureRegions() {
|
||||||
if (this.regionOptions.length) return Promise.resolve(this.regionOptions);
|
if (this.regionOptions.length) return Promise.resolve(this.regionOptions);
|
||||||
if (this.regionRequest) return this.regionRequest;
|
if (this.regionRequest) return this.regionRequest;
|
||||||
@@ -1214,6 +1204,11 @@ export default {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.billing-plan-editor__column-title {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.limit-list {
|
.limit-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -1229,4 +1224,8 @@ export default {
|
|||||||
.limit-row .el-input {
|
.limit-row .el-input {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.limit-placeholder {
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1883,6 +1883,12 @@
|
|||||||
<span>自动生成结算单</span>
|
<span>自动生成结算单</span>
|
||||||
<el-radio-group v-model="settlementRuleForm.autoGenerate" :disabled="dialogReadonly">
|
<el-radio-group v-model="settlementRuleForm.autoGenerate" :disabled="dialogReadonly">
|
||||||
<el-radio :label="1">开启</el-radio>
|
<el-radio :label="1">开启</el-radio>
|
||||||
|
<el-tooltip
|
||||||
|
content="开启时,系统根据配置规则归集运单,定时生成结算单"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<el-icon class="settlement-switch-tip"><QuestionFilled /></el-icon>
|
||||||
|
</el-tooltip>
|
||||||
<el-radio :label="0">关闭</el-radio>
|
<el-radio :label="0">关闭</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
@@ -1921,13 +1927,13 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="showSettlementBillCycleType"
|
v-if="showSettlementBillCycleType"
|
||||||
label="账单周期类型"
|
label="结算周期"
|
||||||
required
|
required
|
||||||
:error="settlementRuleErrors.billCycleType"
|
:error="settlementRuleErrors.billCycleType"
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="settlementRuleForm.billCycleType"
|
v-model="settlementRuleForm.billCycleType"
|
||||||
placeholder="请选择账单周期类型"
|
placeholder="请选择结算周期"
|
||||||
:disabled="dialogReadonly"
|
:disabled="dialogReadonly"
|
||||||
@change="handleSettlementBillCycleTypeChange"
|
@change="handleSettlementBillCycleTypeChange"
|
||||||
>
|
>
|
||||||
@@ -1980,6 +1986,59 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<div
|
||||||
|
v-if="settlementRuleEnabled && showSettlementCustomPeriods"
|
||||||
|
class="business-crud-page__custom-periods"
|
||||||
|
>
|
||||||
|
<el-table :data="settlementRuleForm.customPeriods || []" border>
|
||||||
|
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||||
|
<el-table-column label="运单区间-开始日" min-width="180" align="center">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-select
|
||||||
|
:model-value="row.startDay"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
:disabled="dialogReadonly"
|
||||||
|
@update:model-value="value => handleCustomPeriodStartDayChange($index, value)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in billCutoffDayOptions"
|
||||||
|
:key="`start-${item.value}`"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="运单区间-结束日" min-width="200" align="center">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<el-select
|
||||||
|
:model-value="row.endDay"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
:disabled="dialogReadonly"
|
||||||
|
@update:model-value="value => handleCustomPeriodEndDayChange($index, value)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in customPeriodEndDayOptions(row)"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="!dialogReadonly" label="操作" width="100" align="center">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
<el-link v-if="$index === 0" type="primary" @click="addCustomPeriodRow">添加</el-link>
|
||||||
|
<el-link v-else type="danger" @click="removeCustomPeriodRow($index)">删除</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<template v-if="!dialogReadonly" #empty>
|
||||||
|
<el-link type="primary" @click="addCustomPeriodRow">添加</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -5406,13 +5465,19 @@ const defaultBillingPlan = () => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const defaultSettlementRule = () => ({
|
const defaultSettlementRule = () => ({
|
||||||
autoGenerate: 1,
|
autoGenerate: '',
|
||||||
billStartDate: '',
|
billStartDate: '',
|
||||||
settlementType: '月结',
|
settlementType: '',
|
||||||
billCycleType: '固定截单日',
|
billCycleType: '',
|
||||||
billCutoffDay: 25,
|
billCutoffDay: '',
|
||||||
cycleDays: '',
|
cycleDays: '',
|
||||||
|
customPeriods: [],
|
||||||
});
|
});
|
||||||
|
const normalizeCustomPeriods = (periods = []) =>
|
||||||
|
(periods || []).map(item => ({
|
||||||
|
startDay: Number(item?.startDay) > 0 ? Number(item.startDay) : '',
|
||||||
|
endDay: Number(item?.endDay) > 0 ? Number(item.endDay) : '',
|
||||||
|
}));
|
||||||
|
|
||||||
const defaultReconciliation = () => ({
|
const defaultReconciliation = () => ({
|
||||||
skipReconciliation: 1,
|
skipReconciliation: 1,
|
||||||
@@ -5831,7 +5896,7 @@ export default {
|
|||||||
按数量: ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
按数量: ['固定单价', '区间单价', '阶梯单价', '区间阶梯一口价'],
|
||||||
},
|
},
|
||||||
settlementTypeOptions: ['月结', '日结', '周结', '半月结', '固定天数周期结算'],
|
settlementTypeOptions: ['月结', '日结', '周结', '半月结', '固定天数周期结算'],
|
||||||
billCycleTypeOptions: ['固定截单日', '自然月'],
|
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
||||||
reconciliationModeOptions: ['明细逐行核对', '按账单汇总核对', '跳过自动核对'],
|
reconciliationModeOptions: ['明细逐行核对', '按账单汇总核对', '跳过自动核对'],
|
||||||
packageOptions,
|
packageOptions,
|
||||||
quantityUnitOptions: ['吨', '千克', '立方米', '件', '车', '箱', '托盘'],
|
quantityUnitOptions: ['吨', '千克', '立方米', '件', '车', '箱', '托盘'],
|
||||||
@@ -6442,6 +6507,11 @@ export default {
|
|||||||
this.showSettlementBillCycleType && this.settlementRuleForm.billCycleType === '固定截单日'
|
this.showSettlementBillCycleType && this.settlementRuleForm.billCycleType === '固定截单日'
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
showSettlementCustomPeriods() {
|
||||||
|
return (
|
||||||
|
this.showSettlementBillCycleType && this.settlementRuleForm.billCycleType === '自定义多周期'
|
||||||
|
);
|
||||||
|
},
|
||||||
showSettlementCycleDays() {
|
showSettlementCycleDays() {
|
||||||
return this.settlementRuleForm.settlementType === '固定天数周期结算';
|
return this.settlementRuleForm.settlementType === '固定天数周期结算';
|
||||||
},
|
},
|
||||||
@@ -6868,7 +6938,7 @@ export default {
|
|||||||
const status = this.statusValue(row);
|
const status = this.statusValue(row);
|
||||||
return this.config.permission === 'transport_plan'
|
return this.config.permission === 'transport_plan'
|
||||||
? ['waiting_dispatch', 'dispatching'].includes(status)
|
? ['waiting_dispatch', 'dispatching'].includes(status)
|
||||||
: ['pending', 'processing'].includes(status);
|
: ['pending', 'processing', 'running'].includes(status);
|
||||||
},
|
},
|
||||||
canComplete(row) {
|
canComplete(row) {
|
||||||
if (
|
if (
|
||||||
@@ -6882,7 +6952,7 @@ export default {
|
|||||||
const status = this.statusValue(row);
|
const status = this.statusValue(row);
|
||||||
return this.config.permission === 'transport_plan'
|
return this.config.permission === 'transport_plan'
|
||||||
? status === 'dispatching'
|
? status === 'dispatching'
|
||||||
: status === 'processing';
|
: status === 'processing' || status === 'running';
|
||||||
},
|
},
|
||||||
canMaintainMileage(row) {
|
canMaintainMileage(row) {
|
||||||
return (
|
return (
|
||||||
@@ -7019,7 +7089,7 @@ export default {
|
|||||||
if (!row) return '-';
|
if (!row) return '-';
|
||||||
if (prop === 'businessStatus') return this.displayStatus(row, prop);
|
if (prop === 'businessStatus') return this.displayStatus(row, prop);
|
||||||
if (prop === 'feeGenerationMode') {
|
if (prop === 'feeGenerationMode') {
|
||||||
return row[prop] === 'manual' ? '手动生成' : '系统生成';
|
return row[prop] === 'manual' ? '账单导入生成' : '系统生成';
|
||||||
}
|
}
|
||||||
const column = this.findColumn(this.option.column, prop);
|
const column = this.findColumn(this.option.column, prop);
|
||||||
if (column?.formatter) return column.formatter(row, {}, row[prop]);
|
if (column?.formatter) return column.formatter(row, {}, row[prop]);
|
||||||
@@ -7109,7 +7179,9 @@ export default {
|
|||||||
waybillAmountWithCurrency(row = {}, prop) {
|
waybillAmountWithCurrency(row = {}, prop) {
|
||||||
const value = this.formatDetailValue(row, prop);
|
const value = this.formatDetailValue(row, prop);
|
||||||
if (value === '-') return { value: '-' };
|
if (value === '-') return { value: '-' };
|
||||||
return { value: `${this.waybillCurrencyRemark(row)}${value}` };
|
const number = Number(value);
|
||||||
|
const display = Number.isFinite(number) ? number.toFixed(2) : value;
|
||||||
|
return { value: `${this.waybillCurrencyRemark(row)}${display}` };
|
||||||
},
|
},
|
||||||
normalizeTransportPlanWaybillRow(row = {}, index = 0) {
|
normalizeTransportPlanWaybillRow(row = {}, index = 0) {
|
||||||
const status = row.businessStatus || row.status || row.waybillStatus || '';
|
const status = row.businessStatus || row.status || row.waybillStatus || '';
|
||||||
@@ -7560,23 +7632,32 @@ export default {
|
|||||||
isFixedBillCutoffSettlement(rule = this.settlementRuleForm) {
|
isFixedBillCutoffSettlement(rule = this.settlementRuleForm) {
|
||||||
return this.isMonthlySettlement(rule) && rule.billCycleType === '固定截单日';
|
return this.isMonthlySettlement(rule) && rule.billCycleType === '固定截单日';
|
||||||
},
|
},
|
||||||
|
isCustomMultiPeriodSettlement(rule = this.settlementRuleForm) {
|
||||||
|
return this.isMonthlySettlement(rule) && rule.billCycleType === '自定义多周期';
|
||||||
|
},
|
||||||
isFixedCycleSettlement(rule = this.settlementRuleForm) {
|
isFixedCycleSettlement(rule = this.settlementRuleForm) {
|
||||||
return rule.settlementType === '固定天数周期结算';
|
return rule.settlementType === '固定天数周期结算';
|
||||||
},
|
},
|
||||||
handleSettlementTypeChange(value) {
|
handleSettlementTypeChange(value) {
|
||||||
this.clearSettlementRuleError('settlementType');
|
this.clearSettlementRuleError('settlementType');
|
||||||
if (value === '月结') {
|
if (value === '月结') {
|
||||||
if (!this.settlementRuleForm.billCycleType) {
|
|
||||||
this.settlementRuleForm.billCycleType = '固定截单日';
|
|
||||||
}
|
|
||||||
if (this.settlementRuleForm.billCycleType === '固定截单日') {
|
if (this.settlementRuleForm.billCycleType === '固定截单日') {
|
||||||
this.settlementRuleForm.billCutoffDay = this.settlementRuleForm.billCutoffDay || 25;
|
this.settlementRuleForm.customPeriods = [];
|
||||||
|
} else if (this.settlementRuleForm.billCycleType === '自定义多周期') {
|
||||||
|
this.settlementRuleForm.billCutoffDay = '';
|
||||||
|
this.settlementRuleForm.customPeriods = normalizeCustomPeriods(
|
||||||
|
this.settlementRuleForm.customPeriods || []
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.settlementRuleForm.billCutoffDay = '';
|
||||||
|
this.settlementRuleForm.customPeriods = [];
|
||||||
}
|
}
|
||||||
this.settlementRuleForm.cycleDays = '';
|
this.settlementRuleForm.cycleDays = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.settlementRuleForm.billCycleType = '';
|
this.settlementRuleForm.billCycleType = '';
|
||||||
this.settlementRuleForm.billCutoffDay = '';
|
this.settlementRuleForm.billCutoffDay = '';
|
||||||
|
this.settlementRuleForm.customPeriods = [];
|
||||||
if (value !== '固定天数周期结算') {
|
if (value !== '固定天数周期结算') {
|
||||||
this.settlementRuleForm.cycleDays = '';
|
this.settlementRuleForm.cycleDays = '';
|
||||||
}
|
}
|
||||||
@@ -7584,10 +7665,17 @@ export default {
|
|||||||
handleSettlementBillCycleTypeChange(value) {
|
handleSettlementBillCycleTypeChange(value) {
|
||||||
this.clearSettlementRuleError('billCycleType');
|
this.clearSettlementRuleError('billCycleType');
|
||||||
if (value === '固定截单日') {
|
if (value === '固定截单日') {
|
||||||
this.settlementRuleForm.billCutoffDay = this.settlementRuleForm.billCutoffDay || 25;
|
this.settlementRuleForm.customPeriods = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.settlementRuleForm.billCutoffDay = '';
|
this.settlementRuleForm.billCutoffDay = '';
|
||||||
|
if (value === '自定义多周期') {
|
||||||
|
this.settlementRuleForm.customPeriods = normalizeCustomPeriods(
|
||||||
|
this.settlementRuleForm.customPeriods || []
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.settlementRuleForm.customPeriods = [];
|
||||||
},
|
},
|
||||||
normalizeSettlementRule(rule = this.settlementRuleForm) {
|
normalizeSettlementRule(rule = this.settlementRuleForm) {
|
||||||
const nextRule = {
|
const nextRule = {
|
||||||
@@ -7597,14 +7685,94 @@ export default {
|
|||||||
if (!this.isMonthlySettlement(nextRule)) {
|
if (!this.isMonthlySettlement(nextRule)) {
|
||||||
nextRule.billCycleType = '';
|
nextRule.billCycleType = '';
|
||||||
nextRule.billCutoffDay = '';
|
nextRule.billCutoffDay = '';
|
||||||
|
nextRule.customPeriods = [];
|
||||||
} else if (!this.isFixedBillCutoffSettlement(nextRule)) {
|
} else if (!this.isFixedBillCutoffSettlement(nextRule)) {
|
||||||
nextRule.billCutoffDay = '';
|
nextRule.billCutoffDay = '';
|
||||||
}
|
}
|
||||||
|
if (this.isCustomMultiPeriodSettlement(nextRule)) {
|
||||||
|
nextRule.customPeriods = normalizeCustomPeriods(
|
||||||
|
Array.isArray(nextRule.customPeriods) ? nextRule.customPeriods : []
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
nextRule.customPeriods = [];
|
||||||
|
}
|
||||||
if (!this.isFixedCycleSettlement(nextRule)) {
|
if (!this.isFixedCycleSettlement(nextRule)) {
|
||||||
nextRule.cycleDays = '';
|
nextRule.cycleDays = '';
|
||||||
}
|
}
|
||||||
return nextRule;
|
return nextRule;
|
||||||
},
|
},
|
||||||
|
customPeriodEndDayOptions(row) {
|
||||||
|
const startDay = Number(row?.startDay);
|
||||||
|
if (!Number.isFinite(startDay) || startDay < 1) return this.billCutoffDayOptions;
|
||||||
|
return Array.from({ length: 31 - startDay + 1 }, (_, index) => {
|
||||||
|
const value = startDay + index;
|
||||||
|
return { label: `${value}日`, value };
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCustomPeriodStartDayChange(index, value) {
|
||||||
|
const periods = normalizeCustomPeriods(this.settlementRuleForm.customPeriods || []);
|
||||||
|
const row = periods[index];
|
||||||
|
if (!row) return;
|
||||||
|
row.startDay = value || '';
|
||||||
|
const startDay = Number(row.startDay);
|
||||||
|
const endDay = Number(row.endDay);
|
||||||
|
if (
|
||||||
|
Number.isFinite(startDay) &&
|
||||||
|
Number.isFinite(endDay) &&
|
||||||
|
(endDay < startDay || endDay > 31)
|
||||||
|
) {
|
||||||
|
row.endDay = '';
|
||||||
|
}
|
||||||
|
this.settlementRuleForm.customPeriods = periods;
|
||||||
|
},
|
||||||
|
handleCustomPeriodEndDayChange(index, value) {
|
||||||
|
const periods = normalizeCustomPeriods(this.settlementRuleForm.customPeriods || []);
|
||||||
|
const row = periods[index];
|
||||||
|
if (!row) return;
|
||||||
|
row.endDay = value || '';
|
||||||
|
this.settlementRuleForm.customPeriods = periods;
|
||||||
|
},
|
||||||
|
addCustomPeriodRow() {
|
||||||
|
const periods = normalizeCustomPeriods(this.settlementRuleForm.customPeriods || []);
|
||||||
|
periods.push({ startDay: '', endDay: '' });
|
||||||
|
this.settlementRuleForm.customPeriods = periods;
|
||||||
|
},
|
||||||
|
removeCustomPeriodRow(index) {
|
||||||
|
if (index <= 0) return;
|
||||||
|
const periods = [...(this.settlementRuleForm.customPeriods || [])];
|
||||||
|
periods.splice(index, 1);
|
||||||
|
this.settlementRuleForm.customPeriods = normalizeCustomPeriods(periods);
|
||||||
|
},
|
||||||
|
validateCustomPeriods(periods = [], label = '') {
|
||||||
|
const rows = normalizeCustomPeriods(periods);
|
||||||
|
const prefix = label ? `${label}:` : '';
|
||||||
|
if (!rows.length) {
|
||||||
|
this.$message.warning(`${prefix}请至少配置一段自定义周期`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (let index = 0; index < rows.length; index += 1) {
|
||||||
|
const row = rows[index];
|
||||||
|
const startDay = Number(row.startDay);
|
||||||
|
const endDay = Number(row.endDay);
|
||||||
|
if (!Number.isFinite(startDay) || startDay < 1 || startDay > 31) {
|
||||||
|
this.$message.warning(`${prefix}请选择第${index + 1}行运单区间开始日`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Number.isFinite(endDay) || endDay < 1 || endDay > 31) {
|
||||||
|
this.$message.warning(`${prefix}请选择第${index + 1}行运单区间结束日`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (endDay < startDay) {
|
||||||
|
this.$message.warning(`${prefix}第${index + 1}行结束日不能早于开始日`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (index > 0 && startDay !== Number(rows[index - 1].endDay) + 1) {
|
||||||
|
this.$message.warning(`${prefix}自定义多周期区间必须连续,不允许重叠或存在日期缺口`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
clearSettlementRuleError(field) {
|
clearSettlementRuleError(field) {
|
||||||
if (!this.settlementRuleErrors[field]) return;
|
if (!this.settlementRuleErrors[field]) return;
|
||||||
this.settlementRuleErrors = {
|
this.settlementRuleErrors = {
|
||||||
@@ -7626,8 +7794,8 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isMonthlySettlement(rule) && this.isBillingFieldEmpty(rule.billCycleType)) {
|
if (this.isMonthlySettlement(rule) && this.isBillingFieldEmpty(rule.billCycleType)) {
|
||||||
this.settlementRuleErrors = { billCycleType: '请选择账单周期类型' };
|
this.settlementRuleErrors = { billCycleType: '请选择结算周期' };
|
||||||
this.$message.warning(`${label}${label ? ':' : ''}请选择账单周期类型`);
|
this.$message.warning(`${label}${label ? ':' : ''}请选择结算周期`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isFixedBillCutoffSettlement(rule)) {
|
if (this.isFixedBillCutoffSettlement(rule)) {
|
||||||
@@ -7643,6 +7811,9 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.isCustomMultiPeriodSettlement(rule)) {
|
||||||
|
return this.validateCustomPeriods(rule.customPeriods, label);
|
||||||
|
}
|
||||||
if (this.isFixedCycleSettlement(rule)) {
|
if (this.isFixedCycleSettlement(rule)) {
|
||||||
const cycleDays = Number(rule.cycleDays);
|
const cycleDays = Number(rule.cycleDays);
|
||||||
if (!Number.isInteger(cycleDays) || cycleDays < 1 || cycleDays > 365) {
|
if (!Number.isInteger(cycleDays) || cycleDays < 1 || cycleDays > 365) {
|
||||||
@@ -11233,8 +11404,10 @@ export default {
|
|||||||
if (!this.canEditBillingLimit(row)) {
|
if (!this.canEditBillingLimit(row)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const key = row.billingElement || '';
|
const feeItem = String(row.feeItem || '').trim();
|
||||||
groups[key] = groups[key] || [];
|
const billingElement = String(row.billingElement || '').trim();
|
||||||
|
const key = JSON.stringify([feeItem, billingElement]);
|
||||||
|
groups[key] = groups[key] || { feeItem, billingElement, ranges: [] };
|
||||||
const ranges = this.getBillingLimitRanges(row);
|
const ranges = this.getBillingLimitRanges(row);
|
||||||
for (const range of ranges) {
|
for (const range of ranges) {
|
||||||
const lower = Number(range.lowerLimit);
|
const lower = Number(range.lowerLimit);
|
||||||
@@ -11252,14 +11425,14 @@ export default {
|
|||||||
this.$message.warning('计费要素下限不能大于上限');
|
this.$message.warning('计费要素下限不能大于上限');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
groups[key].push({ lower, upper });
|
groups[key].ranges.push({ lower, upper });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.validateBillingLimitRangeGroups(groups);
|
return this.validateBillingLimitRangeGroups(groups);
|
||||||
},
|
},
|
||||||
validateBillingLimitRangeGroups(groups) {
|
validateBillingLimitRangeGroups(groups) {
|
||||||
const precision = 0.000001;
|
const precision = 0.000001;
|
||||||
for (const [billingElement, ranges] of Object.entries(groups)) {
|
for (const { feeItem, billingElement, ranges } of Object.values(groups)) {
|
||||||
if (ranges.length <= 1) continue;
|
if (ranges.length <= 1) continue;
|
||||||
const sortedRanges = [...ranges].sort((prev, next) => {
|
const sortedRanges = [...ranges].sort((prev, next) => {
|
||||||
if (prev.lower !== next.lower) return prev.lower - next.lower;
|
if (prev.lower !== next.lower) return prev.lower - next.lower;
|
||||||
@@ -11269,11 +11442,13 @@ export default {
|
|||||||
const prevRange = sortedRanges[index - 1];
|
const prevRange = sortedRanges[index - 1];
|
||||||
const currentRange = sortedRanges[index];
|
const currentRange = sortedRanges[index];
|
||||||
if (currentRange.lower < prevRange.upper - precision) {
|
if (currentRange.lower < prevRange.upper - precision) {
|
||||||
this.$message.warning(`${billingElement}的计费要素区间不能重叠`);
|
this.$message.warning(`费用项“${feeItem}”${billingElement}的计费要素区间不能重叠`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (currentRange.lower > prevRange.upper + precision) {
|
if (currentRange.lower > prevRange.upper + precision) {
|
||||||
this.$message.warning(`${billingElement}的计费要素区间必须连续,不能存在间隙`);
|
this.$message.warning(
|
||||||
|
`费用项“${feeItem}”${billingElement}的计费要素区间必须连续,不能存在间隙`
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14453,6 +14628,13 @@ export default {
|
|||||||
color: #303133;
|
color: #303133;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settlement-switch-tip {
|
||||||
|
margin: 0 4px;
|
||||||
|
color: #a8abb2;
|
||||||
|
cursor: help;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
&__module-form {
|
&__module-form {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,596 @@
|
|||||||
|
<template>
|
||||||
|
<section
|
||||||
|
class="contract-manage-form__section contract-manage-form__section--panel contract-manage-form__section--attachment"
|
||||||
|
>
|
||||||
|
<div class="contract-manage-form__attachment-head">
|
||||||
|
<div class="dialog-section-title">{{ title }}</div>
|
||||||
|
<el-button type="primary" :disabled="!rows.length" @click="batchDownload">批量下载</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="rows"
|
||||||
|
border
|
||||||
|
class="contract-manage-form__attachment-table"
|
||||||
|
@selection-change="selected = $event"
|
||||||
|
>
|
||||||
|
<el-table-column v-if="!readonly" type="selection" width="55" align="center" />
|
||||||
|
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||||
|
<el-table-column v-if="attachmentType" label="附件类型" min-width="160" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span v-if="readonly || isRowLocked(row)">{{ row.fileType || '-' }}</span>
|
||||||
|
<el-select
|
||||||
|
v-else
|
||||||
|
:model-value="row.fileType"
|
||||||
|
placeholder="请选择"
|
||||||
|
:teleported="false"
|
||||||
|
:fit-input-width="true"
|
||||||
|
@update:model-value="value => updateRowFileType(row, value)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in contractAttachmentTypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="文件名"
|
||||||
|
min-width="240"
|
||||||
|
align="left"
|
||||||
|
header-align="left"
|
||||||
|
show-overflow-tooltip
|
||||||
|
>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link type="primary" @click="preview?.(row, rows)">{{ attachmentName(row) }}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="description" label="附件描述" min-width="220">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span v-if="readonly || isRowLocked(row)">{{ row.description || '-' }}</span>
|
||||||
|
<el-input
|
||||||
|
v-else
|
||||||
|
:model-value="row.description"
|
||||||
|
maxlength="200"
|
||||||
|
@update:model-value="value => updateRowDescription(row, value)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="文件大小" width="120" align="center">
|
||||||
|
<template #default="{ row }">{{ formatSize(row.size) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="uploadUserName" label="上传人" width="140" align="center" />
|
||||||
|
<el-table-column prop="uploadTime" label="上传时间" width="180" align="center" sortable />
|
||||||
|
<el-table-column v-if="!readonly" label="操作" width="100" align="center" fixed="right">
|
||||||
|
<template #default="{ row, $index }">
|
||||||
|
<span v-if="isRowLocked(row)">-</span>
|
||||||
|
<el-link v-else type="danger" @click="remove($index)">删除</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<div v-if="!readonly" class="contract-manage-form__attachment-upload">
|
||||||
|
<template v-if="useUploadDialog">
|
||||||
|
<el-button type="primary" plain @click="openUploadDialog">上传附件</el-button>
|
||||||
|
<span class="contract-manage-form__attachment-tip">
|
||||||
|
支持pdf、bmp、jpeg、png、jpg、doc、docx、ppt、pptx、xlsx、xls、eml、msg、zip的文件格式,单个文件不超过50M
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<vehicle-attachment-upload
|
||||||
|
v-else
|
||||||
|
:model-value="rows"
|
||||||
|
:file-types="attachmentFileTypes"
|
||||||
|
:max-size="50"
|
||||||
|
show-tip
|
||||||
|
tip="支持pdf、bmp、jpeg、png、jpg、doc、docx、ppt、pptx、xlsx、xls、eml、msg、zip的文件格式,单个文件不超过50M"
|
||||||
|
:show-file-list="false"
|
||||||
|
button-text="上传附件"
|
||||||
|
@update:model-value="handleChange"
|
||||||
|
@change="handleChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
v-model="uploadDialogVisible"
|
||||||
|
title="附件上传"
|
||||||
|
width="560px"
|
||||||
|
append-to-body
|
||||||
|
destroy-on-close
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
class="contract-attachment-upload-dialog"
|
||||||
|
@closed="resetUploadDialog"
|
||||||
|
>
|
||||||
|
<div class="contract-attachment-upload-dialog__body">
|
||||||
|
<div class="contract-attachment-upload-dialog__field">
|
||||||
|
<span class="contract-attachment-upload-dialog__label">附件位置</span>
|
||||||
|
<el-select :model-value="attachmentLocation" disabled style="width: 100%">
|
||||||
|
<el-option :label="attachmentLocation" :value="attachmentLocation" />
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="contract-attachment-upload-dialog__field">
|
||||||
|
<span class="contract-attachment-upload-dialog__label">附件类型</span>
|
||||||
|
<el-select v-model="uploadDialogType" placeholder="请选择附件类型" style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="item in contractAttachmentTypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div class="contract-attachment-upload-dialog__uploader">
|
||||||
|
<el-upload
|
||||||
|
drag
|
||||||
|
multiple
|
||||||
|
:action="uploadAction"
|
||||||
|
:headers="uploadHeaders"
|
||||||
|
:accept="acceptText"
|
||||||
|
:show-file-list="true"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:on-success="handleDialogSuccess"
|
||||||
|
:on-error="handleDialogError"
|
||||||
|
:on-remove="handleDialogRemove"
|
||||||
|
:file-list="uploadDialogFileList"
|
||||||
|
>
|
||||||
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
</el-upload>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="contract-attachment-upload-dialog__footer">
|
||||||
|
<el-button type="primary" @click="confirmUploadDialog">确定</el-button>
|
||||||
|
<el-button type="primary" @click="uploadDialogVisible = false">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { UploadFilled } from '@element-plus/icons-vue';
|
||||||
|
import { baseUrl } from '@/config/env';
|
||||||
|
import { getUploadHeaders } from '@/utils/upload';
|
||||||
|
import { downloadFileByUrl } from '@/utils/util';
|
||||||
|
import { getDictionary as getBizDictionary } from '@/api/system/dictbiz';
|
||||||
|
|
||||||
|
const CONTRACT_ATTACHMENT_TYPE_OTHER = '其它文件';
|
||||||
|
export const defaultContractAttachmentTypeOptions = [
|
||||||
|
{ label: '合同文件', value: '合同文件' },
|
||||||
|
{ label: '双章归档文件', value: '双章归档文件' },
|
||||||
|
{ label: '其它文件', value: CONTRACT_ATTACHMENT_TYPE_OTHER },
|
||||||
|
];
|
||||||
|
/** @deprecated 兼容旧引用,实际选项由业务字典 contract_attachment_type 动态加载 */
|
||||||
|
export const contractAttachmentTypeOptions = defaultContractAttachmentTypeOptions;
|
||||||
|
export const attachmentFileTypes = [
|
||||||
|
'pdf',
|
||||||
|
'bmp',
|
||||||
|
'jpeg',
|
||||||
|
'png',
|
||||||
|
'jpg',
|
||||||
|
'doc',
|
||||||
|
'docx',
|
||||||
|
'ppt',
|
||||||
|
'pptx',
|
||||||
|
'xlsx',
|
||||||
|
'xls',
|
||||||
|
'eml',
|
||||||
|
'msg',
|
||||||
|
'zip',
|
||||||
|
];
|
||||||
|
|
||||||
|
export const attachmentName = row => row?.originalName || row?.name || row?.fileName || '附件';
|
||||||
|
export const attachmentUrl = row =>
|
||||||
|
row?.url || row?.link || row?.fileUrl || row?.downloadUrl || row?.domain || '';
|
||||||
|
export const isAttachmentApproved = row =>
|
||||||
|
row?.approved === true ||
|
||||||
|
row?.approved === 1 ||
|
||||||
|
row?.approved === '1' ||
|
||||||
|
row?.approvalStatus === 'approved';
|
||||||
|
|
||||||
|
const normalizeAttachmentTypeText = value => {
|
||||||
|
let text = String(value || '').split(/[?#]/)[0];
|
||||||
|
try {
|
||||||
|
text = decodeURIComponent(text);
|
||||||
|
} catch (error) {
|
||||||
|
// ignore decode error
|
||||||
|
}
|
||||||
|
return text
|
||||||
|
.replace(/\.[^.\\/]+$/, '')
|
||||||
|
.toLowerCase()
|
||||||
|
.replace(/[\s_\-—–·•()()\[\]【】{}《》<>“”"'、,,。.]/g, '');
|
||||||
|
};
|
||||||
|
|
||||||
|
const attachmentTypeKeywords = fileType => {
|
||||||
|
if (fileType === '双章归档文件') return ['双章归档文件', '双章归档', '双章'];
|
||||||
|
if (fileType === '合同文件') return ['合同文件', '合同'];
|
||||||
|
return [fileType];
|
||||||
|
};
|
||||||
|
|
||||||
|
const resolveOtherAttachmentType = (options = []) => {
|
||||||
|
const list = options.length ? options : defaultContractAttachmentTypeOptions;
|
||||||
|
const matched = list.find(
|
||||||
|
item =>
|
||||||
|
String(item.value) === CONTRACT_ATTACHMENT_TYPE_OTHER ||
|
||||||
|
String(item.label).includes('其它') ||
|
||||||
|
String(item.label).includes('其他')
|
||||||
|
);
|
||||||
|
return matched?.value || list[list.length - 1]?.value || CONTRACT_ATTACHMENT_TYPE_OTHER;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const resolveContractAttachmentType = (
|
||||||
|
row = {},
|
||||||
|
options = defaultContractAttachmentTypeOptions
|
||||||
|
) => {
|
||||||
|
const list = options.length ? options : defaultContractAttachmentTypeOptions;
|
||||||
|
const values = list.map(item => item.value);
|
||||||
|
if (values.includes(row.fileType)) return row.fileType;
|
||||||
|
const fileName = normalizeAttachmentTypeText(attachmentName(row));
|
||||||
|
const otherType = resolveOtherAttachmentType(list);
|
||||||
|
if (!fileName) return otherType;
|
||||||
|
const matched = list
|
||||||
|
.filter(item => item.value !== otherType)
|
||||||
|
.flatMap(item =>
|
||||||
|
attachmentTypeKeywords(item.value).map(keyword => ({
|
||||||
|
value: item.value,
|
||||||
|
keyword: normalizeAttachmentTypeText(keyword),
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
.filter(item => item.keyword)
|
||||||
|
.sort((a, b) => b.keyword.length - a.keyword.length)
|
||||||
|
.find(item => fileName.includes(item.keyword));
|
||||||
|
return matched?.value || otherType;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const normalizeContractFileRows = (rows, options = defaultContractAttachmentTypeOptions) =>
|
||||||
|
(rows || []).map(row => ({
|
||||||
|
...row,
|
||||||
|
fileType: resolveContractAttachmentType(row, options),
|
||||||
|
description: row.description || '',
|
||||||
|
}));
|
||||||
|
|
||||||
|
const mapDictOptions = response => {
|
||||||
|
const data = response?.data?.data || response?.data || [];
|
||||||
|
const records = Array.isArray(data) ? data : data.records || [];
|
||||||
|
return records
|
||||||
|
.map(item => ({
|
||||||
|
label: item.dictValue,
|
||||||
|
value: item.dictKey,
|
||||||
|
}))
|
||||||
|
.filter(item => item.label && item.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ContractAttachmentSection',
|
||||||
|
components: { UploadFilled },
|
||||||
|
props: {
|
||||||
|
title: { type: String, required: true },
|
||||||
|
rows: { type: Array, default: () => [] },
|
||||||
|
description: Boolean,
|
||||||
|
attachmentType: Boolean,
|
||||||
|
readonly: Boolean,
|
||||||
|
lockApproved: Boolean,
|
||||||
|
markApprovedOnUpload: Boolean,
|
||||||
|
useUploadDialog: Boolean,
|
||||||
|
attachmentLocation: { type: String, default: '合同文件' },
|
||||||
|
preview: { type: Function, default: null },
|
||||||
|
},
|
||||||
|
emits: ['update:rows'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selected: [],
|
||||||
|
attachmentFileTypes,
|
||||||
|
contractAttachmentTypeOptions: [...defaultContractAttachmentTypeOptions],
|
||||||
|
uploadDialogVisible: false,
|
||||||
|
uploadDialogType: resolveOtherAttachmentType(defaultContractAttachmentTypeOptions),
|
||||||
|
uploadDialogFiles: [],
|
||||||
|
uploadDialogFileList: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
uploadAction() {
|
||||||
|
return `${baseUrl}/blade-resource/oss/endpoint/put-file`;
|
||||||
|
},
|
||||||
|
uploadHeaders() {
|
||||||
|
return getUploadHeaders();
|
||||||
|
},
|
||||||
|
acceptText() {
|
||||||
|
return this.attachmentFileTypes.map(item => `.${item}`).join(',');
|
||||||
|
},
|
||||||
|
defaultAttachmentType() {
|
||||||
|
return resolveOtherAttachmentType(this.contractAttachmentTypeOptions);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.loadAttachmentTypeOptions();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
attachmentName,
|
||||||
|
loadAttachmentTypeOptions() {
|
||||||
|
return getBizDictionary({ code: 'contract_attachment_type' })
|
||||||
|
.then(res => {
|
||||||
|
const options = mapDictOptions(res);
|
||||||
|
if (options.length) {
|
||||||
|
this.contractAttachmentTypeOptions = options;
|
||||||
|
if (
|
||||||
|
!options.some(item => String(item.value) === String(this.uploadDialogType))
|
||||||
|
) {
|
||||||
|
this.uploadDialogType = this.defaultAttachmentType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// 字典加载失败时保留默认选项
|
||||||
|
});
|
||||||
|
},
|
||||||
|
isRowLocked(row) {
|
||||||
|
return this.lockApproved && isAttachmentApproved(row);
|
||||||
|
},
|
||||||
|
update(rows) {
|
||||||
|
this.$emit('update:rows', rows);
|
||||||
|
},
|
||||||
|
updateRowFileType(row, value) {
|
||||||
|
if (this.isRowLocked(row)) return;
|
||||||
|
row.fileType = value;
|
||||||
|
this.update([...this.rows]);
|
||||||
|
},
|
||||||
|
updateRowDescription(row, value) {
|
||||||
|
if (this.isRowLocked(row)) return;
|
||||||
|
row.description = value;
|
||||||
|
this.update([...this.rows]);
|
||||||
|
},
|
||||||
|
openUploadDialog() {
|
||||||
|
this.uploadDialogType = this.defaultAttachmentType;
|
||||||
|
this.uploadDialogFiles = [];
|
||||||
|
this.uploadDialogFileList = [];
|
||||||
|
this.uploadDialogVisible = true;
|
||||||
|
},
|
||||||
|
resetUploadDialog() {
|
||||||
|
this.uploadDialogFiles = [];
|
||||||
|
this.uploadDialogFileList = [];
|
||||||
|
this.uploadDialogType = this.defaultAttachmentType;
|
||||||
|
},
|
||||||
|
beforeUpload(file) {
|
||||||
|
const extension = String(file.name || '')
|
||||||
|
.split('.')
|
||||||
|
.pop()
|
||||||
|
?.toLowerCase();
|
||||||
|
if (!this.attachmentFileTypes.includes(extension)) {
|
||||||
|
this.$message.warning('文件类型不符合上传要求');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 50) {
|
||||||
|
this.$message.warning('单文件大小不能超过 50MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
normalizeUploadFile(file, response) {
|
||||||
|
const data = response?.data || file.response?.data || {};
|
||||||
|
const url = data.link || data.url || data.domain || file.url || '';
|
||||||
|
const originalName =
|
||||||
|
data.originalName || file.name || data.name || attachmentName({ url }) || '附件';
|
||||||
|
return {
|
||||||
|
uid: file.uid,
|
||||||
|
originalName,
|
||||||
|
name: originalName,
|
||||||
|
url,
|
||||||
|
link: data.link || url,
|
||||||
|
size: data.size || data.attachSize || file.size || '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
handleDialogSuccess(response, file, fileList) {
|
||||||
|
if (!response || response.success === false || (response.code && response.code !== 200)) {
|
||||||
|
this.$message.error(response?.msg || '上传失败');
|
||||||
|
this.uploadDialogFileList = (fileList || []).filter(item => item.uid !== file.uid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const normalized = this.normalizeUploadFile(file, response);
|
||||||
|
this.uploadDialogFileList = fileList || [];
|
||||||
|
this.uploadDialogFiles = [
|
||||||
|
...this.uploadDialogFiles.filter(item => String(item.uid) !== String(file.uid)),
|
||||||
|
normalized,
|
||||||
|
];
|
||||||
|
this.uploadDialogType = resolveContractAttachmentType(
|
||||||
|
{
|
||||||
|
...normalized,
|
||||||
|
fileType: '',
|
||||||
|
},
|
||||||
|
this.contractAttachmentTypeOptions
|
||||||
|
);
|
||||||
|
this.$message.success('上传成功');
|
||||||
|
},
|
||||||
|
handleDialogError() {
|
||||||
|
this.$message.error('上传失败');
|
||||||
|
},
|
||||||
|
handleDialogRemove(file) {
|
||||||
|
this.uploadDialogFiles = this.uploadDialogFiles.filter(
|
||||||
|
item => String(item.uid) !== String(file.uid)
|
||||||
|
);
|
||||||
|
this.uploadDialogFileList = this.uploadDialogFileList.filter(
|
||||||
|
item => String(item.uid) !== String(file.uid)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
confirmUploadDialog() {
|
||||||
|
if (!this.uploadDialogFiles.length) {
|
||||||
|
this.$message.warning('请先上传附件');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.uploadDialogType) {
|
||||||
|
this.$message.warning('请选择附件类型');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const uploadUserName = this.$store.getters.userInfo?.realName || '';
|
||||||
|
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
const appended = this.uploadDialogFiles.map(row => ({
|
||||||
|
...row,
|
||||||
|
fileType: this.uploadDialogType,
|
||||||
|
description: row.description || '',
|
||||||
|
uploadUserName: row.uploadUserName || uploadUserName,
|
||||||
|
uploadTime: row.uploadTime || uploadTime,
|
||||||
|
...(this.markApprovedOnUpload ? { approved: true } : {}),
|
||||||
|
}));
|
||||||
|
this.update([...(this.rows || []), ...appended]);
|
||||||
|
this.uploadDialogVisible = false;
|
||||||
|
},
|
||||||
|
handleChange(rows) {
|
||||||
|
const uploadUserName = this.$store.getters.userInfo?.realName || '';
|
||||||
|
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
const existingRows = this.rows || [];
|
||||||
|
this.update(
|
||||||
|
(rows || []).map(row => {
|
||||||
|
const fileUrl = attachmentUrl(row);
|
||||||
|
const existing = existingRows.find(item => {
|
||||||
|
const sameUid = row.uid && item.uid && String(row.uid) === String(item.uid);
|
||||||
|
const sameUrl = fileUrl && attachmentUrl(item) === fileUrl;
|
||||||
|
return sameUid || sameUrl;
|
||||||
|
});
|
||||||
|
if (existing && this.isRowLocked(existing)) return { ...existing };
|
||||||
|
const next = {
|
||||||
|
...existing,
|
||||||
|
...row,
|
||||||
|
description: row.description || existing?.description || '',
|
||||||
|
uploadUserName: existing?.uploadUserName || row.uploadUserName || uploadUserName,
|
||||||
|
uploadTime: existing?.uploadTime || row.uploadTime || uploadTime,
|
||||||
|
approved: existing?.approved || row.approved || false,
|
||||||
|
};
|
||||||
|
if (this.attachmentType) {
|
||||||
|
next.fileType = resolveContractAttachmentType(
|
||||||
|
{
|
||||||
|
...next,
|
||||||
|
fileType: existing?.fileType || row.fileType,
|
||||||
|
},
|
||||||
|
this.contractAttachmentTypeOptions
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (this.markApprovedOnUpload && !existing) next.approved = true;
|
||||||
|
return next;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
remove(index) {
|
||||||
|
const row = this.rows[index];
|
||||||
|
if (this.isRowLocked(row)) {
|
||||||
|
this.$message.warning('已审核通过的附件不允许删除');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const rows = [...this.rows];
|
||||||
|
rows.splice(index, 1);
|
||||||
|
this.update(rows);
|
||||||
|
},
|
||||||
|
download(row) {
|
||||||
|
const url = attachmentUrl(row);
|
||||||
|
if (!url) {
|
||||||
|
this.$message.warning('附件地址为空,无法下载');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
downloadFileByUrl(url, attachmentName(row));
|
||||||
|
},
|
||||||
|
batchDownload() {
|
||||||
|
(this.selected.length ? this.selected : this.rows).forEach(this.download);
|
||||||
|
},
|
||||||
|
formatSize(size) {
|
||||||
|
const value = Number(size);
|
||||||
|
if (!value) return '';
|
||||||
|
if (value < 1024) return `${value}B`;
|
||||||
|
if (value < 1024 * 1024) return `${(value / 1024).toFixed(1)}KB`;
|
||||||
|
return `${(value / 1024 / 1024).toFixed(1)}MB`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.contract-manage-form__section {
|
||||||
|
margin: 12px 0 0;
|
||||||
|
padding: 14px 16px 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||||
|
|
||||||
|
.dialog-section-title {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: #303133;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
margin-right: 8px;
|
||||||
|
vertical-align: -2px;
|
||||||
|
background: #409eff;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.contract-manage-form__attachment-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
|
||||||
|
.dialog-section-title {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.contract-manage-form__attachment-upload {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contract-manage-form__attachment-tip {
|
||||||
|
margin-left: 30px;
|
||||||
|
color: #909399;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contract-attachment-upload-dialog {
|
||||||
|
&__body {
|
||||||
|
padding: 4px 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__field {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__label {
|
||||||
|
flex: none;
|
||||||
|
width: 72px;
|
||||||
|
color: #606266;
|
||||||
|
text-align: right;
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__uploader {
|
||||||
|
margin-top: 8px;
|
||||||
|
|
||||||
|
:deep(.el-upload) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-upload-dragger) {
|
||||||
|
width: 100%;
|
||||||
|
height: 180px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1257,6 +1257,7 @@ export default {
|
|||||||
dialogReadonly: false,
|
dialogReadonly: false,
|
||||||
crudDialogType: '',
|
crudDialogType: '',
|
||||||
standaloneFormKey: '',
|
standaloneFormKey: '',
|
||||||
|
copyingRow: null,
|
||||||
detailBox: false,
|
detailBox: false,
|
||||||
detailLoading: false,
|
detailLoading: false,
|
||||||
detailRow: {},
|
detailRow: {},
|
||||||
@@ -1427,7 +1428,7 @@ export default {
|
|||||||
String(item.value).toUpperCase() ===
|
String(item.value).toUpperCase() ===
|
||||||
String(this.shippingTemplateFreight.currency || '').toUpperCase()
|
String(this.shippingTemplateFreight.currency || '').toUpperCase()
|
||||||
);
|
);
|
||||||
return this.currencyName(option?.label || this.shippingTemplateFreight.currency);
|
return this.currencyUnit(option?.label || this.shippingTemplateFreight.currency);
|
||||||
},
|
},
|
||||||
roadFreightTotal() {
|
roadFreightTotal() {
|
||||||
const total = this.shippingTemplateFreight.freightItems.reduce(
|
const total = this.shippingTemplateFreight.freightItems.reduce(
|
||||||
@@ -1498,7 +1499,8 @@ export default {
|
|||||||
if (
|
if (
|
||||||
this.isStandaloneFormPage &&
|
this.isStandaloneFormPage &&
|
||||||
(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 || '') ||
|
||||||
|
to.query.copy !== from?.query?.copy)
|
||||||
)
|
)
|
||||||
this.$nextTick(() => this.initStandaloneFormPage());
|
this.$nextTick(() => this.initStandaloneFormPage());
|
||||||
},
|
},
|
||||||
@@ -1608,13 +1610,21 @@ export default {
|
|||||||
},
|
},
|
||||||
openBusinessForm(mode, row = {}) {
|
openBusinessForm(mode, row = {}) {
|
||||||
if (this.isStandaloneBusinessPage) {
|
if (this.isStandaloneBusinessPage) {
|
||||||
|
const query = {
|
||||||
|
mode,
|
||||||
|
...(mode === 'edit' && row.id ? { id: row.id } : {}),
|
||||||
|
name: `${mode === 'edit' ? '编辑' : '新增'}${this.config.title}`,
|
||||||
|
};
|
||||||
|
// 如果是复制模式,添加标识
|
||||||
|
console.log('openBusinessForm, mode:', mode, 'copyingRow:', this.copyingRow);
|
||||||
|
if (mode === 'add' && this.copyingRow) {
|
||||||
|
query.copy = Date.now().toString();
|
||||||
|
console.log('添加 copy 参数:', query.copy);
|
||||||
|
}
|
||||||
|
console.log('最终的 query:', query);
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/business/shipping-template/form',
|
path: '/business/shipping-template/form',
|
||||||
query: {
|
query,
|
||||||
mode,
|
|
||||||
...(mode === 'edit' && row.id ? { id: row.id } : {}),
|
|
||||||
name: `${mode === 'edit' ? '编辑' : '新增'}${this.config.title}`,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1624,10 +1634,29 @@ export default {
|
|||||||
if (!this.isStandaloneFormPage) return;
|
if (!this.isStandaloneFormPage) return;
|
||||||
const mode = this.$route.query.mode;
|
const mode = this.$route.query.mode;
|
||||||
const id = this.$route.query.id || '';
|
const id = this.$route.query.id || '';
|
||||||
const key = `${mode}:${id}`;
|
const copy = this.$route.query.copy || '';
|
||||||
|
const key = `${mode}:${id}:${copy}`;
|
||||||
|
console.log('initStandaloneFormPage 被调用, key:', key, 'standaloneFormKey:', this.standaloneFormKey);
|
||||||
if (this.standaloneFormKey === key) return;
|
if (this.standaloneFormKey === key) return;
|
||||||
this.standaloneFormKey = key;
|
this.standaloneFormKey = key;
|
||||||
|
|
||||||
|
// 检查是否是复制模式
|
||||||
|
if (mode === 'add' && copy) {
|
||||||
|
const copyData = sessionStorage.getItem('shipping-template-copy-data');
|
||||||
|
console.log('复制模式检测到,从 sessionStorage 读取数据:', copyData);
|
||||||
|
if (copyData) {
|
||||||
|
try {
|
||||||
|
this.copyingRow = JSON.parse(copyData);
|
||||||
|
console.log('解析后的 copyingRow:', this.copyingRow);
|
||||||
|
sessionStorage.removeItem('shipping-template-copy-data');
|
||||||
|
} catch (e) {
|
||||||
|
console.error('解析复制数据失败', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mode === 'edit') this.form = { id };
|
if (mode === 'edit') this.form = { id };
|
||||||
|
console.log('调用 beforeOpen 前,copyingRow:', this.copyingRow);
|
||||||
this.beforeOpen(() => {}, mode);
|
this.beforeOpen(() => {}, mode);
|
||||||
},
|
},
|
||||||
parseJsonArray(value) {
|
parseJsonArray(value) {
|
||||||
@@ -1752,9 +1781,37 @@ export default {
|
|||||||
.catch(() => loading?.());
|
.catch(() => loading?.());
|
||||||
},
|
},
|
||||||
beforeOpen(done, type) {
|
beforeOpen(done, type) {
|
||||||
|
console.log('beforeOpen 被调用,type:', type, 'copyingRow:', this.copyingRow);
|
||||||
this.crudDialogType = type;
|
this.crudDialogType = type;
|
||||||
this.dialogReadonly = type === 'view';
|
this.dialogReadonly = type === 'view';
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
|
// 检查是否是复制模式
|
||||||
|
if (this.copyingRow) {
|
||||||
|
console.log('进入复制模式分支');
|
||||||
|
const copyData = { ...this.copyingRow };
|
||||||
|
this.copyingRow = null;
|
||||||
|
this.form = { ...(this.config.defaultForm || {}), ...copyData };
|
||||||
|
console.log('合并后的 form:', this.form);
|
||||||
|
// 删除模板编号,等待系统生成
|
||||||
|
delete this.form.templateCode;
|
||||||
|
this.applyFormDetail(this.form);
|
||||||
|
console.log('applyFormDetail 调用完成');
|
||||||
|
// 生成新的模板编号
|
||||||
|
if (typeof this.api.nextCode === 'function') {
|
||||||
|
this.api
|
||||||
|
.nextCode()
|
||||||
|
.then(res => {
|
||||||
|
this.form.templateCode = res?.data?.data || '';
|
||||||
|
console.log('生成的新模板编号:', this.form.templateCode);
|
||||||
|
})
|
||||||
|
.finally(() => done?.());
|
||||||
|
} else {
|
||||||
|
done?.();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log('进入正常新增模式分支');
|
||||||
|
// 正常新增模式
|
||||||
this.form = { ...(this.config.defaultForm || {}) };
|
this.form = { ...(this.config.defaultForm || {}) };
|
||||||
this.selectedProjectId = '';
|
this.selectedProjectId = '';
|
||||||
this.contractOptions = [];
|
this.contractOptions = [];
|
||||||
@@ -1791,9 +1848,12 @@ export default {
|
|||||||
this.normalizeCargo(item)
|
this.normalizeCargo(item)
|
||||||
);
|
);
|
||||||
if (!this.transportCargoRows.length) this.transportCargoRows = [defaultCargo()];
|
if (!this.transportCargoRows.length) this.transportCargoRows = [defaultCargo()];
|
||||||
this.restoreCargoTypePaths();
|
// 先加载货物类型树,保证已有货物类型可以回显为级联路径,然后再恢复路径。
|
||||||
// 编辑时先加载货物类型树,保证已有货物类型可以回显为级联路径。
|
this.ensureCargoTypeOptions()
|
||||||
this.ensureCargoTypeOptions().catch(() => {});
|
.then(() => {
|
||||||
|
this.restoreCargoTypePaths();
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
this.attachmentRows = this.parseJsonArray(this.form.attachmentsJson);
|
this.attachmentRows = this.parseJsonArray(this.form.attachmentsJson);
|
||||||
this.shippingTemplateFreight = {
|
this.shippingTemplateFreight = {
|
||||||
...defaultFreight(),
|
...defaultFreight(),
|
||||||
@@ -1937,11 +1997,42 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleCopy(row) {
|
handleCopy(row) {
|
||||||
if (typeof this.api.copy !== 'function') return;
|
this.api
|
||||||
this.api.copy(row.id).then(() => {
|
.getDetail(row.id)
|
||||||
this.$message.success('复制成功');
|
.then(res => {
|
||||||
this.onLoad(this.page, this.query);
|
const detail = res?.data?.data || {};
|
||||||
});
|
console.log('获取到的详情数据:', detail);
|
||||||
|
// 删除不需要复制的字段
|
||||||
|
delete detail.id;
|
||||||
|
delete detail.templateCode; // 系统自动生成
|
||||||
|
delete detail.createTime;
|
||||||
|
delete detail.createUser;
|
||||||
|
delete detail.createUserName;
|
||||||
|
delete detail.createDept;
|
||||||
|
delete detail.updateTime;
|
||||||
|
delete detail.updateUser;
|
||||||
|
delete detail.updateUserName;
|
||||||
|
delete detail.status;
|
||||||
|
|
||||||
|
console.log('处理后的数据:', detail);
|
||||||
|
console.log('isStandaloneBusinessPage:', this.isStandaloneBusinessPage);
|
||||||
|
|
||||||
|
// 存储到组件状态(用于判断是否是复制模式)
|
||||||
|
this.copyingRow = detail;
|
||||||
|
console.log('已存储到 copyingRow');
|
||||||
|
|
||||||
|
// 如果是独立表单页模式,同时存储到 sessionStorage
|
||||||
|
if (this.isStandaloneBusinessPage) {
|
||||||
|
sessionStorage.setItem('shipping-template-copy-data', JSON.stringify(detail));
|
||||||
|
console.log('已存储到 sessionStorage');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开新增表单
|
||||||
|
this.openBusinessForm('add', {});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.error('获取数据失败');
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleCustomOperation(operation, row) {
|
handleCustomOperation(operation, row) {
|
||||||
if (operation.action === 'createFromTemplate') {
|
if (operation.action === 'createFromTemplate') {
|
||||||
@@ -2100,6 +2191,45 @@ export default {
|
|||||||
}[text.toUpperCase()] || text
|
}[text.toUpperCase()] || text
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
currencyUnit(value) {
|
||||||
|
const text = String(value || '');
|
||||||
|
// 如果格式是 "CNY - 人民币",提取货币代码部分
|
||||||
|
let code = text;
|
||||||
|
if (text.includes(' - ')) {
|
||||||
|
code = text.split(' - ')[0].trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
const upperCode = code.toUpperCase();
|
||||||
|
const unitMap = {
|
||||||
|
CNY: '元',
|
||||||
|
RMB: '元',
|
||||||
|
USD: '美元',
|
||||||
|
EUR: '欧元',
|
||||||
|
JPY: '日元',
|
||||||
|
GBP: '英镑',
|
||||||
|
};
|
||||||
|
|
||||||
|
// 如果是已知的货币代码,返回对应的单位
|
||||||
|
if (unitMap[upperCode]) {
|
||||||
|
return unitMap[upperCode];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是中文货币名称,转换为单位
|
||||||
|
const nameMap = {
|
||||||
|
'人民币': '元',
|
||||||
|
'美元': '美元',
|
||||||
|
'欧元': '欧元',
|
||||||
|
'日元': '日元',
|
||||||
|
'英镑': '英镑',
|
||||||
|
};
|
||||||
|
|
||||||
|
if (nameMap[code]) {
|
||||||
|
return nameMap[code];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认返回原值
|
||||||
|
return text;
|
||||||
|
},
|
||||||
loadFeeUnitOptions() {
|
loadFeeUnitOptions() {
|
||||||
getDictionary({ code: 'unit_fee' }).then(res => {
|
getDictionary({ code: 'unit_fee' }).then(res => {
|
||||||
this.feeUnitOptions = this.normalizeDictOptions(res?.data?.data || []);
|
this.feeUnitOptions = this.normalizeDictOptions(res?.data?.data || []);
|
||||||
@@ -2644,7 +2774,20 @@ export default {
|
|||||||
const pathMatch = this.cargoTypeFlatOptions.find(item => item.path?.join('/') === pathKey);
|
const pathMatch = this.cargoTypeFlatOptions.find(item => item.path?.join('/') === pathKey);
|
||||||
if (pathMatch) return pathMatch;
|
if (pathMatch) return pathMatch;
|
||||||
}
|
}
|
||||||
const codeCandidates = [row.secondCargoTypeCode, row.cargoTypeCode, row.firstCargoTypeCode]
|
|
||||||
|
// 优先通过二级类型编码查找(最准确)
|
||||||
|
if (row.secondCargoTypeCode) {
|
||||||
|
const secondMatch = this.cargoTypeFlatOptions.find(
|
||||||
|
item => String(item.cargoCode || item.code || '').trim() === String(row.secondCargoTypeCode).trim()
|
||||||
|
);
|
||||||
|
if (secondMatch) {
|
||||||
|
console.log('通过 secondCargoTypeCode 找到货物类型:', secondMatch);
|
||||||
|
return secondMatch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 其他候选编码
|
||||||
|
const codeCandidates = [row.cargoTypeCode, row.firstCargoTypeCode]
|
||||||
.map(value => String(value || '').trim())
|
.map(value => String(value || '').trim())
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
const nameCandidates = [
|
const nameCandidates = [
|
||||||
@@ -2655,6 +2798,7 @@ export default {
|
|||||||
]
|
]
|
||||||
.map(value => String(value || '').trim())
|
.map(value => String(value || '').trim())
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
this.cargoTypeFlatOptions.find(item =>
|
this.cargoTypeFlatOptions.find(item =>
|
||||||
codeCandidates.some(
|
codeCandidates.some(
|
||||||
@@ -2671,13 +2815,19 @@ export default {
|
|||||||
return matched?.path ? this.cargoPath(matched.path) : [];
|
return matched?.path ? this.cargoPath(matched.path) : [];
|
||||||
},
|
},
|
||||||
restoreCargoTypePaths() {
|
restoreCargoTypePaths() {
|
||||||
|
console.log('restoreCargoTypePaths 被调用');
|
||||||
|
console.log('transportCargoRows:', this.transportCargoRows);
|
||||||
|
console.log('cargoTypeFlatOptions 长度:', this.cargoTypeFlatOptions.length);
|
||||||
if (!this.transportCargoRows.length || !this.cargoTypeFlatOptions.length) return;
|
if (!this.transportCargoRows.length || !this.cargoTypeFlatOptions.length) return;
|
||||||
this.transportCargoRows.forEach(row => {
|
this.transportCargoRows.forEach((row, index) => {
|
||||||
|
console.log(`处理第 ${index + 1} 行货物:`, row);
|
||||||
const path = this.resolveCargoTypePath(row);
|
const path = this.resolveCargoTypePath(row);
|
||||||
|
console.log(`解析出的 path:`, path);
|
||||||
if (!path.length) return;
|
if (!path.length) return;
|
||||||
const item = this.cargoTypeFlatOptions.find(
|
const item = this.cargoTypeFlatOptions.find(
|
||||||
option => option.path?.join('/') === path.join('/')
|
option => option.path?.join('/') === path.join('/')
|
||||||
);
|
);
|
||||||
|
console.log(`匹配到的 item:`, item);
|
||||||
row.cargoTypePath = path;
|
row.cargoTypePath = path;
|
||||||
row.cargoType =
|
row.cargoType =
|
||||||
item?.cargoName ||
|
item?.cargoName ||
|
||||||
@@ -2691,12 +2841,22 @@ export default {
|
|||||||
row.secondCargoTypeCode ||
|
row.secondCargoTypeCode ||
|
||||||
row.firstCargoTypeCode ||
|
row.firstCargoTypeCode ||
|
||||||
'';
|
'';
|
||||||
|
console.log(`设置后的 row.cargoTypePath:`, row.cargoTypePath);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
normalizeCargo(row = {}) {
|
normalizeCargo(row = {}) {
|
||||||
const cargoTypePath = this.resolveCargoTypePath(row);
|
console.log('normalizeCargo 输入:', row);
|
||||||
|
// 如果原始数据中有完整的 cargoTypePath 数组,直接使用
|
||||||
|
let cargoTypePath = [];
|
||||||
|
if (Array.isArray(row.cargoTypePath) && row.cargoTypePath.length > 0) {
|
||||||
|
cargoTypePath = this.cargoPath(row.cargoTypePath);
|
||||||
|
console.log('使用原始的 cargoTypePath:', cargoTypePath);
|
||||||
|
} else {
|
||||||
|
cargoTypePath = this.resolveCargoTypePath(row);
|
||||||
|
console.log('解析的 cargoTypePath:', cargoTypePath);
|
||||||
|
}
|
||||||
const cargoType = this.findCargoTypeOption({ ...row, cargoTypePath });
|
const cargoType = this.findCargoTypeOption({ ...row, cargoTypePath });
|
||||||
return {
|
const result = {
|
||||||
...defaultCargo(),
|
...defaultCargo(),
|
||||||
...row,
|
...row,
|
||||||
cargoTypePath,
|
cargoTypePath,
|
||||||
@@ -2714,6 +2874,8 @@ export default {
|
|||||||
'',
|
'',
|
||||||
cargoName: row.cargoName || row.goodsName || '',
|
cargoName: row.cargoName || row.goodsName || '',
|
||||||
};
|
};
|
||||||
|
console.log('normalizeCargo 输出:', result);
|
||||||
|
return result;
|
||||||
},
|
},
|
||||||
handleCargoTypeChange(row, value) {
|
handleCargoTypeChange(row, value) {
|
||||||
const path = this.cargoPath(value);
|
const path = this.cargoPath(value);
|
||||||
@@ -2740,26 +2902,47 @@ export default {
|
|||||||
.catch(() => callback([]));
|
.catch(() => callback([]));
|
||||||
},
|
},
|
||||||
async selectCargoSuggestion(row, item = {}) {
|
async selectCargoSuggestion(row, item = {}) {
|
||||||
const cargoTypeOption = this.findCargoTypeOption(item);
|
console.log('selectCargoSuggestion 被调用,item:', item);
|
||||||
|
|
||||||
const selectedCargo = {
|
const selectedCargo = {
|
||||||
...row,
|
...row,
|
||||||
...item,
|
...item,
|
||||||
cargoName: item.cargoName || item.name || item.label || item.value || row.cargoName || '',
|
cargoName: item.cargoName || item.name || item.label || item.value || row.cargoName || '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 确保货物类型树已加载
|
||||||
try {
|
try {
|
||||||
await this.ensureCargoTypeOptions();
|
await this.ensureCargoTypeOptions();
|
||||||
|
console.log('货物类型树已加载,共', this.cargoTypeFlatOptions.length, '个选项');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.warn('货物类型树加载失败', error);
|
||||||
// 货物类型树加载失败时仍保留货物名称,提交时会给出货物类型必填提示。
|
// 货物类型树加载失败时仍保留货物名称,提交时会给出货物类型必填提示。
|
||||||
}
|
}
|
||||||
// 货物名称返回了类型信息时,以货物自身的类型覆盖当前行原有类型。
|
|
||||||
// 这样从一个类型切换到另一个类型时,级联选择器不会继续显示旧值。
|
// 从常用货物返回的数据中查找货物类型
|
||||||
const matchedCargoType = this.findCargoTypeOption(item) || cargoTypeOption;
|
const matchedCargoType = this.findCargoTypeOption(item);
|
||||||
|
console.log('匹配到的货物类型:', matchedCargoType);
|
||||||
|
|
||||||
if (matchedCargoType?.path?.length) {
|
if (matchedCargoType?.path?.length) {
|
||||||
selectedCargo.cargoTypePath = this.cargoPath(matchedCargoType.path);
|
// 找到匹配的货物类型,回填到当前行
|
||||||
|
const fullPath = matchedCargoType.path;
|
||||||
|
selectedCargo.cargoTypePath = this.cargoPath(fullPath);
|
||||||
selectedCargo.cargoType = matchedCargoType.cargoName || selectedCargo.cargoType;
|
selectedCargo.cargoType = matchedCargoType.cargoName || selectedCargo.cargoType;
|
||||||
selectedCargo.cargoTypeCode =
|
selectedCargo.cargoTypeCode =
|
||||||
matchedCargoType.cargoCode || matchedCargoType.code || matchedCargoType.id || '';
|
matchedCargoType.cargoCode || matchedCargoType.code || matchedCargoType.id || '';
|
||||||
|
|
||||||
|
console.log('货物名称选择后反选货物类型:', {
|
||||||
|
cargoName: selectedCargo.cargoName,
|
||||||
|
cargoType: selectedCargo.cargoType,
|
||||||
|
cargoTypePath: selectedCargo.cargoTypePath,
|
||||||
|
fullPath: fullPath,
|
||||||
|
matchedCargoType: matchedCargoType,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.warn('未找到匹配的货物类型,item数据:', item);
|
||||||
|
console.warn('当前 cargoTypeFlatOptions 前5项:', this.cargoTypeFlatOptions.slice(0, 5));
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(row, this.normalizeCargo(selectedCargo));
|
Object.assign(row, this.normalizeCargo(selectedCargo));
|
||||||
row.value = undefined;
|
row.value = undefined;
|
||||||
this.syncFreightItems();
|
this.syncFreightItems();
|
||||||
|
|||||||
@@ -316,6 +316,25 @@
|
|||||||
empty-text="暂无货物信息"
|
empty-text="暂无货物信息"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" label="序号" width="70" align="center" fixed="left" />
|
<el-table-column type="index" label="序号" width="70" align="center" fixed="left" />
|
||||||
|
<el-table-column min-width="220" align="center">
|
||||||
|
<template #header>
|
||||||
|
<span class="transport-plan-page__required-column">货物类型</span>
|
||||||
|
</template>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-cascader
|
||||||
|
v-model="row.cargoTypePath"
|
||||||
|
:options="transportCargoTypeOptions"
|
||||||
|
:props="transportCargoTypeCascaderProps"
|
||||||
|
:placeholder="row.cargoType || '请选择'"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
:disabled="dialogReadonly"
|
||||||
|
:filter-method="filterBillingCargoType"
|
||||||
|
@visible-change="visible => visible && ensureBillingCargoTypeOptions()"
|
||||||
|
@change="value => handleTransportCargoTypeChange(row, value)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="货物名称" min-width="240" align="center">
|
<el-table-column label="货物名称" min-width="240" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-autocomplete
|
<el-autocomplete
|
||||||
@@ -334,31 +353,11 @@
|
|||||||
<template #default="{ item }">
|
<template #default="{ item }">
|
||||||
<div class="transport-plan-page__cargo-autocomplete-item">
|
<div class="transport-plan-page__cargo-autocomplete-item">
|
||||||
<span>{{ formatBillingCargoTypeLabel(item) }}</span>
|
<span>{{ formatBillingCargoTypeLabel(item) }}</span>
|
||||||
<small v-if="item.cargoCode">{{ item.cargoCode }}</small>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-autocomplete>
|
</el-autocomplete>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column min-width="220" align="center">
|
|
||||||
<template #header>
|
|
||||||
<span class="transport-plan-page__required-column">货物类型</span>
|
|
||||||
</template>
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-cascader
|
|
||||||
v-model="row.cargoTypePath"
|
|
||||||
:options="transportCargoTypeOptions"
|
|
||||||
:props="transportCargoTypeCascaderProps"
|
|
||||||
:placeholder="row.cargoType || '请选择'"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
:disabled="dialogReadonly"
|
|
||||||
:filter-method="filterBillingCargoType"
|
|
||||||
@visible-change="visible => visible && ensureBillingCargoTypeOptions()"
|
|
||||||
@change="value => handleTransportCargoTypeChange(row, value)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="数量" min-width="120" align="center">
|
<el-table-column label="数量" min-width="120" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input
|
<el-input
|
||||||
@@ -1494,10 +1493,12 @@
|
|||||||
v-model="dispatchItemForm.departureName"
|
v-model="dispatchItemForm.departureName"
|
||||||
:placeholder="dispatchStationNamePlaceholder"
|
:placeholder="dispatchStationNamePlaceholder"
|
||||||
:suffix-icon="dispatchStationMode ? Search : undefined"
|
:suffix-icon="dispatchStationMode ? Search : undefined"
|
||||||
|
disabled
|
||||||
/>
|
/>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dispatchItemForm.departureAddress"
|
v-model="dispatchItemForm.departureAddress"
|
||||||
:placeholder="dispatchAddressDetailPlaceholder"
|
:placeholder="dispatchAddressDetailPlaceholder"
|
||||||
|
disabled
|
||||||
>
|
>
|
||||||
<template v-if="!dispatchStationMode" #suffix>
|
<template v-if="!dispatchStationMode" #suffix>
|
||||||
<el-link
|
<el-link
|
||||||
@@ -1509,9 +1510,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<span class="transport-plan-page__route-label">联系人</span>
|
<span class="transport-plan-page__route-label">联系人</span>
|
||||||
<el-input v-model="dispatchItemForm.departureContact" placeholder="请输入" />
|
<el-input v-model="dispatchItemForm.departureContact" placeholder="请输入" disabled />
|
||||||
<span class="transport-plan-page__route-label">联系方式</span>
|
<span class="transport-plan-page__route-label">联系方式</span>
|
||||||
<el-input v-model="dispatchItemForm.departurePhone" placeholder="请输入" />
|
<el-input v-model="dispatchItemForm.departurePhone" placeholder="请输入" disabled />
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="收货地址" required>
|
<el-form-item label="收货地址" required>
|
||||||
@@ -1520,10 +1521,12 @@
|
|||||||
v-model="dispatchItemForm.arrivalName"
|
v-model="dispatchItemForm.arrivalName"
|
||||||
:placeholder="dispatchStationNamePlaceholder"
|
:placeholder="dispatchStationNamePlaceholder"
|
||||||
:suffix-icon="dispatchStationMode ? Search : undefined"
|
:suffix-icon="dispatchStationMode ? Search : undefined"
|
||||||
|
disabled
|
||||||
/>
|
/>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dispatchItemForm.arrivalAddress"
|
v-model="dispatchItemForm.arrivalAddress"
|
||||||
:placeholder="dispatchAddressDetailPlaceholder"
|
:placeholder="dispatchAddressDetailPlaceholder"
|
||||||
|
disabled
|
||||||
>
|
>
|
||||||
<template v-if="!dispatchStationMode" #suffix>
|
<template v-if="!dispatchStationMode" #suffix>
|
||||||
<el-link
|
<el-link
|
||||||
@@ -1535,9 +1538,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<span class="transport-plan-page__route-label">联系人</span>
|
<span class="transport-plan-page__route-label">联系人</span>
|
||||||
<el-input v-model="dispatchItemForm.arrivalContact" placeholder="请输入" />
|
<el-input v-model="dispatchItemForm.arrivalContact" placeholder="请输入" disabled />
|
||||||
<span class="transport-plan-page__route-label">联系方式</span>
|
<span class="transport-plan-page__route-label">联系方式</span>
|
||||||
<el-input v-model="dispatchItemForm.arrivalPhone" placeholder="请输入" />
|
<el-input v-model="dispatchItemForm.arrivalPhone" placeholder="请输入" disabled />
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -4849,10 +4852,7 @@ export default {
|
|||||||
fetchTaskCargoSuggestions(queryString, callback, path = []) {
|
fetchTaskCargoSuggestions(queryString, callback, path = []) {
|
||||||
const keyword = String(queryString || '').trim();
|
const keyword = String(queryString || '').trim();
|
||||||
const normalizedPath = this.normalizeBillingCargoTypePath(path);
|
const normalizedPath = this.normalizeBillingCargoTypePath(path);
|
||||||
if (!keyword && !normalizedPath.length) {
|
// 移除空查询时返回空数组的限制,允许点击时显示货物列表
|
||||||
callback([]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let loadingKey = '';
|
let loadingKey = '';
|
||||||
this.ensureBillingCargoTypeOptions()
|
this.ensureBillingCargoTypeOptions()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -4884,11 +4884,42 @@ export default {
|
|||||||
if (loadingKey) this.setTaskCargoLoadingByKey(loadingKey, false);
|
if (loadingKey) this.setTaskCargoLoadingByKey(loadingKey, false);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleTaskCargoRowSelect(row, item = {}) {
|
async handleTaskCargoRowSelect(row, item = {}) {
|
||||||
const value = this.formatBillingCargoTypeLabel(item);
|
const value = this.formatBillingCargoTypeLabel(item);
|
||||||
row.cargoName = value;
|
row.cargoName = value;
|
||||||
row.specification = item.specification || item.spec || row.specification || '';
|
row.specification = item.specification || item.spec || row.specification || '';
|
||||||
row.model = item.model || item.modelName || row.model || '';
|
row.model = item.model || item.modelName || row.model || '';
|
||||||
|
|
||||||
|
// 确保货物类型树已加载
|
||||||
|
try {
|
||||||
|
await this.ensureBillingCargoTypeOptions();
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('货物类型树加载失败', error);
|
||||||
|
this.syncTransportCargoJson();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从常用货物返回的数据中查找货物类型并反选
|
||||||
|
const matchedCargoType = this.findBillingCargoTypeOption(item);
|
||||||
|
|
||||||
|
if (matchedCargoType?.path?.length) {
|
||||||
|
// 找到匹配的货物类型,回填到当前行
|
||||||
|
const fullPath = this.normalizeBillingCargoTypePath(matchedCargoType.path);
|
||||||
|
row.cargoTypePath = fullPath;
|
||||||
|
row.cargoType = matchedCargoType.cargoName || row.cargoType || '';
|
||||||
|
row.cargoTypeCode =
|
||||||
|
matchedCargoType.cargoCode || matchedCargoType.code || matchedCargoType.id || '';
|
||||||
|
|
||||||
|
console.log('货物名称选择后反选货物类型:', {
|
||||||
|
cargoName: row.cargoName,
|
||||||
|
cargoType: row.cargoType,
|
||||||
|
cargoTypePath: row.cargoTypePath,
|
||||||
|
matchedCargoType: matchedCargoType,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.warn('未找到匹配的货物类型,item数据:', item);
|
||||||
|
}
|
||||||
|
|
||||||
this.syncTransportCargoJson();
|
this.syncTransportCargoJson();
|
||||||
},
|
},
|
||||||
loadTaskQuantityUnitOptions() {
|
loadTaskQuantityUnitOptions() {
|
||||||
@@ -6179,6 +6210,49 @@ export default {
|
|||||||
null
|
null
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
findBillingCargoTypeOption(row = {}) {
|
||||||
|
const path = this.normalizeBillingCargoTypePath(row.cargoTypePath);
|
||||||
|
if (path.length) {
|
||||||
|
const pathKey = path.join('/');
|
||||||
|
const pathMatch = this.billingCargoTypeFlatOptions.find(item => item.path?.join('/') === pathKey);
|
||||||
|
if (pathMatch) return pathMatch;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 优先通过二级类型编码查找(最准确)
|
||||||
|
if (row.secondCargoTypeCode) {
|
||||||
|
const secondMatch = this.billingCargoTypeFlatOptions.find(
|
||||||
|
item => String(item.cargoCode || item.code || '').trim() === String(row.secondCargoTypeCode).trim()
|
||||||
|
);
|
||||||
|
if (secondMatch) {
|
||||||
|
console.log('通过 secondCargoTypeCode 找到货物类型:', secondMatch);
|
||||||
|
return secondMatch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 其他候选编码
|
||||||
|
const codeCandidates = [row.cargoTypeCode, row.firstCargoTypeCode]
|
||||||
|
.map(value => String(value || '').trim())
|
||||||
|
.filter(Boolean);
|
||||||
|
const nameCandidates = [
|
||||||
|
row.secondCargoTypeName,
|
||||||
|
row.cargoType,
|
||||||
|
row.goodsType,
|
||||||
|
row.firstCargoTypeName,
|
||||||
|
]
|
||||||
|
.map(value => String(value || '').trim())
|
||||||
|
.filter(Boolean);
|
||||||
|
|
||||||
|
return (
|
||||||
|
this.billingCargoTypeFlatOptions.find(item =>
|
||||||
|
codeCandidates.some(
|
||||||
|
code => code === String(item.cargoCode || item.code || item.id || '').trim()
|
||||||
|
)
|
||||||
|
) ||
|
||||||
|
this.billingCargoTypeFlatOptions.find(item =>
|
||||||
|
nameCandidates.some(name => name === String(item.cargoName || '').trim())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
resolveCommonCargoTypePath(row = {}) {
|
resolveCommonCargoTypePath(row = {}) {
|
||||||
const path = this.normalizeBillingCargoTypePath(row.cargoTypePath);
|
const path = this.normalizeBillingCargoTypePath(row.cargoTypePath);
|
||||||
if (path.length) return path;
|
if (path.length) return path;
|
||||||
|
|||||||
@@ -655,23 +655,10 @@ const extractRecords = res => {
|
|||||||
if (Array.isArray(data?.data?.records)) return data.data.records;
|
if (Array.isArray(data?.data?.records)) return data.data.records;
|
||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
// 批次号规则:PC + 导入日期 + 当日批次流水号(4 位),如 PC202606010001。
|
// 批次号由后端按 PC + 导入日期 + 当日流水生成,已删除数据也计入流水,避免唯一索引冲突。
|
||||||
const batchNoPrefix = 'PC';
|
|
||||||
const batchNoSequenceLength = 4;
|
|
||||||
const generateBatchNo = async () => {
|
const generateBatchNo = async () => {
|
||||||
const prefix = `${batchNoPrefix}${dayjs().format('YYYYMMDD')}`;
|
const res = await api.getImportBatchNextCode();
|
||||||
let maxSequence = 0;
|
return res?.data?.data || '';
|
||||||
try {
|
|
||||||
const res = await api.getImportBatches({ current: 1, size: 9999 });
|
|
||||||
extractRecords(res).forEach(item => {
|
|
||||||
const no = String(item.batchNo || '').trim();
|
|
||||||
if (!no.startsWith(prefix)) return;
|
|
||||||
maxSequence = Math.max(maxSequence, Number(no.slice(prefix.length)) || 0);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
maxSequence = 0;
|
|
||||||
}
|
|
||||||
return `${prefix}${String(maxSequence + 1).padStart(batchNoSequenceLength, '0')}`;
|
|
||||||
};
|
};
|
||||||
// 承运商合同的承运商固定取合同乙方,与运单管理(waybill-manage-page)保持一致。
|
// 承运商合同的承运商固定取合同乙方,与运单管理(waybill-manage-page)保持一致。
|
||||||
const getCarrierContractPartyName = (contract = {}) =>
|
const getCarrierContractPartyName = (contract = {}) =>
|
||||||
|
|||||||
@@ -100,9 +100,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #businessStatus="{ row }">
|
<template #businessStatus="{ row }">
|
||||||
<el-tag :type="statusTagType(row.businessStatus)" class="status-text">
|
<span class="waybill-manage-page__status-cell">
|
||||||
{{ displayStatus(row, 'businessStatus') }}
|
<el-tag :type="statusTagType(row.businessStatus)" class="status-text">
|
||||||
</el-tag>
|
{{ displayStatus(row, 'businessStatus') }}
|
||||||
|
</el-tag>
|
||||||
|
<el-tooltip
|
||||||
|
v-if="driverRejectReasonText(row)"
|
||||||
|
:content="driverRejectReasonText(row)"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<el-icon class="waybill-manage-page__reject-tip-icon">
|
||||||
|
<WarnTriangleFilled />
|
||||||
|
</el-icon>
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #approvalStatus="{ row }">
|
<template #approvalStatus="{ row }">
|
||||||
@@ -1569,7 +1580,7 @@
|
|||||||
<el-link type="primary" v-if="canEdit(row)" @click="openBusinessForm('edit', row)">
|
<el-link type="primary" v-if="canEdit(row)" @click="openBusinessForm('edit', row)">
|
||||||
编辑
|
编辑
|
||||||
</el-link>
|
</el-link>
|
||||||
<el-link type="primary" v-if="canReassign(row)" @click="handleAction('reassign', row)">
|
<el-link type="primary" v-if="canReassign(row)" @click="openReassignDrawer(row)">
|
||||||
重新派单
|
重新派单
|
||||||
</el-link>
|
</el-link>
|
||||||
<el-link type="primary" v-if="canCopy(row)" @click="handleCopy(row)"> 复制 </el-link>
|
<el-link type="primary" v-if="canCopy(row)" @click="handleCopy(row)"> 复制 </el-link>
|
||||||
@@ -1601,6 +1612,87 @@
|
|||||||
</template>
|
</template>
|
||||||
</component>
|
</component>
|
||||||
|
|
||||||
|
<el-drawer
|
||||||
|
v-model="reassignDrawer.visible"
|
||||||
|
title="重新派单"
|
||||||
|
direction="btt"
|
||||||
|
size="280px"
|
||||||
|
append-to-body
|
||||||
|
destroy-on-close
|
||||||
|
class="waybill-manage-page__reassign-drawer"
|
||||||
|
@closed="resetReassignDrawer"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="reassignFormRef"
|
||||||
|
:model="reassignForm"
|
||||||
|
:rules="reassignRules"
|
||||||
|
label-width="72px"
|
||||||
|
class="waybill-manage-page__reassign-form"
|
||||||
|
>
|
||||||
|
<div class="waybill-manage-page__reassign-row">
|
||||||
|
<div class="waybill-manage-page__reassign-meta">
|
||||||
|
<span class="waybill-manage-page__reassign-meta-label">运单号</span>
|
||||||
|
<span class="waybill-manage-page__reassign-meta-value">{{
|
||||||
|
reassignDrawer.row?.waybillNo || '-'
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="waybill-manage-page__reassign-meta waybill-manage-page__reassign-meta--wide">
|
||||||
|
<span class="waybill-manage-page__reassign-meta-label">拒绝原因</span>
|
||||||
|
<span class="waybill-manage-page__reassign-meta-value">{{
|
||||||
|
driverRejectReasonText(reassignDrawer.row) || '-'
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="waybill-manage-page__reassign-row">
|
||||||
|
<el-form-item label="司机" prop="driverName" class="waybill-manage-page__reassign-span-1">
|
||||||
|
<el-autocomplete
|
||||||
|
v-model="reassignForm.driverName"
|
||||||
|
placeholder="请输入"
|
||||||
|
clearable
|
||||||
|
:debounce="300"
|
||||||
|
:fetch-suggestions="fetchReassignDriverSuggestions"
|
||||||
|
:loading="reassignDrawer.driverLoading"
|
||||||
|
style="width: 100%"
|
||||||
|
@select="handleReassignDriverSelect"
|
||||||
|
@change="handleReassignDriverChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="手机号"
|
||||||
|
prop="driverPhone"
|
||||||
|
class="waybill-manage-page__reassign-span-1"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="reassignForm.driverPhone"
|
||||||
|
placeholder="请输入"
|
||||||
|
clearable
|
||||||
|
maxlength="20"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车牌号" prop="vehicleNo" class="waybill-manage-page__reassign-span-1">
|
||||||
|
<el-input
|
||||||
|
v-model="reassignForm.vehicleNo"
|
||||||
|
placeholder="请输入车牌号"
|
||||||
|
clearable
|
||||||
|
maxlength="30"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="waybill-manage-page__reassign-footer">
|
||||||
|
<el-button @click="reassignDrawer.visible = false">取消</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:loading="reassignDrawer.submitting"
|
||||||
|
@click="submitReassign"
|
||||||
|
>
|
||||||
|
确认派单
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-drawer>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="mileageDialog.visible"
|
v-model="mileageDialog.visible"
|
||||||
width="520px"
|
width="520px"
|
||||||
@@ -1934,33 +2026,149 @@
|
|||||||
<section-card title="执行详情">
|
<section-card title="执行详情">
|
||||||
<el-tabs v-model="waybillProcessDetailTab" type="border-card">
|
<el-tabs v-model="waybillProcessDetailTab" type="border-card">
|
||||||
<el-tab-pane label="打卡详情" name="punch">
|
<el-tab-pane label="打卡详情" name="punch">
|
||||||
<el-timeline v-if="waybillDetailProcessNodes.length">
|
<div v-loading="waybillPunchRecordsLoading">
|
||||||
<el-timeline-item
|
<el-timeline v-if="waybillPunchRecords.length">
|
||||||
v-for="(node, index) in waybillDetailProcessNodes"
|
<el-timeline-item
|
||||||
:key="node.key || index"
|
v-for="(record, index) in waybillPunchRecords"
|
||||||
:timestamp="node.time || ''"
|
:key="record.nodeCode || record.id || index"
|
||||||
>{{ node.name || node.nodeName || node.label }}</el-timeline-item
|
:timestamp="record.punchTime || record.statusName || '未打卡'"
|
||||||
>
|
:type="record.punched ? 'primary' : 'info'"
|
||||||
</el-timeline>
|
:color="record.punched ? '#2b6ce8' : '#c0c4cc'"
|
||||||
<el-empty v-else description="暂无打卡详情" :image-size="50" />
|
placement="top"
|
||||||
|
>
|
||||||
|
<div class="waybill-manage-page__punch-record">
|
||||||
|
<div class="waybill-manage-page__punch-record-title">
|
||||||
|
{{ record.nodeName || record.nodeCode || '打卡' }}
|
||||||
|
<el-tag
|
||||||
|
:type="record.punched ? 'success' : 'info'"
|
||||||
|
size="small"
|
||||||
|
effect="plain"
|
||||||
|
>{{ record.statusName || (record.punched ? '已打卡' : '未打卡') }}</el-tag
|
||||||
|
>
|
||||||
|
<el-tag
|
||||||
|
v-if="record.type === 'enroute'"
|
||||||
|
size="small"
|
||||||
|
type="info"
|
||||||
|
effect="plain"
|
||||||
|
>在途</el-tag
|
||||||
|
>
|
||||||
|
<el-tag
|
||||||
|
v-if="record.exceptionFlag"
|
||||||
|
size="small"
|
||||||
|
type="danger"
|
||||||
|
effect="plain"
|
||||||
|
>异常</el-tag
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<template v-if="record.punched">
|
||||||
|
<div
|
||||||
|
v-if="record.address"
|
||||||
|
class="waybill-manage-page__punch-record-line"
|
||||||
|
>
|
||||||
|
地点:{{ record.address }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="record.weight || record.volume || record.quantity"
|
||||||
|
class="waybill-manage-page__punch-record-line"
|
||||||
|
>
|
||||||
|
<span v-if="record.weight">重量 {{ record.weight }}吨</span>
|
||||||
|
<span v-if="record.volume">体积 {{ record.volume }}方</span>
|
||||||
|
<span v-if="record.quantity">数量 {{ record.quantity }}</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="record.remark"
|
||||||
|
class="waybill-manage-page__punch-record-line"
|
||||||
|
>
|
||||||
|
备注:{{ record.remark }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="record.photos && record.photos.length"
|
||||||
|
class="waybill-manage-page__punch-record-photos"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-for="(photo, pi) in record.photos"
|
||||||
|
:key="`${record.nodeCode || index}-${pi}`"
|
||||||
|
class="waybill-manage-page__driver-upload-item"
|
||||||
|
@click="previewDriverUploadPhoto(record.photos, pi)"
|
||||||
|
>
|
||||||
|
<el-image :src="photo.url" fit="cover" lazy />
|
||||||
|
<div class="waybill-manage-page__driver-upload-label">
|
||||||
|
{{ photo.label || `${record.nodeName}-凭证` }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div v-else class="waybill-manage-page__punch-record-line">暂未打卡</div>
|
||||||
|
</div>
|
||||||
|
</el-timeline-item>
|
||||||
|
</el-timeline>
|
||||||
|
<el-empty
|
||||||
|
v-else-if="!waybillPunchRecordsLoading"
|
||||||
|
description="暂无打卡记录"
|
||||||
|
:image-size="50"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-if="waybillHasRelatedVoucher"
|
v-if="waybillHasRelatedVoucher"
|
||||||
label="批量补录"
|
label="批量补录"
|
||||||
name="batchSupplement"
|
name="batchSupplement"
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
v-if="waybillVoucherFolderView"
|
||||||
|
class="waybill-manage-page__voucher-folder-toolbar"
|
||||||
|
>
|
||||||
|
<el-button text type="primary" @click="backToWaybillVoucherFolders">
|
||||||
|
返回文件夹
|
||||||
|
</el-button>
|
||||||
|
<span>{{ waybillVoucherFolderName(waybillVoucherFolder) }}</span>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
v-loading="waybillVoucherImagesLoading"
|
v-loading="waybillVoucherImagesLoading"
|
||||||
class="waybill-manage-page__voucher-image-grid"
|
class="waybill-manage-page__voucher-image-grid"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-for="(image, index) in waybillVoucherImages"
|
v-for="(image, index) in waybillVoucherImages"
|
||||||
:key="image.id || image.objectKey || index"
|
:key="
|
||||||
class="waybill-manage-page__voucher-image-item"
|
image.id ||
|
||||||
:title="image.imageName"
|
image.objectKey ||
|
||||||
@click="previewWaybillVoucherImage(index)"
|
(isWaybillVoucherFolder(image)
|
||||||
|
? `${image.voucherId || 'folder'}-${image.folderName || image.name || index}`
|
||||||
|
: index)
|
||||||
|
"
|
||||||
|
:class="[
|
||||||
|
'waybill-manage-page__voucher-image-item',
|
||||||
|
{
|
||||||
|
'waybill-manage-page__voucher-image-item--folder':
|
||||||
|
isWaybillVoucherFolder(image),
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
:title="
|
||||||
|
isWaybillVoucherFolder(image)
|
||||||
|
? waybillVoucherFolderName(image)
|
||||||
|
: image.imageName || image.name
|
||||||
|
"
|
||||||
|
@click="
|
||||||
|
isWaybillVoucherFolder(image)
|
||||||
|
? openWaybillVoucherFolder(image)
|
||||||
|
: previewWaybillVoucherImage(index)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<el-image :src="image.url" fit="cover" lazy />
|
<el-image
|
||||||
|
:src="
|
||||||
|
isWaybillVoucherFolder(image)
|
||||||
|
? image.icon || '/img/文件夹.png'
|
||||||
|
: image.url
|
||||||
|
"
|
||||||
|
:fit="isWaybillVoucherFolder(image) ? 'contain' : 'cover'"
|
||||||
|
lazy
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
v-if="isWaybillVoucherFolder(image)"
|
||||||
|
class="waybill-manage-page__voucher-folder-name"
|
||||||
|
>
|
||||||
|
{{ waybillVoucherFolderName(image) }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-empty
|
<el-empty
|
||||||
v-if="!waybillVoucherImagesLoading && !waybillVoucherImages.length"
|
v-if="!waybillVoucherImagesLoading && !waybillVoucherImages.length"
|
||||||
@@ -1969,9 +2177,30 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="司机上传" name="driverUpload">
|
<el-tab-pane label="司机上传" name="driverUpload">
|
||||||
<el-empty description="暂无司机上传数据" :image-size="50" />
|
<div
|
||||||
</el-tab-pane> -->
|
v-loading="waybillPunchRecordsLoading"
|
||||||
|
class="waybill-manage-page__driver-upload-grid"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-for="(photo, index) in waybillDriverUploads"
|
||||||
|
:key="`${photo.url}-${index}`"
|
||||||
|
class="waybill-manage-page__driver-upload-item"
|
||||||
|
:title="photo.label"
|
||||||
|
@click="previewDriverUploadPhoto(waybillDriverUploads, index)"
|
||||||
|
>
|
||||||
|
<el-image :src="photo.url" fit="cover" lazy />
|
||||||
|
<div class="waybill-manage-page__driver-upload-label">
|
||||||
|
{{ photo.label || '凭证' }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-empty
|
||||||
|
v-if="!waybillPunchRecordsLoading && !waybillDriverUploads.length"
|
||||||
|
description="暂无司机上传数据"
|
||||||
|
:image-size="50"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</section-card>
|
</section-card>
|
||||||
<section-card title="物流轨迹">
|
<section-card title="物流轨迹">
|
||||||
@@ -2794,6 +3023,7 @@ import {
|
|||||||
getList as getProcessConfigList,
|
getList as getProcessConfigList,
|
||||||
getVoucherImages as getProcessConfigVoucherImages,
|
getVoucherImages as getProcessConfigVoucherImages,
|
||||||
} from '@/api/business/process-config';
|
} from '@/api/business/process-config';
|
||||||
|
import { getPunchRecords as getWaybillPunchRecords } from '@/api/business/waybill-manage';
|
||||||
import { getList as getDriverList } from '@/api/transportCapacity/driver';
|
import { getList as getDriverList } from '@/api/transportCapacity/driver';
|
||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
||||||
@@ -2805,7 +3035,7 @@ import { openImportDialog } from '@/utils/import-excel';
|
|||||||
import { applyTableMenuWidth } from '@/utils/table-menu';
|
import { applyTableMenuWidth } from '@/utils/table-menu';
|
||||||
import { downloadFileByUrl, downloadXls } from '@/utils/util';
|
import { downloadFileByUrl, downloadXls } from '@/utils/util';
|
||||||
import { isMobile } from '@/utils/validate';
|
import { isMobile } from '@/utils/validate';
|
||||||
import { InfoFilled, Location, OfficeBuilding, Rank, Search } from '@element-plus/icons-vue';
|
import { InfoFilled, Location, OfficeBuilding, Rank, Search, WarnTriangleFilled } from '@element-plus/icons-vue';
|
||||||
import { ElImageViewer } from 'element-plus';
|
import { ElImageViewer } from 'element-plus';
|
||||||
import { OpenFileViewer } from '@open-file-viewer/vue';
|
import { OpenFileViewer } from '@open-file-viewer/vue';
|
||||||
import {
|
import {
|
||||||
@@ -2980,6 +3210,7 @@ export default {
|
|||||||
PageAvueForm,
|
PageAvueForm,
|
||||||
PageDetail,
|
PageDetail,
|
||||||
InfoFilled,
|
InfoFilled,
|
||||||
|
WarnTriangleFilled,
|
||||||
Rank,
|
Rank,
|
||||||
ElImageViewer,
|
ElImageViewer,
|
||||||
OpenFileViewer,
|
OpenFileViewer,
|
||||||
@@ -3036,9 +3267,15 @@ export default {
|
|||||||
detailLoading: false,
|
detailLoading: false,
|
||||||
detailRow: {},
|
detailRow: {},
|
||||||
waybillDetailProcessNodes: [],
|
waybillDetailProcessNodes: [],
|
||||||
|
waybillPunchRecords: [],
|
||||||
|
waybillDriverUploads: [],
|
||||||
|
waybillPunchRecordsLoading: false,
|
||||||
waybillProcessDetailTab: 'punch',
|
waybillProcessDetailTab: 'punch',
|
||||||
waybillHasRelatedVoucher: false,
|
waybillHasRelatedVoucher: false,
|
||||||
waybillVoucherImages: [],
|
waybillVoucherImages: [],
|
||||||
|
waybillVoucherFolders: [],
|
||||||
|
waybillVoucherFolder: null,
|
||||||
|
waybillVoucherFolderView: false,
|
||||||
waybillVoucherImagesLoading: false,
|
waybillVoucherImagesLoading: false,
|
||||||
waybillVoucherImagesLoaded: false,
|
waybillVoucherImagesLoaded: false,
|
||||||
waybillRouteChangeBox: false,
|
waybillRouteChangeBox: false,
|
||||||
@@ -3054,6 +3291,41 @@ export default {
|
|||||||
submitting: false,
|
submitting: false,
|
||||||
row: null,
|
row: null,
|
||||||
},
|
},
|
||||||
|
reassignDrawer: {
|
||||||
|
visible: false,
|
||||||
|
submitting: false,
|
||||||
|
driverLoading: false,
|
||||||
|
row: null,
|
||||||
|
},
|
||||||
|
reassignForm: {
|
||||||
|
id: '',
|
||||||
|
driverId: '',
|
||||||
|
driverName: '',
|
||||||
|
driverPhone: '',
|
||||||
|
vehicleNo: '',
|
||||||
|
},
|
||||||
|
reassignDriverOptions: [],
|
||||||
|
reassignRules: {
|
||||||
|
driverName: [{ required: true, message: '请选择司机', trigger: 'change' }],
|
||||||
|
driverPhone: [
|
||||||
|
{ required: true, message: '请输入手机号', trigger: 'blur' },
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!isMobile(value)) {
|
||||||
|
callback(new Error('请输入正确的手机号'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
vehicleNo: [{ required: true, message: '请输入车牌号', trigger: 'blur' }],
|
||||||
|
},
|
||||||
mileageForm: {
|
mileageForm: {
|
||||||
id: '',
|
id: '',
|
||||||
mileage: '',
|
mileage: '',
|
||||||
@@ -3556,6 +3828,7 @@ export default {
|
|||||||
},
|
},
|
||||||
waybillProcessDetailTab(tab) {
|
waybillProcessDetailTab(tab) {
|
||||||
if (tab === 'batchSupplement') this.loadWaybillVoucherImages();
|
if (tab === 'batchSupplement') this.loadWaybillVoucherImages();
|
||||||
|
if (tab === 'punch' || tab === 'driverUpload') this.loadWaybillPunchRecords();
|
||||||
},
|
},
|
||||||
'form.transportType'(value, oldValue) {
|
'form.transportType'(value, oldValue) {
|
||||||
if (!this.shippingInfoFormEnabled || this.suppressTransportTypeClear) return;
|
if (!this.shippingInfoFormEnabled || this.suppressTransportTypeClear) return;
|
||||||
@@ -3838,7 +4111,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const status = this.statusValue(row);
|
const status = this.statusValue(row);
|
||||||
return ['pending', 'processing'].includes(status);
|
return ['pending', 'processing', 'running'].includes(status);
|
||||||
},
|
},
|
||||||
canComplete(row) {
|
canComplete(row) {
|
||||||
if (
|
if (
|
||||||
@@ -3850,7 +4123,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const status = this.statusValue(row);
|
const status = this.statusValue(row);
|
||||||
return status === 'processing';
|
return status === 'processing' || status === 'running';
|
||||||
},
|
},
|
||||||
canMaintainMileage(row) {
|
canMaintainMileage(row) {
|
||||||
return (
|
return (
|
||||||
@@ -4014,7 +4287,7 @@ export default {
|
|||||||
if (!row) return '-';
|
if (!row) return '-';
|
||||||
if (prop === 'businessStatus') return this.displayStatus(row, prop);
|
if (prop === 'businessStatus') return this.displayStatus(row, prop);
|
||||||
if (prop === 'feeGenerationMode') {
|
if (prop === 'feeGenerationMode') {
|
||||||
return row[prop] === 'manual' ? '手动生成' : '系统生成';
|
return row[prop] === 'manual' ? '账单导入生成' : '系统生成';
|
||||||
}
|
}
|
||||||
const column = this.findColumn(this.option.column, prop);
|
const column = this.findColumn(this.option.column, prop);
|
||||||
if (column?.formatter) return column.formatter(row, {}, row[prop]);
|
if (column?.formatter) return column.formatter(row, {}, row[prop]);
|
||||||
@@ -4105,7 +4378,9 @@ export default {
|
|||||||
waybillAmountWithCurrency(row = {}, prop) {
|
waybillAmountWithCurrency(row = {}, prop) {
|
||||||
const value = this.formatDetailValue(row, prop);
|
const value = this.formatDetailValue(row, prop);
|
||||||
if (value === '-') return { value: '-' };
|
if (value === '-') return { value: '-' };
|
||||||
return { value: `${this.waybillCurrencyRemark(row)}${value}` };
|
const number = Number(value);
|
||||||
|
const display = Number.isFinite(number) ? number.toFixed(2) : value;
|
||||||
|
return { value: `${this.waybillCurrencyRemark(row)}${display}` };
|
||||||
},
|
},
|
||||||
openDetail(row) {
|
openDetail(row) {
|
||||||
if (!this.isStandaloneWaybillDetailPage) {
|
if (!this.isStandaloneWaybillDetailPage) {
|
||||||
@@ -4117,7 +4392,13 @@ export default {
|
|||||||
this.detailRow = { ...row };
|
this.detailRow = { ...row };
|
||||||
this.waybillProcessDetailTab = 'punch';
|
this.waybillProcessDetailTab = 'punch';
|
||||||
this.waybillHasRelatedVoucher = false;
|
this.waybillHasRelatedVoucher = false;
|
||||||
|
this.waybillDetailProcessNodes = [];
|
||||||
|
this.waybillPunchRecords = [];
|
||||||
|
this.waybillDriverUploads = [];
|
||||||
this.waybillVoucherImages = [];
|
this.waybillVoucherImages = [];
|
||||||
|
this.waybillVoucherFolders = [];
|
||||||
|
this.waybillVoucherFolder = null;
|
||||||
|
this.waybillVoucherFolderView = false;
|
||||||
this.waybillVoucherImagesLoaded = false;
|
this.waybillVoucherImagesLoaded = false;
|
||||||
const request =
|
const request =
|
||||||
typeof this.api.getDetail === 'function'
|
typeof this.api.getDetail === 'function'
|
||||||
@@ -4127,6 +4408,7 @@ export default {
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
const detail = res?.data?.data || res?.data || row;
|
const detail = res?.data?.data || res?.data || row;
|
||||||
this.detailRow = detail;
|
this.detailRow = detail;
|
||||||
|
this.loadWaybillPunchRecords();
|
||||||
this.loadWaybillVoucherImages();
|
this.loadWaybillVoucherImages();
|
||||||
if (detail.contractId) {
|
if (detail.contractId) {
|
||||||
return getContractDetail(detail.contractId)
|
return getContractDetail(detail.contractId)
|
||||||
@@ -4210,6 +4492,37 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(() => []);
|
.catch(() => []);
|
||||||
},
|
},
|
||||||
|
loadWaybillPunchRecords() {
|
||||||
|
const waybillId = this.detailRow?.id;
|
||||||
|
if (!waybillId || this.waybillPunchRecordsLoading) return;
|
||||||
|
this.waybillPunchRecordsLoading = true;
|
||||||
|
const request =
|
||||||
|
typeof this.api.getPunchRecords === 'function'
|
||||||
|
? this.api.getPunchRecords(waybillId)
|
||||||
|
: getWaybillPunchRecords(waybillId);
|
||||||
|
request
|
||||||
|
.then(res => {
|
||||||
|
const data = res?.data?.data || res?.data || {};
|
||||||
|
this.waybillPunchRecords = Array.isArray(data.records) ? data.records : [];
|
||||||
|
this.waybillDriverUploads = Array.isArray(data.driverUploads)
|
||||||
|
? data.driverUploads
|
||||||
|
: [];
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.waybillPunchRecords = [];
|
||||||
|
this.waybillDriverUploads = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.waybillPunchRecordsLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
previewDriverUploadPhoto(photos, index) {
|
||||||
|
const list = (photos || []).map(item => item?.url).filter(Boolean);
|
||||||
|
if (!list.length) return;
|
||||||
|
this.attachmentImagePreviewUrls = list;
|
||||||
|
this.attachmentImagePreviewIndex = Math.min(Math.max(Number(index) || 0, 0), list.length - 1);
|
||||||
|
this.attachmentImagePreviewVisible = true;
|
||||||
|
},
|
||||||
loadWaybillVoucherImages() {
|
loadWaybillVoucherImages() {
|
||||||
if (
|
if (
|
||||||
!this.detailRow.id ||
|
!this.detailRow.id ||
|
||||||
@@ -4222,6 +4535,11 @@ export default {
|
|||||||
getProcessConfigVoucherImages(this.detailRow.id)
|
getProcessConfigVoucherImages(this.detailRow.id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.waybillVoucherImages = extractRecords(res);
|
this.waybillVoucherImages = extractRecords(res);
|
||||||
|
this.waybillVoucherFolders = this.waybillVoucherImages.filter(item =>
|
||||||
|
this.isWaybillVoucherFolder(item)
|
||||||
|
);
|
||||||
|
this.waybillVoucherFolder = null;
|
||||||
|
this.waybillVoucherFolderView = false;
|
||||||
if (this.waybillVoucherImages.length) this.waybillHasRelatedVoucher = true;
|
if (this.waybillVoucherImages.length) this.waybillHasRelatedVoucher = true;
|
||||||
this.waybillVoucherImagesLoaded = true;
|
this.waybillVoucherImagesLoaded = true;
|
||||||
})
|
})
|
||||||
@@ -4229,11 +4547,49 @@ export default {
|
|||||||
this.waybillVoucherImagesLoading = false;
|
this.waybillVoucherImagesLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
isWaybillVoucherFolder(item) {
|
||||||
|
return Boolean(item && (item.isFolder === true || item.type === 'folder'));
|
||||||
|
},
|
||||||
|
waybillVoucherFolderName(folder) {
|
||||||
|
return folder?.folderName || folder?.name || folder?.plateNo || '凭证文件夹';
|
||||||
|
},
|
||||||
|
openWaybillVoucherFolder(folder) {
|
||||||
|
if (!this.detailRow.id || !this.isWaybillVoucherFolder(folder)) return;
|
||||||
|
if (!folder.voucherId || !folder.folderName) {
|
||||||
|
this.$message.warning('凭证文件夹信息不完整');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.waybillVoucherImagesLoading = true;
|
||||||
|
getProcessConfigVoucherImages(this.detailRow.id, {
|
||||||
|
voucherId: folder.voucherId,
|
||||||
|
folderName: folder.folderName,
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.waybillVoucherFolder = folder;
|
||||||
|
this.waybillVoucherImages = extractRecords(res).filter(
|
||||||
|
item => !this.isWaybillVoucherFolder(item)
|
||||||
|
);
|
||||||
|
this.waybillVoucherFolderView = true;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.waybillVoucherImagesLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
backToWaybillVoucherFolders() {
|
||||||
|
this.waybillVoucherImages = [...this.waybillVoucherFolders];
|
||||||
|
this.waybillVoucherFolder = null;
|
||||||
|
this.waybillVoucherFolderView = false;
|
||||||
|
},
|
||||||
previewWaybillVoucherImage(index) {
|
previewWaybillVoucherImage(index) {
|
||||||
this.attachmentImagePreviewUrls = this.waybillVoucherImages
|
const imageRows = this.waybillVoucherImages.filter(
|
||||||
|
image => !this.isWaybillVoucherFolder(image)
|
||||||
|
);
|
||||||
|
const currentImage = this.waybillVoucherImages[index];
|
||||||
|
const imageIndex = imageRows.findIndex(image => image === currentImage);
|
||||||
|
this.attachmentImagePreviewUrls = imageRows
|
||||||
.map(image => image.url)
|
.map(image => image.url)
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
this.attachmentImagePreviewIndex = index;
|
this.attachmentImagePreviewIndex = imageIndex >= 0 ? imageIndex : 0;
|
||||||
this.attachmentImagePreviewVisible = this.attachmentImagePreviewUrls.length > 0;
|
this.attachmentImagePreviewVisible = this.attachmentImagePreviewUrls.length > 0;
|
||||||
},
|
},
|
||||||
buildWaybillRouteNodes(rows = []) {
|
buildWaybillRouteNodes(rows = []) {
|
||||||
@@ -4442,6 +4798,13 @@ export default {
|
|||||||
},
|
},
|
||||||
normalizeRow(row, saveAsDraft = false) {
|
normalizeRow(row, saveAsDraft = false) {
|
||||||
const submitRow = { ...row };
|
const submitRow = { ...row };
|
||||||
|
const isAddMode =
|
||||||
|
this.crudDialogType === 'add' ||
|
||||||
|
(this.isStandaloneWaybillFormPage && this.$route.query.mode === 'add');
|
||||||
|
if (isAddMode) {
|
||||||
|
delete submitRow.id;
|
||||||
|
delete submitRow.waybillNo;
|
||||||
|
}
|
||||||
const skipValidation = saveAsDraft && this.config.skipDraftValidation === true;
|
const skipValidation = saveAsDraft && this.config.skipDraftValidation === true;
|
||||||
if (
|
if (
|
||||||
!skipValidation &&
|
!skipValidation &&
|
||||||
@@ -4812,6 +5175,7 @@ export default {
|
|||||||
// 清除不应该复制的字段
|
// 清除不应该复制的字段
|
||||||
delete sourceData.id;
|
delete sourceData.id;
|
||||||
delete sourceData.code;
|
delete sourceData.code;
|
||||||
|
delete sourceData.waybillNo;
|
||||||
delete sourceData.waybillStatus;
|
delete sourceData.waybillStatus;
|
||||||
delete sourceData.createTime;
|
delete sourceData.createTime;
|
||||||
delete sourceData.updateTime;
|
delete sourceData.updateTime;
|
||||||
@@ -4882,6 +5246,10 @@ export default {
|
|||||||
['quantity', 'mileage', 'unitPrice'].forEach(prop => {
|
['quantity', 'mileage', 'unitPrice'].forEach(prop => {
|
||||||
if (Number(this.form[prop]) === -1) this.form[prop] = '';
|
if (Number(this.form[prop]) === -1) this.form[prop] = '';
|
||||||
});
|
});
|
||||||
|
if ([this.form.planId, this.form.planName].some(value => Number(value) === -1)) {
|
||||||
|
this.form.planId = '';
|
||||||
|
this.form.planName = '';
|
||||||
|
}
|
||||||
this.form.mileage = this.normalizeMileageValue(this.form.mileage);
|
this.form.mileage = this.normalizeMileageValue(this.form.mileage);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.suppressTransportTypeClear = false;
|
this.suppressTransportTypeClear = false;
|
||||||
@@ -7721,6 +8089,10 @@ export default {
|
|||||||
this.$refs.mileageFormRef?.clearValidate();
|
this.$refs.mileageFormRef?.clearValidate();
|
||||||
},
|
},
|
||||||
handleAction(action, row) {
|
handleAction(action, row) {
|
||||||
|
if (action === 'reassign') {
|
||||||
|
this.openReassignDrawer(row);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const actionName = {
|
const actionName = {
|
||||||
enable: '启用',
|
enable: '启用',
|
||||||
disable: '停用',
|
disable: '停用',
|
||||||
@@ -7739,6 +8111,113 @@ export default {
|
|||||||
this.onLoad(this.page, this.query);
|
this.onLoad(this.page, this.query);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
driverRejectReasonText(row) {
|
||||||
|
if (!row) return '';
|
||||||
|
if (typeof this.config.getDriverRejectReason === 'function') {
|
||||||
|
return this.config.getDriverRejectReason(row) || '';
|
||||||
|
}
|
||||||
|
return String(
|
||||||
|
row.driverRejectReason ||
|
||||||
|
row.driverRefuseReason ||
|
||||||
|
row.acceptRejectReason ||
|
||||||
|
row.rejectReason ||
|
||||||
|
''
|
||||||
|
).trim();
|
||||||
|
},
|
||||||
|
openReassignDrawer(row) {
|
||||||
|
if (!row?.id) return;
|
||||||
|
this.reassignDrawer.row = row;
|
||||||
|
this.reassignForm = {
|
||||||
|
id: row.id,
|
||||||
|
driverId: '',
|
||||||
|
driverName: '',
|
||||||
|
driverPhone: '',
|
||||||
|
vehicleNo: '',
|
||||||
|
};
|
||||||
|
this.reassignDrawer.visible = true;
|
||||||
|
this.$nextTick(() => this.$refs.reassignFormRef?.clearValidate());
|
||||||
|
},
|
||||||
|
resetReassignDrawer() {
|
||||||
|
this.reassignDrawer.row = null;
|
||||||
|
this.reassignDrawer.submitting = false;
|
||||||
|
this.reassignDrawer.driverLoading = false;
|
||||||
|
this.reassignForm = {
|
||||||
|
id: '',
|
||||||
|
driverId: '',
|
||||||
|
driverName: '',
|
||||||
|
driverPhone: '',
|
||||||
|
vehicleNo: '',
|
||||||
|
};
|
||||||
|
this.reassignDriverOptions = [];
|
||||||
|
this.$refs.reassignFormRef?.clearValidate();
|
||||||
|
},
|
||||||
|
fetchReassignDriverSuggestions(queryString, callback) {
|
||||||
|
const keyword = String(queryString || '').trim();
|
||||||
|
this.reassignDrawer.driverLoading = true;
|
||||||
|
getDriverList(1, 20, { ...(keyword ? { driverName: keyword } : {}), posts: '司机' })
|
||||||
|
.then(res => {
|
||||||
|
const records = extractRecords(res);
|
||||||
|
this.reassignDriverOptions = records;
|
||||||
|
callback(
|
||||||
|
records.map(item => ({
|
||||||
|
...item,
|
||||||
|
value: item.driverName || item.name || '',
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
window.console.log(error);
|
||||||
|
callback([]);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.reassignDrawer.driverLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleReassignDriverSelect(item = {}) {
|
||||||
|
const value = item.driverName || item.name || '';
|
||||||
|
const driverPhone = item.mobile || item.phone || item.driverPhone || '';
|
||||||
|
const drivingVehicle = String(item.drivingVehicle || '').trim();
|
||||||
|
this.reassignForm.driverId = item.id || '';
|
||||||
|
this.reassignForm.driverName = value;
|
||||||
|
if (driverPhone) this.reassignForm.driverPhone = driverPhone;
|
||||||
|
if (drivingVehicle) this.reassignForm.vehicleNo = drivingVehicle;
|
||||||
|
},
|
||||||
|
handleReassignDriverChange(value) {
|
||||||
|
const driver = this.reassignDriverOptions.find(item =>
|
||||||
|
[item.driverName, item.name].some(name => String(name || '') === String(value || ''))
|
||||||
|
);
|
||||||
|
this.reassignForm.driverId = driver?.id || '';
|
||||||
|
this.reassignForm.driverName = value || '';
|
||||||
|
if (driver) {
|
||||||
|
this.reassignForm.driverPhone =
|
||||||
|
driver.mobile || driver.phone || driver.driverPhone || this.reassignForm.driverPhone || '';
|
||||||
|
if (String(driver.drivingVehicle || '').trim()) {
|
||||||
|
this.reassignForm.vehicleNo = String(driver.drivingVehicle).trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitReassign() {
|
||||||
|
this.$refs.reassignFormRef?.validate(valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
this.reassignDrawer.submitting = true;
|
||||||
|
this.api
|
||||||
|
.reassign({
|
||||||
|
id: this.reassignForm.id,
|
||||||
|
driverId: this.reassignForm.driverId || null,
|
||||||
|
driverName: String(this.reassignForm.driverName || '').trim(),
|
||||||
|
driverPhone: String(this.reassignForm.driverPhone || '').trim(),
|
||||||
|
vehicleNo: String(this.reassignForm.vehicleNo || '').trim(),
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.$message.success('重新派单成功');
|
||||||
|
this.reassignDrawer.visible = false;
|
||||||
|
this.onLoad(this.page, this.query);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.reassignDrawer.submitting = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
handleCustomOperation(operation, row) {
|
handleCustomOperation(operation, row) {
|
||||||
if (operation.action === 'createFromTemplate') {
|
if (operation.action === 'createFromTemplate') {
|
||||||
this.api.getDetail(row.id).then(res => {
|
this.api.getDetail(row.id).then(res => {
|
||||||
@@ -7841,7 +8320,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const unavailableWaybills = this.selectionList.filter(
|
const unavailableWaybills = this.selectionList.filter(
|
||||||
row =>
|
row =>
|
||||||
this.statusValue(row) !== 'pending' ||
|
!['processing', 'running'].includes(this.statusValue(row)) ||
|
||||||
row.loadingId ||
|
row.loadingId ||
|
||||||
row.loadingManageId ||
|
row.loadingManageId ||
|
||||||
row.loadingNo
|
row.loadingNo
|
||||||
@@ -8983,7 +9462,65 @@ export default {
|
|||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__punch-record {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__punch-record-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__punch-record-line {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #606266;
|
||||||
|
|
||||||
|
span + span {
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__punch-record-photos,
|
||||||
|
&__driver-upload-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 4px;
|
||||||
|
min-height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__driver-upload-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.el-image {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
border: 1px solid #eff1f7;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__driver-upload-label {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.4;
|
||||||
|
color: #606266;
|
||||||
|
text-align: center;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
&__voucher-image-item {
|
&__voucher-image-item {
|
||||||
|
position: relative;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -8995,6 +9532,42 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--folder {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 12px;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.el-image {
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__voucher-folder-toolbar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
min-height: 32px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
color: #606266;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__voucher-folder-name {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
color: #606266;
|
||||||
|
font-size: 13px;
|
||||||
|
text-align: center;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__route-change-dialog {
|
&__route-change-dialog {
|
||||||
@@ -9327,6 +9900,78 @@ export default {
|
|||||||
:global(.waybill-manage-page__mileage-dialog .waybill-manage-page__mileage-form .el-textarea) {
|
:global(.waybill-manage-page__mileage-dialog .waybill-manage-page__mileage-form .el-textarea) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__status-cell {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__reject-tip-icon {
|
||||||
|
color: #e6a23c;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.waybill-manage-page__reassign-drawer .el-drawer__body) {
|
||||||
|
padding: 12px 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.waybill-manage-page__reassign-drawer .waybill-manage-page__reassign-form) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__reassign-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
|
column-gap: 16px;
|
||||||
|
row-gap: 8px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__reassign-span-1 {
|
||||||
|
grid-column: span 1;
|
||||||
|
margin-bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__reassign-meta {
|
||||||
|
grid-column: span 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
min-width: 0;
|
||||||
|
line-height: 32px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__reassign-meta--wide {
|
||||||
|
grid-column: span 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__reassign-meta-label {
|
||||||
|
flex: none;
|
||||||
|
width: 72px;
|
||||||
|
color: #606266;
|
||||||
|
text-align: right;
|
||||||
|
padding-right: 12px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__reassign-meta-value {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
color: #303133;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.waybill-manage-page__reassign-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.el-input__icon {
|
.el-input__icon {
|
||||||
color: #1e90ff !important;
|
color: #1e90ff !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,203 @@
|
|||||||
<template>
|
<template>
|
||||||
<basic-container class="contract-change-page">
|
<basic-container class="contract-change-page">
|
||||||
|
<div class="archive-page-form__title">{{ pageTitle }}</div>
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-position="right" label-width="auto" class="contract-change-form">
|
<el-form ref="formRef" :model="form" :rules="rules" label-position="right" label-width="auto" class="contract-change-form">
|
||||||
<section class="change-section contract-basic-section">
|
<section class="change-section contract-basic-section">
|
||||||
<div class="dialog-section-title">基本信息</div>
|
<div class="dialog-section-title">基本信息</div>
|
||||||
<div class="contract-basic-section__grid">
|
<div class="contract-basic-section__grid">
|
||||||
<el-form-item label="变更类型" class="contract-basic-section__change-type"><el-radio-group v-model="form.changeType"><el-radio label="合同信息变更" /><el-radio label="终止合同" /></el-radio-group></el-form-item>
|
<el-form-item label="变更类型" class="contract-basic-section__change-type">
|
||||||
<el-form-item label="合同编号"><el-input v-model="form.contractNo" disabled /></el-form-item>
|
<el-radio-group v-model="form.changeType">
|
||||||
<el-form-item label="合同名称" prop="contractName"><el-input v-model="form.contractName" /></el-form-item>
|
<el-radio label="合同信息变更" />
|
||||||
<el-form-item label="合同类型"><el-select v-model="form.contractCategory" disabled><el-option label="客户合同" value="客户合同" /><el-option label="承运商合同" value="承运商合同" /></el-select></el-form-item>
|
<el-radio label="终止合同" />
|
||||||
<el-form-item label="甲方"><el-input v-model="form.partyA" disabled /></el-form-item>
|
</el-radio-group>
|
||||||
<el-form-item label="乙方"><el-input v-model="form.partyB" disabled /></el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属项目"><el-input v-model="form.projectName" disabled /></el-form-item>
|
<el-form-item label="签约类型" prop="signType">
|
||||||
|
<el-select v-model="form.signType" placeholder="请选择签约类型" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in signTypeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同编号">
|
||||||
|
<el-input v-model="form.contractNo" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同名称" prop="contractName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.contractName"
|
||||||
|
maxlength="100"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入合同名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同类型">
|
||||||
|
<el-select v-model="form.contractCategory" disabled>
|
||||||
|
<el-option
|
||||||
|
v-for="item in contractCategoryOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目">
|
||||||
|
<el-input v-model="form.projectName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属组织">
|
||||||
|
<el-input v-model="form.organizationName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="甲方">
|
||||||
|
<el-input v-model="form.partyA" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="乙方">
|
||||||
|
<el-input v-model="form.partyB" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="签订日期">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.signDate"
|
||||||
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="合同期限">
|
<el-form-item label="合同期限">
|
||||||
<div class="contract-basic-section__date-range">
|
<div class="contract-basic-section__date-range">
|
||||||
<el-date-picker v-model="period[0]" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="YYYY-MM-DD" />
|
<el-date-picker
|
||||||
|
v-model="period[0]"
|
||||||
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
<span>至</span>
|
<span>至</span>
|
||||||
<el-date-picker v-model="period[1]" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" placeholder="YYYY-MM-DD" />
|
<el-date-picker
|
||||||
|
v-model="period[1]"
|
||||||
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属组织"><el-input v-model="form.organizationName" disabled /></el-form-item>
|
<el-form-item label="回款账期">
|
||||||
<el-form-item label="签订日期"><el-date-picker v-model="form.signDate" type="date" value-format="YYYY-MM-DD" disabled /></el-form-item>
|
<el-input
|
||||||
<el-form-item label="合同格式"><el-select v-model="form.contractFormat"><el-option label="电子合同" value="电子合同" /><el-option label="纸质合同" value="纸质合同" /></el-select></el-form-item>
|
v-model="form.paymentDays"
|
||||||
<el-form-item label="结算方式"><el-input v-model="form.settlementMode" /></el-form-item>
|
placeholder="请输入"
|
||||||
<el-form-item label="是否需要加盖法人章"><el-select v-model="form.legalSealFlag"><el-option label="是" :value="1" /><el-option label="否" :value="0" /></el-select></el-form-item>
|
@input="value => positiveIntegerInput('paymentDays', value)"
|
||||||
<el-form-item label="一式(份)"><el-input v-model="form.copyCount" inputmode="numeric" maxlength="9" placeholder="请输入" @input="value => positiveIntegerInput('copyCount', value)" /></el-form-item>
|
>
|
||||||
<el-form-item label="回款账期"><el-input v-model="form.paymentDays" inputmode="numeric" maxlength="9" placeholder="请输入" @input="value => positiveIntegerInput('paymentDays', value)" /></el-form-item>
|
<template #suffix>天</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同金额">
|
||||||
|
<el-input-number
|
||||||
|
v-model="form.contractAmount"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"
|
||||||
|
:controls="false"
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否范本">
|
||||||
|
<el-select v-model="form.templateFlag" placeholder="请选择">
|
||||||
|
<el-option label="否" :value="0" />
|
||||||
|
<el-option label="是" :value="1" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原件合同编号">
|
||||||
|
<el-input v-model="form.originalContractNo" maxlength="100" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否电子章">
|
||||||
|
<el-select v-model="form.electronicSealFlag" placeholder="请选择">
|
||||||
|
<el-option label="否" :value="0" />
|
||||||
|
<el-option label="是" :value="1" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开票周期">
|
||||||
|
<el-input
|
||||||
|
v-model="form.invoiceCycle"
|
||||||
|
placeholder="请输入"
|
||||||
|
@input="value => positiveIntegerInput('invoiceCycle', value)"
|
||||||
|
>
|
||||||
|
<template #suffix>天</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结算币种" prop="settlementCurrency">
|
||||||
|
<el-select v-model="form.settlementCurrency" placeholder="请选择结算币种" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in settlementCurrencyOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同格式">
|
||||||
|
<el-select v-model="form.contractFormat" placeholder="请选择合同格式" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in contractFormatOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="一式">
|
||||||
|
<el-input
|
||||||
|
v-model="form.copyCount"
|
||||||
|
placeholder="请输入"
|
||||||
|
@input="value => positiveIntegerInput('copyCount', value)"
|
||||||
|
>
|
||||||
|
<template #suffix>份</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否需要加盖法人章">
|
||||||
|
<el-select v-model="form.legalSealFlag" placeholder="请选择">
|
||||||
|
<el-option label="否" :value="0" />
|
||||||
|
<el-option label="是" :value="1" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结算方式">
|
||||||
|
<el-select v-model="form.settlementMode" placeholder="请选择结算方式" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in settlementModeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="经办人">
|
||||||
|
<el-input v-model="form.handlerUserName" disabled />
|
||||||
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<el-form-item label="备注" class="contract-basic-section__remark"><el-input v-model="form.remark" type="textarea" :rows="2" maxlength="2000" show-word-limit placeholder="请输入备注" /></el-form-item>
|
<el-form-item label="备注" class="contract-basic-section__remark">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
maxlength="200"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入备注"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="change-section">
|
<contract-attachment-section
|
||||||
<div class="dialog-section-title">合同文件</div>
|
title="合同文件"
|
||||||
<div class="attachment-head">
|
description
|
||||||
<el-button type="primary" :disabled="!contractFileRows.length" @click="handleContractFileBatchDownload">批量下载</el-button>
|
attachment-type
|
||||||
</div>
|
use-upload-dialog
|
||||||
<el-table :data="contractFileRows" border class="change-table" @selection-change="selectedContractFiles = $event"><el-table-column type="selection" width="55" /><el-table-column type="index" label="序号" width="70" /><el-table-column label="文件名" min-width="240"><template #default="{ row }"><el-link type="primary" @click="previewAttachment(row, contractFileRows)">{{ row.originalName || row.name }}</el-link></template></el-table-column><el-table-column label="文件大小" width="120"><template #default="{ row }">{{ formatFileSize(row.size) }}</template></el-table-column><el-table-column prop="uploadUserName" label="上传人" width="140" /><el-table-column prop="uploadTime" label="上传时间" width="170" /><el-table-column label="操作" width="100"><template #default="{ $index }"><el-link type="danger" @click="removeContractFile($index)">删除</el-link></template></el-table-column></el-table>
|
:rows="contractFileRows"
|
||||||
<div class="attachment-upload">
|
:preview="previewAttachment"
|
||||||
<vehicle-attachment-upload v-model="contractFileRows" :readonly="false" :file-types="attachmentFileTypes" :max-size="50" :show-file-list="false" button-text="上传附件" @change="handleContractFileChange" />
|
@update:rows="contractFileRows = $event"
|
||||||
</div>
|
/>
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="change-section">
|
<section class="change-section">
|
||||||
<div class="section-head"><div class="dialog-section-title">计费信息</div><el-button type="primary" plain @click="addPlan">添加</el-button></div>
|
<div class="section-head"><div class="dialog-section-title">计费信息</div><el-button type="primary" plain @click="addPlan">添加</el-button></div>
|
||||||
<el-radio-group v-model="feeGenerationMode"><el-radio label="system">系统生成</el-radio><el-radio label="manual">手动生成</el-radio></el-radio-group>
|
<el-radio-group v-model="feeGenerationMode"><el-radio label="system">系统生成</el-radio><el-radio label="manual">账单导入生成</el-radio></el-radio-group>
|
||||||
<el-table :data="plans" border class="change-table"><el-table-column type="index" label="序号" width="70" /><el-table-column prop="planName" label="方案名称" min-width="220" /><el-table-column label="默认方案" min-width="120"><template #default="{ row }">{{ row.defaultPlan ? '是' : '否' }}</template></el-table-column><el-table-column prop="remark" label="备注" min-width="260" /><el-table-column label="操作" width="180"><template #default="{ row, $index }"><el-link type="primary" @click="editPlan(row, $index)">编辑</el-link><el-link type="danger" @click="plans.splice($index, 1)">删除</el-link></template></el-table-column></el-table>
|
<el-table :data="plans" border class="change-table"><el-table-column type="index" label="序号" width="70" /><el-table-column prop="planName" label="方案名称" min-width="220" /><el-table-column label="默认方案" min-width="120"><template #default="{ row }">{{ row.defaultPlan ? '是' : '否' }}</template></el-table-column><el-table-column prop="remark" label="备注" min-width="260" /><el-table-column label="操作" width="180"><template #default="{ row, $index }"><el-link type="primary" @click="editPlan(row, $index)">编辑</el-link><el-link type="danger" @click="plans.splice($index, 1)">删除</el-link></template></el-table-column></el-table>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -52,14 +207,30 @@
|
|||||||
<el-tab-pane label="预结算配置" name="pre" />
|
<el-tab-pane label="预结算配置" name="pre" />
|
||||||
<el-tab-pane label="正式结算配置" name="formal" />
|
<el-tab-pane label="正式结算配置" name="formal" />
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div class="settlement-switch"><span>自动生成结算单</span><el-radio-group v-model="settlementRule.autoGenerate"><el-radio :label="1">开启</el-radio><el-radio :label="0">关闭</el-radio></el-radio-group></div>
|
<div class="settlement-switch">
|
||||||
|
<span>自动生成结算单</span>
|
||||||
|
<el-radio-group v-model="settlementRule.autoGenerate">
|
||||||
|
<el-radio :label="1">开启</el-radio>
|
||||||
|
<el-tooltip content="开启时,系统根据配置规则归集运单,定时生成结算单" placement="top">
|
||||||
|
<el-icon class="settlement-switch-tip"><QuestionFilled /></el-icon>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-radio :label="0">关闭</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
<el-form v-if="settlementRule.autoGenerate === 1" :model="settlementRule" label-position="right" label-width="auto" class="settlement-form">
|
<el-form v-if="settlementRule.autoGenerate === 1" :model="settlementRule" label-position="right" label-width="auto" class="settlement-form">
|
||||||
<el-form-item label="账单起始日期" required><el-date-picker v-model="settlementRule.billStartDate" type="date" placeholder="请选择账单起始日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /></el-form-item>
|
<el-form-item label="账单起始日期" required><el-date-picker v-model="settlementRule.billStartDate" type="date" placeholder="请选择账单起始日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /></el-form-item>
|
||||||
<el-form-item label="结算类型" required><el-select v-model="settlementRule.settlementType" placeholder="请选择结算类型" @change="handleSettlementTypeChange"><el-option v-for="item in settlementTypeOptions" :key="item" :label="item" :value="item" /></el-select></el-form-item>
|
<el-form-item label="结算类型" required><el-select v-model="settlementRule.settlementType" placeholder="请选择结算类型" @change="handleSettlementTypeChange"><el-option v-for="item in settlementTypeOptions" :key="item" :label="item" :value="item" /></el-select></el-form-item>
|
||||||
<el-form-item v-if="showSettlementBillCycleType" label="账单周期类型" required><el-select v-model="settlementRule.billCycleType" placeholder="请选择账单周期类型" @change="handleCycleTypeChange"><el-option v-for="item in billCycleTypeOptions" :key="item" :label="item" :value="item" /></el-select></el-form-item>
|
<el-form-item v-if="showSettlementBillCycleType" label="结算周期" required><el-select v-model="settlementRule.billCycleType" placeholder="请选择结算周期" @change="handleCycleTypeChange"><el-option v-for="item in billCycleTypeOptions" :key="item" :label="item" :value="item" /></el-select></el-form-item>
|
||||||
<el-form-item v-if="showSettlementBillCutoffDay" label="账单截单日" required><el-select v-model="settlementRule.billCutoffDay" placeholder="请选择账单截单日"><el-option v-for="item in billCutoffDayOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
<el-form-item v-if="showSettlementBillCutoffDay" label="账单截单日" required><el-select v-model="settlementRule.billCutoffDay" placeholder="请选择账单截单日"><el-option v-for="item in billCutoffDayOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||||
<el-form-item v-if="showSettlementCycleDays" label="周期天数" required><el-select v-model="settlementRule.cycleDays" placeholder="请选择周期天数"><el-option v-for="item in cycleDayOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
<el-form-item v-if="showSettlementCycleDays" label="周期天数" required><el-select v-model="settlementRule.cycleDays" placeholder="请选择周期天数"><el-option v-for="item in cycleDayOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-table v-if="settlementRule.autoGenerate === 1 && showSettlementCustomPeriods" :data="settlementRule.customPeriods || []" border class="change-table custom-periods-table">
|
||||||
|
<el-table-column type="index" label="序号" width="70" />
|
||||||
|
<el-table-column label="运单区间-开始日" min-width="180"><template #default="{ row, $index }"><el-select :model-value="row.startDay" placeholder="请选择" clearable @update:model-value="value => handleCustomPeriodStartDayChange($index, value)"><el-option v-for="item in billCutoffDayOptions" :key="`start-${item.value}`" :label="item.label" :value="item.value" /></el-select></template></el-table-column>
|
||||||
|
<el-table-column label="运单区间-结束日" min-width="200"><template #default="{ row, $index }"><el-select :model-value="row.endDay" placeholder="请选择" clearable @update:model-value="value => handleCustomPeriodEndDayChange($index, value)"><el-option v-for="item in customPeriodEndDayOptions(row)" :key="item.value" :label="item.label" :value="item.value" /></el-select></template></el-table-column>
|
||||||
|
<el-table-column label="操作" width="100"><template #default="{ $index }"><el-link v-if="$index === 0" type="primary" @click="addCustomPeriodRow">添加</el-link><el-link v-else type="danger" @click="removeCustomPeriodRow($index)">删除</el-link></template></el-table-column>
|
||||||
|
<template #empty><el-link type="primary" @click="addCustomPeriodRow">添加</el-link></template>
|
||||||
|
</el-table>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="change-section">
|
<section class="change-section">
|
||||||
@@ -81,26 +252,41 @@
|
|||||||
|
|
||||||
<billing-plan-editor v-model="planDialogVisible" :value="planEditor" :index="planEditorIndex" @save="savePlan" />
|
<billing-plan-editor v-model="planDialogVisible" :value="planEditor" :index="planEditorIndex" @save="savePlan" />
|
||||||
|
|
||||||
<section class="change-section attachment-section">
|
<contract-attachment-section
|
||||||
<div class="section-head"><div class="dialog-section-title">其它附件</div><el-button type="primary" plain>批量下载</el-button></div>
|
title="其它附件"
|
||||||
<el-table :data="attachments" border class="change-table"><el-table-column type="index" label="序号" width="70" /><el-table-column label="文件名" min-width="240"><template #default="{ row }"><el-link type="primary" @click="previewAttachment(row, attachments)">{{ row.originalName || row.name }}</el-link></template></el-table-column><el-table-column prop="description" label="附件描述" min-width="240" /><el-table-column prop="size" label="文件大小" width="120" /><el-table-column prop="userName" label="上传人" width="140" /><el-table-column prop="uploadTime" label="上传时间" width="180" /><el-table-column label="操作" width="100"><template #default="{ $index }"><el-link type="danger" @click="attachments.splice($index, 1)">删除</el-link></template></el-table-column></el-table>
|
description
|
||||||
<el-upload action="#" :auto-upload="false" multiple :show-file-list="false" @change="handleAttachment"><el-button type="primary" plain icon="el-icon-upload">上传附件</el-button></el-upload>
|
attachment-type
|
||||||
</section>
|
use-upload-dialog
|
||||||
|
attachment-location="其它附件"
|
||||||
|
:rows="attachments"
|
||||||
|
:preview="previewAttachment"
|
||||||
|
@update:rows="attachments = $event"
|
||||||
|
/>
|
||||||
|
|
||||||
<section class="change-section change-reason-section">
|
<section class="change-section change-reason-section">
|
||||||
<div class="dialog-section-title">变更内容</div>
|
<div class="dialog-section-title">变更原因</div>
|
||||||
<el-form-item prop="changeContent"><el-input v-model="form.changeContent" type="textarea" :rows="3" maxlength="2000" show-word-limit placeholder="请输入变更内容" /></el-form-item>
|
<el-form-item prop="changeReason" class="change-reason-section__input">
|
||||||
<div class="dialog-section-title is-required">变更原因</div>
|
<el-input
|
||||||
<el-form-item prop="changeReason"><el-input v-model="form.changeReason" type="textarea" :rows="3" maxlength="500" show-word-limit placeholder="请输入变更原因" /></el-form-item>
|
v-model="form.changeReason"
|
||||||
<div class="dialog-section-title">变更材料</div>
|
type="textarea"
|
||||||
<el-table :data="changeMaterials" border class="change-table">
|
:rows="3"
|
||||||
<el-table-column type="index" label="序号" width="70" />
|
maxlength="500"
|
||||||
<el-table-column label="文件名" min-width="240"><template #default="{ row }">{{ row.originalName || row.name }}</template></el-table-column>
|
show-word-limit
|
||||||
<el-table-column label="文件大小" width="120"><template #default="{ row }">{{ formatFileSize(row.size) }}</template></el-table-column>
|
placeholder="请输入变更原因"
|
||||||
<el-table-column label="操作" width="100"><template #default="{ $index }"><el-link type="danger" @click="changeMaterials.splice($index, 1)">删除</el-link></template></el-table-column>
|
/>
|
||||||
</el-table>
|
</el-form-item>
|
||||||
<div class="attachment-upload"><vehicle-attachment-upload v-model="changeMaterials" :readonly="false" :file-types="attachmentFileTypes" :max-size="50" :show-file-list="false" button-text="上传变更材料" /></div>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<contract-attachment-section
|
||||||
|
title="变更材料"
|
||||||
|
description
|
||||||
|
attachment-type
|
||||||
|
use-upload-dialog
|
||||||
|
attachment-location="变更材料"
|
||||||
|
:rows="changeMaterials"
|
||||||
|
:preview="previewAttachment"
|
||||||
|
@update:rows="changeMaterials = $event"
|
||||||
|
/>
|
||||||
<div class="page-footer">
|
<div class="page-footer">
|
||||||
<el-button @click="$router.back()">取消</el-button>
|
<el-button @click="$router.back()">取消</el-button>
|
||||||
<el-button type="primary" @click="submit">提交</el-button>
|
<el-button type="primary" @click="submit">提交</el-button>
|
||||||
@@ -117,6 +303,15 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as api from '@/api/business/contract-manage';
|
import * as api from '@/api/business/contract-manage';
|
||||||
import BillingPlanEditor from './components/billing-plan-editor.vue';
|
import BillingPlanEditor from './components/billing-plan-editor.vue';
|
||||||
|
import ContractAttachmentSection, {
|
||||||
|
normalizeContractFileRows,
|
||||||
|
} from './components/contract-attachment-section.vue';
|
||||||
|
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
||||||
|
import { getDictionary as getBizDictionary } from '@/api/system/dictbiz';
|
||||||
|
import {
|
||||||
|
contractCategoryOptions as defaultContractCategoryOptions,
|
||||||
|
signTypeOptions as defaultSignTypeOptions,
|
||||||
|
} from '@/option/business/common';
|
||||||
import { ElImageViewer } from 'element-plus';
|
import { ElImageViewer } from 'element-plus';
|
||||||
import { OpenFileViewer } from '@open-file-viewer/vue';
|
import { OpenFileViewer } from '@open-file-viewer/vue';
|
||||||
import { fallbackPlugin, imagePlugin, officePlugin, pdfPlugin, textPlugin } from '@open-file-viewer/core';
|
import { fallbackPlugin, imagePlugin, officePlugin, pdfPlugin, textPlugin } from '@open-file-viewer/core';
|
||||||
@@ -130,40 +325,294 @@ const viewerPlugins = [
|
|||||||
textPlugin(),
|
textPlugin(),
|
||||||
fallbackPlugin(),
|
fallbackPlugin(),
|
||||||
];
|
];
|
||||||
|
const defaultSettlementModeOptions = [
|
||||||
|
{ label: '现结', value: '现结' },
|
||||||
|
{ label: '日结', value: '日结' },
|
||||||
|
{ label: '周结', value: '周结' },
|
||||||
|
{ label: '月结', value: '月结' },
|
||||||
|
{ label: '按固定天数周期', value: '按固定天数周期' },
|
||||||
|
];
|
||||||
|
const defaultContractFormatOptions = [
|
||||||
|
{ label: '电子合同', value: '电子合同' },
|
||||||
|
{ label: '纸质合同', value: '纸质合同' },
|
||||||
|
];
|
||||||
const normalizeOptionalPositiveInteger = value => {
|
const normalizeOptionalPositiveInteger = value => {
|
||||||
if (value === undefined || value === null || value === '') return null;
|
if (value === undefined || value === null || value === '') return null;
|
||||||
const number = Number(value);
|
const number = Number(value);
|
||||||
return Number.isInteger(number) && number > 0 ? number : null;
|
return Number.isInteger(number) && number > 0 ? number : null;
|
||||||
};
|
};
|
||||||
|
const normalizeOptionalAmount = value => {
|
||||||
|
if (value === undefined || value === null || value === '') return null;
|
||||||
|
const number = Number(value);
|
||||||
|
return Number.isFinite(number) && number >= 0 ? Number(number.toFixed(2)) : null;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const normalizeCustomPeriods = (periods = []) =>
|
||||||
|
(periods || []).map(item => ({
|
||||||
|
startDay: Number(item?.startDay) > 0 ? Number(item.startDay) : '',
|
||||||
|
endDay: Number(item?.endDay) > 0 ? Number(item.endDay) : '',
|
||||||
|
}));
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { BillingPlanEditor, ElImageViewer, OpenFileViewer },
|
components: { BillingPlanEditor, ContractAttachmentSection, ElImageViewer, OpenFileViewer },
|
||||||
data() { return { form: {}, period: [], plans: [], attachments: [], contractFiles: [], contractFileRows: [], selectedContractFiles: [], paymentRatioRows: [], settlementConfigTab: 'pre', changeMaterials: [], imagePreviewVisible: false, imagePreviewUrls: [], imagePreviewIndex: 0, documentPreviewVisible: false, previewFile: {}, viewerPlugins, viewerToolbar: { zoom: true, rotate: true, download: true, fullscreen: true }, feeGenerationMode: 'system', settlementRule: { autoGenerate: 1, settlementType: '月结', billCycleType: '固定截单日', billCutoffDay: 25, cycleDays: '' }, preSettlementConfig: {}, formalSettlementConfig: {}, settlementTypeOptions: ['月结','日结','周结','半月结','固定天数周期结算'], billCycleTypeOptions: ['固定截单日','自然月'], billCutoffDayOptions: Array.from({ length: 31 }, (_, index) => ({ label: `${index + 1}日`, value: index + 1 })), cycleDayOptions: [7,15,30,60].map(value => ({ label: `${value}天`, value })), planDialogVisible: false, planEditor: { planName: '', defaultPlan: false, remark: '', rules: [] }, planEditorIndex: -1, billingElements: ['按重量','按体积','按车辆','按里程','按吨·公里','固定金额(整单一口价)','按数量'], attachmentFileTypes: ['pdf','bmp','jpeg','png','jpg','doc','docx','ppt','pptx','xlsx','xls','eml','msg','zip'], rules: { contractName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }], changeReason: [{ required: true, message: '请输入变更原因', trigger: 'blur' }] } }; },
|
data() {
|
||||||
computed: { showSettlementBillCycleType() { return this.settlementRule.settlementType === '月结'; }, showSettlementBillCutoffDay() { return this.showSettlementBillCycleType && this.settlementRule.billCycleType === '固定截单日'; }, showSettlementCycleDays() { return this.settlementRule.settlementType === '固定天数周期结算'; } },
|
return {
|
||||||
mounted() { this.load(); },
|
form: {},
|
||||||
watch: { settlementConfigTab(tab, oldTab) { if (tab === oldTab) return; if (oldTab === 'pre') this.preSettlementConfig = { ...this.settlementRule }; else this.formalSettlementConfig = { ...this.settlementRule }; this.settlementRule = { ...(tab === 'pre' ? this.preSettlementConfig : this.formalSettlementConfig) }; } },
|
period: [],
|
||||||
|
plans: [],
|
||||||
|
attachments: [],
|
||||||
|
contractFiles: [],
|
||||||
|
contractFileRows: [],
|
||||||
|
paymentRatioRows: [],
|
||||||
|
settlementConfigTab: 'pre',
|
||||||
|
changeMaterials: [],
|
||||||
|
imagePreviewVisible: false,
|
||||||
|
imagePreviewUrls: [],
|
||||||
|
imagePreviewIndex: 0,
|
||||||
|
documentPreviewVisible: false,
|
||||||
|
previewFile: {},
|
||||||
|
viewerPlugins,
|
||||||
|
viewerToolbar: { zoom: true, rotate: true, download: true, fullscreen: true },
|
||||||
|
feeGenerationMode: 'system',
|
||||||
|
settlementRule: {
|
||||||
|
autoGenerate: '',
|
||||||
|
billStartDate: '',
|
||||||
|
settlementType: '',
|
||||||
|
billCycleType: '',
|
||||||
|
billCutoffDay: '',
|
||||||
|
cycleDays: '',
|
||||||
|
customPeriods: [],
|
||||||
|
},
|
||||||
|
preSettlementConfig: {},
|
||||||
|
formalSettlementConfig: {},
|
||||||
|
settlementTypeOptions: ['月结', '日结', '周结', '半月结', '固定天数周期结算'],
|
||||||
|
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
||||||
|
billCutoffDayOptions: Array.from({ length: 31 }, (_, index) => ({
|
||||||
|
label: `${index + 1}日`,
|
||||||
|
value: index + 1,
|
||||||
|
})),
|
||||||
|
cycleDayOptions: [7, 15, 30, 60].map(value => ({ label: `${value}天`, value })),
|
||||||
|
signTypeOptions: defaultSignTypeOptions,
|
||||||
|
contractCategoryDictOptions: [],
|
||||||
|
settlementCurrencyOptions: [],
|
||||||
|
settlementModeDictOptions: [],
|
||||||
|
contractFormatDictOptions: [],
|
||||||
|
planDialogVisible: false,
|
||||||
|
planEditor: { planName: '', defaultPlan: false, remark: '', rules: [] },
|
||||||
|
planEditorIndex: -1,
|
||||||
|
billingElements: [
|
||||||
|
'按重量',
|
||||||
|
'按体积',
|
||||||
|
'按车辆',
|
||||||
|
'按里程',
|
||||||
|
'按吨·公里',
|
||||||
|
'固定金额(整单一口价)',
|
||||||
|
'按数量',
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
contractName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }],
|
||||||
|
changeReason: [{ max: 500, message: '变更原因不能超过500个字符', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
pageTitle() {
|
||||||
|
return this.$route.query.name || '合同变更';
|
||||||
|
},
|
||||||
|
contractCategoryOptions() {
|
||||||
|
return this.contractCategoryDictOptions.length
|
||||||
|
? this.contractCategoryDictOptions
|
||||||
|
: defaultContractCategoryOptions;
|
||||||
|
},
|
||||||
|
settlementModeOptions() {
|
||||||
|
return this.settlementModeDictOptions.length
|
||||||
|
? this.settlementModeDictOptions
|
||||||
|
: defaultSettlementModeOptions;
|
||||||
|
},
|
||||||
|
contractFormatOptions() {
|
||||||
|
return this.contractFormatDictOptions.length
|
||||||
|
? this.contractFormatDictOptions
|
||||||
|
: defaultContractFormatOptions;
|
||||||
|
},
|
||||||
|
showSettlementBillCycleType() {
|
||||||
|
return this.settlementRule.settlementType === '月结';
|
||||||
|
},
|
||||||
|
showSettlementBillCutoffDay() {
|
||||||
|
return this.showSettlementBillCycleType && this.settlementRule.billCycleType === '固定截单日';
|
||||||
|
},
|
||||||
|
showSettlementCustomPeriods() {
|
||||||
|
return this.showSettlementBillCycleType && this.settlementRule.billCycleType === '自定义多周期';
|
||||||
|
},
|
||||||
|
showSettlementCycleDays() {
|
||||||
|
return this.settlementRule.settlementType === '固定天数周期结算';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loadDictionaries();
|
||||||
|
this.load();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
settlementConfigTab(tab, oldTab) {
|
||||||
|
if (tab === oldTab) return;
|
||||||
|
if (oldTab === 'pre') this.preSettlementConfig = { ...this.settlementRule };
|
||||||
|
else this.formalSettlementConfig = { ...this.settlementRule };
|
||||||
|
this.settlementRule = {
|
||||||
|
...(tab === 'pre' ? this.preSettlementConfig : this.formalSettlementConfig),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async load() { const id = this.$route.query.id; if (!id) return; const res = await api.getDetail(id); const data = res.data?.data || res.data || {}; this.form = { ...data, changeContent: '', changeReason: '', changeAttachmentsJson: '', copyCount: normalizeOptionalPositiveInteger(data.copyCount), paymentDays: normalizeOptionalPositiveInteger(data.paymentDays), changeType: '合同信息变更' }; this.changeMaterials = []; this.period = data.startDate && data.endDate ? [data.startDate, data.endDate] : []; this.plans = this.parse(data.billingPlanJson); this.attachments = this.mergeChangeAttachments(this.parse(data.attachmentsJson), this.parse(data.changeAttachmentsJson)); this.contractFileRows = this.parse(data.contractFileJson); const rules = this.parseObject(data.settlementRuleJson); const pre = this.parseObject(data.preSettlementConfigJson); const formal = this.parseObject(data.formalSettlementConfigJson); const legacy = Object.keys(rules).some(key => !['preSettlementConfig', 'formalSettlementConfig'].includes(key)) ? rules : {}; this.preSettlementConfig = rules.preSettlementConfig || (Object.keys(pre).length ? pre : legacy); this.formalSettlementConfig = rules.formalSettlementConfig || (Object.keys(formal).length ? formal : legacy); this.settlementRule = { ...this.preSettlementConfig }; this.feeGenerationMode = data.feeGenerationMode || (Number(data.billingEnabled) === 0 ? 'manual' : 'system'); this.paymentRatioRows = this.parse(data.paymentRatioJson); },
|
loadDictionaries() {
|
||||||
parse(value) { try { const result = JSON.parse(value || '[]'); return Array.isArray(result) ? result : []; } catch { return []; } },
|
Promise.all([
|
||||||
|
getSystemDictionary({ code: 'currency_type' }),
|
||||||
|
getBizDictionary({ code: 'settle_method' }),
|
||||||
|
getBizDictionary({ code: 'contractFormat' }),
|
||||||
|
getBizDictionary({ code: 'contractCategory' }),
|
||||||
|
]).then(([currencyRes, methodRes, formatRes, categoryRes]) => {
|
||||||
|
const records = response => {
|
||||||
|
const data = response?.data?.data || response?.data || [];
|
||||||
|
return Array.isArray(data) ? data : data.records || [];
|
||||||
|
};
|
||||||
|
this.settlementCurrencyOptions = records(currencyRes).map(item => ({
|
||||||
|
label: item.dictValue,
|
||||||
|
value: item.dictKey,
|
||||||
|
}));
|
||||||
|
this.settlementModeDictOptions = records(methodRes).map(item => ({
|
||||||
|
label: item.dictValue,
|
||||||
|
value: item.dictKey,
|
||||||
|
}));
|
||||||
|
this.contractFormatDictOptions = records(formatRes).map(item => ({
|
||||||
|
label: item.dictValue,
|
||||||
|
value: item.dictKey,
|
||||||
|
}));
|
||||||
|
this.contractCategoryDictOptions = records(categoryRes).map(item => ({
|
||||||
|
label: item.dictValue,
|
||||||
|
value: item.dictKey,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async load() {
|
||||||
|
const id = this.$route.query.id;
|
||||||
|
if (!id) return;
|
||||||
|
const res = await api.getDetail(id);
|
||||||
|
const data = res.data?.data || res.data || {};
|
||||||
|
this.form = {
|
||||||
|
...data,
|
||||||
|
changeContent: '',
|
||||||
|
changeReason: '',
|
||||||
|
changeAttachmentsJson: '',
|
||||||
|
copyCount: normalizeOptionalPositiveInteger(data.copyCount),
|
||||||
|
invoiceCycle: normalizeOptionalPositiveInteger(data.invoiceCycle),
|
||||||
|
paymentDays: normalizeOptionalPositiveInteger(data.paymentDays),
|
||||||
|
contractAmount: normalizeOptionalAmount(data.contractAmount),
|
||||||
|
templateFlag: data.templateFlag ?? 0,
|
||||||
|
electronicSealFlag: data.electronicSealFlag ?? 0,
|
||||||
|
archiveStatus: data.archiveStatus || '未归档',
|
||||||
|
changeType: '合同信息变更',
|
||||||
|
};
|
||||||
|
this.changeMaterials = [];
|
||||||
|
this.period = data.startDate && data.endDate ? [data.startDate, data.endDate] : [];
|
||||||
|
this.plans = this.parse(data.billingPlanJson);
|
||||||
|
this.attachments = this.mergeChangeAttachments(
|
||||||
|
this.parse(data.attachmentsJson),
|
||||||
|
this.parse(data.changeAttachmentsJson)
|
||||||
|
);
|
||||||
|
this.contractFileRows = normalizeContractFileRows(this.parse(data.contractFileJson));
|
||||||
|
const rules = this.parseObject(data.settlementRuleJson);
|
||||||
|
const pre = this.parseObject(data.preSettlementConfigJson);
|
||||||
|
const formal = this.parseObject(data.formalSettlementConfigJson);
|
||||||
|
const legacy = Object.keys(rules).some(
|
||||||
|
key => !['preSettlementConfig', 'formalSettlementConfig'].includes(key)
|
||||||
|
)
|
||||||
|
? rules
|
||||||
|
: {};
|
||||||
|
const normalizeRule = rule => {
|
||||||
|
const next = {
|
||||||
|
autoGenerate: '',
|
||||||
|
billStartDate: '',
|
||||||
|
settlementType: '',
|
||||||
|
billCycleType: '',
|
||||||
|
billCutoffDay: '',
|
||||||
|
cycleDays: '',
|
||||||
|
customPeriods: [],
|
||||||
|
...(rule || {}),
|
||||||
|
};
|
||||||
|
if (next.settlementType === '月结' && next.billCycleType === '自定义多周期') {
|
||||||
|
next.customPeriods = normalizeCustomPeriods(
|
||||||
|
Array.isArray(next.customPeriods) ? next.customPeriods : []
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
next.customPeriods = [];
|
||||||
|
}
|
||||||
|
return next;
|
||||||
|
};
|
||||||
|
this.preSettlementConfig = normalizeRule(
|
||||||
|
rules.preSettlementConfig || (Object.keys(pre).length ? pre : legacy)
|
||||||
|
);
|
||||||
|
this.formalSettlementConfig = normalizeRule(
|
||||||
|
rules.formalSettlementConfig || (Object.keys(formal).length ? formal : legacy)
|
||||||
|
);
|
||||||
|
this.settlementRule = { ...this.preSettlementConfig };
|
||||||
|
this.feeGenerationMode =
|
||||||
|
data.feeGenerationMode || (Number(data.billingEnabled) === 0 ? 'manual' : 'system');
|
||||||
|
this.paymentRatioRows = this.parse(data.paymentRatioJson);
|
||||||
|
},
|
||||||
|
parse(value) {
|
||||||
|
try {
|
||||||
|
const result = JSON.parse(value || '[]');
|
||||||
|
return Array.isArray(result) ? result : [];
|
||||||
|
} catch {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
// 审核通过后上一次的变更材料归集到「其它附件」,按文件地址/文件名去重,避免重复展示
|
// 审核通过后上一次的变更材料归集到「其它附件」,按文件地址/文件名去重,避免重复展示
|
||||||
mergeChangeAttachments(attachments = [], changeAttachments = []) {
|
mergeChangeAttachments(attachments = [], changeAttachments = []) {
|
||||||
const key = item => this.attachmentUrl(item) || this.attachmentName(item);
|
const key = item => this.attachmentUrl(item) || this.attachmentName(item);
|
||||||
const exists = new Set(attachments.map(key));
|
const exists = new Set(attachments.map(key));
|
||||||
const merged = changeAttachments
|
const merged = changeAttachments
|
||||||
.filter(item => !exists.has(key(item)))
|
.filter(item => !exists.has(key(item)))
|
||||||
.map(item => ({ ...item, size: /^\d+$/.test(String(item.size ?? '')) ? this.formatFileSize(item.size) : item.size }));
|
.map(item => ({
|
||||||
|
...item,
|
||||||
|
size: /^\d+$/.test(String(item.size ?? '')) ? this.formatFileSize(item.size) : item.size,
|
||||||
|
}));
|
||||||
return [...attachments, ...merged];
|
return [...attachments, ...merged];
|
||||||
},
|
},
|
||||||
parseObject(value) { try { return { autoGenerate: 1, settlementType: '月结', billCycleType: '固定截单日', billCutoffDay: 25, cycleDays: 15, ...(JSON.parse(value || '{}') || {}) }; } catch { return { autoGenerate: 1, settlementType: '月结', billCycleType: '固定截单日', billCutoffDay: 25, cycleDays: 15 }; } },
|
parseObject(value) {
|
||||||
positiveIntegerInput(prop, value) { this.form[prop] = String(value ?? '').replace(/\D/g, '').replace(/^0+/, ''); },
|
try {
|
||||||
|
return {
|
||||||
|
autoGenerate: '',
|
||||||
|
billStartDate: '',
|
||||||
|
settlementType: '',
|
||||||
|
billCycleType: '',
|
||||||
|
billCutoffDay: '',
|
||||||
|
cycleDays: '',
|
||||||
|
customPeriods: [],
|
||||||
|
...(JSON.parse(value || '{}') || {}),
|
||||||
|
};
|
||||||
|
} catch {
|
||||||
|
return {
|
||||||
|
autoGenerate: '',
|
||||||
|
billStartDate: '',
|
||||||
|
settlementType: '',
|
||||||
|
billCycleType: '',
|
||||||
|
billCutoffDay: '',
|
||||||
|
cycleDays: '',
|
||||||
|
customPeriods: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
positiveIntegerInput(prop, value) {
|
||||||
|
this.form[prop] = String(value ?? '')
|
||||||
|
.replace(/\D/g, '')
|
||||||
|
.replace(/^0+/, '');
|
||||||
|
},
|
||||||
addPlan() { this.planEditorIndex = -1; this.planEditor = { planName: `计费方案${this.plans.length + 1}`, defaultPlan: !this.plans.length, remark: '', rules: [{}] }; this.planDialogVisible = true; },
|
addPlan() { this.planEditorIndex = -1; this.planEditor = { planName: `计费方案${this.plans.length + 1}`, defaultPlan: !this.plans.length, remark: '', rules: [{}] }; this.planDialogVisible = true; },
|
||||||
editPlan(row, index) { this.planEditorIndex = index; this.planEditor = JSON.parse(JSON.stringify(row)); this.planDialogVisible = true; },
|
editPlan(row, index) { this.planEditorIndex = index; this.planEditor = JSON.parse(JSON.stringify(row)); this.planDialogVisible = true; },
|
||||||
toggleDefaultPlan(value) { if (value) this.plans.forEach(item => { item.defaultPlan = false; }); },
|
toggleDefaultPlan(value) { if (value) this.plans.forEach(item => { item.defaultPlan = false; }); },
|
||||||
savePlan(value, index) { if (index < 0) this.plans.push(value); else this.plans.splice(index, 1, value); if (value.defaultPlan) this.plans.forEach((item, current) => { if (current !== (index < 0 ? this.plans.length - 1 : index)) item.defaultPlan = false; }); },
|
savePlan(value, index) { if (index < 0) this.plans.push(value); else this.plans.splice(index, 1, value); if (value.defaultPlan) this.plans.forEach((item, current) => { if (current !== (index < 0 ? this.plans.length - 1 : index)) item.defaultPlan = false; }); },
|
||||||
handleSettlementTypeChange(value) { if (value !== '月结') { this.settlementRule.billCycleType = ''; this.settlementRule.billCutoffDay = ''; } else if (!this.settlementRule.billCycleType) this.settlementRule.billCycleType = '固定截单日'; if (value !== '固定天数周期结算') this.settlementRule.cycleDays = ''; },
|
handleSettlementTypeChange(value) { if (value !== '月结') { this.settlementRule.billCycleType = ''; this.settlementRule.billCutoffDay = ''; this.settlementRule.customPeriods = []; } else if (this.settlementRule.billCycleType === '自定义多周期') this.settlementRule.customPeriods = normalizeCustomPeriods(this.settlementRule.customPeriods || []); else this.settlementRule.customPeriods = []; if (value !== '固定天数周期结算') this.settlementRule.cycleDays = ''; },
|
||||||
handleCycleTypeChange(value) { if (value === '固定截单日' && !this.settlementRule.billCutoffDay) this.settlementRule.billCutoffDay = 25; if (value !== '固定截单日') this.settlementRule.billCutoffDay = ''; },
|
handleCycleTypeChange(value) { if (value !== '固定截单日') this.settlementRule.billCutoffDay = ''; if (value === '自定义多周期') this.settlementRule.customPeriods = normalizeCustomPeriods(this.settlementRule.customPeriods || []); else this.settlementRule.customPeriods = []; },
|
||||||
handleAttachment(event) { const raw = event.raw; if (!raw) return; if (raw.size > 50 * 1024 * 1024) { this.$message.warning('单个文件大小不能超过50M'); return; } this.attachments.push({ name: raw.name, size: `${Math.ceil(raw.size / 1024)}KB`, uploadTime: this.$dayjs().format('YYYY-MM-DD HH:mm:ss') }); },
|
|
||||||
handleContractFileChange(list) { this.contractFileRows = (list || []).map(item => ({ ...item, uploadTime: item.uploadTime || this.$dayjs().format('YYYY-MM-DD HH:mm:ss') })); },
|
|
||||||
attachmentUrl(row = {}) { return row.url || row.link || row.fileUrl || row.downloadUrl || row.domain || ''; },
|
attachmentUrl(row = {}) { return row.url || row.link || row.fileUrl || row.downloadUrl || row.domain || ''; },
|
||||||
attachmentName(row = {}) { return row.originalName || row.name || row.fileName || '附件'; },
|
attachmentName(row = {}) { return row.originalName || row.name || row.fileName || '附件'; },
|
||||||
attachmentExtension(row = {}) { const source = String(this.attachmentName(row) || this.attachmentUrl(row)).split('?')[0]; const index = source.lastIndexOf('.'); return index > -1 ? source.slice(index + 1).toLowerCase() : ''; },
|
attachmentExtension(row = {}) { const source = String(this.attachmentName(row) || this.attachmentUrl(row)).split('?')[0]; const index = source.lastIndexOf('.'); return index > -1 ? source.slice(index + 1).toLowerCase() : ''; },
|
||||||
@@ -171,11 +620,16 @@ export default {
|
|||||||
previewAttachment(row, rows = this.attachments) { const url = this.attachmentUrl(row); if (!url) { this.$message.warning('附件地址为空,无法预览'); return; } if (this.isAttachmentImage(row)) { this.imagePreviewUrls = (rows || []).filter(item => this.isAttachmentImage(item) && this.attachmentUrl(item)).map(item => this.attachmentUrl(item)); this.imagePreviewIndex = Math.max(this.imagePreviewUrls.indexOf(url), 0); this.imagePreviewVisible = true; return; } this.previewFile = { name: this.attachmentName(row), url, mimeType: row.mimeType || row.contentType || '' }; this.documentPreviewVisible = true; },
|
previewAttachment(row, rows = this.attachments) { const url = this.attachmentUrl(row); if (!url) { this.$message.warning('附件地址为空,无法预览'); return; } if (this.isAttachmentImage(row)) { this.imagePreviewUrls = (rows || []).filter(item => this.isAttachmentImage(item) && this.attachmentUrl(item)).map(item => this.attachmentUrl(item)); this.imagePreviewIndex = Math.max(this.imagePreviewUrls.indexOf(url), 0); this.imagePreviewVisible = true; return; } this.previewFile = { name: this.attachmentName(row), url, mimeType: row.mimeType || row.contentType || '' }; this.documentPreviewVisible = true; },
|
||||||
handlePreviewUnsupported() { this.$message.warning('当前文件暂不支持在线预览'); },
|
handlePreviewUnsupported() { this.$message.warning('当前文件暂不支持在线预览'); },
|
||||||
handlePreviewError() { this.$message.error('附件预览失败'); },
|
handlePreviewError() { this.$message.error('附件预览失败'); },
|
||||||
removeContractFile(index) { this.contractFileRows.splice(index, 1); },
|
|
||||||
handleContractFileBatchDownload() { (this.selectedContractFiles.length ? this.selectedContractFiles : this.contractFileRows).forEach(row => { if (row.url) window.open(row.url, '_blank'); }); },
|
|
||||||
formatFileSize(value) { const size = Number(value || 0); return size > 1024 * 1024 ? `${(size / 1024 / 1024).toFixed(2)}MB` : `${Math.max(1, Math.ceil(size / 1024))}KB`; },
|
formatFileSize(value) { const size = Number(value || 0); return size > 1024 * 1024 ? `${(size / 1024 / 1024).toFixed(2)}MB` : `${Math.max(1, Math.ceil(size / 1024))}KB`; },
|
||||||
addPaymentRatioRow() { this.paymentRatioRows.push({ paymentTerm: `第${this.paymentRatioRows.length + 1}笔`, ratioLimit: '', remark: '' }); },
|
addPaymentRatioRow() { this.paymentRatioRows.push({ paymentTerm: `第${this.paymentRatioRows.length + 1}笔`, ratioLimit: '', remark: '' }); },
|
||||||
async submit() { await this.$refs.formRef.validate(); const total = this.paymentRatioRows.reduce((sum, row) => sum + Number(row.ratioLimit || 0), 0); if (this.paymentRatioRows.length && Math.abs(total - 100) > 0.0001) { this.$message.warning('付款比例上限合计必须等于100%'); return; } const settlementRule = { preSettlementConfig: this.preSettlementConfig, formalSettlementConfig: this.formalSettlementConfig }; await api.submitChange({ ...this.form, settlementCurrency: String(this.form.settlementCurrency || '').trim() || 'RMB', copyCount: normalizeOptionalPositiveInteger(this.form.copyCount), paymentDays: normalizeOptionalPositiveInteger(this.form.paymentDays), startDate: this.period[0], endDate: this.period[1], feeGenerationMode: this.feeGenerationMode, billingEnabled: this.feeGenerationMode === 'system' ? 1 : 0, billingPlanJson: JSON.stringify(this.plans), settlementRuleJson: JSON.stringify(settlementRule), preSettlementConfigJson: JSON.stringify(this.preSettlementConfig), formalSettlementConfigJson: JSON.stringify(this.formalSettlementConfig), paymentRatioJson: JSON.stringify(this.paymentRatioRows), contractFileJson: JSON.stringify(this.contractFileRows), attachmentsJson: JSON.stringify(this.attachments), changeContent: this.form.changeContent, changeReason: this.form.changeReason, changeAttachmentsJson: JSON.stringify(this.changeMaterials) }); this.$message.success('变更已提交'); this.$router.back(); },
|
customPeriodEndDayOptions(row) { const startDay = Number(row?.startDay); if (!Number.isFinite(startDay) || startDay < 1) return this.billCutoffDayOptions; return Array.from({ length: 31 - startDay + 1 }, (_, index) => ({ label: `${startDay + index}日`, value: startDay + index })); },
|
||||||
|
handleCustomPeriodStartDayChange(index, value) { const periods = normalizeCustomPeriods(this.settlementRule.customPeriods || []); const row = periods[index]; if (!row) return; row.startDay = value || ''; const startDay = Number(row.startDay); const endDay = Number(row.endDay); if (Number.isFinite(startDay) && Number.isFinite(endDay) && (endDay < startDay || endDay > 31)) row.endDay = ''; this.settlementRule.customPeriods = periods; },
|
||||||
|
handleCustomPeriodEndDayChange(index, value) { const periods = normalizeCustomPeriods(this.settlementRule.customPeriods || []); const row = periods[index]; if (!row) return; row.endDay = value || ''; this.settlementRule.customPeriods = periods; },
|
||||||
|
addCustomPeriodRow() { const periods = normalizeCustomPeriods(this.settlementRule.customPeriods || []); periods.push({ startDay: '', endDay: '' }); this.settlementRule.customPeriods = periods; },
|
||||||
|
removeCustomPeriodRow(index) { if (index <= 0) return; const periods = [...(this.settlementRule.customPeriods || [])]; periods.splice(index, 1); this.settlementRule.customPeriods = normalizeCustomPeriods(periods); },
|
||||||
|
validateCustomPeriods(periods = [], label) { const rows = normalizeCustomPeriods(periods); if (!rows.length) { this.$message.warning(`${label}:请至少配置一段自定义周期`); return false; } for (let index = 0; index < rows.length; index += 1) { const row = rows[index]; const startDay = Number(row.startDay); const endDay = Number(row.endDay); if (!Number.isFinite(startDay) || startDay < 1 || startDay > 31) { this.$message.warning(`${label}:请选择第${index + 1}行运单区间开始日`); return false; } if (!Number.isFinite(endDay) || endDay < 1 || endDay > 31) { this.$message.warning(`${label}:请选择第${index + 1}行运单区间结束日`); return false; } if (endDay < startDay) { this.$message.warning(`${label}:第${index + 1}行结束日不能早于开始日`); return false; } if (index > 0 && startDay !== Number(rows[index - 1].endDay) + 1) { this.$message.warning(`${label}:自定义多周期区间必须连续,不允许重叠或存在日期缺口`); return false; } } return true; },
|
||||||
|
validateSettlementRule(rule, label) { if (Number(rule.autoGenerate) !== 1) return true; if (!rule.billStartDate || !rule.settlementType) { this.$message.warning(`${label}:请完整填写账单起始日期和结算类型`); return false; } if (rule.settlementType === '月结' && !rule.billCycleType) { this.$message.warning(`${label}:请选择结算周期`); return false; } if (rule.settlementType === '月结' && rule.billCycleType === '固定截单日' && !rule.billCutoffDay) { this.$message.warning(`${label}:请选择账单截单日`); return false; } if (rule.settlementType === '月结' && rule.billCycleType === '自定义多周期') return this.validateCustomPeriods(rule.customPeriods, label); if (rule.settlementType === '固定天数周期结算' && !rule.cycleDays) { this.$message.warning(`${label}:请选择周期天数`); return false; } return true; },
|
||||||
|
async submit() { await this.$refs.formRef.validate(); const total = this.paymentRatioRows.reduce((sum, row) => sum + Number(row.ratioLimit || 0), 0); if (this.paymentRatioRows.length && Math.abs(total - 100) > 0.0001) { this.$message.warning('付款比例上限合计必须等于100%'); return; } if (this.settlementConfigTab === 'pre') this.preSettlementConfig = { ...this.settlementRule }; else this.formalSettlementConfig = { ...this.settlementRule }; if (!this.validateSettlementRule(this.preSettlementConfig, '预结算配置') || !this.validateSettlementRule(this.formalSettlementConfig, '正式结算配置')) return; const settlementRule = { preSettlementConfig: this.preSettlementConfig, formalSettlementConfig: this.formalSettlementConfig }; await api.submitChange({ ...this.form, settlementCurrency: String(this.form.settlementCurrency || '').trim() || 'RMB', copyCount: normalizeOptionalPositiveInteger(this.form.copyCount), invoiceCycle: normalizeOptionalPositiveInteger(this.form.invoiceCycle), paymentDays: normalizeOptionalPositiveInteger(this.form.paymentDays), contractAmount: normalizeOptionalAmount(this.form.contractAmount), startDate: this.period[0], endDate: this.period[1], feeGenerationMode: this.feeGenerationMode, billingEnabled: this.feeGenerationMode === 'system' ? 1 : 0, billingPlanJson: JSON.stringify(this.plans), settlementRuleJson: JSON.stringify(settlementRule), preSettlementConfigJson: JSON.stringify(this.preSettlementConfig), formalSettlementConfigJson: JSON.stringify(this.formalSettlementConfig), paymentRatioJson: JSON.stringify(this.paymentRatioRows), contractFileJson: JSON.stringify(this.contractFileRows), attachmentsJson: JSON.stringify(this.attachments), changeContent: this.form.changeContent, changeReason: this.form.changeReason, changeAttachmentsJson: JSON.stringify(this.changeMaterials) }); this.$message.success('变更已提交'); this.$router.back(); },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -201,18 +655,31 @@ export default {
|
|||||||
.contract-basic-section :deep(.el-date-editor) { width: 360px; max-width: 100%; }
|
.contract-basic-section :deep(.el-date-editor) { width: 360px; max-width: 100%; }
|
||||||
.dialog-section-title { margin-bottom: 18px; font-size: 16px; font-weight: 600; }
|
.dialog-section-title { margin-bottom: 18px; font-size: 16px; font-weight: 600; }
|
||||||
.dialog-section-title::before { display: inline-block; width: 4px; height: 16px; margin-right: 8px; vertical-align: -2px; background: #409eff; content: ''; }
|
.dialog-section-title::before { display: inline-block; width: 4px; height: 16px; margin-right: 8px; vertical-align: -2px; background: #409eff; content: ''; }
|
||||||
.dialog-section-title.is-required::after { margin-left: 4px; color: #f56c6c; content: '*'; }
|
|
||||||
.section-head { display: flex; align-items: center; justify-content: space-between; }
|
.section-head { display: flex; align-items: center; justify-content: space-between; }
|
||||||
.change-table { margin: 16px 0; }
|
.change-table { margin: 16px 0; }
|
||||||
.ratio-tip { margin-bottom: 8px; color: #f56c6c; }
|
.ratio-tip { margin-bottom: 8px; color: #f56c6c; }
|
||||||
.unit { margin-left: 8px; }
|
.unit { margin-left: 8px; }
|
||||||
.attachment-head { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 12px; }
|
|
||||||
.attachment-upload { display: flex; justify-content: flex-start; margin-top: 12px; }
|
.attachment-upload { display: flex; justify-content: flex-start; margin-top: 12px; }
|
||||||
.attachment-upload .vehicle-attachment-upload { width: auto; }
|
.attachment-upload .vehicle-attachment-upload { width: auto; }
|
||||||
.attachment-upload .el-upload { display: inline-flex; }
|
.attachment-upload .el-upload { display: inline-flex; }
|
||||||
.settlement-switch { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
|
.settlement-switch { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
|
||||||
|
// 问号提示图标紧靠「开启」一侧:清掉开启 radio 自带的右间距,图标与「关闭」之间留大间距
|
||||||
|
.settlement-switch :deep(.el-radio:first-child) { margin-right: 0; }
|
||||||
|
.settlement-switch-tip { margin: 0 32px 0 8px; color: #a8abb2; cursor: help; font-size: 14px; }
|
||||||
.settlement-form { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 8px 28px; }
|
.settlement-form { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 8px 28px; }
|
||||||
.change-reason-section { margin: 20px 0; }
|
.change-reason-section { margin: 20px 0; }
|
||||||
|
.change-reason-section__input {
|
||||||
|
width: 100%;
|
||||||
|
:deep(.el-textarea__inner) {
|
||||||
|
border-color: #f56c6c;
|
||||||
|
box-shadow: 0 0 0 1px #f56c6c inset;
|
||||||
|
}
|
||||||
|
:deep(.el-textarea__inner:hover),
|
||||||
|
:deep(.el-textarea__inner:focus) {
|
||||||
|
border-color: #f56c6c;
|
||||||
|
box-shadow: 0 0 0 1px #f56c6c inset;
|
||||||
|
}
|
||||||
|
}
|
||||||
.page-footer {
|
.page-footer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -227,7 +227,7 @@
|
|||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-model="row.confirmMode"
|
v-model="row.confirmMode"
|
||||||
:disabled="dialogReadonly || !row.enabled"
|
:disabled="dialogReadonly || !row.enabled"
|
||||||
@change="syncNodeFields"
|
@change="handleAcceptConfirmChange(row)"
|
||||||
>
|
>
|
||||||
<el-radio label="yes">是</el-radio>
|
<el-radio label="yes">是</el-radio>
|
||||||
<el-radio label="no_confirm_accept">无需确认接单</el-radio>
|
<el-radio label="no_confirm_accept">无需确认接单</el-radio>
|
||||||
@@ -235,12 +235,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="process-config-form__require-line">
|
<div class="process-config-form__require-line">
|
||||||
<span class="process-config-form__require-label">确认接单人</span>
|
<span class="process-config-form__require-label">确认接单人</span>
|
||||||
<el-checkbox
|
<el-checkbox v-model="row.confirmDriver" :disabled="true">司机</el-checkbox>
|
||||||
v-model="row.confirmDriver"
|
|
||||||
:disabled="dialogReadonly || !row.enabled || row.confirmMode !== 'yes'"
|
|
||||||
@change="syncNodeFields"
|
|
||||||
>司机</el-checkbox
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -551,10 +546,19 @@ export default {
|
|||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
return this.isAdmin || this.validData(this.permission && this.permission[code], false);
|
return this.isAdmin || this.validData(this.permission && this.permission[code], false);
|
||||||
},
|
},
|
||||||
|
handleAcceptConfirmChange(row) {
|
||||||
|
row.confirmDriver = row.confirmMode === 'yes';
|
||||||
|
this.syncNodeFields();
|
||||||
|
},
|
||||||
handleReturnConfirmChange(row) {
|
handleReturnConfirmChange(row) {
|
||||||
row.confirmInternal = row.confirmMode === 'yes';
|
row.confirmInternal = row.confirmMode === 'yes';
|
||||||
this.syncNodeFields();
|
this.syncNodeFields();
|
||||||
},
|
},
|
||||||
|
enforceAcceptDriver(node) {
|
||||||
|
if (!node || (node.key !== 'accept' && node.name !== '接单')) return node;
|
||||||
|
node.confirmDriver = node.confirmMode === 'yes';
|
||||||
|
return node;
|
||||||
|
},
|
||||||
initDeptOptions() {
|
initDeptOptions() {
|
||||||
getDeptTree(this.userInfo.tenantId).then(res => {
|
getDeptTree(this.userInfo.tenantId).then(res => {
|
||||||
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
|
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
|
||||||
@@ -610,7 +614,7 @@ export default {
|
|||||||
return 'warning';
|
return 'warning';
|
||||||
},
|
},
|
||||||
canEdit(row) {
|
canEdit(row) {
|
||||||
return this.hasPermission('process_config_edit') && !row.readonly;
|
return this.hasPermission('process_config_edit') && !row.readonly && !row.hasRelatedWaybill;
|
||||||
},
|
},
|
||||||
canDelete(row) {
|
canDelete(row) {
|
||||||
return (
|
return (
|
||||||
@@ -626,7 +630,7 @@ export default {
|
|||||||
return this.hasPermission('process_config_disable') && !row.readonly && row.status === 1;
|
return this.hasPermission('process_config_disable') && !row.readonly && row.status === 1;
|
||||||
},
|
},
|
||||||
cloneNode(template) {
|
cloneNode(template) {
|
||||||
return {
|
const node = {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
punch: true,
|
punch: true,
|
||||||
location: true,
|
location: true,
|
||||||
@@ -641,10 +645,16 @@ export default {
|
|||||||
supportVoucher: false,
|
supportVoucher: false,
|
||||||
voucherOptions: [],
|
voucherOptions: [],
|
||||||
confirmMode: 'yes',
|
confirmMode: 'yes',
|
||||||
confirmDriver: false,
|
confirmDriver: true,
|
||||||
confirmInternal: false,
|
confirmInternal: false,
|
||||||
...template,
|
...template,
|
||||||
};
|
};
|
||||||
|
if ((node.key === 'accept' || node.name === '接单') && node.confirmMode === 'yes') {
|
||||||
|
node.confirmDriver = true;
|
||||||
|
} else if ((node.key === 'accept' || node.name === '接单') && node.confirmMode !== 'yes') {
|
||||||
|
node.confirmDriver = false;
|
||||||
|
}
|
||||||
|
return node;
|
||||||
},
|
},
|
||||||
resetNodeRows() {
|
resetNodeRows() {
|
||||||
this.nodeRows = NODE_TEMPLATES.map(item => this.cloneNode(item));
|
this.nodeRows = NODE_TEMPLATES.map(item => this.cloneNode(item));
|
||||||
@@ -769,20 +779,28 @@ export default {
|
|||||||
this.syncNodeFields();
|
this.syncNodeFields();
|
||||||
},
|
},
|
||||||
syncNodeFields() {
|
syncNodeFields() {
|
||||||
|
this.nodeRows.forEach(item => this.enforceAcceptDriver(item));
|
||||||
const enabledNodes = this.nodeRows.filter(item => item.enabled);
|
const enabledNodes = this.nodeRows.filter(item => item.enabled);
|
||||||
this.form.includedNodes = enabledNodes.map(item => item.name).join(',');
|
this.form.includedNodes = enabledNodes.map(item => item.name).join(',');
|
||||||
this.form.nodeConfigJson = JSON.stringify(
|
this.form.nodeConfigJson = JSON.stringify(
|
||||||
this.nodeRows.map(item => ({
|
this.nodeRows.map(item => ({
|
||||||
key: item.key,
|
key: item.key,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
type: item.type,
|
||||||
enabled: item.enabled,
|
enabled: item.enabled,
|
||||||
confirmMode: item.confirmMode,
|
confirmMode: item.confirmMode,
|
||||||
confirmDriver: item.confirmDriver,
|
confirmDriver: item.confirmDriver,
|
||||||
confirmInternal: item.confirmInternal,
|
confirmInternal: item.confirmInternal,
|
||||||
punch: item.punch,
|
punch: item.punch,
|
||||||
location: item.location,
|
location: item.location,
|
||||||
uploadCargo: item.uploadCargo,
|
// 在途不支持货量;其它节点按配置
|
||||||
cargoTypes: item.uploadCargo ? item.cargoTypes : [],
|
uploadCargo: item.type === 'transit' || item.key === 'transit' ? false : item.uploadCargo,
|
||||||
|
cargoTypes:
|
||||||
|
item.type === 'transit' || item.key === 'transit'
|
||||||
|
? []
|
||||||
|
: item.uploadCargo
|
||||||
|
? item.cargoTypes
|
||||||
|
: [],
|
||||||
frequencyDays: item.frequencyDays,
|
frequencyDays: item.frequencyDays,
|
||||||
timeStart: item.timeStart,
|
timeStart: item.timeStart,
|
||||||
timeEnd: item.timeEnd,
|
timeEnd: item.timeEnd,
|
||||||
@@ -935,7 +953,7 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
openConfig(row, readonly = false) {
|
openConfig(row, readonly = false) {
|
||||||
this.dialogReadonly = readonly;
|
this.dialogReadonly = readonly || !!(row && row.hasRelatedWaybill);
|
||||||
if (!row || !row.id) {
|
if (!row || !row.id) {
|
||||||
this.form = {
|
this.form = {
|
||||||
configName: '',
|
configName: '',
|
||||||
@@ -952,6 +970,7 @@ export default {
|
|||||||
}
|
}
|
||||||
api.getDetail(row.id).then(res => {
|
api.getDetail(row.id).then(res => {
|
||||||
const detail = res.data.data || {};
|
const detail = res.data.data || {};
|
||||||
|
this.dialogReadonly = readonly || !!detail.hasRelatedWaybill;
|
||||||
this.form = {
|
this.form = {
|
||||||
...detail,
|
...detail,
|
||||||
defaultFinishDays:
|
defaultFinishDays:
|
||||||
@@ -969,6 +988,10 @@ export default {
|
|||||||
},
|
},
|
||||||
submitConfig(mode) {
|
submitConfig(mode) {
|
||||||
if (this.submitting) return;
|
if (this.submitting) return;
|
||||||
|
if (this.form.id && this.form.hasRelatedWaybill) {
|
||||||
|
this.$message.warning('该项目已有运单,过程配置不可修改');
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.syncNodeFields();
|
this.syncNodeFields();
|
||||||
const submitRow = this.normalizeRow({
|
const submitRow = this.normalizeRow({
|
||||||
...this.form,
|
...this.form,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -50,7 +50,13 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #projectName-label>项目额度信息</template>
|
<template #projectQuotaInfoTitle-form>
|
||||||
|
<div class="dialog-section-title">项目额度信息</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #temporaryCreditInfoTitle-form>
|
||||||
|
<div class="dialog-section-title">临时额度信息</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template #projectName-form>
|
<template #projectName-form>
|
||||||
<el-select
|
<el-select
|
||||||
@@ -130,22 +136,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #menu-form-before>
|
<template #menu-form-before>
|
||||||
<el-button
|
<template v-if="!dialogReadonly">
|
||||||
v-if="!dialogReadonly"
|
<el-button @click="closeFormDialog">取消</el-button>
|
||||||
type="primary"
|
<el-button type="primary" plain :loading="draftLoading" @click="saveDraft">
|
||||||
plain
|
保存
|
||||||
:loading="draftLoading"
|
</el-button>
|
||||||
@click="saveDraft"
|
</template>
|
||||||
>
|
|
||||||
保存
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #menu="{ row }">
|
<template #menu="{ row }">
|
||||||
<el-link
|
<el-link
|
||||||
v-if="hasPermission(`${config.permission}_view`)"
|
v-if="hasPermission(`${config.permission}_view`)"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="$refs.crud.rowView(row)"
|
@click="openDetail(row)"
|
||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</el-link>
|
</el-link>
|
||||||
@@ -164,6 +167,74 @@
|
|||||||
</template>
|
</template>
|
||||||
</avue-crud>
|
</avue-crud>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
v-model="detailVisible"
|
||||||
|
title="查看临时额度申请"
|
||||||
|
append-to-body
|
||||||
|
destroy-on-close
|
||||||
|
width="96%"
|
||||||
|
class="temporary-credit-limit-dialog temporary-credit-limit-detail-dialog"
|
||||||
|
>
|
||||||
|
<div v-loading="detailLoading" class="business-crud-page__detail-content">
|
||||||
|
<section
|
||||||
|
v-for="section in detailSections"
|
||||||
|
:key="section.title"
|
||||||
|
class="temporary-credit-limit-detail-dialog__section"
|
||||||
|
>
|
||||||
|
<div class="dialog-section-title">{{ section.title }}</div>
|
||||||
|
<el-descriptions :column="4" class="temporary-credit-limit-detail-dialog__descriptions">
|
||||||
|
<el-descriptions-item
|
||||||
|
v-for="field in section.fields"
|
||||||
|
:key="field[0]"
|
||||||
|
:label="field[1]"
|
||||||
|
:span="field[2] || 1"
|
||||||
|
>
|
||||||
|
{{ formatDetailValue(field[0]) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<div
|
||||||
|
v-if="section.showAttachment"
|
||||||
|
class="temporary-credit-limit-detail-dialog__attachment"
|
||||||
|
>
|
||||||
|
<div class="temporary-credit-limit-page__attachment-head">
|
||||||
|
<span class="temporary-credit-limit-detail-dialog__attachment-label">附件</span>
|
||||||
|
<el-button type="primary" :disabled="!attachmentRows.length" @click="batchDownload">
|
||||||
|
批量下载
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="attachmentRows" empty-text="暂无附件">
|
||||||
|
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||||
|
<el-table-column label="文件名" min-width="240" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link type="primary" @click="previewAttachment(row)">
|
||||||
|
{{ attachmentName(row) }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="文件大小" width="120" align="center">
|
||||||
|
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="uploadUserName" label="上传人" width="140" align="center" />
|
||||||
|
<el-table-column
|
||||||
|
prop="uploadTime"
|
||||||
|
label="上传时间"
|
||||||
|
:width="config.detailAttachmentUploadTimeWidth || 180"
|
||||||
|
align="center"
|
||||||
|
/>
|
||||||
|
<el-table-column label="操作" width="100" align="center" fixed="right">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link type="primary" @click="downloadAttachment(row)">下载</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="detailVisible = false">关闭</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<empty-pagination
|
<empty-pagination
|
||||||
:page="page"
|
:page="page"
|
||||||
@size-change="sizeChange"
|
@size-change="sizeChange"
|
||||||
@@ -313,6 +384,9 @@ export default {
|
|||||||
zoom: true,
|
zoom: true,
|
||||||
},
|
},
|
||||||
attachmentFileTypes,
|
attachmentFileTypes,
|
||||||
|
detailVisible: false,
|
||||||
|
detailLoading: false,
|
||||||
|
detailRow: {},
|
||||||
flowBox: false,
|
flowBox: false,
|
||||||
flowUrl: '',
|
flowUrl: '',
|
||||||
processInstanceId: '',
|
processInstanceId: '',
|
||||||
@@ -323,6 +397,9 @@ export default {
|
|||||||
permissionList() {
|
permissionList() {
|
||||||
return { addBtn: this.canCreate };
|
return { addBtn: this.canCreate };
|
||||||
},
|
},
|
||||||
|
detailSections() {
|
||||||
|
return this.config.detailSections || [];
|
||||||
|
},
|
||||||
isAdmin() {
|
isAdmin() {
|
||||||
const authority = this.userInfo?.authority;
|
const authority = this.userInfo?.authority;
|
||||||
return Array.isArray(authority)
|
return Array.isArray(authority)
|
||||||
@@ -341,14 +418,54 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buildTableOption() {
|
buildTableOption() {
|
||||||
|
const columns = (option.column || []).map(column => ({ ...column }));
|
||||||
|
const sectionTitleProps = ['projectQuotaInfoTitle', 'temporaryCreditInfoTitle'];
|
||||||
|
const formGroups = [];
|
||||||
|
let current = [];
|
||||||
|
columns.forEach(col => {
|
||||||
|
if (sectionTitleProps.includes(col.prop)) {
|
||||||
|
if (current.length) formGroups.push(current);
|
||||||
|
current = [col];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!current.length) return;
|
||||||
|
// 列表/搜索专用字段不进入表单分组白卡
|
||||||
|
if (col.addDisplay === false && col.editDisplay === false) return;
|
||||||
|
current.push(col);
|
||||||
|
});
|
||||||
|
if (current.length) formGroups.push(current);
|
||||||
|
|
||||||
|
const formSectionProps = new Set();
|
||||||
|
formGroups.forEach(group => {
|
||||||
|
group.forEach(col => {
|
||||||
|
if (col.prop) formSectionProps.add(col.prop);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表单字段全部进 group 拆白卡;Avue 会额外生成空的主列 group,由样式隐藏去掉顶部白横条
|
||||||
return {
|
return {
|
||||||
...option,
|
...option,
|
||||||
addBtn: false,
|
addBtn: false,
|
||||||
viewBtn: false,
|
viewBtn: false,
|
||||||
editBtn: false,
|
editBtn: false,
|
||||||
delBtn: false,
|
delBtn: false,
|
||||||
|
// 隐藏 Avue 默认取消按钮,改由 menu-form-before 按「取消、保存、提交」顺序自定义
|
||||||
|
cancelBtn: false,
|
||||||
menuWidth: 320,
|
menuWidth: 320,
|
||||||
column: (option.column || []).map(column => ({ ...column })),
|
column: columns.map(col => {
|
||||||
|
if (!formSectionProps.has(col.prop)) return col;
|
||||||
|
return {
|
||||||
|
...col,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
group: formGroups.map(group => ({
|
||||||
|
label: '',
|
||||||
|
arrow: false,
|
||||||
|
column: group,
|
||||||
|
})),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
@@ -451,6 +568,32 @@ export default {
|
|||||||
.then(res => this.applyDetail(res.data?.data || {}))
|
.then(res => this.applyDetail(res.data?.data || {}))
|
||||||
.finally(done);
|
.finally(done);
|
||||||
},
|
},
|
||||||
|
openDetail(row) {
|
||||||
|
this.detailVisible = true;
|
||||||
|
this.detailLoading = true;
|
||||||
|
this.detailRow = { ...row };
|
||||||
|
this.attachmentRows = [];
|
||||||
|
this.selectedAttachments = [];
|
||||||
|
this.api
|
||||||
|
.getDetail(row.id)
|
||||||
|
.then(res => {
|
||||||
|
const detail = res.data?.data || {};
|
||||||
|
this.detailRow = { ...detail };
|
||||||
|
this.attachmentRows = this.parseJsonArray(detail.attachmentsJson);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.detailLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
formatDetailValue(prop) {
|
||||||
|
const row = this.detailRow || {};
|
||||||
|
if (prop === 'approvalStatus') {
|
||||||
|
return this.displayStatus(row, 'approvalStatus');
|
||||||
|
}
|
||||||
|
const value = row[prop];
|
||||||
|
if (value === undefined || value === null || value === '') return '-';
|
||||||
|
return value;
|
||||||
|
},
|
||||||
applyDetail(detail) {
|
applyDetail(detail) {
|
||||||
this.form = { ...detail };
|
this.form = { ...detail };
|
||||||
this.selectedProjectId = detail.projectId || '';
|
this.selectedProjectId = detail.projectId || '';
|
||||||
@@ -459,9 +602,10 @@ export default {
|
|||||||
this.syncCurrentProjectOption();
|
this.syncCurrentProjectOption();
|
||||||
},
|
},
|
||||||
normalizeForm(row = this.form) {
|
normalizeForm(row = this.form) {
|
||||||
|
const { projectQuotaInfoTitle, temporaryCreditInfoTitle, ...payload } = row || {};
|
||||||
return {
|
return {
|
||||||
...row,
|
...payload,
|
||||||
applyLimit: row.applyLimit === '' ? '' : Number(row.applyLimit),
|
applyLimit: payload.applyLimit === '' ? '' : Number(payload.applyLimit),
|
||||||
attachmentsJson: JSON.stringify(this.attachmentRows),
|
attachmentsJson: JSON.stringify(this.attachmentRows),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -492,13 +636,20 @@ export default {
|
|||||||
.saveDraft(this.normalizeForm())
|
.saveDraft(this.normalizeForm())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$message.success('保存成功');
|
this.$message.success('保存成功');
|
||||||
this.$refs.crud?.closeDialog();
|
this.closeFormDialog();
|
||||||
this.onLoad(this.page, this.query);
|
this.onLoad(this.page, this.query);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.draftLoading = false;
|
this.draftLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
closeFormDialog() {
|
||||||
|
if (typeof this.$refs.crud?.closeDialog === 'function') {
|
||||||
|
this.$refs.crud.closeDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$refs.crud?.$refs?.dialogForm?.hide?.();
|
||||||
|
},
|
||||||
rowDel(row) {
|
rowDel(row) {
|
||||||
this.removeRows([row]);
|
this.removeRows([row]);
|
||||||
},
|
},
|
||||||
@@ -824,7 +975,6 @@ export default {
|
|||||||
.el-form-item__label {
|
.el-form-item__label {
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
//padding-top: 7px; // 视觉补偿:让单行 label 仍接近 input 中线
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 强制必填星号垂直居中于行盒,与第一行汉字字符中心同基线(关键)
|
// 强制必填星号垂直居中于行盒,与第一行汉字字符中心同基线(关键)
|
||||||
@@ -832,19 +982,257 @@ export default {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
vertical-align: middle; // 关键:相对 baseline 上移,与汉字字符中心对齐
|
vertical-align: middle;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 「项目额度信息 / 临时额度信息」小标题:对齐项目管理「项目基本信息」样式
|
||||||
|
.avue-form__group:has(.dialog-section-title) {
|
||||||
|
.dialog-section-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 14px 16px 4px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
color: #303133;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avue-form__group--flex:has(.dialog-section-title),
|
||||||
|
.el-form-item:has(.dialog-section-title) {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item:has(.dialog-section-title) .el-form-item__content {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分组白卡:Avue 实际结构为 .avue-form > .el-form > .el-row > .avue-group
|
||||||
|
.avue-form {
|
||||||
|
background: transparent !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
min-height: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avue-form > .el-form > .el-row {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
margin-right: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 无分区标题的空分组(Avue 主列残留)隐藏,去掉顶部白横条
|
||||||
|
.avue-form > .el-form > .el-row > .avue-group:not(:has(.dialog-section-title)) {
|
||||||
|
display: none !important;
|
||||||
|
height: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 有分区标题的分组渲染为独立白卡
|
||||||
|
.avue-form > .el-form > .el-row > .avue-group:has(.dialog-section-title) {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
|
||||||
|
margin-bottom: 12px;
|
||||||
|
padding: 0 0 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avue-form > .el-form > .el-row > .avue-group:has(.dialog-section-title):last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avue-group .el-collapse {
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avue-group .el-collapse-item__header {
|
||||||
|
display: none !important;
|
||||||
|
height: 0 !important;
|
||||||
|
min-height: 0 !important;
|
||||||
|
line-height: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
border: none !important;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avue-group .avue-group__header {
|
||||||
|
display: none !important;
|
||||||
|
height: 0 !important;
|
||||||
|
min-height: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avue-group .el-collapse-item__wrap {
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avue-group .el-collapse-item__content {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 卡片视觉由外层 avue-group 承担,内层去白底,避免叠卡/顶条
|
||||||
|
.avue-group .avue-form__group {
|
||||||
|
display: flex !important;
|
||||||
|
background: transparent !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.temporary-credit-limit-dialog .business-crud-page__detail-content .el-descriptions__label {
|
.temporary-credit-limit-dialog .business-crud-page__detail-content .el-descriptions__label {
|
||||||
width: 180px !important;
|
width: 180px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 新增/编辑/查看:高度随内容自适应,超出时再滚动;去掉强制全屏导致的底部大片空白
|
||||||
|
.temporary-credit-limit-dialog.el-dialog {
|
||||||
|
margin-top: 20px !important;
|
||||||
|
margin-bottom: 20px !important;
|
||||||
|
height: auto !important;
|
||||||
|
max-height: calc(100vh - 40px) !important;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temporary-credit-limit-dialog .el-dialog__header {
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temporary-credit-limit-dialog .el-dialog__body {
|
||||||
|
flex: 0 1 auto;
|
||||||
|
min-height: 0;
|
||||||
|
max-height: calc(100vh - 140px) !important;
|
||||||
|
display: block;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 覆盖全局 .el-dialog .avue-form 白底内边距,避免顶部出现白横条
|
||||||
|
.temporary-credit-limit-dialog:not(.temporary-credit-limit-detail-dialog) .avue-form {
|
||||||
|
background: transparent !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temporary-credit-limit-dialog:not(.temporary-credit-limit-detail-dialog) .avue-dialog__footer,
|
||||||
|
.temporary-credit-limit-detail-dialog .el-dialog__footer {
|
||||||
|
position: sticky;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 5;
|
||||||
|
flex: none;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 12px;
|
||||||
|
margin-top: 0 !important;
|
||||||
|
padding: 12px 20px !important;
|
||||||
|
background: #fff;
|
||||||
|
border-top: 1px solid var(--el-border-color-lighter, #ebeef5) !important;
|
||||||
|
border-radius: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
|
.el-button + .el-button {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.temporary-credit-limit-detail-dialog {
|
||||||
|
.business-crud-page__detail-content {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-height: 0;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__section {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
padding: 0 0 4px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__descriptions {
|
||||||
|
padding: 0 16px 8px;
|
||||||
|
|
||||||
|
// 取消 Descriptions 表格边框样式,改为纯文本描述列表
|
||||||
|
.el-descriptions__body {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-descriptions__table {
|
||||||
|
border-collapse: separate;
|
||||||
|
border-spacing: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-descriptions__cell {
|
||||||
|
border: none !important;
|
||||||
|
background: transparent !important;
|
||||||
|
padding: 8px 12px 8px 0;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-descriptions__label {
|
||||||
|
color: #606266;
|
||||||
|
font-weight: 400;
|
||||||
|
white-space: normal;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-descriptions__content {
|
||||||
|
color: #303133;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-section-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 14px 16px 4px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
color: #303133;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__attachment {
|
||||||
|
padding: 8px 16px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__attachment-label {
|
||||||
|
color: #606266;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temporary-credit-limit-page__attachment-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.el-form-item--default .el-form-item__label {
|
.el-form-item--default .el-form-item__label {
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
}
|
}
|
||||||
.el-dialog .avue-form{
|
|
||||||
padding: 16px 16px 4px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<el-table-column prop="processStatus" label="处理状态" width="130" />
|
<el-table-column prop="processStatus" label="处理状态" width="130" />
|
||||||
<el-table-column prop="createTime" label="创建时间" min-width="180" />
|
<el-table-column prop="createTime" label="创建时间" min-width="180" />
|
||||||
<el-table-column prop="updateTime" label="更新时间" min-width="180" />
|
<el-table-column prop="updateTime" label="更新时间" min-width="180" />
|
||||||
<el-table-column label="操作" width="220" fixed="right"><template #default="{ row }"><div class="voucher-folder-page__actions"><el-link v-if="row.matched !== 1" type="primary" @click="openReplace(row)">单个上传</el-link><el-link type="primary" @click="openViewer(row)">查看</el-link><el-link type="danger" @click="removeFolder(row)">删除</el-link></div></template></el-table-column>
|
<el-table-column label="操作" width="220" fixed="right"><template #default="{ row }"><div class="voucher-folder-page__actions"><el-link v-if="isSuperAdmin && row.matched !== 1" type="primary" @click="openReplace(row)">单个上传</el-link><el-link type="primary" @click="openViewer(row)">查看</el-link><el-link type="danger" @click="removeFolder(row)">删除</el-link></div></template></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="voucher-folder-page__pagination"><el-pagination v-model:current-page="page.current" v-model:page-size="page.size" :total="page.total" :page-sizes="[10, 20, 50]" layout="total, prev, pager, next, sizes" @current-change="load" @size-change="load" /></div>
|
<div class="voucher-folder-page__pagination"><el-pagination v-model:current-page="page.current" v-model:page-size="page.size" :total="page.total" :page-sizes="[10, 20, 50]" layout="total, prev, pager, next, sizes" @current-change="load" @size-change="load" /></div>
|
||||||
</section>
|
</section>
|
||||||
@@ -39,15 +39,23 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { computed, onMounted, reactive, ref } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
import { useStore } from 'vuex';
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
import * as api from '@/api/business/voucher-manage';
|
import * as api from '@/api/business/voucher-manage';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const store = useStore();
|
||||||
const voucherId = route.query.id;
|
const voucherId = route.query.id;
|
||||||
|
const isSuperAdmin = computed(() => {
|
||||||
|
const authority = store.getters.userInfo?.authority;
|
||||||
|
return Array.isArray(authority)
|
||||||
|
? authority.includes('admin')
|
||||||
|
: String(authority || '').includes('admin');
|
||||||
|
});
|
||||||
const loading = ref(false), rows = ref([]), voucher = ref({ voucherBatchNo: route.query.batchNo || '' });
|
const loading = ref(false), rows = ref([]), voucher = ref({ voucherBatchNo: route.query.batchNo || '' });
|
||||||
const page = reactive({ current: 1, size: 10, total: 0 });
|
const page = reactive({ current: 1, size: 10, total: 0 });
|
||||||
const query = reactive({ plateNo: '', matched: undefined });
|
const query = reactive({ plateNo: '', matched: undefined });
|
||||||
|
|||||||
@@ -90,9 +90,9 @@
|
|||||||
width="100"
|
width="100"
|
||||||
/><el-table-column
|
/><el-table-column
|
||||||
prop="relatedWaybillCount"
|
prop="relatedWaybillCount"
|
||||||
label="已关联运单"
|
label="凭证已关联数量"
|
||||||
width="115"
|
width="125"
|
||||||
/><el-table-column prop="unRelatedWaybillCount" label="未关联运单" width="115" />
|
/><el-table-column prop="unRelatedWaybillCount" label="凭证未关联数量" width="125" />
|
||||||
<el-table-column prop="createTime" label="创建时间" min-width="170" />
|
<el-table-column prop="createTime" label="创建时间" min-width="170" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="auditStatus"
|
prop="auditStatus"
|
||||||
@@ -100,7 +100,16 @@
|
|||||||
width="120"
|
width="120"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
align="center"
|
align="center"
|
||||||
/><el-table-column label="操作" width="320" fixed="right" align="left"
|
><template #default="{ row }"
|
||||||
|
><span class="voucher-manage-page__audit-status"
|
||||||
|
><span>{{ row.auditStatus }}</span
|
||||||
|
><el-tooltip
|
||||||
|
v-if="row.auditStatus === '审核驳回' && hasRejectReason(row)"
|
||||||
|
:content="row.rejectReason"
|
||||||
|
placement="top"
|
||||||
|
><el-icon class="voucher-manage-page__audit-reject-icon"><WarnTriangleFilled /></el-icon
|
||||||
|
></el-tooltip></span></template
|
||||||
|
></el-table-column><el-table-column label="操作" width="320" fixed="right" align="center"
|
||||||
><template #default="{ row }"
|
><template #default="{ row }"
|
||||||
><div class="voucher-manage-page__actions">
|
><div class="voucher-manage-page__actions">
|
||||||
<el-link
|
<el-link
|
||||||
@@ -128,12 +137,12 @@
|
|||||||
><el-link
|
><el-link
|
||||||
v-if="row.auditStatus === '审核驳回'"
|
v-if="row.auditStatus === '审核驳回'"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openUpload(row, 'changeBatch')"
|
@click="openBatchDialog(row)"
|
||||||
>更换运单批次</el-link
|
>更换运单批次</el-link
|
||||||
><el-link
|
><el-link
|
||||||
v-if="row.processStatus !== '处理完成' || row.auditStatus === '待审核'"
|
v-if="(row.processStatus !== '处理完成' || row.auditStatus === '待审核') && row.auditStatus !== '审核驳回'"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openUpload(row)"
|
@click="openBatchDialog(row)"
|
||||||
>更换运单批次</el-link
|
>更换运单批次</el-link
|
||||||
><el-link
|
><el-link
|
||||||
v-if="row.processStatus === '上传中' || row.auditStatus === '审核驳回'"
|
v-if="row.processStatus === '上传中' || row.auditStatus === '审核驳回'"
|
||||||
@@ -270,7 +279,7 @@
|
|||||||
class="voucher-manage-page__upload-progress"
|
class="voucher-manage-page__upload-progress"
|
||||||
/></el-form-item>
|
/></el-form-item>
|
||||||
<el-form-item label="关联运输批次" prop="waybillImportBatchIds"
|
<el-form-item label="关联运输批次" prop="waybillImportBatchIds"
|
||||||
><el-button type="primary" @click="openBatchDialog">选择</el-button></el-form-item
|
><el-button type="primary" @click="openBatchDialog()">选择</el-button></el-form-item
|
||||||
>
|
>
|
||||||
</el-form>
|
</el-form>
|
||||||
</section-card>
|
</section-card>
|
||||||
@@ -328,7 +337,11 @@
|
|||||||
placeholder="请输入" /></el-form-item></el-col
|
placeholder="请输入" /></el-form-item></el-col
|
||||||
><el-col :span="12"
|
><el-col :span="12"
|
||||||
><el-form-item label="运单数"
|
><el-form-item label="运单数"
|
||||||
><el-input-number v-model="batchQuery.waybillCount" :min="0" /></el-form-item></el-col
|
><el-input
|
||||||
|
v-model="batchQuery.waybillCount"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入"
|
||||||
|
@input="handleWaybillCountInput" /></el-form-item></el-col
|
||||||
></el-row>
|
></el-row>
|
||||||
<div class="voucher-manage-page__search-actions">
|
<div class="voucher-manage-page__search-actions">
|
||||||
<el-button type="primary" @click="loadBatches">查询</el-button
|
<el-button type="primary" @click="loadBatches">查询</el-button
|
||||||
@@ -373,7 +386,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer
|
<template #footer
|
||||||
><el-button @click="batchVisible = false">取消</el-button
|
><el-button @click="batchVisible = false">取消</el-button
|
||||||
><el-button type="primary" @click="confirmBatches">确认</el-button></template
|
><el-button type="primary" :loading="batchSaving" @click="confirmBatches">确认</el-button></template
|
||||||
>
|
>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@@ -484,6 +497,7 @@ import { useRouter } from 'vue-router';
|
|||||||
import { useStore } from 'vuex';
|
import { useStore } from 'vuex';
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
|
import { WarnTriangleFilled } from '@element-plus/icons-vue';
|
||||||
import { getList as getProjectList } from '@/api/business/project-apply';
|
import { getList as getProjectList } from '@/api/business/project-apply';
|
||||||
import * as api from '@/api/business/voucher-manage';
|
import * as api from '@/api/business/voucher-manage';
|
||||||
import SectionCard from '@/components/section-card/main.vue';
|
import SectionCard from '@/components/section-card/main.vue';
|
||||||
@@ -499,6 +513,12 @@ const hasPermission = code => {
|
|||||||
if (isAdmin.value) return true;
|
if (isAdmin.value) return true;
|
||||||
return permission.value?.[code] === true;
|
return permission.value?.[code] === true;
|
||||||
};
|
};
|
||||||
|
const hasRejectReason = row => {
|
||||||
|
const reason = row?.rejectReason;
|
||||||
|
return typeof reason === 'string'
|
||||||
|
? reason.trim().length > 0
|
||||||
|
: reason !== undefined && reason !== null;
|
||||||
|
};
|
||||||
|
|
||||||
// 判断当前用户是否为承运商(顶级组织是否为"外部组织")
|
// 判断当前用户是否为承运商(顶级组织是否为"外部组织")
|
||||||
const isCarrier = ref(false);
|
const isCarrier = ref(false);
|
||||||
@@ -521,6 +541,9 @@ const loading = ref(false),
|
|||||||
detailRow = ref({}),
|
detailRow = ref({}),
|
||||||
uploadVisible = ref(false),
|
uploadVisible = ref(false),
|
||||||
batchVisible = ref(false),
|
batchVisible = ref(false),
|
||||||
|
batchDialogMode = ref('upload'),
|
||||||
|
batchTarget = ref(),
|
||||||
|
batchSaving = ref(false),
|
||||||
progressVisible = ref(false),
|
progressVisible = ref(false),
|
||||||
uploadFormRef = ref(),
|
uploadFormRef = ref(),
|
||||||
uploading = ref(false),
|
uploading = ref(false),
|
||||||
@@ -862,9 +885,18 @@ watch(uploadVisible, visible => {
|
|||||||
// 兜底处理:右上角、遮罩、Esc 直接修改 v-model 时仍必须停止上传。
|
// 兜底处理:右上角、遮罩、Esc 直接修改 v-model 时仍必须停止上传。
|
||||||
if (!visible && !closingUploadDialog.value) void stopCurrentUpload(editing.fileTaskId);
|
if (!visible && !closingUploadDialog.value) void stopCurrentUpload(editing.fileTaskId);
|
||||||
});
|
});
|
||||||
const openBatchDialog = async () => {
|
const openBatchDialog = async row => {
|
||||||
|
// 按钮 @click 会传入 MouseEvent,不能把事件对象当成凭证行。
|
||||||
|
const voucher = row instanceof Event ? undefined : row;
|
||||||
|
batchDialogMode.value = voucher?.id ? 'change' : 'upload';
|
||||||
|
batchTarget.value = voucher?.id ? voucher : undefined;
|
||||||
|
batchSelection.value = [];
|
||||||
batchVisible.value = true;
|
batchVisible.value = true;
|
||||||
await loadBatches();
|
await loadBatches();
|
||||||
|
if (voucher?.waybillBatchNo) {
|
||||||
|
const currentBatch = batchRows.value.find(item => item.batchNo === voucher.waybillBatchNo);
|
||||||
|
if (currentBatch) batchSelection.value = [currentBatch];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const loadBatches = async () => {
|
const loadBatches = async () => {
|
||||||
const res = await api.getWaybillBatches(batchPage.current, batchPage.size, {
|
const res = await api.getWaybillBatches(batchPage.current, batchPage.size, {
|
||||||
@@ -878,13 +910,56 @@ const loadBatches = async () => {
|
|||||||
batchRows.value = data.records || [];
|
batchRows.value = data.records || [];
|
||||||
batchPage.total = data.total || 0;
|
batchPage.total = data.total || 0;
|
||||||
};
|
};
|
||||||
|
const handleWaybillCountInput = value => {
|
||||||
|
// 只允许输入正整数
|
||||||
|
const filtered = value.replace(/[^\d]/g, '');
|
||||||
|
if (filtered !== value) {
|
||||||
|
batchQuery.waybillCount = filtered;
|
||||||
|
}
|
||||||
|
// 移除前导零
|
||||||
|
if (filtered.length > 1 && filtered.startsWith('0')) {
|
||||||
|
batchQuery.waybillCount = filtered.replace(/^0+/, '');
|
||||||
|
}
|
||||||
|
};
|
||||||
const resetBatchQuery = () => {
|
const resetBatchQuery = () => {
|
||||||
Object.assign(batchQuery, { batchNo: '', createUser: '', waybillCount: undefined });
|
Object.assign(batchQuery, { batchNo: '', createUser: '', waybillCount: undefined });
|
||||||
batchCreateRange.value = [];
|
batchCreateRange.value = [];
|
||||||
batchPage.current = 1;
|
batchPage.current = 1;
|
||||||
loadBatches();
|
loadBatches();
|
||||||
};
|
};
|
||||||
const selectBatch = row => {
|
const updateWaybillBatch = async (target, selected) => {
|
||||||
|
if (!target?.id) {
|
||||||
|
ElMessage.error('缺少凭证批次信息');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!selected?.batchNo) {
|
||||||
|
ElMessage.warning('请选择运单批次');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
batchSaving.value = true;
|
||||||
|
try {
|
||||||
|
await api.changeWaybillBatch({
|
||||||
|
voucherId: target.id,
|
||||||
|
waybillImportBatchIds: [selected.id],
|
||||||
|
});
|
||||||
|
target.waybillBatchNo = selected.batchNo;
|
||||||
|
batchVisible.value = false;
|
||||||
|
ElMessage.success('运单批次更换成功,已提交重新匹配任务');
|
||||||
|
await load();
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error(error.message || '运单批次更换失败');
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
batchSaving.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const selectBatch = async row => {
|
||||||
|
if (batchDialogMode.value === 'change') {
|
||||||
|
batchSelection.value = [row];
|
||||||
|
await updateWaybillBatch(batchTarget.value, row);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const batches = new Map();
|
const batches = new Map();
|
||||||
selectedBatches.value.forEach(item => {
|
selectedBatches.value.forEach(item => {
|
||||||
if (!batches.has(item.batchNo)) batches.set(item.batchNo, item);
|
if (!batches.has(item.batchNo)) batches.set(item.batchNo, item);
|
||||||
@@ -894,7 +969,12 @@ const selectBatch = row => {
|
|||||||
editing.waybillImportBatchIds = selectedBatches.value.map(item => item.id);
|
editing.waybillImportBatchIds = selectedBatches.value.map(item => item.id);
|
||||||
batchVisible.value = false;
|
batchVisible.value = false;
|
||||||
};
|
};
|
||||||
const confirmBatches = () => {
|
const confirmBatches = async () => {
|
||||||
|
if (batchDialogMode.value === 'change') {
|
||||||
|
const selected = batchSelection.value[0];
|
||||||
|
await updateWaybillBatch(batchTarget.value, selected);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const batches = new Map();
|
const batches = new Map();
|
||||||
batchSelection.value.forEach(item => {
|
batchSelection.value.forEach(item => {
|
||||||
if (!batches.has(item.batchNo)) batches.set(item.batchNo, item);
|
if (!batches.has(item.batchNo)) batches.set(item.batchNo, item);
|
||||||
@@ -1240,9 +1320,19 @@ load();
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
min-height: auto;
|
min-height: auto;
|
||||||
}
|
}
|
||||||
|
&__audit-status {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
&__audit-reject-icon {
|
||||||
|
margin-left: 4px;
|
||||||
|
color: #f56c6c;
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
&__actions {
|
&__actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
gap: 2px 12px;
|
gap: 2px 12px;
|
||||||
}
|
}
|
||||||
&__pagination {
|
&__pagination {
|
||||||
|
|||||||
@@ -953,7 +953,10 @@ export default {
|
|||||||
this.receiverInvoiceOptions = Array.isArray(invoiceInfos) ? invoiceInfos : [];
|
this.receiverInvoiceOptions = Array.isArray(invoiceInfos) ? invoiceInfos : [];
|
||||||
this.contactOptions = data.contacts || [];
|
this.contactOptions = data.contacts || [];
|
||||||
const invoiceInfoEmails = [
|
const invoiceInfoEmails = [
|
||||||
...this.receiverInvoiceOptions.flatMap(item => this.parseEmails(item.email)),
|
...this.receiverInvoiceOptions.flatMap(item => [
|
||||||
|
...this.parseEmails(item.email),
|
||||||
|
...(item.contacts || []).flatMap(contact => this.parseEmails(contact.email)),
|
||||||
|
]),
|
||||||
];
|
];
|
||||||
this.departmentEmailOptions = invoiceInfoEmails.filter(Boolean).reduce((emails, email) => {
|
this.departmentEmailOptions = invoiceInfoEmails.filter(Boolean).reduce((emails, email) => {
|
||||||
if (!emails.some(item => item.toLowerCase() === email.toLowerCase())) emails.push(email);
|
if (!emails.some(item => item.toLowerCase() === email.toLowerCase())) emails.push(email);
|
||||||
@@ -989,14 +992,19 @@ export default {
|
|||||||
handleReceiverChange(id) {
|
handleReceiverChange(id) {
|
||||||
const info = this.receiverInvoiceOptions.find(item => String(item.id) === String(id));
|
const info = this.receiverInvoiceOptions.find(item => String(item.id) === String(id));
|
||||||
if (!info) return;
|
if (!info) return;
|
||||||
|
const invoiceContact = (info.contacts || []).find(item => item.contactName || item.email) || {};
|
||||||
Object.assign(this.form, {
|
Object.assign(this.form, {
|
||||||
receiverName: info.invoiceTitle,
|
receiverName: info.invoiceTitle,
|
||||||
taxpayerNo: info.taxNo,
|
taxpayerNo: info.taxNo,
|
||||||
bankName: info.bankName,
|
bankName: info.bankName,
|
||||||
bankAccount: info.bankAccount,
|
bankAccount: info.bankAccount,
|
||||||
registeredAddress: info.registeredAddress,
|
registeredAddress: info.registeredAddress,
|
||||||
email: info.email || '',
|
email: invoiceContact.email || '',
|
||||||
});
|
});
|
||||||
|
if (invoiceContact.contactName) {
|
||||||
|
this.form.contactName = invoiceContact.contactName;
|
||||||
|
this.form.contactPhone = invoiceContact.contactPhone || '';
|
||||||
|
}
|
||||||
this.handleInvoiceTypeChange();
|
this.handleInvoiceTypeChange();
|
||||||
},
|
},
|
||||||
handleContactChange(name) {
|
handleContactChange(name) {
|
||||||
|
|||||||
@@ -84,6 +84,13 @@
|
|||||||
@click="handleSync"
|
@click="handleSync"
|
||||||
>批量同步</el-button
|
>批量同步</el-button
|
||||||
>
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="hasPermission('payment_application_sync')"
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="handleSyncResult"
|
||||||
|
>同步付款结果</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="hasPermission('payment_application_add')"
|
v-if="hasPermission('payment_application_add')"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -396,8 +403,22 @@ export default {
|
|||||||
this.$message.warning('请选择至少一条审批通过的付款申请');
|
this.$message.warning('请选择至少一条审批通过的付款申请');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await api.syncKingdeeBatch(rows.map(row => row.id));
|
const data = this.unwrapData(await api.syncKingdeeBatch(rows.map(row => row.id))) || [];
|
||||||
this.$message.success(`已同步${rows.length}条付款申请`);
|
const failedList = data.filter(item => String(item).includes('同步失败'));
|
||||||
|
if (failedList.length) {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: `同步完成:成功${data.length - failedList.length}条,失败${failedList.length}条。${failedList.join(';')}`,
|
||||||
|
duration: 8000,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.success(`已同步${data.length}条付款申请`);
|
||||||
|
}
|
||||||
|
this.loadTable();
|
||||||
|
},
|
||||||
|
async handleSyncResult() {
|
||||||
|
const data = this.unwrapData(await api.syncKingdeeResult());
|
||||||
|
this.$message.success(data || '金蝶付款结果回写完成');
|
||||||
this.loadTable();
|
this.loadTable();
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
type="date"
|
type="date"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
|
@change="fetchBfiExchangeRate"
|
||||||
/>
|
/>
|
||||||
<el-select
|
<el-select
|
||||||
v-else-if="field.type === 'project' && editable"
|
v-else-if="field.type === 'project' && editable"
|
||||||
@@ -947,6 +948,7 @@ import {
|
|||||||
getDetailFees as getPreSettlementDetailFees,
|
getDetailFees as getPreSettlementDetailFees,
|
||||||
} from '@/api/settlement/preSettlement';
|
} from '@/api/settlement/preSettlement';
|
||||||
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
|
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
|
||||||
|
import { getBfiExchangeRate } from '@/api/base/currency';
|
||||||
import {
|
import {
|
||||||
createFormalSettlementForm,
|
createFormalSettlementForm,
|
||||||
formalSettlementFormFields,
|
formalSettlementFormFields,
|
||||||
@@ -1199,9 +1201,7 @@ export default {
|
|||||||
this.selectedAttachmentRows = [];
|
this.selectedAttachmentRows = [];
|
||||||
this.invoices = data.invoices || [];
|
this.invoices = data.invoices || [];
|
||||||
this.sortAttachments();
|
this.sortAttachments();
|
||||||
this.contracts = this.allContracts.filter(
|
this.contracts = this.filterContracts(this.allContracts, this.form.projectId);
|
||||||
item => String(item.projectId) === String(this.form.projectId)
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
async initialize() {
|
async initialize() {
|
||||||
const newRecordAudit = this.recordId
|
const newRecordAudit = this.recordId
|
||||||
@@ -1211,6 +1211,11 @@ export default {
|
|||||||
createTime: this.$dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
createTime: this.$dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
};
|
};
|
||||||
this.form = createFormalSettlementForm();
|
this.form = createFormalSettlementForm();
|
||||||
|
if (['receivable', 'payable'].includes(this.initialData?.settlementType)) {
|
||||||
|
this.form.settlementType = this.initialData.settlementType;
|
||||||
|
this.form.settlementTypeName =
|
||||||
|
this.initialData.settlementType === 'receivable' ? '应收' : '应付';
|
||||||
|
}
|
||||||
if (newRecordAudit) Object.assign(this.form, newRecordAudit);
|
if (newRecordAudit) Object.assign(this.form, newRecordAudit);
|
||||||
this.sources = [];
|
this.sources = [];
|
||||||
this.details = [];
|
this.details = [];
|
||||||
@@ -1247,6 +1252,7 @@ export default {
|
|||||||
if (this.initialData) await this.applyInitialData();
|
if (this.initialData) await this.applyInitialData();
|
||||||
Object.assign(this.form, newRecordAudit);
|
Object.assign(this.form, newRecordAudit);
|
||||||
await this.refreshFormalSettlementNo();
|
await this.refreshFormalSettlementNo();
|
||||||
|
await this.fetchBfiExchangeRate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@@ -1276,7 +1282,7 @@ export default {
|
|||||||
if (!rows.length) return;
|
if (!rows.length) return;
|
||||||
const first = rows[0];
|
const first = rows[0];
|
||||||
const settlementType = this.initialData.settlementType || first.settlementType || 'payable';
|
const settlementType = this.initialData.settlementType || first.settlementType || 'payable';
|
||||||
const matchedContract = this.allContracts.find(
|
const matchedContract = this.filterContracts(this.allContracts, null, settlementType).find(
|
||||||
item =>
|
item =>
|
||||||
(first.contractId && String(item.id) === String(first.contractId)) ||
|
(first.contractId && String(item.id) === String(first.contractId)) ||
|
||||||
(first.contractNo && String(item.contractNo) === String(first.contractNo))
|
(first.contractNo && String(item.contractNo) === String(first.contractNo))
|
||||||
@@ -1284,9 +1290,7 @@ export default {
|
|||||||
const contractId = first.contractId || matchedContract?.id || null;
|
const contractId = first.contractId || matchedContract?.id || null;
|
||||||
const projectId = first.projectId || matchedContract?.projectId || null;
|
const projectId = first.projectId || matchedContract?.projectId || null;
|
||||||
const projectName = first.projectName || matchedContract?.projectName || '';
|
const projectName = first.projectName || matchedContract?.projectName || '';
|
||||||
this.contracts = this.allContracts.filter(
|
this.contracts = this.filterContracts(this.allContracts, projectId, settlementType);
|
||||||
item => projectId && String(item.projectId) === String(projectId)
|
|
||||||
);
|
|
||||||
if (projectId && !this.projects.some(item => String(item.id) === String(projectId))) {
|
if (projectId && !this.projects.some(item => String(item.id) === String(projectId))) {
|
||||||
this.projects.push({ id: projectId, name: projectName });
|
this.projects.push({ id: projectId, name: projectName });
|
||||||
}
|
}
|
||||||
@@ -1404,6 +1408,25 @@ export default {
|
|||||||
this.projects = [...projectMap.values()];
|
this.projects = [...projectMap.values()];
|
||||||
this.contracts = [];
|
this.contracts = [];
|
||||||
},
|
},
|
||||||
|
contractCategory(settlementType = this.form.settlementType) {
|
||||||
|
if (settlementType === 'receivable') return '客户合同';
|
||||||
|
if (settlementType === 'payable') return '承运商合同';
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
filterContracts(items, projectId, settlementType = this.form.settlementType) {
|
||||||
|
const category = this.contractCategory(settlementType);
|
||||||
|
return (items || []).filter(item => {
|
||||||
|
if (projectId && String(item.projectId) !== String(projectId)) return false;
|
||||||
|
if (!category) return true;
|
||||||
|
const itemCategory = String(item.contractCategory || '').trim();
|
||||||
|
if (itemCategory) return itemCategory === category;
|
||||||
|
const itemSettlementType = String(item.settlementType || '').trim();
|
||||||
|
return (
|
||||||
|
(category === '客户合同' && itemSettlementType === 'receivable') ||
|
||||||
|
(category === '承运商合同' && itemSettlementType === 'payable')
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
async loadContracts(keyword = '') {
|
async loadContracts(keyword = '') {
|
||||||
const projectId = this.form.projectId;
|
const projectId = this.form.projectId;
|
||||||
if (!projectId) {
|
if (!projectId) {
|
||||||
@@ -1412,7 +1435,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const response = await getContractOptions(keyword, projectId);
|
const response = await getContractOptions(keyword, projectId);
|
||||||
if (String(this.form.projectId) === String(projectId)) {
|
if (String(this.form.projectId) === String(projectId)) {
|
||||||
this.contracts = this.unwrapData(response) || [];
|
this.contracts = this.filterContracts(this.unwrapData(response), projectId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async loadFeeOptions() {
|
async loadFeeOptions() {
|
||||||
@@ -1444,16 +1467,25 @@ export default {
|
|||||||
const contract = this.contracts.find(item => String(item.id) === String(id));
|
const contract = this.contracts.find(item => String(item.id) === String(id));
|
||||||
if (!contract) return;
|
if (!contract) return;
|
||||||
const formalSettlementId = this.form.id;
|
const formalSettlementId = this.form.id;
|
||||||
|
const settlementType =
|
||||||
|
contract.settlementType ||
|
||||||
|
(contract.contractCategory === '客户合同'
|
||||||
|
? 'receivable'
|
||||||
|
: contract.contractCategory === '承运商合同'
|
||||||
|
? 'payable'
|
||||||
|
: this.form.settlementType);
|
||||||
Object.assign(this.form, contract, {
|
Object.assign(this.form, contract, {
|
||||||
id: formalSettlementId,
|
id: formalSettlementId,
|
||||||
contractId: contract.id,
|
contractId: contract.id,
|
||||||
payerName:
|
payerName:
|
||||||
contract.payerName ||
|
contract.payerName ||
|
||||||
(contract.settlementType === 'receivable' ? contract.partyB : contract.partyA),
|
(settlementType === 'receivable' ? contract.partyB : contract.partyA),
|
||||||
payeeName:
|
payeeName:
|
||||||
contract.payeeName ||
|
contract.payeeName ||
|
||||||
(contract.settlementType === 'receivable' ? contract.partyA : contract.partyB),
|
(settlementType === 'receivable' ? contract.partyA : contract.partyB),
|
||||||
settlementTypeName: contract.settlementType === 'receivable' ? '应收' : '应付',
|
settlementType,
|
||||||
|
settlementTypeName: settlementType === 'receivable' ? '应收' : '应付',
|
||||||
|
currency: contract.settlementCurrency || 'RMB',
|
||||||
});
|
});
|
||||||
this.sources = [];
|
this.sources = [];
|
||||||
this.details = [];
|
this.details = [];
|
||||||
@@ -1461,6 +1493,23 @@ export default {
|
|||||||
this.form.sourcePreSettlementIds = [];
|
this.form.sourcePreSettlementIds = [];
|
||||||
this.form.sourceDetailIds = [];
|
this.form.sourceDetailIds = [];
|
||||||
if (refreshSettlementNo) this.refreshFormalSettlementNo();
|
if (refreshSettlementNo) this.refreshFormalSettlementNo();
|
||||||
|
if (this.form.currency !== 'RMB') this.fetchBfiExchangeRate();
|
||||||
|
},
|
||||||
|
async fetchBfiExchangeRate() {
|
||||||
|
const currency = this.form.currency;
|
||||||
|
if (!currency || currency === 'RMB') return;
|
||||||
|
if (!this.form.exchangeRateDate) return;
|
||||||
|
try {
|
||||||
|
const { data } = await getBfiExchangeRate(currency, this.form.exchangeRateDate);
|
||||||
|
const rateData = data?.data;
|
||||||
|
if (rateData?.excval != null) {
|
||||||
|
this.form.exchangeRate = Number(rateData.excval);
|
||||||
|
} else {
|
||||||
|
this.$message.warning(`未查询到 ${currency} 的BFI汇率数据`);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.warning('查询BFI汇率失败,请手动输入结算汇率');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
openCandidateDialog() {
|
openCandidateDialog() {
|
||||||
this.candidate.visible = true;
|
this.candidate.visible = true;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
:disabled="!editable || form.currency === 'RMB'"
|
:disabled="!editable || form.currency === 'RMB'"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
@change="recalculateLocalAmount"
|
@change="handleExchangeRateDateChange"
|
||||||
/>
|
/>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-else-if="field.type === 'number'"
|
v-else-if="field.type === 'number'"
|
||||||
@@ -247,6 +247,9 @@
|
|||||||
>
|
>
|
||||||
{{ row[column.prop] }}
|
{{ row[column.prop] }}
|
||||||
</el-link>
|
</el-link>
|
||||||
|
<span v-else-if="column.money && column.prop === 'unitPrice'">
|
||||||
|
{{ formatUnitPrice(row) }}
|
||||||
|
</span>
|
||||||
<span v-else-if="column.money">
|
<span v-else-if="column.money">
|
||||||
{{ formatMoney(row[column.prop], row.currency || form.currency) }}
|
{{ formatMoney(row[column.prop], row.currency || form.currency) }}
|
||||||
</span>
|
</span>
|
||||||
@@ -259,6 +262,12 @@
|
|||||||
<span v-else-if="column.prop === 'transportType'">
|
<span v-else-if="column.prop === 'transportType'">
|
||||||
{{ transportTypeName(row[column.prop]) }}
|
{{ transportTypeName(row[column.prop]) }}
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else-if="column.prop === 'cargoName'">
|
||||||
|
{{ formatCargoNames(row) }}
|
||||||
|
</span>
|
||||||
|
<span v-else-if="column.prop === 'cargoType'">
|
||||||
|
{{ formatCargoTypes(row) }}
|
||||||
|
</span>
|
||||||
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -556,7 +565,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同类别">
|
<el-form-item label="合同类别">
|
||||||
<el-select v-model="contractDialog.query.contractCategory" clearable placeholder="请选择">
|
<el-select :model-value="contractDialogCategory" disabled placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in contractCategoryOptions"
|
v-for="item in contractCategoryOptions"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -925,6 +934,7 @@ import {
|
|||||||
submit,
|
submit,
|
||||||
} from '@/api/settlement/preSettlement';
|
} from '@/api/settlement/preSettlement';
|
||||||
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
|
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
|
||||||
|
import { getBfiExchangeRate } from '@/api/base/currency';
|
||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import {
|
import {
|
||||||
emptyPreSettlementForm,
|
emptyPreSettlementForm,
|
||||||
@@ -1018,7 +1028,7 @@ export default {
|
|||||||
contractName: '',
|
contractName: '',
|
||||||
projectName: '',
|
projectName: '',
|
||||||
organizationName: '',
|
organizationName: '',
|
||||||
contractCategory: '',
|
contractCategory: '承运商合同',
|
||||||
signType: '',
|
signType: '',
|
||||||
effectiveType: '',
|
effectiveType: '',
|
||||||
contractStage: '',
|
contractStage: '',
|
||||||
@@ -1078,6 +1088,7 @@ export default {
|
|||||||
adjustRows: [],
|
adjustRows: [],
|
||||||
pendingAdjustments: {},
|
pendingAdjustments: {},
|
||||||
sourceFeeSnapshots: {},
|
sourceFeeSnapshots: {},
|
||||||
|
detailFeeCache: {}, // 缓存每个明细的费用明细数据(用于拼接货物名称和类型)
|
||||||
adjustChangeRecordVisible: false,
|
adjustChangeRecordVisible: false,
|
||||||
adjustChangeRecord: null,
|
adjustChangeRecord: null,
|
||||||
adjustChangeRecordDetailRows: [],
|
adjustChangeRecordDetailRows: [],
|
||||||
@@ -1151,6 +1162,9 @@ export default {
|
|||||||
settlementTypeName() {
|
settlementTypeName() {
|
||||||
return this.form.settlementType === 'receivable' ? '应收' : '应付';
|
return this.form.settlementType === 'receivable' ? '应收' : '应付';
|
||||||
},
|
},
|
||||||
|
contractDialogCategory() {
|
||||||
|
return '承运商合同';
|
||||||
|
},
|
||||||
summaryTotal() {
|
summaryTotal() {
|
||||||
// 与结算合计表格的合计行保持一致:包含手工添加的费用与明细调整后的金额。
|
// 与结算合计表格的合计行保持一致:包含手工添加的费用与明细调整后的金额。
|
||||||
if (this.summaryFees.length) {
|
if (this.summaryFees.length) {
|
||||||
@@ -1169,6 +1183,19 @@ export default {
|
|||||||
});
|
});
|
||||||
return Array.from(names);
|
return Array.from(names);
|
||||||
},
|
},
|
||||||
|
// 按 preSettlementDetailId 分组的明细数据(用于拼接货物名称和类型)
|
||||||
|
groupedDetails() {
|
||||||
|
const groups = {};
|
||||||
|
this.details.forEach(detail => {
|
||||||
|
// 优先使用 sourceDetailId,如果没有则使用 preSettlementDetailId
|
||||||
|
const groupKey = detail.sourceDetailId || detail.preSettlementDetailId || detail.id;
|
||||||
|
if (!groups[groupKey]) {
|
||||||
|
groups[groupKey] = [];
|
||||||
|
}
|
||||||
|
groups[groupKey].push(detail);
|
||||||
|
});
|
||||||
|
return groups;
|
||||||
|
},
|
||||||
filteredDetails() {
|
filteredDetails() {
|
||||||
return this.details.filter(row =>
|
return this.details.filter(row =>
|
||||||
Object.entries(this.appliedDetailQuery).every(([field, keyword]) => {
|
Object.entries(this.appliedDetailQuery).every(([field, keyword]) => {
|
||||||
@@ -1216,7 +1243,11 @@ export default {
|
|||||||
await this.loadFeeCategoryOptions();
|
await this.loadFeeCategoryOptions();
|
||||||
await this.loadTransportTypeOptions();
|
await this.loadTransportTypeOptions();
|
||||||
if (this.recordId) await this.loadDetail();
|
if (this.recordId) await this.loadDetail();
|
||||||
else if (this.initialData) await this.applyInitialData();
|
else if (this.initialData) {
|
||||||
|
await this.applyInitialData();
|
||||||
|
this.form.exchangeRateDate = this.$dayjs().format('YYYY-MM-DD');
|
||||||
|
await this.fetchBfiExchangeRate();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async applyInitialData() {
|
async applyInitialData() {
|
||||||
const rows = Array.isArray(this.initialData?.rows) ? this.initialData.rows : [];
|
const rows = Array.isArray(this.initialData?.rows) ? this.initialData.rows : [];
|
||||||
@@ -1234,8 +1265,8 @@ export default {
|
|||||||
deptId: first.deptId,
|
deptId: first.deptId,
|
||||||
deptName: first.deptName,
|
deptName: first.deptName,
|
||||||
settlementType,
|
settlementType,
|
||||||
partyA: settlementType === 'receivable' ? first.payeeName : first.payerName,
|
partyA: first.payerName,
|
||||||
partyB: settlementType === 'receivable' ? first.payerName : first.payeeName,
|
partyB: first.payeeName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.handleContractChange(contractId);
|
this.handleContractChange(contractId);
|
||||||
@@ -1322,6 +1353,7 @@ export default {
|
|||||||
this.adjustRows = [];
|
this.adjustRows = [];
|
||||||
this.pendingAdjustments = {};
|
this.pendingAdjustments = {};
|
||||||
this.sourceFeeSnapshots = {};
|
this.sourceFeeSnapshots = {};
|
||||||
|
this.detailFeeCache = {};
|
||||||
this.adjustDialog.activeTab = 'adjust';
|
this.adjustDialog.activeTab = 'adjust';
|
||||||
this.adjustDialog.detailId = '';
|
this.adjustDialog.detailId = '';
|
||||||
this.adjustDialog.sourceDetailId = '';
|
this.adjustDialog.sourceDetailId = '';
|
||||||
@@ -1371,6 +1403,8 @@ export default {
|
|||||||
partyB: detail.payeeName,
|
partyB: detail.payeeName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 预加载所有明细的费用明细数据,用于拼接货物名称和类型
|
||||||
|
await this.loadAllDetailFees();
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
@@ -1389,7 +1423,10 @@ export default {
|
|||||||
const { data } = await getContractList(
|
const { data } = await getContractList(
|
||||||
this.contractDialog.page.current,
|
this.contractDialog.page.current,
|
||||||
this.contractDialog.page.size,
|
this.contractDialog.page.size,
|
||||||
{ ...this.contractDialog.query }
|
{
|
||||||
|
...this.contractDialog.query,
|
||||||
|
contractCategory: this.contractDialogCategory,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
const page = data?.data || {};
|
const page = data?.data || {};
|
||||||
this.contractDialog.rows = page.records || [];
|
this.contractDialog.rows = page.records || [];
|
||||||
@@ -1408,7 +1445,7 @@ export default {
|
|||||||
contractName: '',
|
contractName: '',
|
||||||
projectName: '',
|
projectName: '',
|
||||||
organizationName: '',
|
organizationName: '',
|
||||||
contractCategory: '',
|
contractCategory: this.contractDialogCategory,
|
||||||
signType: '',
|
signType: '',
|
||||||
effectiveType: '',
|
effectiveType: '',
|
||||||
contractStage: '',
|
contractStage: '',
|
||||||
@@ -1493,14 +1530,14 @@ export default {
|
|||||||
this.form.deptId = contract.deptId;
|
this.form.deptId = contract.deptId;
|
||||||
this.form.deptName = contract.deptName;
|
this.form.deptName = contract.deptName;
|
||||||
this.form.settlementType = contract.settlementType || 'payable';
|
this.form.settlementType = contract.settlementType || 'payable';
|
||||||
if (this.form.settlementType === 'receivable') {
|
this.form.payerName = contract.partyA;
|
||||||
this.form.payerName = contract.partyB;
|
this.form.payeeName = contract.partyB;
|
||||||
this.form.payeeName = contract.partyA;
|
this.form.currency = contract.settlementCurrency || 'RMB';
|
||||||
} else {
|
|
||||||
this.form.payerName = contract.partyA;
|
|
||||||
this.form.payeeName = contract.partyB;
|
|
||||||
}
|
|
||||||
this.summaryFees = [];
|
this.summaryFees = [];
|
||||||
|
if (this.form.currency !== 'RMB') {
|
||||||
|
this.form.exchangeRateDate = this.$dayjs().format('YYYY-MM-DD');
|
||||||
|
this.fetchBfiExchangeRate();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async saveDraft(shouldSubmit) {
|
async saveDraft(shouldSubmit) {
|
||||||
await this.$refs.formRef?.validate();
|
await this.$refs.formRef?.validate();
|
||||||
@@ -1767,6 +1804,26 @@ export default {
|
|||||||
.toFixed(2)
|
.toFixed(2)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
handleExchangeRateDateChange() {
|
||||||
|
this.fetchBfiExchangeRate();
|
||||||
|
this.recalculateLocalAmount();
|
||||||
|
},
|
||||||
|
async fetchBfiExchangeRate() {
|
||||||
|
if (!this.form.currency || this.form.currency === 'RMB') return;
|
||||||
|
if (!this.form.exchangeRateDate) return;
|
||||||
|
try {
|
||||||
|
const { data } = await getBfiExchangeRate(this.form.currency, this.form.exchangeRateDate);
|
||||||
|
const rateData = data?.data;
|
||||||
|
if (rateData?.excval != null) {
|
||||||
|
this.form.exchangeRate = Number(rateData.excval);
|
||||||
|
this.recalculateLocalAmount();
|
||||||
|
} else {
|
||||||
|
this.$message.warning(`未查询到 ${this.form.currency} 的BFI汇率数据`);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.warning('查询BFI汇率失败,请手动输入结算汇率');
|
||||||
|
}
|
||||||
|
},
|
||||||
recalculateLocalAmount() {
|
recalculateLocalAmount() {
|
||||||
const rate = this.form.currency === 'RMB' ? 1 : Number(this.form.exchangeRate || 0);
|
const rate = this.form.currency === 'RMB' ? 1 : Number(this.form.exchangeRate || 0);
|
||||||
this.form.localSettlementAmount = (Number(this.form.settlementAmount || 0) * rate).toFixed(2);
|
this.form.localSettlementAmount = (Number(this.form.settlementAmount || 0) * rate).toFixed(2);
|
||||||
@@ -1917,6 +1974,30 @@ export default {
|
|||||||
this.normalizeAdjustRow(item, data.feeItemNames || [])
|
this.normalizeAdjustRow(item, data.feeItemNames || [])
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
// 批量加载所有明细的费用明细数据,用于拼接货物名称和类型
|
||||||
|
async loadAllDetailFees() {
|
||||||
|
if (!this.details.length) return;
|
||||||
|
|
||||||
|
// 并发加载所有明细的费用数据
|
||||||
|
await Promise.all(
|
||||||
|
this.details.map(async detail => {
|
||||||
|
if (!detail.id) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await getDetailFees(detail.id);
|
||||||
|
const feeRows = response.data?.data || response.data || [];
|
||||||
|
|
||||||
|
// 缓存费用明细数据
|
||||||
|
if (Array.isArray(feeRows) && feeRows.length > 0) {
|
||||||
|
this.detailFeeCache[detail.id] = feeRows;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// 加载失败时使用明细本身的数据
|
||||||
|
console.warn(`加载明细 ${detail.id} 的费用数据失败:`, error);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
// 明细列表只有汇总金额,费用项级别的原始金额需要按来源明细单独拉取并缓存为调整基准。
|
// 明细列表只有汇总金额,费用项级别的原始金额需要按来源明细单独拉取并缓存为调整基准。
|
||||||
async ensureSourceFeeSnapshots() {
|
async ensureSourceFeeSnapshots() {
|
||||||
const targets = this.details.filter(row => {
|
const targets = this.details.filter(row => {
|
||||||
@@ -2461,6 +2542,65 @@ export default {
|
|||||||
if (!Number.isFinite(quantity)) return '-';
|
if (!Number.isFinite(quantity)) return '-';
|
||||||
return `${quantity.toFixed(2)}${row.quantityUnit ? ` ${row.quantityUnit}` : ''}`;
|
return `${quantity.toFixed(2)}${row.quantityUnit ? ` ${row.quantityUnit}` : ''}`;
|
||||||
},
|
},
|
||||||
|
// 拼接同一运单的货物名称
|
||||||
|
formatCargoNames(row) {
|
||||||
|
const detailId = row.id;
|
||||||
|
const feeRows = this.detailFeeCache[detailId] || [];
|
||||||
|
|
||||||
|
// 如果没有缓存数据或只有一条,返回原始值
|
||||||
|
if (feeRows.length <= 1) {
|
||||||
|
return this.displayValue(row.cargoName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收集所有货物名称并去重
|
||||||
|
const names = feeRows
|
||||||
|
.map(item => item.cargoName)
|
||||||
|
.filter(name => name && String(name).trim())
|
||||||
|
.filter((name, index, arr) => arr.indexOf(name) === index);
|
||||||
|
|
||||||
|
return names.length > 0 ? names.join('、') : this.displayValue(row.cargoName);
|
||||||
|
},
|
||||||
|
// 拼接同一运单的货物类型
|
||||||
|
formatCargoTypes(row) {
|
||||||
|
const detailId = row.id;
|
||||||
|
const feeRows = this.detailFeeCache[detailId] || [];
|
||||||
|
|
||||||
|
// 如果没有缓存数据或只有一条,返回原始值
|
||||||
|
if (feeRows.length <= 1) {
|
||||||
|
return this.displayValue(row.cargoType);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收集所有货物类型并去重
|
||||||
|
const types = feeRows
|
||||||
|
.map(item => item.cargoType)
|
||||||
|
.filter(type => type && String(type).trim())
|
||||||
|
.filter((type, index, arr) => arr.indexOf(type) === index);
|
||||||
|
|
||||||
|
return types.length > 0 ? types.join('、') : this.displayValue(row.cargoType);
|
||||||
|
},
|
||||||
|
// 格式化运输单价,如果多个货物的单价不一样则显示'-'
|
||||||
|
formatUnitPrice(row) {
|
||||||
|
const detailId = row.id;
|
||||||
|
const feeRows = this.detailFeeCache[detailId] || [];
|
||||||
|
|
||||||
|
// 如果没有缓存数据或只有一条,返回原始值
|
||||||
|
if (feeRows.length <= 1) {
|
||||||
|
return this.formatMoney(row.unitPrice, row.currency || this.form.currency);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查所有货物的运输单价是否一致
|
||||||
|
const prices = feeRows
|
||||||
|
.map(item => Number(item.unitPrice || 0))
|
||||||
|
.filter((price, index, arr) => arr.indexOf(price) === index);
|
||||||
|
|
||||||
|
// 如果单价不一致,返回'-'
|
||||||
|
if (prices.length > 1) {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 单价一致,返回该单价
|
||||||
|
return this.formatMoney(prices[0], row.currency || this.form.currency);
|
||||||
|
},
|
||||||
displayValue(value) {
|
displayValue(value) {
|
||||||
return value === undefined || value === null || value === '' ? '-' : value;
|
return value === undefined || value === null || value === '' ? '-' : value;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,6 +50,9 @@
|
|||||||
:precision="2"
|
:precision="2"
|
||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
|
<span v-else-if="field.prop === 'reconciliationMode'">
|
||||||
|
{{ reconciliationModeLabel }}
|
||||||
|
</span>
|
||||||
<span v-else>{{ displayValue(form[field.prop]) }}</span>
|
<span v-else>{{ displayValue(form[field.prop]) }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -202,10 +205,18 @@
|
|||||||
<section-card title="导入外部账单">
|
<section-card title="导入外部账单">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<div class="reconciliation-editor__actions" v-if="editable">
|
<div class="reconciliation-editor__actions" v-if="editable">
|
||||||
<el-button type="primary" plain @click="downloadTemplate('vehicle')"
|
<el-button
|
||||||
|
v-if="form.reconciliationMode === 'vehicle'"
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="downloadTemplate('vehicle')"
|
||||||
>下载整车对账模板</el-button
|
>下载整车对账模板</el-button
|
||||||
>
|
>
|
||||||
<el-button type="primary" plain @click="downloadTemplate('cargo')"
|
<el-button
|
||||||
|
v-if="form.reconciliationMode === 'cargo'"
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="downloadTemplate('cargo')"
|
||||||
>下载货物明细对账模板</el-button
|
>下载货物明细对账模板</el-button
|
||||||
>
|
>
|
||||||
<el-button type="primary" plain @click="chooseImport">导入</el-button>
|
<el-button type="primary" plain @click="chooseImport">导入</el-button>
|
||||||
@@ -371,6 +382,11 @@
|
|||||||
formatMoney(row.settlementAmount, row.currency)
|
formatMoney(row.settlementAmount, row.currency)
|
||||||
}}</template></el-table-column
|
}}</template></el-table-column
|
||||||
>
|
>
|
||||||
|
<el-table-column label="审批状态" width="110"
|
||||||
|
><template #default="{ row }">{{
|
||||||
|
formalApprovalStatusLabel(row.approvalStatus)
|
||||||
|
}}</template></el-table-column
|
||||||
|
>
|
||||||
<el-table-column label="操作" width="100" fixed="right" align="center">
|
<el-table-column label="操作" width="100" fixed="right" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-link type="primary" @click="selectFormal(row)">选择</el-link>
|
<el-link type="primary" @click="selectFormal(row)">选择</el-link>
|
||||||
@@ -523,23 +539,62 @@
|
|||||||
<el-button type="primary" plain @click="openFeeAdjustment('补款')">补款</el-button>
|
<el-button type="primary" plain @click="openFeeAdjustment('补款')">补款</el-button>
|
||||||
<el-button type="primary" plain @click="openFeeAdjustment('扣款')">扣款</el-button>
|
<el-button type="primary" plain @click="openFeeAdjustment('扣款')">扣款</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="completionSummaryRows" border>
|
<el-table
|
||||||
|
:data="completionSummaryRows"
|
||||||
|
border
|
||||||
|
show-summary
|
||||||
|
:summary-method="getCompletionSummarySums"
|
||||||
|
>
|
||||||
<el-table-column type="index" label="序号" width="72" align="center" />
|
<el-table-column type="index" label="序号" width="72" align="center" />
|
||||||
<el-table-column prop="name" label="费用项目" min-width="150" align="center" />
|
<el-table-column prop="name" label="费用项目" min-width="150" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span :class="{ 'completion-dialog__negative': row._feeKind === '扣款' }">{{ row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="原金额(元)" min-width="160" align="right">
|
<el-table-column label="原金额(元)" min-width="160" align="right">
|
||||||
<template #default="{ row }">{{ formatCompletionMoney(row.originalAmount) }}</template>
|
<template #default="{ row }">{{ formatCompletionMoney(row.originalAmount) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="调整金额(元)" min-width="160" align="right">
|
<el-table-column label="调整金额(元)" min-width="160" align="right">
|
||||||
<template #default="{ row }"
|
<template #default="{ row }">
|
||||||
><span :class="{ 'completion-dialog__negative': row.adjustAmount < 0 }">{{
|
<el-input-number
|
||||||
|
v-if="editable && row.manualFlag === 1"
|
||||||
|
v-model="row.adjustAmount"
|
||||||
|
:class="{ 'completion-dialog__negative-input': row._feeKind === '扣款' }"
|
||||||
|
:precision="2"
|
||||||
|
:step="0.01"
|
||||||
|
:controls="false"
|
||||||
|
:value-on-clear="0"
|
||||||
|
@change="recalculateCompletionFee(row)"
|
||||||
|
/>
|
||||||
|
<span v-else :class="{ 'completion-dialog__negative': Number(row.adjustAmount) < 0 }">{{
|
||||||
formatCompletionMoney(row.adjustAmount)
|
formatCompletionMoney(row.adjustAmount)
|
||||||
}}</span></template
|
}}</span>
|
||||||
>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="调整后金额(元)" min-width="180" align="right">
|
<el-table-column label="调整后金额(元)" min-width="180" align="right">
|
||||||
<template #default="{ row }">{{ formatCompletionMoney(row.afterAmount) }}</template>
|
<template #default="{ row }">
|
||||||
|
<span :class="{ 'completion-dialog__negative': Number(row.afterAmount) < 0 }">{{
|
||||||
|
formatCompletionMoney(row.afterAmount)
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="remark" label="备注" min-width="220">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-input
|
||||||
|
v-if="editable"
|
||||||
|
v-model="row.remark"
|
||||||
|
maxlength="200"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入备注"
|
||||||
|
/>
|
||||||
|
<span v-else>{{ displayValue(row.remark) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="editable" label="操作" width="90" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link v-if="row.manualFlag === 1" type="danger" @click="removeCompletionFee(row)">删除</el-link>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="remark" label="备注" min-width="220" />
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
@@ -565,6 +620,7 @@ import * as api from '@/api/settlement/transportReconciliation';
|
|||||||
import * as formalSettlementApi from '@/api/settlement/formalSettlement';
|
import * as formalSettlementApi from '@/api/settlement/formalSettlement';
|
||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import { Search } from '@element-plus/icons-vue';
|
import { Search } from '@element-plus/icons-vue';
|
||||||
|
import { h } from 'vue';
|
||||||
import { downloadXls } from '@/utils/util';
|
import { downloadXls } from '@/utils/util';
|
||||||
import { transportReconciliationFormFields } from '@/option/settlement/transportReconciliationForm';
|
import { transportReconciliationFormFields } from '@/option/settlement/transportReconciliationForm';
|
||||||
import {
|
import {
|
||||||
@@ -610,6 +666,7 @@ export default {
|
|||||||
adjustDialog: { visible: false, saving: false, rows: [], reason: '' },
|
adjustDialog: { visible: false, saving: false, rows: [], reason: '' },
|
||||||
manualMatchDialog: { visible: false, loading: false, row: null },
|
manualMatchDialog: { visible: false, loading: false, row: null },
|
||||||
completionDialog: { visible: false, loading: false },
|
completionDialog: { visible: false, loading: false },
|
||||||
|
completionSummaryRowsData: null,
|
||||||
externalEditing: {},
|
externalEditing: {},
|
||||||
externalEditSnapshots: {},
|
externalEditSnapshots: {},
|
||||||
matchingStarted: false,
|
matchingStarted: false,
|
||||||
@@ -728,9 +785,17 @@ export default {
|
|||||||
return [...names];
|
return [...names];
|
||||||
},
|
},
|
||||||
duplicateRows() {
|
duplicateRows() {
|
||||||
return this.externalDetails.filter(
|
const duplicateKeys = new Set();
|
||||||
row => row.suspectedDuplicate || row.matchStatus === 'suspected_duplicate'
|
const duplicateRows = [];
|
||||||
|
this.externalDetails.forEach(row => {
|
||||||
|
const key = this.externalDuplicateKey(row);
|
||||||
|
if (duplicateKeys.has(key)) duplicateRows.push(row);
|
||||||
|
else duplicateKeys.add(key);
|
||||||
|
});
|
||||||
|
const duplicateKeySet = new Set(
|
||||||
|
duplicateRows.map(row => this.externalDuplicateKey(row))
|
||||||
);
|
);
|
||||||
|
return this.externalDetails.filter(row => duplicateKeySet.has(this.externalDuplicateKey(row)));
|
||||||
},
|
},
|
||||||
canStartMatch() {
|
canStartMatch() {
|
||||||
return Boolean(this.form.formalSettlementId && this.externalDetails.length);
|
return Boolean(this.form.formalSettlementId && this.externalDetails.length);
|
||||||
@@ -767,6 +832,11 @@ export default {
|
|||||||
return this.form.reconciliationModeName || labels[this.form.reconciliationMode] || '-';
|
return this.form.reconciliationModeName || labels[this.form.reconciliationMode] || '-';
|
||||||
},
|
},
|
||||||
completionSummaryRows() {
|
completionSummaryRows() {
|
||||||
|
if (Array.isArray(this.completionSummaryRowsData)) return this.completionSummaryRowsData;
|
||||||
|
return this.buildCompletionSummaryRows;
|
||||||
|
},
|
||||||
|
|
||||||
|
buildCompletionSummaryRows() {
|
||||||
const source =
|
const source =
|
||||||
this.form.feeSummary ||
|
this.form.feeSummary ||
|
||||||
this.form.feeSummaries ||
|
this.form.feeSummaries ||
|
||||||
@@ -796,10 +866,14 @@ export default {
|
|||||||
: originalAmount;
|
: originalAmount;
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
|
feeType: '',
|
||||||
|
feeItem: name,
|
||||||
originalAmount,
|
originalAmount,
|
||||||
adjustAmount: afterAmount - originalAmount,
|
adjustAmount: afterAmount - originalAmount,
|
||||||
afterAmount,
|
afterAmount,
|
||||||
remark: '',
|
remark: '',
|
||||||
|
manualFlag: 0,
|
||||||
|
_feeKind: '',
|
||||||
_index: index,
|
_index: index,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -851,6 +925,7 @@ export default {
|
|||||||
this.externalDetails = [];
|
this.externalDetails = [];
|
||||||
this.externalEditing = {};
|
this.externalEditing = {};
|
||||||
this.externalEditSnapshots = {};
|
this.externalEditSnapshots = {};
|
||||||
|
this.completionSummaryRowsData = null;
|
||||||
this.matchingStarted = false;
|
this.matchingStarted = false;
|
||||||
this.externalTab = 'all';
|
this.externalTab = 'all';
|
||||||
this.internalQuery = { documentNo: '', vehicleNo: '', batchNo: '', cargoName: '' };
|
this.internalQuery = { documentNo: '', vehicleNo: '', batchNo: '', cargoName: '' };
|
||||||
@@ -880,6 +955,7 @@ export default {
|
|||||||
: data.payeeName) ||
|
: data.payeeName) ||
|
||||||
'',
|
'',
|
||||||
};
|
};
|
||||||
|
this.completionSummaryRowsData = null;
|
||||||
const internalRows = data.internalDetails || data.internalBillDetails || data.internals || [];
|
const internalRows = data.internalDetails || data.internalBillDetails || data.internals || [];
|
||||||
this.internalDetails = internalRows.map(row => this.normalizeInternalRow(row));
|
this.internalDetails = internalRows.map(row => this.normalizeInternalRow(row));
|
||||||
const externalRows = data.externalDetails || data.externalBillDetails || data.externals || [];
|
const externalRows = data.externalDetails || data.externalBillDetails || data.externals || [];
|
||||||
@@ -908,6 +984,52 @@ export default {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
externalDuplicateKey(row) {
|
||||||
|
const feeItems = row.feeItems || this.parseFeeItems(row.feeItemsJson);
|
||||||
|
const normalized = value => {
|
||||||
|
if (value === null || value === undefined || value === '') return '';
|
||||||
|
if (typeof value === 'number') return Number(value).toString();
|
||||||
|
if (typeof value === 'object') {
|
||||||
|
return JSON.stringify(
|
||||||
|
Object.keys(value)
|
||||||
|
.sort()
|
||||||
|
.reduce((result, key) => {
|
||||||
|
result[key] = normalized(value[key]);
|
||||||
|
return result;
|
||||||
|
}, {})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const text = String(value).trim().replace(/\s+/g, '').toLowerCase();
|
||||||
|
return /^-?\d+(\.\d+)?$/.test(text) ? Number(text).toString() : text;
|
||||||
|
};
|
||||||
|
const normalizeDate = value => {
|
||||||
|
if (!value) return '';
|
||||||
|
const date = this.$dayjs(value);
|
||||||
|
return date.isValid() ? date.format('YYYY-MM-DDTHH:mm:ss') : value;
|
||||||
|
};
|
||||||
|
return [
|
||||||
|
row.vehicleNo,
|
||||||
|
row.departureAddress,
|
||||||
|
row.arrivalAddress,
|
||||||
|
normalizeDate(row.actualDepartureTime),
|
||||||
|
normalizeDate(row.actualCompletionTime),
|
||||||
|
row.transportType,
|
||||||
|
row.cargoName,
|
||||||
|
row.cargoType,
|
||||||
|
row.specification,
|
||||||
|
row.model,
|
||||||
|
row.transportQuantity,
|
||||||
|
row.quantityUnit,
|
||||||
|
row.mileage,
|
||||||
|
row.batchNo,
|
||||||
|
row.unitPrice,
|
||||||
|
row.freightAmount,
|
||||||
|
feeItems,
|
||||||
|
row.settlementAmount,
|
||||||
|
]
|
||||||
|
.map(normalized)
|
||||||
|
.join('|');
|
||||||
|
},
|
||||||
normalizeInternalRow(row) {
|
normalizeInternalRow(row) {
|
||||||
const feeItems =
|
const feeItems =
|
||||||
row.feeItems && typeof row.feeItems === 'object' && Object.keys(row.feeItems).length
|
row.feeItems && typeof row.feeItems === 'object' && Object.keys(row.feeItems).length
|
||||||
@@ -972,12 +1094,26 @@ export default {
|
|||||||
getFeeItemAmount(row, name) {
|
getFeeItemAmount(row, name) {
|
||||||
return (row.feeItems || this.parseFeeItems(row.feeItemsJson))[name] ?? 0;
|
return (row.feeItems || this.parseFeeItems(row.feeItemsJson))[name] ?? 0;
|
||||||
},
|
},
|
||||||
|
formalApprovalStatusLabel(value) {
|
||||||
|
return (
|
||||||
|
{
|
||||||
|
draft: '草稿',
|
||||||
|
reviewing: '审批中',
|
||||||
|
approved: '审批通过',
|
||||||
|
returned: '已驳回',
|
||||||
|
voided: '已作废',
|
||||||
|
}[value] ||
|
||||||
|
value ||
|
||||||
|
'-'
|
||||||
|
);
|
||||||
|
},
|
||||||
async loadFormalOptions() {
|
async loadFormalOptions() {
|
||||||
this.formalDialog.loading = true;
|
this.formalDialog.loading = true;
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
settlementType: this.settlementType,
|
settlementType: this.settlementType,
|
||||||
keyword: this.formalDialog.query.keyword,
|
keyword: this.formalDialog.query.keyword,
|
||||||
|
approvalStatus: 'draft',
|
||||||
};
|
};
|
||||||
const data = this.unwrapData(
|
const data = this.unwrapData(
|
||||||
await api.getFormalOptions(
|
await api.getFormalOptions(
|
||||||
@@ -986,20 +1122,8 @@ export default {
|
|||||||
params
|
params
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
let rows = data.records || [];
|
this.formalDialog.rows = data.records || [];
|
||||||
let total = data.total || 0;
|
this.formalDialog.page.total = data.total || 0;
|
||||||
if (!rows.length) {
|
|
||||||
const fallback = await formalSettlementApi.getList(
|
|
||||||
this.formalDialog.page.current,
|
|
||||||
this.formalDialog.page.size,
|
|
||||||
{ ...params, approvalStatus: 'approved' }
|
|
||||||
);
|
|
||||||
const fallbackData = this.unwrapData(fallback);
|
|
||||||
rows = fallbackData.records || [];
|
|
||||||
total = fallbackData.total || 0;
|
|
||||||
}
|
|
||||||
this.formalDialog.rows = rows;
|
|
||||||
this.formalDialog.page.total = total;
|
|
||||||
} finally {
|
} finally {
|
||||||
this.formalDialog.loading = false;
|
this.formalDialog.loading = false;
|
||||||
}
|
}
|
||||||
@@ -1010,6 +1134,9 @@ export default {
|
|||||||
await this.selectFormal(this.formalDialog.selected[0]);
|
await this.selectFormal(this.formalDialog.selected[0]);
|
||||||
},
|
},
|
||||||
async selectFormal(selected) {
|
async selectFormal(selected) {
|
||||||
|
if (selected?.approvalStatus && selected.approvalStatus !== 'draft') {
|
||||||
|
return this.$message.warning('只能选择草稿状态的正式结算单');
|
||||||
|
}
|
||||||
const formalSettlementChanged = this.form.formalSettlementId !== selected.id;
|
const formalSettlementChanged = this.form.formalSettlementId !== selected.id;
|
||||||
this.form = {
|
this.form = {
|
||||||
...this.form,
|
...this.form,
|
||||||
@@ -1027,6 +1154,7 @@ export default {
|
|||||||
if (formalSettlementChanged) {
|
if (formalSettlementChanged) {
|
||||||
this.externalDetails = [];
|
this.externalDetails = [];
|
||||||
this.matchingStarted = false;
|
this.matchingStarted = false;
|
||||||
|
this.completionSummaryRowsData = null;
|
||||||
}
|
}
|
||||||
await this.loadFormalInternalPreview(selected.id);
|
await this.loadFormalInternalPreview(selected.id);
|
||||||
this.formalDialog.visible = false;
|
this.formalDialog.visible = false;
|
||||||
@@ -1174,6 +1302,7 @@ export default {
|
|||||||
this.externalDetails = (data.externalDetails || []).map((row, index) =>
|
this.externalDetails = (data.externalDetails || []).map((row, index) =>
|
||||||
this.normalizeExternalRow(row, index)
|
this.normalizeExternalRow(row, index)
|
||||||
);
|
);
|
||||||
|
this.completionSummaryRowsData = null;
|
||||||
this.matchingStarted = true;
|
this.matchingStarted = true;
|
||||||
this.$message.success('匹配完成');
|
this.$message.success('匹配完成');
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1206,10 +1335,22 @@ export default {
|
|||||||
) {
|
) {
|
||||||
return this.$message.warning('差异单数、差异货量和差异金额必须全部为0才可完成对账');
|
return this.$message.warning('差异单数、差异货量和差异金额必须全部为0才可完成对账');
|
||||||
}
|
}
|
||||||
|
this.completionSummaryRowsData = this.buildCompletionSummaryRows.map(row => ({ ...row }));
|
||||||
this.completionDialog.visible = true;
|
this.completionDialog.visible = true;
|
||||||
},
|
},
|
||||||
async confirmCompletion() {
|
async confirmCompletion() {
|
||||||
if (this.completionDialog.loading) return;
|
if (this.completionDialog.loading) return;
|
||||||
|
for (const row of this.completionSummaryRows) {
|
||||||
|
const adjustAmount = Number(row.adjustAmount || 0);
|
||||||
|
if (row.manualFlag === 1 && row._feeKind === '补款' && adjustAmount <= 0) {
|
||||||
|
return this.$message.warning('补款调整金额必须大于0');
|
||||||
|
}
|
||||||
|
if (row.manualFlag === 1 && row._feeKind === '扣款' && adjustAmount >= 0) {
|
||||||
|
return this.$message.warning('扣款调整金额必须小于0');
|
||||||
|
}
|
||||||
|
if (String(row.remark || '').length > 200) return this.$message.warning('备注不能超过200个字');
|
||||||
|
this.recalculateCompletionFee(row);
|
||||||
|
}
|
||||||
this.completionDialog.loading = true;
|
this.completionDialog.loading = true;
|
||||||
try {
|
try {
|
||||||
this.actionLoading = true;
|
this.actionLoading = true;
|
||||||
@@ -1220,6 +1361,16 @@ export default {
|
|||||||
remark: this.form.remark,
|
remark: this.form.remark,
|
||||||
internalDetails: this.serializeInternalRows(),
|
internalDetails: this.serializeInternalRows(),
|
||||||
externalDetails: this.serializeExternalRows(),
|
externalDetails: this.serializeExternalRows(),
|
||||||
|
feeSummary: this.completionSummaryRows.map(row => ({
|
||||||
|
id: row.id || undefined,
|
||||||
|
feeType: row.feeType,
|
||||||
|
feeItem: row.feeItem || row.name,
|
||||||
|
originalAmount: Number(row.originalAmount || 0),
|
||||||
|
adjustAmount: Number(row.adjustAmount || 0),
|
||||||
|
settlementAmount: Number(row.afterAmount || 0),
|
||||||
|
remark: row.remark || '',
|
||||||
|
manualFlag: Number(row.manualFlag || 0),
|
||||||
|
})),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
this.form = { ...this.form, ...data };
|
this.form = { ...this.form, ...data };
|
||||||
@@ -1237,7 +1388,55 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
openFeeAdjustment(type) {
|
openFeeAdjustment(type) {
|
||||||
this.$message.info(`${type}请在结算明细调整中维护`);
|
if (!Array.isArray(this.completionSummaryRowsData)) {
|
||||||
|
this.completionSummaryRowsData = this.buildCompletionSummaryRows.map(row => ({ ...row }));
|
||||||
|
}
|
||||||
|
this.completionSummaryRowsData.push({
|
||||||
|
id: null,
|
||||||
|
name: type,
|
||||||
|
feeType: '其他费用',
|
||||||
|
feeItem: type,
|
||||||
|
originalAmount: 0,
|
||||||
|
adjustAmount: 0,
|
||||||
|
afterAmount: 0,
|
||||||
|
remark: '',
|
||||||
|
manualFlag: 1,
|
||||||
|
_feeKind: type,
|
||||||
|
_index: this.completionSummaryRowsData.length,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
removeCompletionFee(row) {
|
||||||
|
if (row.manualFlag !== 1 || !Array.isArray(this.completionSummaryRowsData)) return;
|
||||||
|
const index = this.completionSummaryRowsData.indexOf(row);
|
||||||
|
if (index >= 0) this.completionSummaryRowsData.splice(index, 1);
|
||||||
|
},
|
||||||
|
recalculateCompletionFee(row) {
|
||||||
|
row.originalAmount = row.manualFlag === 1 ? 0 : Number(row.originalAmount || 0);
|
||||||
|
row.afterAmount = Number(row.originalAmount || 0) + Number(row.adjustAmount || 0);
|
||||||
|
},
|
||||||
|
getCompletionSummarySums({ columns, data }) {
|
||||||
|
return columns.map((column, index) => {
|
||||||
|
if (index === 0) return '合计';
|
||||||
|
const amountPropertyByIndex = {
|
||||||
|
2: 'originalAmount',
|
||||||
|
3: 'adjustAmount',
|
||||||
|
4: 'afterAmount',
|
||||||
|
};
|
||||||
|
const property = column.property || amountPropertyByIndex[index];
|
||||||
|
if (property === 'originalAmount' || property === 'adjustAmount' || property === 'afterAmount') {
|
||||||
|
const total = data.reduce((sum, row) => {
|
||||||
|
const value = property === 'afterAmount' ? row.afterAmount : row[property];
|
||||||
|
return sum + Number(value || 0);
|
||||||
|
}, 0);
|
||||||
|
const text = this.formatCompletionMoney(total);
|
||||||
|
const negativeAmount =
|
||||||
|
(property === 'adjustAmount' || property === 'afterAmount') && total < 0;
|
||||||
|
return negativeAmount
|
||||||
|
? h('span', { class: 'completion-dialog__negative', style: { color: '#f56c6c' } }, text)
|
||||||
|
: text;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
});
|
||||||
},
|
},
|
||||||
sumFeeAmount(rows, name) {
|
sumFeeAmount(rows, name) {
|
||||||
return rows.reduce((sum, row) => {
|
return rows.reduce((sum, row) => {
|
||||||
@@ -1254,11 +1453,16 @@ export default {
|
|||||||
item.afterAmount ?? item.adjustedAmount ?? item.settlementAmount ?? item.totalAmount ?? originalAmount
|
item.afterAmount ?? item.adjustedAmount ?? item.settlementAmount ?? item.totalAmount ?? originalAmount
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
|
id: item.id,
|
||||||
|
feeType: item.feeType || '',
|
||||||
|
feeItem: item.feeItem || item.name || item.feeItemName || '',
|
||||||
name: item.name || item.feeItem || item.feeItemName || `费用${index + 1}`,
|
name: item.name || item.feeItem || item.feeItemName || `费用${index + 1}`,
|
||||||
originalAmount,
|
originalAmount,
|
||||||
adjustAmount: Number(item.adjustAmount ?? item.adjustmentAmount ?? afterAmount - originalAmount),
|
adjustAmount: Number(item.adjustAmount ?? item.adjustmentAmount ?? afterAmount - originalAmount),
|
||||||
afterAmount,
|
afterAmount,
|
||||||
remark: item.remark || item.adjustRemark || '',
|
remark: item.remark || item.adjustRemark || '',
|
||||||
|
manualFlag: Number(item.manualFlag || 0),
|
||||||
|
_feeKind: item.feeItem === '补款' || item.feeItem === '扣款' ? item.feeItem : '',
|
||||||
_index: index,
|
_index: index,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -1302,7 +1506,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async downloadTemplate(mode) {
|
async downloadTemplate(mode) {
|
||||||
const response = await api.template(mode);
|
if (!this.form.formalSettlementId) {
|
||||||
|
return this.$message.warning('请先选择正式结算单');
|
||||||
|
}
|
||||||
|
const response = await api.template(mode, {
|
||||||
|
id: this.currentId,
|
||||||
|
formalSettlementId: this.form.formalSettlementId,
|
||||||
|
feeItems: this.internalFeeItemNames.join(','),
|
||||||
|
});
|
||||||
downloadXls(
|
downloadXls(
|
||||||
response.data,
|
response.data,
|
||||||
`${mode === 'cargo' ? '货物明细对账模板' : '整车总额对账模板'}.xlsx`
|
`${mode === 'cargo' ? '货物明细对账模板' : '整车总额对账模板'}.xlsx`
|
||||||
@@ -1781,6 +1992,9 @@ export default {
|
|||||||
.completion-dialog__negative {
|
.completion-dialog__negative {
|
||||||
color: #f56c6c;
|
color: #f56c6c;
|
||||||
}
|
}
|
||||||
|
.completion-dialog__negative-input :deep(input) {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
.completion-dialog__footer {
|
.completion-dialog__footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
page-mode
|
page-mode
|
||||||
:record-id="recordId"
|
:record-id="recordId"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:initial-data="transferPayload"
|
:initial-data="editorInitialData"
|
||||||
/>
|
/>
|
||||||
</basic-container>
|
</basic-container>
|
||||||
</template>
|
</template>
|
||||||
@@ -35,6 +35,14 @@ export default {
|
|||||||
pageTitle() {
|
pageTitle() {
|
||||||
return this.readonly ? '查看正式结算' : this.recordId ? '编辑正式结算' : '新增正式结算';
|
return this.readonly ? '查看正式结算' : this.recordId ? '编辑正式结算' : '新增正式结算';
|
||||||
},
|
},
|
||||||
|
editorInitialData() {
|
||||||
|
const settlementType = this.$route.query.settlementType;
|
||||||
|
if (!this.transferPayload && !settlementType) return null;
|
||||||
|
return {
|
||||||
|
...(this.transferPayload || {}),
|
||||||
|
...(settlementType ? { settlementType } : {}),
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
editorVisible(value) {
|
editorVisible(value) {
|
||||||
|
|||||||
@@ -299,7 +299,11 @@ export default {
|
|||||||
openCreate() {
|
openCreate() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/settlement/formal-settlement/form',
|
path: '/settlement/formal-settlement/form',
|
||||||
query: { mode: 'add', name: '新增正式结算' },
|
query: {
|
||||||
|
mode: 'add',
|
||||||
|
name: '新增正式结算',
|
||||||
|
settlementType: this.activeSettlementType,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openEdit(row) {
|
openEdit(row) {
|
||||||
|
|||||||
@@ -145,7 +145,9 @@
|
|||||||
:align="column.align || 'center'"
|
:align="column.align || 'center'"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
<template #default="{ row }">{{ formatDetailCell(row, column.prop) }}</template>
|
<template #default="{ row }">
|
||||||
|
{{ formatFeeDetailCell(row, column.prop) }}
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -398,12 +400,14 @@
|
|||||||
maxlength="300"
|
maxlength="300"
|
||||||
placeholder="请输入调整原因"
|
placeholder="请输入调整原因"
|
||||||
/>
|
/>
|
||||||
<span v-else-if="column.prop === 'adjustAmountText'">
|
<span v-else-if="column.prop === 'originalAmountText'">
|
||||||
{{ fixedTwoDecimals(row.adjustAmount) }}
|
{{
|
||||||
</span>
|
Number(row.adjustAmount || 0) !== 0
|
||||||
<span v-else-if="column.prop === 'afterAmountText'">
|
? fixedTwoDecimals(row.afterAmount)
|
||||||
{{ fixedTwoDecimals(row.afterAmount) }}
|
: fixedTwoDecimals(row.originalAmount)
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span v-else>{{ formatDetailCell(row, column.prop) }}</span>
|
<span v-else>{{ formatDetailCell(row, column.prop) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -1135,7 +1139,13 @@ export default {
|
|||||||
},
|
},
|
||||||
feeDetailColumns() {
|
feeDetailColumns() {
|
||||||
const baseColumns = feeDetailBaseColumns.filter(column => column.prop !== 'freightAmount');
|
const baseColumns = feeDetailBaseColumns.filter(column => column.prop !== 'freightAmount');
|
||||||
return [...baseColumns, ...this.dynamicFeeColumns, ...feeDetailTailColumns];
|
const hasAdjustment = this.feeRows.some(row => Number(row.adjustAmount || 0) !== 0);
|
||||||
|
const tailColumns = feeDetailTailColumns.map(col =>
|
||||||
|
col.prop === 'originalAmountText' && hasAdjustment
|
||||||
|
? { ...col, label: '调整后金额' }
|
||||||
|
: col
|
||||||
|
);
|
||||||
|
return [...baseColumns, ...this.dynamicFeeColumns, ...tailColumns];
|
||||||
},
|
},
|
||||||
displayTableColumns() {
|
displayTableColumns() {
|
||||||
const columns = this.tableColumns.filter(
|
const columns = this.tableColumns.filter(
|
||||||
@@ -1181,7 +1191,7 @@ export default {
|
|||||||
adjustFeeColumns() {
|
adjustFeeColumns() {
|
||||||
const baseColumns = feeDetailBaseColumns.filter(column => column.prop !== 'freightAmount');
|
const baseColumns = feeDetailBaseColumns.filter(column => column.prop !== 'freightAmount');
|
||||||
const tailColumns = feeDetailTailColumns.filter(column => column.prop !== 'remark');
|
const tailColumns = feeDetailTailColumns.filter(column => column.prop !== 'remark');
|
||||||
const afterAmountIndex = tailColumns.findIndex(column => column.prop === 'afterAmountText');
|
const afterAmountIndex = tailColumns.findIndex(column => column.prop === 'originalAmountText');
|
||||||
tailColumns.splice(afterAmountIndex + 1, 0, {
|
tailColumns.splice(afterAmountIndex + 1, 0, {
|
||||||
label: '调整原因',
|
label: '调整原因',
|
||||||
prop: 'changeReason',
|
prop: 'changeReason',
|
||||||
@@ -2596,6 +2606,22 @@ export default {
|
|||||||
}
|
}
|
||||||
return this.formatCell(row?.[prop]);
|
return this.formatCell(row?.[prop]);
|
||||||
},
|
},
|
||||||
|
formatFeeDetailCell(row, prop) {
|
||||||
|
if (prop !== 'originalAmountText') return this.formatDetailCell(row, prop);
|
||||||
|
|
||||||
|
const adjustAmount = Number(row?.adjustAmount || 0);
|
||||||
|
if (adjustAmount === 0) return this.formatDetailCell(row, prop);
|
||||||
|
|
||||||
|
const adjustedAmount = Number(
|
||||||
|
row?.afterAmount ?? row?.adjustedAmount ?? row?.settlementAmount
|
||||||
|
);
|
||||||
|
if (Number.isFinite(adjustedAmount)) return this.fixedTwoDecimals(adjustedAmount);
|
||||||
|
|
||||||
|
const originalAmount = Number(row?.originalAmount ?? row?.originalAmountText);
|
||||||
|
return Number.isFinite(originalAmount)
|
||||||
|
? this.fixedTwoDecimals(originalAmount + adjustAmount)
|
||||||
|
: this.formatCell(row?.afterAmountText);
|
||||||
|
},
|
||||||
formatCell(value) {
|
formatCell(value) {
|
||||||
return value === null || value === undefined || value === '' ? '-' : value;
|
return value === null || value === undefined || value === '' ? '-' : value;
|
||||||
},
|
},
|
||||||
|
|||||||
+124
-31
@@ -42,12 +42,6 @@
|
|||||||
<template #deptCategory="{ row }">
|
<template #deptCategory="{ row }">
|
||||||
<el-tag>{{ getDeptCategoryLabel(row.deptCategory) }}</el-tag>
|
<el-tag>{{ getDeptCategoryLabel(row.deptCategory) }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
<template #leaderId="{ row }">
|
|
||||||
{{ getLeaderValue(row.leaderId, 'realName') }}
|
|
||||||
</template>
|
|
||||||
<template #leaderPhone="{ row }">
|
|
||||||
{{ getLeaderValue(row.leaderId, 'phone') }}
|
|
||||||
</template>
|
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
<el-tag :type="Number(row.status) === 1 ? 'success' : 'info'" class="status-text">
|
<el-tag :type="Number(row.status) === 1 ? 'success' : 'info'" class="status-text">
|
||||||
{{ Number(row.status) === 1 ? '启用' : '停用' }}
|
{{ Number(row.status) === 1 ? '启用' : '停用' }}
|
||||||
@@ -174,6 +168,7 @@ export default {
|
|||||||
searchIndex: 4,
|
searchIndex: 4,
|
||||||
searchMenuPosition: 'right',
|
searchMenuPosition: 'right',
|
||||||
tree: true,
|
tree: true,
|
||||||
|
rowKey: 'id',
|
||||||
border: true,
|
border: true,
|
||||||
index: true,
|
index: true,
|
||||||
selection: true,
|
selection: true,
|
||||||
@@ -183,6 +178,8 @@ export default {
|
|||||||
dialogClickModal: false,
|
dialogClickModal: false,
|
||||||
labelPosition: 'right',
|
labelPosition: 'right',
|
||||||
labelWidth: 'auto',
|
labelWidth: 'auto',
|
||||||
|
// 禁用 Avue 列状态持久化,避免增列后表头/单元格错位
|
||||||
|
columnState: false,
|
||||||
column: [
|
column: [
|
||||||
{
|
{
|
||||||
label: '组织名称',
|
label: '组织名称',
|
||||||
@@ -206,22 +203,32 @@ export default {
|
|||||||
maxlength: 30,
|
maxlength: 30,
|
||||||
showWordLimit: true,
|
showWordLimit: true,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入组织编码',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
const deptCode = String(value || '').trim();
|
const deptCode = String(value || '').trim();
|
||||||
|
// 组织编码非必填,为空直接通过
|
||||||
|
if (!deptCode) {
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (deptCode.length > 30) {
|
if (deptCode.length > 30) {
|
||||||
callback(new Error('组织编码不能超过30个字符'));
|
callback(new Error('组织编码不能超过30个字符'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.parentDeptCode) {
|
const parentId = this.normalizeParentId(this.form?.parentId);
|
||||||
|
if (!parentId) {
|
||||||
callback(new Error('请先选择上级组织'));
|
callback(new Error('请先选择上级组织'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.parentDept || String(this.parentDept.id) !== String(parentId)) {
|
||||||
|
this.loadParentDeptCode(parentId);
|
||||||
|
callback(new Error('正在加载上级组织编码,请稍后重试'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.parentDeptCode) {
|
||||||
|
callback(new Error('上级组织未配置组织编码,请先完善上级组织编码'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
const pattern = new RegExp(`^${escapeRegExp(this.parentDeptCode)}-\\d+$`);
|
const pattern = new RegExp(`^${escapeRegExp(this.parentDeptCode)}-\\d+$`);
|
||||||
if (!pattern.test(deptCode)) {
|
if (!pattern.test(deptCode)) {
|
||||||
callback(new Error(`组织编码格式应为:${this.parentDeptCode}-分段数字`));
|
callback(new Error(`组织编码格式应为:${this.parentDeptCode}-分段数字`));
|
||||||
@@ -239,6 +246,18 @@ export default {
|
|||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
order: 60,
|
order: 60,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '助记码',
|
||||||
|
prop: 'mnemonicCode',
|
||||||
|
minWidth: 120,
|
||||||
|
order: 50,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '拼音助记码',
|
||||||
|
prop: 'pinyinMnemonic',
|
||||||
|
minWidth: 140,
|
||||||
|
order: 45,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '组织类型',
|
label: '组织类型',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@@ -268,29 +287,40 @@ export default {
|
|||||||
label: '负责人',
|
label: '负责人',
|
||||||
prop: 'leaderId',
|
prop: 'leaderId',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
slot: true,
|
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
editDisplay: false,
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
formatter: row => this.getLeaderValue(row.leaderId, 'realName'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '联系电话',
|
label: '联系电话',
|
||||||
prop: 'leaderPhone',
|
prop: 'leaderPhone',
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
slot: true,
|
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
editDisplay: false,
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
formatter: row => this.getLeaderValue(row.leaderId, 'phone'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '助记码',
|
label: '是否平台公司',
|
||||||
prop: 'mnemonicCode',
|
prop: 'isPlatformCompany',
|
||||||
minWidth: 120,
|
type: 'select',
|
||||||
order: 40,
|
dicData: [
|
||||||
},
|
{ label: '否', value: 0 },
|
||||||
{
|
{ label: '是', value: 1 },
|
||||||
label: '拼音助记码',
|
],
|
||||||
prop: 'pinyinMnemonic',
|
dataType: 'number',
|
||||||
minWidth: 140,
|
value: 0,
|
||||||
order: 50,
|
width: 120,
|
||||||
|
order: 35,
|
||||||
|
formatter: row => (Number(row.isPlatformCompany) === 1 ? '是' : '否'),
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择是否平台公司',
|
||||||
|
trigger: 'change',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '排序',
|
label: '排序',
|
||||||
@@ -314,6 +344,7 @@ export default {
|
|||||||
slot: true,
|
slot: true,
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
editDisplay: false,
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '上级组织',
|
label: '上级组织',
|
||||||
@@ -372,6 +403,20 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
// 清除可能错乱的表格列顺序/列状态缓存,避免新增列后表头/单元格错位
|
||||||
|
try {
|
||||||
|
const path = this.$route?.path || '/system/dept';
|
||||||
|
Object.keys(localStorage).forEach(key => {
|
||||||
|
if (
|
||||||
|
(key.startsWith('tms:table-column-order:') && key.includes(path)) ||
|
||||||
|
(key.startsWith('AVUE_COLUMN_STATE:') && key.includes('dept'))
|
||||||
|
) {
|
||||||
|
localStorage.removeItem(key);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
// ignore storage errors
|
||||||
|
}
|
||||||
this.loadLeaderOptions();
|
this.loadLeaderOptions();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -400,16 +445,47 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleParentChange(parentId) {
|
handleParentChange(parentId) {
|
||||||
this.loadParentDeptCode(parentId);
|
// Avue tree 选择时可能先触发空值 change,避免把已加载的上级编码清掉
|
||||||
|
const normalizedId = this.normalizeParentId(parentId);
|
||||||
|
if (!normalizedId && this.form?.parentId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.loadParentDeptCode(normalizedId || this.form?.parentId);
|
||||||
|
},
|
||||||
|
normalizeParentId(parentId) {
|
||||||
|
if (Array.isArray(parentId)) {
|
||||||
|
parentId = parentId[0];
|
||||||
|
}
|
||||||
|
if (parentId && typeof parentId === 'object') {
|
||||||
|
parentId = parentId.value ?? parentId.id ?? parentId.key;
|
||||||
|
}
|
||||||
|
if (!parentId || String(parentId) === '0') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return parentId;
|
||||||
},
|
},
|
||||||
loadParentDeptCode(parentId) {
|
loadParentDeptCode(parentId) {
|
||||||
this.parentDeptCode = '';
|
const normalizedId = this.normalizeParentId(parentId);
|
||||||
this.parentDept = null;
|
if (!normalizedId) {
|
||||||
if (!parentId || String(parentId) === '0') return;
|
this.parentDeptCode = '';
|
||||||
getDept(parentId).then(res => {
|
this.parentDept = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
getDept(normalizedId).then(res => {
|
||||||
|
// 防止异步乱序:仅采纳当前表单上级对应的结果
|
||||||
|
if (
|
||||||
|
this.form?.parentId &&
|
||||||
|
String(this.form.parentId) !== '0' &&
|
||||||
|
String(this.form.parentId) !== String(normalizedId)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.parentDept = res.data.data || null;
|
this.parentDept = res.data.data || null;
|
||||||
this.parentDeptCode = this.parentDept?.deptCode || '';
|
this.parentDeptCode = this.parentDept?.deptCode || '';
|
||||||
this.updateDeptCategoryOptions();
|
this.updateDeptCategoryOptions();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.crud?.clearValidate?.('deptCode');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateDeptCategoryOptions() {
|
updateDeptCategoryOptions() {
|
||||||
@@ -496,6 +572,10 @@ export default {
|
|||||||
loadLeaderOptions(tenantId) {
|
loadLeaderOptions(tenantId) {
|
||||||
getLeaderList(tenantId).then(res => {
|
getLeaderList(tenantId).then(res => {
|
||||||
this.leaderOptions = res.data.data || [];
|
this.leaderOptions = res.data.data || [];
|
||||||
|
// formatter 依赖负责人字典,异步返回后触发表格重绘
|
||||||
|
if (Array.isArray(this.data) && this.data.length) {
|
||||||
|
this.data = [...this.data];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getDeptCategoryLabel(deptCategory) {
|
getDeptCategoryLabel(deptCategory) {
|
||||||
@@ -510,7 +590,16 @@ export default {
|
|||||||
return categoryMap[Number(deptCategory)] || '-';
|
return categoryMap[Number(deptCategory)] || '-';
|
||||||
},
|
},
|
||||||
getLeaderValue(leaderId, field) {
|
getLeaderValue(leaderId, field) {
|
||||||
const values = func.split(leaderId);
|
// func.split 空值时返回 '',需兼容为数组,避免表格 formatter 渲染崩溃导致列错位
|
||||||
|
const splitResult = func.split(leaderId);
|
||||||
|
const values = Array.isArray(splitResult)
|
||||||
|
? splitResult
|
||||||
|
: String(splitResult || '')
|
||||||
|
.split(',')
|
||||||
|
.filter(Boolean);
|
||||||
|
if (!values.length) {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
const result = values
|
const result = values
|
||||||
.map(id => this.leaderOptions.find(item => String(item.id) === String(id))?.[field])
|
.map(id => this.leaderOptions.find(item => String(item.id) === String(id))?.[field])
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
@@ -660,6 +749,9 @@ export default {
|
|||||||
beforeOpen(done, type) {
|
beforeOpen(done, type) {
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
this.form.tenantId = this.form.tenantId || this.userInfo.tenantId || website.tenantId;
|
this.form.tenantId = this.form.tenantId || this.userInfo.tenantId || website.tenantId;
|
||||||
|
if (this.form.isPlatformCompany === undefined || this.form.isPlatformCompany === null) {
|
||||||
|
this.form.isPlatformCompany = 0;
|
||||||
|
}
|
||||||
this.initData(this.form.tenantId);
|
this.initData(this.form.tenantId);
|
||||||
this.loadParentDeptCode(this.form.parentId);
|
this.loadParentDeptCode(this.form.parentId);
|
||||||
}
|
}
|
||||||
@@ -676,7 +768,8 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loadParentDeptCode(this.form.parentId);
|
this.loadParentDeptCode(this.form.parentId);
|
||||||
if (this.form.hasOwnProperty('leaderId')) {
|
if (this.form.hasOwnProperty('leaderId')) {
|
||||||
this.form.leaderId = func.split(this.form.leaderId);
|
const splitResult = func.split(this.form.leaderId);
|
||||||
|
this.form.leaderId = Array.isArray(splitResult) ? splitResult : [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,48 +120,59 @@
|
|||||||
:model="driverForm"
|
:model="driverForm"
|
||||||
:rules="formRules"
|
:rules="formRules"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
|
label-width="calc(4em + 24px)"
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
class="driver-form archive-form"
|
class="driver-form archive-form"
|
||||||
>
|
>
|
||||||
<section-card title="基础身份信息">
|
<section-card title="基础身份信息">
|
||||||
<el-row :gutter="18">
|
<el-row :gutter="18">
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-form-item label="司机姓名" prop="driverName">
|
<el-form-item label="司机姓名" prop="driverName">
|
||||||
<el-input v-model="driverForm.driverName" maxlength="10" show-word-limit />
|
<el-input
|
||||||
|
v-model="driverForm.driverName"
|
||||||
|
maxlength="10"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-form-item label="身份证号" prop="idCardNo">
|
<el-form-item label="身份证号" prop="idCardNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="driverForm.idCardNo"
|
v-model="driverForm.idCardNo"
|
||||||
maxlength="18"
|
maxlength="18"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
@input="driverForm.idCardNo = String(driverForm.idCardNo || '').toUpperCase()"
|
placeholder="请输入"
|
||||||
|
@input="handleIdCardInput"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-form-item label="出生年月" prop="birthday">
|
<el-form-item label="出生年月" prop="birthday">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="driverForm.birthday"
|
v-model="driverForm.birthday"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
<el-col :span="6">
|
||||||
<el-row :gutter="18">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="性别" prop="gender">
|
<el-form-item label="性别" prop="gender">
|
||||||
<el-select v-model="driverForm.gender" clearable>
|
<el-select
|
||||||
|
v-model="driverForm.gender"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择"
|
||||||
|
:validate-event="submitAttempted"
|
||||||
|
>
|
||||||
<el-option label="男" value="男" />
|
<el-option label="男" value="男" />
|
||||||
<el-option label="女" value="女" />
|
<el-option label="女" value="女" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-form-item label="民族" prop="nation">
|
<el-form-item label="民族" prop="nation">
|
||||||
<el-select v-model="driverForm.nation" clearable filterable>
|
<el-select v-model="driverForm.nation" clearable filterable placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in nationOptions"
|
v-for="item in nationOptions"
|
||||||
:key="item"
|
:key="item"
|
||||||
@@ -171,9 +182,14 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-form-item label="学历" prop="education">
|
<el-form-item label="学历" prop="education">
|
||||||
<el-select v-model="driverForm.education" clearable filterable>
|
<el-select
|
||||||
|
v-model="driverForm.education"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in educationOptions"
|
v-for="item in educationOptions"
|
||||||
:key="item"
|
:key="item"
|
||||||
@@ -183,36 +199,43 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
<el-col :span="6">
|
||||||
<el-row :gutter="18">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="住址" prop="addressRegion">
|
<el-form-item label="住址" prop="addressRegion">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
ref="addressRegionCascader"
|
ref="addressRegionCascader"
|
||||||
v-model="driverForm.addressRegionPath"
|
v-model="driverForm.addressRegionPath"
|
||||||
:options="regionOptions"
|
:options="regionOptions"
|
||||||
:props="regionCascaderProps"
|
:props="regionCascaderProps"
|
||||||
:placeholder="driverForm.addressRegion || '请选择省市区'"
|
:placeholder="driverForm.addressRegion || '请选择'"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="handleAddressRegionChange"
|
@change="handleAddressRegionChange"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-form-item label="详细地址" prop="address">
|
<el-form-item label="详细地址" prop="address">
|
||||||
<el-input v-model="driverForm.address" maxlength="200" show-word-limit />
|
<el-input
|
||||||
|
v-model="driverForm.address"
|
||||||
|
maxlength="200"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="18">
|
<el-row :gutter="18">
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<el-form-item label="驾驶车辆" prop="drivingVehicle">
|
<el-form-item label="驾驶车辆" prop="drivingVehicle">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="driverForm.drivingVehicle"
|
v-model="driverForm.drivingVehicle"
|
||||||
maxlength="30"
|
maxlength="30"
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入或选择车辆"
|
readonly
|
||||||
|
placeholder="请选择车辆"
|
||||||
|
:disabled="readonly"
|
||||||
|
@clear="driverForm.drivingVehicle = ''"
|
||||||
|
@click="!readonly && openVehicleSelector()"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-tooltip content="选择车辆" placement="top">
|
<el-tooltip content="选择车辆" placement="top">
|
||||||
@@ -238,7 +261,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="18">
|
<el-row :gutter="18">
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<image-upload-field
|
<image-upload-field
|
||||||
label="身份证正面照"
|
label="身份证正面照"
|
||||||
prop="idCardFront"
|
prop="idCardFront"
|
||||||
@@ -249,7 +272,7 @@
|
|||||||
@success="url => handleIdCardUploadSuccess('idCardFront', url)"
|
@success="url => handleIdCardUploadSuccess('idCardFront', url)"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<image-upload-field
|
<image-upload-field
|
||||||
label="身份证反面照"
|
label="身份证反面照"
|
||||||
prop="idCardBack"
|
prop="idCardBack"
|
||||||
@@ -260,7 +283,7 @@
|
|||||||
@success="url => handleIdCardUploadSuccess('idCardBack', url)"
|
@success="url => handleIdCardUploadSuccess('idCardBack', url)"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="6">
|
||||||
<image-upload-field
|
<image-upload-field
|
||||||
label="大头照"
|
label="大头照"
|
||||||
prop="headPhoto"
|
prop="headPhoto"
|
||||||
@@ -284,6 +307,8 @@
|
|||||||
filterable
|
filterable
|
||||||
allow-create
|
allow-create
|
||||||
default-first-option
|
default-first-option
|
||||||
|
placeholder="请选择"
|
||||||
|
:validate-event="submitAttempted"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in drivingTypeOptions"
|
v-for="item in drivingTypeOptions"
|
||||||
@@ -296,7 +321,11 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="档案编号" prop="drivingLicenseNo">
|
<el-form-item label="档案编号" prop="drivingLicenseNo">
|
||||||
<el-input v-model="driverForm.drivingLicenseNo" maxlength="50" />
|
<el-input
|
||||||
|
v-model="driverForm.drivingLicenseNo"
|
||||||
|
maxlength="50"
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
@@ -307,6 +336,7 @@
|
|||||||
type="date"
|
type="date"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="起"
|
placeholder="起"
|
||||||
|
:disabled="driverForm.drivingLicenseLongTerm === 1"
|
||||||
@change="validateFormField('drivingLicenseEndDate')"
|
@change="validateFormField('drivingLicenseEndDate')"
|
||||||
/>
|
/>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -334,7 +364,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="18">
|
<el-row :gutter="18">
|
||||||
<el-col :span="12">
|
<el-col :span="6">
|
||||||
<image-upload-field
|
<image-upload-field
|
||||||
label="驾驶证主页"
|
label="驾驶证主页"
|
||||||
prop="drivingLicenseFront"
|
prop="drivingLicenseFront"
|
||||||
@@ -347,7 +377,7 @@
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="6">
|
||||||
<image-upload-field
|
<image-upload-field
|
||||||
label="驾驶证副页"
|
label="驾驶证副页"
|
||||||
prop="drivingLicenseBack"
|
prop="drivingLicenseBack"
|
||||||
@@ -371,6 +401,8 @@
|
|||||||
v-model="driverForm.qualificationType"
|
v-model="driverForm.qualificationType"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
|
placeholder="请选择"
|
||||||
|
:validate-event="submitAttempted"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in qualificationTypeOptions"
|
v-for="item in qualificationTypeOptions"
|
||||||
@@ -392,13 +424,24 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="有效期" prop="qualificationEndDate">
|
<el-form-item label="有效期" prop="qualificationEndDate">
|
||||||
<el-date-picker
|
<div class="date-range">
|
||||||
v-model="driverForm.qualificationEndDate"
|
<el-date-picker
|
||||||
type="date"
|
v-model="driverForm.qualificationStartDate"
|
||||||
value-format="YYYY-MM-DD"
|
type="date"
|
||||||
:disabled="driverForm.qualificationLongTerm === 1"
|
value-format="YYYY-MM-DD"
|
||||||
@change="validateFormField('qualificationEndDate')"
|
placeholder="起"
|
||||||
/>
|
:disabled="driverForm.qualificationLongTerm === 1"
|
||||||
|
@change="validateFormField('qualificationEndDate')"
|
||||||
|
/>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="driverForm.qualificationEndDate"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="止"
|
||||||
|
:disabled="driverForm.qualificationLongTerm === 1"
|
||||||
|
@change="validateFormField('qualificationEndDate')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
@@ -415,7 +458,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="18">
|
<el-row :gutter="18">
|
||||||
<el-col :span="12">
|
<el-col :span="6">
|
||||||
<image-upload-field
|
<image-upload-field
|
||||||
label="封面页"
|
label="封面页"
|
||||||
prop="qualificationFront"
|
prop="qualificationFront"
|
||||||
@@ -426,7 +469,7 @@
|
|||||||
@success="url => handleQualificationUploadSuccess('qualificationFront', url)"
|
@success="url => handleQualificationUploadSuccess('qualificationFront', url)"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="6">
|
||||||
<image-upload-field
|
<image-upload-field
|
||||||
label="内容页"
|
label="内容页"
|
||||||
prop="qualificationBack"
|
prop="qualificationBack"
|
||||||
@@ -444,7 +487,7 @@
|
|||||||
<el-row :gutter="18">
|
<el-row :gutter="18">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="司机类型" prop="driverType">
|
<el-form-item label="司机类型" prop="driverType">
|
||||||
<el-select v-model="driverForm.driverType" filterable>
|
<el-select v-model="driverForm.driverType" filterable placeholder="请选择">
|
||||||
<el-option label="自有" value="自有" />
|
<el-option label="自有" value="自有" />
|
||||||
<el-option label="外协" value="外协" />
|
<el-option label="外协" value="外协" />
|
||||||
<el-option label="承运管理员" value="承运管理员" />
|
<el-option label="承运管理员" value="承运管理员" />
|
||||||
@@ -453,7 +496,11 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="手机号" prop="mobile">
|
<el-form-item label="手机号" prop="mobile">
|
||||||
<el-input v-model="driverForm.mobile" maxlength="20" />
|
<el-input
|
||||||
|
v-model="driverForm.mobile"
|
||||||
|
maxlength="20"
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
@@ -461,13 +508,18 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="driverForm.emergencyContactName"
|
v-model="driverForm.emergencyContactName"
|
||||||
maxlength="20"
|
maxlength="20"
|
||||||
|
placeholder="请输入"
|
||||||
@input="driverForm.emergencyContactName = removeDigits($event)"
|
@input="driverForm.emergencyContactName = removeDigits($event)"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="紧急联系人手机号" prop="emergencyContactMobile">
|
<el-form-item label="紧急联系人手机号" prop="emergencyContactMobile">
|
||||||
<el-input v-model="driverForm.emergencyContactMobile" maxlength="20" />
|
<el-input
|
||||||
|
v-model="driverForm.emergencyContactMobile"
|
||||||
|
maxlength="20"
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
@@ -478,6 +530,7 @@
|
|||||||
filterable
|
filterable
|
||||||
allow-create
|
allow-create
|
||||||
default-first-option
|
default-first-option
|
||||||
|
placeholder="请选择"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in relationOptions"
|
v-for="item in relationOptions"
|
||||||
@@ -496,7 +549,7 @@
|
|||||||
:props="organizationCascaderProps"
|
:props="organizationCascaderProps"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
placeholder="请选择 所属组织"
|
placeholder="请选择"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -541,8 +594,8 @@
|
|||||||
<template #organizationName="{ row }">
|
<template #organizationName="{ row }">
|
||||||
{{ String(row.organizationName || '').replace(/^[\s\u3000]+/, '') }}
|
{{ String(row.organizationName || '').replace(/^[\s\u3000]+/, '') }}
|
||||||
</template>
|
</template>
|
||||||
<template #boundDriver>
|
<template #boundDriver="{ row }">
|
||||||
<span>-</span>
|
<span>{{ row.boundDriver || '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #certificationStatus="{ row }">
|
<template #certificationStatus="{ row }">
|
||||||
<el-tag :type="getVehicleCertificationStatus(row).type" class="status-text">
|
<el-tag :type="getVehicleCertificationStatus(row).type" class="status-text">
|
||||||
@@ -645,6 +698,7 @@ const emptyForm = () => ({
|
|||||||
drivingLicenseBack: '',
|
drivingLicenseBack: '',
|
||||||
qualificationType: '',
|
qualificationType: '',
|
||||||
qualificationNo: '',
|
qualificationNo: '',
|
||||||
|
qualificationStartDate: '',
|
||||||
qualificationEndDate: '',
|
qualificationEndDate: '',
|
||||||
qualificationLongTerm: 0,
|
qualificationLongTerm: 0,
|
||||||
qualificationFront: '',
|
qualificationFront: '',
|
||||||
@@ -700,6 +754,7 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
readonly: false,
|
readonly: false,
|
||||||
|
submitAttempted: false,
|
||||||
driverForm: emptyForm(),
|
driverForm: emptyForm(),
|
||||||
drivingLicenseUploads: {},
|
drivingLicenseUploads: {},
|
||||||
uploadHeaders: getUploadHeaders(),
|
uploadHeaders: getUploadHeaders(),
|
||||||
@@ -783,18 +838,14 @@ export default {
|
|||||||
drivingType: [{ required: true, message: '请选择准驾车型', trigger: 'change' }],
|
drivingType: [{ required: true, message: '请选择准驾车型', trigger: 'change' }],
|
||||||
drivingLicenseNo: [{ required: true, message: '请输入档案编号', trigger: 'blur' }],
|
drivingLicenseNo: [{ required: true, message: '请输入档案编号', trigger: 'blur' }],
|
||||||
drivingLicenseEndDate: [
|
drivingLicenseEndDate: [
|
||||||
{ validator: this.validateDrivingLicenseEndDate, trigger: 'change' },
|
{ required: true, validator: this.validateDrivingLicenseEndDate, trigger: 'change' },
|
||||||
],
|
|
||||||
drivingLicenseLongTerm: [
|
|
||||||
{ required: true, message: '请选择驾驶证是否长期有效', trigger: 'change' },
|
|
||||||
],
|
],
|
||||||
qualificationType: [
|
qualificationType: [
|
||||||
{ required: true, message: '请选择从业资格认证类型', trigger: 'change' },
|
{ required: true, message: '请选择从业资格认证类型', trigger: 'change' },
|
||||||
],
|
],
|
||||||
qualificationNo: [{ required: true, message: '请输入资格证号', trigger: 'blur' }],
|
qualificationNo: [{ required: true, message: '请输入资格证号', trigger: 'blur' }],
|
||||||
qualificationEndDate: [{ validator: this.validateQualificationEndDate, trigger: 'change' }],
|
qualificationEndDate: [
|
||||||
qualificationLongTerm: [
|
{ required: true, validator: this.validateQualificationEndDate, trigger: 'change' },
|
||||||
{ required: true, message: '请选择从业资格证是否长期有效', trigger: 'change' },
|
|
||||||
],
|
],
|
||||||
driverType: [{ required: true, message: '请选择司机类型', trigger: 'change' }],
|
driverType: [{ required: true, message: '请选择司机类型', trigger: 'change' }],
|
||||||
mobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
mobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
||||||
@@ -1029,19 +1080,33 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
validateDrivingLicenseEndDate(rule, value, callback) {
|
validateDrivingLicenseEndDate(rule, value, callback) {
|
||||||
|
// 勾选长期有效:起止均已禁用,不再校验
|
||||||
|
if (this.driverForm.drivingLicenseLongTerm === 1) {
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!this.driverForm.drivingLicenseStartDate) {
|
if (!this.driverForm.drivingLicenseStartDate) {
|
||||||
callback(new Error('请选择驾驶证有效期起'));
|
callback(new Error('请选择驾驶证有效期起'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.driverForm.drivingLicenseLongTerm !== 1 && !value) {
|
if (!value) {
|
||||||
callback(new Error('请选择驾驶证有效期止'));
|
callback(new Error('请选择驾驶证有效期止'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
validateQualificationEndDate(rule, value, callback) {
|
validateQualificationEndDate(rule, value, callback) {
|
||||||
if (this.driverForm.qualificationLongTerm !== 1 && !value) {
|
// 勾选长期有效:起止均已禁用,不再校验
|
||||||
callback(new Error('请选择从业资格证有效期'));
|
if (this.driverForm.qualificationLongTerm === 1) {
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.driverForm.qualificationStartDate) {
|
||||||
|
callback(new Error('请选择从业资格证有效期起'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!value) {
|
||||||
|
callback(new Error('请选择从业资格证有效期止'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
@@ -1056,8 +1121,29 @@ export default {
|
|||||||
removeDigits(value = '') {
|
removeDigits(value = '') {
|
||||||
return String(value).replace(/\d/g, '');
|
return String(value).replace(/\d/g, '');
|
||||||
},
|
},
|
||||||
|
handleIdCardInput(value) {
|
||||||
|
const idCardNo = String(value || '').toUpperCase();
|
||||||
|
this.driverForm.idCardNo = idCardNo;
|
||||||
|
const idCardInfo = this.parseIdCardInfo(idCardNo);
|
||||||
|
if (idCardInfo.birthday) {
|
||||||
|
this.driverForm.birthday = idCardInfo.birthday;
|
||||||
|
} else {
|
||||||
|
this.driverForm.birthday = '';
|
||||||
|
}
|
||||||
|
if (idCardInfo.gender) {
|
||||||
|
this.driverForm.gender = idCardInfo.gender;
|
||||||
|
} else {
|
||||||
|
this.driverForm.gender = '';
|
||||||
|
}
|
||||||
|
if (this.submitAttempted) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.driverForm?.validateField(['idCardNo', 'birthday', 'gender']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
openDriver(row, readonly = false) {
|
openDriver(row, readonly = false) {
|
||||||
this.readonly = readonly;
|
this.readonly = readonly;
|
||||||
|
this.submitAttempted = false;
|
||||||
if (!row?.id) {
|
if (!row?.id) {
|
||||||
this.driverForm = emptyForm();
|
this.driverForm = emptyForm();
|
||||||
this.driverForm.organizationName = this.getCurrentOrganizationName();
|
this.driverForm.organizationName = this.getCurrentOrganizationName();
|
||||||
@@ -1082,6 +1168,7 @@ export default {
|
|||||||
this.driverForm = emptyForm();
|
this.driverForm = emptyForm();
|
||||||
this.drivingLicenseUploads = {};
|
this.drivingLicenseUploads = {};
|
||||||
this.readonly = false;
|
this.readonly = false;
|
||||||
|
this.submitAttempted = false;
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
this.$refs.driverForm?.clearValidate();
|
this.$refs.driverForm?.clearValidate();
|
||||||
},
|
},
|
||||||
@@ -1544,6 +1631,7 @@ export default {
|
|||||||
this.$refs.driverForm?.validateField(prop);
|
this.$refs.driverForm?.validateField(prop);
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
this.submitAttempted = true;
|
||||||
this.$refs.driverForm.validate(valid => {
|
this.$refs.driverForm.validate(valid => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
@@ -1553,6 +1641,7 @@ export default {
|
|||||||
birthday: this.normalizeBirthday(this.driverForm.birthday),
|
birthday: this.normalizeBirthday(this.driverForm.birthday),
|
||||||
drivingLicenseStartDate: this.normalizeBirthday(this.driverForm.drivingLicenseStartDate),
|
drivingLicenseStartDate: this.normalizeBirthday(this.driverForm.drivingLicenseStartDate),
|
||||||
drivingLicenseEndDate: this.normalizeBirthday(this.driverForm.drivingLicenseEndDate),
|
drivingLicenseEndDate: this.normalizeBirthday(this.driverForm.drivingLicenseEndDate),
|
||||||
|
qualificationStartDate: this.normalizeBirthday(this.driverForm.qualificationStartDate),
|
||||||
qualificationEndDate: this.normalizeBirthday(this.driverForm.qualificationEndDate),
|
qualificationEndDate: this.normalizeBirthday(this.driverForm.qualificationEndDate),
|
||||||
qualificationNo: this.driverForm.qualificationNo || this.driverForm.idCardNo,
|
qualificationNo: this.driverForm.qualificationNo || this.driverForm.idCardNo,
|
||||||
posts: this.driverForm.postList.join(','),
|
posts: this.driverForm.postList.join(','),
|
||||||
@@ -1740,6 +1829,31 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.driver-form {
|
.driver-form {
|
||||||
|
:deep(.el-form-item__label) {
|
||||||
|
flex: 0 0 calc(4em + 24px) !important;
|
||||||
|
width: calc(4em + 24px) !important;
|
||||||
|
height: auto;
|
||||||
|
white-space: normal !important;
|
||||||
|
word-break: break-all;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item.is-required .el-form-item__label) {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item.is-required .el-form-item__label::before) {
|
||||||
|
display: inline-block;
|
||||||
|
height: 18px;
|
||||||
|
line-height: 18px;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.el-date-editor.el-input),
|
:deep(.el-date-editor.el-input),
|
||||||
:deep(.el-date-editor.el-input__wrapper),
|
:deep(.el-date-editor.el-input__wrapper),
|
||||||
:deep(.el-cascader),
|
:deep(.el-cascader),
|
||||||
@@ -1752,6 +1866,12 @@ export default {
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-range :deep(.el-date-editor) {
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,430 @@
|
|||||||
|
<template>
|
||||||
|
<basic-container class="vehicle-dispatch-page">
|
||||||
|
<avue-crud
|
||||||
|
ref="crud"
|
||||||
|
v-model="form"
|
||||||
|
v-model:page="page"
|
||||||
|
:data="data"
|
||||||
|
:option="option"
|
||||||
|
:permission="permissionList"
|
||||||
|
:table-loading="loading"
|
||||||
|
:before-open="beforeOpen"
|
||||||
|
@row-save="rowSave"
|
||||||
|
@row-update="rowUpdate"
|
||||||
|
@search-change="searchChange"
|
||||||
|
@search-reset="searchReset"
|
||||||
|
@selection-change="selectionChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
@refresh-change="refreshChange"
|
||||||
|
@on-load="onLoad"
|
||||||
|
>
|
||||||
|
<template #menu-left>
|
||||||
|
<el-button
|
||||||
|
v-if="hasPermission('vehicle_dispatch_add')"
|
||||||
|
type="primary"
|
||||||
|
@click="$refs.crud.rowAdd()"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="hasPermission('vehicle_dispatch_export')"
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
>
|
||||||
|
导出
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<template #applicationNo="{ row }">
|
||||||
|
<el-link type="primary" @click="$refs.crud.rowView(row)">{{ row.applicationNo }}</el-link>
|
||||||
|
</template>
|
||||||
|
<template #plateNo-form>
|
||||||
|
<el-autocomplete
|
||||||
|
class="vehicle-dispatch-form-control"
|
||||||
|
v-model="form.plateNo"
|
||||||
|
value-key="value"
|
||||||
|
clearable
|
||||||
|
:fetch-suggestions="fetchVehicleSuggestions"
|
||||||
|
:disabled="dialogType === 'view'"
|
||||||
|
placeholder="请选择车牌号"
|
||||||
|
@input="handleVehicleInput"
|
||||||
|
@select="handleVehicleSelect"
|
||||||
|
@blur="handleVehicleBlur"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #useDepartment-form>
|
||||||
|
<el-cascader
|
||||||
|
class="vehicle-dispatch-form-control"
|
||||||
|
v-model="deptCascaderValue"
|
||||||
|
:options="deptOptions"
|
||||||
|
:props="deptCascaderProps"
|
||||||
|
:disabled="dialogType === 'view'"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择使用部门"
|
||||||
|
@change="handleDepartmentChange"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #attachments-form>
|
||||||
|
<vehicle-attachment-table v-model="form.attachments" :readonly="dialogType === 'view'" />
|
||||||
|
</template>
|
||||||
|
<template #approvalStatus="{ row }">
|
||||||
|
<el-tag :type="statusTagType(row.approvalStatus)" class="status-text">
|
||||||
|
{{ statusName(row.approvalStatus) }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
<template #menu="{ row }">
|
||||||
|
<el-link
|
||||||
|
v-if="hasPermission('vehicle_dispatch_view')"
|
||||||
|
type="primary"
|
||||||
|
@click="$refs.crud.rowView(row)"
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="
|
||||||
|
hasPermission('vehicle_dispatch_edit') &&
|
||||||
|
['draft', 'rejected'].includes(row.approvalStatus)
|
||||||
|
"
|
||||||
|
type="primary"
|
||||||
|
@click="$refs.crud.rowEdit(row)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="hasPermission('vehicle_dispatch_submit') && row.approvalStatus === 'draft'"
|
||||||
|
type="primary"
|
||||||
|
@click="handleSubmitApproval(row)"
|
||||||
|
>
|
||||||
|
提交
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="hasPermission('vehicle_dispatch_approve') && row.approvalStatus === 'reviewing'"
|
||||||
|
type="success"
|
||||||
|
@click="handleApprove(row)"
|
||||||
|
>
|
||||||
|
审核通过
|
||||||
|
</el-link>
|
||||||
|
<el-link
|
||||||
|
v-if="
|
||||||
|
hasPermission('vehicle_dispatch_delete') &&
|
||||||
|
['draft', 'rejected'].includes(row.approvalStatus)
|
||||||
|
"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(row.id)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</avue-crud>
|
||||||
|
<empty-pagination
|
||||||
|
:page="page"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
@load="onLoad(page, query)"
|
||||||
|
/>
|
||||||
|
</basic-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import {
|
||||||
|
approve,
|
||||||
|
exportVehicleDispatch,
|
||||||
|
getDetail,
|
||||||
|
getList,
|
||||||
|
remove,
|
||||||
|
submit,
|
||||||
|
submitApproval,
|
||||||
|
} from '@/api/transportCapacity/vehicle-dispatch';
|
||||||
|
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
||||||
|
import { getDeptTree } from '@/api/system/dept';
|
||||||
|
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||||
|
import { option, statusName } from '@/option/transportCapacity/vehicle-dispatch';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
VehicleAttachmentTable,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
option,
|
||||||
|
form: {},
|
||||||
|
query: {},
|
||||||
|
dialogType: '',
|
||||||
|
deptOptions: [],
|
||||||
|
deptCascaderValue: [],
|
||||||
|
selectedVehicleValue: '',
|
||||||
|
data: [],
|
||||||
|
loading: false,
|
||||||
|
selectionList: [],
|
||||||
|
page: { pageSize: 10, pageSizes: [10, 20, 50, 100], currentPage: 1, total: 0 },
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initDepartmentTree();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['permission', 'userInfo']),
|
||||||
|
permissionList() {
|
||||||
|
return { addBtn: this.hasPermission('vehicle_dispatch_add') };
|
||||||
|
},
|
||||||
|
deptCascaderProps() {
|
||||||
|
return { label: 'title', value: 'id', children: 'children', checkStrictly: true };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
statusName,
|
||||||
|
hasPermission(code) {
|
||||||
|
return (
|
||||||
|
String(this.userInfo?.authority || '').includes('admin') || this.permission?.[code] === true
|
||||||
|
);
|
||||||
|
},
|
||||||
|
statusTagType(status) {
|
||||||
|
return { approved: 'success', reviewing: 'warning', rejected: 'danger' }[status] || 'info';
|
||||||
|
},
|
||||||
|
formatAttachments(value) {
|
||||||
|
if (!value) return '';
|
||||||
|
if (Array.isArray(value)) return `${value.length} 个`;
|
||||||
|
if (typeof value !== 'string') return '1 个';
|
||||||
|
try {
|
||||||
|
const attachments = JSON.parse(value);
|
||||||
|
return Array.isArray(attachments) ? `${attachments.length} 个` : '1 个';
|
||||||
|
} catch (error) {
|
||||||
|
return `${value.split(',').filter(item => item.trim()).length} 个`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
parseAttachments(value) {
|
||||||
|
if (!value || Array.isArray(value)) return value || [];
|
||||||
|
if (typeof value !== 'string') return [];
|
||||||
|
try {
|
||||||
|
const attachments = JSON.parse(value);
|
||||||
|
return Array.isArray(attachments) ? attachments : [];
|
||||||
|
} catch (error) {
|
||||||
|
return value
|
||||||
|
.split(',')
|
||||||
|
.map(item => ({ name: item.trim(), url: item.trim() }))
|
||||||
|
.filter(item => item.url);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stringifyAttachments(value) {
|
||||||
|
if (!value || typeof value === 'string') return value;
|
||||||
|
return JSON.stringify(value);
|
||||||
|
},
|
||||||
|
normalizeRow(row) {
|
||||||
|
const values = { ...row };
|
||||||
|
values.attachments = this.stringifyAttachments(values.attachments);
|
||||||
|
return values;
|
||||||
|
},
|
||||||
|
rowSave(row, done, loading) {
|
||||||
|
if (!this.selectedVehicleValue || row.plateNo !== this.selectedVehicleValue) {
|
||||||
|
this.$message.warning('请选择车牌号');
|
||||||
|
loading();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
submit(this.normalizeRow(row))
|
||||||
|
.then(() => {
|
||||||
|
this.onLoad();
|
||||||
|
this.$message.success('操作成功');
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(() => loading());
|
||||||
|
},
|
||||||
|
rowUpdate(row, index, done, loading) {
|
||||||
|
this.rowSave(row, done, loading);
|
||||||
|
},
|
||||||
|
beforeOpen(done, type) {
|
||||||
|
if (['edit', 'view'].includes(type)) {
|
||||||
|
this.dialogType = type;
|
||||||
|
getDetail(this.form.id)
|
||||||
|
.then(res => {
|
||||||
|
this.form = res.data.data || {};
|
||||||
|
this.form.attachments = this.parseAttachments(this.form.attachments);
|
||||||
|
this.form.applicantName = this.form.createUserName || '';
|
||||||
|
this.form.applyTime = this.form.createTime || '';
|
||||||
|
this.selectedVehicleValue = this.form.plateNo || '';
|
||||||
|
this.deptCascaderValue = this.findDepartmentPath(this.form.useDepartment);
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(() => done());
|
||||||
|
} else {
|
||||||
|
this.dialogType = 'add';
|
||||||
|
this.deptCascaderValue = [];
|
||||||
|
this.selectedVehicleValue = '';
|
||||||
|
this.form.attachments = [];
|
||||||
|
this.form.approvalStatus = 'draft';
|
||||||
|
this.form.vehicleType = '';
|
||||||
|
this.form.applicantName =
|
||||||
|
this.userInfo?.realName || this.userInfo?.userName || this.userInfo?.account || '';
|
||||||
|
this.form.applyTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initDepartmentTree() {
|
||||||
|
getDeptTree(this.userInfo?.tenantId)
|
||||||
|
.then(res => {
|
||||||
|
this.deptOptions = this.filterExternalDepartments(res.data.data || []);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.deptOptions = [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
filterExternalDepartments(tree) {
|
||||||
|
return (tree || [])
|
||||||
|
.filter(item => (item.title || item.deptName || item.name) !== '外部组织')
|
||||||
|
.map(item => ({
|
||||||
|
...item,
|
||||||
|
children: this.filterExternalDepartments(item.children),
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
findDepartmentPath(departmentName, tree = this.deptOptions, parents = []) {
|
||||||
|
if (!departmentName) return [];
|
||||||
|
for (const item of tree || []) {
|
||||||
|
const path = [...parents, item.id];
|
||||||
|
const itemName = item.title || item.deptName || item.name;
|
||||||
|
if (itemName === departmentName) return path;
|
||||||
|
const matched = this.findDepartmentPath(departmentName, item.children, path);
|
||||||
|
if (matched.length) return matched;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
findDepartmentNode(id, tree = this.deptOptions) {
|
||||||
|
for (const item of tree || []) {
|
||||||
|
if (String(item.id) === String(id)) return item;
|
||||||
|
const matched = this.findDepartmentNode(id, item.children);
|
||||||
|
if (matched) return matched;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
handleDepartmentChange(value) {
|
||||||
|
const node = this.findDepartmentNode(value?.[value.length - 1]);
|
||||||
|
this.form.useDepartment = node ? node.title || node.deptName || node.name || '' : '';
|
||||||
|
},
|
||||||
|
fetchVehicleSuggestions(queryString, callback) {
|
||||||
|
getVehicleList(1, 9999, {
|
||||||
|
plateNo: queryString || '',
|
||||||
|
status: 1,
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
const records = res.data.data?.records || [];
|
||||||
|
callback(
|
||||||
|
records.map(item => ({
|
||||||
|
value: item.plateNo,
|
||||||
|
organizationName: item.organizationName,
|
||||||
|
vehicleType: item.vehicleType,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch(() => callback([]));
|
||||||
|
},
|
||||||
|
handleVehicleSelect(vehicle) {
|
||||||
|
this.form.plateNo = vehicle.value;
|
||||||
|
this.form.organizationName = vehicle.organizationName || '';
|
||||||
|
this.form.vehicleType = vehicle.vehicleType || '';
|
||||||
|
this.selectedVehicleValue = vehicle.value;
|
||||||
|
},
|
||||||
|
handleVehicleInput(value) {
|
||||||
|
if (value !== this.selectedVehicleValue) {
|
||||||
|
this.selectedVehicleValue = '';
|
||||||
|
this.form.organizationName = '';
|
||||||
|
this.form.vehicleType = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleVehicleBlur() {
|
||||||
|
if (this.form.plateNo && this.form.plateNo !== this.selectedVehicleValue) {
|
||||||
|
this.form.plateNo = '';
|
||||||
|
this.form.organizationName = '';
|
||||||
|
this.form.vehicleType = '';
|
||||||
|
this.$message.warning('请从下拉列表中选择车牌号');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSubmitApproval(row) {
|
||||||
|
this.$confirm('确定提交该车辆调度申请吗?', '提示', { type: 'warning' })
|
||||||
|
.then(() => submitApproval(row.id))
|
||||||
|
.then(() => {
|
||||||
|
this.$message.success('提交成功');
|
||||||
|
this.onLoad();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleApprove(row) {
|
||||||
|
this.$confirm('审核通过后将同步更新车辆使用部门,确认继续吗?', '提示', { type: 'warning' })
|
||||||
|
.then(() => approve(row.id))
|
||||||
|
.then(() => {
|
||||||
|
this.$message.success('审核通过');
|
||||||
|
this.onLoad();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(ids) {
|
||||||
|
const targetIds = ids || this.selectionList.map(item => item.id).join(',');
|
||||||
|
if (!targetIds) return this.$message.warning('请选择至少一条数据');
|
||||||
|
this.$confirm('确定删除所选数据,删除后不可恢复?', '提示', { type: 'warning' })
|
||||||
|
.then(() => remove(targetIds))
|
||||||
|
.then(() => {
|
||||||
|
this.$message.success('操作成功');
|
||||||
|
this.onLoad();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleExport() {
|
||||||
|
exportVehicleDispatch(this.query).then(res => {
|
||||||
|
const blob = new Blob([res.data]);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = URL.createObjectURL(blob);
|
||||||
|
link.download = `车辆调度${this.$dayjs().format('YYYYMMDDHHmmss')}.xlsx`;
|
||||||
|
link.click();
|
||||||
|
URL.revokeObjectURL(link.href);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
searchChange(params, done) {
|
||||||
|
this.query = { ...params };
|
||||||
|
this.page.currentPage = 1;
|
||||||
|
this.onLoad();
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
searchReset() {
|
||||||
|
this.query = {};
|
||||||
|
this.page.currentPage = 1;
|
||||||
|
this.onLoad();
|
||||||
|
},
|
||||||
|
selectionChange(list) {
|
||||||
|
this.selectionList = list;
|
||||||
|
},
|
||||||
|
currentChange(currentPage) {
|
||||||
|
this.page.currentPage = currentPage;
|
||||||
|
this.onLoad();
|
||||||
|
},
|
||||||
|
sizeChange(pageSize) {
|
||||||
|
this.page.pageSize = pageSize;
|
||||||
|
this.page.currentPage = 1;
|
||||||
|
this.onLoad();
|
||||||
|
},
|
||||||
|
refreshChange() {
|
||||||
|
this.onLoad();
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.loading = true;
|
||||||
|
return getList(this.page.currentPage, this.page.pageSize, this.query)
|
||||||
|
.then(res => {
|
||||||
|
const result = res.data.data || {};
|
||||||
|
this.data = result.records || [];
|
||||||
|
this.page.total = result.total || 0;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.vehicle-dispatch-page :deep(.avue-crud__header) {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.vehicle-dispatch-page :deep(.el-link + .el-link) {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
.vehicle-dispatch-page :deep(.vehicle-dispatch-form-control) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -60,15 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
clearable
|
:loading="vehicleOptionsLoading"
|
||||||
:placeholder="vehicleNoPlaceholder"
|
:placeholder="vehicleNoPlaceholder"
|
||||||
value-key="value"
|
clearable
|
||||||
class="accident-record-page__input"
|
filterable
|
||||||
/>
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #directEconomicLossForm>
|
<template #directEconomicLossForm>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -162,6 +191,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -183,7 +215,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
const ids = [];
|
const ids = [];
|
||||||
@@ -215,27 +247,41 @@ export default {
|
|||||||
const vehicleTypeColumn = this.findColumn(this.option.column, 'vehicleType');
|
const vehicleTypeColumn = this.findColumn(this.option.column, 'vehicleType');
|
||||||
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
||||||
vehicleNoColumn.placeholder =
|
vehicleNoColumn.placeholder =
|
||||||
vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
vehicleTypeColumn.disabled = Boolean(this.form.id);
|
vehicleTypeColumn.disabled = Boolean(this.form.id);
|
||||||
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue && this.form.vehicleNo) {
|
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatAttachments(value) {
|
formatAttachments(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
@@ -392,6 +438,8 @@ export default {
|
|||||||
vehicleType: '车辆',
|
vehicleType: '车辆',
|
||||||
};
|
};
|
||||||
this.updateVehicleTypeDisplays('车辆');
|
this.updateVehicleTypeDisplays('车辆');
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
this.isDetailLoading = true;
|
this.isDetailLoading = true;
|
||||||
@@ -402,6 +450,8 @@ export default {
|
|||||||
detail.vehicleType = detail.vehicleType || '车辆';
|
detail.vehicleType = detail.vehicleType || '车辆';
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
this.updateVehicleTypeDisplays(detail.vehicleType);
|
this.updateVehicleTypeDisplays(detail.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(detail.vehicleNo || '');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isDetailLoading = false;
|
this.isDetailLoading = false;
|
||||||
|
|||||||
@@ -54,21 +54,70 @@
|
|||||||
>批量删除
|
>批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
<template #header>
|
||||||
|
<el-tabs
|
||||||
|
v-model="query.expireStatus"
|
||||||
|
type="card"
|
||||||
|
class="annual-inspection-record-page__expiry-tabs"
|
||||||
|
@tab-change="handleExpireChange"
|
||||||
|
>
|
||||||
|
<el-tab-pane
|
||||||
|
v-for="item in expiryTagOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="`${item.label}(${expiryStat[item.statKey] || 0})`"
|
||||||
|
:name="item.value"
|
||||||
|
/>
|
||||||
|
</el-tabs>
|
||||||
|
</template>
|
||||||
<template #vehicleNo="{ row, index }">
|
<template #vehicleNo="{ row, index }">
|
||||||
<el-button type="primary" link @click="$refs.crud.rowView(row, index)">
|
<el-button type="primary" link @click="$refs.crud.rowView(row, index)">
|
||||||
{{ row.vehicleNo }}
|
{{ row.vehicleNo }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
<template #validUntilDate="{ row }">
|
||||||
|
<span :class="{ 'annual-inspection-record-page__expiring': isValidUntilExpiringSoon(row) }">
|
||||||
|
{{ row.validUntilDate || '' }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
clearable
|
clearable
|
||||||
placeholder="输入车牌号/船号查询选择"
|
filterable
|
||||||
value-key="value"
|
remote
|
||||||
class="annual-inspection-record-page__input"
|
:remote-method="loadVehicleOptions"
|
||||||
/>
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #feeForm>
|
<template #feeForm>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -93,7 +142,7 @@
|
|||||||
:page="page"
|
:page="page"
|
||||||
@size-change="sizeChange"
|
@size-change="sizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
@load="onLoad(page, query)"
|
@load="onLoad(page, searchForm)"
|
||||||
/>
|
/>
|
||||||
<el-dialog title="年检记录数据导入" append-to-body v-model="excelBox" width="555px">
|
<el-dialog title="年检记录数据导入" append-to-body v-model="excelBox" width="555px">
|
||||||
<avue-form :option="excelOption" v-model="excelForm">
|
<avue-form :option="excelOption" v-model="excelForm">
|
||||||
@@ -108,7 +157,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { add, getDetail, getList, remove, update } from '@/api/vehicle/annual-inspection-record';
|
import {
|
||||||
|
add,
|
||||||
|
getDetail,
|
||||||
|
getExpiryStat,
|
||||||
|
getList,
|
||||||
|
remove,
|
||||||
|
update,
|
||||||
|
} from '@/api/vehicle/annual-inspection-record';
|
||||||
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
||||||
import { getList as getShipList } from '@/api/transportCapacity/transport-ship';
|
import { getList as getShipList } from '@/api/transportCapacity/transport-ship';
|
||||||
import { getDeptTree } from '@/api/system/dept';
|
import { getDeptTree } from '@/api/system/dept';
|
||||||
@@ -129,7 +185,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {},
|
form: {},
|
||||||
query: {},
|
query: { expireStatus: 'all' },
|
||||||
|
searchForm: {},
|
||||||
loading: true,
|
loading: true,
|
||||||
excelBox: false,
|
excelBox: false,
|
||||||
excelForm: {},
|
excelForm: {},
|
||||||
@@ -143,7 +200,11 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
|
expiryStat: { total: 0, within30: 0, expired: 0 },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -170,6 +231,13 @@ export default {
|
|||||||
});
|
});
|
||||||
return ids.join(',');
|
return ids.join(',');
|
||||||
},
|
},
|
||||||
|
expiryTagOptions() {
|
||||||
|
return [
|
||||||
|
{ label: '全部', value: 'all', statKey: 'total' },
|
||||||
|
{ label: '已过期', value: 'expired', statKey: 'expired' },
|
||||||
|
{ label: '30天内', value: 'within30', statKey: 'within30' },
|
||||||
|
];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'form.vehicleType': {
|
'form.vehicleType': {
|
||||||
@@ -183,6 +251,14 @@ export default {
|
|||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
return this.isAdmin || this.validData(this.permission[code], false);
|
return this.isAdmin || this.validData(this.permission[code], false);
|
||||||
},
|
},
|
||||||
|
isValidUntilExpiringSoon(row = {}) {
|
||||||
|
if (!row.validUntilDate) return false;
|
||||||
|
const endDate = this.$dayjs(row.validUntilDate);
|
||||||
|
if (!endDate.isValid()) return false;
|
||||||
|
const today = this.$dayjs().startOf('day');
|
||||||
|
const expireSoonDate = today.add(30, 'day');
|
||||||
|
return !endDate.isAfter(expireSoonDate, 'day');
|
||||||
|
},
|
||||||
initDeptTree() {
|
initDeptTree() {
|
||||||
getDeptTree(this.userInfo.tenantId).then(res => {
|
getDeptTree(this.userInfo.tenantId).then(res => {
|
||||||
const column = this.findColumn(this.option.column, 'createDept');
|
const column = this.findColumn(this.option.column, 'createDept');
|
||||||
@@ -204,25 +280,40 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.form.shipInspectionType = undefined;
|
this.form.shipInspectionType = undefined;
|
||||||
}
|
}
|
||||||
if (!this.form.id && this.form.vehicleNo) {
|
if (!this.form.id) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
// 编辑回显:确保当前值在选项中
|
||||||
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatAttachments(value) {
|
formatAttachments(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
@@ -365,9 +456,10 @@ export default {
|
|||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
this.form = {
|
this.form = {
|
||||||
vehicleType: '车辆',
|
vehicleType: '车辆',
|
||||||
inspectionAssessmentDate: this.$dayjs().format('YYYY-MM-DD'),
|
|
||||||
};
|
};
|
||||||
this.updateVehicleTypeDisplays('车辆');
|
this.updateVehicleTypeDisplays('车辆');
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
getDetail(this.form.id).then(res => {
|
getDetail(this.form.id).then(res => {
|
||||||
@@ -375,16 +467,33 @@ export default {
|
|||||||
detail.attachments = this.parseAttachments(detail.attachments);
|
detail.attachments = this.parseAttachments(detail.attachments);
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
this.updateVehicleTypeDisplays(detail.vehicleType);
|
this.updateVehicleTypeDisplays(detail.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(detail.vehicleNo || '');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
done();
|
done();
|
||||||
},
|
},
|
||||||
|
handleExpireChange(expireStatus) {
|
||||||
|
this.query.expireStatus = expireStatus;
|
||||||
|
this.page.currentPage = 1;
|
||||||
|
this.onLoad(this.page);
|
||||||
|
},
|
||||||
|
refreshStat() {
|
||||||
|
getExpiryStat(this.buildQuery(false)).then(res => {
|
||||||
|
this.expiryStat = {
|
||||||
|
total: res.data.data?.total || 0,
|
||||||
|
within30: res.data.data?.within30 || 0,
|
||||||
|
expired: res.data.data?.expired || 0,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
searchReset() {
|
searchReset() {
|
||||||
this.query = {};
|
this.searchForm = {};
|
||||||
|
this.query = { expireStatus: this.query.expireStatus || 'all' };
|
||||||
this.onLoad(this.page);
|
this.onLoad(this.page);
|
||||||
},
|
},
|
||||||
searchChange(params, done) {
|
searchChange(params, done) {
|
||||||
this.query = params;
|
this.searchForm = params;
|
||||||
this.page.currentPage = 1;
|
this.page.currentPage = 1;
|
||||||
this.onLoad(this.page, params);
|
this.onLoad(this.page, params);
|
||||||
done();
|
done();
|
||||||
@@ -403,16 +512,34 @@ export default {
|
|||||||
this.page.pageSize = pageSize;
|
this.page.pageSize = pageSize;
|
||||||
},
|
},
|
||||||
refreshChange() {
|
refreshChange() {
|
||||||
this.onLoad(this.page, this.query);
|
this.onLoad(this.page, this.searchForm);
|
||||||
|
},
|
||||||
|
buildQuery(includeExpire = true, params = {}) {
|
||||||
|
const values = { ...params, ...this.searchForm };
|
||||||
|
const { inspectionAssessmentDateRange } = values;
|
||||||
|
if (Array.isArray(inspectionAssessmentDateRange) && inspectionAssessmentDateRange.length === 2) {
|
||||||
|
values.inspectionAssessmentDateStart = inspectionAssessmentDateRange[0];
|
||||||
|
values.inspectionAssessmentDateEnd = inspectionAssessmentDateRange[1];
|
||||||
|
}
|
||||||
|
values.inspectionAssessmentDateRange = null;
|
||||||
|
if (
|
||||||
|
includeExpire &&
|
||||||
|
this.query.expireStatus &&
|
||||||
|
this.query.expireStatus !== 'all'
|
||||||
|
) {
|
||||||
|
values.expireStatus = this.query.expireStatus;
|
||||||
|
}
|
||||||
|
return values;
|
||||||
},
|
},
|
||||||
onLoad(page, params = {}) {
|
onLoad(page, params = {}) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getList(page.currentPage, page.pageSize, { ...params, ...this.query })
|
getList(page.currentPage, page.pageSize, this.buildQuery(true, params))
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const data = res.data.data;
|
const data = res.data.data;
|
||||||
this.page.total = data.total;
|
this.page.total = data.total;
|
||||||
this.data = data.records;
|
this.data = data.records;
|
||||||
this.selectionClear();
|
this.selectionClear();
|
||||||
|
this.refreshStat();
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -443,7 +570,7 @@ export default {
|
|||||||
},
|
},
|
||||||
buildExportParams() {
|
buildExportParams() {
|
||||||
return {
|
return {
|
||||||
...this.query,
|
...this.buildQuery(true),
|
||||||
ids: this.ids,
|
ids: this.ids,
|
||||||
exportColumns: JSON.stringify(exportColumns),
|
exportColumns: JSON.stringify(exportColumns),
|
||||||
[this.website.tokenHeader]: getToken(),
|
[this.website.tokenHeader]: getToken(),
|
||||||
@@ -464,6 +591,42 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.annual-inspection-record-page {
|
.annual-inspection-record-page {
|
||||||
|
:deep(.avue-crud__body > .el-card__body) {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
> * {
|
||||||
|
order: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .avue-crud__header {
|
||||||
|
order: 1;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .annual-inspection-record-page__expiry-tabs {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__expiry-tabs {
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
|
||||||
|
:deep(.el-tabs__header) {
|
||||||
|
margin: 0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-tabs__nav) {
|
||||||
|
border-bottom-color: var(--el-border-color-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-tabs__content) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.el-table th .cell),
|
:deep(.el-table th .cell),
|
||||||
:deep(.el-table td .cell) {
|
:deep(.el-table td .cell) {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -472,5 +635,9 @@ export default {
|
|||||||
&__input {
|
&__input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__expiring {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -79,6 +79,27 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
class="equipment-ledger-page__vehicle-select"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
<template #equipmentCodeForm>
|
<template #equipmentCodeForm>
|
||||||
<el-input v-model="form.equipmentCode" disabled />
|
<el-input v-model="form.equipmentCode" disabled />
|
||||||
</template>
|
</template>
|
||||||
@@ -167,7 +188,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
return this.selectionList.map(item => item.id).join(',');
|
return this.selectionList.map(item => item.id).join(',');
|
||||||
|
|||||||
@@ -60,15 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
placeholder="请选择车牌号"
|
||||||
clearable
|
clearable
|
||||||
placeholder="输入车牌号模糊查询选择"
|
filterable
|
||||||
value-key="value"
|
remote
|
||||||
class="etc-record-page__input"
|
:remote-method="loadVehicleOptions"
|
||||||
/>
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
placeholder="请选择车牌号"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #transactionAmountForm>
|
<template #transactionAmountForm>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -138,6 +167,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -176,17 +208,27 @@ export default {
|
|||||||
column.dicData = res.data.data;
|
column.dicData = res.data.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
getVehicleList(1, 20, { plateNo: queryString })
|
getVehicleList(1, 20, { plateNo: queryString })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || []).map(item => item.plateNo).filter(Boolean);
|
||||||
records.map(item => ({
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
value: item.plateNo,
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
}))
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
);
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatAttachments(value) {
|
formatAttachments(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
@@ -341,6 +383,8 @@ export default {
|
|||||||
beforeOpen(done, type) {
|
beforeOpen(done, type) {
|
||||||
this.boxType = type;
|
this.boxType = type;
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
this.form = { dataSource: '手工录入' };
|
this.form = { dataSource: '手工录入' };
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
@@ -348,6 +392,8 @@ export default {
|
|||||||
const detail = res.data.data;
|
const detail = res.data.data;
|
||||||
detail.attachments = this.parseAttachments(detail.attachments);
|
detail.attachments = this.parseAttachments(detail.attachments);
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(this.form.vehicleNo || '');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
done();
|
done();
|
||||||
|
|||||||
@@ -60,14 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
:disabled="boxType === 'view'"
|
||||||
clearable
|
:loading="vehicleOptionsLoading"
|
||||||
:placeholder="vehicleNoPlaceholder"
|
:placeholder="vehicleNoPlaceholder"
|
||||||
value-key="value"
|
clearable
|
||||||
class="insurance-record-page__vehicle-input"
|
filterable
|
||||||
/>
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #insuredAmountForm>
|
<template #insuredAmountForm>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -211,6 +241,9 @@ export default {
|
|||||||
excelForm: {},
|
excelForm: {},
|
||||||
isDetailLoading: false,
|
isDetailLoading: false,
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
option,
|
option,
|
||||||
excelOption,
|
excelOption,
|
||||||
page: {
|
page: {
|
||||||
@@ -226,7 +259,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initDeptTree();
|
this.initDeptTree();
|
||||||
this.initOcrTemplateOptions();
|
this.initOcrTemplateOptions('车辆');
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['permission', 'userInfo']),
|
...mapGetters(['permission', 'userInfo']),
|
||||||
@@ -243,7 +276,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
const ids = [];
|
const ids = [];
|
||||||
@@ -271,9 +304,12 @@ export default {
|
|||||||
updateVehicleTypeDisplays(vehicleType, oldValue) {
|
updateVehicleTypeDisplays(vehicleType, oldValue) {
|
||||||
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
||||||
vehicleNoColumn.placeholder =
|
vehicleNoColumn.placeholder =
|
||||||
vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue && this.form.vehicleNo) {
|
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
|
this.initOcrTemplateOptions(vehicleType, true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
initDeptTree() {
|
initDeptTree() {
|
||||||
@@ -282,8 +318,9 @@ export default {
|
|||||||
column.dicData = res.data.data;
|
column.dicData = res.data.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initOcrTemplateOptions() {
|
initOcrTemplateOptions(vehicleType = '车辆', resetSelected = false) {
|
||||||
getOcrTemplateList(1, 100, {})
|
const type = vehicleType || '车辆';
|
||||||
|
return getOcrTemplateList(1, 100, { vehicleType: type })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data?.records || [];
|
const records = res.data.data?.records || [];
|
||||||
this.ocrTemplateOptions = records.map(item => ({
|
this.ocrTemplateOptions = records.map(item => ({
|
||||||
@@ -293,26 +330,44 @@ export default {
|
|||||||
}));
|
}));
|
||||||
const templateColumn = this.findColumn(this.option.column, 'ocrTemplate');
|
const templateColumn = this.findColumn(this.option.column, 'ocrTemplate');
|
||||||
if (templateColumn) templateColumn.dicData = this.ocrTemplateOptions;
|
if (templateColumn) templateColumn.dicData = this.ocrTemplateOptions;
|
||||||
|
if (resetSelected || !this.ocrTemplateOptions.some(item => item.value === this.form.ocrTemplate)) {
|
||||||
|
this.form.ocrTemplate = this.ocrTemplateOptions[0]?.value || '';
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.ocrTemplateOptions = [];
|
this.ocrTemplateOptions = [];
|
||||||
|
const templateColumn = this.findColumn(this.option.column, 'ocrTemplate');
|
||||||
|
if (templateColumn) templateColumn.dicData = [];
|
||||||
|
if (resetSelected) this.form.ocrTemplate = '';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
normalizeRow(row) {
|
normalizeRow(row) {
|
||||||
const values = { ...row };
|
const values = { ...row };
|
||||||
@@ -421,8 +476,10 @@ export default {
|
|||||||
beforeOpen(done, type) {
|
beforeOpen(done, type) {
|
||||||
this.boxType = type;
|
this.boxType = type;
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
this.form.vehicleType = '车辆';
|
this.form.vehicleType = '车辆';
|
||||||
this.form.ocrTemplate = this.ocrTemplateOptions[0]?.value || '';
|
this.initOcrTemplateOptions('车辆', true);
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
this.isDetailLoading = true;
|
this.isDetailLoading = true;
|
||||||
@@ -432,6 +489,9 @@ export default {
|
|||||||
...res.data.data,
|
...res.data.data,
|
||||||
vehicleType: res.data.data.vehicleType || '车辆',
|
vehicleType: res.data.data.vehicleType || '车辆',
|
||||||
};
|
};
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(this.form.vehicleNo || '');
|
||||||
|
return this.initOcrTemplateOptions(this.form.vehicleType);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isDetailLoading = false;
|
this.isDetailLoading = false;
|
||||||
@@ -548,7 +608,7 @@ export default {
|
|||||||
if (filledCount > 0) {
|
if (filledCount > 0) {
|
||||||
this.$message.success(`保单识别完成,已填充${filledCount}项`);
|
this.$message.success(`保单识别完成,已填充${filledCount}项`);
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('保单识别完成,未匹配到模板字段,请手动填写保险信息');
|
this.$message.warning('未识别到相关字段,请手动填写保险信息');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|||||||
@@ -67,15 +67,44 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
clearable
|
:loading="vehicleOptionsLoading"
|
||||||
:placeholder="vehicleNoPlaceholder"
|
:placeholder="vehicleNoPlaceholder"
|
||||||
value-key="value"
|
clearable
|
||||||
class="maintenance-plan-page__input"
|
filterable
|
||||||
/>
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #address-form>
|
<template #address-form>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -223,6 +252,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
option: {
|
option: {
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
calcHeight: 32,
|
calcHeight: 32,
|
||||||
@@ -264,14 +296,17 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '输入车牌号/船号查询选择',
|
placeholder: '请选择车牌号/船号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号/船号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号/船号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'change' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -513,7 +548,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
let ids = [];
|
let ids = [];
|
||||||
@@ -537,9 +572,11 @@ export default {
|
|||||||
},
|
},
|
||||||
handleVehicleTypeChange(vehicleType) {
|
handleVehicleTypeChange(vehicleType) {
|
||||||
this.updateVehicleType(vehicleType);
|
this.updateVehicleType(vehicleType);
|
||||||
if (!this.form.id && this.form.vehicleNo) {
|
if (!this.form.id) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
}
|
}
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
},
|
},
|
||||||
updateVehicleType(vehicleType) {
|
updateVehicleType(vehicleType) {
|
||||||
const mileageUnit = vehicleType === '船舶' ? '海里' : '公里';
|
const mileageUnit = vehicleType === '船舶' ? '海里' : '公里';
|
||||||
@@ -554,21 +591,33 @@ export default {
|
|||||||
mileageUnitColumn.value = mileageUnit;
|
mileageUnitColumn.value = mileageUnit;
|
||||||
this.form.mileageUnit = mileageUnit;
|
this.form.mileageUnit = mileageUnit;
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatMileage(value, unit) {
|
formatMileage(value, unit) {
|
||||||
if (value === undefined || value === null || value === '') return '';
|
if (value === undefined || value === null || value === '') return '';
|
||||||
@@ -724,6 +773,8 @@ export default {
|
|||||||
this.form.vehicleType = '车辆';
|
this.form.vehicleType = '车辆';
|
||||||
this.form.mileageUnit = '公里';
|
this.form.mileageUnit = '公里';
|
||||||
this.updateVehicleType(this.form.vehicleType);
|
this.updateVehicleType(this.form.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
getDetail(this.form.id).then(res => {
|
getDetail(this.form.id).then(res => {
|
||||||
@@ -739,6 +790,8 @@ export default {
|
|||||||
}
|
}
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
this.updateVehicleType(detail.vehicleType);
|
this.updateVehicleType(detail.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(detail.vehicleNo || '');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
done();
|
done();
|
||||||
|
|||||||
@@ -60,15 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
clearable
|
:loading="vehicleOptionsLoading"
|
||||||
:placeholder="vehicleNoPlaceholder"
|
:placeholder="vehicleNoPlaceholder"
|
||||||
value-key="value"
|
clearable
|
||||||
class="maintenance-record-page__input"
|
filterable
|
||||||
/>
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #address-form>
|
<template #address-form>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -197,6 +226,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
option: {
|
option: {
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
calcHeight: 32,
|
calcHeight: 32,
|
||||||
@@ -237,15 +269,17 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '车牌号/船号',
|
label: '车牌号/船号',
|
||||||
prop: 'vehicleNo',
|
prop: 'vehicleNo',
|
||||||
|
type: 'select',
|
||||||
slot: true,
|
slot: true,
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
searchType: 'input',
|
||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
span: 12,
|
span: 12,
|
||||||
placeholder: '输入车牌号/船号查询选择',
|
placeholder: '请选择车牌号/船号',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: '请输入车牌号/船号', trigger: 'blur' },
|
{ required: true, message: '请选择车牌号/船号', trigger: 'change' },
|
||||||
{ max: 30, message: '最多 30 个字符', trigger: 'blur' },
|
{ max: 30, message: '最多 30 个字符', trigger: 'change' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -487,7 +521,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
let ids = [];
|
let ids = [];
|
||||||
@@ -524,30 +558,44 @@ export default {
|
|||||||
const mileageColumn = this.findColumn(this.option.column, 'mileage');
|
const mileageColumn = this.findColumn(this.option.column, 'mileage');
|
||||||
const mileageUnitColumn = this.findColumn(this.option.column, 'mileageUnit');
|
const mileageUnitColumn = this.findColumn(this.option.column, 'mileageUnit');
|
||||||
vehicleNoColumn.placeholder =
|
vehicleNoColumn.placeholder =
|
||||||
vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
vehicleTypeColumn.disabled = Boolean(this.form.id);
|
vehicleTypeColumn.disabled = Boolean(this.form.id);
|
||||||
mileageColumn.label = `里程/航程数(${mileageUnit})`;
|
mileageColumn.label = `里程/航程数(${mileageUnit})`;
|
||||||
mileageUnitColumn.value = mileageUnit;
|
mileageUnitColumn.value = mileageUnit;
|
||||||
this.form.mileageUnit = mileageUnit;
|
this.form.mileageUnit = mileageUnit;
|
||||||
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue && this.form.vehicleNo) {
|
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatMileage(value, unit) {
|
formatMileage(value, unit) {
|
||||||
if (this.normalizeMileageValue(value) === null) return '';
|
if (this.normalizeMileageValue(value) === null) return '';
|
||||||
@@ -681,6 +729,8 @@ export default {
|
|||||||
mileageUnit: '公里',
|
mileageUnit: '公里',
|
||||||
};
|
};
|
||||||
this.updateVehicleType('车辆');
|
this.updateVehicleType('车辆');
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
this.isDetailLoading = true;
|
this.isDetailLoading = true;
|
||||||
@@ -693,6 +743,8 @@ export default {
|
|||||||
detail.mileage = this.normalizeMileageValue(detail.mileage);
|
detail.mileage = this.normalizeMileageValue(detail.mileage);
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
this.updateVehicleType(detail.vehicleType);
|
this.updateVehicleType(detail.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(detail.vehicleNo || '');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isDetailLoading = false;
|
this.isDetailLoading = false;
|
||||||
|
|||||||
@@ -72,15 +72,44 @@
|
|||||||
<span>{{ formatMileage(row.totalMileage) }}</span>
|
<span>{{ formatMileage(row.totalMileage) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
:disabled="boxType === 'view'"
|
||||||
:disabled="Boolean(form.id)"
|
:loading="vehicleOptionsLoading"
|
||||||
|
placeholder="请选择车牌号"
|
||||||
clearable
|
clearable
|
||||||
placeholder="输入车牌号模糊查询选择"
|
filterable
|
||||||
value-key="value"
|
remote
|
||||||
class="mileage-record-page__input"
|
:remote-method="loadVehicleOptions"
|
||||||
/>
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
placeholder="请选择车牌号"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #previousMonthMileageForm>
|
<template #previousMonthMileageForm>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -213,6 +242,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -251,13 +283,27 @@ export default {
|
|||||||
column.dicData = res.data.data;
|
column.dicData = res.data.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
getVehicleList(1, 20, { plateNo: queryString })
|
getVehicleList(1, 20, { plateNo: queryString })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(records.map(item => ({ value: item.plateNo })));
|
const values = (res.data.data.records || []).map(item => item.plateNo).filter(Boolean);
|
||||||
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatMileage(value) {
|
formatMileage(value) {
|
||||||
if (this.isEmpty(value)) {
|
if (this.isEmpty(value)) {
|
||||||
@@ -446,6 +492,8 @@ export default {
|
|||||||
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
||||||
vehicleNoColumn.disabled = type !== 'add';
|
vehicleNoColumn.disabled = type !== 'add';
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
this.form.vehicleType = '车辆';
|
this.form.vehicleType = '车辆';
|
||||||
this.form.mileageUnit = '公里';
|
this.form.mileageUnit = '公里';
|
||||||
}
|
}
|
||||||
@@ -456,6 +504,8 @@ export default {
|
|||||||
detail.vehicleType = '车辆';
|
detail.vehicleType = '车辆';
|
||||||
detail.mileageUnit = '公里';
|
detail.mileageUnit = '公里';
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(this.form.vehicleNo || '');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
done();
|
done();
|
||||||
|
|||||||
@@ -60,15 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
clearable
|
:loading="vehicleOptionsLoading"
|
||||||
:placeholder="vehicleNoPlaceholder"
|
:placeholder="vehicleNoPlaceholder"
|
||||||
value-key="value"
|
clearable
|
||||||
class="oil-electric-record-page__input"
|
filterable
|
||||||
/>
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #quantityForm>
|
<template #quantityForm>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -171,6 +200,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -192,7 +224,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
const ids = [];
|
const ids = [];
|
||||||
@@ -229,9 +261,11 @@ export default {
|
|||||||
updateVehicleType(vehicleType, oldValue) {
|
updateVehicleType(vehicleType, oldValue) {
|
||||||
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
||||||
vehicleNoColumn.placeholder =
|
vehicleNoColumn.placeholder =
|
||||||
vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue && this.form.vehicleNo) {
|
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateFeeType(feeType) {
|
updateFeeType(feeType) {
|
||||||
@@ -241,21 +275,33 @@ export default {
|
|||||||
this.form.oilProduct = undefined;
|
this.form.oilProduct = undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatAttachments(value) {
|
formatAttachments(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
@@ -415,6 +461,8 @@ export default {
|
|||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
this.form = { vehicleType: '车辆', feeType: '加油', dataSource: '手工录入' };
|
this.form = { vehicleType: '车辆', feeType: '加油', dataSource: '手工录入' };
|
||||||
this.updateVehicleType('车辆');
|
this.updateVehicleType('车辆');
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
this.updateFeeType('加油');
|
this.updateFeeType('加油');
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
@@ -426,6 +474,8 @@ export default {
|
|||||||
detail.vehicleType = detail.vehicleType || '车辆';
|
detail.vehicleType = detail.vehicleType || '车辆';
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
this.updateVehicleType(detail.vehicleType);
|
this.updateVehicleType(detail.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(detail.vehicleNo || '');
|
||||||
this.updateFeeType(detail.feeType);
|
this.updateFeeType(detail.feeType);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -60,15 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
clearable
|
:loading="vehicleOptionsLoading"
|
||||||
:placeholder="vehicleNoPlaceholder"
|
:placeholder="vehicleNoPlaceholder"
|
||||||
value-key="value"
|
clearable
|
||||||
class="other-expense-record-page__input"
|
filterable
|
||||||
/>
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #amountForm>
|
<template #amountForm>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -108,6 +137,7 @@ import { add, getDetail, getList, remove, update } from '@/api/vehicle/other-exp
|
|||||||
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
||||||
import { getList as getShipList } from '@/api/transportCapacity/transport-ship';
|
import { getList as getShipList } from '@/api/transportCapacity/transport-ship';
|
||||||
import { getDeptTree } from '@/api/system/dept';
|
import { getDeptTree } from '@/api/system/dept';
|
||||||
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
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 { openImportDialog } from '@/utils/import-excel';
|
||||||
@@ -140,11 +170,15 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initDeptTree();
|
this.initDeptTree();
|
||||||
|
this.initExpenseTypeOptions();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['permission', 'userInfo']),
|
...mapGetters(['permission', 'userInfo']),
|
||||||
@@ -161,7 +195,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
const ids = [];
|
const ids = [];
|
||||||
@@ -189,29 +223,52 @@ export default {
|
|||||||
column.dicData = res.data.data;
|
column.dicData = res.data.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initExpenseTypeOptions() {
|
||||||
|
getDictionary({ code: 'other_fee_category' }).then(res => {
|
||||||
|
const column = this.findColumn(this.option.column, 'expenseType');
|
||||||
|
column.dicData = (res.data.data || []).map(item => ({
|
||||||
|
label: item.dictValue,
|
||||||
|
value: item.dictValue,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
},
|
||||||
updateVehicleType(vehicleType, oldValue) {
|
updateVehicleType(vehicleType, oldValue) {
|
||||||
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
||||||
vehicleNoColumn.placeholder =
|
vehicleNoColumn.placeholder =
|
||||||
vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue && this.form.vehicleNo) {
|
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatAttachments(value) {
|
formatAttachments(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
@@ -369,6 +426,8 @@ export default {
|
|||||||
dataSource: '手工录入',
|
dataSource: '手工录入',
|
||||||
};
|
};
|
||||||
this.updateVehicleType('车辆');
|
this.updateVehicleType('车辆');
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
this.isDetailLoading = true;
|
this.isDetailLoading = true;
|
||||||
@@ -379,6 +438,8 @@ export default {
|
|||||||
detail.vehicleType = detail.vehicleType || '车辆';
|
detail.vehicleType = detail.vehicleType || '车辆';
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
this.updateVehicleType(detail.vehicleType);
|
this.updateVehicleType(detail.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(detail.vehicleNo || '');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isDetailLoading = false;
|
this.isDetailLoading = false;
|
||||||
|
|||||||
@@ -60,15 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
placeholder="请选择车牌号"
|
||||||
clearable
|
clearable
|
||||||
placeholder="输入车牌号查询选择"
|
filterable
|
||||||
value-key="value"
|
remote
|
||||||
class="tire-replacement-record-page__input"
|
:remote-method="loadVehicleOptions"
|
||||||
/>
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
placeholder="请选择车牌号"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #tireQuantityForm>
|
<template #tireQuantityForm>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -158,6 +187,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -196,13 +228,27 @@ export default {
|
|||||||
column.dicData = res.data.data;
|
column.dicData = res.data.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
getVehicleList(1, 20, { plateNo: queryString })
|
getVehicleList(1, 20, { plateNo: queryString })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(records.map(item => ({ value: item.plateNo })));
|
const values = (res.data.data.records || []).map(item => item.plateNo).filter(Boolean);
|
||||||
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatAttachments(value) {
|
formatAttachments(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
@@ -339,6 +385,8 @@ export default {
|
|||||||
beforeOpen(done, type) {
|
beforeOpen(done, type) {
|
||||||
this.boxType = type;
|
this.boxType = type;
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
this.form = {};
|
this.form = {};
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
@@ -346,6 +394,8 @@ export default {
|
|||||||
const detail = res.data.data;
|
const detail = res.data.data;
|
||||||
detail.attachments = this.parseAttachments(detail.attachments);
|
detail.attachments = this.parseAttachments(detail.attachments);
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(this.form.vehicleNo || '');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
done();
|
done();
|
||||||
|
|||||||
@@ -60,15 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
clearable
|
:loading="vehicleOptionsLoading"
|
||||||
:placeholder="vehicleNoPlaceholder"
|
:placeholder="vehicleNoPlaceholder"
|
||||||
value-key="value"
|
clearable
|
||||||
class="transport-change-record-page__input"
|
filterable
|
||||||
/>
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #attachments="{ row }">
|
<template #attachments="{ row }">
|
||||||
<span>{{ formatAttachments(row.attachments) }}</span>
|
<span>{{ formatAttachments(row.attachments) }}</span>
|
||||||
@@ -134,6 +163,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -155,7 +187,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
const ids = [];
|
const ids = [];
|
||||||
@@ -186,26 +218,40 @@ export default {
|
|||||||
updateVehicleType(vehicleType, oldValue) {
|
updateVehicleType(vehicleType, oldValue) {
|
||||||
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
|
||||||
vehicleNoColumn.placeholder =
|
vehicleNoColumn.placeholder =
|
||||||
vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue && this.form.vehicleNo) {
|
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
formatAttachments(value) {
|
formatAttachments(value) {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
@@ -333,6 +379,8 @@ export default {
|
|||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
this.form = { vehicleType: '车辆' };
|
this.form = { vehicleType: '车辆' };
|
||||||
this.updateVehicleType('车辆');
|
this.updateVehicleType('车辆');
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
this.isDetailLoading = true;
|
this.isDetailLoading = true;
|
||||||
@@ -343,6 +391,8 @@ export default {
|
|||||||
detail.vehicleType = detail.vehicleType || '车辆';
|
detail.vehicleType = detail.vehicleType || '车辆';
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
this.updateVehicleType(detail.vehicleType);
|
this.updateVehicleType(detail.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(detail.vehicleNo || '');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isDetailLoading = false;
|
this.isDetailLoading = false;
|
||||||
|
|||||||
@@ -60,15 +60,44 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #vehicleNoForm>
|
<template #vehicleNoForm>
|
||||||
<el-autocomplete
|
<el-select
|
||||||
v-model="form.vehicleNo"
|
v-model="form.vehicleNo"
|
||||||
:fetch-suggestions="fetchVehicleOptions"
|
|
||||||
:disabled="boxType === 'view'"
|
:disabled="boxType === 'view'"
|
||||||
clearable
|
:loading="vehicleOptionsLoading"
|
||||||
:placeholder="vehicleNoPlaceholder"
|
:placeholder="vehicleNoPlaceholder"
|
||||||
value-key="value"
|
clearable
|
||||||
class="violation-record-page__input"
|
filterable
|
||||||
/>
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
<template #vehicleNo-form>
|
||||||
|
<el-select
|
||||||
|
v-model="form.vehicleNo"
|
||||||
|
:disabled="boxType === 'view'"
|
||||||
|
:loading="vehicleOptionsLoading"
|
||||||
|
:placeholder="vehicleNoPlaceholder"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
:remote-method="loadVehicleOptions"
|
||||||
|
@visible-change="handleVehicleSelectVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicleOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
<template #driverNameForm>
|
<template #driverNameForm>
|
||||||
<el-autocomplete
|
<el-autocomplete
|
||||||
@@ -204,6 +233,9 @@ export default {
|
|||||||
},
|
},
|
||||||
selectionList: [],
|
selectionList: [],
|
||||||
boxType: '',
|
boxType: '',
|
||||||
|
vehicleOptions: [],
|
||||||
|
vehicleOptionsLoading: false,
|
||||||
|
vehicleOptionsRequestId: 0,
|
||||||
data: [],
|
data: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -226,7 +258,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
vehicleNoPlaceholder() {
|
vehicleNoPlaceholder() {
|
||||||
return this.form.vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
return this.form.vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
},
|
},
|
||||||
ids() {
|
ids() {
|
||||||
const ids = [];
|
const ids = [];
|
||||||
@@ -284,7 +316,7 @@ export default {
|
|||||||
const typeColumn = this.findColumn(this.option.column, 'violationType');
|
const typeColumn = this.findColumn(this.option.column, 'violationType');
|
||||||
const itemColumn = this.findColumn(this.option.column, 'violationItem');
|
const itemColumn = this.findColumn(this.option.column, 'violationItem');
|
||||||
vehicleNoColumn.placeholder =
|
vehicleNoColumn.placeholder =
|
||||||
vehicleType === '船舶' ? '输入船号模糊查询选择' : '输入车牌号模糊查询选择';
|
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
|
||||||
driverColumn.label = vehicleType === '船舶' ? '船长' : '驾驶人';
|
driverColumn.label = vehicleType === '船舶' ? '船长' : '驾驶人';
|
||||||
typeColumn.display = vehicleType !== '船舶';
|
typeColumn.display = vehicleType !== '船舶';
|
||||||
itemColumn.display = vehicleType === '船舶';
|
itemColumn.display = vehicleType === '船舶';
|
||||||
@@ -303,6 +335,8 @@ export default {
|
|||||||
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
|
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
|
||||||
this.form.vehicleNo = '';
|
this.form.vehicleNo = '';
|
||||||
this.form.driverName = '';
|
this.form.driverName = '';
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
}
|
}
|
||||||
if (vehicleType === '船舶') {
|
if (vehicleType === '船舶') {
|
||||||
this.form.violationType = undefined;
|
this.form.violationType = undefined;
|
||||||
@@ -317,21 +351,33 @@ export default {
|
|||||||
this.form.processResult = undefined;
|
this.form.processResult = undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fetchVehicleOptions(queryString, callback) {
|
handleVehicleSelectVisible(visible) {
|
||||||
|
if (visible && !this.vehicleOptions.length) this.loadVehicleOptions('');
|
||||||
|
},
|
||||||
|
loadVehicleOptions(queryString = '') {
|
||||||
const vehicleType = this.form.vehicleType || '车辆';
|
const vehicleType = this.form.vehicleType || '车辆';
|
||||||
const request = vehicleType === '船舶' ? getShipList : getVehicleList;
|
const isShip = vehicleType === '船舶';
|
||||||
const params =
|
const request = isShip ? getShipList : getVehicleList;
|
||||||
vehicleType === '船舶' ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
const params = isShip ? { shipIdentifierNo: queryString } : { plateNo: queryString };
|
||||||
|
const requestId = ++this.vehicleOptionsRequestId;
|
||||||
|
this.vehicleOptionsLoading = true;
|
||||||
request(1, 20, params)
|
request(1, 20, params)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const records = res.data.data.records || [];
|
if (requestId !== this.vehicleOptionsRequestId) return;
|
||||||
callback(
|
const values = (res.data.data.records || [])
|
||||||
records.map(item => ({
|
.map(item => (isShip ? item.shipIdentifierNo || item.shipName : item.plateNo))
|
||||||
value: vehicleType === '船舶' ? item.shipIdentifierNo || item.shipName : item.plateNo,
|
.filter(Boolean);
|
||||||
}))
|
this.vehicleOptions = [...new Set(values)].map(value => ({ label: value, value }));
|
||||||
);
|
if (this.form.vehicleNo && !this.vehicleOptions.some(item => item.value === this.form.vehicleNo)) {
|
||||||
|
this.vehicleOptions.unshift({ label: this.form.vehicleNo, value: this.form.vehicleNo });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => callback([]));
|
.catch(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptions = [];
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
if (requestId === this.vehicleOptionsRequestId) this.vehicleOptionsLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
fetchDriverOptions(queryString, callback) {
|
fetchDriverOptions(queryString, callback) {
|
||||||
getDriverList(1, 20, { driverName: queryString })
|
getDriverList(1, 20, { driverName: queryString })
|
||||||
@@ -418,7 +464,7 @@ export default {
|
|||||||
row.violationTime &&
|
row.violationTime &&
|
||||||
new Date(row.violationTime.replace(/-/g, '/')).getTime() > Date.now()
|
new Date(row.violationTime.replace(/-/g, '/')).getTime() > Date.now()
|
||||||
) {
|
) {
|
||||||
this.$message.warning('时间不能超过当前时间');
|
this.$message.warning('日期不能超过当前时间');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Number(row.fineAmount) < 0) {
|
if (Number(row.fineAmount) < 0) {
|
||||||
@@ -512,6 +558,8 @@ export default {
|
|||||||
attachments: [],
|
attachments: [],
|
||||||
};
|
};
|
||||||
this.updateVehicleTypeDisplays('车辆');
|
this.updateVehicleTypeDisplays('车辆');
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions('');
|
||||||
this.updateProcessResultDisplay('已处理');
|
this.updateProcessResultDisplay('已处理');
|
||||||
}
|
}
|
||||||
if (['edit', 'view'].includes(type)) {
|
if (['edit', 'view'].includes(type)) {
|
||||||
@@ -524,6 +572,8 @@ export default {
|
|||||||
detail.processStatus = detail.processStatus || '未处理';
|
detail.processStatus = detail.processStatus || '未处理';
|
||||||
this.form = detail;
|
this.form = detail;
|
||||||
this.updateVehicleTypeDisplays(detail.vehicleType);
|
this.updateVehicleTypeDisplays(detail.vehicleType);
|
||||||
|
this.vehicleOptions = [];
|
||||||
|
this.loadVehicleOptions(detail.vehicleNo || '');
|
||||||
this.updateProcessResultDisplay(detail.processStatus);
|
this.updateProcessResultDisplay(detail.processStatus);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
+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