Commit 88859214 by 前端

Merge branch 'develop' into 'SAAS+V4.51.0-0331'

上线合并

See merge request !417
2 parents 32ebdf6e be44b4d4
Showing 117 changed files with 3802 additions and 461 deletions
This diff could not be displayed because it is too large.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"dayjs": "^1.8.12", "dayjs": "^1.8.12",
"default-passive-events": "^2.0.0", "default-passive-events": "^2.0.0",
"echarts": "^5.3.2", "echarts": "^5.3.2",
"element-ui": "^2.13.1", "element-ui": "2.13.2",
"eslint-plugin-standard": "^5.0.0", "eslint-plugin-standard": "^5.0.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"flex.css": "^1.1.7", "flex.css": "^1.1.7",
...@@ -43,11 +43,13 @@ ...@@ -43,11 +43,13 @@
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"number-precision": "^1.6.0",
"qrcodejs2": "^0.0.2", "qrcodejs2": "^0.0.2",
"qs": "^6.8.0", "qs": "^6.8.0",
"rfdc": "^1.3.0", "rfdc": "^1.3.0",
"screenfull": "^4.2.0", "screenfull": "^4.2.0",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"sortablejs": "^1.15.6",
"speed-measure-webpack-plugin": "^1.5.0", "speed-measure-webpack-plugin": "^1.5.0",
"svg-sprite-loader": "^6.0.11", "svg-sprite-loader": "^6.0.11",
"ua-parser-js": "^0.7.19", "ua-parser-js": "^0.7.19",
......
{
"name": "dj-car-life-system",
"version": "0.1.0",
"private": true,
"scripts": {
"备注": "去掉nomock配置命令",
"serve": "vue-cli-service serve",
"start": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve",
"build": " vue-cli-service build --no-module",
"build:nomock": "vue-cli-service build --mode nomock",
"build:travis": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode travis",
"lint": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint --fix",
"test:unit": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service test:unit",
"report": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --report"
},
"dependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.17.12",
"@babel/plugin-proposal-optional-chaining": "7.13.12",
"@sentry/browser": "^7.12.1",
"@sentry/integrations": "^7.12.1",
"@sentry/tracing": "^7.3.0",
"@sentry/vue": "^7.3.0",
"@sentry/webpack-plugin": "^1.18.9",
"axios": "^0.18.0",
"better-scroll": "^1.15.2",
"core-js": "^3.8.3",
"dayjs": "^1.8.12",
"default-passive-events": "^2.0.0",
"echarts": "^5.3.2",
"element-ui": "^2.13.1",
"eslint-plugin-standard": "^5.0.0",
"file-saver": "^2.0.5",
"flex.css": "^1.1.7",
"fuse.js": "^3.4.4",
"hotkeys-js": "^3.6.2",
"html2canvas": "^1.4.1",
"js-cookie": "^2.2.0",
"js-md5": "^0.7.3",
"jspdf": "^2.5.1",
"lowdb": "^1.0.0",
"nprogress": "^0.2.0",
"qrcodejs2": "^0.0.2",
"qs": "^6.8.0",
"rfdc": "^1.3.0",
"screenfull": "^4.2.0",
"sha1": "^1.1.1",
"speed-measure-webpack-plugin": "^1.5.0",
"svg-sprite-loader": "^6.0.11",
"ua-parser-js": "^0.7.19",
"vue": "^2.6.10",
"vue-qr": "^2.5.0",
"vue-router": "3.0.5",
"vue2-org-tree": "^1.3.6",
"vuex": "^3.0.1",
"webpack-theme-color-replacer": "^1.4.2",
"webpack5-svg-sprite-loader": "^5.1.1",
"xlsx": "^0.16.9",
"yarn": "^1.22.19"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@kazupon/vue-i18n-loader": "^0.4.1",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-unit-jest": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-standard": "^6.1.0",
"@vue/test-utils": "1.0.0-beta.29",
"@vue/vue2-jest": "^27.0.0-alpha.3",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.0.0",
"jest": "^27.1.0",
"postcss-preset-env": "^7.7.2",
"postcss-px-to-viewport": "^1.1.1",
"sass": "^1.18.0",
"sass-loader": "^7.1.0",
"script-loader": "^0.7.2",
"vue-template-compiler": "^2.5.21",
"webpack": "^5.74.0",
"vue-loader": "^15.10.0",
"vue-demi": "^0.13.1"
},
"eslintConfig": {
"parserOptions": {
"//": "由 babel-eslint 替换 @babel/eslint-parser",
"parser": "@babel/eslint-parser"
}
}
}
...@@ -207,4 +207,60 @@ export function getPersonStaffReceptionList (data) { ...@@ -207,4 +207,60 @@ export function getPersonStaffReceptionList (data) {
export function getPersonStaffWarning (data) { export function getPersonStaffWarning (data) {
data.method = 'dj.riskmanage.api.personefficiency.staffwarning' data.method = 'dj.riskmanage.api.personefficiency.staffwarning'
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
}
\ No newline at end of file \ No newline at end of file
}
/**
* 店效盯防-查询登录人指标集合
*/
export function getKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.findAllKpiMetric'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-修改登录人指标集合
*/
export function updateKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.updateKpiMetric'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-更多看板-数据指标
*/
export function getBoardList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.notice.board.items.detail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-更多看板-门店列表
*/
export function getBoardMerchantList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.notice.board.merchant.list'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-指标详情(趋势图)
*/
export function getBoardDetail (data) {
data.method = 'dj.api.smartcarlife.risk.manage.code.detail.list'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-修改登录人指标隐藏显示
*/
export function updateOneKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.updateOneKpiMetri'
return request(data, RequestMethods.POST)
}
/**
*
* 店效盯防-更多看板-门店列表导出
*/
export function exportMerchantList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.notice.board.merchant.list.export'
return request(data, RequestMethods.POST)
}
...@@ -54,9 +54,13 @@ export function getAllGoodsList(data) { ...@@ -54,9 +54,13 @@ 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) {
// data.method = `${path}merchantGoodsInfo.upgradeGoods.page`
// return request(data, "post")
// }
export function getAllGoodsListPage(data) { export function getAllGoodsListPage(data) {
data.method = `${path}merchantGoodsInfo.upgradeGoods.page` data.method = `${path}productManager.search`
return request(data, "post") return request(data, "post")
} }
...@@ -96,5 +100,5 @@ export function batchSetValidMinSellPrice(data) { ...@@ -96,5 +100,5 @@ export function batchSetValidMinSellPrice(data) {
// 批量导入 // 批量导入
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"])
} }
...@@ -105,3 +105,43 @@ export function pointStaffQuery(data) { ...@@ -105,3 +105,43 @@ export function pointStaffQuery(data) {
data.method = `${path}resident.point.staff.query` data.method = `${path}resident.point.staff.query`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 获取优惠券列表
export const getCouponList = (data) => {
data.method = `dj.api.smartcarlife.resident.coupon.list.merchant`
return request(data, RequestMethods.POST)
}
// 获取优惠券列表
export const getBrandList = (data) => {
data.method = `dj.api.smartcarlife.resident.coupon.brand.list.all`
return request(data, RequestMethods.POST)
}
// 驻店人员卡券发发放记录
export function getCouponRecord(data) {
data.method = "dj.api.smartcarlife.resident.coupon.grant.record"
return request(data, RequestMethods.POST)
}
// 等级名称列表
export function getLevelNameList(data) {
data.method = 'dj.api.smartcarlife.resident.level.config.name.list'
return request(data, RequestMethods.POST)
}
// 打开、关闭等级配置
export function levelSwitch(data) {
data.method = 'dj.api.smartcarlife.resident.level.config.switch'
return request(data, RequestMethods.POST)
}
// 卡券操作
export function grantOperate(data) {
data.method = 'dj.api.smartcarlife.resident.coupon.grant.operate'
return request(data, RequestMethods.POST)
}
// 卡券发放导出
export function exportGrantRecord(data) {
data.method = 'dj.api.smartcarlife.resident.coupon.grant.record.export'
return request(data, RequestMethods.POST)
}
...@@ -380,3 +380,12 @@ export function get4sAndServiceMerchantListApi(data) { ...@@ -380,3 +380,12 @@ export function get4sAndServiceMerchantListApi(data) {
data.method = `${path}merchant.merchantAndService.page` data.method = `${path}merchant.merchantAndService.page`
return request(data, "post") return request(data, "post")
} }
/**
*
* 获取车品牌列表
*/
export function getCarBrandList (data = {}) {
data.method = 'dj.api.smartcarlife.common.car.brand.list'
return request(data, RequestMethods.POST)
}
...@@ -78,4 +78,25 @@ export function deductOrderPage(data) { ...@@ -78,4 +78,25 @@ export function deductOrderPage(data) {
export function cancelDeduct(data) { export function cancelDeduct(data) {
data.method = `dj.api.smartcarlife.staff.score.cancel.deduct` data.method = `dj.api.smartcarlife.staff.score.cancel.deduct`
return request(data) return request(data)
}
// 积分审批列表同步
export function refreshData(data) {
data.method = `dj.api.smartcarlife.staff.motivation.page.sync`
return request(data)
}
//查询指定订单的操作记录
export function getOperationRecord(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.operation`
return request(data)
}
//根据订单号查询剩余积分
// export function getScoreByscore(data) {
// data.method = `dj.api.smartcarlife.staff.motivation.order.score`
// return request(data)
// }
//获取到总积分
export function getOrderByScore(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.score`
return request(data)
} }
\ No newline at end of file \ No newline at end of file
...@@ -439,4 +439,46 @@ export function getIncomePage(data) { ...@@ -439,4 +439,46 @@ export function getIncomePage(data) {
export function listGoodsType(data = {}) { export function listGoodsType(data = {}) {
data.method = 'dj.api.smartcarlife.staff.incomeCalculation.listGoodsType' data.method = 'dj.api.smartcarlife.staff.incomeCalculation.listGoodsType'
return request(data, 'post') return request(data, 'post')
}
// 复制绩效方案
export function copyPerformanceApi(data) {
data.method = `${path2}merchantPerformanceConfig.copyConfig`
return request(data, 'post')
}
// 获取员工是否是可查看工资白名单
export function staffWhiteListFlagApi(data) {
data.method = `${path2}staffBaseInfo.whiteList.select`
return request(data, 'post')
}
// 根据员工手机号获取员工所在园区店
export function yqMerchantListByStaffPhoneApi(data) {
data.method = `${path2}staffBaseInfo.yqMerchantInfo.list`
return request(data, 'post')
}
// 根据园区店商户号获取1.1和2.1场景下4S店列表
export function merchantListByYqMerchantApi(data) {
data.method = `${path2}scene.shopMerchant.list`
return request(data, 'post')
}
// 员工调店分配新增
export function addStaffDailyReportConfigApi(data) {
data.method = `${path2}staffDailyReportConfig.add`
return request(data, 'post')
}
// 员工调店分配配置修改
export function updateStaffDailyReportConfigApi(data) {
data.method = `${path2}staffDailyReportConfig.update`
return request(data, 'post')
}
// 员工调店分配配置删除
export function deleteStaffDailyReportConfigApi(data) {
data.method = `${path2}staffDailyReportConfig.delete`
return request(data, 'post')
} }
\ No newline at end of file \ No newline at end of file
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-02-24 10:57:17
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-02-24 17:13:11
* @FilePath: \dj-car-life-system\src\api\shelfManage.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.api.create.business.approve."
// 获取企微审批模版
export function getWorkwechatTemplate(data) {
data.method = `${path}workwechat.template`
return request(data, RequestMethods.POST)
}
// 分页查询嘀加上架列表
export function getPage(data) {
data.method = `${path}page`
return request(data, RequestMethods.POST)
}
// 驳回嘀加上架
export function reject(data) {
data.method = `${path}reject`
return request(data, RequestMethods.POST)
}
// 嘀加上架查看详情(分账、对账配置)
export function merchantSettleDistributeRuleLastRule(data) {
data.method = `dj.api.create.business.approve.detail.rule`
return request(data)
}
// 获取不同场景的商品分类
export function getGoodsCategoryConfiguration(data) {
data.currentPage = 1
data.pageSize = 999999
// data.method = `${path}goodsCategoryConfiguration.page`
data.method = `${path}goodsCategoryConfiguration.page.new`
return request(data)
}
// 财务 - 2 - 获取导流方
export function getMerchantLevelApi(data) {
data.method = `dj.api.smartcarlife.get.merchantLevel`
return request(data, "post")
}
// 嘀加上架 - 基本信息
export function getBusisDetailBasic(data) {
data.method = `dj.api.create.business.approve.detail.basic`
return request(data)
}
// 新增商户 - 车品牌
export function brandList(data) {
data.method = `merchants.api.merchantCommon.getCarbrandTree`
return request(data, RequestMethods.POST)
}
// 新增商户 - 商户类型
export function getMerchantType(data) {
data.method = `merchants.api.menu.findAllDictData`
return request(data, RequestMethods.POST)
}
// 嘀加上架查看详情(上架商品及测算)
export function getGoodsDetail(data) {
data.method = `${path}detail.goods`
return request(data, RequestMethods.POST)
}
// 嘀加上架提交
export function saveApprove(data) {
data.method = `${path}save`
return request(data, RequestMethods.POST, ["file"])
}
// 新增商户 - 保存商户
export function saveMerchant(data) {
data.method = `merchants.api.merchant.saveMerchant.permissions`
return request(data, RequestMethods.POST)
}
// 新增商户 - 下级商户
export function findMerchantListByPage(data) {
data.method = `merchants.api.open.findMerchantListByPage`
return request(data, RequestMethods.POST)
}
// 嘀加上架 - 保存
export function operationConfirm(data) {
data.method = `dj.api.create.business.approve.operationConfirm`
return request(data, RequestMethods.POST)
}
// 嘀加上架 - 保存
export function operationConfirmJson(data) {
data.method = `dj.api.create.business.approve.operationConfirm.json`
return request(data, RequestMethods.POST)
}
// 嘀加上架 - 保存异步
export function operationConfirmJsonAsync(data) {
data.method = `dj.api.create.business.approve.operationConfirm.json.async`
return request(data, RequestMethods.POST)
}
// 嘀加上架 - 保存异步
export function approveAsyncProcess(data) {
data.method = `dj.api.create.business.approve.asyncProcess`
return request(data, RequestMethods.POST)
}
// 嘀加上架 - 测算
export function computeProductProfitDetail(data) {
data.method = `dj.api.smartcarlife.createBusiness.approve.computeProductProfitDetail.json`
return request(data, RequestMethods.POST)
}
// 附件上传接口
export function uploadFileWithFileName(data) {
data.method = `dj.api.common.uploadFile.with.file.name`
return request(data, RequestMethods.POST, ["file"])
}
...@@ -684,7 +684,11 @@ export const businessNature = [ ...@@ -684,7 +684,11 @@ export const businessNature = [
// { confId: 3, confName: "合资收购" }, // { confId: 3, confName: "合资收购" },
{ confId: 4, confName: "投资收购-利丰" }, { confId: 4, confName: "投资收购-利丰" },
{ confId: 5, confName: "投资收购-内蒙古" }, { confId: 5, confName: "投资收购-内蒙古" },
{ confId: 6, confName: "服务商投资" } { confId: 7, confName: "投资收购-龙南" },
{ confId: 8, confName: "投资收购-湖北正旺" },
{ confId: 6, confName: "服务商投资" },
{ confId: 9, confName: "系统实施-新疆东捷" },
{ confId: 10, confName: "系统实施-捷通达" }
] ]
// 店面配置 业务性质 // 店面配置 业务性质
export const businessNatureShow = { export const businessNatureShow = {
...@@ -822,7 +826,8 @@ export const downloadReportManage_reportType = [ ...@@ -822,7 +826,8 @@ export const downloadReportManage_reportType = [
{ confId: "multiCategoryOperationMerchant", confValue: "多品类运营-门店" }, { confId: "multiCategoryOperationMerchant", confValue: "多品类运营-门店" },
{ confId: "selleruseruserdipadanalysis", confValue: "驻店人员平板使用分析" }, { confId: "selleruseruserdipadanalysis", confValue: "驻店人员平板使用分析" },
{ confId: "dailybehaviorsummary", confValue: "日行为汇总表" }, { confId: "dailybehaviorsummary", confValue: "日行为汇总表" },
{ confId: "weeklybehaviorsummary", confValue: "周行为汇总表" } { confId: "weeklybehaviorsummary", confValue: "周行为汇总表" },
{ confId: "businessDataSummary", confValue: "业务数据汇总" }
] ]
// 下载报表 业务类型 // 下载报表 业务类型
...@@ -1071,3 +1076,32 @@ export const zyVoucherStatusOpt = [ ...@@ -1071,3 +1076,32 @@ export const zyVoucherStatusOpt = [
{ confId: "1", confValue: "待上传" }, { confId: "1", confValue: "待上传" },
{ confId: "2", confValue: "已上传" } { confId: "2", confValue: "已上传" }
] ]
// 嘀加上架 审批类型
export const approveTypeOpt = [
{ confId: 1, confValue: "嘀加上架与销售合同" },
{ confId: 2, confValue: "嘀加上架修改" }
]
// 嘀加上架 系统状态
export const systemStatusOpt = [
{ confId: 1, confValue: "运营确认" },
{ confId: 2, confValue: "已转OA" },
{ confId: 3, confValue: "完成上架更新" },
{ confId: 4, confValue: "驳回" },
{ confId: 5, confValue: "处理中" }
]
// 嘀加上架 审批状态
export const approveStatusOpt = [
{ confId: 1, confValue: "审批中" },
{ confId: 2, confValue: "已通过" },
{ confId: 3, confValue: "已驳回" },
{ confId: 4, confValue: "已撤销" }
]
// 嘀加上架 业务线
export const businessLineOpt = [
{ confId: 1, confValue: "权益" },
{ confId: 2, confValue: "延保" }
]
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).GlMap=r()}(this,(function(){"use strict";function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function e(t,r,e){return r&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(){n=function(){return r};var t,r={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof g?r:g,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=s;var p="suspendedStart",y="suspendedYield",v="executing",d="completed",m={};function g(){}function w(){}function b(){}var L={};l(L,c,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(T([])));E&&E!==e&&o.call(E,c)&&(L=E);var j=b.prototype=g.prototype=Object.create(L);function G(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function S(t,r){function e(n,i,a,c){var u=h(t[n],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&o.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}})}function O(r,e,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var f=h(r,e,n);if("normal"===f.type){if(o=n.done?d:y,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=d,n.method="throw",n.arg=f.arg)}}}function _(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,_(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function A(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(r){if(r||""===r){var e=r[c];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var n=-1,i=function e(){for(;++n<r.length;)if(o.call(r,n))return e.value=r[n],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(typeof r+" is not iterable")}return w.prototype=b,i(j,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},r.awrap=function(t){return{__await:t}},G(S.prototype),l(S.prototype,u,(function(){return this})),r.AsyncIterator=S,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new S(s(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},G(j),l(j,f,"Generator"),l(j,c,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=T,P.prototype={constructor:P,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!r)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),A(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;A(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:T(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function o(r){return function(r){if(Array.isArray(r))return t(r)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof r?r:r+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var c={1:"develop",2:"test",3:"production",4:"beta"},u=function(){return e((function t(){var e=this;!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t);var o,i,u={env:3,version:3},f=arguments[0];if(arguments.length>1&&(u="object"==a(arguments[0])?arguments[0]:u,f=arguments[1],null!==(o=u)&&void 0!==o&&o.env||(u.env=3),null!==(i=u)&&void 0!==i&&i.version||(u.version=3)),"undefined"!=typeof window){var l=function(){var t,o=(t=n().mark((function t(){var r,o,i,a;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=map-api-js&env=".concat(c[u.env]));case 3:return r=t.sent,t.next=6,r.json();case 6:o=t.sent,i=Array.from(document.head.getElementsByTagName("script")).some((function(t){return t.src===o.apiUrl})),i?f&&"function"==typeof f&&(e.GLMap=new window.$GlMapApi(u,(function(){f&&"function"==typeof f&&f(e)}))):((a=document.createElement("script")).src=o.apiUrl,document.head.appendChild(a),a.onload=function(){e.GLMap=new window.$GlMapApi(u,(function(){f&&"function"==typeof f&&f(e)}))}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.error("Failed to fetch configuration:",t.t0);case 14:case"end":return t.stop()}}),t,null,[[0,11]])})),function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(){return o.apply(this,arguments)}}();l()}}),[{key:"invoke",value:function(t){var r,e=Array.prototype.slice.call(arguments,1);return(r=this.GLMap)[t].apply(r,o(e))}},{key:"map",get:function(){return this.GLMap._BMAP}},{key:"mapGL",get:function(){return this.GLMap._BMapGL}}])}();return u}));
<!--
* @Author: your name
* @Date: 2022-03-07 14:32:50
* @LastEditTime: 2025-03-11 17:12:12
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\views\baseInfo\editInfo.vue
-->
<template>
<div v-loading="loading">
<div class="select-input-box" @click="switchBrand">
<div>
<template v-for="(item, idx) in getCheckedArr">
<el-tag effect="plain" type="info" :key="idx" closable :disable-transitions="false" @close="removeItem(item, idx)" v-if="idx < 3">
{{ item.label }}
</el-tag>
</template>
<el-popover placement="top" width="600" trigger="hover" class="select-popover">
<div class="select-popover-box">
<el-tag effect="plain" class="popover-item" v-for="(item, idx) in getCheckedArr" type="info" :key="idx" closable :disable-transitions="false" @close="removeItem(item, idx)">
{{ item.label }}
</el-tag>
</div>
<el-tag effect="plain" slot="reference" type="info" v-show="getCheckedArr.length > 3">+ {{ getCheckedArr.length - 3 }}</el-tag>
</el-popover>
</div>
<div>
<i v-show="!brandTree" class="el-icon-arrow-up" style="color:#909399"></i>
<i v-show="brandTree" class="el-icon-arrow-down" style="color:#909399"></i>
</div>
</div>
<div class="tree-box" v-show="brandTree">
<el-input class="tree-input" prefix-icon="el-icon-search" placeholder="输入关键字进行过滤" v-model="filterText"></el-input>
<el-tree class="filter-tree" @check="handleCheck" :data="brandListTree" :props="defaultProps" node-key="id" show-checkbox :filter-node-method="filterNode" ref="tree"></el-tree>
<div class="tree-footer">
<div class="tree-footer-checkbox">
<el-checkbox v-model="checkedAll" @change="selectAll">全部</el-checkbox>
</div>
<div class="tree-footer-reset" @click="selectClear">重置</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'SelectBrand',
data() {
return {
loading: false,
checkedAll: false,
filterText: '',
treeArr: [],
getCheckedArr: [],
defaultProps: {
children: 'children',
label: 'label'
},
brandTree: false
}
},
props: {
brandListTree: {
type: Array
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
treeArr: {
handler() {
const getCheckedNodes = this.$refs.tree.getCheckedNodes()
this.getCheckedArr = getCheckedNodes.reduce((prev, cur) => {
if (Object.keys(cur).includes('children') && cur.children && cur.children.length > 0) {
return prev
}
return prev.concat(cur)
}, [])
},
deep: true
}
},
methods: {
getMerchantBrandList() {
let getCheckedNodes = this.$refs.tree.getCheckedNodes()
const getCheckedKeys = this.$refs.tree.getCheckedKeys()
const getHalfCheckedNodes = this.$refs.tree.getHalfCheckedNodes()
let merchantBrandList = getHalfCheckedNodes.map(car => {
let merchantBrandId = []
car.children.forEach(item => {
if (getCheckedKeys.includes(item.id)) {
merchantBrandId.push(item.id)
}
})
return {
cars: car.id,
merchantBrandId
}
})
let checkNodes = getCheckedNodes.filter(item => item.children)
let noCheckNodes = getCheckedNodes
.filter(item => item.children === null)
.map(i => {
return {
cars: i.id
}
})
let merchantBrandList2 = checkNodes.map(car => {
let merchantBrandId = []
car.children.forEach(item => {
if (getCheckedKeys.includes(item.id)) {
merchantBrandId.push(item.id)
}
})
return {
cars: car.id,
merchantBrandId
}
})
return merchantBrandList.concat(merchantBrandList2).concat(noCheckNodes)
},
//勾选
handleCheck() {
this.treeArr = this.getTreeArray()
if (this.$refs.tree.getCheckedKeys().length == 0) {
this.checkedAll = false
}
if (this.$refs.tree.getCheckedKeys().length == this.treeArr.length) {
this.checkedAll = true
}
},
getCheckList(checkArr = []) {
checkArr.forEach(item => (item = parseInt(item)))
this.$refs.tree.setCheckedKeys(checkArr)
this.$nextTick(() => {
this.handleCheck()
})
},
//获取选择项
getTreeArray() {
let tree_arr = []
this.brandListTree.forEach(k => {
let child = k.children
if (child && child.length > 0) {
child.forEach(j => {
tree_arr.push(j.id)
})
} else {
tree_arr.push(k.id)
}
})
return tree_arr
},
//全选
selectAll() {
this.loading = true
this.treeArr = this.getTreeArray()
if (this.getCheckedArr.length == this.treeArr.length) {
this.checkedAll = false
this.$refs.tree.setCheckedKeys([])
} else {
this.checkedAll = true
this.$refs.tree.setCheckedKeys(this.treeArr)
}
setTimeout(() => {
this.loading = false
}, 1000)
},
//重置
selectClear() {
this.treeArr = []
this.checkedAll = false
this.$refs.tree.setCheckedKeys([])
},
//删除
removeItem(checkItem, index) {
this.loading = true
this.getCheckedArr.splice(index, 1)
const getCheckedNodes = this.$refs.tree.getCheckedNodes()
let getCheckedArr = getCheckedNodes.reduce((prev, cur) => {
if (Object.keys(cur).includes('children')) {
return prev
}
return prev.concat(cur)
}, [])
getCheckedArr = getCheckedArr.filter(item => {
return item.id != checkItem.id
})
this.$refs.tree.setCheckedNodes(getCheckedArr)
if (getCheckedArr.length == 0) {
this.checkedAll = false
}
this.$nextTick(() => {
this.loading = false
})
},
//过滤
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 显示隐藏
switchBrand() {
this.brandTree = !this.brandTree
this.$emit('clickBrand', this.brandTree)
}
}
}
</script>
<style lang="scss" scoped>
.select-input-box {
width: 400px;
// height: 38px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
box-sizing: border-box;
padding: 8px;
display: flex;
justify-content: space-between;
align-items: center;
// /deep/ .el-tag {
// margin-right: 5px;
// height: 26px;
// line-height: 26px;
// box-sizing: border-box;
// }
}
.select-popover {
&-box {
display: flex;
flex-wrap: wrap;
max-height: 500px;
overflow-y: auto;
.popover-item {
margin-right: 5px;
margin-bottom: 5px;
height: 26px;
line-height: 26px;
box-sizing: border-box;
}
}
}
.tree-box {
margin-top: 10px;
padding: 15px 15px 0px;
background: #ffffff;
// box-shadow: 0px 6px 20px 0px rgba(122, 122, 122, 0.2);
border-radius: 4px;
.tree-input {
margin-bottom: 10px;
}
.filter-tree {
height: 300px;
overflow-y: auto;
}
.tree-footer {
border-top: 1px solid #e5e5e5;
height: 48px;
padding: 0px 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.tree-footer-reset {
cursor: pointer;
}
</style>
<template>
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="mapContainer" style="width: 100%; height: 100%;z-index: 999999"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input id="input" placeholder="请输入关键字" v-model="input" @keyup.enter.native="searchAddress" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
</div>
</div>
</template>
<script>
let map, marker, geocoder
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 300
}
},
data() {
return {
input: '',
address: '',
lnglat: [],
geocoderAddress: {},
mapapi: null
}
},
methods: {
async mapInit(lng, lat) {
const mapapi = this.$mapapi
console.log(lng, lat, '==========', this.$mapapi)
map = await mapapi.invoke('Map', 'mapContainer')
if (lng) {
this.init(mapapi, map, lng, lat)
return true
}
mapapi.invoke('LocalCity', res => {
console.log('IP', res)
let { lng, lat } = res.center
this.init(mapapi, map, lng, lat, false)
})
},
init(mapapi, map, lng, lat, isMark = true) {
console.log(lng, lat, 'lng, lat')
mapapi.invoke('centerAndZoom', mapapi.invoke('Point', lng, lat), 15)
map.enableScrollWheelZoom() // 启用滚轮放大缩小
map.enableAutoResize() // 启用自动适应容器尺寸变化
geocoder = mapapi.invoke('Geocoder')
if (isMark) {
this.addMarker([lng, lat], true)
}
// 右键菜单
mapapi.invoke('mapAddEventListener', 'click', (e) => {
console.log(e)
this.getAddress(e.point)
})
},
searchAddress() {
const mapapi = this.$mapapi
console.log(mapapi, 'mapapi')
mapapi.invoke('getPoint', this.input, res => {
console.log(this.input, res, 'getPoint')
// this.addMarker(res)
this.getAddress(res)
}, '全国')
// let _this = this
// placeSearch.search(this.input, function(status, result) {
// if (status === 'complete' && result.poiList.pois.length) {
// let lnglat = result.poiList.pois[0].location
// _this.getAddress(lnglat)
// }
// })
},
addMarker(lnglat, isInit = false) {
const mapapi = this.$mapapi
let lnglatXY
console.log(lnglat)
if (lnglat.lng) {
const { lng, lat } = lnglat
lnglatXY = mapapi.invoke('Point', lng, lat)
} else {
lnglatXY = mapapi.invoke('Point', lnglat[0], lnglat[1])
}
if (marker) {
mapapi.invoke('removeOverlay', marker)
}
marker = mapapi.invoke('Marker', lnglatXY, {
icon: mapapi.invoke('Icon', require('@/assets/address.png'), mapapi.invoke('Size', 26, 38))
})
// if (!isInit) {
// mapapi.invoke('getLocation', lnglatXY, res => {
// console.log(res, 'getLocation')
// if (res) this.address = res.surroundingPois.length ? res.surroundingPois[0].address : res.address
// })
// }
mapapi.invoke('panTo', lnglatXY)
mapapi.invoke('addOverlay', marker)
},
getAddress(e) {
console.log(e)
let self = this
const mapapi = this.$mapapi
let lnglat
if (e.lng) {
const { lng, lat } = e
lnglat = mapapi.invoke('Point', lng, lat)
} else {
lnglat = mapapi.invoke('Point', e[0], e[1])
}
self.addMarker(lnglat)
self.lnglat = lnglat
geocoder.getLocation(lnglat, res => {
console.log(res)
this.address = res.surroundingPois.length ? res.surroundingPois[0].address : res.address
this.geocoderAddress = res.content.address_detail
})
// AMap.plugin('AMap.Geocoder', () => {
// const geocoder = new AMap.Geocoder()
// geocoder.getAddress(lnglat, (status, result) => {
// self.lnglat = lnglat
// self.address = result.regeocode.formattedAddress
// geocoder.getLocation(self.address, (status, result) => {
// if (status === 'complete' && result.info === 'OK') {
// this.geocoderAddress = result.geocodes[0]
// }
// })
// })
// })
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
}
},
created() {
// this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
position: absolute;
line-height: 20px;
bottom: -30px;
}
</style>
<template> <template>
<div class="d2-layout-header-aside-group" :style="styleLayoutMainGroup" :class="{ grayMode: grayActive }"> <div
class="d2-layout-header-aside-group"
:style="styleLayoutMainGroup"
:class="{ grayMode: grayActive }"
>
<!-- 半透明遮罩 --> <!-- 半透明遮罩 -->
<div class="d2-layout-header-aside-mask" /> <div class="d2-layout-header-aside-mask" />
<!-- 主体内容 --> <!-- 主体内容 -->
<div class="d2-layout-header-aside-content" flex="dir:top"> <div class="d2-layout-header-aside-content" flex="dir:top">
<!-- 顶栏 --> <!-- 顶栏 -->
<div class="d2-theme-header" :style="{ <div
opacity: this.searchActive ? 0.5 : 1 class="d2-theme-header"
}" flex-box="0" flex> :style="{
<div class="logo-group d2-theme-header-logo" :class="asideCollapse ? 'logo-only' : 'logo-all'" flex-box="0"> opacity: this.searchActive ? 0.5 : 1
<img v-if="asideCollapse" src="../../assets/icon-only.png"> }"
<img v-else src="../../assets/all.png"> flex-box="0"
flex
>
<div
class="logo-group d2-theme-header-logo"
:class="asideCollapse ? 'logo-only' : 'logo-all'"
flex-box="0"
>
<img v-if="asideCollapse" src="../../assets/icon-only.png" />
<img v-else src="../../assets/all.png" />
<!-- <img style="width: 32px; height: 32px;" src="../../assets/icon-only.png"> --> <!-- <img style="width: 32px; height: 32px;" src="../../assets/icon-only.png"> -->
</div> </div>
<p v-if="show" class="d2-header-name"> <p v-if="show" class="d2-header-name">
<!-- 先写死名字 --> <!-- 先写死名字 -->
<!-- {{ info ? info.detail.merchantName : '' }} --> <!-- {{ info ? info.detail.merchantName : '' }} -->
{{ 'SaaS+增值业务管理平台' }} {{ "SaaS+增值业务管理平台" }}
</p> </p>
<!-- <hamburger :onClick="handleToggleAside" :isActive="asideCollapse" flex-box="0" class="toggle-aside-btn"></hamburger> <!-- <hamburger :onClick="handleToggleAside" :isActive="asideCollapse" flex-box="0" class="toggle-aside-btn"></hamburger>
<span class="header-title">{{headerTitle}}</span> --> <span class="header-title">{{headerTitle}}</span> -->
...@@ -35,24 +48,47 @@ ...@@ -35,24 +48,47 @@
<d2-header-user /> <d2-header-user />
</div> </div>
</div> </div>
<div class="d2-theme-header" style="height: 40px; font-size: 14px; border-top: 1px solid #F0F2F5;" flex-box="0" <div
flex> class="d2-theme-header"
<div class="logo-group d2-theme-header-logo" style="height: 1px; margin-top: -1px;" style="height: 40px; font-size: 14px; border-top: 1px solid #f0f2f5"
:class="asideCollapse ? 'logo-only' : 'logo-all'" flex-box="0" /> flex-box="0"
<hamburger :on-click="handleToggleAside" :is-active="asideCollapse" flex-box="0" class="toggle-aside-btn" /> flex
>
<div
class="logo-group d2-theme-header-logo"
style="height: 1px; margin-top: -1px"
:class="asideCollapse ? 'logo-only' : 'logo-all'"
flex-box="0"
/>
<hamburger
:on-click="handleToggleAside"
:is-active="asideCollapse"
flex-box="0"
class="toggle-aside-btn"
/>
<span class="header-title">{{ headerTitle }}</span> <span class="header-title">{{ headerTitle }}</span>
</div> </div>
<!-- 下面 主体 --> <!-- 下面 主体 -->
<div class="d2-theme-container" flex-box="1" flex> <div class="d2-theme-container" flex-box="1" flex>
<!-- 主体 侧边栏 --> <!-- 主体 侧边栏 -->
<div flex-box="0" ref="aside" class="d2-theme-container-aside" :style="{ <div
width: asideCollapse ? asideWidthCollapse : asideWidth, flex-box="0"
opacity: this.searchActive ? 0.5 : 1 ref="aside"
}"> class="d2-theme-container-aside"
:style="{
width: asideCollapse ? asideWidthCollapse : asideWidth,
opacity: this.searchActive ? 0.5 : 1
}"
>
<d2-menu-side /> <d2-menu-side />
</div> </div>
<!-- 主体 --> <!-- 主体 -->
<div class="d2-theme-container-main" :class="this.searchActive ? 'is-search' : ''" flex-box="1" flex> <div
class="d2-theme-container-main"
:class="this.searchActive ? 'is-search' : ''"
flex-box="1"
flex
>
<!-- 搜索 --> <!-- 搜索 -->
<transition name="fade-scale"> <transition name="fade-scale">
<div v-if="searchActive" class="d2-theme-container-main-layer" flex> <div v-if="searchActive" class="d2-theme-container-main-layer" flex>
...@@ -61,14 +97,21 @@ ...@@ -61,14 +97,21 @@
</transition> </transition>
<!-- 内容 --> <!-- 内容 -->
<transition name="fade-scale"> <transition name="fade-scale">
<div v-if="!searchActive" class="d2-theme-container-main-layer" flex="dir:top"> <div
v-if="!searchActive"
class="d2-theme-container-main-layer"
flex="dir:top"
>
<!-- tab --> <!-- tab -->
<div class="d2-theme-container-main-header" flex-box="0"> <div class="d2-theme-container-main-header" flex-box="0">
<!-- <d2-tabs/> --> <!-- <d2-tabs/> -->
</div> </div>
<!-- 页面 --> <!-- 页面 -->
<div class="d2-theme-container-main-body" flex-box="1"> <div class="d2-theme-container-main-body" flex-box="1">
<transition :name="transitionActive ? 'el-fade-in' : ''" mode="out-in"> <transition
:name="transitionActive ? 'el-fade-in' : ''"
mode="out-in"
>
<keep-alive :include="keepAlive"> <keep-alive :include="keepAlive">
<router-view /> <router-view />
</keep-alive> </keep-alive>
...@@ -83,27 +126,25 @@ ...@@ -83,27 +126,25 @@
</template> </template>
<script> <script>
import d2MenuSide from './components/menu-side' import d2MenuSide from "./components/menu-side"
import d2MenuHeader from './components/menu-header' import d2MenuHeader from "./components/menu-header"
// import d2Tabs from './components/tabs' // import d2Tabs from './components/tabs'
// import d2HeaderFullscreen from './components/header-fullscreen' // import d2HeaderFullscreen from './components/header-fullscreen'
// import d2HeaderLocales from './components/header-locales' // import d2HeaderLocales from './components/header-locales'
// import d2HeaderSearch from './components/header-search' // import d2HeaderSearch from './components/header-search'
// import d2HeaderSize from './components/header-size' // import d2HeaderSize from './components/header-size'
// import d2HeaderTheme from './components/header-theme' // import d2HeaderTheme from './components/header-theme'
import d2HeaderUser from './components/header-user' import d2HeaderUser from "./components/header-user"
// import d2HeaderLog from './components/header-log' // import d2HeaderLog from './components/header-log'
// import d2HeaderColor from './components/header-color' // import d2HeaderColor from './components/header-color'
import hamburger from './components/hamburger' import hamburger from "./components/hamburger"
// import d2HeaderDatetime from './components/header-datetime' // import d2HeaderDatetime from './components/header-datetime'
import { mapState, mapGetters, mapActions } from 'vuex' import { mapState, mapGetters, mapActions } from "vuex"
import mixinSearch from './mixins/search' import mixinSearch from "./mixins/search"
import { localRoutes } from '@/router/routes' import { localRoutes } from "@/router/routes"
export default { export default {
name: 'D2LayoutHeaderAside', name: "D2LayoutHeaderAside",
mixins: [ mixins: [mixinSearch],
mixinSearch
],
components: { components: {
d2MenuSide, d2MenuSide,
d2MenuHeader, d2MenuHeader,
...@@ -122,10 +163,10 @@ export default { ...@@ -122,10 +163,10 @@ export default {
data() { data() {
return { return {
// [侧边栏宽度] 正常状态 // [侧边栏宽度] 正常状态
asideWidth: '200px', asideWidth: "200px",
// [侧边栏宽度] 折叠状态 // [侧边栏宽度] 折叠状态
asideWidthCollapse: '65px', asideWidthCollapse: "65px",
headerTitle: '', headerTitle: "",
show: false show: false
// headerSubTitle: '客户列表' // headerSubTitle: '客户列表'
} }
...@@ -135,51 +176,53 @@ export default { ...@@ -135,51 +176,53 @@ export default {
Object.values(localRoutes).forEach((item, index) => { Object.values(localRoutes).forEach((item, index) => {
this.routerPath.push(item.meta) this.routerPath.push(item.meta)
}) })
console.log('this.$route', this.$route) console.log("this.$route", this.$route)
var targetItem = this.$route.matched var targetItem = this.$route.matched
this.findTitle(targetItem[targetItem.length - 1]?.meta) this.findTitle(targetItem[targetItem.length - 1]?.meta)
this.getInfo() this.getInfo()
}, },
watch: { watch: {
'$route.matched'(val) { "$route.matched"(val) {
console.log(val, '$route.matched') // console.log(val, '$route.matched')
var targetItem = val[val.length - 1]?.meta var targetItem = val[val.length - 1]?.meta
this.headerTitle = '' this.headerTitle = ""
this.findTitle(targetItem) this.findTitle(targetItem)
} }
}, },
computed: { computed: {
...mapState('d2admin', { ...mapState("d2admin", {
keepAlive: state => state.page.keepAlive, keepAlive: (state) => state.page.keepAlive,
grayActive: state => state.gray.active, grayActive: (state) => state.gray.active,
transitionActive: state => state.transition.active, transitionActive: (state) => state.transition.active,
asideCollapse: state => state.menu.asideCollapse asideCollapse: (state) => state.menu.asideCollapse
}), }),
...mapGetters('d2admin', { ...mapGetters("d2admin", {
themeActiveSetting: 'theme/activeSetting' themeActiveSetting: "theme/activeSetting"
}), }),
/** /**
* @description 最外层容器的背景图片样式 * @description 最外层容器的背景图片样式
*/ */
styleLayoutMainGroup() { styleLayoutMainGroup() {
return { return {
...this.themeActiveSetting.backgroundImage ...(this.themeActiveSetting.backgroundImage
? { ? {
backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')` backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')`
} }
: {} : {})
} }
} }
}, },
methods: { methods: {
...mapActions('d2admin/menu', [ ...mapActions("d2admin/menu", ["asideCollapseToggle"]),
'asideCollapseToggle' ...mapActions("d2admin/user", ["load"]),
]),
...mapActions('d2admin/user', ['load']),
findTitle(val) { findTitle(val) {
this.headerTitle = val?.title ? val.title + (this.headerTitle ? ' / ' : '') + this.headerTitle : '' this.headerTitle = val?.title
? val.title + (this.headerTitle ? " / " : "") + this.headerTitle
: ""
if (val?.parentId && +val?.parentId !== 1) { if (val?.parentId && +val?.parentId !== 1) {
return this.findTitle(this.routerPath.find(item => item.authId === val.parentId)) return this.findTitle(
this.routerPath.find((item) => item.authId === val.parentId)
)
} }
}, },
async getInfo() { async getInfo() {
...@@ -200,7 +243,7 @@ export default { ...@@ -200,7 +243,7 @@ export default {
<style lang="scss"> <style lang="scss">
// 注册主题 // 注册主题
@import '~@/assets/style/theme/register.scss'; @import "~@/assets/style/theme/register.scss";
@keyframes lightflow { @keyframes lightflow {
90% { 90% {
......
...@@ -20,8 +20,10 @@ import "default-passive-events" ...@@ -20,8 +20,10 @@ import "default-passive-events"
import notice from "@/common/notice" import notice from "@/common/notice"
import "element-ui/lib/theme-chalk/index.css" import "element-ui/lib/theme-chalk/index.css"
import { config } from "@/common/baseConfig" import { config } from "@/common/baseConfig"
import GLMapSdk from "@/common/glsk-mapapi-sdk"
// import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建) // import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload" import VueLazyload from "vue-lazyload"
Vue.prototype.$mapapi = new GLMapSdk()
Vue.use(VueLazyload, { Vue.use(VueLazyload, {
// 懒加载默认加载图片 // 懒加载默认加载图片
loading: loading:
...@@ -124,7 +126,7 @@ fetch( ...@@ -124,7 +126,7 @@ fetch(
.then((response) => { .then((response) => {
const { code, data } = response const { code, data } = response
// console.log("response", response) // console.log("response", response)
// response.axios.baseURL = 'https://dj.test.glsx.com.cn/rop-dj-smartcarlife/router' // response.axios.baseURL = 'https://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// response.axios.baseURL = 'http://192.168.1.104:8392/rop-dj-smartcarlife/router' // response.axios.baseURL = 'http://192.168.1.104:8392/rop-dj-smartcarlife/router'
if (code == "200") { if (code == "200") {
......
...@@ -175,7 +175,7 @@ export const routerName = { ...@@ -175,7 +175,7 @@ export const routerName = {
{ {
authId: "9120510", authId: "9120510",
parentId: "91205", parentId: "91205",
label: "工资明细", label: "提成构成",
handle: "handleSalaryDetail" handle: "handleSalaryDetail"
} }
], ],
...@@ -708,6 +708,14 @@ export const routerName = { ...@@ -708,6 +708,14 @@ export const routerName = {
type: "primary", type: "primary",
handle: "handleImport" handle: "handleImport"
}, },
{
authId: "9121211",
parentId: "91212",
label: "复制绩效方案",
category: "Button",
type: "primary",
handle: "handleCopyConfig"
}
], ],
component: _import("residentManage/salaryPerformance/index") component: _import("residentManage/salaryPerformance/index")
}, },
...@@ -826,7 +834,31 @@ export const routerName = { ...@@ -826,7 +834,31 @@ export const routerName = {
false: "启用" false: "启用"
} }
} }
} },
{
authId: "9121406",
parentId: "91214",
label: "启用",
handle: "handleUp"
},
{
authId: "9121407",
parentId: "91214",
label: "禁用",
handle: "handleDown"
},
{
authId: "9121408",
parentId: "91214",
label: "查看",
handle: "handleView"
},
{
authId: "9121409",
parentId: "91214",
label: "删除",
handle: "handleDelete"
},
], ],
component: _import("residentManage/growUpGrade/indexControl") component: _import("residentManage/growUpGrade/indexControl")
}, },
......
...@@ -46,6 +46,14 @@ export const routerName = { ...@@ -46,6 +46,14 @@ export const routerName = {
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleExport" handle: "handleExport"
},
{
authId: "9140105",
parentId: "91401",
label: "刷新",
category: "Button",
type: "primary",
handle: "handleRefresh"
} }
], ],
component: _import("pointManagement/pointExamine") component: _import("pointManagement/pointExamine")
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
></el-input> ></el-input>
</template> </template>
<template v-else> <template v-else>
{{ scope.row[item.addHtml]?scope.row[item.addHtml].toLocaleString() : ''}} {{ scope.row[item.addHtml] != null ?scope.row[item.addHtml].toLocaleString() : ''}}
</template> </template>
<template v-if="item.unit"> <template v-if="item.unit">
<div class="unit">{{item.unit}}</div> <div class="unit">{{item.unit}}</div>
......
<template>
<baseDialog
:is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
class="dialog"
@handleClick="handleClick"
>
<div
class="dialog-content"
v-loading="loading"
>
<div class="search-box">
<div class="label">指标名称:</div>
<el-input
class="input"
size="small"
maxlength="10"
v-model="searchValue"
clearable
></el-input>
<el-button
class="btn"
type="primary"
size="small"
@click="getDataConfig"
>查询</el-button>
</div>
<el-table
:data="tableData"
border
ref="table"
:show-header="false"
row-key="id"
current-row-key="id"
>
<el-table-column
class-name="draggable-icon"
width="40"
align="center"
v-if="!searchFlag"
>
<div class="icon"></div>
</el-table-column>
<el-table-column
type="index"
width="60"
align="center"
v-if="!searchFlag"
>
</el-table-column>
<template v-for="(item,index) in tableParams.tableColumns">
<el-table-column
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
align="center"
:key="index"
>
<template slot-scope="scope">
<template v-if="item.formatter">
<span
v-if="item.html"
v-html="item.formatter(scope.row)"
/>
<template v-if="!item.html">
<span :class="item.className ? item.className(scope.row) : ''" />
<span v-text="item.formatter(scope.row)" />
</template>
</template>
<span v-else>{{ scope.row[item.prop] || "-" }}</span>
</template>
</el-table-column>
</template>
<el-table-column
:align="tableParams.tableOption.align || 'center'"
:width="tableParams.tableOption.width || 'auto'"
class-name="table-option"
>
<template slot-scope="scope">
<el-button
type="text"
@click="hide(scope)"
:key="btnKey"
>{{scope.row.hiddenFlag == 1?'显示':'隐藏'}}</el-button>
<template v-if="tableData.length > 1 && !searchFlag">
<span
class="icon el-icon-top"
@click="changeSort(scope.$index,0)"
v-if="scope.$index != 0"
></span>
<span
class="icon el-icon-bottom"
@click="changeSort(scope.$index,tableData.length - 1)"
v-if="scope.$index != tableData.length - 1"
></span>
</template>
</template>
</el-table-column>
</el-table>
</div>
</baseDialog>
</template>
<script type='text/ecmascript-6'>
import sortablejs from "sortablejs"
import { getKpiMetric, updateKpiMetric, updateOneKpiMetric} from '@/api/earlyWarningManager'
export default {
name: '',
props: {
show: Boolean,
scope: Number
},
data () {
return {
btnKey: Date.now(),
loading: true,
searchValue: '',
dialogShow: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: true,
btnList: [],
isShowFooter: true,
confirm_name: '确定',
cancel_name: '取消'
},
config: {
title: "编辑指标",
width: "1080px"
}
},
tableData: [],
tableParams: {
tableOption: {
width: '100'
},
tableColumns: [
{
minWidth: 110,
prop: 'name'
},
{
minWidth: 135,
prop: 'definition'
},
]
},
searchFlag: false
}
},
watch: {
show (n) {
this.dialogShow = n
if (n) {
this.tableData = []
this.searchValue = ''
this.init()
}
},
dialogShow (n) {
this.$emit('update:show', n)
}
},
computed: {
uuid () {
return this.$store.state.d2admin.user.info.detail.uuid
}
},
mounted () {
},
methods: {
init () {
this.getDataConfig()
},
async getDataConfig () {
try {
const { searchValue, uuid, scope } = this,
res = await getKpiMetric({
scope,
name: searchValue,
uuid
})
this.searchFlag = searchValue ? true : false
this.tableData = res || []
console.log(res, '===')
this.loading = false
this.$nextTick(() => {
let el = this.$refs.table.$el.querySelector(`.el-table__body-wrapper > table > tbody`)
this.$nextTick(() => {
new sortablejs(el, {
handle: '.draggable-icon',
ghostClass: "sortable-drag",
onEnd: (e) => {
const { oldIndex, newIndex } = e
this.changeSort(oldIndex, newIndex)
}
})
})
})
} catch (error) {
this.loading = false
}
},
async handleClick () {
try {
let userKpiMetricAddRequestDTOS = [],
{ scope, tableData, uuid, searchFlag } = this
tableData.map((e, index) => {
userKpiMetricAddRequestDTOS.push({
id: e.id,
loginUuid: uuid,
sort: searchFlag ? e.defaultSortOrder : index + 1,
hiddenFlag: e.hiddenFlag
})
})
console.log(userKpiMetricAddRequestDTOS, '-------')
const apiFun = searchFlag ? updateOneKpiMetric : updateKpiMetric
const res = await apiFun({
userKpiMetricAddRequestDTOS,
scope
})
if (res) {
this.$message.success('保存成功')
this.dialogShow = false
this.$emit('update')
}
} catch (error) {
if (typeof error === 'string') this.$message.error(error)
}
},
hide (scope) {
scope.row.hiddenFlag = scope.row.hiddenFlag == 1 ? 0 : 1
this.btnKey = Date.now()
},
changeSort (oldIndex, newIndex) {
this.tableData.splice(newIndex, 0, this.tableData.splice(oldIndex, 1)[0])
}
}
}
</script>
<style scoped lang='scss'>
.dialog {
::v-deep.el-dialog__body {
max-height: 60vh !important;
overflow-y: auto;
}
&-content {
// padding: 5px 0;
.search-box {
display: flex;
align-items: center;
margin-bottom: 32px;
.label {
color: #333333;
font-size: 14px;
display: flex;
align-items: center;
justify-content: flex-end;
}
.input {
width: 155px;
}
.btn {
margin-left: auto;
}
}
}
.input-box {
padding: 4px 10px;
display: flex;
align-items: center;
justify-content: center;
}
::v-deep.el-table {
.cell {
padding-left: 0;
}
.sortable-drag {
box-shadow: 0 6px 20px 0 #00000040;
background: #fff;
}
.table-option {
span {
margin-right: 8px;
}
.icon {
position: relative;
color: #2a58ad;
font-size: 15px;
font-weight: 700;
cursor: pointer;
&:hover {
opacity: 0.7;
}
&::before {
font-size: 14px;
}
&::after {
width: 8px;
height: 1.33px;
content: "";
position: absolute;
background: #2a58ad;
left: 50%;
transform: translateX(-50%);
}
}
.el-icon-top {
transform: translateY(3px);
padding-top: 1px;
&::after {
top: 0;
}
}
.el-icon-bottom {
padding-bottom: 1px;
&::after {
bottom: 0;
}
}
}
}
::v-deep.draggable-icon {
cursor: grab;
.icon {
width: 10.67px;
height: 7px;
border-top: 1px solid #333;
border-bottom: 1px solid #333;
margin: 0 auto;
display: flex;
align-items: center;
&::after {
content: "";
width: 100%;
height: 1px;
background: #333;
display: block;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -5,11 +5,27 @@ ...@@ -5,11 +5,27 @@
size="small" size="small"
label-width="97px" label-width="97px"
> >
<el-form-item> <template v-if="hasStatisticalPeriod">
<el-form-item label="统计周期:">
<el-select
v-model="statisticalPeriod"
@change="changeStatisticalPeriod"
:popper-append-to-body="false"
>
<el-option
v-for="item in statisticalPeriodOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item class="radio-group">
<el-radio-group <el-radio-group
v-model="form.dateType" v-model="form.dateType"
@input="search('dateType')" @input="search('dateType')"
class="radio-group"
> >
<el-radio-button <el-radio-button
v-for="item in dateGroup" v-for="item in dateGroup"
...@@ -41,13 +57,39 @@ ...@@ -41,13 +57,39 @@
@click="dialogShow = true" @click="dialogShow = true"
><i class="el-icon-setting"></i>数据配置</el-button> ><i class="el-icon-setting"></i>数据配置</el-button>
</div> </div>
<config-dialog :show.sync="dialogShow" @update="$emit('update')" /> <config-dialog
:show.sync="dialogShow"
@update="$emit('update')"
/>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import ConfigDialog from './ConfigDialog.vue' import ConfigDialog from './ConfigDialog.vue'
const statisticalPeriodOptions = {
day: { label: '按日', value: 'day' },
week: { label: '按周', value: 'week' },
month: { label: '按月', value: 'month' },
},
DATE_TYPES = {
WEEK: 'week',
MONTH: 'month',
DEFAULT: 'default'
}, dateTypeMapping = {
[DATE_TYPES.WEEK]: {
options: [statisticalPeriodOptions.day],
period: 'day'
},
[DATE_TYPES.MONTH]: {
options: [statisticalPeriodOptions.day, statisticalPeriodOptions.week],
period: 'day'
},
[DATE_TYPES.DEFAULT]: {
options: [statisticalPeriodOptions.month],
period: 'month'
}
}
export default { export default {
components: { components: {
ConfigDialog ConfigDialog
...@@ -58,6 +100,7 @@ export default { ...@@ -58,6 +100,7 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
hasStatisticalPeriod: Boolean
}, },
data () { data () {
return { return {
...@@ -74,7 +117,29 @@ export default { ...@@ -74,7 +117,29 @@ export default {
{ name: '本月', value: 'month' }, { name: '本月', value: 'month' },
{ name: '全年', value: 'year' }, { name: '全年', value: 'year' },
], ],
dialogShow: false dialogShow: false,
statisticalPeriodOptions: [statisticalPeriodOptions.day],
statisticalPeriod: 'day'
}
},
watch: {
date: {
handler (val) {
if (val && val.length) {
let [startDate, endDate] = val
let dayNum = dayjs(endDate).diff(dayjs(startDate), 'day') + 1
if (dayNum <= 7) {
this.statisticalPeriodOptions = [statisticalPeriodOptions.day]
this.statisticalPeriod = 'day'
}
if (dayNum >= 8 && dayNum <= 93) {
this.statisticalPeriodOptions = [statisticalPeriodOptions.day, statisticalPeriodOptions.week]
this.statisticalPeriod = 'day'
}
}
},
immediate: true,
deep: true
} }
}, },
mounted () { mounted () {
...@@ -114,41 +179,77 @@ export default { ...@@ -114,41 +179,77 @@ export default {
// + (type == 'start' ? ' 00:00:00' : ' 23:59:59') // + (type == 'start' ? ' 00:00:00' : ' 23:59:59')
}, },
changeDate (e) { changeDate (e) {
let [startDate, endDate] = e if (e && e.length) {
const date1 = dayjs(startDate), let [startDate, endDate] = e
date2 = dayjs(endDate), const date1 = dayjs(startDate),
day = date2.diff(date1, 'day') + 1 date2 = dayjs(endDate),
if (day > 93) { day = date2.diff(date1, 'day') + 1
this.$message.error('自定义时间范围限制为93天') if (day > 93) {
return this.$message.error('自定义时间范围限制为93天')
return
}
this.form.dateType = ''
this.$emit('search', this.getSearchTime())
} else {
this.form = this.$options.data.call(this).form
this.search()
} }
this.form.dateType = ''
startDate = this.formatDate(startDate, 'start')
endDate = this.formatDate(endDate)
this.$emit('search', {
startDate,
endDate
})
}, },
search (e) { search (e) {
let { dateGroup, form: { let { form: {
dateType
} } = this
if (e == 'dateType') this.date = []
if (this.hasStatisticalPeriod) {
const selectedDateType = dateType && Object.keys(dateTypeMapping).includes(dateType) ? dateType : DATE_TYPES.DEFAULT
this.statisticalPeriodOptions = dateTypeMapping[selectedDateType].options
this.statisticalPeriod = dateTypeMapping[selectedDateType].period
}
// return this.$emit('search', {
// allYear: false,
// startDate: '2024-10-01',
// endDate: '2024-12-31'
// })
this.$emit('search', this.getSearchTime())
},
changeStatisticalPeriod (e) {
this.$emit('search', this.getSearchTime())
},
getSearchTime () {
let { dateGroup, date, form: {
dateType dateType
} } = this, } } = this,
params = { params = {
allYear: dateType == 'year' allYear: dateType == 'year'
},
startDate = '',
endDate = ''
if (date && date.length) {
startDate = this.formatDate(date[0])
endDate = this.formatDate(date[1])
} else {
let dateItem = dateGroup.find(i => i.value == dateType)
if (dateItem) {
startDate = dateItem.startDate
endDate = dateItem.endDate
} }
if (e == 'dateType') this.date = [] }
let { startDate, endDate } = dateGroup.find(i => i.value == dateType) if (this.hasStatisticalPeriod) {
params.dateType = {
'day':0,
'week':1,
'month':2,
}[this.statisticalPeriod]
}
params.startDate = startDate params.startDate = startDate
params.endDate = endDate params.endDate = endDate
// this.$emit('search', { return params
// allYear: false,
// startDate: '2024-10-01',
// endDate: '2024-12-31'
// })
this.$emit('search', params)
}, },
handleReset () {
this.form = this.$options.data.call(this).form
this.search('dateType')
}
} }
} }
</script> </script>
......
<template> <template>
<div class="board-detail-box"> <div
<search-box class="board-detail-box"
@search="getBoardData" v-loading="loading"
:hasConfig="false" >
/> <div class="board-header">
<div class="business-type">
归属业务:{{{
2:'轻改',
3:'权益',
4:'延保'
}[businessType]}}
</div>
<div class="search-component">
<search-box
@search="getBoardData"
:hasConfig="false"
hasStatisticalPeriod
/>
</div>
</div>
<div class="board-content"> <div class="board-content">
<div <div
class="line-chart" class="line-chart"
...@@ -16,9 +31,11 @@ ...@@ -16,9 +31,11 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import SearchBox from '../SearchBox' import SearchBox from '../SearchBox'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { getMerchantOutputDetail } from '@api/earlyWarningManager' import { getBoardDetail } from '@api/earlyWarningManager'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { tooltipConfig, xAxisConfig, dataZoomSliderConfig } from '../chartConfig' import { tooltipConfig, xAxisConfig, dataZoomSliderConfig } from '../chartConfig'
import { KPI_DATA } from '../kpiConfig.js'
import NP from 'number-precision'
export default { export default {
components: { components: {
SearchBox SearchBox
...@@ -28,12 +45,29 @@ export default { ...@@ -28,12 +45,29 @@ export default {
pageData: { pageData: {
type: Object, type: Object,
default: () => { } default: () => { }
} },
show: Boolean
}, },
data () { data () {
return { return {
chart: null, chart: null,
searchTime: {}, searchTime: {},
dialogShow: false,
loading: false
}
},
computed: {
businessType () {
return this.pageData.businessType
},
},
watch: {
businessType: {
handler (newVal) {
if (this.show) {
if (newVal && this.initStatus) this.getData()
} else this.initStatus = false
}
} }
}, },
mounted () { mounted () {
...@@ -42,41 +76,50 @@ export default { ...@@ -42,41 +76,50 @@ export default {
methods: { methods: {
async getBoardData (params) { async getBoardData (params) {
this.searchTime = params this.searchTime = params
this.getMerchantOutputDetail() this.getData()
this.initStatus = true
}, },
async getMerchantOutputDetail () { async getData () {
let { businessType, queryType } = this.pageData, try {
{ searchTime } = this this.loading = true
const res = await getMerchantOutputDetail({ let { searchTime: { startDate, endDate, dateType }, businessType } = this
businessType, this.chart = echarts.init(document.getElementById(this.pageData.pageId))
queryType, const { merchantId, code } = this.pageData,
...searchTime unit = KPI_DATA[code]?.valueUnit ? KPI_DATA[code].valueUnit : '',
}) res = await getBoardDetail({
businessType,
this.chart = echarts.init(document.getElementById(this.pageData.pageId)) merchantId,
this.drawChart(res, queryType) startDate,
dateType,
endDate,
code
})
res.map(e => {
let value = e.value || 0
if (unit) e.value = NP.times(value, 100)
})
this.loading = false
this.drawChart(res)
} catch (error) {
this.loading = false
}
}, },
drawChart (list, queryType) { drawChart (list) {
this.chart.clear() this.chart.clear()
let { pageData } = this, let { pageData: { name, code } } = this,
_this = this, _this = this,
{ allYear } = this.searchTime, { allYear, dateType } = this.searchTime,
timeList = [], timeList = [],
data = [], data = [],
//1-产值,2-客单价,3-订单数,4-引流率,5-转化率,6-展业门店数,7-店均产值,8-交车数,9-触客数) unit = KPI_DATA[code]?.valueUnit ? KPI_DATA[code].valueUnit : ''
queryKey = {
1: 'output',
6: 'storeNum',
2: 'customerPrice',
7: 'storeAverageOutput',
8: 'deliveryNumber',
9: 'touchCustomers'
}[queryType]
list.map(e => { list.map(e => {
// if (!e[queryKey]) e[queryKey] = Math.round(Math.random() * 10000) let { startDate, endDate } = e,
data.push([dayjs(e.countDate).format("YYYY-MM-DD"), e[queryKey] || 0]) axisLabel = dayjs(startDate).format("YYYY-MM-DD"),
timeList.push(e.countDate) weekStr = `${dayjs(startDate).format('MM/DD')}~${dayjs(endDate).format('MM/DD')}`,
value = e.value || 0
if (dateType == 1) axisLabel = weekStr
data.push([axisLabel, value])
timeList.push(dateType == 1 ? weekStr : e.startDate)
}) })
let option = { let option = {
...@@ -86,27 +129,38 @@ export default { ...@@ -86,27 +129,38 @@ export default {
let [item] = params let [item] = params
if (!item) return if (!item) return
let { dataIndex, axisValue } = item, let { dataIndex, axisValue } = item,
{ output, customerPrice, orderNumber, drainageRate, conversionRate } = list[dataIndex] { value } = list[dataIndex],
return ` title = dayjs(axisValue).format(allYear ? 'YYYY年MM月' : 'MM-DD')
${dayjs(axisValue).format(allYear ? 'YYYY-MM' : 'YYYY-MM-DD')}<br> if (dateType == 1) title = axisValue
return `${title}<br>
<div class="tooltips"> <div class="tooltips">
<i class="circle"></i>产值:${output?.toLocaleString() || 0}<br> <i class="circle"></i>${name}:${value?.toLocaleString() || 0}${unit}
客单价:${customerPrice?.toLocaleString() || 0}<br> </div>`;
订单数:${orderNumber || 0}<br>
引流率:${drainageRate || 0}%<br>
转化率:${conversionRate || 0}%</div>`;
} }
}, },
title: { title: {
left: '20', left: '20',
text: `${pageData.name}趋势图` text: `${name}趋势图`
}, },
grid: { grid: {
left: 100, left: 100,
right: '60', right: '60',
bottom: '80' bottom: '80'
}, },
xAxis: xAxisConfig(_this), xAxis: {
...xAxisConfig(_this),
axisLabel: {
showMaxLabel: true,
formatter: function (value, index) {
let str = ''
str = allYear ? dayjs(value).format('YYYY年MM月') : dayjs(value).format('MM-DD')
if (dateType == 1) str = value
return str
}
}
},
yAxis: { yAxis: {
type: 'value', type: 'value',
boundaryGap: [0, '100%'], boundaryGap: [0, '100%'],
...@@ -140,6 +194,18 @@ export default { ...@@ -140,6 +194,18 @@ export default {
background: #fff; background: #fff;
height: 100%; height: 100%;
border-radius: 0 4px 4px 4px; border-radius: 0 4px 4px 4px;
.board-header {
display: flex;
align-items: center;
.business-type {
color: #333333;
font-size: 14px;
margin-left: 24px;
}
.search-component {
margin-left: auto;
}
}
.board-content { .board-content {
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
......
...@@ -25,7 +25,7 @@ export const tooltipConfig = { ...@@ -25,7 +25,7 @@ export const tooltipConfig = {
// } // }
} }
export const xAxisConfig = (params) => { export const xAxisConfig = (params) => {
let { allYear } = params.searchTime, let { allYear, dateType } = params.searchTime,
xaxis = { xaxis = {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
...@@ -40,6 +40,7 @@ export const xAxisConfig = (params) => { ...@@ -40,6 +40,7 @@ export const xAxisConfig = (params) => {
formatter: function (value, index) { formatter: function (value, index) {
let str = '' let str = ''
str = allYear ? dayjs(value).format('MM月') : dayjs(value).format('MM/DD') str = allYear ? dayjs(value).format('MM月') : dayjs(value).format('MM/DD')
if (dateType == 1) str = value
return str return str
} }
...@@ -55,8 +56,10 @@ export const dataZoomSliderConfig = (params, timeList) => { ...@@ -55,8 +56,10 @@ export const dataZoomSliderConfig = (params, timeList) => {
left: 100, left: 100,
right: 100, right: 100,
labelFormatter (value) { labelFormatter (value) {
let { allYear } = params.searchTime let { allYear, dateType } = params.searchTime,
return allYear ? dayjs(timeList[value]).format('YYYY年MM月') : dayjs(timeList[value]).format('YYYY-MM-DD') str = allYear ? dayjs(timeList[value]).format('YYYY年MM月') : dayjs(timeList[value]).format('YYYY-MM-DD')
if(dateType == 1) str = timeList[value]
return str
} }
} }
} }
\ No newline at end of file \ No newline at end of file
<template>
<div class="data-group">
<div class="tab">
<el-tabs v-model="activeName">
<el-tab-pane
v-for="item in tabList"
:key="item.id"
:label="item.label"
:name="item.id"
/>
</el-tabs>
<template v-if="activeName == '1'">
<el-button
class="edit-board"
@click="dialogShow = true"
>
<span class="el-icon-edit-outline"></span>
编辑指标
</el-button>
</template>
</div>
<div class="data-component">
<template v-for="i in tabList">
<component
:ref="`component-${i.id}`"
:key="i.id"
:is="i.componentName"
v-show="activeName == i.id"
:show="activeName == i.id"
@openWindow="$emit('openWindow',$event)"
:pageId="i.id"
:search-form="searchForm"
:refreshFlag.sync="i.refreshFlag"
/>
</template>
</div>
<pointer-config
:show.sync="dialogShow"
:scope="1"
@update="search"
/>
</div>
</template>
<script type='text/ecmascript-6'>
import dataList from './dataList.vue'
import merchantList from './merchantList.vue'
import PointerConfig from '../PointerConfig.vue'
export default {
name: '',
components: {
dataList,
merchantList,
PointerConfig
},
props: {
searchForm: Object
},
data () {
return {
activeName: '1',
tabList: [
{
label: '数据指标',
componentName: 'data-list',
id: '1'
},
{
label: '门店列表',
componentName: 'merchant-list',
id: '2'
},
],
dialogShow: false
}
},
mounted () {
},
methods: {
search () {
this.$nextTick(() => {
this.$refs[`component-${this.activeName}`][0].search()
this.tabList.map(e => {
if (e.id != this.activeName) e.refreshFlag = true
})
})
}
}
}
</script>
<style scoped lang='scss'>
.data-group {
margin-top: 16px;
background: #fff;
// height: calc(100% - 394px);
height: 100%;
border-radius: 4px;
.tab {
position: relative;
::v-deep .el-tabs__nav-wrap {
padding: 0 20px;
}
::v-deep .el-tabs__item {
height: 54px;
line-height: 54px;
}
::v-deep.el-tabs__nav-wrap::after {
height: 1px;
background: #e5e5e5;
}
.edit-board {
position: absolute;
right: 20px;
top: 11px;
width: 92px;
height: 32px;
border-radius: 4px;
border: 1px solid #2020201a;
color: #202020;
font-size: 12px;
display: flex;
align-items: center;
justify-content: center;
span {
color: #2a58ad;
font-size: 14px;
}
}
}
.data-component {
position: relative;
height: calc(100% - 68px);
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div
class="data-list-box"
v-loading="loading"
>
<template v-if="boardList.length">
<div class="data-list">
<template v-for="(item,index) in boardList">
<board-item
:key="index"
class="board-item"
:item="item"
:data="item.data"
@click="openWindow(item)"
>
<div class="board-tips">
<el-tooltip placement="top">
<div slot="content">{{item.definition}}</div>
<div class="board-tips-icon">?</div>
</el-tooltip>
</div>
</board-item>
</template>
</div>
</template>
<template v-else>
<div class="no-data">
<template v-if="!loading">
暂无数据
</template>
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
import onShowMixin from './onShowMixin'
import BoardItem from '../shopGuardIndex/BoardItem'
import { getBoardList } from '@api/earlyWarningManager'
import { KPI_DATA } from '../kpiConfig.js'
export default {
mixins: [onShowMixin],
components: {
BoardItem,
},
name: '',
data () {
return {
boardList: [],
}
},
mounted () {
},
methods: {
async search () {
try {
this.loading = true
this.$message.success({
message: '指标计算中,请耐心等待',
duration: 3000
})
this.boardList = this.$options.data.call(this).boardList
let { businessType } = this.searchForm
const res = await getBoardList({
...this.searchForm,
scope: 1
})
res.map(e => {
this.boardList.push({
componentName: 'boardDetail',
pageId: `board-${e.code}`,
tabTitle: `${e.name}详情`,
definition: e.definition,
code: e.code,
name: e.name,
businessType,
data: e,
value: 'value',
percent: 'ratio',
...KPI_DATA[e.code]
})
})
this.loading = false
} catch (error) {
this.loading = false
}
},
openWindow (e) {
this.$emit('openWindow', e)
}
}
}
</script>
<style scoped lang='scss'>
.data-list {
display: grid;
gap: 16px;
grid-template-columns: repeat(4, 1fr);
padding: 0 20px 20px;
.board-item {
border-radius: 4px;
background: #f8faff;
cursor: pointer;
}
.board-tips {
position: absolute;
top: 20px;
right: 20px;
&-icon {
width: 14px;
height: 14px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #999;
color: #999;
border-radius: 100%;
font-size: 10px;
font-weight: 500;
}
}
}
.no-data {
background: white;
padding: 20px 0;
min-height: 60px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="layout">
<div class="header">
<d2-search
ref="showSearch"
:search-form="searchForm"
:form-data="showFormData"
label-width="100px"
:selectPopperAppendToBody="false"
class="d2-search"
>
<template slot="dateGroup">
<search-box
ref="timeRef"
class="search-box"
:hasConfig="false"
@search="setTimeData"
/>
</template>
</d2-search>
<div class="up-btns">
<el-button
size="small"
type="primary"
@click="search"
>
查询
</el-button>
<el-button
size="small"
@click="handleReset"
>
重置
</el-button>
</div>
</div>
<template v-if="loading">
<div class="content">
<data-group
@openWindow="$emit('openWindow',$event)"
:search-form="searchForm"
ref="dataGroupRef"
/>
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
import SearchBox from '../SearchBox'
import dataGroup from './dataGroup.vue'
import { listShop4sByRef, getCarBrandList } from "@api/merchant"
export default {
name: '',
components: {
SearchBox,
dataGroup
},
data () {
return {
loading: false,
searchForm: {
businessType: 4,
businessScenarioList: [],
brandIdList: [],
secondBrandIdList: [],
merchantRange: 1,
merchantId: '',
},
showFormData: [
{
label: '归属业务',
name: 'businessType',
type: 'select',
optionList: [
{ value: 2, name: '轻改' },
{ value: 3, name: '权益' },
{ value: 4, name: '延保' },
],
optionId: 'value',
optionLabel: 'name',
},
{
label: '业务性质',
name: 'businessScenarioList',
type: 'select',
multiple: true,
isClear: true,
collapseTags: true,
optionList: [
{ confId: 1, confName: "直营渠道" },
{ confId: 2, confName: "直营4S店" },
{ confId: 4, confName: "投资收购-利丰" },
{ confId: 5, confName: "投资收购-内蒙古" },
{ confId: 6, confName: "服务商投资" }
],
optionId: 'confId',
optionLabel: 'confName',
},
{
addHtml: 'dateGroup'
},
{
label: '主营品牌',
name: 'secondBrandIdList',
type: 'select',
multiple: true,
isClear: true,
collapseTags: true,
optionList: [],
optionId: 'id',
optionLabel: 'label',
},
{
label: '门店范围',
name: 'merchantRange',
type: 'select',
optionList: [
{ value: 1, name: '展业门店' },
{ value: 2, name: '所有门店' },
],
optionId: 'value',
optionLabel: 'name',
},
{
label: '门店名称',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
},
],
brandList: []
}
},
mounted () {
this.getServiceStore()
this.getCarBrandList()
},
methods: {
getServiceStore (merchantId) {
listShop4sByRef({
yqMerchantId: merchantId
}).then((res) => {
this.showFormData.map(item => {
if (item.name == 'merchantId') {
res.unshift({
merchantName: '全部',
merchantId: ''
})
item.optionList = res || []
}
})
})
},
async getCarBrandList () {
const res = await getCarBrandList({ containsChildren: true }),
brandList = []
res.map(e => {
if (e && e.children && e.children.length) {
e.children.map(i => {
i.brandId = e.id
brandList.push(i)
})
}
})
this.showFormData.map(item => {
if (item.name == 'secondBrandIdList') {
item.optionList = brandList || []
}
})
this.brandList = brandList || []
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.$refs.timeRef.handleReset()
this.$nextTick(() => this.search())
},
setTimeData (e) {
delete e.allYear
this.searchForm = {
...this.searchForm,
...e
}
this.loading = true
},
search () {
const { secondBrandIdList } = this.searchForm,
{ brandList } = this
if (secondBrandIdList.length) {
console.log(secondBrandIdList)
let brandIdList = []
brandList.map(e => {
if (secondBrandIdList.includes(e.id)) brandIdList.push(e.brandId)
})
brandIdList = Array.from(
new Set([...brandIdList.map((e) => e)])
)
console.log(brandIdList)
this.searchForm.brandIdList = brandIdList
}
this.$refs.dataGroupRef.search()
}
}
}
</script>
<style scoped lang='scss'>
.layout {
height: 100%;
padding: 0 20px;
overflow-y: auto;
.header {
background: #fff;
position: sticky;
top: 0;
z-index: 9;
}
.up-btns {
padding-bottom: 22px;
}
.d2-search{
::v-deep.el-select-dropdown,.el-popper{
width: 300px !important;
}
}
.search-box {
padding: 0;
::v-deep.el-form {
display: flex;
.radio-group {
width: fit-content;
flex-shrink: 0;
margin-right: 8px;
}
.date-picker {
width: 217px;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="merchantList">
<div class="header">
<el-button
size="small"
type="primary"
@click="handleExport"
>导出</el-button>
</div>
<d2-table
ref="table"
:table-params="tableParams"
:tableData="tableData"
:hasPage="false"
:has-num="false"
noDataText="暂无门店数据"
v-loading="loading"
@sortChange="sortChange"
>
<template
slot="popoverHtml"
slot-scope="scope"
>
<template v-if="scope.scope[scope.prop] && scope.scope[scope.prop].length > 1">
<span>{{ scope.scope[scope.prop].slice(0, 1).join("") }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div :class="{scrollHeight: scope.scope[scope.prop].length >= 10}">
<div
v-for="(item, index) in scope.scope[scope.prop]"
:key="index"
>
{{ item }}
</div>
</div>
<span
class="more-info"
slot="reference"
>...({{ scope.scope[scope.prop].length }})</span>
</el-popover>
</template>
<template v-else>
<span v-if="
!scope.scope[scope.prop] || !scope.scope[scope.prop].length
">-</span>
<span v-else>{{ scope.scope[scope.prop].join("") }}</span>
</template>
</template>
<template
slot="sortableHtml"
slot-scope="scope"
>
<div class="sortableHtml">
{{formatterValue(scope)}}
<div :class="['percent',`${percentColor(scope)}`]">
{{formattedPercent(scope)}}
</div>
</div>
</template>
<div
slot="auth-button"
slot-scope="scope"
>
<el-button
type="text"
@click="handleDetail(scope.scope)"
>详情</el-button>
</div>
</d2-table>
</div>
</template>
<script type='text/ecmascript-6'>
import onShowMixin from './onShowMixin'
import { getBoardMerchantList, exportMerchantList } from '@api/earlyWarningManager'
import { deepClone, downLoadFile } from '@/common/util'
import dayjs from 'dayjs'
import NP from 'number-precision'
const RATIO_KEY = {
output: 'outputRatio',
orderNumber: 'orderNumberRatio',
customerUnitPrice: 'customerUnitPriceRatio',
penetrationRate: 'penetrationRateRatio',
touchConversionRate: 'touchConversionRateRatio',
}
export default {
mixins: [onShowMixin],
name: '',
props: {
searchForm: Object
},
data () {
return {
tableData: [],
originTableData: [],
// 表格参数
tableParams: {
tableOption: { width: '150px' },
tableColumns: [
{
label: '门店名称',
prop: 'merchantName',
width: '150'
}, {
label: '商户号',
prop: 'merchantId',
width: '100'
}, {
label: '是否直营',
formatter (row) {
//直营(0-非直营,1-直营)
return {
0: '非直营',
1: '直营'
}[row.directSale]
}
}, {
label: '展业时间',
formatter (row) {
return row.startBusiness ? dayjs(row.startBusiness).format('YYYY-MM-DD') : '-'
}
}, {
label: '督导',
minWidth: 150,
prop: 'supervisionNameList',
addHtml: 'popoverHtml'
}, {
label: '归属业务',
prop: 'businessType',
width: '130',
formatter (row) {
return {
2: '轻改',
3: '权益',
4: '延保',
}[row.businessType]
}
}, {
label: '主营品牌',
prop: "carBrandList",
addHtml: 'popoverHtml',
minWidth: 200,
}, {
label: '业务性质',
prop: "businessScenario",
formatter (row) {
return {
1: '直营渠道',
2: '直营4S店',
4: '投资收购-利丰',
5: '投资收购-内蒙古',
6: '服务商投资',
}[row.businessScenario] || '-'
}
}, {
label: '产值',
width: '150',
prop: "output",
sortable: true,
addHtml: 'sortableHtml',
}, {
label: '订单数',
width: '150',
prop: "orderNumber",
sortable: true,
addHtml: 'sortableHtml'
}, {
label: '客单价',
width: '130',
prop: "customerUnitPrice",
sortable: true,
addHtml: 'sortableHtml',
}, {
label: '渗透率',
prop: "penetrationRate",
width: 130,
sortable: true,
addHtml: 'sortableHtml',
},
{
label: '触客转化率',
prop: "touchConversionRate",
sortable: true,
width: 130,
addHtml: 'sortableHtml',
}
]
},
}
},
mounted () {
},
methods: {
async search () {
try {
this.loading = true
this.tableData = []
this.originTableData = []
const res = await getBoardMerchantList(this.searchForm)
res.map(e => {
// e.output = Math.random() * 9999 + 1
// e.orderNumber = Math.floor(Math.random() * 10001)
// e.customerUnitPrice = Math.random() * 9999 + 1
// e.penetrationRate = Math.random() * 10 + 1
// e.touchConversionRate = Math.random() * 10 + 1
// e.outputRatio = Math.floor(Math.random() * 201) - 100
let supervisionNameList = []
e.supervisionList?.map(i => {
supervisionNameList.push(i.supervisionName)
})
e.carBrandList = e.brandList?.split(',') || []
e.supervisionNameList = supervisionNameList
})
this.tableData = deepClone(res)
this.originTableData = deepClone(res)
this.loading = false
} catch (error) {
this.loading = false
}
},
handleDetail (e) {
this.$emit('openWindow', {
...e,
pageId: `merchant-${e.merchantId}`,
componentName: 'shop-detail',
tabTitle: `${e.merchantName}门店详情`,
merchantId: e.merchantId,
merchantName: e.merchantName
})
},
handleExport () {
exportMerchantList(this.searchForm).then((res) => {
res && downLoadFile(res)
})
},
sortChange (sortObj, sortColum, sort) {
if (sort) {
if (sort == 'ascending') this.tableData.sort((a, b) => {
return a[sortColum] - b[sortColum]
})
else this.tableData.sort((a, b) => {
return b[sortColum] - a[sortColum]
})
} else this.tableData = deepClone(this.originTableData)
},
formatterValue (e) {
const { scope, prop } = e
let num = scope[prop]
if (num != null) {
const isRate = ['penetrationRate', 'touchConversionRate'].includes(prop)
if (isRate) num = NP.times(num, 100)
if (num % 1 !== 0) num = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
else num = num.toLocaleString();
if (['output', 'customerUnitPrice'].includes(prop)) num = `¥${num}`
if (isRate) num += '%'
} else num = '-'
return num
},
percentColor (e) {
const { scope, prop } = e,
key = RATIO_KEY[prop]
if (scope[key] > 0) {
return 'red'
} else if (scope[key] < 0) {
return 'green'
} else {
return ''
}
},
formattedPercent (e) {
const { scope, prop } = e,
key = RATIO_KEY[prop]
let str = ''
if (scope[key] != null) str = `环${scope[key]}%`
return str
}
}
}
</script>
<style scoped lang='scss'>
.merchantList {
padding: 0 20px 20px;
.header {
display: flex;
justify-content: flex-end;
}
.sortableHtml {
color: #1d1d1d;
font-size: 14px;
font-weight: 500;
line-height: 20px;
.percent {
font-weight: 400;
color: #333333;
}
.red {
color: #eb4e4e;
}
.green {
color: #43cf7c;
}
}
.more-info {
white-space: nowrap;
color: #5850ff;
cursor: pointer;
}
}
</style>
\ No newline at end of file \ No newline at end of file
export default {
data () {
return {
initStatus: false,
loading:false
}
},
props: {
show: Boolean,
searchForm: Object,
refreshFlag: Boolean
},
mounted () {
let search = this.search
this.search = function () {
search.apply(this, arguments)
}
},
watch: {
show: {
async handler (newVal) {
if (newVal) {
if (!this.initStatus || this.refreshFlag) {
await this.search()
this.initStatus = true
this.$emit('update:refreshFlag', false)
}
}
},
immediate: true,
deep: true
},
},
methods: {
}
}
\ No newline at end of file \ No newline at end of file
export const KPI_DATA = {
"A014": {unit: '(元)'},//产值
"A004": {},//触客数
"A020": { unit: '(元)' },//客单价
"A010": {},//订单数
"A001": {},//交车数
"A046": {},//日均触客数
"A044": { unit: '(元)' },//店均产值
"A025": { valueUnit: '%' },//引流率
"A047": {},//日均交车数
"A023": { valueUnit: '%' },//触客转化率
"A021": { valueUnit: '%' },//触客转化率(售前)
"A022": { valueUnit: '%' },//触客转化率(售后)
"A026": { valueUnit: '%' },//溇透率
"A048": { unit: '(元)' },//日均产值
"A049": {},//新增门店数
"A050": {},//累计门店数
"A045": {},//展业门店数
"A051": {},//累计展业门店数
"A052": {},//新展业门店数
"A053": {},//疑似流失门店数
"A054": { valueUnit: '%' },//展业门店流失率
"A055": {},//疑似流失新门店数
"A056": { valueUnit: '%' }//新展业门店流失率
}
\ No newline at end of file \ No newline at end of file
...@@ -195,6 +195,7 @@ export default { ...@@ -195,6 +195,7 @@ export default {
type: 'select', type: 'select',
multiple: true, multiple: true,
isClear: true, isClear: true,
collapseTags:true,
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue', optionLabel: 'confValue',
......
...@@ -30,11 +30,11 @@ ...@@ -30,11 +30,11 @@
</template> </template>
</div> </div>
<template v-if="i.hasAdd"> <template v-if="i.hasAdd">
<div class="add"> <div class="add block-icon">
</div> </div>
</template> </template>
<template v-if="i.hasEqual"> <template v-if="i.hasEqual">
<div class="equal"> <div class="equal block-icon">
</div> </div>
</template> </template>
</div> </div>
...@@ -160,25 +160,21 @@ export default { ...@@ -160,25 +160,21 @@ export default {
} }
} }
} }
.add { .block-icon {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: -9.24%; left: -6.89%;
transform: translateY(-50%); transform: translateY(-50%);
width: 9.24%; width: 5.17%;
aspect-ratio: 1/1; aspect-ratio: 1/1;
background-image: url("@/assets/funnel+.png");
background-size: 100% 100%; background-size: 100% 100%;
} }
.add {
background-image: url("@/assets/funnel+.png");
}
.equal { .equal {
position: absolute;
top: 50%;
left: -9.24%;
transform: translateY(-50%);
width: 9.24%;
aspect-ratio: 1/1;
background-image: url("@/assets/funnel=.png"); background-image: url("@/assets/funnel=.png");
background-size: 100% 100%;
} }
.minus { .minus {
width: 6px; width: 6px;
...@@ -187,10 +183,10 @@ export default { ...@@ -187,10 +183,10 @@ export default {
background: #999ea8; background: #999ea8;
margin-left: 2px; margin-left: 2px;
} }
.el-icon-top{ .el-icon-top {
color: #F24724; color: #f24724;
} }
.el-icon-bottom{ .el-icon-bottom {
color: #35C376; color: #35c376;
} }
</style> </style>
...@@ -40,8 +40,11 @@ export default { ...@@ -40,8 +40,11 @@ export default {
immediate: true, immediate: true,
handler (newval) { handler (newval) {
if (!this.show) return if (!this.show) return
this.chart = echarts.init(document.getElementById(this.pageId)) let chartDom = document.getElementById(this.pageId)
this.drawChart(newval) if (chartDom) {
this.chart = echarts.init(chartDom)
this.drawChart(newval)
}
} }
} }
}, },
......
<template> <template>
<div class="store-layout"> <div class="store-layout">
<div class="store-box"> <div
<div class="board-box"> class="store-box"
<template v-for="(item,index) in boardList"> v-loading="loading"
<board-item >
:key="index" <template v-if="boardList.length">
class="board-item" <div class="board-box">
:item="item" <template v-for="(item,index) in boardList">
:data="boardData" <board-item
/> :key="index"
</template> class="board-item"
</div> :item="item"
:data="item.data"
@click="openWindow(item)"
>
<div class="board-tips">
<el-tooltip placement="top">
<div slot="content">{{item.definition}}</div>
<div class="board-tips-icon">?</div>
</el-tooltip>
</div>
</board-item>
</template>
</div>
</template>
<template v-else>
<div class="no-data">
<template v-if="!loading">
暂无数据
</template>
</div>
</template>
</div> </div>
<div class="store-chart"> <div class="store-chart">
...@@ -20,14 +40,14 @@ ...@@ -20,14 +40,14 @@
:boardData="boardData" :boardData="boardData"
/> />
</div> </div>
<div class="line"> <!-- <div class="line">
<line-chart <line-chart
:pageId="`store-${pageId}`" :pageId="`store-${pageId}`"
:outputTrend="boardData.outputTrend" :outputTrend="boardData.outputTrend"
:show="show" :show="show"
:searchTime="searchTime" :searchTime="searchTime"
/> />
</div> </div> -->
</div> </div>
</div> </div>
...@@ -37,8 +57,9 @@ ...@@ -37,8 +57,9 @@
import BoardItem from '../../shopGuardIndex/BoardItem' import BoardItem from '../../shopGuardIndex/BoardItem'
import Funnel from './Funnel' import Funnel from './Funnel'
import LineChart from './LineChart' import LineChart from './LineChart'
import { getMerchantBaseDetail } from '@/api/earlyWarningManager' import { getMerchantBaseDetail, getBoardList } from '@/api/earlyWarningManager'
import onShowMixin from '../onShowMixin' import onShowMixin from '../onShowMixin'
import { KPI_DATA } from '../../kpiConfig.js'
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
components: { components: {
...@@ -52,43 +73,32 @@ export default { ...@@ -52,43 +73,32 @@ export default {
boardData: { boardData: {
outputTrend: [] outputTrend: []
}, },
boardList: [ boardList: [],
{ loading: false
name: '总产值', }
value: 'output', },
percent: 'outputRatio', watch: {
unit: '(元)' pageData: {
handler (newVal) {
}, // let { businessType, merchantId, merchantName } = newVal
{ // this.boardList.map((e, index) => {
name: '客单价', // e.businessType = businessType
value: 'customerUnitPrice', // e.componentName = 'boardDetail'
percent: 'customerUnitPriceRatio', // e.pageId = `board-${merchantId}-${index}`
unit: '(元)' // e.tabTitle = `${e.name}(${merchantName})`
}, // })
{ },
name: '交车数', immediate: true,
value: 'deliveryNum', deep: true
percent: 'deliveryNumRatio',
},
{
name: '触客数',
value: 'touchCustomers',
percent: 'touchCustomersRatio',
},
{
name: '转化数',
value: 'conversionNum',
percent: 'conversionNumRatio',
},
],
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
async getData () { async getData () {
this.getBoardList()
const { merchantId, businessType } = this.pageData, const { merchantId, businessType } = this.pageData,
{ searchTime } = this { searchTime } = this
const res = await getMerchantBaseDetail({ const res = await getMerchantBaseDetail({
...@@ -100,6 +110,47 @@ export default { ...@@ -100,6 +110,47 @@ export default {
if (res[key] == null) res[key] = '-' if (res[key] == null) res[key] = '-'
}) })
this.boardData = res this.boardData = res
},
async getBoardList () {
try {
this.loading = true
this.$message.success({
message: '指标计算中,请耐心等待',
duration: 3000
})
this.boardList = this.$options.data.call(this).boardList
let { merchantId, merchantName, businessType } = this.pageData,
{ searchTime: { startDate, endDate } } = this
const res = await getBoardList({
businessType,
merchantId,
startDate,
endDate,
scope: 2
})
res.map(e => {
this.boardList.push({
componentName: 'boardDetail',
pageId: `board-${merchantId}-${e.code}`,
tabTitle: `${e.name}(${merchantName})`,
definition: e.definition,
merchantId,
code: e.code,
name: e.name,
businessType,
data: e,
value: 'value',
percent: 'ratio',
...KPI_DATA[e.code]
})
})
this.loading = false
} catch (error) {
this.loading = false
}
},
openWindow (e) {
this.$emit('openWindow', e)
} }
} }
} }
...@@ -113,16 +164,44 @@ export default { ...@@ -113,16 +164,44 @@ export default {
border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
margin-bottom: 16px; margin-bottom: 16px;
padding-top: 54px; padding-top: 54px;
min-height: 200px;
.board-box { .board-box {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 0 16px; gap: 16px;
padding: 0 20px 20px; padding: 0 20px 20px;
.board-item { .board-item {
cursor: pointer;
height: 163px; height: 163px;
border-radius: 4px; border-radius: 4px;
background: #f8faff; background: #f8faff;
} }
.board-tips {
position: absolute;
top: 20px;
right: 20px;
&-icon {
width: 14px;
height: 14px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #999;
color: #999;
border-radius: 100%;
font-size: 10px;
font-weight: 500;
}
}
}
.no-data {
background: white;
padding: 20px 0;
min-height: 60px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
} }
} }
.store-chart { .store-chart {
......
...@@ -68,11 +68,20 @@ ...@@ -68,11 +68,20 @@
@search="searchTime = $event" @search="searchTime = $event"
:hasConfig="false" :hasConfig="false"
/> />
<template v-if="activeName == '1'">
<el-button
class="edit-board flex"
@click="dialogShow = true"
>
<span class="el-icon-edit-outline"></span>
编辑指标
</el-button>
</template>
</div> </div>
<div class="component"> <div class="component">
<template v-for="i in tabList"> <template v-for="i in tabList">
<component <component
:ref="i.name" :ref="i.componentName"
:key="i.id" :key="i.id"
:is="i.componentName" :is="i.componentName"
v-show="activeName == i.id" v-show="activeName == i.id"
...@@ -93,6 +102,11 @@ ...@@ -93,6 +102,11 @@
@closeDialog="closeDialog" @closeDialog="closeDialog"
ref="qualityDetail" ref="qualityDetail"
></quality-detail> ></quality-detail>
<pointer-config
:show.sync="dialogShow"
:scope="2"
@update="getBoardList"
/>
</div> </div>
</template> </template>
...@@ -104,8 +118,9 @@ import SearchBox from '../SearchBox' ...@@ -104,8 +118,9 @@ import SearchBox from '../SearchBox'
import { getMerchantBaseInfo } from '@api/earlyWarningManager' import { getMerchantBaseInfo } from '@api/earlyWarningManager'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import QualityDetail from "@/views/residentManage/components/qualityDetail.vue" import QualityDetail from "@/views/residentManage/components/qualityDetail.vue"
import PointerConfig from '../PointerConfig.vue'
export default { export default {
components: { Store, Human, Product, SearchBox, QualityDetail }, components: { Store, Human, Product, SearchBox, QualityDetail, PointerConfig },
name: '', name: '',
props: { props: {
pageData: { pageData: {
...@@ -150,6 +165,20 @@ export default { ...@@ -150,6 +165,20 @@ export default {
isQualityVisible: false, isQualityVisible: false,
qualityDetailList: [], qualityDetailList: [],
currentNum: 0, currentNum: 0,
dialogShow: false
}
},
computed: {
businessType () {
return this.pageData.businessType
}
},
watch: {
businessType: {
handler (val) {
if (val && this.activeName) this.getMerchantBaseInfo()
},
immediate: true
} }
}, },
mounted () { mounted () {
...@@ -173,13 +202,16 @@ export default { ...@@ -173,13 +202,16 @@ export default {
}, },
openReceptionDialog (e) { openReceptionDialog (e) {
this.qualityDetailList = e.qualityDetailList, this.qualityDetailList = e.qualityDetailList,
this.isQualityVisible = e.isQualityVisible this.isQualityVisible = e.isQualityVisible
this.currentNum = e.currentNum this.currentNum = e.currentNum
}, },
closeDialog () { closeDialog () {
this.isQualityVisible = false this.isQualityVisible = false
this.qualityDetailList = [] this.qualityDetailList = []
this.currentNum = 0 this.currentNum = 0
},
getBoardList () {
this.$nextTick(() => this.$refs.Store[0].getBoardList())
} }
} }
} }
...@@ -257,7 +289,7 @@ export default { ...@@ -257,7 +289,7 @@ export default {
} }
.active { .active {
background: #fff; background: #fff;
color: #2A58AD; color: #2a58ad;
} }
} }
} }
...@@ -305,7 +337,7 @@ export default { ...@@ -305,7 +337,7 @@ export default {
opacity: 1; opacity: 1;
background: #e8f3ff; background: #e8f3ff;
padding: 0 8px; padding: 0 8px;
color: #2A58AD; color: #2a58ad;
font-size: 12px; font-size: 12px;
margin-right: 16px; margin-right: 16px;
flex-shrink: 0; flex-shrink: 0;
...@@ -350,6 +382,20 @@ export default { ...@@ -350,6 +382,20 @@ export default {
.search-box { .search-box {
padding: 0 10px 20px 0; padding: 0 10px 20px 0;
} }
.edit-board {
width: 92px;
height: 32px;
border-radius: 4px;
border: 1px solid #2020201a;
color: #202020;
font-size: 12px;
margin-right: 20px;
justify-content: center;
span {
color: #2a58ad;
font-size: 14px;
}
}
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -20,6 +20,11 @@ export default { ...@@ -20,6 +20,11 @@ export default {
default: () => { } default: () => { }
}, },
}, },
computed: {
businessType () {
return this.pageData.businessType
}
},
mounted () { mounted () {
let getData = this.getData let getData = this.getData
this.getData = function () { this.getData = function () {
...@@ -37,13 +42,20 @@ export default { ...@@ -37,13 +42,20 @@ export default {
} }
}, },
immediate: true, immediate: true,
deep: true deep: true
}, },
searchTime (n) { searchTime (n) {
if (this.initStatus) { if (this.initStatus) {
if (this.show) this.getData() if (this.show) this.getData()
else this.searchTimeStatus = true else this.searchTimeStatus = true
} }
},
businessType: {
handler (newVal) {
if (this.show) {
if (newVal && this.initStatus) this.getData()
} else this.initStatus = false
}
} }
}, },
methods: { methods: {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
class="select" class="select"
v-model="businessType" v-model="businessType"
@change="changeBusinessType" @change="changeBusinessType"
:popper-append-to-body="false"
> >
<el-option <el-option
v-for="item in bussinessTypeList" v-for="item in bussinessTypeList"
...@@ -50,7 +51,17 @@ ...@@ -50,7 +51,17 @@
</template> </template>
</div> </div>
</div> </div>
<div
class="board-more"
@click="openWindow({
componentName:'data-more',
tabTitle:'更多看板',
pageId:'data-more'
})"
>
更多看板
<span class="el-icon-d-arrow-right"></span>
</div>
</div> </div>
</template> </template>
...@@ -58,7 +69,7 @@ ...@@ -58,7 +69,7 @@
import SearchBox from '../SearchBox' import SearchBox from '../SearchBox'
import BoardItem from './BoardItem' import BoardItem from './BoardItem'
import { getShopGuardIndexBoard } from '@api/earlyWarningManager' import { getShopGuardIndexBoard } from '@api/earlyWarningManager'
import NP from 'number-precision'
export default { export default {
name: '', name: '',
components: { components: {
...@@ -88,7 +99,8 @@ export default { ...@@ -88,7 +99,8 @@ export default {
value: 'profitSituation', value: 'profitSituation',
percent: 'profitSituationRatio', percent: 'profitSituationRatio',
tips: '毛利率', tips: '毛利率',
tipsValue: 'grossProfitMargin' tipsValue: 'grossProfitMargin',
tipsUnit:'%'
} }
], ],
boardList: [ boardList: [
...@@ -97,48 +109,48 @@ export default { ...@@ -97,48 +109,48 @@ export default {
value: 'output', value: 'output',
percent: 'outputRatio', percent: 'outputRatio',
unit: '(元)', unit: '(元)',
queryType: 1 code: 'A014'
}, },
{ {
name: '展业门店数', name: '展业门店数',
value: 'storeNum', value: 'storeNum',
percent: 'storeNumRatio', percent: 'storeNumRatio',
queryType: 6 code: 'A045'
}, },
{ {
name: '客单价', name: '客单价',
value: 'customerUnitPrice', value: 'customerUnitPrice',
percent: 'customerUnitPriceRatio', percent: 'customerUnitPriceRatio',
unit: '(元)', unit: '(元)',
queryType: 2 code: 'A020'
}, },
{ {
name: '店均产值', name: '店均产值',
value: 'storeAverageOutput', value: 'storeAverageOutput',
percent: 'storeAverageOutputRatio', percent: 'storeAverageOutputRatio',
unit: '(元)', unit: '(元)',
queryType: 7 code: 'A044'
}, },
{ {
name: '交车数', name: '交车数',
value: 'deliveryNum', value: 'deliveryNum',
percent: 'deliveryNumRatio', percent: 'deliveryNumRatio',
queryType: 8 code: 'A001'
}, },
{ {
name: '触客数', name: '触客数',
value: 'touchNum', value: 'touchNum',
percent: 'touchNumRatio', percent: 'touchNumRatio',
queryType: 9 code: 'A004'
}, },
], ],
timeObject: {} timeObject: {}
} }
}, },
mounted () { mounted () {
this.boardList.map((e, index) => { this.boardList.map(e => {
e.componentName = 'boardDetail' e.componentName = 'boardDetail'
e.pageId = `board-${index}` e.pageId = `board-${e.code}`
e.tabTitle = `${e.name}详情` e.tabTitle = `${e.name}详情`
}) })
}, },
...@@ -156,9 +168,11 @@ export default { ...@@ -156,9 +168,11 @@ export default {
const res = await getShopGuardIndexBoard(params) const res = await getShopGuardIndexBoard(params)
Object.keys(res).map(key => { Object.keys(res).map(key => {
if (res[key] != null) { if (res[key] != null) {
if (key == 'outputCompletionProgress' || key == 'grossProfitMargin') res[key] = res[key] + '%' if (key == 'outputCompletionProgress') res[key] = NP.times(res[key], 0.01)
if (key == 'budget') res[key] = '¥' + res[key].toLocaleString() if (key == 'budget') res[key] = '¥' + res[key].toLocaleString()
} else res[key] = '-' if(key == 'grossProfitMargin') res[key] += '%'
}
// else res[key] = '-'
}) })
this.boardData = res this.boardData = res
}, },
...@@ -198,7 +212,7 @@ export default { ...@@ -198,7 +212,7 @@ export default {
flex: 1; flex: 1;
} }
.board-content { .board-content {
padding: 0 20px 20px; padding: 0 20px;
display: flex; display: flex;
.flex-box { .flex-box {
display: flex; display: flex;
...@@ -227,5 +241,21 @@ export default { ...@@ -227,5 +241,21 @@ export default {
} }
} }
} }
.board-more {
display: flex;
align-items: center;
justify-content: center;
height: 32px;
padding: 8px 0 16px;
color: #202020;
font-size: 14px;
cursor: pointer;
width: fit-content;
margin: 0 auto;
span {
color: #333333;
margin-left: 4px;
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -3,12 +3,8 @@ ...@@ -3,12 +3,8 @@
class="item" class="item"
@click="$emit('click')" @click="$emit('click')"
> >
<div class="name">{{item.name}} <div class="name">{{formattedName(item)}}</div>
<template v-if="item.unit">{{item.unit}}</template> <div class="value">{{formattedValue(data[item.value],item.valueUnit)}}</div>
</div>
<div class="value">
{{formattedValue(data[item.value])}}
</div>
<div :class="['percent',`${percentColor(data[item.percent])}`]"> <div :class="['percent',`${percentColor(data[item.percent])}`]">
环比<div class="percent-value">{{data[item.percent] != null ? formatted(data[item.percent]) : '-'}}</div> 环比<div class="percent-value">{{data[item.percent] != null ? formatted(data[item.percent]) : '-'}}</div>
<template v-if="data[item.percent] != null && data[item.percent] != '-'"> <template v-if="data[item.percent] != null && data[item.percent] != '-'">
...@@ -18,13 +14,15 @@ ...@@ -18,13 +14,15 @@
<template v-if="item.tips"> <template v-if="item.tips">
<div class="tips"> <div class="tips">
{{item.tips}} {{item.tips}}
<div class="tips-value">{{data[item.tipsValue]}}</div> <div class="tips-value">{{data[item.tipsValue] || '-'}}</div>
</div> </div>
</template> </template>
<slot />
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import NP from 'number-precision'
export default { export default {
name: '', name: '',
props: { props: {
...@@ -67,10 +65,21 @@ export default { ...@@ -67,10 +65,21 @@ export default {
return '' return ''
} }
}, },
formattedValue (num) { formattedValue (num, unit) {
if (num != null) num = num.toLocaleString() if (num != null) {
if (unit) num = NP.times(num, 100);
// 检查数字是否有小数部分
if (num % 1 !== 0) num = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
else num = num.toLocaleString();
if (unit) num += '%';
}
else num = '-' else num = '-'
return num return num
},
formattedName (item) {
let name = item.name
if (item.unit) name = `${name}${item.unit}`
return name
} }
}, },
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
v-show="windowId == i.id" v-show="windowId == i.id"
:show="windowId == i.id" :show="windowId == i.id"
:pageData="i.data" :pageData="i.data"
@openWindow="openWindow"
/> />
</template> </template>
</div> </div>
...@@ -85,12 +86,14 @@ ...@@ -85,12 +86,14 @@
import shopGuardIndex from "./components/shopGuardIndex/index" import shopGuardIndex from "./components/shopGuardIndex/index"
import boardDetail from './components/boardDetail/index' import boardDetail from './components/boardDetail/index'
import shopDetail from "./components/shopDetail/index" import shopDetail from "./components/shopDetail/index"
import dataMore from './components/dataMore/index'
export default { export default {
name: "", name: "",
components: { components: {
shopGuardIndex, shopGuardIndex,
boardDetail, boardDetail,
shopDetail shopDetail,
dataMore
}, },
data () { data () {
return { return {
...@@ -104,9 +107,14 @@ export default { ...@@ -104,9 +107,14 @@ export default {
// 在beforeDestroy钩子中移除事件监听 // 在beforeDestroy钩子中移除事件监听
beforeDestroy () { beforeDestroy () {
window.removeEventListener('popstate', this.preventBack) window.removeEventListener('popstate', this.preventBack)
window.onresize = null
}, },
// 在你的Vue组件的mounted钩子中添加事件监听 // 在你的Vue组件的mounted钩子中添加事件监听
mounted () { mounted () {
// window.onresize = () => {
// this.tabboxWidth = this.$refs.tabbox.offsetWidth
// this.checkEl()
// }
history.pushState(null, null, document.URL) history.pushState(null, null, document.URL)
window.addEventListener('popstate', this.preventBack) window.addEventListener('popstate', this.preventBack)
if (this.tabboxWidth == 0) this.tabboxWidth = this.$refs.tabbox.offsetWidth if (this.tabboxWidth == 0) this.tabboxWidth = this.$refs.tabbox.offsetWidth
...@@ -121,23 +129,32 @@ export default { ...@@ -121,23 +129,32 @@ export default {
} else this.$router.go(-1) } else this.$router.go(-1)
}, },
openWindow (data) { openWindow (data) {
// console.log(data) console.log(data)
// data.merchantId = 44211895 // data.merchantId = 44211895
// data.merchantId = 44210895 // data.merchantId = 44210895
// data.merchantId = 44209510 // data.merchantId = 44209510
// data.businessType = 4 // data.businessType = 4
let id = data.pageId, let id = data.pageId,
windowList = [...this.tab, ...this.dropdownList], windowList = [...this.tab, ...this.dropdownList],
windowItem = windowList.find((e) => e.id == id) windowItem = windowList.find((e) => e.id == id),
if (windowItem) return this.windowId = id item = {
if (windowList.length == 20) return this.$message.error("最多同时打开20个tabs") component: data.componentName,
let item = { data,
component: data.componentName, id,
data, tabTitle: data.tabTitle
id, }
tabTitle: data.tabTitle if (windowItem) {
let tabIndex = this.tab.findIndex(e => e.id == id)
if (tabIndex == -1) {
let dropdownIndex = this.dropdownList.findIndex(e => e.id == id)
this.dropdownList[dropdownIndex] = item
} else this.tab[tabIndex] = item
this.windowId = id
return
} }
if (windowList.length == 20) return this.$message.error("最多同时打开20个tabs")
if (this.dropdownList.length) this.dropdownList.push(item) if (this.dropdownList.length) this.dropdownList.push(item)
else { else {
this.tab.push(item) this.tab.push(item)
...@@ -169,6 +186,10 @@ export default { ...@@ -169,6 +186,10 @@ export default {
this.dropdownList.push(tab[len]) this.dropdownList.push(tab[len])
this.tab.splice(len, 1) this.tab.splice(len, 1)
} }
if (this.dropdownList.length && offsetLeft + offsetWidth / 2 < tabboxWidth - 54) {
this.tab.push(this.dropdownList[0])
this.closeDrop(0)
}
} }
}) })
}, },
......
...@@ -84,6 +84,11 @@ export default { ...@@ -84,6 +84,11 @@ export default {
margin: 0; margin: 0;
padding: 0 20px; padding: 0 20px;
} }
::v-deep.el-tabs__nav-wrap{
&::after{
height: 1px !important;
}
}
} }
} }
</style> </style>
<!-- 管理其他变更明细弹窗 --> <!-- 管理其他变更明细弹窗 -->
<template> <template>
<d2-dialog title="管理其他变更明细" <d2-dialog
:is-visible="manageVisible" title="管理其他变更明细"
class="manageOtherDialog" :is-visible="manageVisible"
width="70%" class="manageOtherDialog"
:no-cancel="true" width="70%"
btn-ok-label="关闭" :no-cancel="true"
@closeDialog="handleClose" btn-ok-label="关闭"
@confirmDialog="handleClose" @closeDialog="handleClose"
:append-to-body="true"> @confirmDialog="handleClose"
:append-to-body="true"
>
<div class="merchantInfo"> <div class="merchantInfo">
<span class="merchantName">{{ info.merchantName }}</span><span <span class="merchantName">{{ info.merchantName }}</span
class="merchantId">{{ info.merchantId }}</span> ><span class="merchantId">{{ info.merchantId }}</span>
<span class="merchantYear">{{ statYear + "年" + info.statMonth + "月" }} <span class="merchantYear"
<el-button type="primary" >{{ statYear + "年" + info.statMonth + "月" }}
size="small" <el-button
icon="el-icon-plus" type="primary"
@click="addRow" size="small"
:disabled="addflag">新增</el-button></span> icon="el-icon-plus"
@click="addRow"
:disabled="addflag"
>新增</el-button
></span
>
</div> </div>
<div> <div>
<div class="header" <div class="header" slot="header"></div>
slot="header"></div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table ref="recordTable" <d2-table
:table-data="tableData" ref="recordTable"
:search-form="searchFormSearch" :table-data="tableData"
:table-params="tableParams" :search-form="searchFormSearch"
:before-search-fn="beforeSearchFn" :table-params="tableParams"
:has-page="false"> :before-search-fn="beforeSearchFn"
<div slot="otherAmount" :has-page="false"
slot-scope="scope"> >
<div slot="otherAmount" slot-scope="scope">
<template v-if="scope.scope.isEdit"> <template v-if="scope.scope.isEdit">
<!-- v-model="tableData[scope.index].otherAmount" --> <!-- v-model="tableData[scope.index].otherAmount" -->
<span><el-input v-model="tableData[scope.index].otherAmount" <span
style="width: 80%" ><el-input
placeholder="请输入金额" v-model="tableData[scope.index].otherAmount"
@input="checkAmount($event, scope)" /></span> style="width: 80%"
placeholder="请输入金额"
@input="checkAmount($event, scope)"
/></span>
<!-- {{ scope.index }} --> <!-- {{ scope.index }} -->
</template> </template>
<template v-else> <template v-else>
...@@ -47,18 +57,22 @@ ...@@ -47,18 +57,22 @@
}}</span> }}</span>
</template> </template>
</div> </div>
<div slot="remark" <div slot="remark" slot-scope="scope">
slot-scope="scope">
<template v-if="scope.scope.isEdit"> <template v-if="scope.scope.isEdit">
<span><el-input v-model="scope.scope.remark" <span
style="width: 80%" ><el-input
placeholder="请输入变更说明" v-model="scope.scope.remark"
maxlength="50" /></span> style="width: 80%"
placeholder="请输入变更说明"
maxlength="50"
/></span>
</template> </template>
<template v-else> <template v-else>
<el-tooltip class="item" <el-tooltip
:content="scope.scope.remark" class="item"
placement="right"> :content="scope.scope.remark"
placement="right"
>
<span> <span>
{{ {{
scope.scope.remark scope.scope.remark
...@@ -71,16 +85,22 @@ ...@@ -71,16 +85,22 @@
</el-tooltip> </el-tooltip>
</template> </template>
</div> </div>
<div slot="tableOpt" <div slot="tableOpt" slot-scope="scope">
slot-scope="scope">
<template v-if="scope.scope.isEdit"> <template v-if="scope.scope.isEdit">
<span><el-button type="text" <span
@click="add(scope.scope)">保存</el-button><el-button type="text" ><el-button type="text" @click="add(scope.scope)"
@click="cancel(scope.scope)">取消</el-button></span> >保存</el-button
><el-button type="text" @click="cancel(scope.scope)"
>取消</el-button
></span
>
</template> </template>
<template v-else> <template v-else>
<span><el-button type="text" <span
@click="del(scope.scope)">删除</el-button></span> ><el-button type="text" @click="del(scope.scope)"
>删除</el-button
></span
>
</template> </template>
</div> </div>
</d2-table> </d2-table>
...@@ -163,7 +183,7 @@ export default { ...@@ -163,7 +183,7 @@ export default {
}, },
info: { info: {
type: Object, type: Object,
default: () => { } default: () => {}
}, },
statYear: { statYear: {
type: String, type: String,
...@@ -173,7 +193,7 @@ export default { ...@@ -173,7 +193,7 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {
console.log("info", this.info) // console.log("info", this.info)
if (this.info) { if (this.info) {
this.searchForm.statYearMonth = this.info.statYearMonth this.searchForm.statYearMonth = this.info.statYearMonth
this.searchForm.merchantId = this.info.merchantId this.searchForm.merchantId = this.info.merchantId
......
<template> <template>
<d2-dialog <d2-dialog :title="title"
:title="title" :is-visible.sync="selectGoodsVisible"
:is-visible.sync="selectGoodsVisible" width="70%"
width="70%" btn-ok-label="确定"
btn-ok-label="确定" @confirmDialog="handleSelectGoodsConfirm"
@confirmDialog="handleSelectGoodsConfirm" @closeDialog="handleSelectGoodsClose"
@closeDialog="handleSelectGoodsClose" class="selectGoods">
class="selectGoods">
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
:label-width="'100px'" :label-width="'100px'"
:form-data="showFormData"> :form-data="showFormData">
<template slot="commodityCode"> <template slot="commodityCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入商品ID" placeholder="请输入商品ID"
v-model.trim="searchForm['commodityCode']" v-model.trim="searchForm['commodityCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'commodityCode')" /> @input="event => searchInput(event, 'commodityCode')" />
</template> </template>
<template slot="type"> <template slot="type">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入商品编码" placeholder="请输入商品编码"
v-model.trim="searchForm['type']" v-model.trim="searchForm['type']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'type')" /> @input="event => searchInput(event, 'type')" />
</template> </template>
<template slot="thirdPartyCode"> <template slot="thirdPartyCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入第三方编码" placeholder="请输入第三方编码"
v-model.trim="searchForm['thirdPartyCode']" v-model.trim="searchForm['thirdPartyCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'thirdPartyCode')" /> @input="event => searchInput(event, 'thirdPartyCode')" />
</template> </template>
<template slot="baseGoodsCommodityCode"> <template slot="baseGoodsCommodityCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入系列ID" placeholder="请输入系列ID"
v-model.trim="searchForm['baseGoodsCommodityCode']" v-model.trim="searchForm['baseGoodsCommodityCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'baseGoodsCommodityCode')" /> @input="event => searchInput(event, 'baseGoodsCommodityCode')" />
</template> </template>
<template slot="goodsCascader"> <template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;" <el-cascader :options="baseData.productTypeList"
v-model="tempGoodsType" :placeholder="'请选择'" filterable style="width: 100%;"
@change="selectAddAttr($event)" clearable v-model="tempGoodsType"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }"> :placeholder="'请选择'"
filterable
@change="selectAddAttr($event)"
clearable
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }">
</el-cascader> </el-cascader>
</template> </template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" <el-button :id="tableParams.btnId"
size="small" size="small"
type="primary"> type="primary">
查询 查询
</el-button> </el-button>
</div> </div>
<d2-table ref="groundingIndexTable" <d2-table ref="groundingIndexTable"
:has-num="false" :has-num="false"
:search-form="searchForm" :search-form="searchForm"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"> @setTableFinishFun="setTableFinishFun">
<template slot="select_btn" slot-scope="scope"> <template slot="select_btn"
<el-radio v-model="selectedRowId" :label="scope.scope.id" :disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)">{{ '' }}</el-radio> slot-scope="scope">
<el-radio v-model="selectedRowId"
:label="scope.scope.id"
:disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)">{{ '' }}</el-radio>
</template> </template>
</d2-table> </d2-table>
</d2-dialog> </d2-dialog>
...@@ -89,7 +95,12 @@ export default { ...@@ -89,7 +95,12 @@ export default {
default: false default: false
}, },
upgradeGoodsId: {}, upgradeGoodsId: {},
packageSelectIds: {} packageSelectIds: {},
// 用于嘀加上架获取商品时过滤只筛选出权益和延保类
filterParams: {
type: Array,
default: () => []
}
}, },
data() { data() {
return { return {
...@@ -208,7 +219,7 @@ export default { ...@@ -208,7 +219,7 @@ export default {
prop: '', prop: '',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join('/') : '-' return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join('/') : '-'
} }
}, { }, {
label: '所属系列', label: '所属系列',
prop: 'goodsName', prop: 'goodsName',
...@@ -272,11 +283,14 @@ export default { ...@@ -272,11 +283,14 @@ export default {
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if (this.filterParams.length > 0) { // 嘀加上架获取商品时过滤只筛选出权益和延保类
this.searchForm.goodsTypeList = this.filterParams
}
resolve() resolve()
}) })
}, },
handleSelectGoodsConfirm() { handleSelectGoodsConfirm() {
let selectData = this.tableData?.find(v => v.id == this.selectedRowId) const selectData = this.tableData?.find(v => v.id == this.selectedRowId)
if (!selectData) return this.$message.warning('请选择商品') if (!selectData) return this.$message.warning('请选择商品')
this.$emit('handleSelectGoodsConfirm', selectData) this.$emit('handleSelectGoodsConfirm', selectData)
}, },
...@@ -297,7 +311,7 @@ export default { ...@@ -297,7 +311,7 @@ export default {
this.tempGoodsType = [] this.tempGoodsType = []
// 重新查询 // 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true) this.$refs.groundingIndexTable.refreshTable(true, true)
}, }
} }
} }
</script> </script>
...@@ -307,4 +321,4 @@ export default { ...@@ -307,4 +321,4 @@ export default {
padding: 0; padding: 0;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
export function filterSpecsStr(data) { export function filterSpecsStr(data) {
let specificationTypeSequenceArr = (data?.specificationTypeSequence && data?.specificationTypeSequence?.split(';~;')) || [] let specificationTypeSequenceArr =
let specificationValueSequenceArr = data?.specificationData?.split(';~;') (data?.specificationTypeSequence &&
data?.specificationTypeSequence?.split(";~;")) ||
[]
let specificationValueSequenceArr = data?.specificationData?.split(";~;")
const suffixMapping = { const suffixMapping = {
1: '年', 1: "年",
2: '(km/万)', 2: "(km/万)",
3: '万' 3: "万"
} }
if (specificationTypeSequenceArr?.length) { if (specificationTypeSequenceArr?.length) {
specificationValueSequenceArr?.forEach((val, index) => { specificationValueSequenceArr?.forEach((val, index) => {
...@@ -13,10 +16,10 @@ export function filterSpecsStr(data) { ...@@ -13,10 +16,10 @@ export function filterSpecsStr(data) {
specificationValueSequenceArr[index] = `${val}${suffix}` specificationValueSequenceArr[index] = `${val}${suffix}`
} }
}) })
return specificationValueSequenceArr?.join('/') return specificationValueSequenceArr?.join("/")
} else if (data?.specificationData?.includes(';~;')) { } else if (data?.specificationData?.includes(";~;")) {
return data?.specificationData?.replace(RegExp(';~;', 'g'), '/') return data?.specificationData?.replace(RegExp(";~;", "g"), "/")
} else { } else {
return '-' return "-"
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -226,9 +226,19 @@ ...@@ -226,9 +226,19 @@
<el-input placeholder="请输入" <el-input placeholder="请输入"
size="small" size="small"
v-model="subItem.djCost" v-model="subItem.djCost"
:class="{ 'w-150-per': true }" :class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.djCost) && subItem.djCostEmpty }"
:disabled="true" :disabled="goodsInfoData.scrmFlag == 'Y'"
@input="handlePrice($event, subIndex, 'djCost')"> @input="handlePrice($event, subIndex, 'djCost')">
<el-popover v-if="filterEmpty(subItem.djCost) && subItem.djCostEmpty"
slot="suffix"
placement="top"
title
width="90"
trigger="hover"
content="嘀加成本是必填项">
<i class="el-icon-warning color-red"
slot="reference" />
</el-popover>
</el-input> </el-input>
</div> </div>
</td> </td>
...@@ -815,7 +825,8 @@ export default { ...@@ -815,7 +825,8 @@ export default {
}) })
if (!data?.length) djCost = '' if (!data?.length) djCost = ''
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'serviceItemArr', data) this.$set(this.goodsInfoData.goodsSpecificationList[index], 'serviceItemArr', data)
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'djCost', djCost) // 暂时放开嘀加成本与服务项目联动累加
// this.$set(this.goodsInfoData.goodsSpecificationList[index], 'djCost', djCost)
this.serviceSelectIndex = null this.serviceSelectIndex = null
this.serviceSelected = [] this.serviceSelected = []
this.serviceItemsVisible = false this.serviceItemsVisible = false
...@@ -1220,14 +1231,20 @@ export default { ...@@ -1220,14 +1231,20 @@ export default {
if (temp.specificationData == item.specsValueList.join(';~;') && flag) { if (temp.specificationData == item.specsValueList.join(';~;') && flag) {
item.id = temp.id ? temp.id : '' item.id = temp.id ? temp.id : ''
item.upgradePrice = temp.upgradePrice item.upgradePrice = temp.upgradePrice
item.oldupgradePrice = temp.upgradePrice
item.warningValue = temp.warningValue item.warningValue = temp.warningValue
item.oldwarningValue = temp.warningValue
item.warningValueMax = temp.warningValueMax item.warningValueMax = temp.warningValueMax
item.oldwarningValueMax = temp.warningValueMax
item.position = temp.position ? (temp.position + '')?.split(',')?.map(Number) : [] item.position = temp.position ? (temp.position + '')?.split(',')?.map(Number) : []
item.type = temp.type item.type = temp.type
item.thirdPartyCode = temp.thirdPartyCode item.thirdPartyCode = temp.thirdPartyCode
item.purchasePrice = temp.purchasePrice item.purchasePrice = temp.purchasePrice
item.oldpurchasePrice = temp.purchasePrice
item.djCost = temp.djCost item.djCost = temp.djCost
item.olddjCost = temp.djCost
item.warrantyPeriod = temp.warrantyPeriod || '5' item.warrantyPeriod = temp.warrantyPeriod || '5'
item.oldwarrantyPeriod = temp.warrantyPeriod
item.serviceItemArr = temp.upgradeGoodsServiceItemsList || [], item.serviceItemArr = temp.upgradeGoodsServiceItemsList || [],
item.entityCardFlag = temp.entityCardFlag == 'Y' item.entityCardFlag = temp.entityCardFlag == 'Y'
item.extendServiceItemArr = temp.extendServiceItemArr item.extendServiceItemArr = temp.extendServiceItemArr
......
...@@ -226,10 +226,20 @@ ...@@ -226,10 +226,20 @@
<td v-if="(extendedPosiType.includes(goodsInfoData.goodsType) || equitySceneType.includes(goodsInfoData.goodsType)) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)"> <td v-if="(extendedPosiType.includes(goodsInfoData.goodsType) || equitySceneType.includes(goodsInfoData.goodsType)) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)">
<el-input placeholder="请输入" <el-input placeholder="请输入"
size="small" size="small"
:disabled="true" :disabled="goodsInfoData.scrmFlag == 'Y'"
v-model="subItem.djCost" v-model="subItem.djCost"
:class="{ 'w-150-per': true }" :class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.djCost) && subItem.djCostEmpty }"
@input="handlePrice($event, subIndex, 'djCost')"> @input="handlePrice($event, subIndex, 'djCost')">
<el-popover v-if="filterEmpty(subItem.djCost) && subItem.djCostEmpty"
slot="suffix"
placement="top"
title
width="90"
trigger="hover"
content="嘀加成本是必填项">
<i class="el-icon-warning color-red"
slot="reference" />
</el-popover>
</el-input> </el-input>
</td> </td>
<td> <td>
...@@ -244,6 +254,7 @@ ...@@ -244,6 +254,7 @@
@focus="carSeriesSelectFocus($event, subIndex)" @focus="carSeriesSelectFocus($event, subIndex)"
popper-class="service_select_class" popper-class="service_select_class"
clearable clearable
:disabled="goodsInfoData.scrmFlag == 'Y'"
:popper-append-to-body="false"> :popper-append-to-body="false">
</el-select> </el-select>
</td> </td>
...@@ -660,7 +671,8 @@ export default { ...@@ -660,7 +671,8 @@ export default {
}) })
if (!data?.length) djCost = '' if (!data?.length) djCost = ''
this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], 'serviceItemArr', data) this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], 'serviceItemArr', data)
this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], 'djCost', djCost) // 暂时放开嘀加成本与服务项目联动累加
// this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], 'djCost', djCost)
this.serviceSelectIndex = null this.serviceSelectIndex = null
this.serviceSelected = [] this.serviceSelected = []
this.serviceItemsVisible = false this.serviceItemsVisible = false
......
...@@ -150,6 +150,13 @@ export default { ...@@ -150,6 +150,13 @@ export default {
entityCardFlag: val.entityCardFlag == 'Y', entityCardFlag: val.entityCardFlag == 'Y',
merchantGoodsInfos: val?.merchantGoodsInfos, merchantGoodsInfos: val?.merchantGoodsInfos,
djCost: val.djCost, djCost: val.djCost,
// 编辑产品价格输入框限制
oldpurchasePrice: val.purchasePrice,
oldupgradePrice: val.upgradePrice,
oldwarningValue: val.warningValue,
oldwarningValueMax: val.warningValueMax,
oldwarrantyPeriod: val.warrantyPeriod,
olddjCost: val.djCost,
selectCarSerise: val?.carTypeConfigList?.map(v => { selectCarSerise: val?.carTypeConfigList?.map(v => {
return { return {
brandId: v.brandId, brandId: v.brandId,
...@@ -451,6 +458,7 @@ export default { ...@@ -451,6 +458,7 @@ export default {
if (this.goodsInfoData.shoppingMallFlag == 1) item.purchasePriceEmpty = true // 上架到采购商城 if (this.goodsInfoData.shoppingMallFlag == 1) item.purchasePriceEmpty = true // 上架到采购商城
if (this.equitySceneType.includes(this.goodsInfoData.goodsType) && !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`)) { // 会员权益升级类目(仅供应方是非第三方) if (this.equitySceneType.includes(this.goodsInfoData.goodsType) && !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`)) { // 会员权益升级类目(仅供应方是非第三方)
item.serviceItemArrEmpty = true item.serviceItemArrEmpty = true
item.djCostEmpty = true
} }
if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类 if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类
item.warrantyPeriodEmpty = true item.warrantyPeriodEmpty = true
...@@ -467,7 +475,7 @@ export default { ...@@ -467,7 +475,7 @@ export default {
} else if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类 质保必填 采购价必填 } else if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类 质保必填 采购价必填
specialList = ['purchasePrice', 'warrantyPeriod'] specialList = ['purchasePrice', 'warrantyPeriod']
} else if (this.equitySceneType.includes(this.goodsInfoData.goodsType)) { // 权益服务 服务项目必填 } else if (this.equitySceneType.includes(this.goodsInfoData.goodsType)) { // 权益服务 服务项目必填
specialList = !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`) ? ['serviceItemArr', 'purchasePrice'] : ['purchasePrice'] specialList = !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`) ? ['serviceItemArr', 'djCost', 'purchasePrice'] : ['purchasePrice']
} else { // 其余商品类型 采购价必填 } else { // 其余商品类型 采购价必填
specialList = ['purchasePrice'] specialList = ['purchasePrice']
} }
......
<!-- 驳回 -->
<template>
<baseDialog :dialog-config="dialogConfig"
:is-show.sync="visible"
class="accountDailog"
@handleClick="handleAddConfirm">
<div class="reject-dialog">
<glsx-combi-form class="edit-form-container"
ref="formRef"
label-width="150px"
default-width="350px"
:form-ref="rejectRef"
:form-obj="infoForm"
:form-data="editFormData"
:form-rules="formRules"></glsx-combi-form>
</div>
</baseDialog>
</template>
<script>
import {
reject
} from "@api/shelfManage.js"
export default {
name: 'RejectDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
remark: ''
},
dialogConfig: {
title: '驳回',
width: '600px'
},
rejectRef: 'rejectRef',
formRules: {
remark: [{ required: true, message: '请输入驳回原因', trigger: 'blur' }]
},
editFormData: [{
label: '驳回原因',
name: 'remark',
type: 'input',
maxlength: 50,
inputType: 'textarea',
showLimit: true,
rows: 4
}],
baseData: {
}
}
},
props: {
rejectVisible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
computed: {
visible: {
get() {
return this.rejectVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'rejectVisible' })
}
}
},
mounted() {
console.log('paramsObj', this.paramsObj)
},
methods: {
handleAddConfirm() {
this.$refs.formRef.$refs[this.rejectRef].validate(valid => {
if (valid) {
var params = {}
params.rejectedReason = this.infoForm.remark
params.id = this.paramsObj.id
reject(params).then(res => {
this.notice.okTips('操作成功')
this.visible = true
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin: 65px 0;
.reject-input {
::v-deep .el-textarea__inner {
height: 70px;
}
}
.el-textarea .el-input__count {
right: 90px;
bottom: -10px;
font-size: 12px;
color: #999999;
}
.tips {
color: #999999;
}
}
</style>
<!-- 查看 - 对账配置 -->
<template>
<div class="edit-page finance-config">
<div class="title">
<span>对账配置</span>
</div>
<div style="padding: 20px">
<el-tabs v-model="editableTabsValue" type="card" class="my-tab-pane">
<el-tab-pane v-for="(item, index) in editableTabs" :key="index" :label="item.title" :name="item.name">
<div class="classificationCptContainer">
<el-form label-suffix=":" label-width="154px">
<el-form-item label="分账品类">
{{
financialObj[editableTabsValue - 1].categoryType || "--"
}}</el-form-item>
<el-form-item label="">
{{
financialObj[editableTabsValue - 1].packageArrText
}}</el-form-item>
<template v-for="(item, index) in financialObj[editableTabsValue - 1]
.expenseCategoryTypeRules">
<el-form-item :key="index" :label="item.expenseCategoryName">
<span>{{
getExpenseCategoryCalculateType(
item.expenseCategoryCalculateType,
item.expenseCategoryValue,
item.expenseCategoryName
)
}}</span>
</el-form-item>
</template>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import { deepClone } from "@/common/util"
export default {
name: "FinanceConfig",
props: {
financeObj: {
type: Object,
default: () => { }
}
},
watch: {
financeObj: {
handler(val, oldVal) {
if (val) {
this.initData(val)
}
},
immediate: true,
deep: true
}
},
data() {
//这里存放数据
return {
editableTabsValue: "1",
editableTabs: [],
financialObj: []
}
},
methods: {
getExpenseCategoryCalculateType(value, num, name) {
if (!value || num == null) {
return "-"
}
let res
switch (value) {
case 1:
res = "按毛利比例:"
break
case 2:
res = "按收入比例:"
break
case 3:
res = "按固定金额:"
break
case 4:
res = "按(产值-流量成本):"
break
case 5:
res = "按(产值-流量成本-其他费用不包含产品成本):"
break
case 6:
res = "按(产值-流量成本-其他费用包含产品成本):"
break
case 8:
res = "按(收入-自定义其他费用):"
break
case 9:
res = "按(收入-其他费用):"
break
case 10:
res = `按固定金额${num}元*购买数量`
break
}
res = value == 10 ? res : res + num + (value == 3 ? "元" : "%")
return res
},
initData(data) {
const typeList = data.goodsTypeGroupReconciliationRules || []
this.editableTabs = []
typeList.forEach((item, index) => {
const upgradeArr = []
const packageArr = []
const textArr = []
this.editableTabs.push({
title: "特殊品类" + (index + 1),
name: (index + 1).toString()
})
// 按具体商品
if (
item.goodsTypeGroupRelations?.length &&
item.goodsTypeGroupRelations[0]?.categoryType == 2
) {
item.upgradeGoods = deepClone(item.goodsTypeGroupRelations)
item.categoryType = "按具体商品"
item.goodsTypeGroupRelations.forEach((val) => {
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: val.commodityCode
})
textArr.push(val.upgradeGoodsName)
})
item.packageArrText = textArr.join(",")
item.goodsTypeGroupRelations = []
}
// 按套餐商品
if (
item.goodsTypeGroupRelations?.length &&
item.goodsTypeGroupRelations[0]?.categoryType == 3
) {
item.packageGoods = deepClone(item.goodsTypeGroupRelations)
item.categoryType = 3
item.categoryType = "按套餐商品"
item.goodsTypeGroupRelations.forEach((val) => {
packageArr.push({
packageCode: val.packageCode,
packageName: val.packageName
})
textArr.push(val.packageName)
})
item.packageArrText = textArr.join(",")
item.goodsTypeGroupRelations = []
}
if (
item.goodsTypeGroupRelations?.length &&
item.goodsTypeGroupRelations[0]?.categoryType == 1
) {
item.goodsTypeGroupRelations = deepClone(item.goodsTypeGroupRelations)
item.categoryType = 1
item.categoryTypeText = "按商品分类"
item.goodsTypes?.forEach((val) => {
textArr.push(val.upgradeGoodsName)
})
item.packageArrText = textArr.join(",")
item.upgradeGoods = []
}
})
this.financialObj = typeList
this.filterData(typeList)
},
filterData() {
let arrIdx = [1100, 810, 809, 807, 811]
this.financialObj.forEach((item) => {
item.expenseCategoryTypeRules = []
item.expenseCategoryRules.forEach((type) => {
if (arrIdx.includes(type.expenseCategoryId)) {
if (type.expenseCategoryId == 1100) type.expenseCategoryName = "一线阳光激励费"
if (type.expenseCategoryId == 809) type.expenseCategoryName = "一线阳光2激励费"
item.expenseCategoryTypeRules.push(type)
}
})
this.$set(item, "expenseCategoryTypeRules", item.expenseCategoryTypeRules)
})
}
}
}
</script>
<style lang="scss" scoped>
@import "../../style/editdetailCon.scss";
</style>
<!--
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-02-28 15:16:11
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-02-28 16:04:13
* @FilePath: \dj-car-life-system\src\views\goods\shelfManage\components\detailCon\OperateList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="edit-page">
<div class="title">
<span>操作记录</span>
</div>
<div style="padding: 20px" v-if="list && list.length > 0">
<div class="wrap" v-for="(item, index) in list" :key="index">
<div class="type">
{{ item.operatorTypeText }}
</div>
<div class="operate">
{{ item.operatorTypeText }}人:{{ item.createdBy }}
</div>
<div>操作时间:{{ item.createdDate }}</div>
</div>
</div>
<div v-else class="empty">暂无记录</div>
</div>
</template>
<script>
import { deepClone ,Util} from "@/common/util"
export default {
name: "OperateList",
props: {
logList: {
type: Array,
default: () => []
}
},
watch: {
logList(val) {
this.list = val
for (var item in this.types) {
this.list.forEach((ele) => {
if (ele.operatorType == item) {
ele.operatorTypeText = this.types[item]
}
})
}
// console.log(this.list, "✈")
this.list = deepClone(this.list)
}
},
data() {
//这里存放数据
return {
list: [],
types: { 1: "创建", 2: "驳回", 3: "确认", 4: "完成" }
}
},
methods: {}
}
</script>
<style lang="scss" scoped>
@import "../../style/editdetailCon.scss";
.wrap {
display: flex;
align-items: center;
color: #333333;
font-size: 14px;
margin-bottom: 20px;
.type {
font-weight: bold;
margin-right: 60px;
}
.operate {
min-width: 160px;
margin-right: 86px;
white-space: nowrap;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
}
}
.empty {
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 查看 - 流量方信息 -->
<template>
<div class="edit-page shop-merchant-info-detail">
<div class="title">
<span>流量方信息</span>
</div>
<div style="padding: 20px 20px 0;">
<el-form :model="merchantInfo" label-width="150px">
<el-form-item v-for="(item, index) in editFormData" :key="index" class="form-item" :style="{ 'width': '48%'}">
<span slot="label" class="label">{{item.label}}:</span>
<span>{{merchantInfo[item.name] || '-'}}{{item.suffix}}</span>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import { sceneCodeList } from '@/common/constants.js'
import { busiModeList, operationModeList } from '../../constant/baseData'
export default {
name: 'ShopMerchantInfo',
props: {
merchantInfo: {
type: Object,
default: () => { }
}
},
watch: {
merchantInfo(val) {
this.dealInitData()
}
},
data() {
//这里存放数据
return {
editFormData: [{
label: "流量方信息",
name: 'merchantName',
}, {
label: "集团(上级商户)",
name: 'parentMerchantName',
}, {
label: "业务模式",
name: 'businessModeName',
attrName: 'businessMode',
optionsName: 'busiModeList'
}, {
label: "签约主体",
name: 'contractingMerchantName',
}, {
label: "业务场景",
name: 'sceneTypeName',
attrName: 'sceneType',
optionLabel: 'confValue',
optionsName: 'sceneCodeList'
}, {
label: "园区店",
name: 'yqMerchantName',
}, {
label: '预估流量/月',
name: 'estimatedFlow',
}, {
label: '预估转化率',
name: 'estimatedUpgradeRate',
suffix: '%',
}, {
label: "运营模式",
name: 'operationModeName',
attrName: 'operationMode',
optionsName: 'operationModeList'
}, {
label: "服务商",
name: 'partnerMerchantName',
}, {
label: "上级服务商",
name: 'parentPartnerMerchantName',
}],
baseData: {
busiModeList: busiModeList,
sceneCodeList: sceneCodeList,
operationModeList: operationModeList
}
}
},
methods: {
dealInitData() {
console.log(this.merchantInfo, 'merchantInfo')
this.editFormData.forEach(item => {
if (item.attrName) {
const obj = this.baseData[item.optionsName].find(k => k[item.optionId || 'confId'] == this.merchantInfo[item.attrName]) || {}
this.merchantInfo[item.name] = obj[item.optionLabel || 'confName']
}
})
},
},
};
</script>
<style lang="scss">
@import "../../style/editdetailCon.scss";
.shop-merchant-info-detail {
.el-form-item__label {
padding-right: 0;
}
.el-form-item__label,
.el-form-item__content {
line-height: 20px !important;
}
.form-item {
display: inline-block;
line-height: 20px;
margin-bottom: 20px;
}
.download {
margin-left: 8px;
}
}
</style>
<!-- 2 - 分账金额设置 -->
<template>
<div class="division-rule">
<el-form
class="formSty"
ref="divisionRuleRef"
:model="form"
:rules="rules"
label-suffix=":"
label-width="180px"
>
<el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block">
<tr class="tableHeader">
<td>分账对象/分账类目</td>
<!-- <td>平台方分账金额</td> -->
<td v-for="(item, index) in radioList" :key="index">
{{ item.applicationObjectName || item.expenseCategoryName }}
</td>
</tr>
<tr>
<td class="merchantNameTd p-b-20">
<p
:title="item | filterMerchantType"
v-for="(item, index) in tableSelectOptions"
:key="index"
>
{{ item | filterMerchantType }}
</p>
</td>
<td
class="p-b-20"
v-for="(item, index) in radioList"
:key="index + 'radioList'"
>
<div class="line-td is-required el-form-item--medium wrap">
<p
v-for="(el, index) in tableSelectOptions"
:key="index"
class="el-radio-group"
>
<span
:class="[
'el-radio__input',
form['id' + item.expenseCategoryId] == el.merchantId
? 'is-checked'
: ''
]"
>
<span class="el-radio__inner"></span>
</span>
</p>
</div>
</td>
</tr>
</table>
</el-form-item>
</el-form>
</div>
</template>
<script>
// import { userType } from '@/common/constants'
export default {
name: "TableAccount",
props: {
// 列选项
classificationObjSelect: {
type: Object,
default: () => {}
},
merchantDistributionRules: {
type: Array,
default: () => {
return []
}
},
// 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户
tableSelectOptions: {
type: Array,
default: () => []
}
},
filters: {
// 过滤商户类型
filterMerchantType(val) {
const name = {
1: "平台方",
2: "服务商",
3: "流量方",
4: "平台方"
}
const type = val.targetMerchantType
return `${name[type]}: ${val.merchantName}`
}
},
data() {
return {
form: {
// settleTimeType: 1
},
platformSideLabel: 0,
merchantAccountInfo: {},
partnerSettleAccountModel: "",
djDivisionDefalut: 1,
rules: {},
// 导流方下拉选项对应
attrToVal: [
{
confId: 3,
confLabel: "city"
},
{
// confId: 4,
confId: 2,
confLabel: "province"
},
{
// confId: 5,
confId: 1,
confLabel: "factory"
}
],
realityShopMerchant: {
merchantId: "",
merchantName: "",
userType: ""
},
baseData: {
merchantLevelList: [],
PlatformLevelList: []
}
}
},
computed: {
radioList: function () {
const obj = this.classificationObjSelect
let list = [],
arr = [],
arrIdx = [1, 2, 302, 701, 4]
for (const key in obj) {
obj[key].map((item) => {
if (
arrIdx.includes(item.id) ||
arrIdx.includes(item.expenseCategoryId)
) {
list.push(item)
}
})
}
arr = list.filter((item) => {
return (
arrIdx.includes(item.id) || arrIdx.includes(item.expenseCategoryId)
)
})
console.log("list", arr)
return arr
}
},
watch: {
classificationObjSelect: {
handler() {
this.initList()
},
deep: true,
immediate: true
},
merchantDistributionRules: {
handler() {
this.initList()
},
deep: true
// immediate: true
},
tableSelectOptions: {
handler(val) {
// this.initList()
this.changFormList()
},
deep: true
// immediate: true
}
},
mounted() {},
methods: {
initList() {
// console.log('initList')
// this.merchantDistributionRules
// console.log(this.merchantDistributionRules)
const obj = this.classificationObjSelect
const form = {}
console.log("obj", obj)
for (const key in obj) {
obj[key].map((item) => {
// 数字转字符串
const name = "id" + item.expenseCategoryId
// console.log(name, item.id || item.expenseCategoryId, 'item.id')
// 做回显用数据
const findObj = this.merchantDistributionRules.find((el) => {
return el.expenseCategoryId == item.expenseCategoryId
})
// 还要跟存在现在的选项里面
// console.log('findObj', findObj)
// console.log(name)
// const optIndex = this.tableSelectOptions.findIndex((opt) => { return opt.merchantId == findObj?.merchantId })
// console.log(optIndex, 'optIndex')
form[name] = parseInt(findObj?.merchantId) || ""
})
}
// 判断id是否有在选项里面 没有就去掉
this.form = form
console.log(this.form, "this.form")
},
changFormList() {
console.log(this.form, "this.form")
// 判断id是否有在选项里面 没有就去掉
for (const key in this.form) {
const element = this.form[key]
this.tableSelectOptions.findIndex((opt) => {
return opt.merchantId == element
}) == -1 && (this.form[key] = "")
}
},
handleClearValid(e, validField) {
this.$forceUpdate()
// this.handleConfirm()
// console.log('validField', validField)
this.$refs.divisionRuleRef.clearValidate(validField)
},
handleConfirm() {
// console.log(this.merchantInfo)
return new Promise((resolve, reject) => {
this.$refs.divisionRuleRef.validate((valid) => {
if (valid) {
// this.form
const merchantDistributionRules = this.radioList.reduce(
(prev, next) => {
const id = this.form["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
(item) => item.merchantId == id
)
// console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
},
[]
)
resolve(merchantDistributionRules)
} else {
resolve(false)
}
})
})
},
getTableAccountParams() {
const merchantDistributionRules = this.radioList.reduce((prev, next) => {
const id = this.form["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
(item) => item.merchantId == id
)
// console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
}, [])
return merchantDistributionRules
// console.log(this.merchantInfo)
// return new Promise((resolve, reject) => {
// this.$refs.divisionRuleRef.validate(valid => {
// if (valid) {
// // this.form
// } else {
// resolve(false)
// }
// })
// }
// )
}
}
}
</script>
<style scoped lang="scss">
.formSty {
overflow-x: scroll;
}
.division-rule table {
width: 98%;
color: #666666;
border: 1px solid #e5e6e7;
border-width: 1px 0 0 1px;
}
.division-rule table tr {
height: 50px;
line-height: 50px;
}
.division-rule table th,
.division-rule table td {
font-size: 12px;
font-weight: normal;
padding: 0px 10px;
border: 1px solid #e5e6e7;
border-width: 0px 1px 1px 0px;
border-spacing: 0;
text-align: center;
min-width: 100px;
white-space: nowrap;
/* white-space: nowrap; */
/* overflow: hidden; */
/* text-overflow: ellipsis; */
}
.division-rule table .merchantNameTd {
min-width: 150px;
}
.division-rule .flex {
display: flex;
justify-content: space-around;
}
.division-rule .table-block .el-radio {
display: block;
height: 60px;
line-height: 42px;
margin-right: 0;
}
.division-rule .table-block .el-radio__label {
display: none !important;
}
.p-b-20 {
padding-bottom: 26px !important;
}
.line-td {
display: flex;
align-items: center;
justify-items: center;
flex-direction: column;
.el-radio-group{
flex:1;
height: 60px;
line-height: 60px;
}
}
</style>
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!