Commit 8d14d6b2 by 张立顺

功能开发 提交

1 parent c471d35a
......@@ -201,6 +201,12 @@ export function scenemerchantrefQueryServiceRefByShop(data) {
return request(data, RequestMethods.POST)
}
// 获取商户财务设置进度
export function divisionRuleTestGet(data) {
data.method = `${path2}divisionRuleTest.get`
return request(data, RequestMethods.POST)
}
// // 分账测算
// export function merchantSettleDistributeRuleTestRule(data) {
// data.method = `${path}merchantSettleDistributeRule.testRule`
......
......@@ -3,7 +3,9 @@
<div class="hederContainer">
<span class="tips ruleTest">不确定规则是否正确?点击 <el-button @click="ruleTest"
type="text">进行测算</el-button></span>
<span class="tips dimensionTest">未进行分账测试,点击 <el-button type="text">立即测试</el-button></span>
<!-- v-show="tabItem.testFlag == 'N'" -->
<span class="tips dimensionTest">未进行分账测试,点击 <el-button @click="getProgress"
type="text">立即测试</el-button></span>
</div>
<el-form ref="classification"
......@@ -191,6 +193,12 @@
:merchant-distribution-rules="goodsTypeGroupRules.merchantDistributionRules"
:table-select-options="tableSelectOptions"
:classification-obj-select="classificationObjSelect" />
<tipsDialog v-if="tipsDialogVisible"
:account-valid-merchants="accountValidMerchants"
:visible.sync="tipsDialogVisible" />
<financialCalculationDialog v-if="financialCalculationVisible"
:financial-calculation-obj="financialCalculationObj"
:visible.sync="financialCalculationVisible" />
</div>
</template>
......@@ -202,12 +210,16 @@ import { mapActions, mapState, mapMutations } from 'vuex'
import tableAccount from './tableAccount'
import { limitPrice } from '@/common/format'
import { deepClone } from '@/common/util'
import { divisionRuleTestGet } from '@api/merchant'
import { defaultSelectOptions, severSelectOptions } from '@/common/constant/merchant'
import tipsDialog from './tipsDialog'
import financialCalculationDialog from './financialCalculationDialog.vue'
export default {
name: 'ClassificationCpt',
components: {
tableAccount
tableAccount,
tipsDialog,
financialCalculationDialog
},
props: {
goodsTypeGroupRules: {
......@@ -231,6 +243,12 @@ export default {
type: Number,
default: 0
},
tabItem: {
type: Object,
default() {
return {}
}
},
classificationObjSelect: // 类目选择
{
type: Object,
......@@ -264,6 +282,9 @@ export default {
},
data() {
return {
financialCalculationVisible: false,
tipsDialogVisible: false,
accountValidMerchants: [],
classificationObj: {
goodsTypes: [],
// trafficSide: [],
......@@ -292,7 +313,8 @@ export default {
rules: {
goodsTypes: [{ required: true, message: '请选择商品', trigger: 'change' }]
},
serviceSelectList: []
serviceSelectList: [],
financialCalculationObj: {}
}
},
computed: {
......@@ -400,13 +422,6 @@ export default {
deep: true
// immediate: true
}
// serviceMerchantList: {
// handler() {
// this.initList()
// },
// deep: true
// // immediate: true
// }
},
mounted() {
// this.init4sServiceList()
......@@ -415,7 +430,24 @@ export default {
methods: {
...mapActions('FinancialRules', ['reset']),
// ...mapMutations('FinancialRules', ['toggle', 'set']),
getProgress() {
// groupDivisionRuleId:118
divisionRuleTestGet({ goodsTypeGroupDivisionId: 122 }).then((result) => {
const { subProgress, accountValidMerchants } = result
// 没有虚拟对公账户
if (subProgress == 32) {
this.tipsDialogVisible = true
this.accountValidMerchants = accountValidMerchants
}
console.log([34, 35, 36, 31].includes(subProgress))
if ([34, 35, 36, 31].includes(subProgress)) {
this.financialCalculationVisible = true
this.financialCalculationObj = result
}
console.log('result', result)
})
},
ruleTest() {
this.$emit('rulesTest')
},
......
......@@ -140,6 +140,7 @@ export default {
label: '分账类目',
prop: 'expenseCategorys',
formatter: (cellValue) => {
this.expenseCategoryCalculatedItemForRuleTestsResults
const label = cellValue.expenseCategorys && cellValue.expenseCategorys.reduce((prv, item, index) => {
const name = index ? `-${item.expenseCategoryName}` : item.expenseCategoryName
prv = prv.concat(name)
......@@ -222,9 +223,10 @@ export default {
}
merchantSettleDistributeRuleTestRule(params).then((result) => {
console.log('result', result)
result.expenseCategoryCalculatedItemForRuleTestsResults.sort((a, b) => {
result.expenseCategoryCalculatedItemForRuleTestsResults = result.expenseCategoryCalculatedItemForRuleTestsResults.sort((a, b) => {
return a.targetType - b.targetType
})
console.log(result.expenseCategoryCalculatedItemForRuleTestsResults)
this.categoryTableData = result
this.resultTableData = result.merchantDistributions
}).catch((err) => {
......
......@@ -5,14 +5,21 @@
:is-visible="verificationCodeVisible"
class="verificationCode"
width="750px"
btn-ok-label="前往开通"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<div>55</div>
<!-- <div>55</div> -->
<p>未开通虚拟对公账号园区店</p>
<p v-for="(item,index) in accountValidMerchants"
:key="index">
<span class="label">{{ item.merchantName }} </span>
</p>
</d2-dialog>
</template>
<script>
// import { sendSms, getAdminInfo } from '@api/merchant'
import { mapActions } from 'vuex'
export default {
name: 'TipsDialog',
props: {
......@@ -20,6 +27,10 @@ export default {
// 弹窗是否展示
type: Boolean,
default: false
},
accountValidMerchants: {
type: Array,
default: () => []
}
},
computed: {
......@@ -42,14 +53,21 @@ export default {
},
methods: {
...mapActions({
close: 'd2admin/page/close'
}),
handleClose() {
// this.$emit('dialogClose')
// this.$update
this.verificationCodeVisible = false
},
// handleApply() {
// },
// 跳转虚拟对公账号
handleConfirm() {
this.handleClose()
this.$router.push({ name: 'accountList_new' })
this.close({ tagName: '/merchantDetail' })
}
}
}
......
......@@ -114,7 +114,7 @@
:label="item.title"
:name="item.name"
:closable="idx!=0">
<span slot="label"><i v-show="item.testFlag=='N'"
<span slot="label"><i v-show="item.testFlag!='Y'"
class="el-icon-warning car-error-txt" />{{ item.title }} </span>
<div class="classificationCptContainer">
<classificationCpt :ref="`classification${item.name}`"
......@@ -149,14 +149,11 @@
<verificationCodeDialog v-if="verificationCodeVisible"
@handleConfirm="codeHandleConfirm"
:visible.sync="verificationCodeVisible" />
<financialCalculationDialog v-if="financialCalculationVisible"
:visible.sync="financialCalculationVisible" />
<!-- 财务分账测试 -->
<merchantTestDialog v-if="merchantTestVisible"
:rules-test-params="rulesTestParams"
:visible.sync="merchantTestVisible" />
<tipsDialog v-if="tipsDialogVisible"
:visible.sync="tipsDialogVisible" />
</d2-Container>
......@@ -170,25 +167,23 @@ import { scenemerchantrefQueryServiceRefByShop, merchantSettleDistributeRuleLast
import { queryFeeCategoryByType } from '@/api/sys.base.js'
import verificationCodeDialog from './components/verificationCodeDialog'
import classificationCpt from './components/classificationCpt.vue'
import financialCalculationDialog from './components/financialCalculationDialog.vue'
import merchantTestDialog from './components/merchantTestDialog'
import tipsDialog from './components/tipsDialog'
export default {
name: 'FinancialRules',
isNeedVuex: true,
components: {
classificationCpt,
verificationCodeDialog,
financialCalculationDialog,
merchantTestDialog,
tipsDialog
merchantTestDialog
},
data() {
return {
verificationCodeVisible: false,
merchantTestVisible: false,
financialCalculationVisible: false,
tipsDialogVisible: false,
rulesTestParams: {},
goodsTypeGroupRelations: [],
classificationObj: {
......@@ -398,7 +393,7 @@ export default {
const obj = {
applicationObjectType,
id,
applicationObjectName: feeCategoryNameList.feeCategoryName
applicationObjectName: feeCategoryNameList[0].feeCategoryName
}
if (applicationObjectType == 1) {
prev.trafficSide.push(obj)
......@@ -407,7 +402,7 @@ export default {
} else if (applicationObjectType == 3) {
obj.id != 3 && obj.applicationObjectName != '产品成本' && prev.platformPublic.push(obj)
}
console.log(prev)
// console.log(prev)
return prev
}, {
trafficSide: [],
......@@ -487,7 +482,7 @@ export default {
goodsTypeGroupRules.forEach((item, index) => {
if (item.testFlag != "Y") {
this.editableTabs[index].testFlag = "N"
this.editableTabs[index].goodsTypeGroupDivisionId = item.groupSettleRuledId
this.editableTabs[index].groupDivisionRuleId = item.groupDivisionRuleId
}
})
}).catch((err) => {
......@@ -638,7 +633,8 @@ export default {
// 去除对应关闭tab下已选的商品
const childCop = this.$refs[`classification${targetName}`][0]
const childParams = childCop.getParams()
this.deleteSelectGoodsList(childParams.goodsTypeGroupRelations)
console.log(childParams)
this.deleteSelectGoodsList(childParams.goodsTypes)
// const childCop = this.$refs.test
// console.log()
// console.log(childCop.song())
......@@ -679,7 +675,7 @@ export default {
this.goodsSelectList = this.goodsSelectList.filter(el => el.goodsType != item.goodsType)
},
deleteSelectGoodsList(list) {
// console.log(list)
console.log(list)
this.goodsSelectList = this.goodsSelectList.reduce((arr, item) => {
if (list.findIndex(el => item.goodsType == el.goodsType) == -1) {
arr.push(item)
......
<!-- 3 - 分账测试 -->
<!-- - 分账测试 -->
<template>
<div class="division-test">
<p class="edit-sub-title">
分账测试<span class="title-tips">首次开启线上分账,需进行分账测试!</span>
</p>
<!-- 嘀加智慧云 -->
<div class="show-tip-block"
<!-- <div class="show-tip-block"
v-if="needAccountNum === accessFirstMerchantList.length">
<!-- {{accessFirstMerchantList.length ? ',' : ''}} -->
<p>
<span class="blue">{{ accessFirstMerchantList.join(',') }}</span>已经完成了分账测试,你可直接进入下一步。
</p>
......@@ -16,10 +15,10 @@
@click="handleNextStep">
下一步
</el-button>
</div>
</div> -->
<!-- 根据分账金额设置判断,服务商/导流方有没有配置虚拟账户 -->
<div class="show-tip-block"
<!-- <div class="show-tip-block"
v-else-if="noVirtualAccMerchantList.length">
<p>
您绑定的分账方:<span
......@@ -30,11 +29,10 @@
@click="handleApply">
申请虚拟对公账户 >>
</el-button>
</div>
</div> -->
<!-- <div -->
<div v-else-if="!noVirtualAccMerchantList.length"
class="account-card-block">
<!-- <div v-else-if="!noVirtualAccMerchantList.length"-->
<div class="account-card-block">
<div class="card-title card-box">
<span>商品名:{{ goodsInfo.baseGoodsName }}</span>
<span class="title-target-obj">{{ form.merchantName }}</span>
......@@ -115,12 +113,11 @@
</div>
<!-- 多个服务商展示 -->
<div class="card-list"
<!-- <div class="card-list"
v-if="merchantInfo.partnerSettleAccountModel ==2">
<vue2-org-tree :data="orgData"
:render-content="renderContent" />
<!-- <org-tree :data="data" /> -->
</div>
</div> -->
<div class="card-box"
style="margin-top: 20px;">
......@@ -315,21 +312,21 @@
</template>
<script>
import { mapActions } from 'vuex'
// import vueQr from 'vue-qr'
import { limitPrice } from '@/common/format'
import { moneyValidApi, getWsUrlApi } from '@api/merchant'
import vue2OrgTree from 'vue2-org-tree'
// import vue2OrgTree from 'vue2-org-tree'
export default {
name: 'StepThree',
components: {
// vueQr,
vue2OrgTree
// vue2OrgTree
},
data() {
return {
orgData: {
},
// orgData: {
// },
size: 'small',
stepActive: 0,
form: {},
......@@ -401,7 +398,7 @@ export default {
this.getInfo()
this.outTradeNo = this.merchantInfo.goodsOrder ? this.merchantInfo.goodsOrder.payOrder.outTradeNo : ''
this.getWsUrl()
this.merchantInfo.partnerSettleAccountModel == 2 && this.getOrgTree()
// this.merchantInfo.partnerSettleAccountModel == 2 && this.getOrgTree()
} else {
this.socket && this.socket.close()
}
......@@ -412,9 +409,7 @@ export default {
},
methods: {
...mapActions({
close: 'd2admin/page/close'
}),
filterCostLabel(op, type, value) {
// console.log(op, type, value)
// let a =
......@@ -427,90 +422,7 @@ export default {
return name + value + '%'
}
},
getOrgTree() {
// realityPlatformMerchant
const { divisionRule, realityDivisionMerchant, yqMerchant, settleAccountRule, installCostPartnerMerchant, marketingCostPartnerMerchant } = this.merchantInfo
// (+merchantInfo.) : ''}}的{{merchantInfo.settleAccountRule ? merchantInfo.settleAccountRule.merchantProfitValue : '0'}}%
const merchantSettleType = settleAccountRule.merchantSettleType === 1 ? '毛利' : '收入'
const merchantProfitValue = settleAccountRule.merchantProfitValue || 0
const partnerProfitPer = settleAccountRule.partnerProfitPer || 0
const realityInfo = {
title: '导流方',
label: `按${merchantSettleType}的${merchantProfitValue}%`,
name: realityDivisionMerchant.merchantName
}
const yqInfo = {
title: '园区店',
label: `按${merchantSettleType}的${100 - merchantProfitValue}%`,
name: yqMerchant.merchantName
}
const realityDivisionMerchantInfo = {
title: '平台方',
label: `占${100 - partnerProfitPer}%`,
name: divisionRule ? divisionRule.realityPlatformMerchantName : ''
}
const multiServiceProvider = {
title: '服务商',
label: `占${partnerProfitPer}%`,
name: '多家服务商'
}
const value1 = this.filterCostLabel(settleAccountRule.partnerMerchantMultiSettleAccountRule.installCostCalculateType, settleAccountRule.partnerMerchantMultiSettleAccountRule.installCostSettleType, settleAccountRule.partnerMerchantMultiSettleAccountRule.installCostValue)
const installCostPartnerMerchantInfo = {
title: '安装费服务商',
label: value1,
name: installCostPartnerMerchant.merchantName
}
const value2 = this.filterCostLabel(settleAccountRule.partnerMerchantMultiSettleAccountRule.marketingCostCalculateType, settleAccountRule.partnerMerchantMultiSettleAccountRule.marketingCostSettleType, settleAccountRule.partnerMerchantMultiSettleAccountRule.marketingCostValue)
const marketingCostPartnerMerchantInfo = {
title: '营销费服务商',
label: value2,
name: marketingCostPartnerMerchant ? marketingCostPartnerMerchant.merchantName : ''
}
const rewardAndPunishmentFeeServiceProvider = {
title: '奖惩费服务商',
label: '服务商总利润 - 安装费 - 营销费',
name: marketingCostPartnerMerchant ? marketingCostPartnerMerchant.merchantName : ''
}
this.orgData = {
label: '',
style: 'none',
children: [
realityInfo,
{
...yqInfo,
children: [
{
...multiServiceProvider,
children: [
installCostPartnerMerchantInfo,
marketingCostPartnerMerchantInfo,
rewardAndPunishmentFeeServiceProvider
]
},
{
...realityDivisionMerchantInfo
}
]
}
]
}
// console.log(installCostPartnerMerchantInfo)
// console.log(rewardAndPunishmentFeeServiceProvider)
},
renderContent(h, data) {
return (
<div class={data.style == 'none' ? 'displaynone' : ''}>
<p class="orgPadding orgTitleBg"><span class="orgTitle">{data.title}</span> <span class="Orglabel">{data.label}</span></p>
<p class="orgPadding">{data.name}</p>
</div>
)
// <span style="100%;height:100%;display:block;padding:10px 15px;border-radius:3px;" class={data.relations === '1-1' ? 'bg-tomato' : (data.relations === '1-2' ? 'bg-gold' : (data.relations === '1-3' ? 'bg-gray' : (data.relations === '1-4' ? 'bg-lightpink' : (data.relations === '1-5' ? 'bg-blue' : 'bg-green'))))}>
// <dd style="height:6vh;border-radius:50%;padding:0;margin-bottom:1vh;"><img style="6vh;height:6vh;border-radius:50%;" src={data.img ? data.img : (data.sex === 1 ? this.manUrl : (data.sex === 2 ? this.womanUrl : this.shemaleUrl))} /></dd>
// <dd style="font-size:1.6vh;">{data.label}</dd>
// <dd style="font-size:1vh;">{data.position}</dd>
// </span>
},
handleRealityShopDivisionMoney(newVal, name) {
// console.log(name)
this.moneyForm.realityShopDivisionMoney = limitPrice(newVal, this.oldVal.realityShopDivisionMoney, 6, 2)
......@@ -793,27 +705,4 @@ export default {
// }
}
}
.org-tree-node-label .org-tree-node-label-inner {
padding: 0;
}
.displaynone {
display: none;
}
.orgTitleBg {
background: #fafafa;
}
.orgTitle {
font-weight: 600;
font-size: 14px;
}
.Orglabel {
margin-left: 20px;
color: #2a58ad;
}
.orgPadding {
box-sizing: border-box;
padding: 10px 20px;
height: 36px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!