Commit e1236345 by 前端

Merge branch 'SAAS+V5.7.0' into 'develop'

上线合并

See merge request !572
2 parents abccaee2 abb8a936
Showing 109 changed files with 2580 additions and 1484 deletions
...@@ -4,6 +4,8 @@ node_modules ...@@ -4,6 +4,8 @@ node_modules
/.history /.history
/cache /cache
/copyDirTarget /copyDirTarget
.cursorrules
.cursor
# Log files # Log files
npm-debug.log* npm-debug.log*
......
...@@ -4247,6 +4247,27 @@ ...@@ -4247,6 +4247,27 @@
"whatwg-fetch": "^3.6.2" "whatwg-fetch": "^3.6.2"
}, },
"dependencies": { "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": { "acorn-walk": {
"version": "8.2.0", "version": "8.2.0",
"resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz", "resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz",
...@@ -4782,27 +4803,6 @@ ...@@ -4782,27 +4803,6 @@
"lodash": "^4.17.4" "lodash": "^4.17.4"
} }
}, },
"@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
}
}
},
"@vue/vue2-jest": { "@vue/vue2-jest": {
"version": "27.0.0", "version": "27.0.0",
"resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz", "resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz",
......
...@@ -55,7 +55,7 @@ export function baseGoodsUpOrDown(data) { ...@@ -55,7 +55,7 @@ export function baseGoodsUpOrDown(data) {
// 删除商品 // 删除商品
export function baseGoodsDelete(data) { export function baseGoodsDelete(data) {
data.method = `${path2}basegoods.delete` data.method = `${path2}basegoods.delete`
return request(data, "post") return request(data, "post", [], { useResponseMessage: true })
} }
// 导出 // 导出
......
import request from "./request" import request from "./request";
const path = "dj.api.smartcarlife."
const path = "dj.api.smartcarlife.";
// 获取上架管理 列表数据 // 获取上架管理 列表数据
export function getGroundingManageList(data) { export function getGroundingManageList(data) {
data.method = `${path}merchantGoodsInfo.page` data.method = `${path}merchantGoodsInfo.page`;
return request(data) return request(data);
} }
// 获取上架商品详情 // 获取上架商品详情
export function getMerchantGoodsInfo(data) { export function getMerchantGoodsInfo(data) {
data.method = `${path}merchantGoodsInfo.getById` data.method = `${path}merchantGoodsInfo.getById`;
return request(data) return request(data);
} }
// 删除 // 删除
export function delGroundingById(data) { export function delGroundingById(data) {
data.method = `${path}merchantGoodsInfo.deleteById` data.method = `${path}merchantGoodsInfo.deleteById`;
return request(data) return request(data);
} }
// 批量审核 // 批量审核
export function batchReviewAPI(data) { export function batchReviewAPI(data) {
data.method = `${path}merchantGoodsInfo.updateBatchWaitAudit` data.method = `${path}merchantGoodsInfo.updateBatchWaitAudit`;
return request(data, "post") return request(data, "post");
} }
// 上下架 // 上下架
export function updateGoodsStatus(data) { export function updateGoodsStatus(data) {
data.method = `${path}merchantGoodsInfo.updateStatus` data.method = `${path}merchantGoodsInfo.updateStatus`;
return request(data) return request(data);
} }
// 添加编辑上架信息 // 添加编辑上架信息
export function addOrUpdateAPI(data) { export function addOrUpdateAPI(data) {
data.method = `${path}merchantGoodsInfo.insertOrUpdate` data.method = `${path}merchantGoodsInfo.insertOrUpdate`;
return request(data, "post") return request(data, "post");
} }
// 获取门店开通的场景 // 获取门店开通的场景
export function getSceneTypeListByMerchantId(data) { export function getSceneTypeListByMerchantId(data) {
data.method = `${path}scenemerchantref.listScene` data.method = `${path}scenemerchantref.listScene`;
return request(data) return request(data);
} }
// 获取类目商品两级选择框数据 // 获取类目商品两级选择框数据
export function getAllGroupByCategory(data) { export function getAllGroupByCategory(data) {
data.method = `${path}productManager.getAllGroupByCategory` data.method = `${path}productManager.getAllGroupByCategory`;
return request(data) return request(data);
} }
// 获取所有上架商品 // 获取所有上架商品
export function getAllGoodsList(data) { export function getAllGoodsList(data) {
data.method = `${path}productManager.search` data.method = `${path}productManager.search`;
return request(data, "post") return request(data, "post");
} }
// 获取所有上架商品 替换新接口 // 获取所有上架商品 替换新接口
// export function getAllGoodsListPage(data) { // export function getAllGoodsListPage(data) {
...@@ -60,104 +61,128 @@ export function getAllGoodsList(data) { ...@@ -60,104 +61,128 @@ export function getAllGoodsList(data) {
// return request(data, "post") // return request(data, "post")
// } // }
export function getAllGoodsListPage(data) { export function getAllGoodsListPage(data) {
data.method = `${path}productManager.search` data.method = `${path}productManager.search`;
return request(data, "post") return request(data, "post");
} }
// 批量下架 // 批量下架
export function batchUpdateStatus(data) { export function batchUpdateStatus(data) {
data.method = `${path}merchantGoodsInfo.updateBatchOffShelf` data.method = `${path}merchantGoodsInfo.updateBatchOffShelf`;
return request(data, "post") return request(data, "post");
} }
// 批量复制 // 批量复制
export function batchUpdateBatchCopy(data) { export function batchUpdateBatchCopy(data) {
// data.method = `${path}merchantGoodsInfo.updateBatchCopy` // data.method = `${path}merchantGoodsInfo.updateBatchCopy`
data.method = `${path}merchantGoodsInfo.addBatchCopy` data.method = `${path}merchantGoodsInfo.addBatchCopy`;
return request(data, "post") return request(data, "post");
} }
// 校验上架记录中是否已存在 // 校验上架记录中是否已存在
export function checkGroundingLog(data) { export function checkGroundingLog(data) {
data.method = `${path}merchantGoodsInfo.existsCount` data.method = `${path}merchantGoodsInfo.existsCount`;
return request(data, "post") return request(data, "post");
} }
// 分页查询套餐管理记录 // 分页查询套餐管理记录
export function merchantPackageGoodsInfoPage(data) { export function merchantPackageGoodsInfoPage(data) {
data.method = `${path}merchantPackageGoodsInfo.page` data.method = `${path}merchantPackageGoodsInfo.page`;
return request(data, "post") return request(data, "post");
} }
// return request(data, 'post') // return request(data, 'post')
// } // }
// 批量设置是否校验最低价 // 批量设置是否校验最低价
export function batchSetValidMinSellPrice(data) { export function batchSetValidMinSellPrice(data) {
data.method = `${path}merchantGoodsInfo.updateBatchValidMinSellPrice` data.method = `${path}merchantGoodsInfo.updateBatchValidMinSellPrice`;
return request(data, "post") return request(data, "post");
}
// 批量修改库存模式
export function batchModifyInventoryType(data) {
data.method = `${path}merchantGoodsInfo.update.inventory.type`;
return request(data, "post");
}
// 查询批量勾选的上架商品关联的门店
export function queryRelatedMerchant(data) {
data.method = `${path}merchantGoodsInfo.query.related.merchant`;
return request(data, "post");
} }
// 批量导入 // 批量导入
export function groundingImport(data) { export function groundingImport(data) {
data.method = `${path}merchantGoodsInfo.import` data.method = `${path}merchantGoodsInfo.import`;
return request(data, "post", ["file"]) return request(data, "post", ["file"]);
} }
// 采购上架 添加/修改记录 // 采购上架 添加/修改记录
export function purchaseGoodsInfoInsertOrUpdate(data) { export function purchaseGoodsInfoInsertOrUpdate(data) {
data.method = `${path}purchaseGoodsInfo.insertOrUpdate` data.method = `${path}purchaseGoodsInfo.insertOrUpdate`;
return request(data, "post", ["file"]) return request(data, "post", ["file"]);
} }
// 删除记录 // 删除记录
export function purchaseGoodsInfoDeleteById(data) { export function purchaseGoodsInfoDeleteById(data) {
data.method = `${path}purchaseGoodsInfo.deleteById` data.method = `${path}purchaseGoodsInfo.deleteById`;
return request(data, "post") return request(data, "post");
} }
// 导出列表(异步) // 导出列表(异步)
export function purchaseGoodsInfoExportAsync(data) { export function purchaseGoodsInfoExportAsync(data) {
data.method = `${path}purchaseGoodsInfo.export.async` data.method = `${path}purchaseGoodsInfo.export.async`;
return request(data, "post") return request(data, "post");
} }
// 根据ID查询详细信息 // 根据ID查询详细信息
export function purchaseGoodsInfoGetById(data) { export function purchaseGoodsInfoGetById(data) {
data.method = `${path}purchaseGoodsInfo.getById` data.method = `${path}purchaseGoodsInfo.getById`;
return request(data, "post") return request(data, "post");
} }
// 采购上架导入 // 采购上架导入
export function purchaseGoodsInfoImport(data) { export function purchaseGoodsInfoImport(data) {
data.method = `${path}purchaseGoodsInfo.import` data.method = `${path}purchaseGoodsInfo.import`;
return request(data, "post", ["file"]) return request(data, "post", ["file"]);
} }
// 分页查询上架管理记录 // 分页查询上架管理记录
export function purchaseGoodsInfoPage(data) { export function purchaseGoodsInfoPage(data) {
data.method = `${path}purchaseGoodsInfo.page` data.method = `${path}purchaseGoodsInfo.page`;
return request(data, "post") return request(data, "post");
} }
// 采购上架导入模版 // 采购上架导入模版
export function purchaseGoodsInfoTemplateExport(data) { export function purchaseGoodsInfoTemplateExport(data) {
data.method = `${path}purchaseGoodsInfo.template.export` data.method = `${path}purchaseGoodsInfo.template.export`;
return request(data, "post") return request(data, "post");
} }
// 批量下架操作 // 批量下架操作
export function purchaseGoodsInfoUpdateBatchOffShelf(data) { export function purchaseGoodsInfoUpdateBatchOffShelf(data) {
data.method = `${path}purchaseGoodsInfo.updateBatchOffShelf` data.method = `${path}purchaseGoodsInfo.updateBatchOffShelf`;
return request(data, "post") return request(data, "post");
} }
// 批量审核 // 批量审核
export function purchaseGoodsInfoUpdateBatchWaitAudit(data) { export function purchaseGoodsInfoUpdateBatchWaitAudit(data) {
data.method = `${path}purchaseGoodsInfo.updateBatchWaitAudit` data.method = `${path}purchaseGoodsInfo.updateBatchWaitAudit`;
return request(data, "post") return request(data, "post");
} }
// 上下架操作 // 上下架操作
export function purchaseGoodsInfoUpdateStatus(data) { export function purchaseGoodsInfoUpdateStatus(data) {
data.method = `${path}purchaseGoodsInfo.updateStatus` data.method = `${path}purchaseGoodsInfo.updateStatus`;
return request(data, "post") return request(data, "post");
}
// 渠道配置 - 列表查询
export function getPaymentChannelConfigList(data) {
data.method = `${path}paymentChannelConfig.list`;
return request(data);
}
// 渠道配置 - 保存
export function savePaymentChannelConfig(data) {
data.method = `${path}paymentChannelConfig.save`;
return request(data, "post");
} }
import request from "./request" import request from "./request";
const path = 'dj.api.smartcarlife.'
const path = "dj.api.smartcarlife.";
// 获取产品管理 列表数据 // 获取产品管理 列表数据
export function getProductManageList(data) { export function getProductManageList(data) {
data.method = `${path}productManager.page` data.method = `${path}productManager.page`;
return request(data) return request(data);
}
// 获取产品管理列表 SPU 分页(否)
export function getProductManageListPageLimit(data) {
data.method = `${path}productManager.spu.page`;
return request(data);
}
// 获取产品管理列表 pageSku(是)
export function getProductManageListPageSku(data) {
data.method = `${path}productManager.pageSku`;
return request(data);
} }
// 新增产品 // 新增产品:所有参数转 json 字符串赋值到 requestJson
export function addProductManage(data) { export function addProductManage(data) {
data.method = `${path}productManager.add` const requestData = {
return request(data, 'post') method: `${path}productManager.add`,
requestJson: JSON.stringify(data),
};
return request(requestData, "post");
} }
// 编辑产品 // 编辑产品:所有参数转 json 字符串赋值到 requestJson
export function UpdateProductManage(data) { export function UpdateProductManage(data) {
data.method = `${path}productManager.update` const requestData = {
return request(data, 'post') method: `${path}productManager.update`,
requestJson: JSON.stringify(data),
};
return request(requestData, "post");
} }
// 获取权益/升级类目服务项目 // 获取权益/升级类目服务项目
export function getProductServiceItems(data) { export function getProductServiceItems(data) {
data.method = `${path}vd.item.queryServiceItemsGradeConfig` data.method = `${path}vd.item.queryServiceItemsGradeConfig`;
return request(data, 'post') return request(data, "post");
} }
// 批量导入 // 批量导入(通用,已拆分为轻改/延保)
export function productImport(data) { export function productImport(data) {
data.method = `${path}productManager.import` data.method = `${path}productManager.import`;
return request(data, 'post', ["file"]) return request(data, "post", ["file"]);
}
// 轻改SKU批量导入(code -1 时直接展示响应 message,无需 errCode 配置)
export function qinggaiImport(data) {
data.method = `${path}productManager.qinggai.import`;
return request(data, "post", ["file"], { useResponseMessage: true });
}
// 延保SKU批量导入(code -1 时直接展示响应 message,无需 errCode 配置)
export function yanbaoImport(data) {
data.method = `${path}productManager.yanbao.import`;
return request(data, "post", ["file"], { useResponseMessage: true });
} }
// 获取延保类服务项目 // 获取延保类服务项目
export function getExtendServiceItems(data) { export function getExtendServiceItems(data) {
data.method = `${path}vd.item.queryExtendServiceItemsConfig` data.method = `${path}vd.item.queryExtendServiceItemsConfig`;
return request(data, 'post') return request(data, "post");
} }
// 获取延保类服务项目部件列表 // 获取延保类服务项目部件列表
export function getExtendServiceItemsParts(data) { export function getExtendServiceItemsParts(data) {
data.method = `${path}vd.item.getExtendUnitList` data.method = `${path}vd.item.getExtendUnitList`;
return request(data, 'post') return request(data, "post");
} }
// 获取适用车系列表 // 获取适用车系列表
export function getCarSeriesList(data) { export function getCarSeriesList(data) {
data.method = `${path}common.car.series.page` data.method = `${path}common.car.series.page`;
return request(data, 'post') return request(data, "post");
} }
// 分页获取上架商品所需的升级商品信息 // 分页获取上架商品所需的升级商品信息
export function getUpgradeProductList(data) { export function getUpgradeProductList(data) {
data.method = `${path}productManager.listUpgradeGoodsWithPage` data.method = `${path}productManager.listUpgradeGoodsWithPage`;
return request(data, 'post') return request(data, "post");
}
// 根据id查询商品详情
export function getBaseGoodsById(data) {
data.method = "dj.api.basegoods.get.byId";
return request(data);
}
// 分页查询 SKU 详情(商品名称/编码搜索)
export function getBaseGoodsSkuPageById(data) {
data.method = "dj.api.basegoods.get.sku.page.byId";
return request(data);
}
// 分页查询基础商品操作日志
export function getBaseGoodsOperationLogPage(data) {
data.method = "dj.api.basegoods.get.goods.operationLog.page";
return request(data);
}
// 删除 SKU(升级商品)
export function upgradeGoodsDelete(data) {
data.method = "dj.smartcarlife.api.upgradegoods.delete";
return request(data, "post", [], { useResponseMessage: true });
} }
...@@ -5,135 +5,135 @@ ...@@ -5,135 +5,135 @@
* @Last Modified time: 2021-06-30 14:30:41 * @Last Modified time: 2021-06-30 14:30:41
*/ */
import axiosPackage from "axios";
import util from "@/libs/util.js";
import { baseConfig } from "@/main";
// import axios from "@/plugin/axios" // import axios from "@/plugin/axios"
import axios from "@/plugin/axios/index_code" import axios from "@/plugin/axios/index_code";
import sign from "./sign" import RequestMethods from "./request.methods";
import RequestMethods from "./request.methods" import sign from "./sign";
import util from "@/libs/util.js"
import { baseConfig } from "@/main"
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]
}
// console.log("params.method", params.method) function request(params = {}, method = RequestMethods.GET, noSignAttr = [], options = {}) {
// console.log("apiName", apiName) // 兼容线上dj和scrm appkey和secret不一样的情况
// 为空报错 let apiName = "";
if (!apiName) { if (params.method.includes("dj.api.smartcarlife")) {
throw new Error("apiName is null") apiName = "dj";
} } else if (params.method.includes("dj.api.script")) {
const mappingName = { apiName = "script";
"dj.smartcarlife": "axios", } else if (params.method.includes("dj.staff.api")) {
dj: "axios", apiName = "staff";
scrm: "axios2", } else if (params.method.includes("dj.smartcarlife.stock")) {
merchants: "axios3", apiName = "dj.smartcarlife";
reportExport: "axios4", } else if (params.method.includes("risk.manage.api")) {
"glsx.accounts.biz.common.pictureUpload": "common", apiName = "riskmanage";
clue: "axios5", } else if (params.method.includes("dj.api.strategy")) {
"dj.businessSchool": "axios6", apiName = "strategy";
script: "axios7", } else if (params.method.includes("dj.api.supervisor")) {
staff: "axios9", apiName = "supervisor";
riskmanage: "axios10", } else {
strategy: 'axios_strategy' // console.log(params.method.split(".api"))
} apiName = params.method.split(".api")[0];
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]) }
reqData = Object.assign(reqData, options, {}) // console.log("params.method", params.method)
// 请求进度 // console.log("apiName", apiName)
if (params?.onProcess) { // 为空报错
reqData.onUploadProgress = params.onProcess if (!apiName) {
} throw new Error("apiName is null");
// 取消请求 }
if (params?.cancelFun) { const mappingName = {
reqData.cancelToken = new CancelToken(function excutor (c) { "dj.smartcarlife": "axios",
params.cancelFun.cancel = c "dj": "axios",
}) "scrm": "axios2",
} "merchants": "axios3",
// console.log(method === RequestMethods.POST) "reportExport": "axios4",
// console.log(url) "glsx.accounts.biz.common.pictureUpload": "common",
// console.log(options) "clue": "axios5",
// console.log(reqData) "dj.businessSchool": "axios6",
let axiosParams = { "script": "axios7",
url, "staff": "axios9",
method, "riskmanage": "axios10",
...reqData "strategy": "axios_strategy",
} "supervisor": "axios_supervisor",
if (options.returnAll) axiosParams.headers = { 'return-all': true } };
return axios(axiosParams) 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]) };
/** reqData = Object.assign(reqData, options, {});
* mock,请使用以下代码。 // 请求进度
*/ if (params?.onProcess) {
// return axios({ reqData.onUploadProgress = params.onProcess;
// url, }
// method, // 取消请求
// params: sign(params, noSignAttr) 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 = {}) { ...@@ -689,3 +689,101 @@ export function getCommissionListApi(data = {}) {
data.method = "dj.staff.api.staff.performance.commission.list"; data.method = "dj.staff.api.staff.performance.commission.list";
return request(data, "post"); return request(data, "post");
} }
// 获取督导管理列表数据
export function getSupervisorListApi(data = {}) {
data.method = "dj.api.supervisor.manage.page"
return request(data, "post");
}
// 获取督导管理汇总数据
export function getSupervisorSummaryApi(data = {}) {
data.method = "dj.api.supervisor.manage.summary";
return request(data, "post");
}
// 获取近三年的周数据
export function getWeeklyRangesApi(data = {}) {
data.method = "dj.api.supervisor.get.generateWeeklyRanges";
return request(data, "post");
}
// 获取督导详情数据
export function getSupervisorDetailApi(data = {}) {
data.method = "dj.api.supervisor.manage.detail.staff.page"
return request(data, "post")
}
// 获取督导详情汇总数据
export function 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");
}
...@@ -17,6 +17,31 @@ export const BaseData = { ...@@ -17,6 +17,31 @@ export const BaseData = {
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: "张" },
];
/** /**
* 超级管理员类型 * 超级管理员类型
*/ */
...@@ -895,11 +920,23 @@ export const downloadReportManage_reportType = [ ...@@ -895,11 +920,23 @@ export const downloadReportManage_reportType = [
{ confId: "yanbaoMerAndPerRanking", confValue: "门店产值及个人成交排名" }, { confId: "yanbaoMerAndPerRanking", confValue: "门店产值及个人成交排名" },
{ confId: "abnormalClockWeeklySummary", confValue: "打卡异常周汇总表" }, { confId: "abnormalClockWeeklySummary", confValue: "打卡异常周汇总表" },
{ confId: "ClockMonthlySummary", confValue: "打卡月汇总表" }, { confId: "ClockMonthlySummary", confValue: "打卡月汇总表" },
{ confId: "technicianConstructionOrder", confValue: "轻改技师施工单月度汇总表" }, {
confId: "technicianConstructionOrder",
confValue: "轻改技师施工单月度汇总表",
},
{ confId: "yqMerchantGrossProfitReport", confValue: "园区店毛利报表" }, { confId: "yqMerchantGrossProfitReport", confValue: "园区店毛利报表" },
{ confId: "learningCourseReviewReport", confValue: "课程学习复盘报表" }, {
{ confId: "salesDailyMonthlySummaryTable", confValue: "销售日报月汇总表" }, confId: "learningCourseReviewReport",
{ confId: "yanbaoResidentPersonnelEvaluation", confValue: "驻店人员能力定级" }, confValue: "课程学习复盘报表",
},
{
confId: "salesDailyMonthlySummaryTable",
confValue: "销售日报月汇总表",
},
{
confId: "BIAnalysisReport",
confValue: "BI数据分析表",
}
]; ];
// 下载报表 业务类型 // 下载报表 业务类型
...@@ -1943,3 +1980,49 @@ export const contractOrgOpt = [ ...@@ -1943,3 +1980,49 @@ export const contractOrgOpt = [
{ confId: "hzglsk", confValue: "惠州广联" }, { confId: "hzglsk", confValue: "惠州广联" },
{ confId: "szyjzh", 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",
};
<!-- 文件导入弹框通用组件 -->
<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>
...@@ -19,6 +19,7 @@ Vue.component("D2IconSvg", () => import("./d2-icon-svg/index.vue")) ...@@ -19,6 +19,7 @@ Vue.component("D2IconSvg", () => import("./d2-icon-svg/index.vue"))
Vue.component("D2TableHeader", () => import("./d2-table-header/index.vue")) Vue.component("D2TableHeader", () => import("./d2-table-header/index.vue"))
Vue.component("D2Table", () => import("./d2-table/index.vue")) Vue.component("D2Table", () => import("./d2-table/index.vue"))
Vue.component("D2Dialog", () => import("./d2-dialog/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("D2Form", () => import("./d2-form/index.vue"))
Vue.component("D2Search", () => import("./d2-search/index.vue")) Vue.component("D2Search", () => import("./d2-search/index.vue"))
Vue.component("RelateStoreDialog", () => Vue.component("RelateStoreDialog", () =>
......
...@@ -120,9 +120,11 @@ service.interceptors.response.use( ...@@ -120,9 +120,11 @@ service.interceptors.response.use(
// } // }
const dataAxios = response.data; const dataAxios = response.data;
const ruleResult = baseConfig.axios.result; const ruleResult = baseConfig.axios.result;
const errCodeMsg = baseConfig.errCode; const errCodeMsg = baseConfig.errCode || {};
const errCodes = Object.keys(errCodeMsg); const errCodes = Object.keys(errCodeMsg);
const returnAll = response.config.headers["return-all"]; const returnAll = response.config.headers["return-all"];
// 请求级配置:为 true 时,code 为 -1 直接使用响应的 message,不查 errCode 配置
const useResponseMessage = response.config.useResponseMessage;
// console.log("baseConfig", baseConfig) // console.log("baseConfig", baseConfig)
// console.log("response", response) // console.log("response", response)
...@@ -150,17 +152,20 @@ service.interceptors.response.use( ...@@ -150,17 +152,20 @@ service.interceptors.response.use(
case ruleResult.code_error_value: case ruleResult.code_error_value:
// [ 示例 ] code === -1 代表需将返回的message弹窗展示 // [ 示例 ] code === -1 代表需将返回的message弹窗展示
return errorCreate(`${dataAxios[ruleResult.message_key]}`); return errorCreate(`${dataAxios[ruleResult.message_key]}`);
default: default: {
// 不是正确的 code // 不是正确的 code
// console.log(dataAxios) // 请求配置 useResponseMessage 时:code 为 -1 直接使用响应的 message
// errorCreate(`${dataAxios[ruleResult.message_key]}`) const codeStr = String(dataAxios[ruleResult.code_key] ?? "");
const isCodeMinusOne = codeStr === "-1" || +dataAxios[ruleResult.code_key] === -1;
if (useResponseMessage && isCodeMinusOne) {
return errorCreate(`${dataAxios[ruleResult.message_key]}`);
}
if (errCodes.includes(dataAxios[ruleResult.code_key])) { if (errCodes.includes(dataAxios[ruleResult.code_key])) {
return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`); return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`);
} else {
// 返回约定定义之外的错误码直接取message
return errorCreate(`${dataAxios[ruleResult.message_key]}`);
} }
break; // 返回约定定义之外的错误码直接取message
return errorCreate(`${dataAxios[ruleResult.message_key]}`);
}
} }
}, },
......
...@@ -1298,4 +1298,120 @@ export const routerName = { ...@@ -1298,4 +1298,120 @@ export const routerName = {
}, },
component: _import("residentManage/recruitmentManagement/lookRecruitment"), 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"),
}
}; };
...@@ -42,44 +42,11 @@ ...@@ -42,44 +42,11 @@
<auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" /> <auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" />
</d2-table> </d2-table>
</div> </div>
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleImport" @confirmDialog="handleConfirmImport"> <d2-file-import-dialog :is-visible="fileVisible"
<slot> title="上传文件"
<el-form :model="fileForm" ref="fileRuleForm" :rules="fileRules" label-width="120px"> @closeDialog="handleImport"
<!-- <el-form-item v-if="userInfo.beSuper" label="园区店:" prop="yqMerchantId"> @confirmDialog="handleConfirmImport"
<el-select v-model="fileForm.yqMerchantId"> @downloadTemplate="exportTemplate" />
<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-container> </d2-container>
</template> </template>
...@@ -97,17 +64,7 @@ export default { ...@@ -97,17 +64,7 @@ export default {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
hideVisible: false, hideVisible: false,
fileVisible: false, fileVisible: false,
fileForm: {},
total: 0, total: 0,
showNum: false,
importNum: {
succNum: 0,
failNum: 0
},
fileRules: {
yqMerchantId: [{ required: true, message: '请选择园区店', trigger: 'change' }],
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
tableSearchForm: {}, tableSearchForm: {},
searchForm: { searchForm: {
shopOrYqMerchantId: '', shopOrYqMerchantId: '',
...@@ -359,30 +316,7 @@ export default { ...@@ -359,30 +316,7 @@ export default {
handleShowHide() { handleShowHide() {
this.hideVisible = !this.hideVisible 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() { handleImport() {
this.fileForm = {
fileName: ''
}
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
}, },
exportFailList(list) { exportFailList(list) {
...@@ -396,27 +330,22 @@ export default { ...@@ -396,27 +330,22 @@ export default {
formatJson(filterVal, jsonData) { formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j])) return jsonData.map(v => filterVal.map(j => v[j]))
}, },
handleConfirmImport() { handleConfirmImport({ fileName, fileData }) {
this.$refs.fileRuleForm.validate(valid => { var params = {
if (valid) { file: fileData
var params = { }
file: this.fileInfo recordUpload(params).then(res => {
} if (res) {
recordUpload(params).then(res => { const list = [...this.updateList, {
if (res) { name: fileName,
// 异步处理文件上传 把id传入处理轮询 ifSuccess: false,
const list = [...this.updateList, { uuid: res,
name: this.fileForm.fileName, type: 'upload'
ifSuccess: false, }]
uuid: res,
type: 'upload'
}]
this.actionSetDownloadList({ list, type: 'updateList' }) this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功') this.notice.okTips('上传成功')
this.handleImport() this.handleImport()
}
})
} }
}) })
}, },
...@@ -479,29 +408,4 @@ export default { ...@@ -479,29 +408,4 @@ export default {
margin: 0 0; 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> </style>
...@@ -118,14 +118,14 @@ ...@@ -118,14 +118,14 @@
<div slot="content" class="tooltip-content-max"> <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-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"> <div v-for="(item, index) in scope.scope.strategyTypeStatisticsResponse" :key="index">
{{ item.strategyTypeName }}:{{ item.strategyTotalCount }} {{ item.strategyTypeName }}:{{ item.strategyCount }}
</div> </div>
</div> </div>
<div v-else>{{scope.columnsObj.formatter(scope.scope) || '暂无数据'}}</div> <div v-else>{{scope.columnsObj.formatter(scope.scope) || '暂无数据'}}</div>
</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> </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>
<!-- 线上运营 --> <!-- 线上运营 -->
<div slot="onlineOperator" slot-scope="scope"> <div slot="onlineOperator" slot-scope="scope">
...@@ -761,6 +761,33 @@ export default { ...@@ -761,6 +761,33 @@ export default {
this.loading.onlineOperData = false; 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> </script>
......
import dayjs from "dayjs" import dayjs from "dayjs"
const STRATEGYTYPEOPTIONS = { const STRATEGYTYPEOPTIONS = {
0: '学习', 0: '学习',
1: '优秀案例分享', 1: '优秀案例分享',
2: '带教', 2: '带教',
3: '任务下发', 3: '任务下发',
4: '销售精英到店提拉', 4: '销售精英到店提拉',
5: '强力促销', 5: '强力促销',
6: '最终盘点与低客单产品购入', 6: '最终盘点与低客单产品购入',
7: '留言'
} }
const DATE_RANGE = { const DATE_RANGE = {
label: '执行周期', label: '执行周期',
format: (val) => { format: (val) => {
let { startDate, endDate } = val let {
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}` startDate,
} endDate
} = val
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}`
}
} }
const TITLE = { const TITLE = {
label: '标题', label: '标题',
key: 'title', key: 'title',
} }
const CREATED = { const CREATED = {
label: '操作人', label: '操作人',
key: 'createdBy', key: 'createdBy',
} }
const CREATED_DATE = { const CREATED_DATE = {
label: '操作时间', label: '操作时间',
format: (val) => { format: (val) => {
return dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss') return dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss')
} }
} }
const STRATEGY_FORM_01 = [ const STRATEGY_FORM_01 = [
TITLE, TITLE,
DATE_RANGE, DATE_RANGE,
CREATED, CREATED,
CREATED_DATE CREATED_DATE
] ]
const STRATEGY_FORM_2456 = [ const STRATEGY_FORM_2456 = [
CREATED, CREATED,
DATE_RANGE, DATE_RANGE,
{ {
label: '执行人', label: '执行人',
format: (val) => { format: (val) => {
let { executePersons } = val let {
return executePersons.map(item => item.username).join('、') executePersons
}, } = val
hide: (val) => { return executePersons.map(item => item.username).join('/')
let { strategyType } = val },
return [5, 6].includes(strategyType) hide: (val) => {
} let {
}, strategyType
CREATED_DATE } = val
return [5, 6].includes(strategyType)
}
},
CREATED_DATE
] ]
const STRATEGY_FORM_3 = [ const STRATEGY_FORM_3 = [
CREATED, CREATED,
TITLE, TITLE,
CREATED_DATE, CREATED_DATE,
{ {
label: '副标题', label: '副标题',
key: 'subTitle', key: 'subTitle',
class: 'bespread', class: 'bespread',
}, },
{ {
label: '执行时间', label: '执行时间',
key: 'startDate', key: 'startDate',
}, },
]
const STRATEGY_FORM_7 = [
CREATED,
CREATED_DATE,
{
label: '处理人',
format: (val) => {
let {
executePersons
} = val
return executePersons.map(item => item.username).join('/') || '-'
},
},
] ]
export { export {
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_01,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
}
\ No newline at end of file \ No newline at end of file
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_01,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
STRATEGY_FORM_7
}
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
> >
<div class="content"> <div class="content">
<!-- <el-scrollbar class="content"> --> <!-- <el-scrollbar class="content"> -->
<div class="detail-info"> <div :class="['detail-info', { 'detail-info-7': detailInfo.strategyType == 7 }]">
<template v-for="(item,index) in strategyDetailFormList"> <template v-for="(item, index) in strategyDetailFormList">
<div <div
:class="['info-item',item.class]" :class="['info-item', item.class]"
:key="index" :key="index"
v-if="!item.hide || !item.hide(detailInfo)" v-if="!item.hide || !item.hide(detailInfo)"
> >
...@@ -38,15 +38,15 @@ ...@@ -38,15 +38,15 @@
</div> </div>
</template> </template>
</div> </div>
<template v-if="[0,1].includes(detailInfo.strategyType)"> <template v-if="[0, 1].includes(detailInfo.strategyType)">
<study-view <study-view
:info="detailInfo" :info="detailInfo"
@openReceptionDialog="$emit('openReceptionDialog',$event)" @openReceptionDialog="$emit('openReceptionDialog', $event)"
></study-view> ></study-view>
</template> </template>
<template v-if="[5,6].includes(detailInfo.strategyType)"> <template v-if="[5, 6].includes(detailInfo.strategyType)">
<div class="order-info"> <div class="order-info">
<template v-for="(item,index) in orderFormList"> <template v-for="(item, index) in orderFormList">
<div <div
class="info-item flex" class="info-item flex"
:key="index" :key="index"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div class="label">{{ item.label }}:</div> <div class="label">{{ item.label }}:</div>
<div class="value"> <div class="value">
<template v-if="item.format">{{ item.format(detailInfo) }}</template> <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>
</div> </div>
</template> </template>
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
> >
<template #statusHtml="scope"> <template #statusHtml="scope">
<div class="online-status"> <div class="online-status">
<span :class="['dot',{un:scope.scope.readStatus == 0}]"></span> <span :class="['dot', { un: scope.scope.readStatus == 0 }]"></span>
{{ { {{ {
0: '未查看', 0: '未查看',
1: '已查看' 1: '已查看'
...@@ -111,6 +111,7 @@ import { ...@@ -111,6 +111,7 @@ import {
STRATEGY_FORM_01, STRATEGY_FORM_01,
STRATEGY_FORM_2456, STRATEGY_FORM_2456,
STRATEGY_FORM_3, STRATEGY_FORM_3,
STRATEGY_FORM_7
} from './contant' } from './contant'
import StudyView from './StudyView.vue'; import StudyView from './StudyView.vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
...@@ -191,12 +192,18 @@ export default { ...@@ -191,12 +192,18 @@ export default {
} }
}, },
strategyDetailFormList () { strategyDetailFormList () {
const { strategyType } = this.detailInfo, const { strategyType } = this.detailInfo
list = [2, 4, 5, 6].includes(strategyType) const formMap = {
? STRATEGY_FORM_2456 : 0: STRATEGY_FORM_01,
[0, 1].includes(strategyType) 1: STRATEGY_FORM_01,
? STRATEGY_FORM_01 2: STRATEGY_FORM_2456,
: STRATEGY_FORM_3 || [] 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 [ return [
{ {
label: '执行策略', label: '执行策略',
...@@ -269,7 +276,7 @@ export default { ...@@ -269,7 +276,7 @@ export default {
this.setData(data) this.setData(data)
}, },
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.detailInfo = data
this.loading = false this.loading = false
}, },
...@@ -286,19 +293,23 @@ export default { ...@@ -286,19 +293,23 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
::v-deep.strategy-drawer { ::v-deep.strategy-drawer {
.el-drawer__header { .el-drawer__header {
padding: 0; padding: 0;
margin: 0; margin: 0;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
.el-drawer__close-btn { .el-drawer__close-btn {
padding: 0 20px; padding: 0 20px;
.el-dialog__close { .el-dialog__close {
font-weight: 700; font-weight: 700;
font-size: 24px; font-size: 24px;
} }
} }
&-title { &-title {
height: 26px; height: 26px;
line-height: 26px; line-height: 26px;
...@@ -307,12 +318,15 @@ export default { ...@@ -307,12 +318,15 @@ export default {
padding: 17px 20px; padding: 17px 20px;
font-weight: bold; font-weight: bold;
} }
&-content { &-content {
height: calc(100vh - 61px); height: calc(100vh - 61px);
.content { .content {
height: calc(100% - 61px); height: calc(100% - 61px);
padding: 0 20px; padding: 0 20px;
overflow-y: auto; overflow-y: auto;
.detail-info { .detail-info {
margin: 20px 0 16px; margin: 20px 0 16px;
background: #fafafa; background: #fafafa;
...@@ -321,16 +335,19 @@ export default { ...@@ -321,16 +335,19 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
gap: 20px 0; gap: 20px 0;
} }
.info-item { .info-item {
display: flex; display: flex;
width: 50%; width: 50%;
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
.label { .label {
width: 150px; width: 150px;
text-align: right; text-align: right;
line-height: 19px; line-height: 19px;
} }
.value { .value {
color: #333333; color: #333333;
width: calc(100% - 150px); width: calc(100% - 150px);
...@@ -343,9 +360,11 @@ export default { ...@@ -343,9 +360,11 @@ export default {
width: 100%; width: 100%;
word-break: break-all; word-break: break-all;
} }
.order-info { .order-info {
.info-item { .info-item {
margin-bottom: 20px; margin-bottom: 20px;
.value { .value {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
...@@ -353,14 +372,18 @@ export default { ...@@ -353,14 +372,18 @@ export default {
} }
} }
} }
.task { .task {
padding-bottom: 20px; padding-bottom: 20px;
&-content { &-content {
width: 100%; width: 100%;
.label { .label {
width: 170px; width: 170px;
line-height: 19px; line-height: 19px;
} }
.value { .value {
width: calc(100% - 170px); width: calc(100% - 170px);
height: 140px; height: 140px;
...@@ -373,11 +396,13 @@ export default { ...@@ -373,11 +396,13 @@ export default {
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
p { p {
margin: 0 !important; margin: 0 !important;
} }
} }
} }
&-title { &-title {
height: 50px; height: 50px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
...@@ -387,6 +412,7 @@ export default { ...@@ -387,6 +412,7 @@ export default {
margin: 16px 0; margin: 16px 0;
} }
} }
.online-status { .online-status {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -400,11 +426,19 @@ export default { ...@@ -400,11 +426,19 @@ export default {
margin-right: 8px; margin-right: 8px;
background: #2cca74; background: #2cca74;
} }
.un { .un {
background: #eb4e4e; background: #eb4e4e;
} }
} }
.detail-info-7 {
background-color: #fff;
.info-item {
width: 100%;
}
}
} }
.footer { .footer {
padding: 14px 0; padding: 14px 0;
border-top: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5;
......
...@@ -70,7 +70,8 @@ import { ...@@ -70,7 +70,8 @@ import {
STRATEGYTYPEOPTIONS, STRATEGYTYPEOPTIONS,
STRATEGY_01, STRATEGY_01,
STRATEGY_2456, STRATEGY_2456,
STRATEGY_3 STRATEGY_3,
STRATEGY_7
} from './contant' } from './contant'
import { import {
deleteStrategy deleteStrategy
...@@ -98,7 +99,8 @@ export default { ...@@ -98,7 +99,8 @@ export default {
list = [0, 1].includes(strategyType) list = [0, 1].includes(strategyType)
? STRATEGY_01 : [2, 4, 5, 6].includes(strategyType) ? ? STRATEGY_01 : [2, 4, 5, 6].includes(strategyType) ?
STRATEGY_2456 : { STRATEGY_2456 : {
3: STRATEGY_3 3: STRATEGY_3,
7: STRATEGY_7
}[strategyType] || [] }[strategyType] || []
return [ return [
...list, ...list,
......
...@@ -7,6 +7,7 @@ const STRATEGYTYPEOPTIONS = { ...@@ -7,6 +7,7 @@ const STRATEGYTYPEOPTIONS = {
4: '销售精英到店提拉', 4: '销售精英到店提拉',
5: '强力促销', 5: '强力促销',
6: '最终盘点与低客单产品购入', 6: '最终盘点与低客单产品购入',
7: '留言'
} }
const DATE_RANGE = { const DATE_RANGE = {
label: '执行周期', label: '执行周期',
...@@ -20,7 +21,7 @@ const STAFF_FORMAT = (label) => { ...@@ -20,7 +21,7 @@ const STAFF_FORMAT = (label) => {
label, label,
format: (val) => { format: (val) => {
let { staffList } = 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 = [ ...@@ -63,10 +64,18 @@ const STRATEGY_3 = [
} }
}, },
] ]
const STRATEGY_7 = [
{
label: '留言人',
key: 'createdBy',
},
STAFF_FORMAT('处理人')
]
export { export {
STRATEGYTYPEOPTIONS, STRATEGYTYPEOPTIONS,
STRATEGY_01, STRATEGY_01,
STRATEGY_2456, STRATEGY_2456,
STRATEGY_3 STRATEGY_3,
STRATEGY_7,
} }
\ No newline at end of file \ No newline at end of file
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
class="strategy-list" class="strategy-list"
:key="viewKey" :key="viewKey"
v-loading="loading" v-loading="loading"
ref="scrollbar"
> >
<template v-for="(i,index) in list"> <template v-for="(i,index) in list">
<strategy-item <strategy-item
...@@ -22,13 +23,21 @@ ...@@ -22,13 +23,21 @@
:isLast="index == list.length - 1" :isLast="index == list.length - 1"
:class="[{first:index == 0},{last:index == list.length - 1}]" :class="[{first:index == 0},{last:index == list.length - 1}]"
@toDetail="toDetail" @toDetail="toDetail"
@refresh="getStrategyList" @refresh="init"
></strategy-item> ></strategy-item>
</template> </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> </el-scrollbar>
<add-strategy <add-strategy
:dialogVisible.sync="addStrategyVisible" :dialogVisible.sync="addStrategyVisible"
@refresh="getStrategyList" @refresh="init"
></add-strategy> ></add-strategy>
<strategy-detail <strategy-detail
:dialogVisible.sync="strategyDetailVisible" :dialogVisible.sync="strategyDetailVisible"
...@@ -61,20 +70,42 @@ export default { ...@@ -61,20 +70,42 @@ export default {
strategyDetailVisible: false, strategyDetailVisible: false,
currentItem: {}, currentItem: {},
viewKey: Date.now(), viewKey: Date.now(),
loading: false loading: false,
noMoreData: false,
pageNum: 1,
pageSize: 10,
} }
}, },
computed: { computed: {
paramsInfo () { paramsInfo () {
return this.GET_PARAMS_INFO() return this.GET_PARAMS_INFO()
}, },
}, },
mounted () {
mounted () {
},
beforeDestroy () {
const scrollbar = this.$refs.scrollbar;
if (scrollbar && scrollbar.wrap) {
scrollbar.wrap.removeEventListener('scroll', this.handleScroll);
}
}, },
methods: { 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 () { init () {
this.pageNum = 1
this.noMoreData = false
this.list = []
this.getStrategyList() this.getStrategyList()
}, },
toDetail (item) { toDetail (item) {
...@@ -88,24 +119,50 @@ export default { ...@@ -88,24 +119,50 @@ export default {
data = await getStrategyList({ data = await getStrategyList({
merchantId: merchantIds[0], merchantId: merchantIds[0],
biz: 1, biz: 1,
pageNum: 1, pageNum: this.pageNum,
pageSize: 999999 pageSize: this.pageSize
}) })
if (data && data.list) { if (data && data.list) {
let { list } = data let { list } = data
list.map(e => { 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.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.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) { } catch (error) {
this.loading = false this.loading = false
} }
},
handleScroll (event) {
console.log('handleScroll 被触发了!', event)
const wrap = event.target
const scrollTop = wrap.scrollTop
const scrollHeight = wrap.scrollHeight
const clientHeight = wrap.clientHeight
console.log('滚动信息:', { scrollTop, scrollHeight, clientHeight })
if (scrollTop + clientHeight >= scrollHeight - 10 && !this.loading && !this.noMoreData) {
console.log('触发加载下一页,当前页码:', this.pageNum)
this.pageNum++
this.getStrategyList()
}
} }
} }
} }
...@@ -119,6 +176,9 @@ export default { ...@@ -119,6 +176,9 @@ export default {
.strategy { .strategy {
width: 100%; width: 100%;
height: 100%; height: 100%;
::v-deep .el-scrollbar__wrap {
overflow: auto !important;
}
&-title { &-title {
height: 50px; height: 50px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
...@@ -150,4 +210,14 @@ export default { ...@@ -150,4 +210,14 @@ export default {
} }
} }
} }
.loading-more,
.no-more-data {
text-align: center;
padding: 12px 0;
color: #999;
font-size: 12px;
}
.no-more-data {
color: #ccc;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -459,23 +459,10 @@ ...@@ -459,23 +459,10 @@
<download-account-dialog :account-visible="accountVisible" v-if="accountVisible" :scene="searchForm.sceneType" @custTmpl="handleCustTmpl" @handleBill="handleBill" @accountClose="accountClose" /> <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" /> <warehouse-detail v-if="warehouseVisible" :warehouse-visible="warehouseVisible" :order-info-id="orderId" @handleDrawerClose="handleDrawerClose" />
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleImport" @confirmDialog="handleConfirmImport"> <d2-file-import-dialog :is-visible="fileVisible"
<slot> title="上传文件"
<el-form :model="fileForm" ref="fileRuleForm" :rules="fileRules" label-width="120px"> @closeDialog="handleImport"
<el-form-item label="导入文件:" prop="fileName"> @confirmDialog="handleConfirmImport" />
<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>
<tmpl-drawer v-if="tmplDrawerVisible" :tmplDrawerVisible="tmplDrawerVisible" :type="tmplInfo.type" :tmplSelectList="tmplInfo.tmplSelectList" @handleConfirm="handleCustConfirm" @handleClose="handleCustVisible"></tmpl-drawer> <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> <system-bill-dialog v-if="billVisible" :billVisible="billVisible" :billTmplInfo="billTmplInfo" @handleClose="handleBillVisible" @handleConfirm="handleBillVisible"></system-bill-dialog>
</div> </div>
...@@ -748,10 +735,6 @@ export default { ...@@ -748,10 +735,6 @@ export default {
/** 根据场景控制页面显示隐藏end */ /** 根据场景控制页面显示隐藏end */
sceneList: sceneList, sceneList: sceneList,
positionTypeList: [], // 商品部位数据 positionTypeList: [], // 商品部位数据
fileRules: {
fileName: [{ required: true, message: "请上传文件", trigger: "change" }]
},
fileForm: {},
fileVisible: false, fileVisible: false,
tmplDrawerVisible: false, tmplDrawerVisible: false,
tmplInfo: { tmplInfo: {
...@@ -899,62 +882,30 @@ export default { ...@@ -899,62 +882,30 @@ export default {
}, },
handleImport() { handleImport() {
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
}, },
// 上传文件,转码为base64 handleConfirmImport({ fileName, fileData }) {
importFile(e) { var params = {
console.log(e) file: fileData
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 = ''
} }
}, api.uploadFile(params).then((res) => {
handleConfirmImport() { if (res) {
this.$refs.fileRuleForm.validate((valid) => { const list = [
if (valid) { ...this.updateList,
var params = { {
file: this.fileInfo name: fileName,
} ifSuccess: false,
api.uploadFile(params).then((res) => { uuid: res,
if (res) { type: "upload"
// 异步处理文件上传 把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()
} }
}) ]
this.actionSetDownloadList({ list, type: "updateList" })
this.notice.okTips("上传成功")
this.handleBatchImport()
} }
}) })
}, },
handleBatchImport() { handleBatchImport() {
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
}, },
async getBaseData() { async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType) this.baseData.channelTypeList = await this.get(BaseData.channelType)
...@@ -1527,26 +1478,4 @@ export default { ...@@ -1527,26 +1478,4 @@ export default {
margin-right: 5px; margin-right: 5px;
display: inline-block; 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> </style>
<template> <template>
<d2-dialog title="批量复制" <d2-dialog btn-ok-label="确定"
:is-visible.sync="batchCopyVisible" class="relateStore"
width="600px" :is-visible.sync="batchCopyVisible"
btn-ok-label="确定" title="批量复制"
@confirmDialog="handleBatchCopyConfirm" width="600px"
@closeDialog="handleBatchCopyClose" @closeDialog="handleBatchCopyClose"
class="relateStore"> @confirmDialog="handleBatchCopyConfirm">
<el-form label-width="120px" :rules="rules" :model="selectData" ref="batchCopyForm"> <el-form ref="batchCopyForm"
<el-form-item label="业务场景:"> label-width="120px"
<el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input> :model="selectData"
</el-form-item> :rules="rules">
<el-form-item label="复制门店:" prop="selectMerchantObj"> <el-form-item label="业务场景:">
<el-select v-model="selectData.selectMerchantObj" remote reserve-keyword multiple collapse-tags <el-input v-model="sceneList[selectedScene]"
placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod" disabled
v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable> style="width: 370px;">
<el-option v-for="subItem in storeData" :key="subItem.merchantId" </el-input>
:label="subItem.merchantName" :value="subItem" /> </el-form-item>
</el-select> <el-form-item label="复制门店:" prop="selectMerchantObj">
</el-form-item> <el-select v-model="selectData.selectMerchantObj"
</el-form> v-el-select-loadmore="interestsLoadmore"
<div class="tips"> collapse-tags
说明:批量复制至新门店后,系统自动按操作商品,自动更新补充商品对应的上架门店 filterable
</div> multiple
</d2-dialog> 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> </template>
<script> <script>
import { getList, getAccountMerchantList } from '@/api/merchant' import { getAccountMerchantList, getList } from "@/api/merchant";
import { sceneList } from '@/common/constants.js' import { sceneList } from "@/common/constants.js";
export default { export default {
name: 'RelateStoreDialog', name: "RelateStoreDialog",
data() { directives: {
return { "el-select-loadmore": {
storeData: [], bind(el, binding) {
// 分页 setTimeout(() => {
total: 0, const SELECTWRAP_DOM = el.querySelector(
currentPage: 1, ".el-select-dropdown .el-select-dropdown__wrap",
pageSize: 20, );
searchMerchantName: '', SELECTWRAP_DOM.addEventListener("scroll", function () {
sceneList, const condition
selectData: {}, = this.scrollHeight - this.scrollTop <= this.clientHeight;
rules: { selectMerchantObj: [{ required: true, message: '请选择复制门店', trigger: 'blur' }] } if (condition) {
} binding.value();
}, }
directives: { });
'el-select-loadmore': { }, 100);
bind(el, binding) { },
setTimeout(() => { },
const SELECTWRAP_DOM = el.querySelector( },
'.el-select-dropdown .el-select-dropdown__wrap' props: {
) batchCopyVisible: {
SELECTWRAP_DOM.addEventListener('scroll', function () { type: Boolean,
const condition = default: false,
this.scrollHeight - this.scrollTop <= this.clientHeight },
if (condition) { selectedScene: {
binding.value() type: Number,
} },
}) },
}, 100) data() {
} return {
} storeData: [],
}, // 分页
props: { total: 0,
batchCopyVisible: { currentPage: 1,
type: Boolean, pageSize: 20,
default: false searchMerchantName: "",
}, sceneList,
selectedScene: { selectData: {},
type: Number rules: { selectMerchantObj: [{ required: true, message: "请选择复制门店", trigger: "blur" }] },
} };
}, },
mounted() { mounted() {
this.getList() 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')
}
}
}
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> </script>
<style lang="scss"> <style lang="scss">
.tips{ .tips {
font-size: 14px; font-size: 14px;
color: #999; color: #999;
} }
</style> </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.
<!--
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2024-06-12 15:21:09
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-03-23 18:41:31
* @FilePath: \dj-car-life-system\src\views\goods\grounding\components\relateStoreTable.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<div class="store-table"> <div class="store-table">
<el-table <el-table border
:data="merchantGoodsRefList" :data="merchantGoodsRefList"
style="width: 100%" header-cell-class-name="header-cell-class-name"
:header-row-style="headerRowStyle" :header-row-style="headerRowStyle"
header-cell-class-name="header-cell-class-name" style="width: 100%">
border> <el-table-column align="center"
<el-table-column label="序号"
align="center" type="index"
width="60px" width="60px" />
label="序号" <el-table-column align="center"
type="index" /> label="门店名称"
<el-table-column prop="merchantName" />
prop="merchantName" <el-table-column align="center"
label="门店名称" label="门店商户号"
align="center" /> prop="merchantId" />
<el-table-column <el-table-column v-if="!isHide"
prop="merchantId" align="center"
label="门店商户号" label="库存管控">
align="center" /> <template #default="scope">
<el-table-column <span v-if="isDetail">{{ scope.row.inventoryType == 1 ? '虚拟' : '实物' }}</span>
label="操作" <el-select v-else
align="center" v-model="scope.row.inventoryType"
v-if="!isDetail" placeholder="请选择">
width="90">
<template slot-scope="scope"> <el-option label="实物" :value="2"></el-option>
<el-button <el-option label="虚拟" :value="1"></el-option>
type="text" </el-select>
@click="handleDelete(scope.row)">删除</el-button> </template>
</template> </el-table-column>
</el-table-column> <el-table-column v-if="!isDetail"
</el-table> align="center"
</div> label="操作"
width="90">
<template #default="scope">
<el-button type="text"
@click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'RelateProTable', name: "RelateProTable",
props: { props: {
merchantGoodsRefList: { merchantGoodsRefList: {
type: Array, type: Array,
default: () => {} default: () => {},
}, },
isDetail: { isDetail: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, isHide: {
data() { type: Boolean,
return { default: false,
} },
}, },
methods: { data() {
handleDelete(item) { return {
this.$emit('handleDelete', item) };
}, },
headerRowStyle() { methods: {
return { handleDelete(item) {
height: '40px', this.$emit("handleDelete", item);
background: '#F2F4F7' },
} headerRowStyle() {
} return {
} height: "40px",
} background: "#F2F4F7",
};
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.store-table{ .store-table {
margin-top: 15px; margin-top: 15px;
} }
::v-deep .header-cell-class-name{ ::v-deep .header-cell-class-name {
height: 30px; height: 30px;
background: #F2F4F7; background: #f2f4f7;
} }
::v-deep .el-table th{ ::v-deep .el-table th {
padding: 0; padding: 0;
} }
::v-deep .el-table__body-wrapper tr td{ ::v-deep .el-table__body-wrapper tr td {
padding: 8px 0 !important; padding: 8px 0 !important;
} }
</style> </style>
This diff could not be displayed because it is too large.
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
</div> </div>
</div> </div>
<div class="speci-box" id="specificationDetailList"> <div class="speci-box" id="specificationDetailList">
<singleSpecificationForm ref="singleSpecificationFormRef" v-show="goodsInfoData.specificationType == '1'" <singleSpecificationForm ref="singleSpecificationFormRef" v-if="goodsInfoData.specificationType == '1'"
:product-service-item-list="productServiceItemList" :extend-service-part-list="extendServicePartList"> :product-service-item-list="productServiceItemList" :extend-service-part-list="extendServicePartList">
</singleSpecificationForm> </singleSpecificationForm>
<multipleSpecificationForm ref="multipleSpecificationFormRef" v-show="goodsInfoData.specificationType == '2'" <multipleSpecificationForm ref="multipleSpecificationFormRef" v-if="goodsInfoData.specificationType == '2'"
:product-service-item-list="productServiceItemList" :extend-service-part-list="extendServicePartList"> :product-service-item-list="productServiceItemList" :extend-service-part-list="extendServicePartList">
</multipleSpecificationForm> </multipleSpecificationForm>
</div> </div>
......
/**
* SKU 表格列宽拖拽调整 mixin
* 使用方需提供: $refs.headerRow (表头 tr), $refs.bodyTable (表体 table)
*/
const MIN_COL_WIDTH = 80;
const MAX_COL_WIDTH = 800;
const RESIZE_DELTA_SCALE = 2;
export default {
data() {
return {
columnWidths: [],
_resizeState: null,
};
},
watch: {
columnWidths: {
handler() {
this.$nextTick(() => this.applyColumnWidths());
},
deep: true,
},
},
mounted() {
this.$nextTick(() => this.initColumnWidths());
},
updated() {
this.$nextTick(() => {
this.initColumnWidths();
this.applyColumnWidths();
});
},
beforeDestroy() {
this._removeResizeListeners();
},
methods: {
initColumnWidths() {
const row = this.$refs.headerRow;
if (!row) return;
const el = row.$el || row;
const tds = el.querySelectorAll ? el.querySelectorAll("td") : [];
if (tds.length === 0) return;
const buildDefaults = () =>
Array.from(tds).map((td, i, arr) => {
const len = arr.length;
if (i === 0) return 75; // checkbox
if (i === len - 1) return 60; // 操作
// 仅信任已拖拽写入的 style.width;不要用 getBoundingClientRect:
// 多规格前几列为动态列时,表格横向未撑开会读到极窄宽度并固化进 columnWidths,导致整表被压扁
const parsed = parseInt(td.style.width, 10);
// 纠正时 td 上可能仍残留错误 inline 宽度,需忽略小于列拖拽下限的值
if (!Number.isNaN(parsed) && parsed >= MIN_COL_WIDTH) return parsed;
return 220;
});
if (this.columnWidths.length !== tds.length) {
const defaults = buildDefaults();
this.columnWidths = this.columnWidths.length
? defaults.map((d, i) => (i < this.columnWidths.length ? this.columnWidths[i] : d))
: defaults;
} else if (
this.columnWidths.some(
(w, i) => i > 0 && i < tds.length - 1 && typeof w === "number" && w > 0 && w < 120,
)
) {
// 纠正历史错误:中间列曾被压成几十像素并持久化
this.columnWidths = buildDefaults();
}
},
applyColumnWidths() {
if (!this.columnWidths.length) return;
const row = this.$refs.headerRow;
if (row) {
const el = row.$el || row;
const tds = el.querySelectorAll ? el.querySelectorAll("td") : [];
tds.forEach((td, i) => {
if (this.columnWidths[i] != null) {
td.style.width = `${this.columnWidths[i]}px`;
td.style.minWidth = `${this.columnWidths[i]}px`;
td.style.flex = `0 0 ${this.columnWidths[i]}px`;
}
});
}
const bodyTable = this.$refs.bodyTable;
if (bodyTable) {
const tableEl = bodyTable.$el || bodyTable;
const rows = tableEl.querySelectorAll ? tableEl.querySelectorAll("tbody tr") : [];
rows.forEach((tr) => {
const tds = tr.querySelectorAll("td");
tds.forEach((td, i) => {
if (this.columnWidths[i] != null) {
td.style.width = `${this.columnWidths[i]}px`;
td.style.minWidth = `${this.columnWidths[i]}px`;
td.style.flex = `0 0 ${this.columnWidths[i]}px`;
}
});
});
}
},
onResizeStart(e) {
const handle = e.currentTarget;
const td = handle.closest("td");
if (!td) return;
const row = td.parentElement;
const tds = row ? Array.from(row.querySelectorAll("td")) : [];
const index = tds.indexOf(td);
if (index < 0) return;
const startX = e.clientX;
const startWidth = this.columnWidths[index] || 220;
const minW = index === 0 ? 75 : index === tds.length - 1 ? 60 : MIN_COL_WIDTH;
const maxW = index === 0 ? 75 : index === tds.length - 1 ? 60 : MAX_COL_WIDTH;
this._resizeState = { index, startX, startWidth, minW, maxW };
this._onResizeMove = (ev) => {
const delta = (ev.clientX - startX) * RESIZE_DELTA_SCALE;
let newWidth = Math.round(startWidth + delta);
newWidth = Math.max(minW, Math.min(maxW, newWidth));
this.$set(this.columnWidths, index, newWidth);
};
this._onResizeUp = () => this._removeResizeListeners();
document.addEventListener("mousemove", this._onResizeMove);
document.addEventListener("mouseup", this._onResizeUp);
document.body.style.cursor = "col-resize";
document.body.style.userSelect = "none";
},
_removeResizeListeners() {
if (this._onResizeMove) {
document.removeEventListener("mousemove", this._onResizeMove);
this._onResizeMove = null;
}
if (this._onResizeUp) {
document.removeEventListener("mouseup", this._onResizeUp);
this._onResizeUp = null;
}
document.body.style.cursor = "";
document.body.style.userSelect = "";
this._resizeState = null;
},
},
};
/**
* 原生 table 虚拟滚动 mixin
* 使用方需提供: listData, getRowKey, filterRow(可选)
*/
export default {
data() {
return {
virtualScrollTop: 0
}
},
watch: {
virtualScrollDisplayList: {
handler(list) {
const rowHeight = this.virtualScrollRowHeight || 40
if (!list || list.length === 0) {
this.virtualScrollTop = 0
return
}
const maxTop = Math.max(0, (list.length || 0) * rowHeight - (this.virtualScrollContainerHeight || 400))
if (this.virtualScrollTop > maxTop) {
this.virtualScrollTop = maxTop
}
}
}
},
computed: {
virtualScrollDisplayList() {
const list = this.listData || []
const filterRow = this.filterRow || (() => true)
const getRowKey = this.getRowKey || ((item, idx) => 'row-' + idx)
return list
.map((item, idx) => ({
item,
originalIndex: idx,
key: getRowKey.call(this, item, idx)
}))
.filter(({ item }) => filterRow.call(this, item))
},
virtualScrollVisibleRows() {
const list = this.virtualScrollDisplayList
const rowHeight = this.virtualScrollRowHeight || 40
const containerHeight = this.virtualScrollContainerHeight || 400
const buffer = this.virtualScrollBuffer || 5
const start = Math.max(0, Math.floor(this.virtualScrollTop / rowHeight) - buffer)
const visibleCount = Math.ceil(containerHeight / rowHeight)
const end = Math.min(list.length, start + visibleCount + 2 * buffer)
return list.slice(start, end)
},
virtualScrollTotalHeight() {
const list = this.virtualScrollDisplayList
const rowHeight = this.virtualScrollRowHeight || 40
return Math.max(0, (list?.length || 0) * rowHeight)
},
virtualScrollOffsetY() {
const rowHeight = this.virtualScrollRowHeight || 40
const buffer = this.virtualScrollBuffer || 5
const start = Math.max(0, Math.floor(this.virtualScrollTop / rowHeight) - buffer)
return start * rowHeight
}
},
methods: {
virtualScrollOnScroll(e) {
this.virtualScrollTop = e.target.scrollTop
}
}
}
...@@ -117,29 +117,11 @@ ...@@ -117,29 +117,11 @@
:selected-scene="batchCopySelectScene" @handleBatchCopyConfirm="handleBatchCopyConfirm" :selected-scene="batchCopySelectScene" @handleBatchCopyConfirm="handleBatchCopyConfirm"
@handleBatchCopyClose="handleBatchCopyClose"> @handleBatchCopyClose="handleBatchCopyClose">
</batch-copy-dialog> </batch-copy-dialog>
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleBatchImport" <d2-file-import-dialog :is-visible="fileVisible"
@confirmDialog="handleConfirmImport"> title="上传文件"
<slot> @closeDialog="handleBatchImport"
<el-form :model="fileForm" ref="fileRuleForm" :rules="fileRules" label-width="120px"> @confirmDialog="handleConfirmImport"
<el-form-item label="导入文件:" prop="fileName"> @downloadTemplate="exportTemplate" />
<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 type="primary" class="import-template" icon="el-icon-link" @click="exportTemplate">
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
</d2-container> </d2-container>
</template> </template>
<script> <script>
...@@ -520,10 +502,6 @@ export default { ...@@ -520,10 +502,6 @@ export default {
batchCopySelectScene: '', // 批量复制选中的场景值 batchCopySelectScene: '', // 批量复制选中的场景值
batchCopyVisible: false, batchCopyVisible: false,
batchCopySelectData: [], // 批量辅助选中的上架数据 batchCopySelectData: [], // 批量辅助选中的上架数据
fileRules: {
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
fileForm: {},
fileVisible: false fileVisible: false
} }
}, },
...@@ -704,48 +682,23 @@ export default { ...@@ -704,48 +682,23 @@ export default {
}, },
handleBatchImport() { handleBatchImport() {
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
}, },
// 上传文件,转码为base64 handleConfirmImport({ fileName, fileData }) {
importFile(e) { var params = {
const size = e.target.files[0].size / 1024 / 1024 file: fileData
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 = ''
} }
}, groundingImport(params).then(res => {
handleConfirmImport() { if (res) {
this.$refs.fileRuleForm.validate(valid => { const list = [...this.updateList, {
if (valid) { name: fileName,
var params = { ifSuccess: false,
file: this.fileInfo uuid: res,
} type: 'upload'
groundingImport(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.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功') this.notice.okTips('上传成功')
this.handleBatchImport() this.handleBatchImport()
}
})
} }
}) })
}, },
...@@ -982,30 +935,5 @@ export default { ...@@ -982,30 +935,5 @@ export default {
margin-left: 8px; margin-left: 8px;
} }
.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> </style>
...@@ -93,52 +93,11 @@ ...@@ -93,52 +93,11 @@
</slot> </slot>
</d2-dialog> </d2-dialog>
<!-- 导入门店设置 --> <d2-file-import-dialog :is-visible="fileVisible"
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleImport" title="上传文件"
@confirmDialog="handleConfirmImport" width="600px"> @closeDialog="handleImport"
<slot> @confirmDialog="handleConfirmImport"
<div> @downloadTemplate="downLoadTemplate" />
<el-form :model="fileForm" :rules="fileRules" ref="fileRuleForm" 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)" />
<!-- href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/对账单模版.xlsx" -->
<el-link type="primary" class="import-template" @click="downLoadTemplate" icon="el-icon-link">
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
<span v-show="showNum">
<div class="upload-statistics">
<div class="quantity">
<div class="success">{{ importNum.successCount }}</div>
<div>有效数据</div>
</div>
<div class="line"></div>
<div class="quantity">
<div class="err">{{ importNum.failCount }}</div>
<div>异常数据</div>
</div>
</div>
<div class="abnormal">
<p>数据异常的可能原因:</p>
<p class="color-33">
1. 订单编号不匹配
</p>
</div>
</span>
</div>
</slot>
</d2-dialog>
</div> </div>
</template> </template>
...@@ -162,15 +121,6 @@ export default { ...@@ -162,15 +121,6 @@ export default {
data() { data() {
return { return {
fileVisible: false, fileVisible: false,
showNum: false,
importNum: {
succNum: 0,
failNum: 0
},
fileForm: {},
fileRules: {
fileName: [{ required: true, message: "请上传文件", trigger: "change" }]
},
pickerOptions: { pickerOptions: {
disabledDate: (time) => { disabledDate: (time) => {
const maxMonth = dayjs().subtract(-1, 'months').endOf('month') const maxMonth = dayjs().subtract(-1, 'months').endOf('month')
...@@ -297,109 +247,22 @@ export default { ...@@ -297,109 +247,22 @@ export default {
result && downLoadFile(result) result && downLoadFile(result)
}) })
}, },
// 上传文件,转码为base64
importFile(e) {
const size = e.target.files[0].size / 1024 / 1024
console.log(e)
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(".")[1] + "@" + arrBase64[1]
// orderManage.pictureUpload({ file: this.fileInfo }).then((res) => {
// if (res) {
// this.fileForm.fileUrl = res
// }
// // const refName = "file" + row.id
// // const refName = "file"
// e.target.value = ""
// // this.$refs[refName].value = ""
// })
document.getElementById("fileUpload").value = ""
}
} else {
this.notice.errorTips("上传文件不可超过9M")
document.getElementById("fileUpload").value = ""
}
},
handleImport() { handleImport() {
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
}, },
handleConfirmImport() { handleConfirmImport({ fileName, fileData }) {
this.$refs.fileRuleForm.validate((valid) => { merchantOutputValueTargetImport({ file: fileData }).then((result) => {
if (valid) { if (result) {
// var params = { const list = [...this.updateList, {
// fileUrl: this.fileForm.fileUrl name: fileName,
// } ifSuccess: false,
merchantOutputValueTargetImport({ file: this.fileInfo }).then((result) => { uuid: result,
if (result) { type: 'upload'
// 异步处理文件上传 把id传入处理轮询 }]
const list = [...this.updateList, {
name: this.fileForm.fileName,
ifSuccess: false,
uuid: result,
type: 'upload'
}]
this.actionSetDownloadList({ list, type: 'updateList' }) this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功') this.notice.okTips('上传成功')
this.handleImport() this.handleImport()
}
// console.log(result, 'result')
// const { url, dataList } = result
// console.log(url, 'url')
// if (url) {
// // this.$message.error('上传失败')
// this.$message.error('上传失败')
// downLoadFile(url)
// }
// if (dataList) {
// this.$message.success('上传成功')
// this.fileVisible = false
// this.hasPage = false
// // const listFilter = result.list
// this.tableData = dataList.map((item) => {
// item.dataMonth = this.search.targetDate
// item.isEdit = true
// item.areaSupervision = item.areaSupervision || {}
// item.residentManager = item.residentManager || {}
// item.area = item.area || ''
// // item.residentManagerOptionsList = item.residentManager?{}
// if (item.residentManager) {
// item.residentManagerOptionsList = [{
// userId: item.residentManager.userId,
// userName: item.residentManager.userName,
// userNum: item.residentManager.userNum,
// userType: item.residentManager.userType
// }]
// } else {
// item.residentManagerOptionsList = []
// }
// return item
// })
// // this.tableTotal = result.total
// }
})
// .catch((err) => {
// })
// orderManage.orderEndExportApi(params).then((res) => {
// if (res) {
// this.showNum = true
// this.importNum = {
// successCount: res.successCount,
// failCount: res.failCount
// }
// this.$message.success('上传成功')
// // this.handleImport()
// }
// })
} }
}) })
}, },
...@@ -602,66 +465,4 @@ export default { ...@@ -602,66 +465,4 @@ export default {
margin-top: 94px; margin-top: 94px;
} }
.upload-wrap {
display: flex;
}
.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;
}
.m-l-md {
margin-left: 20px;
}
.upload-statistics {
display: flex;
align-items: center;
justify-content: space-between;
margin: 30px 70px;
.quantity {
font-size: 14px;
color: #333333;
text-align: center;
.success {
font-size: 26px;
color: #2cca74;
text-align: center;
margin-bottom: 4px;
}
.err {
font-size: 26px;
color: #eb4e4e;
text-align: center;
margin-bottom: 4px;
}
}
.line {
width: 1px;
height: 56px;
background: #e8e8ea;
}
}
</style> </style>
...@@ -24,26 +24,11 @@ ...@@ -24,26 +24,11 @@
<auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" /> <auth-button slot="auth-button" slot-scope="scope" :data="scope.scope" />
</d2-table> </d2-table>
</div> </div>
<d2-dialog :title="'上传文件'" :is-visible="fileVisible" @closeDialog="handleImport" @confirmDialog="handleConfirmImport"> <d2-file-import-dialog :is-visible="fileVisible"
<slot> title="上传文件"
<el-form :model="fileForm" ref="fileRuleForm" :rules="fileRules" label-width="120px"> @closeDialog="handleImport"
<el-form-item label="导入文件:" prop="fileName"> @confirmDialog="handleConfirmImport"
<el-col :span="16"> @downloadTemplate="exportTemplate" />
<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-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<d2-dialog :title="chooseType" @closeDialog="handleObject" @confirmDialog="handleConfirmObject" <d2-dialog :title="chooseType" @closeDialog="handleObject" @confirmDialog="handleConfirmObject"
:is-visible="pushVisible"> :is-visible="pushVisible">
<slot> <slot>
...@@ -92,9 +77,7 @@ export default { ...@@ -92,9 +77,7 @@ export default {
data() { data() {
return { return {
state, state,
// 上传文件数据
fileVisible: false, fileVisible: false,
fileForm: {},
// 搜索表格数据 // 搜索表格数据
tableSearchForm: {}, tableSearchForm: {},
searchForm: { searchForm: {
...@@ -170,9 +153,6 @@ export default { ...@@ -170,9 +153,6 @@ export default {
} }
] ]
}, },
fileRules: {
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
changeList: [], changeList: [],
superviseList: [], superviseList: [],
residentialList: [], residentialList: [],
...@@ -196,25 +176,6 @@ export default { ...@@ -196,25 +176,6 @@ export default {
methods: { methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
...mapMutations('d2admin/user', ['setUpdateRefesh']), ...mapMutations('d2admin/user', ['setUpdateRefesh']),
// 上传文件,转码为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('.')[1] + '@' + arrBase64[1]
document.getElementById('fileUpload').value = ''
}
} else {
this.notice.errorTips('上传文件不可超过9M')
document.getElementById('fileUpload').value = ''
}
},
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = deepClone(this.searchForm) this.tableSearchForm = deepClone(this.searchForm)
...@@ -224,38 +185,31 @@ export default { ...@@ -224,38 +185,31 @@ export default {
keyDowmGetList() { keyDowmGetList() {
this.$refs.outputValueTable.refreshTable() this.$refs.outputValueTable.refreshTable()
}, },
handleConfirmImport() { handleConfirmImport({ fileName, fileData }) {
this.$refs.fileRuleForm.validate(valid => { var params = {
if (valid) { file: fileData
var params = { }
file: this.fileInfo importContact(params).then(res => {
} if (res) {
importContact(params).then(res => { const list = [...this.updateList, {
if (res) { name: fileName,
// 异步处理文件上传 把id传入处理轮询 ifSuccess: false,
const list = [...this.updateList, { uuid: res,
name: this.fileForm.fileName, type: 'upload'
ifSuccess: false, }]
uuid: res,
type: 'upload'
// labelText: ''
}]
this.actionSetDownloadList({ list, type: 'updateList' }) this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功') this.notice.okTips('上传成功')
this.handleImport() this.handleImport()
}
})
} }
}) })
}, },
handleImport() { handleImport() {
// this.fileForm = {
// fileName: ''
// }
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
}, },
exportTemplate() {
window.open('http://img01.glsx.com.cn/upload/salesexcel/企微推送对象导入模板.xlsx')
},
merchantData(type) { merchantData(type) {
const superviseParams = { const superviseParams = {
currentPage: 1, currentPage: 1,
...@@ -401,31 +355,5 @@ export default { ...@@ -401,31 +355,5 @@ export default {
.outputValue-list { .outputValue-list {
position: relative; position: relative;
} }
.outputValue-list .m-l-md {
margin-left: 20px;
}
.outputValue-list .import-btn {
position: relative;
}
.outputValue-list .import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.outputValue-list .import-template {
position: absolute;
height: 20px;
top: 50px;
left: 0;
}
</style> </style>
...@@ -605,46 +605,11 @@ ...@@ -605,46 +605,11 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
@size-change="handleSizeChange" /> @size-change="handleSizeChange" />
</div> </div>
<d2-dialog :is-visible="fileVisible" <d2-file-import-dialog :is-visible="fileVisible"
title="上传文件" title="上传文件"
@closeDialog="handleImport" @closeDialog="handleImport"
@confirmDialog="handleConfirmImport"> @confirmDialog="handleConfirmImport"
<slot> @downloadTemplate="exportTemplate" />
<el-form ref="fileRuleForm"
label-width="120px"
:model="fileForm"
:rules="fileRules">
<el-form-item label="导入文件:" prop="fileName">
<el-col :span="16">
<el-input v-model="fileForm.fileName" readonly />
</el-col>
<el-col class="m-l-md" :span="4">
<el-button class="import-btn">
导入文件
<input id="fileUpload"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
class="import-input"
type="file"
@change="importFile($event)" />
<el-link class="import-template"
href="http://img01.glsx.com.cn/upload/salesexcel/园区店客户订单导入模板.xlsx"
icon="el-icon-link"
type="primary">
模版下载
</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>
<!-- 选择分账规则 --> <!-- 选择分账规则 -->
<ChooseRuleDialog v-if="ruleVisible" <ChooseRuleDialog v-if="ruleVisible"
...@@ -714,15 +679,6 @@ export default { ...@@ -714,15 +679,6 @@ export default {
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
fileForm: {},
fileRules: {
fileName: [{ required: true, message: "请上传文件", trigger: "change" }],
},
showNum: false,
importNum: {
succNum: 0,
failNum: 0,
},
fileVisible: false, fileVisible: false,
waitOrderNum: 0, waitOrderNum: 0,
statusOpts: { statusOpts: {
...@@ -1394,73 +1350,32 @@ export default { ...@@ -1394,73 +1350,32 @@ export default {
}, },
handleImport() { handleImport() {
this.fileVisible = !this.fileVisible; this.fileVisible = !this.fileVisible;
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields();
}, },
// 上传文件,转码为base64 handleConfirmImport({ fileName, fileData }) {
importFile(e) { let params = {
// console.log(e) file: fileData,
const size = e.target.files[0].size / 1024 / 1024; };
if (size < 9) { orderImport(params).then((res) => {
this.$set(this.fileForm, "fileName", e.target.files[0].name); if (res) {
// // 转码base64 const list = [
const reader = new FileReader(); ...this.updateList,
reader.readAsDataURL(e.target.files[0]); {
reader.onload = (event) => { name: fileName,
const imgFile = event.target.result; ifSuccess: false,
const arrBase64 = imgFile.split(","); uuid: res,
this.fileInfo type: "upload",
= e.target.files[0].name.split(".")[1] + "@" + arrBase64[1]; },
document.getElementById("fileUpload").value = ""; ];
};
} else {
this.notice.errorTips("上传文件不可超过9M");
document.getElementById("fileUpload").value = "";
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate((valid) => {
if (valid) {
let params = {
// advanceUserId: this.userInfo.detail.uuid,
// advanceUserName: this.userInfo.merchantAccountLevel == 4 ? this.userInfo.detail.userName : this.userInfo.detail.merchantName,
// yqMerchantId: this.userInfo.beSuper ? this.fileForm.yqMerchantId : this.userInfo.detail.merchantId,
file: this.fileInfo,
};
orderImport(params).then((res) => {
// console.log(res)
if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [
...this.updateList,
{
name: this.fileForm.fileName,
ifSuccess: false,
uuid: res,
type: "upload",
// labelText: ''
},
];
this.actionSetDownloadList({ list, type: "updateList" }); this.actionSetDownloadList({ list, type: "updateList" });
this.notice.okTips("上传成功"); this.notice.okTips("上传成功");
this.handleImport(); this.handleImport();
}
// this.showNum = !!res.failNum
// res.succNum && this.$refs.recordTable.refreshTable()
// if (res.failNum) {
// this.importNum = {
// succNum: res.succNum,
// failNum: res.failNum
// }
// this.exportFailList(res.errorList)
// return true
// }
// this.handleImport()
// this.notice.okTips('上传成功')
});
} }
}); });
}, },
exportTemplate() {
window.open('http://img01.glsx.com.cn/upload/salesexcel/园区店客户订单导入模板.xlsx');
},
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
sceneType: 0, sceneType: 0,
...@@ -1999,30 +1914,4 @@ export default { ...@@ -1999,30 +1914,4 @@ export default {
margin-top: 40px; margin-top: 40px;
} }
.order-list .m-l-md {
margin-left: 20px;
}
// .order-list
.order-list .import-btn {
position: relative;
}
.order-list .import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.order-list .import-template {
position: absolute;
height: 20px;
top: 50px;
left: 0;
}
</style> </style>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
{{ scope.scope[scope.prop].value {{ scope.scope[scope.prop].value
}}{{ scope.scope[scope.prop].suffix }} }}{{ scope.scope[scope.prop].suffix }}
</div> </div>
<div class="precent"> <!-- <div class="precent">
<template v-if="scope.scope[scope.prop].monthRate"> <template v-if="scope.scope[scope.prop].monthRate">
<div :class=" <div :class="
scope.scope[scope.prop].monthRate > 0 scope.scope[scope.prop].monthRate > 0
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</div> </div>
</template> </template>
<template v-else>周 -</template> <template v-else>周 -</template>
</div> </div> -->
</div> </div>
<div slot="upload" class="upload-box" slot-scope="scope"> <div slot="upload" class="upload-box" slot-scope="scope">
<div class="uploade-btn" v-show="!scope.scope['assessmentResult' + trainTmlpSuffix]" @click="handleUpload(scope.scope)"> <div class="uploade-btn" v-show="!scope.scope['assessmentResult' + trainTmlpSuffix]" @click="handleUpload(scope.scope)">
......
...@@ -58,42 +58,11 @@ ...@@ -58,42 +58,11 @@
</div> </div>
</d2-table> </d2-table>
</div> </div>
<d2-dialog :title="'上传文件'" <d2-file-import-dialog :is-visible="fileVisible"
:is-visible="fileVisible" title="上传文件"
@closeDialog="handleBatchImport" @closeDialog="handleBatchImport"
@confirmDialog="handleConfirmImport"> @confirmDialog="handleConfirmImport"
<slot> @downloadTemplate="exportTemplate" />
<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-link type="primary"
class="import-template"
icon="el-icon-link"
@click="exportTemplate">
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 新增积分记录 --> <!-- 新增积分记录 -->
<add-dialog :add-visible="addVisible" <add-dialog :add-visible="addVisible"
...@@ -300,10 +269,6 @@ export default { ...@@ -300,10 +269,6 @@ export default {
handleVisible: false, handleVisible: false,
recordInfo: {}, recordInfo: {},
params_obj: {}, params_obj: {},
fileRules: {
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
fileForm: {},
fileVisible: false, fileVisible: false,
addVisible: false addVisible: false
} }
...@@ -433,48 +398,16 @@ export default { ...@@ -433,48 +398,16 @@ export default {
}, },
handleBatchImport() { handleBatchImport() {
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
}, },
// 上传文件,转码为base64 handleConfirmImport({ fileName, fileData }) {
importFile(e) { var params = {
const size = e.target.files[0].size / 1024 / 1024 file: fileData
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 = ''
} }
}, pointImport(params).then(res => {
handleConfirmImport() { if (res) {
this.$refs.fileRuleForm.validate(valid => { this.notice.okTips(res)
if (valid) { this.handleBatchImport()
var params = { this.$refs.detailListTable.refreshTable()
file: this.fileInfo
}
pointImport(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(res)
this.handleBatchImport()
this.$refs.detailListTable.refreshTable()
}
})
} }
}) })
}, },
...@@ -516,28 +449,6 @@ export default { ...@@ -516,28 +449,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.points-record { .points-record {
margin-top: 40px; margin-top: 40px;
.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;
}
} }
.more-info { .more-info {
white-space: nowrap; white-space: nowrap;
......
...@@ -9,37 +9,9 @@ ...@@ -9,37 +9,9 @@
:search-form="searchForm" :search-form="searchForm"
:form-data="showFormData" :form-data="showFormData"
> >
<div slot="firstClassify"> <template slot="phone">
<el-select <el-input v-model="searchForm.phone" maxlength="11" placeholder="请输入手机号" @input="handlePhoneInput"></el-input>
v-model="searchForm.firstClassify" </template>
clearable
placeholder="请选择"
@change="changeClassify"
>
<el-option
v-for="item in baseData.firstClassifyList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</div>
<div slot="secondClassify">
<el-select
v-model="searchForm.secondClassify"
clearable
placeholder="请选择"
>
<el-option
v-for="item in baseData.secondClassifyList"
:key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
</div>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary"> <el-button @click="handleSearch" size="small" type="primary">
...@@ -81,27 +53,21 @@ export default { ...@@ -81,27 +53,21 @@ export default {
data() { data() {
return { return {
searchForm: { searchForm: {
firstClassify: "", supervisionName: "",
secondClassify: "", phone: ""
content: ""
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [ showFormData: [
{ {
label: "话术内容", label: "督导姓名",
name: "content", name: "supervisionName",
type: "input", type: "input",
isClear: true isClear: true
}, },
{ {
label: "一级分类", label: "手机号",
name: "firstClassify", name: "phone",
addHtml: "firstClassify" addHtml: "phone"
},
{
label: "二级分类",
name: "secondClassify",
addHtml: "secondClassify"
} }
], ],
getListApi: conversationPointPage, getListApi: conversationPointPage,
...@@ -111,42 +77,33 @@ export default { ...@@ -111,42 +77,33 @@ export default {
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: "话术内容", label: "督导姓名",
prop: "content", prop: "content",
width: "550px",
addHtml: "content",
align:'left'
}, },
{ {
label: "一级分类", label: "手机号",
prop: "firstClassify" prop: "firstClassify"
}, },
{ {
label: "一级权重", label: "入职日期",
prop: "firstWeight" prop: "firstWeight"
}, },
{ {
label: "二级分类", label: "团队人员",
prop: "secondClassify" prop: "secondClassify"
}, },
{ {
label: "二级权重", label: "管理门店",
prop: "secondWeight" prop: "secondWeight"
}, },
{ {
label: "更新时间", label: "产值",
prop: "updatedDate", prop: "updatedDate",
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.updatedDate return cellValue.updatedDate ? `¥${cellValue.updatedDate}` : '-'
? Util.dateFormate(cellValue.updatedDate, "YYYY-MM-DD HH:mm:ss")
: ""
} }
} }
] ]
},
baseData: {
firstClassifyList: [],
secondClassifyList: []
} }
} }
}, },
...@@ -155,24 +112,9 @@ export default { ...@@ -155,24 +112,9 @@ export default {
}, },
methods: { methods: {
formatSrt(str) { handlePhoneInput(e) {
return str let newValue = e.replace(/[^\d.]/g, '')
// return str.replace(/\n/g, "<br/>") this.searchForm.phone = newValue
},
getPointCategory() {
this.classifyMap = new Map()
getPointCategory().then((res) => {
this.baseData.firstClassifyList = Object.keys(res)
for (const item in res) {
this.classifyMap.set(item, res[item])
}
})
},
changeClassify() {
this.searchForm.secondClassify = ""
this.baseData.secondClassifyList = this.classifyMap.get(
this.searchForm.firstClassify
)
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
...@@ -180,40 +122,25 @@ export default { ...@@ -180,40 +122,25 @@ export default {
resolve() resolve()
}) })
}, },
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
handleSearch() { handleSearch() {
this.$refs.pointTable.refreshTable(true, true) this.$refs.pointTable.refreshTable(true, true)
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
firstClassify: "", // 质检日期 supervisionName: "",
secondClassify: "", phone: ""
content: ""
} }
this.baseData.secondClassifyList = []
this.$refs.pointTable.refreshTable() this.$refs.pointTable.refreshTable()
},
handleDetail(data) {
this.close({ tagName: "/orderDetail" })
this.$router.push({
name: "orderDetail",
query: {
detail: JSON.stringify(data.row)
}
})
} }
} }
} }
......
<template>
<div class="recording-detail">
<div class="header">
<div class="left">
<span class="title">录音复盘</span>
<span>提交人:{{ detail.updatedBy }}</span>
</div>
<div>提交时间:{{ detail.updatedDate }}</div>
</div>
<div class="content">
<d2-table
ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<template slot="tag" slot-scope="scope">
<el-tooltip class="item"
:content="scope.scope.reviewTarget"
placement="top">
<span>
{{
scope.scope.reviewTarget
? scope.scope.reviewTarget.length > 10
? `${scope.scope.reviewTarget.substring(0, 10)}...`
: scope.scope.reviewTarget
: "-"
}}
</span>
</el-tooltip>
</template>
<template slot="review" slot-scope="scope">
<el-tooltip class="item"
:content="scope.scope.reviewContent"
placement="top">
<span>
{{
scope.scope.reviewContent
? scope.scope.reviewContent.length > 10
? `${scope.scope.reviewContent.substring(0, 10)}...`
: scope.scope.reviewContent
: "-"
}}
</span>
</el-tooltip>
</template>
</d2-table>
</div>
</div>
</template>
<script>
import { getSupervisorRecordListApi } from "@api/resident"
import { Util } from "@/common/util"
export default {
name: "RecordingDetail",
props: {
detail: {
type: Object,
default: () => {}
}
},
data() {
return {
getListApi: getSupervisorRecordListApi,
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: false,
tableColumns: [
{
label: "驻店销售",
prop: "employeeName",
},
{
label: "接待日期",
prop: "staticDate",
formatter: (cellValue) => {
return cellValue.staticDate ? Util.dateFormate(cellValue.staticDate, 'YYYY-MM-DD') : '-'
}
},
{
label: "接待门店",
prop: "merchantName"
},
{
label: "质检评分",
prop: "qualityCheckScore"
},
{
label: "攻防评分",
prop: "avgDefence"
},
{
label: "客户类型",
prop: "customerType"
},
{
label: "车型",
prop: "carModel"
},
{
label: "标签",
prop: "reviewTarget",
addHtml: 'tag'
},
{
label: "复盘",
prop: "reviewContent",
addHtml: 'review'
}
]
}
}
},
mounted() {
},
methods: {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = { id: this.detail.id }
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
.recording-detail {
.header {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
background: #FFFFFF;
padding: 14px 20px;
color: #666666;
font-size: 14px;
.title {
color: #333333;
font-weight: 500;
font-size: 16px;
margin-right: 10px;
}
}
.content {
background: #FFFFFF;
padding: 12px 20px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="review-detail">
<div class="header">{{ missionTypeOptions[detailInfo.taskType] }}</div>
<div class="content">
<div class="item">
<div class="label">提交人:</div>
<div class="value">{{ detailInfo.updatedBy }}</div>
</div>
<div class="item">
<div class="label">提交时间:</div>
<div class="value">{{ detailInfo.createTime }}</div>
</div>
<div class="item" v-if="[0, 5].includes(detailInfo.taskType)">
<div class="label">督导门店:</div>
<div class="value">{{ detailInfo.merchantName }}</div>
</div>
<template v-if="detailInfo.taskType == '5'">
<div class="item" >
<div class="label">带教人员:</div>
<div class="value">{{ detailInfo.storeManagerName }}</div>
</div>
<div class="item">
<div class="label">带教记录:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
<div class="item">
<div class="label">推送课程:</div>
<div class="value">
<el-table
:data="detailInfo.taskCourseList"
style="width: 450px"
border
class="store-table"
>
<el-table-column
label="序号"
align="center"
type="index"
width="64px"
/>
<el-table-column
prop="bcCourseName"
label="课程名称"
align="center"
/>
</el-table>
</div>
</div>
</template>
<div class="item" v-if="[0, 5].includes(detailInfo.taskType)">
<div class="label">督导记录:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
<template v-if="[0, 5].includes(detailInfo.taskType)">
<div class="item">
<div class="label">门店照片:</div>
<div class="value">
<img v-for="(item, index) in detailInfo.taskImageList" :key="index" class="img-item" :src="item" alt="" @click="handleImg(item)">
</div>
</div>
</template>
<template v-if="detailInfo.taskType == '1'">
<div class="item">
<div class="label">复盘人员:</div>
<div class="value">{{ detailInfo.reviewStaffNames }}</div>
</div>
<div class="item">
<div class="label">复盘记录:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
<div class="item">
<div class="label">会议截图:</div>
<div class="value">
<img v-for="(item, index) in detailInfo.taskImageList" :key="index" class="img-item" :src="item" alt="" @click="handleImg(item)">
</div>
</div>
</template>
<template v-if="detailInfo.taskType == '2'">
<div class="item">
<div class="label">月度计划:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
</template>
<template v-if="detailInfo.taskType == '4'">
<div class="item">
<div class="label">门店名称:</div>
<div class="value">{{ detailInfo.merchantName }}</div>
</div>
<div class="item">
<div class="label">事项描述:</div>
<div class="value">{{ detailInfo.taskDesc }}</div>
</div>
<div class="item">
<div class="label">创建时间:</div>
<div class="value">{{ detailInfo.createTime }}</div>
</div>
<div class="item">
<div class="label">专项任务:</div>
<div class="value">{{ detailInfo.taskContext }}</div>
</div>
</template>
</div>
<el-image-viewer v-if="imgVisible" :on-close="closeImgViewer" :url-list="detailInfo.taskImageList" :initial-index="initialIndex" />
</div>
</template>
<script>
import { getSupervisorTaskDetailApi } from "@api/resident"
import dayjs from "dayjs"
export default {
name: "ReviewDetail",
components: {
"el-image-viewer": () =>
import("element-ui/packages/image/src/image-viewer")
},
props: {
detail: {
type: Object,
default: () => {}
}
},
watch: {
detail: {
handler(val) {
console.log(val, 'detail')
if (val.id) {
this.getDetail(val.id)
}
},
deep: true
},
},
data() {
return {
missionTypeOptions: {
'5': '人员带教',
'0': '督导日报',
'1': '本周复盘',
'2': '督导月度计划',
'4': '专项任务'
},
detailInfo: {},
imgVisible: false,
initialIndex: 0
}
},
mounted() {
},
methods: {
getDetail(id) {
getSupervisorTaskDetailApi({ id }).then(res => {
res.createTime = res.createTime ? dayjs(res.createTime).format("YYYY-MM-DD HH:mm:ss") : ""
res.taskImageList = res.taskImageList?.map(val => { return val.imageUrl }) || []
res.reviewStaffNames = res?.weekTaskStaffList?.map(i => i.staffName).join(",") || ""
this.detailInfo = res || {}
})
},
handleImg() {
this.imgVisible = !this.imgVisible
this.initialIndex = 0
},
closeImgViewer() {
this.imgVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.review-detail {
background: #FFFFFF;
.header {
font-size: 16px;
color: #333333;
font-weight: 500;
padding: 14px 20px;
border-bottom: 1px solid #E5E5E5;
}
.content {
padding: 20px;
.item {
display: flex;
font-size: 14px;
margin-bottom: 20px;
.label {
flex-shrink: 0;
color: #666666;
width: 150px;
text-align: right;
}
.value {
color: #333333;
.img-item {
width: 36px;
height: 36px;
margin-right: 8px;
}
}
&:last-child {
margin-bottom: 0;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 督导任务详情 -->
<template>
<div class="mission-detail">
<d2-container>
<div v-if="detail.taskType == '3'">
<recording :detail="detail"/>
</div>
<div v-else>
<reviewDetail :detail="detail"/>
</div>
<div class="footer-btn">
<el-button class="cancel-btn" @click="handleBack"> 关闭 </el-button>
</div>
</d2-container>
</div>
</template>
<script>
import recording from "./components/recording.vue"
import reviewDetail from "./components/reviewDetail.vue"
import { mapActions } from "vuex"
import { Util } from "@/common/util";
export default {
name: "MissionDetail",
components: {
recording,
reviewDetail
},
data() {
return {
detail: {}
}
},
mounted() {
let detail = JSON.parse(this.$route.query.detail)
detail = {
...detail,
updatedDate: detail.updatedDate ? Util.dateFormate(detail.updatedDate, 'YYYY-MM-DD HH:mm:ss') : '-'
}
this.detail = detail
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
handleBack() {
this.close({ tagName: "/supervisionMissionManagement" })
this.$router.push({
name: "supervisionMissionManagement"
})
}
}
}
</script>
<style lang="scss" scoped>
.footer-btn {
display: flex;
justify-content: center;
margin-top: 20px;
.cancel-btn {
width: 100px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 督导任务管理 -->
<template>
<d2-container>
<div class="detail-content">
<div class="content-box">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in tabList"
:key="item.key"
:label="item.name"
:name="item.key">
</el-tab-pane>
<div class="container">
<div slot="header"
class="header"
style="padding: 10px 20px">
<d2-search ref="showSearch"
class="show-search"
:form-data="showFormData"
:search-form="searchForm">
</d2-search>
<div class="up-btns">
<el-button size="small"
type="primary"
@click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
<div class="table-box">
<div class="date-select">
<dateSelectPicker :tab-key="activeName" @change="onDateChange"></dateSelectPicker>
</div>
<div class="view">
<div class="view-item">
<div class="label">
总人数
</div>
<div class="value">
<span class="orange">{{ staticsData.totalCount != null ? staticsData.totalCount : '-' }}</span>
</div>
</div>
<div class="view-item">
<div class="label">
提交任务人数
</div>
<div class="value">
<span class="green">{{ staticsData.submittedCount != null ? staticsData.submittedCount : '-' }}</span>
</div>
</div>
<div class="view-item">
<div class="label">
提交任务数
</div>
<div class="value">
<span class="red">{{ staticsData.submittedTaskCount != null ? staticsData.submittedTaskCount : '-' }}</span>
</div>
</div>
</div>
<d2-table ref="supervisionTaskTable"
:before-search-fn="beforeSearchFn"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams">
<template #auth-button="scope">
<div>
<auth-button :data="scope.scope"
:show-btn-ids="['9122501']" />
</div>
</template>
</d2-table>
</div>
</div>
</el-tabs>
</div>
</div>
</d2-container>
</template>
<script>
import { getSupervisorTaskListApi, getSupervisorTaskSummaryApi } from "@api/resident";
import { mapActions } from "vuex";
import { superviseTaskTypeOpt } from "@/common/constants";
import { deepClone, Util } from "@/common/util";
import dateSelectPicker from "../components/dateSelectPicker.vue";
export default {
name: "SupervisionDetail",
components: {
dateSelectPicker
},
data() {
return {
tabList: [{
name: "今日任务",
key: "day"
}, {
name: "本周任务",
key: "week"
}, {
name: "月度任务",
key: "month"
}, {
name: "专项任务",
key: "special"
}],
getListApi: getSupervisorTaskListApi,
showFormData: [
{
label: "任务类型",
name: "searchTaskTypeList",
type: "select",
optionId: "confId",
optionLabel: "confName",
optionList: [],
optionsName: "superviseTaskTypeOpt",
},
{
label: "提交人",
name: "updatedBy",
type: "input",
isClear: true,
},
],
activeName: "day",
searchForm: {
searchTaskTypeList: "",
updatedBy: "",
},
searchFormSearch: {},
staticsData: {},
tableParams: {
btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: "list",
tableOption: { width: "100px" },
tableColumns: [
{
label: "任务类型",
prop: "taskType",
formatter: (cellValue) => {
const type = superviseTaskTypeOpt.find(item => item.confId == cellValue.taskType);
return type ? type.confName : "-";
},
},
{
label: "任务提交时间",
prop: "createTime",
formatter: (cellValue) => {
return cellValue.updatedDate ? Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss') : '-'
}
},
{
label: "提交人",
prop: "updatedBy",
},
],
},
};
},
created() {
this.updateTaskTypeOptionsByTab(this.tabList[0]?.name || "")
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
updateTaskTypeOptionsByTab(tabName) {
const allowMap = {
"今日任务": [3, 0, 5],
"本周任务": [1],
"月度任务": [2],
"专项任务": [4]
}
const allowIds = allowMap[tabName] || [];
const optById = new Map(superviseTaskTypeOpt.map(i => [i.confId, i]))
const filtered = allowIds
.map((id) => optById.get(id))
.filter(Boolean)
.map((i) => (i.confId === 2 ? { ...i, confName: "月度计划" } : i))
const optionList = [{ confId: "", confName: "全部" }].concat(filtered)
this.$set(this.showFormData[0], "optionList", optionList)
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
const allowMap = {
"day": [3, 0, 5],
"week": [1],
"month": [2],
"special": [4]
}
const allowIds = allowMap[this.tabList.find(i => i.key == this.activeName)?.key] || [];
this.searchFormSearch.taskTypeList = (this.searchFormSearch.searchTaskTypeList ?? '') !== '' ? [this.searchFormSearch.searchTaskTypeList] : allowIds;
delete this.searchFormSearch.searchTaskTypeList
resolve();
});
},
getStaticsData() {
let params = this.getParams();
getSupervisorTaskSummaryApi(params).then((res) => {
this.staticsData = res || {};
});
},
getParams() {
const allowMap = {
"day": [3, 0, 5],
"week": [1],
"month": [2],
"special": [4]
}
const allowIds = allowMap[this.tabList.find(i => i.key === this.activeName)?.key] || [];
const params = Util.deepClone(this.searchForm);
console.log(params, 'params')
params.taskTypeList = (params.searchTaskTypeList ?? '') !== '' ? [params.searchTaskTypeList] : allowIds;
delete params.searchTaskTypeList;
return params;
},
handleClick(event) {
this.activeName = event.paneName;
this.searchForm.searchTaskTypeList = ''
this.updateTaskTypeOptionsByTab(event.label || "");
},
handleSearch() {
this.$refs.supervisionTaskTable?.refreshTable(true, true);
this.getStaticsData();
},
handleReset() {
this.searchForm.searchTaskTypeList = "";
this.searchForm.updatedBy = "";
this.$refs.supervisionTaskTable?.refreshTable(true, true);
this.getStaticsData();
},
onDateChange(e) {
this.searchForm.startDate = e.startTime?.replace(/\//g, "-");
this.searchForm.endDate = e.endTime?.replace(/\//g, "-");
this.$refs.supervisionTaskTable?.refreshTable();
this.getStaticsData();
},
handleDetail(data) {
console.log(data, 'data')
this.close({ tagName: "/supervisionMissionDetail" });
this.$router.push({
name: "supervisionMissionDetail",
query: {
detail: JSON.stringify(data),
},
});
},
},
};
</script>
<style lang="scss" scoped>
.detail-content {
::v-deep .el-tabs__nav-wrap {
padding-left: 20px;
}
.content-box {
::v-deep .el-tabs__header {
background: #ffffff;
margin-bottom: 0;
}
.table-box {
margin-top: 18px;
background: #ffffff;
padding: 12px 20px;
}
.date-select {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 16px;
}
.view {
display: flex;
gap: 16px;
margin-bottom: 16px;
.view-item {
flex: 1;
background: #f8faff;
border-radius: 4px;
padding: 12px 20px;
.label {
font-size: 14px;
color: #333333;
}
.value {
font-size: 20px;
font-weight: 500;
margin-top: 4px;
color: #1d1d1d;
}
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!