Commit 022e4cb9 by huyue

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 9fd22d9c b7fc0b53
Showing 96 changed files with 3193 additions and 503 deletions
...@@ -208,3 +208,49 @@ export function getPersonStaffWarning (data) { ...@@ -208,3 +208,49 @@ 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)
}
...@@ -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")
} }
......
...@@ -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)
}
...@@ -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")
}
...@@ -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>
...@@ -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:
......
...@@ -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")
}, },
......
...@@ -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: {
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
class="dialog" class="dialog"
@handleClick="handleClick" @handleClick="handleClick"
> >
<div class="dialog-content"> <div
class="dialog-content"
v-loading="loading"
>
<div class="search-box"> <div class="search-box">
<div class="label">指标名称:</div> <div class="label">指标名称:</div>
<el-input <el-input
...@@ -14,11 +17,13 @@ ...@@ -14,11 +17,13 @@
size="small" size="small"
maxlength="10" maxlength="10"
v-model="searchValue" v-model="searchValue"
clearable
></el-input> ></el-input>
<el-button <el-button
class="btn" class="btn"
type="primary" type="primary"
size="small" size="small"
@click="getDataConfig"
>查询</el-button> >查询</el-button>
</div> </div>
<el-table <el-table
...@@ -33,6 +38,7 @@ ...@@ -33,6 +38,7 @@
class-name="draggable-icon" class-name="draggable-icon"
width="40" width="40"
align="center" align="center"
v-if="!searchFlag"
> >
<div class="icon"></div> <div class="icon"></div>
</el-table-column> </el-table-column>
...@@ -40,6 +46,7 @@ ...@@ -40,6 +46,7 @@
type="index" type="index"
width="60" width="60"
align="center" align="center"
v-if="!searchFlag"
> >
</el-table-column> </el-table-column>
<template v-for="(item,index) in tableParams.tableColumns"> <template v-for="(item,index) in tableParams.tableColumns">
...@@ -52,29 +59,7 @@ ...@@ -52,29 +59,7 @@
:key="index" :key="index"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div <template v-if="item.formatter">
v-if="item.addHtml"
class="input-box"
>
<template v-if="scope.row.isEdit">
<el-input
v-model="scope.row[item.addHtml]"
:maxlength="item.maxlength"
:placeholder="item.placeholder"
:ref="`${scope.row.id}`"
size="mini"
:class="scope.row.className"
@blur="handleInput($event, scope.row, item)"
></el-input>
</template>
<template v-else>
{{ scope.row[item.addHtml]?scope.row[item.addHtml].toLocaleString() : ''}}
</template>
<template v-if="item.unit">
<div class="unit">{{item.unit}}</div>
</template>
</div>
<template v-else-if="item.formatter">
<span <span
v-if="item.html" v-if="item.html"
v-html="item.formatter(scope.row)" v-html="item.formatter(scope.row)"
...@@ -97,7 +82,9 @@ ...@@ -97,7 +82,9 @@
<el-button <el-button
type="text" type="text"
@click="hide(scope)" @click="hide(scope)"
>{{scope.type == 1?'显示':'隐藏'}}</el-button> :key="btnKey"
>{{scope.row.hiddenFlag == 1?'显示':'隐藏'}}</el-button>
<template v-if="tableData.length > 1 && !searchFlag">
<span <span
class="icon el-icon-top" class="icon el-icon-top"
@click="changeSort(scope.$index,0)" @click="changeSort(scope.$index,0)"
...@@ -109,6 +96,7 @@ ...@@ -109,6 +96,7 @@
v-if="scope.$index != tableData.length - 1" v-if="scope.$index != tableData.length - 1"
></span> ></span>
</template> </template>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
...@@ -117,13 +105,18 @@ ...@@ -117,13 +105,18 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import sortablejs from "sortablejs" import sortablejs from "sortablejs"
import { getKpiMetric, updateKpiMetric, updateOneKpiMetric} from '@/api/earlyWarningManager'
export default { export default {
name: '', name: '',
props: { props: {
show: Boolean show: Boolean,
scope: Number
}, },
data () { data () {
return { return {
btnKey: Date.now(),
loading: true,
searchValue: '', searchValue: '',
dialogShow: false, dialogShow: false,
dialogConfig: { dialogConfig: {
...@@ -140,79 +133,31 @@ export default { ...@@ -140,79 +133,31 @@ export default {
width: "1080px" width: "1080px"
} }
}, },
tableData: [ tableData: [],
{
id: 1,
businessType: 4,
outputTarget: '1',
grossProfit: '',
grossMargin: ''
},
{
id: 2,
businessType: 3,
outputTarget: '2',
grossProfit: '',
grossMargin: ''
},
{
id: 3,
businessType: 2,
outputTarget: '3',
grossProfit: '',
grossMargin: ''
}
],
tableParams: { tableParams: {
tableOption: { tableOption: {
width: '100' width: '100'
}, },
tableColumns: [ tableColumns: [
{ {
label: '业务类型',
minWidth: 110, minWidth: 110,
formatter: (cellValue) => { prop: 'name'
return {
2: '轻改',
3: '权益',
4: '延保'
}[cellValue.businessType]
},
}, },
{ {
label: '产值目标',
addHtml: 'outputTarget',
minWidth: 135, minWidth: 135,
maxlength: 10, prop: 'definition'
placeholder: '请输入',
max: 9999999999
},
{
label: '毛利润',
addHtml: 'grossProfit',
minWidth: 135,
maxlength: 10,
placeholder: '请输入',
max: 9999999999
},
{
label: '毛利润率',
addHtml: 'grossMargin',
unit: '%',
minWidth: 135,
maxlength: 5,
placeholder: '请输入',
max: 100,
decimals: true
}, },
] ]
}, },
searchFlag: false
} }
}, },
watch: { watch: {
show (n) { show (n) {
this.dialogShow = n this.dialogShow = n
if (n) { if (n) {
this.tableData = []
this.searchValue = ''
this.init() this.init()
} }
}, },
...@@ -220,6 +165,11 @@ export default { ...@@ -220,6 +165,11 @@ export default {
this.$emit('update:show', n) this.$emit('update:show', n)
} }
}, },
computed: {
uuid () {
return this.$store.state.d2admin.user.info.detail.uuid
}
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -227,7 +177,19 @@ export default { ...@@ -227,7 +177,19 @@ export default {
this.getDataConfig() this.getDataConfig()
}, },
async 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(() => { this.$nextTick(() => {
let el = this.$refs.table.$el.querySelector(`.el-table__body-wrapper > table > tbody`) let el = this.$refs.table.$el.querySelector(`.el-table__body-wrapper > table > tbody`)
this.$nextTick(() => { this.$nextTick(() => {
new sortablejs(el, { new sortablejs(el, {
...@@ -240,34 +202,40 @@ export default { ...@@ -240,34 +202,40 @@ export default {
}) })
}) })
}) })
} catch (error) {
this.loading = false
}
}, },
async handleClick () { async handleClick () {
// try { try {
// let { tableData } = this, let userKpiMetricAddRequestDTOS = [],
// { targetDate } = this { scope, tableData, uuid, searchFlag } = this
// tableData.map(e => { tableData.map((e, index) => {
// if (e.isEdit) { userKpiMetricAddRequestDTOS.push({
// e.outputTarget = e.origin_outputTarget id: e.id,
// e.grossProfit = e.origin_grossProfit loginUuid: uuid,
// e.grossMargin = e.origin_grossMargin sort: searchFlag ? e.defaultSortOrder : index + 1,
// } hiddenFlag: e.hiddenFlag
// e.targetDate = targetDate })
// }) })
// const res = await saveOrUpdateDataConfig({ console.log(userKpiMetricAddRequestDTOS, '-------')
// targetConfigList: tableData const apiFun = searchFlag ? updateOneKpiMetric : updateKpiMetric
// }) const res = await apiFun({
// if (res) { userKpiMetricAddRequestDTOS,
// this.$message.success('保存成功') scope
})
if (res) {
this.$message.success('保存成功')
this.dialogShow = false this.dialogShow = false
this.$emit('update') this.$emit('update')
// } }
// } catch (error) { } catch (error) {
// if (error) this.$message.error(error) if (typeof error === 'string') this.$message.error(error)
// } }
}, },
hide (scope) { hide (scope) {
console.log(scope) scope.row.hiddenFlag = scope.row.hiddenFlag == 1 ? 0 : 1
this.btnKey = Date.now()
}, },
changeSort (oldIndex, newIndex) { changeSort (oldIndex, newIndex) {
this.tableData.splice(newIndex, 0, this.tableData.splice(oldIndex, 1)[0]) this.tableData.splice(newIndex, 0, this.tableData.splice(oldIndex, 1)[0])
...@@ -278,8 +246,13 @@ export default { ...@@ -278,8 +246,13 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.dialog { .dialog {
::v-deep.el-dialog__body {
max-height: 60vh !important;
overflow-y: auto;
}
&-content { &-content {
padding: 5px 0; // padding: 5px 0;
.search-box { .search-box {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
watch: { watch: {
date: { date: {
handler (val) { handler (val) {
if (val.length) { if (val && val.length) {
let [startDate, endDate] = val let [startDate, endDate] = val
let dayNum = dayjs(endDate).diff(dayjs(startDate), 'day') + 1 let dayNum = dayjs(endDate).diff(dayjs(startDate), 'day') + 1
if (dayNum <= 7) { if (dayNum <= 7) {
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +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),
...@@ -189,6 +189,11 @@ export default { ...@@ -189,6 +189,11 @@ export default {
} }
this.form.dateType = '' this.form.dateType = ''
this.$emit('search', this.getSearchTime()) this.$emit('search', this.getSearchTime())
} else {
this.form = this.$options.data.call(this).form
this.search()
}
}, },
search (e) { search (e) {
let { form: { let { form: {
...@@ -219,7 +224,7 @@ export default { ...@@ -219,7 +224,7 @@ export default {
}, },
startDate = '', startDate = '',
endDate = '' endDate = ''
if (date.length) { if (date && date.length) {
startDate = this.formatDate(date[0]) startDate = this.formatDate(date[0])
endDate = this.formatDate(date[1]) endDate = this.formatDate(date[1])
} else { } else {
...@@ -229,14 +234,18 @@ export default { ...@@ -229,14 +234,18 @@ export default {
endDate = dateItem.endDate endDate = dateItem.endDate
} }
} }
if(this.hasStatisticalPeriod){ if (this.hasStatisticalPeriod) {
console.log(this.statisticalPeriod) params.dateType = {
'day':0,
'week':1,
'month':2,
}[this.statisticalPeriod]
} }
params.startDate = startDate params.startDate = startDate
params.endDate = endDate params.endDate = endDate
return params return params
}, },
handleReset(){ handleReset () {
this.form = this.$options.data.call(this).form this.form = this.$options.data.call(this).form
this.search('dateType') this.search('dateType')
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<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 { getMerchantOutputDetail, getBoardDetail } from '@api/earlyWarningManager'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { tooltipConfig, xAxisConfig, dataZoomSliderConfig } from '../chartConfig' import { tooltipConfig, xAxisConfig, dataZoomSliderConfig } from '../chartConfig'
...@@ -42,25 +42,25 @@ export default { ...@@ -42,25 +42,25 @@ export default {
type: Object, type: Object,
default: () => { } default: () => { }
}, },
show:Boolean show: Boolean
}, },
data () { data () {
return { return {
chart: null, chart: null,
searchTime: {}, searchTime: {},
dialogShow:false dialogShow: false
} }
}, },
computed: { computed: {
businessType () { businessType () {
return this.pageData.businessType return this.pageData.businessType
}
}, },
watch:{ },
watch: {
businessType: { businessType: {
handler (newVal) { handler (newVal) {
if (this.show) { if (this.show) {
if (newVal && this.initStatus) this.getMerchantOutputDetail() if (newVal && this.initStatus) this.getData()
} else this.initStatus = false } else this.initStatus = false
} }
} }
...@@ -71,41 +71,37 @@ export default { ...@@ -71,41 +71,37 @@ export default {
methods: { methods: {
async getBoardData (params) { async getBoardData (params) {
this.searchTime = params this.searchTime = params
this.getMerchantOutputDetail() this.getData()
this.initStatus = true this.initStatus = true
}, },
async getMerchantOutputDetail () { async getData () {
let { queryType } = this.pageData, let { searchTime: { startDate, endDate, dateType }, businessType } = this
{ searchTime, businessType } = 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: 'A048'
}) })
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 } } = 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-触客数)
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 = {
...@@ -115,20 +111,18 @@ export default { ...@@ -115,20 +111,18 @@ 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}
客单价:${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,
......
...@@ -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
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
/> />
</el-tabs> </el-tabs>
<template v-if="activeName == '1'"> <template v-if="activeName == '1'">
<el-button class="edit-board" @click="dialogShow = true"> <el-button
class="edit-board"
@click="dialogShow = true"
>
<span class="el-icon-edit-outline"></span> <span class="el-icon-edit-outline"></span>
编辑指标 编辑指标
</el-button> </el-button>
...@@ -27,12 +30,14 @@ ...@@ -27,12 +30,14 @@
@openWindow="$emit('openWindow',$event)" @openWindow="$emit('openWindow',$event)"
:pageId="i.id" :pageId="i.id"
:search-form="searchForm" :search-form="searchForm"
:refreshFlag.sync="i.refreshFlag"
/> />
</template> </template>
</div> </div>
<pointer-config <pointer-config
:show.sync="dialogShow" :show.sync="dialogShow"
@update="$emit('update')" :scope="1"
@update="search"
/> />
</div> </div>
</template> </template>
...@@ -75,6 +80,9 @@ export default { ...@@ -75,6 +80,9 @@ export default {
methods: { methods: {
search () { search () {
this.$refs[`component-${this.activeName}`][0].search() this.$refs[`component-${this.activeName}`][0].search()
this.tabList.map(e => {
if (e.id != this.activeName) e.refreshFlag = true
})
} }
} }
} }
......
<template> <template>
<div class="data-list-box">
<template v-if="boardList.length">
<div class="data-list"> <div class="data-list">
<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"> <div class="board-tips">
<el-tooltip placement="top"> <el-tooltip placement="top">
<div slot="content">多行信息<br />第二行信息</div> <div slot="content">{{item.definition}}</div>
<div class="board-tips-icon">?</div> <div class="board-tips-icon">?</div>
</el-tooltip> </el-tooltip>
</div> </div>
</board-item> </board-item>
</template> </template>
</div>
</template>
<template v-else>
<div class="no-data">
暂无数据
</div>
</template>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import onShowMixin from './onShowMixin' import onShowMixin from './onShowMixin'
import BoardItem from '../shopGuardIndex/BoardItem' import BoardItem from '../shopGuardIndex/BoardItem'
import { getBoardList } from '@api/earlyWarningManager'
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
components: { components: {
...@@ -29,45 +43,37 @@ export default { ...@@ -29,45 +43,37 @@ export default {
name: '', name: '',
data () { data () {
return { return {
boardData: { boardList: [],
},
boardList: [
{
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',
},
],
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
search () { async search () {
console.log(this.searchForm, 'list') 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'
})
})
},
openWindow (e) {
console.log(e)
this.$emit('openWindow', e)
} }
} }
} }
...@@ -82,12 +88,12 @@ export default { ...@@ -82,12 +88,12 @@ export default {
.board-item { .board-item {
border-radius: 4px; border-radius: 4px;
background: #f8faff; background: #f8faff;
cursor: pointer;
} }
.board-tips { .board-tips {
position: absolute; position: absolute;
top: 20px; top: 20px;
right: 20px; right: 20px;
cursor: pointer;
&-icon { &-icon {
width: 14px; width: 14px;
height: 14px; height: 14px;
...@@ -102,4 +108,13 @@ export default { ...@@ -102,4 +108,13 @@ export default {
} }
} }
} }
.no-data {
background: white;
padding: 20px 0;
min-height: 60px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:form-data="showFormData" :form-data="showFormData"
label-width="100px" label-width="100px"
> >
<template slot="time"> <template slot="dateGroup">
<search-box <search-box
ref="timeRef" ref="timeRef"
class="search-box" class="search-box"
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import SearchBox from '../SearchBox' import SearchBox from '../SearchBox'
import dataGroup from './dataGroup.vue' import dataGroup from './dataGroup.vue'
import { listShop4sByRef } from "@api/merchant" import { listShop4sByRef, getCarBrandList } from "@api/merchant"
export default { export default {
name: '', name: '',
components: { components: {
...@@ -60,8 +60,8 @@ export default { ...@@ -60,8 +60,8 @@ export default {
loading: false, loading: false,
searchForm: { searchForm: {
businessType: 4, businessType: 4,
businessNature: '', businessScenarioList: [],
carBrand: '', secondBrandIdList: [],
merchantRange: 1, merchantRange: 1,
// merchantId: '', // merchantId: '',
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
}, },
{ {
label: '业务性质', label: '业务性质',
name: 'businessNature', name: 'businessScenarioList',
type: 'select', type: 'select',
multiple: true, multiple: true,
isClear: true, isClear: true,
...@@ -100,20 +100,18 @@ export default { ...@@ -100,20 +100,18 @@ export default {
optionLabel: 'confName', optionLabel: 'confName',
}, },
{ {
addHtml: 'time' addHtml: 'dateGroup'
}, },
{ {
label: '主营品牌', label: '主营品牌',
name: 'carBrand', name: 'secondBrandIdList',
type: 'select', type: 'select',
multiple: true,
isClear: true, isClear: true,
optionList: [ collapseTags: true,
{ value: 2, name: '轻改' }, optionList: [],
{ value: 3, name: '权益' }, optionId: 'id',
{ value: 4, name: '延保' }, optionLabel: 'label',
],
optionId: 'value',
optionLabel: 'name',
}, },
{ {
label: '门店范围', label: '门店范围',
...@@ -139,6 +137,7 @@ export default { ...@@ -139,6 +137,7 @@ export default {
}, },
mounted () { mounted () {
this.getServiceStore() this.getServiceStore()
this.getCarBrandList()
}, },
methods: { methods: {
getServiceStore (merchantId) { getServiceStore (merchantId) {
...@@ -155,12 +154,30 @@ export default { ...@@ -155,12 +154,30 @@ export default {
}) })
}) })
}, },
async getCarBrandList () {
const res = await getCarBrandList({ containsChildren: true }),
brandList = []
console.log(res)
res.map(e => {
if (e && e.children && e.children.length) {
e.children.map(i => {
brandList.push(i)
})
}
})
this.showFormData.map(item => {
if (item.name == 'secondBrandIdList') {
item.optionList = brandList || []
}
})
},
handleReset () { handleReset () {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.$refs.timeRef.handleReset() this.$refs.timeRef.handleReset()
this.$nextTick(() => this.search()) this.$nextTick(() => this.search())
}, },
setTimeData (e) { setTimeData (e) {
delete e.allYear
this.searchForm = { this.searchForm = {
...this.searchForm, ...this.searchForm,
...e ...e
...@@ -189,7 +206,10 @@ export default { ...@@ -189,7 +206,10 @@ export default {
.radio-group { .radio-group {
width: fit-content; width: fit-content;
flex-shrink: 0; flex-shrink: 0;
margin-left: 17px; margin-right: 8px;
}
.date-picker {
width: 217px;
} }
} }
} }
......
...@@ -10,10 +10,18 @@ ...@@ -10,10 +10,18 @@
ref="table" ref="table"
:table-params="tableParams" :table-params="tableParams"
:tableData="tableData" :tableData="tableData"
:table-total="tableTotal" :hasPage="false"
:has-num="false" :has-num="false"
@pageChange="pageChange" noDataText="暂无门店数据"
> >
<template
slot="sortableHtml"
slot-scope="scope"
>
<div class="sortableHtml">
{{scope.scope[scope.prop]}}
</div>
</template>
<div <div
slot="auth-button" slot="auth-button"
slot-scope="scope" slot-scope="scope"
...@@ -29,8 +37,8 @@ ...@@ -29,8 +37,8 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import onShowMixin from './onShowMixin' import onShowMixin from './onShowMixin'
import { warningMsgDetailListWithPage } from '@api/earlyWarningManager' import { getBoardMerchantList } from '@api/earlyWarningManager'
import dayjs from 'dayjs'
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
name: '', name: '',
...@@ -51,78 +59,92 @@ export default { ...@@ -51,78 +59,92 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '门店名称', label: '门店名称',
prop: 'merchantName4s', prop: 'merchantName',
width: '150' width: '150'
}, { }, {
label: '商户号', label: '商户号',
prop: 'merchantId4s', prop: 'merchantId',
width: '100' width: '100'
}, { }, {
label: '是否直营', label: '是否直营',
prop: 'customerName', formatter (row) {
//直营(0-非直营,1-直营)
return {
0: '非直营',
1: '直营'
}[row.directSale]
}
}, { }, {
label: '展业时间', label: '展业时间',
prop: 'carModel', formatter (row) {
return row.startBusiness ? dayjs(row.startBusiness).format('YYYY-MM-DD') : '-'
}
}, { }, {
label: '督导', label: '督导',
width: '130', width: 'supervisionList',
formatter (row) { formatter (row) {
let result = { return "-"
1: "成交",
0: "战败"
}[row.receptionStatus]
return result || "-"
} }
}, { }, {
label: '归属业务', label: '归属业务',
prop: 'orderFinishFlag', prop: 'businessType',
width: '130', width: '130',
formatter (row) { formatter (row) {
return row.orderFinishFlag ? '成交' : '战败' return {
2: '轻改',
3: '权益',
4: '延保',
}[row.businessType]
} }
}, { }, {
label: '主营品牌', label: '主营品牌',
prop: "score", prop: "brandList",
formatter (row) { formatter (row) {
return row.score != null ? row.score : '-' return
} }
}, { }, {
label: '业务性质', label: '业务性质',
prop: "defencePoint", prop: "businessScenario",
formatter (row) { formatter (row) {
return row.defencePoint != null ? row.defencePoint : '-' return {
1: '直营渠道',
2: '直营4S店',
4: '投资收购-利丰',
5: '投资收购-内蒙古',
6: '服务商投资',
}[row.businessScenario] || '-'
} }
}, { }, {
label: '门店范围',
prop: "customerTypeName",
width: '130',
}, {
label: '产值', label: '产值',
width: '150', width: '150',
prop: "startTime" prop: "output",
sortable: true,
addHtml: 'sortableHtml'
}, { }, {
label: '订单数', label: '订单数',
width: '150', width: '150',
prop: "endTime" prop: "orderNumber",
sortable: true,
addHtml: 'sortableHtml'
}, { }, {
label: '客单价', label: '客单价',
width: '130', width: '130',
prop: "seconds", prop: "customerUnitPrice",
sortable: true,
addHtml: 'sortableHtml'
}, { }, {
label: '渗透率', label: '渗透率',
prop: "axbOpenFlag", prop: "penetrationRate",
width: 130, width: 130,
formatter (row) { sortable: true,
return row.axbOpenFlag ? "是" : "否" addHtml: 'sortableHtml'
}
}, },
{ {
label: '触客转化率', label: '触客转化率',
prop: "isFinishFlag", prop: "touchConversionRate",
sortable: true,
width: 130, width: 130,
formatter (row) { addHtml: 'sortableHtml'
return row.finishFlag ? "是" : "否"
}
} }
] ]
}, },
...@@ -132,24 +154,25 @@ export default { ...@@ -132,24 +154,25 @@ export default {
}, },
methods: { methods: {
async search () { async search () {
const { total, list } = await warningMsgDetailListWithPage({ this.tableData = []
...this.page, const res = await getBoardMerchantList({
monitorType: 2, // 预警数据 1.员工 2.门店 ...this.searchForm
}) })
this.tableData = list console.log(res)
this.tableTotal = total this.tableData = res
// this.tableTotal = total
}, },
handleDetail (e) { handleDetail (e) {
this.$emit('openWindow', { this.$emit('openWindow', {
...e, ...e,
pageId: `merchant-${e.merchantId4s}`, pageId: `merchant-${e.merchantId}`,
componentName: 'shop-detail', componentName: 'shop-detail',
tabTitle: `${e.merchantName4s}门店详情`, tabTitle: `${e.merchantName}门店详情`,
merchantId: e.merchantId4s, merchantId: e.merchantId,
merchantName: e.merchantName4s merchantName: e.merchantName
}) })
}, },
pageChange(e){ pageChange (e) {
this.page = e this.page = e
this.search() this.search()
} }
......
...@@ -4,9 +4,10 @@ export default { ...@@ -4,9 +4,10 @@ export default {
initStatus: false, initStatus: false,
} }
}, },
props:{ props: {
show: Boolean, show: Boolean,
searchForm:Object searchForm: Object,
refreshFlag: Boolean
}, },
mounted () { mounted () {
let search = this.search let search = this.search
...@@ -18,9 +19,10 @@ export default { ...@@ -18,9 +19,10 @@ export default {
show: { show: {
async handler (newVal) { async handler (newVal) {
if (newVal) { if (newVal) {
if (!this.initStatus) { if (!this.initStatus || this.refreshFlag) {
await this.search() await this.search()
this.initStatus = true this.initStatus = true
this.$emit('update:refreshFlag', false)
} }
} }
}, },
......
export const KpiList = {
'A014': {
}
}
\ No newline at end of file \ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
class="board-item" class="board-item"
:item="item" :item="item"
:data="boardData" :data="boardData"
@click="openWindow(item)"
/> />
</template> </template>
</div> </div>
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
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'
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
...@@ -52,40 +53,28 @@ export default { ...@@ -52,40 +53,28 @@ export default {
boardData: { boardData: {
outputTrend: [] outputTrend: []
}, },
boardList: [ boardList: [],
{
name: '总产值',
value: 'output',
percent: 'outputRatio',
unit: '(元)'
}
}, },
{ watch: {
name: '客单价', pageData: {
value: 'customerUnitPrice', handler (newVal) {
percent: 'customerUnitPriceRatio',
unit: '(元)'
},
{
name: '交车数',
value: 'deliveryNum',
percent: 'deliveryNumRatio',
},
{
name: '触客数',
value: 'touchCustomers',
percent: 'touchCustomersRatio',
},
{
name: '转化数',
value: 'conversionNum',
percent: 'conversionNumRatio',
},
],
// 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 () {
...@@ -100,6 +89,36 @@ export default { ...@@ -100,6 +89,36 @@ export default {
if (res[key] == null) res[key] = '-' if (res[key] == null) res[key] = '-'
}) })
this.boardData = res this.boardData = res
this.getBoardList()
},
async getBoardList () {
this.boardList = this.$options.data.call(this).boardList
let { merchantId, merchantName, businessType } = this.pageData,
{ searchTime: { startDate, endDate } } = this
const res = await getBoardList({
businessType,
merchantId,
startDate,
endDate,
scope: 2
})
res.map(e => {
this.boardList.push({
componentName: 'boardDetail',
pageId: `board-${e.code}`,
tabTitle: `${e.name}(${merchantName})`,
definition: e.definition,
code: e.code,
name: e.name,
businessType,
data: e,
value: 'value',
percent: 'ratio'
})
})
},
openWindow (e) {
this.$emit('openWindow', e)
} }
} }
} }
...@@ -119,6 +138,7 @@ export default { ...@@ -119,6 +138,7 @@ export default {
gap: 0 16px; gap: 0 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;
......
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
></quality-detail> ></quality-detail>
<pointer-config <pointer-config
:show.sync="dialogShow" :show.sync="dialogShow"
:scope="2"
@update="$emit('update')" @update="$emit('update')"
/> />
</div> </div>
......
...@@ -107,48 +107,48 @@ export default { ...@@ -107,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}详情`
}) })
}, },
......
...@@ -124,7 +124,7 @@ export default { ...@@ -124,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
......
...@@ -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
<template>
<d2-dialog
:title="title"
:is-visible.sync="selectGoodsVisible"
width="70%"
btn-ok-label="确定"
@confirmDialog="handleSelectGoodsConfirm"
@closeDialog="handleSelectGoodsClose"
class="selectGoods">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'100px'"
:form-data="showFormData">
<template slot="commodityCode">
<el-input :style="{ width: '100%'}"
placeholder="请输入商品ID"
v-model.trim="searchForm['commodityCode']"
:clearable="true"
:maxlength="50"
@input="event => searchInput(event, 'commodityCode')" />
</template>
<template slot="type">
<el-input :style="{ width: '100%'}"
placeholder="请输入商品编码"
v-model.trim="searchForm['type']"
:clearable="true"
:maxlength="50"
@input="event => searchInput(event, 'type')" />
</template>
<template slot="thirdPartyCode">
<el-input :style="{ width: '100%'}"
placeholder="请输入第三方编码"
v-model.trim="searchForm['thirdPartyCode']"
:clearable="true"
:maxlength="50"
@input="event => searchInput(event, 'thirdPartyCode')" />
</template>
<template slot="baseGoodsCommodityCode">
<el-input :style="{ width: '100%'}"
placeholder="请输入系列ID"
v-model.trim="searchForm['baseGoodsCommodityCode']"
:clearable="true"
:maxlength="50"
@input="event => searchInput(event, 'baseGoodsCommodityCode')" />
</template>
<template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;"
v-model="tempGoodsType" :placeholder="'请选择'" filterable
@change="selectAddAttr($event)" clearable
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }">
</el-cascader>
</template>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
</div>
<d2-table ref="groundingIndexTable"
:has-num="false"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<template slot="select_btn" slot-scope="scope">
<el-radio v-model="selectedRowId" :label="scope.scope.id" :disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)">{{ '' }}</el-radio>
</template>
</d2-table>
</d2-dialog>
</template>
<script>
import { getUpgradeProductList } from '@api/productManage'
import { getAllCategory } from '@api/product'
import { filterSpecsStr } from '../filterOption'
export default {
name: 'SelectGoodsDialog',
props: {
title: {
type: String,
default: "选择商品"
},
selectGoodsVisible: {
type: Boolean,
default: false
},
upgradeGoodsId: {},
packageSelectIds: {}
},
data() {
return {
getListApi: getUpgradeProductList,
showFormData: [{
label: '商品名称',
name: 'upgradeGoodsName',
type: 'input',
maxlength: 50,
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商品ID',
name: 'commodityCode',
addHtml: 'commodityCode'
}, {
label: '规格',
name: 'specificationData',
type: 'input',
maxlength: 50,
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商品编码',
name: 'type',
addHtml: 'type'
}, {
label: '第三方编码',
name: 'thirdPartyCode',
addHtml: 'thirdPartyCode'
}, {
label: '适用车型',
name: 'carTypeSearch',
type: 'input',
maxlength: 50,
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '所属系列',
name: 'goodsName',
type: 'input',
maxlength: 50,
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '系列ID',
name: 'baseGoodsCommodityCode',
addHtml: 'baseGoodsCommodityCode'
}, {
label: '所属分类',
name: 'goodsType',
addHtml: 'goodsCascader'
}],
searchForm: {
upgradeGoodsName: '',
commodityCode: '',
specificationData: '',
type: '',
thirdPartyCode: '',
carTypeSearch: '',
goodsName: '',
baseGoodsCommodityCode: ''
},
tempGoodsType: [],
baseData: {
productTypeList: [],
productList: []
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [{
label: '',
width: '60',
addHtml: 'select_btn'
}, {
label: '序号',
prop: 'ownSerialNum',
type: 'ownSerialNum',
width: '60'
}, {
label: '商品名称',
prop: 'upgradeGoodsName',
width: 150,
formatter: (cellValue) => {
return cellValue.upgradeGoodsName || '-'
}
}, {
label: '商品ID',
prop: 'commodityCode',
width: 180,
formatter: (cellValue) => {
return cellValue.commodityCode || '-'
}
}, {
label: '规格',
prop: 'specificationData',
formatter: (cellValue) => {
return this.filterSpecsStr(cellValue)
}
}, {
label: '商品编码',
prop: 'type',
formatter: (cellValue) => {
return cellValue.type || '-'
}
}, {
label: '第三方编码',
prop: 'thirdPartyCode',
width: 100,
formatter: (cellValue) => {
return cellValue?.thirdPartyCode || '-'
}
}, {
label: '适用车型',
prop: '',
formatter: (cellValue) => {
return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join('/') : '-'
}
}, {
label: '所属系列',
prop: 'goodsName',
formatter: (cellValue) => {
return cellValue?.goodsInfo?.goodsName || '-'
},
width: 140
}, {
label: '系列ID',
prop: 'baseGoodsCommodityCode',
width: 170
}, {
label: '所属分类',
prop: 'goodsTypeName',
formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo || {}
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
return result
},
width: 170
}]
},
selectedRowId: '',
filterSpecsStr // 处理规格单位
}
},
mounted() {
this.selectedRowId = this.upgradeGoodsId
// 获取全部类目 屏蔽服务商自建类目
getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
this.baseData.productTypeList = res?.list || []
})
},
methods: {
searchInput(e, key) {
if (!/^[a-zA-Z0-9]*$/.test(e)) {
this.searchForm[key] = e.replace(/[^a-zA-Z0-9]/g, '')
}
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
setTableFinishFun(data) {
this.tableData = data
},
selectAddAttr(value) {
this.searchForm.goodsType = value?.[0]
this.searchForm.secondaryGoodsType = value?.[1]
this.searchForm.thirdLevelGoodsType = value?.[2]
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleSelectGoodsConfirm() {
let selectData = this.tableData?.find(v => v.id == this.selectedRowId)
if (!selectData) return this.$message.warning('请选择商品')
this.$emit('handleSelectGoodsConfirm', selectData)
},
handleSelectGoodsClose() {
this.$emit('handleSelectGoodsClose')
},
handleReset() {
this.searchForm = {
upgradeGoodsName: '',
commodityCode: '',
specificationData: '',
type: '',
thirdPartyCode: '',
carTypeSearch: '',
goodsName: '',
baseGoodsCommodityCode: ''
}
this.tempGoodsType = []
// 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true)
},
}
}
</script>
<style lang="scss" scoped>
.show-search {
::v-deep .d2-search-block {
padding: 0;
}
}
</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)
}
} }
}) })
}, },
......
...@@ -4,19 +4,24 @@ ...@@ -4,19 +4,24 @@
<div class="content-box"> <div class="content-box">
<div class="sync_type_class"> <div class="sync_type_class">
<span class="label"><span class="color-red">*</span>使用模式:</span> <span class="label"><span class="color-red">*</span>使用模式:</span>
<el-radio-group v-model="goodsInfoData.shoppingMallFlag"> <el-radio-group v-model="goodsInfoData.shoppingMallFlag" :disabled="pageData.pageDisabled">
<el-radio :label="'1'">采购上架及分发至单店</el-radio> <el-radio :label="'1'">采购上架及分发至单店</el-radio>
<el-radio :label="'0'">仅分发至单店</el-radio> <el-radio :label="'0'">仅分发至单店</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div style="margin-left: 120px;"> <div style="margin-left: 120px;">
<div class="add-btns"> <div class="add-btns">
<el-button icon="el-icon-plus" v-if="goodsInfoData.specificationType == '2'" <div v-if="goodsInfoData.specificationType == '2'">
<el-button icon="el-icon-plus"
type="primary" plain
:disabled="goodsInfoData.scrmFlag == 'Y' || pageData.pageDisabled"
@click="handleSpecsEdit(1)">新增规格</el-button> @click="handleSpecsEdit(1)">新增规格</el-button>
<el-button icon="el-icon-plus" v-if="goodsInfoData.specificationType == '1'" @click="addShop">新增商品</el-button> <el-button :disabled="goodsInfoData.scrmFlag == 'Y' || pageData.pageDisabled" type="primary" plain @click="handleSpecsManage">规格组合管理</el-button>
</div>
<el-button icon="el-icon-plus" :disabled="pageData.pageDisabled" v-if="goodsInfoData.specificationType == '1'" type="primary" plain @click="addShop">新增商品</el-button>
<div class="assi_type"> <div class="assi_type">
<span>规格:</span> <span>规格:</span>
<el-radio-group v-model="goodsInfoData.specificationType" @change="changeRadio"> <el-radio-group v-model="goodsInfoData.specificationType" :disabled="goodsInfoData.scrmFlag == 'Y' || pageData.pageDisabled" @change="changeRadio">
<el-radio :label="'1'">单规格</el-radio> <el-radio :label="'1'">单规格</el-radio>
<el-radio :label="'2'">多规格</el-radio> <el-radio :label="'2'">多规格</el-radio>
</el-radio-group> </el-radio-group>
...@@ -47,6 +52,7 @@ export default { ...@@ -47,6 +52,7 @@ export default {
singleSpecificationForm, singleSpecificationForm,
multipleSpecificationForm multipleSpecificationForm
}, },
inject: ['pageData'],
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
...@@ -85,6 +91,10 @@ export default { ...@@ -85,6 +91,10 @@ export default {
handleSpecsEdit(num) { handleSpecsEdit(num) {
this.$refs.multipleSpecificationFormRef.handleSpecsEdit(num) this.$refs.multipleSpecificationFormRef.handleSpecsEdit(num)
}, },
// 规格管理
handleSpecsManage() {
this.$refs.multipleSpecificationFormRef.handleSpecsManage()
},
// 新增商品 // 新增商品
addShop() { addShop() {
this.$refs.singleSpecificationFormRef.addShop() this.$refs.singleSpecificationFormRef.addShop()
......
<template>
<d2-dialog
title="规格组合管理"
:is-visible.sync="specsManageVisible"
width="70%"
btn-ok-label="确定"
@confirmDialog="handleSpecsManageConfirm"
@closeDialog="handleSpecsManageClose"
class="specsManage">
<div class="serach-item" v-for="(item, index) in specificationData" :key="index">
<span class="label">{{ `${item.specificationName}:` }}</span>
<el-select v-model="item.selected" collapse-tags multiple placeholder="请选择">
<el-option v-for="(subItem, subIndex) in item.specificationValueList"
:key="subIndex"
:label="subItem.specificationValue"
:value="subItem.specificationValue"></el-option>
</el-select>
</div>
<el-button type="primary" @click="handleSearch">搜索</el-button>
<div class="btn_content">
<el-button type="primary" plain @click="handleBatchUpdateStatus(1)">批量启用</el-button>
<el-button type="primary" plain @click="handleBatchUpdateStatus(2)">批量禁用</el-button>
</div>
<el-table ref="seletingTable"
:data="tableData"
height="380px"
class="table"
@select="handleChange"
@select-all="handleAll"
border>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号"
align="center"
type="index"
width="55" />
<el-table-column
v-for="(item, index) in specificationData"
:key="index"
:label="item.specificationName"
:show-overflow-tooltip="true"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.specsValueList[index] }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span :class="{ 'greenSpot': scope.row.statusFlag != 2, 'redSpot': scope.row.statusFlag == 2 }"></span>
<span>{{ scope.row.statusFlag == 2 ? '禁用中' : '启用中' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100px">
<template slot-scope="scope">
<el-button
@click="handleUpdateStatus(scope.row)"
type="text">{{ scope.row.statusFlag != 2 ? '禁用' : '启用' }}</el-button>
</template>
</el-table-column>
</el-table>
</d2-dialog>
</template>
<script>
import { deepClone } from '@/common/util'
export default {
name: 'SpecsManage',
props: {
specsManageVisible: {
type: Boolean
},
specificationDetailList: {
type: Array
},
goodsList: {
type: Array
}
},
data () {
return {
carSeriesSearchForm: {},
specificationData: [],
tableData: [],
selectedData: []
}
},
mounted () {
this.specificationData = deepClone(this.specificationDetailList)
this.specificationData.forEach(item => {
this.$set(item, 'selected', [])
})
this.initTableData(true)
},
methods: {
handleSearch() {
this.selectedData = []
this.tableData = []
this.initTableData()
const spliceIndex = this.tableData.reduce((indices, item, index) => {
this.specificationData.forEach((spec) => {
if (spec.selected?.length > 0 && !spec.selected.includes(item.specsValueList[this.specificationData.indexOf(spec)])) {
indices.push(index)
}
})
return indices
}, [])
this.tableData = this.tableData.filter((_, index) => !spliceIndex.includes(index))
},
initTableData(loadFlag) {
this.tableData = deepClone(this.goodsList)
this.tableData = this.specificationData.reduce((acc, spec, i) => {
const values = spec.specificationValueList.map(v => v.specificationValue)
if (i === 0) {
return values.map(value => ({ specsValueList: [value], statusFlag: 1 }))
}
const newAcc = []
acc.forEach(item => {
values.forEach(value => {
newAcc.push({ ...item, specsValueList: [...item.specsValueList, value] })
})
})
return newAcc
}, [])
if (loadFlag) {
this.tableData?.forEach(v => {
this.goodsList?.forEach(item => {
if (v?.specsValueList?.join(';~;') == item?.specsValueList?.join(';~;')) v.statusFlag = item.statusFlag || 1
})
})
}
this.updateTableDataStatus()
this.copyTableData = deepClone(this.tableData)
},
updateTableDataStatus() {
this.copyTableData?.forEach(copyItem => {
this.tableData.forEach(item => {
if (copyItem.specsValueList.join(';~;') === item.specsValueList.join(';~;')) {
item.statusFlag = copyItem.statusFlag
}
})
})
},
handleAll(selection) {
this.selectedData = selection.length ? [...this.tableData] : []
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(
(item) => item.specsValueList?.join(';~;') == row.specsValueList?.join(';~;')
)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.specsValueList?.join(';~;') != row.specsValueList?.join(';~;')
))
},
handleUpdateStatus(item) {
const toggleStatus = (v) => {
if (v.specsValueList.join(';~;') === item.specsValueList.join(';~;')) {
v.statusFlag = v.statusFlag != 2 ? 2 : 1
}
}
this.tableData.forEach(toggleStatus)
this.copyTableData.forEach(toggleStatus)
},
handleBatchUpdateStatus(statusFlag) {
if (!this.selectedData.length) {
return this.$message({
message: '请选择要操作的数据',
type: 'warning',
customClass: 'message-Z-zinde'
})
}
if (this.selectedData.some(v => v.statusFlag == statusFlag)) {
return this.$message({
message: `请勾选${statusFlag != 2 ? '禁用中' : '启用中'}的规格组合结果`,
type: 'warning',
customClass: 'message-Z-zinde'
})
}
const updateStatus = (v) => {
this.selectedData.forEach(item => {
if (v.specsValueList.join(';~;') === item.specsValueList.join(';~;')) {
v.statusFlag = statusFlag
}
})
}
this.tableData.forEach(updateStatus)
this.copyTableData.forEach(updateStatus)
},
handleSpecsManageConfirm() {
this.$emit('handleSpecsManageConfirm', this.copyTableData)
},
handleSpecsManageClose () {
this.$emit('handleSpecsManageClose')
}
}
}
</script>
<style lang="scss" scoped>
.specsManage{
.serach-item{
display: inline-block;
margin-right: 10px;
margin-bottom: 15px;
}
.label{
display: inline-block;
}
.btn_content{
margin: 20px 0;
}
.greenSpot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #2cca74;
margin-right: 5px;
display: inline-block;
}
.redSpot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #eb4e4e;
margin-right: 5px;
display: inline-block;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<auth-button category="Button" :show-btn-ids="['9030701']" /> <auth-button category="Button" :show-btn-ids="['9030701']" />
</span> </span>
<!-- 批量导入 --> <!-- 批量导入 -->
<auth-button category="Button" style="display: inline-block;" :show-btn-ids="['9030707']" /> <!-- <auth-button category="Button" style="display: inline-block;" :show-btn-ids="['9030707']" /> -->
</span> </span>
<!-- 导出 --> <!-- 导出 -->
<auth-button category="Button" style="display: inline-block" :show-btn-ids="['9030702']" /> <auth-button category="Button" style="display: inline-block" :show-btn-ids="['9030702']" />
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<span style="margin-right: 10px;"> <span style="margin-right: 10px;">
<auth-button :data="scope.scope" :show-btn-ids="['9030703']" /> <auth-button :data="scope.scope" :show-btn-ids="['9030703']" />
</span> </span>
<auth-button :data="scope.scope" <auth-button :data="scope.scope" v-if="scope.scope.goodsInfo.scrmFlag != 'Y'"
:show-btn-ids="['9030706']" /> :show-btn-ids="['9030706']" />
</div> </div>
</d2-table> </d2-table>
...@@ -210,7 +210,7 @@ export default { ...@@ -210,7 +210,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
......
<!-- 驳回 -->
<template>
<baseDialog :dialog-config="dialogConfig"
:is-show.sync="visible"
class="accountDailog"
@handleClick="handleAddConfirm">
<div class="reject-dialog">
<glsx-combi-form class="edit-form-container"
ref="formRef"
label-width="150px"
default-width="350px"
:form-ref="rejectRef"
:form-obj="infoForm"
:form-data="editFormData"
:form-rules="formRules"></glsx-combi-form>
</div>
</baseDialog>
</template>
<script>
import {
reject
} from "@api/shelfManage.js"
export default {
name: 'RejectDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
remark: ''
},
dialogConfig: {
title: '驳回',
width: '600px'
},
rejectRef: 'rejectRef',
formRules: {
remark: [{ required: true, message: '请输入驳回原因', trigger: 'blur' }]
},
editFormData: [{
label: '驳回原因',
name: 'remark',
type: 'input',
maxlength: 50,
inputType: 'textarea',
showLimit: true,
rows: 4
}],
baseData: {
}
}
},
props: {
rejectVisible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: {}
}
},
computed: {
visible: {
get() {
return this.rejectVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'rejectVisible' })
}
}
},
mounted() {
console.log('paramsObj', this.paramsObj)
},
methods: {
handleAddConfirm() {
this.$refs.formRef.$refs[this.rejectRef].validate(valid => {
if (valid) {
var params = {}
params.rejectedReason = this.infoForm.remark
params.id = this.paramsObj.id
reject(params).then(res => {
this.notice.okTips('操作成功')
this.visible = true
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin: 65px 0;
.reject-input {
::v-deep .el-textarea__inner {
height: 70px;
}
}
.el-textarea .el-input__count {
right: 90px;
bottom: -10px;
font-size: 12px;
color: #999999;
}
.tips {
color: #999999;
}
}
</style>
<!-- 查看 - 对账配置 --> <!-- 查看 - 对账配置 -->
<template> <template>
<div class="edit-page finance-config"> <div class="edit-page finance-config">
<div class="title"> <div class="title">
<span>对账配置</span> <span>对账配置</span>
</div> </div>
<div style="padding: 20px;"> <div style="padding: 20px">
<div>啦啦啦</div> <el-tabs v-model="editableTabsValue" type="card" class="my-tab-pane">
<el-tab-pane
v-for="(item, index) in editableTabs"
:key="index"
:label="item.title"
:name="item.name"
>
<div class="classificationCptContainer">
<el-form label-suffix=":" label-width="154px">
<el-form-item label="分账品类">
{{
financialObj[editableTabsValue].categoryType || "--"
}}</el-form-item
>
<el-form-item label="">
{{
financialObj[editableTabsValue].packageArrText
}}</el-form-item
>
<template
v-for="(item, index) in financialObj[editableTabsValue]
.expenseCategoryTypeRules"
>
<el-form-item :key="index" :label="item.expenseCategoryName">
<span>{{
getExpenseCategoryCalculateType(
item.expenseCategoryCalculateType,
item.expenseCategoryValue
)
}}</span>
</el-form-item>
</template>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { deepClone } from "@/common/util"
export default { export default {
name: 'FinanceConfig', name: "FinanceConfig",
props: {}, props: {
financeObj: {
type: Object,
default: () => {}
}
},
watch: {
financeObj: {
handler(val, oldVal) {
if (val) {
this.initData(val)
}
},
immediate: true,
deep: true
}
},
data() { data() {
//这里存放数据 //这里存放数据
return { return {
editableTabsValue: "1",
editableTabs: [],
financialObj: []
}
},
methods: {
getExpenseCategoryCalculateType(value, num) {
if (!value || num == null) {
return "-"
} }
// console.log('num: ', num)
let res
switch (value) {
case 1:
res = "按毛利比例:"
break
case 2:
res = "按收入比例:"
break
case 3:
res = "按固定金额:"
break
case 4:
res = "按(产值-流量成本):"
break
case 5:
res = "按(产值-流量成本-其他费用不包含产品成本):"
break
case 6:
res = "按(产值-流量成本-其他费用包含产品成本):"
break
case 8:
res = "按(收入-自定义其他费用):"
break
case 9:
res = "按(收入-其他费用):"
break
case 10:
res = `按固定金额${num}元*购买数量`
break
}
res = value == 10 ? res : res + num + (value == 3 ? "元" : "%")
return res
},
initData(data) {
const typeList = data.goodsTypeGroupReconciliationRules
this.editableTabs=[]
typeList.forEach((item, index) => {
const upgradeArr = []
const packageArr = []
const textArr = []
this.editableTabs.push({
title: "特殊品类" + (index + 1),
name: (index + 1).toString()
})
// 按具体商品
if (
item.goodsTypeGroupRelations?.length &&
item.goodsTypeGroupRelations[0]?.categoryType == 2
) {
item.upgradeGoods = deepClone(item.goodsTypeGroupRelations)
item.categoryType = "按具体商品"
item.goodsTypeGroupRelations.forEach((val) => {
upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName,
commodityCode: val.commodityCode
})
textArr.push(val.upgradeGoodsName)
})
item.packageArrText = textArr.join(",")
item.goodsTypeGroupRelations = []
}
// 按套餐商品
if (
item.goodsTypeGroupRelations?.length &&
item.goodsTypeGroupRelations[0]?.categoryType == 3
) {
item.packageGoods = deepClone(item.goodsTypeGroupRelations)
item.categoryType = 3
item.categoryType = "按套餐商品"
item.goodsTypeGroupRelations.forEach((val) => {
packageArr.push({
packageCode: val.packageCode,
packageName: val.packageName
})
textArr.push(val.packageName)
})
item.packageArrText = textArr.join(",")
item.goodsTypeGroupRelations = []
}
if (
item.goodsTypeGroupRelations?.length &&
item.goodsTypeGroupRelations[0]?.categoryType == 1
) {
item.goodsTypeGroupRelations = deepClone(item.goodsTypeGroupRelations)
item.categoryType = 1
item.categoryTypeText = "按商品分类"
item.goodsTypes?.forEach((val) => {
textArr.push(val.upgradeGoodsName)
})
item.packageArrText = textArr.join(",")
item.upgradeGoods = []
}
})
this.financialObj = typeList
this.filterData(typeList)
}, },
methods: {}, filterData() {
}; let arrIdx = [1100, 810, 809, 807, 811]
this.financialObj.forEach((item) => {
item.expenseCategoryTypeRules = []
item.expenseCategoryRules.forEach((type) => {
if (arrIdx.includes(type.expenseCategoryId)) {
if (type.expenseCategoryId == 1100) type.expenseCategoryName = "一线阳光激励费"
if (type.expenseCategoryId == 809) type.expenseCategoryName = "一线阳光2激励费"
item.expenseCategoryTypeRules.push(type)
}
})
this.$set(item, "expenseCategoryTypeRules", item.expenseCategoryTypeRules)
})
console.log(this.financialObj,76666)
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../../style/editdetailCon.scss"; @import "../../style/editdetailCon.scss";
......
<template>
<el-drawer title="新增商户" :visible.sync="addMerVisible" size="50%" direction="rtl" :wrapperClosable="wrapperClosable" :before-close="handleClose">
<div class="">
<glsx-combi-form class="edit-form-container" ref="addFormRef" :isBlock="isBlock" label-width="150px" default-width="400px" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
<ProvinceCity slot="provinceCity" ref="provinceForm" :subdistrict="subdistrict" @selectProvince="selectProvince" @selectCity="selectCity" :detailAddressLabel="detailAddressLabel" @selectAddressByMap="selectAddressByMap"></ProvinceCity>
<select-brand slot="selectBrand" :brandListTree="brandListTree" @clickBrand="clickBrand" ref="brandListTree"></select-brand>
</glsx-combi-form>
</div>
</el-drawer>
</template>
<script>
import SelectBrand from '@/components/SelectBrand/index.vue'
import ProvinceCity from '@/components/province-city/index.vue'
export default {
name: 'AddMerchant',
components: {
ProvinceCity,
SelectBrand
},
props: {
addMerVisible: false
},
data() {
//这里存放数据
return {
wrapperClosable: false,
// 地址
subdistrict: 2,
detailAddressLabel: ' ',
// 品牌
brandListTree: [],
isFirstBrand: false,
// 表单
isBlock: true,
editChildRef: 'editChildRef',
formRules: {},
editData: {},
editFormData: [{
name: '',
label: '商户类型',
type: 'radio',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'merchantList',
optionList: [],
// isDisabled: false,
// style: { width: '520px' },
handleRadioChange: () => { }
}, {
label: "账户等级",
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'accountLevelList'
}, {
label: "上级商户",
name: 'parentMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'parentMerchantList'
}, {
label: "渠道",
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: ''
}, {
label: "选择开通模式",
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: ''
}, {
label: '商户名称',
name: '',
type: 'input',
maxlength: 50
}, {
label: '联系电话',
name: '',
type: 'input',
maxlength: 11
}, {
label: '',
name: '',
addHtml: 'provinceCity'
}, {
label: '主营品牌',
name: '',
addHtml: 'selectBrand'
}, {
label: '登录账号',
name: '',
type: 'input',
maxlength: 15
}, {
label: '登录密码',
name: '',
type: 'input',
maxlength: 20
}],
baseData: {
merchantList: [],
accountLevelList: [],
parentMerchantList: []
}
}
},
//方法集合
methods: {
handleClose() {
this.$emit('handleClose')
},
checkBrandList() {
// let merchantBrandMain = chant.filter(item => item)
// this.$set(this.editData, 'merchantBrandMain', merchantBrandMain)
if (!this.editData.merchantBrandMain) {
this.editData.merchantBrandMain = []
}
this.brandList()
// this.$refs.brandListTree.getCheckList(this.editData.merchantBrandMain)
},
async brandList() {
this.$refs.brandListTree.loading = true
const brandListTree = await this.$apis.baseInfo.brandList({})
brandListTree.forEach(item => {
let child = item.children
if (!child) return
child.forEach(k => {
delete k.children
})
})
this.brandListTree = brandListTree
this.$refs.brandListTree.getCheckList(this.editData.merchantBrandMain)
this.$nextTick(() => {
this.$refs.brandListTree.loading = false
})
},
// 点击主营品牌
clickBrand(val) {
if (!this.isFirstBrand) {
// this.brandList()
this.isFirstBrand = true
}
},
// 当直接点击选择地址时,获取省市ID
init(province, city) {
this.$refs.provinceForm.init(province, city)
},
// 获取省
selectProvince(val) {
console.log(val)
this.$set(this.editData, 'merchantAddress', '')
// 强制更新 merchantAddress
this.$forceUpdate()
this.editData.cityName = ''
this.editData.provinceName = val.name
this.editData.provinceCode = val.adcode
},
// 获取市
selectCity(val) {
console.log(val)
if (val.name) {
this.editData.cityName = val.name
this.editData.cityCode = val.adcode
} else {
this.editData.cityName = ''
this.editData.cityCode = ''
}
this.$set(this.editData, 'merchantAddress', '')
this.$forceUpdate()
},
// 通过地图选择省市和详细地址
selectAddressByMap(val) {
console.log(val)
const { provinceName, cityName, fullAddress, lat, lng } = val
this.editData.merchantAddress = fullAddress
this.editData.provinceName = provinceName
this.editData.cityName = cityName
this.editData.lat = lat
this.editData.lng = lng
},
}
};
</script>
<style scoped>
</style>
<!-- 2 - 分账金额设置 -->
<template>
<div class="division-rule">
<el-form
class="formSty"
ref="divisionRuleRef"
:model="form"
:rules="rules"
label-suffix=":"
label-width="180px"
>
<el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block">
<tr class="tableHeader">
<td>分账对象/分账类目</td>
<!-- <td>平台方分账金额</td> -->
<td v-for="(item, index) in radioList" :key="index">
{{ item.applicationObjectName||item.expenseCategoryName }}
</td>
</tr>
<tr>
<td class="merchantNameTd p-b-20">
<p
:title="item | filterMerchantType"
v-for="(item, index) in tableSelectOptions"
:key="index"
>
{{ item | filterMerchantType }}
</p>
</td>
<td
class="p-b-20"
v-for="(item, index) in radioList"
:key="index + 'radioList'"
>
<el-form-item
label-width="0"
:prop="`id${item.expenseCategoryId}`"
:rules="[
{
required: true,
message: `请选择${item.applicationObjectName}`,
trigger: 'change'
}
]"
>
<el-radio-group
v-model="form['id' + item.expenseCategoryId]"
@change="
(e) => handleClearValid(e, 'id' + item.expenseCategoryId)
"
>
<el-radio
v-for="(el, index) in tableSelectOptions"
:key="index"
:label="+el.merchantId"
/>
</el-radio-group>
</el-form-item>
</td>
</tr>
</table>
</el-form-item>
</el-form>
</div>
</template>
<script>
// import { userType } from '@/common/constants'
export default {
name: "TableAccount",
props: {
// 列选项
classificationObjSelect: {
type: Object,
default: () => {}
},
merchantDistributionRules: {
type: Array,
default: () => {
return []
}
},
// 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户
tableSelectOptions: {
type: Array,
default: () => []
}
},
filters: {
// 过滤商户类型
filterMerchantType(val) {
const name = {
1: "平台方",
2: "服务商",
3: "流量方",
4: "平台方"
}
const type = val.targetMerchantType
return `${name[type]}: ${val.merchantName}`
}
},
data() {
return {
form: {
// settleTimeType: 1
},
platformSideLabel: 0,
merchantAccountInfo: {},
partnerSettleAccountModel: "",
djDivisionDefalut: 1,
rules: {},
// 导流方下拉选项对应
attrToVal: [
{
confId: 3,
confLabel: "city"
},
{
// confId: 4,
confId: 2,
confLabel: "province"
},
{
// confId: 5,
confId: 1,
confLabel: "factory"
}
],
realityShopMerchant: {
merchantId: "",
merchantName: "",
userType: ""
},
baseData: {
merchantLevelList: [],
PlatformLevelList: []
}
}
},
computed: {
radioList: function () {
const obj = this.classificationObjSelect
let list = [],
arr = [],
arrIdx = [1, 2, 302, 701, 4]
for (const key in obj) {
obj[key].map((item) => {
if (arrIdx.includes(item.id)||arrIdx.includes(item.expenseCategoryId)) {
list.push(item)
}
})
}
arr = list.filter((item) => {
return arrIdx.includes(item.id)||arrIdx.includes(item.expenseCategoryId)
})
return arr
}
},
watch: {
classificationObjSelect: {
handler() {
this.initList()
},
deep: true,
immediate: true
},
merchantDistributionRules: {
handler() {
this.initList()
},
deep: true
// immediate: true
},
tableSelectOptions: {
handler() {
// this.initList()
this.changFormList()
},
deep: true
// immediate: true
}
},
mounted() {},
methods: {
initList() {
// console.log('initList')
// this.merchantDistributionRules
// console.log(this.merchantDistributionRules)
const obj = this.classificationObjSelect
const form = {}
console.log('obj', obj)
for (const key in obj) {
obj[key].map((item) => {
// 数字转字符串
const name = "id" + item.expenseCategoryId
// console.log(name, item.id || item.expenseCategoryId, 'item.id')
// 做回显用数据
const findObj = this.merchantDistributionRules.find((el) => {
return el.expenseCategoryId == item.expenseCategoryId
})
// 还要跟存在现在的选项里面
// console.log('findObj', findObj)
// console.log(name)
// const optIndex = this.tableSelectOptions.findIndex((opt) => { return opt.merchantId == findObj?.merchantId })
// console.log(optIndex, 'optIndex')
form[name] = parseInt(findObj?.merchantId) || ""
})
}
// 判断id是否有在选项里面 没有就去掉
this.form = form
},
changFormList() {
console.log(this.form,'this.form')
// 判断id是否有在选项里面 没有就去掉
for (const key in this.form) {
const element = this.form[key]
this.tableSelectOptions.findIndex((opt) => {
return opt.merchantId == element
}) == -1 && (this.form[key] = "")
}
},
handleClearValid(e, validField) {
this.$forceUpdate()
// this.handleConfirm()
// console.log('validField', validField)
this.$refs.divisionRuleRef.clearValidate(validField)
},
handleConfirm() {
// console.log(this.merchantInfo)
return new Promise((resolve, reject) => {
this.$refs.divisionRuleRef.validate((valid) => {
if (valid) {
// this.form
const merchantDistributionRules = this.radioList.reduce(
(prev, next) => {
const id = this.form["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
(item) => item.merchantId == id
)
// console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
},
[]
)
resolve(merchantDistributionRules)
} else {
resolve(false)
}
})
})
},
getTableAccountParams() {
const merchantDistributionRules = this.radioList.reduce((prev, next) => {
const id = this.form["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
(item) => item.merchantId == id
)
// console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
}, [])
return merchantDistributionRules
// console.log(this.merchantInfo)
// return new Promise((resolve, reject) => {
// this.$refs.divisionRuleRef.validate(valid => {
// if (valid) {
// // this.form
// } else {
// resolve(false)
// }
// })
// }
// )
}
}
}
</script>
<style scoped lang="scss">
.formSty {
overflow-x: scroll;
}
.division-rule table {
width: 98%;
color: #666666;
border: 1px solid #e5e6e7;
border-width: 1px 0 0 1px;
}
.division-rule table tr {
height: 50px;
line-height: 50px;
}
.division-rule table th,
.division-rule table td {
font-size: 12px;
font-weight: normal;
padding: 0px 10px;
border: 1px solid #e5e6e7;
border-width: 0px 1px 1px 0px;
border-spacing: 0;
text-align: center;
min-width: 100px;
white-space: nowrap;
/* white-space: nowrap; */
/* overflow: hidden; */
/* text-overflow: ellipsis; */
}
.division-rule table .merchantNameTd {
min-width: 150px;
}
.division-rule .flex {
display: flex;
justify-content: space-around;
}
.division-rule .table-block .el-radio {
display: block;
height: 60px;
line-height: 42px;
margin-right: 0;
}
.division-rule .table-block .el-radio__label {
display: none !important;
}
.p-b-20 {
padding-bottom: 26px !important;
}
</style>
export const busiModeList = [
{
confId: "1",
confName: "直营渠道"
},
{
confId: "2",
confName: "经销商投资"
},
{
confId: "3",
confName: "服务商投资"
},
{
confId: "4",
confName: "服务商渠道"
}
]
export const operationModeList = [
{
confId: "0",
confName: "非直营"
},
{
confId: "1",
confName: "直营"
}
]
...@@ -8,31 +8,34 @@ ...@@ -8,31 +8,34 @@
<!-- 上架商品及测算 --> <!-- 上架商品及测算 -->
<goods-info></goods-info> <goods-info></goods-info>
<!-- 分账配置 --> <!-- 分账配置 -->
<division-config></division-config> <division-config
:divisiObj="divisiObj"
></division-config>
<!-- 对账配置 --> <!-- 对账配置 -->
<finance-config></finance-config> <finance-config :financeObj="financialObj"></finance-config>
<div style="margin-top: 40px;text-align: center;"> <div style="margin-top: 40px; text-align: center">
<el-button type="primary" @click="handleBack()"> <el-button type="primary" @click="handleBack()"> 返回 </el-button>
返回
</el-button>
</div> </div>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from "vuex"
import BaseInfo from './components/detailCon/BaseInfo.vue' import BaseInfo from "./components/detailCon/BaseInfo.vue"
import ShopMerchantInfo from './components/detailCon/ShopMerchantInfo' import ShopMerchantInfo from "./components/detailCon/ShopMerchantInfo"
import GoodsInfo from './components/detailCon/GoodsInfo.vue' import GoodsInfo from "./components/detailCon/GoodsInfo.vue"
import DivisionConfig from './components/detailCon/DivisionConfig.vue' import DivisionConfig from "./components/detailCon/DivisionConfig.vue"
import FinanceConfig from './components/detailCon/FinanceConfig.vue' import FinanceConfig from "./components/detailCon/FinanceConfig.vue"
import { merchantSettleDistributeRuleLastRule } from "@api/shelfManage"
export default { export default {
name: 'contractDetail', name: "contractDetail",
data() { data() {
return { return {
isLoad: true, isLoad: true,
editData: {}, editData: {},
}; divisiObj: {},
financialObj: {}
}
}, },
components: { components: {
...@@ -42,24 +45,41 @@ export default { ...@@ -42,24 +45,41 @@ export default {
DivisionConfig, DivisionConfig,
FinanceConfig FinanceConfig
}, },
computed: {
routerInfo() {
return this.$route.query.params
? JSON.parse(this.$route.query.params)
: ""
}
},
mounted() { mounted() {
this.getDetail() this.getDetail()
this.getFinaceObj()
}, },
//方法集合 //方法集合
methods: { methods: {
...mapActions({ ...mapActions({
close: 'd2admin/page/close' close: "d2admin/page/close"
}), }),
getDetail() { getDetail() {
this.isLoad = false this.isLoad = false
}, },
getFinaceObj() {
// const { id } = this.routerInfo;
merchantSettleDistributeRuleLastRule({
id: 1
}).then((result) => {
this.divisiObj = result.merchantSettleDistributeRule
this.financialObj = result.merchantReconciliationRule
})
},
handleBack() { handleBack() {
this.close({ tagName: '/shelfManage' }) this.close({ tagName: "/shelfManage" })
this.$router.push({ name: 'shelfManage' }) this.$router.push({ name: "shelfManage" })
this.close({ tagName: '/contractDetail' }) this.close({ tagName: "/contractDetail" })
} }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cancel-btn { .cancel-btn {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!