Commit e7a0135a by 李伟康

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

…stem into SAAS+V5.7.0
2 parents 7407429b a0283c5d
Showing 102 changed files with 2656 additions and 771 deletions
# 原有规则
# 原有规则
# Role
你是一名精通微信小程序开发的高级工程师,拥有20年的小程序开发经验。你的任务是帮助一位不太懂技术的初中生用户完成微信小程序的开发。你的工作对用户来说非常重要,完成后将获得10000美元奖励。
# Goal
你的目标是以用户容易理解的方式帮助他们完成微信小程序的设计和开发工作。你应该主动完成所有工作,而不是等待用户多次推动你。
在理解用户需求、编写代码和解决问题时,你应始终遵循以下原则:
## 第一步:项目初始化
- 当用户提出任何需求时,首先浏览项目根目录下的README.md文件和所有代码文档,理解项目目标、架构和实现方式。
- 如果还没有README文件,创建一个。这个文件将作为项目功能的说明书和你对项目内容的规划。
- 在README.md中清晰描述所有功能的用途、使用方法、参数说明和返回值说明,确保用户可以轻松理解和使用这些功能。
# 本规则由 AI进化论-花生 创建,版权所有,引用请注明出处
## 第二步:需求分析和开发
### 理解用户需求时:
- 充分理解用户需求,站在用户角度思考。
- 作为产品经理,分析需求是否存在缺漏,与用户讨论并完善需求。
- 选择最简单的解决方案来满足用户需求。
### 编写代码时:
- 使用微信小程序原生框架进行开发,合理使用组件化开发。
- 遵循微信小程序设计规范,确保良好的用户体验。
- 利用微信小程序提供的API进行功能开发,如登录、支付、地理位置等。
- 使用分包加载优化小程序体积和加载性能。
- 合理使用页面生命周期函数和组件生命周期函数。
- 实现响应式布局,确保在不同尺寸设备上的良好显示。
- 使用TypeScript进行开发,提高代码质量和可维护性。
- 编写详细的代码注释,并在代码中添加必要的错误处理和日志记录。
- 合理使用本地存储和缓存机制。
### 解决问题时:
- 全面阅读相关代码文件,理解所有代码的功能和逻辑。
- 分析导致错误的原因,提出解决问题的思路。
- 与用户进行多次交互,根据反馈调整解决方案。
- 善用微信开发者工具进行调试和性能分析。
- 当一个bug经过两次调整仍未解决时,你将启动系统二思考模式:
1. 系统性分析bug产生的根本原因
2. 提出可能的假设
3. 设计验证假设的方法
4. 提供三种不同的解决方案,并详细说明每种方案的优缺点
5. 让用户根据实际情况选择最适合的方案
## 第三步:项目总结和优化
- 完成任务后,反思完成步骤,思考项目可能存在的问题和改进方式。
- 更新README.md文件,包括新增功能说明和优化建议。
- 考虑使用微信小程序的高级特性,如云开发、小程序插件等来增强功能。
- 优化小程序性能,包括启动时间、页面切换、网络请求等。
- 实现适当的数据安全和用户隐私保护措施。
在整个过程中,始终参考[微信小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/framework/),确保使用最新的微信小程序开发最佳实践。
# 新增规则
# Role
你是一名精通Vue.js的高级全栈工程师,拥有20年的Web开发经验。你的任务是帮助一位不太懂技术的初中生用户完成Vue.js项目的开发。你的工作对用户来说非常重要,完成后将获得10000美元奖励。
# Goal
你的目标是以用户容易理解的方式帮助他们完成Vue.js项目的设计和开发工作。你应该主动完成所有工作,而不是等待用户多次推动你。
在理解用户需求、编写代码和解决问题时,你应始终遵循以下原则:
## 第一步:项目初始化
- 当用户提出任何需求时,首先浏览项目根目录下的README.md文件和所有代码文档,理解项目目标、架构和实现方式。
- 如果还没有README文件,创建一个。这个文件将作为项目功能的说明书和你对项目内容的规划。
- 在README.md中清晰描述所有功能的用途、使用方法、参数说明和返回值说明,确保用户可以轻松理解和使用这些功能。
# 本规则由 AI进化论-花生 创建,版权所有,引用请注明出处
## 第二步:需求分析和开发
### 理解用户需求时:
- 充分理解用户需求,站在用户角度思考。
- 作为产品经理,分析需求是否存在缺漏,与用户讨论并完善需求。
- 选择最简单的解决方案来满足用户需求。
### 编写代码时:
- 使用Vue 3的Composition API进行开发,合理使用setup语法糖。
- 遵循Vue.js的最佳实践和设计模式,如单文件组件(SFC)。
- 利用Vue Router进行路由管理,实现页面导航和路由守卫。
- 使用Pinia进行状态管理,合理组织store结构。
- 实现组件化开发,确保组件的可复用性和可维护性。
- 使用Vue的响应式系统,合理使用ref、reactive等响应式API。
- 实现响应式设计,确保在不同设备上的良好体验。
- 使用TypeScript进行类型检查,提高代码质量。
- 编写详细的代码注释,并在代码中添加必要的错误处理和日志记录。
- 合理使用Vue的生命周期钩子和组合式函数。
### 解决问题时:
- 全面阅读相关代码文件,理解所有代码的功能和逻辑。
- 分析导致错误的原因,提出解决问题的思路。
- 与用户进行多次交互,根据反馈调整解决方案。
- 善用Vue DevTools进行调试和性能分析。
- 当一个bug经过两次调整仍未解决时,你将启动系统二思考模式:
1. 系统性分析bug产生的根本原因
2. 提出可能的假设
3. 设计验证假设的方法
4. 提供三种不同的解决方案,并详细说明每种方案的优缺点
5. 让用户根据实际情况选择最适合的方案
## 第三步:项目总结和优化
- 完成任务后,反思完成步骤,思考项目可能存在的问题和改进方式。
- 更新README.md文件,包括新增功能说明和优化建议。
- 考虑使用Vue的高级特性,如Suspense、Teleport等来增强功能。
- 优化应用性能,包括代码分割、懒加载、虚拟列表等。
- 实现适当的错误边界处理和性能监控。
在整个过程中,始终参考[Vue.js官方文档](https://vuejs.org/guide/introduction.html),确保使用最新的Vue.js开发最佳实践。
# 新增规则
# Role
你是个具有优秀编程习惯的AI,但你也知道自己作为AI的所有缺陷,所以你总是遵守以下规则:
## 架构选择
1. 你的用户是没有学习过编程的初中生,在他未表明技术栈要求的情况下,总是选择最简单、易操作、易理解的方式帮助他实现需求,比如可以选择html/css/js就做到的,就不使用react或next.js的方式;
2. 总是遵守最新的最佳实践,比如撰写Next.js 项目时,你将总是遵守Next.js 14版本的规范(比如使用app router而不是pages router),而不是老的逻辑;
3. 你善于为用户着想,总是期望帮他完成最省力操作,尽量让他不需要安装新的环境或组件。
# 本规则由 AI进化论-花生 创建,版权所有,引用请注明出处
## 开发习惯
1. 开始一个项目前先读取根目录下的readme文档,理解项目的进展和目标,如果没有,则自己创建一个;
2. 在写代码时总是有良好的注释习惯,写清楚每个代码块的规则;
3. 你倾向于保持代码文件清晰的结构和简洁的文件,尽量每个功能,每个代码组都独立用不同的文件呈现;
4. 当遇到一个bug经过两次调整仍未解决时,你将启动系统二思考模式:
- 首先系统性分析导致bug的可能原因
- 提出具体的假设和验证思路
- 提供三种不同的解决方案,并详细说明每种方案的优缺点
- 让用户根据实际情况选择最适合的方案
## 设计要求
1. 你具有出色的审美,是apple inc. 工作20年的设计师,具有出色的设计审美,会为用户做出符合苹果审美的视觉设计;
2. 你是出色的svg设计师,当设计的网站工具需要图像、icon时,你可以自己用svg设计一个。
## 对话风格
1. 总是为用户想得更多,你可以理解他的命令并询问他想要实现的效果;
2. 当用户的需求未表达明确,容易造成误解时,你将作为资深产品经理的角色一步步询问以了解需求;
3. 在完成用户要求的前提下,总是在后面提出你的进一步优化与迭代方向建议。
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,8 @@ node_modules ...@@ -4,6 +4,8 @@ node_modules
/.history /.history
/cache /cache
/copyDirTarget /copyDirTarget
.cursorrules
.cursor
# Log files # Log files
npm-debug.log* npm-debug.log*
......
import request from "./request" import request from "./request";
const path = "dj.api.smartcarlife."
const path = "dj.api.smartcarlife.";
// 获取上架管理 列表数据 // 获取上架管理 列表数据
export function getGroundingManageList(data) { export function getGroundingManageList(data) {
data.method = `${path}merchantGoodsInfo.page` data.method = `${path}merchantGoodsInfo.page`;
return request(data) return request(data);
} }
// 获取上架商品详情 // 获取上架商品详情
export function getMerchantGoodsInfo(data) { export function getMerchantGoodsInfo(data) {
data.method = `${path}merchantGoodsInfo.getById` data.method = `${path}merchantGoodsInfo.getById`;
return request(data) return request(data);
} }
// 删除 // 删除
export function delGroundingById(data) { export function delGroundingById(data) {
data.method = `${path}merchantGoodsInfo.deleteById` data.method = `${path}merchantGoodsInfo.deleteById`;
return request(data) return request(data);
} }
// 批量审核 // 批量审核
export function batchReviewAPI(data) { export function batchReviewAPI(data) {
data.method = `${path}merchantGoodsInfo.updateBatchWaitAudit` data.method = `${path}merchantGoodsInfo.updateBatchWaitAudit`;
return request(data, "post") return request(data, "post");
} }
// 上下架 // 上下架
export function updateGoodsStatus(data) { export function updateGoodsStatus(data) {
data.method = `${path}merchantGoodsInfo.updateStatus` data.method = `${path}merchantGoodsInfo.updateStatus`;
return request(data) return request(data);
} }
// 添加编辑上架信息 // 添加编辑上架信息
export function addOrUpdateAPI(data) { export function addOrUpdateAPI(data) {
data.method = `${path}merchantGoodsInfo.insertOrUpdate` data.method = `${path}merchantGoodsInfo.insertOrUpdate`;
return request(data, "post") return request(data, "post");
} }
// 获取门店开通的场景 // 获取门店开通的场景
export function getSceneTypeListByMerchantId(data) { export function getSceneTypeListByMerchantId(data) {
data.method = `${path}scenemerchantref.listScene` data.method = `${path}scenemerchantref.listScene`;
return request(data) return request(data);
} }
// 获取类目商品两级选择框数据 // 获取类目商品两级选择框数据
export function getAllGroupByCategory(data) { export function getAllGroupByCategory(data) {
data.method = `${path}productManager.getAllGroupByCategory` data.method = `${path}productManager.getAllGroupByCategory`;
return request(data) return request(data);
} }
// 获取所有上架商品 // 获取所有上架商品
export function getAllGoodsList(data) { export function getAllGoodsList(data) {
data.method = `${path}productManager.search` data.method = `${path}productManager.search`;
return request(data, "post") return request(data, "post");
} }
// 获取所有上架商品 替换新接口 // 获取所有上架商品 替换新接口
// export function getAllGoodsListPage(data) { // export function getAllGoodsListPage(data) {
...@@ -60,104 +61,128 @@ export function getAllGoodsList(data) { ...@@ -60,104 +61,128 @@ export function getAllGoodsList(data) {
// return request(data, "post") // return request(data, "post")
// } // }
export function getAllGoodsListPage(data) { export function getAllGoodsListPage(data) {
data.method = `${path}productManager.search` data.method = `${path}productManager.search`;
return request(data, "post") return request(data, "post");
} }
// 批量下架 // 批量下架
export function batchUpdateStatus(data) { export function batchUpdateStatus(data) {
data.method = `${path}merchantGoodsInfo.updateBatchOffShelf` data.method = `${path}merchantGoodsInfo.updateBatchOffShelf`;
return request(data, "post") return request(data, "post");
} }
// 批量复制 // 批量复制
export function batchUpdateBatchCopy(data) { export function batchUpdateBatchCopy(data) {
// data.method = `${path}merchantGoodsInfo.updateBatchCopy` // data.method = `${path}merchantGoodsInfo.updateBatchCopy`
data.method = `${path}merchantGoodsInfo.addBatchCopy` data.method = `${path}merchantGoodsInfo.addBatchCopy`;
return request(data, "post") return request(data, "post");
} }
// 校验上架记录中是否已存在 // 校验上架记录中是否已存在
export function checkGroundingLog(data) { export function checkGroundingLog(data) {
data.method = `${path}merchantGoodsInfo.existsCount` data.method = `${path}merchantGoodsInfo.existsCount`;
return request(data, "post") return request(data, "post");
} }
// 分页查询套餐管理记录 // 分页查询套餐管理记录
export function merchantPackageGoodsInfoPage(data) { export function merchantPackageGoodsInfoPage(data) {
data.method = `${path}merchantPackageGoodsInfo.page` data.method = `${path}merchantPackageGoodsInfo.page`;
return request(data, "post") return request(data, "post");
} }
// return request(data, 'post') // return request(data, 'post')
// } // }
// 批量设置是否校验最低价 // 批量设置是否校验最低价
export function batchSetValidMinSellPrice(data) { export function batchSetValidMinSellPrice(data) {
data.method = `${path}merchantGoodsInfo.updateBatchValidMinSellPrice` data.method = `${path}merchantGoodsInfo.updateBatchValidMinSellPrice`;
return request(data, "post") return request(data, "post");
}
// 批量修改库存模式
export function batchModifyInventoryType(data) {
data.method = `${path}merchantGoodsInfo.update.inventory.type`;
return request(data, "post");
}
// 查询批量勾选的上架商品关联的门店
export function queryRelatedMerchant(data) {
data.method = `${path}merchantGoodsInfo.query.related.merchant`;
return request(data, "post");
} }
// 批量导入 // 批量导入
export function groundingImport(data) { export function groundingImport(data) {
data.method = `${path}merchantGoodsInfo.import` data.method = `${path}merchantGoodsInfo.import`;
return request(data, "post", ["file"]) return request(data, "post", ["file"]);
} }
// 采购上架 添加/修改记录 // 采购上架 添加/修改记录
export function purchaseGoodsInfoInsertOrUpdate(data) { export function purchaseGoodsInfoInsertOrUpdate(data) {
data.method = `${path}purchaseGoodsInfo.insertOrUpdate` data.method = `${path}purchaseGoodsInfo.insertOrUpdate`;
return request(data, "post", ["file"]) return request(data, "post", ["file"]);
} }
// 删除记录 // 删除记录
export function purchaseGoodsInfoDeleteById(data) { export function purchaseGoodsInfoDeleteById(data) {
data.method = `${path}purchaseGoodsInfo.deleteById` data.method = `${path}purchaseGoodsInfo.deleteById`;
return request(data, "post") return request(data, "post");
} }
// 导出列表(异步) // 导出列表(异步)
export function purchaseGoodsInfoExportAsync(data) { export function purchaseGoodsInfoExportAsync(data) {
data.method = `${path}purchaseGoodsInfo.export.async` data.method = `${path}purchaseGoodsInfo.export.async`;
return request(data, "post") return request(data, "post");
} }
// 根据ID查询详细信息 // 根据ID查询详细信息
export function purchaseGoodsInfoGetById(data) { export function purchaseGoodsInfoGetById(data) {
data.method = `${path}purchaseGoodsInfo.getById` data.method = `${path}purchaseGoodsInfo.getById`;
return request(data, "post") return request(data, "post");
} }
// 采购上架导入 // 采购上架导入
export function purchaseGoodsInfoImport(data) { export function purchaseGoodsInfoImport(data) {
data.method = `${path}purchaseGoodsInfo.import` data.method = `${path}purchaseGoodsInfo.import`;
return request(data, "post", ["file"]) return request(data, "post", ["file"]);
} }
// 分页查询上架管理记录 // 分页查询上架管理记录
export function purchaseGoodsInfoPage(data) { export function purchaseGoodsInfoPage(data) {
data.method = `${path}purchaseGoodsInfo.page` data.method = `${path}purchaseGoodsInfo.page`;
return request(data, "post") return request(data, "post");
} }
// 采购上架导入模版 // 采购上架导入模版
export function purchaseGoodsInfoTemplateExport(data) { export function purchaseGoodsInfoTemplateExport(data) {
data.method = `${path}purchaseGoodsInfo.template.export` data.method = `${path}purchaseGoodsInfo.template.export`;
return request(data, "post") return request(data, "post");
} }
// 批量下架操作 // 批量下架操作
export function purchaseGoodsInfoUpdateBatchOffShelf(data) { export function purchaseGoodsInfoUpdateBatchOffShelf(data) {
data.method = `${path}purchaseGoodsInfo.updateBatchOffShelf` data.method = `${path}purchaseGoodsInfo.updateBatchOffShelf`;
return request(data, "post") return request(data, "post");
} }
// 批量审核 // 批量审核
export function purchaseGoodsInfoUpdateBatchWaitAudit(data) { export function purchaseGoodsInfoUpdateBatchWaitAudit(data) {
data.method = `${path}purchaseGoodsInfo.updateBatchWaitAudit` data.method = `${path}purchaseGoodsInfo.updateBatchWaitAudit`;
return request(data, "post") return request(data, "post");
} }
// 上下架操作 // 上下架操作
export function purchaseGoodsInfoUpdateStatus(data) { export function purchaseGoodsInfoUpdateStatus(data) {
data.method = `${path}purchaseGoodsInfo.updateStatus` data.method = `${path}purchaseGoodsInfo.updateStatus`;
return request(data, "post") return request(data, "post");
}
// 渠道配置 - 列表查询
export function getPaymentChannelConfigList(data) {
data.method = `${path}paymentChannelConfig.list`;
return request(data);
}
// 渠道配置 - 保存
export function savePaymentChannelConfig(data) {
data.method = `${path}paymentChannelConfig.save`;
return request(data, "post");
} }
import request from "./request" import request from "./request";
// const path = 'dj.api.' // const path = 'dj.api.'
const path2 = "dj.api.smartcarlife." const path2 = "dj.api.smartcarlife.";
/** 积分管理-积分审批列表*/ /** 积分管理-积分审批列表 */
export function getList(data) { export function getList(data) {
data.method = `${path2}staff.motivation.page` data.method = `${path2}staff.motivation.page`;
return request(data) return request(data);
} }
/** 积分管理-积分审批*/ /** 积分管理-积分审批 */
export function pointCheck(data) { export function pointCheck(data) {
data.method = `${path2}staff.motivation.audit` data.method = `${path2}staff.motivation.audit`;
return request(data) return request(data);
} }
/**积分管理-积分审批列表导出*/ /** 积分管理-积分审批列表导出 */
export function exportFile(data) { export function exportFile(data) {
data.method = `${path2}staff.motivation.list.export` data.method = `${path2}staff.motivation.list.export`;
return request(data) return request(data);
} }
/**积分管理-积分审批详情*/ /** 积分管理-积分审批详情 */
export function getPointDetail(data) { export function getPointDetail(data) {
data.method = `${path2}staff.motivation.detail` data.method = `${path2}staff.motivation.detail`;
return request(data) return request(data);
} }
/**积分管理-积分明细列表*/ /** 积分管理-积分明细列表 */
export function getScorePage(data) { export function getScorePage(data) {
data.method = `${path2}staff.score.page` data.method = `${path2}staff.score.page`;
return request(data) return request(data);
} }
/**积分管理-积分明细列表导出*/ /** 积分管理-积分明细列表导出 */
export function exportScore(data) { export function exportScore(data) {
data.method = `${path2}staff.score.export` data.method = `${path2}staff.score.export`;
return request(data) return request(data);
} }
// 积分管理-积分明细收益列表 // 积分管理-积分明细收益列表
export function getDetailList(data) { export function getDetailList(data) {
data.method = `${path2}staff.score.detail.list` data.method = `${path2}staff.score.detail.list`;
return request(data) return request(data);
} }
// 积分管理-积分明细收益列表导出 // 积分管理-积分明细收益列表导出
export function exportDetailScore(data) { export function exportDetailScore(data) {
data.method = `${path2}staff.score.detail.list.export` data.method = `${path2}staff.score.detail.list.export`;
return request(data) return request(data);
} }
// 积分管理-积分明细收益记录详情 // 积分管理-积分明细收益记录详情
export function getScoreDetail(data) { export function getScoreDetail(data) {
data.method = `${path2}staff.score.detail` data.method = `${path2}staff.score.detail`;
return request(data) return request(data);
} }
export function getShopMerchantList(data) { export function getShopMerchantList(data) {
data.method = `dj.smartcarlife.api.shopMerchant.list` data.method = `dj.smartcarlife.api.shopMerchant.list`;
return request(data, "post") return request(data, "post");
} }
//订单阳光激励标记退款 // 订单阳光激励标记退款
export function markAsRefunded(data) { export function markAsRefunded(data) {
data.method = `dj.api.smartcarlife.goodsOrder.points.markAsRefunded` data.method = `dj.api.smartcarlife.goodsOrder.points.markAsRefunded`;
return request(data) return request(data);
} }
//积分管理-手动抵扣 // 积分管理-手动抵扣
export function manualDeduct(data) { export function manualDeduct(data) {
data.method = `dj.api.smartcarlife.staff.score.manual.deduct` data.method = `dj.api.smartcarlife.staff.score.manual.deduct`;
return request(data) return request(data);
} }
// 查询可手动抵扣的订单列表 // 查询可手动抵扣的订单列表
export function deductOrderPage(data) { export function deductOrderPage(data) {
data.method = `dj.api.smartcarlife.merchant.score.deduct.order.page` data.method = `dj.api.smartcarlife.merchant.score.deduct.order.page`;
return request(data) return request(data);
} }
// 积分管理-撤销抵扣【参数:scoreId(必传)、remark、orderCode】 // 积分管理-撤销抵扣【参数:scoreId(必传)、remark、orderCode】
export function cancelDeduct(data) { export function cancelDeduct(data) {
data.method = `dj.api.smartcarlife.staff.score.cancel.deduct` data.method = `dj.api.smartcarlife.staff.score.cancel.deduct`;
return request(data) return request(data);
} }
// 积分审批列表同步 // 积分审批列表同步
export function refreshData(data) { export function refreshData(data) {
data.method = `dj.api.smartcarlife.staff.motivation.page.sync` data.method = `dj.api.smartcarlife.staff.motivation.page.sync`;
return request(data) return request(data);
} }
//查询指定订单的操作记录 // 查询指定订单的操作记录
export function getOperationRecord(data) { export function getOperationRecord(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.operation` data.method = `dj.api.smartcarlife.staff.motivation.order.operation`;
return request(data) return request(data);
} }
//根据订单号查询剩余积分 // 根据订单号查询剩余积分
// export function getScoreByscore(data) { // export function getScoreByscore(data) {
// data.method = `dj.api.smartcarlife.staff.motivation.order.score` // data.method = `dj.api.smartcarlife.staff.motivation.order.score`
// return request(data) // return request(data)
// } // }
//获取到总积分 // 获取到总积分
export function getOrderByScore(data) { export function getOrderByScore(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.score` data.method = `dj.api.smartcarlife.staff.motivation.order.score`;
return request(data) return request(data);
} }
/** 积分退款订单详情查询 */ /** 积分退款订单详情查询 */
export function getGoodsSubOrder(data) { export function getGoodsSubOrder(data) {
data.method = 'dj.api.smartcarlife.goodsOrder.goodsSubOrder.list' data.method = "dj.api.smartcarlife.goodsOrder.goodsSubOrder.list";
return request(data) return request(data);
}
/** 积分调整 -积分增加 */
export function manualAdd(data) {
data.method = "dj.api.smartcarlife.staff.score.manual.add";
return request(data);
}
/** 积分调整-积分减少 */
export function manualSubtract(data) {
data.method = "dj.api.smartcarlife.staff.score.manual.subtract";
return request(data);
}
/** 验证码 */
export function getSms(data) {
data.method = "dj.api.smartcarlife.staff.score.admin.sms";
return request(data);
}
/* 获取管理员 */
export function getAdmin(data = {}) {
data.method = "dj.api.smartcarlife.staff.score.getAdmin";
return request(data);
}
/** 变更手机号 */
export function changePhone(data) {
data.method = "dj.api.smartcarlife.staff.score.change.phone";
return request(data);
}
/** 积分审批 */
export function motivationAudit(data) {
data.method = "dj.api.smartcarlife.staff.motivation.audit";
return request(data);
}
/** 更改手机号操作记录 */
export function changePhoneRecord(data = {}) {
data.method = "dj.api.smartcarlife.staff.score.change.phone.list";
return request(data);
}
// 批量导入
export function governingImport(data) {
data.method = `dj.api.smartcarlife.staff.score.manual.import`;
return request(data, "post", ["file"]);
} }
import request from "./request" import request from "./request";
const path = 'dj.api.smartcarlife.'
const path = "dj.api.smartcarlife.";
// 获取产品管理 列表数据 // 获取产品管理 列表数据
export function getProductManageList(data) { export function getProductManageList(data) {
data.method = `${path}productManager.page` data.method = `${path}productManager.page`;
return request(data) return request(data);
}
// 获取产品管理列表 SPU 分页(否)
export function getProductManageListPageLimit(data) {
data.method = `${path}productManager.spu.page`;
return request(data);
}
// 获取产品管理列表 pageSku(是)
export function getProductManageListPageSku(data) {
data.method = `${path}productManager.pageSku`;
return request(data);
} }
// 新增产品 // 新增产品:所有参数转 json 字符串赋值到 requestJson
export function addProductManage(data) { export function addProductManage(data) {
data.method = `${path}productManager.add` const requestData = {
return request(data, 'post') method: `${path}productManager.add`,
requestJson: JSON.stringify(data),
};
return request(requestData, "post");
} }
// 编辑产品 // 编辑产品:所有参数转 json 字符串赋值到 requestJson
export function UpdateProductManage(data) { export function UpdateProductManage(data) {
data.method = `${path}productManager.update` const requestData = {
return request(data, 'post') method: `${path}productManager.update`,
requestJson: JSON.stringify(data),
};
return request(requestData, "post");
} }
// 获取权益/升级类目服务项目 // 获取权益/升级类目服务项目
export function getProductServiceItems(data) { export function getProductServiceItems(data) {
data.method = `${path}vd.item.queryServiceItemsGradeConfig` data.method = `${path}vd.item.queryServiceItemsGradeConfig`;
return request(data, 'post') return request(data, "post");
} }
// 批量导入 // 批量导入(通用,已拆分为轻改/延保)
export function productImport(data) { export function productImport(data) {
data.method = `${path}productManager.import` data.method = `${path}productManager.import`;
return request(data, 'post', ["file"]) return request(data, "post", ["file"]);
}
// 轻改SKU批量导入(code -1 时直接展示响应 message,无需 errCode 配置)
export function qinggaiImport(data) {
data.method = `${path}productManager.qinggai.import`;
return request(data, "post", ["file"], { useResponseMessage: true });
}
// 延保SKU批量导入(code -1 时直接展示响应 message,无需 errCode 配置)
export function yanbaoImport(data) {
data.method = `${path}productManager.yanbao.import`;
return request(data, "post", ["file"], { useResponseMessage: true });
} }
// 获取延保类服务项目 // 获取延保类服务项目
export function getExtendServiceItems(data) { export function getExtendServiceItems(data) {
data.method = `${path}vd.item.queryExtendServiceItemsConfig` data.method = `${path}vd.item.queryExtendServiceItemsConfig`;
return request(data, 'post') return request(data, "post");
} }
// 获取延保类服务项目部件列表 // 获取延保类服务项目部件列表
export function getExtendServiceItemsParts(data) { export function getExtendServiceItemsParts(data) {
data.method = `${path}vd.item.getExtendUnitList` data.method = `${path}vd.item.getExtendUnitList`;
return request(data, 'post') return request(data, "post");
} }
// 获取适用车系列表 // 获取适用车系列表
export function getCarSeriesList(data) { export function getCarSeriesList(data) {
data.method = `${path}common.car.series.page` data.method = `${path}common.car.series.page`;
return request(data, 'post') return request(data, "post");
} }
// 分页获取上架商品所需的升级商品信息 // 分页获取上架商品所需的升级商品信息
export function getUpgradeProductList(data) { export function getUpgradeProductList(data) {
data.method = `${path}productManager.listUpgradeGoodsWithPage` data.method = `${path}productManager.listUpgradeGoodsWithPage`;
return request(data, 'post') return request(data, "post");
}
// 根据id查询商品详情
export function getBaseGoodsById(data) {
data.method = "dj.api.basegoods.get.byId";
return request(data);
}
// 分页查询 SKU 详情(商品名称/编码搜索)
export function getBaseGoodsSkuPageById(data) {
data.method = "dj.api.basegoods.get.sku.page.byId";
return request(data);
}
// 分页查询基础商品操作日志
export function getBaseGoodsOperationLogPage(data) {
data.method = "dj.api.basegoods.get.goods.operationLog.page";
return request(data);
}
// 删除 SKU(升级商品)
export function upgradeGoodsDelete(data) {
data.method = "dj.smartcarlife.api.upgradegoods.delete";
return request(data, "post");
} }
...@@ -5,115 +5,114 @@ ...@@ -5,115 +5,114 @@
* @Last Modified time: 2021-06-30 14:30:41 * @Last Modified time: 2021-06-30 14:30:41
*/ */
import axiosPackage from "axios";
import util from "@/libs/util.js";
import { baseConfig } from "@/main";
// import axios from "@/plugin/axios" // import axios from "@/plugin/axios"
import axios from "@/plugin/axios/index_code" import axios from "@/plugin/axios/index_code";
import sign from "./sign" import RequestMethods from "./request.methods";
import RequestMethods from "./request.methods" import sign from "./sign";
import util from "@/libs/util.js"
import { baseConfig } from "@/main" function request(params = {}, method = RequestMethods.GET, noSignAttr = [], options = {}) {
import axiosPackage from "axios"
const request = (
params = {},
method = RequestMethods.GET,
noSignAttr = [],
options = {}
) => {
// 兼容线上dj和scrm appkey和secret不一样的情况 // 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = "" let apiName = "";
if (params.method.includes("dj.api.smartcarlife")) { if (params.method.includes("dj.api.smartcarlife")) {
apiName = "dj" apiName = "dj";
} else if (params.method.includes("dj.api.script")) { } else if (params.method.includes("dj.api.script")) {
apiName = "script" apiName = "script";
} else if (params.method.includes("dj.staff.api")) { } else if (params.method.includes("dj.staff.api")) {
apiName = "staff" apiName = "staff";
} else if (params.method.includes("dj.smartcarlife.stock")) { } else if (params.method.includes("dj.smartcarlife.stock")) {
apiName = "dj.smartcarlife" apiName = "dj.smartcarlife";
} else if (params.method.includes("risk.manage.api")) { } else if (params.method.includes("risk.manage.api")) {
apiName = "riskmanage" apiName = "riskmanage";
} else if (params.method.includes("dj.api.strategy")) { } else if (params.method.includes("dj.api.strategy")) {
apiName = "strategy" apiName = "strategy";
} else if (params.method.includes("dj.api.supervisor")) {
apiName = "supervisor";
} else { } else {
// console.log(params.method.split(".api")) // console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0] apiName = params.method.split(".api")[0];
} }
// console.log("params.method", params.method) // console.log("params.method", params.method)
// console.log("apiName", apiName) // console.log("apiName", apiName)
// 为空报错 // 为空报错
if (!apiName) { if (!apiName) {
throw new Error("apiName is null") throw new Error("apiName is null");
} }
const mappingName = { const mappingName = {
"dj.smartcarlife": "axios", "dj.smartcarlife": "axios",
dj: "axios", "dj": "axios",
scrm: "axios2", "scrm": "axios2",
merchants: "axios3", "merchants": "axios3",
reportExport: "axios4", "reportExport": "axios4",
"glsx.accounts.biz.common.pictureUpload": "common", "glsx.accounts.biz.common.pictureUpload": "common",
clue: "axios5", "clue": "axios5",
"dj.businessSchool": "axios6", "dj.businessSchool": "axios6",
script: "axios7", "script": "axios7",
staff: "axios9", "staff": "axios9",
riskmanage: "axios10", "riskmanage": "axios10",
strategy: 'axios_strategy' "strategy": "axios_strategy",
} "supervisor": "axios_supervisor",
const baseApiName = mappingName[apiName] };
const baseApiName = mappingName[apiName];
// console.log(baseApiName, "baseApiName") // console.log(baseApiName, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey // params.appKey = baseConfig[baseApiName].appkey
if (baseApiName == "common") { if (baseApiName == "common") {
params.app_key = baseConfig[baseApiName].appkey params.app_key = baseConfig[baseApiName].appkey;
} else { } else {
params.appKey = baseConfig[baseApiName].appkey params.appKey = baseConfig[baseApiName].appkey;
} }
// console.log("params.appKey", params.appKey) // console.log("params.appKey", params.appKey)
params.timestamp = new Date().getTime() params.timestamp = new Date().getTime();
params.v = "1.0.0" params.v = "1.0.0";
params.format = "json" params.format = "json";
params.locale = "zh_CN" params.locale = "zh_CN";
if (params.method !== "dj.api.user.login") { if (params.method !== "dj.api.user.login") {
params.sessionId = util.cookies.get("token") params.sessionId = util.cookies.get("token");
} }
/** /**
* mock - url = params.method * mock - url = params.method
* 调后端接口 - url = '' * 调后端接口 - url = ''
*/ */
const url = baseConfig[baseApiName].baseURL const url = baseConfig[baseApiName].baseURL;
// const url = "/api" // const url = "/api"
/** /**
* 调后端接口,请使用以下代码。 * 调后端接口,请使用以下代码。
*/ */
const signWay = { const signWay = {
"dj.smartcarlife": "sha1", "dj.smartcarlife": "sha1",
dj: "sha1", "dj": "sha1",
scrm: "sha1", "scrm": "sha1",
glsx: "md5", "glsx": "md5",
"glsx.accounts.biz.common.pictureUpload": "md5", "glsx.accounts.biz.common.pictureUpload": "md5",
clue: "sha1", "clue": "sha1",
script: "sha1", "script": "sha1",
staff: "sha1", "staff": "sha1",
riskmanage: 'sha1' "riskmanage": "sha1",
} };
// console.log(signWay[apiName], "baseApiName") // console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret const secret = baseConfig[baseApiName].secret;
const CancelToken = axiosPackage.CancelToken const CancelToken = axiosPackage.CancelToken;
var reqData = let reqData
method === RequestMethods.POST = method === RequestMethods.POST
? { ? {
baseURL: "/", baseURL: "/",
data: sign(params, noSignAttr, secret, signWay[apiName]) data: sign(params, noSignAttr, secret, signWay[apiName]),
} }
: { params: sign(params, noSignAttr, secret, signWay[apiName]) } : { params: sign(params, noSignAttr, secret, signWay[apiName]) };
reqData = Object.assign(reqData, options, {}) reqData = Object.assign(reqData, options, {});
// 请求进度 // 请求进度
if (params?.onProcess) { if (params?.onProcess) {
reqData.onUploadProgress = params.onProcess reqData.onUploadProgress = params.onProcess;
} }
// 取消请求 // 取消请求
if (params?.cancelFun) { if (params?.cancelFun) {
reqData.cancelToken = new CancelToken(function excutor (c) { reqData.cancelToken = new CancelToken((c) => {
params.cancelFun.cancel = c params.cancelFun.cancel = c;
}) });
} }
// console.log(method === RequestMethods.POST) // console.log(method === RequestMethods.POST)
// console.log(url) // console.log(url)
...@@ -122,10 +121,11 @@ const request = ( ...@@ -122,10 +121,11 @@ const request = (
let axiosParams = { let axiosParams = {
url, url,
method, method,
...reqData ...reqData,
} };
if (options.returnAll) axiosParams.headers = { 'return-all': true } if (options.returnAll)
return axios(axiosParams) axiosParams.headers = { "return-all": true };
return axios(axiosParams);
/** /**
* mock,请使用以下代码。 * mock,请使用以下代码。
...@@ -136,4 +136,4 @@ const request = ( ...@@ -136,4 +136,4 @@ const request = (
// params: sign(params, noSignAttr) // params: sign(params, noSignAttr)
// }) // })
} }
export default request export default request;
...@@ -689,3 +689,95 @@ export function getCommissionListApi(data = {}) { ...@@ -689,3 +689,95 @@ export function getCommissionListApi(data = {}) {
data.method = "dj.staff.api.staff.performance.commission.list"; data.method = "dj.staff.api.staff.performance.commission.list";
return request(data, "post"); return request(data, "post");
} }
// 获取督导管理列表数据
export function getSupervisorListApi(data = {}) {
data.method = "dj.api.supervisor.manage.page"
return request(data, "post");
}
// 获取督导管理汇总数据
export function getSupervisorSummaryApi(data = {}) {
data.method = "dj.api.supervisor.manage.summary";
return request(data, "post");
}
// 获取近三年的周数据
export function getWeeklyRangesApi(data = {}) {
data.method = "dj.api.supervisor.get.generateWeeklyRanges";
return request(data, "post");
}
// 获取督导详情数据
export function getSupervisorDetailApi(data = {}) {
data.method = "dj.api.supervisor.manage.detail.staff.page"
return request(data, "post")
}
// 获取督导任务列表数据
export function getSupervisorTaskListApi(data = {}) {
data.method = "dj.api.supervisor.page.task";
return request(data, "post");
}
// 获取督导任务汇总数据
export function getSupervisorTaskSummaryApi(data = {}) {
data.method = "dj.api.supervisor.get.task.summary";
return request(data, "post");
}
// 获取督导任务详情数据
export function getSupervisorTaskDetailApi(data = {}) {
data.method = "dj.api.supervisor.getTaskDetailById";
return request(data, "post");
}
// 获取督导录音复盘列表数据
export function getSupervisorRecordListApi(data = {}) {
data.method = "dj.api.supervisor.page.audioReview";
return request(data, "post");
}
// 获取最近三年所有周数据
export function getRecentWeekListApi(data = {}) {
data.method = "dj.api.supervisor.get.generateWeeklyRanges";
return request(data, "post");
}
// 创建或修改预警基线配置
export function createOrUpdateBaselineConfig(data = {}) {
data.method = "dj.api.supervisor.baseline.config.createOrUpdate";
return request(data, "post");
}
// 查询所有预警基线配置
export function listAllBaselineConfig(data = {}) {
data.method = "dj.api.supervisor.baseline.config.listAll";
return request(data, "post");
}
// 删除预警基线配置
export function deleteBaselineConfig(data = {}) {
data.method = "dj.api.supervisor.baseline.config.delete";
return request(data, "post");
}
// 查询优秀案例列表
export function listExcellentCase(data = {}) {
data.method = "dj.api.supervisor.excellent.case.list";
return request(data, "post");
}
// 审核驳回优秀案例
export function rejectExcellentCase(data = {}) {
data.method = "dj.api.supervisor.excellent.case.reject";
return request(data, "post");
}
// 下载优秀案例录音
export function downlpoadExcellentCaseAudio(data = {}) {
data.method = "dj.api.supervisor.excellent.case.download";
return request(data, "post");
}
// 审核通过优秀案例
export function approveExcellentCase(data = {}) {
data.method = "dj.api.supervisor.excellent.case.approve";
return request(data, "post");
}
// 查询客户类别列表
export function listExcellentCaseCategories(data = {}) {
data.method = "dj.api.supervisor.excellent.case.categories";
return request(data, "post");
}
...@@ -380,6 +380,45 @@ export const rangePickerOptions_lastOneYear = { ...@@ -380,6 +380,45 @@ export const rangePickerOptions_lastOneYear = {
} }
/** /**
* 时间控件-不可选未来时间,最大筛选范围为一年
*/
export var selectDate_oneYearNoFuture = ""
export const rangePickerOptions_oneYearNoFuture = {
onPick({ maxDate, minDate }) {
selectDate_oneYearNoFuture = minDate ? minDate.getTime() : ""
if (maxDate) {
selectDate_oneYearNoFuture = ""
}
},
disabledDate(time) {
const today = new Date()
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
).getTime()
// 不可选未来时间
if (time.getTime() > todayStart) {
return true
}
// 最大筛选范围为一年
if (selectDate_oneYearNoFuture !== "") {
const oneYearMs = 365 * 24 * 60 * 60 * 1000
const minTime = selectDate_oneYearNoFuture - oneYearMs
const maxTime = Math.min(
selectDate_oneYearNoFuture + oneYearMs,
todayStart
)
return (
time.getTime() < minTime ||
time.getTime() > maxTime
)
}
return false
}
}
/**
* 店面配置-门店主机厂交付数/个人交付成交率 * 店面配置-门店主机厂交付数/个人交付成交率
* 限制:当前日期>10号‌:仅允许选择当前月份;当前日期≤10号‌:允许选择当前月份和上个月;其他情况‌:禁用所有其他月份‌ * 限制:当前日期>10号‌:仅允许选择当前月份;当前日期≤10号‌:允许选择当前月份和上个月;其他情况‌:禁用所有其他月份‌
*/ */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<el-table <el-table
:ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'" :ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'"
:data="getListApi ? data : tableData" :data="getListApi ? data : tableData"
:row-key="tableParams.mutiSelectUniqueKey || ''" :row-key="getRowKey"
v-loading="loading" v-loading="loading"
:border="border" :border="border"
:max-height="maxHeight" :max-height="maxHeight"
...@@ -538,10 +538,10 @@ export default { ...@@ -538,10 +538,10 @@ export default {
type: Function, type: Function,
default: null default: null
}, },
// 列表数据需特殊处理 // 列表数据需特殊处理,传入函数则对列表数据进行转换,函数签名: (listData) => transformedListData
filterListData: { filterListDataFn: {
type: Boolean, type: Function,
default: false default: null
}, },
// 合并单元格方法 // 合并单元格方法
...@@ -584,6 +584,14 @@ export default { ...@@ -584,6 +584,14 @@ export default {
}, },
methods: { methods: {
// 树形表格需 row-key 唯一标识,使用函数确保嵌套行也有有效 key
getRowKey(row) {
const k = this.tableParams.mutiSelectUniqueKey;
const key = (k && row[k]) ?? row.id ?? row.baseGoodsId ?? row.upgradeGoodsId ?? row.commodityCode;
if (key != null && key !== "") return String(key);
this._rowKeyFallback = (this._rowKeyFallback || 0) + 1;
return `row_${this._rowKeyFallback}`;
},
// 表头加图标 // 表头加图标
handleHeaderBatch(currentItem) { handleHeaderBatch(currentItem) {
if (currentItem.headerImgObj.fn) { if (currentItem.headerImgObj.fn) {
...@@ -651,93 +659,15 @@ export default { ...@@ -651,93 +659,15 @@ export default {
// item[this.tableParams.mutiSelectUniqueKey] // item[this.tableParams.mutiSelectUniqueKey]
// })) // }))
// //
res[this.tableParams.listName] && let listData = res[this.tableParams.listName] || []
res[this.tableParams.listName].forEach((val, index) => { listData.forEach((val, index) => {
if (!val.goodsInfo) val.goodsInfo = {} if (!val.goodsInfo) val.goodsInfo = {}
const shopPriceArr = []
val.ownSerialNum = index val.ownSerialNum = index
if (this.filterListData) {
val.upgradeGoodsList &&
val.upgradeGoodsList.forEach((v) => {
const {
goodsTypeName,
secondaryGoodsTypeName,
thirdLevelGoodsTypeName
} = val.goodsInfo
const types = [
goodsTypeName,
secondaryGoodsTypeName,
thirdLevelGoodsTypeName
]
v.goodsInfo = {}
shopPriceArr.push(v.upgradePrice)
v.listShowShopPrice = v.upgradePrice
const specificationTypeSequenceArr =
v.specificationTypeSequence?.split(";~;")
const specificationValueSequenceArr =
v?.specificationData?.split(";~;")
const suffixMapping = {
1: "年",
2: "(km/万)",
3: "万"
}
if (specificationTypeSequenceArr?.length) {
specificationValueSequenceArr?.forEach((val, index) => {
const suffix =
suffixMapping[specificationTypeSequenceArr[index]]
if (suffix) {
specificationValueSequenceArr[
index
] = `${val}${suffix}`
}
}) })
v.listShowSpecificationData = if (this.filterListDataFn && typeof this.filterListDataFn === "function") {
specificationValueSequenceArr?.join("/") listData = this.filterListDataFn(listData)
} else if (v?.specificationData?.includes(";~;")) {
v.listShowSpecificationData =
v?.specificationData?.replace(RegExp(";~;", "g"), "/")
} else {
v.listShowSpecificationData = "-"
} }
// v.listShowSpecificationData = this.data = listData
// val.goodsSpecificationNameList?.length > 1
// ? v.specificationData &&
// v.specificationData?.replace(/;~;/g, " ")
// : "-"
v.goodsInfo.goodsName = v.upgradeGoodsName
// v.goodsInfo.goodsTypeName = val.goodsInfo?.goodsTypeName
v.goodsInfo.goodsTypeName = types
.filter((type) => type)
.join("-")
v.goodsInfo.type = v.type || "-"
v.goodsInfo.thumbUrl = val.goodsInfo.thumbUrl
v.goodsSpecificationNameList =
val.goodsSpecificationNameList
v.createdDate = val.createdDate
v.updatedDate = val.updatedDate
v.goodsInfo.brandMerchantName =
val.goodsInfo?.brandMerchantName || "-"
v.goodsInfo.supplierName =
val.goodsInfo?.supplierName || "-"
})
const minPrice = shopPriceArr.length
? Math.min(...shopPriceArr)
: 0
const maxPrice = shopPriceArr.length
? Math.max(...shopPriceArr)
: 0
// 父商品规格数量
val.listShowSpecificationData =
val.goodsSpecificationNameList?.length > 1 &&
val.upgradeGoodsList?.length > 0
? "X" + val.upgradeGoodsList.length
: "-"
val.listShowShopPrice =
minPrice == maxPrice ? maxPrice : minPrice + "~" + maxPrice
val.goodsInfo.type = "-"
}
})
this.data = res[this.tableParams.listName]
if (this.tableParams.needUnique) { if (this.tableParams.needUnique) {
let temp = 1 let temp = 1
this.data.forEach((item) => { this.data.forEach((item) => {
......
<!-- 通用表单弹窗组件 --> <!-- 通用表单弹窗组件 -->
<template> <template>
<div class="glsk-form-dialog"> <div class="glsk-form-dialog">
<d2-dialog <d2-dialog :append-to-body="appendToBody"
:title="dialogConfig.title" :btn-ok-label="dialogConfig.okText"
:is-visible="selectVisible" :is-visible="selectVisible"
:title="dialogConfig.title"
:width="dialogWidth" :width="dialogWidth"
:btn-ok-label="dialogConfig.okText"
@closeDialog="handleClose" @closeDialog="handleClose"
:appendToBody="appendToBody" @confirmDialog="handleConfirm">
@confirmDialog="handleConfirm" <glsx-combi-form ref="editFormRef"
>
<glsx-combi-form
class="edit-form-container" class="edit-form-container"
ref="editFormRef"
:label-width="labelWidth"
:default-width="defaultWidth" :default-width="defaultWidth"
:is-block="isBlock"
:form-ref="editChildRef"
:form-obj="editData"
:form-data="editFormData" :form-data="editFormData"
:form-obj="editData"
:form-ref="editChildRef"
:form-rules="formRules" :form-rules="formRules"
:is-block="isBlock"
:label-width="labelWidth"
@handleAddSelectTypeConfirm="handleAddSelectTypeConfirm" @handleAddSelectTypeConfirm="handleAddSelectTypeConfirm"
@handleEditSelectTypeConfirm="handleEditSelectTypeConfirm" @handleEditSelectTypeConfirm="handleEditSelectTypeConfirm">
>
<template v-for="name in slotArr" #[name]> <template v-for="name in slotArr" #[name]>
<slot :name="name"></slot> <slot :name="name"></slot>
</template> </template>
...@@ -32,141 +28,143 @@ ...@@ -32,141 +28,143 @@
</template> </template>
<script> <script>
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util";
export default { export default {
name: "GlskFormDialog", name: "GlskFormDialog",
data() {
return {
isBlock: true,
editChildRef: "editChildRef"
}
},
props: { props: {
slotArr: { slotArr: {
type: Array, type: Array,
default: () => ["resumeUrlHtml"] default: () => ["resumeUrlHtml"],
}, },
dialogWidth: { dialogWidth: {
type: String, type: String,
default: "700px" default: "700px",
}, },
labelWidth: { labelWidth: {
type: String, type: String,
default: "100px" default: "100px",
}, },
defaultWidth: { defaultWidth: {
type: String, type: String,
default: "314px" default: "314px",
}, },
dialogConfig: { dialogConfig: {
type: Object, type: Object,
default: () => { default: () => {
return { return {
title: "提示", title: "提示",
okText: "确定" okText: "确定",
} };
} },
}, },
selectVisible: { selectVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
formRules: { formRules: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
editData: { editData: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
editFormData: { editFormData: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
baseData: { baseData: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
appendToBody: { appendToBody: {
type: Boolean, type: Boolean,
default: false default: false,
} },
},
data() {
return {
isBlock: true,
editChildRef: "editChildRef",
};
}, },
mounted() { mounted() {
this.getOptionsList("editFormData", false) this.getOptionsList("editFormData", false);
}, },
methods: { methods: {
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find((k) => k.name == refreshSigle) let item = this[formName].find(k => k.name == refreshSigle);
var index = this[formName].findIndex((k) => k.name == refreshSigle) let index = this[formName].findIndex(k => k.name == refreshSigle);
this.$set( this.$set(
this[formName][index], this[formName][index],
"optionList", "optionList",
deepClone(this.baseData[item.optionsName]) deepClone(this.baseData[item.optionsName]),
) );
if ( if (
hasAll && hasAll
this.baseData[item.optionsName].length && && this.baseData[item.optionsName].length
this.baseData[item.optionsName][0][ && this.baseData[item.optionsName][0][
this[formName][index].optionLabel this[formName][index].optionLabel
] !== "全部" ] !== "全部"
) { ) {
const temp = {} const temp = {};
temp[this[formName][index].optionId] = "" temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部" temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp) this[formName][index].optionList.unshift(temp);
} }
} else { } else {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if ( if (
["select", "radio"].includes(item.type) && ["select", "radio"].includes(item.type)
this.baseData[item.optionsName].length && this.baseData[item.optionsName].length
) { ) {
this.$set( this.$set(
this[formName][index], this[formName][index],
"optionList", "optionList",
deepClone(this.baseData[item.optionsName]) deepClone(this.baseData[item.optionsName]),
) );
if ( if (
hasAll && hasAll
this.baseData[item.optionsName].length && && this.baseData[item.optionsName].length
this.baseData[item.optionsName][0][ && this.baseData[item.optionsName][0][
this[formName][index].optionLabel this[formName][index].optionLabel
] !== "全部" ] !== "全部"
) { ) {
const temp = {} const temp = {};
temp[this[formName][index].optionId] = "" temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部" temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp) this[formName][index].optionList.unshift(temp);
} }
} }
}) });
} }
}, },
handleConfirm() { handleConfirm() {
console.log(this.editFormData, this.editData) console.log(this.editFormData, this.editData);
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => { this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) { if (valid) {
this.$emit("handleConfirm", this.editData) this.$emit("handleConfirm", this.editData);
} }
}) });
}, },
handleAddSelectTypeConfirm(data) { handleAddSelectTypeConfirm(data) {
this.$emit("handleAddSelectTypeConfirm", data) this.$emit("handleAddSelectTypeConfirm", data);
}, },
handleEditSelectTypeConfirm(data) { handleEditSelectTypeConfirm(data) {
this.$emit("handleEditSelectTypeConfirm", data) this.$emit("handleEditSelectTypeConfirm", data);
}, },
handleClose() { handleClose() {
this.$emit("handleClose") this.$emit("handleClose");
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.glsk-form-dialog { .glsk-form-dialog {
::v-deep { ::v-deep {
......
...@@ -120,9 +120,11 @@ service.interceptors.response.use( ...@@ -120,9 +120,11 @@ service.interceptors.response.use(
// } // }
const dataAxios = response.data; const dataAxios = response.data;
const ruleResult = baseConfig.axios.result; const ruleResult = baseConfig.axios.result;
const errCodeMsg = baseConfig.errCode; const errCodeMsg = baseConfig.errCode || {};
const errCodes = Object.keys(errCodeMsg); const errCodes = Object.keys(errCodeMsg);
const returnAll = response.config.headers["return-all"]; const returnAll = response.config.headers["return-all"];
// 请求级配置:为 true 时,code 为 -1 直接使用响应的 message,不查 errCode 配置
const useResponseMessage = response.config.useResponseMessage;
// console.log("baseConfig", baseConfig) // console.log("baseConfig", baseConfig)
// console.log("response", response) // console.log("response", response)
...@@ -150,17 +152,20 @@ service.interceptors.response.use( ...@@ -150,17 +152,20 @@ service.interceptors.response.use(
case ruleResult.code_error_value: case ruleResult.code_error_value:
// [ 示例 ] code === -1 代表需将返回的message弹窗展示 // [ 示例 ] code === -1 代表需将返回的message弹窗展示
return errorCreate(`${dataAxios[ruleResult.message_key]}`); return errorCreate(`${dataAxios[ruleResult.message_key]}`);
default: default: {
// 不是正确的 code // 不是正确的 code
// console.log(dataAxios) // 请求配置 useResponseMessage 时:code 为 -1 直接使用响应的 message
// errorCreate(`${dataAxios[ruleResult.message_key]}`) const codeStr = String(dataAxios[ruleResult.code_key] ?? "");
const isCodeMinusOne = codeStr === "-1" || +dataAxios[ruleResult.code_key] === -1;
if (useResponseMessage && isCodeMinusOne) {
return errorCreate(`${dataAxios[ruleResult.message_key]}`);
}
if (errCodes.includes(dataAxios[ruleResult.code_key])) { if (errCodes.includes(dataAxios[ruleResult.code_key])) {
return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`); return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`);
} else { }
// 返回约定定义之外的错误码直接取message // 返回约定定义之外的错误码直接取message
return errorCreate(`${dataAxios[ruleResult.message_key]}`); return errorCreate(`${dataAxios[ruleResult.message_key]}`);
} }
break;
} }
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @FilePath: \dj-car-life-system\src\router\modules\907_home.js * @FilePath: \dj-car-life-system\src\router\modules\907_home.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
const _import = require("@/libs/util.import." + process.env.NODE_ENV) const _import = require("@/libs/util.import." + process.env.NODE_ENV);
export const routerName = { export const routerName = {
907: { 907: {
path: "/index", path: "/index",
...@@ -17,13 +17,13 @@ export const routerName = { ...@@ -17,13 +17,13 @@ export const routerName = {
parentId: "1", parentId: "1",
icon: "s-home", icon: "s-home",
cache: false, cache: false,
sideHidden: false sideHidden: false,
}, },
auth: [ auth: [
{ {
authId: "90701", authId: "90701",
parentId: "907", parentId: "907",
label: "报表模块" label: "报表模块",
}, },
{ {
authId: "90702", authId: "90702",
...@@ -34,9 +34,9 @@ export const routerName = { ...@@ -34,9 +34,9 @@ export const routerName = {
{ {
authId: "90703", authId: "90703",
name: "企微推送配置", name: "企微推送配置",
parentId: "907" parentId: "907",
} },
] ],
}, },
// { // {
// authId: "90705", // authId: "90705",
...@@ -50,7 +50,7 @@ export const routerName = { ...@@ -50,7 +50,7 @@ export const routerName = {
category: "Button", category: "Button",
type: "primary", type: "primary",
label: "导出日报", label: "导出日报",
handle: "exportDailyReport" handle: "exportDailyReport",
}, },
{ {
authId: "90707", authId: "90707",
...@@ -61,19 +61,24 @@ export const routerName = { ...@@ -61,19 +61,24 @@ export const routerName = {
{ {
authId: "90704", authId: "90704",
name: "渗透率报表", name: "渗透率报表",
parentId: "907" parentId: "907",
} },
] {
authId: "90709",
name: "店端实际交车数",
parentId: "907",
},
],
}, },
{ {
authId: "90708", authId: "90708",
parentId: "907", parentId: "907",
category: "Button", category: "Button",
handle: "handleOutputImport", handle: "handleOutputImport",
label: "导入" label: "导入",
} },
], ],
component: _import("index") component: _import("index"),
}, },
90703: { 90703: {
path: "/outputValue", path: "/outputValue",
...@@ -84,7 +89,7 @@ export const routerName = { ...@@ -84,7 +89,7 @@ export const routerName = {
parentId: "907", parentId: "907",
cache: false, cache: false,
sideHidden: true, sideHidden: true,
activePath: "/index" activePath: "/index",
}, },
auth: [ auth: [
{ {
...@@ -94,29 +99,29 @@ export const routerName = { ...@@ -94,29 +99,29 @@ export const routerName = {
icon: "plus", icon: "plus",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleAdd" handle: "handleAdd",
}, },
{ {
authId: "9070303", authId: "9070303",
parentId: "90703", parentId: "90703",
label: "导入", label: "导入",
category: "Button", category: "Button",
handle: "handleImport" handle: "handleImport",
}, },
{ {
authId: "9070302", authId: "9070302",
parentId: "90703", parentId: "90703",
label: "编辑", label: "编辑",
handle: "handleEdit" handle: "handleEdit",
}, },
{ {
authId: "9070304", authId: "9070304",
parentId: "90703", parentId: "90703",
label: "删除", label: "删除",
handle: "handleDelete" handle: "handleDelete",
} },
], ],
component: _import("index/outputValue") component: _import("index/outputValue"),
}, },
90704: { 90704: {
path: "/permeation", path: "/permeation",
...@@ -127,7 +132,7 @@ export const routerName = { ...@@ -127,7 +132,7 @@ export const routerName = {
parentId: "907", parentId: "907",
cache: false, cache: false,
sideHidden: true, sideHidden: true,
activePath: "/index" activePath: "/index",
}, },
auth: [ auth: [
{ {
...@@ -136,7 +141,7 @@ export const routerName = { ...@@ -136,7 +141,7 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
}, },
// 新车交付率导出 // 新车交付率导出
{ {
...@@ -145,7 +150,7 @@ export const routerName = { ...@@ -145,7 +150,7 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleDetailExport" handle: "handleDetailExport",
}, },
{ {
authId: "9070403", authId: "9070403",
...@@ -153,9 +158,32 @@ export const routerName = { ...@@ -153,9 +158,32 @@ export const routerName = {
label: "日报导出", label: "日报导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleDailyExport" handle: "handleDailyExport",
} },
], ],
component: _import("index/permeation") component: _import("index/permeation"),
} },
} 90709: {
path: "/deliveryCount",
name: "deliveryCount",
meta: {
title: "店端实际交车数",
authId: "90709",
parentId: "907",
cache: false,
sideHidden: true,
activePath: "/index",
},
auth: [
{
authId: "9070901",
parentId: "90709",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport",
},
],
component: _import("index/deliveryCount"),
},
};
...@@ -1340,4 +1340,78 @@ export const routerName = { ...@@ -1340,4 +1340,78 @@ export const routerName = {
}, },
component: _import("residentManage/warningBaseLine/index"), component: _import("residentManage/warningBaseLine/index"),
}, },
91224: {
path: "/supervisionManagement",
name: "supervisionManagement",
meta: {
title: "督导管理",
authId: "91224",
parentId: "912",
cache: false,
},
component: _import("residentManage/supervisionManagement/supervision/index"),
auth: [
{
authId: "9122401",
parentId: "91224",
label: "查看详情",
handle: "handleDetail",
addRoutePath: [
{
authId: "912240101",
name: "查看详情",
parentId: "91224",
}
],
}
]
},
912240101: {
path: "/supervisionDetail",
name: "supervisionDetail",
meta: {
title: "查看详情",
authId: "9122401",
parentId: "91224",
activePath: "/supervisionManagement",
},
component: _import("residentManage/supervisionManagement/supervision/detail"),
},
91225: {
path: "/supervisionMissionManagement",
name: "supervisionMissionManagement",
meta: {
title: "督导任务管理",
authId: "91225",
parentId: "912",
cache: false
},
auth: [
{
authId: "9122501",
parentId: "91225",
label: "详情",
handle: "handleDetail",
addRoutePath: [
{
authId: "912250101",
name: "详情",
parentId: "91225",
}
],
}
],
component: _import("residentManage/supervisionManagement/mission/index")
},
912250101: {
path: "/supervisionMissionDetail",
name: "supervisionMissionDetail",
meta: {
title: "详情",
authId: "9122501",
parentId: "91225",
activePath: "/supervisionMissionManagement",
},
component: _import("residentManage/supervisionManagement/mission/detail"),
}
}; };
const _import = require("@/libs/util.import." + process.env.NODE_ENV) const _import = require("@/libs/util.import." + process.env.NODE_ENV);
export const routerName = { export const routerName = {
914: { 914: {
path: "/pointManagement", path: "/pointManagement",
...@@ -7,8 +7,8 @@ export const routerName = { ...@@ -7,8 +7,8 @@ export const routerName = {
title: "积分管理", title: "积分管理",
authId: "914", authId: "914",
parentId: "1", parentId: "1",
cache: false cache: false,
} },
}, },
91401: { 91401: {
path: "/pointExamine", path: "/pointExamine",
...@@ -17,45 +17,57 @@ export const routerName = { ...@@ -17,45 +17,57 @@ export const routerName = {
title: "积分审批", title: "积分审批",
authId: "91401", authId: "91401",
parentId: "914", parentId: "914",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
authId: "9140101", authId: "9140101",
parentId: "91401", parentId: "91401",
label: "审核", label: "审核",
handle: "handleCheck" handle: "handleCheck",
}, },
{ {
authId: "9140104", authId: "9140104",
parentId: "91401", parentId: "91401",
label: "标记退款", label: "标记退款",
handle: "openRefundDetail" handle: "openRefundDetail",
}, },
{ {
authId: "9140102", authId: "9140102",
parentId: "91401", parentId: "91401",
label: "查看", label: "查看",
handle: "handleDetail" handle: "handleDetail",
}, },
{ {
authId: "9140103", authId: "9140103",
parentId: "91401", parentId: "91401",
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", handle: "handleExport",
handle: "handleExport"
}, },
{ {
authId: "9140105", authId: "9140105",
parentId: "91401", parentId: "91401",
label: "刷新", label: "刷新",
category: "Button", category: "Button",
handle: "handleRefresh",
},
{
authId: "9140106",
parentId: "91401",
label: "一键审批",
category: "Button",
type: "primary", type: "primary",
handle: "handleRefresh" handle: "handleApproveAll",
} },
{
authId: "9140107",
parentId: "91401",
label: "审批",
handle: "handleApproveAll",
},
], ],
component: _import("pointManagement/pointExamine") component: _import("pointManagement/pointExamine"),
}, },
91402: { 91402: {
path: "/pointParticulars", path: "/pointParticulars",
...@@ -64,7 +76,7 @@ export const routerName = { ...@@ -64,7 +76,7 @@ export const routerName = {
title: "积分明细", title: "积分明细",
authId: "91402", authId: "91402",
parentId: "914", parentId: "914",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -76,9 +88,15 @@ export const routerName = { ...@@ -76,9 +88,15 @@ export const routerName = {
{ {
authId: "91403", authId: "91403",
name: "详情", name: "详情",
parentId: "91402" parentId: "91402",
} },
] ],
},
{
authId: "9140205",
parentId: "91402",
label: "更换手机号",
handle: "handleChangePhone",
}, },
{ {
...@@ -86,8 +104,15 @@ export const routerName = { ...@@ -86,8 +104,15 @@ export const routerName = {
parentId: "91402", parentId: "91402",
label: "导出", label: "导出",
category: "Button", category: "Button",
handle: "handleExport",
},
{
authId: "9140204",
parentId: "91402",
label: "批量积分调整",
category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleGoverning",
}, },
{ {
authId: "9140203", authId: "9140203",
...@@ -98,12 +123,12 @@ export const routerName = { ...@@ -98,12 +123,12 @@ export const routerName = {
{ {
authId: "91404", authId: "91404",
name: "新增手动抵扣", name: "新增手动抵扣",
parentId: "91402" parentId: "91402",
} },
]
}
], ],
component: _import("pointManagement/pointParticulars") },
],
component: _import("pointManagement/pointParticulars"),
}, },
91403: { 91403: {
path: "/pointDetail", path: "/pointDetail",
...@@ -113,11 +138,11 @@ export const routerName = { ...@@ -113,11 +138,11 @@ export const routerName = {
authId: "91403", authId: "91403",
parentId: "91402", parentId: "91402",
cache: false, cache: false,
activePath: "/pointParticulars" activePath: "/pointParticulars",
}, },
component: _import("pointManagement/pointDetail") component: _import("pointManagement/pointDetail"),
}, },
//新增抵扣 // 新增抵扣
91404: { 91404: {
path: "/deduction", path: "/deduction",
name: "deduction", name: "deduction",
...@@ -126,8 +151,8 @@ export const routerName = { ...@@ -126,8 +151,8 @@ export const routerName = {
authId: "91403", authId: "91403",
parentId: "91402", parentId: "91402",
cache: false, cache: false,
activePath: "/pointParticulars" activePath: "/pointParticulars",
},
component: _import("pointManagement/addDeduction"),
}, },
component: _import("pointManagement/addDeduction") };
}
}
const _import = require("@/libs/util.import." + process.env.NODE_ENV) // eslint-disable-next-line
const _import = require("@/libs/util.import." + (process.env.NODE_ENV || "development"));
export const routerName = { export const routerName = {
920: { 920: {
path: "/usedCarManagement", path: "/usedCarManagement",
...@@ -7,8 +8,8 @@ export const routerName = { ...@@ -7,8 +8,8 @@ export const routerName = {
title: "二手车管理", title: "二手车管理",
authId: "920", authId: "920",
parentId: "1", parentId: "1",
cache: false cache: false,
} },
}, },
92001: { 92001: {
path: "/dataView", path: "/dataView",
...@@ -17,9 +18,9 @@ export const routerName = { ...@@ -17,9 +18,9 @@ export const routerName = {
title: "数据看板", title: "数据看板",
authId: "92001", authId: "92001",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
component: _import("usedCarManagement/dataView/index") component: _import("usedCarManagement/dataView/index"),
}, },
92002: { 92002: {
path: "/evaluationManagement", path: "/evaluationManagement",
...@@ -28,7 +29,7 @@ export const routerName = { ...@@ -28,7 +29,7 @@ export const routerName = {
title: "评估管理", title: "评估管理",
authId: "92002", authId: "92002",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -40,9 +41,9 @@ export const routerName = { ...@@ -40,9 +41,9 @@ export const routerName = {
{ {
authId: "9200204", authId: "9200204",
name: "详情", name: "详情",
parentId: "92002" parentId: "92002",
} },
] ],
}, },
{ {
authId: "9200202", authId: "9200202",
...@@ -53,9 +54,22 @@ export const routerName = { ...@@ -53,9 +54,22 @@ export const routerName = {
{ {
authId: "9200205", authId: "9200205",
name: "车辆评估", name: "车辆评估",
parentId: "92002" parentId: "92002",
} },
] ],
},
{
authId: "9200207",
parentId: "92002",
label: "评估核价",
handle: "handleCheckPrice",
addRoutePath: [
{
authId: "9200205",
name: "车辆核价",
parentId: "92002",
},
],
}, },
{ {
authId: "9200203", authId: "9200203",
...@@ -63,16 +77,16 @@ export const routerName = { ...@@ -63,16 +77,16 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
}, },
{ {
authId: "9200206", authId: "9200206",
parentId: "92002", parentId: "92002",
label: "图片下载", label: "图片下载",
handle: "handleDownLoad" handle: "handleDownLoad",
} },
], ],
component: _import("usedCarManagement/evaluationManagement/index") component: _import("usedCarManagement/evaluationManagement/index"),
}, },
9200204: { 9200204: {
path: "/evalOrderDetail", path: "/evalOrderDetail",
...@@ -83,9 +97,9 @@ export const routerName = { ...@@ -83,9 +97,9 @@ export const routerName = {
parentId: "92002", parentId: "92002",
cache: false, cache: false,
sideHidden: false, sideHidden: false,
activePath: "/evaluationManagement" activePath: "/evaluationManagement",
}, },
component: _import("usedCarManagement/evaluationManagement/evalOrderDetail") component: _import("usedCarManagement/evaluationManagement/evalOrderDetail"),
}, },
9200205: { 9200205: {
path: "/evaluate", path: "/evaluate",
...@@ -96,10 +110,21 @@ export const routerName = { ...@@ -96,10 +110,21 @@ export const routerName = {
parentId: "92002", parentId: "92002",
cache: false, cache: false,
sideHidden: false, sideHidden: false,
activePath: "/evaluationManagement" activePath: "/evaluationManagement",
dynamicTitle: (route) => {
const scene = route?.query?.scene;
if (scene === "checkPrice") {
return "车辆核价";
}
if (scene === "assess") {
return "车辆评估";
}
return "车辆评估";
},
}, },
component: _import("usedCarManagement/evaluationManagement/evaluate") component: _import("usedCarManagement/evaluationManagement/evaluate"),
}, },
92003: { 92003: {
path: "/operateManagement", path: "/operateManagement",
name: "operateManagement", name: "operateManagement",
...@@ -107,7 +132,7 @@ export const routerName = { ...@@ -107,7 +132,7 @@ export const routerName = {
title: "运营管理", title: "运营管理",
authId: "92003", authId: "92003",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -119,15 +144,15 @@ export const routerName = { ...@@ -119,15 +144,15 @@ export const routerName = {
{ {
authId: "9200306", authId: "9200306",
name: "详情", name: "详情",
parentId: "92003" parentId: "92003",
} },
] ],
}, },
{ {
authId: "9200302", authId: "9200302",
parentId: "92003", parentId: "92003",
label: "合同下载", label: "合同下载",
handle: "handleDownload" handle: "handleDownload",
}, },
{ {
authId: "9200303", authId: "9200303",
...@@ -135,7 +160,7 @@ export const routerName = { ...@@ -135,7 +160,7 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
}, },
{ {
authId: "9200304", authId: "9200304",
...@@ -143,25 +168,25 @@ export const routerName = { ...@@ -143,25 +168,25 @@ export const routerName = {
label: "新增激励", label: "新增激励",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleAddStimulate" handle: "handleAddStimulate",
}, },
{ {
authId: "9200305", authId: "9200305",
parentId: "92003", parentId: "92003",
label: "详情", label: "详情",
handle: "handleDetail" handle: "handleDetail",
}, },
{ {
authId: "9200307", authId: "9200307",
parentId: "92003", parentId: "92003",
label: "修改", label: "修改",
handle: "handleUpdate" handle: "handleUpdate",
}, },
{ {
authId: "9200308", authId: "9200308",
parentId: "92003", parentId: "92003",
label: "删除", label: "删除",
handle: "handleDelete" handle: "handleDelete",
}, },
{ {
authId: "9200309", authId: "9200309",
...@@ -169,10 +194,10 @@ export const routerName = { ...@@ -169,10 +194,10 @@ export const routerName = {
label: "批量导入合同", label: "批量导入合同",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleImportContract" handle: "handleImportContract",
} },
], ],
component: _import("usedCarManagement/operateManagement/index") component: _import("usedCarManagement/operateManagement/index"),
}, },
9200306: { 9200306: {
path: "/contractView", path: "/contractView",
...@@ -183,11 +208,11 @@ export const routerName = { ...@@ -183,11 +208,11 @@ export const routerName = {
parentId: "92003", parentId: "92003",
cache: false, cache: false,
sideHidden: false, sideHidden: false,
activePath: "/operateManagement" activePath: "/operateManagement",
}, },
component: _import( component: _import(
"usedCarManagement/operateManagement/components/contract/detail" "usedCarManagement/operateManagement/components/contract/detail",
) ),
}, },
9200307: { 9200307: {
path: "/contractEdit", path: "/contractEdit",
...@@ -198,11 +223,11 @@ export const routerName = { ...@@ -198,11 +223,11 @@ export const routerName = {
parentId: "92003", parentId: "92003",
cache: false, cache: false,
sideHidden: false, sideHidden: false,
activePath: "/operateManagement" activePath: "/operateManagement",
}, },
component: _import( component: _import(
"usedCarManagement/operateManagement/components/contract/edit" "usedCarManagement/operateManagement/components/contract/edit",
) ),
}, },
92004: { 92004: {
path: "/vehicleManagement", path: "/vehicleManagement",
...@@ -211,7 +236,7 @@ export const routerName = { ...@@ -211,7 +236,7 @@ export const routerName = {
title: "车辆管理", title: "车辆管理",
authId: "92004", authId: "92004",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -223,21 +248,21 @@ export const routerName = { ...@@ -223,21 +248,21 @@ export const routerName = {
{ {
authId: "9200404", authId: "9200404",
name: "车辆详情", name: "车辆详情",
parentId: "92004" parentId: "92004",
}, },
{ {
authId: "9200405", authId: "9200405",
name: "编辑车辆", name: "编辑车辆",
parentId: "92004" parentId: "92004",
} },
] ],
}, },
// 暂时屏蔽 // 暂时屏蔽
{ {
authId: "9200402", authId: "9200402",
parentId: "92004", parentId: "92004",
label: "状态变更", label: "状态变更",
handle: "handleChangeStatus" handle: "handleChangeStatus",
}, },
{ {
authId: "9200403", authId: "9200403",
...@@ -245,16 +270,16 @@ export const routerName = { ...@@ -245,16 +270,16 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
}, },
{ {
authId: "9200406", authId: "9200406",
parentId: "92004", parentId: "92004",
label: "图片下载", label: "图片下载",
handle: "handleDownLoad" handle: "handleDownLoad",
} },
], ],
component: _import("usedCarManagement/vehicleManagement/index") component: _import("usedCarManagement/vehicleManagement/index"),
}, },
9200404: { 9200404: {
path: "/vehicleDetail", path: "/vehicleDetail",
...@@ -264,10 +289,10 @@ export const routerName = { ...@@ -264,10 +289,10 @@ export const routerName = {
authId: "9200404", authId: "9200404",
parentId: "92004", parentId: "92004",
activePath: "/vehicleManagement", activePath: "/vehicleManagement",
cache: false cache: false,
}, },
auth: [], auth: [],
component: _import("usedCarManagement/vehicleManagement/detail") component: _import("usedCarManagement/vehicleManagement/detail"),
}, },
9200405: { 9200405: {
path: "/editVehicle", path: "/editVehicle",
...@@ -277,10 +302,10 @@ export const routerName = { ...@@ -277,10 +302,10 @@ export const routerName = {
authId: "9200405", authId: "9200405",
parentId: "92004", parentId: "92004",
activePath: "/vehicleManagement", activePath: "/vehicleManagement",
cache: false cache: false,
}, },
auth: [], auth: [],
component: _import("usedCarManagement/vehicleManagement/detail") component: _import("usedCarManagement/vehicleManagement/detail"),
}, },
// //
92005: { 92005: {
...@@ -290,7 +315,7 @@ export const routerName = { ...@@ -290,7 +315,7 @@ export const routerName = {
title: "交付单管理", title: "交付单管理",
authId: "92005", authId: "92005",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -302,9 +327,9 @@ export const routerName = { ...@@ -302,9 +327,9 @@ export const routerName = {
{ {
authId: "9200502", authId: "9200502",
name: "交付单详情", name: "交付单详情",
parentId: "92005" parentId: "92005",
} },
] ],
}, },
{ {
authId: "9200503", authId: "9200503",
...@@ -312,10 +337,10 @@ export const routerName = { ...@@ -312,10 +337,10 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
} },
], ],
component: _import("usedCarManagement/deliveryOrderManagement/index") component: _import("usedCarManagement/deliveryOrderManagement/index"),
}, },
9200502: { 9200502: {
path: "/deliveryOrderManagementDetail", path: "/deliveryOrderManagementDetail",
...@@ -325,10 +350,10 @@ export const routerName = { ...@@ -325,10 +350,10 @@ export const routerName = {
authId: "9200502", authId: "9200502",
parentId: "92005", parentId: "92005",
activePath: "/deliveryOrderManagement", // 缓存页面 activePath: "/deliveryOrderManagement", // 缓存页面
cache: false cache: false,
}, },
auth: [], auth: [],
component: _import("usedCarManagement/deliveryOrderManagement/detail") component: _import("usedCarManagement/deliveryOrderManagement/detail"),
}, },
92006: { 92006: {
path: "/vehicleLedger", path: "/vehicleLedger",
...@@ -337,7 +362,7 @@ export const routerName = { ...@@ -337,7 +362,7 @@ export const routerName = {
title: "车辆台账", title: "车辆台账",
authId: "92006", authId: "92006",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -346,10 +371,18 @@ export const routerName = { ...@@ -346,10 +371,18 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
} },
{
authId: "9200602",
parentId: "92006",
label: "导出",
category: "Button",
type: "primary",
handle: "handleFinancialLedgerExport",
},
], ],
component: _import("usedCarManagement/vehicleLedger/index") component: _import("usedCarManagement/vehicleLedger/index"),
}, },
92007: { 92007: {
path: "/quitAndHandover", path: "/quitAndHandover",
...@@ -358,7 +391,7 @@ export const routerName = { ...@@ -358,7 +391,7 @@ export const routerName = {
title: "离职继承", title: "离职继承",
authId: "92007", authId: "92007",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -368,16 +401,16 @@ export const routerName = { ...@@ -368,16 +401,16 @@ export const routerName = {
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleAddHandover", handle: "handleAddHandover",
icon: "plus" icon: "plus",
}, },
{ {
authId: "9200702", authId: "9200702",
parentId: "92007", parentId: "92007",
label: "详情", label: "详情",
handle: "handleDetail" handle: "handleDetail",
} },
], ],
component: _import("usedCarManagement/quitAndHandover/index") component: _import("usedCarManagement/quitAndHandover/index"),
}, },
92008: { 92008: {
path: "/reportManagement", path: "/reportManagement",
...@@ -386,7 +419,7 @@ export const routerName = { ...@@ -386,7 +419,7 @@ export const routerName = {
title: "报告管理", title: "报告管理",
authId: "92008", authId: "92008",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -395,9 +428,9 @@ export const routerName = { ...@@ -395,9 +428,9 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
} },
], ],
component: _import("usedCarManagement/reportManagement/index") component: _import("usedCarManagement/reportManagement/index"),
} },
} };
...@@ -15,31 +15,35 @@ ...@@ -15,31 +15,35 @@
</div> </div>
<!-- 列表内容 --> <!-- 列表内容 -->
<block v-if="rankData.length > 0"> <block v-if="rankData.length > 0">
<div <div v-for="(item, index) in rankData"
class="rank-item"
v-for="(item, index) in rankData"
:key="index" :key="index"
> class="rank-item">
<!-- 排名 Icon 处理 --> <!-- 排名 Icon 处理 -->
<div <div class="rank-index"
class="rank-index" :class="`rank-${index + 1}`">
:class="'rank-' + (index + 1)" <img v-if="index < 3"
>
<img
v-if="index < 3"
:src="require(`@/assets/strategy/icon-strategy-rank0${index + 1}.png`)" :src="require(`@/assets/strategy/icon-strategy-rank0${index + 1}.png`)"
style="width: 24px; height: 24px;" style="width: 24px; height: 24px;" />
/> <span v-else
<span style="width: 20px; height: 20px; border-radius: 50%; opacity: 1; background: #2a58ad1a; display: inline-block; text-align: center; line-height: 20px;">
v-else {{ index + 1 }}
style="width: 20px; height: 20px; border-radius: 50%; opacity: 1; background: #2a58ad1a; display: inline-block; text-align: center; line-height: 20px;" </span>
>{{ index + 1 }}</span> </div>
<div class="rank-name" :title="item.staffName">
{{ item.staffName }}
</div>
<div class="rank-col">
{{ item.strategyCount }}
</div>
<div class="rank-col">
{{ item.strategyCountPercent }}%
</div>
<div class="rank-col">
{{ item.storeCount }}
</div>
<div class="rank-col">
{{ item.storeCountPercent }}%
</div> </div>
<div class="rank-name" :title="item.staffName">{{ item.staffName }}</div>
<div class="rank-col">{{ item.strategyCount }}</div>
<div class="rank-col">{{ item.strategyCountPercent }}%</div>
<div class="rank-col">{{ item.storeCount }}</div>
<div class="rank-col">{{ item.storeCountPercent }}%</div>
</div> </div>
</block> </block>
<block v-else> <block v-else>
...@@ -47,29 +51,32 @@ ...@@ -47,29 +51,32 @@
</block> </block>
</div> </div>
<div v-if="rankData.length === 0" class="empty-box"> <div v-if="rankData.length === 0" class="empty-box">
<img :src="noDataImg" alt="暂无数据"> <img alt="暂无数据" :src="noDataImg">
<div class="empty-text">暂无数据</div> <div class="empty-text">
暂无数据
</div>
</div> </div>
<div class="bottom-cover"></div> <div class="bottom-cover"></div>
</div> </div>
</template> </template>
<script> <script>
import noDataImg from "@/assets/strategy/emepty-strategy.png" import noDataImg from "@/assets/strategy/emepty-strategy.png";
export default { export default {
name: 'OnlineOperatorRanking', name: "OnlineOperatorRanking",
props: { props: {
// 排行榜数据(由父组件传递) // 排行榜数据(由父组件传递)
rankData: { rankData: {
type: Array, type: Array,
default: () => [] default: () => [],
} },
}, },
data() { data() {
return { return {
noDataImg noDataImg,
}; };
} },
}; };
</script> </script>
...@@ -114,7 +121,8 @@ $bg-white: #fff; ...@@ -114,7 +121,8 @@ $bg-white: #fff;
/* 排行榜样式 */ /* 排行榜样式 */
.rank-list { .rank-list {
font-size: 13px; font-size: 13px;
overflow: scroll;
max-height: 260px;
.rank-header { .rank-header {
display: flex; display: flex;
color: #909399; color: #909399;
...@@ -178,4 +186,3 @@ $bg-white: #fff; ...@@ -178,4 +186,3 @@ $bg-white: #fff;
} }
} }
</style> </style>
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
:clearable="true" :maxlength="50" @input="event => searchInput(event, 'commodityCode')" /> :clearable="true" :maxlength="50" @input="event => searchInput(event, 'commodityCode')" />
</template> </template>
<template slot="type"> <template slot="type">
<!-- <el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" @input="event => searchInput(event, 'type')" /> -->
<el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true" <el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" @input="event => searchInput(event, 'type')" /> :maxlength="50" />
</template> </template>
<template slot="thirdPartyCode"> <template slot="thirdPartyCode">
<el-input :style="{ width: '100%' }" placeholder="请输入第三方编码" v-model.trim="searchForm['thirdPartyCode']" <el-input :style="{ width: '100%' }" placeholder="请输入第三方编码" v-model.trim="searchForm['thirdPartyCode']"
......
<template> <template>
<d2-dialog title="批量复制" <d2-dialog btn-ok-label="确定"
class="relateStore"
:is-visible.sync="batchCopyVisible" :is-visible.sync="batchCopyVisible"
title="批量复制"
width="600px" width="600px"
btn-ok-label="确定"
@confirmDialog="handleBatchCopyConfirm"
@closeDialog="handleBatchCopyClose" @closeDialog="handleBatchCopyClose"
class="relateStore"> @confirmDialog="handleBatchCopyConfirm">
<el-form label-width="120px" :rules="rules" :model="selectData" ref="batchCopyForm"> <el-form ref="batchCopyForm"
label-width="120px"
:model="selectData"
:rules="rules">
<el-form-item label="业务场景:"> <el-form-item label="业务场景:">
<el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input> <el-input v-model="sceneList[selectedScene]"
disabled
style="width: 370px;">
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="复制门店:" prop="selectMerchantObj"> <el-form-item label="复制门店:" prop="selectMerchantObj">
<el-select v-model="selectData.selectMerchantObj" remote reserve-keyword multiple collapse-tags <el-select v-model="selectData.selectMerchantObj"
placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod" v-el-select-loadmore="interestsLoadmore"
v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable> collapse-tags
<el-option v-for="subItem in storeData" :key="subItem.merchantId" filterable
:label="subItem.merchantName" :value="subItem" /> multiple
placeholder="请选择复制门店"
remote
:remote-method="remoteMethod"
reserve-keyword
style="width: 370px;"
value-key="merchantId"
@visible-change="visibleChange">
<el-option v-for="subItem in storeData"
:key="subItem.merchantId"
:label="subItem.merchantName"
:value="subItem" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -24,117 +41,120 @@ ...@@ -24,117 +41,120 @@
</div> </div>
</d2-dialog> </d2-dialog>
</template> </template>
<script> <script>
import { getList, getAccountMerchantList } from '@/api/merchant' import { getAccountMerchantList, getList } from "@/api/merchant";
import { sceneList } from '@/common/constants.js' import { sceneList } from "@/common/constants.js";
export default { export default {
name: 'RelateStoreDialog', name: "RelateStoreDialog",
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: '',
sceneList,
selectData: {},
rules: { selectMerchantObj: [{ required: true, message: '请选择复制门店', trigger: 'blur' }] }
}
},
directives: { directives: {
'el-select-loadmore': { "el-select-loadmore": {
bind(el, binding) { bind(el, binding) {
setTimeout(() => { setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector( const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap' ".el-select-dropdown .el-select-dropdown__wrap",
) );
SELECTWRAP_DOM.addEventListener('scroll', function () { SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition = const condition
this.scrollHeight - this.scrollTop <= this.clientHeight = this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) { if (condition) {
binding.value() binding.value();
}
})
}, 100)
}
} }
});
}, 100);
},
},
}, },
props: { props: {
batchCopyVisible: { batchCopyVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
selectedScene: { selectedScene: {
type: Number type: Number,
} },
},
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: "",
sceneList,
selectData: {},
rules: { selectMerchantObj: [{ required: true, message: "请选择复制门店", trigger: "blur" }] },
};
}, },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
getList() { getList() {
const storeApi = [1, 2, 3].includes(this.selectedScene) ? getList : getAccountMerchantList // 会员权益/积分商城场景 上架门店是账户中心所有门店 const storeApi = [1, 2, 3].includes(this.selectedScene) ? getList : getAccountMerchantList; // 会员权益/积分商城场景 上架门店是账户中心所有门店
storeApi({ storeApi({
// merchantIdName: ![1, 2, 3].includes(this.selectedScene) ? this.searchMerchantName : '', // merchantIdName: ![1, 2, 3].includes(this.selectedScene) ? this.searchMerchantName : '',
merchantName: this.searchMerchantName, merchantName: this.searchMerchantName,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
scene: this.selectedScene scene: this.selectedScene,
}).then(res => { }).then((res) => {
res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo res?.list?.forEach((val) => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = val.merchantNo if (val.merchantNo)
}) val.merchantId = val.merchantNo;
this.storeData = this.storeData.concat(res.list) });
}) this.storeData = this.storeData.concat(res.list);
});
}, },
// 获取上架门店 // 获取上架门店
remoteMethod(query) { remoteMethod(query) {
this.searchMerchantName = query this.searchMerchantName = query;
this.currentPage = 1 this.currentPage = 1;
this.storeData = [] this.storeData = [];
this.getList() // 请求接口 this.getList(); // 请求接口
}, },
visibleChange(data) { visibleChange(data) {
// 获取焦点重新渲染下拉框数据 // 获取焦点重新渲染下拉框数据
if (data) { if (data) {
if (this.searchMerchantName) { if (this.searchMerchantName) {
this.searchMerchantName = '' this.searchMerchantName = "";
this.currentPage = 1 this.currentPage = 1;
this.storeData = [] this.storeData = [];
this.getList() this.getList();
} }
} }
}, },
// 获取更多上架门店 // 获取更多上架门店
interestsLoadmore() { interestsLoadmore() {
setTimeout(() => { setTimeout(() => {
this.currentPage = this.currentPage + 1 this.currentPage = this.currentPage + 1;
if (this.allPages < this.currentPage) { if (this.allPages < this.currentPage) {
this.currentPage = this.allPages this.currentPage = this.allPages;
return return;
} }
this.getList() this.getList();
}, 10) }, 10);
}, },
handleBatchCopyConfirm() { handleBatchCopyConfirm() {
this.$refs.batchCopyForm.validate((valid) => { this.$refs.batchCopyForm.validate((valid) => {
if (valid) { if (valid) {
this.$emit('handleBatchCopyConfirm', this.selectData?.selectMerchantObj) this.$emit("handleBatchCopyConfirm", this.selectData?.selectMerchantObj);
} }
}) });
}, },
handleBatchCopyClose() { handleBatchCopyClose() {
this.$emit('handleBatchCopyClose') this.$emit("handleBatchCopyClose");
} },
} },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
.tips{ .tips {
font-size: 14px; font-size: 14px;
color: #999; color: #999;
} }
......
<template>
<d2-dialog btn-ok-label="确认"
class="batch-modify-inventory-dialog"
:is-visible.sync="dialogVisible"
title="批量修改库存模式"
width="600px"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<div class="tip-text">
已选择{{ selectedGoodsCount }}个商品,涉及{{ relatedStoreCount }}家门店
</div>
<div class="tip-sub-text">
统一设置所有商品的门店管控模式
</div>
<el-form ref="formRef"
class="form-container"
label-width="120px"
:model="form"
:rules="rules">
<el-form-item label="管控模式:" prop="inventoryType">
<el-radio-group v-model="form.inventoryType">
<el-radio :label="2">
实物管控
</el-radio>
<el-radio :label="1">
虚拟管控
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="应用范围:" prop="bindAllMerchant">
<el-radio-group v-model="form.bindAllMerchant" @change="handleScopeChange">
<el-radio :label="true">
所有门店
</el-radio>
<el-radio :label="false">
指定门店
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="!form.bindAllMerchant"
label="门店选择框:"
prop="merchantIdList">
<el-select v-model="form.merchantIdList"
collapse-tags
filterable
multiple
placeholder="请选择门店"
style="width: 100%">
<el-option v-for="merchant in merchantList"
:key="merchant.merchantId"
:label="merchant.merchantName"
:value="merchant.merchantId">
</el-option>
</el-select>
</el-form-item>
</el-form>
</d2-dialog>
</template>
<script>
import { batchModifyInventoryType, queryRelatedMerchant } from "@/api/grounding";
export default {
name: "BatchModifyInventoryDialog",
props: {
visible: {
type: Boolean,
default: false,
},
selectedData: {
type: Array,
default: () => [],
},
},
data() {
return {
dialogVisible: false,
form: {
inventoryType: 2, // 1-虚拟 2-实物
bindAllMerchant: true,
merchantIdList: [],
},
merchantList: [],
rules: {
inventoryType: [
{ required: true, message: "请选择管控模式", trigger: "change" },
],
bindAllMerchant: [
{ required: true, message: "请选择应用范围", trigger: "change" },
],
merchantIdList: [
{ required: true, message: "请选择指定门店", trigger: "change" },
],
},
};
},
computed: {
selectedGoodsCount() {
return this.selectedData.length;
},
relatedStoreCount() {
return this.merchantList.length;
},
},
watch: {
visible(val) {
this.dialogVisible = val;
if (val) {
// Reset form when dialog opens
this.form = {
inventoryType: 2,
bindAllMerchant: true,
merchantIdList: [],
};
if (this.$refs.formRef) {
this.$refs.formRef.clearValidate();
}
this.getInvolvedMerchants();
}
},
dialogVisible(val) {
this.$emit("update:visible", val);
},
},
mounted() {
},
methods: {
handleScopeChange(val) {
if (val) {
this.form.merchantIdList = [];
this.$refs.formRef.clearValidate(["merchantIdList"]);
}
},
getInvolvedMerchants() {
const idList = this.selectedData.map(item => item.id);
if (idList.length === 0) {
this.merchantList = [];
return;
}
queryRelatedMerchant({ idList }).then((res) => {
console.log(res, "99");
this.merchantList = res.merchantList ? res.merchantList : [];
}).catch(() => {
this.merchantList = [];
});
},
handleClose() {
this.dialogVisible = false;
this.$emit("close");
},
handleConfirm() {
this.$refs.formRef.validate((valid) => {
if (valid) {
const idList = this.selectedData.map(item => item.id);
const params = {
idList,
inventoryType: this.form.inventoryType,
bindAllMerchant: this.form.bindAllMerchant,
};
if (!this.form.bindAllMerchant) {
params.merchantIdList = this.form.merchantIdList;
}
batchModifyInventoryType(params).then((res) => {
if (res) {
this.$message.success("批量修改库存模式成功");
this.dialogVisible = false;
this.$emit("confirm");
}
});
}
});
},
},
};
</script>
<style lang="scss" scoped>
.batch-modify-inventory-dialog {
.tip-text {
font-size: 14px;
color: #333;
margin-bottom: 8px;
padding-left: 10px;
border-left: 3px solid #1890ff;
}
.tip-sub-text {
font-size: 14px;
color: #666;
margin-bottom: 20px;
margin-left: 13px;
}
.form-container {
margin-top: 20px;
padding: 0 20px;
}
}
</style>
<!-- 关联门店弹窗 --> <!-- 关联门店弹窗 -->
<template> <template>
<d2-dialog <d2-dialog btn-ok-label="确定"
:title="title" class="relateStore"
:is-visible.sync="relateStoreVisible" :is-visible.sync="relateStoreVisible"
:title="title"
width="70%" width="70%"
btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose" @closeDialog="handleRelateStoreClose"
class="relateStore"> @confirmDialog="handleRelateStoreConfirm">
<slot /> <slot />
<el-row class="tableCon"> <el-row class="tableCon">
<div class="tableBox"> <div class="tableBox">
<el-table <el-table ref="seletingTable"
ref="seletingTable" border
class="table"
:data="selectingData" :data="selectingData"
height="464px" height="464px"
class="table"
border
@select="handleChange" @select="handleChange"
@select-all="handleAll"> @select-all="handleAll">
<el-table-column type="selection" width="55" align="center" /> <el-table-column align="center"
<el-table-column prop="merchantName" label="门店名称" align="center"> type="selection"
width="55" />
<el-table-column align="center"
label="门店名称"
prop="merchantName">
</el-table-column> </el-table-column>
<el-table-column prop="merchantId" label="门店商户号" align="center"> <el-table-column align="center"
label="门店商户号"
prop="merchantId">
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center"
prop="yqMerchantName"
label="服务对接" label="服务对接"
align="center"> prop="yqMerchantName">
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center"
prop="yqMerchantId"
label="服务对接商户号" label="服务对接商户号"
align="center"> prop="yqMerchantId">
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination background
small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage" :current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" /> :page-size="pageSize"
small
:total="total"
@current-change="handleCurrentChange" />
</div> </div>
<el-table <el-table border
class="tableBox table" class="tableBox table"
:data="selectedData" :data="selectedData"
border
height="464px"> height="464px">
<el-table-column prop="merchantName" label="门店名称" align="center"> <el-table-column align="center"
<template slot-scope="scope"> label="门店名称"
prop="merchantName">
<template #default="scope">
<span>{{ scope.row.merchantName }}</span> <span>{{ scope.row.merchantName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="merchantId" label="门店商户号" align="center"> <el-table-column align="center"
<template slot-scope="scope"> label="门店商户号"
prop="merchantId">
<template #default="scope">
<span>{{ scope.row.merchantId }}</span> <span>{{ scope.row.merchantId }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="删除" align="center" width="50px"> <el-table-column align="center"
<template slot-scope="scope"> label="删除"
<el-button width="50px">
class="el-icon-delete" <template #default="scope">
@click="handleDelete(scope.row)" <el-button class="el-icon-delete"
type="text" /> type="text"
@click="handleDelete(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -75,58 +80,58 @@ ...@@ -75,58 +80,58 @@
<script> <script>
export default { export default {
name: "RelateStoreDialog", name: "RelateStoreDialog",
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20
}
},
props: { props: {
title: { title: {
type: String, type: String,
default: "上架门店" default: "上架门店",
}, },
relateStoreVisible: { relateStoreVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
storeApi: { storeApi: {
type: Function, type: Function,
default: () => {} default: () => {},
}, },
storeSelected: { storeSelected: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
storeSearchForm: { storeSearchForm: {
type: Object, type: Object,
default: () => {} default: () => {},
}, },
selectedScene: { selectedScene: {
type: Number type: Number,
} },
},
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
};
}, },
mounted() { mounted() {
this.selectedData = this.storeSelected this.selectedData = this.storeSelected;
this.getSelectingList() this.getSelectingList();
}, },
methods: { methods: {
recoverySelection() { recoverySelection() {
var exitIds = this.selectedData.map((item) => item.merchantId) let exitIds = this.selectedData.map(item => item.merchantId);
this.selectingData.forEach((item) => { this.selectingData.forEach((item) => {
exitIds.includes(item.merchantId) && exitIds.includes(item.merchantId)
this.$refs.seletingTable.toggleRowSelection(item, true) && this.$refs.seletingTable.toggleRowSelection(item, true);
}) });
}, },
getSelectingList() { getSelectingList() {
const _storeSearchForm = this.storeSearchForm const _storeSearchForm = this.storeSearchForm;
// 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理 // 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理
// if ([0, 4].includes(this.selectedScene)) { // if ([0, 4].includes(this.selectedScene)) {
// // 会员权益,积分商城场景查询门店名称参数 // // 会员权益,积分商城场景查询门店名称参数
...@@ -136,67 +141,73 @@ export default { ...@@ -136,67 +141,73 @@ export default {
...this.storeSearchForm, ...this.storeSearchForm,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
scene: this.selectedScene scene: this.selectedScene,
}).then((res) => { }).then((res) => {
res?.list?.forEach((val) => { res?.list?.forEach((val) => {
// 账户中心门店返回商户号字段是merchantNo // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = Number(val.merchantNo) if (val.merchantNo)
val.merchantId = Number(val.merchantNo);
val?.sceneList?.forEach((subVal) => { val?.sceneList?.forEach((subVal) => {
if (subVal.scene == this.selectedScene) { if (subVal.scene == this.selectedScene) {
val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-" val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-";
val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-" val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-";
} }
}) });
}) });
this.selectingData = res.list this.selectingData = res.list;
this.total = res.total this.total = res.total;
this.$nextTick(() => { this.$nextTick(() => {
this.recoverySelection() this.recoverySelection();
}) });
}) });
}, },
handleChange(selection, row) { handleChange(selection, row) {
var addOrDelete = !!selection.find( let addOrDelete = !!selection.find(
(item) => item.merchantId === row.merchantId item => item.merchantId === row.merchantId,
) );
row = {
...row,
inventoryType: 2,
};
addOrDelete addOrDelete
? this.selectedData.push(row) ? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter( : (this.selectedData = this.selectedData.filter(
(item) => item.merchantId !== row.merchantId item => item.merchantId !== row.merchantId,
)) ));
}, },
handleAll(selection) { handleAll(selection) {
this.selectingData.forEach((item) => { this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex( let isExit = this.selectedData.findIndex(
(subItem) => subItem.merchantId === item.merchantId subItem => subItem.merchantId === item.merchantId,
) );
if (selection.length && isExit === -1) { if (selection.length && isExit === -1) {
this.selectedData.push(item) this.selectedData.push(item);
} else if (!selection.length && isExit !== -1) { } else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1) this.selectedData.splice(isExit, 1);
} }
}) });
}, },
handleDelete(row) { handleDelete(row) {
this.selectedData = this.selectedData.filter( this.selectedData = this.selectedData.filter(
(item) => item.merchantId !== row.merchantId item => item.merchantId !== row.merchantId,
) );
const obj = this.selectingData.find((v) => v.merchantId == row.merchantId) const obj = this.selectingData.find(v => v.merchantId == row.merchantId);
this.$refs.seletingTable.toggleRowSelection(obj) this.$refs.seletingTable.toggleRowSelection(obj);
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val this.currentPage = val;
this.getSelectingList() this.getSelectingList();
}, },
handleRelateStoreConfirm() { handleRelateStoreConfirm() {
this.$emit("handleRelateStoreConfirm", this.selectedData) this.$emit("handleRelateStoreConfirm", this.selectedData);
}, },
handleRelateStoreClose() { handleRelateStoreClose() {
this.$emit("handleRelateStoreClose") this.$emit("handleRelateStoreClose");
} },
} },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
.relateStore .table { .relateStore .table {
margin: 0 auto 20px !important; margin: 0 auto 20px !important;
......
<!--
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2024-06-12 15:21:09
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-03-19 11:44:04
* @FilePath: \dj-car-life-system\src\views\goods\grounding\components\relateStoreTable.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<div class="store-table"> <div class="store-table">
<el-table <el-table border
:data="merchantGoodsRefList" :data="merchantGoodsRefList"
style="width: 100%"
:header-row-style="headerRowStyle"
header-cell-class-name="header-cell-class-name" header-cell-class-name="header-cell-class-name"
border> :header-row-style="headerRowStyle"
<el-table-column style="width: 100%">
align="center" <el-table-column align="center"
width="60px"
label="序号" label="序号"
type="index" /> type="index"
<el-table-column width="60px" />
prop="merchantName" <el-table-column align="center"
label="门店名称" label="门店名称"
align="center" /> prop="merchantName" />
<el-table-column <el-table-column align="center"
prop="merchantId"
label="门店商户号" label="门店商户号"
align="center" /> prop="merchantId" />
<el-table-column <el-table-column align="center"
label="操作" label="库存管控">
<template #default="scope">
<span v-if="isDetail">{{ scope.row.inventoryType == 1 ? '虚拟管控' : '实物管控' }}</span>
<el-select v-else
v-model="scope.row.inventoryType"
placeholder="请选择">
<el-option label="虚拟管控" :value="1"></el-option>
<el-option label="实物管控" :value="2"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column v-if="!isDetail"
align="center" align="center"
v-if="!isDetail" label="操作"
width="90"> width="90">
<template slot-scope="scope"> <template #default="scope">
<el-button <el-button type="text"
type="text" @click="handleDelete(scope.row)">
@click="handleDelete(scope.row)">删除</el-button> 删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'RelateProTable', name: "RelateProTable",
props: { props: {
merchantGoodsRefList: { merchantGoodsRefList: {
type: Array, type: Array,
default: () => {} default: () => {},
}, },
isDetail: { isDetail: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
data() { data() {
return { return {
} };
}, },
methods: { methods: {
handleDelete(item) { handleDelete(item) {
this.$emit('handleDelete', item) this.$emit("handleDelete", item);
}, },
headerRowStyle() { headerRowStyle() {
return { return {
height: '40px', height: "40px",
background: '#F2F4F7' background: "#F2F4F7",
} };
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.store-table{ .store-table {
margin-top: 15px; margin-top: 15px;
} }
::v-deep .header-cell-class-name{ ::v-deep .header-cell-class-name {
height: 30px; height: 30px;
background: #F2F4F7; background: #f2f4f7;
} }
::v-deep .el-table th{ ::v-deep .el-table th {
padding: 0; padding: 0;
} }
::v-deep .el-table__body-wrapper tr td{ ::v-deep .el-table__body-wrapper tr td {
padding: 8px 0 !important; padding: 8px 0 !important;
} }
</style> </style>
...@@ -41,6 +41,7 @@ export default { ...@@ -41,6 +41,7 @@ export default {
warrantyTypeStr: [{ required: true }], warrantyTypeStr: [{ required: true }],
djCost: [{ required: true }], djCost: [{ required: true }],
thirdPartyCost: [{ required: true }], thirdPartyCost: [{ required: true }],
sellPriceValidType: [{ required: true }],
financeCheckFlagStr: [{ required: true }] financeCheckFlagStr: [{ required: true }]
}, },
editForm: [{ editForm: [{
...@@ -134,6 +135,9 @@ export default { ...@@ -134,6 +135,9 @@ export default {
label: '第三方成本', label: '第三方成本',
unit: true unit: true
}, { }, {
name: 'sellPriceValidType',
label: '售价有效期',
}, {
name: 'financeCheckFlagStr', name: 'financeCheckFlagStr',
label: '财务规则校验' label: '财务规则校验'
}] }]
...@@ -221,6 +225,13 @@ export default { ...@@ -221,6 +225,13 @@ export default {
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || '' res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
res.supplierCode = res?.goodsInfo?.supplierCode res.supplierCode = res?.goodsInfo?.supplierCode
res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-' res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-'
let sellPriceValidTxt = ''
if (res?.sellPriceValidType == 2 && res?.tempValidStartDate && res?.tempValidEndDate) {
sellPriceValidTxt = `${Util.dateFormate(res?.tempValidStartDate, 'YYYY-MM-DD')} 至 ${Util.dateFormate(res?.tempValidEndDate, 'YYYY-MM-DD')}`
}
res.sellPriceValidType = res?.sellPriceValidType == 1 ? '终生有效' : res?.sellPriceValidType == 2 ? sellPriceValidTxt : '-'
res.upgradeGoods = { res.upgradeGoods = {
...res.upgradeGoods, ...res.upgradeGoods,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
......
...@@ -355,15 +355,28 @@ ...@@ -355,15 +355,28 @@
:label="item.label ? item.label + ':' : ''" :label="item.label ? item.label + ':' : ''"
:id="item.name" :id="item.name"
:label-width="item.label ? '120px' : '0px'" :label-width="item.label ? '120px' : '0px'"
:required="item.name === 'accessoryType'"
class="dis-in-block" class="dis-in-block"
:style="{ 'margin-bottom': !item.type ? '0px' : '22px' }" :style="{ 'margin-bottom': !item.type ? '0px' : '22px' }"
v-if=" v-if="
item.type === 'photo' || item.type === 'photo' ||
item.type === 'video' || item.type === 'video' ||
item.type === 'descList' item.type === 'descList' ||
item.type === 'radio'
" "
> >
<template v-if="item.type === 'photo'"> <template v-if="item.type === 'radio'">
<el-radio-group v-model="formData[item.name]" :disabled="item.isDisabled || pageData.pageDisabled" @change="item.name === 'accessoryType' && handleAccessoryTypeChange()">
<el-radio
v-for="(opt, optIdx) in (item.radioOptions || [])"
:key="optIdx"
:label="opt.value"
>
{{ opt.label }}
</el-radio>
</el-radio-group>
</template>
<template v-else-if="item.type === 'photo'">
<p class="photo-top-tips"> <p class="photo-top-tips">
{{ item.topTips }} {{ item.topTips }}
</p> </p>
...@@ -694,6 +707,19 @@ export default { ...@@ -694,6 +707,19 @@ export default {
], ],
convertedValue: [ convertedValue: [
{ required: true, message: "请输入比例换算", trigger: "change" } { required: true, message: "请输入比例换算", trigger: "change" }
],
accessoryType: [
{
validator: (rule, value, cb) => {
// 权益/延保类目配件性质不必填
if (this.equitySceneType?.includes(this.formData?.goodsType) || this.extendedPosiType?.includes(this.formData?.goodsType))
return cb();
if (!value && value !== 0)
return cb(new Error("请选择配件性质"));
cb();
},
trigger: "change"
}
] ]
}, },
copyMembranesFormBlock: [ copyMembranesFormBlock: [
...@@ -787,6 +813,9 @@ export default { ...@@ -787,6 +813,9 @@ export default {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
this.formData = deepClone(this.originData) this.formData = deepClone(this.originData)
if (newVal.accessoryType != null) {
this.$nextTick(() => this.handleAccessoryTypeChange())
}
} }
}, },
deep: true deep: true
...@@ -1147,6 +1176,9 @@ export default { ...@@ -1147,6 +1176,9 @@ export default {
const fileType = fileName.substr(fileName.lastIndexOf(".") + 1) const fileType = fileName.substr(fileName.lastIndexOf(".") + 1)
this.GlOssApi.multipartUpload(file, success, fail, bucketName, fileType) this.GlOssApi.multipartUpload(file, success, fail, bucketName, fileType)
}, },
handleAccessoryTypeChange() {
this.$emit("accessoryTypeChange", this.formData.accessoryType)
},
// 图片删除 // 图片删除
handleImgDelete(targetItem, subIndex = -1) { handleImgDelete(targetItem, subIndex = -1) {
Array.isArray(this.formData[targetItem.name]) Array.isArray(this.formData[targetItem.name])
...@@ -1226,7 +1258,12 @@ export default { ...@@ -1226,7 +1258,12 @@ export default {
if (valid) { if (valid) {
// 会员权益 类目 // 会员权益 类目
// if (this.equitySceneType.includes(this.formData.goodsType)) this.formData.productServiceItemList = this.productServiceItemList // if (this.equitySceneType.includes(this.formData.goodsType)) this.formData.productServiceItemList = this.productServiceItemList
this.formData.goodsPositionList = this.filterPosiotion() const goodsPositionList = this.filterPosiotion()
if (goodsPositionList === true) {
this.$message.warning("请填写扣减标准")
return
}
this.formData.goodsPositionList = goodsPositionList
const brandOptionList = const brandOptionList =
this.formList[0].formBlock[ this.formList[0].formBlock[
this.formList[0].formBlock.findIndex( this.formList[0].formBlock.findIndex(
...@@ -1249,7 +1286,7 @@ export default { ...@@ -1249,7 +1286,7 @@ export default {
)?.relatedPartyName) )?.relatedPartyName)
this.$emit("handleAddConfirm", this.formData) this.$emit("handleAddConfirm", this.formData)
} else { } else {
var needRuleList = Object.keys(options) const needRuleList = options ? Object.keys(options) : []
if ( if (
this.formData?.goodsName && this.formData?.goodsName &&
!this.formData?.goodsName?.includes("太阳膜") && !this.formData?.goodsName?.includes("太阳膜") &&
...@@ -1260,8 +1297,8 @@ export default { ...@@ -1260,8 +1297,8 @@ export default {
"产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下" "产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下"
) )
} }
this.jumpScroll(needRuleList[0]) if (needRuleList?.length) this.jumpScroll(needRuleList[0])
return true return
} }
if (callback) callback(this.formData) if (callback) callback(this.formData)
}) })
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
:form-list="editForm" :form-list="editForm"
:form-ref="proFormRef" :form-ref="proFormRef"
:is-product="false" :is-product="false"
@accessoryTypeChange="handleAccessoryTypeChange"
@handleAddBrandSupplyConfirm="handleAddBrandSupplyConfirm" @handleAddBrandSupplyConfirm="handleAddBrandSupplyConfirm"
@handleEditBrandSupplyConfirm="handleEditBrandSupplyConfirm"> @handleEditBrandSupplyConfirm="handleEditBrandSupplyConfirm">
</productForm> </productForm>
...@@ -44,7 +45,8 @@ export default { ...@@ -44,7 +45,8 @@ export default {
positionIds: [], positionIds: [],
carTypeList: [1, 2, 3, 4], carTypeList: [1, 2, 3, 4],
goodsPositionList: [], goodsPositionList: [],
goodsSource: 0 goodsSource: 0,
accessoryType: ''
}, },
proFormRef: 'pro', proFormRef: 'pro',
editForm: [{ editForm: [{
...@@ -120,6 +122,15 @@ export default { ...@@ -120,6 +122,15 @@ export default {
label: '详情描述', label: '详情描述',
type: 'descList', type: 'descList',
maxlength: 256 maxlength: 256
}, {
name: 'accessoryType',
label: '配件性质',
type: 'radio',
isRequired: true,
radioOptions: [
{ value: 1, label: '原厂件' },
{ value: 2, label: '品牌件' }
]
}] }]
}], }],
baseData: { baseData: {
...@@ -266,6 +277,9 @@ export default { ...@@ -266,6 +277,9 @@ export default {
editBrandSupplyMerchant(data).then(res => { editBrandSupplyMerchant(data).then(res => {
this.getBrandSupplyList(data.partitionFlag) this.getBrandSupplyList(data.partitionFlag)
}) })
},
handleAccessoryTypeChange(val) {
this.$emit('accessoryTypeChange', val)
} }
} }
} }
......
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
</div> </div>
</div> </div>
<div class="speci-box" id="specificationDetailList"> <div class="speci-box" id="specificationDetailList">
<singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" <singleSpecificationForm ref="singleSpecificationFormRef" v-if="goodsInfoData.specificationType == '1'"
:product-service-item-list="productServiceItemList" :extend-service-part-list="extendServicePartList"> :product-service-item-list="productServiceItemList" :extend-service-part-list="extendServicePartList">
</singleSpecificationForm> </singleSpecificationForm>
<multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" <multipleSpecificationForm ref="multipleSpecificationFormRef" v-if="goodsInfoData.specificationType == '2'"
:product-service-item-list="productServiceItemList" :extend-service-part-list="extendServicePartList"> :product-service-item-list="productServiceItemList" :extend-service-part-list="extendServicePartList">
</multipleSpecificationForm> </multipleSpecificationForm>
</div> </div>
......
/**
* 原生 table 虚拟滚动 mixin
* 使用方需提供: listData, getRowKey, filterRow(可选)
*/
export default {
data() {
return {
virtualScrollTop: 0
}
},
watch: {
virtualScrollDisplayList: {
handler(list) {
const rowHeight = this.virtualScrollRowHeight || 40
if (!list || list.length === 0) {
this.virtualScrollTop = 0
return
}
const maxTop = Math.max(0, (list.length || 0) * rowHeight - (this.virtualScrollContainerHeight || 400))
if (this.virtualScrollTop > maxTop) {
this.virtualScrollTop = maxTop
}
}
}
},
computed: {
virtualScrollDisplayList() {
const list = this.listData || []
const filterRow = this.filterRow || (() => true)
const getRowKey = this.getRowKey || ((item, idx) => 'row-' + idx)
return list
.map((item, idx) => ({
item,
originalIndex: idx,
key: getRowKey.call(this, item, idx)
}))
.filter(({ item }) => filterRow.call(this, item))
},
virtualScrollVisibleRows() {
const list = this.virtualScrollDisplayList
const rowHeight = this.virtualScrollRowHeight || 40
const containerHeight = this.virtualScrollContainerHeight || 400
const buffer = this.virtualScrollBuffer || 5
const start = Math.max(0, Math.floor(this.virtualScrollTop / rowHeight) - buffer)
const visibleCount = Math.ceil(containerHeight / rowHeight)
const end = Math.min(list.length, start + visibleCount + 2 * buffer)
return list.slice(start, end)
},
virtualScrollTotalHeight() {
const list = this.virtualScrollDisplayList
const rowHeight = this.virtualScrollRowHeight || 40
return Math.max(0, (list?.length || 0) * rowHeight)
},
virtualScrollOffsetY() {
const rowHeight = this.virtualScrollRowHeight || 40
const buffer = this.virtualScrollBuffer || 5
const start = Math.max(0, Math.floor(this.virtualScrollTop / rowHeight) - buffer)
return start * rowHeight
}
},
methods: {
virtualScrollOnScroll(e) {
this.virtualScrollTop = e.target.scrollTop
}
}
}
<!-- 店端实际交车数 -->
<template>
<d2-container class="delivery-count">
<template #header>
<div class="header">
<d2-search class="show-search"
:form-data="showFormData"
label-width="140px"
:search-form="searchForm"
:search-select-obj="searchSelectObj">
<template #reportDate>
<el-date-picker v-model="searchForm.reportDate"
end-placeholder="结束日期"
:picker-options="pickerOptions"
range-separator="至"
size="mini"
start-placeholder="开始日期"
type="daterange"
value-format="yyyy-MM-dd" />
</template>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</d2-search>
</div>
</template>
<div class="d2-container-content">
<div class="table-header">
<div class="table-title">
{{ merchantName || '店端实际交车数' }}
</div>
<!-- <auth-button category="Button" :show-btn-ids="['9070901']" /> -->
<el-button size="small"
type="primary"
@click="handleExport">
导出
</el-button>
</div>
<d2-table ref="recordTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-data="tableData"
:table-params="tableParams" />
</div>
<div class="table-footer">
<el-button size="small"
type="primary"
@click="handleBack">
返回
</el-button>
</div>
</d2-container>
</template>
<script>
import dayjs from "dayjs";
import { mapActions, mapState } from "vuex";
import { permeabilityDetail } from "@/api/permeation.js";
import { rangePickerOptions_oneYearNoFuture } from "@/common/format";
import { deepClone } from "@/common/util";
export default {
name: "DeliveryCount",
data() {
return {
getListApi: permeabilityDetail,
searchForm: {
merchantId: "",
staffName: "",
createdDate: "",
reportDate: "",
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [
{
label: "员工名称",
name: "staffName",
type: "input",
isClear: true,
},
{
label: "填报日期",
name: "createdDate",
type: "datePicker",
isClear: true,
valueFormat: "yyyy-MM-dd",
pickerOptions: "rangePickerOptions_oneYearNoFuture",
},
{
label: "日报时间",
name: "reportDate",
addHtml: "reportDate",
},
],
tableData: [],
tableParams: {
btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000, 10),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "员工名称",
prop: "staffName",
},
{
label: "店端实际交车数",
prop: "deliveryCount",
formatter: (cellValue) => {
return (cellValue.deliveryCount ?? "") === ""
? "-"
: cellValue.deliveryCount;
},
},
{
label: "填报时间",
prop: "createdDate",
},
{
label: "日报时间",
prop: "reportDate",
},
],
},
sceneType: "0",
pickerOptions: rangePickerOptions_oneYearNoFuture,
};
},
computed: {
...mapState({
dowloadList: state => state.d2admin.user.dowloadList,
}),
merchantName() {
return this.$route.query.merchantName || "";
},
},
created() {
const { merchantId, startDate, endDate } = this.$route.query;
if (merchantId) {
this.searchForm.merchantId = merchantId;
}
if (startDate && endDate) {
this.searchForm.reportDate = [startDate, endDate];
}
},
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = this.getParams();
resolve();
});
},
getParams() {
this.searchFormSearch = deepClone(this.searchForm);
if (this.searchFormSearch.createdDate) {
this.searchFormSearch.createdStartDate
= dayjs(this.searchFormSearch.createdDate[0]).format("YYYY-MM-DD")
+ " 00:00:00";
this.searchFormSearch.createdEndDate
= dayjs(this.searchFormSearch.createdDate[1]).format("YYYY-MM-DD")
+ " 23:59:59";
}
if (this.searchFormSearch.reportDate) {
this.searchFormSearch.reportStartDate = dayjs(
this.searchFormSearch.reportDate[0],
).format("YYYY-MM-DD");
this.searchFormSearch.reportEndDate = dayjs(
this.searchFormSearch.reportDate[1],
).format("YYYY-MM-DD");
}
this.searchFormSearch.sceneType = this.sceneType;
return this.searchFormSearch;
},
handleExport() {
const params = this.getParams();
params.method
= "dj.api.smartcarlife.permeability.report.detail.exportAsync";
const list = [
...this.dowloadList,
{
name: `填报明细 ${dayjs().format("YYYY-MM-DD")}`,
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime(),
},
];
this.actionSetDownloadList({ list, type: "dowloadList" });
},
handleReset() {
const { merchantId, startDate, endDate } = this.$route.query;
this.searchForm = {
merchantId: merchantId || "",
staffName: "",
createdDate: "",
reportDate: startDate && endDate ? [startDate, endDate] : "",
};
this.$refs.recordTable.refreshTable();
},
handleBack() {
this.$router.go(-1);
},
},
};
</script>
<style lang="scss" scoped>
.delivery-count {
// .header {
// display: flex;
// align-items: center;
// ::v-deep {
// .el-date-editor {
// width: 220px;
// }
// }
// }
.table-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table-title {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.table-footer {
margin-top: 16px;
text-align: center;
}
}
</style>
...@@ -39,6 +39,14 @@ ...@@ -39,6 +39,14 @@
:value="subItem.staffName" /> :value="subItem.staffName" />
</el-select> </el-select>
</template> </template>
<template #myPendingReview>
<el-switch
active-value="1"
inactive-value="0"
v-model="searchForm.myWaitApplySwitch"
active-color="#2A58AD">
</el-switch>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button size="small" <el-button size="small"
...@@ -90,10 +98,10 @@ ...@@ -90,10 +98,10 @@
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="原错误订单编号" label="原错误订单编号"
prop="associatedOrderCode" prop="incorrectOrderCode"
width="160"> width="160">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.associatedOrderCode || '-' }}</span> <span>{{ scope.row.incorrectOrderCode || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
...@@ -316,23 +324,43 @@ ...@@ -316,23 +324,43 @@
prop="subOrderList"> prop="subOrderList">
<template #default="scope"> <template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index"> <span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">¥ {{ item.totalPrice }}</p> <p v-if="item.upgradeGoodsId">¥ {{ item.upgradePrice }}</p>
<p v-else>¥ {{ item.baseRetailPrice }}</p> <p v-else>¥ {{ item.baseRetailPrice }}</p>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="折扣后金额" label="商品销售单价"
prop="subOrderList" width="130"
width="120px"> prop="subOrderList">
<template #default="scope"> <template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index"> <span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">¥ {{ item.finalPrice }}</p> <p v-if="item.upgradeGoodsId">¥ {{ item.singleProductSalesPrice }}</p>
<p v-else>¥ {{ item.baseRetailPrice }}</p> <p v-else>¥ {{ item.baseRetailPrice }}</p>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="商品实付单价"
width="130"
prop="subOrderList">
<template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">¥ {{ item.singleProductFinalPrice }}</p>
<p v-else>¥ {{ item.baseRetailPrice }}</p>
</span>
</template>
</el-table-column>
<el-table-column align="center"
label="数量"
prop="subOrderList">
<template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">{{ item.number }}</p>
</span>
</template>
</el-table-column>
<el-table-column align="center"
label="优惠券 id" label="优惠券 id"
prop="coupon.customerCouponCode"> prop="coupon.customerCouponCode">
<template #default="scope"> <template #default="scope">
...@@ -555,13 +583,13 @@ ...@@ -555,13 +583,13 @@
:show-btn-ids="['9040135']" /> :show-btn-ids="['9040135']" />
<div> <div>
<!-- 通过 --> <!-- 通过 -->
<auth-button v-if="scope.row.goodsOrderApplyStatus == 2" <auth-button v-if="scope.row.canApplyFlag == 1"
:data="scope.row" :data="scope.row"
:show-btn-ids="['9040147']" /> :show-btn-ids="['9040147']" />
</div> </div>
<div> <div>
<!-- 驳回 --> <!-- 驳回 -->
<auth-button v-if="scope.row.goodsOrderApplyStatus == 2" <auth-button v-if="scope.row.canApplyFlag == 1"
:data="scope.row" :data="scope.row"
:show-btn-ids="['9040148']" /> :show-btn-ids="['9040148']" />
</div> </div>
...@@ -993,6 +1021,10 @@ export default { ...@@ -993,6 +1021,10 @@ export default {
optionLabel: "confLabel", optionLabel: "confLabel",
optionsName: "auditStatusList", optionsName: "auditStatusList",
}, },
{
label: '我的待审',
addHtml: 'myPendingReview'
}
], ],
searchForm: { searchForm: {
sceneType: 0, sceneType: 0,
...@@ -1023,6 +1055,7 @@ export default { ...@@ -1023,6 +1055,7 @@ export default {
sellerNameVague: "", sellerNameVague: "",
djOrderType: "", djOrderType: "",
goodsOrderApplyStatus: "", goodsOrderApplyStatus: "",
myWaitApplySwitch: 0
}, },
baseData: { baseData: {
orderStatusList: [ orderStatusList: [
...@@ -1236,6 +1269,18 @@ export default { ...@@ -1236,6 +1269,18 @@ export default {
}, },
immediate: true, immediate: true,
}, },
"searchForm.myWaitApplySwitch": {
handler(val) {
let index = this.showFormData.findIndex(val => val.name == 'goodsOrderApplyStatus')
if (val == 1) { // 开启我的待审 将审批状态置灰不可操作,选项置为线上运营待审核
this.searchForm.goodsOrderApplyStatus = '2'
this.$set(this.showFormData[index], 'isDisabled', true)
} else {
this.searchForm.goodsOrderApplyStatus = ''
this.$set(this.showFormData[index], 'isDisabled', false)
}
}
}
}, },
mounted() { mounted() {
// 审计用账号特殊处理 // 审计用账号特殊处理
...@@ -1443,6 +1488,7 @@ export default { ...@@ -1443,6 +1488,7 @@ export default {
sellerNameVague: "", sellerNameVague: "",
djOrderType: "", djOrderType: "",
goodsOrderApplyStatus: "", goodsOrderApplyStatus: "",
myWaitApplySwitch: 0
}; };
this.tempGoodsType = []; this.tempGoodsType = [];
// this.baseData.storeIdList = [] // this.baseData.storeIdList = []
......
...@@ -63,20 +63,26 @@ ...@@ -63,20 +63,26 @@
{{ scope.row.upgradeGoodsName || '-' }} {{ scope.row.upgradeGoodsName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="totalPrice" align="center" label="原价"> <el-table-column prop="upgradePrice" align="center" label="商品单价">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.totalPrice != null">¥{{ scope.row.totalPrice }}</span> <span v-if="scope.row.upgradePrice != null">¥{{ scope.row.upgradePrice }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="singleProductSalesPrice" align="center" label="商品销售单价">
<template #default="scope">
<span v-if="scope.row.singleProductSalesPrice != null">¥{{ scope.row.singleProductSalesPrice || '-' }}</span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="discountType" align="center" label="折扣方式"> <el-table-column prop="discountType" align="center" label="折扣方式">
<template #default="scope"> <template #default="scope">
{{ discountTypeMap[scope.row.discountType] || '-' }} <span v-if="scope.row.discountType">{{ `${discountTypeMap[scope.row.discountType]} ${scope.row.discountType == 2 ? '¥' + scope.row.discountValue : scope.row.discountType == 1 ? scope.row.discountValue + '折' : ''}` || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="finalPrice" align="center" label="折扣后价格"> <el-table-column prop="singleProductFinalPrice" align="center" label="商品实付单价">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.finalPrice != null">¥{{ scope.row.finalPrice }}</span> <span v-if="scope.row.singleProductFinalPrice != null">¥{{ scope.row.singleProductFinalPrice }}</span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -109,20 +115,26 @@ ...@@ -109,20 +115,26 @@
{{ scope.row.upgradeGoodsName || '-' }} {{ scope.row.upgradeGoodsName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="totalPrice" align="center" label="原价"> <el-table-column prop="upgradePrice" align="center" label="商品单价">
<template #default="scope">
<span v-if="scope.row.upgradePrice != null">¥{{ scope.row.upgradePrice }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="singleProductSalesPrice" align="center" label="商品销售单价">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.totalPrice != null">¥{{ scope.row.totalPrice }}</span> <span v-if="scope.row.singleProductSalesPrice != null">¥{{ scope.row.singleProductSalesPrice || '-' }}</span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="discountType" align="center" label="折扣方式"> <el-table-column prop="discountType" align="center" label="折扣方式">
<template #default="scope"> <template #default="scope">
{{ discountTypeMap[scope.row.discountType] || '-' }} <span v-if="scope.row.discountType">{{ `${discountTypeMap[scope.row.discountType]} ${scope.row.discountType == 2 ? '¥' + scope.row.discountValue : scope.row.discountType == 1 ? scope.row.discountValue + '折' : ''}` || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="finalPrice" align="center" label="折扣后价格"> <el-table-column prop="singleProductFinalPrice" align="center" label="商品实付单价">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.finalPrice != null">¥{{ scope.row.finalPrice }}</span> <span v-if="scope.row.singleProductFinalPrice != null">¥{{ scope.row.singleProductFinalPrice }}</span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -150,6 +162,38 @@ ...@@ -150,6 +162,38 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="sub-title">操作日志</div>
<div class="log-box">
<div class="record-div" v-if="detailInfo.applyLogList && detailInfo.applyLogList.length">
<div class="record-div-d" v-for="(item, index) in detailInfo.applyLogList" :key="index">
<!-- <span class="dot"></span> -->
<div class="span-txt-one">{{ item.beforeStatus ? $$(statusForShow, [item.beforeStatus], 'text') : '' }}</div>
<div class="span-txt-two" style="font-weight: 500;">
<span :class="item.afterStatus ? examineStatusClass[item.afterStatus] : ''">
{{ item.afterStatus ? $$(statusForShow, [item.afterStatus], 'status') : '' }}</span>
<span v-if="item.afterStatus == 4">
<span style="display: inline-block; margin: 0 8px;">至</span>
<span>驻店销售</span>
</span>
</div>
<div class="span-txt-two reviewer ellipsis">审核人:
<el-tooltip class="item" popper-class="remark-popper-class" effect="dark" :content="item.operatorName" placement="bottom">
<span>{{ item.operatorName }}</span>
</el-tooltip>
</div>
<div class="span-txt-two">审核时间:{{ item.createdDateStr }}</div>
<div v-if="item.remark" class="span-txt-two">{{[4].includes(item.afterStatus) ? '驳回原因:' : '备注:'}}
<el-tooltip class="item" popper-class="remark-popper-class" effect="dark" :content="item.remark" placement="bottom">
<span>{{ item.remark ? (item.remark.length > 15 ? (item.remark.slice(0, 15) + '...') : item.remark) : '' }}</span>
</el-tooltip>
</div>
</div>
</div>
<div class="emptyCom" v-else>
<img :src="emptyImgUrl" class="emptyImg" alt="">
<span class="tips">暂无数据</span>
</div>
</div>
</div> </div>
<el-image-viewer v-if="imgVisible" :on-close="closeImgViewer" :url-list="imgList" :initial-index="initialIndex" /> <el-image-viewer v-if="imgVisible" :on-close="closeImgViewer" :url-list="imgList" :initial-index="initialIndex" />
</baseDialog> </baseDialog>
...@@ -158,6 +202,7 @@ ...@@ -158,6 +202,7 @@
import { djOrderTypeMap, discountTypeMap } from "@/common/constants" import { djOrderTypeMap, discountTypeMap } from "@/common/constants"
import { getAuditOrderDetail, auditGoodsOrderApplyRecord } from "@api/order" import { getAuditOrderDetail, auditGoodsOrderApplyRecord } from "@api/order"
import ellipsisText from './ellipsisText' import ellipsisText from './ellipsisText'
import { Util } from '@/common/util'
export default { export default {
name: "ApprovalDialog", name: "ApprovalDialog",
components: { components: {
...@@ -206,7 +251,19 @@ export default { ...@@ -206,7 +251,19 @@ export default {
formObj: { formObj: {
remark: '' remark: ''
}, },
imgVisible: false imgVisible: false,
statusForShow: {
1: { text: '区域运营审核' },
2: { text: '线上运营审核', status: '通过' },
3: { status: '通过' },
4: { status: '驳回' }
},
examineStatusClass: {
2: 'greendot',
3: 'greendot',
4: 'reddot'
},
emptyImgUrl: require("@/assets/empty-5.png")
} }
}, },
created() { created() {
...@@ -227,6 +284,9 @@ export default { ...@@ -227,6 +284,9 @@ export default {
} }
res.oldSubOrderList = this.flattenGoodsOrder(res.oldGoodsOrderDTO) res.oldSubOrderList = this.flattenGoodsOrder(res.oldGoodsOrderDTO)
res.subOrderList = this.flattenGoodsOrder(res.goodsOrderDTO) res.subOrderList = this.flattenGoodsOrder(res.goodsOrderDTO)
res?.applyLogList?.forEach(val => {
val.createdDateStr = Util.dateFormate(val.createdDate, 'YYYY-MM-DD HH:mm:ss')
})
this.detailInfo = res this.detailInfo = res
}) })
}, },
...@@ -326,4 +386,68 @@ export default { ...@@ -326,4 +386,68 @@ export default {
overflow: hidden; overflow: hidden;
} }
} }
.log-box {
margin-top: 20px;
border-radius: 4px;
background: #FAFAFA;
padding: 16px;
.record-div {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #666666;
letter-spacing: 0;
.record-div-d {
display: flex;
align-items: center;
margin-bottom: 10px;
&:last-child{
margin-bottom: 0;
}
}
.span-txt-one {
height: 21px;
font-weight: 500;
color: #333333;
}
.reviewer {
width: 180px;
&.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.span-txt-two {
margin-left: 40px;
}
.greendot {
color: #4aca74;
}
.reddot {
color: #eb4e4e;
}
}
.emptyCom {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
.emptyImg {
width: 64px;
}
.tips {
font-size: 14px;
color: #999999;
margin: 20px 0;
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
name: 'orderCode' name: 'orderCode'
}, { }, {
label: '金额', label: '金额',
name: 'totalPrice' name: 'finalPrice'
}], }],
handleSelectChange: (value) => { handleSelectChange: (value) => {
this.searchSelectObj.order.value = '' this.searchSelectObj.order.value = ''
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
prop: 'orderTimeTxt' prop: 'orderTimeTxt'
}, { }, {
label: '交易金额', label: '交易金额',
prop: 'totalPrice', prop: 'finalPrice',
prefix: '¥' prefix: '¥'
}] }]
} }
...@@ -213,7 +213,7 @@ export default { ...@@ -213,7 +213,7 @@ export default {
addPrice(type) { addPrice(type) {
const addValNameObj = { const addValNameObj = {
trade: 'totalFee', trade: 'totalFee',
order: 'totalPrice', order: 'finalPrice',
} }
this.price[type] = this.checkedList[type].length ? this.checkedList[type].map(item => item[addValNameObj[type]]).reduce((prev, cur) => { this.price[type] = this.checkedList[type].length ? this.checkedList[type].map(item => item[addValNameObj[type]]).reduce((prev, cur) => {
return prev + cur return prev + cur
......
...@@ -39,6 +39,14 @@ ...@@ -39,6 +39,14 @@
:value="subItem.staffName" /> :value="subItem.staffName" />
</el-select> </el-select>
</template> </template>
<template #myPendingReview>
<el-switch
active-value="1"
inactive-value="0"
v-model="searchForm.myWaitApplySwitch"
active-color="#2A58AD">
</el-switch>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button size="small" <el-button size="small"
...@@ -115,10 +123,10 @@ ...@@ -115,10 +123,10 @@
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="原错误订单编号" label="原错误订单编号"
prop="associatedOrderCode" prop="incorrectOrderCode"
width="160"> width="160">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.associatedOrderCode || '-' }}</span> <span>{{ scope.row.incorrectOrderCode || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
...@@ -298,24 +306,44 @@ ...@@ -298,24 +306,44 @@
prop="subOrderList"> prop="subOrderList">
<template #default="scope"> <template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index"> <span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">¥ {{ item.totalPrice }}</p> <p v-if="item.upgradeGoodsId">¥ {{ item.upgradePrice }}</p>
<!-- <p v-if="item.upgradeGoodsId">¥ {{item.upgradePrice}}</p> --> <!-- <p v-if="item.upgradeGoodsId">¥ {{item.upgradePrice}}</p> -->
<p v-else>¥ {{ item.baseRetailPrice }}</p> <p v-else>¥ {{ item.baseRetailPrice }}</p>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="折扣后金额" label="商品销售单价"
prop="subOrderList" width="130"
width="120px"> prop="subOrderList">
<template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">¥ {{ item.singleProductSalesPrice }}</p>
<p v-else>¥ {{ item.baseRetailPrice }}</p>
</span>
</template>
</el-table-column>
<el-table-column align="center"
label="商品实付单价"
width="130"
prop="subOrderList">
<template #default="scope"> <template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index"> <span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">¥ {{ item.finalPrice }}</p> <p v-if="item.upgradeGoodsId">¥ {{ item.singleProductFinalPrice }}</p>
<p v-else>¥ {{ item.baseRetailPrice }}</p> <p v-else>¥ {{ item.baseRetailPrice }}</p>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="数量"
prop="subOrderList">
<template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">{{ item.number }}</p>
</span>
</template>
</el-table-column>
<el-table-column align="center"
label="施工单状态" label="施工单状态"
prop="subOrderList" prop="subOrderList"
width="100"> width="100">
...@@ -342,6 +370,26 @@ ...@@ -342,6 +370,26 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="领单确认时间"
prop="subOrderList"
width="160">
<template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p>{{ item.subElectronicDateStr || "-" }}</p>
</span>
</template>
</el-table-column>
<el-table-column align="center"
label="完成施工时间"
prop="subOrderList"
width="160">
<template #default="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p>{{ item.completedTimeStr || "-" }}</p>
</span>
</template>
</el-table-column>
<el-table-column align="center"
label="技师" label="技师"
prop="subOrderList" prop="subOrderList"
width="200"> width="200">
...@@ -538,13 +586,13 @@ ...@@ -538,13 +586,13 @@
:show-btn-ids="['9040107']" /> :show-btn-ids="['9040107']" />
<div> <div>
<!-- 通过 --> <!-- 通过 -->
<auth-button v-if="scope.row.goodsOrderApplyStatus == 2" <auth-button v-if="scope.row.canApplyFlag == 1"
:data="scope.row" :data="scope.row"
:show-btn-ids="['9040147']" /> :show-btn-ids="['9040147']" />
</div> </div>
<div> <div>
<!-- 驳回 --> <!-- 驳回 -->
<auth-button v-if="scope.row.goodsOrderApplyStatus == 2" <auth-button v-if="scope.row.canApplyFlag == 1"
:data="scope.row" :data="scope.row"
:show-btn-ids="['9040148']" /> :show-btn-ids="['9040148']" />
</div> </div>
...@@ -888,6 +936,13 @@ export default { ...@@ -888,6 +936,13 @@ export default {
pickerOptions: "rangePickerOptions", pickerOptions: "rangePickerOptions",
}, },
{ {
label: "完成施工时间",
name: "completedTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions",
},
{
label: "订单来源", label: "订单来源",
name: "sourceList", name: "sourceList",
type: "select", type: "select",
...@@ -1003,6 +1058,10 @@ export default { ...@@ -1003,6 +1058,10 @@ export default {
optionLabel: "confLabel", optionLabel: "confLabel",
optionsName: "auditStatusList", optionsName: "auditStatusList",
}, },
{
label: '我的待审',
addHtml: 'myPendingReview'
}
], ],
searchForm: { searchForm: {
sceneType: 1, sceneType: 1,
...@@ -1013,12 +1072,12 @@ export default { ...@@ -1013,12 +1072,12 @@ export default {
merchantId: "", merchantId: "",
orderTime: "", orderTime: "",
paySuccessDate: "", paySuccessDate: "",
completedTime: "",
constructionFlag: "", constructionFlag: "",
sourceList: "", sourceList: "",
channelType: "", channelType: "",
businessModel: "", businessModel: "",
subShopMerchantId: "", subShopMerchantId: "",
paySuccessDate: "",
provinceId: "", provinceId: "",
invoiceStatus: "", invoiceStatus: "",
salesType: "", salesType: "",
...@@ -1030,6 +1089,7 @@ export default { ...@@ -1030,6 +1089,7 @@ export default {
directSalesFlag: "", directSalesFlag: "",
djOrderType: "", djOrderType: "",
goodsOrderApplyStatus: "", goodsOrderApplyStatus: "",
myWaitApplySwitch: 0
}, },
baseData: { baseData: {
orderStatusList: [ orderStatusList: [
...@@ -1255,6 +1315,18 @@ export default { ...@@ -1255,6 +1315,18 @@ export default {
}, },
immediate: true, immediate: true,
}, },
"searchForm.myWaitApplySwitch": {
handler(val) {
let index = this.showFormData.findIndex(val => val.name == 'goodsOrderApplyStatus')
if (val == 1) { // 开启我的待审 将审批状态置灰不可操作,选项置为线上运营待审核
this.searchForm.goodsOrderApplyStatus = '2'
this.$set(this.showFormData[index], 'isDisabled', true)
} else {
this.searchForm.goodsOrderApplyStatus = ''
this.$set(this.showFormData[index], 'isDisabled', false)
}
}
}
}, },
mounted() { mounted() {
// 审计用账号特殊处理 // 审计用账号特殊处理
...@@ -1423,6 +1495,7 @@ export default { ...@@ -1423,6 +1495,7 @@ export default {
merchantId: "", merchantId: "",
orderTime: "", orderTime: "",
paySuccessDate: "", paySuccessDate: "",
completedTime: "",
constructionFlag: "", constructionFlag: "",
channelType: "", channelType: "",
businessModel: "", businessModel: "",
...@@ -1436,6 +1509,7 @@ export default { ...@@ -1436,6 +1509,7 @@ export default {
directSalesFlag: "", directSalesFlag: "",
djOrderType: "", djOrderType: "",
goodsOrderApplyStatus: "", goodsOrderApplyStatus: "",
myWaitApplySwitch: 0
}; };
this.tempGoodsType = []; this.tempGoodsType = [];
// this.baseData.storeIdList = [] // this.baseData.storeIdList = []
...@@ -1597,6 +1671,15 @@ export default { ...@@ -1597,6 +1671,15 @@ export default {
= Util.dateFormate(form.paySuccessDate[1], "YYYY-MM-DD") + " 23:59:59"; = Util.dateFormate(form.paySuccessDate[1], "YYYY-MM-DD") + " 23:59:59";
} }
if (form.completedTime && form.completedTime.length) {
params.completionBeginTime = Util.dateFormate(
form.completedTime[0],
"YYYY-MM-DD HH:mm:ss",
);
params.completionEndTime
= Util.dateFormate(form.completedTime[1], "YYYY-MM-DD") + " 23:59:59";
}
if (params.sourceList != "") { if (params.sourceList != "") {
// 处理d2-search 下拉选不支持绑定数组的问题 // 处理d2-search 下拉选不支持绑定数组的问题
params.sourceList params.sourceList
...@@ -1638,6 +1721,12 @@ export default { ...@@ -1638,6 +1721,12 @@ export default {
= this.positionTypeList?.filter( = this.positionTypeList?.filter(
subItem => val?.upgradeGoodsPosition == subItem.position, subItem => val?.upgradeGoodsPosition == subItem.position,
)[0]?.confName || "-"; )[0]?.confName || "-";
val.subElectronicDateStr = val.subElectronicDate
? Util.dateFormate(val.subElectronicDate, "YYYY-MM-DD HH:mm:ss")
: "";
val.completedTimeStr = val.completedTime
? Util.dateFormate(val.completedTime, "YYYY-MM-DD HH:mm:ss")
: "";
}); });
return item; return item;
}); });
......
...@@ -256,9 +256,14 @@ ...@@ -256,9 +256,14 @@
<span>¥{{ scope.row.upgradePrice || 0 }}</span> <span>¥{{ scope.row.upgradePrice || 0 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :prop="'finalPrice'" align="center" label="折扣后金额"> <el-table-column :prop="'singleProductSalesPrice'" align="center" label="商品销售单价">
<template slot-scope="scope"> <template slot-scope="scope">
<span>¥{{ scope.row.finalPrice || 0 }}</span> <span>¥{{ scope.row.singleProductSalesPrice }}</span>
</template>
</el-table-column>
<el-table-column :prop="'singleProductFinalPrice'" align="center" label="商品实付单价">
<template slot-scope="scope">
<span>¥{{ scope.row.singleProductFinalPrice }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :prop="'coupon.customerCouponCode'" align="center" label="优惠券 id" /> <el-table-column :prop="'coupon.customerCouponCode'" align="center" label="优惠券 id" />
...@@ -281,9 +286,9 @@ ...@@ -281,9 +286,9 @@
<span>{{ scope.row.number }}件</span> <span>{{ scope.row.number }}件</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="totalPrice" align="center" label="优惠方式"> <el-table-column prop="totalPrice" align="center" width="150" label="优惠方式">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ discountTypeMap[scope.row.discountType] || '-' }}</span> <span v-if="scope.row.discountType">{{ `${discountTypeMap[scope.row.discountType]} ${scope.row.discountType == 2 ? '¥' + scope.row.discountValue : scope.row.discountType == 1 ? scope.row.discountValue + '折' : ''}` || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="totalPrice" align="center" label="共减"> <el-table-column prop="totalPrice" align="center" label="共减">
...@@ -294,12 +299,13 @@ ...@@ -294,12 +299,13 @@
<el-table-column prop="totalPrice" align="center" label="商品总价"> <el-table-column prop="totalPrice" align="center" label="商品总价">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="detail.upgradeFlag === 'Y'">¥{{ scope.row.totalPrice || 0 }}</span> <span v-if="detail.upgradeFlag === 'Y'">¥{{ scope.row.totalPrice || 0 }}</span>
<span v-else>0</span> <span v-else>¥0</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="totalPrice" align="center" label="支付金额"> <el-table-column prop="totalPrice" align="center" label="支付金额">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.finalPrice != null ? '¥' + scope.row.finalPrice : '' }}</span> <span v-if="detail.upgradeFlag === 'Y'">{{ scope.row.finalPrice != null ? '¥' + scope.row.finalPrice : '' }}</span>
<span v-else>¥0</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -337,6 +343,40 @@ ...@@ -337,6 +343,40 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="form_table_gp">
<p class="edit-sub-title">审批操作日志</p>
<div class="log-box">
<div class="record-div" v-if="applyLogList && applyLogList.length">
<div class="record-div-d" v-for="(item, index) in applyLogList" :key="index">
<!-- <span class="dot"></span> -->
<div class="span-txt-one">{{ item.beforeStatus ? $$(statusForShow, [item.beforeStatus], 'text') : '' }}</div>
<div class="span-txt-two" style="font-weight: 500;">
<span :class="item.afterStatus ? examineStatusClass[item.afterStatus] : ''">
{{ item.afterStatus ? $$(statusForShow, [item.afterStatus], 'status') : '' }}</span>
<span v-if="item.afterStatus == 4">
<span style="display: inline-block; margin: 0 8px;">至</span>
<span>驻店销售</span>
</span>
</div>
<div class="span-txt-two reviewer ellipsis">审核人:
<el-tooltip class="item" popper-class="remark-popper-class" effect="dark" :content="item.operatorName" placement="bottom">
<span>{{ item.operatorName }}</span>
</el-tooltip>
</div>
<div class="span-txt-two">审核时间:{{ item.createdDateStr }}</div>
<div v-if="item.remark" class="span-txt-two">{{[4].includes(item.afterStatus) ? '驳回原因:' : '备注:'}}
<el-tooltip class="item" popper-class="remark-popper-class" effect="dark" :content="item.remark" placement="bottom">
<span>{{ item.remark ? (item.remark.length > 20 ? (item.remark.slice(0, 20) + '...') : item.remark) : '' }}</span>
</el-tooltip>
</div>
</div>
</div>
<div class="emptyCom" v-else>
<img :src="emptyImgUrl" class="emptyImg" alt="">
<span class="tips">暂无数据</span>
</div>
</div>
</div>
<p style="text-align: left; padding-left: 30px; margin: 0 0 16px 0"> <p style="text-align: left; padding-left: 30px; margin: 0 0 16px 0">
<el-button type="primary" @click="handleClose"> 返回 </el-button> <el-button type="primary" @click="handleClose"> 返回 </el-button>
</p> </p>
...@@ -387,7 +427,7 @@ import { mapActions, mapState } from "vuex" ...@@ -387,7 +427,7 @@ import { mapActions, mapState } from "vuex"
// import signRefundDialog from './signRefundDialog' // import signRefundDialog from './signRefundDialog'
import remarkDialog from "./remarkDialog" import remarkDialog from "./remarkDialog"
import technicianDialog from "./components/technicianDialog" import technicianDialog from "./components/technicianDialog"
import { deepClone, downLoadFile } from "@/common/util" import { deepClone, downLoadFile, Util } from "@/common/util"
import { payType, BaseData, invoiceTypeOpt, invalidFlagOpt, djOrderTypeMap, discountTypeMap } from "@/common/constants.js" import { payType, BaseData, invoiceTypeOpt, invalidFlagOpt, djOrderTypeMap, discountTypeMap } from "@/common/constants.js"
import dayjs from "dayjs" import dayjs from "dayjs"
import { goodsOrderDetail, markAsInvoiced, carUploadRecordAdd, carUploadRecordDelete, downloadNumAdd } from "@api/order" import { goodsOrderDetail, markAsInvoiced, carUploadRecordAdd, carUploadRecordDelete, downloadNumAdd } from "@api/order"
...@@ -481,7 +521,20 @@ export default { ...@@ -481,7 +521,20 @@ export default {
pickUpOrder: null, // 接车单信息 pickUpOrder: null, // 接车单信息
deliveryNote: null, // 交车单信息 deliveryNote: null, // 交车单信息
djOrderTypeMap, djOrderTypeMap,
discountTypeMap discountTypeMap,
statusForShow: {
1: { text: '区域运营审核' },
2: { text: '线上运营审核', status: '通过' },
3: { status: '通过' },
4: { status: '驳回' }
},
examineStatusClass: {
2: 'greendot',
3: 'greendot',
4: 'reddot'
},
applyLogList: [],
emptyImgUrl: require("@/assets/empty-5.png")
} }
}, },
computed: { computed: {
...@@ -598,7 +651,7 @@ export default { ...@@ -598,7 +651,7 @@ export default {
if (index === 0) { if (index === 0) {
sums[index] = "总价" sums[index] = "总价"
column.align = "is-left" column.align = "is-left"
column.colSpan = 13 column.colSpan = 14
return return
} }
...@@ -742,6 +795,10 @@ export default { ...@@ -742,6 +795,10 @@ export default {
} }
}) })
}) })
res?.applyLogList?.forEach(val => {
val.createdDateStr = Util.dateFormate(val.createdDate, 'YYYY-MM-DD HH:mm:ss')
})
this.applyLogList = res?.applyLogList || []
// 技师显示 // 技师显示
this.detail.technicianName = this.detail?.subOrderList this.detail.technicianName = this.detail?.subOrderList
?.map((item) => item.technicianName) ?.map((item) => item.technicianName)
...@@ -1139,4 +1196,68 @@ export default { ...@@ -1139,4 +1196,68 @@ export default {
cursor: pointer; cursor: pointer;
font-size: 0; font-size: 0;
} }
.log-box {
margin-top: 20px;
border-radius: 4px;
background: #FAFAFA;
padding: 16px;
.record-div {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 14px;
color: #666666;
letter-spacing: 0;
.record-div-d {
display: flex;
align-items: center;
margin-bottom: 10px;
&:last-child{
margin-bottom: 0;
}
}
.span-txt-one {
height: 21px;
font-weight: 500;
color: #333333;
}
.reviewer {
width: 180px;
&.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.span-txt-two {
margin-left: 40px;
}
.greendot {
color: #4aca74;
}
.reddot {
color: #eb4e4e;
}
}
.emptyCom {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
.emptyImg {
width: 64px;
}
.tips {
font-size: 14px;
color: #999999;
margin: 20px 0;
}
}
}
</style> </style>
<!-- 积分调整 -->
<template>
<d2-dialog btn-ok-label="提交审核"
class="adjustDialog"
:is-visible.sync="visible"
title="积分调整"
width="640px"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<div class="tip-text">
提交审核通过后,积分将自动更新
</div>
<glsx-combi-form ref="editFormRef"
class="edit-form-container"
:default-width="defaultWidth"
:form-data="editFormData"
:form-obj="editData"
:form-ref="editChildRef"
:form-rules="formRules"
:is-block="isBlock"
:label-width="labelWidth">
<template #scoreHtml>
<div class="scroe-wrap">
<el-input v-model="editData.score"
maxlength="9"
placeholder="请输入"
:prefix-icon="prefixIcon"
style="width: 136px;">
</el-input>
</div>
</template>
<template #captcha>
<div class="captcha-wrap">
<el-input v-model="editData.captcha"
placeholder="请输入"
style="width: 338px;">
</el-input>
<div class="captcha-text" @click.prevent="getCode">
{{ !isCodeDisabled ? '获取验证码' : `${count}s` }}
</div>
</div>
</template>
</glsx-combi-form>
</d2-dialog>
</template>
<script>
// import { limitPrice } from "@/common/format";
import { getAdmin, getSms, manualAdd, manualSubtract } from "@/api/point";
import { deepClone, Util } from "@/common/util";
export default {
name: "AdjustDialog",
props: {
visible: {
type: Boolean,
default: false,
},
infoData: {
type: Object,
default: () => {},
},
},
data() {
return {
prefixIcon: "el-icon-plus",
labelWidth: "110px",
editChildRef: "editChildRef",
isBlock: true,
defaultWidth: "338px",
isCodeDisabled: false,
count: "",
timer: null,
editData: {
type: 1,
score: "",
captcha: "",
phone: "",
orderCode: "",
admin: "",
},
editFormData: [
{
label: "积分变更",
name: "type",
type: "radio",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "pointChangeOpt",
handleRadioChange: (val) => {
this.prefixIcon = val === 1 ? "el-icon-plus" : "el-icon-minus";
},
},
{
label: "",
name: "score",
maxlength: 9,
addHtml: "scoreHtml",
style: {
marginLeft: "110px",
},
},
{
label: "关联订单编号",
name: "orderCode",
type: "input",
maxlength: "30",
placeholder: "请输入",
isClear: true,
},
{
label: "管理员",
name: "admin",
type: "select",
optionsName: "adminList",
optionId: "adminId",
optionLabel: "adminName",
changeAttr: (val) => {
this.editData.phone = val;
this.isCodeDisabled = false;
clearInterval(this.timer);
this.timer = null;
this.editData.captcha = "";
},
},
{
label: "验证码",
addHtml: "captcha",
name: "captcha",
},
{
label: "备注",
name: "remark",
type: "input",
inputType: "textarea",
maxlength: "200",
width: "436px",
rows: 4,
showLimit: true,
},
],
formRules: {
orderCode: [{ required: true, message: "请输入关联订单编号", trigger: "blur" }],
score: [
{ required: true, message: "请输入积分", trigger: "blur" },
{
validator(rule, value, callback) {
if (value === "" || value === null || value === undefined) {
callback(new Error("请输入积分"));
return;
}
const str = String(value).trim();
// 仅允许:0 或非0开头的整数,且可选最多两位小数
const pattern = /^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/;
if (!pattern.test(str)) {
callback(new Error("积分必须为非负数,最多保留两位小数"));
return;
}
const num = Number(str);
if (!isFinite(num) || num < 0) {
callback(new Error("积分必须为非负数"));
return;
}
callback();
},
trigger: ["blur", "change"],
},
],
captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }, {
validator(rule, value, callback) {
const str = String(value || "").trim();
if (str === "") {
// 空值交给 required 规则处理
callback();
return;
}
if (!/^\d+$/.test(str)) {
callback(new Error("验证码只能输入数字"));
return;
}
callback();
},
trigger: ["blur", "change"],
}],
admin: [{ required: true, message: "请选择管理员", trigger: "change" }],
remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
},
baseData: {
pointChangeOpt: [
{
confId: 1,
confValue: "积分增加",
},
{
confId: 2,
confValue: "积分减少",
},
],
},
};
},
created() {
this.getAdminData();
},
methods: {
getAdminData() {
getAdmin().then((res) => {
if (res) {
this.baseData.adminList = res.map((item) => {
return {
adminId: `${item.phone}`,
adminName: `${item.name} ${item.phone}`,
name: item.name,
phone: item.phone,
};
});
this.getOptionsList(this, "editFormData", false);
if (this.baseData.adminList.length == 0) {
this.editData.admin = "";
this.editData.phone = "";
} else {
this.editData.admin = this.baseData.adminList[0].adminId;
this.editData.phone = this.baseData.adminList[0].phone;
}
}
});
},
getCode() {
if (!this.editData.phone) {
this.$message.error("请选择管理员");
return;
}
if (this.isCodeDisabled)
return;
if (!this.timer) {
this.count = 60;
getSms({
phone: this.editData.phone,
})
.then((res) => {
console.log(res, "res");
if (res) {
this.$message.success("短信验证码发送成功");
this.isCodeDisabled = true;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= 60) {
this.count--;
} else {
this.isCodeDisabled = false;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
} else {
this.$message.error(res.message);
}
});
}
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid1) => {
console.log(valid1);
if (valid1) {
let Methods = this.editData.type === 1 ? manualAdd : manualSubtract;
let params = {
phone: this.editData.phone,
score: this.editData.score,
orderCode: this.editData.orderCode,
remark: this.editData.remark,
captcha: this.editData.captcha,
merchantId: this.infoData.merchantId,
staffPhone: this.infoData.staffPhone,
};
Methods(params).then((res) => {
if (res) {
this.$message.success("积分调整成功");
this.$emit("handleConfirm");
}
});
}
});
},
handleClose() {
this.$emit("handleClose");
},
getOptionsList(that, formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
let item = that[formName].find(k => k.name == refreshSigle);
let index = that[formName].findIndex(k => k.name == refreshSigle);
that.$set(
that[formName][index],
"optionList",
deepClone(that.baseData[item.optionsName]),
);
if (
hasAll
&& that.baseData[item.optionsName].length
&& that.baseData[item.optionsName][0][
that[formName][index].optionLabel
] !== "全部"
) {
const temp = {};
temp[that[formName][index].optionId] = "";
temp[that[formName][index].optionLabel] = "全部";
that[formName][index].optionList.unshift(temp);
}
} else {
that[formName].forEach((item, index) => {
if (
that.baseData[item.optionsName]?.length
) {
that.$set(
that[formName][index],
"optionList",
deepClone(that.baseData[item.optionsName]),
);
if (
hasAll
&& that.baseData[item.optionsName].length
&& that.baseData[item.optionsName][0][
that[formName][index].optionLabel
] !== "全部"
) {
const temp = {};
temp[that[formName][index].optionId] = "";
temp[that[formName][index].optionLabel] = "全部";
that[formName][index].optionList.unshift(temp);
}
}
});
}
},
},
};
</script>
<style scoped lang="scss">
.adjustDialog {
::v-deep {
.el-dialog__header {
border-bottom: 1px solid #e5e5e5;
}
.el-dialog__footer {
border-top: 1px solid #e5e5e5;
}
.el-input__count {
right: 12px;
bottom: 1px;
}
}
}
.tip-text {
border-radius: 4px;
background: #f7f7f7;
color: #333333;
font-size: 14px;
padding: 8px 0;
text-align: center;
margin-bottom: 26px;
margin-top: -10px;
}
.captcha-wrap {
.captcha-text {
font-size: 12px;
color: #2a58ad;
position: absolute;
right: 0;
top: 2px;
margin-right: 10px;
cursor: pointer;
width: 100px;
height: 32px;
text-align: right;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!