Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a52bf4c2
authored
Mar 16, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商户管理-财务-分账比例设置完成
1 parent
351cdf9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
160 additions
and
15 deletions
src/views/systemConfig/merchantDetail.vue
src/views/systemConfig/merchantDetail.vue
View file @
a52bf4c
...
...
@@ -122,7 +122,7 @@
<span
style=
"margin-right: 30px;"
>
类型:调用类型
</span>
<el-button
type=
"text"
@
click=
"handle
FirstSetEdit
"
@
click=
"handle
SetEdit('isFirstSetEdit', 'accountValiteForm', 'accountSetForm', 'accountSecondSetForm', 'accountSecondSetStruct')
"
>
{{
isFirstSetEdit
?
'完成'
:
'编辑'
}}
</el-button>
</block>
</p>
...
...
@@ -238,16 +238,19 @@
<el-button
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleAccountDelete(item, index)"
@
click=
"handleAccountDelete(
'accountSetForm',
item, index)"
></el-button>
</el-form-item>
</p>
<el-form-item
class=
"p-l-30"
style=
"width: 63%;"
>
<el-form-item
class=
"p-l-30"
style=
"width: 63%;"
>
<el-button
v-if=
"isFirstSetEdit"
size=
"small"
type=
"primary"
@
click=
"handleAccountAdd(
item, index
)"
@
click=
"handleAccountAdd(
'accountSetForm', 'accountValiteForm', 'accountSetStruct'
)"
>
+新增分账品类
</el-button>
</el-form-item>
<el-form-item
...
...
@@ -358,6 +361,117 @@
</el-form-item>
-->
</div>
<div>
<div
class=
"account-card-block"
>
<p
class=
"card-title"
>
<span>
目标分账对象:
</span>
<span
class=
"title-target-obj"
>
服务商 / 转化方 / 合作伙伴
</span>
<block
style=
"float: right; margin-top: -8px;"
>
<span
style=
"margin-right: 30px;"
>
类型:调用类型
</span>
<el-button
type=
"text"
@
click=
"handleSetEdit('isSecondSetEdit', 'accountSecondValiteForm', 'accountSecondSetForm', 'accountSetForm', 'accountSetStruct')"
>
{{
isSecondSetEdit
?
'完成'
:
'编辑'
}}
</el-button>
</block>
</p>
<el-form
:inline=
"true"
:model=
"accountSecondSetForm"
ref=
"accountSecondValiteForm"
>
<p
class=
"account-content p-l-30"
v-for=
"(item, index) in accountSecondSetForm.list"
:key=
"index"
>
<el-form-item
:prop=
"'list.' + index + '.goodsType'"
:rules=
"
{ required: true, message: '请选择分账品类', trigger: 'change'}"
>
<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"
></span>
</el-tooltip>
:
</span>
<el-select
v-show=
"isSecondSetEdit && index !== 0"
size=
"small"
v-model=
"item.goodsType"
@
change=
"handleSelectChange($event, index, 'accountSecondSetForm')"
>
<el-option
v-for=
"(subItem, subIndex) in baseData.productTypeList"
:key=
"subIndex"
:label=
"subItem.goodsTypeName"
:value=
"subItem.goodsType"
:disabled=
"accountSecondSetForm.list.filter(k => k.goodsType !== item.goodsType).map(i => i.goodsType).includes(subItem.goodsType)"
></el-option>
</el-select>
<span
v-show=
"!isSecondSetEdit || index === 0"
>
{{
item
.
goodsTypeName
}}
</span>
</el-form-item>
<el-form-item
:prop=
"'list.' + index + '.merchantProfitValue'"
:rules=
"[
{ required: true, message: '请输入分润比例', trigger: 'change'}, { pattern: /^(([1-9][0-9])|[0-9])$/, message: '请输入小于100正整数', trigger: 'blur' }]"
>
<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"
></span>
</el-tooltip>
:
</span>
<el-input
size=
"small"
v-show=
"isSecondSetEdit"
v-model=
"item.merchantProfitValue"
>
<i
slot=
"suffix"
class=
"suffix"
>
%
</i></el-input>
<span
v-show=
"!isSecondSetEdit"
>
{{
item
.
merchantProfitValue
?
(
item
.
merchantProfitValue
+
'%'
)
:
''
}}
</span>
</el-form-item>
<el-form-item
v-if=
"isSecondSetEdit && index !== 0"
style=
"width: 3%;"
>
<el-button
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleAccountDelete('accountSecondSetForm', item, index)"
></el-button>
</el-form-item>
</p>
<el-form-item
v-if=
"isSecondSetEdit"
class=
"p-l-30"
style=
"width: 63%;"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"handleAccountAdd('accountSecondSetForm', 'accountSecondValiteForm', 'accountSecondSetStruct')"
>
+新增分账品类
</el-button>
</el-form-item>
</el-form>
</div>
</div>
<div>
<!--
<h4
class=
"form_gp_title"
>
服务商财务对账分润规则
</h4>
<el-form-item
label=
"服务商分润比例"
...
...
@@ -489,6 +603,7 @@ export default {
},
// 编辑按钮
isFirstSetEdit
:
false
,
isSecondSetEdit
:
false
,
// 分账设置
accountSetStruct
:
Object
.
freeze
({
goodsType
:
''
,
...
...
@@ -504,6 +619,19 @@ export default {
merchantProfitValue
:
''
}]
},
// 分账设置-服务商(第二个)
accountSecondSetStruct
:
Object
.
freeze
({
goodsType
:
''
,
goodsTypeName
:
''
,
partnerProfitPer
:
''
}),
accountSecondSetForm
:
{
list
:
[{
goodsType
:
'全部'
,
goodsTypeName
:
'全部'
,
partnerProfitPer
:
''
}]
},
merchantId
:
''
,
channelType
:
''
,
contactName
:
''
,
...
...
@@ -612,32 +740,49 @@ export default {
// this.form.incentiveValue = ''
// this.oldVal.incentiveValue = ''
// },
handleFirstSetEdit
()
{
if
(
this
.
isFirstSetEdit
)
{
this
.
$refs
.
accountValiteForm
.
validate
(
valid
=>
{
// 是否编辑;refs绑定的属性值;当前Form属性值;级联Form属性值;添加对象的属性
handleSetEdit
(
isEditAttr
,
refsAttr
,
formAttr
,
cascadeChangeAttr
,
addStructAttr
)
{
if
(
this
[
isEditAttr
])
{
this
.
$refs
[
refsAttr
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
isFirstSetEdit
=
!
this
.
isFirstSetEdit
this
[
isEditAttr
]
=
!
this
[
isEditAttr
]
// 设置其中一个表格增删改后,级联另一个表格中的分账品类
var
currentLen
=
this
[
formAttr
].
list
.
length
var
cascadeLen
=
this
[
cascadeChangeAttr
].
list
.
length
if
(
currentLen
<
cascadeLen
)
{
this
[
cascadeChangeAttr
].
list
.
splice
(
currentLen
,
cascadeLen
-
currentLen
)
}
this
[
formAttr
].
list
.
forEach
((
i
,
idx
)
=>
{
cascadeLen
=
this
[
cascadeChangeAttr
].
list
.
length
if
(
cascadeLen
<
idx
+
1
)
{
this
[
cascadeChangeAttr
].
list
.
push
(
_
.
cloneDeep
(
this
[
addStructAttr
]))
var
cascadeEditAttr
=
isEditAttr
===
'isFirstSetEdit'
?
'isSecondSetEdit'
:
'isFirstSetEdit'
this
[
cascadeEditAttr
]
=
!
this
[
cascadeEditAttr
]
}
this
[
cascadeChangeAttr
].
list
[
idx
].
goodsType
=
i
.
goodsType
this
[
cascadeChangeAttr
].
list
[
idx
].
goodsTypeName
=
i
.
goodsTypeName
})
}
})
return
true
}
this
.
isFirstSetEdit
=
!
this
.
isFirstSetEdit
this
[
isEditAttr
]
=
!
this
[
isEditAttr
]
},
handleAccountAdd
()
{
var
validArr
=
this
.
accountSetForm
.
list
.
map
((
i
,
index
)
=>
'list.'
+
index
+
'.goodsType'
)
handleAccountAdd
(
formAttr
,
refsAttr
,
addStructAttr
)
{
var
validArr
=
this
[
formAttr
].
list
.
map
((
i
,
j
)
=>
'list.'
+
j
+
'.goodsType'
)
var
isEmpty
=
false
this
.
$refs
.
accountValiteForm
.
validateField
(
validArr
,
valid
=>
{
this
.
$refs
[
refsAttr
]
.
validateField
(
validArr
,
valid
=>
{
valid
&&
(
isEmpty
=
true
)
})
!
isEmpty
&&
this
.
accountSetForm
.
list
.
push
(
_
.
cloneDeep
(
this
.
accountSetStruct
))
!
isEmpty
&&
this
[
formAttr
].
list
.
push
(
_
.
cloneDeep
(
this
[
addStructAttr
]
))
},
handleAccountDelete
(
item
,
index
)
{
handleAccountDelete
(
formAttr
,
item
,
index
)
{
this
.
$confirm
(
'是否删除该品类'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
accountSetForm
.
list
.
splice
(
index
,
1
)
this
[
formAttr
]
.
list
.
splice
(
index
,
1
)
})
},
onSubmit
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment