Commit 37d4a930 by 张立顺

fix 联调bug修复

1 parent db4c878c
......@@ -792,7 +792,6 @@ export default {
// console.log(result)
// 判空处理
// result.goodsTypeGroupRules = [...result?.goodsTypeGroupRules, ...result?.goodsTypeGroupRules, ...result?.goodsTypeGroupRules]
const goodsTypeGroupRules = result?.goodsTypeGroupRules
result = result || this.financialObj
// result.autoFlag = null
// result.settleTimeType = null
......@@ -834,13 +833,23 @@ export default {
// 如果有分账配置
result && (this.financialObj = result)
// 详情未返回分账品类(null / 非数组 / 空数组)时:默认一条「全部品类」,首个 Tab 激活
let goodsTypeGroupRules = this.financialObj.goodsTypeGroupRules
if (!Array.isArray(goodsTypeGroupRules)) {
goodsTypeGroupRules = []
}
if (!goodsTypeGroupRules.length) {
goodsTypeGroupRules = [{ groupType: 1 }]
this.$set(this.financialObj, "goodsTypeGroupRules", goodsTypeGroupRules)
}
const upgradeArr = []
const packageArr = []
let startNum = 0
if (goodsTypeGroupRules && goodsTypeGroupRules[0].groupType == 2) {
this.editableTabs = []
if (goodsTypeGroupRules[0].groupType == 2) {
goodsTypeGroupRules.unshift({ groupType: 1 })
}
goodsTypeGroupRules &&
goodsTypeGroupRules.forEach((item, index) => {
if (index == 0 && item.groupType == 2) {
startNum = 1
......
<!-- 分账 -->
<template>
<div v-if="items && items.goodsTypeGroupRules">
<div class="type">
<el-tabs
:value="String(activeType)"
type="card"
class="ledger-goods-type-tabs"
@tab-click="onGoodsTypeTabClick"
>
<template v-for="(item, index) in items.goodsTypeGroupRules">
<div class="btn" :key="index + 'type'" v-if="item.groupType == 1" :class="{ act: activeType == index }"
@click="handleType(index)">全部分类</div>
<div class="btn" :key="index + 'type'" v-if="item.groupType == 2" :class="{ act: activeType == index }"
@click="handleType(index)">特殊品类{{ items.goodsTypeGroupRules[0].groupType == 1 ? index : index + 1 }}</div>
<el-tab-pane
v-if="item.groupType == 1 || item.groupType == 2"
:key="index + '-goods-type-tab'"
:label="getGoodsGroupTabLabel(item, index)"
:name="String(index)"
/>
</template>
</div>
</el-tabs>
<div class="content" v-for="(item, index) in items.goodsTypeGroupRules.filter((v, i) => i == activeType)"
:key="index + 'ledger'">
<div class="part1">
......@@ -483,8 +490,14 @@ export default {
}
return res
},
handleType(num) {
this.activeType = num
onGoodsTypeTabClick(tab) {
this.activeType = Number(tab.name)
},
getGoodsGroupTabLabel(item, index) {
if (item.groupType == 1) return '全部分类'
const first = this.items.goodsTypeGroupRules[0]
const num = first && first.groupType == 1 ? index : index + 1
return `特殊品类${num}`
},
chooseDate() {
this.$refs.datePicker.focus()
......@@ -685,6 +698,22 @@ export default {
}
}
.ledger-goods-type-tabs {
margin-top: 6px;
::v-deep .el-tabs__header {
margin-bottom: 0;
}
::v-deep .el-tabs__content {
display: none;
}
::v-deep .el-tabs__nav-wrap.is-scrollable {
padding: 0 28px;
}
}
.more {
display: flex;
flex-direction: column;
......
<!-- 对账 -->
<template>
<div>
<!-- shopMerchantTotalFeeCalculateType,
......
......@@ -8,10 +8,6 @@
<el-tab-pane label="对账规则" name="second"></el-tab-pane>
</el-tabs>
</div>
<!-- <div class="type">
<div class="btn" :class="{act:activeType==1}" @click="handleType(1)">全部分类</div>
<div class="btn" :class="{act:activeType==2}" @click="handleType(2)">特殊品类</div>
</div> -->
<!-- 商户关系 -->
<template v-if="activeName == 'third'">
......
<!-- 分账 -->
<template>
<div v-if="detailInfo && detailInfo.goodsTypeGroupRules">
<div class="type">
<el-tabs
:value="String(activeType)"
type="card"
class="ledger-goods-type-tabs"
@tab-click="onGoodsTypeTabClick"
>
<template v-for="(item, index) in detailInfo.goodsTypeGroupRules">
<div class="btn" :key="index + 'type'" v-if="item.groupType == 1"
:class="{ act: activeType == index, isRed: (filterIsRed(item, 1) || filterIsRed(item)) }"
@click="handleType(index)">全部分类</div>
<div class="btn" :key="index + 'type'" v-if="item.groupType == 2"
:class="{ act: activeType == index, isRed: (filterIsRed(item, 1) || filterIsRed(item)) }"
@click="handleType(index)">特殊品类{{ detailInfo.goodsTypeGroupRules[0].groupType == 1 ? index : index + 1 }}
</div>
<el-tab-pane
v-if="item.groupType == 1 || item.groupType == 2"
:key="index + '-goods-type-tab'"
:name="String(index)"
>
<span slot="label" :class="{ isRed: filterIsRed(item, 1) || filterIsRed(item) }">
{{ getGoodsGroupTabLabel(item, index) }}
</span>
</el-tab-pane>
</template>
</div>
</el-tabs>
<div class="content channelList"
v-for="(item, index) in detailInfo.goodsTypeGroupRules.filter((v, i) => i == activeType)" :key="index + 'ledger'">
<!-- <template v-if="(activeType == index)"> -->
......@@ -497,8 +504,14 @@ export default {
}
return res
},
handleType(num) {
this.activeType = num
onGoodsTypeTabClick(tab) {
this.activeType = Number(tab.name)
},
getGoodsGroupTabLabel(item, index) {
if (item.groupType == 1) return '全部分类'
const first = this.detailInfo.goodsTypeGroupRules[0]
const num = first && first.groupType == 1 ? index : index + 1
return `特殊品类${num}`
},
getTypeText(type, arr) {
let res = ''
......@@ -620,6 +633,22 @@ export default {
<style lang='scss' scoped>
$color: #2a58ad;
.ledger-goods-type-tabs {
margin-top: 6px;
::v-deep .el-tabs__header {
margin-bottom: 0;
}
::v-deep .el-tabs__content {
display: none;
}
::v-deep .el-tabs__nav-wrap.is-scrollable {
padding: 0 28px;
}
}
.content {
padding-top: 20px;
}
......
<!-- 对账 -->
<template>
<div>
<div class="type">
<template v-for="(item, index) in items">
<div
class="btn"
:key="index + 'type'"
v-if="item.groupType == 1"
:class="{
act: activeType == index,
isRed: filterIsRed(item, 1) || filterIsRed(item)
}"
@click="handleType(index)"
<el-tabs
:value="String(activeType)"
type="card"
class="ledger-goods-type-tabs"
@tab-click="onGoodsTypeTabClick"
>
全部分类
</div>
<div
class="btn"
:key="index + 'type'"
v-if="item.groupType == 2"
:class="{
act: activeType == index,
isRed: filterIsRed(item, 1) || filterIsRed(item)
}"
@click="handleType(index)"
>
特殊品类{{ items[0].groupType == 1 ? index : index + 1 }}
</div>
<template v-for="(item, index) in items">
<el-tab-pane
v-if="item.groupType == 1 || item.groupType == 2"
:key="index + '-goods-type-tab'"
:name="String(index)"
>
<span slot="label" :class="{ isRed: filterIsRed(item, 1) || filterIsRed(item) }">
{{ getGoodsGroupTabLabel(item, index) }}
</span>
</el-tab-pane>
</template>
</div>
</el-tabs>
<div class="content" v-for="(item, index) in items" :key="index + 'reconc'">
<template v-if="activeType == index">
<div class="part1">
......@@ -635,8 +625,14 @@ export default {
}
return item.diffTypes && item.diffTypes.some((v) => v == num)
},
handleType(num) {
this.activeType = num
onGoodsTypeTabClick(tab) {
this.activeType = Number(tab.name)
},
getGoodsGroupTabLabel(item, index) {
if (item.groupType == 1) return "全部分类"
const first = this.items[0]
const num = first && first.groupType == 1 ? index : index + 1
return `特殊品类${num}`
},
formatGoodsTypeGroupRelations(type, arr) {
let res = ""
......@@ -735,6 +731,22 @@ export default {
</script>
<style lang="scss" scoped>
.ledger-goods-type-tabs {
margin-top: 6px;
::v-deep .el-tabs__header {
margin-bottom: 0;
}
::v-deep .el-tabs__content {
display: none;
}
::v-deep .el-tabs__nav-wrap.is-scrollable {
padding: 0 28px;
}
}
.header {
height: 72px;
background: #ffffff;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!