Commit 68a3a531 by 前端

Merge branch 'SAAS+V4.50.0-0311' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.50.0-0311
2 parents 1eec2823 c92c7c5c
Showing 119 changed files with 3386 additions and 362 deletions
This diff could not be displayed because it is too large.
...@@ -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",
......
...@@ -208,3 +208,59 @@ export function getPersonStaffWarning (data) { ...@@ -208,3 +208,59 @@ 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)
} }
/**
* 店效盯防-查询登录人指标集合
*/
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)
}
...@@ -68,7 +68,8 @@ export function batchUpdateStatus(data) { ...@@ -68,7 +68,8 @@ export function batchUpdateStatus(data) {
// 批量复制 // 批量复制
export function batchUpdateBatchCopy(data) { export function batchUpdateBatchCopy(data) {
data.method = `${path}merchantGoodsInfo.updateBatchCopy` // data.method = `${path}merchantGoodsInfo.updateBatchCopy`
data.method = `${path}merchantGoodsInfo.addBatchCopy`
return request(data, "post") return request(data, "post")
} }
......
...@@ -116,3 +116,8 @@ export const getBrandList = (data) => { ...@@ -116,3 +116,8 @@ export const getBrandList = (data) => {
data.method = `dj.api.smartcarlife.resident.coupon.brand.list.all` data.method = `dj.api.smartcarlife.resident.coupon.brand.list.all`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 驻店人员卡券发发放记录
export function getCouponRecord(data) {
data.method = "dj.api.smartcarlife.resident.coupon.grant.record"
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)
}
...@@ -79,3 +79,24 @@ export function cancelDeduct(data) { ...@@ -79,3 +79,24 @@ 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
...@@ -42,3 +42,15 @@ export function getExtendServiceItemsParts(data) { ...@@ -42,3 +42,15 @@ export function getExtendServiceItemsParts(data) {
data.method = `${path}vd.item.getExtendUnitList` data.method = `${path}vd.item.getExtendUnitList`
return request(data, 'post') return request(data, 'post')
} }
// 获取适用车系列表
export function getCarSeriesList(data) {
data.method = `${path}common.car.series.page`
return request(data, 'post')
}
// 分页获取上架商品所需的升级商品信息
export function getUpgradeProductList(data) {
data.method = `${path}productManager.listUpgradeGoodsWithPage`
return request(data, 'post')
}
...@@ -440,3 +440,45 @@ export function listGoodsType(data = {}) { ...@@ -440,3 +440,45 @@ 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`
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)
}
...@@ -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 = {
...@@ -1046,6 +1050,12 @@ export const jdSyncOpt = [ ...@@ -1046,6 +1050,12 @@ export const jdSyncOpt = [
{ confId: 1, confValue: "成功" } { confId: 1, confValue: "成功" }
] ]
// 财资数据 回单状态
export const receiptStatusOpt = [
{ confId: 0, confValue: "否" },
{ confId: 1, confValue: "是" }
]
// 财资数据 操作项 // 财资数据 操作项
export const operationTypeOpt = [ export const operationTypeOpt = [
{ confId: 1, confValue: "重推财资数据" }, { confId: 1, confValue: "重推财资数据" },
...@@ -1065,3 +1075,25 @@ export const zyVoucherStatusOpt = [ ...@@ -1065,3 +1075,25 @@ 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: "驳回" }
]
// 嘀加上架 审批状态
export const approveStatusOpt = [
{ confId: 1, confValue: "审批中" },
{ confId: 2, confValue: "已通过" },
{ confId: 3, confValue: "已驳回" },
{ confId: 4, 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: 2022-04-21 18:43:21
* @LastEditors: huyue
* @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: 100%;
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>
...@@ -440,11 +440,29 @@ export default { ...@@ -440,11 +440,29 @@ export default {
v.goodsInfo = {} v.goodsInfo = {}
shopPriceArr.push(v.upgradePrice) shopPriceArr.push(v.upgradePrice)
v.listShowShopPrice = v.upgradePrice v.listShowShopPrice = v.upgradePrice
v.listShowSpecificationData = let specificationTypeSequenceArr = v.specificationTypeSequence?.split(';~;')
val.goodsSpecificationNameList?.length > 1 let specificationValueSequenceArr = v?.specificationData?.split(';~;')
? v.specificationData && const suffixMapping = {
v.specificationData?.replace(/;~;/g, " ") 1: '年',
: "-" 2: '(km/万)',
3: '万'
}
if (specificationTypeSequenceArr?.length) {
specificationValueSequenceArr?.forEach((val, index) => {
const suffix = suffixMapping[specificationTypeSequenceArr[index]]
if (suffix) {
specificationValueSequenceArr[index] = `${val}${suffix}`
}
})
v.listShowSpecificationData = specificationValueSequenceArr?.join('/')
} else {
v.listShowSpecificationData = v?.specificationData?.replace(RegExp(';~;', 'g'), '/')
}
// v.listShowSpecificationData =
// val.goodsSpecificationNameList?.length > 1
// ? v.specificationData &&
// v.specificationData?.replace(/;~;/g, " ")
// : "-"
v.goodsInfo.goodsName = v.upgradeGoodsName v.goodsInfo.goodsName = v.upgradeGoodsName
// v.goodsInfo.goodsTypeName = val.goodsInfo?.goodsTypeName // v.goodsInfo.goodsTypeName = val.goodsInfo?.goodsTypeName
v.goodsInfo.goodsTypeName = types v.goodsInfo.goodsTypeName = types
......
<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', 20, 30))
})
// 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
class="d2-theme-header"
:style="{
opacity: this.searchActive ? 0.5 : 1 opacity: this.searchActive ? 0.5 : 1
}" flex-box="0" flex> }"
<div class="logo-group d2-theme-header-logo" :class="asideCollapse ? 'logo-only' : 'logo-all'" flex-box="0"> flex-box="0"
<img v-if="asideCollapse" src="../../assets/icon-only.png"> flex
<img v-else src="../../assets/all.png"> >
<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
flex-box="0"
ref="aside"
class="d2-theme-container-aside"
:style="{
width: asideCollapse ? asideWidthCollapse : asideWidth, width: asideCollapse ? asideWidthCollapse : asideWidth,
opacity: this.searchActive ? 0.5 : 1 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:
......
...@@ -259,7 +259,7 @@ export const routerName = { ...@@ -259,7 +259,7 @@ export const routerName = {
parentId: "90307", parentId: "90307",
label: "查看", label: "查看",
handle: "handleCommodityDetail" handle: "handleCommodityDetail"
}, }
], ],
component: _import("goods/productManage/list") component: _import("goods/productManage/list")
}, },
...@@ -417,12 +417,14 @@ export const routerName = { ...@@ -417,12 +417,14 @@ export const routerName = {
sideHidden: true, sideHidden: true,
activePath: "/grounding" activePath: "/grounding"
}, },
auth: [{ auth: [
{
authId: "9031101", authId: "9031101",
parentId: "90311", parentId: "90311",
label: "审核", label: "审核",
handle: "handleView" handle: "handleView"
}], }
],
component: _import("goods/grounding/groundingDetail") component: _import("goods/grounding/groundingDetail")
}, },
90306: { 90306: {
...@@ -589,12 +591,138 @@ export const routerName = { ...@@ -589,12 +591,138 @@ export const routerName = {
sideHidden: true, sideHidden: true,
activePath: "/packageManage" activePath: "/packageManage"
}, },
auth: [{ auth: [
{
authId: "9031209", authId: "9031209",
parentId: "9031205", parentId: "9031205",
label: "审核", label: "审核",
handle: "handleCheck" handle: "handleCheck"
}], }
],
component: _import("goods/packageManage/packageView") component: _import("goods/packageManage/packageView")
},
90313: {
path: "/shelfManage",
name: "shelfManage",
meta: {
title: "嘀加上架",
authId: "90313",
parentId: "903",
cache: false
},
auth: [
{
authId: "9031301",
parentId: "90313",
label: "嘀加上架与销售合同",
category: "Button",
type: "primary",
handle: "handleAdd",
addRoutePath: [
{
authId: "9031302",
name: "嘀加上架编辑",
parentId: "90313"
}
]
},
{
authId: "9031303",
parentId: "90313",
label: "嘀加上架修改",
category: "Button",
type: "primary",
handle: "handleEdit",
addRoutePath: [
{
authId: "9031302",
name: "嘀加上架编辑",
parentId: "90313"
}
]
},
{
authId: "9031304",
parentId: "90313",
label: "查看",
handle: "handleContractDetail",
addRoutePath: [
{
authId: "9031305",
name: "运营确认",
parentId: "90313"
}
]
},
{
authId: "9031306",
parentId: "90313",
label: "确认",
handle: "handleEditContract",
addRoutePath: [
{
authId: "9031307",
name: "运营确认",
parentId: "90313"
}
]
},
{
authId: "9031308",
parentId: "90313",
label: "驳回",
handle: "handleReject"
},
{
authId: "9031309",
parentId: "90313",
label: "重新发起",
handle: "handleAgain",
addRoutePath: [
{
authId: "9031302",
name: "嘀加上架编辑",
parentId: "90313"
}
]
}
],
component: _import("goods/shelfManage/index")
},
9031302: {
path: "/editShelf",
name: "editShelf",
meta: {
title: "嘀加上架编辑",
authId: "9031302",
parentId: "90313",
sideHidden: true,
activePath: "/shelfManage"
},
component: _import("goods/shelfManage/editShelf")
},
9031305: {
path: "/contractDetail",
name: "contractDetail",
meta: {
title: "运营查看",
authId: "9031305",
parentId: "90313",
sideHidden: true,
activePath: "/shelfManage"
},
component: _import("goods/shelfManage/contractDetail")
},
9031307: {
path: "/editContract",
name: "editContract",
meta: {
title: "运营确认",
authId: "9031307",
parentId: "90313",
sideHidden: true,
activePath: "/shelfManage"
},
component: _import("goods/shelfManage/editContract")
} }
} }
...@@ -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")
......
...@@ -32,7 +32,9 @@ export default { ...@@ -32,7 +32,9 @@ export default {
goodsSpecificationSingleList: [], goodsSpecificationSingleList: [],
specificationSingleDetailList: [], specificationSingleDetailList: [],
selectedSceneCode: '', selectedSceneCode: '',
goodsType: '' goodsType: '',
baseGoodsNameEmpty: false,
scrmFlag: 'N'
} }
}, },
mutations: { mutations: {
......
<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,26 @@ ...@@ -5,11 +5,26 @@
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"
>
<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 +56,39 @@ ...@@ -41,13 +56,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 +99,7 @@ export default { ...@@ -58,6 +99,7 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
hasStatisticalPeriod: Boolean
}, },
data () { data () {
return { return {
...@@ -74,7 +116,29 @@ export default { ...@@ -74,7 +116,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,6 +178,7 @@ export default { ...@@ -114,6 +178,7 @@ export default {
// + (type == 'start' ? ' 00:00:00' : ' 23:59:59') // + (type == 'start' ? ' 00:00:00' : ' 23:59:59')
}, },
changeDate (e) { changeDate (e) {
if (e && e.length) {
let [startDate, endDate] = e let [startDate, endDate] = e
const date1 = dayjs(startDate), const date1 = dayjs(startDate),
date2 = dayjs(endDate), date2 = dayjs(endDate),
...@@ -123,32 +188,67 @@ export default { ...@@ -123,32 +188,67 @@ export default {
return return
} }
this.form.dateType = '' this.form.dateType = ''
startDate = this.formatDate(startDate, 'start') this.$emit('search', this.getSearchTime())
endDate = this.formatDate(endDate) } else {
this.$emit('search', { this.form = this.$options.data.call(this).form
startDate, this.search()
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 (this.hasStatisticalPeriod) {
params.dateType = {
'day':0,
'week':1,
'month':2,
}[this.statisticalPeriod]
} }
if (e == 'dateType') this.date = []
let { startDate, endDate } = dateGroup.find(i => i.value == dateType)
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 class="board-detail-box">
<div class="board-header">
<div class="business-type">
归属业务:{{{
2:'轻改',
3:'权益',
4:'延保'
}[businessType]}}
</div>
<div class="search-component">
<search-box <search-box
@search="getBoardData" @search="getBoardData"
:hasConfig="false" :hasConfig="false"
hasStatisticalPeriod
/> />
</div>
</div>
<div class="board-content"> <div class="board-content">
<div <div
class="line-chart" class="line-chart"
...@@ -16,9 +28,10 @@ ...@@ -16,9 +28,10 @@
<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'
export default { export default {
components: { components: {
SearchBox SearchBox
...@@ -28,12 +41,28 @@ export default { ...@@ -28,12 +41,28 @@ export default {
pageData: { pageData: {
type: Object, type: Object,
default: () => { } default: () => { }
} },
show: Boolean
}, },
data () { data () {
return { return {
chart: null, chart: null,
searchTime: {}, searchTime: {},
dialogShow: 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 +71,38 @@ export default { ...@@ -42,41 +71,38 @@ 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, let { searchTime: { startDate, endDate, dateType }, businessType } = this
{ searchTime } = this this.chart = echarts.init(document.getElementById(this.pageData.pageId))
const res = await getMerchantOutputDetail({ const { merchantId, code } = this.pageData,
res = await getBoardDetail({
businessType, businessType,
queryType, merchantId,
...searchTime startDate,
dateType,
endDate,
code
}) })
this.drawChart(res)
this.chart = echarts.init(document.getElementById(this.pageData.pageId))
this.drawChart(res, queryType)
}, },
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')}`
if (dateType == 1) axisLabel = weekStr
data.push([axisLabel, e.value || 0])
timeList.push(dateType == 1 ? weekStr : e.startDate)
}) })
let option = { let option = {
...@@ -86,27 +112,38 @@ export default { ...@@ -86,27 +112,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 +177,18 @@ export default { ...@@ -140,6 +177,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.$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">
暂无数据
</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"
>
<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: '全部'
})
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;
}
.up-btns {
padding-bottom: 22px;
}
.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',
......
...@@ -40,10 +40,13 @@ export default { ...@@ -40,10 +40,13 @@ 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)
if (chartDom) {
this.chart = echarts.init(chartDom)
this.drawChart(newval) this.drawChart(newval)
} }
} }
}
}, },
mounted () { mounted () {
......
<template> <template>
<div class="store-layout"> <div class="store-layout">
<div class="store-box"> <div
class="store-box"
v-loading="loading"
>
<template v-if="boardList.length">
<div class="board-box"> <div class="board-box">
<template v-for="(item,index) in boardList"> <template v-for="(item,index) in boardList">
<board-item <board-item
:key="index" :key="index"
class="board-item" class="board-item"
:item="item" :item="item"
:data="boardData" :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>
<template v-else>
<div class="no-data">
暂无数据
</div> </div>
</template>
</div> </div>
<div class="store-chart"> <div class="store-chart">
...@@ -20,14 +38,14 @@ ...@@ -20,14 +38,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 +55,9 @@ ...@@ -37,8 +55,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 +71,32 @@ export default { ...@@ -52,43 +71,32 @@ export default {
boardData: { boardData: {
outputTrend: [] outputTrend: []
}, },
boardList: [ boardList: [],
{ loading: false
name: '总产值', }
value: 'output',
percent: 'outputRatio',
unit: '(元)'
},
{
name: '客单价',
value: 'customerUnitPrice',
percent: 'customerUnitPriceRatio',
unit: '(元)'
},
{
name: '交车数',
value: 'deliveryNum',
percent: 'deliveryNumRatio',
},
{
name: '触客数',
value: 'touchCustomers',
percent: 'touchCustomersRatio',
},
{
name: '转化数',
value: 'conversionNum',
percent: 'conversionNumRatio',
}, },
], watch: {
pageData: {
handler (newVal) {
// let { businessType, merchantId, merchantName } = newVal
// this.boardList.map((e, index) => {
// e.businessType = businessType
// e.componentName = 'boardDetail'
// e.pageId = `board-${merchantId}-${index}`
// e.tabTitle = `${e.name}(${merchantName})`
// })
},
immediate: true,
deep: true
} }
}, },
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 +108,48 @@ export default { ...@@ -100,6 +108,48 @@ 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,
dateType: 3,
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 +163,44 @@ export default { ...@@ -113,16 +163,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,6 +68,12 @@ ...@@ -68,6 +68,12 @@
@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">
...@@ -93,6 +99,11 @@ ...@@ -93,6 +99,11 @@
@closeDialog="closeDialog" @closeDialog="closeDialog"
ref="qualityDetail" ref="qualityDetail"
></quality-detail> ></quality-detail>
<pointer-config
:show.sync="dialogShow"
:scope="2"
@update="$emit('update')"
/>
</div> </div>
</template> </template>
...@@ -104,8 +115,9 @@ import SearchBox from '../SearchBox' ...@@ -104,8 +115,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 +162,20 @@ export default { ...@@ -150,6 +162,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 () {
...@@ -257,7 +283,7 @@ export default { ...@@ -257,7 +283,7 @@ export default {
} }
.active { .active {
background: #fff; background: #fff;
color: #2A58AD; color: #2a58ad;
} }
} }
} }
...@@ -305,7 +331,7 @@ export default { ...@@ -305,7 +331,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 +376,20 @@ export default { ...@@ -350,6 +376,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 () {
...@@ -44,6 +49,13 @@ export default { ...@@ -44,6 +49,13 @@ export default {
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: {
......
...@@ -50,7 +50,17 @@ ...@@ -50,7 +50,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 +68,7 @@ ...@@ -58,7 +68,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: {
...@@ -97,48 +107,48 @@ export default { ...@@ -97,48 +107,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,7 +166,7 @@ export default { ...@@ -156,7 +166,7 @@ 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] = '-' } else res[key] = '-'
}) })
...@@ -198,7 +208,7 @@ export default { ...@@ -198,7 +208,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 +237,21 @@ export default { ...@@ -227,5 +237,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] != '-'">
...@@ -21,10 +17,12 @@ ...@@ -21,10 +17,12 @@
<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 {
...@@ -121,7 +124,7 @@ export default { ...@@ -121,7 +124,7 @@ 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
...@@ -129,15 +132,24 @@ export default { ...@@ -129,15 +132,24 @@ export default {
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")
let item = {
component: data.componentName, component: data.componentName,
data, data,
id, id,
tabTitle: data.tabTitle 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)
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
// import { rangePickerOptions } from '@/common/format' // import { rangePickerOptions } from '@/common/format'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { cdSignOpt, jdSyncOpt } from '@/common/constants.js' import { cdSignOpt, jdSyncOpt, receiptStatusOpt } from '@/common/constants.js'
import { nbcbAccDetailPage, nbcbAccDetailConfig, nbcbAccDetailBatchSync, nbcbReceiptPdfUrl } from '@api/theAssetData' import { nbcbAccDetailPage, nbcbAccDetailConfig, nbcbAccDetailBatchSync, nbcbReceiptPdfUrl } from '@api/theAssetData'
import inputRange from './components/inputRange' import inputRange from './components/inputRange'
import refetchDialog from './components/refetchDialog' import refetchDialog from './components/refetchDialog'
...@@ -115,7 +115,8 @@ export default { ...@@ -115,7 +115,8 @@ export default {
cdSign: '', cdSign: '',
postScript: '', postScript: '',
jdSync: '', jdSync: '',
transactionTime: '' transactionTime: '',
receiptStatus: ''
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [{ showFormData: [{
...@@ -212,6 +213,15 @@ export default { ...@@ -212,6 +213,15 @@ export default {
type: 'datePicker', type: 'datePicker',
isClear: true, isClear: true,
pickerOptions: 'rangePickerOptions' pickerOptions: 'rangePickerOptions'
}, {
label: '回单状态',
name: 'receiptStatus',
type: 'select',
isClear: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'receiptStatusOpt'
}], }],
getListApi: nbcbAccDetailPage, getListApi: nbcbAccDetailPage,
tableParams: { tableParams: {
...@@ -282,6 +292,13 @@ export default { ...@@ -282,6 +292,13 @@ export default {
width: '200px', width: '200px',
addHtml: "postScriptHtml" addHtml: "postScriptHtml"
}, { }, {
label: '回单状态',
prop: 'receiptStatus',
width: '100px',
formatter: (cellValue) => {
return this.baseData.receiptStatusOpt.find(item => item.confId === cellValue.receiptStatus)?.confValue
}
}, {
label: '同步状态', label: '同步状态',
prop: 'jdSync', prop: 'jdSync',
width: '100px', width: '100px',
...@@ -304,7 +321,8 @@ export default { ...@@ -304,7 +321,8 @@ export default {
bankNameList: [], bankNameList: [],
curCodeList: [], curCodeList: [],
cdSignOpt: deepClone(cdSignOpt), cdSignOpt: deepClone(cdSignOpt),
jdSyncOpt: deepClone(jdSyncOpt) jdSyncOpt: deepClone(jdSyncOpt),
receiptStatusOpt: deepClone(receiptStatusOpt),
}, },
recordInfo: null, recordInfo: null,
...@@ -398,7 +416,8 @@ export default { ...@@ -398,7 +416,8 @@ export default {
cdSign: '', cdSign: '',
postScript: '', postScript: '',
jdSync: '', jdSync: '',
transactionTime: '' transactionTime: '',
receiptStatus: ''
} }
this.$refs.recordTable.refreshTable(false, true) this.$refs.recordTable.refreshTable(false, true)
}, },
......
<template>
<el-popover
v-if="isTextLong"
placement="top"
popper-class="base-popper"
trigger="hover"
:content="content"
>
<span ref="textRef" slot="reference" class="line-ellipsis">{{ truncatedText }}</span>
</el-popover>
<span v-else>{{ content || '-' }}</span>
</template>
<script>
export default {
name: 'EllipsisPopover',
props: {
content: {}
},
data() {
return {
maxWidth: 0
}
},
computed: {
truncatedText() {
const maxLength = Math.ceil(this.maxWidth / 12);
return this.content?.length > maxLength ? this.content.slice(0, maxLength) + '...' : this.content;
},
isTextLong() {
const maxLength = Math.ceil(this.maxWidth / 12);
return this.content?.length >= maxLength;
},
},
mounted() {
this.$nextTick(() => {
this.maxWidth = this.$refs.textRef?.getBoundingClientRect().width - 30 // 获取元素宽度
})
}
}
</script>
<style scoped>
.line-ellipsis {
display: inline-block;
width: 100%;
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 隐藏超出部分 */
text-overflow: ellipsis; /* 显示省略号 */
}
</style>
\ No newline at end of file \ No newline at end of file
export function filterSpecsStr(data) {
let specificationTypeSequenceArr = (data?.specificationTypeSequence && data?.specificationTypeSequence?.split(';~;')) || []
let specificationValueSequenceArr = data?.specificationData?.split(';~;')
const suffixMapping = {
1: '年',
2: '(km/万)',
3: '万'
}
if (specificationTypeSequenceArr?.length) {
specificationValueSequenceArr?.forEach((val, index) => {
const suffix = suffixMapping[specificationTypeSequenceArr[index]]
if (suffix) {
specificationValueSequenceArr[index] = `${val}${suffix}`
}
})
return specificationValueSequenceArr?.join('/')
} else if (data?.specificationData?.includes(';~;')) {
return data?.specificationData?.replace(RegExp(';~;', 'g'), '/')
} else {
return '-'
}
}
\ No newline at end of file \ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input> <el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="复制门店:" prop="selectMerchantObj"> <el-form-item label="复制门店:" prop="selectMerchantObj">
<el-select v-model="selectData.selectMerchantObj" remote reserve-keyword <el-select v-model="selectData.selectMerchantObj" remote reserve-keyword multiple collapse-tags
placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod" placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod"
v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable> v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable>
<el-option v-for="subItem in storeData" :key="subItem.merchantId" <el-option v-for="subItem in storeData" :key="subItem.merchantId"
...@@ -121,7 +121,6 @@ export default { ...@@ -121,7 +121,6 @@ export default {
}, },
handleBatchCopyConfirm() { handleBatchCopyConfirm() {
this.$refs.batchCopyForm.validate((valid) => { this.$refs.batchCopyForm.validate((valid) => {
console.log(valid)
if (valid) { if (valid) {
this.$emit('handleBatchCopyConfirm', this.selectData?.selectMerchantObj) this.$emit('handleBatchCopyConfirm', this.selectData?.selectMerchantObj)
} }
......
...@@ -26,50 +26,42 @@ ...@@ -26,50 +26,42 @@
<div class="incid_box"> <div class="incid_box">
<div class="item" v-for="(subItem, subIndex) in item.detailInfo" :key="subIndex"> <div class="item" v-for="(subItem, subIndex) in item.detailInfo" :key="subIndex">
<div class="label">{{ subItem.unit ? (membraneTypeList.includes(formData[item.key]) ? subItem.label + `(元)/${subItem.value == 'purchasePrice' ? '卷' : '车'}` : (subItem.label + '(元)/件')) : subItem.label }}:</div> <div class="label">{{ subItem.unit ? (membraneTypeList.includes(formData[item.key]) ? subItem.label + `(元)/${subItem.value == 'purchasePrice' ? '卷' : '车'}` : (subItem.label + '(元)/件')) : subItem.label }}:</div>
<div class="value text-hide">{{ subItem.unit ? priceFilter(formData[subItem.value]) : formData[subItem.value] }}</div> <div class="value">
<ellipsis-popover :content="subItem.unit ? priceFilter(formData.upgradeGoods[subItem.value]) : formData.upgradeGoods[subItem.value] || ''"></ellipsis-popover>
</div> </div>
<!-- 商品分类 1太阳膜/延保类 --> </div>
<!-- 权益/延保非第三方展示 -->
<div class="item" v-if="(equitySceneType.includes(formData[item.key]) || extendedPosiType.includes(formData[item.key])) && !baseConfig.supplierCode.includes(`${formData.supplierCode}`)">
<div class="label">嘀加成本元/件:</div>
<div class="value">
<ellipsis-popover :content="priceFilter(formData.upgradeGoods['djCost']) || ''"></ellipsis-popover>
</div>
</div>
<!-- 商品分类 1太阳膜 -->
<div class="item" v-if="formData[item.key] == '1'"> <div class="item" v-if="formData[item.key] == '1'">
<div class="label">部位:</div> <div class="label">部位:</div>
<div class="value">{{ formData['positionNames'] }}</div> <div class="value">
<ellipsis-popover :content="formData.upgradeGoods['positionNames'] || ''"></ellipsis-popover>
</div> </div>
<!-- 质保年限 膜类展示-->
<div class="item" v-if="membraneTypeList.includes(formData[item.key])">
<div class="label">质保年限/年:</div>
<div class="value">{{ formData['warrantyPeriod'] }}</div>
</div> </div>
<!-- 商品分类 权益升级 (线上126) --> <!-- 商品分类 权益服务 非第三方 -->
<div class="item" v-if="equitySceneType.includes(formData[item.key]) && !baseConfig.supplierCode.includes(`${formData.supplierCode}`)"> <div class="item" v-if="equitySceneType.includes(formData[item.key]) && !baseConfig.supplierCode.includes(`${formData.supplierCode}`)">
<div class="label">服务时间/年:</div> <div class="label">服务项目:</div>
<div class="value">{{ formData['serviceYears'] }}</div> <div class="value">
<ellipsis-popover :content="formData.upgradeGoods['serviceItemNames'] || ''"></ellipsis-popover>
</div> </div>
<!-- 商品分类 权益升级 (线上126) --> </div>
<!-- 商品分类 权益服务 -->
<div class="item" v-if="equitySceneType.includes(formData[item.key])"> <div class="item" v-if="equitySceneType.includes(formData[item.key])">
<div class="label">实体卡:</div> <div class="label">实体卡:</div>
<div class="value">{{ formData['entityCardFlag'] == 'Y' ? '是' : '否' }}</div> <div class="value">{{ formData.upgradeGoods['entityCardFlag'] == 'Y' ? '是' : '否' }}</div>
</div>
<div class="item" v-if="equitySceneType.includes(formData[item.key]) || extendedPosiType.includes(formData[item.key])">
<div class="label">适用车价:</div>
<div v-if="!filterEmpty(formData['minSuitCarPrice']) && !filterEmpty(formData['maxSuitCarPrice'])">{{ formData['minSuitCarPrice'] }} - {{ formData['maxSuitCarPrice'] }}万</div>
<div v-else>-</div>
</div> </div>
<!-- 商品分类 权益升级 (线上126) --> <!-- 质保年限 膜类展示-->
<div class="item flex_1" v-if="equitySceneType.includes(formData[item.key]) && !baseConfig.supplierCode.includes(`${formData.supplierCode}`)"> <div class="item" v-if="membraneTypeList.includes(formData[item.key])">
<div class="label">服务项目:</div> <div class="label">质保年限/年:</div>
<div class="value">{{ formData['serviceItemNames'] }}</div> <div class="value">
</div> <ellipsis-popover :content="`${formData.upgradeGoods['warrantyPeriod']}年` || ''"></ellipsis-popover>
<!-- 延保类非第三方供应 -->
<div class="item" v-if="extendedPosiType.includes(formData[item.key]) && !baseConfig.supplierCode.includes(`${formData.supplierCode}`)">
<div class="label">服务项目:</div>
<div class="value text-hide">{{ formData['serviceItemNames'] || '-' }}</div>
</div>
<div class="item" v-if="extendedPosiType.includes(formData[item.key]) && !baseConfig.supplierCode.includes(`${formData.supplierCode}`)">
<div class="label">服务年限:</div>
<div class="value">{{ !filterEmpty(formData.serviceYears) ? (formData.serviceYears + '年') : '-' }}</div>
</div> </div>
<div class="item" v-if="extendedPosiType.includes(formData[item.key]) && !baseConfig.supplierCode.includes(`${formData.supplierCode}`)">
<div class="label">公里数:</div>
<div class="value">{{ !filterEmpty(formData.kilometers) ? (formData.kilometers + '万公里') : '-' }}</div>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
...@@ -161,11 +153,13 @@ import { deepClone } from '@/common/util' ...@@ -161,11 +153,13 @@ import { deepClone } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import relateStoreTable from "./relateStoreTable.vue" import relateStoreTable from "./relateStoreTable.vue"
import ellipsisPopover from '../../components/ellipsisPopover.vue'
export default { export default {
name: 'GroundingForm', name: 'GroundingForm',
components: { components: {
relateStoreTable, relateStoreTable,
'el-image-viewer': () => import('element-ui/packages/image/src/image-viewer') 'el-image-viewer': () => import('element-ui/packages/image/src/image-viewer'),
ellipsisPopover
}, },
data() { data() {
return { return {
...@@ -338,7 +332,7 @@ export default { ...@@ -338,7 +332,7 @@ export default {
priceFilter(num) { priceFilter(num) {
var pow = Math.pow(10, 2) var pow = Math.pow(10, 2)
if (this.filterEmpty(num)) return '-' if (this.filterEmpty(num)) return '-'
return (Math.round(num * pow) / pow).toFixed(2) return `${(Math.round(num * pow) / pow).toFixed(2)}元`
}, },
handleClose() { handleClose() {
this.$emit('handleClose') this.$emit('handleClose')
...@@ -395,6 +389,9 @@ export default { ...@@ -395,6 +389,9 @@ export default {
width: 150px; width: 150px;
text-align: right; text-align: right;
} }
.value {
width: calc(100% - 150px);
}
.text-hide { .text-hide {
width: calc(100% - 150px); width: calc(100% - 150px);
overflow: hidden; overflow: hidden;
......
...@@ -56,6 +56,9 @@ export const packageGoodsForm = [{ ...@@ -56,6 +56,9 @@ export const packageGoodsForm = [{
label: '商品名称', label: '商品名称',
value: 'upgradeGoodsName' value: 'upgradeGoodsName'
}, { }, {
label: '规格',
value: 'specificationData'
}, {
label: '商品编码', label: '商品编码',
value: 'type' value: 'type'
}, { }, {
...@@ -70,6 +73,9 @@ export const packageGoodsForm = [{ ...@@ -70,6 +73,9 @@ export const packageGoodsForm = [{
value: 'upgradePrice', value: 'upgradePrice',
unit: true unit: true
}, { }, {
label: '适用车型',
value: 'carTypeConfigName'
}, {
label: '所属系列', label: '所属系列',
value: 'goodsName' value: 'goodsName'
}, { }, {
...@@ -152,6 +158,7 @@ export const packageGoodsForm = [{ ...@@ -152,6 +158,7 @@ export const packageGoodsForm = [{
type: 'input', type: 'input',
width: '432px', width: '432px',
unit: true, unit: true,
isDisabled: false,
handleInput: true handleInput: true
}, { }, {
name: 'thirdPartyCost', name: 'thirdPartyCost',
...@@ -173,6 +180,9 @@ export const packageGoodsDetail = [ ...@@ -173,6 +180,9 @@ export const packageGoodsDetail = [
label: '商品名称', label: '商品名称',
value: 'upgradeGoodsName' value: 'upgradeGoodsName'
}, { }, {
label: '规格',
value: 'specificationData'
}, {
label: '商品编码', label: '商品编码',
value: 'type' value: 'type'
}, { }, {
...@@ -187,6 +197,9 @@ export const packageGoodsDetail = [ ...@@ -187,6 +197,9 @@ export const packageGoodsDetail = [
value: 'upgradePrice', value: 'upgradePrice',
unit: true unit: true
}, { }, {
label: '适用车型',
value: 'carTypeConfigName'
}, {
label: '所属系列', label: '所属系列',
value: 'goodsName' value: 'goodsName'
}, { }, {
......
...@@ -16,6 +16,7 @@ import { mapActions } from 'vuex' ...@@ -16,6 +16,7 @@ import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data' import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data'
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { filterSpecsStr } from '../filterOption'
export default { export default {
name: 'GroundingDetail', name: 'GroundingDetail',
components: { components: {
...@@ -53,6 +54,9 @@ export default { ...@@ -53,6 +54,9 @@ export default {
label: '商品名称', label: '商品名称',
value: 'upgradeGoodsName' value: 'upgradeGoodsName'
}, { }, {
label: '规格',
value: 'specificationData'
}, {
label: '商品编码', label: '商品编码',
value: 'type' value: 'type'
}, { }, {
...@@ -67,6 +71,9 @@ export default { ...@@ -67,6 +71,9 @@ export default {
value: 'upgradePrice', value: 'upgradePrice',
unit: true unit: true
}, { }, {
label: '适用车型',
value: 'carTypeConfigName'
}, {
label: '所属系列', label: '所属系列',
value: 'goodsName' value: 'goodsName'
}, { }, {
...@@ -159,7 +166,8 @@ export default { ...@@ -159,7 +166,8 @@ export default {
1: '质保权益卡' 1: '质保权益卡'
}, },
detailId: '', detailId: '',
productServiceItemList: [] productServiceItemList: [],
filterSpecsStr
} }
}, },
mounted() { mounted() {
...@@ -183,7 +191,7 @@ export default { ...@@ -183,7 +191,7 @@ export default {
const productType = [] const productType = []
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo || {}
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName] const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-') const result = types.filter(type => type).join('-')
const productTypeTextArr = [] const productTypeTextArr = []
...@@ -203,29 +211,27 @@ export default { ...@@ -203,29 +211,27 @@ export default {
if (res.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高) if (res.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList arr = upgradeSupplyModeList
} }
res.tempGoodsTypeName = result // 所属分类
res.productTypeStr = productTypeTextArr?.length ? productTypeTextArr.join(';') : '-' res.productTypeStr = productTypeTextArr?.length ? productTypeTextArr.join(';') : '-'
res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-' res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-'
res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || '' res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || ''
res.upgradeSupplyModeStr = arr?.filter(v => v.confId == res.upgradeSupplyMode)[0]?.confName || '' res.upgradeSupplyModeStr = arr?.filter(v => v.confId == res.upgradeSupplyMode)[0]?.confName || ''
res.sceneName = sceneList[res.sceneType] || '-' res.sceneName = sceneList[res.sceneType] || '-'
res.upgradePrice = res.upgradeGoods?.upgradePrice
res.purchasePrice = res.upgradeGoods?.purchasePrice
res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
res.productType = productType res.productType = productType
res.serviceItemNames = res?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => { return this.extendedPosiType.includes(res?.goodsType) ? item.serviceName : `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(',') // 服务项目
res.warrantyPeriod = res.upgradeGoods?.warrantyPeriod
res.serviceYears = res.upgradeGoods?.serviceYears
res.merchantGoodsRefList = res.merchantGoodsRefList || [] res.merchantGoodsRefList = res.merchantGoodsRefList || []
res.thirdPartyCode = res?.upgradeGoods?.thirdPartyCode || ''
res.entityCardFlag = res?.upgradeGoods?.entityCardFlag
res.voucherList = res?.voucherList || [] res.voucherList = res?.voucherList || []
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || '' res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
res.minSuitCarPrice = res?.upgradeGoods?.minSuitCarPrice
res.maxSuitCarPrice = res?.upgradeGoods?.maxSuitCarPrice
res.supplierCode = res?.goodsInfo?.supplierCode res.supplierCode = res?.goodsInfo?.supplierCode
res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-' res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-'
res.kilometers = res?.upgradeGoods?.kilometers res.upgradeGoods = {
...res.upgradeGoods,
goodsName: res.goodsInfo.goodsName,
tempGoodsTypeName: result,
serviceItemNames: res?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => { return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
upgradeCommodityCode: res?.upgradeGoods?.commodityCode
}
this.editData = res || {} this.editData = res || {}
this.$nextTick(() => { this.$nextTick(() => {
this.show = true this.show = true
......
...@@ -471,7 +471,7 @@ export default { ...@@ -471,7 +471,7 @@ export default {
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
prop: 'goodsTypeName', prop: 'goodsTypeName',
formatter: (cellValue) => { formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo || {}
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName] const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-') const result = types.filter(type => type).join('-')
return result return result
...@@ -977,11 +977,16 @@ export default { ...@@ -977,11 +977,16 @@ export default {
}, },
// 批量复制弹窗确定 // 批量复制弹窗确定
handleBatchCopyConfirm(data) { handleBatchCopyConfirm(data) {
let merchantGoodsRefList = []
data?.forEach(v => {
merchantGoodsRefList.push({
merchantId: v.merchantId,
merchantName: v.merchantName
})
})
const params = { const params = {
ids: this.batchCopySelectData.map(v => { return v.id }) || [], // 商品id ids: this.batchCopySelectData.map(v => { return v.id }) || [], // 商品id
sceneType: this.batchCopySelectScene, // 业务场景 merchantGoodsRefList
merchantId: data?.merchantId,
merchantName: data?.merchantName
} }
batchUpdateBatchCopy(params).then(() => { batchUpdateBatchCopy(params).then(() => {
this.notice.okTips() this.notice.okTips()
......
...@@ -27,50 +27,44 @@ ...@@ -27,50 +27,44 @@
<div class="item" v-for="(subItem, subIndex) in item.detailInfo" :key="subIndex"> <div class="item" v-for="(subItem, subIndex) in item.detailInfo" :key="subIndex">
<div class="label">{{ subItem.unit ? (membraneTypeList.includes(ele[item.key]) ? subItem.label + <div class="label">{{ subItem.unit ? (membraneTypeList.includes(ele[item.key]) ? subItem.label +
`(元)/${subItem.value == 'purchasePrice' ? '卷' : '车'}` : (subItem.label + '(元)/件')) : subItem.label }}:</div> `(元)/${subItem.value == 'purchasePrice' ? '卷' : '车'}` : (subItem.label + '(元)/件')) : subItem.label }}:</div>
<div class="value text-hide">{{ subItem.unit ? priceFilter(ele[subItem.value]) : ele[subItem.value] }}</div> <div class="value">
<ellipsis-popover :content="subItem.unit ? priceFilter(ele.upgradeGoods[subItem.value]) : ele.upgradeGoods[subItem.value] || ''"></ellipsis-popover>
</div>
</div>
<!-- 权益/延保非第三方展示 -->
<div class="item" v-if="(equitySceneType.includes(ele[item.key]) || extendedPosiType.includes(ele[item.key])) && !baseConfig.supplierCode.includes(`${ele.supplierCode}`)">
<div class="label">嘀加成本元/件:</div>
<div class="value">
<ellipsis-popover :content="priceFilter(ele.upgradeGoods['djCost'])"></ellipsis-popover>
</div>
</div> </div>
<!-- 商品分类 延保类 --> <!-- 商品分类 延保类 -->
<div class="item" v-if="ele[item.key] == 1"> <div class="item" v-if="ele[item.key] == 1">
<div class="label">部位:</div> <div class="label">部位:</div>
<div class="value">{{ ele['positionNames'] }}</div> <div class="value">
<ellipsis-popover :content="ele.upgradeGoods['positionNames'] || ''"></ellipsis-popover>
</div> </div>
<!-- 质保年限 膜类展示-->
<div class="item" v-if="membraneTypeList.includes(ele[item.key])">
<div class="label">质保年限/年:</div>
<div class="value">{{ ele['warrantyPeriod'] }}</div>
</div> </div>
<!-- 商品分类 权益升级 (线上126) --> <!-- 商品分类 权益升级 -->
<div class="item" v-if="equitySceneType.includes(ele[item.key]) && !baseConfig.supplierCode.includes(`${ele['supplierCode']}`)"> <div class="item" v-if="(equitySceneType.includes(ele[item.key]) || extendedPosiType.includes(ele[item.key])) && !baseConfig.supplierCode.includes(`${ele['supplierCode']}`)">
<div class="label">服务时间/年:</div> <div class="label">服务项目:</div>
<div class="value">{{ ele['serviceYears'] }}</div> <div class="value">
<ellipsis-popover :content="ele.upgradeGoods['serviceItemNames'] || ''"></ellipsis-popover>
</div>
</div> </div>
<!-- 商品分类 权益升级 (线上126) --> <!-- 商品分类 权益服务 -->
<div class="item" v-if="equitySceneType.includes(ele[item.key])"> <div class="item" v-if="equitySceneType.includes(ele[item.key])">
<div class="label">实体卡:</div> <div class="label">实体卡:</div>
<div class="value">{{ ele['entityCardFlag'] == 'Y' ? '是' : '否' }}</div> <div class="value">
<ellipsis-popover :content="ele.upgradeGoods['entityCardFlag'] == 'Y' ? '是' : '否'"></ellipsis-popover>
</div> </div>
<div class="item" v-if="equitySceneType.includes(ele[item.key]) || extendedPosiType.includes(ele[item.key])">
<div class="label">适用车价:</div>
<div v-if="!filterEmpty(ele['minSuitCarPrice']) && !filterEmpty(ele['maxSuitCarPrice'])">{{ ele['minSuitCarPrice'] }} - {{ ele['maxSuitCarPrice'] }}万</div>
<div v-else>-</div>
</div> </div>
<!-- 商品分类 权益升级 (线上126) --> <!-- 质保年限 膜类展示-->
<div class="item flex_1" v-if="equitySceneType.includes(ele[item.key]) && !baseConfig.supplierCode.includes(`${ele['supplierCode']}`)"> <div class="item" v-if="membraneTypeList.includes(ele[item.key])">
<div class="label">服务项目:</div> <div class="label">质保年限/年:</div>
<div class="value">{{ ele['serviceItemNames'] }}</div> <div class="value">
</div> <ellipsis-popover :content="`${ele.upgradeGoods['warrantyPeriod']}年` || ''"></ellipsis-popover>
<!-- 延保类非第三方 -->
<div class="item" v-if="extendedPosiType.includes(ele[item.key]) && !baseConfig.supplierCode.includes(`${ele['supplierCode']}`)">
<div class="label">服务项目:</div>
<div class="value text-hide">{{ ele['serviceItemNames'] || '-' }}</div>
</div>
<div class="item" v-if="extendedPosiType.includes(ele[item.key]) && !baseConfig.supplierCode.includes(`${ele['supplierCode']}`)">
<div class="label">服务年限:</div>
<div class="value">{{ !filterEmpty(ele['serviceYears']) ? ele['serviceYears'] + '年' : '-' }}</div>
</div> </div>
<div class="item" v-if="extendedPosiType.includes(ele[item.key]) && !baseConfig.supplierCode.includes(`${ele['supplierCode']}`)">
<div class="label">公里数:</div>
<div class="value">{{ !filterEmpty(ele['kilometers']) ? ele['kilometers'] + '万公里' : '-' }}</div>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
...@@ -180,11 +174,13 @@ import { deepClone } from '@/common/util' ...@@ -180,11 +174,13 @@ import { deepClone } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import relateStoreTable from "../../grounding/components/relateStoreTable.vue" import relateStoreTable from "../../grounding/components/relateStoreTable.vue"
import ellipsisPopover from '../../components/ellipsisPopover.vue'
export default { export default {
name: 'GroundingForm', name: 'GroundingForm',
components: { components: {
relateStoreTable, relateStoreTable,
'el-image-viewer': () => import('element-ui/packages/image/src/image-viewer') 'el-image-viewer': () => import('element-ui/packages/image/src/image-viewer'),
ellipsisPopover
}, },
data() { data() {
return { return {
...@@ -331,7 +327,7 @@ export default { ...@@ -331,7 +327,7 @@ export default {
priceFilter(num) { priceFilter(num) {
var pow = Math.pow(10, 2) var pow = Math.pow(10, 2)
if (this.filterEmpty(num)) return '-' if (this.filterEmpty(num)) return '-'
return (Math.round(num * pow) / pow).toFixed(2) return `${(Math.round(num * pow) / pow).toFixed(2)}元`
}, },
// 返回 // 返回
handleClose() { handleClose() {
...@@ -400,6 +396,9 @@ export default { ...@@ -400,6 +396,9 @@ export default {
width: 150px; width: 150px;
text-align: right; text-align: right;
} }
.value{
width: calc(100% - 150px);
}
.text-hide { .text-hide {
width: calc(100% - 150px); width: calc(100% - 150px);
overflow: hidden; overflow: hidden;
......
...@@ -16,6 +16,7 @@ import { mapActions } from 'vuex' ...@@ -16,6 +16,7 @@ import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { packageGoodsDetail, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from '../grounding/constants/data' import { packageGoodsDetail, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from '../grounding/constants/data'
import { filterSpecsStr } from "../filterOption"
export default { export default {
name: 'PackageDetail', name: 'PackageDetail',
components: { components: {
...@@ -118,6 +119,7 @@ export default { ...@@ -118,6 +119,7 @@ export default {
0: '质保卡', 0: '质保卡',
1: '质保权益卡' 1: '质保权益卡'
}, },
filterSpecsStr
} }
}, },
mounted() { mounted() {
...@@ -150,7 +152,7 @@ export default { ...@@ -150,7 +152,7 @@ export default {
if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高) if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList arr = upgradeSupplyModeList
} }
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo || {}
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName] const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-') const result = types.filter(type => type).join('-')
this.editForm[1].formBlock.push(packageGoodsDetail) this.editForm[1].formBlock.push(packageGoodsDetail)
...@@ -159,25 +161,8 @@ export default { ...@@ -159,25 +161,8 @@ export default {
res.groundingGoodsList.push({ res.groundingGoodsList.push({
goodsType: val?.goodsType, // 类目值 goodsType: val?.goodsType, // 类目值
upgradeGoodsId: val?.upgradeGoodsId, // 升级商品Id upgradeGoodsId: val?.upgradeGoodsId, // 升级商品Id
upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称
goodsAlias: val?.goodsAlias || '-', // 商品别名 goodsAlias: val?.goodsAlias || '-', // 商品别名
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result, // 商品所属类目
// upgradePrice: val?.upgradePrice, // 参考售价
positionStr: deepClone(this.positionTypeList)?.filter(subVal => val?.position == subVal.position)[0]?.confName || '', // 上架部位 positionStr: deepClone(this.positionTypeList)?.filter(subVal => val?.position == subVal.position)[0]?.confName || '', // 上架部位
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称
positionNamesArr: positionNamesArr, // 多部位数组
purchasePrice: val?.upgradeGoods?.purchasePrice, // 采购价
upgradeCommodityCode: val?.upgradeCommodityCode, // 商品ID
serviceYears: val?.upgradeGoods?.serviceYears, // 服务时间
serviceItemNames: val?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => { return this.extendedPosiType.includes(val?.goodsType) ? item.serviceName : `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
kilometers: val?.upgradeGoods?.kilometers, // 公里数
type: val?.upgradeGoods?.type, // 编码
thirdPartyCode: val?.upgradeGoods?.thirdPartyCode, // 第三方编码
entityCardFlag: val?.upgradeGoods?.entityCardFlag, // 是否实体卡
goodsName: val?.goodsName, // 素材名称(所属系列)
minSuitCarPrice: val?.upgradeGoods?.minSuitCarPrice, // 适用车价最低价
maxSuitCarPrice: val?.upgradeGoods?.maxSuitCarPrice, // 适用车价最高价
sellPrice: val?.sellPrice, // 售价 sellPrice: val?.sellPrice, // 售价
minSellPrice: val?.minSellPrice, // 最低售价 minSellPrice: val?.minSellPrice, // 最低售价
validMinSellPrice: val?.validMinSellPrice, // 是否校验最低价 validMinSellPrice: val?.validMinSellPrice, // 是否校验最低价
...@@ -191,7 +176,19 @@ export default { ...@@ -191,7 +176,19 @@ export default {
virtualAccountCost: val?.virtualAccountCost, // 虚拟对账成本 virtualAccountCost: val?.virtualAccountCost, // 虚拟对账成本
recoveryCost: val?.recoveryCost, // 回收成本 recoveryCost: val?.recoveryCost, // 回收成本
warrantyPeriod: val?.upgradeGoods?.warrantyPeriod, // 质保年限 warrantyPeriod: val?.upgradeGoods?.warrantyPeriod, // 质保年限
upgradePrice: val?.upgradeGoods?.upgradePrice // 参考售价 upgradePrice: val?.upgradeGoods?.upgradePrice, // 参考售价
upgradeGoods: {
...val?.upgradeGoods,
goodsName: val.goodsName,
upgradeGoodsName: val?.upgradeGoodsName,
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result,
serviceItemNames: val?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => { return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(val?.upgradeGoods),
carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
upgradeCommodityCode: val?.upgradeCommodityCode
}
}) })
}) })
res.sceneName = sceneList[res.sceneType] || '-' res.sceneName = sceneList[res.sceneType] || '-'
......
<!-- 适用车型弹窗 -->
<template>
<div>
<d2-dialog title="选择适用车型"
:is-visible.sync="carSeriesVisible"
width="70%"
btn-ok-label="确定"
@confirmDialog="handleCarSeriesConfirm"
@closeDialog="handleCarSeriesClose"
class="carSeries">
<slot />
<el-row class="tableCon">
<div class="tableBox">
<el-table ref="seletingTable"
:data="selectingData"
height="320px"
class="table"
border
@select="handleChange"
@select-all="handleAll">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号"
align="center"
type="index"
width="55" />
<el-table-column
prop="seriesName"
label="车系"
:show-overflow-tooltip="true"
align="center">
</el-table-column>
<el-table-column
prop="childName"
label="所属子品牌"
:show-overflow-tooltip="true"
align="center">
</el-table-column>
<el-table-column
prop="brandName"
label="所属品牌"
:show-overflow-tooltip="true"
align="center">
</el-table-column>
</el-table>
<el-pagination small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
</div>
<div class="selectedBox">
<div class="title">
<div class="title_txt">已选</div>
<div class="title_btn" @click="clearSelect">清空</div>
</div>
<div class="content">
<div class="item" v-for="(subItem, subIdx) in selectedData" :key="subIdx">
<div class="item_txt"><span>{{ subItem.seriesName }}</span></div>
<div class="del_item" @click="delItem(subItem)"><i class="el-icon-error"></i></div>
</div>
</div>
</div>
</el-row>
</d2-dialog>
</div>
</template>
<script>
import { deepClone } from '@/common/util'
export default {
name: 'CarSeriesDialog',
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 10,
curId: '',
isVisible: false
}
},
props: {
carSeriesVisible: {
type: Boolean,
default: false
},
carSeriesApi: {
type: Function,
default: () => { }
},
carSeriesSelected: {
type: Array,
default: () => []
},
carSeriesSearchForm: {
type: Object,
default: () => { }
},
extendServicePartList: {
type: Array,
default: () => []
}
},
mounted() {
this.selectedData = deepClone(this.carSeriesSelected)
this.curId = deepClone(this.carSeriesSelected)[0]?.gradeId || deepClone(this.carSeriesSelected)[0]?.id
this.getSelectingList()
},
methods: {
getSelectingList() {
let params = deepClone(this.carSeriesSearchForm)
this.carSeriesApi({
...params,
currentPage: this.currentPage,
pageSize: this.pageSize
}).then(res => {
this.selectingData = res.list || []
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
recoverySelection() {
var exitIds = this.selectedData.map((item) => item.seriesId)
this.selectingData.forEach((item) => {
exitIds.includes(item.seriesId) &&
this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(
(item) => item.seriesId === row.seriesId
)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.seriesId !== row.seriesId
))
},
handleAll(selection) {
this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex(
(subItem) => subItem.seriesId === item.seriesId
)
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
clearSelect() {
this.selectedData = []
this.$refs.seletingTable.clearSelection()
},
delItem(row) {
this.selectedData = this.selectedData.filter(item => item.seriesId !== row.seriesId)
const obj = this.selectingData.find(v => v.seriesId == row.seriesId)
if (obj) this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.currentPage = val
this.getSelectingList()
},
handleCarSeriesConfirm() {
if (!this.selectedData?.length) return this.$message.warning('请选择适用车型')
this.$emit('handleCarSeriesConfirm', this.selectedData)
},
handleCarSeriesClose() {
this.$emit('handleCarSeriesClose')
}
}
}
</script>
<style lang="scss" scoped>
.carSeries .table {
margin: 0 auto 20px !important;
width: 100%;
}
.carSeries .tableCon {
margin-top: 20px;
display: flex;
.tableBox {
flex: 2;
}
.selectedBox{
flex: 1;
height: 320px;
border: 1px solid #E5E5E5;
margin-left: 10px;
.title{
height: 38px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8px 0 16px;
border-bottom: 1px solid #E5E5E5;
.title_txt{
font-size: 16px;
font-weight: 600;
color: #333333;
}
.title_btn{
cursor: pointer;
font-size: 14px;
color: #185EFE;
}
}
.content{
padding: 16px 10px;
height: calc(100% - 75px);
overflow-y: scroll;
.item{
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
color: #666666;
padding: 0 8px;
.del_item{
cursor: pointer;
}
}
.item:hover{
background: #F6F9FF;
}
}
}
}
.service-service .carSeries .el-table .cell,
.d2-form .carSeries .el-table .cell {
line-height: 26px !important;
}
.service-service .carSeries .el-table--medium td,
.d2-form .carSeries .el-table--medium td {
padding: 6px 8px !important;
}
.carSeries .red {
color: red;
}
.carSeries .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
.text_hide{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .text_hide p{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin: 0;
}
::v-deep .el-radio__original {
display: none !important;
}
::v-deep .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled)
.el-radio__inner {
box-shadow: none !important;
}
.pdfDialog{
::v-deep .el-dialog__header {
padding: 10px 16px 4px;
background-color: #141516;
.el-dialog__title {
color: #fff;
font-size: 16px;
}
}
::v-deep .el-dialog__body {
padding: 0;
background-color: #202223;
}
}
</style>
...@@ -45,32 +45,42 @@ ...@@ -45,32 +45,42 @@
</p> </p>
<div class="flex_box"> <div class="flex_box">
<el-form-item class="d2-drawer-item" <el-form-item class="d2-drawer-item"
label="规格:">
<ellipsis-popover :content="item.specificationName"></ellipsis-popover>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="编码:"> label="编码:">
<span>{{ item.type }}</span> <ellipsis-popover :content="item.type"></ellipsis-popover>
</el-form-item> </el-form-item>
<el-form-item class="d2-drawer-item" <el-form-item class="d2-drawer-item"
label="第三方编码:"> label="第三方编码:">
<span>{{ item.thirdPartyCode }}</span> <ellipsis-popover :content="item.thirdPartyCode"></ellipsis-popover>
</el-form-item> </el-form-item>
<el-form-item class="d2-drawer-item" <el-form-item class="d2-drawer-item"
:label="membraneTypeList.includes(commodityInfo.goodsInfo.goodsType) ? '参考售价(元)/车:' : '参考售价(元)/件:'"> :label="membraneTypeList.includes(commodityInfo.goodsInfo.goodsType) ? '采购价(元)/卷:' : '采购价(元)/件:'">
<span>{{ !filterEmpty(item.upgradePrice) ? priceFilter(item.upgradePrice) : '-' }}</span> <ellipsis-popover :content="!filterEmpty(item.purchasePrice) ? priceFilter(item.purchasePrice) : '-'"></ellipsis-popover>
</el-form-item> </el-form-item>
<el-form-item class="d2-drawer-item" <el-form-item class="d2-drawer-item"
:label="membraneTypeList.includes(commodityInfo.goodsInfo.goodsType) ? '采购价(元)/卷:' : '采购价(元)/件:'"> :label="membraneTypeList.includes(commodityInfo.goodsInfo.goodsType) ? '参考售价(元)/车:' : '参考售价(元)/件:'">
<span>{{ !filterEmpty(item.purchasePrice) ? priceFilter(item.purchasePrice) : '-' }}</span> <ellipsis-popover :content="!filterEmpty(item.upgradePrice) ? priceFilter(item.upgradePrice) : '-'"></ellipsis-popover>
</el-form-item> </el-form-item>
<el-form-item <el-form-item v-if="(equitySceneType.includes($$(commodityInfo.goodsInfo,'goodsType')) || extendedPosiType.includes($$(commodityInfo.goodsInfo, 'goodsType'))) && !supplierCode.includes($$(commodityInfo.goodsInfo, 'supplierCode'))" class="d2-drawer-item"
class="d2-drawer-item" :label="'嘀加成本(元)/件:'">
v-if="membraneTypeList.includes($$(commodityInfo.goodsInfo,'goodsType'))" <ellipsis-popover :content="!filterEmpty(item.djCost) ? priceFilter(item.djCost) : '-'"></ellipsis-popover>
label="质保年限:"> </el-form-item>
<span>{{ !filterEmpty(item.warrantyPeriod) ? (item.warrantyPeriod + '年') : '-' }}</span> <el-form-item class="d2-drawer-item" label="适用车型:">
<ellipsis-popover :content="item.carSeriesName"></ellipsis-popover>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
class="d2-drawer-item" class="d2-drawer-item"
v-if="equitySceneType.includes($$(commodityInfo.goodsInfo,'goodsType')) && !supplierCode.includes($$(commodityInfo.goodsInfo, 'supplierCode'))" v-if="equitySceneType.includes($$(commodityInfo.goodsInfo,'goodsType')) && !supplierCode.includes($$(commodityInfo.goodsInfo, 'supplierCode'))"
label="服务时间:"> label="服务项目:">
<span>{{ !filterEmpty(item.serviceYears) ? (item.serviceYears + '年') : '-' }}</span> <ellipsis-popover :content="!filterEmpty(item.serviceItemNames) ? item.serviceItemNames : '-'"></ellipsis-popover>
</el-form-item>
<el-form-item class="d2-drawer-item"
v-if="$$(commodityInfo.goodsInfo,'goodsType') == 1"
label="部位:">
<ellipsis-popover :content="item.positionNames || '-'"></ellipsis-popover>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
class="d2-drawer-item" class="d2-drawer-item"
...@@ -78,38 +88,11 @@ ...@@ -78,38 +88,11 @@
label="实体卡:"> label="实体卡:">
<span>{{ item.entityCardFlag == 'Y' ? '是' : '否' }}</span> <span>{{ item.entityCardFlag == 'Y' ? '是' : '否' }}</span>
</el-form-item> </el-form-item>
<el-form-item class="d2-drawer-item"
v-if="equitySceneType.includes($$(commodityInfo.goodsInfo,'goodsType')) || extendedPosiType.includes($$(commodityInfo.goodsInfo,'goodsType'))"
label="适用车价:">
<span v-if="!filterEmpty(item.minSuitCarPrice) && !filterEmpty(item.maxSuitCarPrice)">{{ item.minSuitCarPrice }} - {{ item.maxSuitCarPrice }}万</span>
<span v-else>-</span>
</el-form-item>
<el-form-item <el-form-item
class="d2-drawer-item flex_1" class="d2-drawer-item"
v-if="equitySceneType.includes($$(commodityInfo.goodsInfo,'goodsType')) && !supplierCode.includes($$(commodityInfo.goodsInfo, 'supplierCode'))" v-if="membraneTypeList.includes($$(commodityInfo.goodsInfo,'goodsType'))"
label="服务项目:"> label="质保年限:">
<span>{{ !filterEmpty(item.serviceItemNames) ? item.serviceItemNames : '-' }}</span> <ellipsis-popover :content="!filterEmpty(item.warrantyPeriod) ? (item.warrantyPeriod + '年') : '-'"></ellipsis-popover>
</el-form-item>
<el-form-item class="d2-drawer-item flex_1"
v-if="$$(commodityInfo.goodsInfo,'goodsType') == 1"
label="部位:">
<span>{{ item.positionNames || '-' }}</span>
</el-form-item>
<!-- 延保类非第三方 -->
<el-form-item class="d2-drawer-item"
v-if="extendedPosiType.includes($$(commodityInfo.goodsInfo, 'goodsType')) && !supplierCode.includes($$(commodityInfo.goodsInfo, 'supplierCode'))"
label="服务项目:">
<span style="display: inline-block;width: 210px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap">{{ !filterEmpty(item.extendServiceItemNames) ? item.extendServiceItemNames : '-' }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
v-if="extendedPosiType.includes($$(commodityInfo.goodsInfo, 'goodsType')) && !supplierCode.includes($$(commodityInfo.goodsInfo, 'supplierCode'))"
label="服务年限:">
<span>{{ !filterEmpty(item.serviceYears) ? (item.serviceYears + '年') : '-' }}</span>
</el-form-item>
<el-form-item class="d2-drawer-item"
v-if="extendedPosiType.includes($$(commodityInfo.goodsInfo, 'goodsType')) && !supplierCode.includes($$(commodityInfo.goodsInfo, 'supplierCode'))"
label="公里数:">
<span>{{ !filterEmpty(item.kilometers) ? (item.kilometers + '万公里') : '-' }}</span>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -137,8 +120,11 @@ ...@@ -137,8 +120,11 @@
import { getGoodsInfoById } from '@/api/commodity' import { getGoodsInfoById } from '@/api/commodity'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import ellipsisPopover from '../../components/ellipsisPopover.vue'
import { filterSpecsStr } from '../../filterOption'
export default { export default {
name: 'DrawerDetail', name: 'DrawerDetail',
components: {ellipsisPopover},
data() { data() {
return { return {
equitySceneType: baseConfig.equitySceneType || [], // 权益类目 equitySceneType: baseConfig.equitySceneType || [], // 权益类目
...@@ -147,7 +133,8 @@ export default { ...@@ -147,7 +133,8 @@ export default {
commodityInfo: {}, commodityInfo: {},
membraneTypeList: baseConfig.membraneTypeList, membraneTypeList: baseConfig.membraneTypeList,
supplierCode: baseConfig.supplierCode, // 供应方 supplierCode: baseConfig.supplierCode, // 供应方
operationLogList: [] // 操作信息 operationLogList: [], // 操作信息
filterSpecsStr
} }
}, },
...@@ -185,10 +172,16 @@ export default { ...@@ -185,10 +172,16 @@ export default {
getInfo(id) { getInfo(id) {
getGoodsInfoById({ id: id }).then(res => { getGoodsInfoById({ id: id }).then(res => {
res?.upgradeGoodsList?.forEach(item => { res?.upgradeGoodsList?.forEach(item => {
let obj = {
...item,
specificationTypeSequence: res?.specificationPermutationList?.find(v => v.specificationValueSequence == item.specificationData)?.specificationTypeSequence
}
const positionNamesArr = deepClone(this.positionTypeList).filter(val => item.position?.split(',')?.includes(val.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList).filter(val => item.position?.split(',')?.includes(val.position + '')) || []
item.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' item.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : ''
item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',') item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',')
item.extendServiceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}` })?.join(',') item.extendServiceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}` })?.join(',')
item.specificationName = this.filterSpecsStr(obj)
item.carSeriesName = item?.carTypeConfigList?.map(v => { return v.seriesName })?.join('/')
}) })
res?.operationLogList?.forEach(val => { res?.operationLogList?.forEach(val => {
val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, 'YYYY-MM-DD HH:mm:ss') : '' val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
...@@ -266,6 +259,10 @@ export default { ...@@ -266,6 +259,10 @@ export default {
.el-form-item__label{ .el-form-item__label{
flex-shrink: 0; flex-shrink: 0;
} }
.el-form-item__content {
width: 100%;
height: 36px;
}
} }
.flex_1{ .flex_1{
width: 100%; width: 100%;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
:placeholder="item.label" :placeholder="item.label"
:maxlength="item.maxlength" :maxlength="item.maxlength"
:style="{ width: item.width || formItemWidth }" :style="{ width: item.width || formItemWidth }"
:disabled="item.isDisabled" :disabled="item.isDisabled || pageData.pageDisabled"
clearable clearable
@input="input($event, item)" @input="input($event, item)"
@blur="blur(item)" @blur="blur(item)"
...@@ -50,13 +50,14 @@ ...@@ -50,13 +50,14 @@
@change="selectAddAttr($event, item)" @change="selectAddAttr($event, item)"
:style="{ width: item.width || formItemWidth }" :style="{ width: item.width || formItemWidth }"
filterable filterable
:disabled="item.isDisabled" :disabled="item.isDisabled || pageData.pageDisabled"
> >
<el-option <el-option
v-for="subItem in item.optionList" v-for="subItem in item.optionList"
:key="subItem[item.optionId]" :key="subItem[item.optionId]"
:label="subItem[item.optionLabel]" :label="subItem[item.optionLabel]"
:value="subItem[item.optionId]" :value="subItem[item.optionId]"
:disabled="subItem.isDisabled"
/> />
</el-select> </el-select>
<!-- 可添加选项选择框 --> <!-- 可添加选项选择框 -->
...@@ -70,7 +71,7 @@ ...@@ -70,7 +71,7 @@
@blur="selectBlur" @blur="selectBlur"
@focus="selectFocus" @focus="selectFocus"
filterable filterable
:disabled="item.isDisabled" :disabled="item.isDisabled || pageData.pageDisabled"
> >
<el-option <el-option
v-for="(subItem, subIndex) in item.optionList" v-for="(subItem, subIndex) in item.optionList"
...@@ -176,7 +177,7 @@ ...@@ -176,7 +177,7 @@
<!-- 级联选择器 --> <!-- 级联选择器 -->
<el-cascader v-else-if="item.type === 'cascader'" :style="{ width: item.width || formItemWidth }" :options="item.optionList" <el-cascader v-else-if="item.type === 'cascader'" :style="{ width: item.width || formItemWidth }" :options="item.optionList"
v-model="formData[item.name]" :placeholder="'请选择' + item.label" filterable v-model="formData[item.name]" :placeholder="'请选择' + item.label" filterable
@change="selectAddAttr($event, item)" aria-hidden="false" @change="selectAddAttr($event, item)" aria-hidden="false" :disabled="pageData.pageDisabled"
:props="{ checkStrictly: true, label: item.optionLabel, value: item.optionId }"> :props="{ checkStrictly: true, label: item.optionLabel, value: item.optionId }">
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
...@@ -611,10 +612,13 @@ import { baseConfig } from "@/main" ...@@ -611,10 +612,13 @@ import { baseConfig } from "@/main"
const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-info` const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-info`
export default { export default {
name: "ProductForm", name: "ProductForm",
inject: ['pageData'],
data() { data() {
return { return {
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
membraneTypeList: baseConfig.membraneTypeList || [], membraneTypeList: baseConfig.membraneTypeList || [],
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
supplierCode: baseConfig.supplierCode || [],
solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112], solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112],
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
lookImgVisible: false, lookImgVisible: false,
...@@ -790,6 +794,20 @@ export default { ...@@ -790,6 +794,20 @@ export default {
this.selectedPositionIds = arr this.selectedPositionIds = arr
this.setUpdateGoodsInfo({ goodsPositionList: newVal }) this.setUpdateGoodsInfo({ goodsPositionList: newVal })
} }
},
'formData.goodsType': {
handler() {
if (this.addOrEdit === 'edit' && (this.formData?.status != 3 || this.formData?.scrmFlag == 'Y')) return
this.setFormItemStatus()
},
deep: true
},
'formData.supplierCode': {
handler() {
if (this.addOrEdit === 'edit' && (this.formData?.status != 3 || this.formData?.scrmFlag == 'Y')) return
this.setFormItemStatus()
},
deep: true
} }
}, },
...@@ -822,6 +840,47 @@ export default { ...@@ -822,6 +840,47 @@ export default {
get: "d2admin/base/get" get: "d2admin/base/get"
}), }),
...mapMutations("goodsInfoData", ["setUpdateGoodsInfo"]), ...mapMutations("goodsInfoData", ["setUpdateGoodsInfo"]),
setFormItemStatus() {
// 获取供应方和延保类目的选项列表
const supplierIndex = this.formList[0]?.formBlock.findIndex(val => val.name === "supplierCode")
const goodsTypeIndex = this.formList[0]?.formBlock.findIndex(val => val.name === 'tempGoodsType')
const suppOptionList = this.formList[0]?.formBlock[supplierIndex]?.optionList
const goodsTypeOptionList = this.formList[0]?.formBlock[goodsTypeIndex]?.optionList
// 更新供应方选项的 disabled 状态
const updateSupplierOptions = (isDisabled) => {
suppOptionList?.forEach(item => {
item.isDisabled = isDisabled && !this.supplierCode?.includes(`${item.id}`)
})
this.$set(this.formList[0].formBlock[supplierIndex], 'optionList', suppOptionList)
}
// 更新延保类目选项的 disabled 状态
const updateGoodsTypeOptions = (isDisabled) => {
const updatedGoodsTypeOptionList = goodsTypeOptionList.map(item => {
const newItem = { ...item, disabled: isDisabled && this.extendedPosiType?.includes(item.categoryType) };
if (newItem.children) {
newItem.children = newItem.children.map(i => ({
...i,
disabled: newItem.disabled,
children: i.children ? i.children.map(j => ({ ...j, disabled: newItem.disabled })) : undefined
}))
}
return newItem
})
this.$set(this.formList[0].formBlock[goodsTypeIndex], 'optionList', updatedGoodsTypeOptionList)
}
// 根据 goodsType 更新供应方选项
if (this.extendedPosiType?.includes(this.formData?.goodsType)) {
updateSupplierOptions(true)
} else {
updateSupplierOptions(false)
}
// 根据 supplierCode 更新延保类目选项
if (this.formData?.supplierCode && !this.supplierCode?.includes(`${this.formData?.supplierCode}`)) {
updateGoodsTypeOptions(true)
} else {
updateGoodsTypeOptions(false)
}
},
selectBlur() { selectBlur() {
this.editOptionIndex = -1 this.editOptionIndex = -1
this.showOptionInput = false this.showOptionInput = false
...@@ -1006,7 +1065,7 @@ export default { ...@@ -1006,7 +1065,7 @@ export default {
if (!fileInfo) return if (!fileInfo) return
if (fileInfo?.size / 1024 / 1024 > 10) { if (fileInfo?.size / 1024 / 1024 > 10) {
document.getElementById(`${targetItem.name}file`).value = "" document.getElementById(`${targetItem.name}file`).value = ""
return this.$message("请上传10M以内图片") return this.$message.warning("请上传10M以内图片")
} }
reader.readAsDataURL(fileInfo) reader.readAsDataURL(fileInfo)
reader.onload = (e) => { reader.onload = (e) => {
...@@ -1057,7 +1116,7 @@ export default { ...@@ -1057,7 +1116,7 @@ export default {
if (e.total / 1024 / 1024 > 20) { if (e.total / 1024 / 1024 > 20) {
return this.$message({ return this.$message({
message: "视频内容大于20M", message: "视频内容大于20M",
type: "error" type: "warning"
}) })
} }
const imgFile = e.target.result const imgFile = e.target.result
...@@ -1139,7 +1198,7 @@ export default { ...@@ -1139,7 +1198,7 @@ export default {
this.solarFilmArr?.includes(this.formData?.goodsType) this.solarFilmArr?.includes(this.formData?.goodsType)
) { ) {
// 太阳膜类目 产品名称关键字与类目不匹配 // 太阳膜类目 产品名称关键字与类目不匹配
this.$message.error( this.$message.warning(
"产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下" "产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下"
) )
} }
......
...@@ -54,7 +54,8 @@ export default { ...@@ -54,7 +54,8 @@ export default {
label: '产品名称', label: '产品名称',
type: 'input', type: 'input',
maxlength: 20, maxlength: 20,
width: '432px' width: '432px',
isDisabled: false
}, },
{ {
name: 'tempGoodsType', name: 'tempGoodsType',
...@@ -94,7 +95,8 @@ export default { ...@@ -94,7 +95,8 @@ export default {
optionId: 'id', optionId: 'id',
optionLabel: 'relatedPartyName', optionLabel: 'relatedPartyName',
partitionFlag: 2, partitionFlag: 2,
width: '432px' width: '432px',
isDisabled: false
}, { }, {
name: 'thumbUrl', name: 'thumbUrl',
label: '缩略图', label: '缩略图',
...@@ -179,7 +181,8 @@ export default { ...@@ -179,7 +181,8 @@ export default {
getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => { getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
const obj = this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'tempGoodsType')] const obj = this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'tempGoodsType')]
obj.optionList = res?.list || [] obj.optionList = res?.list || []
if (this.addOrEdit === 'edit' && this.formData?.status != 3) { // SCRM同步过来商品 或者非草稿支持在当前类目下变更1.2.3级类目,不允许更换一级类目
if (this.addOrEdit === 'edit' && (this.formData?.status != 3 || this.formData?.scrmFlag == 'Y')) {
obj.optionList.forEach(item => { obj.optionList.forEach(item => {
if (item.categoryType != this.editData.goodsType) { if (item.categoryType != this.editData.goodsType) {
item.disabled = true item.disabled = true
...@@ -191,6 +194,37 @@ export default { ...@@ -191,6 +194,37 @@ export default {
}) })
} }
}) })
} else {
const goodsTypeIndex = this.editForm[0]?.formBlock.findIndex(val => val.name === 'tempGoodsType')
const goodsTypeOptionList = this.editForm[0]?.formBlock[goodsTypeIndex]?.optionList
// 更新延保类目选项的 disabled 状态
const updateGoodsTypeOptions = (isDisabled) => {
const updatedGoodsTypeOptionList = goodsTypeOptionList.map(item => {
const newItem = { ...item, disabled: isDisabled && this.baseConfig?.extendedPosiType?.includes(item.categoryType) };
if (newItem.children) {
newItem.children = newItem.children.map(i => ({
...i,
disabled: newItem.disabled,
children: i.children ? i.children.map(j => ({ ...j, disabled: newItem.disabled })) : undefined
}))
}
return newItem
})
this.$set(this.editForm[0].formBlock[goodsTypeIndex], 'optionList', updatedGoodsTypeOptionList)
}
// 根据 supplierCode 更新延保类目选项
if (this.formData?.supplierCode && !this.baseConfig?.supplierCode?.includes(`${this.formData?.supplierCode}`)) {
updateGoodsTypeOptions(true)
} else {
updateGoodsTypeOptions(false)
}
}
// SCRM同步过来商品字段不可编辑
if (this.formData?.scrmFlag == 'Y') {
let disabledLabel = ['goodsName', 'supplierCode']
for (var i = 0; i < disabledLabel.length; i++) {
this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == disabledLabel[i])].isDisabled = true
}
} }
}) })
}, },
...@@ -202,7 +236,22 @@ export default { ...@@ -202,7 +236,22 @@ export default {
if (num == 1) { if (num == 1) {
this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'brandMerchantCode')].optionList = res this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'brandMerchantCode')].optionList = res
} else { } else {
this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'supplierCode')].optionList = res const supplierIndex = this.editForm[0]?.formBlock.findIndex(val => val.name === "supplierCode")
this.editForm[0].formBlock[supplierIndex].optionList = res
const suppOptionList = this.editForm[0]?.formBlock[supplierIndex]?.optionList
// 更新供应方选项的 disabled 状态
const updateSupplierOptions = (isDisabled) => {
suppOptionList?.forEach(item => {
item.isDisabled = isDisabled && !this.baseConfig?.supplierCode?.includes(`${item.id}`)
})
this.$set(this.editForm[0].formBlock[supplierIndex], 'optionList', suppOptionList)
}
// 根据 goodsType 更新供应方选项
if (this.baseConfig?.extendedPosiType?.includes(this.formData?.goodsType)) {
updateSupplierOptions(true)
} else {
updateSupplierOptions(false)
}
} }
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!