Commit 4df3c1b1 by Jaxon

Merge remote-tracking branch 'origin/SAAS+V5.7.1' into feature/d-plus-list-product

# Conflicts:
#	jsconfig.json
#	package-lock.json
#	src/common/constants.js
#	src/router/modules/903_productManagement.js
#	src/views/goods/components/selectGoodsDialog.vue
#	src/views/goods/grounding/components/groundingForm.vue
#	src/views/goods/grounding/editGrounding.vue
#	src/views/goods/shelfManage/components/detailCon/FinanceConfig.vue
#	src/views/residentManage/salaryPerformance/performanceScheme/components/channelConfig/index.vue
2 parents 1583e2ad 7b04bbd8
Showing 171 changed files with 2658 additions and 1392 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
......@@ -4,6 +4,9 @@ node_modules
/.history
/cache
/copyDirTarget
.cursorrules
.cursor
.trae
# Log files
npm-debug.log*
......
......@@ -4247,6 +4247,27 @@
"whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"acorn-walk": {
"version": "8.2.0",
"resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz",
......@@ -4792,7 +4813,7 @@
},
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
......@@ -4805,7 +4826,7 @@
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
......
......@@ -55,7 +55,7 @@ export function baseGoodsUpOrDown(data) {
// 删除商品
export function baseGoodsDelete(data) {
data.method = `${path2}basegoods.delete`
return request(data, "post")
return request(data, "post", [], { useResponseMessage: true })
}
// 导出
......
......@@ -649,4 +649,13 @@ export function getStrategyRecordStaticByCondition (data = {}) {
export function getStrategyMerchantAnalysisIndexHistory (data = {}) {
data.method = "dj.api.strategy.merchant.analysis.index.history"
return request(data, RequestMethods.POST)
}
\ No newline at end of file
}
/**
* 招聘概况
*/
export function getRecruitmentDemandOverview (data = {}) {
data.method = "dj.staff.api.recruitment.demand.merchant.overview"
return request(data, RequestMethods.POST)
}
import request from "./request"
const path = "dj.api.smartcarlife."
import request from "./request";
const path = "dj.api.smartcarlife.";
// 获取上架管理 列表数据
export function getGroundingManageList(data) {
data.method = `${path}merchantGoodsInfo.page`
return request(data)
data.method = `${path}merchantGoodsInfo.page`;
return request(data);
}
// 获取上架商品详情
export function getMerchantGoodsInfo(data) {
data.method = `${path}merchantGoodsInfo.getById`
return request(data)
data.method = `${path}merchantGoodsInfo.getById`;
return request(data);
}
// 删除
export function delGroundingById(data) {
data.method = `${path}merchantGoodsInfo.deleteById`
return request(data)
data.method = `${path}merchantGoodsInfo.deleteById`;
return request(data);
}
// 批量审核
export function batchReviewAPI(data) {
data.method = `${path}merchantGoodsInfo.updateBatchWaitAudit`
return request(data, "post")
data.method = `${path}merchantGoodsInfo.updateBatchWaitAudit`;
return request(data, "post");
}
// 上下架
export function updateGoodsStatus(data) {
data.method = `${path}merchantGoodsInfo.updateStatus`
return request(data)
data.method = `${path}merchantGoodsInfo.updateStatus`;
return request(data);
}
// 添加编辑上架信息
export function addOrUpdateAPI(data) {
data.method = `${path}merchantGoodsInfo.insertOrUpdate`
return request(data, "post")
data.method = `${path}merchantGoodsInfo.insertOrUpdate`;
return request(data, "post");
}
// 获取门店开通的场景
export function getSceneTypeListByMerchantId(data) {
data.method = `${path}scenemerchantref.listScene`
return request(data)
data.method = `${path}scenemerchantref.listScene`;
return request(data);
}
// 获取类目商品两级选择框数据
export function getAllGroupByCategory(data) {
data.method = `${path}productManager.getAllGroupByCategory`
return request(data)
data.method = `${path}productManager.getAllGroupByCategory`;
return request(data);
}
// 获取所有上架商品
export function getAllGoodsList(data) {
data.method = `${path}productManager.search`
return request(data, "post")
data.method = `${path}productManager.search`;
return request(data, "post");
}
// 获取所有上架商品 替换新接口
// export function getAllGoodsListPage(data) {
......@@ -60,104 +61,128 @@ export function getAllGoodsList(data) {
// return request(data, "post")
// }
export function getAllGoodsListPage(data) {
data.method = `${path}productManager.search`
return request(data, "post")
data.method = `${path}productManager.search`;
return request(data, "post");
}
// 批量下架
export function batchUpdateStatus(data) {
data.method = `${path}merchantGoodsInfo.updateBatchOffShelf`
return request(data, "post")
data.method = `${path}merchantGoodsInfo.updateBatchOffShelf`;
return request(data, "post");
}
// 批量复制
export function batchUpdateBatchCopy(data) {
// data.method = `${path}merchantGoodsInfo.updateBatchCopy`
data.method = `${path}merchantGoodsInfo.addBatchCopy`
return request(data, "post")
// data.method = `${path}merchantGoodsInfo.updateBatchCopy`
data.method = `${path}merchantGoodsInfo.addBatchCopy`;
return request(data, "post");
}
// 校验上架记录中是否已存在
export function checkGroundingLog(data) {
data.method = `${path}merchantGoodsInfo.existsCount`
return request(data, "post")
data.method = `${path}merchantGoodsInfo.existsCount`;
return request(data, "post");
}
// 分页查询套餐管理记录
export function merchantPackageGoodsInfoPage(data) {
data.method = `${path}merchantPackageGoodsInfo.page`
return request(data, "post")
data.method = `${path}merchantPackageGoodsInfo.page`;
return request(data, "post");
}
// return request(data, 'post')
// }
// 批量设置是否校验最低价
export function batchSetValidMinSellPrice(data) {
data.method = `${path}merchantGoodsInfo.updateBatchValidMinSellPrice`
return request(data, "post")
data.method = `${path}merchantGoodsInfo.updateBatchValidMinSellPrice`;
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) {
data.method = `${path}merchantGoodsInfo.import`
return request(data, "post", ["file"])
data.method = `${path}merchantGoodsInfo.import`;
return request(data, "post", ["file"]);
}
// 采购上架 添加/修改记录
export function purchaseGoodsInfoInsertOrUpdate(data) {
data.method = `${path}purchaseGoodsInfo.insertOrUpdate`
return request(data, "post", ["file"])
data.method = `${path}purchaseGoodsInfo.insertOrUpdate`;
return request(data, "post", ["file"]);
}
// 删除记录
export function purchaseGoodsInfoDeleteById(data) {
data.method = `${path}purchaseGoodsInfo.deleteById`
return request(data, "post")
data.method = `${path}purchaseGoodsInfo.deleteById`;
return request(data, "post");
}
// 导出列表(异步)
export function purchaseGoodsInfoExportAsync(data) {
data.method = `${path}purchaseGoodsInfo.export.async`
return request(data, "post")
data.method = `${path}purchaseGoodsInfo.export.async`;
return request(data, "post");
}
// 根据ID查询详细信息
export function purchaseGoodsInfoGetById(data) {
data.method = `${path}purchaseGoodsInfo.getById`
return request(data, "post")
data.method = `${path}purchaseGoodsInfo.getById`;
return request(data, "post");
}
// 采购上架导入
export function purchaseGoodsInfoImport(data) {
data.method = `${path}purchaseGoodsInfo.import`
return request(data, "post", ["file"])
data.method = `${path}purchaseGoodsInfo.import`;
return request(data, "post", ["file"]);
}
// 分页查询上架管理记录
export function purchaseGoodsInfoPage(data) {
data.method = `${path}purchaseGoodsInfo.page`
return request(data, "post")
data.method = `${path}purchaseGoodsInfo.page`;
return request(data, "post");
}
// 采购上架导入模版
export function purchaseGoodsInfoTemplateExport(data) {
data.method = `${path}purchaseGoodsInfo.template.export`
return request(data, "post")
data.method = `${path}purchaseGoodsInfo.template.export`;
return request(data, "post");
}
// 批量下架操作
export function purchaseGoodsInfoUpdateBatchOffShelf(data) {
data.method = `${path}purchaseGoodsInfo.updateBatchOffShelf`
return request(data, "post")
data.method = `${path}purchaseGoodsInfo.updateBatchOffShelf`;
return request(data, "post");
}
// 批量审核
export function purchaseGoodsInfoUpdateBatchWaitAudit(data) {
data.method = `${path}purchaseGoodsInfo.updateBatchWaitAudit`
return request(data, "post")
data.method = `${path}purchaseGoodsInfo.updateBatchWaitAudit`;
return request(data, "post");
}
// 上下架操作
export function purchaseGoodsInfoUpdateStatus(data) {
data.method = `${path}purchaseGoodsInfo.updateStatus`
return request(data, "post")
data.method = `${path}purchaseGoodsInfo.updateStatus`;
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");
}
......@@ -36,3 +36,21 @@ export function delPackageById(data) {
data.method = `${path}merchantPackageGoodsInfo.deleteById`
return request(data)
}
// 根据套餐ID列表查询套餐下商品信息
export function getGoodsByPackageIdList(data) {
data.method = `${path}merchantPackageGoodsInfo.getGoodsByPackageIdList`
return request(data, "post")
}
// 根据套餐ID列表查询套餐关联商户列表
export function queryRelatedMerchantByPackageIdList(data) {
data.method = `${path}merchantPackageGoodsInfo.queryRelatedMerchantByPackageIdList`
return request(data, "post")
}
// 批量修改套餐库存管控模式
export function batchEditInventoryTypeByPackageId(data) {
data.method = `${path}merchantPackageGoodsInfo.batchEditInventoryTypeByPackageId`
return request(data, "post")
}
import request from "./request"
import request from "./request";
// const path = 'dj.api.'
const path2 = "dj.api.smartcarlife."
const path2 = "dj.api.smartcarlife.";
/** 积分管理-积分审批列表*/
/** 积分管理-积分审批列表 */
export function getList(data) {
data.method = `${path2}staff.motivation.page`
return request(data)
data.method = `${path2}staff.motivation.page`;
return request(data);
}
/** 积分管理-积分审批*/
/** 积分管理-积分审批 */
export function pointCheck(data) {
data.method = `${path2}staff.motivation.audit`
return request(data)
data.method = `${path2}staff.motivation.audit`;
return request(data);
}
/**积分管理-积分审批列表导出*/
/** 积分管理-积分审批列表导出 */
export function exportFile(data) {
data.method = `${path2}staff.motivation.list.export`
return request(data)
data.method = `${path2}staff.motivation.list.export`;
return request(data);
}
/**积分管理-积分审批详情*/
/** 积分管理-积分审批详情 */
export function getPointDetail(data) {
data.method = `${path2}staff.motivation.detail`
return request(data)
data.method = `${path2}staff.motivation.detail`;
return request(data);
}
/**积分管理-积分明细列表*/
/** 积分管理-积分明细列表 */
export function getScorePage(data) {
data.method = `${path2}staff.score.page`
return request(data)
data.method = `${path2}staff.score.page`;
return request(data);
}
/**积分管理-积分明细列表导出*/
/** 积分管理-积分明细列表导出 */
export function exportScore(data) {
data.method = `${path2}staff.score.export`
return request(data)
data.method = `${path2}staff.score.export`;
return request(data);
}
// 积分管理-积分明细收益列表
export function getDetailList(data) {
data.method = `${path2}staff.score.detail.list`
return request(data)
data.method = `${path2}staff.score.detail.list`;
return request(data);
}
// 积分管理-积分明细收益列表导出
export function exportDetailScore(data) {
data.method = `${path2}staff.score.detail.list.export`
return request(data)
data.method = `${path2}staff.score.detail.list.export`;
return request(data);
}
// 积分管理-积分明细收益记录详情
export function getScoreDetail(data) {
data.method = `${path2}staff.score.detail`
return request(data)
data.method = `${path2}staff.score.detail`;
return request(data);
}
export function getShopMerchantList(data) {
data.method = `dj.smartcarlife.api.shopMerchant.list`
return request(data, "post")
data.method = `dj.smartcarlife.api.shopMerchant.list`;
return request(data, "post");
}
//订单阳光激励标记退款
// 订单阳光激励标记退款
export function markAsRefunded(data) {
data.method = `dj.api.smartcarlife.goodsOrder.points.markAsRefunded`
return request(data)
data.method = `dj.api.smartcarlife.goodsOrder.points.markAsRefunded`;
return request(data);
}
//积分管理-手动抵扣
// 积分管理-手动抵扣
export function manualDeduct(data) {
data.method = `dj.api.smartcarlife.staff.score.manual.deduct`
return request(data)
data.method = `dj.api.smartcarlife.staff.score.manual.deduct`;
return request(data);
}
// 查询可手动抵扣的订单列表
export function deductOrderPage(data) {
data.method = `dj.api.smartcarlife.merchant.score.deduct.order.page`
return request(data)
data.method = `dj.api.smartcarlife.merchant.score.deduct.order.page`;
return request(data);
}
// 积分管理-撤销抵扣【参数:scoreId(必传)、remark、orderCode】
export function cancelDeduct(data) {
data.method = `dj.api.smartcarlife.staff.score.cancel.deduct`
return request(data)
data.method = `dj.api.smartcarlife.staff.score.cancel.deduct`;
return request(data);
}
// 积分审批列表同步
export function refreshData(data) {
data.method = `dj.api.smartcarlife.staff.motivation.page.sync`
return request(data)
data.method = `dj.api.smartcarlife.staff.motivation.page.sync`;
return request(data);
}
//查询指定订单的操作记录
// 查询指定订单的操作记录
export function getOperationRecord(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.operation`
return request(data)
data.method = `dj.api.smartcarlife.staff.motivation.order.operation`;
return request(data);
}
//根据订单号查询剩余积分
// 根据订单号查询剩余积分
// export function getScoreByscore(data) {
// data.method = `dj.api.smartcarlife.staff.motivation.order.score`
// return request(data)
// }
//获取到总积分
// 获取到总积分
export function getOrderByScore(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.score`
return request(data)
data.method = `dj.api.smartcarlife.staff.motivation.order.score`;
return request(data);
}
/** 积分退款订单详情查询 */
export function getGoodsSubOrder(data) {
data.method = 'dj.api.smartcarlife.goodsOrder.goodsSubOrder.list'
return request(data)
}
\ No newline at end of file
data.method = "dj.api.smartcarlife.goodsOrder.goodsSubOrder.list";
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"
const path = 'dj.api.smartcarlife.'
import request from "./request";
const path = "dj.api.smartcarlife.";
// 获取产品管理 列表数据
export function getProductManageList(data) {
data.method = `${path}productManager.page`
return request(data)
data.method = `${path}productManager.page`;
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) {
data.method = `${path}productManager.add`
return request(data, 'post')
const requestData = {
method: `${path}productManager.add`,
requestJson: JSON.stringify(data),
};
return request(requestData, "post");
}
// 编辑产品
// 编辑产品:所有参数转 json 字符串赋值到 requestJson
export function UpdateProductManage(data) {
data.method = `${path}productManager.update`
return request(data, 'post')
const requestData = {
method: `${path}productManager.update`,
requestJson: JSON.stringify(data),
};
return request(requestData, "post");
}
// 获取权益/升级类目服务项目
export function getProductServiceItems(data) {
data.method = `${path}vd.item.queryServiceItemsGradeConfig`
return request(data, 'post')
data.method = `${path}vd.item.queryServiceItemsGradeConfig`;
return request(data, "post");
}
// 批量导入
// 批量导入(通用,已拆分为轻改/延保)
export function productImport(data) {
data.method = `${path}productManager.import`
return request(data, 'post', ["file"])
data.method = `${path}productManager.import`;
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) {
data.method = `${path}vd.item.queryExtendServiceItemsConfig`
return request(data, 'post')
data.method = `${path}vd.item.queryExtendServiceItemsConfig`;
return request(data, "post");
}
// 获取延保类服务项目部件列表
export function getExtendServiceItemsParts(data) {
data.method = `${path}vd.item.getExtendUnitList`
return request(data, 'post')
data.method = `${path}vd.item.getExtendUnitList`;
return request(data, "post");
}
// 获取适用车系列表
export function getCarSeriesList(data) {
data.method = `${path}common.car.series.page`
return request(data, 'post')
data.method = `${path}common.car.series.page`;
return request(data, "post");
}
// 分页获取上架商品所需的升级商品信息
export function getUpgradeProductList(data) {
data.method = `${path}productManager.listUpgradeGoodsWithPage`
return request(data, 'post')
data.method = `${path}productManager.listUpgradeGoodsWithPage`;
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", [], { useResponseMessage: true });
}
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2026-03-30 17:36:59
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-04-01 16:58:21
* @FilePath: \dj-car-life-system\src\api\recruitment.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 招聘管理
import request from "./request"
import request from "./request";
// 招聘需求分页查询
export function getRecruitmentList(data) {
data.method = `dj.staff.api.recruitment.demand.page`
return request(data)
data.method = `dj.staff.api.recruitment.demand.page`;
return request(data);
}
// 新增招聘需求
export function addRecruitment(data) {
data.method = `dj.staff.api.recruitment.demand.add`
return request(data)
data.method = `dj.staff.api.recruitment.demand.add`;
return request(data);
}
// 招聘需求详情
export function getRecruitmentDetail(data) {
data.method = `dj.staff.api.recruitment.demand.detail`
return request(data)
data.method = `dj.staff.api.recruitment.demand.detail`;
return request(data);
}
// 处理招聘需求
export function handleRecruitment(data) {
data.method = `dj.staff.api.recruitment.demand.process`
return request(data)
data.method = `dj.staff.api.recruitment.demand.process`;
return request(data);
}
// 招聘需求状态更新(确认、驳回、完成)
export function updateRecruitmentStatus(data) {
data.method = `dj.staff.api.recruitment.demand.status.update`
return request(data)
data.method = `dj.staff.api.recruitment.demand.status.update`;
return request(data);
}
// 招聘需求汇总
export function getRecruitmentSummary(data = {}) {
data.method = `dj.staff.api.recruitment.demand.summary`
return request(data)
data.method = `dj.staff.api.recruitment.demand.summary`;
return request(data);
}
// 门店(d+系统中的全部门店+园区店商户)列表查询
export function getDemandMerchant(data) {
data.method = `dj.staff.api.recruitment.demand.merchant.page`
return request(data)
data.method = `dj.staff.api.recruitment.demand.merchant.page`;
return request(data);
}
// 新增字典项
export function addDict(data) {
data.method = `dj.staff.api.dict.add`
return request(data)
data.method = `dj.staff.api.dict.add`;
return request(data);
}
// 删除字典项
export function deleteDict(data) {
data.method = `dj.staff.api.dict.delete`
return request(data)
data.method = `dj.staff.api.dict.delete`;
return request(data);
}
// 分页查询字典项列表
export function getDictList(data) {
data.pageSize = 99999
data.currentPage = 1
data.method = `dj.staff.api.dict.page`
return request(data)
data.pageSize = 99999;
data.currentPage = 1;
data.method = `dj.staff.api.dict.page`;
return request(data);
}
// 修改字典项
export function updateDict(data) {
data.method = `dj.staff.api.dict.update`
return request(data)
data.method = `dj.staff.api.dict.update`;
return request(data);
}
// 批量变更招聘需求
export function batchUpdateRecruitment(data) {
data.method = `dj.staff.api.recruitment.demand.batch.update`;
return request(data);
}
// 关联招聘需求
export function associateRecruitmentDemand(data) {
data.method = `dj.staff.api.recruitment.demand.relate`;
return request(data);
}
// 招聘需求批量变更
export function batchChangeRecruitment(data) {
data.method = `dj.staff.api.recruitment.demand.batch.change`;
return request(data);
}
// 单店信息督导和员工查询
export function findMerchantStaffList(data) {
// data.method = `${path2}workbench.findMerchantStaffList`
data.method = `dj.api.smartcarlife.workbench.findMerchantStaffFilterList`;
return request(data);
}
// 招聘需求关联系统门店
export function linkMerchant(data) {
data.method = `dj.staff.api.recruitment.demand.link.merchant`;
return request(data);
}
\ No newline at end of file
......@@ -5,135 +5,135 @@
* @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/index_code"
import sign from "./sign"
import RequestMethods from "./request.methods"
import util from "@/libs/util.js"
import { baseConfig } from "@/main"
import axiosPackage from "axios"
const request = (
params = {},
method = RequestMethods.GET,
noSignAttr = [],
options = {}
) => {
// 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = ""
if (params.method.includes("dj.api.smartcarlife")) {
apiName = "dj"
} else if (params.method.includes("dj.api.script")) {
apiName = "script"
} else if (params.method.includes("dj.staff.api")) {
apiName = "staff"
} else if (params.method.includes("dj.smartcarlife.stock")) {
apiName = "dj.smartcarlife"
} else if (params.method.includes("risk.manage.api")) {
apiName = "riskmanage"
} else if (params.method.includes("dj.api.strategy")) {
apiName = "strategy"
} else {
// console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0]
}
import axios from "@/plugin/axios/index_code";
import RequestMethods from "./request.methods";
import sign from "./sign";
// console.log("params.method", params.method)
// console.log("apiName", apiName)
// 为空报错
if (!apiName) {
throw new Error("apiName is null")
}
const mappingName = {
"dj.smartcarlife": "axios",
dj: "axios",
scrm: "axios2",
merchants: "axios3",
reportExport: "axios4",
"glsx.accounts.biz.common.pictureUpload": "common",
clue: "axios5",
"dj.businessSchool": "axios6",
script: "axios7",
staff: "axios9",
riskmanage: "axios10",
strategy: 'axios_strategy'
}
const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey
if (baseApiName == "common") {
params.app_key = baseConfig[baseApiName].appkey
} else {
params.appKey = baseConfig[baseApiName].appkey
}
// console.log("params.appKey", params.appKey)
params.timestamp = new Date().getTime()
params.v = "1.0.0"
params.format = "json"
params.locale = "zh_CN"
if (params.method !== "dj.api.user.login") {
params.sessionId = util.cookies.get("token")
}
/**
* mock - url = params.method
* 调后端接口 - url = ''
*/
const url = baseConfig[baseApiName].baseURL
// const url = "/api"
/**
* 调后端接口,请使用以下代码。
*/
const signWay = {
"dj.smartcarlife": "sha1",
dj: "sha1",
scrm: "sha1",
glsx: "md5",
"glsx.accounts.biz.common.pictureUpload": "md5",
clue: "sha1",
script: "sha1",
staff: "sha1",
riskmanage: 'sha1'
}
// console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret
const CancelToken = axiosPackage.CancelToken
var reqData =
method === RequestMethods.POST
? {
baseURL: "/",
data: sign(params, noSignAttr, secret, signWay[apiName])
}
: { params: sign(params, noSignAttr, secret, signWay[apiName]) }
function request(params = {}, method = RequestMethods.GET, noSignAttr = [], options = {}) {
// 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = "";
if (params.method.includes("dj.api.smartcarlife")) {
apiName = "dj";
} else if (params.method.includes("dj.api.script")) {
apiName = "script";
} else if (params.method.includes("dj.staff.api")) {
apiName = "staff";
} else if (params.method.includes("dj.smartcarlife.stock")) {
apiName = "dj.smartcarlife";
} else if (params.method.includes("risk.manage.api")) {
apiName = "riskmanage";
} else if (params.method.includes("dj.api.strategy")) {
apiName = "strategy";
} else if (params.method.includes("dj.api.supervisor")) {
apiName = "supervisor";
} else {
// console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0];
}
reqData = Object.assign(reqData, options, {})
// 请求进度
if (params?.onProcess) {
reqData.onUploadProgress = params.onProcess
}
// 取消请求
if (params?.cancelFun) {
reqData.cancelToken = new CancelToken(function excutor (c) {
params.cancelFun.cancel = c
})
}
// console.log(method === RequestMethods.POST)
// console.log(url)
// console.log(options)
// console.log(reqData)
let axiosParams = {
url,
method,
...reqData
}
if (options.returnAll) axiosParams.headers = { 'return-all': true }
return axios(axiosParams)
// console.log("params.method", params.method)
// console.log("apiName", apiName)
// 为空报错
if (!apiName) {
throw new Error("apiName is null");
}
const mappingName = {
"dj.smartcarlife": "axios",
"dj": "axios",
"scrm": "axios2",
"merchants": "axios3",
"reportExport": "axios4",
"glsx.accounts.biz.common.pictureUpload": "common",
"clue": "axios5",
"dj.businessSchool": "axios6",
"script": "axios7",
"staff": "axios9",
"riskmanage": "axios10",
"strategy": "axios_strategy",
"supervisor": "axios_supervisor",
};
const baseApiName = mappingName[apiName];
// console.log(baseApiName, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey
if (baseApiName == "common") {
params.app_key = baseConfig[baseApiName].appkey;
} else {
params.appKey = baseConfig[baseApiName].appkey;
}
// console.log("params.appKey", params.appKey)
params.timestamp = new Date().getTime();
params.v = "1.0.0";
params.format = "json";
params.locale = "zh_CN";
if (params.method !== "dj.api.user.login") {
params.sessionId = util.cookies.get("token");
}
/**
* mock - url = params.method
* 调后端接口 - url = ''
*/
const url = baseConfig[baseApiName].baseURL;
// const url = "/api"
/**
* 调后端接口,请使用以下代码。
*/
const signWay = {
"dj.smartcarlife": "sha1",
"dj": "sha1",
"scrm": "sha1",
"glsx": "md5",
"glsx.accounts.biz.common.pictureUpload": "md5",
"clue": "sha1",
"script": "sha1",
"staff": "sha1",
"riskmanage": "sha1",
};
// console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret;
const CancelToken = axiosPackage.CancelToken;
let reqData
= method === RequestMethods.POST
? {
baseURL: "/",
data: sign(params, noSignAttr, secret, signWay[apiName]),
}
: { params: sign(params, noSignAttr, secret, signWay[apiName]) };
/**
* mock,请使用以下代码。
*/
// return axios({
// url,
// method,
// params: sign(params, noSignAttr)
// })
reqData = Object.assign(reqData, options, {});
// 请求进度
if (params?.onProcess) {
reqData.onUploadProgress = params.onProcess;
}
// 取消请求
if (params?.cancelFun) {
reqData.cancelToken = new CancelToken((c) => {
params.cancelFun.cancel = c;
});
}
// console.log(method === RequestMethods.POST)
// console.log(url)
// console.log(options)
// console.log(reqData)
let axiosParams = {
url,
method,
...reqData,
};
if (options.returnAll)
axiosParams.headers = { "return-all": true };
return axios(axiosParams);
/**
* mock,请使用以下代码。
*/
// return axios({
// url,
// method,
// params: sign(params, noSignAttr)
// })
}
export default request
export default request;
......@@ -689,3 +689,101 @@ export function getCommissionListApi(data = {}) {
data.method = "dj.staff.api.staff.performance.commission.list";
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 getSupervisorDetailSummaryApi(data = {}) {
data.method = "dj.api.supervisor.manage.detail.summary";
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");
}
......@@ -34,6 +34,18 @@ export function merchantSettleDistributeRuleLastRule(data) {
data.method = `dj.api.create.business.approve.detail.rule`;
return request(data);
}
// 保存财务分账规则
export function merchantSettleDistributeRule(data) {
data.method = `dj.api.serviceMerchant.merchantSettleDistributeRule.save`
return request(data, RequestMethods.POST)
}
// 获取嘀加智慧云子商户信息
export function getDjzhySubMerchant(data) {
data.method = `dj.api.serviceMerchant.merchantDivisionRule.djzhySubMerchant`
return request(data)
}
// 获取不同场景的商品分类
export function getGoodsCategoryConfiguration(data) {
data.currentPage = 1;
......
......@@ -16,6 +16,33 @@ export const BaseData = {
positionTypeList: "positionTypeList", // 太阳膜商品部位
extendedPosiTypeList: "extendedPosiTypeList", // 延保类商品部位
};
extendedPosiTypeList: "extendedPosiTypeList", // 延保类商品部位
};
/** 计价单位选项 1-把、2-本、3-对、4-个、5-根、6-盒、7-件、8-卷、9-块、10-辆、11-米、12-克、13-升、14-双、15-台、16-套、17-条、18-桶、19-位、20-页、21-张 */
export const priceUnitTypeList = [
{ value: 1, label: "把" },
{ value: 2, label: "本" },
{ value: 3, label: "对" },
{ value: 4, label: "个" },
{ value: 5, label: "根" },
{ value: 6, label: "盒" },
{ value: 7, label: "件" },
{ value: 8, label: "卷" },
{ value: 9, label: "块" },
{ value: 10, label: "辆" },
{ value: 11, label: "米" },
{ value: 12, label: "克" },
{ value: 13, label: "升" },
{ value: 14, label: "双" },
{ value: 15, label: "台" },
{ value: 16, label: "套" },
{ value: 17, label: "条" },
{ value: 18, label: "桶" },
{ value: 19, label: "位" },
{ value: 20, label: "页" },
{ value: 21, label: "张" },
];
/**
* 超级管理员类型
......@@ -908,6 +935,10 @@ export const downloadReportManage_reportType = [
confId: "salesDailyMonthlySummaryTable",
confValue: "销售日报月汇总表",
},
{
confId: "BIAnalysisReport",
confValue: "BI数据分析表",
},
];
// 下载报表 业务类型
......@@ -1881,7 +1912,7 @@ export const auditStatusMap = {
};
export const discountTypeMap = {
1: "比例折扣",
1: "折扣比例",
2: "折扣金额",
3: "无折扣",
4: "赠品",
......@@ -1951,3 +1982,69 @@ export const contractOrgOpt = [
{ confId: "hzglsk", confValue: "惠州广联" },
{ confId: "szyjzh", confValue: "优加" },
];
// 督导任务类型
export const superviseTaskTypeOpt = [
{
confName: "录音复盘",
confId: 3,
},
{
confName: "人员带教",
confId: 5,
},
{
confName: "督导日报",
confId: 0,
},
{
confName: "本周复盘",
confId: 1,
},
{
confName: "督导月度计划",
confId: 2,
},
{
confName: "专项任务",
confId: 4,
},
];
export const reviewCaseStatusOpt = [
{
confId: 0,
confValue: "待审核",
},
{
confId: 1,
confValue: "已通过",
},
{
confId: 2,
confValue: "已驳回",
},
];
export const reviewCaseStatusOptMap = {
0: "#FF9D0A",
1: "#2CCA74",
2: "#EB4E4E",
};
export const connectionFlagOpt = [
{
confId: 1,
confValue: "已关联",
},
{
confId: 0,
confValue: "未关联",
},
];
export const connectionFlagOptMap = {
true: "#2CCA74",
false: "#EB4E4E",
};
export const changeTypeOpt = [
{ confId: 1, confValue: "区域运营" },
{ confId: 2, confValue: "技师督导" },
{ confId: 3, confValue: "招聘负责人" },
{ confId: 4, confValue: "创建人" }
];
......@@ -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号‌:允许选择当前月份和上个月;其他情况‌:禁用所有其他月份‌
*/
......
<!-- 文件导入弹框通用组件 -->
<template>
<d2-dialog :is-visible="isVisible"
:title="title"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<el-form ref="fileFormRef"
label-width="120px"
:model="form"
:rules="rules">
<slot name="prepend" />
<el-form-item :label="formItemLabel"
prop="fileName">
<el-col :span="16">
<el-input v-model="form.fileName"
readonly />
<slot name="tip" />
</el-col>
<el-col class="m-l-md"
:span="4">
<el-button class="import-btn">
导入文件
<input ref="fileInput"
:accept="accept"
class="import-input"
type="file"
@change="onFileChange"
@click="$event.target.value = null">
<el-link class="import-template"
icon="el-icon-link"
type="primary"
@click="$emit('downloadTemplate')">
{{ templateName }}
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</d2-dialog>
</template>
<script>
export default {
name: "D2FileImportDialog",
props: {
isVisible: {
type: Boolean,
default: false,
},
title: {
type: String,
default: "批量导入",
},
accept: {
type: String,
default: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",
},
maxSize: {
type: Number,
default: 9,
},
templateName: {
type: String,
default: "模版下载",
},
formItemLabel: {
type: String,
default: "导入文件:",
},
},
data() {
return {
form: { fileName: "" },
fileData: null,
rules: {
fileName: [{ required: true, message: "请上传文件", trigger: "change" }],
},
};
},
watch: {
isVisible(val) {
if (!val) {
this.resetForm();
}
},
},
methods: {
resetForm() {
this.$refs.fileFormRef && this.$refs.fileFormRef.resetFields();
this.fileData = null;
if (this.$refs.fileInput) {
this.$refs.fileInput.value = "";
}
},
handleClose() {
this.resetForm();
this.$emit("closeDialog");
},
handleConfirm() {
this.$refs.fileFormRef.validate((valid) => {
if (valid && this.fileData) {
this.$emit("confirmDialog", {
fileName: this.form.fileName,
fileData: this.fileData,
});
}
});
},
onFileChange(e) {
if (!e.target.files || !e.target.files[0])
return;
const file = e.target.files[0];
const size = file.size / 1024 / 1024;
e.target.value = "";
if (size < this.maxSize) {
this.form.fileName = file.name;
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = (event) => {
const imgFile = event.target.result;
const arrBase64 = imgFile.split(",");
const ext = file.name.split(".").pop();
this.fileData = ext + "@" + arrBase64[1];
};
} else {
this.notice.errorTips(`上传文件不可超过${this.maxSize}M`);
}
},
},
};
</script>
<style scoped>
.m-l-md {
margin-left: 20px;
}
.import-btn {
position: relative;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.import-template {
position: absolute;
height: 20px;
top: 50px;
left: 0;
}
</style>
<!-- 通用表单弹窗组件 -->
<template>
<div class="glsk-form-dialog">
<d2-dialog
:title="dialogConfig.title"
:is-visible="selectVisible"
:width="dialogWidth"
:btn-ok-label="dialogConfig.okText"
@closeDialog="handleClose"
:appendToBody="appendToBody"
@confirmDialog="handleConfirm"
>
<glsx-combi-form
class="edit-form-container"
ref="editFormRef"
:label-width="labelWidth"
:default-width="defaultWidth"
:is-block="isBlock"
:form-ref="editChildRef"
:form-obj="editData"
:form-data="editFormData"
:form-rules="formRules"
@handleAddSelectTypeConfirm="handleAddSelectTypeConfirm"
@handleEditSelectTypeConfirm="handleEditSelectTypeConfirm"
>
<template v-for="name in slotArr" #[name]>
<slot :name="name"></slot>
</template>
</glsx-combi-form>
</d2-dialog>
</div>
<div class="glsk-form-dialog">
<d2-dialog :append-to-body="appendToBody"
:btn-ok-label="dialogConfig.okText"
:is-visible="selectVisible"
:title="dialogConfig.title"
:width="dialogWidth"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<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"
@handleAddSelectTypeConfirm="handleAddSelectTypeConfirm"
@handleEditSelectTypeConfirm="handleEditSelectTypeConfirm">
<template v-for="name in slotArr" #[name]>
<slot :name="name"></slot>
</template>
</glsx-combi-form>
</d2-dialog>
</div>
</template>
<script>
import { deepClone } from "@/common/util"
import { deepClone } from "@/common/util";
export default {
name: "GlskFormDialog",
data() {
return {
isBlock: true,
editChildRef: "editChildRef"
}
},
name: "GlskFormDialog",
props: {
slotArr: {
type: Array,
default: () => ["resumeUrlHtml"]
},
dialogWidth: {
type: String,
default: "700px"
},
labelWidth: {
type: String,
default: "100px"
},
defaultWidth: {
type: String,
default: "314px"
},
dialogConfig: {
type: Object,
default: () => {
return {
title: "提示",
okText: "确定"
}
}
},
selectVisible: {
type: Boolean,
default: false
},
formRules: {
type: Object,
default: () => ({})
},
editData: {
type: Object,
default: () => ({})
},
editFormData: {
type: Array,
default: () => []
},
baseData: {
type: Object,
default: () => ({})
},
appendToBody: {
type: Boolean,
default: false
}
},
props: {
slotArr: {
type: Array,
default: () => ["resumeUrlHtml"],
},
dialogWidth: {
type: String,
default: "700px",
},
labelWidth: {
type: String,
default: "100px",
},
defaultWidth: {
type: String,
default: "314px",
},
dialogConfig: {
type: Object,
default: () => {
return {
title: "提示",
okText: "确定",
};
},
},
selectVisible: {
type: Boolean,
default: false,
},
formRules: {
type: Object,
default: () => ({}),
},
editData: {
type: Object,
default: () => ({}),
},
editFormData: {
type: Array,
default: () => [],
},
baseData: {
type: Object,
default: () => ({}),
},
appendToBody: {
type: Boolean,
default: false,
},
},
data() {
return {
isBlock: true,
editChildRef: "editChildRef",
};
},
mounted() {
this.getOptionsList("editFormData", false)
},
mounted() {
this.getOptionsList("editFormData", false);
},
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find((k) => k.name == refreshSigle)
var index = this[formName].findIndex((k) => k.name == refreshSigle)
this.$set(
this[formName][index],
"optionList",
deepClone(this.baseData[item.optionsName])
)
if (
hasAll &&
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this[formName][index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this[formName][index].optionId] = ""
temp[this[formName][index].optionLabel] = "全部"
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (
["select", "radio"].includes(item.type) &&
this.baseData[item.optionsName].length
) {
this.$set(
this[formName][index],
"optionList",
deepClone(this.baseData[item.optionsName])
)
if (
hasAll &&
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this[formName][index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this[formName][index].optionId] = ""
temp[this[formName][index].optionLabel] = "全部"
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleConfirm() {
console.log(this.editFormData, this.editData)
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
this.$emit("handleConfirm", this.editData)
}
})
},
handleAddSelectTypeConfirm(data) {
this.$emit("handleAddSelectTypeConfirm", data)
},
handleEditSelectTypeConfirm(data) {
this.$emit("handleEditSelectTypeConfirm", data)
},
handleClose() {
this.$emit("handleClose")
}
}
}
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
let item = this[formName].find(k => k.name == refreshSigle);
let index = this[formName].findIndex(k => k.name == refreshSigle);
this.$set(
this[formName][index],
"optionList",
deepClone(this.baseData[item.optionsName]),
);
if (
hasAll
&& this.baseData[item.optionsName].length
&& this.baseData[item.optionsName][0][
this[formName][index].optionLabel
] !== "全部"
) {
const temp = {};
temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp);
}
} else {
this[formName].forEach((item, index) => {
if (
["select", "radio"].includes(item.type)
&& this.baseData[item.optionsName].length
) {
this.$set(
this[formName][index],
"optionList",
deepClone(this.baseData[item.optionsName]),
);
if (
hasAll
&& this.baseData[item.optionsName].length
&& this.baseData[item.optionsName][0][
this[formName][index].optionLabel
] !== "全部"
) {
const temp = {};
temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp);
}
}
});
}
},
handleConfirm() {
console.log(this.editFormData, this.editData);
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
this.$emit("handleConfirm", this.editData);
}
});
},
handleAddSelectTypeConfirm(data) {
this.$emit("handleAddSelectTypeConfirm", data);
},
handleEditSelectTypeConfirm(data) {
this.$emit("handleEditSelectTypeConfirm", data);
},
handleClose() {
this.$emit("handleClose");
},
},
};
</script>
<style lang="scss" scoped>
.glsk-form-dialog {
::v-deep {
.el-dialog__header {
border-bottom: 1px solid #e5e5e5 !important;
}
}
::v-deep {
.el-dialog__footer {
border-top: 1px solid #e5e5e5 !important;
.el-button {
width: 80px;
}
}
}
::v-deep {
.el-dialog__header {
border-bottom: 1px solid #e5e5e5 !important;
}
}
::v-deep {
.el-dialog__footer {
border-top: 1px solid #e5e5e5 !important;
.el-button {
width: 80px;
}
}
}
}
</style>
......@@ -19,6 +19,7 @@ Vue.component("D2IconSvg", () => import("./d2-icon-svg/index.vue"))
Vue.component("D2TableHeader", () => import("./d2-table-header/index.vue"))
Vue.component("D2Table", () => import("./d2-table/index.vue"))
Vue.component("D2Dialog", () => import("./d2-dialog/index.vue"))
Vue.component("D2FileImportDialog", () => import("./d2-file-import-dialog/index.vue"))
Vue.component("D2Form", () => import("./d2-form/index.vue"))
Vue.component("D2Search", () => import("./d2-search/index.vue"))
Vue.component("RelateStoreDialog", () =>
......
......@@ -120,9 +120,11 @@ service.interceptors.response.use(
// }
const dataAxios = response.data;
const ruleResult = baseConfig.axios.result;
const errCodeMsg = baseConfig.errCode;
const errCodeMsg = baseConfig.errCode || {};
const errCodes = Object.keys(errCodeMsg);
const returnAll = response.config.headers["return-all"];
// 请求级配置:为 true 时,code 为 -1 直接使用响应的 message,不查 errCode 配置
const useResponseMessage = response.config.useResponseMessage;
// console.log("baseConfig", baseConfig)
// console.log("response", response)
......@@ -150,17 +152,20 @@ service.interceptors.response.use(
case ruleResult.code_error_value:
// [ 示例 ] code === -1 代表需将返回的message弹窗展示
return errorCreate(`${dataAxios[ruleResult.message_key]}`);
default:
default: {
// 不是正确的 code
// console.log(dataAxios)
// errorCreate(`${dataAxios[ruleResult.message_key]}`)
// 请求配置 useResponseMessage 时:code 为 -1 直接使用响应的 message
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])) {
return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`);
} else {
// 返回约定定义之外的错误码直接取message
return errorCreate(`${dataAxios[ruleResult.message_key]}`);
}
break;
// 返回约定定义之外的错误码直接取message
return errorCreate(`${dataAxios[ruleResult.message_key]}`);
}
}
},
......
......@@ -61,13 +61,14 @@ export const routerName = {
label: "删除",
handle: "handleDelete",
},
{ authId: "9030707", parentId: "90307", label: "批量导入轻改SKU", category: "Button", type: "primary", handle: "handleBatchImport" },
{
authId: "9030707",
authId: "9030709",
parentId: "90307",
label: "批量导入",
label: "批量导入延保SKU",
category: "Button",
type: "primary",
handle: "handleBatchImport",
handle: "handleBatchImportExtension",
},
{
authId: "9030708",
......@@ -205,6 +206,14 @@ export const routerName = {
type: "primary",
handle: "handleBatchImport",
},
{
authId: "9030912",
parentId: "90309",
label: "批量修改库存模式",
category: "Button",
type: "primary",
handle: "handleBatchModifyInventory",
},
],
component: _import("goods/grounding/index"),
},
......@@ -402,6 +411,14 @@ export const routerName = {
category: "Button",
handle: "handleExport",
},
{
authId: "9031211",
parentId: "90312",
label: "批量修改库存模式",
category: "Button",
type: "primary",
handle: "handleBatchModifyInventory",
},
],
component: _import("goods/packageManage/index"),
},
......
......@@ -6,156 +6,184 @@
* @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
*/
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
const _import = require("@/libs/util.import." + process.env.NODE_ENV);
export const routerName = {
907: {
path: "/index",
name: "index",
meta: {
title: "总览",
authId: "907",
parentId: "1",
icon: "s-home",
cache: false,
sideHidden: false
},
auth: [
{
authId: "90701",
parentId: "907",
label: "报表模块"
},
{
authId: "90702",
parentId: "907",
category: "Button",
label: "查看企微推送对象",
addRoutePath: [
{
authId: "90703",
name: "企微推送配置",
parentId: "907"
}
]
},
// {
// authId: "90705",
// parentId: "907",
// category: "Button",
// label: "编辑单店信息"
// },
{
authId: "90706",
parentId: "907",
category: "Button",
type: "primary",
label: "导出日报",
handle: "exportDailyReport"
},
{
authId: "90707",
parentId: "907",
category: "Button",
label: "渗透率报表",
addRoutePath: [
{
authId: "90704",
name: "渗透率报表",
parentId: "907"
}
]
},
{
authId: "90708",
parentId: "907",
category: "Button",
handle: "handleOutputImport",
label: "导入"
}
],
component: _import("index")
},
90703: {
path: "/outputValue",
name: "outputValue",
meta: {
title: "企微推送对象",
authId: "90703",
parentId: "907",
cache: false,
sideHidden: true,
activePath: "/index"
},
auth: [
{
authId: "9070301",
parentId: "90703",
label: "新增",
icon: "plus",
category: "Button",
type: "primary",
handle: "handleAdd"
},
{
authId: "9070303",
parentId: "90703",
label: "导入",
category: "Button",
handle: "handleImport"
},
{
authId: "9070302",
parentId: "90703",
label: "编辑",
handle: "handleEdit"
},
{
authId: "9070304",
parentId: "90703",
label: "删除",
handle: "handleDelete"
}
],
component: _import("index/outputValue")
},
90704: {
path: "/permeation",
name: "permeation",
meta: {
title: "渗透率报表",
authId: "90704",
parentId: "907",
cache: false,
sideHidden: true,
activePath: "/index"
},
auth: [
{
authId: "9070401",
parentId: "90704",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
// 新车交付率导出
{
authId: "9070402",
parentId: "90704",
label: "导出",
category: "Button",
type: "primary",
handle: "handleDetailExport"
},
{
authId: "9070403",
parentId: "90704",
label: "日报导出",
category: "Button",
type: "primary",
handle: "handleDailyExport"
}
],
component: _import("index/permeation")
}
}
907: {
path: "/index",
name: "index",
meta: {
title: "总览",
authId: "907",
parentId: "1",
icon: "s-home",
cache: false,
sideHidden: false,
},
auth: [
{
authId: "90701",
parentId: "907",
label: "报表模块",
},
{
authId: "90702",
parentId: "907",
category: "Button",
label: "查看企微推送对象",
addRoutePath: [
{
authId: "90703",
name: "企微推送配置",
parentId: "907",
},
],
},
// {
// authId: "90705",
// parentId: "907",
// category: "Button",
// label: "编辑单店信息"
// },
{
authId: "90706",
parentId: "907",
category: "Button",
type: "primary",
label: "导出日报",
handle: "exportDailyReport",
},
{
authId: "90707",
parentId: "907",
category: "Button",
label: "渗透率报表",
addRoutePath: [
{
authId: "90704",
name: "渗透率报表",
parentId: "907",
},
{
authId: "90709",
name: "店端实际交车数",
parentId: "907",
},
],
},
{
authId: "90708",
parentId: "907",
category: "Button",
handle: "handleOutputImport",
label: "导入",
},
],
component: _import("index"),
},
90703: {
path: "/outputValue",
name: "outputValue",
meta: {
title: "企微推送对象",
authId: "90703",
parentId: "907",
cache: false,
sideHidden: true,
activePath: "/index",
},
auth: [
{
authId: "9070301",
parentId: "90703",
label: "新增",
icon: "plus",
category: "Button",
type: "primary",
handle: "handleAdd",
},
{
authId: "9070303",
parentId: "90703",
label: "导入",
category: "Button",
handle: "handleImport",
},
{
authId: "9070302",
parentId: "90703",
label: "编辑",
handle: "handleEdit",
},
{
authId: "9070304",
parentId: "90703",
label: "删除",
handle: "handleDelete",
},
],
component: _import("index/outputValue"),
},
90704: {
path: "/permeation",
name: "permeation",
meta: {
title: "渗透率报表",
authId: "90704",
parentId: "907",
cache: false,
sideHidden: true,
activePath: "/index",
},
auth: [
{
authId: "9070401",
parentId: "90704",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport",
},
// 新车交付率导出
{
authId: "9070402",
parentId: "90704",
label: "导出",
category: "Button",
type: "primary",
handle: "handleDetailExport",
},
{
authId: "9070403",
parentId: "90704",
label: "日报导出",
category: "Button",
type: "primary",
handle: "handleDailyExport",
},
],
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"),
},
};
......@@ -1218,6 +1218,14 @@ export const routerName = {
handle: "handleExport",
},
{
authId: "9122308",
parentId: "91223",
label: "批量变更",
category: "Button",
type: "primary",
handle: "handleBatchChange",
},
{
authId: "9122303",
parentId: "91223",
label: "查看",
......@@ -1249,6 +1257,12 @@ export const routerName = {
handle: "handleComplete",
},
{
authId: "9122309",
parentId: "91223",
label: "关联",
handle: "handleRelate",
},
{
authId: "9122306",
parentId: "91223",
label: "处理",
......@@ -1298,4 +1312,120 @@ export const routerName = {
},
component: _import("residentManage/recruitmentManagement/lookRecruitment"),
},
91226: {
path: "/outstandingCase",
name: "outstandingCase",
meta: {
title: "优秀案例审核",
authId: "91226",
parentId: "912",
cache: false,
},
auth: [
{
authId: "9122601",
parentId: "91226",
label: "通过",
handle: "handlePass",
},
{
authId: "9122602",
parentId: "91226",
label: "驳回",
handle: "handleReject",
},
{
authId: "9122603",
parentId: "91226",
label: "下载录音",
handle: "handleDownload",
},
],
component: _import("residentManage/outstandingCase/index"),
},
91227: {
path: "/warningBaseLine",
name: "warningBaseLine",
meta: {
title: "预警基线管理",
authId: "91227",
parentId: "912",
cache: false,
},
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 = {
914: {
path: "/pointManagement",
name: "pointManagement",
meta: {
title: "积分管理",
authId: "914",
parentId: "1",
cache: false
}
},
91401: {
path: "/pointExamine",
name: "pointExamine",
meta: {
title: "积分审批",
authId: "91401",
parentId: "914",
cache: false
},
auth: [
{
authId: "9140101",
parentId: "91401",
label: "审核",
handle: "handleCheck"
},
{
authId: "9140104",
parentId: "91401",
label: "标记退款",
handle: "openRefundDetail"
},
{
authId: "9140102",
parentId: "91401",
label: "查看",
handle: "handleDetail"
},
{
authId: "9140103",
parentId: "91401",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9140105",
parentId: "91401",
label: "刷新",
category: "Button",
type: "primary",
handle: "handleRefresh"
}
],
component: _import("pointManagement/pointExamine")
},
91402: {
path: "/pointParticulars",
name: "pointParticulars",
meta: {
title: "积分明细",
authId: "91402",
parentId: "914",
cache: false
},
auth: [
{
authId: "9140201",
parentId: "91402",
label: "明细",
handle: "handleDetail",
addRoutePath: [
{
authId: "91403",
name: "详情",
parentId: "91402"
}
]
},
914: {
path: "/pointManagement",
name: "pointManagement",
meta: {
title: "积分管理",
authId: "914",
parentId: "1",
cache: false,
},
},
91401: {
path: "/pointExamine",
name: "pointExamine",
meta: {
title: "积分审批",
authId: "91401",
parentId: "914",
cache: false,
},
auth: [
{
authId: "9140101",
parentId: "91401",
label: "审核",
handle: "handleCheck",
},
{
authId: "9140104",
parentId: "91401",
label: "标记退款",
handle: "openRefundDetail",
},
{
authId: "9140102",
parentId: "91401",
label: "查看",
handle: "handleDetail",
},
{
authId: "9140103",
parentId: "91401",
label: "导出",
category: "Button",
handle: "handleExport",
},
{
authId: "9140105",
parentId: "91401",
label: "刷新",
category: "Button",
handle: "handleRefresh",
},
{
authId: "9140106",
parentId: "91401",
label: "一键审批",
category: "Button",
type: "primary",
handle: "handleApproveAll",
},
{
authId: "9140107",
parentId: "91401",
label: "审批",
handle: "handleApproveAll",
},
],
component: _import("pointManagement/pointExamine"),
},
91402: {
path: "/pointParticulars",
name: "pointParticulars",
meta: {
title: "积分明细",
authId: "91402",
parentId: "914",
cache: false,
},
auth: [
{
authId: "9140201",
parentId: "91402",
label: "明细",
handle: "handleDetail",
addRoutePath: [
{
authId: "91403",
name: "详情",
parentId: "91402",
},
],
},
{
authId: "9140205",
parentId: "91402",
label: "更换手机号",
handle: "handleChangePhone",
},
{
authId: "9140202",
parentId: "91402",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9140203",
parentId: "91402",
label: "新增",
handle: "handleDetail",
addRoutePath: [
{
authId: "91404",
name: "新增手动抵扣",
parentId: "91402"
}
]
}
],
component: _import("pointManagement/pointParticulars")
},
91403: {
path: "/pointDetail",
name: "pointDetail",
meta: {
title: "详情",
authId: "91403",
parentId: "91402",
cache: false,
activePath: "/pointParticulars"
},
component: _import("pointManagement/pointDetail")
},
//新增抵扣
91404: {
path: "/deduction",
name: "deduction",
meta: {
title: "新增抵扣",
authId: "91403",
parentId: "91402",
cache: false,
activePath: "/pointParticulars"
},
component: _import("pointManagement/addDeduction")
}
}
{
authId: "9140202",
parentId: "91402",
label: "导出",
category: "Button",
handle: "handleExport",
},
{
authId: "9140204",
parentId: "91402",
label: "批量积分调整",
category: "Button",
type: "primary",
handle: "handleGoverning",
},
{
authId: "9140203",
parentId: "91402",
label: "新增",
handle: "handleDetail",
addRoutePath: [
{
authId: "91404",
name: "新增手动抵扣",
parentId: "91402",
},
],
},
],
component: _import("pointManagement/pointParticulars"),
},
91403: {
path: "/pointDetail",
name: "pointDetail",
meta: {
title: "详情",
authId: "91403",
parentId: "91402",
cache: false,
activePath: "/pointParticulars",
},
component: _import("pointManagement/pointDetail"),
},
// 新增抵扣
91404: {
path: "/deduction",
name: "deduction",
meta: {
title: "新增抵扣",
authId: "91403",
parentId: "91402",
cache: false,
activePath: "/pointParticulars",
},
component: _import("pointManagement/addDeduction"),
},
};
......@@ -42,44 +42,11 @@
<auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" />
</d2-table>
</div>
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleImport" @confirmDialog="handleConfirmImport">
<slot>
<el-form :model="fileForm" ref="fileRuleForm" :rules="fileRules" label-width="120px">
<!-- <el-form-item v-if="userInfo.beSuper" label="园区店:" prop="yqMerchantId">
<el-select v-model="fileForm.yqMerchantId">
<el-option v-for="item in baseData.parkServiceList.filter(i => i.merchantName !== '全部')"
:key="item.merchantId" :value="item.merchantId" :label="item.merchantName" />
</el-select>
</el-form-item> -->
<el-form-item label="导入文件:" prop="fileName">
<el-col :span="16">
<el-input readonly v-model="fileForm.fileName" />
</el-col>
<el-col :span="4" class="m-l-md">
<el-button class="import-btn">
导入文件
<input type="file" id="fileUpload" class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@change="importFile($event)">
<!-- <el-link href="http://img01.glsx.com.cn/upload/salesexcel/预录订单导入模板.xlsx" type="primary"
class="import-template" icon="el-icon-link">
模版下载
</el-link> -->
<el-link type="primary"
class="import-template"
icon="el-icon-link"
@click="exportTemplate">
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
<el-form-item v-show="showNum">
<span>导入成功{{ importNum.succNum }}条,导入失败{{ importNum.failNum }}条</span>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<d2-file-import-dialog :is-visible="fileVisible"
title="上传文件"
@closeDialog="handleImport"
@confirmDialog="handleConfirmImport"
@downloadTemplate="exportTemplate" />
</d2-container>
</template>
......@@ -97,17 +64,7 @@ export default {
userInfo: this.$store.state.d2admin.user.info,
hideVisible: false,
fileVisible: false,
fileForm: {},
total: 0,
showNum: false,
importNum: {
succNum: 0,
failNum: 0
},
fileRules: {
yqMerchantId: [{ required: true, message: '请选择园区店', trigger: 'change' }],
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
tableSearchForm: {},
searchForm: {
shopOrYqMerchantId: '',
......@@ -359,30 +316,7 @@ export default {
handleShowHide() {
this.hideVisible = !this.hideVisible
},
// 上传文件,转码为base64
importFile(e) {
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
this.fileInfo = e.target.files[0].name.split('.')[e.target.files[0].name.split('.')?.length - 1] + '@' + arrBase64[1]
document.getElementById('fileUpload').value = ''
}
} else {
this.notice.errorTips('上传文件不可超过9M')
document.getElementById('fileUpload').value = ''
}
},
handleImport() {
this.fileForm = {
fileName: ''
}
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
this.fileVisible = !this.fileVisible
},
exportFailList(list) {
......@@ -396,27 +330,22 @@ export default {
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j]))
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = {
file: this.fileInfo
}
recordUpload(params).then(res => {
if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, {
name: this.fileForm.fileName,
ifSuccess: false,
uuid: res,
type: 'upload'
}]
handleConfirmImport({ fileName, fileData }) {
var params = {
file: fileData
}
recordUpload(params).then(res => {
if (res) {
const list = [...this.updateList, {
name: fileName,
ifSuccess: false,
uuid: res,
type: 'upload'
}]
this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功')
this.handleImport()
}
})
this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功')
this.handleImport()
}
})
},
......@@ -479,29 +408,4 @@ export default {
margin: 0 0;
}
.record-list .m-l-md {
margin-left: 20px;
}
.record-list .import-btn {
position: relative;
}
.record-list .import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.record-list .import-template {
position: absolute;
height: 20px;
top: 50px;
left: 0;
}
</style>
......@@ -25,6 +25,7 @@
>
<el-radio
v-for="item in baseData.followStatusOptions"
:key="item.confId"
:label="item.confId"
>{{ item.confValue }}</el-radio
>
......
......@@ -29,6 +29,7 @@
>
<el-radio
v-for="item in baseData.followStatusOptions"
:key="item.confId"
:label="item.confId"
>{{ item.confValue }}</el-radio>
</el-radio-group>
......
<template>
<div class="dashboard-card rank-card">
<div class="card-header">
<span class="card-title">线上运营分布</span>
</div>
<div class="rank-list">
<!-- 表头 -->
<div class="rank-header">
<span class="rank-header-col" style="flex: 1;">排名</span>
<span class="rank-header-col" style="flex: 1;">姓名</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">策略总数</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">占比</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">门店总数</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">占比</span>
</div>
<!-- 列表内容 -->
<block v-if="rankData.length > 0">
<div
class="rank-item"
v-for="(item, index) in rankData"
:key="index"
>
<!-- 排名 Icon 处理 -->
<div
class="rank-index"
:class="'rank-' + (index + 1)"
>
<img
v-if="index < 3"
:src="require(`@/assets/strategy/icon-strategy-rank0${index + 1}.png`)"
style="width: 24px; height: 24px;"
/>
<span
v-else
style="width: 20px; height: 20px; border-radius: 50%; opacity: 1; background: #2a58ad1a; display: inline-block; text-align: center; line-height: 20px;"
>{{ index + 1 }}</span>
<div class="dashboard-card rank-card">
<div class="card-header">
<span class="card-title">线上运营分布</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>
</block>
<block v-else>
<!-- 空数据占位,实际显示在 .dashboard-card 层级 -->
</block>
</div>
<div v-if="rankData.length === 0" class="empty-box">
<img :src="noDataImg" alt="暂无数据">
<div class="empty-text">暂无数据</div>
<div class="rank-list">
<!-- 表头 -->
<div class="rank-header">
<span class="rank-header-col" style="flex: 1;">排名</span>
<span class="rank-header-col" style="flex: 1;">姓名</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">策略总数</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">占比</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">门店总数</span>
<span class="rank-header-col" style="flex: 1; text-align: center;">占比</span>
</div>
<!-- 列表内容 -->
<block v-if="rankData.length > 0">
<div v-for="(item, index) in rankData"
:key="index"
class="rank-item">
<!-- 排名 Icon 处理 -->
<div class="rank-index"
:class="`rank-${index + 1}`">
<img v-if="index < 3"
:src="require(`@/assets/strategy/icon-strategy-rank0${index + 1}.png`)"
style="width: 24px; height: 24px;" />
<span v-else
style="width: 20px; height: 20px; border-radius: 50%; opacity: 1; background: #2a58ad1a; display: inline-block; text-align: center; line-height: 20px;">
{{ 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>
</block>
<block v-else>
<!-- 空数据占位,实际显示在 .dashboard-card 层级 -->
</block>
</div>
<div v-if="rankData.length === 0" class="empty-box">
<img alt="暂无数据" :src="noDataImg">
<div class="empty-text">
暂无数据
</div>
</div>
<div class="bottom-cover"></div>
</div>
<div class="bottom-cover"></div>
</div>
</template>
<script>
import noDataImg from "@/assets/strategy/emepty-strategy.png"
import noDataImg from "@/assets/strategy/emepty-strategy.png";
export default {
name: 'OnlineOperatorRanking',
props: {
// 排行榜数据(由父组件传递)
rankData: {
type: Array,
default: () => []
}
},
data() {
return {
noDataImg
};
}
name: "OnlineOperatorRanking",
props: {
// 排行榜数据(由父组件传递)
rankData: {
type: Array,
default: () => [],
},
},
data() {
return {
noDataImg,
};
},
};
</script>
......@@ -77,105 +84,105 @@ export default {
$bg-white: #fff;
.dashboard-card {
background: $bg-white;
border-radius: 4px;
padding: 20px;
padding-right: 28px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
position: relative;
&.rank-card {
height: 332px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.card-title {
font-size: 16px;
font-weight: 500;
color: #303133;
}
}
.bottom-cover {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 72px;
border-radius: 10px;
background: linear-gradient(0deg, #ffffff 0%, #ffffff00 100%);
}
background: $bg-white;
border-radius: 4px;
padding: 20px;
padding-right: 28px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
position: relative;
&.rank-card {
height: 332px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
.card-title {
font-size: 16px;
font-weight: 500;
color: #303133;
}
}
.bottom-cover {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 72px;
border-radius: 10px;
background: linear-gradient(0deg, #ffffff 0%, #ffffff00 100%);
}
}
/* 排行榜样式 */
.rank-list {
font-size: 13px;
.rank-header {
display: flex;
color: #909399;
.rank-header-col {
display: inline-block;
}
}
.rank-item {
display: flex;
align-items: center;
box-sizing: border-box;
margin-top: 16px;
&:last-child {
border-bottom: none;
}
.rank-index {
flex: 1;
}
.rank-name {
flex: 1;
color: #303133;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.rank-col {
flex: 1;
text-align: center;
color: #606266;
}
}
font-size: 13px;
overflow: scroll;
max-height: 260px;
.rank-header {
display: flex;
color: #909399;
.rank-header-col {
display: inline-block;
}
}
.rank-item {
display: flex;
align-items: center;
box-sizing: border-box;
margin-top: 16px;
&:last-child {
border-bottom: none;
}
.rank-index {
flex: 1;
}
.rank-name {
flex: 1;
color: #303133;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.rank-col {
flex: 1;
text-align: center;
color: #606266;
}
}
}
.empty-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 12px;
color: #909399;
text-align: center;
width: calc(100% - 48px); // 减去左右 padding (20px + 28px)
box-sizing: border-box;
img {
width: 86px;
height: 86px;
}
.empty-text {
margin-top: 0;
}
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 12px;
color: #909399;
text-align: center;
width: calc(100% - 48px); // 减去左右 padding (20px + 28px)
box-sizing: border-box;
img {
width: 86px;
height: 86px;
}
.empty-text {
margin-top: 0;
}
}
</style>
......@@ -118,14 +118,14 @@
<div slot="content" class="tooltip-content-max">
<div v-if="scope.scope.strategyTypeStatisticsResponse && Array.isArray(scope.scope.strategyTypeStatisticsResponse) && scope.scope.strategyTypeStatisticsResponse.length > 0">
<div v-for="(item, index) in scope.scope.strategyTypeStatisticsResponse" :key="index">
{{ item.strategyTypeName }}:{{ item.strategyTotalCount }}
{{ item.strategyTypeName }}:{{ item.strategyCount }}
</div>
</div>
<div v-else>{{scope.columnsObj.formatter(scope.scope) || '暂无数据'}}</div>
</div>
<span class="two-line-ellipsis" style="color: #2A58AD;">{{ scope.columnsObj.formatter(scope.scope) }}</span>
<span class="two-line-ellipsis" style="color: #2A58AD;cursor: pointer;" @click="handleViewDetail(scope.scope)">{{ scope.columnsObj.formatter(scope.scope) }}</span>
</el-tooltip>
<span v-else style="color: #2A58AD;">{{ scope.columnsObj.formatter(scope.scope) }}</span>
<span v-else style="color: #2A58AD;cursor: pointer;" @click="handleViewDetail(scope.scope)">{{ scope.columnsObj.formatter(scope.scope) }}</span>
</div>
<!-- 线上运营 -->
<div slot="onlineOperator" slot-scope="scope">
......@@ -761,6 +761,33 @@ export default {
this.loading.onlineOperData = false;
}
},
handleViewDetail(e) {
// 构建查询参数
const query = {
merchantNo: e.merchantId4s,
storeName: e.merchantName4s
};
// 添加时间范围类型
if (this.timeRangeType && this.timeRangeType.value !== undefined) {
query.timeRangeType = this.timeRangeType.value;
}
// 添加日期范围
if (this.dateRange) {
if (this.dateRange.startDate) {
query.startDate = this.dateRange.startDate;
}
if (this.dateRange.endDate) {
query.endDate = this.dateRange.endDate;
}
}
this.$router.push({
path: '/storeSignboard',
query
});
},
}
};
</script>
......
<template>
<div class="recruitment">
<div class="recruitment-title">招聘概况</div>
<div class="recruitment-content">
<div class="recruitment-card" v-for="(item, index) in recruitmentOptions" :key="index">
<div class="card-label">{{ item.label }}</div>
<div class="card-value">
{{ recruitmentData[item.key] || 0 }}<span class="card-unit">人</span>
</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import data from '@/views/stockManage/returnManage/constant/data';
import {
getRecruitmentDemandOverview
} from '@/api/earlyWarningManager'
export default {
name: 'Recruitment',
inject: ['GET_PARAMS_INFO'],
data () {
return {
recruitmentData: {},
recruitmentOptions: [
{ label: '需求总数', key: 'allOfDemand' },
{ label: '在招数量', key: 'recruitingCount' },
{ label: '入职人数', key: 'allOfOnboarding' },
{ label: '离职人数', key: 'resignedCount' }
]
}
},
computed: {
paramsInfo () {
return this.GET_PARAMS_INFO()
},
},
mounted () {
},
methods: {
init () {
this.getRecruitmentData()
},
async getRecruitmentData () {
let { merchantIds, bizs } = this.paramsInfo
const data = await getRecruitmentDemandOverview({
biz: bizs,
merchantId: merchantIds[0]
})
console.log(data, 'Recruitment/index.vue(查询门店招聘数据)')
this.recruitmentData = data || {}
}
}
}
</script>
<style scoped lang='scss'>
.recruitment {
padding: 0 20px 20px;
border-top: 1px solid #e5e5e5;
&-title {
height: 50px;
color: #333333;
font-size: 16px;
font-weight: 500;
display: flex;
align-items: center;
}
&-content {
display: flex;
gap: 10px;
border-radius: 8px;
background: #f2f7ff;
padding: 10px;
}
&-card {
flex: 1;
border-radius: 8px;
background: #ffffffcc;
padding: 12px 20px;
min-width: 0;
.card-label {
margin-bottom: 8px;
color: #666666;
font-size: 14px;
font-weight: 500;
line-height: 20px;
}
.card-value {
color: #2A58AD;
font-size: 30px;
font-weight: 600;
text-align: center;
.card-unit {
font-size: 16px;
font-weight: 500;
margin-left: 4px;
}
}
}
}
</style>
\ No newline at end of file
import dayjs from "dayjs"
const STRATEGYTYPEOPTIONS = {
0: '学习',
1: '优秀案例分享',
2: '带教',
3: '任务下发',
4: '销售精英到店提拉',
5: '强力促销',
6: '最终盘点与低客单产品购入',
0: '学习',
1: '优秀案例分享',
2: '带教',
3: '任务下发',
4: '销售精英到店提拉',
5: '强力促销',
6: '最终盘点与低客单产品购入',
7: '留言'
}
const DATE_RANGE = {
label: '执行周期',
format: (val) => {
let { startDate, endDate } = val
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}`
}
label: '执行周期',
format: (val) => {
let {
startDate,
endDate
} = val
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}`
}
}
const TITLE = {
label: '标题',
key: 'title',
label: '标题',
key: 'title',
}
const CREATED = {
label: '操作人',
key: 'createdBy',
label: '操作人',
key: 'createdBy',
}
const CREATED_DATE = {
label: '操作时间',
format: (val) => {
return dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
label: '操作时间',
format: (val) => {
return dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
const STRATEGY_FORM_01 = [
TITLE,
DATE_RANGE,
CREATED,
CREATED_DATE
TITLE,
DATE_RANGE,
CREATED,
CREATED_DATE
]
const STRATEGY_FORM_2456 = [
CREATED,
DATE_RANGE,
{
label: '执行人',
format: (val) => {
let { executePersons } = val
return executePersons.map(item => item.username).join('、')
},
hide: (val) => {
let { strategyType } = val
return [5, 6].includes(strategyType)
}
},
CREATED_DATE
CREATED,
DATE_RANGE,
{
label: '执行人',
format: (val) => {
let {
executePersons
} = val
return executePersons?.map(item => item.username).join('/')
},
hide: (val) => {
let {
strategyType
} = val
return [5, 6].includes(strategyType)
}
},
CREATED_DATE
]
const STRATEGY_FORM_3 = [
CREATED,
TITLE,
CREATED_DATE,
{
label: '副标题',
key: 'subTitle',
class: 'bespread',
},
{
label: '执行时间',
key: 'startDate',
},
CREATED,
TITLE,
CREATED_DATE,
{
label: '副标题',
key: 'subTitle',
class: 'bespread',
},
{
label: '执行时间',
key: 'startDate',
},
]
const STRATEGY_FORM_7 = [
CREATED,
CREATED_DATE,
{
label: '处理人',
format: (val) => {
let {
executePersons
} = val
return executePersons?.map(item => item.username).join('/') || '-'
},
},
]
export {
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_01,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
}
\ No newline at end of file
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_01,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
STRATEGY_FORM_7
}
......@@ -18,10 +18,10 @@
>
<div class="content">
<!-- <el-scrollbar class="content"> -->
<div class="detail-info">
<template v-for="(item,index) in strategyDetailFormList">
<div :class="['detail-info', { 'detail-info-7': detailInfo.strategyType == 7 }]">
<template v-for="(item, index) in strategyDetailFormList">
<div
:class="['info-item',item.class]"
:class="['info-item', item.class]"
:key="index"
v-if="!item.hide || !item.hide(detailInfo)"
>
......@@ -38,15 +38,15 @@
</div>
</template>
</div>
<template v-if="[0,1].includes(detailInfo.strategyType)">
<template v-if="[0, 1].includes(detailInfo.strategyType)">
<study-view
:info="detailInfo"
@openReceptionDialog="$emit('openReceptionDialog',$event)"
@openReceptionDialog="$emit('openReceptionDialog', $event)"
></study-view>
</template>
<template v-if="[5,6].includes(detailInfo.strategyType)">
<template v-if="[5, 6].includes(detailInfo.strategyType)">
<div class="order-info">
<template v-for="(item,index) in orderFormList">
<template v-for="(item, index) in orderFormList">
<div
class="info-item flex"
:key="index"
......@@ -54,7 +54,7 @@
<div class="label">{{ item.label }}:</div>
<div class="value">
<template v-if="item.format">{{ item.format(detailInfo) }}</template>
<template v-else>{{ detailInfo[item.key] != null ? detailInfo[item.key] : '-' }}</template>
<template v-else>{{ detailInfo[item.key] != null ? detailInfo[item.key] : '-' }}</template>
</div>
</div>
</template>
......@@ -80,7 +80,7 @@
>
<template #statusHtml="scope">
<div class="online-status">
<span :class="['dot',{un:scope.scope.readStatus == 0}]"></span>
<span :class="['dot', { un: scope.scope.readStatus == 0 }]"></span>
{{ {
0: '未查看',
1: '已查看'
......@@ -111,6 +111,7 @@ import {
STRATEGY_FORM_01,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
STRATEGY_FORM_7
} from './contant'
import StudyView from './StudyView.vue';
import dayjs from 'dayjs';
......@@ -191,12 +192,18 @@ export default {
}
},
strategyDetailFormList () {
const { strategyType } = this.detailInfo,
list = [2, 4, 5, 6].includes(strategyType)
? STRATEGY_FORM_2456 :
[0, 1].includes(strategyType)
? STRATEGY_FORM_01
: STRATEGY_FORM_3 || []
const { strategyType } = this.detailInfo
const formMap = {
0: STRATEGY_FORM_01,
1: STRATEGY_FORM_01,
2: STRATEGY_FORM_2456,
3: STRATEGY_FORM_3,
4: STRATEGY_FORM_2456,
5: STRATEGY_FORM_2456,
6: STRATEGY_FORM_2456,
7: STRATEGY_FORM_7
}
const list = formMap[strategyType] || STRATEGY_FORM_2456
return [
{
label: '执行策略',
......@@ -269,7 +276,7 @@ export default {
this.setData(data)
},
setData (data) {
data.descriptionText = data.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
data.descriptionText = data.description ? data.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') : '-'
this.detailInfo = data
this.loading = false
},
......@@ -286,19 +293,23 @@ export default {
display: flex;
align-items: center;
}
::v-deep.strategy-drawer {
.el-drawer__header {
padding: 0;
margin: 0;
border-bottom: 1px solid #e5e5e5;
}
.el-drawer__close-btn {
padding: 0 20px;
.el-dialog__close {
font-weight: 700;
font-size: 24px;
}
}
&-title {
height: 26px;
line-height: 26px;
......@@ -307,12 +318,15 @@ export default {
padding: 17px 20px;
font-weight: bold;
}
&-content {
height: calc(100vh - 61px);
.content {
height: calc(100% - 61px);
padding: 0 20px;
overflow-y: auto;
.detail-info {
margin: 20px 0 16px;
background: #fafafa;
......@@ -321,16 +335,19 @@ export default {
flex-wrap: wrap;
gap: 20px 0;
}
.info-item {
display: flex;
width: 50%;
color: #666666;
font-size: 14px;
.label {
width: 150px;
text-align: right;
line-height: 19px;
}
.value {
color: #333333;
width: calc(100% - 150px);
......@@ -343,9 +360,11 @@ export default {
width: 100%;
word-break: break-all;
}
.order-info {
.info-item {
margin-bottom: 20px;
.value {
font-size: 16px;
font-weight: 500;
......@@ -353,14 +372,18 @@ export default {
}
}
}
.task {
padding-bottom: 20px;
&-content {
width: 100%;
.label {
width: 170px;
line-height: 19px;
}
.value {
width: calc(100% - 170px);
height: 140px;
......@@ -373,11 +396,13 @@ export default {
color: #333333;
font-size: 14px;
line-height: 20px;
p {
margin: 0 !important;
}
}
}
&-title {
height: 50px;
border-bottom: 1px solid #e5e5e5;
......@@ -387,6 +412,7 @@ export default {
margin: 16px 0;
}
}
.online-status {
display: flex;
justify-content: center;
......@@ -400,11 +426,19 @@ export default {
margin-right: 8px;
background: #2cca74;
}
.un {
background: #eb4e4e;
}
}
.detail-info-7 {
background-color: #fff;
.info-item {
width: 100%;
}
}
}
.footer {
padding: 14px 0;
border-top: 1px solid #e5e5e5;
......
......@@ -70,7 +70,8 @@ import {
STRATEGYTYPEOPTIONS,
STRATEGY_01,
STRATEGY_2456,
STRATEGY_3
STRATEGY_3,
STRATEGY_7
} from './contant'
import {
deleteStrategy
......@@ -98,7 +99,8 @@ export default {
list = [0, 1].includes(strategyType)
? STRATEGY_01 : [2, 4, 5, 6].includes(strategyType) ?
STRATEGY_2456 : {
3: STRATEGY_3
3: STRATEGY_3,
7: STRATEGY_7
}[strategyType] || []
return [
...list,
......
......@@ -7,6 +7,7 @@ const STRATEGYTYPEOPTIONS = {
4: '销售精英到店提拉',
5: '强力促销',
6: '最终盘点与低客单产品购入',
7: '留言'
}
const DATE_RANGE = {
label: '执行周期',
......@@ -20,7 +21,7 @@ const STAFF_FORMAT = (label) => {
label,
format: (val) => {
let { staffList } = val
return staffList.map(item => item.userName).join('、')
return staffList.map(item => item.userName).join('/') || '-'
}
}
}
......@@ -63,10 +64,18 @@ const STRATEGY_3 = [
}
},
]
const STRATEGY_7 = [
{
label: '留言人',
key: 'createdBy',
},
STAFF_FORMAT('处理人')
]
export {
STRATEGYTYPEOPTIONS,
STRATEGY_01,
STRATEGY_2456,
STRATEGY_3
STRATEGY_3,
STRATEGY_7,
}
\ No newline at end of file
......@@ -3,38 +3,21 @@
<div class="strategy-title flex">
策略中心
<div class="add">
<el-button
type="text"
@click="addStrategyVisible = true"
> <i class="el-icon-plus"></i>添加策略</el-button>
<el-button type="text" @click="addStrategyVisible = true"> <i class="el-icon-plus"></i>添加策略</el-button>
</div>
</div>
<el-scrollbar
class="strategy-list"
:key="viewKey"
v-loading="loading"
>
<template v-for="(i,index) in list">
<strategy-item
:key="index"
:index="index"
:item="i"
:isLast="index == list.length - 1"
:class="[{first:index == 0},{last:index == list.length - 1}]"
@toDetail="toDetail"
@refresh="getStrategyList"
></strategy-item>
<el-scrollbar class="strategy-list" :key="viewKey" v-loading="loading" ref="scrollbar">
<template v-for="(i, index) in list">
<strategy-item :key="index" :index="index" :item="i" :isLast="index == list.length - 1"
:class="[{ first: index == 0 }, { last: index == list.length - 1 }]" @toDetail="toDetail"
@refresh="init"></strategy-item>
</template>
<div v-if="loading && list.length > 0" class="loading-more">加载中...</div>
<div v-if="noMoreData && list.length > 0" class="no-more-data">没有更多了</div>
</el-scrollbar>
<add-strategy
:dialogVisible.sync="addStrategyVisible"
@refresh="getStrategyList"
></add-strategy>
<strategy-detail
:dialogVisible.sync="strategyDetailVisible"
:item="currentItem"
@openReceptionDialog="$emit('openReceptionDialog',$event)"
></strategy-detail>
<add-strategy :dialogVisible.sync="addStrategyVisible" @refresh="init"></add-strategy>
<strategy-detail :dialogVisible.sync="strategyDetailVisible" :item="currentItem"
@openReceptionDialog="$emit('openReceptionDialog', $event)"></strategy-detail>
</div>
</template>
......@@ -61,20 +44,42 @@ export default {
strategyDetailVisible: false,
currentItem: {},
viewKey: Date.now(),
loading: false
loading: false,
noMoreData: false,
pageNum: 1,
pageSize: 10,
}
},
computed: {
paramsInfo () {
return this.GET_PARAMS_INFO()
},
},
mounted () {
mounted () {
},
beforeDestroy () {
const scrollbar = this.$refs.scrollbar;
if (scrollbar && scrollbar.wrap) {
scrollbar.wrap.removeEventListener('scroll', this.handleScroll);
}
},
methods: {
bindScrollEvent () {
this.$nextTick(() => {
const scrollbar = this.$refs.scrollbar;
if (scrollbar && scrollbar.wrap) {
console.log('绑定滚动事件')
scrollbar.wrap.addEventListener('scroll', this.handleScroll);
} else {
console.log('scrollbar 或 wrap 不存在:', { scrollbar, wrap: scrollbar?.wrap })
}
})
},
init () {
this.pageNum = 1
this.noMoreData = false
this.list = []
this.getStrategyList()
},
toDetail (item) {
......@@ -88,24 +93,45 @@ export default {
data = await getStrategyList({
merchantId: merchantIds[0],
biz: 1,
pageNum: 1,
pageSize: 999999
pageNum: this.pageNum,
pageSize: this.pageSize
})
if (data && data.list) {
let { list } = data
list.map(e => {
e.showDel = dayjs().diff(dayjs(e.startDate),'s') < 0
e.showDel = dayjs().diff(dayjs(e.startDate), 's') < 0
e.createdDateText = dayjs(e.createdDate).format('YYYY-MM-DD')
e.descriptionText = e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
e.descriptionText = e.description ? e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') : '-'
})
this.list = list
if (this.pageNum == 1) {
this.list = list
} else {
this.list = this.list.concat(list)
}
this.loading = false
this.viewKey = Date.now()
if (this.pageNum == 1) this.viewKey = Date.now()
if (list.length < this.pageSize) {
this.noMoreData = true
}
// 数据加载完成后重新绑定事件
this.bindScrollEvent()
}
} catch (error) {
this.loading = false
}
},
handleScroll (event) {
const wrap = event.target
const scrollTop = wrap.scrollTop
const scrollHeight = wrap.scrollHeight
const clientHeight = wrap.clientHeight
if (scrollTop + clientHeight >= scrollHeight - 10 && !this.loading && !this.noMoreData) {
this.pageNum++
this.getStrategyList()
}
}
}
}
......@@ -116,9 +142,15 @@ export default {
display: flex;
align-items: center;
}
.strategy {
width: 100%;
height: 100%;
::v-deep .el-scrollbar__wrap {
overflow: auto !important;
}
&-title {
height: 50px;
border-bottom: 1px solid #e5e5e5;
......@@ -127,10 +159,12 @@ export default {
color: #333333;
font-size: 16px;
font-weight: 500;
.add {
font-weight: 400;
color: #2a58ad;
font-size: 14px;
.el-icon-plus {
font-size: 12px;
font-weight: 700;
......@@ -138,16 +172,31 @@ export default {
}
}
}
&-list {
width: 100%;
height: calc(100% - 51px);
box-sizing: border-box;
.first {
margin-top: 16px;
}
.last {
margin-bottom: 16px;
}
}
}
.loading-more,
.no-more-data {
text-align: center;
padding: 12px 0;
color: #999;
font-size: 12px;
}
.no-more-data {
color: #ccc;
}
</style>
\ No newline at end of file
<template>
<div class="layout">
<el-scrollbar class="left">
<store-signboard-info
@dateChange="dateChange"
@changeMerchant="changeMerchant"
ref="storeSignboardInfo"
></store-signboard-info>
<store-signboard-info @dateChange="dateChange" @changeMerchant="changeMerchant"
ref="storeSignboardInfo"></store-signboard-info>
<business-overview ref="businessOverview"></business-overview>
<summary-overview ref="summaryOverview"></summary-overview>
<staff-overview ref="staffOverview"></staff-overview>
<recruitment ref="recruitment"></recruitment>
</el-scrollbar>
<div class="right">
<strategy-list
@openReceptionDialog="openReceptionDialog"
ref="strategyList"
></strategy-list>
<strategy-list @openReceptionDialog="openReceptionDialog" ref="strategyList"></strategy-list>
</div>
<quality-detail
:is-quality-visible="isQualityVisible"
v-if="isQualityVisible"
:currentNum="currentNum"
:qualityDetailList="qualityDetailList"
@closeDialog="closeReceptionDialog"
ref="qualityDetail"
></quality-detail>
<new-quality-detail
:is-quality-visible="isNewQualityVisible"
v-if="isNewQualityVisible"
:currentNum="currentNum"
:qualityDetailList="qualityDetailList"
@closeDialog="closeReceptionDialog"
ref="newQualityDetail"
></new-quality-detail>
<quality-detail :is-quality-visible="isQualityVisible" v-if="isQualityVisible" :currentNum="currentNum"
:qualityDetailList="qualityDetailList" @closeDialog="closeReceptionDialog" ref="qualityDetail"></quality-detail>
<new-quality-detail :is-quality-visible="isNewQualityVisible" v-if="isNewQualityVisible" :currentNum="currentNum"
:qualityDetailList="qualityDetailList" @closeDialog="closeReceptionDialog"
ref="newQualityDetail"></new-quality-detail>
</div>
</template>
......@@ -45,6 +29,7 @@ import StaffOverview from './components/StaffOverview/index.vue';
import { deepClone } from "@/common/util"
import qualityDetail from '@/views/residentManage/components/qualityDetail'
import newQualityDetail from '@/views/residentManage/components/newQualityDetail'
import Recruitment from './components/Recruitment/index.vue'
const rise = require('@/assets/strategy/rise.png')
const just01 = require('@/assets/strategy/just01.png')
const decline = require('@/assets/strategy/decline.png')
......@@ -56,7 +41,8 @@ export default {
SummaryOverview,
StaffOverview,
qualityDetail,
newQualityDetail
newQualityDetail,
Recruitment
},
name: 'storeSignboard',
......@@ -103,7 +89,10 @@ export default {
},
strategyListRef () {
return this.$refs.strategyList
}
},
recruitmentRef () {
return this.$refs.recruitment
},
},
// 在beforeDestroy钩子中移除事件监听
beforeDestroy () {
......@@ -150,7 +139,7 @@ export default {
this.storeSignboardInfoRef.init()
this.businessOverviewRef.init()
this.strategyListRef.init()
this.recruitmentRef.init()
},
preventBack () {
if (this.isQualityVisible || this.isNewQualityVisible) {
......@@ -252,12 +241,14 @@ export default {
width: calc(100% - 40px);
height: calc(100% - 20px);
overflow: hidden;
.left {
// width: 875px;
width: 60.76vw;
height: 100%;
flex-shrink: 0;
}
.right {
// width: calc(100% - 875px);
width: calc(100% - 60.76vw);
......@@ -265,6 +256,7 @@ export default {
flex-shrink: 0;
border-left: 1px solid #e5e5e5;
}
::v-deep .el-scrollbar__wrap {
overflow: auto scroll;
}
......
......@@ -459,23 +459,10 @@
<download-account-dialog :account-visible="accountVisible" v-if="accountVisible" :scene="searchForm.sceneType" @custTmpl="handleCustTmpl" @handleBill="handleBill" @accountClose="accountClose" />
<!-- 出库面板 -->
<warehouse-detail v-if="warehouseVisible" :warehouse-visible="warehouseVisible" :order-info-id="orderId" @handleDrawerClose="handleDrawerClose" />
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleImport" @confirmDialog="handleConfirmImport">
<slot>
<el-form :model="fileForm" ref="fileRuleForm" :rules="fileRules" label-width="120px">
<el-form-item label="导入文件:" prop="fileName">
<el-col :span="16">
<el-input readonly v-model="fileForm.fileName" />
</el-col>
<el-col :span="4" class="m-l-md">
<el-button class="import-btn">
导入文件
<input type="file" id="fileUpload" class="import-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel" @change="importFile($event)" />
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<d2-file-import-dialog :is-visible="fileVisible"
title="上传文件"
@closeDialog="handleImport"
@confirmDialog="handleConfirmImport" />
<tmpl-drawer v-if="tmplDrawerVisible" :tmplDrawerVisible="tmplDrawerVisible" :type="tmplInfo.type" :tmplSelectList="tmplInfo.tmplSelectList" @handleConfirm="handleCustConfirm" @handleClose="handleCustVisible"></tmpl-drawer>
<system-bill-dialog v-if="billVisible" :billVisible="billVisible" :billTmplInfo="billTmplInfo" @handleClose="handleBillVisible" @handleConfirm="handleBillVisible"></system-bill-dialog>
</div>
......@@ -748,10 +735,6 @@ export default {
/** 根据场景控制页面显示隐藏end */
sceneList: sceneList,
positionTypeList: [], // 商品部位数据
fileRules: {
fileName: [{ required: true, message: "请上传文件", trigger: "change" }]
},
fileForm: {},
fileVisible: false,
tmplDrawerVisible: false,
tmplInfo: {
......@@ -899,62 +882,30 @@ export default {
},
handleImport() {
this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
},
// 上传文件,转码为base64
importFile(e) {
console.log(e)
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.$set(this.fileForm, "fileName", e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = (event) => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(",")
this.fileInfo =
e.target.files[0].name.split(".")[
e.target.files[0].name.split(".")?.length - 1
] +
"@" +
arrBase64[1]
document.getElementById("fileUpload").value = ""
}
} else {
this.notice.errorTips("上传文件不可超过9M")
document.getElementById('fileUpload').value = ''
handleConfirmImport({ fileName, fileData }) {
var params = {
file: fileData
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate((valid) => {
if (valid) {
var params = {
file: this.fileInfo
}
api.uploadFile(params).then((res) => {
if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [
...this.updateList,
{
name: this.fileForm.fileName,
ifSuccess: false,
uuid: res,
type: "upload"
}
]
this.actionSetDownloadList({ list, type: "updateList" })
this.notice.okTips("上传成功")
this.handleBatchImport()
api.uploadFile(params).then((res) => {
if (res) {
const list = [
...this.updateList,
{
name: fileName,
ifSuccess: false,
uuid: res,
type: "upload"
}
})
]
this.actionSetDownloadList({ list, type: "updateList" })
this.notice.okTips("上传成功")
this.handleBatchImport()
}
})
},
handleBatchImport() {
this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
},
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
......@@ -1527,26 +1478,4 @@ export default {
margin-right: 5px;
display: inline-block;
}
.m-l-md {
margin-left: 20px;
}
.import-btn {
position: relative;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.import-template {
position: absolute;
height: 20px;
top: 50px;
left: 0;
}
</style>
......@@ -21,12 +21,14 @@
@input="event => searchInput(event, 'commodityCode')" />
</template>
<template #type>
<el-input v-model.trim="searchForm.type"
<!-- <el-input v-model.trim="searchForm.type"
:clearable="true"
:maxlength="50"
placeholder="请输入商品编码"
:style="{ width: '100%' }"
@input="event => searchInput(event, 'type')" />
@input="event => searchInput(event, 'type')" /> -->
<el-input :style="{ width: '100%' }" placeholder="请输入商品编码" v-model.trim="searchForm['type']" :clearable="true"
:maxlength="50" />
</template>
<template #thirdPartyCode>
<el-input v-model.trim="searchForm.thirdPartyCode"
......
<template>
<d2-dialog title="批量复制"
:is-visible.sync="batchCopyVisible"
width="600px"
btn-ok-label="确定"
@confirmDialog="handleBatchCopyConfirm"
@closeDialog="handleBatchCopyClose"
class="relateStore">
<el-form label-width="120px" :rules="rules" :model="selectData" ref="batchCopyForm">
<el-form-item label="业务场景:">
<el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input>
</el-form-item>
<el-form-item label="复制门店:" prop="selectMerchantObj">
<el-select v-model="selectData.selectMerchantObj" remote reserve-keyword multiple collapse-tags
placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod"
v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable>
<el-option v-for="subItem in storeData" :key="subItem.merchantId"
:label="subItem.merchantName" :value="subItem" />
</el-select>
</el-form-item>
</el-form>
<div class="tips">
说明:批量复制至新门店后,系统自动按操作商品,自动更新补充商品对应的上架门店
</div>
</d2-dialog>
<d2-dialog btn-ok-label="确定"
class="relateStore"
:is-visible.sync="batchCopyVisible"
title="批量复制"
width="600px"
@closeDialog="handleBatchCopyClose"
@confirmDialog="handleBatchCopyConfirm">
<el-form ref="batchCopyForm"
label-width="120px"
:model="selectData"
:rules="rules">
<el-form-item label="业务场景:">
<el-input v-model="sceneList[selectedScene]"
disabled
style="width: 370px;">
</el-input>
</el-form-item>
<el-form-item label="复制门店:" prop="selectMerchantObj">
<el-select v-model="selectData.selectMerchantObj"
v-el-select-loadmore="interestsLoadmore"
collapse-tags
filterable
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-form-item>
</el-form>
<div class="tips">
说明:批量复制至新门店后,系统自动按操作商品,自动更新补充商品对应的上架门店
</div>
</d2-dialog>
</template>
<script>
import { getList, getAccountMerchantList } from '@/api/merchant'
import { sceneList } from '@/common/constants.js'
import { getAccountMerchantList, getList } from "@/api/merchant";
import { sceneList } from "@/common/constants.js";
export default {
name: 'RelateStoreDialog',
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: '',
sceneList,
selectData: {},
rules: { selectMerchantObj: [{ required: true, message: '请选择复制门店', trigger: 'blur' }] }
}
},
directives: {
'el-select-loadmore': {
bind(el, binding) {
setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}, 100)
}
}
},
props: {
batchCopyVisible: {
type: Boolean,
default: false
},
selectedScene: {
type: Number
}
},
name: "RelateStoreDialog",
directives: {
"el-select-loadmore": {
bind(el, binding) {
setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector(
".el-select-dropdown .el-select-dropdown__wrap",
);
SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition
= this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) {
binding.value();
}
});
}, 100);
},
},
},
props: {
batchCopyVisible: {
type: Boolean,
default: false,
},
selectedScene: {
type: Number,
},
},
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: "",
sceneList,
selectData: {},
rules: { selectMerchantObj: [{ required: true, message: "请选择复制门店", trigger: "blur" }] },
};
},
mounted() {
this.getList()
},
methods: {
getList() {
const storeApi = [1, 2, 3].includes(this.selectedScene) ? getList : getAccountMerchantList // 会员权益/积分商城场景 上架门店是账户中心所有门店
storeApi({
// merchantIdName: ![1, 2, 3].includes(this.selectedScene) ? this.searchMerchantName : '',
merchantName: this.searchMerchantName,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene
}).then(res => {
res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = val.merchantNo
})
this.storeData = this.storeData.concat(res.list)
})
},
// 获取上架门店
remoteMethod(query) {
this.searchMerchantName = query
this.currentPage = 1
this.storeData = []
this.getList() // 请求接口
},
visibleChange(data) {
// 获取焦点重新渲染下拉框数据
if (data) {
if (this.searchMerchantName) {
this.searchMerchantName = ''
this.currentPage = 1
this.storeData = []
this.getList()
}
}
},
// 获取更多上架门店
interestsLoadmore() {
setTimeout(() => {
this.currentPage = this.currentPage + 1
if (this.allPages < this.currentPage) {
this.currentPage = this.allPages
return
}
this.getList()
}, 10)
},
handleBatchCopyConfirm() {
this.$refs.batchCopyForm.validate((valid) => {
if (valid) {
this.$emit('handleBatchCopyConfirm', this.selectData?.selectMerchantObj)
}
})
},
handleBatchCopyClose() {
this.$emit('handleBatchCopyClose')
}
}
}
mounted() {
this.getList();
},
methods: {
getList() {
const storeApi = [1, 2, 3].includes(this.selectedScene) ? getList : getAccountMerchantList; // 会员权益/积分商城场景 上架门店是账户中心所有门店
storeApi({
// merchantIdName: ![1, 2, 3].includes(this.selectedScene) ? this.searchMerchantName : '',
merchantName: this.searchMerchantName,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene,
}).then((res) => {
res?.list?.forEach((val) => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo)
val.merchantId = val.merchantNo;
});
this.storeData = this.storeData.concat(res.list);
});
},
// 获取上架门店
remoteMethod(query) {
this.searchMerchantName = query;
this.currentPage = 1;
this.storeData = [];
this.getList(); // 请求接口
},
visibleChange(data) {
// 获取焦点重新渲染下拉框数据
if (data) {
if (this.searchMerchantName) {
this.searchMerchantName = "";
this.currentPage = 1;
this.storeData = [];
this.getList();
}
}
},
// 获取更多上架门店
interestsLoadmore() {
setTimeout(() => {
this.currentPage = this.currentPage + 1;
if (this.allPages < this.currentPage) {
this.currentPage = this.allPages;
return;
}
this.getList();
}, 10);
},
handleBatchCopyConfirm() {
this.$refs.batchCopyForm.validate((valid) => {
if (valid) {
this.$emit("handleBatchCopyConfirm", this.selectData?.selectMerchantObj);
}
});
},
handleBatchCopyClose() {
this.$emit("handleBatchCopyClose");
},
},
};
</script>
<style lang="scss">
.tips{
font-size: 14px;
color: #999;
.tips {
font-size: 14px;
color: #999;
}
</style>
<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 === false"
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: "", // 1-虚拟 2-实物
bindAllMerchant: "",
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: "",
bindAllMerchant: "",
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>
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!