Commit 37d4a930 by 张立顺

fix 联调bug修复

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