Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
SuperMan
Commits
10f8db20
Commit
10f8db20
authored
Dec 20, 2019
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
52707802
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
175 additions
and
254 deletions
+175
-254
viittoCommissions.vue
src/components/FinancialModule/viittoCommissions.vue
+175
-254
No files found.
src/components/FinancialModule/viittoCommissions.vue
View file @
10f8db20
<
template
>
<
template
>
<div
class=
"Feedback"
>
<div
class=
"Feedback"
>
<ul
style=
"overflow: initial!important"
>
<ul
style=
"overflow: initial!important"
>
<!--
<li>
<li
style=
"float:right;margin-bottom:10px"
>
<span>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"新增"
@
click=
"addRule"
>
<em>
公司
</em>
</li>
</span>
</ul>
<el-select
filterable
v-model=
"obj.BranchId"
>
<el-option
label=
"不限"
:value=
'-1'
></el-option>
<el-option
v-for=
"item in companyList"
:label=
'item.BName'
:value=
'item.Id'
:key=
'item.Id'
>
</el-option>
</el-select>
</li>
<li>
<span>
<em>
线路
</em>
</span>
<el-select
filterable
v-model=
"obj.LineId"
>
<el-option
label=
"不限"
:value=
'0'
></el-option>
<el-option
v-for=
"item in LineList"
:label=
'item.LineName'
:value=
'item.LineID'
:key=
'item.LineID'
></el-option>
</el-select>
</li>
-->
<li
style=
"float:right;margin-bottom:10px"
>
<!--
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"查询"
@
click=
"getList()"
>
-->
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"新增"
@
click=
"addRule"
>
</li>
</ul>
<table
class=
"singeRowTable"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
v-loading=
"loading"
>
<table
class=
"singeRowTable"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
v-loading=
"loading"
>
<tr>
<tr>
<th
style=
"width:30%"
>
线路名称
</th>
<th
style=
"width:30%"
>
线路名称
</th>
...
@@ -52,260 +20,213 @@
...
@@ -52,260 +20,213 @@
<!--
<el-button
@
click=
"SetRules(item)"
style=
"padding:4px"
type=
"primary"
icon=
"el-icon-edit"
circle
></el-button>
<!--
<el-button
@
click=
"SetRules(item)"
style=
"padding:4px"
type=
"primary"
icon=
"el-icon-edit"
circle
></el-button>
<el-button
@
click=
"Delete(item)"
style=
"padding:4px"
type=
"danger"
icon=
"el-icon-delete"
circle
></el-button>
-->
<el-button
@
click=
"Delete(item)"
style=
"padding:4px"
type=
"danger"
icon=
"el-icon-delete"
circle
></el-button>
-->
</td>
</td>
</tr>
</tr>
<tbody
v-for=
"(item,i) in dataList"
:key=
"i"
>
<tbody
v-for=
"(item,i) in dataList"
:key=
"i"
>
<tr
v-for=
"(com,index) in item.OPCommissionList"
:key=
"index"
>
<tr
v-for=
"(com,index) in item.OPCommissionList"
:key=
"index"
>
<td
:rowspan=
"item.OPCommissionList.length"
v-if=
"index==0"
>
{{
item
.
LineName
}}
</td>
<td
:rowspan=
"item.OPCommissionList.length"
v-if=
"index==0"
>
{{
item
.
LineName
}}
</td>
<td>
{{
com
.
EmployeeName
}}
</td>
<td>
{{
com
.
EmployeeName
}}
</td>
<td>
{{
com
.
CommissionPercent
}}
%
</td>
<td>
{{
com
.
CommissionPercent
}}
%
</td>
<td>
<td>
<el-button
@
click=
"SetRules(com)"
style=
"padding:4px"
type=
"primary"
icon=
"el-icon-edit"
circle
></el-button>
<el-button
@
click=
"SetRules(com)"
style=
"padding:4px"
type=
"primary"
icon=
"el-icon-edit"
circle
></el-button>
<el-button
@
click=
"Delete(com)"
style=
"padding:4px"
type=
"danger"
icon=
"el-icon-delete"
circle
></el-button>
<el-button
@
click=
"Delete(com)"
style=
"padding:4px"
type=
"danger"
icon=
"el-icon-delete"
circle
></el-button>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
<tr
v-if=
"dataList.length==0"
>
<tr
v-if=
"dataList.length==0"
>
<td
colspan=
"12"
align=
"center"
>
暂无数据
</td>
<td
colspan=
"12"
align=
"center"
>
暂无数据
</td>
</tr>
</tr>
</table>
</table>
<el-dialog
<el-dialog
title=
"提成规则"
:visible
.
sync=
"ruleVisible"
width=
"400px"
>
title=
"提成规则"
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
:visible
.
sync=
"ruleVisible"
width=
"400px"
>
<el-form-item
label=
"人员"
prop=
"EmployeeId"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<el-select
class=
"multiple_input"
filterable
v-model=
"form.EmployeeId"
>
<!--
<el-form-item
label=
"线路"
prop=
"LineIdList"
>
<el-option
v-for=
"item in EmployeeList"
:label=
"item.EmName"
:value=
"item.EmployeeId"
<el-select
class=
"multiple_input"
filterable
value-key=
"item"
v-model=
"form.LineIdList"
@
change=
"getLine"
>
:key=
"item.EmployeeId"
></el-option>
<el-option
v-for=
"item in LineList"
:label=
'item.LineName'
:value=
'item'
:key=
'item.LineID'
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
-->
<el-form-item
label=
"占比"
prop=
"CommissionPercent"
>
<el-form-item
label=
"人员"
prop=
"EmployeeId"
>
<el-input
class=
"w220"
@
keyup
.
native=
"checkPrice(form,'CommissionPercent')"
v-model=
"form.CommissionPercent"
>
<el-select
class=
"multiple_input"
filterable
v-model=
"form.EmployeeId"
>
</el-input>
<el-option
v-for=
"item in EmployeeList"
:label=
"item.EmName"
</el-form-item>
:value=
"item.EmployeeId"
:key=
"item.EmployeeId"
></el-option>
</el-form>
</el-select>
<span
slot=
"footer"
class=
"dialog-footer"
>
</el-form-item>
<el-button
size=
"small"
@
click=
"ruleVisible = false"
>
取 消
</el-button>
<el-form-item
label=
"占比"
prop=
"CommissionPercent"
>
<el-button
size=
"small"
type=
"danger"
@
click=
"RulesOk('form')"
>
确 定
</el-button>
<el-input
class=
"w220"
@
keyup
.
native=
"checkPrice(form,'CommissionPercent')"
v-model=
"form.CommissionPercent"
></el-input>
</span>
</el-form-item>
</el-dialog>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"small"
@
click=
"ruleVisible = false"
>
取 消
</el-button>
<el-button
size=
"small"
type=
"danger"
@
click=
"RulesOk('form')"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
moment
from
"moment"
import
moment
from
"moment"
import
{
constants
}
from
'fs'
;
import
{
export
default
{
constants
}
from
'fs'
;
export
default
{
name
:
'Feedback'
,
name
:
'Feedback'
,
data
(){
data
()
{
return
{
return
{
allzb
:
100
,
allzb
:
100
,
obj
:{
dataList
:
[],
BranchId
:
-
1
,
loading
:
false
,
LineId
:
0
,
ruleVisible
:
false
,
},
form
:
{
dataList
:[],
LineName
:
'出境日本线'
,
loading
:
false
,
LineID
:
14
,
dateList
:[],
EmployeeId
:
''
,
LineList
:[],
CommissionPercent
:
0
,
companyList
:[],
},
ruleVisible
:
false
,
EmployeeList
:
[],
form
:{
rules
:
{
// LineIdList:[],
EmployeeId
:
[{
LineName
:
'出境日本线'
,
required
:
true
,
LineID
:
14
,
message
:
'请选择参与人员'
,
EmployeeId
:
''
,
trigger
:
'change'
CommissionPercent
:
0
,
}],
},
CommissionPercent
:
[{
departmentMsg
:
{
required
:
true
,
RB_Group_Id
:
'0'
,
message
:
"请输入占比"
,
RB_Branch_Id
:
'-1'
,
trigger
:
"blur"
Status
:
'0'
,
}],
ParentId
:
'-1'
,
},
Tier
:
'0'
,
}
},
LineTeamList
:[],
EmployeeList
:[],
rules
:{
EmployeeId
:
[
{
required
:
true
,
message
:
'请选择参与人员'
,
trigger
:
'change'
}
],
CommissionPercent
:
[{
required
:
true
,
message
:
"请输入占比"
,
trigger
:
"blur"
}],
},
departmentList
:[]
}
},
created
(){
},
},
mounted
(){
created
()
{},
this
.
getList
();
mounted
()
{
this
.
getEmployeeList
();
this
.
getList
();
this
.
getLineList
();
this
.
getEmployeeList
();
},
},
methods
:{
methods
:
{
Delete
(
item
)
{
Delete
(
item
)
{
this
.
$confirm
(
"是否删除? 删除后不可恢复"
,
"提示"
,
{
this
.
$confirm
(
"是否删除? 删除后不可恢复"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
type
:
"warning"
})
.
then
(()
=>
{
this
.
apipost
(
'OPCommission_RemoveOPCommission'
,
{
ID
:
item
.
Id
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
Success
(
res
.
data
.
message
)
this
.
getList
()
}
else
{
this
.
Error
(
res
.
data
.
message
)
}
})
})
.
then
(()
=>
{
})
this
.
apipost
(
'OPCommission_RemoveOPCommission'
,
{
ID
:
item
.
Id
},
res
=>
{
.
catch
(()
=>
{});
if
(
res
.
data
.
resultCode
==
1
)
{
},
this
.
Success
(
res
.
data
.
message
)
addRule
()
{
this
.
getList
()
this
.
ruleVisible
=
true
;
}
else
{
this
.
form
=
{
this
.
Error
(
res
.
data
.
message
)
LineName
:
'出境日本线'
,
LineID
:
14
,
}
EmployeeId
:
''
,
CommissionPercent
:
0
,
}
},
SetRules
(
item
)
{
this
.
ruleVisible
=
true
;
this
.
form
=
{
LineName
:
'出境日本线'
,
LineID
:
14
,
EmployeeId
:
item
.
EmployeeId
,
CommissionPercent
:
item
.
CommissionPercent
,
Id
:
item
.
Id
}
},
RulesOk
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
num
=
0
;
let
newnum
=
0
;
if
(
this
.
form
.
Id
)
{
this
.
dataList
.
forEach
(
item
=>
{
item
.
OPCommissionList
.
forEach
(
com
=>
{
if
(
com
.
Id
!=
this
.
form
.
Id
)
{
num
+=
com
.
CommissionPercent
;
}
})
})
})
})
.
catch
(()
=>
{});
newnum
=
100
-
num
;
},
}
else
{
addRule
(){
newnum
=
this
.
allzb
;
this
.
ruleVisible
=
true
;
this
.
form
=
{
LineName
:
'出境日本线'
,
LineID
:
14
,
EmployeeId
:
''
,
CommissionPercent
:
0
,
}
},
SetRules
(
item
){
this
.
ruleVisible
=
true
;
this
.
form
=
{
LineName
:
'出境日本线'
,
LineID
:
14
,
EmployeeId
:
item
.
EmployeeId
,
CommissionPercent
:
item
.
CommissionPercent
,
Id
:
item
.
Id
}
}
},
if
(
Number
(
this
.
form
.
CommissionPercent
)
>
newnum
||
Number
(
this
.
form
.
CommissionPercent
)
==
0
)
{
RulesOk
(
formName
){
this
.
Error
(
"请输入正确的占比!"
);
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
return
;
if
(
valid
)
{
let
num
=
0
;
let
newnum
=
0
;
if
(
this
.
form
.
Id
){
this
.
dataList
.
forEach
(
item
=>
{
item
.
OPCommissionList
.
forEach
(
com
=>
{
if
(
com
.
Id
!=
this
.
form
.
Id
){
num
+=
com
.
CommissionPercent
;
}
})
})
newnum
=
100
-
num
;
}
else
{
newnum
=
this
.
allzb
;
}
if
(
Number
(
this
.
form
.
CommissionPercent
)
>
newnum
||
Number
(
this
.
form
.
CommissionPercent
)
==
0
){
this
.
Error
(
"请输入正确的占比!"
);
return
;
}
this
.
apipost
(
'OPCommission_SetOPCommission'
,
this
.
form
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
getList
();
this
.
ruleVisible
=
false
;
this
.
Success
(
res
.
data
.
message
)
}
else
{
this
.
Error
(
res
.
data
.
message
)
}
},
err
=>
{
}
)
}
else
{
}
});
},
getEmployeeList
()
{
let
userInfo
=
this
.
getLocalStorage
()
let
msg
=
{
GroupId
:
userInfo
.
RB_Group_id
,
BranchId
:
'-1'
,
DepartmentId
:
'-1'
,
PostId
:
'-1'
,
IsLeave
:
'0'
}
}
this
.
apipost
(
this
.
apipost
(
'admin_get_EmployeeGetList'
,
{}
,
'OPCommission_SetOPCommission'
,
this
.
form
,
res
=>
{
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
EmployeeList
=
res
.
data
.
data
this
.
getList
();
this
.
ruleVisible
=
false
;
this
.
Success
(
res
.
data
.
message
)
}
else
{
this
.
Error
(
res
.
data
.
message
)
}
}
},
},
err
=>
{
err
=>
{}
}
)
)
},
}
else
{}
getLineList
()
{
this
.
apipost
(
"line_post_GetAllList_V2"
,
{
LineDirection
:
0
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
LineList
=
res
.
data
.
data
;
}
});
});
},
},
getEmployeeList
()
{
linkageDepartment
(){
let
userInfo
=
this
.
getLocalStorage
()
this
.
departmentMsg
.
RB_Branch_Id
=
this
.
form
.
BranchId
;
let
msg
=
{
this
.
departmentList
=
[];
GroupId
:
userInfo
.
RB_Group_id
,
this
.
form
.
DepartmentId
=-
1
;
BranchId
:
'-1'
,
this
.
getDepartment
();
DepartmentId
:
'-1'
,
},
PostId
:
'-1'
,
getDepart
(
id
){
IsLeave
:
'0'
this
.
form
.
DepartmentId
=
id
;
}
this
.
$forceUpdate
();
this
.
apipost
(
},
'admin_get_EmployeeGetList'
,
{},
getDepartment
()
{
res
=>
{
this
.
apipost
(
'admin_get_DepartmentGetList'
,
this
.
departmentMsg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
EmployeeList
=
res
.
data
.
data
this
.
departmentList
=
res
.
data
.
data
;
}
}
},
err
=>
{})
},
},
err
=>
{}
getList
(){
)
this
.
loading
=
true
;
},
getList
()
{
this
.
loading
=
true
;
this
.
apipost
(
"OPCommission_GetPageList"
,
{},
res
=>
{
this
.
apipost
(
"OPCommission_GetPageList"
,
{},
res
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
if
(
res
.
data
.
resultCode
==
1
)
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
dataList
=
res
.
data
.
data
;
this
.
dataList
=
res
.
data
.
data
;
// allzb
// allzb
let
num
=
0
;
let
num
=
0
;
this
.
dataList
.
forEach
(
item
=>
{
this
.
dataList
.
forEach
(
item
=>
{
item
.
OPCommissionList
.
forEach
(
com
=>
{
item
.
OPCommissionList
.
forEach
(
com
=>
{
num
+=
com
.
CommissionPercent
;
num
+=
com
.
CommissionPercent
;
})
})
})
})
this
.
allzb
=
100
-
num
;
this
.
allzb
=
100
-
num
;
}
}
});
});
},
},
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
.Feedback
ul
>
li
{
.Feedback
ul
>
li
{
display
:
inline-block
;
display
:
inline-block
;
font-size
:
12px
;
font-size
:
12px
;
color
:
#666
;
color
:
#666
;
margin
:
20px
30px
0px
0
;
margin
:
20px
30px
0px
0
;
}
}
.Feedback
.singeRowTable
{
.Feedback
.singeRowTable
{
margin-top
:
20px
;
margin-top
:
20px
;
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment