Commit e1236345 by 前端

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

上线合并

See merge request !572
2 parents abccaee2 abb8a936
Showing 109 changed files with 1879 additions and 1447 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,115 +5,114 @@ ...@@ -5,115 +5,114 @@
* @Last Modified time: 2021-06-30 14:30:41 * @Last Modified time: 2021-06-30 14:30:41
*/ */
import axiosPackage from "axios";
import util from "@/libs/util.js";
import { baseConfig } from "@/main";
// import axios from "@/plugin/axios" // import axios from "@/plugin/axios"
import axios from "@/plugin/axios/index_code" import axios from "@/plugin/axios/index_code";
import sign from "./sign" import RequestMethods from "./request.methods";
import RequestMethods from "./request.methods" import sign from "./sign";
import util from "@/libs/util.js"
import { baseConfig } from "@/main" function request(params = {}, method = RequestMethods.GET, noSignAttr = [], options = {}) {
import axiosPackage from "axios"
const request = (
params = {},
method = RequestMethods.GET,
noSignAttr = [],
options = {}
) => {
// 兼容线上dj和scrm appkey和secret不一样的情况 // 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = "" let apiName = "";
if (params.method.includes("dj.api.smartcarlife")) { if (params.method.includes("dj.api.smartcarlife")) {
apiName = "dj" apiName = "dj";
} else if (params.method.includes("dj.api.script")) { } else if (params.method.includes("dj.api.script")) {
apiName = "script" apiName = "script";
} else if (params.method.includes("dj.staff.api")) { } else if (params.method.includes("dj.staff.api")) {
apiName = "staff" apiName = "staff";
} else if (params.method.includes("dj.smartcarlife.stock")) { } else if (params.method.includes("dj.smartcarlife.stock")) {
apiName = "dj.smartcarlife" apiName = "dj.smartcarlife";
} else if (params.method.includes("risk.manage.api")) { } else if (params.method.includes("risk.manage.api")) {
apiName = "riskmanage" apiName = "riskmanage";
} else if (params.method.includes("dj.api.strategy")) { } else if (params.method.includes("dj.api.strategy")) {
apiName = "strategy" apiName = "strategy";
} else if (params.method.includes("dj.api.supervisor")) {
apiName = "supervisor";
} else { } else {
// console.log(params.method.split(".api")) // console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0] apiName = params.method.split(".api")[0];
} }
// console.log("params.method", params.method) // console.log("params.method", params.method)
// console.log("apiName", apiName) // console.log("apiName", apiName)
// 为空报错 // 为空报错
if (!apiName) { if (!apiName) {
throw new Error("apiName is null") throw new Error("apiName is null");
} }
const mappingName = { const mappingName = {
"dj.smartcarlife": "axios", "dj.smartcarlife": "axios",
dj: "axios", "dj": "axios",
scrm: "axios2", "scrm": "axios2",
merchants: "axios3", "merchants": "axios3",
reportExport: "axios4", "reportExport": "axios4",
"glsx.accounts.biz.common.pictureUpload": "common", "glsx.accounts.biz.common.pictureUpload": "common",
clue: "axios5", "clue": "axios5",
"dj.businessSchool": "axios6", "dj.businessSchool": "axios6",
script: "axios7", "script": "axios7",
staff: "axios9", "staff": "axios9",
riskmanage: "axios10", "riskmanage": "axios10",
strategy: 'axios_strategy' "strategy": "axios_strategy",
} "supervisor": "axios_supervisor",
const baseApiName = mappingName[apiName] };
const baseApiName = mappingName[apiName];
// console.log(baseApiName, "baseApiName") // console.log(baseApiName, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey // params.appKey = baseConfig[baseApiName].appkey
if (baseApiName == "common") { if (baseApiName == "common") {
params.app_key = baseConfig[baseApiName].appkey params.app_key = baseConfig[baseApiName].appkey;
} else { } else {
params.appKey = baseConfig[baseApiName].appkey params.appKey = baseConfig[baseApiName].appkey;
} }
// console.log("params.appKey", params.appKey) // console.log("params.appKey", params.appKey)
params.timestamp = new Date().getTime() params.timestamp = new Date().getTime();
params.v = "1.0.0" params.v = "1.0.0";
params.format = "json" params.format = "json";
params.locale = "zh_CN" params.locale = "zh_CN";
if (params.method !== "dj.api.user.login") { if (params.method !== "dj.api.user.login") {
params.sessionId = util.cookies.get("token") params.sessionId = util.cookies.get("token");
} }
/** /**
* mock - url = params.method * mock - url = params.method
* 调后端接口 - url = '' * 调后端接口 - url = ''
*/ */
const url = baseConfig[baseApiName].baseURL const url = baseConfig[baseApiName].baseURL;
// const url = "/api" // const url = "/api"
/** /**
* 调后端接口,请使用以下代码。 * 调后端接口,请使用以下代码。
*/ */
const signWay = { const signWay = {
"dj.smartcarlife": "sha1", "dj.smartcarlife": "sha1",
dj: "sha1", "dj": "sha1",
scrm: "sha1", "scrm": "sha1",
glsx: "md5", "glsx": "md5",
"glsx.accounts.biz.common.pictureUpload": "md5", "glsx.accounts.biz.common.pictureUpload": "md5",
clue: "sha1", "clue": "sha1",
script: "sha1", "script": "sha1",
staff: "sha1", "staff": "sha1",
riskmanage: 'sha1' "riskmanage": "sha1",
} };
// console.log(signWay[apiName], "baseApiName") // console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret const secret = baseConfig[baseApiName].secret;
const CancelToken = axiosPackage.CancelToken const CancelToken = axiosPackage.CancelToken;
var reqData = let reqData
method === RequestMethods.POST = method === RequestMethods.POST
? { ? {
baseURL: "/", baseURL: "/",
data: sign(params, noSignAttr, secret, signWay[apiName]) data: sign(params, noSignAttr, secret, signWay[apiName]),
} }
: { params: sign(params, noSignAttr, secret, signWay[apiName]) } : { params: sign(params, noSignAttr, secret, signWay[apiName]) };
reqData = Object.assign(reqData, options, {}) reqData = Object.assign(reqData, options, {});
// 请求进度 // 请求进度
if (params?.onProcess) { if (params?.onProcess) {
reqData.onUploadProgress = params.onProcess reqData.onUploadProgress = params.onProcess;
} }
// 取消请求 // 取消请求
if (params?.cancelFun) { if (params?.cancelFun) {
reqData.cancelToken = new CancelToken(function excutor (c) { reqData.cancelToken = new CancelToken((c) => {
params.cancelFun.cancel = c params.cancelFun.cancel = c;
}) });
} }
// console.log(method === RequestMethods.POST) // console.log(method === RequestMethods.POST)
// console.log(url) // console.log(url)
...@@ -122,10 +121,11 @@ const request = ( ...@@ -122,10 +121,11 @@ const request = (
let axiosParams = { let axiosParams = {
url, url,
method, method,
...reqData ...reqData,
} };
if (options.returnAll) axiosParams.headers = { 'return-all': true } if (options.returnAll)
return axios(axiosParams) axiosParams.headers = { "return-all": true };
return axios(axiosParams);
/** /**
* mock,请使用以下代码。 * mock,请使用以下代码。
...@@ -136,4 +136,4 @@ const request = ( ...@@ -136,4 +136,4 @@ const request = (
// params: sign(params, noSignAttr) // params: sign(params, noSignAttr)
// }) // })
} }
export default request export default request;
...@@ -689,3 +689,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", () =>
......
import store from "@/store" import axios from "axios";
import axios from "axios" import { Message } from "element-ui";
import { Message } from "element-ui" import Qs from "qs";
import util from "@/libs/util" import util from "@/libs/util";
import router from "@/router" import { baseConfig } from "@/main";
import { baseConfig } from "@/main" import router from "@/router";
import Qs from "qs" import store from "@/store";
axios.defaults.withCredentials = true
axios.defaults.withCredentials = true;
// const expiresMinute = 60 // 过期时间(分钟) // const expiresMinute = 60 // 过期时间(分钟)
// 创建一个错误 // 创建一个错误
export function errorCreate(msg) { export function errorCreate(msg) {
const error = new Error(msg) const error = new Error(msg);
errorLog(error) errorLog(error);
throw error throw error;
} }
// 记录和显示错误 // 记录和显示错误
function errorLog(error) { function errorLog(error) {
...@@ -20,20 +21,20 @@ function errorLog(error) { ...@@ -20,20 +21,20 @@ function errorLog(error) {
message: "数据请求异常", message: "数据请求异常",
type: "danger", type: "danger",
meta: { meta: {
error error,
} },
}) });
// 打印到控制台 // 打印到控制台
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
util.log.danger(">>>>>> Error >>>>>>") util.log.danger(">>>>>> Error >>>>>>");
console.log(error) console.log(error);
} }
// 显示提示 // 显示提示
Message({ Message({
message: error.message, message: error.message,
type: "error", type: "error",
duration: 5 * 1000 duration: 5 * 1000,
}) });
} }
// 网络请求公用地址 http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS // 网络请求公用地址 http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
// VUE_APP_API=http://192.168.3.191:8944/router // VUE_APP_API=http://192.168.3.191:8944/router
...@@ -43,16 +44,16 @@ const service = axios.create({ ...@@ -43,16 +44,16 @@ const service = axios.create({
timeout: 100000, // 请求超时时间 timeout: 100000, // 请求超时时间
transformRequest: [ transformRequest: [
function (data) { function (data) {
return Qs.stringify(data) return Qs.stringify(data);
} },
] ],
}) });
// 请求拦截器 // 请求拦截器
service.interceptors.request.use( service.interceptors.request.use(
(config) => { (config) => {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
await store.commit("d2admin/loading/set", true) await store.commit("d2admin/loading/set", true);
// const uuid = util.cookies.get('uuid') // const uuid = util.cookies.get('uuid')
// 如果请求链接不在排除列表 (排除列表: 登录 基础数据) 并且cookie 过期(判断是否长时间未操作) // 如果请求链接不在排除列表 (排除列表: 登录 基础数据) 并且cookie 过期(判断是否长时间未操作)
// if (!LogExternals.some(u => u === url || (params && u === params.method)) && !uuid) { // if (!LogExternals.some(u => u === url || (params && u === params.method)) && !uuid) {
...@@ -73,18 +74,18 @@ service.interceptors.request.use( ...@@ -73,18 +74,18 @@ service.interceptors.request.use(
// console.log(config.data.method) // console.log(config.data.method)
if (process.env.NODE_ENV == "development") { if (process.env.NODE_ENV == "development") {
// 处理图片开发环境没用的问题 // 处理图片开发环境没用的问题
const type = Object.prototype.toString.call(config.data) const type = Object.prototype.toString.call(config.data);
const methodList = [ const methodList = [
"dj.api.common.uploadImg", "dj.api.common.uploadImg",
"dj.api.common.ocr.recognition", "dj.api.common.ocr.recognition",
"dj.api.smartcarlife.sms.sendSmsCode" "dj.api.smartcarlife.sms.sendSmsCode",
] ];
if ( if (
type == "[object Object]" && type == "[object Object]"
methodList.includes(config.data.method) && methodList.includes(config.data.method)
) { ) {
config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router" config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router";
return resolve(config) return resolve(config);
} }
} }
// if (config.isPoint) { // if (config.isPoint) {
...@@ -95,21 +96,21 @@ service.interceptors.request.use( ...@@ -95,21 +96,21 @@ service.interceptors.request.use(
// config.url = baseConfig.axios.baseURL // config.url = baseConfig.axios.baseURL
// } // }
// console.log(config) // console.log(config)
resolve(config) resolve(config);
}) });
}, },
(error) => { (error) => {
store.commit("d2admin/loading/set", false) store.commit("d2admin/loading/set", false);
// 发送失败 // 发送失败
console.log(error) console.log(error);
Promise.reject(error) Promise.reject(error);
} },
) );
// 响应拦截器 // 响应拦截器
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
// console.log(response) // console.log(response)
store.commit("d2admin/loading/set", false) store.commit("d2admin/loading/set", false);
// dataAxios 是 axios 返回数据中的 data // dataAxios 是 axios 返回数据中的 data
// const dataAxios = { // const dataAxios = {
// code: "20", // code: "20",
...@@ -117,33 +118,34 @@ service.interceptors.response.use( ...@@ -117,33 +118,34 @@ service.interceptors.response.use(
// solution: "将添加会话ID请求参数", // solution: "将添加会话ID请求参数",
// subErrors: null // subErrors: null
// } // }
const dataAxios = response.data const dataAxios = response.data;
const ruleResult = baseConfig.axios.result const ruleResult = baseConfig.axios.result;
const returnAll = response.config.returnAll const returnAll = response.config.returnAll;
// 这个状态码是和后端约定的 // 这个状态码是和后端约定的
// 有 code 代表这是一个后端接口 可以进行进一步的判断 // 有 code 代表这是一个后端接口 可以进行进一步的判断
var goBackArr = ["20", "21"] let goBackArr = ["20", "21"];
// console.log(dataAxios[ruleResult.code_key]) // console.log(dataAxios[ruleResult.code_key])
if (goBackArr.includes(dataAxios[ruleResult.code_key])) { if (goBackArr.includes(dataAxios[ruleResult.code_key])) {
// await store.dispatch('d2admin/account/logout') // await store.dispatch('d2admin/account/logout')
store.dispatch("d2admin/user/clear") store.dispatch("d2admin/user/clear");
util.cookies.remove("token") util.cookies.remove("token");
router.replace("/login") router.replace("/login");
return errorCreate("登录超时,请重新登录") return errorCreate("登录超时,请重新登录");
// return Promise.reject(new Error("登录超时,请重新登录")) // return Promise.reject(new Error("登录超时,请重新登录"))
// return Promise.reject(new Error(response.message || 'Error')) // return Promise.reject(new Error(response.message || 'Error'))
} }
if(returnAll) return dataAxios if (returnAll)
const codeValue = dataAxios[ruleResult.code_key] || dataAxios.returnCode return dataAxios;
const codeValue = dataAxios[ruleResult.code_key] || dataAxios.returnCode;
switch (+codeValue) { switch (+codeValue) {
case ruleResult.code_success_value: case ruleResult.code_success_value:
// [ 示例 ] code === 0 代表没有错误 // [ 示例 ] code === 0 代表没有错误
return dataAxios[ruleResult.data_key] return dataAxios[ruleResult.data_key];
default: default:
// 不是正确的 code // 不是正确的 code
console.log(dataAxios) console.log(dataAxios);
errorCreate(`${dataAxios[ruleResult.message_key]}`) errorCreate(`${dataAxios[ruleResult.message_key]}`);
break break;
} }
}, },
...@@ -151,52 +153,53 @@ service.interceptors.response.use( ...@@ -151,52 +153,53 @@ service.interceptors.response.use(
if (error && error.response) { if (error && error.response) {
switch (error.response.status) { switch (error.response.status) {
case 400: case 400:
error.message = "请求错误" error.message = "请求错误";
break break;
case 401: case 401:
error.message = "未授权,请登录" error.message = "未授权,请登录";
break break;
case 403: case 403:
error.message = "拒绝访问" error.message = "拒绝访问";
break break;
case 404: case 404:
error.message = `请求地址出错: ${error.response.config.url}` error.message = `请求地址出错: ${error.response.config.url}`;
break break;
case 408: case 408:
error.message = "请求超时" error.message = "请求超时";
break break;
case 500: case 500:
error.message = "服务器内部错误" error.message = "服务器内部错误";
break break;
case 501: case 501:
error.message = "服务未实现" error.message = "服务未实现";
break break;
case 502: case 502:
error.message = "网关错误" error.message = "网关错误";
break break;
case 503: case 503:
error.message = "服务不可用" error.message = "服务不可用";
break break;
case 504: case 504:
error.message = "网关超时" error.message = "网关超时";
break break;
case 505: case 505:
error.message = "HTTP版本不受支持" error.message = "HTTP版本不受支持";
break break;
default: default:
break break;
} }
} }
if (error && error?.stack?.indexOf("timeout") > -1) { if (error && error?.stack?.indexOf("timeout") > -1) {
if (error.stack.indexOf("5000ms")) { if (error.stack.indexOf("5000ms")) {
error.message = "查询超时,请刷新页面重试!" error.message = "查询超时,请刷新页面重试!";
} }
// console.log('超时') // console.log('超时')
// console.log(error) // console.log(error)
} }
store.commit("d2admin/loading/set", false) store.commit("d2admin/loading/set", false);
if (!error.__CANCEL__) errorLog(error) // 取消请求 不做错误提示 if (!error.__CANCEL__)
return Promise.reject(error) errorLog(error); // 取消请求 不做错误提示
} return Promise.reject(error);
) },
export default service );
export default service;
...@@ -120,9 +120,11 @@ service.interceptors.response.use( ...@@ -120,9 +120,11 @@ service.interceptors.response.use(
// } // }
const dataAxios = response.data; const dataAxios = response.data;
const ruleResult = baseConfig.axios.result; const ruleResult = baseConfig.axios.result;
const errCodeMsg = baseConfig.errCode; const errCodeMsg = baseConfig.errCode || {};
const errCodes = Object.keys(errCodeMsg); const errCodes = Object.keys(errCodeMsg);
const returnAll = response.config.headers["return-all"]; const returnAll = response.config.headers["return-all"];
// 请求级配置:为 true 时,code 为 -1 直接使用响应的 message,不查 errCode 配置
const useResponseMessage = response.config.useResponseMessage;
// console.log("baseConfig", baseConfig) // console.log("baseConfig", baseConfig)
// console.log("response", response) // console.log("response", response)
...@@ -150,17 +152,20 @@ service.interceptors.response.use( ...@@ -150,17 +152,20 @@ service.interceptors.response.use(
case ruleResult.code_error_value: case ruleResult.code_error_value:
// [ 示例 ] code === -1 代表需将返回的message弹窗展示 // [ 示例 ] code === -1 代表需将返回的message弹窗展示
return errorCreate(`${dataAxios[ruleResult.message_key]}`); return errorCreate(`${dataAxios[ruleResult.message_key]}`);
default: default: {
// 不是正确的 code // 不是正确的 code
// console.log(dataAxios) // 请求配置 useResponseMessage 时:code 为 -1 直接使用响应的 message
// errorCreate(`${dataAxios[ruleResult.message_key]}`) const codeStr = String(dataAxios[ruleResult.code_key] ?? "");
const isCodeMinusOne = codeStr === "-1" || +dataAxios[ruleResult.code_key] === -1;
if (useResponseMessage && isCodeMinusOne) {
return errorCreate(`${dataAxios[ruleResult.message_key]}`);
}
if (errCodes.includes(dataAxios[ruleResult.code_key])) { if (errCodes.includes(dataAxios[ruleResult.code_key])) {
return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`); return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`);
} else { }
// 返回约定定义之外的错误码直接取message // 返回约定定义之外的错误码直接取message
return errorCreate(`${dataAxios[ruleResult.message_key]}`); return errorCreate(`${dataAxios[ruleResult.message_key]}`);
} }
break;
} }
}, },
......
...@@ -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"),
}
}; };
const _import = require("@/libs/util.import." + process.env.NODE_ENV) // eslint-disable-next-line
const _import = require("@/libs/util.import." + (process.env.NODE_ENV || "development"));
export const routerName = { export const routerName = {
920: { 920: {
path: "/usedCarManagement", path: "/usedCarManagement",
...@@ -7,8 +8,8 @@ export const routerName = { ...@@ -7,8 +8,8 @@ export const routerName = {
title: "二手车管理", title: "二手车管理",
authId: "920", authId: "920",
parentId: "1", parentId: "1",
cache: false cache: false,
} },
}, },
92001: { 92001: {
path: "/dataView", path: "/dataView",
...@@ -17,9 +18,9 @@ export const routerName = { ...@@ -17,9 +18,9 @@ export const routerName = {
title: "数据看板", title: "数据看板",
authId: "92001", authId: "92001",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
component: _import("usedCarManagement/dataView/index") component: _import("usedCarManagement/dataView/index"),
}, },
92002: { 92002: {
path: "/evaluationManagement", path: "/evaluationManagement",
...@@ -28,7 +29,7 @@ export const routerName = { ...@@ -28,7 +29,7 @@ export const routerName = {
title: "评估管理", title: "评估管理",
authId: "92002", authId: "92002",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -40,9 +41,9 @@ export const routerName = { ...@@ -40,9 +41,9 @@ export const routerName = {
{ {
authId: "9200204", authId: "9200204",
name: "详情", name: "详情",
parentId: "92002" parentId: "92002",
} },
] ],
}, },
{ {
authId: "9200202", authId: "9200202",
...@@ -53,9 +54,22 @@ export const routerName = { ...@@ -53,9 +54,22 @@ export const routerName = {
{ {
authId: "9200205", authId: "9200205",
name: "车辆评估", name: "车辆评估",
parentId: "92002" parentId: "92002",
} },
] ],
},
{
authId: "9200207",
parentId: "92002",
label: "评估核价",
handle: "handleCheckPrice",
addRoutePath: [
{
authId: "9200205",
name: "车辆核价",
parentId: "92002",
},
],
}, },
{ {
authId: "9200203", authId: "9200203",
...@@ -63,16 +77,16 @@ export const routerName = { ...@@ -63,16 +77,16 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
}, },
{ {
authId: "9200206", authId: "9200206",
parentId: "92002", parentId: "92002",
label: "图片下载", label: "图片下载",
handle: "handleDownLoad" handle: "handleDownLoad",
} },
], ],
component: _import("usedCarManagement/evaluationManagement/index") component: _import("usedCarManagement/evaluationManagement/index"),
}, },
9200204: { 9200204: {
path: "/evalOrderDetail", path: "/evalOrderDetail",
...@@ -83,9 +97,9 @@ export const routerName = { ...@@ -83,9 +97,9 @@ export const routerName = {
parentId: "92002", parentId: "92002",
cache: false, cache: false,
sideHidden: false, sideHidden: false,
activePath: "/evaluationManagement" activePath: "/evaluationManagement",
}, },
component: _import("usedCarManagement/evaluationManagement/evalOrderDetail") component: _import("usedCarManagement/evaluationManagement/evalOrderDetail"),
}, },
9200205: { 9200205: {
path: "/evaluate", path: "/evaluate",
...@@ -96,10 +110,21 @@ export const routerName = { ...@@ -96,10 +110,21 @@ export const routerName = {
parentId: "92002", parentId: "92002",
cache: false, cache: false,
sideHidden: false, sideHidden: false,
activePath: "/evaluationManagement" activePath: "/evaluationManagement",
dynamicTitle: (route) => {
const scene = route?.query?.scene;
if (scene === "checkPrice") {
return "车辆核价";
}
if (scene === "assess") {
return "车辆评估";
}
return "车辆评估";
},
}, },
component: _import("usedCarManagement/evaluationManagement/evaluate") component: _import("usedCarManagement/evaluationManagement/evaluate"),
}, },
92003: { 92003: {
path: "/operateManagement", path: "/operateManagement",
name: "operateManagement", name: "operateManagement",
...@@ -107,7 +132,7 @@ export const routerName = { ...@@ -107,7 +132,7 @@ export const routerName = {
title: "运营管理", title: "运营管理",
authId: "92003", authId: "92003",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -119,15 +144,15 @@ export const routerName = { ...@@ -119,15 +144,15 @@ export const routerName = {
{ {
authId: "9200306", authId: "9200306",
name: "详情", name: "详情",
parentId: "92003" parentId: "92003",
} },
] ],
}, },
{ {
authId: "9200302", authId: "9200302",
parentId: "92003", parentId: "92003",
label: "合同下载", label: "合同下载",
handle: "handleDownload" handle: "handleDownload",
}, },
{ {
authId: "9200303", authId: "9200303",
...@@ -135,7 +160,7 @@ export const routerName = { ...@@ -135,7 +160,7 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
}, },
{ {
authId: "9200304", authId: "9200304",
...@@ -143,25 +168,25 @@ export const routerName = { ...@@ -143,25 +168,25 @@ export const routerName = {
label: "新增激励", label: "新增激励",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleAddStimulate" handle: "handleAddStimulate",
}, },
{ {
authId: "9200305", authId: "9200305",
parentId: "92003", parentId: "92003",
label: "详情", label: "详情",
handle: "handleDetail" handle: "handleDetail",
}, },
{ {
authId: "9200307", authId: "9200307",
parentId: "92003", parentId: "92003",
label: "修改", label: "修改",
handle: "handleUpdate" handle: "handleUpdate",
}, },
{ {
authId: "9200308", authId: "9200308",
parentId: "92003", parentId: "92003",
label: "删除", label: "删除",
handle: "handleDelete" handle: "handleDelete",
}, },
{ {
authId: "9200309", authId: "9200309",
...@@ -169,10 +194,10 @@ export const routerName = { ...@@ -169,10 +194,10 @@ export const routerName = {
label: "批量导入合同", label: "批量导入合同",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleImportContract" handle: "handleImportContract",
} },
], ],
component: _import("usedCarManagement/operateManagement/index") component: _import("usedCarManagement/operateManagement/index"),
}, },
9200306: { 9200306: {
path: "/contractView", path: "/contractView",
...@@ -183,11 +208,11 @@ export const routerName = { ...@@ -183,11 +208,11 @@ export const routerName = {
parentId: "92003", parentId: "92003",
cache: false, cache: false,
sideHidden: false, sideHidden: false,
activePath: "/operateManagement" activePath: "/operateManagement",
}, },
component: _import( component: _import(
"usedCarManagement/operateManagement/components/contract/detail" "usedCarManagement/operateManagement/components/contract/detail",
) ),
}, },
9200307: { 9200307: {
path: "/contractEdit", path: "/contractEdit",
...@@ -198,11 +223,11 @@ export const routerName = { ...@@ -198,11 +223,11 @@ export const routerName = {
parentId: "92003", parentId: "92003",
cache: false, cache: false,
sideHidden: false, sideHidden: false,
activePath: "/operateManagement" activePath: "/operateManagement",
}, },
component: _import( component: _import(
"usedCarManagement/operateManagement/components/contract/edit" "usedCarManagement/operateManagement/components/contract/edit",
) ),
}, },
92004: { 92004: {
path: "/vehicleManagement", path: "/vehicleManagement",
...@@ -211,7 +236,7 @@ export const routerName = { ...@@ -211,7 +236,7 @@ export const routerName = {
title: "车辆管理", title: "车辆管理",
authId: "92004", authId: "92004",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -223,21 +248,21 @@ export const routerName = { ...@@ -223,21 +248,21 @@ export const routerName = {
{ {
authId: "9200404", authId: "9200404",
name: "车辆详情", name: "车辆详情",
parentId: "92004" parentId: "92004",
}, },
{ {
authId: "9200405", authId: "9200405",
name: "编辑车辆", name: "编辑车辆",
parentId: "92004" parentId: "92004",
} },
] ],
}, },
// 暂时屏蔽 // 暂时屏蔽
{ {
authId: "9200402", authId: "9200402",
parentId: "92004", parentId: "92004",
label: "状态变更", label: "状态变更",
handle: "handleChangeStatus" handle: "handleChangeStatus",
}, },
{ {
authId: "9200403", authId: "9200403",
...@@ -245,16 +270,16 @@ export const routerName = { ...@@ -245,16 +270,16 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
}, },
{ {
authId: "9200406", authId: "9200406",
parentId: "92004", parentId: "92004",
label: "图片下载", label: "图片下载",
handle: "handleDownLoad" handle: "handleDownLoad",
} },
], ],
component: _import("usedCarManagement/vehicleManagement/index") component: _import("usedCarManagement/vehicleManagement/index"),
}, },
9200404: { 9200404: {
path: "/vehicleDetail", path: "/vehicleDetail",
...@@ -264,10 +289,10 @@ export const routerName = { ...@@ -264,10 +289,10 @@ export const routerName = {
authId: "9200404", authId: "9200404",
parentId: "92004", parentId: "92004",
activePath: "/vehicleManagement", activePath: "/vehicleManagement",
cache: false cache: false,
}, },
auth: [], auth: [],
component: _import("usedCarManagement/vehicleManagement/detail") component: _import("usedCarManagement/vehicleManagement/detail"),
}, },
9200405: { 9200405: {
path: "/editVehicle", path: "/editVehicle",
...@@ -277,10 +302,10 @@ export const routerName = { ...@@ -277,10 +302,10 @@ export const routerName = {
authId: "9200405", authId: "9200405",
parentId: "92004", parentId: "92004",
activePath: "/vehicleManagement", activePath: "/vehicleManagement",
cache: false cache: false,
}, },
auth: [], auth: [],
component: _import("usedCarManagement/vehicleManagement/detail") component: _import("usedCarManagement/vehicleManagement/detail"),
}, },
// //
92005: { 92005: {
...@@ -290,7 +315,7 @@ export const routerName = { ...@@ -290,7 +315,7 @@ export const routerName = {
title: "交付单管理", title: "交付单管理",
authId: "92005", authId: "92005",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -302,9 +327,9 @@ export const routerName = { ...@@ -302,9 +327,9 @@ export const routerName = {
{ {
authId: "9200502", authId: "9200502",
name: "交付单详情", name: "交付单详情",
parentId: "92005" parentId: "92005",
} },
] ],
}, },
{ {
authId: "9200503", authId: "9200503",
...@@ -312,10 +337,10 @@ export const routerName = { ...@@ -312,10 +337,10 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
} },
], ],
component: _import("usedCarManagement/deliveryOrderManagement/index") component: _import("usedCarManagement/deliveryOrderManagement/index"),
}, },
9200502: { 9200502: {
path: "/deliveryOrderManagementDetail", path: "/deliveryOrderManagementDetail",
...@@ -325,10 +350,10 @@ export const routerName = { ...@@ -325,10 +350,10 @@ export const routerName = {
authId: "9200502", authId: "9200502",
parentId: "92005", parentId: "92005",
activePath: "/deliveryOrderManagement", // 缓存页面 activePath: "/deliveryOrderManagement", // 缓存页面
cache: false cache: false,
}, },
auth: [], auth: [],
component: _import("usedCarManagement/deliveryOrderManagement/detail") component: _import("usedCarManagement/deliveryOrderManagement/detail"),
}, },
92006: { 92006: {
path: "/vehicleLedger", path: "/vehicleLedger",
...@@ -337,7 +362,7 @@ export const routerName = { ...@@ -337,7 +362,7 @@ export const routerName = {
title: "车辆台账", title: "车辆台账",
authId: "92006", authId: "92006",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -346,10 +371,18 @@ export const routerName = { ...@@ -346,10 +371,18 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
} },
{
authId: "9200602",
parentId: "92006",
label: "导出",
category: "Button",
type: "primary",
handle: "handleFinancialLedgerExport",
},
], ],
component: _import("usedCarManagement/vehicleLedger/index") component: _import("usedCarManagement/vehicleLedger/index"),
}, },
92007: { 92007: {
path: "/quitAndHandover", path: "/quitAndHandover",
...@@ -358,7 +391,7 @@ export const routerName = { ...@@ -358,7 +391,7 @@ export const routerName = {
title: "离职继承", title: "离职继承",
authId: "92007", authId: "92007",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -368,16 +401,16 @@ export const routerName = { ...@@ -368,16 +401,16 @@ export const routerName = {
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleAddHandover", handle: "handleAddHandover",
icon: "plus" icon: "plus",
}, },
{ {
authId: "9200702", authId: "9200702",
parentId: "92007", parentId: "92007",
label: "详情", label: "详情",
handle: "handleDetail" handle: "handleDetail",
} },
], ],
component: _import("usedCarManagement/quitAndHandover/index") component: _import("usedCarManagement/quitAndHandover/index"),
}, },
92008: { 92008: {
path: "/reportManagement", path: "/reportManagement",
...@@ -386,7 +419,7 @@ export const routerName = { ...@@ -386,7 +419,7 @@ export const routerName = {
title: "报告管理", title: "报告管理",
authId: "92008", authId: "92008",
parentId: "920", parentId: "920",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
...@@ -395,9 +428,9 @@ export const routerName = { ...@@ -395,9 +428,9 @@ export const routerName = {
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport",
} },
], ],
component: _import("usedCarManagement/reportManagement/index") component: _import("usedCarManagement/reportManagement/index"),
} },
} };
...@@ -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,17 +330,14 @@ export default { ...@@ -396,17 +330,14 @@ 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 => {
if (valid) {
var params = { var params = {
file: this.fileInfo file: fileData
} }
recordUpload(params).then(res => { recordUpload(params).then(res => {
if (res) { if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, { const list = [...this.updateList, {
name: this.fileForm.fileName, name: fileName,
ifSuccess: false, ifSuccess: false,
uuid: res, uuid: res,
type: 'upload' type: 'upload'
...@@ -417,8 +348,6 @@ export default { ...@@ -417,8 +348,6 @@ export default {
this.handleImport() this.handleImport()
} }
}) })
}
})
}, },
handleAdd() { handleAdd() {
this.close({ tagName: '/editCustomer' }) this.close({ tagName: '/editCustomer' })
...@@ -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>
......
...@@ -7,11 +7,15 @@ const STRATEGYTYPEOPTIONS = { ...@@ -7,11 +7,15 @@ const STRATEGYTYPEOPTIONS = {
4: '销售精英到店提拉', 4: '销售精英到店提拉',
5: '强力促销', 5: '强力促销',
6: '最终盘点与低客单产品购入', 6: '最终盘点与低客单产品购入',
7: '留言'
} }
const DATE_RANGE = { const DATE_RANGE = {
label: '执行周期', label: '执行周期',
format: (val) => { format: (val) => {
let { startDate, endDate } = val let {
startDate,
endDate
} = val
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}` return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}`
} }
} }
...@@ -41,11 +45,15 @@ const STRATEGY_FORM_2456 = [ ...@@ -41,11 +45,15 @@ const STRATEGY_FORM_2456 = [
{ {
label: '执行人', label: '执行人',
format: (val) => { format: (val) => {
let { executePersons } = val let {
return executePersons.map(item => item.username).join('、') executePersons
} = val
return executePersons.map(item => item.username).join('/')
}, },
hide: (val) => { hide: (val) => {
let { strategyType } = val let {
strategyType
} = val
return [5, 6].includes(strategyType) return [5, 6].includes(strategyType)
} }
}, },
...@@ -66,9 +74,24 @@ const STRATEGY_FORM_3 = [ ...@@ -66,9 +74,24 @@ const STRATEGY_FORM_3 = [
}, },
] ]
const STRATEGY_FORM_7 = [
CREATED,
CREATED_DATE,
{
label: '处理人',
format: (val) => {
let {
executePersons
} = val
return executePersons.map(item => item.username).join('/') || '-'
},
},
]
export { export {
STRATEGYTYPEOPTIONS, STRATEGYTYPEOPTIONS,
STRATEGY_FORM_01, STRATEGY_FORM_01,
STRATEGY_FORM_2456, STRATEGY_FORM_2456,
STRATEGY_FORM_3, 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"
...@@ -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>') : '-'
}) })
if (this.pageNum == 1) {
this.list = list 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,46 +882,17 @@ export default { ...@@ -899,46 +882,17 @@ export default {
}, },
handleImport() { handleImport() {
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields() },
}, handleConfirmImport({ fileName, fileData }) {
// 上传文件,转码为base64
importFile(e) {
console.log(e)
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.$set(this.fileForm, "fileName", e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = (event) => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(",")
this.fileInfo =
e.target.files[0].name.split(".")[
e.target.files[0].name.split(".")?.length - 1
] +
"@" +
arrBase64[1]
document.getElementById("fileUpload").value = ""
}
} else {
this.notice.errorTips("上传文件不可超过9M")
document.getElementById('fileUpload').value = ''
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate((valid) => {
if (valid) {
var params = { var params = {
file: this.fileInfo file: fileData
} }
api.uploadFile(params).then((res) => { api.uploadFile(params).then((res) => {
if (res) { if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [ const list = [
...this.updateList, ...this.updateList,
{ {
name: this.fileForm.fileName, name: fileName,
ifSuccess: false, ifSuccess: false,
uuid: res, uuid: res,
type: "upload" type: "upload"
...@@ -949,12 +903,9 @@ export default { ...@@ -949,12 +903,9 @@ export default {
this.handleBatchImport() 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="确定"
class="relateStore"
:is-visible.sync="batchCopyVisible" :is-visible.sync="batchCopyVisible"
title="批量复制"
width="600px" width="600px"
btn-ok-label="确定"
@confirmDialog="handleBatchCopyConfirm"
@closeDialog="handleBatchCopyClose" @closeDialog="handleBatchCopyClose"
class="relateStore"> @confirmDialog="handleBatchCopyConfirm">
<el-form label-width="120px" :rules="rules" :model="selectData" ref="batchCopyForm"> <el-form ref="batchCopyForm"
label-width="120px"
:model="selectData"
:rules="rules">
<el-form-item label="业务场景:"> <el-form-item label="业务场景:">
<el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input> <el-input v-model="sceneList[selectedScene]"
disabled
style="width: 370px;">
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="复制门店:" prop="selectMerchantObj"> <el-form-item label="复制门店:" prop="selectMerchantObj">
<el-select v-model="selectData.selectMerchantObj" remote reserve-keyword multiple collapse-tags <el-select v-model="selectData.selectMerchantObj"
placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod" v-el-select-loadmore="interestsLoadmore"
v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable> collapse-tags
<el-option v-for="subItem in storeData" :key="subItem.merchantId" filterable
:label="subItem.merchantName" :value="subItem" /> multiple
placeholder="请选择复制门店"
remote
:remote-method="remoteMethod"
reserve-keyword
style="width: 370px;"
value-key="merchantId"
@visible-change="visibleChange">
<el-option v-for="subItem in storeData"
:key="subItem.merchantId"
:label="subItem.merchantName"
:value="subItem" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -24,117 +41,120 @@ ...@@ -24,117 +41,120 @@
</div> </div>
</d2-dialog> </d2-dialog>
</template> </template>
<script> <script>
import { getList, getAccountMerchantList } from '@/api/merchant' import { getAccountMerchantList, getList } from "@/api/merchant";
import { sceneList } from '@/common/constants.js' import { sceneList } from "@/common/constants.js";
export default { export default {
name: 'RelateStoreDialog', name: "RelateStoreDialog",
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: '',
sceneList,
selectData: {},
rules: { selectMerchantObj: [{ required: true, message: '请选择复制门店', trigger: 'blur' }] }
}
},
directives: { directives: {
'el-select-loadmore': { "el-select-loadmore": {
bind(el, binding) { bind(el, binding) {
setTimeout(() => { setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector( const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap' ".el-select-dropdown .el-select-dropdown__wrap",
) );
SELECTWRAP_DOM.addEventListener('scroll', function () { SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition = const condition
this.scrollHeight - this.scrollTop <= this.clientHeight = this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) { if (condition) {
binding.value() binding.value();
}
})
}, 100)
}
} }
});
}, 100);
},
},
}, },
props: { props: {
batchCopyVisible: { batchCopyVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
selectedScene: { selectedScene: {
type: Number type: Number,
} },
},
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: "",
sceneList,
selectData: {},
rules: { selectMerchantObj: [{ required: true, message: "请选择复制门店", trigger: "blur" }] },
};
}, },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
getList() { getList() {
const storeApi = [1, 2, 3].includes(this.selectedScene) ? getList : getAccountMerchantList // 会员权益/积分商城场景 上架门店是账户中心所有门店 const storeApi = [1, 2, 3].includes(this.selectedScene) ? getList : getAccountMerchantList; // 会员权益/积分商城场景 上架门店是账户中心所有门店
storeApi({ storeApi({
// merchantIdName: ![1, 2, 3].includes(this.selectedScene) ? this.searchMerchantName : '', // merchantIdName: ![1, 2, 3].includes(this.selectedScene) ? this.searchMerchantName : '',
merchantName: this.searchMerchantName, merchantName: this.searchMerchantName,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
scene: this.selectedScene scene: this.selectedScene,
}).then(res => { }).then((res) => {
res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo res?.list?.forEach((val) => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = val.merchantNo if (val.merchantNo)
}) val.merchantId = val.merchantNo;
this.storeData = this.storeData.concat(res.list) });
}) this.storeData = this.storeData.concat(res.list);
});
}, },
// 获取上架门店 // 获取上架门店
remoteMethod(query) { remoteMethod(query) {
this.searchMerchantName = query this.searchMerchantName = query;
this.currentPage = 1 this.currentPage = 1;
this.storeData = [] this.storeData = [];
this.getList() // 请求接口 this.getList(); // 请求接口
}, },
visibleChange(data) { visibleChange(data) {
// 获取焦点重新渲染下拉框数据 // 获取焦点重新渲染下拉框数据
if (data) { if (data) {
if (this.searchMerchantName) { if (this.searchMerchantName) {
this.searchMerchantName = '' this.searchMerchantName = "";
this.currentPage = 1 this.currentPage = 1;
this.storeData = [] this.storeData = [];
this.getList() this.getList();
} }
} }
}, },
// 获取更多上架门店 // 获取更多上架门店
interestsLoadmore() { interestsLoadmore() {
setTimeout(() => { setTimeout(() => {
this.currentPage = this.currentPage + 1 this.currentPage = this.currentPage + 1;
if (this.allPages < this.currentPage) { if (this.allPages < this.currentPage) {
this.currentPage = this.allPages this.currentPage = this.allPages;
return return;
} }
this.getList() this.getList();
}, 10) }, 10);
}, },
handleBatchCopyConfirm() { handleBatchCopyConfirm() {
this.$refs.batchCopyForm.validate((valid) => { this.$refs.batchCopyForm.validate((valid) => {
if (valid) { if (valid) {
this.$emit('handleBatchCopyConfirm', this.selectData?.selectMerchantObj) this.$emit("handleBatchCopyConfirm", this.selectData?.selectMerchantObj);
} }
}) });
}, },
handleBatchCopyClose() { handleBatchCopyClose() {
this.$emit('handleBatchCopyClose') this.$emit("handleBatchCopyClose");
} },
} },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
.tips{ .tips {
font-size: 14px; font-size: 14px;
color: #999; color: #999;
} }
......
<template>
<d2-dialog btn-ok-label="确认"
class="batch-modify-inventory-dialog"
:is-visible.sync="dialogVisible"
title="批量修改库存模式"
width="600px"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<div class="tip-text">
已选择{{ selectedGoodsCount }}个商品,涉及{{ relatedStoreCount }}家门店
</div>
<div class="tip-sub-text">
统一设置所有商品的门店管控模式
</div>
<el-form ref="formRef"
class="form-container"
label-width="120px"
:model="form"
:rules="rules">
<el-form-item label="管控模式:" prop="inventoryType">
<el-radio-group v-model="form.inventoryType">
<el-radio :label="2">
实物
</el-radio>
<el-radio :label="1">
虚拟
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="应用范围:" prop="bindAllMerchant">
<el-radio-group v-model="form.bindAllMerchant" @change="handleScopeChange">
<el-radio :label="true">
所有门店
</el-radio>
<el-radio :label="false">
指定门店
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.bindAllMerchant === 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>
<!-- 关联门店弹窗 --> <!-- 关联门店弹窗 -->
<template> <template>
<d2-dialog <d2-dialog btn-ok-label="确定"
:title="title" class="relateStore"
:is-visible.sync="relateStoreVisible" :is-visible.sync="relateStoreVisible"
:title="title"
width="70%" width="70%"
btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose" @closeDialog="handleRelateStoreClose"
class="relateStore"> @confirmDialog="handleRelateStoreConfirm">
<slot /> <slot />
<el-row class="tableCon"> <el-row class="tableCon">
<div class="tableBox"> <div class="tableBox">
<el-table <el-table ref="seletingTable"
ref="seletingTable" border
class="table"
:data="selectingData" :data="selectingData"
height="464px" height="464px"
class="table"
border
@select="handleChange" @select="handleChange"
@select-all="handleAll"> @select-all="handleAll">
<el-table-column type="selection" width="55" align="center" /> <el-table-column align="center"
<el-table-column prop="merchantName" label="门店名称" align="center"> type="selection"
width="55" />
<el-table-column align="center"
label="门店名称"
prop="merchantName">
</el-table-column> </el-table-column>
<el-table-column prop="merchantId" label="门店商户号" align="center"> <el-table-column align="center"
label="门店商户号"
prop="merchantId">
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center"
prop="yqMerchantName"
label="服务对接" label="服务对接"
align="center"> prop="yqMerchantName">
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center"
prop="yqMerchantId"
label="服务对接商户号" label="服务对接商户号"
align="center"> prop="yqMerchantId">
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination background
small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage" :current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" /> :page-size="pageSize"
small
:total="total"
@current-change="handleCurrentChange" />
</div> </div>
<el-table <el-table border
class="tableBox table" class="tableBox table"
:data="selectedData" :data="selectedData"
border
height="464px"> height="464px">
<el-table-column prop="merchantName" label="门店名称" align="center"> <el-table-column align="center"
<template slot-scope="scope"> label="门店名称"
prop="merchantName">
<template #default="scope">
<span>{{ scope.row.merchantName }}</span> <span>{{ scope.row.merchantName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="merchantId" label="门店商户号" align="center"> <el-table-column align="center"
<template slot-scope="scope"> label="门店商户号"
prop="merchantId">
<template #default="scope">
<span>{{ scope.row.merchantId }}</span> <span>{{ scope.row.merchantId }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="删除" align="center" width="50px"> <el-table-column align="center"
<template slot-scope="scope"> label="删除"
<el-button width="50px">
class="el-icon-delete" <template #default="scope">
@click="handleDelete(scope.row)" <el-button class="el-icon-delete"
type="text" /> type="text"
@click="handleDelete(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -75,58 +80,62 @@ ...@@ -75,58 +80,62 @@
<script> <script>
export default { export default {
name: "RelateStoreDialog", name: "RelateStoreDialog",
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20
}
},
props: { props: {
title: { title: {
type: String, type: String,
default: "上架门店" default: "上架门店",
}, },
relateStoreVisible: { relateStoreVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
storeApi: { storeApi: {
type: Function, type: Function,
default: () => {} default: () => {},
}, },
storeSelected: { storeSelected: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
storeSearchForm: { storeSearchForm: {
type: Object, type: Object,
default: () => {} default: () => {},
}, },
selectedScene: { selectedScene: {
type: Number type: Number,
} },
isHide: {
type: Boolean,
default: false,
},
},
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
};
}, },
mounted() { mounted() {
this.selectedData = this.storeSelected this.selectedData = this.storeSelected;
this.getSelectingList() this.getSelectingList();
}, },
methods: { methods: {
recoverySelection() { recoverySelection() {
var exitIds = this.selectedData.map((item) => item.merchantId) let exitIds = this.selectedData.map(item => item.merchantId);
this.selectingData.forEach((item) => { this.selectingData.forEach((item) => {
exitIds.includes(item.merchantId) && exitIds.includes(item.merchantId)
this.$refs.seletingTable.toggleRowSelection(item, true) && this.$refs.seletingTable.toggleRowSelection(item, true);
}) });
}, },
getSelectingList() { getSelectingList() {
const _storeSearchForm = this.storeSearchForm const _storeSearchForm = this.storeSearchForm;
// 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理 // 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理
// if ([0, 4].includes(this.selectedScene)) { // if ([0, 4].includes(this.selectedScene)) {
// // 会员权益,积分商城场景查询门店名称参数 // // 会员权益,积分商城场景查询门店名称参数
...@@ -136,67 +145,77 @@ export default { ...@@ -136,67 +145,77 @@ export default {
...this.storeSearchForm, ...this.storeSearchForm,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
scene: this.selectedScene scene: this.selectedScene,
}).then((res) => { }).then((res) => {
res?.list?.forEach((val) => { res?.list?.forEach((val) => {
// 账户中心门店返回商户号字段是merchantNo // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = Number(val.merchantNo) if (val.merchantNo)
val.merchantId = Number(val.merchantNo);
val?.sceneList?.forEach((subVal) => { val?.sceneList?.forEach((subVal) => {
if (subVal.scene == this.selectedScene) { if (subVal.scene == this.selectedScene) {
val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-" val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-";
val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-" val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-";
} }
}) });
}) });
this.selectingData = res.list this.selectingData = res.list;
this.total = res.total this.total = res.total;
this.$nextTick(() => { this.$nextTick(() => {
this.recoverySelection() this.recoverySelection();
}) });
}) });
}, },
handleChange(selection, row) { handleChange(selection, row) {
var addOrDelete = !!selection.find( let addOrDelete = !!selection.find(
(item) => item.merchantId === row.merchantId item => item.merchantId === row.merchantId,
) );
row = {
...row,
inventoryType: 2,
};
addOrDelete addOrDelete
? this.selectedData.push(row) ? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter( : (this.selectedData = this.selectedData.filter(
(item) => item.merchantId !== row.merchantId item => item.merchantId !== row.merchantId,
)) ));
}, },
handleAll(selection) { handleAll(selection) {
this.selectingData.forEach((item) => { this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex( if (!item.inventoryType) {
(subItem) => subItem.merchantId === item.merchantId this.$set(item, "inventoryType", 2);
) }
let isExit = this.selectedData.findIndex(
subItem => subItem.merchantId === item.merchantId,
);
if (selection.length && isExit === -1) { if (selection.length && isExit === -1) {
this.selectedData.push(item) this.selectedData.push(item);
} else if (!selection.length && isExit !== -1) { } else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1) this.selectedData.splice(isExit, 1);
} }
}) });
}, },
handleDelete(row) { handleDelete(row) {
this.selectedData = this.selectedData.filter( this.selectedData = this.selectedData.filter(
(item) => item.merchantId !== row.merchantId item => item.merchantId !== row.merchantId,
) );
const obj = this.selectingData.find((v) => v.merchantId == row.merchantId) const obj = this.selectingData.find(v => v.merchantId == row.merchantId);
this.$refs.seletingTable.toggleRowSelection(obj) this.$refs.seletingTable.toggleRowSelection(obj);
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val this.currentPage = val;
this.getSelectingList() this.getSelectingList();
}, },
handleRelateStoreConfirm() { handleRelateStoreConfirm() {
this.$emit("handleRelateStoreConfirm", this.selectedData) this.$emit("handleRelateStoreConfirm", this.selectedData);
}, },
handleRelateStoreClose() { handleRelateStoreClose() {
this.$emit("handleRelateStoreClose") this.$emit("handleRelateStoreClose");
} },
} },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
.relateStore .table { .relateStore .table {
margin: 0 auto 20px !important; margin: 0 auto 20px !important;
......
<!--
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2024-06-12 15:21:09
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-03-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-row-style="headerRowStyle"
header-cell-class-name="header-cell-class-name" header-cell-class-name="header-cell-class-name"
border> :header-row-style="headerRowStyle"
<el-table-column style="width: 100%">
align="center" <el-table-column align="center"
width="60px"
label="序号" label="序号"
type="index" /> type="index"
<el-table-column width="60px" />
prop="merchantName" <el-table-column align="center"
label="门店名称" label="门店名称"
align="center" /> prop="merchantName" />
<el-table-column <el-table-column align="center"
prop="merchantId"
label="门店商户号" label="门店商户号"
align="center" /> prop="merchantId" />
<el-table-column <el-table-column v-if="!isHide"
label="操作" align="center"
label="库存管控">
<template #default="scope">
<span v-if="isDetail">{{ scope.row.inventoryType == 1 ? '虚拟' : '实物' }}</span>
<el-select v-else
v-model="scope.row.inventoryType"
placeholder="请选择">
<el-option label="实物" :value="2"></el-option>
<el-option label="虚拟" :value="1"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column v-if="!isDetail"
align="center" align="center"
v-if="!isDetail" label="操作"
width="90"> width="90">
<template slot-scope="scope"> <template #default="scope">
<el-button <el-button type="text"
type="text" @click="handleDelete(scope.row)">
@click="handleDelete(scope.row)">删除</el-button> 删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'RelateProTable', name: "RelateProTable",
props: { props: {
merchantGoodsRefList: { merchantGoodsRefList: {
type: Array, type: Array,
default: () => {} default: () => {},
}, },
isDetail: { isDetail: {
type: Boolean, type: Boolean,
default: false default: false,
} },
isHide: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
} };
}, },
methods: { methods: {
handleDelete(item) { handleDelete(item) {
this.$emit('handleDelete', item) this.$emit("handleDelete", item);
}, },
headerRowStyle() { headerRowStyle() {
return { return {
height: '40px', height: "40px",
background: '#F2F4F7' background: "#F2F4F7",
} };
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.store-table{ .store-table {
margin-top: 15px; margin-top: 15px;
} }
::v-deep .header-cell-class-name{ ::v-deep .header-cell-class-name {
height: 30px; height: 30px;
background: #F2F4F7; background: #f2f4f7;
} }
::v-deep .el-table th{ ::v-deep .el-table th {
padding: 0; padding: 0;
} }
::v-deep .el-table__body-wrapper tr td{ ::v-deep .el-table__body-wrapper tr td {
padding: 8px 0 !important; padding: 8px 0 !important;
} }
</style> </style>
...@@ -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,38 +682,15 @@ export default { ...@@ -704,38 +682,15 @@ export default {
}, },
handleBatchImport() { handleBatchImport() {
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields() },
}, handleConfirmImport({ fileName, fileData }) {
// 上传文件,转码为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 = ''
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = { var params = {
file: this.fileInfo file: fileData
} }
groundingImport(params).then(res => { groundingImport(params).then(res => {
if (res) { if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, { const list = [...this.updateList, {
name: this.fileForm.fileName, name: fileName,
ifSuccess: false, ifSuccess: false,
uuid: res, uuid: res,
type: 'upload' type: 'upload'
...@@ -746,8 +701,6 @@ export default { ...@@ -746,8 +701,6 @@ export default {
this.handleBatchImport() this.handleBatchImport()
} }
}) })
}
})
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
...@@ -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,51 +247,14 @@ export default { ...@@ -297,51 +247,14 @@ 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) {
// var params = {
// fileUrl: this.fileForm.fileUrl
// }
merchantOutputValueTargetImport({ file: this.fileInfo }).then((result) => {
if (result) { if (result) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, { const list = [...this.updateList, {
name: this.fileForm.fileName, name: fileName,
ifSuccess: false, ifSuccess: false,
uuid: result, uuid: result,
type: 'upload' type: 'upload'
...@@ -351,56 +264,6 @@ export default { ...@@ -351,56 +264,6 @@ export default {
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,21 +185,17 @@ export default { ...@@ -224,21 +185,17 @@ export default {
keyDowmGetList() { keyDowmGetList() {
this.$refs.outputValueTable.refreshTable() this.$refs.outputValueTable.refreshTable()
}, },
handleConfirmImport() { handleConfirmImport({ fileName, fileData }) {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = { var params = {
file: this.fileInfo file: fileData
} }
importContact(params).then(res => { importContact(params).then(res => {
if (res) { if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, { const list = [...this.updateList, {
name: this.fileForm.fileName, name: fileName,
ifSuccess: false, ifSuccess: false,
uuid: res, uuid: res,
type: 'upload' type: 'upload'
// labelText: ''
}] }]
this.actionSetDownloadList({ list, type: 'updateList' }) this.actionSetDownloadList({ list, type: 'updateList' })
...@@ -246,16 +203,13 @@ export default { ...@@ -246,16 +203,13 @@ export default {
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,50 +1350,20 @@ export default { ...@@ -1394,50 +1350,20 @@ export default {
}, },
handleImport() { handleImport() {
this.fileVisible = !this.fileVisible; this.fileVisible = !this.fileVisible;
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields();
},
// 上传文件,转码为base64
importFile(e) {
// console.log(e)
const size = e.target.files[0].size / 1024 / 1024;
if (size < 9) {
this.$set(this.fileForm, "fileName", e.target.files[0].name);
// // 转码base64
const reader = new FileReader();
reader.readAsDataURL(e.target.files[0]);
reader.onload = (event) => {
const imgFile = event.target.result;
const arrBase64 = imgFile.split(",");
this.fileInfo
= e.target.files[0].name.split(".")[1] + "@" + arrBase64[1];
document.getElementById("fileUpload").value = "";
};
} else {
this.notice.errorTips("上传文件不可超过9M");
document.getElementById("fileUpload").value = "";
}
}, },
handleConfirmImport() { handleConfirmImport({ fileName, fileData }) {
this.$refs.fileRuleForm.validate((valid) => {
if (valid) {
let params = { let params = {
// advanceUserId: this.userInfo.detail.uuid, file: fileData,
// 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) => { orderImport(params).then((res) => {
// console.log(res)
if (res) { if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [ const list = [
...this.updateList, ...this.updateList,
{ {
name: this.fileForm.fileName, name: fileName,
ifSuccess: false, ifSuccess: false,
uuid: res, uuid: res,
type: "upload", type: "upload",
// labelText: ''
}, },
]; ];
...@@ -1445,22 +1371,11 @@ export default { ...@@ -1445,22 +1371,11 @@ export default {
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,50 +398,18 @@ export default { ...@@ -433,50 +398,18 @@ 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) {
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
this.fileInfo = e.target.files[0].name.split('.')[e.target.files[0].name.split('.')?.length - 1] + '@' + arrBase64[1]
document.getElementById('fileUpload').value = ''
}
} else {
this.notice.errorTips('上传文件不可超过9M')
document.getElementById('fileUpload').value = ''
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = { var params = {
file: this.fileInfo file: fileData
} }
pointImport(params).then(res => { pointImport(params).then(res => {
if (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.notice.okTips(res)
this.handleBatchImport() this.handleBatchImport()
this.$refs.detailListTable.refreshTable() this.$refs.detailListTable.refreshTable()
} }
}) })
}
})
}, },
findAllPersonRelations(sourceType) { findAllPersonRelations(sourceType) {
...@@ -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)
}
})
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!