Commit a6339d1b by 前端

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.56.0-0908
2 parents 7d33e5c9 20ecd711
......@@ -556,5 +556,142 @@ export const routerName = {
activePath: "/shelfManage"
},
component: _import("goods/shelfManage/editMultilateralContract")
},
90314: {
path: "/purchaseOnShelves",
name: "purchaseOnShelves",
meta: {
title: "采购上架",
authId: "90314",
parentId: "903",
cache: false
},
auth: [
{
authId: "9031401",
parentId: "90314",
label: "新增上架",
category: "Button",
type: "primary",
handle: "handleAdd",
addRoutePath: [
{
authId: "90315",
name: "上架编辑",
parentId: "90314"
}
]
},
{
authId: "9031402",
parentId: "90314",
label: "导出",
category: "Button",
handle: "handleExport"
},
{
authId: "9031403",
parentId: "90314",
label: "批量审核",
category: "Button",
type: "primary",
handle: "handleBatchReview"
},
{
authId: "9031404",
parentId: "90314",
label: "删除",
handle: "handleDel"
},
{
authId: "9031405",
parentId: "90314",
label: "上架",
handle: "handleUpOrDown",
ruleObj: {
attr: "status",
rule: {
0: "上架",
1: "下架"
}
}
},
{
authId: "9031406",
parentId: "90314",
label: "查看",
handle: "handleView",
addRoutePath: [
{
authId: "90316",
name: "查看上架",
parentId: "90314"
}
]
},
{
authId: "9031407",
parentId: "90314",
label: "编辑",
handle: "handleEdit",
addRoutePath: [
{
authId: "90315",
name: "上架编辑",
parentId: "90314"
}
]
},
{
authId: "9031408",
parentId: "90314",
label: "批量下架",
category: "Button",
handle: "handleBatchOffShelf"
},
{
authId: "9031411",
parentId: "90314",
label: "批量导入",
category: "Button",
type: "primary",
handle: "handleBatchImport"
}
],
component: _import("goods/purchaseOnShelves/index")
},
90315: {
path: "/editGrounding",
name: "editGrounding",
meta: {
title: "上架编辑",
authId: "90315",
parentId: "90314",
// cache: false,
sideHidden: true,
activePath: "/grounding"
},
component: _import("goods/purchaseOnShelves/editGrounding")
},
90316: {
path: "/groundingDetail",
name: "groundingDetail",
meta: {
title: "查看上架",
authId: "90316",
parentId: "90314",
// cache: false,
sideHidden: true,
activePath: "/grounding"
},
auth: [
{
authId: "9031101",
parentId: "90316",
label: "审核",
handle: "handleView"
}
],
component: _import("goods/purchaseOnShelves/groundingDetail")
}
}
<template>
<d2-dialog title="批量复制"
:is-visible.sync="batchCopyVisible"
width="600px"
btn-ok-label="确定"
@confirmDialog="handleBatchCopyConfirm"
@closeDialog="handleBatchCopyClose"
class="relateStore">
<el-form label-width="120px" :rules="rules" :model="selectData" ref="batchCopyForm">
<el-form-item label="业务场景:">
<el-input style="width: 370px;" v-model="sceneList[selectedScene]" disabled></el-input>
</el-form-item>
<el-form-item label="复制门店:" prop="selectMerchantObj">
<el-select v-model="selectData.selectMerchantObj" remote reserve-keyword multiple collapse-tags
placeholder="请选择复制门店" @visible-change="visibleChange" :remote-method="remoteMethod"
v-el-select-loadmore="interestsLoadmore" style="width: 370px;" value-key="merchantId" filterable>
<el-option v-for="subItem in storeData" :key="subItem.merchantId"
:label="subItem.merchantName" :value="subItem" />
</el-select>
</el-form-item>
</el-form>
<div class="tips">
说明:批量复制至新门店后,系统自动按操作商品,自动更新补充商品对应的上架门店
</div>
</d2-dialog>
</template>
<script>
import { getList, getAccountMerchantList } from '@/api/merchant'
import { sceneList } from '@/common/constants.js'
export default {
name: 'RelateStoreDialog',
data() {
return {
storeData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20,
searchMerchantName: '',
sceneList,
selectData: {},
rules: { selectMerchantObj: [{ required: true, message: '请选择复制门店', trigger: 'blur' }] }
}
},
directives: {
'el-select-loadmore': {
bind(el, binding) {
setTimeout(() => {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}, 100)
}
}
},
props: {
batchCopyVisible: {
type: Boolean,
default: false
},
selectedScene: {
type: Number
}
},
mounted() {
this.getList()
},
methods: {
getList() {
const storeApi = [1, 2, 3].includes(this.selectedScene) ? getList : getAccountMerchantList // 会员权益/积分商城场景 上架门店是账户中心所有门店
storeApi({
// merchantIdName: ![1, 2, 3].includes(this.selectedScene) ? this.searchMerchantName : '',
merchantName: this.searchMerchantName,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene
}).then(res => {
res?.list?.forEach(val => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = val.merchantNo
})
this.storeData = this.storeData.concat(res.list)
})
},
// 获取上架门店
remoteMethod(query) {
this.searchMerchantName = query
this.currentPage = 1
this.storeData = []
this.getList() // 请求接口
},
visibleChange(data) {
// 获取焦点重新渲染下拉框数据
if (data) {
if (this.searchMerchantName) {
this.searchMerchantName = ''
this.currentPage = 1
this.storeData = []
this.getList()
}
}
},
// 获取更多上架门店
interestsLoadmore() {
setTimeout(() => {
this.currentPage = this.currentPage + 1
if (this.allPages < this.currentPage) {
this.currentPage = this.allPages
return
}
this.getList()
}, 10)
},
handleBatchCopyConfirm() {
this.$refs.batchCopyForm.validate((valid) => {
if (valid) {
this.$emit('handleBatchCopyConfirm', this.selectData?.selectMerchantObj)
}
})
},
handleBatchCopyClose() {
this.$emit('handleBatchCopyClose')
}
}
}
</script>
<style lang="scss">
.tips{
font-size: 14px;
color: #999;
}
</style>
<!-- 关联门店弹窗 -->
<template>
<d2-dialog
:title="title"
:is-visible.sync="relateStoreVisible"
width="70%"
btn-ok-label="确定"
@confirmDialog="handleRelateStoreConfirm"
@closeDialog="handleRelateStoreClose"
class="relateStore">
<slot />
<el-row class="tableCon">
<div class="tableBox">
<el-table
ref="seletingTable"
:data="selectingData"
height="464px"
class="table"
border
@select="handleChange"
@select-all="handleAll">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="merchantName" label="门店名称" align="center">
</el-table-column>
<el-table-column prop="merchantId" label="门店商户号" align="center">
</el-table-column>
<el-table-column
prop="yqMerchantName"
label="服务对接"
align="center">
</el-table-column>
<el-table-column
prop="yqMerchantId"
label="服务对接商户号"
align="center">
</el-table-column>
</el-table>
<el-pagination
small
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pageSize"
layout="total, prev, pager, next"
:total="total" />
</div>
<el-table
class="tableBox table"
:data="selectedData"
border
height="464px">
<el-table-column prop="merchantName" label="门店名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.merchantName }}</span>
</template>
</el-table-column>
<el-table-column prop="merchantId" label="门店商户号" align="center">
<template slot-scope="scope">
<span>{{ scope.row.merchantId }}</span>
</template>
</el-table-column>
<el-table-column label="删除" align="center" width="50px">
<template slot-scope="scope">
<el-button
class="el-icon-delete"
@click="handleDelete(scope.row)"
type="text" />
</template>
</el-table-column>
</el-table>
</el-row>
</d2-dialog>
</template>
<script>
export default {
name: "RelateStoreDialog",
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
currentPage: 1,
pageSize: 20
}
},
props: {
title: {
type: String,
default: "上架门店"
},
relateStoreVisible: {
type: Boolean,
default: false
},
storeApi: {
type: Function,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
},
selectedScene: {
type: Number
}
},
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
},
methods: {
recoverySelection() {
var exitIds = this.selectedData.map((item) => item.merchantId)
this.selectingData.forEach((item) => {
exitIds.includes(item.merchantId) &&
this.$refs.seletingTable.toggleRowSelection(item, true)
})
},
getSelectingList() {
const _storeSearchForm = this.storeSearchForm
// 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理
// if ([0, 4].includes(this.selectedScene)) {
// // 会员权益,积分商城场景查询门店名称参数
// _storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
// }
this.storeApi({
...this.storeSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene
}).then((res) => {
res?.list?.forEach((val) => {
// 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo) val.merchantId = Number(val.merchantNo)
val?.sceneList?.forEach((subVal) => {
if (subVal.scene == this.selectedScene) {
val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-"
val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-"
}
})
})
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(
(item) => item.merchantId === row.merchantId
)
addOrDelete
? this.selectedData.push(row)
: (this.selectedData = this.selectedData.filter(
(item) => item.merchantId !== row.merchantId
))
},
handleAll(selection) {
this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex(
(subItem) => subItem.merchantId === item.merchantId
)
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(
(item) => item.merchantId !== row.merchantId
)
const obj = this.selectingData.find((v) => v.merchantId == row.merchantId)
this.$refs.seletingTable.toggleRowSelection(obj)
},
handleCurrentChange(val) {
this.currentPage = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
this.$emit("handleRelateStoreConfirm", this.selectedData)
},
handleRelateStoreClose() {
this.$emit("handleRelateStoreClose")
}
}
}
</script>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .tableCon {
margin-top: 20px;
display: flex;
.tableBox {
flex: 1;
}
}
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
<template>
<div class="store-table">
<el-table
:data="merchantGoodsRefList"
style="width: 100%"
:header-row-style="headerRowStyle"
header-cell-class-name="header-cell-class-name"
border>
<el-table-column
align="center"
width="60px"
label="序号"
type="index" />
<el-table-column
prop="merchantName"
label="门店名称"
align="center" />
<el-table-column
prop="merchantId"
label="门店商户号"
align="center" />
<el-table-column
label="操作"
align="center"
v-if="!isDetail"
width="90">
<template slot-scope="scope">
<el-button
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
name: 'RelateProTable',
props: {
merchantGoodsRefList: {
type: Array,
default: () => {}
},
isDetail: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
methods: {
handleDelete(item) {
this.$emit('handleDelete', item)
},
headerRowStyle() {
return {
height: '40px',
background: '#F2F4F7'
}
}
}
}
</script>
<style lang="scss" scoped>
.store-table{
margin-top: 15px;
}
::v-deep .header-cell-class-name{
height: 30px;
background: #F2F4F7;
}
::v-deep .el-table th{
padding: 0;
}
::v-deep .el-table__body-wrapper tr td{
padding: 8px 0 !important;
}
</style>
export const productList = [{
confId: 1,
confName: '基础产品'
}, {
confId: 2,
confName: '升级产品'
}]
export const baseSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 2,
confName: '门店'
}]
// 太阳膜升级产品供货模式
export const upgradeSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 3,
confName: '门店套码+嘀加'
}, {
confId: 4,
confName: '门店回收原厂+嘀加'
}, {
confId: 5,
confName: '服务商自采+嘀加'
}]
// 1.3场景 升级产品供货模式
export const crowdUpgradeSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 2,
confName: '门店'
}]
// 套餐上架商品信息form表单
export const packageGoodsForm = [{
name: 'upgradeGoodsId',
label: '上架商品',
isRequired: true,
type: 'searchSelect',
optionList: [],
isClear: false,
optionId: 'confId',
optionNameLabel: 'confNameValue',
optionTypeNameLabel: 'confTypeNameValue',
width: '432px'
}, {
type: 'incidBox',
key: 'goodsType',
detailInfo: [{
label: '商品名称',
value: 'upgradeGoodsName'
}, {
label: '规格',
value: 'specificationData'
}, {
label: '商品编码',
value: 'type'
}, {
label: '第三方编码',
value: 'thirdPartyCode'
}, {
label: '采购价',
value: 'purchasePrice',
unit: true
}, {
label: '参考售价',
value: 'upgradePrice',
unit: true
}, {
label: '适用车型',
value: 'carTypeConfigName'
}, {
label: '所属系列',
value: 'goodsName'
}, {
label: '所属分类',
value: 'tempGoodsTypeName'
}, {
label: '商品ID',
value: 'upgradeCommodityCode'
}]
}, {
name: 'position',
label: '上架部位',
type: 'radio',
radioGroupList: []
}, {
name: 'goodsAlias',
label: '商品别名',
type: 'input',
maxlength: 50,
width: '432px'
}, {
name: 'warrantyType',
label: '质保卡类型',
type: 'select',
isClear: false,
optionList: [{
confId: 0,
confName: '质保卡'
}, {
confId: 1,
confName: '质保权益卡'
}],
optionId: 'confId',
optionLabel: 'confName',
width: '432px'
}, {
name: 'upgradeSupplyMode',
label: '升级/产品供货模式',
type: 'radio',
index: 2,
radioGroupList: []
}, {
name: 'sellPrice',
label: '售价',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}, {
name: 'minSellPrice',
label: '最低售价',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}, {
name: 'upgradeProductCost',
label: '产品、升级成本',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}, {
name: 'recoveryCost',
label: '回收成本',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}, {
name: 'virtualAccountCost',
label: '虚拟对账成本',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}, {
name: 'djCost',
label: '嘀加成本',
type: 'input',
width: '432px',
unit: true,
isDisabled: false,
handleInput: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
type: 'input',
width: '432px',
unit: true,
handleInput: true
}]
// 套餐查看详情form
export const packageGoodsDetail = [
{
name: 'upgradeGoodsName',
label: '上架商品',
type: 'incidBox',
key: 'goodsType',
detailInfo: [{
label: '商品名称',
value: 'upgradeGoodsName'
}, {
label: '规格',
value: 'specificationData'
}, {
label: '商品编码',
value: 'type'
}, {
label: '第三方编码',
value: 'thirdPartyCode'
}, {
label: '采购价',
value: 'purchasePrice',
unit: true
}, {
label: '参考售价',
value: 'upgradePrice',
unit: true
}, {
label: '适用车型',
value: 'carTypeConfigName'
}, {
label: '所属系列',
value: 'goodsName'
}, {
label: '所属分类',
value: 'tempGoodsTypeName'
}, {
label: '商品ID',
value: 'upgradeCommodityCode'
}]
}, {
name: 'positionStr',
label: '上架部位'
}, {
name: 'goodsAlias',
label: '商品别名'
}, {
name: 'warrantyTypeStr',
label: '质保卡类型'
}, {
name: 'upgradeSupplyModeStr',
label: '升级产品供货模式'
}, {
name: 'sellPrice',
label: '售价',
unit: true
}, {
name: 'minSellPrice',
label: '最低售价',
unit: true
}, {
name: 'upgradeProductCost',
label: '产品、升级成本',
unit: true
}, {
name: 'recoveryCost',
label: '回收成本',
unit: true
}, {
name: 'virtualAccountCost',
label: '虚拟对账成本',
unit: true
}, {
name: 'djCost',
label: '嘀加成本',
unit: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
unit: true
}
]
<!-- 查看上架 -->
<template>
<d2-container class="edit-commodity">
<div class="" v-if="show">
<detail ref="d2GroundingDetail" :rules="rules" form-name="grounding" :origin-data="editData" :form-list="editForm"
:product-service-item-list="productServiceItemList" @handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose"></detail>
</div>
</d2-container>
</template>
<script>
import { getMerchantGoodsInfo, batchReviewAPI } from '@api/grounding'
import detail from './components/detail.vue'
import { sceneList, BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data'
import { baseConfig } from "@/main"
import { filterSpecsStr, convertYuanToWan } from '../filterOption'
export default {
name: 'GroundingDetail',
components: {
detail
},
data() {
return {
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
rules: {
merchantGoodsRefList: [{ required: true }],
sceneName: [{ required: true }],
goodsName: [{ required: true }],
productTypeStr: [{ required: true }],
baseSupplyModeStr: [{ required: true }],
upgradeSupplyModeStr: [{ required: true }],
sellPrice: [{ required: true }],
minSellPrice: [{ required: true }],
upgradeProductCost: [{ required: true }],
giftCost: [{ required: true }],
recoveryCost: [{ required: true }],
virtualAccountCost: [{ required: true }],
warrantyTypeStr: [{ required: true }],
djCost: [{ required: true }],
thirdPartyCost: [{ required: true }],
financeCheckFlagStr: [{ required: true }]
},
editForm: [{
title: '商品信息',
formBlock: [{
name: 'goodsName',
label: '上架商品',
type: 'incidBox',
key: 'goodsType',
detailInfo: [{
label: '商品名称',
value: 'upgradeGoodsName'
}, {
label: '规格',
value: 'specificationData'
}, {
label: '商品编码',
value: 'type'
}, {
label: '第三方编码',
value: 'thirdPartyCode'
}, {
label: '采购价',
value: 'purchasePrice',
unit: true
}, {
label: '参考售价',
value: 'upgradePrice',
unit: true
}, {
label: '适用车型',
value: 'carTypeConfigName'
}, {
label: '所属系列',
value: 'goodsName'
}, {
label: '所属分类',
value: 'tempGoodsTypeName'
}, {
label: '商品ID',
value: 'upgradeCommodityCode'
}]
}, {
name: 'positionStr',
label: '上架部位'
}, {
name: 'goodsAlias',
label: '商品别名'
}, {
name: 'warrantyTypeStr',
label: '质保卡类型'
}, {
name: 'productTypeStr',
label: '产品类型'
}, {
name: 'baseSupplyModeStr',
label: '基础产品供货模式'
}, {
name: 'upgradeSupplyModeStr',
label: '升级产品供货模式'
}, {
name: 'sellPrice',
label: '售价',
unit: true
}, {
name: 'minSellPrice',
label: '最低售价',
unit: true
}, {
name: 'upgradeProductCost',
label: '产品、升级成本',
unit: true
}, {
name: 'giftCost',
label: '赠送成本',
unit: true
}, {
name: 'recoveryCost',
label: '回收成本',
unit: true
}, {
name: 'virtualAccountCost',
label: '虚拟对账成本',
unit: true
}, {
name: 'djCost',
label: '嘀加成本',
unit: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
unit: true
}, {
name: 'financeCheckFlagStr',
label: '财务规则校验'
}]
}, {
title: '门店信息',
formBlock: [{
name: 'sceneName',
label: '业务场景'
}, {
name: 'merchantGoodsRefList',
label: '上架门店',
type: 'table'
}, {
name: 'voucherList',
label: '上架凭证',
type: 'upload'
}]
}, {
title: '操作信息',
formBlock: [{
type: 'checkView',
name: 'reviewLogList'
}]
}],
show: false,
editData: {},
examineFlag: false,
warrantyTypeShow: {
0: '质保卡',
1: '质保权益卡'
},
detailId: '',
productServiceItemList: [],
filterSpecsStr
}
},
mounted() {
this.getBaseData()
// 获取商品详情
const id = this.$route.query.id
this.detailId = id
if (!id) return this.show = true
this.getDetailInfo(id)
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => {
const productType = []
if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1)
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo || {}
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
const productTypeTextArr = []
// 太阳膜/延保类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || []
// 产品类型
productList.forEach(v => {
if (productType.includes(v.confId)) productTypeTextArr.push(v.confName)
})
res.reviewLogList?.forEach(val => {
val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
})
let arr = []
if (res.sceneType == 3) { // 1.3场景 升级产品供货模式
arr = crowdUpgradeSupplyModeList
}
if (res.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList
}
res.productTypeStr = productTypeTextArr?.length ? productTypeTextArr.join(';') : '-'
res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-'
res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || ''
res.upgradeSupplyModeStr = arr?.filter(v => v.confId == res.upgradeSupplyMode)[0]?.confName || ''
res.sceneName = sceneList[res.sceneType] || '-'
res.productType = productType
res.merchantGoodsRefList = res.merchantGoodsRefList || []
res.voucherList = res?.voucherList || []
res.positionStr = deepClone(this.positionTypeList)?.filter(val => res?.position == val.position)[0]?.confName || ''
res.supplierCode = res?.goodsInfo?.supplierCode
res.financeCheckFlagStr = res?.financeCheckFlag == 'Y' ? '开启' : res?.financeCheckFlag == 'N' ? '关闭' : '-'
res.upgradeGoods = {
...res.upgradeGoods,
goodsName: res.goodsInfo.goodsName,
tempGoodsTypeName: result,
serviceItemNames: res?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})?.join(','), // 服务项目
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
upgradeCommodityCode: res?.upgradeGoods?.commodityCode
}
this.editData = res || {}
this.$nextTick(() => {
this.show = true
})
})
},
filterEmpty(data) {
return (data ?? '') === ''
},
handleAddConfirm() {
this.$confirm('<p>审核通过后,商品完成上架,对应的门店可使用该商品</p>是否确定审核?', '提示', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
batchReviewAPI({ ids: [this.detailId] }).then(res => {
this.notice.okTips()
this.handleClose(true)
})
}).catch(err => {
console.log(err)
})
},
handleClose(isRefresh = false) {
if (isRefresh) {
this.close({ tagName: '/grounding' })
this.$router.push({ name: 'grounding' })
this.close({ tagName: '/grounding' })
} else {
this.$confirm('内容未保存,是否返回?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
this.close({ tagName: '/grounding' })
this.$router.push({ name: 'grounding' })
this.close({ tagName: '/grounding' })
}).catch(err => {
console.log(err)
})
}
},
handleAddClose() {
this.handleClose(true)
}
}
}
</script>
<style lang="scss" scoped></style>
......@@ -5,49 +5,26 @@
<span>分账配置</span>
</div>
<div style="padding: 20px">
<el-form
ref="divisionRuleRef"
:model="financialObj"
label-suffix=":"
label-width="154px"
>
<el-form ref="divisionRuleRef" :model="financialObj" label-suffix=":" label-width="154px">
<el-form-item label="" prop="autoFlag">
<span class="tips-block" slot="label">
<span class="tips-label">线上自动分账</span>
<el-tooltip
popper-class="tooltip-class"
effect="dark"
content="产生交易后会自动打款给商户,开启及关闭操作第二天生效。"
placement="top"
>
<span class="tips-icon" /> </el-tooltip
>:
<el-tooltip popper-class="tooltip-class" effect="dark" content="产生交易后会自动打款给商户,开启及关闭操作第二天生效。"
placement="top">
<span class="tips-icon" /> </el-tooltip>:
</span>
<el-switch
v-model="financialObj.autoFlag"
active-value="Y"
disabled
inactive-value="N"
/>
<el-switch v-model="financialObj.autoFlag" active-value="Y" disabled inactive-value="N" />
</el-form-item>
<el-form-item label="结算时间方式">
<span class="tips-block" slot="label">
<span class="tips-label">分账周期</span>
<el-tooltip
popper-class="tooltip-class"
effect="dark"
content="用户支付的款项可按T+1或指定日自动打款给商户。"
placement="top"
>
<span class="tips-icon" /> </el-tooltip
>:
<el-tooltip popper-class="tooltip-class" effect="dark" content="用户支付的款项可按T+1或指定日自动打款给商户。" placement="top">
<span class="tips-icon" /> </el-tooltip>:
</span>
<div class="block_item" style="margin-bottom: 20px">
<span>
分账周期 T+{{ settleTimeObj.first }}日
<span v-show="financialObj.settleTimeType == 1"
>(分账后第2天到分账方对公账户)</span
>
<span v-show="financialObj.settleTimeType == 1">(分账后第2天到分账方对公账户)</span>
</span>
</div>
</el-form-item>
......@@ -57,26 +34,14 @@
</el-form>
<el-tabs v-model="editableTabsValue" type="card" class="my-tab-pane">
<!-- closable -->
<el-tab-pane
v-for="item in editableTabs"
:key="item.name"
:label="item.title"
:name="item.name"
>
<el-tab-pane v-for="item in editableTabs" :key="item.name" :label="item.title" :name="item.name">
<span slot="label">{{ item.title }} </span>
<div class="classificationCptContainer">
<el-form
ref="divisionRuleRef"
:model="financialObj"
label-suffix=":"
label-width="154px"
>
<h3
v-if="
financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.groupType == 1
"
>
<el-form ref="divisionRuleRef" :model="financialObj" label-suffix=":" label-width="154px">
<h3 v-if="
financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.groupType == 1
">
全部品类
</h3>
......@@ -85,21 +50,17 @@
{{
financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.categoryType || "--"
}}</el-form-item
>
}}</el-form-item>
<el-form-item label="">
{{
financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.packageArrText
}}</el-form-item
>
}}</el-form-item>
</div>
<template
v-for="(item, index) in financialObj.goodsTypeGroupRules[
editableTabsValue - 1
].expenseCategoryRules"
>
<template v-for="(item, index) in financialObj.goodsTypeGroupRules[
editableTabsValue - 1
].expenseCategoryRules">
<el-form-item :key="index" :label="item.expenseCategoryName">
<span>{{
getExpenseCategoryCalculateType(
......@@ -111,15 +72,11 @@
</template>
</el-form>
</div>
<tableAccount
ref="tableAccount"
:merchant-distribution-rules="
financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.merchantDistributionRules
<tableAccount ref="tableAccount" :merchant-distribution-rules="financialObj.goodsTypeGroupRules[editableTabsValue - 1]
.merchantDistributionRules
"
:table-select-options="tableSelectOptions"
:classification-obj-select="tableClassificationObjSelect"
/>
:owningMerchantDistributionRules="financialObj.goodsTypeGroupRules[editableTabsValue - 1].owningMerchantDistributionRules"
:table-select-options="tableSelectOptions" :classification-obj-select="tableClassificationObjSelect" />
</el-tab-pane>
</el-tabs>
</div>
......@@ -137,11 +94,11 @@ export default {
props: {
divisiObj: {
type: Object,
default: () => {}
default: () => { }
},
basicInfo: {
type: Object,
default: () => {}
default: () => { }
}
},
data() {
......@@ -248,7 +205,7 @@ export default {
deep: true
}
},
created() {},
created() { },
methods: {
initData(data) {
......
<!-- 2 - 分账金额设置 -->
<template>
<div class="division-rule">
<p class="edit-sub-title">
费用归属设置 (用于定义费用的业务归属)
</p>
<el-form class="formSty" ref="divisionRuleRef" :model="form2" :rules="rules" label-suffix=":" label-width="180px">
<el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block">
<tr class="tableHeader">
<td>分账对象/分账类目</td>
<!-- <td>平台方分账金额</td> -->
<td v-for="(item, index) in radioList2" :key="index">
{{ item.applicationObjectName || item.expenseCategoryName }}
</td>
</tr>
<tr>
<td class="merchantNameTd p-b-20" v-if="!tableSelectOptionsId">
<p :title="item | filterMerchantType" v-for="(item, index) in tableSelectOptions" :key="index">
{{ item | filterMerchantType }}
</p>
</td>
<td class="merchantNameTd p-b-20" v-if="tableSelectOptionsId">
<p :title="item.merchantName" v-for="(item, index) in tableSelectOptions" :key="index">
{{ item.merchantName }}
</p>
</td>
<td class="p-b-20" v-for="(item, index) in radioList2" :key="index + 'radioList'">
<div class="line-td is-required el-form-item--medium wrap">
<p v-for="(el, index) in tableSelectOptions" :key="index" class="el-radio-group">
<span v-if="!tableSelectOptionsId" :class="[
'el-radio__input',
form2['id' + item.expenseCategoryId] == el.merchantId
? 'is-checked'
: ''
]">
<span class="el-radio__inner"></span>
</span>
<span v-if="tableSelectOptionsId" :class="[
'el-radio__input',
form2['id' + item.expenseCategoryId] == el.targetMerchantType
? 'is-checked'
: ''
]">
<span class="el-radio__inner"></span>
</span>
</p>
</div>
</td>
</tr>
</table>
</el-form-item>
</el-form>
<p class="edit-sub-title">
实际分账设置 (用于定义费用的实际分账归属)
</p>
<el-form class="formSty" ref="divisionRuleRef" :model="form" :rules="rules" label-suffix=":" label-width="180px">
<el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block">
......@@ -67,6 +120,12 @@ export default {
return []
}
},
owningMerchantDistributionRules: {
type: Array,
default: () => {
return []
}
},
// 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户
tableSelectOptions: {
......@@ -92,6 +151,9 @@ export default {
form: {
// settleTimeType: 1
},
form2: {
// settleTimeType: 1
},
platformSideLabel: 0,
merchantAccountInfo: {},
partnerSettleAccountModel: "",
......@@ -150,6 +212,29 @@ export default {
// console.log("list", arr)
return arr
},
radioList2: function () {
const obj = this.classificationObjSelect
let list = []
let arr = []
const arrIdx = [1, 2, 302, 701, 4]
for (const key in obj) {
obj[key].map((item) => {
if (
arrIdx.includes(item.id) ||
arrIdx.includes(item.expenseCategoryId)
) {
list.push(item)
}
})
}
arr = list.filter((item) => {
return (
arrIdx.includes(item.id) || arrIdx.includes(item.expenseCategoryId)
)
})
// console.log('list', arr)
return arr
},
tableSelectOptionsId() {
return this.tableSelectOptions.some(item => item.merchantId == 1)
}
......@@ -158,6 +243,7 @@ export default {
classificationObjSelect: {
handler() {
this.initList()
this.initList2()
},
deep: true,
immediate: true
......@@ -165,6 +251,7 @@ export default {
merchantDistributionRules: {
handler() {
this.initList()
this.initList2()
},
deep: true
// immediate: true
......@@ -220,6 +307,42 @@ export default {
this.form = form
// console.log(this.form, "this.form")
},
initList2() {
// console.log('initList')
// this.merchantDistributionRules
// console.log(this.merchantDistributionRules)
const obj = this.classificationObjSelect
const tableSelectOptionsId = this.tableSelectOptions.some(item => item.merchantId == 1)
const form = {}
// console.log('obj', obj)
// 判断是不是多商户的,是改一下结构绑定
for (const key in obj) {
obj[key].map((item) => {
// 数字转字符串
const name = "id" + item.expenseCategoryId
// console.log(name, item.id || item.expenseCategoryId, 'item.id')
// 做回显用数据
const findObj = this.owningMerchantDistributionRules.find((el) => {
return el.expenseCategoryId == item.expenseCategoryId
})
// console.log('findObj', findObj)
// if (findObj?.targetMerchantType == 3 && tableSelectOptionsId) {
// this.copyMerchantInfo = findObj
// }
// 还要跟存在现在的选项里面
// console.log(name)
// const optIndex = this.tableSelectOptions.findIndex((opt) => { return opt.merchantId == findObj?.merchantId })
// console.log(optIndex, 'optIndex')
// form[name] = parseInt(findObj?.merchantId) || ""
// console.log(findObj, tableSelectOptionsId)
// console.log(findObj.targetMerchantType == 3 && tableSelectOptionsId)
form[name] = findObj?.merchantId || ""
})
}
// 判断id是否有在选项里面 没有就去掉
this.form2 = form
console.log(this.form, 'this.form')
},
changFormList() {
console.log(this.form, "this.form")
// 判断id是否有在选项里面 没有就去掉
......
<!-- 2 - 分账金额设置 -->
<template>
<div class="division-rule">
<p class="edit-sub-title">
费用归属设置 (用于定义费用的业务归属)
</p>
<el-form class="formSty" ref="divisionRuleRef2" :model="form2" :rules="rules" label-suffix=":" label-width="180px">
<el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block">
<tr class="tableHeader">
<td>分账对象/分账类目</td>
<!-- <td>平台方分账金额</td> -->
<td v-for="(item, index) in radioList2" :key="index">
{{ item.applicationObjectName || item.expenseCategoryName }}
</td>
</tr>
<tr>
<td class="merchantNameTd p-b-20">
<p :title="item | filterMerchantType" v-for="(item, index) in tableSelectOptions" :key="index">
{{ item | filterMerchantType }}
</p>
</td>
<td class="p-b-20" v-for="(item, index) in radioList2" :key="index + 'radioList'">
<el-form-item label-width="0" :prop="`id${item.expenseCategoryId}`" :rules="[
{
required: true,
message: `请选择${item.applicationObjectName}`,
trigger: 'change'
}
]">
<el-radio-group v-model="form2['id' + item.expenseCategoryId]" @change="
(e) => handleClearValid2(e, 'id' + item.expenseCategoryId)
">
<el-radio v-for="(el, index) in tableSelectOptions" :key="index" :label="+el.merchantId" />
</el-radio-group>
</el-form-item>
</td>
</tr>
</table>
</el-form-item>
</el-form>
<p class="edit-sub-title">
实际分账设置 (用于定义费用的实际分账归属)
</p>
<el-form class="formSty" ref="divisionRuleRef" :model="form" :rules="rules" label-suffix=":" label-width="180px">
<el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block">
......@@ -40,7 +81,6 @@
</template>
<script>
import { mapGetters } from "vuex"
// import { userType } from '@/common/constants'
export default {
name: "TableAccount",
......@@ -56,6 +96,12 @@ export default {
return []
}
},
owningMerchantDistributionRules: {
type: Array,
default: () => {
return []
}
},
// 分账对象选项 1:平台方 2:服务商 3:流量方 4:子商户
tableSelectOptions: {
......@@ -82,6 +128,9 @@ export default {
form: {
// settleTimeType: 1
},
form2: {
// settleTimeType: 1
},
platformSideLabel: 0,
merchantAccountInfo: {},
partnerSettleAccountModel: "",
......@@ -139,15 +188,36 @@ export default {
})
// console.log('list', arr)
return arr
},
radioList2: function () {
const obj = this.classificationObjSelect
let list = []
let arr = []
const arrIdx = [1, 2, 302, 701, 4]
for (const key in obj) {
obj[key].map((item) => {
if (
arrIdx.includes(item.id) ||
arrIdx.includes(item.expenseCategoryId)
) {
list.push(item)
}
})
}
arr = list.filter((item) => {
return (
arrIdx.includes(item.id) || arrIdx.includes(item.expenseCategoryId)
)
})
// console.log('list', arr)
return arr
}
// ...mapGetters("goodsInfoData", {
// shelfType: "shelfType"
// })
},
watch: {
classificationObjSelect: {
handler() {
this.initList()
this.initList2()
},
deep: true,
immediate: true
......@@ -155,6 +225,7 @@ export default {
merchantDistributionRules: {
handler() {
this.initList()
this.initList2()
},
deep: true
// immediate: true
......@@ -207,6 +278,43 @@ export default {
this.form = form
console.log(this.form, 'this.form')
},
initList2() {
// console.log('initList')
// this.merchantDistributionRules
// console.log(this.merchantDistributionRules)
const obj = this.classificationObjSelect
const tableSelectOptionsId = this.tableSelectOptions.some(item => item.merchantId == 1)
const form = {}
// console.log('obj', obj)
// 判断是不是多商户的,是改一下结构绑定
for (const key in obj) {
obj[key].map((item) => {
// 数字转字符串
const name = "id" + item.expenseCategoryId
// console.log(name, item.id || item.expenseCategoryId, 'item.id')
// 做回显用数据
const findObj = this.owningMerchantDistributionRules.find((el) => {
return el.expenseCategoryId == item.expenseCategoryId
})
// console.log('findObj', findObj)
// if (findObj?.targetMerchantType == 3 && tableSelectOptionsId) {
// this.copyMerchantInfo = findObj
// }
// 还要跟存在现在的选项里面
// console.log(name)
// const optIndex = this.tableSelectOptions.findIndex((opt) => { return opt.merchantId == findObj?.merchantId })
// console.log(optIndex, 'optIndex')
// form[name] = parseInt(findObj?.merchantId) || ""
// console.log(findObj, tableSelectOptionsId)
// console.log(findObj.targetMerchantType == 3 && tableSelectOptionsId)
form[name] = findObj?.merchantId || ""
})
}
// 判断id是否有在选项里面 没有就去掉
this.form2 = form
console.log(this.form, 'this.form')
},
changFormList() {
// console.log(this.form,'this.form')
// 判断id是否有在选项里面 没有就去掉
......@@ -217,6 +325,78 @@ export default {
}) == -1 && (this.form[key] = "")
}
},
handleClearValid2(e, validField) {
this.$forceUpdate()
// this.handleConfirm()
// console.log('validField', validField)
this.$refs.divisionRuleRef2.clearValidate(validField)
},
handleConfirm2() {
// console.log(this.merchantInfo)
return new Promise((resolve, reject) => {
this.$refs.divisionRuleRef2.validate((valid) => {
if (valid) {
// this.form
const merchantDistributionRules = this.radioList2.reduce(
(prev, next) => {
const id = this.form2["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
// (item) => item.merchantId == id
(item) => (item.merchantId == id) || (item.targetMerchantType == 3 && item.targetMerchantLevel == id)
)
// console.log(merchantObj, 'merchantObj')
if (merchantObj?.merchantId == 1) {
merchantObj.merchantId = this.copyMerchantInfo.merchantId
merchantObj.merchantName = this.copyMerchantInfo.merchantName
}
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
},
[]
)
resolve(merchantDistributionRules)
} else {
resolve(false)
}
})
})
},
getTableAccountParams2() {
const merchantDistributionRules = this.radioList2.reduce((prev, next) => {
const id = this.form2["id" + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(
// (item) => item.merchantId == id
// (item) => (item.merchantId == id) || item.targetMerchantLevel == id
(item) => (item.merchantId == id) || (item.targetMerchantType == 3 && item.targetMerchantLevel == id)
)
if (merchantObj?.merchantId == 1) {
merchantObj.merchantId = this.copyMerchantInfo.merchantId
merchantObj.merchantName = this.copyMerchantInfo.merchantName
}
console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
}, [])
return merchantDistributionRules
},
handleClearValid(e, validField) {
this.$forceUpdate()
// this.handleConfirm()
......
......@@ -772,7 +772,8 @@
</el-form>
<!-- <el-button @click="handleConfirm">测试</el-button> -->
<tableAccount ref="tableAccount" :merchant-distribution-rules="goodsTypeGroupRules.merchantDistributionRules
" :table-select-options="tableSelectOptions" :classification-obj-select="tableClassificationObjSelect" />
" :owningMerchantDistributionRules="goodsTypeGroupRules.owningMerchantDistributionRules"
:table-select-options="tableSelectOptions" :classification-obj-select="tableClassificationObjSelect" />
<tipsDialog v-if="tipsDialogVisible" :account-valid-merchants="accountValidMerchants"
:visible.sync="tipsDialogVisible" />
<financialCalculationDialog v-if="financialCalculationVisible" v-on="$listeners"
......@@ -2103,9 +2104,10 @@ export default {
// 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 })
const res2 = await this.$refs.tableAccount.handleConfirm2()
console.log("res", res, res2)
res && res2
? resolve({ ...obj, merchantDistributionRules: res, owningMerchantDistributionRules: res2 })
: resolve(false)
} else {
resolve(false)
......@@ -2116,8 +2118,9 @@ export default {
getClassificationParams() {
const obj = this.getParams()
const res = this.$refs.tableAccount.getTableAccountParams()
const res2 = this.$refs.tableAccount.getTableAccountParams2()
// console.log("res", { ...obj, merchantDistributionRules: res })
return { ...obj, merchantDistributionRules: res }
return { ...obj, merchantDistributionRules: res, owningMerchantDistributionRules: res2 }
// : resolve(false)
// return new Promise((resolve, reject) => {
// this.$refs.classification.validate(async (valid) => {
......
......@@ -2,7 +2,71 @@
<template>
<div class="division-rule">
<p class="edit-sub-title">
分账金额设置
费用归属设置 (用于定义费用的业务归属)
</p>
<el-form class="formSty" ref="divisionRuleRef2" :model="form2" :rules="rules" label-suffix=":" label-width="180px">
<el-form-item label="" label-width="54px">
<table cellpadding="0" cellspacing="0" class="table-block">
<!-- <tr>
<th rowspan="2">
分账方-账户
</th>
<th :colspan="merchantAccountInfo.partnerSettleAccountModel == 2?6:5">
分账金额
</th>
</tr> -->
<tr class="tableHeader">
<td>分账对象/分账类目</td>
<td>平台方分账金额</td>
<td v-for="(item, index) in radioList2" :key="index">{{ item.applicationObjectName }}</td>
<!-- <td v-if="merchantAccountInfo.partnerSettleAccountModel == 1">
服务商分账金额
</td> -->
<!-- <td v-if="merchantAccountInfo.partnerSettleAccountModel == 2">
安装费用
</td>
<td v-if="merchantAccountInfo.partnerSettleAccountModel == 2">
营销费用(包含奖惩)
</td>
<td>导流方分账金额</td>
<td>产品成本</td>
<td>额外成本</td> -->
<!-- <td>市场费</td> -->
</tr>
<tr>
<td class="merchantNameTd p-b-20 ">
<!-- <p>默认:嘀加智慧云</p> -->
<!-- class="one-line-ellipsis"
style="width: 300px;" -->
<!-- 对应的分账对象 -->
<p :title="item | filterMerchantType" v-for="(item, index) in tableSelectOptions" :key="index">
{{ item | filterMerchantType }}
</p>
</td>
<td class="p-b-20">
<el-form-item label-width="0px">
<el-radio-group v-model="platformSideLabel">
<el-radio v-for="(item, index) in tableSelectOptions" :key="index + 'index'" :disabled="item != 0"
:label="index" />
</el-radio-group>
</el-form-item>
</td>
<td class="p-b-20" v-for="(item, index) in radioList2" :key="index + 'radioList2'">
<el-form-item label-width="0" :prop="`id${item.expenseCategoryId}`"
:rules="[{ required: true, message: `请选择${item.applicationObjectName}`, trigger: 'change' }]">
<el-radio-group v-model="form2['id' + (item.expenseCategoryId)]"
@change="e => handleClearValid2(e, 'id' + (item.expenseCategoryId))">
<el-radio v-for="(el, index) in tableSelectOptions" :key="index" :label="+(el.merchantId)" />
</el-radio-group>
</el-form-item>
</td>
</tr>
</table>
</el-form-item>
</el-form>
<p class="edit-sub-title">
实际分账设置 (用于定义费用的实际分账归属)
</p>
<el-form class="formSty" ref="divisionRuleRef" :model="form" :rules="rules" label-suffix=":" label-width="180px">
<el-form-item label="" label-width="54px">
......@@ -88,6 +152,12 @@ export default {
return []
}
},
owningMerchantDistributionRules: {
type: Array,
default: () => {
return []
}
},
// 分账对象选项 1:平台方 2:服务商 3:导流方 4:子商户
tableSelectOptions: {
......@@ -113,6 +183,9 @@ export default {
form: {
// settleTimeType: 1
},
form2: {
// settleTimeType: 1
},
platformSideLabel: 0,
merchantAccountInfo: {
......@@ -156,26 +229,29 @@ export default {
})
}
return list
},
radioList2: function () {
const obj = this.classificationObjSelect
const list = []
for (const key in obj) {
obj[key].map((item) => {
list.push(item)
})
}
return list
}
},
watch: {
classificationObjSelect: {
handler() {
this.initList()
this.initList2()
},
deep: true,
immediate: true
},
merchantDistributionRules: {
handler() {
this.initList()
},
deep: true
// immediate: true
},
tableSelectOptions: {
handler() {
// this.initList()
this.changFormList()
},
deep: true
......@@ -186,7 +262,6 @@ export default {
methods: {
initList() {
// console.log('initList')
// this.merchantDistributionRules
// console.log(this.merchantDistributionRules)
const obj = this.classificationObjSelect
const form = {}
......@@ -212,6 +287,33 @@ export default {
// 判断id是否有在选项里面 没有就去掉
this.form = form
},
initList2() {
// console.log('initList')
// console.log(this.merchantDistributionRules)
const obj = this.classificationObjSelect
const form = {}
// console.log('obj', obj)
for (const key in obj) {
obj[key].map(
item => {
// 数字转字符串
const name = 'id' + item.expenseCategoryId
// console.log(name, item.id || item.expenseCategoryId, 'item.id')
// 做回显用数据
const findObj = this.owningMerchantDistributionRules.find((el) => { return el.expenseCategoryId == item.expenseCategoryId })
// 还要跟存在现在的选项里面
// console.log('findObj', findObj)
// console.log(name)
// const optIndex = this.tableSelectOptions.findIndex((opt) => { return opt.merchantId == findObj?.merchantId })
// console.log(optIndex, 'optIndex')
form[name] = parseInt(findObj?.merchantId) || ''
}
)
}
// 判断id是否有在选项里面 没有就去掉
this.form2 = form
},
changFormList() {
// 判断id是否有在选项里面 没有就去掉
for (const key in this.form) {
......@@ -225,6 +327,73 @@ export default {
// console.log('validField', validField)
this.$refs.divisionRuleRef.clearValidate(validField)
},
handleClearValid2(e, validField) {
this.$forceUpdate()
// this.handleConfirm()
// console.log('validField', validField)
this.$refs.divisionRuleRef2.clearValidate(validField)
},
handleConfirm2() {
// console.log(this.merchantInfo)
return new Promise((resolve, reject) => {
this.$refs.divisionRuleRef2.validate(valid => {
if (valid) {
// this.form
const merchantDistributionRules = this.radioList2.reduce((prev, next) => {
const id = this.form2['id' + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(item => item.merchantId == id)
// console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
}, [])
resolve(merchantDistributionRules)
} else {
resolve(false)
}
})
}
)
},
getTableAccountParams2() {
const merchantDistributionRules = this.radioList2.reduce((prev, next) => {
const id = this.form2['id' + next.expenseCategoryId]
// console.log(id)
const merchantObj = this.tableSelectOptions.find(item => item.merchantId == id)
// console.log(merchantObj, 'merchantObj')
next = {
...next,
expenseCategoryId: next.expenseCategoryId,
...merchantObj
}
// console.log(next, 'next')
// const name = 'id' + next.id
// prev[name] = this.form[name]
prev.push(next)
return prev
}, [])
return merchantDistributionRules
// console.log(this.merchantInfo)
// return new Promise((resolve, reject) => {
// this.$refs.divisionRuleRef.validate(valid => {
// if (valid) {
// // this.form
// } else {
// resolve(false)
// }
// })
// }
// )
},
handleConfirm() {
// console.log(this.merchantInfo)
return new Promise((resolve, reject) => {
......
......@@ -45,7 +45,12 @@
<div class="msg-val"> T + {{ items.settleTime }}</div>
</div>
<div class="msg">
<div class="msg-title">金额分配设置:</div>
<div class="msg-title">费用归属设置:</div>
<div class="msg-val" v-html="getDistribute(item.owningMerchantDistributionRules)">
</div>
</div>
<div class="msg">
<div class="msg-title">实际分账设置:</div>
<div class="msg-val" v-html="getDistribute(item.merchantDistributionRules)">
</div>
</div>
......
......@@ -60,6 +60,8 @@
<div class="cost">子类目</div>
<div class="cost">计算模式</div>
<div class="cost">分帐规则</div>
<div class="cost">归属商户</div>
<div class="cost">归属商户商户号</div>
<div class="cost">分润对象</div>
<div class="cost">分润对象商户号</div>
</div>
......@@ -68,13 +70,13 @@
v-for="(subItem, subIdx) in item.expenseCategoryRuleTargetTypeGroups" :key="subIdx + 'expenseCategory3'">
<template v-if="subItem.targetType == 1">
<div class="detail-i">流量方分润</div>
<div class="detail-i more flex8">
<div class="detail-i more flex10">
<div class="flex_box"
v-for="(ininItem, initIdx) in item.expenseCategoryRuleTargetTypeGroups.find(ele => ele.targetType == 1).expenseCategoryRuleLevels"
:key="initIdx">
<template v-if="ininItem.nodeType == 1">
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 1) }">{{ ininItem.expenseCategoryName
}}</div>
}}</div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 2) }">{{ ininItem.calculateMode == 1
? '按品类计算' :
ininItem.calculateMode == 2 ? '按整单计算' :
......@@ -87,6 +89,12 @@
</div>
<div class="detail-i" v-for="num in 3" :key="num"> {{ '-' }} </div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 4) }">
{{ ininItem.targetMerchantName || '-' }}
</div>
<div class="detail-i more" :class="{ 'isRed': filterIsRed(ininItem, 4) }">
{{ ininItem.targetMerchantId || '-' }}
</div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 4) }">
{{ ininItem.distributeTargetMerchantName || '-' }}
</div>
<div class="detail-i more" :class="{ 'isRed': filterIsRed(ininItem, 4) }">
......@@ -95,7 +103,7 @@
</template>
<template v-if="ininItem.nodeType == 2">
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 1) }">{{ ininItem.expenseCategoryName
}}</div>
}}</div>
<div class="detail-i" :class="{ 'isRed': !item.diffTypes.length && filterIsRed(ininItem, 2) }">{{
ininItem.calculateMode == 1 ? '按品类计算' :
ininItem.calculateMode == 2 ? '按整单计算' :
......@@ -128,6 +136,16 @@
<div class="detail-i more">
<div v-for="(childrenITem, num) in ininItem.children" :key="num" class="childrenItem"
:class="{ 'isRed': filterIsRed(childrenITem, 4) }"> {{
childrenITem.targetMerchantName || '-' }}</div>
</div>
<div class="detail-i more">
<div v-for="(childrenITem, num) in ininItem.children" :key="num" class="childrenItem"
:class="{ 'isRed': filterIsRed(childrenITem, 4) }"> {{
childrenITem.targetMerchantId || '-' }}</div>
</div>
<div class="detail-i more">
<div v-for="(childrenITem, num) in ininItem.children" :key="num" class="childrenItem"
:class="{ 'isRed': filterIsRed(childrenITem, 4) }"> {{
childrenITem.distributeTargetMerchantName || '-' }}</div>
</div>
<div class="detail-i more">
......@@ -141,13 +159,13 @@
</template>
<template v-if="subItem.targetType == 2">
<div class="detail-i">服务商分润</div>
<div class="detail-i more flex8">
<div class="detail-i more flex10">
<div class="flex_box"
v-for="(ininItem, initIdx) in item.expenseCategoryRuleTargetTypeGroups.find(ele => ele.targetType == 2).expenseCategoryRuleLevels"
:key="initIdx">
<template v-if="ininItem.nodeType == 1">
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 1) }">{{ ininItem.expenseCategoryName
}}</div>
}}</div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 2) }">{{ ininItem.calculateMode == 1
? '按品类计算' :
ininItem.calculateMode == 2 ? '按整单计算' :
......@@ -160,6 +178,12 @@
</div>
<div class="detail-i" v-for="num in 3" :key="num"> {{ '-' }} </div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 4) }">
{{ ininItem.targetMerchantName || '-' }}
</div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 4) }">
{{ ininItem.targetMerchantId || '-' }}
</div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 4) }">
{{ ininItem.distributeTargetMerchantName || '-' }}
</div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 4) }">
......@@ -168,7 +192,7 @@
</template>
<template v-if="ininItem.nodeType == 2">
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 1) }">{{ ininItem.expenseCategoryName
}}</div>
}}</div>
<div class="detail-i" :class="{ 'isRed': filterIsRed(ininItem, 2) }">{{ ininItem.calculateMode == 1
? '按品类计算' :
ininItem.calculateMode == 2 ? '按整单计算' :
......@@ -201,6 +225,16 @@
<div class="detail-i more">
<div v-for="(childrenITem, num) in ininItem.children" :key="num" class="childrenItem"
:class="{ 'isRed': filterIsRed(childrenITem, 4) }"> {{
childrenITem.targetMerchantName || '-' }}</div>
</div>
<div class="detail-i more">
<div v-for="(childrenITem, num) in ininItem.children" :key="num" class="childrenItem"
:class="{ 'isRed': filterIsRed(childrenITem, 4) }"> {{
childrenITem.targetMerchantId || '-' }}</div>
</div>
<div class="detail-i more">
<div v-for="(childrenITem, num) in ininItem.children" :key="num" class="childrenItem"
:class="{ 'isRed': filterIsRed(childrenITem, 4) }"> {{
childrenITem.distributeTargetMerchantName || '-' }}</div>
</div>
<div class="detail-i more">
......@@ -214,7 +248,7 @@
</template>
<template v-if="subItem.targetType == 3">
<div class="detail-i">其它费用</div>
<div class="detail-i more flex8">
<div class="detail-i more flex10">
<div class="flex_box"
v-for="(ininItem, initIdx) in item.expenseCategoryRuleTargetTypeGroups.find(ele => ele.targetType == 3).expenseCategoryRuleLevels"
:key="initIdx">
......@@ -586,7 +620,7 @@ $color: #2a58ad;
}
&.right {
flex: 5;
flex: 7;
}
.type-name {
......@@ -688,7 +722,7 @@ $color: #2a58ad;
&+.flex8 {
display: flex;
flex: 8;
flex: 10;
}
}
}
......@@ -708,9 +742,14 @@ $color: #2a58ad;
border-left: 1px solid #e8e8ea;
}
&+.flex10 {
display: flex;
flex: 10;
}
&+.flex8 {
display: flex;
flex: 8
flex: 8;
}
flex: 1;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!