Commit 7b78b5a0 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 1449543f bdede4e5
Showing 44 changed files with 1427 additions and 437 deletions
...@@ -12970,6 +12970,11 @@ ...@@ -12970,6 +12970,11 @@
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
}, },
"number-precision": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/number-precision/-/number-precision-1.6.0.tgz",
"integrity": "sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ=="
},
"nwsapi": { "nwsapi": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmmirror.com/nwsapi/-/nwsapi-2.2.1.tgz", "resolved": "https://registry.npmmirror.com/nwsapi/-/nwsapi-2.2.1.tgz",
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"number-precision": "^1.6.0",
"qrcodejs2": "^0.0.2", "qrcodejs2": "^0.0.2",
"qs": "^6.8.0", "qs": "^6.8.0",
"rfdc": "^1.3.0", "rfdc": "^1.3.0",
......
...@@ -254,3 +254,13 @@ export function updateOneKpiMetric (data) { ...@@ -254,3 +254,13 @@ export function updateOneKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.updateOneKpiMetri' data.method = 'dj.riskmanage.api.kpiMetric.updateOneKpiMetri'
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
/**
*
* 店效盯防-更多看板-门店列表导出
*/
export function exportMerchantList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.notice.board.merchant.list.export'
return request(data, RequestMethods.POST)
}
...@@ -106,9 +106,19 @@ export function pointStaffQuery(data) { ...@@ -106,9 +106,19 @@ export function pointStaffQuery(data) {
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 获取优惠券列表
export const getCouponList = (data) => {
data.method = `dj.api.smartcarlife.resident.coupon.list.merchant`
return request(data, RequestMethods.POST)
}
// 获取优惠券列表
export const getBrandList = (data) => {
data.method = `dj.api.smartcarlife.resident.coupon.brand.list.all`
return request(data, RequestMethods.POST)
}
// 驻店人员卡券发发放记录 // 驻店人员卡券发发放记录
export function getCouponRecord(data) { export function getCouponRecord(data) {
data.method = 'dj.api.smartcarlife.resident.coupon.grant.record' data.method = "dj.api.smartcarlife.resident.coupon.grant.record"
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
...@@ -134,4 +144,4 @@ export function grantOperate(data) { ...@@ -134,4 +144,4 @@ export function grantOperate(data) {
export function exportGrantRecord(data) { export function exportGrantRecord(data) {
data.method = 'dj.api.smartcarlife.resident.coupon.grant.record.export' data.method = 'dj.api.smartcarlife.resident.coupon.grant.record.export'
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
}
\ No newline at end of file \ No newline at end of file
}
...@@ -78,4 +78,25 @@ export function deductOrderPage(data) { ...@@ -78,4 +78,25 @@ export function deductOrderPage(data) {
export function cancelDeduct(data) { export function cancelDeduct(data) {
data.method = `dj.api.smartcarlife.staff.score.cancel.deduct` data.method = `dj.api.smartcarlife.staff.score.cancel.deduct`
return request(data) return request(data)
}
// 积分审批列表同步
export function refreshData(data) {
data.method = `dj.api.smartcarlife.staff.motivation.page.sync`
return request(data)
}
//查询指定订单的操作记录
export function getOperationRecord(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.operation`
return request(data)
}
//根据订单号查询剩余积分
// export function getScoreByscore(data) {
// data.method = `dj.api.smartcarlife.staff.motivation.order.score`
// return request(data)
// }
//获取到总积分
export function getOrderByScore(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.score`
return request(data)
} }
\ No newline at end of file \ No newline at end of file
...@@ -46,3 +46,55 @@ export function getMerchantLevelApi(data) { ...@@ -46,3 +46,55 @@ export function getMerchantLevelApi(data) {
data.method = `dj.api.smartcarlife.get.merchantLevel` data.method = `dj.api.smartcarlife.get.merchantLevel`
return request(data, "post") return request(data, "post")
} }
// 嘀加上架 - 基本信息
export function getBusisDetailBasic(data) {
data.method = `dj.api.create.business.approve.detail.basic`
return request(data)
}
// 新增商户 - 车品牌
export function brandList(data) {
data.method = `merchants.api.merchantCommon.getCarbrandTree`
return request(data, RequestMethods.POST)
}
// 新增商户 - 商户类型
export function getMerchantType(data) {
data.method = `merchants.api.menu.findAllDictData`
return request(data, RequestMethods.POST)
}
// 嘀加上架查看详情(上架商品及测算)
export function getGoodsDetail(data) {
data.method = `${path}detail.goods`
return request(data, RequestMethods.POST)
}
// 嘀加上架提交
export function saveApprove(data) {
data.method = `${path}save`
return request(data, RequestMethods.POST, ["file"])
}
// 新增商户 - 保存商户
export function saveMerchant(data) {
data.method = `merchants.api.merchant.saveMerchant`
return request(data, RequestMethods.POST)
}
// 新增商户 - 下级商户
export function findMerchantListByPage(data) {
data.method = `merchants.api.open.findMerchantListByPage`
return request(data, RequestMethods.POST)
}
// 嘀加上架 - 保存
export function operationConfirm(data) {
data.method = `dj.api.create.business.approve.operationConfirm`
return request(data, RequestMethods.POST)
}
// 嘀加上架 - 保存
export function operationConfirmJson(data) {
data.method = `dj.api.create.business.approve.operationConfirm.json`
return request(data, RequestMethods.POST)
}
<template> <template>
<div class="d2-layout-header-aside-group" :style="styleLayoutMainGroup" :class="{ grayMode: grayActive }"> <div
class="d2-layout-header-aside-group"
:style="styleLayoutMainGroup"
:class="{ grayMode: grayActive }"
>
<!-- 半透明遮罩 --> <!-- 半透明遮罩 -->
<div class="d2-layout-header-aside-mask" /> <div class="d2-layout-header-aside-mask" />
<!-- 主体内容 --> <!-- 主体内容 -->
<div class="d2-layout-header-aside-content" flex="dir:top"> <div class="d2-layout-header-aside-content" flex="dir:top">
<!-- 顶栏 --> <!-- 顶栏 -->
<div class="d2-theme-header" :style="{ <div
opacity: this.searchActive ? 0.5 : 1 class="d2-theme-header"
}" flex-box="0" flex> :style="{
<div class="logo-group d2-theme-header-logo" :class="asideCollapse ? 'logo-only' : 'logo-all'" flex-box="0"> opacity: this.searchActive ? 0.5 : 1
<img v-if="asideCollapse" src="../../assets/icon-only.png"> }"
<img v-else src="../../assets/all.png"> flex-box="0"
flex
>
<div
class="logo-group d2-theme-header-logo"
:class="asideCollapse ? 'logo-only' : 'logo-all'"
flex-box="0"
>
<img v-if="asideCollapse" src="../../assets/icon-only.png" />
<img v-else src="../../assets/all.png" />
<!-- <img style="width: 32px; height: 32px;" src="../../assets/icon-only.png"> --> <!-- <img style="width: 32px; height: 32px;" src="../../assets/icon-only.png"> -->
</div> </div>
<p v-if="show" class="d2-header-name"> <p v-if="show" class="d2-header-name">
<!-- 先写死名字 --> <!-- 先写死名字 -->
<!-- {{ info ? info.detail.merchantName : '' }} --> <!-- {{ info ? info.detail.merchantName : '' }} -->
{{ 'SaaS+增值业务管理平台' }} {{ "SaaS+增值业务管理平台" }}
</p> </p>
<!-- <hamburger :onClick="handleToggleAside" :isActive="asideCollapse" flex-box="0" class="toggle-aside-btn"></hamburger> <!-- <hamburger :onClick="handleToggleAside" :isActive="asideCollapse" flex-box="0" class="toggle-aside-btn"></hamburger>
<span class="header-title">{{headerTitle}}</span> --> <span class="header-title">{{headerTitle}}</span> -->
...@@ -35,24 +48,47 @@ ...@@ -35,24 +48,47 @@
<d2-header-user /> <d2-header-user />
</div> </div>
</div> </div>
<div class="d2-theme-header" style="height: 40px; font-size: 14px; border-top: 1px solid #F0F2F5;" flex-box="0" <div
flex> class="d2-theme-header"
<div class="logo-group d2-theme-header-logo" style="height: 1px; margin-top: -1px;" style="height: 40px; font-size: 14px; border-top: 1px solid #f0f2f5"
:class="asideCollapse ? 'logo-only' : 'logo-all'" flex-box="0" /> flex-box="0"
<hamburger :on-click="handleToggleAside" :is-active="asideCollapse" flex-box="0" class="toggle-aside-btn" /> flex
>
<div
class="logo-group d2-theme-header-logo"
style="height: 1px; margin-top: -1px"
:class="asideCollapse ? 'logo-only' : 'logo-all'"
flex-box="0"
/>
<hamburger
:on-click="handleToggleAside"
:is-active="asideCollapse"
flex-box="0"
class="toggle-aside-btn"
/>
<span class="header-title">{{ headerTitle }}</span> <span class="header-title">{{ headerTitle }}</span>
</div> </div>
<!-- 下面 主体 --> <!-- 下面 主体 -->
<div class="d2-theme-container" flex-box="1" flex> <div class="d2-theme-container" flex-box="1" flex>
<!-- 主体 侧边栏 --> <!-- 主体 侧边栏 -->
<div flex-box="0" ref="aside" class="d2-theme-container-aside" :style="{ <div
width: asideCollapse ? asideWidthCollapse : asideWidth, flex-box="0"
opacity: this.searchActive ? 0.5 : 1 ref="aside"
}"> class="d2-theme-container-aside"
:style="{
width: asideCollapse ? asideWidthCollapse : asideWidth,
opacity: this.searchActive ? 0.5 : 1
}"
>
<d2-menu-side /> <d2-menu-side />
</div> </div>
<!-- 主体 --> <!-- 主体 -->
<div class="d2-theme-container-main" :class="this.searchActive ? 'is-search' : ''" flex-box="1" flex> <div
class="d2-theme-container-main"
:class="this.searchActive ? 'is-search' : ''"
flex-box="1"
flex
>
<!-- 搜索 --> <!-- 搜索 -->
<transition name="fade-scale"> <transition name="fade-scale">
<div v-if="searchActive" class="d2-theme-container-main-layer" flex> <div v-if="searchActive" class="d2-theme-container-main-layer" flex>
...@@ -61,14 +97,21 @@ ...@@ -61,14 +97,21 @@
</transition> </transition>
<!-- 内容 --> <!-- 内容 -->
<transition name="fade-scale"> <transition name="fade-scale">
<div v-if="!searchActive" class="d2-theme-container-main-layer" flex="dir:top"> <div
v-if="!searchActive"
class="d2-theme-container-main-layer"
flex="dir:top"
>
<!-- tab --> <!-- tab -->
<div class="d2-theme-container-main-header" flex-box="0"> <div class="d2-theme-container-main-header" flex-box="0">
<!-- <d2-tabs/> --> <!-- <d2-tabs/> -->
</div> </div>
<!-- 页面 --> <!-- 页面 -->
<div class="d2-theme-container-main-body" flex-box="1"> <div class="d2-theme-container-main-body" flex-box="1">
<transition :name="transitionActive ? 'el-fade-in' : ''" mode="out-in"> <transition
:name="transitionActive ? 'el-fade-in' : ''"
mode="out-in"
>
<keep-alive :include="keepAlive"> <keep-alive :include="keepAlive">
<router-view /> <router-view />
</keep-alive> </keep-alive>
...@@ -83,27 +126,25 @@ ...@@ -83,27 +126,25 @@
</template> </template>
<script> <script>
import d2MenuSide from './components/menu-side' import d2MenuSide from "./components/menu-side"
import d2MenuHeader from './components/menu-header' import d2MenuHeader from "./components/menu-header"
// import d2Tabs from './components/tabs' // import d2Tabs from './components/tabs'
// import d2HeaderFullscreen from './components/header-fullscreen' // import d2HeaderFullscreen from './components/header-fullscreen'
// import d2HeaderLocales from './components/header-locales' // import d2HeaderLocales from './components/header-locales'
// import d2HeaderSearch from './components/header-search' // import d2HeaderSearch from './components/header-search'
// import d2HeaderSize from './components/header-size' // import d2HeaderSize from './components/header-size'
// import d2HeaderTheme from './components/header-theme' // import d2HeaderTheme from './components/header-theme'
import d2HeaderUser from './components/header-user' import d2HeaderUser from "./components/header-user"
// import d2HeaderLog from './components/header-log' // import d2HeaderLog from './components/header-log'
// import d2HeaderColor from './components/header-color' // import d2HeaderColor from './components/header-color'
import hamburger from './components/hamburger' import hamburger from "./components/hamburger"
// import d2HeaderDatetime from './components/header-datetime' // import d2HeaderDatetime from './components/header-datetime'
import { mapState, mapGetters, mapActions } from 'vuex' import { mapState, mapGetters, mapActions } from "vuex"
import mixinSearch from './mixins/search' import mixinSearch from "./mixins/search"
import { localRoutes } from '@/router/routes' import { localRoutes } from "@/router/routes"
export default { export default {
name: 'D2LayoutHeaderAside', name: "D2LayoutHeaderAside",
mixins: [ mixins: [mixinSearch],
mixinSearch
],
components: { components: {
d2MenuSide, d2MenuSide,
d2MenuHeader, d2MenuHeader,
...@@ -122,10 +163,10 @@ export default { ...@@ -122,10 +163,10 @@ export default {
data() { data() {
return { return {
// [侧边栏宽度] 正常状态 // [侧边栏宽度] 正常状态
asideWidth: '200px', asideWidth: "200px",
// [侧边栏宽度] 折叠状态 // [侧边栏宽度] 折叠状态
asideWidthCollapse: '65px', asideWidthCollapse: "65px",
headerTitle: '', headerTitle: "",
show: false show: false
// headerSubTitle: '客户列表' // headerSubTitle: '客户列表'
} }
...@@ -135,51 +176,53 @@ export default { ...@@ -135,51 +176,53 @@ export default {
Object.values(localRoutes).forEach((item, index) => { Object.values(localRoutes).forEach((item, index) => {
this.routerPath.push(item.meta) this.routerPath.push(item.meta)
}) })
console.log('this.$route', this.$route) console.log("this.$route", this.$route)
var targetItem = this.$route.matched var targetItem = this.$route.matched
this.findTitle(targetItem[targetItem.length - 1]?.meta) this.findTitle(targetItem[targetItem.length - 1]?.meta)
this.getInfo() this.getInfo()
}, },
watch: { watch: {
'$route.matched'(val) { "$route.matched"(val) {
console.log(val, '$route.matched') // console.log(val, '$route.matched')
var targetItem = val[val.length - 1]?.meta var targetItem = val[val.length - 1]?.meta
this.headerTitle = '' this.headerTitle = ""
this.findTitle(targetItem) this.findTitle(targetItem)
} }
}, },
computed: { computed: {
...mapState('d2admin', { ...mapState("d2admin", {
keepAlive: state => state.page.keepAlive, keepAlive: (state) => state.page.keepAlive,
grayActive: state => state.gray.active, grayActive: (state) => state.gray.active,
transitionActive: state => state.transition.active, transitionActive: (state) => state.transition.active,
asideCollapse: state => state.menu.asideCollapse asideCollapse: (state) => state.menu.asideCollapse
}), }),
...mapGetters('d2admin', { ...mapGetters("d2admin", {
themeActiveSetting: 'theme/activeSetting' themeActiveSetting: "theme/activeSetting"
}), }),
/** /**
* @description 最外层容器的背景图片样式 * @description 最外层容器的背景图片样式
*/ */
styleLayoutMainGroup() { styleLayoutMainGroup() {
return { return {
...this.themeActiveSetting.backgroundImage ...(this.themeActiveSetting.backgroundImage
? { ? {
backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')` backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')`
} }
: {} : {})
} }
} }
}, },
methods: { methods: {
...mapActions('d2admin/menu', [ ...mapActions("d2admin/menu", ["asideCollapseToggle"]),
'asideCollapseToggle' ...mapActions("d2admin/user", ["load"]),
]),
...mapActions('d2admin/user', ['load']),
findTitle(val) { findTitle(val) {
this.headerTitle = val?.title ? val.title + (this.headerTitle ? ' / ' : '') + this.headerTitle : '' this.headerTitle = val?.title
? val.title + (this.headerTitle ? " / " : "") + this.headerTitle
: ""
if (val?.parentId && +val?.parentId !== 1) { if (val?.parentId && +val?.parentId !== 1) {
return this.findTitle(this.routerPath.find(item => item.authId === val.parentId)) return this.findTitle(
this.routerPath.find((item) => item.authId === val.parentId)
)
} }
}, },
async getInfo() { async getInfo() {
...@@ -200,7 +243,7 @@ export default { ...@@ -200,7 +243,7 @@ export default {
<style lang="scss"> <style lang="scss">
// 注册主题 // 注册主题
@import '~@/assets/style/theme/register.scss'; @import "~@/assets/style/theme/register.scss";
@keyframes lightflow { @keyframes lightflow {
90% { 90% {
......
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import SearchBox from '../SearchBox' import SearchBox from '../SearchBox'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { getMerchantOutputDetail, getBoardDetail } from '@api/earlyWarningManager' import { getBoardDetail } from '@api/earlyWarningManager'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { tooltipConfig, xAxisConfig, dataZoomSliderConfig } from '../chartConfig' import { tooltipConfig, xAxisConfig, dataZoomSliderConfig } from '../chartConfig'
import { KPI_DATA } from '../kpiConfig.js'
export default { export default {
components: { components: {
SearchBox SearchBox
...@@ -84,17 +84,18 @@ export default { ...@@ -84,17 +84,18 @@ export default {
startDate, startDate,
dateType, dateType,
endDate, endDate,
code: 'A048' code
}) })
this.drawChart(res) this.drawChart(res)
}, },
drawChart (list) { drawChart (list) {
this.chart.clear() this.chart.clear()
let { pageData: { name } } = this, let { pageData: { name, code } } = this,
_this = this, _this = this,
{ allYear, dateType } = this.searchTime, { allYear, dateType } = this.searchTime,
timeList = [], timeList = [],
data = [] data = [],
unit = KPI_DATA[code]?.valueUnit ? KPI_DATA[code].valueUnit : ''
list.map(e => { list.map(e => {
let { startDate, endDate } = e, let { startDate, endDate } = e,
axisLabel = dayjs(startDate).format("YYYY-MM-DD"), axisLabel = dayjs(startDate).format("YYYY-MM-DD"),
...@@ -116,7 +117,7 @@ export default { ...@@ -116,7 +117,7 @@ export default {
if (dateType == 1) title = axisValue if (dateType == 1) title = axisValue
return `${title}<br> return `${title}<br>
<div class="tooltips"> <div class="tooltips">
<i class="circle"></i>${name}:${value?.toLocaleString() || 0} <i class="circle"></i>${name}:${value?.toLocaleString() || 0}${unit}
</div>`; </div>`;
} }
}, },
...@@ -129,7 +130,20 @@ export default { ...@@ -129,7 +130,20 @@ export default {
right: '60', right: '60',
bottom: '80' bottom: '80'
}, },
xAxis: xAxisConfig(_this), xAxis: {
...xAxisConfig(_this),
axisLabel: {
showMaxLabel: true,
formatter: function (value, index) {
let str = ''
str = allYear ? dayjs(value).format('YYYY年MM月') : dayjs(value).format('MM-DD')
if (dateType == 1) str = value
return str
}
}
},
yAxis: { yAxis: {
type: 'value', type: 'value',
boundaryGap: [0, '100%'], boundaryGap: [0, '100%'],
......
<template> <template>
<div class="data-list-box"> <div
class="data-list-box"
v-loading="loading"
>
<template v-if="boardList.length"> <template v-if="boardList.length">
<div class="data-list"> <div class="data-list">
...@@ -34,6 +37,7 @@ ...@@ -34,6 +37,7 @@
import onShowMixin from './onShowMixin' import onShowMixin from './onShowMixin'
import BoardItem from '../shopGuardIndex/BoardItem' import BoardItem from '../shopGuardIndex/BoardItem'
import { getBoardList } from '@api/earlyWarningManager' import { getBoardList } from '@api/earlyWarningManager'
import { KPI_DATA } from '../kpiConfig.js'
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
...@@ -50,29 +54,39 @@ export default { ...@@ -50,29 +54,39 @@ export default {
}, },
methods: { methods: {
async search () { async search () {
this.boardList = this.$options.data.call(this).boardList try {
let { businessType } = this.searchForm this.loading = true
const res = await getBoardList({ this.$message.success({
...this.searchForm, message: '指标计算中,请耐心等待',
scope: 1 duration: 3000
})
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'
}) })
}) this.boardList = this.$options.data.call(this).boardList
let { businessType } = this.searchForm
const res = await getBoardList({
...this.searchForm,
scope: 1
})
res.map(e => {
this.boardList.push({
componentName: 'boardDetail',
pageId: `board-${e.code}`,
tabTitle: `${e.name}详情`,
definition: e.definition,
code: e.code,
name: e.name,
businessType,
data: e,
value: 'value',
percent: 'ratio',
...KPI_DATA[e.code]
})
})
this.loading = false
} catch (error) {
this.loading = false
}
}, },
openWindow (e) { openWindow (e) {
console.log(e)
this.$emit('openWindow', e) this.$emit('openWindow', e)
} }
} }
......
...@@ -61,14 +61,12 @@ export default { ...@@ -61,14 +61,12 @@ export default {
searchForm: { searchForm: {
businessType: 4, businessType: 4,
businessScenarioList: [], businessScenarioList: [],
brandIdList: [],
secondBrandIdList: [], secondBrandIdList: [],
merchantRange: 1, merchantRange: 1,
// merchantId: '', merchantId: '',
}, },
// baseData: {
// storeIdList: [],
// },
showFormData: [ showFormData: [
{ {
label: '归属业务', label: '归属业务',
...@@ -132,7 +130,8 @@ export default { ...@@ -132,7 +130,8 @@ export default {
optionId: 'merchantId', optionId: 'merchantId',
optionLabel: 'merchantName', optionLabel: 'merchantName',
}, },
] ],
brandList:[]
} }
}, },
mounted () { mounted () {
...@@ -157,10 +156,10 @@ export default { ...@@ -157,10 +156,10 @@ export default {
async getCarBrandList () { async getCarBrandList () {
const res = await getCarBrandList({ containsChildren: true }), const res = await getCarBrandList({ containsChildren: true }),
brandList = [] brandList = []
console.log(res)
res.map(e => { res.map(e => {
if (e && e.children && e.children.length) { if (e && e.children && e.children.length) {
e.children.map(i => { e.children.map(i => {
i.brandId = e.id
brandList.push(i) brandList.push(i)
}) })
} }
...@@ -170,6 +169,7 @@ export default { ...@@ -170,6 +169,7 @@ export default {
item.optionList = brandList || [] item.optionList = brandList || []
} }
}) })
this.brandList = brandList || []
}, },
handleReset () { handleReset () {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
...@@ -185,6 +185,20 @@ export default { ...@@ -185,6 +185,20 @@ export default {
this.loading = true this.loading = true
}, },
search () { search () {
const { secondBrandIdList } = this.searchForm,
{ brandList } = this
if (secondBrandIdList.length) {
console.log(secondBrandIdList)
let brandIdList = []
brandList.map(e => {
if (secondBrandIdList.includes(e.id)) brandIdList.push(e.brandId)
})
brandIdList = Array.from(
new Set([...brandIdList.map((e) => e)])
)
console.log(brandIdList)
this.searchForm.brandIdList = brandIdList
}
this.$refs.dataGroupRef.search() this.$refs.dataGroupRef.search()
} }
} }
...@@ -196,6 +210,9 @@ export default { ...@@ -196,6 +210,9 @@ export default {
height: 100%; height: 100%;
padding: 0 20px; padding: 0 20px;
overflow-y: auto; overflow-y: auto;
.header {
background: #fff;
}
.up-btns { .up-btns {
padding-bottom: 22px; padding-bottom: 22px;
} }
...@@ -213,7 +230,5 @@ export default { ...@@ -213,7 +230,5 @@ export default {
} }
} }
} }
.content {
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<el-button <el-button
size="small" size="small"
type="primary" type="primary"
@click="handleExport"
>导出</el-button> >导出</el-button>
</div> </div>
<d2-table <d2-table
...@@ -13,13 +14,50 @@ ...@@ -13,13 +14,50 @@
:hasPage="false" :hasPage="false"
:has-num="false" :has-num="false"
noDataText="暂无门店数据" noDataText="暂无门店数据"
v-loading="loading"
@sortChange="sortChange"
> >
<template <template
slot="popoverHtml"
slot-scope="scope"
>
<template v-if="scope.scope[scope.prop] && scope.scope[scope.prop].length > 1">
<span>{{ scope.scope[scope.prop].slice(0, 1).join("") }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div :class="{scrollHeight: scope.scope[scope.prop].length >= 10}">
<div
v-for="(item, index) in scope.scope[scope.prop]"
:key="index"
>
{{ item }}
</div>
</div>
<span
class="more-info"
slot="reference"
>...({{ scope.scope[scope.prop].length }})</span>
</el-popover>
</template>
<template v-else>
<span v-if="
!scope.scope[scope.prop] || !scope.scope[scope.prop].length
">-</span>
<span v-else>{{ scope.scope[scope.prop].join("") }}</span>
</template>
</template>
<template
slot="sortableHtml" slot="sortableHtml"
slot-scope="scope" slot-scope="scope"
> >
<div class="sortableHtml"> <div class="sortableHtml">
{{scope.scope[scope.prop]}} {{formatterValue(scope)}}
<div :class="['percent',`${percentColor(scope)}`]">
{{formattedPercent(scope)}}
</div>
</div> </div>
</template> </template>
<div <div
...@@ -37,8 +75,17 @@ ...@@ -37,8 +75,17 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import onShowMixin from './onShowMixin' import onShowMixin from './onShowMixin'
import { getBoardMerchantList } from '@api/earlyWarningManager' import { getBoardMerchantList, exportMerchantList } from '@api/earlyWarningManager'
import { deepClone, downLoadFile } from '@/common/util'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import NP from 'number-precision'
const RATIO_KEY = {
output: 'outputRatio',
orderNumber: 'orderNumberRatio',
customerUnitPrice: 'customerUnitPriceRatio',
penetrationRate: 'penetrationRateRatio',
touchConversionRate: 'touchConversionRateRatio',
}
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
name: '', name: '',
...@@ -47,12 +94,8 @@ export default { ...@@ -47,12 +94,8 @@ export default {
}, },
data () { data () {
return { return {
tableTotal: 0,
page: {
pageSize: 10,
currentPage: 1
},
tableData: [], tableData: [],
originTableData: [],
// 表格参数 // 表格参数
tableParams: { tableParams: {
tableOption: { width: '150px' }, tableOption: { width: '150px' },
...@@ -81,10 +124,9 @@ export default { ...@@ -81,10 +124,9 @@ export default {
} }
}, { }, {
label: '督导', label: '督导',
width: 'supervisionList', minWidth: 150,
formatter (row) { prop: 'supervisionNameList',
return "-" addHtml: 'popoverHtml'
}
}, { }, {
label: '归属业务', label: '归属业务',
prop: 'businessType', prop: 'businessType',
...@@ -98,10 +140,9 @@ export default { ...@@ -98,10 +140,9 @@ export default {
} }
}, { }, {
label: '主营品牌', label: '主营品牌',
prop: "brandList", prop: "carBrandList",
formatter (row) { addHtml: 'popoverHtml',
return minWidth: 200,
}
}, { }, {
label: '业务性质', label: '业务性质',
prop: "businessScenario", prop: "businessScenario",
...@@ -119,7 +160,7 @@ export default { ...@@ -119,7 +160,7 @@ export default {
width: '150', width: '150',
prop: "output", prop: "output",
sortable: true, sortable: true,
addHtml: 'sortableHtml' addHtml: 'sortableHtml',
}, { }, {
label: '订单数', label: '订单数',
width: '150', width: '150',
...@@ -131,20 +172,20 @@ export default { ...@@ -131,20 +172,20 @@ export default {
width: '130', width: '130',
prop: "customerUnitPrice", prop: "customerUnitPrice",
sortable: true, sortable: true,
addHtml: 'sortableHtml' addHtml: 'sortableHtml',
}, { }, {
label: '渗透率', label: '渗透率',
prop: "penetrationRate", prop: "penetrationRate",
width: 130, width: 130,
sortable: true, sortable: true,
addHtml: 'sortableHtml' addHtml: 'sortableHtml',
}, },
{ {
label: '触客转化率', label: '触客转化率',
prop: "touchConversionRate", prop: "touchConversionRate",
sortable: true, sortable: true,
width: 130, width: 130,
addHtml: 'sortableHtml' addHtml: 'sortableHtml',
} }
] ]
}, },
...@@ -154,13 +195,31 @@ export default { ...@@ -154,13 +195,31 @@ export default {
}, },
methods: { methods: {
async search () { async search () {
this.tableData = [] try {
const res = await getBoardMerchantList({ this.loading = true
...this.searchForm this.tableData = []
}) this.originTableData = []
console.log(res) const res = await getBoardMerchantList(this.searchForm)
this.tableData = res res.map(e => {
// this.tableTotal = total // e.output = Math.random() * 9999 + 1
// e.orderNumber = Math.floor(Math.random() * 10001)
// e.customerUnitPrice = Math.random() * 9999 + 1
// e.penetrationRate = Math.random() * 10 + 1
// e.touchConversionRate = Math.random() * 10 + 1
// e.outputRatio = Math.floor(Math.random() * 201) - 100
let supervisionNameList = []
e.supervisionList?.map(i => {
supervisionNameList.push(i.supervisionName)
})
e.carBrandList = e.brandList?.split(',') || []
e.supervisionNameList = supervisionNameList
})
this.tableData = deepClone(res)
this.originTableData = deepClone(res)
this.loading = false
} catch (error) {
this.loading = false
}
}, },
handleDetail (e) { handleDetail (e) {
this.$emit('openWindow', { this.$emit('openWindow', {
...@@ -172,9 +231,51 @@ export default { ...@@ -172,9 +231,51 @@ export default {
merchantName: e.merchantName merchantName: e.merchantName
}) })
}, },
pageChange (e) { handleExport () {
this.page = e exportMerchantList(this.searchForm).then((res) => {
this.search() res && downLoadFile(res)
})
},
sortChange (sortObj, sortColum, sort) {
if (sort) {
if (sort == 'ascending') this.tableData.sort((a, b) => {
return a[sortColum] - b[sortColum]
})
else this.tableData.sort((a, b) => {
return b[sortColum] - a[sortColum]
})
} else this.tableData = deepClone(this.originTableData)
},
formatterValue (e) {
const { scope, prop } = e
let num = scope[prop]
if (num != null) {
const isRate = ['penetrationRate', 'touchConversionRate'].includes(prop)
if (isRate) num = NP.times(num, 100)
if (num % 1 !== 0) num = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
else num = num.toLocaleString();
if (['output', 'customerUnitPrice'].includes(prop)) num = `¥${num}`
if (isRate) num += '%'
} else num = '-'
return num
},
percentColor (e) {
const { scope, prop } = e,
key = RATIO_KEY[prop]
if (scope[key] > 0) {
return 'red'
} else if (scope[key] < 0) {
return 'green'
} else {
return ''
}
},
formattedPercent (e) {
const { scope, prop } = e,
key = RATIO_KEY[prop]
let str = ''
if (scope[key] != null) str = `环${scope[key]}%`
return str
} }
} }
} }
...@@ -187,5 +288,26 @@ export default { ...@@ -187,5 +288,26 @@ export default {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.sortableHtml {
color: #1d1d1d;
font-size: 14px;
font-weight: 500;
line-height: 20px;
.percent {
font-weight: 400;
color: #333333;
}
.red {
color: #eb4e4e;
}
.green {
color: #43cf7c;
}
}
.more-info {
white-space: nowrap;
color: #5850ff;
cursor: pointer;
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ export default { ...@@ -2,6 +2,7 @@ export default {
data () { data () {
return { return {
initStatus: false, initStatus: false,
loading:false
} }
}, },
props: { props: {
......
export const KpiList = { export const KPI_DATA = {
'A014': { "A014": {unit: '(元)'},//产值
"A004": {},//触客数
} "A020": { unit: '(元)' },//客单价
"A010": {},//订单数
"A001": {},//交车数
"A046": {},//日均触客数
"A044": { unit: '(元)' },//店均产值
"A025": { valueUnit: '%' },//引流率
"A047": {},//日均交车数
"A023": { valueUnit: '%' },//触客转化率
"A021": { valueUnit: '%' },//触客转化率(售前)
"A022": { valueUnit: '%' },//触客转化率(售后)
"A026": { valueUnit: '%' },//溇透率
"A048": { unit: '(元)' },//日均产值
"A049": {},//新增门店数
"A050": {},//累计门店数
"A045": {},//展业门店数
"A051": {},//累计展业门店数
"A052": {},//新展业门店数
"A053": {},//疑似流失门店数
"A054": { valueUnit: '%' },//展业门店流失率
"A055": {},//疑似流失新门店数
"A056": { valueUnit: '%' }//新展业门店流失率
} }
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="store-layout"> <div class="store-layout">
<div class="store-box"> <div
<div class="board-box"> class="store-box"
<template v-for="(item,index) in boardList"> v-loading="loading"
<board-item >
:key="index" <template v-if="boardList.length">
class="board-item" <div class="board-box">
:item="item" <template v-for="(item,index) in boardList">
:data="boardData" <board-item
@click="openWindow(item)" :key="index"
/> class="board-item"
</template> :item="item"
</div> :data="item.data"
@click="openWindow(item)"
>
<div class="board-tips">
<el-tooltip placement="top">
<div slot="content">{{item.definition}}</div>
<div class="board-tips-icon">?</div>
</el-tooltip>
</div>
</board-item>
</template>
</div>
</template>
<template v-else>
<div class="no-data">
暂无数据
</div>
</template>
</div> </div>
<div class="store-chart"> <div class="store-chart">
...@@ -40,6 +57,7 @@ import Funnel from './Funnel' ...@@ -40,6 +57,7 @@ import Funnel from './Funnel'
import LineChart from './LineChart' import LineChart from './LineChart'
import { getMerchantBaseDetail, getBoardList } from '@/api/earlyWarningManager' import { getMerchantBaseDetail, getBoardList } from '@/api/earlyWarningManager'
import onShowMixin from '../onShowMixin' import onShowMixin from '../onShowMixin'
import { KPI_DATA } from '../../kpiConfig.js'
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
components: { components: {
...@@ -54,7 +72,7 @@ export default { ...@@ -54,7 +72,7 @@ export default {
outputTrend: [] outputTrend: []
}, },
boardList: [], boardList: [],
loading: false
} }
}, },
watch: { watch: {
...@@ -78,6 +96,7 @@ export default { ...@@ -78,6 +96,7 @@ export default {
}, },
methods: { methods: {
async getData () { async getData () {
this.getBoardList()
const { merchantId, businessType } = this.pageData, const { merchantId, businessType } = this.pageData,
{ searchTime } = this { searchTime } = this
const res = await getMerchantBaseDetail({ const res = await getMerchantBaseDetail({
...@@ -89,33 +108,45 @@ export default { ...@@ -89,33 +108,45 @@ export default {
if (res[key] == null) res[key] = '-' if (res[key] == null) res[key] = '-'
}) })
this.boardData = res this.boardData = res
this.getBoardList()
}, },
async getBoardList () { async getBoardList () {
this.boardList = this.$options.data.call(this).boardList try {
let { merchantId, merchantName, businessType } = this.pageData, this.loading = true
{ searchTime: { startDate, endDate } } = this this.$message.success({
const res = await getBoardList({ message: '指标计算中,请耐心等待',
businessType, duration: 3000
merchantId, })
startDate, this.boardList = this.$options.data.call(this).boardList
endDate, let { merchantId, merchantName, businessType } = this.pageData,
scope: 2 { searchTime: { startDate, endDate } } = this
}) const res = await getBoardList({
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, businessType,
data: e, merchantId,
value: 'value', dateType: 3,
percent: 'ratio' startDate,
endDate,
scope: 2
}) })
}) res.map(e => {
this.boardList.push({
componentName: 'boardDetail',
pageId: `board-${merchantId}-${e.code}`,
tabTitle: `${e.name}(${merchantName})`,
definition: e.definition,
merchantId,
code: e.code,
name: e.name,
businessType,
data: e,
value: 'value',
percent: 'ratio',
...KPI_DATA[e.code]
})
})
this.loading = false
} catch (error) {
this.loading = false
}
}, },
openWindow (e) { openWindow (e) {
this.$emit('openWindow', e) this.$emit('openWindow', e)
...@@ -132,10 +163,11 @@ export default { ...@@ -132,10 +163,11 @@ export default {
border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
margin-bottom: 16px; margin-bottom: 16px;
padding-top: 54px; padding-top: 54px;
min-height: 200px;
.board-box { .board-box {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 0 16px; gap: 16px;
padding: 0 20px 20px; padding: 0 20px 20px;
.board-item { .board-item {
cursor: pointer; cursor: pointer;
...@@ -143,6 +175,32 @@ export default { ...@@ -143,6 +175,32 @@ export default {
border-radius: 4px; border-radius: 4px;
background: #f8faff; background: #f8faff;
} }
.board-tips {
position: absolute;
top: 20px;
right: 20px;
&-icon {
width: 14px;
height: 14px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #999;
color: #999;
border-radius: 100%;
font-size: 10px;
font-weight: 500;
}
}
}
.no-data {
background: white;
padding: 20px 0;
min-height: 60px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
} }
} }
.store-chart { .store-chart {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
import SearchBox from '../SearchBox' import SearchBox from '../SearchBox'
import BoardItem from './BoardItem' import BoardItem from './BoardItem'
import { getShopGuardIndexBoard } from '@api/earlyWarningManager' import { getShopGuardIndexBoard } from '@api/earlyWarningManager'
import NP from 'number-precision'
export default { export default {
name: '', name: '',
components: { components: {
...@@ -166,7 +166,7 @@ export default { ...@@ -166,7 +166,7 @@ export default {
const res = await getShopGuardIndexBoard(params) const res = await getShopGuardIndexBoard(params)
Object.keys(res).map(key => { Object.keys(res).map(key => {
if (res[key] != null) { if (res[key] != null) {
if (key == 'outputCompletionProgress' || key == 'grossProfitMargin') res[key] = res[key] + '%' if (key == 'outputCompletionProgress') res[key] = NP.times(res[key], 0.01)
if (key == 'budget') res[key] = '¥' + res[key].toLocaleString() if (key == 'budget') res[key] = '¥' + res[key].toLocaleString()
} else res[key] = '-' } else res[key] = '-'
}) })
......
...@@ -3,12 +3,8 @@ ...@@ -3,12 +3,8 @@
class="item" class="item"
@click="$emit('click')" @click="$emit('click')"
> >
<div class="name">{{item.name}} <div class="name">{{formattedName(item)}}</div>
<template v-if="item.unit">{{item.unit}}</template> <div class="value">{{formattedValue(data[item.value],item.valueUnit)}}</div>
</div>
<div class="value">
{{formattedValue(data[item.value])}}
</div>
<div :class="['percent',`${percentColor(data[item.percent])}`]"> <div :class="['percent',`${percentColor(data[item.percent])}`]">
环比<div class="percent-value">{{data[item.percent] != null ? formatted(data[item.percent]) : '-'}}</div> 环比<div class="percent-value">{{data[item.percent] != null ? formatted(data[item.percent]) : '-'}}</div>
<template v-if="data[item.percent] != null && data[item.percent] != '-'"> <template v-if="data[item.percent] != null && data[item.percent] != '-'">
...@@ -26,6 +22,7 @@ ...@@ -26,6 +22,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import NP from 'number-precision'
export default { export default {
name: '', name: '',
props: { props: {
...@@ -68,10 +65,21 @@ export default { ...@@ -68,10 +65,21 @@ export default {
return '' return ''
} }
}, },
formattedValue (num) { formattedValue (num, unit) {
if (num != null) num = num.toLocaleString() if (num != null) {
if (unit) num = NP.times(num, 100);
// 检查数字是否有小数部分
if (num % 1 !== 0) num = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
else num = num.toLocaleString();
if (unit) num += '%';
}
else num = '-' else num = '-'
return num return num
},
formattedName (item) {
let name = item.name
if (item.unit) name = `${name}${item.unit}`
return name
} }
}, },
......
<template> <template>
<d2-dialog <d2-dialog :title="title"
:title="title" :is-visible.sync="selectGoodsVisible"
:is-visible.sync="selectGoodsVisible" width="70%"
width="70%" btn-ok-label="确定"
btn-ok-label="确定" @confirmDialog="handleSelectGoodsConfirm"
@confirmDialog="handleSelectGoodsConfirm" @closeDialog="handleSelectGoodsClose"
@closeDialog="handleSelectGoodsClose" class="selectGoods">
class="selectGoods">
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
:label-width="'100px'" :label-width="'100px'"
:form-data="showFormData"> :form-data="showFormData">
<template slot="commodityCode"> <template slot="commodityCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入商品ID" placeholder="请输入商品ID"
v-model.trim="searchForm['commodityCode']" v-model.trim="searchForm['commodityCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'commodityCode')" /> @input="event => searchInput(event, 'commodityCode')" />
</template> </template>
<template slot="type"> <template slot="type">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入商品编码" placeholder="请输入商品编码"
v-model.trim="searchForm['type']" v-model.trim="searchForm['type']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'type')" /> @input="event => searchInput(event, 'type')" />
</template> </template>
<template slot="thirdPartyCode"> <template slot="thirdPartyCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入第三方编码" placeholder="请输入第三方编码"
v-model.trim="searchForm['thirdPartyCode']" v-model.trim="searchForm['thirdPartyCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'thirdPartyCode')" /> @input="event => searchInput(event, 'thirdPartyCode')" />
</template> </template>
<template slot="baseGoodsCommodityCode"> <template slot="baseGoodsCommodityCode">
<el-input :style="{ width: '100%'}" <el-input :style="{ width: '100%'}"
placeholder="请输入系列ID" placeholder="请输入系列ID"
v-model.trim="searchForm['baseGoodsCommodityCode']" v-model.trim="searchForm['baseGoodsCommodityCode']"
:clearable="true" :clearable="true"
:maxlength="50" :maxlength="50"
@input="event => searchInput(event, 'baseGoodsCommodityCode')" /> @input="event => searchInput(event, 'baseGoodsCommodityCode')" />
</template> </template>
<template slot="goodsCascader"> <template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;" <el-cascader :options="baseData.productTypeList"
v-model="tempGoodsType" :placeholder="'请选择'" filterable style="width: 100%;"
@change="selectAddAttr($event)" clearable v-model="tempGoodsType"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }"> :placeholder="'请选择'"
filterable
@change="selectAddAttr($event)"
clearable
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }">
</el-cascader> </el-cascader>
</template> </template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" <el-button :id="tableParams.btnId"
size="small" size="small"
type="primary"> type="primary">
查询 查询
</el-button> </el-button>
</div> </div>
<d2-table ref="groundingIndexTable" <d2-table ref="groundingIndexTable"
:has-num="false" :has-num="false"
:search-form="searchForm" :search-form="searchForm"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"> @setTableFinishFun="setTableFinishFun">
<template slot="select_btn" slot-scope="scope"> <template slot="select_btn"
<el-radio v-model="selectedRowId" :label="scope.scope.id" :disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)">{{ '' }}</el-radio> slot-scope="scope">
<el-radio v-model="selectedRowId"
:label="scope.scope.id"
:disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)">{{ '' }}</el-radio>
</template> </template>
</d2-table> </d2-table>
</d2-dialog> </d2-dialog>
...@@ -89,7 +95,12 @@ export default { ...@@ -89,7 +95,12 @@ export default {
default: false default: false
}, },
upgradeGoodsId: {}, upgradeGoodsId: {},
packageSelectIds: {} packageSelectIds: {},
// 用于嘀加上架获取商品时过滤只筛选出权益和延保类
filterParams: {
type: Array,
default: () => []
}
}, },
data() { data() {
return { return {
...@@ -208,7 +219,7 @@ export default { ...@@ -208,7 +219,7 @@ export default {
prop: '', prop: '',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join('/') : '-' return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join('/') : '-'
} }
}, { }, {
label: '所属系列', label: '所属系列',
prop: 'goodsName', prop: 'goodsName',
...@@ -272,11 +283,14 @@ export default { ...@@ -272,11 +283,14 @@ export default {
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if (this.filterParams.length > 0) { // 嘀加上架获取商品时过滤只筛选出权益和延保类
this.searchForm.goodsTypeList = this.filterParams
}
resolve() resolve()
}) })
}, },
handleSelectGoodsConfirm() { handleSelectGoodsConfirm() {
let selectData = this.tableData?.find(v => v.id == this.selectedRowId) const selectData = this.tableData?.find(v => v.id == this.selectedRowId)
if (!selectData) return this.$message.warning('请选择商品') if (!selectData) return this.$message.warning('请选择商品')
this.$emit('handleSelectGoodsConfirm', selectData) this.$emit('handleSelectGoodsConfirm', selectData)
}, },
...@@ -297,7 +311,7 @@ export default { ...@@ -297,7 +311,7 @@ export default {
this.tempGoodsType = [] this.tempGoodsType = []
// 重新查询 // 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true) this.$refs.groundingIndexTable.refreshTable(true, true)
}, }
} }
} }
</script> </script>
...@@ -307,4 +321,4 @@ export default { ...@@ -307,4 +321,4 @@ export default {
padding: 0; padding: 0;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -74,19 +74,19 @@ ...@@ -74,19 +74,19 @@
> >
<el-form-item label="分账品类"> <el-form-item label="分账品类">
{{ {{
financialObj.goodsTypeGroupRules[editableTabsValue] financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.categoryType || "--" .categoryType || "--"
}}</el-form-item }}</el-form-item
> >
<el-form-item label=""> <el-form-item label="">
{{ {{
financialObj.goodsTypeGroupRules[editableTabsValue] financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.packageArrText .packageArrText
}}</el-form-item }}</el-form-item
> >
<template <template
v-for="(item, index) in financialObj.goodsTypeGroupRules[ v-for="(item, index) in financialObj.goodsTypeGroupRules[
editableTabsValue editableTabsValue - 1
].expenseCategoryRules" ].expenseCategoryRules"
> >
<el-form-item :key="index" :label="item.expenseCategoryName"> <el-form-item :key="index" :label="item.expenseCategoryName">
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<tableAccount <tableAccount
ref="tableAccount" ref="tableAccount"
:merchant-distribution-rules=" :merchant-distribution-rules="
financialObj.goodsTypeGroupRules[editableTabsValue] financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.merchantDistributionRules .merchantDistributionRules
" "
:table-select-options="tableSelectOptions" :table-select-options="tableSelectOptions"
...@@ -145,10 +145,9 @@ export default { ...@@ -145,10 +145,9 @@ export default {
computed: { computed: {
tableClassificationObjSelect() { tableClassificationObjSelect() {
const filterObj = deepClone( const filterObj = deepClone(
this.financialObj.goodsTypeGroupRules[this.editableTabsValue] this.financialObj.goodsTypeGroupRules[this.editableTabsValue - 1]
.expenseCategoryRules .expenseCategoryRules
) )
console.log(filterObj)
const obj = { const obj = {
trafficSide: filterObj trafficSide: filterObj
} }
...@@ -178,12 +177,18 @@ export default { ...@@ -178,12 +177,18 @@ export default {
merchantName: info.realityPlatformMerchantName, merchantName: info.realityPlatformMerchantName,
targetMerchantType: 1 targetMerchantType: 1
} }
// 4s 店 // 流量方
const merchantSideobj = { const merchantSideobj = {
merchantId: info.realityShopMerchantId, // 实际分账商户方商户id(嘀加智慧云为-1) merchantId: info.realityShopMerchantId, // 实际分账商户方商户id(嘀加智慧云为-1)
merchantName: info.realityShopMerchantName, merchantName: info.realityShopMerchantName,
targetMerchantType: 3 targetMerchantType: 3
} }
//服务商
const serviceObj = {
merchantId: info.partnerMerchantId,
merchantName: info.partnerMerchantName,
targetMerchantType: 2
}
// // 如果勾选商户 就追加进去 // // 如果勾选商户 就追加进去
// if (info.djzhySubMerchantId) { // if (info.djzhySubMerchantId) {
// const dizhySubMerchantObj = { // const dizhySubMerchantObj = {
...@@ -198,10 +203,9 @@ export default { ...@@ -198,10 +203,9 @@ export default {
// merchantSideobj // merchantSideobj
// ] // ]
// } // }
return [platformSideobj, merchantSideobj] return [platformSideobj, merchantSideobj, serviceObj]
} }
}, }
}, },
watch: { watch: {
divisiObj: { divisiObj: {
...@@ -315,9 +319,7 @@ export default { ...@@ -315,9 +319,7 @@ export default {
item.expenseCategoryTypeRules item.expenseCategoryTypeRules
) )
}) })
this.financialObj = data
this.initSettleTimeObj() this.initSettleTimeObj()
console.log(this.financialObj, 76666)
}, },
initSettleTimeObj() { initSettleTimeObj() {
const { settleTimeType, settleTime } = this.financialObj const { settleTimeType, settleTime } = this.financialObj
......
...@@ -17,23 +17,24 @@ ...@@ -17,23 +17,24 @@
<el-form label-suffix=":" label-width="154px"> <el-form label-suffix=":" label-width="154px">
<el-form-item label="分账品类"> <el-form-item label="分账品类">
{{ {{
financialObj[editableTabsValue].categoryType || "--" financialObj[editableTabsValue-1].categoryType || "--"
}}</el-form-item }}</el-form-item
> >
<el-form-item label=""> <el-form-item label="">
{{ {{
financialObj[editableTabsValue].packageArrText financialObj[editableTabsValue-1].packageArrText
}}</el-form-item }}</el-form-item
> >
<template <template
v-for="(item, index) in financialObj[editableTabsValue] v-for="(item, index) in financialObj[editableTabsValue-1]
.expenseCategoryTypeRules" .expenseCategoryTypeRules"
> >
<el-form-item :key="index" :label="item.expenseCategoryName"> <el-form-item :key="index" :label="item.expenseCategoryName">
<span>{{ <span>{{
getExpenseCategoryCalculateType( getExpenseCategoryCalculateType(
item.expenseCategoryCalculateType, item.expenseCategoryCalculateType,
item.expenseCategoryValue item.expenseCategoryValue,
item.expenseCategoryName
) )
}}</span> }}</span>
</el-form-item> </el-form-item>
...@@ -76,11 +77,11 @@ export default { ...@@ -76,11 +77,11 @@ export default {
} }
}, },
methods: { methods: {
getExpenseCategoryCalculateType(value, num) { getExpenseCategoryCalculateType(value, num,name) {
if (!value || num == null) { if (!value || num == null) {
return "-" return "-"
} }
// console.log('num: ', num)
let res let res
switch (value) { switch (value) {
case 1: case 1:
...@@ -193,7 +194,6 @@ export default { ...@@ -193,7 +194,6 @@ export default {
}) })
this.$set(item, "expenseCategoryTypeRules", item.expenseCategoryTypeRules) this.$set(item, "expenseCategoryTypeRules", item.expenseCategoryTypeRules)
}) })
console.log(this.financialObj,76666)
} }
} }
} }
......
...@@ -4,8 +4,21 @@ ...@@ -4,8 +4,21 @@
<div class="title"> <div class="title">
<span>基础信息</span> <span>基础信息</span>
</div> </div>
<div style="padding: 20px;"> <div style="padding: 20px 20px 0;">
<div>啦啦啦</div> <el-form :model="basicInfo" label-width="150px">
<el-form-item v-for="(item, index) in editFormData" :key="index" class="form-item" :style="{ 'width': [2,7].includes(item.inputType) ? '100%' : '48%'}">
<span slot="label" class="label">{{item.title}}:</span>
<div v-if="item.inputType == 7">
<div v-for="(k, kIdx) in item.fileList" :key="kIdx">
<span>{{k.fileName}}</span>
<el-link type="primary" class="download" :href="k.url">
下载
</el-link>
</div>
</div>
<span v-else>{{item.showValue}}</span>
</el-form-item>
</el-form>
</div> </div>
</div> </div>
</template> </template>
...@@ -13,15 +26,85 @@ ...@@ -13,15 +26,85 @@
<script> <script>
export default { export default {
name: 'BaseInfo', name: 'BaseInfo',
props: {}, props: {
basicInfo: {
type: Object,
default: () => { }
}
},
watch: {
basicInfo(val) {
if (val?.basicApproveInfo) {
this.dealFormData()
}
}
},
data() { data() {
//这里存放数据 //这里存放数据
return { return {
/** 动态表单
* inputType 输入类型,1.文本;2.多行文本;3.数字;4.金额;5.单选;6.多选;7.附件;
*/
editFormData: []
}
},
mounted() {
},
methods: {
dealFormData() {
this.editFormData = JSON.parse(this.basicInfo.basicApproveInfo)
// console.log(this.editFormData, 'this.editFormData---')
this.editFormData.forEach(item => {
// 直接展示
if ([1, 2, 3, 4].includes(item.inputType)) {
item.showValue = item.value
} else if (item.inputType == 5) {
// 单选
item.showValue = item.options.find(k => k.key == item.value)?.value || ''
} else if (item.inputType == 6) {
// 多选
const list = item.value.split(',')
item.showValue = ''
list.forEach((m, idx) => {
let label = item.options.find(k => k.key == m)?.value || ''
item.showValue = item.showValue + (idx != 0 ? (',' + label) : label)
})
} else if (item.inputType == 7) {
// 附件
item.fileList = []
const valueList = item.value.split(',')
valueList.forEach(k => {
item.fileList.push({
url: k,
fileName: k.split('/')[k.split('/').length - 1]
})
})
}
})
} }
}, },
methods: {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss">
@import "../../style/editdetailCon.scss"; @import "../../style/editdetailCon.scss";
.base-info {
.el-form-item__label {
padding-right: 0;
}
.el-form-item__label,
.el-form-item__content {
line-height: 20px !important;
}
.form-item {
display: inline-block;
line-height: 20px;
margin-bottom: 20px;
}
.download {
margin-left: 8px;
}
}
</style> </style>
...@@ -94,6 +94,8 @@ ...@@ -94,6 +94,8 @@
:prop="classificationObj.categoryType == 3 ? 'packageGoods' : 'empty'" :prop="classificationObj.categoryType == 3 ? 'packageGoods' : 'empty'"
label-width="20px" label-width="20px"
> >
<!-- @visible-change="visibleChangePackage" :remote-method="remoteMethodPackage"
v-el-select-loadmore-package="interestsLoadmorePackage" -->
<el-select <el-select
v-model="classificationObj.packageGoods" v-model="classificationObj.packageGoods"
multiple multiple
...@@ -101,9 +103,6 @@ ...@@ -101,9 +103,6 @@
remote remote
reserve-keyword reserve-keyword
placeholder="请选择套餐商品" placeholder="请选择套餐商品"
@visible-change="visibleChangePackage"
:remote-method="remoteMethodPackage"
v-el-select-loadmore-package="interestsLoadmorePackage"
style="width: 370px" style="width: 370px"
value-key="packageCode" value-key="packageCode"
filterable filterable
...@@ -380,14 +379,14 @@ export default { ...@@ -380,14 +379,14 @@ export default {
// expenseCategoryRules: [] // expenseCategoryRules: []
shop4sDeductChargeFlag: "Y", // 导流方POS机支付是否扣除手续费(Y:扣除,N:不扣) shop4sDeductChargeFlag: "Y", // 导流方POS机支付是否扣除手续费(Y:扣除,N:不扣)
partnerDeductChargeFlag: "Y", // 服务商POS机支付是否扣除手续费(Y:扣除,N:不扣) partnerDeductChargeFlag: "Y", // 服务商POS机支付是否扣除手续费(Y:扣除,N:不扣)
goodsCostFlag: "Y", // 平台方是否扣除产品成本(Y:计算,N:不计算) goodsCostFlag: "N", // 平台方是否扣除产品成本(Y:计算,N:不计算)
groupType: 1, groupType: 1,
categoryType: "", // 分类类别 categoryType: "", // 分类类别
upgradeGoods: [], // 具体商品 upgradeGoods: [], // 具体商品
packageGoods: [], packageGoods: [],
virtualAccountCostFlag: "Y", virtualAccountCostFlag: "N",
recoveryCostFlag: "Y", recoveryCostFlag: "N",
djCostFlag: "Y", djCostFlag: "N",
thirdPartyCostFlag: "Y", thirdPartyCostFlag: "Y",
goodsSource: 1 goodsSource: 1
// expenseCategoryRules: [ // expenseCategoryRules: [
...@@ -439,12 +438,13 @@ export default { ...@@ -439,12 +438,13 @@ export default {
// 不可选择的商品分类 // 不可选择的商品分类
disabledGoodsTypeList() { disabledGoodsTypeList() {
// 根据区别已选的过滤出该组件自己勾选的 剩下的就是其他组件选的 要禁用 // 根据区别已选的过滤出该组件自己勾选的 剩下的就是其他组件选的 要禁用
const selectList = this.classificationObj.goodsTypes const selectList = this.classificationObj.goodsTypes || []
// console.log(selectList) // console.log(selectList)
// goodsList // goodsList
const list = this.goodsSelectList.filter((item) => { const list = this.goodsSelectList.filter((item) => {
// item.goodsType // item.goodsType
// const flag = selectList.findIndex(el => { return el.goodsType == item.goodsType }) // const flag = selectList.findIndex(el => { return el.goodsType == item.goodsType })
console.log(selectList, "selectList")
if ( if (
selectList.findIndex((el) => { selectList.findIndex((el) => {
return el.goodsType == item.goodsType return el.goodsType == item.goodsType
...@@ -471,7 +471,8 @@ export default { ...@@ -471,7 +471,8 @@ export default {
}, },
// 不可选择的商品套餐 // 不可选择的商品套餐
disabledPackageGoodsList() { disabledPackageGoodsList() {
const selectList = this.classificationObj.packageGoods const selectList = this.classificationObj.packageGoods || []
console.log(selectList, "selectList")
const list = this.selectPackageGoodsList.filter((item) => { const list = this.selectPackageGoodsList.filter((item) => {
if ( if (
selectList.findIndex((el) => { selectList.findIndex((el) => {
...@@ -488,7 +489,6 @@ export default { ...@@ -488,7 +489,6 @@ export default {
// 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户 // 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户
tableSelectOptions: { tableSelectOptions: {
get() { get() {
console.log(this.financialLedgerParty, "this.financialLedgerParty")
const info = this.financialLedgerParty const info = this.financialLedgerParty
// 平台方 // 平台方
const platformSideobj = { const platformSideobj = {
...@@ -496,12 +496,18 @@ export default { ...@@ -496,12 +496,18 @@ export default {
merchantName: info.realityPlatformMerchantName, merchantName: info.realityPlatformMerchantName,
targetMerchantType: 1 targetMerchantType: 1
} }
// 4s 店 // 流量方
const merchantSideobj = { const merchantSideobj = {
merchantId: info.realityShopMerchantId, // 实际分账商户方商户id(嘀加智慧云为-1) merchantId: info.realityShopMerchantId, // 实际分账商户方商户id(嘀加智慧云为-1)
merchantName: info.realityShopMerchantName, merchantName: info.realityShopMerchantName,
targetMerchantType: 3 targetMerchantType: 3
} }
// 服务商
const serviceObj = {
merchantId: info.partnerMerchantId,
merchantName: info.partnerMerchantName,
targetMerchantType: 2
}
// 如果勾选商户 就追加进去 // 如果勾选商户 就追加进去
if (info.djzhySubMerchantId) { if (info.djzhySubMerchantId) {
const dizhySubMerchantObj = { const dizhySubMerchantObj = {
...@@ -512,17 +518,15 @@ export default { ...@@ -512,17 +518,15 @@ export default {
return [ return [
platformSideobj, platformSideobj,
dizhySubMerchantObj, dizhySubMerchantObj,
...this.serviceSelectList, merchantSideobj,
merchantSideobj serviceObj
] ]
} }
return info.realityShopMerchantId return [platformSideobj, merchantSideobj, serviceObj]
? [platformSideobj, ...this.serviceSelectList, merchantSideobj]
: [platformSideobj, ...this.serviceSelectList]
} }
}, },
tableClassificationObjSelect() { tableClassificationObjSelect() {
console.log(this.classificationObjSelect, "this.classificationObjSelect") // console.log(this.classificationObjSelect, "this.classificationObjSelect")
// return false // return false
// let obj // let obj
const filterObj = deepClone(this.classificationObjSelect) const filterObj = deepClone(this.classificationObjSelect)
...@@ -533,7 +537,6 @@ export default { ...@@ -533,7 +537,6 @@ export default {
obj[key] = [] obj[key] = []
} }
filterObj[key].map((item) => { filterObj[key].map((item) => {
if (item.formType == 2) { if (item.formType == 2) {
obj[key].push(...item.feeCategoryNameList) obj[key].push(...item.feeCategoryNameList)
} else { } else {
...@@ -661,6 +664,9 @@ export default { ...@@ -661,6 +664,9 @@ export default {
handler(val, oldVal) { handler(val, oldVal) {
if (val) { if (val) {
this.copyPackageGoodsList = deepClone(val) this.copyPackageGoodsList = deepClone(val)
// 然后对比一下当前选择的套件是否还在队列,不在就删除
this.classificationObj.packageGoods?.length &&
this.diffPackageGoodsList()
} }
}, },
deep: true deep: true
...@@ -748,6 +754,27 @@ export default { ...@@ -748,6 +754,27 @@ export default {
methods: { methods: {
...mapMutations("FinancialRules", ["setGoodsSource", "delGoodsSource"]), ...mapMutations("FinancialRules", ["setGoodsSource", "delGoodsSource"]),
diffPackageGoodsList() {
// copyPackageGoodsList 如果有变动,对比一下当前选择的套件是否还在队列,不在就删除
// 找到需要删除的对象
const deleteObj = this.classificationObj.packageGoods.find((item) => {
return this.copyPackageGoodsList.every(
(el) => el.packageCode != item.packageCode
)
})
// 如果找到需要删除的对象
if (deleteObj) {
this.$emit("deletePackageGoodsItem", deleteObj)
// 直接过滤掉删除的对象
this.classificationObj.packageGoods =
this.classificationObj.packageGoods.filter(
(item) => item.packageCode !== deleteObj.packageCode
)
}
console.log(deleteObj, "deleteObj")
},
clearValidate() { clearValidate() {
this.$refs.classification.clearValidate([ this.$refs.classification.clearValidate([
"goodsTypes", "goodsTypes",
...@@ -1181,7 +1208,7 @@ export default { ...@@ -1181,7 +1208,7 @@ export default {
} }
// console.log(editObj, 'obj') // console.log(editObj, 'obj')
this.classificationObj[key].push(Object.assign(obj, editObj)) this.classificationObj[key].push(Object.assign(obj, editObj))
console.log(this.classificationObj, " this.classificationObj") // console.log(this.classificationObj, " this.classificationObj")
// debugger // debugger
// this.classificationObj[key].push(Object.assign(obj)) // this.classificationObj[key].push(Object.assign(obj))
// 流量方分润/其他费用是按整单计算 服务商分润 均为按整单计算 不可操作 // 流量方分润/其他费用是按整单计算 服务商分润 均为按整单计算 不可操作
...@@ -1326,7 +1353,7 @@ export default { ...@@ -1326,7 +1353,7 @@ export default {
}, },
getParams() { getParams() {
const obj = deepClone(this.classificationObj) const obj = deepClone(this.classificationObj)
const expenseCategoryRules = [] let expenseCategoryRules = []
// 合并出对象的集合 类目对象合集 // 合并出对象的集合 类目对象合集
for (const key in obj) { for (const key in obj) {
if ( if (
...@@ -1377,8 +1404,11 @@ export default { ...@@ -1377,8 +1404,11 @@ export default {
// categoryType: obj.categoryType, // categoryType: obj.categoryType,
// goodsTypeGroupRelations: obj.categoryType == 1 ? goodsTypes : upgradeGoods, // goodsTypeGroupRelations: obj.categoryType == 1 ? goodsTypes : upgradeGoods,
console.log(obj, "obj") expenseCategoryRules = expenseCategoryRules.filter(
(item) => item.expenseCategoryId != 701
)
// debugger // debugger
console.log(obj, expenseCategoryRules, "obj")
const returnObj = { const returnObj = {
expenseCategoryRules, expenseCategoryRules,
shop4sDeductChargeFlag: obj.shop4sDeductChargeFlag, shop4sDeductChargeFlag: obj.shop4sDeductChargeFlag,
...@@ -1415,10 +1445,8 @@ export default { ...@@ -1415,10 +1445,8 @@ export default {
this.$refs.classification.validate(async (valid) => { this.$refs.classification.validate(async (valid) => {
// console.log(valid) // console.log(valid)
if (valid) { if (valid) {
// console.log(this.getParams())
const obj = this.getParams() const obj = this.getParams()
const res = await this.$refs.tableAccount.handleConfirm() const res = await this.$refs.tableAccount.handleConfirm()
// console.log("res", { ...obj, merchantDistributionRules: res })
res res
? resolve({ ...obj, merchantDistributionRules: res }) ? resolve({ ...obj, merchantDistributionRules: res })
: resolve(false) : resolve(false)
...@@ -1433,31 +1461,15 @@ export default { ...@@ -1433,31 +1461,15 @@ export default {
const res = this.$refs.tableAccount.getTableAccountParams() const res = this.$refs.tableAccount.getTableAccountParams()
// console.log("res", { ...obj, merchantDistributionRules: res }) // console.log("res", { ...obj, merchantDistributionRules: res })
return { ...obj, merchantDistributionRules: res } return { ...obj, merchantDistributionRules: res }
// : resolve(false)
// return new Promise((resolve, reject) => {
// this.$refs.classification.validate(async (valid) => {
// console.log(valid)
// if (valid) {
// // console.log(this.getParams())
// const obj = this.getParams()
// const res = await this.$refs.tableAccount.handleConfirm()
// console.log("res", { ...obj, merchantDistributionRules: res })
// res
// ? resolve({ ...obj, merchantDistributionRules: res })
// : resolve(false)
// } else {
// resolve(false)
// }
// })
// })
}, },
setCalculateError(index, item, flag = true) { setCalculateError(index, item, flag = true) {
if (this.classificationObj[item][index]) if (this.classificationObj[item][index]) {
this.$set( this.$set(
this.classificationObj[item][index], this.classificationObj[item][index],
"calculateModeError", "calculateModeError",
flag flag
) )
}
} }
}, },
beforeDestroy() { beforeDestroy() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<d2-container class="edit-contract" v-loading="isLoad"> <d2-container class="edit-contract" v-loading="isLoad">
<!-- 基础信息 --> <!-- 基础信息 -->
<base-info></base-info> <base-info :basicInfo="basicInfo"></base-info>
<!-- 流量方信息 --> <!-- 流量方信息 -->
<shop-merchant-info></shop-merchant-info> <shop-merchant-info></shop-merchant-info>
<!-- 上架商品及测算 --> <!-- 上架商品及测算 -->
...@@ -20,22 +20,23 @@ ...@@ -20,22 +20,23 @@
</template> </template>
<script> <script>
import { mapActions } from "vuex" import { mapActions } from 'vuex'
import BaseInfo from "./components/detailCon/BaseInfo.vue" import BaseInfo from './components/editCon/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" import { merchantSettleDistributeRuleLastRule, getBusisDetailBasic } from "@api/shelfManage"
export default { export default {
name: "contractDetail", name: "contractDetail",
data() { data() {
return { return {
isLoad: true, isLoad: true,
editData: {}, editData: {},
basicInfo: {},
divisiObj: {}, divisiObj: {},
financialObj: {} financialObj: {}
} };
}, },
components: { components: {
...@@ -47,13 +48,14 @@ export default { ...@@ -47,13 +48,14 @@ export default {
}, },
computed: { computed: {
routerInfo() { routerInfo() {
return this.$route.query.params return this.$route.params
? JSON.parse(this.$route.query.params) ? this.$route.params
: "" : ""
} }
}, },
mounted() { mounted() {
this.getDetail() this.getDetail()
this.getBasicDetail()
this.getFinaceObj() this.getFinaceObj()
}, },
//方法集合 //方法集合
...@@ -61,16 +63,27 @@ export default { ...@@ -61,16 +63,27 @@ export default {
...mapActions({ ...mapActions({
close: "d2admin/page/close" close: "d2admin/page/close"
}), }),
getBasicDetail() {
getBusisDetailBasic({ id: 1 }).then(res => {
this.basicInfo = res.basicInfo || {}
this.merchantEditData = res.createBusinessApproveMerchant || {}
})
},
getDetail() { getDetail() {
this.isLoad = false this.isLoad = false
}, },
getFinaceObj() { getFinaceObj() {
// const { id } = this.routerInfo; const { id } = this.routerInfo;
merchantSettleDistributeRuleLastRule({ merchantSettleDistributeRuleLastRule({
id: 1 id
}).then((result) => { }).then((result) => {
this.divisiObj = result.merchantSettleDistributeRule this.divisiObj = Object.assign(result.merchantSettleDistributeRule,{
partnerMerchantName:result.createBusinessApproveMerchant.partnerMerchantName,
partnerMerchantId:result.createBusinessApproveMerchant.partnerMerchantId
})
this.financialObj = result.merchantReconciliationRule this.financialObj = result.merchantReconciliationRule
}) })
}, },
handleBack() { handleBack() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com' * @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-02-24 21:48:44 * @Date: 2025-02-24 21:48:44
* @LastEditors: 'wangzhihui' '1733904062@qq.com' * @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-02-25 17:57:05 * @LastEditTime: 2025-02-27 17:02:40
* @FilePath: \dj-car-life-system\src\views\goods\shelfManage\editContract.vue * @FilePath: \dj-car-life-system\src\views\goods\shelfManage\editContract.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -10,50 +10,64 @@ ...@@ -10,50 +10,64 @@
<template> <template>
<d2-container class="edit-contract" v-loading="isLoad"> <d2-container class="edit-contract" v-loading="isLoad">
<!-- 基础信息 --> <!-- 基础信息 -->
<base-info></base-info> <base-info :basic-info="basicInfo"></base-info>
<!-- 流量方信息 --> <!-- 流量方信息 -->
<shop-merchant-info :edit-data="editData" @addMerchant="handleAddMerchant"></shop-merchant-info> <shop-merchant-info
ref="shopMerchant"
:edit-data="merchantEditData"
@addMerchant="handleAddMerchant"
></shop-merchant-info>
<!-- 流量方信息 - 新增 - 新增商户 --> <!-- 流量方信息 - 新增 - 新增商户 -->
<add-merchant :addMerVisible="addMerVisible" @handleClose="handleAddMerchant"></add-merchant> <add-merchant
v-if="addMerVisible"
:add-mer-visible="addMerVisible"
@handleClose="handleAddMerchant"
></add-merchant>
<!-- 上架商品及测算 --> <!-- 上架商品及测算 -->
<goods-info></goods-info> <goods-info ref="goodsInfo" :record-id="routeObj.id"></goods-info>
<!-- 分账配置 --> <!-- 分账配置 -->
<division-config ref="divisionConfig"></division-config> <division-config ref="divisionConfig"></division-config>
<!-- 对账配置 --> <!-- 对账配置 -->
<finance-config ref="financeConfig"></finance-config> <finance-config ref="financeConfig"></finance-config>
<div style="margin-top: 40px;text-align: center;"> <div style="margin-top: 40px; text-align: center">
<el-button type="primary" @click="handleConfirm(1)"> <el-button type="primary" @click="handleConfirm('save')">
提交 提交
</el-button> </el-button>
<!-- 草稿状态/已下架/新增显示 --> <!-- 草稿状态/已下架/新增显示 -->
<el-button type="primary" plain @click="handleConfirm(2)"> <el-button type="primary" plain @click="handleConfirm('draft')">
暂存 暂存
</el-button> </el-button>
<el-button class="cancel-btn" @click="handleCancel"> <el-button class="cancel-btn" @click="handleCancel"> 取消 </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/editCon/BaseInfo.vue' import BaseInfo from "./components/editCon/BaseInfo.vue"
import ShopMerchantInfo from './components/editCon/ShopMerchantInfo' import ShopMerchantInfo from "./components/editCon/ShopMerchantInfo"
import AddMerchant from './components/editCon/AddMerchant' import AddMerchant from "./components/editCon/AddMerchant"
import GoodsInfo from './components/editCon/GoodsInfo.vue' import GoodsInfo from "./components/editCon/GoodsInfo.vue"
import DivisionConfig from './components/editCon/DivisionConfig.vue' import DivisionConfig from "./components/editCon/DivisionConfig.vue"
import FinanceConfig from './components/editCon/FinanceConfig.vue' import FinanceConfig from "./components/editCon/FinanceConfig.vue"
import {
getBusisDetailBasic,
operationConfirm,
operationConfirmJson
} from "@api/shelfManage"
export default { export default {
name: 'EditContract', name: "EditContract",
data() { data() {
return { return {
routeObj: {},
isLoad: true, isLoad: true,
addMerVisible: false, addMerVisible: false,
basicInfo: {},
merchantEditData: {},
editData: { editData: {
merchantName: '', merchantName: ""
}, }
}; }
}, },
components: { components: {
...@@ -65,31 +79,74 @@ export default { ...@@ -65,31 +79,74 @@ export default {
FinanceConfig FinanceConfig
}, },
mounted() { mounted() {
this.getDetail() this.routeObj = this.$route.params
this.isLoad = true
this.getBasicDetail()
}, },
//方法集合 // 方法集合
methods: { methods: {
...mapActions({ ...mapActions({
close: 'd2admin/page/close' close: "d2admin/page/close"
}), }),
getDetail() { getBasicDetail() {
this.isLoad = false getBusisDetailBasic({ id: this.routeObj.id })
.then((res) => {
console.log(res, "res----")
this.basicInfo = res.basicInfo || {}
this.merchantEditData = res.createBusinessApproveMerchant || {}
})
.finally(() => {
this.isLoad = false
})
}, },
handleAddMerchant() { handleAddMerchant() {
console.log('新建---') console.log("新建---")
this.addMerVisible = !this.addMerVisible this.addMerVisible = !this.addMerVisible
}, },
handleConfirm() {
this.$refs.divisionConfig.submit() async handleConfirm(confirmType) {
this.$refs.financeConfig.submit() if (confirmType == "save") {
const divisionSubmitResult = await this.$refs.divisionConfig.submit()
const financeSubmitResult = await this.$refs.financeConfig.submit()
const merchantSubmitResult = await this.$refs.merchant.submit()
if (
!merchantSubmitResult ||
!divisionSubmitResult ||
!financeSubmitResult
) {
// 校验失败,处理逻辑
return false
}
} else {
// 存草稿
this.$refs.divisionConfig.handleWorking()
this.$refs.financeConfig.handleWorking()
}
var params = {
saveDraft: confirmType == "draft",
businessCode: this.routeObj.businessCode,
goods: this.$refs.goodsInfo.submitParamsGoods(),
packages: this.$refs.goodsInfo.submitParamsPackages(),
merchant: this.$refs.shopMerchant.editData,
settleDistributeRule: this.$refs.divisionConfig.submitParams,
reconciliationRule: this.$refs.financeConfig.submitParams
}
console.log(params, "params----")
operationConfirmJson({ dataString: JSON.stringify(params) }).then(
(res) => {
console.log(res)
this.$message.success("操作成功")
this.handleCancel()
}
)
}, },
handleCancel() { handleCancel() {
this.close({ tagName: '/shelfManage' }) this.close({ tagName: "/shelfManage" })
this.$router.push({ name: 'shelfManage' }) this.$router.push({ name: "shelfManage" })
this.close({ tagName: '/editContract' }) this.close({ tagName: "/editContract" })
} }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cancel-btn { .cancel-btn {
......
...@@ -184,7 +184,8 @@ import { mapActions, mapState } from 'vuex' ...@@ -184,7 +184,8 @@ import { mapActions, mapState } from 'vuex'
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
import { uploadFile } from "@/api/sys.base" import { uploadFile } from "@/api/sys.base"
import { import {
getWorkwechatTemplate getWorkwechatTemplate,
saveApprove
} from "@api/shelfManage.js" } from "@api/shelfManage.js"
export default { export default {
name: "EditShelf", name: "EditShelf",
...@@ -466,27 +467,33 @@ export default { ...@@ -466,27 +467,33 @@ export default {
} }
return item return item
}) })
// this.itemList = this.itemList.map((item) => {
// if (item.inputType == 1 || item.inputType == 2) { return item }
// })
console.log("itemList", this.itemList) console.log("itemList", this.itemList)
const params = {} const params = {}
params.file = this.infoForm.fileInfo params.file = this.infoForm.fileInfo
params.basicApproveInfo = JSON.stringify(this.itemList) params.basicApproveInfo = JSON.stringify(this.itemList)
const approveType = this.$route.params.operate == "add" ? 1 : 2
params.approveType = approveType
console.log('params', params) console.log('params', params)
// console.log("JSON.stringify(this.itemList)", JSON.stringify(this.itemList)) saveApprove(params)
// merchantTargetConfigUpdate(params) .then((res) => {
// .then((res) => { console.log(res)
// console.log(res, "merchantTargetConfigUpdate") this.$notify({
// this.$notify({ type: "success",
// type: "success", title: "保存成功"
// title: "保存成功" })
// }) this.close({ tagName: "/editShelf" })
// this.$router.push("/inStoreGoalsConfig") this.$router.push({ name: "shelfManage" })
// }) })
// .catch((err) => { .catch((err) => {
// console.log(err) console.log(err)
// }) })
// } else { } else {
// console.log("error submit!!") console.log("error submit!!")
// return false return false
} }
}) })
} }
......
...@@ -64,7 +64,12 @@ ...@@ -64,7 +64,12 @@
</el-form-item></el-col </el-form-item></el-col
> >
<el-col :span="8"> <el-col :span="8">
<el-form-item label="积分收益:" class="halfItem"> <el-form-item
:label="
detailInfo.failType == '退款' ? '退回积分' : '积分收益:'
"
class="halfItem"
>
{{ {{
detailInfo.integralIncome detailInfo.integralIncome
? "¥" + detailInfo.integralIncome || 0 ? "¥" + detailInfo.integralIncome || 0
...@@ -127,17 +132,28 @@ ...@@ -127,17 +132,28 @@
> >
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8" v-if="detailInfo.failType == '退款'">
<el-form-item label="退款类型:" class="halfItem"> <el-form-item label="退款类型:" class="halfItem">
{{ detailInfo.status }} {{
detailInfo.refundType
? detailInfo.refundType == 1
? "全额退款"
: "部分退款"
: "-"
}}
</el-form-item></el-col </el-form-item></el-col
> >
<el-col :span="8"> <el-col
<el-form-item label="订单总积分:" class="halfItem"> :span="8"
{{ detailInfo.status }} v-if="
</el-form-item></el-col detailInfo.status == '已审核' || detailInfo.failType == '退款'
"
> >
<el-form-item label="订单总积分:" class="halfItem">
{{ addScore ? addScore : "-" }}
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
...@@ -165,15 +181,18 @@ ...@@ -165,15 +181,18 @@
</div> </div>
<div v-else class="empty">暂无记录</div> <div v-else class="empty">暂无记录</div>
</div> </div>
<div class="examine-record"> <div
class="examine-record"
v-if="detailInfo.status == '已审核' || detailInfo.failType == '退款'"
>
<div class="title">操作记录</div> <div class="title">操作记录</div>
<div <div
class="record-div" class="record-div"
v-if="detailInfo.operationList && detailInfo.operationList.length > 0" v-if="operationList && operationList.length > 0"
> >
<div <div
class="record-div-d" class="record-div-d"
v-for="(item, index) in detailInfo.operationList" v-for="(item, index) in operationList"
:key="index" :key="index"
> >
<div class="div-operator">操作人:{{ item.operator }}</div> <div class="div-operator">操作人:{{ item.operator }}</div>
...@@ -209,7 +228,7 @@ ...@@ -209,7 +228,7 @@
<script> <script>
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import { getPointDetail } from "@api/point" import { getPointDetail, getOperationRecord, getOrderByScore } from "@api/point"
export default { export default {
name: "DetailDialog", name: "DetailDialog",
props: { props: {
...@@ -253,8 +272,10 @@ export default { ...@@ -253,8 +272,10 @@ export default {
width: "1080px" width: "1080px"
} }
}, },
addScore:0,
detailInfo: {}, detailInfo: {
},
operationList: [],
loading: false, loading: false,
imgVisible: false, imgVisible: false,
photoList: [], photoList: [],
...@@ -284,11 +305,38 @@ export default { ...@@ -284,11 +305,38 @@ export default {
: "错单" : "错单"
: "--" : "--"
this.detailInfo = res this.detailInfo = res
this.photoList = res.attachments ? res.attachments.split(",") : [] this.photoList = res.attachments ? res.attachments.split(",") : []
if (
this.detailInfo.status == "已审核" ||
this.detailInfo.failType == '退款'
) {
this.getScore()
this.getOrderOperateData()
}
} }
}) })
}, },
getScore() {
getOrderByScore({
orderCode: this.detailInfo.orderCode
}).then((res) => {
this.addScore = res.addScore
// this.$set(this.detailInfo, "addScore", res.addScore)
})
},
getOrderOperateData() {
let params = {
orderCode: this.detailInfo.orderCode,
operationType: 1
}
getOperationRecord(params).then((res) => {
console.log(res)
this.operationList = res
})
},
handleEnlargeImg(url) { handleEnlargeImg(url) {
this.imgVisible = !this.imgVisible this.imgVisible = !this.imgVisible
this.imgList = url this.imgList = url
...@@ -352,7 +400,7 @@ export default { ...@@ -352,7 +400,7 @@ export default {
align-items: center; align-items: center;
} }
.div-operator { .div-operator {
min-width:200px; min-width: 200px;
margin-right: 40px; margin-right: 40px;
white-space: nowrap; white-space: nowrap;
} }
......
...@@ -297,7 +297,6 @@ export default { ...@@ -297,7 +297,6 @@ export default {
}) })
}, },
getOptionsList() { getOptionsList() {
console.log(111111111111)
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === "select") { if (item.type === "select") {
if ( if (
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
> >
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- <el-button type="primary" size="mini" @click="handleExport">
导出
</el-button> -->
<div> <div>
<span style="margin-right: 10px" <span style="margin-right: 10px"
><auth-button category="Button" :show-btn-ids="['9140105']" ><auth-button category="Button" :show-btn-ids="['9140105']"
...@@ -67,11 +64,14 @@ ...@@ -67,11 +64,14 @@
:show-btn-ids="['9140101']" :show-btn-ids="['9140101']"
v-if="scope.scope.status == 0 && scope.scope.supervisorAudit == 1" v-if="scope.scope.status == 0 && scope.scope.supervisorAudit == 1"
/> />
<!-- v-if=" <auth-button
v-if="
scope.scope.status == 1 && scope.scope.status == 1 &&
scope.scope.pointsRefundAvailable == 'Y' scope.scope.pointsRefundAvailable == 'Y'
" --> "
<auth-button :data="scope.scope" :show-btn-ids="['9140104']" /> :data="scope.scope"
:show-btn-ids="['9140104']"
/>
</span> </span>
</div> </div>
</d2-table> </d2-table>
...@@ -116,7 +116,10 @@ import { ...@@ -116,7 +116,10 @@ import {
getShopMerchantList, getShopMerchantList,
pointCheck, pointCheck,
exportFile, exportFile,
markAsRefunded markAsRefunded,
refreshData,
getOrderByScore,
getOperationRecord
} from "@api/point" } from "@api/point"
export default { export default {
name: "PointList", name: "PointList",
...@@ -128,10 +131,10 @@ export default { ...@@ -128,10 +131,10 @@ export default {
if (!value) { if (!value) {
return callback(new Error("请输入退回积分")) return callback(new Error("请输入退回积分"))
} }
if (!Number.isInteger(+value)) { if (!Util.validateNumber(value)) {
callback(new Error("请输入数字值")) callback(new Error("输入范围为大于0的数字,至少支持小数点后两位"))
} else { } else {
if (value > this.refundForm.maXPoints) { if (value > this.refundForm.integralIncome) {
callback(new Error("输入的积分超过当前订单最大积分")) callback(new Error("输入的积分超过当前订单最大积分"))
} else { } else {
callback() callback()
...@@ -140,7 +143,7 @@ export default { ...@@ -140,7 +143,7 @@ export default {
} }
return { return {
show: true, show: true,
handleFormRef: 'handleFormRef', handleFormRef: "handleFormRef",
refundVisible: false, refundVisible: false,
activeName: "4", activeName: "4",
tabPaneList: [ tabPaneList: [
...@@ -162,7 +165,7 @@ export default { ...@@ -162,7 +165,7 @@ export default {
}, },
{ {
label: "未兑换", label: "未兑换",
name: "3" name: "-1"
} }
], ],
statusEnum: { statusEnum: {
...@@ -610,16 +613,37 @@ export default { ...@@ -610,16 +613,37 @@ export default {
//标记退款 //标记退款
handleRefund(data) { handleRefund(data) {
this.refundVisible = true this.refundVisible = true
this.refundForm.id = data.id
this.refundForm.orderCode = data.orderCode this.refundForm.orderCode = data.orderCode
this.refundForm.refundType = 1 //退款类型(1:全退,2:部分退),
this.refundForm.refundPoints = 10000 this.refundForm.refundPoints = data.integralIncome
this.refundForm.maXPoints =10000 //当前积分能抵扣的最大值
if(data.operator==true){ this.getScore()
//对应订单若操作过一次部分退款,则后续进来后只能选择“部分退款”,全部退款默认置灰不可选 //
this.refundFormData[0].optionList[0].isDisabled=true // this.refundForm.refundPoints = 10000
} //
this.updateDisable() // if(data.operator==true){
// //对应订单若操作过一次部分退款,则后续进来后只能选择“部分退款”,全部退款默认置灰不可选
// this.refundFormData[0].optionList[0].isDisabled=true
// }
// this.updateDisable()
},
getScore() {
getOrderByScore({
orderCode: this.refundForm.orderCode
}).then((res) => {
this.refundForm.integralIncome = res.addScore
//最大积分
if (this.refundForm.refundPoints == this.refundForm.integralIncome) {
this.refundForm.refundType = 1 //退款类型(1:全退,2:部分退),
this.refundFormData[0].optionList[0].isDisabled = false
} else {
this.refundForm.refundType = 2
this.refundFormData[0].optionList[0].isDisabled = true
}
this.updateDisable()
})
}, },
updateDisable() { updateDisable() {
let disabled = this.refundForm.refundType == 2 ? false : true let disabled = this.refundForm.refundType == 2 ? false : true
...@@ -637,8 +661,8 @@ export default { ...@@ -637,8 +661,8 @@ export default {
if (valid) { if (valid) {
markAsRefunded({ markAsRefunded({
orderCode: this.refundForm.orderCode, orderCode: this.refundForm.orderCode,
refundType:this.refundForm.refundType, refundType: this.refundForm.refundType,
refundPoints:this.refundForm.refundPoints refundPoints: this.refundForm.refundPoints
}).then((res) => { }).then((res) => {
if (res) { if (res) {
this.$message.success("退款成功!") this.$message.success("退款成功!")
...@@ -652,21 +676,23 @@ export default { ...@@ -652,21 +676,23 @@ export default {
}, },
//刷新 //刷新
handleRefresh() { handleRefresh() {
let params = {
...this.searchFormSearch,
...this.$refs.pointTable.page
}
this.$confirm("确定需要刷新并同步订单信息", "", { this.$confirm("确定需要刷新并同步订单信息", "", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
callback: (action) => { callback: (action) => {
// if (action == "confirm") { if (action == "confirm") {
// markAsRefunded({ refreshData(params).then((res) => {
// orderCode: data.orderCode if (res) {
// }).then((res) => { this.$message.success("订单信息已同步完成!")
// if (res) { this.handleSearch()
// this.$message.success("订单信息已同步完成!") }
// this.handleSearch() })
// } }
// })
// }
} }
}) })
}, },
......
...@@ -50,8 +50,9 @@ export default { ...@@ -50,8 +50,9 @@ export default {
staffName: "", staffName: "",
staffPhone: "", staffPhone: "",
merchantId: "", merchantId: "",
withdrawalTime:[], rewardTime:[],
rewardTime:[] reviewTime:[],
successTime:[]
}, },
searchFormSearch:{ searchFormSearch:{
...@@ -95,14 +96,14 @@ export default { ...@@ -95,14 +96,14 @@ export default {
// }, // },
{ {
label: "积分付款时间", label: "积分付款时间",
name: "rewardTime", name: "reviewTime",
type: "datePicker", type: "datePicker",
isClear: true, isClear: true,
pickerOptions: "rangePickerOptions" pickerOptions: "rangePickerOptions"
}, },
{ {
label: "积分到账时间", label: "积分到账时间",
name: "withdrawalTime", name: "successTime",
type: "datePicker", type: "datePicker",
isClear: true, isClear: true,
pickerOptions: "rangePickerOptions" pickerOptions: "rangePickerOptions"
...@@ -212,20 +213,33 @@ export default { ...@@ -212,20 +213,33 @@ export default {
"YYYY-MM-DD" "YYYY-MM-DD"
) + " 23:59:59" ) + " 23:59:59"
} }
if (this.searchFormSearch.withdrawalTime&&this.searchFormSearch.withdrawalTime.length) { if (this.searchFormSearch.reviewTime&&this.searchFormSearch.reviewTime.length) {
this.searchFormSearch.withdrawalBeginTime = this.searchFormSearch.reviewBeginTime =
Util.dateFormate(
this.searchFormSearch.reviewTime[0],
"YYYY-MM-DD"
) + " 00:00:00"
this.searchFormSearch.reviewEndTime =
Util.dateFormate(
this.searchFormSearch.reviewTime[1],
"YYYY-MM-DD"
) + " 23:59:59"
}
if (this.searchFormSearch.successTime&&this.searchFormSearch.successTime.length) {
this.searchFormSearch.successBeginTime =
Util.dateFormate( Util.dateFormate(
this.searchFormSearch.withdrawalTime[0], this.searchFormSearch.successTime[0],
"YYYY-MM-DD" "YYYY-MM-DD"
) + " 00:00:00" ) + " 00:00:00"
this.searchFormSearch.withdrawalEndTime = this.searchFormSearch.successEndTime =
Util.dateFormate( Util.dateFormate(
this.searchFormSearch.withdrawalTime[1], this.searchFormSearch.successTime[1],
"YYYY-MM-DD" "YYYY-MM-DD"
) + " 23:59:59" ) + " 23:59:59"
} }
delete this.searchFormSearch.rewardTime delete this.searchFormSearch.rewardTime
delete this.searchFormSearch.withdrawalTime delete this.searchFormSearch.successTime
delete this.searchFormSearch.reviewTime
resolve() resolve()
}) })
}, },
...@@ -237,8 +251,9 @@ export default { ...@@ -237,8 +251,9 @@ export default {
staffName: "", staffName: "",
staffPhone: "", staffPhone: "",
merchantId: "", merchantId: "",
withdrawalTime:[], rewardTime:[],
rewardTime:[] reviewTime:[],
successTime:[]
} }
this.searchFormSearch={} this.searchFormSearch={}
this.$refs.pointTable.refreshTable(true, true) this.$refs.pointTable.refreshTable(true, true)
......
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-02-18 10:33:56
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-02-27 15:28:20
* @FilePath: \dj-car-life-system\src\views\residentManage\growUpGrade\components\couponDialog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<baseDialog
:dialog-config="dialogConfig"
:is-show.sync="visible"
class="couponDialog"
:config="{
appendToBody: true,
isShowFooter: true,
cancel_name: '取 消',
confirm_name: '确 定'
}"
@handleClick="handleAddConfirm"
>
<div class="dialog-body">
<div class="dialog-left">
<el-form :inline="true" :model="searchForm" class="form-inline">
<el-form-item label="品牌">
<el-select v-model="searchForm.brandName" placeholder="请选择">
<el-option
:label="item.brandName"
:value="item.brandName"
v-for="(item, index) in brandList"
:key="index"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="卡券">
<el-input
v-model="searchForm.goodsName"
placeholder="请输入"
></el-input>
</el-form-item>
<el-form-item size="small">
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<d2-table
ref="table"
:search-form="searchForm"
:table-params="tableParams"
:tableData="couponList"
@refreshTable="getList"
:tableTotal="tableTotal"
@selectionTable="handleSelectionTable"
>
</d2-table>
</div>
<div class="dialog-right">
<div class="select-header">
<span>已选</span>
<span class="clear" @click="clear">清空</span>
</div>
<div class="select-body">
<div
class="select-item"
v-for="(item, index) in selectList"
:key="index"
>
<i class="el-icon-error" @click="removeCoupon(item, index)"></i>
<div class="select-name">{{ item.goodsName }}</div>
<el-input-number
v-model="item.couponCount"
:min="1"
:max="100"
></el-input-number>
</div>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
import { getCouponList, getBrandList } from "@/api/inStorePoints"
export default {
name: "CouponDialog",
props: {
couponVisible: {
type: Boolean,
default: false
},
levelType: {
type: [String, Number]
},
couponFormList: {
type: Array,
default: () => []
}
},
data() {
return {
dialogConfig: {
title: "选择卡券",
width: "920px"
},
tableTotal: 0,
brandList: [],
selectList: [],
couponList: [],
tableParams: {
listName: "list",
// 行数据的key
mutiSelectUniqueKey: "id",
// 多选ref的名称
mutiSelectName: "list",
tableColumns: [
{
label: "品牌",
prop: "brandName"
},
{
label: "卡券",
prop: "goodsName"
},
{
label: "官方价/元",
prop: "lineationPrice"
},
{
label: "成本价/元",
prop: "costPrice"
}
]
},
searchForm: {}
}
},
computed: {
visible: {
get() {
return this.couponVisible
},
set() {
this.$emit("update:couponVisible", false)
}
}
},
mounted() {
this.$nextTick(() => {
this.selectList = this.couponFormList
this.getList()
this.getBrandList()
})
},
methods: {
clear() {
this.selectList = []
this.$refs.table.$refs.listMutiTable.clearSelection()
},
getBrandList() {
getBrandList({ supplier: "HW", pageNum: 1, pageSize: 9999 }).then(
(res) => {
this.brandList = res
}
)
},
getList(isReset) {
let params = {
...this.searchForm,
appearance: 1,
status: 2,
pageNum: this.$refs.table.page.currentPage,
pageSize: this.$refs.table.page.pageSize
}
getCouponList(params).then((res) => {
this.couponList = res.list
this.tableTotal = res.total
this.selectList.forEach((row) => {
const idx = this.couponList.findIndex((k) => k.id == row.id)
console.log(idx)
if (idx != -1) {
this.toggleRowSelected(row, true)
}
})
})
},
removeCoupon(row, i) {
this.toggleRowSelected(row, false)
this.selectList.splice(i, 1)
},
handleReset() {
this.searchForm = {}
this.getList(true)
},
handleSearch() {
this.getList(true)
},
handleSelectionTable(val) {
const currentIdList = this.couponList.map((item) => item.id)
val.forEach((item) => {
if (this.selectList.findIndex((k) => k.id == item.id) == "-1") {
this.selectList.push({ ...item, couponCount: 1 })
}
})
currentIdList.forEach((item) => {
if (
val.findIndex((k) => k.id == item) == "-1" &&
this.selectList.findIndex((k) => k.id == item) != -1
) {
this.selectList.splice(
this.selectList.findIndex((k) => k.id == item),
1
)
}
})
console.log(this.selectList)
},
// 删除选中
toggleRowSelected(List, isSelected) {
this.$nextTick(() => {
const i = this.couponList.findIndex((item) => item.id == List.id)
if (i >= 0) {
this.$refs.table.$refs.listMutiTable.toggleRowSelection(
this.couponList[i],
isSelected
)
}
})
},
handleAddConfirm() {
if (this.selectList.length == 0) {
return this.$message.error("请选择卡券")
}
if (this.levelType == 2 && this.selectList.length > 1) {
return this.$message.error("只能选择一种卡券")
}
this.$emit("update:couponVisible", false)
this.$emit("handleAddConfirm", this.selectList)
}
}
}
</script>
<style scoped lang="scss">
.dialog-body {
display: flex;
.dialog-left {
border: 1px solid #e5e5e5;
padding: 20px;
margin-right: 20px;
width: calc(100% - 360px);
.form-inline {
::v-deep {
.el-input__inner {
width: 140px;
}
}
}
}
.dialog-right {
width: 300px;
border: 1px solid #e5e5e5;
.select-header {
height: 44px;
line-height: 44px;
border-bottom: 1px solid #e5e5e5;
display: flex;
justify-content: space-between;
padding: 0 16px;
font-size: 16px;
color: #333333;
.clear {
font-size: 14px;
color: #2a58ad;
cursor: pointer;
}
}
.select-body {
margin-top: 10px;
.select-item {
padding: 5px 16px;
display: flex;
align-items: center;
font-size: 14px;
color: #333333;
i {
color: #a6a6a6;
}
.select-name {
width: 125px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-left: 5px;
}
.el-input-number--medium {
width: 125px;
}
}
}
}
}
</style>
...@@ -207,7 +207,10 @@ ...@@ -207,7 +207,10 @@
</div> </div>
<div class="info-item-block block-line" style="height: 100%;display: flex;align-items: start;"> <div class="info-item-block block-line" style="height: 100%;display: flex;align-items: start;">
<label class="label">调店分配:</label> <label class="label">调店分配:</label>
<div class="store-allocation"> <div v-if="!$$(detail.staffDailyReportConfigList, 'length')">
<el-button size="small" plain @click="addStorConfig">添加配置</el-button>
</div>
<div class="store-allocation" v-else>
<div v-for="(item, index) in detail.staffDailyReportConfigList" :key="index" > <div v-for="(item, index) in detail.staffDailyReportConfigList" :key="index" >
<el-form-item label="" style="display: inline-block;" :prop="`staffDailyReportConfigList[${index}].startEffectiveTime`"> <el-form-item label="" style="display: inline-block;" :prop="`staffDailyReportConfigList[${index}].startEffectiveTime`">
<el-date-picker v-model="detail.staffDailyReportConfigList[index].startEffectiveTime" <el-date-picker v-model="detail.staffDailyReportConfigList[index].startEffectiveTime"
...@@ -254,7 +257,7 @@ ...@@ -254,7 +257,7 @@
</el-select> </el-select>
<el-input v-else class="select-store" disabled v-model="detail.staffDailyReportConfigList[index].merchantName"></el-input> <el-input v-else class="select-store" disabled v-model="detail.staffDailyReportConfigList[index].merchantName"></el-input>
</el-form-item> </el-form-item>
<el-button type="text" class="text" v-if="detail.staffDailyReportConfigList.length > 1" @click="deletStorConfig(index)">删除</el-button> <el-button type="text" class="text" @click="deletStorConfig(index)">删除</el-button>
<el-button type="text" class="text" v-if="index == (detail.staffDailyReportConfigList.length - 1)" @click="addStorConfig">添加一行</el-button> <el-button type="text" class="text" v-if="index == (detail.staffDailyReportConfigList.length - 1)" @click="addStorConfig">添加一行</el-button>
<el-button type="text" class="text" @click="targetConfigConfirm(index)">确定</el-button> <el-button type="text" class="text" @click="targetConfigConfirm(index)">确定</el-button>
<div class="change-log" style="margin: 0 0 15px;align-items: center;" v-if="detail.staffDailyReportConfigList[index].salaryCalculateStartTime && detail.staffDailyReportConfigList[index].salaryCalculateEndTime"> <div class="change-log" style="margin: 0 0 15px;align-items: center;" v-if="detail.staffDailyReportConfigList[index].salaryCalculateStartTime && detail.staffDailyReportConfigList[index].salaryCalculateEndTime">
...@@ -486,14 +489,7 @@ export default { ...@@ -486,14 +489,7 @@ export default {
v.currentlyFlag = true v.currentlyFlag = true
} }
}) })
res.staffDailyReportConfigList = res?.staffDailyReportConfigList || [{ res.staffDailyReportConfigList = res.staffDailyReportConfigList || []
startEffectiveTime: '',
endEffectiveTime: '',
currentlyFlag: false,
yqMerchantId: '',
merchantId: '',
targetMerchantList: []
}]
} }
this.detail = res || {} this.detail = res || {}
this.tableData = res?.accountRecordList || [] this.tableData = res?.accountRecordList || []
...@@ -633,6 +629,8 @@ export default { ...@@ -633,6 +629,8 @@ export default {
// 获取调店分配4s店 // 获取调店分配4s店
handleTargetYqMerchantChange(e, index) { handleTargetYqMerchantChange(e, index) {
merchantListByYqMerchantApi({ merchantId: e }).then(res => { merchantListByYqMerchantApi({ merchantId: e }).then(res => {
// 将已选的4s店清空
this.$set(this.detail.staffDailyReportConfigList[index], 'merchantId', '')
this.$set(this.detail.staffDailyReportConfigList[index], 'targetMerchantList', res || []) this.$set(this.detail.staffDailyReportConfigList[index], 'targetMerchantList', res || [])
}) })
}, },
......
...@@ -189,9 +189,16 @@ export default { ...@@ -189,9 +189,16 @@ export default {
}) })
}, },
del(index) { del(index) {
this.infoData.campusList.splice(index, 1) this.$confirm('确认删除吗?', '提示', {
this.$nextTick(() => { confirmButtonText: '确定',
this.$refs['configForm'].clearValidate() cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.infoData.campusList.splice(index, 1)
this.$nextTick(() => {
this.$refs['configForm'].clearValidate()
})
}).catch(() => {
}) })
}, },
handleInput(e, key, scope) { handleInput(e, key, scope) {
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
:search-form="searchForm" :search-form="searchForm"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn"
:selectable-fn="selectableFn">
<template slot="brand" slot-scope="scope"> <template slot="brand" slot-scope="scope">
<template v-if="scope.scope.brand && scope.scope.brand.length > 20"> <template v-if="scope.scope.brand && scope.scope.brand.length > 20">
<el-popover placement="top" width="300" trigger="hover"> <el-popover placement="top" width="300" trigger="hover">
...@@ -273,6 +274,13 @@ export default { ...@@ -273,6 +274,13 @@ export default {
resolve() resolve()
}) })
}, },
selectableFn(row) {
var isSelect = true
if (row.minPerformConfigStatus == 2 || !row.minPerformConfigStatus) { // 无配置方案或已禁用的不可勾选
isSelect = false
}
return isSelect
},
brandFilter(ele, lenght) { brandFilter(ele, lenght) {
if (ele.brand) { if (ele.brand) {
return lenght ? (ele.brand?.length > lenght ? ele.brand.substring(0, lenght) + '\u2026' : ele.brand.substring(0, lenght)) : ele.brand return lenght ? (ele.brand?.length > lenght ? ele.brand.substring(0, lenght) + '\u2026' : ele.brand.substring(0, lenght)) : ele.brand
......
...@@ -323,11 +323,18 @@ export default { ...@@ -323,11 +323,18 @@ export default {
// 删除 // 删除
handleDelete(item, index) { handleDelete(item, index) {
const data = this.configInfo this.$confirm('确认删除吗?', '提示', {
data[item + 'List']?.splice(index, 1) confirmButtonText: '确定',
this.$set(this.configInfo, item + 'List', data[item + 'List']) cancelButtonText: '取消',
this.$nextTick(() => { type: 'warning'
this.$refs['editFormRef'].$refs['editChildRef'].clearValidate() }).then(() => {
const data = this.configInfo
data[item + 'List']?.splice(index, 1)
this.$set(this.configInfo, item + 'List', data[item + 'List'])
this.$nextTick(() => {
this.$refs['editFormRef'].$refs['editChildRef'].clearValidate()
})
}).catch(() => {
}) })
}, },
// 自定义校验区间结束值 // 自定义校验区间结束值
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!