Commit 1da2cb6c by 岑成威

Merge branch 'SAAS+V5.8.2' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into sass-5.8.2-ccw
2 parents 8a29be0d 25067816
Showing 59 changed files with 1180 additions and 874 deletions
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
## API规范
调用接口时:
* 优先复用现有 API
* 使用项目已有 axios 封装
* 保持统一错误处理
不要直接创建新的请求框架。
## 调试规范
发现问题时:
### 第一步
阅读相关代码:
* 页面
* API
* Vuex
* Router
先理解逻辑再修改。
---
### 第二步
定位问题原因。
不要通过不断试错碰运气修复问题。
---
### 第三步
如果连续两次修改仍未解决:
必须进入系统化分析模式:
1. 分析可能根因
2. 提出验证方案
3. 给出至少3种解决方案
4. 分析优缺点
5. 推荐最终方案
## 表单规范
新增业务表单优先使用:
```text
glsx-combi-form
```
适用场景:
* 新增页面
* 编辑页面
* 弹窗表单
仅在无法满足需求时使用:
```text
el-form
```
并说明原因。
# Git Commit Message 规范
生成 commit message 时必须遵循 **Conventional Commits 规范**。
# Language
默认使用 **简体中文** 输出,包括:
- Git commit message
- Pull Request 描述
- 代码解释
- 技术说明
只有在代码注释或特殊要求时才使用英文。
## AI协作规范
与用户沟通时:
* 使用中文
* 简洁清晰
* 面向业务结果
避免:
* 堆砌术语
* 长篇理论分析
* 无关架构讨论
解释问题时:
向“不懂代码但逻辑清晰的人”解释。
## 本地开发规范
常用命令:
```bash
npm run dev
npm run start
npm run lint
npm run test:unit
```
默认不要执行:
```bash
npm run build
```
仅在:
* 用户明确要求
* 排查构建问题
时执行。
## 路由规范
遵循现有:
```text
router/modules
```
结构。
权限控制与动态路由逻辑保持一致。
不要创建第二套路由体系。
## 状态管理
使用:
```text
Vuex Modules
```
保持与现有 store 结构一致。
不要新增 Pinia。
## UI规范
### UI框架
统一使用:
* Element UI
* D2Admin
新增页面需要保持:
* 间距一致
* 表单风格一致
* 表格风格一致
* 弹窗风格一致
不要引入新的大型UI框架。
File mode changed
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
---
## 项目概述
嘀加智享车生活后台管理系统 (SAAS+) - 基于 Vue 2 + Element UI + D2Admin 的企业级后台管理系统
## 技术栈
| 类别 | 技术 |
|------|------|
| 核心框架 | Vue 2.6.10 + Vue Router 3.0.5 + Vuex 3.0.1 |
| UI 组件 | Element UI 2.13.2 + D2Admin |
| 构建工具 | Vue CLI 5.0.8 + Webpack 5 |
| Node 版本 | 14.21.3 (volta 配置) |
## 开发命令
```bash
# 开发启动
npm run dev # 或 npm run start (兼容旧 OpenSSL)
# 单元测试
npm run test:unit -- tests/unit/xxx.spec.js
npm run test:unit:legacy -- tests/unit/xxx.spec.js # legacy 模式
# E2E 测试
npx playwright test tests/e2e/xxx.spec.js
# 构建
npm run build
npm run build:nomock # 无 Mock 构建
# 代码检查
npm run lint
```
## 常见问题解决
### OpenSSL 参数问题
```bash
# 错误:--openssl-legacy-provider is not allowed in NODE_OPTIONS
# 解决:直接运行或使用 npx
npx vue-cli-service test:unit
npm run test:unit # 已移除 openssl 参数
```
### ES 模块转换问题
```bash
# 错误:SyntaxError: Unexpected token 'export' (lodash-es/nanoid)
# 已在 jest.config.js 配置 transformIgnorePatterns
```
### 测试相关
- Mock API: `jest.mock("@/api/xxx", () => ({ xxxApi: jest.fn() }))`
- 组件测试使用 `shallowMount` + stub 自定义指令
- Mixin inject 问题:`provide: { formContext: null }`
## 代码结构
```
src/
├── api/ # API 接口层 (按业务模块划分)
├── views/ # 页面视图 (24 个业务模块)
├── components/ # 公共组件 (d2-* 系列)
├── router/modules/ # 路由模块 (权限 902-921)
├── store/modules/ # Vuex 模块 (d2admin + 业务模块)
├── plugin/d2admin/ # D2Admin 核心插件
├── common/ # 公共业务逻辑
└── libs/ # 工具库
```
## 业务模块
| 编号 | 模块 | 编号 | 模块 |
|------|------|------|------|
| 902 | 流量管理 | 912 | 驻店管理 |
| 903 | 产品管理 | 913 | 内容管理 |
| 904 | 订单管理 | 914 | 积分管理 |
| 905 | 财务管理 | 915 | 预警管理 |
| 906 | 系统设置 | 916 | 大模型 |
| 907 | 首页 | 917 | 发票管理 |
| 908 | 库存管理 | 918 | 话术管理 |
| 909 | 采购管理 | 919 | 服务中心 |
| 910 | 权益管理 | 920 | 二手车管理 |
| 911 | 车损管理 | 921 | 销售管理 |
## 架构特点
1. **动态路由** - 基于权限的路由和菜单生成
2. **统一 API 层** - 按业务模块划分,统一签名/鉴权机制
3. **D2Admin 封装** - d2-container/d2-table/d2-form 等组件
4. **多环境配置** - .env + .env.development + .env.nomock
## 环境地址
- 开发:http://192.168.3.233:8090/saas_plus/dj-car-life-system
- 测试:http://frontend.test.glsx.com.cn/dj-carlife-web/
- 生产:http://dj.glsx.com.cn/dj-carlife-web/
## 分支管理
主干:`master` / `develop`
# dj-car-life-system — Cursor / AI 工作区规则
## 项目与本仓库技术栈(唯一事实)
- **项目名称**:`dj-car-life-system`
- **产品形态**:嘀加智享车生活 **Web 管理后台 SPA**,与**微信小程序工程、小程序原生 API 无关**。不要按小程序目录或分包去设计功能。
- **构建**:Vue CLI 5(`vue-cli-service`),Webpack 打包;本地常用 `npm run serve` / `npm run start`。
- **核心依赖**:Vue **2.6**,**Vue Router 3**,**Vuex 3**,**Element UI 2**,**axios**(及项目既有封装如 `glsk-toolkit` 等)。
- **工程语言**:主体为 **JavaScript**,与现有 `.vue`、`src/store`、`src/router` 保持一致。**不要默认**把整个项目改写为 Vue 3 / Pinia / `<script setup>` / 全仓库 TypeScript,除非仓库已明确迁移且用户提出要求。
- **UI 与框架**:沿用 **Element UI** 与 **`d2admin` 插件体系**(见 `src/plugin/d2admin`),新页面样式与全局布局应与现有后台一致。
- **非本仓库技术栈**:**Next.js / App Router / React** 等不适用;勿在方案中预设这些栈。
编写新代码时以 **Vue 2 单文件组件(SFC)**、**Options API**(`export default { … }`)为主,Vuex **模块化**、`store.modules`、路由模块化与 **`src/router`、`src/store`** 现有写法对齐。
Vue 能力与习惯用法参见 [Vue 2 文档](https://v2.cn.vuejs.org/)(中文版),勿以 Vue 3 独有 API(如 Composition API/`ref()` 作为必选规范)为主线。
# 角色与协作方式
你是精通 Vue 2 与中后台开发的工程师,以帮助业务侧完成本后台需求为目标;表达清晰易懂,但不要为了「炫技」而引入与仓库不一致的技术。
# Goal
在用户提出需求后,主动推进需求澄清、方案与实现,尽量减少无效往返。
在理解需求、编写代码和解决问题时,遵循下面**统一的一条流程**,避免多套重复条目。
---
## 第一步:熟悉上下文
- 先阅读项目根目录 **README.md** 与相关代码,理解目标、模块划分和既有实现。
- 若 README 缺失重要说明且用户需要,可补充;**不要**仅为满足规则而大面积改写 README(用户另有要求时除外)。
# 本规则由 AI进化论-花生 创建,版权所有,引用请注明出处
---
## 第二步:需求与实现
### 理解需求
- 站在业务与最终用户角度理解;若存在歧义,用产品化方式追问,补全验收条件。
- 在满足需求的前提下,优先**最简单、可维护**的实现,并与本仓库风格一致。
### 编写代码
- 使用 Vue 2 SFC,组件化拆分;路由与导航、权限与现有 `router` 逻辑一致。
- 使用 **Vuex 3** 管理跨页状态,按模块组织;与 `d2admin`、现有 `store/modules` 模式一致。
- 网络请求使用项目已有 **axios** 封装与工具,不引入与后台无关的「小程序式」请求假设。
- 样式与响应式:管理后台以桌面端为主,与现有 Element + 布局习惯一致;新增页面注意与全局主题、表格/表单规范统一。
- 注释与错误处理:对非显而易见处写清意图;关键请求与用户操作保留必要错误提示(与项目现有 `Message` 等用法一致)。
### 解决问题
- 先通读相关文件,定位原因后再改。
- 善用浏览器 DevTools 与 **Vue DevTools**(Vue 2)排查。
- **当一个 bug 经过两次调整仍未解决时,启动「系统二」思考模式**:
1. 系统性分析可能根因
2. 列出可验证的假设与验证步骤
3. 给出**三种**可行方案,并说明各自优缺点
4. 由用户或场景选择最终方案
---
## 第三步:收尾
- 简要回顾改动与风险点;若涉及可复用模式,可提示后续优化方向(非强制摊派任务)。
---
## 架构与习惯(本仓库内)
1. 未说明技术栈时,**默认即本仓库栈**(Vue 2 + Vue Router 3 + Vuex 3 + Element UI + Vue CLI),不要引入 Next.js / React / 小程序原生作为默认方案。
2. 尽量复用现有目录与抽象,避免重复造轮子;功能块宜按现有习惯拆到独立文件。
3. 尽量不让用户为单次需求安装与项目无关的新运行时或大规模换栈。
## 设计要求
1. 管理后台界面与现有 Element 风格、间距与信息层级保持一致;避免与整站 UI 突兀的「另起一套」。
2. 需要图标时,优先与项目现有 icon/svg 体系一致;必要时可用简洁 SVG。
## 对话风格
1. 先理解用户要达成的结果,必要时追问关键细节。
2. 需求不清时,用简短问题收敛范围。
3. 完成后可客观补充**可选**的后续优化点,不强制。
## 本项目(dj-car-life-system)本地开发约定
- 本地开发**不要自动执行 `npm run build`**(生产构建耗时长,且非日常调试必需)。
- 验证改动优先:本地 **`npm run serve`**(或 `npm run start` / `npm run dev`,见 `package.json`)/ 在 IDE 中看报错;仅当用户明确要求打包、或需排查构建问题时再运行 `npm run build`。
# DJ Car Life System - AI Agent Instructions
## Project Overview
嘀加智享车生活后台系统是一个大型Vue 2企业管理后台系统,涵盖车主生活管理、订单管理、财务清分、员工管理等多个业务领域。支持多个API网关和签名方案。
## Architecture Essentials
### Tech Stack
- **Frontend**: Vue 2.6 + Vue Router 3.0 + Vuex 3.0
- **UI Framework**: Element UI 2.13
- **Build**: Vue CLI 5 + Webpack 5 + Babel
- **HTTP**: Axios with custom signing layer
- **State Management**: Vuex with d2admin framework module
- **Node Version**: 14.21.3
### Project Structure
```
src/
├── api/ # API layer with custom request signing (~50+ service files)
├── views/ # 23+ feature modules (financeManage/, salesManagement/, etc.)
├── router/ # Dynamic route loading with permission checks
├── store/ # Vuex modules (d2admin, goodsInfoData, FinancialRules)
├── common/ # Shared utilities & configs (baseConfig.js, util.js, format.js)
├── components/ # Reusable UI components
├── plugin/ # Core plugins (d2admin framework, axios, error handling)
└── assets/ # Style, SVG icons, localization resources
```
## Critical Development Patterns
### 1. API Request Layer Architecture
The system uses a **custom ROP (Request-Over-Protocol) gateway pattern** with multiple API endpoints:
```javascript
// Each API file (api/account.js, api/orderManage.js, etc.) follows:
import request from './request'
const path = 'dj.api.smartcarlife.'
export function getListApi(data) {
data.method = `${path}orderDivision.page` // Service method name
return request(data, 'post')
}
```
**Key Points**:
- `data.method` determines which backend service is invoked (not the URL)
- `request()` in [src/api/request.js](src/api/request.js) handles:
- API routing via `baseConfig[apiName]` mappings (axios, axios2-10, axios_strategy)
- Request signing (SHA1/MD5) based on method prefix
- Session token injection from cookies
- Multiple API gateways: dj, scrm, merchants, reportExport, riskmanage, strategy
### 2. Multi-Gateway Routing
[src/api/request.js#L18-L66](src/api/request.js#L18-L66) contains the routing logic:
- `dj.api.smartcarlife.*` → axios (main gateway)
- `dj.api.script.*` → axios7 (script service)
- `risk.manage.api.*` → axios10 (risk management)
- `scrm.api.shopmall.*` → axios2 (SCRM shopping)
- Each maps to different `appkey/secret` in [src/common/baseConfig.js](src/common/baseConfig.js)
### 3. State Management
Vuex store structure ([src/store/modules/](src/store/modules/)):
- **d2admin**: Main framework state (page navigation, auth, search, themes)
- **goodsInfoData**: Product information shared across modules
- **FinancialRules**: Financial configuration rules
- **performanceFormStore**: Resident management performance data
Access pattern: `this.$store.dispatch('d2admin/page/currentSet', path)`
### 4. Router & Permission System
[src/router/index.js](src/router/index.js):
- Dynamic route loading from Vuex auth state
- Router guards intercept all navigation (`router.beforeEach`)
- NProgress bar shows loading state
- Permission source comes from `store.state.d2admin.auth.source`
### 5. View Module Organization
Features live in [src/views/](src/views/) folders with encapsulated patterns:
```
views/
├── financeManage/ # Financial clearing & reconciliation
├── salesManagement/ # Sales dashboards & analytics
├── orderManage/ # Order lifecycle management
├── residentManage/ # Resident info & performance tracking
├── goods/ # Product management & SKU
└── invoiceManage/ # Invoice generation & tracking
```
Each module can have local stores, components, and APIs.
## Build & Development Workflow
### Commands
```bash
npm run dev # Local development (with --openssl-legacy-provider flag)
npm run build # Production build
npm run build:nomock # Build without mock data
npm run lint # ESLint fix
npm run test:unit # Jest unit tests
npm run report # Build with webpack report
```
### Configuration
- **Base path**: `/dj-carlife-web/` (set in [vue.config.js](vue.config.js))
- **CDN**: https://img02.glsx.com.cn/dj-carlife-web for assets
- **Mock support**: Via [src/mock/d2-mock/](src/mock/d2-mock/) (mockjs-based)
- **Sentry integration**: Error tracking in production only
## Code Patterns & Conventions
### Export Functions from API Files
Always use named exports with `Api` suffix:
```javascript
export function getListApi(data) { ... } // List endpoints
export function getDetailApi(data) { ... } // Detail/fetch
export function updateXxxApi(data) { ... } // Create/update
export function deleteXxxApi(data) { ... } // Delete
export function exportXxxApi(data) { ... } // Export to Excel
```
### View Component Structure
```vue
<template>
<!-- Element UI components: el-table, el-dialog, el-form -->
</template>
<script>
import * as accountApi from '@/api/account'
export default {
data() { return { list: [], filters: {} } },
methods: {
async fetchList() {
const res = await accountApi.getListApi(this.filters)
this.list = res.data
}
}
}
</script>
```
### Common Utilities
- **[src/common/util.js](src/common/util.js)**: Util.msg() for dialogs, cookies management, date formatting
- **[src/common/format.js](src/common/format.js)**: Formatting helpers for display
- **[src/common/Export2Excel.js](src/common/Export2Excel.js)**: Excel export via xlsx
- **[src/common/constants.js](src/common/constant/)**: Shared enums and constants
## Testing & Quality
### Jest Configuration
[jest.config.js](jest.config.js) tests located in `/tests/unit/**/*.spec.js`
### ESLint
Modern ESLint 9 + antfu config ([eslint.config.js](eslint.config.js))
## Deployment Notes
- **Environments**: Production (dj.glsx.com.cn), Testing (frontend.test.glsx.com.cn)
- **Multiple release branches**: dev_v4.x.x branches per release cycle
- **Legacy Node flags**: Build requires `NODE_OPTIONS=--openssl-legacy-provider` (Node 14 compatibility)
## Key Files for New Features
1. **API integration**: Add new exports in [src/api/](src/api/) matching service method
2. **View component**: Create in appropriate [src/views/](src/views/) module folder
3. **Store data**: Add to Vuex if cross-module state needed
4. **Routes**: Register in [src/router/routes.js](src/router/routes.js) or dynamic loading
5. **Styles**: Use SCSS in [src/assets/style/](src/assets/style/), leverage flex.css utility classes
## Common Tasks
- **Add new API endpoint**: Create function in relevant api/*.js file, inject session/signature in request()
- **Create list page**: Use Element Table + pagination, implement async fetchList() method
- **Export to Excel**: Import Export2Excel from common/, pass table data
- **Add menu item**: Register in router + add permission checks in router.beforeEach
- **Cross-component communication**: Use Vuex store or pass via props/events
---
# Language
默认使用 **简体中文** 输出,包括:
- Git commit message
- Pull Request 描述
- 代码解释
- 技术说明
只有在代码注释或特殊要求时才使用英文。
---
# Git Commit Message 规范
生成 commit message 时必须遵循 **Conventional Commits 规范**。
## 基本格式
type: 简短描述
......@@ -26,3 +26,11 @@ yarn-error.log*
*.njsproj
*.sln
*.sw*
# AI Local
.cursor/
.claude/settings.local.json
.roo/
.copilot/
.windsurf/
# 项目协作规则
# AGENTS.md
## 沟通方式
- 向用户汇报成果时,用简洁明了的中文说明做了什么、发生了什么。
- 避免使用术语、技术实现细节和代码行话;按“向不懂代码的聪明人解释”的方式表达。
- 汇报前尽量先检查工作,能运行或测试的先运行或测试。
# 项目AI规范
## 表单规则
- 后台页面新增或重写业务表单时,优先使用 `glsx-combi-form` 组件。
- 弹窗表单也按 `glsx-combi-form` 的配置化写法组织字段、校验和自定义插槽。
- 只有在 `glsx-combi-form` 无法满足交互时,才单独使用原生 `el-form`,并说明原因。
请优先阅读:
- /.ai/rules/ 目录下的文件
## 项目概述
### 项目名称
dj-car-life-system(嘀加智享车生活后台管理系统)
### 项目类型
企业级 Web 管理后台 SPA。
注意:
* 不是微信小程序
* 不是 H5 活动页
* 不是 React / Next.js 项目
* 不要按小程序架构设计功能
---
## 技术栈
### 核心框架
* Vue 2.6
* Vue Router 3
* Vuex 3
* Element UI 2
* D2Admin
### 构建工具
* Vue CLI 5
* Webpack 5
### 网络请求
* axios
* 项目已有封装
### 语言
* JavaScript
除非用户明确要求,否则不要:
* 升级 Vue3
* 引入 Pinia
* 使用 Composition API
* 使用 script setup
* 大规模 TypeScript 改造
---
## 项目结构
```text
src/
├── api/
├── views/
├── components/
├── router/modules/
├── store/modules/
├── plugin/d2admin/
├── common/
└── libs/
```
新增功能时优先遵循现有目录结构。
不要创建重复能力的目录和工具。
---
## 编码原则
### 优先遵循现有代码风格
修改代码时:
* 先阅读相关模块
* 保持现有命名风格
* 保持现有文件组织方式
* 保持现有组件拆分方式
不要为了追求“最佳实践”而大规模重构。
---
### 实现原则
优先级:
```text
正确
↓
简单
↓
可维护
↓
性能优化
```
优先选择:
* 最简单方案
* 最小改动方案
* 与现有系统一致方案
---
### 组件开发
默认使用:
```js
export default {};
```
即:
* Vue2 Options API
* 单文件组件(SFC)
不要默认使用:
* Composition API
* script setup
---
## 错误处理
用户操作失败时:
* 给出明确提示
* 保持与项目现有 Message 风格一致
不要静默失败。
## 测试规范
修改完成后优先:
* 检查代码逻辑
* 检查运行结果
* 检查控制台报错
能够验证的内容先验证。
不要直接宣布完成。
## 输出要求
完成任务后优先说明:
1. 做了什么
2. 为什么这么做
3. 风险点是什么
然后再补充可选优化建议。
不要把优化建议当成必须任务。
[![Build Status](https://www.travis-ci.org/d2-projects/d2-admin-start-kit.svg?branch=master)](https://www.travis-ci.org/d2-projects/d2-admin-start-kit)
## node 版本
14.21.3
[D2Admin](https://github.com/d2-projects/d2-admin) 简化版起始模板,删除所有完整版中的示例代码,保留所有核心功能。
## 包管理工具
npm 6.14.8
[码云镜像](https://gitee.com/fairyever/d2-admin-start-kit)
\ No newline at end of file
### AI 相关
* 项目忽略所有AI相关文件. 不要提交如 CLAUDE.md 等文件.
* 项目提供统一目录, 个人使用什么 AI 自己配置读取.ai/下的文件
* 如果你的AI工具不支持自定义目录, 请将 .ai 目录下的文件复制到你对应的目录下去, 以节省你的token
......@@ -13,94 +13,94 @@
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
// 测试文件位置
testDir: "./tests/e2e",
// 测试文件位置
testDir: "./tests/e2e",
// 超时时间
timeout: 30 * 1000,
// 超时时间
timeout: 30 * 1000,
// 每个测试的期望时间
expect: {
timeout: 5000,
},
// 每个测试的期望时间
expect: {
timeout: 5000,
},
// 失败重试次数
retries: 1,
// 失败重试次数
retries: 1,
// 并行执行配置
workers: 4,
// 并行执行配置
workers: 4,
// 是否失败即停止
failOnFlakyTests: false,
// 是否失败即停止
failOnFlakyTests: false,
// 报告配置
reporter: [
["list"],
["html", { outputFolder: "playwright-report", open: "never" }],
],
// 报告配置
reporter: [
["list"],
["html", { outputFolder: "playwright-report", open: "never" }],
],
// 共享配置
use: {
// 基础 URL
baseURL: process.env.BASE_URL || "http://localhost:8080",
// 共享配置
use: {
// 基础 URL
baseURL: process.env.BASE_URL || "http://localhost:8080",
// 截图配置
screenshot: "only-on-failure",
// 截图配置
screenshot: "only-on-failure",
// 录屏配置
video: "retain-on-failure",
// 录屏配置
video: "retain-on-failure",
// 追踪配置
trace: "retain-on-failure",
// 追踪配置
trace: "retain-on-failure",
// 浏览器上下文选项
actionTimeout: 10000,
navigationTimeout: 30000,
},
// 浏览器上下文选项
actionTimeout: 10000,
navigationTimeout: 30000,
},
// 浏览器配置
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
viewport: { width: 1920, height: 1080 },
},
},
{
name: "firefox",
use: {
...devices["Desktop Firefox"],
viewport: { width: 1920, height: 1080 },
},
},
{
name: "webkit",
use: {
...devices["Desktop Safari"],
viewport: { width: 1920, height: 1080 },
},
},
// 移动端测试
{
name: "Mobile Chrome",
use: {
...devices["Pixel 5"],
},
},
{
name: "Mobile Safari",
use: {
...devices["iPhone 12"],
},
},
],
// 浏览器配置
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
viewport: { width: 1920, height: 1080 },
},
},
{
name: "firefox",
use: {
...devices["Desktop Firefox"],
viewport: { width: 1920, height: 1080 },
},
},
{
name: "webkit",
use: {
...devices["Desktop Safari"],
viewport: { width: 1920, height: 1080 },
},
},
// 移动端测试
{
name: "Mobile Chrome",
use: {
...devices["Pixel 5"],
},
},
{
name: "Mobile Safari",
use: {
...devices["iPhone 12"],
},
},
],
// Web 服务器配置 (可选,用于自动启动开发服务器)
// webServer: {
// command: "npm run dev",
// port: 8080,
// timeout: 120 * 1000,
// reuseExistingServer: true,
// },
// Web 服务器配置 (可选,用于自动启动开发服务器)
// webServer: {
// command: "npm run dev",
// port: 8080,
// timeout: 120 * 1000,
// reuseExistingServer: true,
// },
});
......@@ -422,6 +422,15 @@ export function getStrategyStaffList(data = {}) {
data.method = "dj.api.strategy.staff.page";
return request(data, RequestMethods.POST);
}
/**
*
* 查询策略 驻店员工/区域运营/飞行督导列表 - 去重新接口
*/
export function getStrategyStaffListNew(data = {}) {
data.method = "dj.api.strategy.staff.page.distinct.phone";
return request(data, RequestMethods.POST);
}
/*
/**
* 策略中心-查询策略录音记录
......
......@@ -141,9 +141,8 @@
<el-tag v-if="hasValue(sub, scope.row)" :type="getSchemaTagOptions(sub, scope.row).type">
{{ getSchemaTagOptions(sub, scope.row).label }}
</el-tag>
<el-tag v-else>
-
</el-tag>
<span v-else>-</span>
</div>
</template>
......@@ -257,9 +256,7 @@
<el-tag v-if="hasValue(item, scope.row)" :type="getSchemaTagOptions(item, scope.row).type">
{{ getSchemaTagOptions(item, scope.row).label }}
</el-tag>
<el-tag v-else>
-
</el-tag>
<span v-else>-</span>
</div>
</template>
......
......@@ -33,7 +33,7 @@
<div class="label">
{{ item.categoryExtension }}
{{ item.categoryExtension == '全部' ? item.metricName : (item.categoryExtension + item.metricName) }}
</div>
......@@ -79,7 +79,7 @@
<div class="label">
{{ item.categoryExtension }}
{{ item.categoryExtension == '全部' ? item.metricName : (item.categoryExtension + item.metricName) }}
</div>
......@@ -224,7 +224,7 @@ export default {
},
formatIsRatio(delta) {
return delta < 0 ? "decline" : delta === 0 ? "just01" : "rise";
return delta < 0 ? "decline" : delta == 0 ? "just01" : "rise";
},
},
......@@ -321,9 +321,10 @@ export default {
font-size: 13px;
.label {
width: 104px;
min-width: 104px;
color: #888888;
margin-right: 10px;
}
.value {
......
......@@ -64,7 +64,7 @@ const STRATEGY_TYPE_CONFIG = {
0: { name: "学习", color: "#409EFF" },
1: { name: "优秀案例分享", color: "#36CBCB" },
2: { name: "带教", color: "#67C23A" },
3: { name: "任务下发", color: "#FFD666" },
3: { name: "通知", color: "#FFD666" },
4: { name: "销售精英到店提拉", color: "#B3E19D" },
5: { name: "强力促销", color: "#E6A23C" },
6: { name: "最终盘点与低客单产品购入", color: "#9254DE" },
......
......@@ -177,7 +177,7 @@
<template #metrics="scope">
<span class="effect-cell"
@click="handleEffectDetail(scope.scope)">
{{ scope.scope.metrics.length }} <span style="color: #333333;">项提升</span>
{{ countImprovedMetrics(scope.scope.metrics) }} <span style="color: #333333;">项提升</span>
</span>
</template>
</d2-table>
......@@ -743,6 +743,12 @@ export default {
this.loading.onlineOperData = false;
}
},
countImprovedMetrics(metrics) {
if (!Array.isArray(metrics)) {
return 0;
}
return metrics.filter(m => m.improved === true).length;
},
handleEffectDetail(row) {
this.effectDetailRow = row.metrics;
this.effectDetailVisible = true;
......
......@@ -175,16 +175,27 @@ export default {
brand: [],
regionOps: "",
onlineOps: this.getDefaultOnlineOps(),
supervisorOps: null,
};
},
syncFormFromFilters() {
const { region = "", provinceId = "", brand = [], regionOps = "", onlineOps = "" } = this.filters || {};
const {
region = "",
provinceId = "",
brand = [],
regionOps = "",
onlineOps = "",
supervisorOps,
flightSupervisionId,
} = this.filters || {};
const supervisorValue = supervisorOps ?? flightSupervisionId ?? null;
this.formData = {
region,
provinceId: provinceId || "",
brand: Array.isArray(brand) ? brand.map(item => (Array.isArray(item) ? [...item] : item)) : [],
regionOps: regionOps || "",
onlineOps: onlineOps || this.getDefaultOnlineOps(),
supervisorOps: supervisorValue === "" ? null : supervisorValue,
};
},
submit() {
......
......@@ -22,19 +22,20 @@
<span class="label">门店名称:</span>
<el-input v-model="localFilters.storeName"
class="filter-select"
clearable
maxlength="50"
placeholder="请输入"
size="small">
size="small"
clearable>
</el-input>
</div>
<div class="filter-group">
<span class="label">项目组:</span>
<el-select v-model="localFilters.groupId"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in groupOptions"
:key="item.value"
:label="item.label"
......@@ -59,10 +60,10 @@
<span class="label">区域:</span>
<el-select v-model="localFilters.provinceId"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in provinceOptions"
:key="item.code"
:label="item.name"
......@@ -74,24 +75,24 @@
<span class="label">品牌:</span>
<el-cascader v-model="localFilters.brand"
class="filter-select-brand"
placeholder="全部"
size="small"
clearable
collapse-tags
filterable
:options="brandOptions"
placeholder="全部"
:props="cascaderProps"
:show-all-levels="false"
size="small">
:show-all-levels="false">
</el-cascader>
</div>
<div v-if="false" class="filter-group">
<span class="label">区域运营:</span>
<el-select v-model="localFilters.regionOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in regionOpsOptions"
:key="item.value"
:label="item.label"
......@@ -103,10 +104,10 @@
<span class="label">线上运营:</span>
<el-select v-model="localFilters.onlineOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in onlineOpsOptions"
:key="item.value"
:label="item.label"
......
......@@ -368,6 +368,7 @@ export default {
twoBrandIds,
regionOps,
onlineOps,
supervisorOps,
} = this.filters;
const params = {
storeName,
......@@ -378,6 +379,7 @@ export default {
twoBrandIds: twoBrandIds || [],
regionalOperatorId: regionOps,
onlineOperatorId: onlineOps,
flightSupervisionId: supervisorOps,
// periodType: this.timeRangeType.value,
cycleType: {
1: 2,
......
......@@ -106,7 +106,7 @@ export default {
dialogConfig: {
config: {
title: "选择录音",
width: "1092px",
width: "1192px",
},
},
targetId: "id",
......@@ -172,7 +172,6 @@ export default {
{
label: "成交状态",
prop: "orderFinishFlag",
minWidth: 90,
formatter(row) {
return row.orderFinishFlag ? "成功" : "战败";
},
......
......@@ -14,9 +14,9 @@
<div class="search-box flex">
<el-input v-model="searchForm.staffName"
class="search-input"
clearable
placeholder="搜索员工名称"
size="small">
size="small"
clearable>
</el-input>
<el-button size="small"
type="primary"
......@@ -30,10 +30,10 @@
</div>
<div class="table">
<d2-table ref="multipleTable"
layout="total, prev, pager, next"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:has-num="false"
layout="total, prev, pager, next"
:pager-count="5"
:search-form="searchFormSearch"
:table-params="tableParams"
......@@ -78,12 +78,19 @@
<script>
import {
getStrategyStaffList,
getStrategyStaffListNew,
} from "@api/earlyWarningManager";
import multipleMixin from "./multipleMixin";
export default {
name: "MultipleStaff",
mixins: [multipleMixin],
props: {
strategyType: {
type: [Number, String],
default: null,
},
},
data() {
return {
dialogConfig: {
......@@ -92,14 +99,25 @@ export default {
width: "1092px",
},
},
targetId: "staffUuid",
getListApi: getStrategyStaffList,
searchForm: {
staffName: "",
},
tableParams: {
};
},
computed: {
isPhoneMode() {
return this.strategyType == 0 || this.strategyType == 1;
},
targetId() {
return this.isPhoneMode ? "phoneNumber" : "staffUuid";
},
getListApi() {
return this.isPhoneMode ? getStrategyStaffListNew : getStrategyStaffList;
},
tableParams() {
return {
listName: "list",
mutiSelectUniqueKey: "staffUuid",
mutiSelectUniqueKey: this.targetId,
mutiSelectName: "contentIndex",
tableColumns: [
{
......@@ -124,23 +142,23 @@ export default {
},
},
],
},
};
};
},
},
mounted() {
},
methods: {
beforeSearchFn() {
return new Promise((resolve) => {
let { positionTypeList, merchantList, paramsInfo, delMerchantList } = this;
let { positionTypeList, merchantList, paramsInfo, delMerchantList, biz } = this;
let { staffName } = this.searchForm;
let merchantIdList = [];
if (merchantList.length)
merchantIdList = merchantList.map(item => item.merchantId);
else merchantIdList = paramsInfo.merchantIds;
else merchantIdList = paramsInfo?.merchantIds || [];
let params = {
positionTypeList,
sceneType: paramsInfo.bizs == 2 ? 1 : 0, // 业务场景(0.会员权益(延保权益),1.精品升级(轻改))
sceneType: biz == 2 ? 1 : 0, // 业务场景(0.会员权益(延保权益),1.精品升级(轻改))
staffName,
merchantIdList,
};
......
......@@ -2,7 +2,7 @@ const STRATEGYTYPEOPTIONS = [
{ label: "学习", value: 0 },
{ label: "优秀案例分享", value: 1 },
{ label: "带教", value: 2 },
{ label: "任务下发", value: 3 },
{ label: "通知", value: 3 },
{ label: "销售精英到店提拉", value: 4 },
{ label: "强力促销", value: 5 },
{ label: "最终盘点与低客单产品购入", value: 6 },
......
......@@ -136,12 +136,14 @@
</div>
<MultipleStaff ref="staffTagRef"
:choose-data="formData.staffList"
:strategy-type="strategyType"
:visible="staffTagVisible"
@choose="formatMultipleList($event, 'staffList')"
@dialogClose="staffTagVisible = false">
</MultipleStaff>
<MultipleStaff ref="staffTagRef"
:choose-data="formData.staffList_1"
:strategy-type="strategyType"
:visible="staffTag1Visible"
@choose="formatMultipleList($event, 'staffList_1')"
@dialogClose="staffTag1Visible = false">
......
<template>
<div :class="['warning-item flex',`bg-${item.type || 1}`]">
<img
:src="icon"
class="warning-icon"
>
<div class="warning-text text-hide">{{ item.text }}</div>
<div class="warning-item flex" :class="[`bg-${item.type || 1}`]">
<img class="warning-icon"
:src="icon">
<div class="warning-text text-hide">
{{ item.text }}
</div>
</div>
</template>
<script type='text/ecmascript-6'>
const type_1 = require('@/assets/strategy/icon-strategy-type01.png'),
type_2 = require('@/assets/strategy/icon-strategy-type02.png'),
type_3 = require('@/assets/strategy/icon-strategy-type03.png'),
type_4 = require('@/assets/strategy/icon-strategy-type04.png'),
type_5 = require('@/assets/strategy/icon-strategy-type05.png'),
type_6 = require('@/assets/strategy/icon-strategy-type06.png')
const type_1 = require("@/assets/strategy/icon-strategy-type01.png");
const type_2 = require("@/assets/strategy/icon-strategy-type01.png");
const type_3 = require("@/assets/strategy/icon-strategy-type02.png");
const type_6 = require("@/assets/strategy/icon-strategy-type06.png");
const type_4 = require("@/assets/strategy/icon-strategy-type07.png");
const type_5 = require("@/assets/strategy/icon-strategy-type08.png");
export default {
name: 'EarlyWarningTips',
props: {
item: {
type: Object,
default: () => ({})
}
},
computed: {
icon () {
return {
1: type_1,
2: type_2,
3: type_3,
4: type_4,
5: type_5,
6: type_6
}[this.item.type] || ''
}
},
data () {
return {
}
},
mounted () {
},
methods: {
}
}
name: "EarlyWarningTips",
props: {
item: {
type: Object,
default: () => ({}),
},
},
data() {
return {
};
},
computed: {
icon() {
return {
1: type_1,
2: type_2,
3: type_3,
4: type_4,
5: type_5,
6: type_6,
}[this.item.type] || "";
},
},
mounted() {
},
methods: {
},
};
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
display: flex;
align-items: center;
}
.warning-item {
width: 100%;
border-radius: 4px;
color: #333333;
font-size: 13px;
margin-top: 12px;
height: 30px;
background: #2c66f714;
box-sizing: border-box;
padding: 0 8px;
word-break: break-all;
.warning-icon {
width: 18px;
height: 18px;
margin-right: 6px;
}
.warning-text {
width: calc(100% - 24px);
}
width: 100%;
border-radius: 4px;
color: #333333;
font-size: 13px;
margin-top: 12px;
height: 30px;
background: #2c66f714;
box-sizing: border-box;
padding: 0 8px;
word-break: break-all;
.warning-icon {
width: 18px;
height: 18px;
margin-right: 6px;
}
.warning-text {
width: calc(100% - 24px);
}
}
.bg-1 {
background: #f2472414;
background: #f2472414;
}
.bg-2 {
background: #ff9d0a14;
background: #f2472414;
}
.bg-3 {
background: #ff9d0a14;
}
.bg-4 {
background: #f2472414;
}
.bg-5 {
background: #ff9d0a14;
}
.bg-6 {
background: #2c66f714;
}
</style>
\ No newline at end of file
......@@ -732,9 +732,9 @@ export default {
.summary-box {
position: relative;
height: calc(100% - 91px);
margin-top: 8px;
margin-top: 18%;
box-sizing: border-box;
padding: 12px 35px 12px 13px;
padding: 12px 10px 12px 13px;
z-index: 9;
.help {
position: absolute;
......@@ -755,7 +755,7 @@ export default {
}
.fixed-summary02 {
position: absolute;
bottom: 12%;
bottom: 30%;
left: 50%;
transform: translateX(-54%);
min-width: 95px;
......
......@@ -125,7 +125,7 @@ export default {
},
{
label: "区域督导",
key: "flightSupervisionext",
key: "flightSupervisionText",
tooltip: true,
},
{
......
import dayjs from "dayjs"
import dayjs from "dayjs";
const STRATEGYTYPEOPTIONS = {
0: '学习',
1: '优秀案例分享',
2: '带教',
3: '任务下发',
4: '销售精英到店提拉',
5: '强力促销',
6: '最终盘点与低客单产品购入',
7: '留言'
}
0: "学习",
1: "优秀案例分享",
2: "带教",
3: "通知",
4: "销售精英到店提拉",
5: "强力促销",
6: "最终盘点与低客单产品购入",
7: "留言",
};
const DATE_RANGE = {
label: '执行周期',
label: "执行周期",
format: (val) => {
let {
startDate,
endDate
} = val
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}`
}
}
endDate,
} = val;
return `${dayjs(startDate).format("YYYY-MM-DD")}至 ${dayjs(endDate).format("YYYY-MM-DD")}`;
},
};
const TITLE = {
label: '标题',
key: 'title',
}
label: "标题",
key: "title",
};
const CREATED = {
label: '操作人',
key: 'createdBy',
}
label: "操作人",
key: "createdBy",
};
const CREATED_DATE = {
label: '操作时间',
label: "操作时间",
format: (val) => {
return dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
return dayjs(val.createdDate).format("YYYY-MM-DD HH:mm:ss");
},
};
const STRATEGY_FORM_01 = [
TITLE,
DATE_RANGE,
CREATED,
CREATED_DATE
]
CREATED_DATE,
];
const STRATEGY_FORM_2456 = [
CREATED,
DATE_RANGE,
{
label: '执行人',
label: "执行人",
format: (val) => {
let {
executePersons
} = val
return executePersons?.map(item => item.username).join('/')
executePersons,
} = val;
return executePersons?.map(item => item.username).join("/");
},
hide: (val) => {
let {
strategyType
} = val
return [5, 6].includes(strategyType)
}
strategyType,
} = val;
return [5, 6].includes(strategyType);
},
},
CREATED_DATE
]
CREATED_DATE,
];
const STRATEGY_FORM_3 = [
CREATED,
TITLE,
CREATED_DATE,
{
label: '副标题',
key: 'subTitle',
class: 'bespread',
label: "副标题",
key: "subTitle",
class: "bespread",
},
{
label: '执行时间',
key: 'startDate',
label: "执行时间",
key: "startDate",
},
]
];
const STRATEGY_FORM_7 = [
CREATED,
CREATED_DATE,
{
label: '处理人',
label: "处理人",
format: (val) => {
let {
executePersons
} = val
return executePersons?.map(item => item.username).join('/') || '-'
executePersons,
} = val;
return executePersons?.map(item => item.username).join("/") || "-";
},
},
]
];
export {
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_01,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
STRATEGY_FORM_7
}
STRATEGY_FORM_7,
STRATEGY_FORM_2456,
STRATEGYTYPEOPTIONS,
};
......@@ -50,7 +50,7 @@
</template>
<div class="btn-list flex">
<!-- 状态=未下发 -->
<template v-if="item.pushFlag == 0">
<template v-if="item.pushFlag == 0 || item.pushFlag == 2 || item.pushFlag == 3">
<el-button class="btn-default _btn"
:size="size"
@click="deleteStrategy(item)">
......@@ -58,9 +58,9 @@
</el-button>
</template>
<el-button class="btn-primary _btn"
type="primary"
plain
:size="size"
type="primary"
@click="$emit('toDetail', item)">
查看详情
</el-button>
......
......@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2026-04-01 09:57:49
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-06-02 17:54:09
* @LastEditTime: 2026-06-04 19:16:23
* @FilePath: \dj-car-life-system\src\views\earlyWarningManager\strategyCentre\storeSignboard\components\StrategyList\contant.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -12,7 +12,7 @@ const STRATEGYTYPEOPTIONS = {
0: "学习",
1: "优秀案例分享",
2: "带教",
3: "任务下发",
3: "通知",
4: "销售精英到店提拉",
5: "强力促销",
6: "最终盘点与低客单产品购入",
......@@ -35,7 +35,7 @@ function STAFF_FORMAT(label) {
label,
format: (val) => {
let { staffList } = val;
return staffList.filter(item => !item.userPosition).map(item => item.userName).join("/") || "-";
return staffList.map(item => item.userName).join("/") || "-";
},
};
}
......@@ -89,12 +89,19 @@ const STRATEGY_8 = [
STAFF_FORMAT("需带教人员"),
];
const STRATEGY_9 = [
STAFF_FORMAT("问题人员"),
// STAFF_FORMAT("问题人员"),
{
label: "问题人员",
format: (val) => {
let { staffList } = val;
return staffList.filter(item => item.userPosition != 8 && item.userPosition != 9).map(item => item.userName).join("/") || "-";
},
},
{
label: "执行人员",
format: (val) => {
let { staffList } = val;
return staffList.filter(item => item.userPosition != 0).map(item => item.userName).join("/") || "-";
return staffList.filter(item => item.userPosition == 8 || item.userPosition == 9).map(item => item.userName).join("/") || "-";
},
},
];
......@@ -104,7 +111,7 @@ const STRATEGY_10_11_12 = [
label: "执行人员",
format: (val) => {
let { staffList } = val;
return staffList.filter(item => item.userPosition != 0).map(item => item.userName).join("/") || "-";
return staffList.filter(item => item.userPosition == 8 || item.userPosition == 9).map(item => item.userName).join("/") || "-";
},
},
];
......
......@@ -101,10 +101,10 @@
</div>
<div class="sub-value flex">
<template>
环比{{ formatMom(summaryInfo.contactConversionRateMon) }}
<template v-if="formatIsRatio(summaryInfo.contactConversionRateMon)">
环比{{ formatMom(summaryInfo.contactConversionRateMom) }}
<template v-if="formatIsRatio(summaryInfo.contactConversionRateMom)">
<img class="arrow"
:src="getIconSrc(formatIsRatio(summaryInfo.contactConversionRateMon))" />
:src="getIconSrc(formatIsRatio(summaryInfo.contactConversionRateMom))" />
</template>
</template>
</div>
......@@ -447,7 +447,8 @@ export default {
this.summaryInfoZJ = data || {};
this.startDay = data.periodStartDate;
this.endDay = data.periodEndDate;
this.showZJ = data.contactRate > 0;
this.showZJ
= data?.newCarDeliveryCount != null && data.newCarDeliveryCount !== "";
this.summaryLeftLoading = false;
console.log(data, "SummaryOverview/index.vue(查询门店经营概况-主机厂)");
} catch (error) {
......@@ -600,7 +601,7 @@ export default {
height: calc(100% - 91px);
margin-top: 8px;
box-sizing: border-box;
padding: 12px 35px 12px 13px;
padding: 12px 22px 12px 26px;
z-index: 9;
.help {
position: absolute;
......@@ -628,7 +629,6 @@ export default {
font-size: 13px;
.label {
color: #666666;
.num {
display: block;
color: #2a58ad;
......@@ -683,6 +683,7 @@ export default {
height: 100%;
flex-direction: column;
justify-content: center;
.label {
color: #666666;
font-size: 13px;
......
<!-- 导入明细&回单主页面 -->
<template>
<div class="importDetail">
<div class="header"
slot="header">
<div slot="header"
class="header">
<div>
<import-one ref="importOne"
v-if="activeName === 'one'"
@oneStepComplete="oneStepComplete" />
<import-two v-if="activeName === 'two'"
:task-info="taskInfo"
@twoStepComplete="twoStepComplete"
@goBackOneStep="goBackOneStep" />
<import-three v-if="activeName === 'three'"
:result-info="resultInfo"
@importAgain="importAgain"
@goBackListPage="goBackListPage" />
<ImportOne v-if="activeName === 'one'"
ref="importOne"
@oneStepComplete="oneStepComplete" />
<ImportTwo v-if="activeName === 'two'"
:task-info="taskInfo"
@goBackOneStep="goBackOneStep"
@twoStepComplete="twoStepComplete" />
<ImportThree v-if="activeName === 'three'"
:result-info="resultInfo"
@goBackListPage="goBackListPage"
@importAgain="importAgain" />
</div>
</div>
</div>
</template>
<script>
import importOne from './components/importOne'
import importTwo from './components/importTwo'
import importThree from './components/importThree'
import { mapActions } from 'vuex'
export default {
name: 'StaffIndex',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
activeName: 'one',
taskInfo: null,
resultInfo: null
}
},
import { mapActions } from "vuex";
import importOne from "./components/importOne";
import importThree from "./components/importThree";
import importTwo from "./components/importTwo";
components: {
importOne,
importTwo,
importThree
},
export default {
name: "StaffIndex",
mounted() {
if (this.$route.query.step) {
console.log('step', this.$route.query.step)
this.activeName = this.$route.query.step
this.taskInfo = this.$route.query.taskInfo
}
},
components: {
ImportOne: importOne,
ImportTwo: importTwo,
ImportThree: importThree,
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
activeName: "one",
taskInfo: null,
resultInfo: null,
};
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
oneStepComplete(data) {
console.log('data', data)
this.activeName = 'two'
},
goBackOneStep() {
this.activeName = 'one'
},
twoStepComplete(data) {
this.resultInfo = data
this.activeName = 'three'
},
importAgain() {
this.activeName = 'one'
},
goBackListPage() {
this.close({ tagName: "/importDetailControl" })
this.$router.push({
name: "theAssetData"
})
}
mounted() {
if (this.$route.query.step) {
console.log("step", this.$route.query.step);
this.activeName = this.$route.query.step;
this.taskInfo = this.$route.query.taskInfo;
}
},
}
}
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
oneStepComplete(data) {
console.log("data", data);
this.activeName = "two";
},
goBackOneStep() {
this.activeName = "one";
},
twoStepComplete(data) {
this.resultInfo = data;
this.activeName = "three";
},
importAgain() {
this.activeName = "one";
},
goBackListPage() {
this.close({ tagName: "/importDetailControl" });
this.$router.push({
name: "theAssetData",
});
},
},
};
</script>
<style lang="scss" scoped>
.importDetail {
padding: 0 20px;
padding: 0 20px;
.header {
::v-deep .el-tabs__header {
margin: 0;
padding: 0 20px;
}
}
.header {
::v-deep .el-tabs__header {
margin: 0;
padding: 0 20px;
}
}
}
</style>
......@@ -60,8 +60,8 @@
<!-- <span v-if="scope.scope.reconciliationBillStatus == '2'" style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9051104']" />
</span> -->
<!-- 查看 - 已对账 -->
<span v-if="scope.scope.reconciliationBillStatus == '3'" style="margin-right: 10px;">
<!-- 查看 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9051106']" />
</span>
<!-- 下载 -->
......@@ -144,17 +144,6 @@
@dialogClose="handleEditVisible"
@handleConfirm="handleEditConfirm">
</EditPayReceive>
<glsk-form-dialog v-if="billSplitVisible"
label-width="200px"
:base-data="baseData"
:dialog-config="billSplitDialogConfig"
:edit-data="billSplitEditData"
:edit-form-data="billSplitEditFormData"
:form-rules="billSplitRules"
:select-visible="billSplitVisible"
@handleClose="splitDialogVisible"
@handleConfirm="handleSplitConfirm">
</glsk-form-dialog>
<CreateServiceDialog v-if="accountVisible"
:account-visible="accountVisible"
:edit-form="serviceInfo"
......@@ -370,26 +359,6 @@ export default {
},
billVisible: false,
billTmplInfo: [],
// 确认对账-拆分
billSplitVisible: false,
billSplitDialogConfig: {
title: "确认对账",
okText: "确定",
},
billSplitRules: {
splitBill: [{ required: true, message: "请选择是否拆分对账单", trigger: "blur" }],
},
billSplitEditData: {},
billSplitEditFormData: [{
name: "splitBill",
label: "是否按支付类型拆分对账单",
type: "radio",
optionId: "confId",
optionLabel: "confLabel",
optionsName: "splitBillList",
optionList: [],
handleRadioChange: () => { },
}],
accountVisible: false,
marketTransferVisible: false,
importBillVisible: false,
......@@ -506,37 +475,20 @@ export default {
this.loading = false;
});
},
splitDialogVisible() {
this.billSplitVisible = !this.billSplitVisible;
},
handleSplitConfirm() {
this.splitDialogVisible();
this.billApiConfirm(this.billSplitEditData);
},
handleBillConfirm(row) {
this.$confirm("是否确认对账?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
// 流量方对账单 - 是否拆分弹窗
if (row.billType == "1") {
this.billSplitEditData = {
...row,
splitBill: false,
};
this.splitDialogVisible();
} else {
this.billApiConfirm(row);
}
this.billApiConfirm(row);
}).catch(() => { });
},
billApiConfirm(row) {
const params = { id: row.id };
if (row.billType == "1") {
params.splitBill = row.splitBill;
params.splitBill = false;
}
billConfirm(params).then((res) => {
this.$message.success("操作成功");
......@@ -818,11 +770,13 @@ export default {
handleImportBillVisible() {
this.importBillVisible = !this.importBillVisible;
if (!this.importBillVisible) {
this.$refs.recordTable.refreshTable(false, true);
}
},
handleImportBillConfirm() {
this.handleImportBillVisible();
this.$refs.recordTable.refreshTable(false, true);
},
},
};
......
......@@ -91,6 +91,15 @@ export function buildMarketTransferSubmitParams(form = {}, excludeExpenseCategor
return params;
}
export function buildMarketTransferDownloadParams(form = {}, excludeExpenseCategoryIds = []) {
const expenseCategoryIds = Array.isArray(form.expenseCategoryIds) ? form.expenseCategoryIds : [];
return {
reconciliationBillId: form.reconciliationBillId,
expenseCategoryIds: expenseCategoryIds.filter(id => !excludeExpenseCategoryIds.includes(id)),
};
}
export function normalizeApprovedMarketTransferFees(list = []) {
const amountMap = {};
const expenseCategoryIds = [];
......@@ -110,8 +119,8 @@ export function normalizeApprovedMarketTransferFees(list = []) {
};
}
export function getVisibleAmountFields(expenseCategoryIds = []) {
return EXPENSE_CATEGORY_OPTIONS.filter(item => expenseCategoryIds.includes(item.id));
export function getVisibleAmountFields(expenseCategoryIds = [], excludeExpenseCategoryIds = []) {
return EXPENSE_CATEGORY_OPTIONS.filter(item => expenseCategoryIds.includes(item.id) && !excludeExpenseCategoryIds.includes(item.id));
}
export function mapMarketFeeResults(data = {}) {
......@@ -122,6 +131,6 @@ export function mapMarketFeeResults(data = {}) {
return {
amountMap,
totalAmount: data.expenseCategoryTotalResult || 0,
totalAmount: data?.expenseCategoryTotalResult || 0,
};
}
......@@ -18,6 +18,7 @@
:is-block="isBlock" />
<glsx-combi-form v-else
:key="transferFormKey"
ref="transferFormRef"
class="market-transfer-form"
default-width="360px"
......@@ -124,6 +125,7 @@ import { deepClone } from "@/common/util";
import util from "@/libs/util";
import { baseConfig } from "@/main";
import {
buildMarketTransferDownloadParams,
buildMarketTransferFormData,
buildMarketTransferSubmitParams,
EXPENSE_CATEGORY_OPTIONS,
......@@ -149,6 +151,7 @@ export default {
return {
isBlock: true,
step: 1,
transferFormKey: 0,
platformChildRef: "platformChildRef",
transferChildRef: "transferChildRef",
platformMerchantList: [],
......@@ -199,7 +202,7 @@ export default {
return this.transferForm.billType == "1" ? "所属流量方" : "所属服务商";
},
visibleAmountFields() {
return getVisibleAmountFields(this.transferForm.expenseCategoryIds);
return getVisibleAmountFields(this.transferForm.expenseCategoryIds, this.lockedExpenseCategoryIds);
},
platformFormData() {
return [
......@@ -289,7 +292,7 @@ export default {
// value: item.merchantId || item.id || item.bankAccountNo,
// label: this.formatBankAccountLabel(item),
value: item.merchantId,
label: item.bankAccountName,
label: item.bankAccountName + " / " + item.bankAccountNo,
}));
});
},
......@@ -321,6 +324,17 @@ export default {
const formRef = this.$refs.transferFormRef?.$refs?.[this.transferChildRef];
formRef && formRef.clearValidate(field);
},
clearTransferValidateAfterLayout() {
this.$nextTick(() => {
this.clearTransferValidate(["expenseCategoryIds", "rcvMerchantId", "invoiceRemark", "fileUrlList"]);
});
},
refreshTransferFormValidateLayout() {
this.clearTransferValidate(["expenseCategoryIds", "rcvMerchantId", "invoiceRemark", "fileUrlList"]);
this.$nextTick(() => {
this.transferFormKey += 1;
});
},
isExpenseCategoryDisabled(id) {
return this.lockedExpenseCategoryIds.includes(id);
},
......@@ -345,7 +359,7 @@ export default {
}
});
},
applyExpenseAmountMap(amountMap = {}) {
applyExpenseAmountMap(amountMap = {}, totalAmount) {
EXPENSE_CATEGORY_OPTIONS.forEach((item) => {
if (!this.transferForm.expenseCategoryIds.includes(item.id)) {
this.$set(this.transferForm, `amount_${item.id}`, "");
......@@ -353,15 +367,13 @@ export default {
}
this.$set(this.transferForm, `amount_${item.id}`, amountMap[item.id] ?? "");
});
this.transferForm.transferTotalAmount = this.transferForm.expenseCategoryIds.reduce((total, id) => {
return total + (Number(amountMap[id]) || 0);
}, 0);
this.transferForm.transferTotalAmount = totalAmount || 0;
},
handleExpenseChange(value) {
const expenseCategoryIds = this.mergeLockedExpenseCategoryIds(value);
if (expenseCategoryIds.length !== value.length)
this.transferForm.expenseCategoryIds = expenseCategoryIds;
this.clearTransferValidate("expenseCategoryIds");
this.refreshTransferFormValidateLayout();
const unlockedExpenseCategoryIds = this.getUnlockedExpenseCategoryIds(expenseCategoryIds);
if (!expenseCategoryIds.length) {
this.transferForm.transferTotalAmount = "";
......@@ -379,14 +391,19 @@ export default {
this.applyExpenseAmountMap({
...result.amountMap,
...this.lockedExpenseAmountMap,
});
}, result.totalAmount);
this.refreshTransferFormValidateLayout();
});
},
handleDownloadDetail() {
const params = {
const params = buildMarketTransferDownloadParams({
reconciliationBillId: this.info.id,
expenseCategoryIds: this.transferForm.expenseCategoryIds,
};
}, this.lockedExpenseCategoryIds);
if (!params.expenseCategoryIds.length) {
this.$message.error("请选择新的费用类型");
return;
}
downloadMarketTransferDetail(params).then((res) => {
console.log("下载任务已创建", res);
util.open(res);
......
......@@ -41,6 +41,20 @@
</div>
</div>
</div>
<template slot="expenseCategoryHtml">
<div class="expense-category-text">
<span v-for="item in editData.expenseCategoryList"
:key="item.expenseCategoryId"
class="expense-category-item">
{{ item.expenseCategoryName }}
</span>
</div>
</template>
<template slot="invoiceRemarkHtml">
<div class="record-transfer-text">
{{ editData.invoiceRemark }}
</div>
</template>
</glsx-combi-form>
<div>操作日志</div>
<d2-table ref="logTable"
......@@ -87,7 +101,7 @@ export default {
platformMerchantId: "",
platformMerchantName: "",
},
editFormData: [
baseEditFormData: [
{
label: "所属平台方",
name: "platformMerchantName",
......@@ -154,18 +168,83 @@ export default {
};
},
computed: {
editFormData() {
return this.buildEditFormData(this.editData);
},
},
mounted() {
this.editData = deepClone(this.info);
this.getTransferRecord();
},
methods: {
findIdx(attr) {
return this.editFormData.findIndex(item => item.name === attr);
isMarketTransferRecord(record = {}) {
return Array.isArray(record.expenseCategoryList);
},
getBillMerchantLabel(record = {}) {
if (!this.isMarketTransferRecord(record))
return "对账服务商";
return record.billType == "1" ? "所属流量方" : "所属服务商";
},
buildEditFormData(record = {}) {
const formData = deepClone(this.baseEditFormData);
const billMerchant = formData.find(item => item.name === "billMerchantName");
if (billMerchant)
billMerchant.label = this.getBillMerchantLabel(record);
if (!this.isMarketTransferRecord(record))
return formData;
const amountIndex = formData.findIndex(item => item.name === "amount");
const expenseFields = [
{
label: "费用类型",
name: "expenseCategoryList",
addHtml: "expenseCategoryHtml",
},
...(record.expenseCategoryList || []).map(item => ({
label: `${item.expenseCategoryName}金额`,
name: `expenseAmount_${item.expenseCategoryId}`,
type: "showTxt",
formatter: row => row[`expenseAmount_${item.expenseCategoryId}`] ?? "",
})),
{
label: "收款账户",
name: "rcvBankName",
type: "showTxt",
},
];
formData.splice(amountIndex, 0, ...expenseFields);
const fileIndex = formData.findIndex(item => item.name === "fileUrlList");
formData.splice(fileIndex, 0, {
label: "发票及其他说明",
name: "invoiceRemark",
addHtml: "invoiceRemarkHtml",
});
return formData;
},
normalizeTransferRecord(item = {}) {
const record = {
...item,
fileUrlList: item.fileUrl ? item.fileUrl.split(",").filter(Boolean) : [],
rcvBankName: item.rcvBankName,
};
if (this.isMarketTransferRecord(record)) {
record.expenseCategoryList = record.expenseCategoryList || [];
record.expenseCategoryList.forEach((expense) => {
record[`expenseAmount_${expense.expenseCategoryId}`] = expense.expenseCategoryResult;
});
if ((record.amount === undefined || record.amount === null || record.amount === "") && record.transferTotalAmount !== undefined) {
record.amount = record.transferTotalAmount;
}
}
return record;
},
getTransferRecord() {
getTransferRecord({ id: this.info.id }).then((res) => {
this.transferList = res.transferList || [];
this.transferList = (res.transferList || []).map(item => this.normalizeTransferRecord(item));
this.dealTabList();
this.editData = deepClone(this.transferList[0]) || {};
console.log(this.editData, "this.editData");
......@@ -181,7 +260,6 @@ export default {
};
this.transferList.forEach((item, idx) => {
this.transferList[idx].oaApproveStatusTxt = statusObj[item.oaApproveStatus] || "";
this.transferList[idx].fileUrlList = item.fileUrl.split(",") || [];
this.tabPaneList.push({
label: "转账记录" + (idx + 1),
name: idx + "",
......@@ -214,4 +292,25 @@ export default {
align-items: center;
margin-bottom: 8px;
}
.expense-category-text {
display: inline-flex;
flex-wrap: wrap;
width: 314px;
line-height: 32px;
vertical-align: top;
}
.expense-category-item {
margin-right: 16px;
color: #333;
}
.record-transfer-text {
display: inline-block;
width: 616px;
margin-top: 6px;
line-height: 22px;
color: #333;
vertical-align: top;
white-space: normal;
word-break: break-all;
}
</style>
......@@ -20,15 +20,15 @@
<span class="detail-label">门店名称:</span>
<span class="detail-value">{{ detailForm.storeName }}</span>
</el-col>
<el-col class="detail-row" :span="12">
<el-col class="detail-row" :span="12">
<span class="detail-label">园区店店名称:</span>
<span class="detail-value">{{ detailForm.sellerMerchantShopName }}</span>
</el-col>
<el-col class="detail-row" :span="12">
<el-col class="detail-row" :span="12">
<span class="detail-label">客户姓名:</span>
<span class="detail-value">{{ detailForm.customerName }}</span>
</el-col>
<el-col class="detail-row" :span="12">
<el-col class="detail-row" :span="12">
<span class="detail-label">车架号:</span>
<span class="detail-value">{{ detailForm.standNo }}</span>
</el-col>
......@@ -77,7 +77,7 @@
技师占比
</div>
<div class="value">
<span>{{ detailForm.staffList[0] ? detailForm.staffList[0].name : '-' }}</span>
<span>{{ detailForm.technicianShareText || '-' }}</span>
</div>
</div>
</section>
......@@ -150,12 +150,14 @@
prop="remark" />
<el-table-column align="center" label="操作">
<template #default="scope">
<el-button type="text" v-if="scope.row.subItemPictures.length" @click="handlePreviewImage(scope.row)">
<el-button v-if="scope.row.subItemPictures.length"
type="text"
@click="handlePreviewImage(scope.row)">
查看施工图
</el-button>
<span v-else>
-
</span>
<span v-else>
-
</span>
</template>
</el-table-column>
</el-table>
......@@ -231,6 +233,7 @@ function emptyForm() {
staffList: [],
mainTechnicianList: [],
subTechnicianList: [],
technicianShareText: "-",
serviceItems: [],
subOrders: [],
dispatchTime: "",
......@@ -430,7 +433,7 @@ export default {
EARLIEST_OUTBOUND: "outboundTime",
EARLIEST_START: "startConstructionTime",
LATEST_END: "endConstructionTime",
LATEST_COMPLETE: "completeTime"
LATEST_COMPLETE: "completeTime",
};
const next = emptyTimelineFields();
list.forEach((it) => {
......@@ -454,7 +457,8 @@ export default {
});
},
handlePreviewImage(item) {
if (!item.subItemPictures?.length) return
if (!item.subItemPictures?.length)
return;
this.imgViewerVisible = true;
this.imageFileArr = item.subItemPictures || [];
},
......
......@@ -16,6 +16,92 @@ function toIntOrNull(v) {
return Number.isNaN(n) ? null : n;
}
function toNumberOrNull(v) {
if (v == null || v === "")
return null;
const n = Number(v);
return Number.isNaN(n) ? null : n;
}
function formatPercentNumber(n) {
const rounded = Math.round(n * 100) / 100;
if (!Number.isFinite(rounded))
return "";
return String(rounded);
}
function shareRateToPercentString(shareRate) {
const n = toNumberOrNull(shareRate);
if (n == null)
return "";
const percent = n <= 1 ? n * 100 : n;
return `${formatPercentNumber(percent)}%`;
}
function shareRateToPercentNumber(shareRate) {
const n = toNumberOrNull(shareRate);
if (n == null)
return null;
const percent = n <= 1 ? n * 100 : n;
return Number.isFinite(percent) ? percent : null;
}
function getTechnicianShareValue(t) {
if (!t)
return null;
if (t.shareRate != null && t.shareRate !== "")
return t.shareRate;
if (t.shareRatio != null && t.shareRatio !== "")
return t.shareRatio;
return null;
}
function buildTechnicianShareText(mainList, subList) {
const all = []
.concat(Array.isArray(mainList) ? mainList : [])
.concat(Array.isArray(subList) ? subList : [])
.filter(Boolean);
const mains = all.filter(t => Number(t.technicianType) === 0);
const subs = all.filter(t => Number(t.technicianType) === 1);
if (!mains.length && !subs.length)
return "-";
const subWithRate = subs.filter((t) => {
const v = getTechnicianShareValue(t);
return v != null && v !== "";
});
const mainCandidate = mains.find((t) => {
const v = getTechnicianShareValue(t);
return v != null && v !== "";
}) || mains[0] || null;
const mainPercentStr = shareRateToPercentString(getTechnicianShareValue(mainCandidate));
if (!subWithRate.length) {
const p = mainPercentStr || "100%";
return `主技师${p}(默认比例)`;
}
let mainPartPercent = mainPercentStr;
if (!mainPartPercent) {
const sum = subWithRate.reduce((acc, t) => {
const pn = shareRateToPercentNumber(getTechnicianShareValue(t));
return acc + (pn != null ? pn : 0);
}, 0);
const remain = Math.max(0, 100 - sum);
mainPartPercent = `${formatPercentNumber(remain)}%`;
}
const parts = [`主技师 ${mainPartPercent}`];
subWithRate.forEach((t, idx) => {
const name = `副手技师${t.technicianName}`;
const p = shareRateToPercentString(getTechnicianShareValue(t));
if (!p)
return;
parts.push(`${name} ${p}`);
});
return parts.length ? parts.join(" / ") : "-";
}
function formatListDateTime(v) {
if (v == null || v === "")
return "-";
......@@ -224,6 +310,7 @@ export function mapApiRowToDetailForm(row) {
name: t.technicianName,
role: t.technicianType === 0 ? "main" : "sub",
roleLabel: t.technicianType === 0 ? "主技师" : "技师",
shareRate: t.shareRate != null ? t.shareRate : t.shareRatio,
}));
const subTech = (row.subTechnicianList || [])
.filter(t => t)
......@@ -231,6 +318,7 @@ export function mapApiRowToDetailForm(row) {
name: t.technicianName,
role: "sub",
roleLabel: "副手技师",
shareRate: t.shareRate != null ? t.shareRate : t.shareRatio,
}));
const staffList = [...mainTech, ...subTech];
const serviceItems = []
......@@ -269,7 +357,7 @@ export function mapApiRowToDetailForm(row) {
reworkFlag: s.subItemStatus == 3 ? "是" : "否",
reworkConstructionCode: s.reworkConstructionCode || "-",
refundQuantity: formatMaterialsUsedDisplay(s.refundQuantity),
remark: s.subItemStatus == 3 ? (s.remark || '-') : "-",
remark: s.subItemStatus == 3 ? (s.remark || "-") : "-",
subItemPictures: (s.subItemPictures || [])
.map((p) => {
if (typeof p === "string")
......@@ -290,6 +378,9 @@ export function mapApiRowToDetailForm(row) {
staffList: staffList.length
? staffList
: [{ name: "-", role: "", roleLabel: "-" }],
mainTechnicianList: row.mainTechnicianList || [],
subTechnicianList: row.subTechnicianList || [],
technicianShareText: buildTechnicianShareText(row.mainTechnicianList, row.subTechnicianList),
serviceItems: serviceItems.length ? serviceItems : [{ name: "-", qty: "-" }],
subOrders: subOrders.length
? subOrders
......
......@@ -31,83 +31,154 @@ function parseDatetime(value) {
return "-";
}
function renderText(h, { data, schemaItem, schema }) {
return h("span", schemaItem.meta.fieldValue || "-");
}
function renderDatetime(h, { data, schemaItem, schema }) {
const formatted = parseDatetime(schemaItem.meta.fieldValue);
return h("span", formatted);
}
function renderLink(h, { data, schemaItem, schema }) {
const { fieldValue, linkAlias } = schemaItem.meta;
if (!fieldValue)
return h("span", "-");
const linkProps = {
attrs: {
href: fieldValue,
target: "_blank",
type: "primary",
// tooltip: true,
// parentProps: {
// style: {
// display: "inline-block",
// height: "32px",
// width: "auto",
// maxWidth: "100%",
// verticalAlign: "top",
// },
// },
// // tooltipProps: el-tooltip 的传参
// render: (h, { data, schemaItem, schema }) => {
// return h("div", { class: "text-hide" }, data.description || "-");
// },
function renderText() {
return {
tooltip: true,
tooltipProps: {
render: (h, { data, schemaItem, schema }) => {
return h("div", schemaItem.meta.fieldValue || "-");
},
},
on: {
click: (e) => {
e.preventDefault();
window.open(fieldValue, "_blank");
parentProps: {
style: {
display: "inline-block",
height: "32px",
width: "auto",
maxWidth: "100%",
verticalAlign: "top",
},
},
render: (h, { data, schemaItem, schema }) => {
return h("div", { class: "text-hide" }, schemaItem.meta.fieldValue || "-");
},
};
return h("el-link", linkProps, linkAlias || fieldValue);
}
function renderImage(h, { data, schemaItem, schema }) {
const { fieldValue } = schemaItem.meta;
if (!fieldValue || !Array.isArray(fieldValue) || fieldValue.length === 0) {
return h("span", "-");
}
return h(DescriptionImageList, { props: { list: fieldValue, size: 80 } });
function renderDatetime() {
return {
render: (h, { data, schemaItem, schema }) => {
const formatted = parseDatetime(schemaItem.meta.fieldValue);
return h("span", formatted);
},
};
}
function renderAttachment(h, { data, schemaItem, schema }) {
const { fieldValue } = schemaItem.meta;
if (!fieldValue || !Array.isArray(fieldValue) || fieldValue.length === 0) {
return h("span", "-");
}
const containerChildren = fieldValue.map((item, index) => {
const fileName = item.name || item.fileName || item.url || `附件${index + 1}`;
const fileUrl = item.value || item.url || "";
const rowChildren = [
h("span", {
function renderLink() {
return {
tooltip: true,
tooltipProps: {
render: (h, { data, schemaItem, schema }) => {
return h("div", schemaItem.meta.fieldValue || "-");
},
},
parentProps: {
style: {
display: "inline-block",
height: "32px",
width: "auto",
maxWidth: "100%",
verticalAlign: "top",
},
},
render: (h, { data, schemaItem, schema }) => {
const { fieldValue, linkAlias } = schemaItem.meta;
if (!fieldValue)
return h("span", "-");
const linkProps = {
class: "text-hide link-type",
style: {
width: "100%",
},
attrs: {
class: "file-name text-hide",
title: fileName,
style: "max-width: 50%",
href: fieldValue,
target: "_blank",
type: "primary",
},
}, fileName),
];
rowChildren.push(
h("el-link", {
attrs: { href: fileUrl, target: "_blank" },
props: { type: "primary", underline: false },
style: { marginLeft: "8px", lineHeight: 1 },
on: {
click: (e) => {
if (!fileUrl)
return;
e.preventDefault();
window.open(fileUrl, "_blank");
window.open(fieldValue, "_blank");
},
},
}, "下载"),
);
};
return h("el-link", linkProps, linkAlias || fieldValue);
},
};
}
return h("div", { attrs: { class: "attachment-item", style: "display: flex; align-items: center; margin-bottom: 8px;" } }, rowChildren);
});
function renderImage() {
return {
render: (h, { data, schemaItem, schema }) => {
const { fieldValue } = schemaItem.meta;
if (!fieldValue || !Array.isArray(fieldValue) || fieldValue.length === 0) {
return h("span", "-");
}
return h(DescriptionImageList, { props: { list: fieldValue, size: 80 } });
},
};
}
return h("div", { attrs: { class: "attachment-list" } }, containerChildren);
function renderAttachment() {
return {
render: (h, { data, schemaItem, schema }) => {
const { fieldValue } = schemaItem.meta;
if (!fieldValue || !Array.isArray(fieldValue) || fieldValue.length === 0) {
return h("span", "-");
}
const containerChildren = fieldValue.map((item, index) => {
const fileName = item.name || item.fileName || item.url || `附件${index + 1}`;
const fileUrl = item.value || item.url || "";
const rowChildren = [
h("span", {
attrs: {
class: "file-name text-hide",
title: fileName,
style: "max-width: 50%",
},
}, fileName),
];
rowChildren.push(
h("el-link", {
attrs: { href: fileUrl, target: "_blank", title: fileUrl },
props: { type: "primary", underline: false },
style: { marginLeft: "8px", lineHeight: 1 },
on: {
click: (e) => {
if (!fileUrl)
return;
e.preventDefault();
window.open(fileUrl, "_blank");
},
},
}, "下载"),
);
return h("div", { attrs: { class: "attachment-item" } }, rowChildren);
});
return h("div", { attrs: { class: "attachment-list" } }, containerChildren);
},
};
}
export default {
......
......@@ -15,12 +15,13 @@ export async function getTaskCenterTaskDescriptionSchema() {
display: "inline-block",
height: "32px",
width: "auto",
maxWidth: "100%",
verticalAlign: "top",
},
},
// tooltipProps: el-tooltip 的传参
render: (h, { data, schemaItem, schema }) => {
return h("span", {}, data.description || "-");
return h("div", { class: "text-hide" }, data.description || "-");
},
isHide: ({ formModel }) => !formModel.description,
},
......@@ -59,6 +60,8 @@ export async function getTaskCenterTaskDescriptionSchema() {
item?.label || "-",
);
},
isHide: ({ formModel }) => !formModel.priority,
},
{
name: "assignees",
......
......@@ -69,7 +69,7 @@ export default {
},
labelWidth: "120px",
meta: item,
render: cover2Descriptions[toUpper(item.fieldType)],
...cover2Descriptions?.[toUpper(item.fieldType)]?.(),
})));
this.descriptionSchema = schema;
} else {
......@@ -238,6 +238,29 @@ export default {
margin: 0 0 12px;
background-color: #ebeef5;
}
::v-deep .link-type {
overflow: hidden;
.el-link--inner {
display: inline-block;
height: 32px;
width: auto;
max-width: 100%;
vertical-align: top;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
::v-deep .attachment-list {
.attachment-item {
margin-bottom: 8px;
display: flex;
align-items: center;
&:last-child {
margin-bottom: 0;
}
}
}
::v-deep .form-item {
margin-bottom: 12px;
}
......
......@@ -31,9 +31,9 @@
操作日志
</div>
<el-table v-loading="loading"
style="width: 100%"
border
:data="tableData"
style="width: 100%">
:data="tableData">
<el-table-column align="center"
label="序号"
type="index"
......@@ -119,7 +119,7 @@ export default {
pageSize: 1000,
currentPage: 1,
upgradeGoodsId: this.row.upgradeGoodsId,
merchantId: this.row.merchantId,
merchantId: this.row.yqMerchantId,
};
getReplenishLogListApi(params).then((res) => {
......
......@@ -3,6 +3,7 @@ import {
EXPENSE_CATEGORY_OPTIONS,
FORM_COMPONENT_RULE,
buildMarketTransferFormData,
buildMarketTransferDownloadParams,
buildMarketTransferSubmitParams,
getVisibleAmountFields,
normalizeApprovedMarketTransferFees,
......@@ -16,17 +17,23 @@ describe("marketTransfer helpers", () => {
expect(fields.map(item => item.id)).toEqual([706, 900])
})
it("hides amount fields for expense categories already in approval", () => {
const fields = getVisibleAmountFields([706, 808, 900], [706, 900])
expect(fields.map(item => item.id)).toEqual([808])
})
it("maps market fee result rows by expense category id", () => {
const result = mapMarketFeeResults({
list: [
{ expenseCategoryId: 706, expenseCategoryResult: 11 },
{ expenseCategoryId: 900, expenseCategoryResult: 22 }
],
expenseCategoryTotalResult: 33
expenseCategoryTotalResult: 1.17
})
expect(result.amountMap).toEqual({ 706: 11, 900: 22 })
expect(result.totalAmount).toBe(33)
expect(result.totalAmount).toBe(1.17)
})
it("normalizes approved market transfer fees for default checked readonly categories", () => {
......@@ -98,4 +105,16 @@ describe("marketTransfer helpers", () => {
expect(params.id).toBe("bill-1")
expect(params.remark).toBe("ok")
})
it("downloads details only for unchecked approval expense categories", () => {
const params = buildMarketTransferDownloadParams({
reconciliationBillId: "bill-1",
expenseCategoryIds: [706, 808, 900]
}, [706, 900])
expect(params).toEqual({
reconciliationBillId: "bill-1",
expenseCategoryIds: [808]
})
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!