Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
hujun
tl_estate
Commits
ee67c7d1
Commit
ee67c7d1
authored
Jun 01, 2018
by
clone
Committed by
hujun
Jun 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test-v1.9' into test
parents
976d620b
8ca1f58f
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
3839 additions
and
1136 deletions
+3839
-1136
OrderLog.php
application/api_broker/controller/OrderLog.php
+3
-3
OrderLogService.php
application/api_broker/service/OrderLogService.php
+2
-1
PushMessageService.php
application/api_broker/service/PushMessageService.php
+6
-0
Auth.php
application/index/controller/Auth.php
+4
-8
Finance.php
application/index/controller/Finance.php
+21
-25
account_statement.html
application/index/view/finance/account_statement.html
+2
-0
commission.html
application/index/view/finance/commission.html
+300
-122
commission_total.html
application/index/view/finance/commission_total.html
+17
-5
tax.html
application/index/view/finance/tax.html
+299
-121
OBargainModel.php
application/model/OBargainModel.php
+128
-35
OPartialCommission.php
application/model/OPartialCommission.php
+4
-2
OTaxes.php
application/model/OTaxes.php
+9
-4
reportDetails.vue
public/appnew/src/components/reportDetails/reportDetails.vue
+1
-1
report_list.css
public/resource/css/report_list.css
+4
-1
commission.js
public/resource/js/commission.js
+1298
-225
commissionTotal.js
public/resource/js/commissionTotal.js
+377
-341
public.js
public/resource/js/public.js
+2
-2
reportList.js
public/resource/js/reportList.js
+7
-5
tax.js
public/resource/js/tax.js
+1302
-227
commission_template_tpl.html
public/resource/template/commission_template_tpl.html
+3
-3
reportList_maidtwo_template_tpl.html
...ic/resource/template/reportList_maidtwo_template_tpl.html
+45
-0
reportList_shuiFee_template_tpl.html
...ic/resource/template/reportList_shuiFee_template_tpl.html
+1
-1
reportList_template_tpl.html
public/resource/template/reportList_template_tpl.html
+1
-1
tax_template_tpl.html
public/resource/template/tax_template_tpl.html
+3
-3
No files found.
application/api_broker/controller/OrderLog.php
View file @
ee67c7d1
...
...
@@ -426,9 +426,9 @@ class OrderLog extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
//
$params = array(
// "bargain_id" => 1
69,
// );
/*
$params = array(
"bargain_id" => 4
69,
);*/
if
(
!
isset
(
$params
[
"bargain_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
application/api_broker/service/OrderLogService.php
View file @
ee67c7d1
...
...
@@ -838,7 +838,7 @@ class OrderLogService
//分佣提成 o_partial_commission
$partialCommissionModel
=
new
OPartialCommission
();
$field
=
"a.agent_id,a.role,b.name,b.phone,a.scale,a.should_commission,a.create_time,a.real_fee,a.charity_fund,
$field
=
"a.agent_id,a.role,b.name,b.phone,a.scale,a.should_commission,a.c
onfirm_date,a.c
reate_time,a.real_fee,a.charity_fund,
a.cash,a.practical_fee,a.service_charge"
;
$commissionParams
[
"bargain_id"
]
=
$params
[
"bargain_id"
];
$cent_commission_arr
=
$partialCommissionModel
->
getCommissionListByBargainId
(
$field
,
$commissionParams
);
...
...
@@ -861,6 +861,7 @@ class OrderLogService
foreach
(
$item
as
$i
=>
$j
)
{
$cent_commission
[
$z
][
"info"
][
$key
][
"real_fee"
]
=
$j
[
"real_fee"
];
$cent_commission
[
$z
][
"info"
][
$key
][
"create_time"
]
=
$j
[
"create_time"
];
$cent_commission
[
$z
][
"info"
][
$key
][
"confirm_date"
]
=
$j
[
"confirm_date"
];
$cent_commission
[
$z
][
"info"
][
$key
][
"charity_fund"
]
=
$j
[
"charity_fund"
];
$cent_commission
[
$z
][
"info"
][
$key
][
"cash"
]
=
$j
[
"cash"
];
$cent_commission
[
$z
][
"info"
][
$key
][
"practical_fee"
]
=
$j
[
"practical_fee"
];
...
...
application/api_broker/service/PushMessageService.php
View file @
ee67c7d1
...
...
@@ -103,6 +103,12 @@ class PushMessageService
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$report_id
]);
$house_arr
=
[
1
,
4
,
3031
,
3032
];
//剔除测试楼盘推送
if
(
in_array
(
$report_data
[
'house_id'
],
$house_arr
))
{
return
;
}
//查询经纪人门店和部门信息
$agent_store
=
$agent
->
verifyUser
(
'store_id'
,
''
,
[
'id'
=>
$report_data
[
'report_agent_id'
]]);
$store
=
new
AStore
();
...
...
application/index/controller/Auth.php
View file @
ee67c7d1
...
...
@@ -168,10 +168,9 @@ class Auth extends Basic
}
}
//权限表list
/**
* 权限表list
*
* @param int $type
* @return array|false|\PDOStatement|string|\think\Collection|\think\Response
* @throws \think\db\exception\DataNotFoundException
...
...
@@ -179,12 +178,9 @@ class Auth extends Basic
* @throws \think\exception\DbException
*/
public
function
classList
(
$type
=
1
){
$table
=
new
authRule
;
$menus
=
db
(
'auth_rule'
)
->
select
();
// exit;
$table
=
new
authRule
;
$menus
=
db
(
'auth_rule'
)
->
where
(
'status'
,
0
)
->
select
();
$menus
=
$table
->
toFormatTree
(
$menus
,
'title'
);
// prt($menus);
if
(
$type
==
1
)
{
return
$this
->
response
(
200
,
'成功'
,
$menus
);
}
else
{
...
...
application/index/controller/Finance.php
View file @
ee67c7d1
...
...
@@ -13,8 +13,6 @@ use app\api_broker\service\OrderLogService;
use
app\index\extend\Basic
;
use
app\index\untils\ExportExcelUntil
;
use
app\model\AAgents
;
use
app\model\AStore
;
use
app\model\OBargainLogModel
;
use
app\model\OBargainModel
;
use
app\model\ORealIncome
;
use
app\model\OTaxes
;
...
...
@@ -68,11 +66,12 @@ class Finance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$fields
=
'a.id,a.create_time,a.trade_type,b.user_phone,b.user_name,d.internal_title,d.internal_address,a.commission,a.practical_fee,a.scale_fee,a.order_no,content,house_number'
;
$check_status
=
$this
->
params
[
'check_status'
];
$fields
=
'a.id,a.create_time,a.trade_type,b.user_phone,b.user_name,d.internal_title,d.internal_address,
a.commission,a.practical_fee,a.scale_fee,a.order_no,a.order_id,content,house_number'
;
$where
[
'a.father_id'
]
=
0
;
$where
[
'c.is_del'
]
=
0
;
$where
[
'a.status'
]
=
1
0
;
//
$where['c.is_del'] = 0;
$where
[
'a.status'
]
=
1
1
;
$order
=
'e.id desc'
;
if
(
!
empty
(
$this
->
params
[
'create_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
...
...
@@ -84,7 +83,7 @@ class Finance extends Basic
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'
create
_time'
]
.
' 23:59:59'
]
];
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'
end
_time'
]
.
' 23:59:59'
]
];
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
...
...
@@ -99,25 +98,20 @@ class Finance extends Basic
$where
[
'a.house_number'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'house_number'
]
.
'%'
];
}
switch
(
$
this
->
params
[
'check_status'
]
)
{
switch
(
$
check_status
)
{
case
2
:
//成交报告列表-第二级审核
$where
[
'e.audit_level'
]
=
0
;
$where
[]
=
[
'EXP'
,
'e.id in (SELECT MAX(id) FROM o_financial_audit WHERE is_del = 0 and `status`<>3 GROUP BY bargain_id)'
];
$where
[
'e.is_del'
]
=
0
;
$audit_level
=
0
;
break
;
case
3
:
//成交报告列表-第三级审核
$where
[
'e.audit_level'
]
=
1
;
$where
[
'e.is_del'
]
=
0
;
$where
[]
=
[
'EXP'
,
'e.id in (SELECT MAX(id) FROM o_financial_audit WHERE is_del = 0 and `status`<>3 GROUP BY bargain_id)'
];
$audit_level
=
1
;
break
;
case
4
:
//成交报告列表-已结单
$where
[
'a.account_statement'
]
=
1
;
$where
[
'a.status'
]
=
11
;
$where
[
'e.audit_level'
]
=
2
;
$where
[
'a.status'
]
=
13
;
$audit_level
=
2
;
break
;
/* case 5 :
//成交报告列表-待撤销
...
...
@@ -130,8 +124,8 @@ class Finance extends Basic
default
:
//成交报告列表-第一级审核
$order
=
'a.id DESC'
;
$where
[
'
e.audit_level'
]
=
[
'NULL'
]
;
$
where
[]
=
[
'EXP'
,
'e.audit_level IS NULL or e.id not in (SELECT MAX(id) FROM o_financial_audit WHERE is_del = 0 GROUP BY bargain_id)'
]
;
$where
[
'
a.status'
]
=
10
;
$
audit_level
=
-
1
;
}
if
(
!
empty
(
$this
->
params
[
'status'
]))
{
...
...
@@ -139,9 +133,9 @@ class Finance extends Basic
}
$bargain
=
new
OBargainModel
();
$data
[
'data'
][
'list'
]
=
$bargain
->
getBargain
(
$pageNo
,
$pageSize
,
$order
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$bargain
->
getBargainTotal
(
$where
);
$data
[
'data'
][
'step'
]
=
$
this
->
params
[
'check_status'
]
;
$data
[
'data'
][
'list'
]
=
$bargain
->
getBargain
List
(
$pageNo
,
$pageSize
,
$order
,
$fields
,
$where
,
$audit_level
);
$data
[
'data'
][
'total'
]
=
$bargain
->
getBargainTotal
(
$where
,
$audit_level
);
$data
[
'data'
][
'step'
]
=
$
check_status
;
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
...
...
@@ -264,7 +258,7 @@ class Finance extends Basic
$practical_fee_arr
=
$this
->
params
[
"practical_fee"
];
$bargain_id
=
$this
->
params
[
"id"
];
$
log_data
=
$
add_real_arr
=
$update_real_arr
=
[];
$add_real_arr
=
$update_real_arr
=
[];
$i
=
$j
=
0
;
foreach
(
$practical_fee_arr
as
$item
)
{
if
(
!
$item
[
'fee'
]
||
!
$item
[
'operation_date'
])
{
...
...
@@ -587,7 +581,7 @@ class Finance extends Basic
$where
[
'b.house_number'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'house_number'
]
.
'%'
];
}
$field
=
'a.id,b.id as bargain_id,a.confirm_date,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,b.house_number'
;
$field
=
'a.id,b.id as bargain_id,a.confirm_date,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,b.house_number
,b.father_id,b.order_id
'
;
$m_commission
=
new
OPartialCommission
();
$data
[
'data'
][
'list'
]
=
$m_commission
->
getCommissionBargainList
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$field
,
$where
);
...
...
@@ -921,7 +915,7 @@ class Finance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$fields
=
'a.id,a.create_time,e.name,e.phone,a.fee,b.house_number,d.internal_address,b.agent_id'
;
$fields
=
'a.id,a.create_time,e.name,e.phone,a.fee,b.house_number,d.internal_address,b.agent_id
,b.father_id,b.order_id
'
;
$where
[
'c.is_del'
]
=
0
;
$where
[
'b.status'
]
=
[
'in'
,
10
,
11
];
//10已提交 11审核成功
...
...
@@ -1147,6 +1141,8 @@ class Finance extends Basic
$data
[
'is_del'
]
=
1
;
$data
=
$m_financial
->
editData
(
$data
,
$this
->
params
[
'bargain_id'
],
'bargain_id'
);
$m_bargain
=
new
OBargainModel
();
$m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
[
'status'
=>
10
]);
$msg
=
''
;
if
(
$data
>
0
)
{
$code
=
200
;
...
...
application/index/view/finance/account_statement.html
View file @
ee67c7d1
...
...
@@ -30,6 +30,8 @@
<form
id=
"maintable_form_search"
>
<span
class=
"fore-span"
>
提交时间:
</span>
<input
class=
"form-control btn4"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"maintable_create_time"
name=
"start_date"
type=
"date"
>
<span
class=
"fore-span"
id=
"maintable_form_span_zhi"
>
至
</span>
<input
class=
"form-control btn4"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"maintable_end_time"
name=
"end_date"
type=
"date"
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"maintable_internal_address"
placeholder=
"商铺地址"
type=
"text"
value=
""
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"maintable_shop_num"
placeholder=
"商铺号"
type=
"text"
value=
""
>
<input
class=
"form-control btn2"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"maintable_user_phone"
placeholder=
"客户电话"
type=
"text"
value=
""
>
...
...
application/index/view/finance/commission.html
View file @
ee67c7d1
...
...
@@ -94,7 +94,6 @@
<tbody
class=
"text-center"
id=
"business_list"
>
</table>
</div>
<!-- /#page-content-wrapper -->
<div
class=
"text-right"
id=
"pagediv"
>
</div>
...
...
@@ -105,150 +104,329 @@
</div>
</div>
</div>
<!-- 弹出框 编辑 -->
<div
class=
"modal fade"
id=
"modal-details"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
<!-- 弹出框 详情 -->
<div
class=
"modal fade"
id=
"modal_detail"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title
"
>
<
span
class=
"btn btn-info"
id=
"information"
>
成交信息
</span
>
<
span
class=
"btn btn-default caozuo"
id=
"fees"
>
分佣提成
</span
>
<
span
class=
"btn btn-default"
id=
"records"
>
收款记录
</span
>
<h4
class=
"modal-title detail-modal-header-tab
"
>
<
a
href=
"javascript:;"
class=
"btn btn-info"
>
成交信息
</a
>
<
a
href=
"javascript:;"
class=
"btn btn-default"
>
分佣提成
</a
>
<
a
href=
"javascript:;"
class=
"btn btn-default"
>
开票税费
</a
>
</h4>
</div>
<div
class=
"modal-body modal-body-two"
>
<div
class=
"Tswitch"
>
<div
class=
"left"
>
<span>
商铺地址:
</span><span
class=
"internal_address"
></span><br>
<span>
客户姓名:
</span><span
class=
"user_name"
></span><br>
<span>
应收总佣金:
</span>
<input
class=
"form-control btn_2 commission"
type=
"text"
>
元
<br>
<span>
实收佣金:
</span>
<input
class=
"form-control btn_2 practical_fee"
type=
"text"
>
元
<br>
</div>
<div
class=
"right"
>
<span>
商铺名称:
</span><span
class=
"internal_title"
></span><br>
<span>
客户电话:
</span><span
class=
"user_phone"
></span><br>
<span>
提交日期:
</span><span
class=
"create_time"
></span><br>
</div>
<input
type=
"hidden"
class=
"page-pass"
/>
</div>
<div
class=
"Tswitch Tswitch_one"
>
<!--分佣提成-->
<a
class=
"btn btn-success edit_new"
href=
"#modal-new"
data-toggle=
"modal"
>
新增
</a>
<table
class=
"table table-striped table-bordered table-hover table-condensed"
id=
"caozuo_hide"
>
<thead>
<tr>
<th
class=
"text-center"
>
分佣方
</th>
<th
class=
"text-center"
>
业务员
</th>
<th
class=
"text-center"
>
所属门店
</th>
<th
class=
"text-center"
>
分佣比例
</th>
<th
class=
"text-center"
>
应分佣金(元)
</th>
<th
class=
"text-center"
>
实分佣金
</th>
<th
class=
"text-center"
>
备注
</th>
</tr>
</thead>
<tbody
class=
"text-center"
id=
"caozuo_table"
>
</div>
<div
class=
"modal-body detail-modal-body"
>
<div>
<div
class=
"detail-modal-body-sec"
>
<form
class=
"detail-modal-bargaininfo-form"
>
<div
class=
"detail-modal-bargaininfo-main-left"
>
<span>
商铺类型:
</span>
<span
id=
"bargaininfo_shop_type"
></span>
<br
/>
</table>
<!--分佣提成-->
</div>
<span>
商铺地址:
</span><span
id=
"bargaininfo_internal_address"
></span><br>
<span>
客户姓名:
</span><span
id=
"bargaininfo_user_name"
></span><br>
<span>
成交类型:
</span>
<select
class=
"form-control"
id=
"bargaininfo_type"
disabled=
"disabled"
>
<option
value=
"10"
>
出租
</option>
<option
value=
"20"
>
增佣
</option>
<option
value=
"30"
>
代理
</option>
<option
value=
"40"
>
好处费
</option>
</select>
<br
/>
<span>
应收总佣金:
</span>
<input
class=
"form-control"
id=
"bargaininfo_total_commission"
type=
"number"
disabled=
"disabled"
>
元
<br>
<div
class=
"Tswitch Tswitch_two"
>
<table
class=
"table table-striped table-bordered table-hover table-condensed"
id=
"tcaozuo_hide"
>
<thead>
<tr>
<th
class=
"text-center"
>
入账时间
</th>
<th
class=
"text-center"
>
入账金额(元)
</th>
<th
class=
"text-center"
>
入账类型
</th>
<th
class=
"text-center"
>
入账方式
</th>
<th
class=
"text-center"
>
操作人
</th>
</tr>
</thead>
<tbody
class=
"text-center"
id=
"tcaozuo_table"
>
</div>
<div
class=
"detail-modal-bargaininfo-main-right"
>
<span>
是否开业:
</span>
<select
class=
"form-control"
id=
"bargaininfo_is_open"
disabled=
"disabled"
>
<option
value=
"0"
>
否
</option>
<option
value=
"1"
>
是
</option>
</select>
<br
/>
<span>
商铺号:
</span><span
id=
"bargaininfo_shop_num"
></span><br>
<span>
客户电话:
</span><span
id=
"bargaininfo_user_phone"
></span><br>
<span>
成交日期:
</span><span
id=
"bargaininfo_create_time"
></span><br>
</div>
<div
class=
"detail-modal-bargaininfo-commission-inputpar"
>
<div
class=
"detail-modal-bargaininfo-commission-addarea"
>
<div
class=
"form-group detail-modal-bargaininfo-commission-sec"
>
<label
class=
""
>
实收佣金:
</label>
<div
class=
"input-group"
>
<input
type=
"number"
class=
"form-control"
placeholder=
"请输入"
disabled=
"disabled"
>
<div
class=
"input-group-addon"
>
元
</div>
</div>
<label
class=
""
>
收佣日期:
</label>
<div
class=
"input-group"
>
<input
type=
"date"
class=
"form-control"
placeholder=
"请输入"
disabled=
"disabled"
>
</div>
<!--<mark href="javascript:;" class="detail-modal-bargaininfo-commission-cancel-pic"><img src="/resource/image/search_gb.png" /></mark>-->
</div>
</div>
<!--<div id="bargaininfo_commission_add_btn">
<img src="/resource/image/jia2@2x.png" />
</div>-->
</div>
<div>
<span
class=
"detail-modal-bargaininfo-span-beizhu"
>
备注:
</span>
<textarea
id=
"bargaininfo_beizhu"
disabled=
"disabled"
></textarea>
</div>
</form>
<div
class=
"tc"
>
<!--<button type="button" class="btn btn-primary" id="bargaininfo_btn_save">保存</button>-->
</div>
</div>
<div
class=
"detail-modal-body-sec"
>
<div
class=
"detail-modal-maid-top-btn-area oh"
>
<!--<a class="btn btn-success" href="#modal_new_maid" data-toggle="modal">新增</a>-->
<!--<a id="maid_new_btn" class="btn btn-primary" data-toggle="modal">增加实收</a>-->
</div>
<table
class=
"table table-striped table-bordered table-hover table-condensed"
id=
"maid_table_main"
>
<thead>
<tr>
<th
class=
"text-center"
>
分佣方
</th>
<th
class=
"text-center"
>
业务员
</th>
<th
class=
"text-center"
>
所属部门/门店
</th>
<th
class=
"text-center"
>
分佣比例
</th>
<th
class=
"text-center"
>
应分佣金(元)
</th>
<th
class=
"text-center"
>
实分佣金(元)
</th>
<th
class=
"text-center"
>
手续费(元)
</th>
<th
class=
"text-center"
>
慈善基金(元)
</th>
<th
class=
"text-center"
>
现金奖(元)
</th>
<th
class=
"text-center"
>
实收佣金(元)
</th>
<th
class=
"text-center"
>
确认时间
</th>
</tr>
</thead>
<tbody
class=
"text-center"
id=
"maid_new_table_list"
>
<!--<tr>
<td>盘方</td>
<td>刘丹丹-13918937741</td>
<td>同联一部南京东路店</td>
<td contenteditable>30%</td>
<td contenteditable>350000</td>
<td colspan="6" class="detail-modal-maid-mix-td oh">
<div class="oh">
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span></span>
</div>
</td>
</tr>
<tr>
<td>盘方</td>
<td>刘丹丹-13918937741</td>
<td>同联一部南京东路店</td>
<td contenteditable>30%</td>
<td contenteditable>350000</td>
<td colspan="6" class="detail-modal-maid-mix-td oh">
<div class="oh">
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span></span>
</div>
</td>
</tr>-->
</tbody>
</table>
</div>
<br><br><br><br>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
id=
"confirm_edit"
>
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</table>
<div
class=
"detail-modal-maid-bottom-btn-area text-right"
>
<!--<a id="maid_ok_btn" class="btn btn-primary" data-toggle="modal">确认分佣</a>-->
<!--<a id="maid_save_btn" class="btn btn-primary" data-toggle="modal">保存</a>-->
</div>
<!--分佣提成-->
</div>
<div
class=
"detail-modal-body-sec"
>
<div>
<div
class=
"tc"
>
<!--<a class="btn btn-success" href="#modal_new_tax" data-toggle="modal">新增开票</a>-->
</div>
<div
id=
"tax_main_box"
>
<!--内容为模板生成-->
</div>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
</div>
<!-- 弹出框
时间
-->
<div
class=
"modal fade"
id=
"modal-
linetime
"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
<!-- 弹出框
通过
-->
<div
class=
"modal fade"
id=
"modal-
pass
"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
时间轴
<h4
class=
"modal-title"
>
通过
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
id=
"del_msg"
>
时间轴
</div
>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</div>
<div
class=
"modal-body"
>
<label
class=
"control-label"
>
备注:
</label
>
<textarea
class=
"form-control"
rows=
"5"
id=
"pass_beizhu"
></textarea>
<!-- <span class="use-span text-danger">(必填)</span> --
>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
id=
"
"
>
删除
<button
type=
"button"
class=
"btn btn-info"
data-dismiss=
"modal"
class=
"pass-modal-btn-pass"
id=
"pass_ok_btn
"
>
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 分佣提成新增 -->
<div
class=
"modal fade"
id=
"modal-new"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<!-- 弹出框 时间轴 -->
<div
class=
"modal fade"
id=
"modal-time"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
新增分佣提成
<h4
class=
"modal-title"
>
时间轴
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
id=
""
>
<!-- 新增分佣提成 -->
<form
id=
"form_search"
>
分佣方:
<select
class=
"form-control form-control-one"
id=
"is_carefully_chosen"
>
<option
value=
"0"
>
请选择
</option>
<option
value=
"1"
>
盘方
</option>
<option
value=
"2"
>
客方
</option>
<option
value=
"3"
>
反签
</option>
<option
value=
"4"
>
独家
</option>
<option
value=
"5"
>
合作方
</option>
</select><br>
<span>
业务员:
</span><input
class=
"form-control form-control-one"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
" "
placeholder=
""
type=
"text"
value=
""
><br>
<span>
所属门店:
</span><input
class=
"form-control form-control-one"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
" "
placeholder=
""
type=
"text"
value=
""
><br>
<span>
分佣比例:
</span><input
class=
"form-control form-control-one"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"commission-rate"
placeholder=
""
type=
"text"
value=
""
><br>
<span>
应分佣金:
</span><input
class=
"form-control form-control-one"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"should-commission"
placeholder=
""
type=
"text"
value=
""
><br>
</form>
<!-- 新增分佣提成 -->
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
id=
"new-commission"
>
确定
</button>
<div
class=
"modal-body"
class=
"iframe-div-parent"
>
<iframe
class=
"iframe-time-line"
></iframe>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 弹出框 分佣提成新增 -->
<div
class=
"modal fade"
id=
"modal_new_maid"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
新增分佣提成
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
id=
"addmaid_input_area"
>
<div>
<span>
分佣方:
</span>
<select
class=
"form-control"
id=
"addmaid_input_servant"
>
<option
value=
""
>
请选择
</option>
<option
value=
"1"
>
盘方
</option>
<option
value=
"2"
>
客方
</option>
<option
value=
"3"
>
反签
</option>
<option
value=
"4"
>
独家
</option>
<option
value=
"5"
>
合作方
</option>
</select>
</div>
<div
class=
"po-relative"
>
<span>
业务员:
</span><input
class=
"form-control"
type=
"text"
id=
"addmaid_input_ywy"
/>
<ul>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
</ul>
</div>
<div>
<span>
所属门店:
</span><input
class=
"form-control"
type=
"text"
id=
"addmaid_input_shop"
/>
</div>
<div>
<span>
分佣比例:
</span><input
class=
"form-control"
type=
"number"
id=
"addmaid_input_ratio"
/><span>
%
</span>
</div>
<div>
<span>
应分佣金:
</span><input
class=
"form-control"
type=
"number"
id=
"addmaid_input_cash"
/><span>
元
</span>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<div
href=
"#modal_new_maid_select"
data-toggle=
"modal"
>
打开盘方业务员选择框
</div>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
id=
"addmaid_ok_btn"
>
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 弹出框 分佣提成新增,选择盘方,多个的时候选择一业务员 -->
<div
class=
"modal fade"
id=
"modal_new_maid_select"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
data-backdrop=
'static'
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
选择一业务员
</h4>
</div>
<div
class=
"modal-body"
>
<ul
id=
"addmaid_select_ul"
>
</ul>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 弹出框 开票税费新增 -->
<div
class=
"modal fade"
id=
"modal_new_tax"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
新增开票
</h4>
</div>
<div
class=
"modal-body"
>
<div>
<div>
<div
class=
"form-group addtax-modal-tax-commission-sec"
>
<label
class=
""
>
开票金额:
</label>
<div
class=
"input-group"
><input
type=
"number"
class=
"form-control"
placeholder=
"请输入"
id=
"addtax_commission_input"
>
<div
class=
"input-group-addon"
>
元
</div>
</div>
<label
class=
""
>
开票日期:
</label>
<div
class=
"input-group"
><input
type=
"date"
class=
"form-control"
placeholder=
"请输入"
id=
"addtax_date"
></div>
</div>
<div>
<table
class=
"table-haveborder addtax-modal-tax-table"
>
<!--<tr>
<td>分佣方</td>
<td>业务员</td>
<td>分佣比例</td>
<td>税费</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>-->
</table>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
id=
"addtax_commission_addok"
>
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
application/index/view/finance/commission_total.html
View file @
ee67c7d1
...
...
@@ -26,6 +26,11 @@
width
:
340px
;
line-height
:
36px
;
}
.left-btn
{
float
:
left
;
}
.right
{
line-height
:
36px
;
...
...
@@ -57,6 +62,9 @@
height
:
500px
;
overflow-y
:
scroll
;
}
.clear
{
clear
:
both
;
}
</style>
<div
id=
"page-content-wrapper"
>
<div
class=
"container"
>
...
...
@@ -86,11 +94,14 @@
<span
class=
"fore-span ld-Marheight"
>
-
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"end_dealtime"
name=
"end_date"
type=
"date"
>
<select
class=
"form-control btn4 ld-Marheight"
id=
"deal_status"
>
<
!--<
select class="form-control btn4 ld-Marheight" id="deal_status">
<option value="-1">请选择部门</option>
<option value="10">市场一部</option>
<option value="20">市场二部</option>
</select>
</select>-->
<select
name=
"qx-store"
class=
"form-control btn2 ld-Marheight"
id=
"qx-store"
>
<option
value=
""
selected=
"selected"
>
选择部门
</option>
</select>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"store_name"
placeholder=
"所属门店名称"
type=
"text"
value=
""
>
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_num" placeholder="商铺号" type="text" value="">-->
...
...
@@ -101,10 +112,11 @@
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"create_ticketTime"
name=
"start_date"
type=
"date"
>
<span
class=
"fore-span ld-Marheight"
>
-
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"end_ticketTime"
name=
"end_date"
type=
"date"
>
<div
class=
"clear"
></div>
<span
class=
"btn btn-info btn3"
id=
"search"
>
搜索
</span>
<span
class=
"btn btn-info btn3"
id=
"reset"
>
重置
</span>
<span
class=
"btn btn-info btn3"
id=
"export"
>
导出excel
</span>
<span
class=
"btn btn-info btn3
"
id=
"search"
>
搜索
</span>
<span
class=
"btn btn-info btn3
"
id=
"reset"
>
重置
</span>
<span
class=
"btn btn-info btn3
"
id=
"export"
>
导出excel
</span>
</form>
</td>
</tr>
...
...
application/index/view/finance/tax.html
View file @
ee67c7d1
...
...
@@ -105,150 +105,328 @@
</div>
</div>
</div>
<!-- 弹出框
编辑
-->
<div
class=
"modal fade"
id=
"modal
-details
"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
<!-- 弹出框
详情
-->
<div
class=
"modal fade"
id=
"modal
_detail
"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title
"
>
<
span
class=
"btn btn-info"
id=
"information"
>
成交信息
</span
>
<
span
class=
"btn btn-default caozuo"
id=
"fees"
>
分佣提成
</span
>
<
span
class=
"btn btn-default"
id=
"records"
>
收款记录
</span
>
<h4
class=
"modal-title detail-modal-header-tab
"
>
<
a
href=
"javascript:;"
class=
"btn btn-info"
>
成交信息
</a
>
<
a
href=
"javascript:;"
class=
"btn btn-default"
>
分佣提成
</a
>
<
a
href=
"javascript:;"
class=
"btn btn-default"
>
开票税费
</a
>
</h4>
</div>
<div
class=
"modal-body modal-body-two"
>
<div
class=
"Tswitch"
>
<div
class=
"left"
>
<span>
商铺地址:
</span><span
class=
"internal_address"
></span><br>
<span>
客户姓名:
</span><span
class=
"user_name"
></span><br>
<span>
应收总佣金:
</span>
<input
class=
"form-control btn_2 commission"
type=
"text"
>
元
<br>
<span>
实收佣金:
</span>
<input
class=
"form-control btn_2 practical_fee"
type=
"text"
>
元
<br>
</div>
<div
class=
"right"
>
<span>
商铺名称:
</span><span
class=
"internal_title"
></span><br>
<span>
客户电话:
</span><span
class=
"user_phone"
></span><br>
<span>
提交日期:
</span><span
class=
"create_time"
></span><br>
</div>
<input
type=
"hidden"
class=
"page-pass"
/>
</div>
<div
class=
"Tswitch Tswitch_one"
>
<!--分佣提成-->
<a
class=
"btn btn-success edit_new"
href=
"#modal-new"
data-toggle=
"modal"
>
新增
</a>
<table
class=
"table table-striped table-bordered table-hover table-condensed"
id=
"caozuo_hide"
>
<thead>
<tr>
<th
class=
"text-center"
>
分佣方
</th>
<th
class=
"text-center"
>
业务员
</th>
<th
class=
"text-center"
>
所属门店
</th>
<th
class=
"text-center"
>
分佣比例
</th>
<th
class=
"text-center"
>
应分佣金(元)
</th>
<th
class=
"text-center"
>
实分佣金
</th>
<th
class=
"text-center"
>
备注
</th>
</tr>
</thead>
<tbody
class=
"text-center"
id=
"caozuo_table"
>
</div>
<div
class=
"modal-body detail-modal-body"
>
<div>
<div
class=
"detail-modal-body-sec"
>
<form
class=
"detail-modal-bargaininfo-form"
>
<div
class=
"detail-modal-bargaininfo-main-left"
>
<span>
商铺类型:
</span>
<span
id=
"bargaininfo_shop_type"
></span>
<br
/>
</table>
<!--分佣提成-->
</div>
<span>
商铺地址:
</span><span
id=
"bargaininfo_internal_address"
></span><br>
<span>
客户姓名:
</span><span
id=
"bargaininfo_user_name"
></span><br>
<span>
成交类型:
</span>
<select
class=
"form-control"
id=
"bargaininfo_type"
disabled=
"disabled"
>
<option
value=
"10"
>
出租
</option>
<option
value=
"20"
>
增佣
</option>
<option
value=
"30"
>
代理
</option>
<option
value=
"40"
>
好处费
</option>
</select>
<br
/>
<span>
应收总佣金:
</span>
<input
class=
"form-control"
id=
"bargaininfo_total_commission"
type=
"number"
disabled=
"disabled"
>
元
<br>
<div
class=
"Tswitch Tswitch_two"
>
<table
class=
"table table-striped table-bordered table-hover table-condensed"
id=
"tcaozuo_hide"
>
<thead>
<tr>
<th
class=
"text-center"
>
入账时间
</th>
<th
class=
"text-center"
>
入账金额(元)
</th>
<th
class=
"text-center"
>
入账类型
</th>
<th
class=
"text-center"
>
入账方式
</th>
<th
class=
"text-center"
>
操作人
</th>
</tr>
</thead>
<tbody
class=
"text-center"
id=
"tcaozuo_table"
>
</div>
<div
class=
"detail-modal-bargaininfo-main-right"
>
<span>
是否开业:
</span>
<select
class=
"form-control"
id=
"bargaininfo_is_open"
disabled=
"disabled"
>
<option
value=
"0"
>
否
</option>
<option
value=
"1"
>
是
</option>
</select>
<br
/>
<span>
商铺号:
</span><span
id=
"bargaininfo_shop_num"
></span><br>
<span>
客户电话:
</span><span
id=
"bargaininfo_user_phone"
></span><br>
<span>
成交日期:
</span><span
id=
"bargaininfo_create_time"
></span><br>
</div>
<div
class=
"detail-modal-bargaininfo-commission-inputpar"
>
<div
class=
"detail-modal-bargaininfo-commission-addarea"
>
<div
class=
"form-group detail-modal-bargaininfo-commission-sec"
>
<label
class=
""
>
实收佣金:
</label>
<div
class=
"input-group"
>
<input
type=
"number"
class=
"form-control"
placeholder=
"请输入"
disabled=
"disabled"
>
<div
class=
"input-group-addon"
>
元
</div>
</div>
<label
class=
""
>
收佣日期:
</label>
<div
class=
"input-group"
>
<input
type=
"date"
class=
"form-control"
placeholder=
"请输入"
disabled=
"disabled"
>
</div>
<!--<mark href="javascript:;" class="detail-modal-bargaininfo-commission-cancel-pic"><img src="/resource/image/search_gb.png" /></mark>-->
</div>
</div>
<!--<div id="bargaininfo_commission_add_btn">
<img src="/resource/image/jia2@2x.png" />
</div>-->
</div>
<div>
<span
class=
"detail-modal-bargaininfo-span-beizhu"
>
备注:
</span>
<textarea
id=
"bargaininfo_beizhu"
disabled=
"disabled"
></textarea>
</div>
</form>
<div
class=
"tc"
>
<!--<button type="button" class="btn btn-primary" id="bargaininfo_btn_save">保存</button>-->
</div>
</div>
<div
class=
"detail-modal-body-sec"
>
<div
class=
"detail-modal-maid-top-btn-area oh"
>
<!--<a class="btn btn-success" href="#modal_new_maid" data-toggle="modal">新增</a>-->
<!--<a id="maid_new_btn" class="btn btn-primary" data-toggle="modal">增加实收</a>-->
</div>
<table
class=
"table table-striped table-bordered table-hover table-condensed"
id=
"maid_table_main"
>
<thead>
<tr>
<th
class=
"text-center"
>
分佣方
</th>
<th
class=
"text-center"
>
业务员
</th>
<th
class=
"text-center"
>
所属部门/门店
</th>
<th
class=
"text-center"
>
分佣比例
</th>
<th
class=
"text-center"
>
应分佣金(元)
</th>
<th
class=
"text-center"
>
实分佣金(元)
</th>
<th
class=
"text-center"
>
手续费(元)
</th>
<th
class=
"text-center"
>
慈善基金(元)
</th>
<th
class=
"text-center"
>
现金奖(元)
</th>
<th
class=
"text-center"
>
实收佣金(元)
</th>
<th
class=
"text-center"
>
确认时间
</th>
</tr>
</thead>
<tbody
class=
"text-center"
id=
"maid_new_table_list"
>
<!--<tr>
<td>盘方</td>
<td>刘丹丹-13918937741</td>
<td>同联一部南京东路店</td>
<td contenteditable>30%</td>
<td contenteditable>350000</td>
<td colspan="6" class="detail-modal-maid-mix-td oh">
<div class="oh">
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span></span>
</div>
</td>
</tr>
<tr>
<td>盘方</td>
<td>刘丹丹-13918937741</td>
<td>同联一部南京东路店</td>
<td contenteditable>30%</td>
<td contenteditable>350000</td>
<td colspan="6" class="detail-modal-maid-mix-td oh">
<div class="oh">
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span contenteditable></span>
<span></span>
</div>
</td>
</tr>-->
</tbody>
</table>
</div>
<br><br><br><br>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
id=
"confirm_edit"
>
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</table>
<div
class=
"detail-modal-maid-bottom-btn-area text-right"
>
<!--<a id="maid_ok_btn" class="btn btn-primary" data-toggle="modal">确认分佣</a>-->
<!--<a id="maid_save_btn" class="btn btn-primary" data-toggle="modal">保存</a>-->
</div>
<!--分佣提成-->
</div>
<div
class=
"detail-modal-body-sec"
>
<div>
<div
class=
"tc"
>
<!--<a class="btn btn-success" href="#modal_new_tax" data-toggle="modal">新增开票</a>-->
</div>
<div
id=
"tax_main_box"
>
<!--内容为模板生成-->
</div>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
</div>
<!-- 弹出框
时间
-->
<div
class=
"modal fade"
id=
"modal-
linetime
"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
<!-- 弹出框
通过
-->
<div
class=
"modal fade"
id=
"modal-
pass
"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
时间轴
<h4
class=
"modal-title"
>
通过
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
id=
"del_msg"
>
时间轴
</div
>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</div>
<div
class=
"modal-body"
>
<label
class=
"control-label"
>
备注:
</label
>
<textarea
class=
"form-control"
rows=
"5"
id=
"pass_beizhu"
></textarea>
<!-- <span class="use-span text-danger">(必填)</span> --
>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
id=
"
"
>
删除
<button
type=
"button"
class=
"btn btn-info"
data-dismiss=
"modal"
class=
"pass-modal-btn-pass"
id=
"pass_ok_btn
"
>
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 分佣提成新增 -->
<div
class=
"modal fade"
id=
"modal-new"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<!-- 弹出框 时间轴 -->
<div
class=
"modal fade"
id=
"modal-time"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
新增分佣提成
<h4
class=
"modal-title"
>
时间轴
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
id=
""
>
<!-- 新增分佣提成 -->
<form
id=
"form_search"
>
分佣方:
<select
class=
"form-control form-control-one"
id=
"is_carefully_chosen"
>
<option
value=
"0"
>
请选择
</option>
<option
value=
"1"
>
盘方
</option>
<option
value=
"2"
>
客方
</option>
<option
value=
"3"
>
反签
</option>
<option
value=
"4"
>
独家
</option>
<option
value=
"5"
>
合作方
</option>
</select><br>
<span>
业务员:
</span><input
class=
"form-control form-control-one"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
" "
placeholder=
""
type=
"text"
value=
""
><br>
<span>
所属门店:
</span><input
class=
"form-control form-control-one"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
" "
placeholder=
""
type=
"text"
value=
""
><br>
<span>
分佣比例:
</span><input
class=
"form-control form-control-one"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"commission-rate"
placeholder=
""
type=
"text"
value=
""
><br>
<span>
应分佣金:
</span><input
class=
"form-control form-control-one"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"should-commission"
placeholder=
""
type=
"text"
value=
""
><br>
</form>
<!-- 新增分佣提成 -->
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
id=
"new-commission"
>
确定
</button>
<div
class=
"modal-body"
class=
"iframe-div-parent"
>
<iframe
class=
"iframe-time-line"
></iframe>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 弹出框 分佣提成新增 -->
<div
class=
"modal fade"
id=
"modal_new_maid"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
新增分佣提成
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
id=
"addmaid_input_area"
>
<div>
<span>
分佣方:
</span>
<select
class=
"form-control"
id=
"addmaid_input_servant"
>
<option
value=
""
>
请选择
</option>
<option
value=
"1"
>
盘方
</option>
<option
value=
"2"
>
客方
</option>
<option
value=
"3"
>
反签
</option>
<option
value=
"4"
>
独家
</option>
<option
value=
"5"
>
合作方
</option>
</select>
</div>
<div
class=
"po-relative"
>
<span>
业务员:
</span><input
class=
"form-control"
type=
"text"
id=
"addmaid_input_ywy"
/>
<ul>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
<li
data-id=
"5755"
>
5755-测试-小杨业务员-17621975554
</li>
</ul>
</div>
<div>
<span>
所属门店:
</span><input
class=
"form-control"
type=
"text"
id=
"addmaid_input_shop"
/>
</div>
<div>
<span>
分佣比例:
</span><input
class=
"form-control"
type=
"number"
id=
"addmaid_input_ratio"
/><span>
%
</span>
</div>
<div>
<span>
应分佣金:
</span><input
class=
"form-control"
type=
"number"
id=
"addmaid_input_cash"
/><span>
元
</span>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<div
href=
"#modal_new_maid_select"
data-toggle=
"modal"
>
打开盘方业务员选择框
</div>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
id=
"addmaid_ok_btn"
>
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 弹出框 分佣提成新增,选择盘方,多个的时候选择一业务员 -->
<div
class=
"modal fade"
id=
"modal_new_maid_select"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
data-backdrop=
'static'
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
选择一业务员
</h4>
</div>
<div
class=
"modal-body"
>
<ul
id=
"addmaid_select_ul"
>
</ul>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 弹出框 开票税费新增 -->
<div
class=
"modal fade"
id=
"modal_new_tax"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
新增开票
</h4>
</div>
<div
class=
"modal-body"
>
<div>
<div>
<div
class=
"form-group addtax-modal-tax-commission-sec"
>
<label
class=
""
>
开票金额:
</label>
<div
class=
"input-group"
><input
type=
"number"
class=
"form-control"
placeholder=
"请输入"
id=
"addtax_commission_input"
>
<div
class=
"input-group-addon"
>
元
</div>
</div>
<label
class=
""
>
开票日期:
</label>
<div
class=
"input-group"
><input
type=
"date"
class=
"form-control"
placeholder=
"请输入"
id=
"addtax_date"
></div>
</div>
<div>
<table
class=
"table-haveborder addtax-modal-tax-table"
>
<!--<tr>
<td>分佣方</td>
<td>业务员</td>
<td>分佣比例</td>
<td>税费</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>-->
</table>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
id=
"addtax_commission_addok"
>
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
application/model/OBargainModel.php
View file @
ee67c7d1
...
...
@@ -257,50 +257,136 @@ class OBargainModel extends Model
return
$result
;
}
// /**
// * 成交报告
// *
// * @param int $pageNo
// * @param int $pageSize
// * @param string $order_
// * @param string $field
// * @param string $params
// * @return false|\PDOStatement|string|\think\Collection
// * @throws \think\db\exception\DataNotFoundException
// * @throws \think\db\exception\ModelNotFoundException
// * @throws \think\exception\DbException
// */
// public function getBargain($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
// {
// return $this->field($field)->alias('a')
// ->join('o_report b', 'a.report_id = b.id', 'left')
// ->join('o_order c', 'a.order_id = c.id', 'left')
// ->join('g_houses d', 'c.house_id = d.id', 'left')
// ->join('o_financial_audit e', 'e.bargain_id = a.id', 'left')
// ->where($params)
// ->group('a.id')
// ->order($order_)
// ->limit($pageSize)
// ->page($pageNo)
// ->select();
// }
/**
* 成交报告
* 成交报告
列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @param int $audit_level
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBargain
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
public
function
getBargain
List
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
,
int
$audit_level
=
0
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'o_financial_audit e'
,
'e.bargain_id = a.id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
if
(
$audit_level
!=
-
1
)
{
$sql_string
=
'((SELECT * FROM o_financial_audit WHERE audit_level = '
.
$audit_level
.
' AND is_del = 0)
UNION ALL (SELECT * FROM o_financial_audit WHERE audit_level > '
.
$audit_level
.
' AND is_del = 0)) as e'
;
$data
=
$this
->
table
(
$sql_string
)
->
field
(
$field
)
->
join
(
'o_bargain a'
,
'e.bargain_id = a.id'
,
'left'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
where
(
$params
)
->
having
(
'count(e.order_id) = 1'
)
->
order
(
$order_
)
->
group
(
'e.order_id'
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
return
$data
;
}
// /**
// * 成交报告总数
// *
// * @param string $params
// * @return int|string
// */
// public function getBargainTotal($params = '')
// {
// return $this->alias('a')
// ->join('o_report b', 'a.report_id = b.id', 'left')
// ->join('o_order c', 'a.order_id = c.id', 'left')
// ->join('g_houses d', 'c.house_id = d.id', 'left')
// ->join('o_financial_audit e', 'e.bargain_id = a.id', 'left')
// ->where($params)
// ->group('a.id')
// ->count();
// }
/**
* 成交报告总数
*
* @param string $params
* @return int|string
* @param array $params
* @param int $audit_level
* @return int
*/
public
function
getBargainTotal
(
$params
=
''
)
public
function
getBargainTotal
(
array
$params
=
[],
int
$audit_level
=
0
)
:
int
{
return
$this
->
alias
(
'a'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'o_financial_audit e'
,
'e.bargain_id = a.id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
count
();
$total
=
0
;
if
(
$audit_level
!=
-
1
)
{
$total
=
$this
->
table
(
'((SELECT * FROM o_financial_audit WHERE audit_level = '
.
$audit_level
.
' AND is_del = 0)
UNION ALL (SELECT * FROM o_financial_audit WHERE audit_level > '
.
$audit_level
.
' AND is_del = 0)) as e'
)
->
join
(
'o_bargain a'
,
'e.bargain_id = a.id'
,
'left'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
where
(
$params
)
->
having
(
'count(e.order_id) = 1'
)
->
group
(
'e.order_id'
)
->
count
();
}
else
{
$total
=
$this
->
alias
(
'a'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
count
();
}
return
$total
;
}
/**
...
...
@@ -309,7 +395,7 @@ class OBargainModel extends Model
* @param int $id
* @param array $data
* @param int $source 审核来源 1成交报告申请结单 2退款 3申请撤销成交报告
* @param int $status 成交报告状态
10已提交 11审核成功
20待撤销 21已撤销 30删除
* @param int $status 成交报告状态
10已提交 11审核开始 12驳回 13审核成功
20待撤销 21已撤销 30删除
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
...
...
@@ -318,11 +404,11 @@ class OBargainModel extends Model
*/
public
function
addCheckBargain
(
int
$id
,
array
$data
,
int
$source
,
int
$status
)
:
bool
{
$this
->
startTrans
();
//
$this->startTrans();
$bargain_data
=
$this
->
field
(
'id,report_id,agent_id,order_no,order_id'
)
->
where
([
'id'
=>
$id
,
'status'
=>
$status
])
->
lock
(
true
)
->
find
();
'status'
=>
[
'in'
,
'10,11'
]
])
->
find
();
if
(
$bargain_data
!=
''
)
{
$audit
=
new
OFinancialAudit
();
...
...
@@ -358,20 +444,23 @@ class OBargainModel extends Model
if
(
$return
)
{
if
(
$data
[
'audit_level'
]
==
2
&&
$status
==
10
)
{
$update_data
[
'status'
]
=
1
1
;
$update_data
[
'status'
]
=
1
3
;
$update_data
[
'account_statement'
]
=
1
;
$update_data
[
'account_time'
]
=
time
();
$this
->
save
(
$update_data
,
[
'id'
=>
$bargain_data
[
'id'
]
]);
}
else
{
$update_data
[
'status'
]
=
11
;
$this
->
save
(
$update_data
,
[
'id'
=>
$bargain_data
[
'id'
]
]);
}
if
(
$data
[
'audit_level'
]
==
2
&&
$status
==
20
)
{
$this
->
where
(
'id'
,
$bargain_data
[
'id'
])
->
setField
(
'status'
,
21
);
}
$this
->
commit
();
//
$this->commit();
$result
=
true
;
}
else
{
$this
->
rollback
();
//
$this->rollback();
$result
=
false
;
}
}
else
{
...
...
@@ -732,14 +821,17 @@ class OBargainModel extends Model
{
$m_partial
=
new
OPartialCommission
();
$data
=
$m_partial
->
getBragainScale
(
$bargain_id
);
$partial_bargain
=
$m_partial
->
getBragainScale
(
$bargain_id
);
foreach
(
$partial_bargain
as
$val
)
{
$bargain_id_arr
[]
=
$val
[
'bargain_id'
];
}
if
(
empty
(
$data
))
{
$data
=
$this
->
field
(
'role,agent_id,scale,scale_fee'
)
$data
=
$this
->
field
(
'role,agent_id,scale,scale_fee'
)
->
where
(
'id'
,
$bargain_id
)
->
where
(
'id'
,
'not in'
,
import
(
','
,
$bargain_id_arr
))
->
whereOr
(
'father_id'
,
$bargain_id
)
->
select
();
}
$m_agent
=
new
AAgents
();
$result
=
[];
...
...
@@ -748,6 +840,7 @@ class OBargainModel extends Model
if
(
isset
(
$v
[
'role'
]))
{
$agent_name
=
$m_agent
->
getAgentInfo
(
'id,name,phone'
,
$v
[
'agent_id'
]);
$result
[
$k
][
'id'
]
=
$agent_name
[
'id'
];
$result
[
$k
][
'agent_id'
]
=
$agent_name
[
'id'
];
$result
[
$k
][
'name'
]
=
$agent_name
[
'name'
];
$result
[
$k
][
'phone'
]
=
$agent_name
[
'phone'
];
$result
[
$k
][
'role'
]
=
$v
[
'role'
];
...
...
application/model/OPartialCommission.php
View file @
ee67c7d1
...
...
@@ -197,8 +197,9 @@ class OPartialCommission extends BaseModel
* @throws \think\exception\PDOException
*/
public
function
getBragainScale
(
int
$bargain_id
)
{
$sql
=
'SELECT scale,agent_id,role,substring_index(group_concat(id ORDER BY id DESC),",",1) as id
FROM o_partial_commission WHERE bargain_id = '
.
$bargain_id
.
' GROUP BY role'
;
$sql
=
'SELECT a.bargain_id,a.scale,b.scale_fee,a.agent_id,a.role,substring_index(group_concat(a.id ORDER BY a.id DESC),",",1) AS id
FROM o_partial_commission a LEFT JOIN o_bargain b on a.bargain_id=b.id WHERE a.bargain_id = '
.
$bargain_id
.
'
and b.id= '
.
$bargain_id
.
' OR b.father_id='
.
$bargain_id
.
' GROUP BY role'
;
return
$this
->
query
(
$sql
);
}
}
\ No newline at end of file
application/model/OTaxes.php
View file @
ee67c7d1
...
...
@@ -24,8 +24,10 @@ class OTaxes extends BaseModel
*/
public
function
getBargainTaxes
(
int
$bargain_id
,
$field
=
'id as fee_id,fee,operation_date'
)
{
$params
[
"bargain_id"
]
=
$bargain_id
;
$params
[
"father_id"
]
=
array
(
"neq"
,
0
);
return
$this
->
field
(
$field
)
->
where
(
'bargain_id'
,
$bargain_id
)
->
where
(
$params
)
->
where
(
'is_del'
,
0
)
->
select
();
}
...
...
@@ -100,7 +102,7 @@ class OTaxes extends BaseModel
foreach
(
$data
as
$k
=>
$v
)
{
$result
[
$k
]
=
$v
;
if
(
isset
(
$v
[
'id'
])
&&
$v
[
'bargain_id'
])
{
$result
[
$k
][
'fee_list'
]
=
$this
->
field
(
'a.id as fee
d
_id,a.fee,b.phone,b.name,a.role,a.scale'
)
$result
[
$k
][
'fee_list'
]
=
$this
->
field
(
'a.id as fee_id,a.fee,b.phone,b.name,a.role,a.scale'
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agent_id = b.id'
,
'left'
)
->
where
(
'a.father_id'
,
$v
[
'id'
])
...
...
@@ -112,12 +114,15 @@ class OTaxes extends BaseModel
return
$result
;
}
/**
* 根据id 查询详情 zw
*
* @param int $taxesId
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getTaxesId
(
int
$taxesId
,
string
$field
)
{
...
...
public/appnew/src/components/reportDetails/reportDetails.vue
View file @
ee67c7d1
...
...
@@ -104,7 +104,7 @@
</li>
<li
class=
"main-sec-li-26 color li-border-bottom"
>
<div
class=
'clear'
>
<div
class=
"left"
>
确认时间
{{
index
+
1
}}
:
{{
items
.
c
reate_tim
e
}}
</div>
<div
class=
"left"
>
确认时间
{{
index
+
1
}}
:
{{
items
.
c
onfirm_dat
e
}}
</div>
</div>
</li>
...
...
public/resource/css/report_list.css
View file @
ee67c7d1
...
...
@@ -15,7 +15,10 @@ addtax_
*
*
* */
/*页面主要内容table区域*/
#maintable_form_span_zhi
{
margin-left
:
10px
;
}
/*详情弹出框*/
.detail-modal-body
{
...
...
public/resource/js/commission.js
View file @
ee67c7d1
define
([
'doT'
,
'text!temp/commission_template_tpl.html'
,
'css!style/home.css'
,
'ckfinder'
,
'ckfinderStart'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
business
=
{
//define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
// business = {
// pageNo: 1,
// /*第几页*/
// pageSize: 10,
// /*每页显示多少条*/
// id: '',
// house_id: '',
// type: '',
// valueCurrent: '',
// ajaxObj: '',
// stopstatus: true,
// ldHtml: $('.phone_list'),
// boxphoto: '',
// exclusive_id: 0,
// init: function() {
// //初始化dot
// $("body").append(template);
// business.getList();
// business.event();
// },
// event: function() {
// var _doc = $(document);
// $("#search").click(function() {
// business.getList(1);
// });
// $("#export").click(function() { //导出列表
// business.exportList();
// });
//
// $("#reset").click(function() { //重置
// document.getElementById("form_search").reset();
// });
//
// $(document).delegate(".del_modal", "click", function() {
// business.id = $(this).attr("data-id");
//
// });
// $(document).delegate(".caozuo", "click", function() { //点击操作记录
// business.Caozuo();
// });
// // 时间轴
// $(document).delegate(".timeline", "click", function() { //时间轴
// // business.house_id = $ (this).attr ("data-id");
// business.Timeline();
// });
// // 编辑
// $(document).delegate(".edit", "click", function() { //点击编辑
// business.house_id = $(this).attr("data-id");
// business.Edit();
// });
// $(document).delegate(".is_pass", "click", function() { //点击编辑
// follow.house_id = $(this).attr("data-id");
// console.log(follow.house_id);
// });
// $(document).delegate("#confirm_edit", "click", function() { //点击编辑确定
// business.confirmEdit();
// });
// $(document).delegate("#new-commission", "click", function() { //点击分佣提成
// business.newCommission();
// business.Caozuo();
// });
// //table切换
// $(document).delegate("#information", "click", function() {
// business.Information();
// });
// $(document).delegate("#fees", "click", function() {
// console.log(business.house_id);
// business.Fees();
// });
// $(document).delegate("#records", "click", function() {
// business.Records();
// });
// },
// Timeline: function() { //获取时间轴
// $.ajax({
// 'type': 'GET',
// 'url': '/index/selectReportAll',
// data: {
// "order_id": business.house_id
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// console.log(data.data);
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// Edit: function() { //报告详情
// $(".Tswitch").eq(0).show();
// $(".Tswitch").eq(1).hide();
// $(".Tswitch").eq(2).hide();
// $("#information").removeClass("btn-default");
// $("#information").addClass("btn-info");
// $("#fees").removeClass("btn-info");
// $("#fees").addClass("btn-default");
// $("#records").removeClass("btn-info");
// $("#records").addClass("btn-default");
// console.log(business.house_id);
// $.ajax({
// 'type': 'GET',
// 'url': '/index/bargainInfo',
// data: {
// "id": business.house_id
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// $(".create_time").html(data.data.create_time);
// $(".user_phone").html(data.data.user_phone);
// $(".user_name").html(data.data.user_name);
// $(".internal_address").html(data.data.internal_address);
// $(".internal_title").html(data.data.internal_title);
// $(".commission").val(data.data.commission);
// $(".practical_fee").val(data.data.practical_fee);
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// confirmEdit: function() { //修改报告详情
// $.ajax({
// 'type': 'POST',
// 'url': '/index/editBargainInfo',
// data: {
// "id": business.house_id,
// "scale_fee": $(".commission").val(),
// "practical_fee": $(".practical_fee").val()
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {}
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// Caozuo: function() { //分佣提成获取跟进详情的数据
// console.log(business);
// console.log(business.house_id);
// $.ajax({
// 'type': 'GET',
// 'url': '/index/commissionList',
// data: {
// "id": business.house_id
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// var caozuo_table = "";
// $.each(data['data'], function(i, item) {
// caozuo_table += '<tr><td>' + item.role + '</td><td>' + item.agent_name + '</td><td>' + item.store_name +
// '</td><td>' + item.scale + '</td><td>' + item.scale_fee + '</td><td>' + item.practical_fee + '</td><td>' + item.content + '</td></tr>';
// });
// $("#caozuo_table").html(caozuo_table);
// $("#caozuo_table tr").each(function(e) { //不能为空
// var temp = $("#caozuo_table").find("tr").eq(e).find("td").eq(6).html(); //获取一列的值
// if(temp == 'null') {
// $("#caozuo_table").find("tr").eq(e).find("td").eq(6).html(" ")
// }
// });
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// Records: function() { //分佣提成数据
// $(".Tswitch").eq(0).hide();
// $(".Tswitch").eq(1).hide();
// $(".Tswitch").eq(2).show();
// $("#information").removeClass("btn-info");
// $("#information").addClass("btn-default");
// $("#fees").removeClass("btn-info");
// $("#fees").addClass("btn-default");
// $("#records").removeClass("btn-default");
// $("#records").addClass("btn-info");
// $.ajax({
// 'type': 'GET',
// 'url': '/index/payLogList',
// data: {
// "id": business.house_id
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// var caozuo_table = "";
// $.each(data['data'], function(i, item) {
// caozuo_table += '<tr><td>' + item.create_time + '</td><td>' + item.money + '</td><td>' + item.type +
// '</td><td>' + item.pay_type + '</td><td>' + item.agent_name + '</td></tr>';
// });
// $("#tcaozuo_table").html(caozuo_table);
// $("#tcaozuo_table tr").each(function(e) { //不能为空
// var temp_one = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(4).html();
// var temp = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html(); //获取一列的值
// var temp_two = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html();
// // 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
// if(temp * 1 == 10) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("支付宝")
// }
// if(temp * 1 == 20) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("微信")
// }
// if(temp * 1 == 30) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("pos机器")
// }
// if(temp * 1 == 40) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("转账")
// }
// if(temp * 1 == 50) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("现金")
// }
// if(temp * 1 == 60) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("其他")
// }
//
// // 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他
// if(temp_two * 1 == 10) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("意向金")
// }
// if(temp_two * 1 == 20) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("定金")
// }
// if(temp_two * 1 == 30) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("保管金")
// }
// if(temp_two * 1 == 40) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("押金")
// }
// if(temp_two * 1 == 50) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("租金")
// }
// if(temp_two * 1 == 60) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("进场费")
// }
// if(temp_two * 1 == 70) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("转让费")
// }
// if(temp_two * 1 == 80) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("其他")
// };
// if(temp_one == 'null') {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(4).html(" ")
// }
//
// });
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// newCommission: function() { //新增分佣提成
// $.ajax({
// 'type': 'POST',
// 'url': '/index/addBargain',
// data: {
// "id": business.house_id,
// "role": $("#is_carefully_chosen").val(),
// "scale": $("#commission-rate").val(),
// "scale_fee": $("#should-commission").val(),
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// console.log(666);
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// // table切换
// Information: function() {
// $(".Tswitch").eq(0).show();
// $(".Tswitch").eq(1).hide();
// $(".Tswitch").eq(2).hide();
// $("#information").removeClass("btn-default");
// $("#information").addClass("btn-info");
// $("#fees").removeClass("btn-info");
// $("#fees").addClass("btn-default");
// $("#records").removeClass("btn-info");
// $("#records").addClass("btn-default");
// },
// Fees: function() {
// $(".Tswitch").eq(0).hide();
// $(".Tswitch").eq(1).show();
// $(".Tswitch").eq(2).hide();
// $("#information").removeClass("btn-info");
// $("#information").addClass("btn-default");
// $("#fees").removeClass("btn-default");
// $("#fees").addClass("btn-info");
// $("#records").removeClass("btn-info");
// $("#records").addClass("btn-default");
//
// },
// getList: function(pageNo) {
// business.pageNo = pageNo;
// var params = {};
// params.pageNo = business.pageNo;
// params.pageSize = business.pageSize;
// params.create_time = $('#create_time') .val();
// params.end_time = $('#end_time') .val();
// params.internal_address = $('#internal_address').val();
// params.name = $('#user_name').val();
// params.phone = $('#user_phone').val();
// params.house_number = $('#internal_num').val();
//
// $.ajax({
// url: '/index/partialCommissionList', //获取列表
// type: 'GET',
// async: true,
// data: params,
// dataType: 'json',
// success: function(data) {
// console.log(data);
// var temp = document.getElementById('commission_list_tpl').innerHTML;
// var doTtmpl = doT.template(temp);
// $("#business_list").html(doTtmpl(data.data.data.list));
//
// /*分页代码*/
// add_page(data.data.data.total, pageNo, business.pageSize, business.getList);
// }
// });
// },
// exportList: function(pageNo) {
// //导出分佣提成列表
// business.pageNo = pageNo;
// var create_time = $('#create_time').val();
// var end_time = $('#end_time').val();
// var internal_address = $('#internal_address').val();
// var agent = $('#user_name').val();
// var user_phone = $('#user_phone').val();
// var house_number = $('#internal_num').val();
// window.open('/index/exportExcel?create_time=' + create_time + '&end_time=' + end_time + '&internal_address=' + internal_address + '&name=' + agent + '&phone=' + user_phone + '&house_number=' + house_number);
//
// },
//
// };
// return business;
//});
define
([
'doT'
,
'text!temp/commission_template_tpl.html'
,
'text!temp/reportList_shuiFee_template_tpl.html'
,
'text!temp/reportList_maidtwo_template_tpl.html'
,
'text!temp/reportList_maid_sub1_template_tpl.html'
,
'css!style/home.css'
,
'css!style/report_list.css'
,
'ckfinder'
,
'ckfinderStart'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
,
template_tax
,
template_maid
,
template_maid_sub1
)
{
bargain
=
{
pageNo
:
1
,
/*第几页*/
pageSize
:
10
,
/*每页显示多少条*/
id
:
''
,
house_id
:
''
,
type
:
''
,
valueCurrent
:
''
,
ajaxObj
:
''
,
stopstatus
:
true
,
ldHtml
:
$
(
'.phone_list'
),
boxphoto
:
''
,
exclusive_id
:
0
,
mainTabIndex
:
0
,
detailTabIndex
:
0
,
bargain_id
:
''
,
father_id
:
''
,
order_id
:
0
,
//订单id
panfangData
:
null
,
maidTotalCommission
:
0
,
//应收总佣金
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
b
usiness
.
getList
(
);
b
usiness
.
event
();
$
(
document
.
body
).
append
(
template
+
template_tax
+
template_maid
+
template_maid_sub1
);
b
argain
.
getList
(
1
);
b
argain
.
event
();
},
event
:
function
()
{
var
_doc
=
$
(
document
);
$
(
"#search"
).
click
(
function
()
{
business
.
getList
(
1
);
$
(
"#search"
).
click
(
function
()
{
bargain
.
getList
(
1
);
});
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
});
//主页面一级审核,二级审核,三级审核,结单四个tab的点击事件
//专员审核 总监审核 经理审核 出纳审核
_doc
.
on
(
'click'
,
'.maintable-top-sub-tr>a'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
_this
.
removeClass
(
'btn-default'
).
addClass
(
'btn-info'
).
siblings
().
removeClass
(
'btn-info'
).
addClass
(
'btn-default'
);
bargain
.
mainTabIndex
=
_this
.
index
();
console
.
log
(
bargain
.
mainTabIndex
);
bargain
.
getList
(
1
);
});
$
(
"#export"
).
click
(
function
()
{
//导出列表
b
usiness
.
exportList
();
b
argain
.
exportList
();
});
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
//搜索按钮的事件
_doc
.
on
(
'click'
,
'#maintable_search'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
getList
(
1
);
//一级审核搜索
});
$
(
document
).
delegate
(
".del_modal"
,
"click"
,
function
()
{
business
.
id
=
$
(
this
).
attr
(
"data-id"
);
//搜索的重置
$
(
"#maintable_reset"
).
click
(
function
()
{
document
.
getElementById
(
"maintable_form_search"
).
reset
();
});
$
(
document
).
delegate
(
".caozuo"
,
"click"
,
function
()
{
//点击操作记录
business
.
Caozuo
();
//时间轴按钮
_doc
.
on
(
"click"
,
".timeline"
,
function
()
{
bargain
.
Timeline
();
});
// 时间轴
$
(
document
).
delegate
(
".timeline"
,
"click"
,
function
()
{
//时间轴
// business.house_id = $ (this).attr ("data-id");
business
.
Timeline
();
//转到一级审核
_doc
.
on
(
'click'
,
'.maintable-btn-trans-one'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
bargain_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-id"
);
layer
.
open
({
content
:
'确定转到一级审核?'
,
btn
:
[
'确定'
,
'取消'
],
yes
:
function
(
_index
){
bargain
.
transFirstExamine
();
layer
.
close
(
_index
);
}
});
});
// 编辑
$
(
document
).
delegate
(
".edit"
,
"click"
,
function
()
{
//点击编辑
business
.
house_id
=
$
(
this
).
attr
(
"data-id"
);
business
.
Edit
();
//结单
_doc
.
on
(
'click'
,
'.maintable-btn-account'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
bargain_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-id"
);
layer
.
open
({
content
:
'确定结单?'
,
btn
:
[
'确定'
,
'取消'
],
yes
:
function
(
_index
){
bargain
.
account
();
layer
.
close
(
_index
);
}
});
});
$
(
document
).
delegate
(
".is_pass"
,
"click"
,
function
()
{
//点击编辑
follow
.
house_id
=
$
(
this
).
attr
(
"data-id"
);
console
.
log
(
follow
.
house_id
);
//点击通过,修改全局bargain_id,弹出框出来
_doc
.
on
(
'click'
,
'[href=
\
"#modal-pass
\
"]'
,
function
()
{
bargain
.
bargain_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-id"
);
});
$
(
document
).
delegate
(
"#confirm_edit"
,
"click"
,
function
()
{
//点击编辑确定
business
.
confirmEdit
();
//点击通过,确定按钮触发的事件
_doc
.
on
(
'click'
,
'#pass_ok_btn'
,
function
()
{
bargain
.
pass
();
});
$
(
document
).
delegate
(
"#new-commission"
,
"click"
,
function
()
{
//点击分佣提成
business
.
newCommission
();
business
.
Caozuo
();
//点击获取报告详情
_doc
.
on
(
'click'
,
'.details-btn'
,
function
()
{
bargain
.
bargain_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-id"
);
bargain
.
father_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-fatherid"
);
console
.
log
(
bargain
.
bargain_id
);
console
.
log
(
bargain
.
father_id
);
$
(
'.detail-modal-header-tab>a:nth-of-type(1)'
).
removeClass
(
'btn-default'
).
addClass
(
'btn-info'
).
siblings
().
removeClass
(
'btn-info'
).
addClass
(
'btn-default'
);
bargain
.
detailTabIndex
=
0
;
$
(
'.detail-modal-body-sec:nth-of-type(1)'
).
show
().
siblings
().
hide
();
bargain
.
bargaininfoShow
();
});
//table切换
$
(
document
).
delegate
(
"#information"
,
"click"
,
function
()
{
business
.
Information
();
//详情弹出框里的tab点击事件,成交信息,分佣提成,开票税费
_doc
.
on
(
'click'
,
'.detail-modal-header-tab>a'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
_this
.
removeClass
(
'btn-default'
).
addClass
(
'btn-info'
).
siblings
().
removeClass
(
'btn-info'
).
addClass
(
'btn-default'
);
bargain
.
detailTabIndex
=
_this
.
index
();
$
(
'.detail-modal-body-sec:nth-of-type('
+
(
bargain
.
detailTabIndex
+
1
)
+
')'
).
show
().
siblings
().
hide
();
if
(
bargain
.
detailTabIndex
==
0
){
bargain
.
bargaininfoShow
();
}
else
if
(
bargain
.
detailTabIndex
==
1
){
bargain
.
maidShow
();
}
else
{
bargain
.
taxShow
();
}
});
//详情弹出框,成交信息里的实收佣金相关的事件
var
_iYJAAObj
=
$
(
'.detail-modal-bargaininfo-commission-addarea'
);
_doc
.
on
(
'click'
,
'#bargaininfo_commission_add_btn>img'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
$
(
'.detail-modal-bargaininfo-commission-addarea>div'
).
length
>=
5
){
alert
(
'最多添加5条'
);
return
false
;
}
else
{
_iYJAAObj
.
append
(
'<div class="form-group detail-modal-bargaininfo-commission-sec"><label class="">实收佣金:</label><div class="input-group"><input type="number"class="form-control"placeholder="请输入"><div class="input-group-addon">元</div></div><label class="">收佣日期:</label><div class="input-group"><input type="date"class="form-control"placeholder="请输入"></div><mark href="javascript:;"class="detail-modal-bargaininfo-commission-cancel-pic"><img src="/resource/image/search_gb.png"/></mark></div>'
);
};
});
//详情弹出框,成交信息里的实收佣金相关的事件,点击x删除这条
_doc
.
on
(
'click'
,
'.detail-modal-bargaininfo-commission-cancel-pic'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
this
).
parent
().
remove
();
});
//详情弹出框,点击成交信息确定
_doc
.
delegate
(
"#bargaininfo_btn_save"
,
"click"
,
function
()
{
bargain
.
bargaininfoSave
();
});
$
(
document
).
delegate
(
"#fees"
,
"click"
,
function
()
{
console
.
log
(
business
.
house_id
);
business
.
Fees
();
//详情弹出框,点击开票税费下的新增税费,弹出框出来
_doc
.
on
(
'click'
,
'[href=
\
"#modal_new_tax
\
"]'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
bargain
.
newAddTax
({
'type'
:
_this
.
attr
(
'data-recordid'
)?
'edit'
:
'new'
,
'id'
:
_this
.
attr
(
'data-recordid'
)
});
});
$
(
document
).
delegate
(
"#records"
,
"click"
,
function
()
{
business
.
Records
();
//详情弹出框,新增开票税费,金额输入框输入后,自动计算税费
_doc
.
on
(
'input'
,
'#addtax_commission_input'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_trObj
=
$
(
'.addtax-modal-tax-table-datatr'
);
$
.
each
(
_trObj
,
function
(
i
,
v
)
{
v
.
childNodes
[
3
].
innerHTML
=
dealJineNum
(
Number
(
v
.
childNodes
[
2
].
innerHTML
.
split
(
'%'
)[
0
])
*
0.01
*
Number
(
$
.
trim
(
_this
.
val
()))
*
0.1
);
});
});
//详情弹出框,新增开票税费,点击确定时的提交
_doc
.
on
(
'click'
,
'#addtax_commission_addok'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
newAddTaxOk
();
});
//详情弹出框,分佣提成里,点击新增
_doc
.
on
(
'click'
,
'[href="#modal_new_maid"]'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
newAddMaid
();
});
//详情弹出框,分佣提成里,点击新增,分佣方选择时触发的事件
_doc
.
on
(
'input'
,
'#addmaid_input_servant'
,
function
(
e
){
var
_this
=
$
(
this
);
$
(
'#addmaid_input_ywy'
).
val
(
''
);
//先置空
$
(
'#addmaid_input_shop'
).
val
(
''
);
//先置空
if
(
_this
.
val
()
===
''
){
}
else
if
(
_this
.
val
()
===
'5'
){
}
else
{
var
_rateTemp
=
bargain
.
getDefaultRadio
(
_this
.
val
());
$
(
'#addmaid_input_ratio'
).
val
(
_rateTemp
);
$
(
'#addmaid_input_cash'
).
val
(
dealJineNum
(
_rateTemp
*
bargain
.
maidTotalCommission
/
100
));
var
_arrTemp
=
bargain
.
panfangData
.
filter
(
function
(
item
,
index
,
array
){
return
(
item
.
role
==
_this
.
val
());
});
if
(
_arrTemp
.
length
===
0
){
return
false
;
}
else
if
(
_arrTemp
.
length
===
1
){
$
(
'#addmaid_input_ywy'
).
val
(
_arrTemp
[
0
].
name
+
'-'
+
_arrTemp
[
0
].
phone
).
attr
(
'data-id'
,
_arrTemp
[
0
].
id
);
bargain
.
getDepart
(
_arrTemp
[
0
].
id
,
function
(
obj
){
$
(
'#addmaid_input_shop'
).
val
(
obj
.
district_name
+
'-'
+
obj
.
store_name
);
});
}
else
{
$
(
'[href="#modal_new_maid_select"]'
).
click
();
var
_tempHtml
=
''
;
$
.
each
(
_arrTemp
,
function
(
i
,
v
)
{
_tempHtml
+=
'<li data-data="{data}">{0}-{1}</li>'
.
stringFormatObj
({
'data'
:
encodeURIComponent
(
JSON
.
stringify
(
v
)),
'0'
:
v
.
name
,
'1'
:
v
.
phone
});
});
$
(
'#addmaid_select_ul'
).
html
(
_tempHtml
);
}
}
});
//详情弹出框,分佣提成里,点击新增,分佣方选择,弹出选择列表触发的事件
_doc
.
on
(
'click'
,
'#addmaid_select_ul>li'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_dataTemp
=
JSON
.
parse
(
decodeURIComponent
(
_this
.
attr
(
'data-data'
)));
$
(
'#addmaid_input_ywy'
).
val
(
_dataTemp
.
name
+
'-'
+
_dataTemp
.
phone
).
attr
(
'data-id'
,
_dataTemp
.
id
);
bargain
.
getDepart
(
_dataTemp
.
id
,
function
(
obj
){
$
(
'#addmaid_input_shop'
).
val
(
obj
.
district_name
+
'-'
+
obj
.
store_name
);
});
_this
.
closest
(
'.modal-content'
).
find
(
'button.close'
).
click
();
});
//详情弹出框,分佣提成里,点击新增,点击保存触发的事件
_doc
.
on
(
'click'
,
'#addmaid_ok_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
newAddMaidOk
();
});
//详情弹出框,分佣提成里,点击确认分佣触发的事件
_doc
.
on
(
'click'
,
'#maid_ok_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
bargain
.
mainTabIndex
===
2
){
bargain
.
maidConfirmOk
(
1
);
}
else
{
alert
(
'财务第三级审核人员才能确认分佣!'
);
}
});
//详情弹出框,分佣提成里,点击保存触发的事件
_doc
.
on
(
'click'
,
'#maid_save_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
// bargain.maidSave();
bargain
.
maidConfirmOk
(
0
);
});
//详情弹出框,分佣提成里,点击增加实收按钮
_doc
.
on
(
'click'
,
'#maid_new_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_temp
=
$
(
'.detail-modal-maid-span-time'
);
var
_flag
=
false
;
if
(
_temp
&&
_temp
.
length
&&
_temp
.
length
>
0
){
$
.
each
(
_temp
,
function
(
i
,
v
)
{
if
(
v
.
innerHTML
==
''
){
_flag
=
true
;
return
false
;
};
});
};
if
(
_flag
){
alert
(
'前边一组收佣尚未确认分佣或成交信息里没有对应的实收佣金'
);
}
else
{
layer
.
open
({
content
:
'确认增加吗?'
,
btn
:
[
'确定'
,
'取消'
],
yes
:
function
(
_index
){
$
(
'.detail-modal-maid-mix-td'
).
append
(
document
.
getElementById
(
'reportList_maid_sub1_list_tpl'
).
innerHTML
);
layer
.
close
(
_index
);
}
});
};
});
//新增分佣提成,业务员input输入搜索,点击之后赋值
_doc
.
on
(
'click'
,
'#addmaid_input_ywy+ul>li'
,
function
()
{
var
_this
=
$
(
this
);
var
_id
=
_this
.
attr
(
'data-id'
);
_this
.
parent
().
prev
().
val
(
_this
.
html
()).
attr
(
'data-id'
,
_id
);
bargain
.
getDepart
(
_id
,
function
(
obj
){
$
(
'#addmaid_input_shop'
).
val
(
obj
.
district_name
+
'-'
+
obj
.
store_name
);
});
_this
.
parent
().
html
(
''
).
hide
();
});
//新增分佣提成,业务员input输入搜索
var
_ajaxObjTel
=
null
;
var
_addmaid_input_servantObj
=
$
(
'#addmaid_input_servant'
);
_doc
.
on
(
'input'
,
'#addmaid_input_ywy'
,
function
()
{
var
_this
=
$
(
this
);
if
(
_addmaid_input_servantObj
.
val
()
==
'5'
){
//当分佣方的值为5,合作方的时候,才能查询
var
_thisVal
=
$
.
trim
(
_this
.
val
());
_this
.
removeAttr
(
'data-id'
);
//移除之前携带的信息
if
(
_thisVal
!=
''
)
{
_ajaxObjTel
&&
_ajaxObjTel
.
abort
();
_ajaxObjTel
=
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/getBroker_new'
,
data
:
{
'phone'
:
$
.
trim
(
_this
.
val
())
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
if
(
data
[
'data'
].
length
>
0
)
{
var
_htmlTemp
=
''
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
_htmlTemp
+=
'<li data-id="{3}">{0}-{1}<li>'
.
stringFormatObj
({
'0'
:
item
[
'name'
],
'1'
:
item
[
'phone'
],
'3'
:
item
[
'id'
]
});
});
_this
.
next
().
show
().
html
(
_htmlTemp
);
}
else
{
_this
.
next
().
html
(
''
);
};
}
else
{
alert
(
data
[
'msg'
]);
};
}
else
{
alert
(
'数据错误'
);
};
},
error
:
function
()
{
//alert('error');
},
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
alert
(
'请求超时'
);
};
}
});
}
else
{
_this
.
next
().
hide
();
}
}
else
{}
});
//时间轴点击事件
_doc
.
on
(
'click'
,
'a[href="#modal-time"]'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_id
=
_this
.
closest
(
'tr'
).
data
(
'orderid'
);
console
.
log
(
_id
);
$
(
'.iframe-time-line'
).
attr
(
'src'
,
'/app_broker/timeline_pc?order_id='
+
_id
);
});
},
getDefaultRadio
:
function
(
v
){
switch
(
Number
(
v
)){
case
1
:
return
25
;
case
2
:
return
30
;
case
3
:
return
35
;
case
4
:
return
10
;
default
:
return
25
;
}
},
getDepart
:
function
(
s
,
fn
){
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/getAgentDistrictStore'
,
data
:
{
'id'
:
s
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
fn
&&
fn
(
_data
.
data
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
Timeline
:
function
()
{
//获取时间轴
...
...
@@ -77,7 +783,7 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
'type'
:
'GET'
,
'url'
:
'/index/selectReportAll'
,
data
:
{
"order_id"
:
b
usiness
.
house
_id
"order_id"
:
b
argain
.
bargain
_id
},
dataType
:
"json"
,
success
:
function
(
data
)
{
...
...
@@ -91,34 +797,50 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
}
});
},
Edit
:
function
()
{
//报告详情
$
(
".Tswitch"
).
eq
(
0
).
show
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-default"
);
$
(
"#information"
).
addClass
(
"btn-info"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
console
.
log
(
business
.
house_id
);
bargaininfoShow
:
function
()
{
//报告详情
var
bargainId
;
if
(
bargain
.
father_id
==
0
){
bargainId
=
bargain
.
bargain_id
;
}
else
{
bargainId
=
bargain
.
father_id
;
}
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/bargainInfo'
,
data
:
{
"id"
:
b
usiness
.
house_i
d
"id"
:
b
argainI
d
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
$
(
".create_time"
).
html
(
data
.
data
.
create_time
);
$
(
".user_phone"
).
html
(
data
.
data
.
user_phone
);
$
(
".user_name"
).
html
(
data
.
data
.
user_name
);
$
(
".internal_address"
).
html
(
data
.
data
.
internal_address
);
$
(
".internal_title"
).
html
(
data
.
data
.
internal_title
);
$
(
".commission"
).
val
(
data
.
data
.
commission
);
$
(
".practical_fee"
).
val
(
data
.
data
.
practical_fee
);
$
(
'#bargaininfo_shop_type'
).
html
(
data
.
data
.
shop_type
==
'1'
?
'街铺'
:
'商场'
);
$
(
'#bargaininfo_is_open'
).
val
(
data
.
data
.
is_open
);
$
(
'#bargaininfo_beizhu'
).
val
(
data
.
data
.
content
);
$
(
"#bargaininfo_user_phone"
).
html
(
hideTel
(
data
.
data
.
user_phone
));
$
(
"#bargaininfo_user_name"
).
html
(
data
.
data
.
user_name
);
$
(
"#bargaininfo_internal_address"
).
html
(
data
.
data
.
internal_address
);
$
(
"#bargaininfo_shop_num"
).
html
(
data
.
data
.
house_number
);
$
(
"#bargaininfo_type"
).
val
(
data
.
data
.
trade_type
);
$
(
"#bargaininfo_total_commission"
).
val
(
data
.
data
.
commission
);
$
(
"#bargaininfo_create_time"
).
html
(
data
.
data
.
create_time
);
bargain
.
maidTotalCommission
=
Number
(
data
.
data
.
commission
);
//总佣金
bargain
.
order_id
=
Number
(
data
.
data
.
order_id
);
//订单id
var
_inputAreaTempObj
=
$
(
'.detail-modal-bargaininfo-commission-addarea'
);
if
(
data
.
data
.
practical_fee
&&
data
.
data
.
practical_fee
.
length
>
0
){
_inputAreaTempObj
.
html
(
''
);
};
$
.
each
(
data
.
data
.
practical_fee
,
function
(
i
,
v
)
{
_inputAreaTempObj
.
append
(
'<div data-id="{id}" class="form-group detail-modal-bargaininfo-commission-sec"><label class="">实收佣金:</label><div class="input-group"><input type="number"class="form-control"placeholder="请输入"value="{0}"><div class="input-group-addon">元</div></div><label class="">收佣日期:</label><div class="input-group"><input type="date"class="form-control"placeholder="请输入"value="{1}"></div></div>'
.
stringFormatObj
({
'0'
:
v
.
money
,
'1'
:
v
.
income_time
,
'id'
:
v
.
fee_id
}));
});
}
}
else
{
alert
(
'获取失败!'
);
...
...
@@ -126,50 +848,114 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
}
});
},
confirmEdit
:
function
()
{
//修改报告详情
bargaininfoSave
:
function
()
{
//修改报告详情
var
_data
=
{
'id'
:
bargain
.
bargain_id
,
'commission'
:
$
.
trim
(
$
(
'#bargaininfo_total_commission'
).
val
()),
'content'
:
$
.
trim
(
$
(
'#bargaininfo_beizhu'
).
val
()),
'is_open'
:
$
(
'#bargaininfo_is_open'
).
val
(),
'trade_type'
:
$
(
'#bargaininfo_type'
).
val
()
};
$
.
each
(
$
(
'.detail-modal-bargaininfo-commission-sec'
),
function
(
i
,
v
)
{
_data
[
'practical_fee['
+
i
+
']'
]
=
{
'fee_id'
:
v
.
getAttribute
(
'data-id'
)?
v
.
getAttribute
(
'data-id'
):
0
,
'fee'
:
$
.
trim
(
$
(
v
).
find
(
'input'
).
eq
(
0
).
val
()),
'operation_date'
:
$
.
trim
(
$
(
v
).
find
(
'input'
).
eq
(
1
).
val
())
};
});
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/editBargainInfo'
,
data
:
{
"id"
:
business
.
house_id
,
"scale_fee"
:
$
(
".commission"
).
val
(),
"practical_fee"
:
$
(
".practical_fee"
).
val
()
},
data
:
_data
,
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{}
alert
(
'修改成功'
);
bargain
.
bargaininfoShow
();
bargain
.
getList
(
0
);
}
else
{
alert
(
'获取失败!'
);
alert
(
data
.
msg
);
}
}
});
},
Caozuo
:
function
()
{
//分佣提成获取跟进详情的数据
console
.
log
(
business
);
console
.
log
(
business
.
house_id
);
maidShow
:
function
()
{
$
(
'[href="#modal_new_maid"]'
).
hide
();
//默认隐藏新增按钮
$
(
"#maid_new_table_list"
).
html
(
''
);
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/commissionList'
,
type
:
'GET'
,
url
:
'/index/commissionList'
,
data
:
{
'id'
:
bargain
.
bargain_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
$
(
"#maid_new_table_list"
).
html
(
doT
.
template
(
$
(
'#reportList_maid_list_tpl'
).
html
())(
_data
));
var
_isShowAddBtnFlag
=
true
;
$
.
each
(
$
(
'.detail-modal-maid-span-time'
),
function
(
i
,
v
)
{
if
(
v
.
innerHTML
){
_isShowAddBtnFlag
=
false
;
};
});
//如果确认时间都有,都不为空,则把新增按钮显示出来
if
(
_isShowAddBtnFlag
){
$
(
'[href="#modal_new_maid"]'
).
show
();
};
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
//通过
pass
:
function
()
{
//点击通过
var
a_url
=
''
;
if
(
bargain
.
mainTabIndex
==
0
)
{
a_url
=
"/index/checkReportAttache/0"
};
if
(
bargain
.
mainTabIndex
==
1
)
{
a_url
=
"/index/checkReportManager/1"
};
// if(bargain.mainTabIndex == 2) {
// a_url = "/index/checkReportMajordomo/2"
// };
// if(bargain.mainTabIndex == 3) {
// a_url = "/index/checkReportCashier/3"
// };
//审核来源 1.成交报告申请结单 2.待撤销(退款) 3.申请撤销成交报告
//成交报告状态 10已提交 20待撤销
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
a_url
,
data
:
{
"id"
:
business
.
house_id
"id"
:
bargain
.
bargain_id
,
"source"
:
1
,
"status"
:
10
,
"remark"
:
$
.
trim
(
$
(
"#pass_beizhu"
).
val
()),
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
var
caozuo_table
=
""
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
caozuo_table
+=
'<tr><td>'
+
item
.
role
+
'</td><td>'
+
item
.
agent_name
+
'</td><td>'
+
item
.
store_name
+
'</td><td>'
+
item
.
scale
+
'</td><td>'
+
item
.
scale_fee
+
'</td><td>'
+
item
.
practical_fee
+
'</td><td>'
+
item
.
content
+
'</td></tr>'
;
});
$
(
"#caozuo_table"
).
html
(
caozuo_table
);
$
(
"#caozuo_table tr"
).
each
(
function
(
e
)
{
//不能为空
var
temp
=
$
(
"#caozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
6
).
html
();
//获取一列的值
if
(
temp
==
'null'
)
{
$
(
"#caozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
6
).
html
(
" "
)
}
});
bargain
.
getList
(
1
);
}
}
else
{
alert
(
'获取失败!'
);
...
...
@@ -177,144 +963,430 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
}
});
},
Records
:
function
()
{
//分佣提成数据
$
(
".Tswitch"
).
eq
(
0
).
hide
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
show
();
$
(
"#information"
).
removeClass
(
"btn-info"
);
$
(
"#information"
).
addClass
(
"btn-default"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-default"
);
$
(
"#records"
).
addClass
(
"btn-info"
);
// 开票税费
taxShow
:
function
()
{
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/payLogList'
,
data
:
{
"id"
:
business
.
house_id
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
var
caozuo_table
=
""
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
caozuo_table
+=
'<tr><td>'
+
item
.
create_time
+
'</td><td>'
+
item
.
money
+
'</td><td>'
+
item
.
type
+
'</td><td>'
+
item
.
pay_type
+
'</td><td>'
+
item
.
agent_name
+
'</td></tr>'
;
});
$
(
"#tcaozuo_table"
).
html
(
caozuo_table
);
$
(
"#tcaozuo_table tr"
).
each
(
function
(
e
)
{
//不能为空
var
temp_one
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
4
).
html
();
var
temp
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
();
//获取一列的值
var
temp_two
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
();
// 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
if
(
temp
*
1
==
10
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"支付宝"
)
}
if
(
temp
*
1
==
20
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"微信"
)
}
if
(
temp
*
1
==
30
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"pos机器"
)
}
if
(
temp
*
1
==
40
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"转账"
)
}
if
(
temp
*
1
==
50
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"现金"
)
}
if
(
temp
*
1
==
60
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"其他"
)
}
// 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他
if
(
temp_two
*
1
==
10
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"意向金"
)
}
if
(
temp_two
*
1
==
20
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"定金"
)
}
if
(
temp_two
*
1
==
30
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"保管金"
)
}
if
(
temp_two
*
1
==
40
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"押金"
)
}
if
(
temp_two
*
1
==
50
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"租金"
)
}
if
(
temp_two
*
1
==
60
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"进场费"
)
}
if
(
temp_two
*
1
==
70
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"转让费"
)
}
if
(
temp_two
*
1
==
80
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"其他"
)
};
if
(
temp_one
==
'null'
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
4
).
html
(
" "
)
type
:
'GET'
,
url
:
'/index/getTallAge'
,
data
:
{
'bargain_id'
:
bargain
.
bargain_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
$
(
"#tax_main_box"
).
html
(
doT
.
template
(
$
(
'#reportList_shuiFee_list_tpl'
).
html
())(
_data
.
data
));
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
newAddMaid
:
function
(){
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/searchOrderAgents'
,
data
:
{
'order_id'
:
bargain
.
order_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
bargain
.
panfangData
=
_data
.
data
;
console
.
log
(
bargain
.
panfangData
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
newAddMaidOk
:
function
(){
console
.
log
(
7789
);
$
.
ajax
({
type
:
'POST'
,
url
:
'/index/addBargain'
,
data
:
{
'id'
:
bargain
.
bargain_id
,
'agent_id'
:
$
(
'#addmaid_input_ywy'
).
attr
(
'data-id'
),
'scale_fee'
:
$
(
'#addmaid_input_cash'
).
val
(),
'role'
:
$
(
'#addmaid_input_servant'
).
val
(),
'scale'
:
$
(
'#addmaid_input_ratio'
).
val
(),
'source'
:
1
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
alert
(
'新增成功!'
);
bargain
.
maidShow
();
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
maidTest
:
function
(
type
){
var
_stopFlag
=
false
;
var
_data
=
[];
var
_parObj
=
$
(
'#maid_new_table_list>tr'
);
var
_errorTips
=
'请填写完整'
;
var
_scaleTotal
=
0
;
if
(
_parObj
.
length
>
0
){
$
.
each
(
_parObj
,
function
(
i
,
v
)
{
console
.
count
(
'$v'
);
var
_$v
=
$
(
v
);
var
_agentId
=
_$v
.
attr
(
'data-agentid'
);
//经纪人id
var
_role
=
_$v
.
attr
(
'data-role'
);
//盘方等类型
var
_scaleVal
=
$
.
trim
(
_$v
.
find
(
'.detail-modal-maid-span-scale'
).
html
());
//分佣比例
var
_shouldCommissionVal
=
$
.
trim
(
_$v
.
find
(
'.detail-modal-maid-td-should-commission'
).
html
());
//应分佣金
var
_dataTemp
=
{
'bargain_id'
:
_$v
.
attr
(
'data-id'
),
//成交报告id
'last_commission_id'
:
_$v
.
attr
(
'lastid'
)?
_$v
.
attr
(
'lastid'
):
0
,
//最后一个提交的记录id
'is_account_commission'
:
type
//0是保存,1是确认分佣
};
if
(
_scaleVal
==
''
||
_shouldCommissionVal
==
''
){
_stopFlag
=
true
;
}
else
{
var
_parObj2
=
_$v
.
find
(
'.detail-modal-maid-mix-td>div'
);
if
(
_parObj2
.
length
>
0
){
$
.
each
(
_parObj2
,
function
(
i2
,
v2
)
{
console
.
count
(
'$v2'
);
var
_$v2
=
$
(
v2
);
var
_cid
=
_$v2
.
attr
(
'data-id'
);
_cid
=
_cid
?
_cid
:
0
;
//如果没有这个id,则为新增,传0
var
_sfyj
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-real-fee'
).
html
());
var
_sxf
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-service-charge'
).
html
());
var
_csjj
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-charity-fund'
).
html
());
var
_xjj
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-cash'
).
html
());
var
_ssyj
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-practical-fee'
).
html
());
if
(
_sfyj
==
''
||
_sxf
==
''
||
_csjj
==
''
||
_xjj
==
''
||
_ssyj
==
''
){
_stopFlag
=
true
;
}
else
{
_dataTemp
[
'commission_date['
+
i2
+
']'
]
=
{
'agent_id'
:
_agentId
,
//业务员id
'role'
:
_role
,
//盘方等角色类型
'scale'
:
Number
(
_scaleVal
),
//分佣比例
'should_commission'
:
_shouldCommissionVal
,
//应分佣金
'commission_id'
:
_cid
,
//子记录id
'real_fee'
:
_sfyj
,
//实分佣金
'service_charge'
:
_sxf
,
//手续费
'charity_fund'
:
_csjj
,
//慈善基金
'cash'
:
_xjj
,
//现金奖
'practical_fee'
:
_ssyj
//实收佣金
};
}
});
}
else
{
}
};
_data
.
push
(
_dataTemp
);
});
};
$
.
each
(
$
(
'.detail-modal-maid-span-scale'
),
function
(
i
,
v
)
{
_scaleTotal
+=
Number
(
$
.
trim
(
v
.
innerHTML
));
});
if
(
_scaleTotal
!=
100
){
_stopFlag
=
true
;
_errorTips
=
'分佣比例一定要是100%,否则无法提交'
;
};
return
{
'flag'
:
_stopFlag
,
'tips'
:
_errorTips
,
'list'
:
_data
}
},
maidConfirmOk
:
function
(
type
){
var
_back
=
bargain
.
maidTest
(
type
);
//获取处理的数据
if
(
!
_back
.
flag
){
var
_len
=
_back
.
list
.
length
;
!
function
funTemp
(
count
)
{
if
(
count
>=
_len
)
{
//如果递归执行完毕则执行这条
alert
(
type
===
0
?
'保存成功'
:
'确认成功'
);
bargain
.
maidShow
();
}
else
{
alert
(
'获取失败!'
);
$
.
ajax
({
type
:
'POST'
,
url
:
'/index/addRealIncome'
,
data
:
_back
.
list
[
count
],
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
funTemp
(
++
count
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
}
}
}(
0
);
}
else
{
alert
(
_back
.
tips
);
}
},
newAddTax
:
function
(
obj
)
{
var
_tempTableObj
=
$
(
'.addtax-modal-tax-table'
);
_tempTableObj
.
attr
(
'data-type'
,
obj
[
'type'
]);
var
_url
=
''
;
var
_data
=
{};
$
(
'#addtax_commission_input'
).
val
(
''
);
//开票金额置空
$
(
'#addtax_date'
).
val
(
''
);
//开票日期置空
if
(
obj
[
'type'
]
===
'new'
){
$
(
'#modal_new_tax .modal-title'
).
html
(
'新增开票'
);
_url
=
'/index/searchBargainAgents'
;
_data
[
'bargain_id'
]
=
bargain
.
bargain_id
;
}
else
{
$
(
'#modal_new_tax .modal-title'
).
html
(
'编辑开票'
);
_tempTableObj
.
attr
(
'data-recordid'
,
obj
[
'id'
]);
_url
=
'/index/getTaxesById'
;
_data
[
'taxes_id'
]
=
obj
[
'id'
];
};
$
.
ajax
({
type
:
'GET'
,
url
:
_url
,
data
:
_data
,
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
if
(
_data
[
'data'
]
&&
_data
[
'data'
].
length
&&
_data
[
'data'
].
length
>
0
){
$
(
'#addtax_commission_input'
).
val
(
_data
[
'data'
][
0
][
'total_fee'
]);
$
(
'#addtax_date'
).
val
(
_data
[
'data'
][
0
][
'operation_date'
]);
var
_htmlTemp
=
'<tr><td>分佣方</td><td>业务员</td><td>分佣比例</td><td>税费</td></tr>'
;
$
.
each
(
_data
[
'data'
],
function
(
i
,
v
)
{
_htmlTemp
+=
'<tr class="addtax-modal-tax-table-datatr" data-id="{id}" data-role="{role}"><td>{0}</td><td>{1}</td><td>{2}%</td><td contenteditable>{3}</td></tr>'
.
stringFormatObj
({
'0'
:
v
.
role_name
,
'1'
:
v
.
name
+
'-'
+
v
.
phone
,
'2'
:
v
.
scale
,
'3'
:
(
obj
[
'type'
]
===
'new'
)?
''
:
v
.
fee
,
'role'
:
v
.
role
,
'id'
:
v
.
id
});
});
$
(
'.addtax-modal-tax-table'
).
html
(
_htmlTemp
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
};
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
newCommission
:
function
()
{
//新增分佣提成
newAddTaxOk
:
function
(){
var
_tempTableObj
=
$
(
'.addtax-modal-tax-table'
);
var
_data
=
{
'bargain_id'
:
bargain
.
bargain_id
,
'total_fee'
:
$
.
trim
(
$
(
'#addtax_commission_input'
).
val
()),
'operation_date'
:
$
(
'#addtax_date'
).
val
()
};
if
(
_tempTableObj
.
attr
(
'data-type'
)
===
'edit'
){
_data
[
'id'
]
=
_tempTableObj
.
attr
(
'data-recordid'
);
};
$
.
each
(
$
(
'.addtax-modal-tax-table-datatr'
),
function
(
i
,
v
)
{
_data
[
'tax['
+
i
+
']'
]
=
{
'fee'
:
v
.
childNodes
[
3
].
innerHTML
,
'agent_id'
:
JSON
.
parse
(
decodeURIComponent
(
sessionStorage
.
getItem
(
'pcUserInfo'
))).
id
,
'role'
:
v
.
getAttribute
(
'data-role'
),
'scale'
:
v
.
childNodes
[
2
].
innerHTML
.
split
(
'%'
)[
0
]
};
if
(
_tempTableObj
.
attr
(
'data-type'
)
===
'edit'
){
_data
[
'tax['
+
i
+
']'
][
'fee_id'
]
=
v
.
getAttribute
(
'data-id'
);
};
});
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/addBargain'
,
data
:
{
"id"
:
business
.
house_id
,
"role"
:
$
(
"#is_carefully_chosen"
).
val
(),
"scale"
:
$
(
"#commission-rate"
).
val
(),
"scale_fee"
:
$
(
"#should-commission"
).
val
(),
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
console
.
log
(
666
);
}
}
else
{
alert
(
'获取失败!'
);
}
}
type
:
'POST'
,
url
:
'/index/addTallAge'
,
data
:
_data
,
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
alert
(
'新增成功!'
);
bargain
.
taxShow
();
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
// table切换
Information
:
function
()
{
$
(
".Tswitch"
).
eq
(
0
).
show
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-default"
);
$
(
"#information"
).
addClass
(
"btn-info"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
//转到一级审核
transFirstExamine
:
function
(){
$
.
ajax
({
type
:
'POST'
,
url
:
'/index/toReportListOne'
,
data
:
{
'bargain_id'
:
bargain
.
bargain_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
alert
(
'修改成功'
);
bargain
.
getList
(
1
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
Fees
:
function
()
{
$
(
".Tswitch"
).
eq
(
0
).
hide
();
$
(
".Tswitch"
).
eq
(
1
).
show
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-info"
);
$
(
"#information"
).
addClass
(
"btn-default"
);
$
(
"#fees"
).
removeClass
(
"btn-default"
);
$
(
"#fees"
).
addClass
(
"btn-info"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
account
:
function
(){
$
.
ajax
({
type
:
'POST'
,
url
:
'/index/checkOver'
,
data
:
{
'bargain_id'
:
bargain
.
bargain_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
alert
(
'结单成功!'
);
bargain
.
getList
(
1
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
getList
:
function
(
pageNo
)
{
business
.
pageNo
=
pageNo
;
//获取一级审核,二级审核,三级审核,结单不同的ajax请求url
// switchUrl: function(){
// switch (Number(this.mainTabIndex)){
// case 0:
// return '/index/reportListOne/1';
// case 1:
// return '/index/reportListTwo/2';
// case 2:
// return '/index/reportListThree/3';
// case 3:
// return '/index/reportListStatement/4';
// default:
// return '';
// }
// },
//获取一级审核,二级审核,三级审核,结单数据列表共用的方法
getList
:
function
(
pageNo
)
{
bargain
.
pageNo
=
pageNo
;
var
params
=
{};
params
.
pageNo
=
b
usiness
.
pageNo
;
params
.
pageSize
=
b
usiness
.
pageSize
;
params
.
pageNo
=
b
argain
.
pageNo
;
params
.
pageSize
=
b
argain
.
pageSize
;
params
.
create_time
=
$
(
'#create_time'
)
.
val
();
params
.
end_time
=
$
(
'#end_time'
)
.
val
();
params
.
internal_address
=
$
(
'#internal_address'
).
val
();
...
...
@@ -335,13 +1407,14 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
$
(
"#business_list"
).
html
(
doTtmpl
(
data
.
data
.
data
.
list
));
/*分页代码*/
add_page
(
data
.
data
.
data
.
total
,
pageNo
,
b
usiness
.
pageSize
,
business
.
getList
);
add_page
(
data
.
data
.
data
.
total
,
pageNo
,
b
argain
.
pageSize
,
bargain
.
getList
);
}
});
},
exportList
:
function
(
pageNo
)
{
exportList
:
function
(
pageNo
)
{
console
.
log
(
6
);
//导出分佣提成列表
b
usiness
.
pageNo
=
pageNo
;
b
argain
.
pageNo
=
pageNo
;
var
create_time
=
$
(
'#create_time'
).
val
();
var
end_time
=
$
(
'#end_time'
).
val
();
var
internal_address
=
$
(
'#internal_address'
).
val
();
...
...
@@ -351,7 +1424,6 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
window
.
open
(
'/index/exportExcel?create_time='
+
create_time
+
'&end_time='
+
end_time
+
'&internal_address='
+
internal_address
+
'&name='
+
agent
+
'&phone='
+
user_phone
+
'&house_number='
+
house_number
);
},
};
return
b
usiness
;
return
b
argain
;
});
\ No newline at end of file
public/resource/js/commissionTotal.js
View file @
ee67c7d1
define
([
'doT'
,
'text!temp/commissionTotal_template_tpl.html'
,
'css!style/home.css'
,
'ckfinder'
,
'ckfinderStart'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
business
=
{
pageNo
:
1
,
/*第几页*/
pageSize
:
10
,
/*每页显示多少条*/
id
:
''
,
house_id
:
''
,
type
:
''
,
valueCurrent
:
''
,
ajaxObj
:
''
,
stopstatus
:
true
,
ldHtml
:
$
(
'.phone_list'
),
boxphoto
:
''
,
exclusive_id
:
0
,
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
business
.
getList
();
business
.
event
();
},
event
:
function
()
{
var
_doc
=
$
(
document
);
$
(
"#search"
).
click
(
function
()
{
business
.
getList
(
1
);
});
$
(
"#export"
).
click
(
function
()
{
//导出列表
business
.
exportList
();
});
business
=
{
pageNo
:
1
,
/*第几页*/
pageSize
:
10
,
/*每页显示多少条*/
id
:
''
,
house_id
:
''
,
type
:
''
,
valueCurrent
:
''
,
ajaxObj
:
''
,
stopstatus
:
true
,
ldHtml
:
$
(
'.phone_list'
),
boxphoto
:
''
,
exclusive_id
:
0
,
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
business
.
getList
();
business
.
event
();
business
.
getDistrict
();
},
event
:
function
()
{
var
_doc
=
$
(
document
);
$
(
"#search"
).
click
(
function
()
{
business
.
getList
(
1
);
});
$
(
"#export"
).
click
(
function
()
{
//导出列表
business
.
exportList
();
});
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
});
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
});
$
(
document
).
delegate
(
".del_modal"
,
"click"
,
function
()
{
business
.
id
=
$
(
this
).
attr
(
"data-id"
);
$
(
document
).
delegate
(
".del_modal"
,
"click"
,
function
()
{
business
.
id
=
$
(
this
).
attr
(
"data-id"
);
});
$
(
document
).
delegate
(
".caozuo"
,
"click"
,
function
()
{
//点击操作记录
business
.
Caozuo
();
});
// 时间轴
$
(
document
).
delegate
(
".timeline"
,
"click"
,
function
()
{
//时间轴
// business.house_id = $ (this).attr ("data-id");
business
.
Timeline
();
});
// 编辑
$
(
document
).
delegate
(
".edit"
,
"click"
,
function
()
{
//点击编辑
business
.
house_id
=
$
(
this
).
attr
(
"data-id"
);
business
.
Edit
();
});
$
(
document
).
delegate
(
".is_pass"
,
"click"
,
function
()
{
//点击编辑
follow
.
house_id
=
$
(
this
).
attr
(
"data-id"
);
console
.
log
(
follow
.
house_id
);
});
$
(
document
).
delegate
(
"#confirm_edit"
,
"click"
,
function
()
{
//点击编辑确定
business
.
confirmEdit
();
});
$
(
document
).
delegate
(
"#new-commission"
,
"click"
,
function
()
{
//点击分佣提成
business
.
newCommission
();
business
.
Caozuo
();
});
//table切换
$
(
document
).
delegate
(
"#information"
,
"click"
,
function
()
{
business
.
Information
();
});
$
(
document
).
delegate
(
"#fees"
,
"click"
,
function
()
{
console
.
log
(
business
.
house_id
);
business
.
Fees
();
});
$
(
document
).
delegate
(
"#records"
,
"click"
,
function
()
{
business
.
Records
();
});
},
Timeline
:
function
()
{
//获取时间轴
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/selectReportAll'
,
data
:
{
"order_id"
:
business
.
house_id
});
$
(
document
).
delegate
(
".caozuo"
,
"click"
,
function
()
{
//点击操作记录
business
.
Caozuo
();
});
// 时间轴
$
(
document
).
delegate
(
".timeline"
,
"click"
,
function
()
{
//时间轴
// business.house_id = $ (this).attr ("data-id");
business
.
Timeline
();
});
// 编辑
$
(
document
).
delegate
(
".edit"
,
"click"
,
function
()
{
//点击编辑
business
.
house_id
=
$
(
this
).
attr
(
"data-id"
);
business
.
Edit
();
});
$
(
document
).
delegate
(
".is_pass"
,
"click"
,
function
()
{
//点击编辑
follow
.
house_id
=
$
(
this
).
attr
(
"data-id"
);
console
.
log
(
follow
.
house_id
);
});
$
(
document
).
delegate
(
"#confirm_edit"
,
"click"
,
function
()
{
//点击编辑确定
business
.
confirmEdit
();
});
$
(
document
).
delegate
(
"#new-commission"
,
"click"
,
function
()
{
//点击分佣提成
business
.
newCommission
();
business
.
Caozuo
();
});
//table切换
$
(
document
).
delegate
(
"#information"
,
"click"
,
function
()
{
business
.
Information
();
});
$
(
document
).
delegate
(
"#fees"
,
"click"
,
function
()
{
console
.
log
(
business
.
house_id
);
business
.
Fees
();
});
$
(
document
).
delegate
(
"#records"
,
"click"
,
function
()
{
business
.
Records
();
});
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
console
.
log
(
data
.
data
);
Timeline
:
function
()
{
//获取时间轴
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/selectReportAll'
,
data
:
{
"order_id"
:
business
.
house_id
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
console
.
log
(
data
.
data
);
}
}
else
{
alert
(
'获取失败!'
);
}
}
}
else
{
alert
(
'获取失败!'
);
}
}
});
},
Edit
:
function
()
{
//报告详情
$
(
".Tswitch"
).
eq
(
0
).
show
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-default"
);
$
(
"#information"
).
addClass
(
"btn-info"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
console
.
log
(
business
.
house_id
);
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/bargainInfo'
,
data
:
{
"id"
:
business
.
house_id
});
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
$
(
".create_time"
).
html
(
data
.
data
.
create_time
);
$
(
".user_phone"
).
html
(
data
.
data
.
user_phone
);
$
(
".user_name"
).
html
(
data
.
data
.
user_name
);
$
(
".internal_address"
).
html
(
data
.
data
.
internal_address
);
$
(
".internal_title"
).
html
(
data
.
data
.
internal_title
);
$
(
".commission"
).
val
(
data
.
data
.
commission
);
$
(
".practical_fee"
).
val
(
data
.
data
.
practical_fee
);
Edit
:
function
()
{
//报告详情
$
(
".Tswitch"
).
eq
(
0
).
show
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-default"
);
$
(
"#information"
).
addClass
(
"btn-info"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
console
.
log
(
business
.
house_id
);
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/bargainInfo'
,
data
:
{
"id"
:
business
.
house_id
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
$
(
".create_time"
).
html
(
data
.
data
.
create_time
);
$
(
".user_phone"
).
html
(
data
.
data
.
user_phone
);
$
(
".user_name"
).
html
(
data
.
data
.
user_name
);
$
(
".internal_address"
).
html
(
data
.
data
.
internal_address
);
$
(
".internal_title"
).
html
(
data
.
data
.
internal_title
);
$
(
".commission"
).
val
(
data
.
data
.
commission
);
$
(
".practical_fee"
).
val
(
data
.
data
.
practical_fee
);
}
}
else
{
alert
(
'获取失败!'
);
}
}
}
else
{
alert
(
'获取失败!'
);
}
}
});
},
confirmEdit
:
function
()
{
//修改报告详情
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/editBargainInfo'
,
data
:
{
"id"
:
business
.
house_id
,
"scale_fee"
:
$
(
".commission"
).
val
(),
"practical_fee"
:
$
(
".practical_fee"
).
val
()
});
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{}
}
else
{
alert
(
'获取失败!'
);
}
}
});
}
,
Caozuo
:
function
()
{
//分佣提成获取跟进详情的数据
console
.
log
(
business
);
console
.
log
(
business
.
house_id
);
$
.
ajax
(
{
'type'
:
'GET'
,
'url'
:
'/index/commissionList'
,
data
:
{
"id"
:
business
.
house_id
confirmEdit
:
function
()
{
//修改报告详情
$
.
ajax
(
{
'type'
:
'POST'
,
'url'
:
'/index/editBargainInfo'
,
data
:
{
"id"
:
business
.
house_id
,
"scale_fee"
:
$
(
".commission"
).
val
(),
"practical_fee"
:
$
(
".practical_fee"
).
val
()
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{}
}
else
{
alert
(
'获取失败!'
);
}
}
});
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
var
caozuo_table
=
""
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
caozuo_table
+=
'<tr><td>'
+
item
.
role
+
'</td><td>'
+
item
.
agent_name
+
'</td><td>'
+
item
.
store_name
+
'</td><td>'
+
item
.
scale
+
'</td><td>'
+
item
.
scale_fee
+
'</td><td>'
+
item
.
practical_fee
+
'</td><td>'
+
item
.
content
+
'</td></tr>'
;
});
$
(
"#caozuo_table"
).
html
(
caozuo_table
);
$
(
"#caozuo_table tr"
).
each
(
function
(
e
)
{
//不能为空
var
temp
=
$
(
"#caozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
6
).
html
();
//获取一列的值
if
(
temp
==
'null'
)
{
$
(
"#caozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
6
).
html
(
" "
)
Caozuo
:
function
()
{
//分佣提成获取跟进详情的数据
console
.
log
(
business
);
console
.
log
(
business
.
house_id
);
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/commissionList'
,
data
:
{
"id"
:
business
.
house_id
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
var
caozuo_table
=
""
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
caozuo_table
+=
'<tr><td>'
+
item
.
role
+
'</td><td>'
+
item
.
agent_name
+
'</td><td>'
+
item
.
store_name
+
'</td><td>'
+
item
.
scale
+
'</td><td>'
+
item
.
scale_fee
+
'</td><td>'
+
item
.
practical_fee
+
'</td><td>'
+
item
.
content
+
'</td></tr>'
;
});
$
(
"#caozuo_table"
).
html
(
caozuo_table
);
$
(
"#caozuo_table tr"
).
each
(
function
(
e
)
{
//不能为空
var
temp
=
$
(
"#caozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
6
).
html
();
//获取一列的值
if
(
temp
==
'null'
)
{
$
(
"#caozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
6
).
html
(
" "
)
}
});
}
});
}
else
{
alert
(
'获取失败!'
);
}
}
}
else
{
alert
(
'获取失败!'
);
}
}
});
},
Records
:
function
()
{
//分佣提成数据
$
(
".Tswitch"
).
eq
(
0
).
hide
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
show
();
$
(
"#information"
).
removeClass
(
"btn-info"
);
$
(
"#information"
).
addClass
(
"btn-default"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-default"
);
$
(
"#records"
).
addClass
(
"btn-info"
);
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/payLogList'
,
data
:
{
"id"
:
business
.
house_id
});
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
var
caozuo_table
=
""
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
caozuo_table
+=
'<tr><td>'
+
item
.
create_time
+
'</td><td>'
+
item
.
money
+
'</td><td>'
+
item
.
type
+
'</td><td>'
+
item
.
pay_type
+
'</td><td>'
+
item
.
agent_name
+
'</td></tr>'
;
});
$
(
"#tcaozuo_table"
).
html
(
caozuo_table
);
$
(
"#tcaozuo_table tr"
).
each
(
function
(
e
)
{
//不能为空
var
temp_one
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
4
).
html
();
var
temp
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
();
//获取一列的值
var
temp_two
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
();
// 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
if
(
temp
*
1
==
10
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"支付宝"
)
}
if
(
temp
*
1
==
20
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"微信"
)
}
if
(
temp
*
1
==
30
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"pos机器"
)
}
if
(
temp
*
1
==
40
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"转账"
)
}
if
(
temp
*
1
==
50
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"现金"
)
}
if
(
temp
*
1
==
60
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"其他"
)
}
Records
:
function
()
{
//分佣提成数据
$
(
".Tswitch"
).
eq
(
0
).
hide
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
show
();
$
(
"#information"
).
removeClass
(
"btn-info"
);
$
(
"#information"
).
addClass
(
"btn-default"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-default"
);
$
(
"#records"
).
addClass
(
"btn-info"
);
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/payLogList'
,
data
:
{
"id"
:
business
.
house_id
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
var
caozuo_table
=
""
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
caozuo_table
+=
'<tr><td>'
+
item
.
create_time
+
'</td><td>'
+
item
.
money
+
'</td><td>'
+
item
.
type
+
'</td><td>'
+
item
.
pay_type
+
'</td><td>'
+
item
.
agent_name
+
'</td></tr>'
;
});
$
(
"#tcaozuo_table"
).
html
(
caozuo_table
);
$
(
"#tcaozuo_table tr"
).
each
(
function
(
e
)
{
//不能为空
var
temp_one
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
4
).
html
();
var
temp
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
();
//获取一列的值
var
temp_two
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
();
// 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
if
(
temp
*
1
==
10
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"支付宝"
)
}
if
(
temp
*
1
==
20
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"微信"
)
}
if
(
temp
*
1
==
30
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"pos机器"
)
}
if
(
temp
*
1
==
40
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"转账"
)
}
if
(
temp
*
1
==
50
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"现金"
)
}
if
(
temp
*
1
==
60
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"其他"
)
}
// 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他
if
(
temp_two
*
1
==
10
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"意向金"
)
}
if
(
temp_two
*
1
==
20
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"定金"
)
}
if
(
temp_two
*
1
==
30
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"保管金"
)
}
if
(
temp_two
*
1
==
40
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"押金"
)
}
if
(
temp_two
*
1
==
50
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"租金"
)
}
if
(
temp_two
*
1
==
60
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"进场费"
)
}
if
(
temp_two
*
1
==
70
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"转让费"
)
}
if
(
temp_two
*
1
==
80
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"其他"
)
};
if
(
temp_one
==
'null'
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
4
).
html
(
" "
)
}
// 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他
if
(
temp_two
*
1
==
10
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"意向金"
)
}
if
(
temp_two
*
1
==
20
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"定金"
)
}
if
(
temp_two
*
1
==
30
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"保管金"
)
}
if
(
temp_two
*
1
==
40
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"押金"
)
}
if
(
temp_two
*
1
==
50
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"租金"
)
}
if
(
temp_two
*
1
==
60
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"进场费"
)
}
if
(
temp_two
*
1
==
70
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"转让费"
)
}
if
(
temp_two
*
1
==
80
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"其他"
)
};
if
(
temp_one
==
'null'
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
4
).
html
(
" "
)
}
});
});
}
}
else
{
alert
(
'获取失败!'
);
}
}
}
else
{
alert
(
'获取失败!'
);
}
}
});
},
newCommission
:
function
()
{
//新增分佣提成
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/addBargain'
,
data
:
{
"id"
:
business
.
house_id
,
"role"
:
$
(
"#is_carefully_chosen"
).
val
(),
"scale"
:
$
(
"#commission-rate"
).
val
(),
"scale_fee"
:
$
(
"#should-commission"
).
val
(),
});
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
console
.
log
(
666
);
newCommission
:
function
()
{
//新增分佣提成
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/addBargain'
,
data
:
{
"id"
:
business
.
house_id
,
"role"
:
$
(
"#is_carefully_chosen"
).
val
(),
"scale"
:
$
(
"#commission-rate"
).
val
(),
"scale_fee"
:
$
(
"#should-commission"
).
val
(),
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
console
.
log
(
666
);
}
}
else
{
alert
(
'获取失败!'
);
}
}
}
else
{
alert
(
'获取失败!'
);
}
}
});
},
// table切换
Information
:
function
()
{
$
(
".Tswitch"
).
eq
(
0
).
show
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-default"
);
$
(
"#information"
).
addClass
(
"btn-info"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
},
Fees
:
function
()
{
$
(
".Tswitch"
).
eq
(
0
).
hide
();
$
(
".Tswitch"
).
eq
(
1
).
show
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-info"
);
$
(
"#information"
).
addClass
(
"btn-default"
);
$
(
"#fees"
).
removeClass
(
"btn-default"
);
$
(
"#fees"
).
addClass
(
"btn-info"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
},
getList
:
function
(
pageNo
)
{
business
.
pageNo
=
pageNo
;
var
params
=
{};
params
.
pageNo
=
business
.
pageNo
;
params
.
pageSize
=
business
.
pageSize
;
params
.
name
=
$
(
'#user_name'
).
val
();
params
.
phone
=
$
(
'#user_phone'
).
val
();
params
.
commission_start_date
=
$
(
'#create_time'
).
val
();
params
.
commission_end_date
=
$
(
'#end_time'
).
val
();
params
.
deal_start_date
=
$
(
'#create_dealtime'
).
val
();
params
.
deal_end_date
=
$
(
'#end_dealtime'
).
val
();
params
.
operation_start_date
=
$
(
'#create_ticketTime'
).
val
();
params
.
operation_end_date
=
$
(
'#end_ticketTime'
).
val
();
params
.
district_id
=
$
(
'#user_phone'
).
val
();
params
.
store_name
=
$
(
'#store_name'
).
val
();
$
.
ajax
({
url
:
'/index/getCommissionTotalList'
,
//获取列表
type
:
'GET'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
console
.
log
(
data
);
var
temp
=
document
.
getElementById
(
'commissionTotal_list_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#business_list"
).
html
(
doTtmpl
(
data
.
data
.
list
));
console
.
log
(
data
.
data
.
list
);
});
},
// table切换
Information
:
function
()
{
$
(
".Tswitch"
).
eq
(
0
).
show
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-default"
);
$
(
"#information"
).
addClass
(
"btn-info"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
},
Fees
:
function
()
{
$
(
".Tswitch"
).
eq
(
0
).
hide
();
$
(
".Tswitch"
).
eq
(
1
).
show
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-info"
);
$
(
"#information"
).
addClass
(
"btn-default"
);
$
(
"#fees"
).
removeClass
(
"btn-default"
);
$
(
"#fees"
).
addClass
(
"btn-info"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
/*分页代码*/
add_page
(
data
.
data
.
total
,
pageNo
,
business
.
pageSize
,
business
.
getList
);
}
});
},
exportList
:
function
(
pageNo
)
{
business
.
pageNo
=
pageNo
;
var
create_time
=
$
(
'#create_time'
).
val
();
var
end_time
=
$
(
'#end_time'
).
val
();
var
internal_address
=
$
(
'#internal_address'
).
val
();
var
agent
=
$
(
'#user_name'
).
val
();
var
user_phone
=
$
(
'#user_phone'
).
val
();
var
house_number
=
$
(
'#internal_num'
).
val
();
window
.
open
(
'/index/exportExcel?create_time='
+
create_time
+
'&end_time='
+
end_time
+
'&internal_address='
+
internal_address
+
'&name='
+
agent
+
'&phone='
+
user_phone
+
'&house_number='
+
house_number
);
},
getList
:
function
(
pageNo
)
{
business
.
pageNo
=
pageNo
;
var
params
=
{};
params
.
pageNo
=
business
.
pageNo
;
params
.
pageSize
=
business
.
pageSize
;
params
.
name
=
$
(
'#user_name'
).
val
();
params
.
phone
=
$
(
'#user_phone'
).
val
();
params
.
commission_start_date
=
$
(
'#create_time'
).
val
();
params
.
commission_end_date
=
$
(
'#end_time'
).
val
();
params
.
deal_start_date
=
$
(
'#create_dealtime'
).
val
();
params
.
deal_end_date
=
$
(
'#end_dealtime'
).
val
();
params
.
operation_start_date
=
$
(
'#create_ticketTime'
).
val
();
params
.
operation_end_date
=
$
(
'#end_ticketTime'
).
val
();
params
.
district_id
=
$
(
"#qx-store option:selected"
).
val
();
//部门id 添加字段
params
.
store_name
=
$
(
'#store_name'
).
val
();
},
$
.
ajax
({
url
:
'/index/getCommissionTotalList'
,
//获取列表
type
:
'GET'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
console
.
log
(
data
);
var
temp
=
document
.
getElementById
(
'commissionTotal_list_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#business_list"
).
html
(
doTtmpl
(
data
.
data
.
list
));
console
.
log
(
data
.
data
.
list
);
};
return
business
;
});
\ No newline at end of file
/*分页代码*/
add_page
(
data
.
data
.
total
,
pageNo
,
business
.
pageSize
,
business
.
getList
);
}
});
},
getDistrict
:
function
(
name
)
{
$
.
ajax
({
url
:
'/index/getDistrictListByName'
,
type
:
'GET'
,
async
:
true
,
data
:
{
"pageSize"
:
50
},
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
var
_html
=
''
;
$
.
each
(
data
.
data
,
function
(
i
,
n
)
{
if
(
n
.
district_name
==
name
&&
(
typeof
name
!=
undefined
))
{
_html
+=
'<option value="'
+
n
.
id
+
'">'
+
n
.
district_name
+
'</option>'
;
}
else
{
_html
+=
'<option value="'
+
n
.
id
+
'">'
+
n
.
district_name
+
'</option>'
;
}
});
$
(
"#ss-store"
).
html
(
_html
);
$
(
"#qx-store"
).
append
(
_html
);
// $("#qx-store").html(_html);
}
else
{
alert
(
'获取部门信息失败'
);
}
}
});
},
exportList
:
function
(
pageNo
)
{
console
.
log
(
2
);
business
.
pageNo
=
pageNo
;
var
excel_two
=
1
;
var
name
=
$
(
'#user_name'
).
val
();
var
phone
=
$
(
'#user_phone'
).
val
();
var
commission_start_date
=
$
(
'#create_time'
).
val
();
var
commission_end_date
=
$
(
'#end_time'
).
val
();
var
deal_start_date
=
$
(
'#create_dealtime'
).
val
();
var
deal_end_date
=
$
(
'#end_dealtime'
).
val
();
var
operation_start_date
=
$
(
'#create_ticketTime'
).
val
();
var
operation_end_date
=
$
(
'#end_ticketTime'
).
val
();
// var district_id = $('#user_phone').val();
var
district_id
=
$
(
"#qx-store option:selected"
).
val
();
//部门id 添加字段
var
store_name
=
$
(
'#store_name'
).
val
();
window
.
open
(
'/index/getCommissionTotalList?'
+
'excel = '
+
excel_two
+
' &name = '
+
name
+
' &phone = '
+
phone
+
' &commission_start_date = '
+
commission_start_date
+
'& commission_end_date = '
+
commission_end_date
+
' &deal_start_date = '
+
deal_start_date
+
' &deal_end_date = '
+
deal_end_date
+
' &operation_start_date = '
+
operation_start_date
+
' &operation_end_date = '
+
operation_end_date
+
' &district_id = '
+
district_id
+
' &store_name = '
+
store_name
);
},
};
return
business
;
});
\ No newline at end of file
public/resource/js/public.js
View file @
ee67c7d1
...
...
@@ -139,10 +139,10 @@ function is_mobile(text) {
//处理金额的数字,最多三位小数
function
dealJineNum
(
num
){
if
(
isFinite
(
num
)){
if
(
parseInt
(
num
)
==
num
||
num
.
toString
().
split
(
"."
)[
1
].
length
<
4
){
if
(
parseInt
(
num
)
==
num
||
num
.
toString
().
split
(
"."
)[
1
].
length
<
3
){
return
num
;
}
else
{
return
Number
((
num
).
toFixed
(
3
));
return
Number
((
num
).
toFixed
(
2
));
}
}
else
{
return
0
;
...
...
public/resource/js/reportList.js
View file @
ee67c7d1
...
...
@@ -356,7 +356,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_id
=
_this
.
closest
(
'tr'
).
data
(
'id'
);
var
_id
=
_this
.
closest
(
'tr'
).
data
(
'
order
id'
);
console
.
log
(
_id
);
$
(
'.iframe-time-line'
).
attr
(
'src'
,
'/app_broker/timeline_pc?order_id='
+
_id
);
});
...
...
@@ -839,13 +839,14 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
$
(
'#addtax_date'
).
val
(
_data
[
'data'
][
0
][
'operation_date'
]);
var
_htmlTemp
=
'<tr><td>分佣方</td><td>业务员</td><td>分佣比例</td><td>税费</td></tr>'
;
$
.
each
(
_data
[
'data'
],
function
(
i
,
v
)
{
_htmlTemp
+=
'<tr class="addtax-modal-tax-table-datatr" data-id="{id}" data-role="{role}"><td>{0}</td><td>{1}</td><td>{2}%</td><td contenteditable>{3}</td></tr>'
.
stringFormatObj
({
_htmlTemp
+=
'<tr class="addtax-modal-tax-table-datatr" data-
feeid="{feeid}" data-agent
id="{id}" data-role="{role}"><td>{0}</td><td>{1}</td><td>{2}%</td><td contenteditable>{3}</td></tr>'
.
stringFormatObj
({
'0'
:
v
.
role_name
,
'1'
:
v
.
name
+
'-'
+
v
.
phone
,
'2'
:
v
.
scale
,
'3'
:
(
obj
[
'type'
]
===
'new'
)?
''
:
v
.
fee
,
'role'
:
v
.
role
,
'id'
:
v
.
id
'id'
:
v
.
agent_id
,
'feeid'
:
v
.
id
});
});
$
(
'.addtax-modal-tax-table'
).
html
(
_htmlTemp
);
...
...
@@ -883,12 +884,12 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
$
.
each
(
$
(
'.addtax-modal-tax-table-datatr'
),
function
(
i
,
v
)
{
_data
[
'tax['
+
i
+
']'
]
=
{
'fee'
:
v
.
childNodes
[
3
].
innerHTML
,
'agent_id'
:
JSON
.
parse
(
decodeURIComponent
(
sessionStorage
.
getItem
(
'pcUserInfo'
))).
id
,
'agent_id'
:
v
.
getAttribute
(
'data-agentid'
)
,
'role'
:
v
.
getAttribute
(
'data-role'
),
'scale'
:
v
.
childNodes
[
2
].
innerHTML
.
split
(
'%'
)[
0
]
};
if
(
_tempTableObj
.
attr
(
'data-type'
)
===
'edit'
){
_data
[
'tax['
+
i
+
']'
][
'fee_id'
]
=
v
.
getAttribute
(
'data-id'
);
_data
[
'tax['
+
i
+
']'
][
'fee_id'
]
=
v
.
getAttribute
(
'data-
fee
id'
);
};
});
$
.
ajax
({
...
...
@@ -1010,6 +1011,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
'pageNo'
:
pageNo
,
'pageSize'
:
bargain
.
pageSize
,
'create_time'
:
$
.
trim
(
$
(
'#maintable_create_time'
).
val
()),
'end_time'
:
$
.
trim
(
$
(
'#maintable_end_time'
).
val
()),
'internal_address'
:
$
.
trim
(
$
(
'#maintable_internal_address'
).
val
()),
'user_phone'
:
$
.
trim
(
$
(
'#maintable_user_phone'
).
val
()),
'house_number'
:
$
.
trim
(
$
(
'#maintable_shop_num'
).
val
())
...
...
public/resource/js/tax.js
View file @
ee67c7d1
define
([
'doT'
,
'text!temp/tax_template_tpl.html'
,
'css!style/home.css'
,
'ckfinder'
,
'ckfinderStart'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
business
=
{
//define(['doT', 'text!temp/tax_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
// business = {
// pageNo: 1,
// /*第几页*/
// pageSize: 10,
// /*每页显示多少条*/
// id: '',
// house_id: '',
// type: '',
// valueCurrent: '',
// ajaxObj: '',
// stopstatus: true,
// ldHtml: $('.phone_list'),
// boxphoto: '',
// exclusive_id: 0,
// init: function() {
// //初始化dot
// $("body").append(template);
// business.getList();
// business.event();
// },
// event: function() {
// var _doc = $(document);
// $("#search").click(function() {
// business.getList(1);
// });
// $("#export").click(function() { //导出列表
// business.exportList();
// });
//
// $("#reset").click(function() { //重置
// document.getElementById("form_search").reset();
// });
//
// $(document).delegate(".del_modal", "click", function() {
// business.id = $(this).attr("data-id");
//
// });
// $(document).delegate(".caozuo", "click", function() { //点击操作记录
// business.Caozuo();
// });
// // 时间轴
// $(document).delegate(".timeline", "click", function() { //时间轴
// // business.house_id = $ (this).attr ("data-id");
// business.Timeline();
// });
// // 编辑
// $(document).delegate(".edit", "click", function() { //点击编辑
// business.house_id = $(this).attr("data-id");
// business.Edit();
// });
// $(document).delegate(".is_pass", "click", function() { //点击编辑
// follow.house_id = $(this).attr("data-id");
// console.log(follow.house_id);
// });
// $(document).delegate("#confirm_edit", "click", function() { //点击编辑确定
// business.confirmEdit();
// });
// $(document).delegate("#new-commission", "click", function() { //点击分佣提成
// business.newCommission();
// business.Caozuo();
// });
// //table切换
// $(document).delegate("#information", "click", function() {
// business.Information();
// });
// $(document).delegate("#fees", "click", function() {
// console.log(business.house_id);
// business.Fees();
// });
// $(document).delegate("#records", "click", function() {
// business.Records();
// });
// },
// Timeline: function() { //获取时间轴
// $.ajax({
// 'type': 'GET',
// 'url': '/index/selectReportAll',
// data: {
// "order_id": business.house_id
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// console.log(data.data);
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// Edit: function() { //报告详情
// $(".Tswitch").eq(0).show();
// $(".Tswitch").eq(1).hide();
// $(".Tswitch").eq(2).hide();
// $("#information").removeClass("btn-default");
// $("#information").addClass("btn-info");
// $("#fees").removeClass("btn-info");
// $("#fees").addClass("btn-default");
// $("#records").removeClass("btn-info");
// $("#records").addClass("btn-default");
// console.log(business.house_id);
// $.ajax({
// 'type': 'GET',
// 'url': '/index/bargainInfo',
// data: {
// "id": business.house_id
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// $(".create_time").html(data.data.create_time);
// $(".user_phone").html(data.data.user_phone);
// $(".user_name").html(data.data.user_name);
// $(".internal_address").html(data.data.internal_address);
// $(".internal_title").html(data.data.internal_title);
// $(".commission").val(data.data.commission);
// $(".practical_fee").val(data.data.practical_fee);
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// confirmEdit: function() { //修改报告详情
// $.ajax({
// 'type': 'POST',
// 'url': '/index/editBargainInfo',
// data: {
// "id": business.house_id,
// "scale_fee": $(".commission").val(),
// "practical_fee": $(".practical_fee").val()
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {}
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// Caozuo: function() { //分佣提成获取跟进详情的数据
// console.log(business);
// console.log(business.house_id);
// $.ajax({
// 'type': 'GET',
// 'url': '/index/commissionList',
// data: {
// "id": business.house_id
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// var caozuo_table = "";
// $.each(data['data'], function(i, item) {
// caozuo_table += '<tr><td>' + item.role + '</td><td>' + item.agent_name + '</td><td>' + item.store_name +
// '</td><td>' + item.scale + '</td><td>' + item.scale_fee + '</td><td>' + item.practical_fee + '</td><td>' + item.content + '</td></tr>';
// });
// $("#caozuo_table").html(caozuo_table);
// $("#caozuo_table tr").each(function(e) { //不能为空
// var temp = $("#caozuo_table").find("tr").eq(e).find("td").eq(6).html(); //获取一列的值
// if(temp == 'null') {
// $("#caozuo_table").find("tr").eq(e).find("td").eq(6).html(" ")
// }
// });
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// Records: function() { //分佣提成数据
// $(".Tswitch").eq(0).hide();
// $(".Tswitch").eq(1).hide();
// $(".Tswitch").eq(2).show();
// $("#information").removeClass("btn-info");
// $("#information").addClass("btn-default");
// $("#fees").removeClass("btn-info");
// $("#fees").addClass("btn-default");
// $("#records").removeClass("btn-default");
// $("#records").addClass("btn-info");
// $.ajax({
// 'type': 'GET',
// 'url': '/index/payLogList',
// data: {
// "id": business.house_id
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// var caozuo_table = "";
// $.each(data['data'], function(i, item) {
// caozuo_table += '<tr><td>' + item.create_time + '</td><td>' + item.money + '</td><td>' + item.type +
// '</td><td>' + item.pay_type + '</td><td>' + item.agent_name + '</td></tr>';
// });
// $("#tcaozuo_table").html(caozuo_table);
// $("#tcaozuo_table tr").each(function(e) { //不能为空
// var temp_one = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(4).html();
// var temp = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html(); //获取一列的值
// var temp_two = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html();
// // 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
// if(temp * 1 == 10) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("支付宝")
// }
// if(temp * 1 == 20) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("微信")
// }
// if(temp * 1 == 30) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("pos机器")
// }
// if(temp * 1 == 40) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("转账")
// }
// if(temp * 1 == 50) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("现金")
// }
// if(temp * 1 == 60) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("其他")
// }
//
// // 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他
// if(temp_two * 1 == 10) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("意向金")
// }
// if(temp_two * 1 == 20) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("定金")
// }
// if(temp_two * 1 == 30) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("保管金")
// }
// if(temp_two * 1 == 40) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("押金")
// }
// if(temp_two * 1 == 50) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("租金")
// }
// if(temp_two * 1 == 60) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("进场费")
// }
// if(temp_two * 1 == 70) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("转让费")
// }
// if(temp_two * 1 == 80) {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("其他")
// };
// if(temp_one == 'null') {
// $("#tcaozuo_table").find("tr").eq(e).find("td").eq(4).html(" ")
// }
//
// });
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// newCommission: function() { //新增分佣提成
// $.ajax({
// 'type': 'POST',
// 'url': '/index/addBargain',
// data: {
// "id": business.house_id,
// "role": $("#is_carefully_chosen").val(),
// "scale": $("#commission-rate").val(),
// "scale_fee": $("#should-commission").val(),
// },
// dataType: "json",
// success: function(data) {
// if(data.code == 200) {
// if(data.data) {
// console.log(666);
// }
// } else {
// alert('获取失败!');
// }
// }
// });
// },
// // table切换
// Information: function() {
// $(".Tswitch").eq(0).show();
// $(".Tswitch").eq(1).hide();
// $(".Tswitch").eq(2).hide();
// $("#information").removeClass("btn-default");
// $("#information").addClass("btn-info");
// $("#fees").removeClass("btn-info");
// $("#fees").addClass("btn-default");
// $("#records").removeClass("btn-info");
// $("#records").addClass("btn-default");
// },
// Fees: function() {
// $(".Tswitch").eq(0).hide();
// $(".Tswitch").eq(1).show();
// $(".Tswitch").eq(2).hide();
// $("#information").removeClass("btn-info");
// $("#information").addClass("btn-default");
// $("#fees").removeClass("btn-default");
// $("#fees").addClass("btn-info");
// $("#records").removeClass("btn-info");
// $("#records").addClass("btn-default");
//
// },
// getList: function(pageNo) {
// business.pageNo = pageNo;
// var params = {};
// params.pageNo = business.pageNo;
// params.pageSize = business.pageSize;
// params.create_time = $('#create_time') .val();
// params.end_time = $('#end_time') .val();
// params.internal_address = $('#internal_address').val();
// params.name = $('#user_name').val();
// params.phone = $('#user_phone').val();
// params.house_number = $('#internal_num').val();
//
//
// $.ajax({
// url: '/index/getTallAgeList', //获取列表
// type: 'GET',
// async: true,
// data: params,
// dataType: 'json',
// success: function(data) {
//// console.log(data);
// var temp = document.getElementById('tax_list_tpl').innerHTML;
// var doTtmpl = doT.template(temp);
// $("#business_list").html(doTtmpl(data.data.list));
// $("#taxTotal").html(data.data.total_fee);
//
// /*分页代码*/
// add_page(data.data.total, pageNo, business.pageSize, business.getList);
// //总的税费
//
//
// }
// });
// },
// exportList: function(pageNo) {
// business.pageNo = pageNo;
// var create_time = $('#create_time').val();
// var end_time = $('#end_time').val();
// var internal_address = $('#internal_address').val();
// var agent = $('#user_name').val();
// var user_phone = $('#user_phone').val();
// var house_number = $('#internal_num').val();
// window.open('/index/exportExcel?create_time=' + create_time + '&end_time=' + end_time + '&internal_address=' + internal_address + '&name=' + agent + '&phone=' + user_phone + '&house_number=' + house_number);
//
// },
//
// };
// return business;
//});
define
([
'doT'
,
'text!temp/tax_template_tpl.html'
,
'text!temp/reportList_shuiFee_template_tpl.html'
,
'text!temp/reportList_maidtwo_template_tpl.html'
,
'text!temp/reportList_maid_sub1_template_tpl.html'
,
'css!style/home.css'
,
'css!style/report_list.css'
,
'ckfinder'
,
'ckfinderStart'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
,
template_tax
,
template_maid
,
template_maid_sub1
)
{
bargain
=
{
pageNo
:
1
,
/*第几页*/
pageSize
:
10
,
/*每页显示多少条*/
id
:
''
,
house_id
:
''
,
type
:
''
,
valueCurrent
:
''
,
ajaxObj
:
''
,
stopstatus
:
true
,
ldHtml
:
$
(
'.phone_list'
),
boxphoto
:
''
,
exclusive_id
:
0
,
mainTabIndex
:
0
,
detailTabIndex
:
0
,
bargain_id
:
''
,
father_id
:
''
,
order_id
:
0
,
//订单id
panfangData
:
null
,
maidTotalCommission
:
0
,
//应收总佣金
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
b
usiness
.
getList
(
);
b
usiness
.
event
();
$
(
document
.
body
).
append
(
template
+
template_tax
+
template_maid
+
template_maid_sub1
);
b
argain
.
getList
(
1
);
b
argain
.
event
();
},
event
:
function
()
{
var
_doc
=
$
(
document
);
$
(
"#search"
).
click
(
function
()
{
business
.
getList
(
1
);
$
(
"#search"
).
click
(
function
()
{
bargain
.
getList
(
1
);
});
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
});
//主页面一级审核,二级审核,三级审核,结单四个tab的点击事件
//专员审核 总监审核 经理审核 出纳审核
_doc
.
on
(
'click'
,
'.maintable-top-sub-tr>a'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
_this
.
removeClass
(
'btn-default'
).
addClass
(
'btn-info'
).
siblings
().
removeClass
(
'btn-info'
).
addClass
(
'btn-default'
);
bargain
.
mainTabIndex
=
_this
.
index
();
console
.
log
(
bargain
.
mainTabIndex
);
bargain
.
getList
(
1
);
});
$
(
"#export"
).
click
(
function
()
{
//导出列表
b
usiness
.
exportList
();
b
argain
.
exportList
();
});
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
//搜索按钮的事件
_doc
.
on
(
'click'
,
'#maintable_search'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
getList
(
1
);
//一级审核搜索
});
$
(
document
).
delegate
(
".del_modal"
,
"click"
,
function
()
{
business
.
id
=
$
(
this
).
attr
(
"data-id"
);
//搜索的重置
$
(
"#maintable_reset"
).
click
(
function
()
{
document
.
getElementById
(
"maintable_form_search"
).
reset
();
});
//时间轴按钮
_doc
.
on
(
"click"
,
".timeline"
,
function
()
{
bargain
.
Timeline
();
});
//转到一级审核
_doc
.
on
(
'click'
,
'.maintable-btn-trans-one'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
bargain_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-id"
);
layer
.
open
({
content
:
'确定转到一级审核?'
,
btn
:
[
'确定'
,
'取消'
],
yes
:
function
(
_index
){
bargain
.
transFirstExamine
();
layer
.
close
(
_index
);
}
});
});
//结单
_doc
.
on
(
'click'
,
'.maintable-btn-account'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
bargain_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-id"
);
layer
.
open
({
content
:
'确定结单?'
,
btn
:
[
'确定'
,
'取消'
],
yes
:
function
(
_index
){
bargain
.
account
();
layer
.
close
(
_index
);
}
});
});
//点击通过,修改全局bargain_id,弹出框出来
_doc
.
on
(
'click'
,
'[href=
\
"#modal-pass
\
"]'
,
function
()
{
bargain
.
bargain_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-id"
);
});
//点击通过,确定按钮触发的事件
_doc
.
on
(
'click'
,
'#pass_ok_btn'
,
function
()
{
bargain
.
pass
();
});
//点击获取报告详情
_doc
.
on
(
'click'
,
'.details-btn'
,
function
()
{
bargain
.
bargain_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-id"
);
bargain
.
father_id
=
$
(
this
).
closest
(
'tr'
).
attr
(
"data-fatherid"
);
console
.
log
(
bargain
.
bargain_id
);
console
.
log
(
bargain
.
father_id
);
$
(
'.detail-modal-header-tab>a:nth-of-type(1)'
).
removeClass
(
'btn-default'
).
addClass
(
'btn-info'
).
siblings
().
removeClass
(
'btn-info'
).
addClass
(
'btn-default'
);
bargain
.
detailTabIndex
=
0
;
$
(
'.detail-modal-body-sec:nth-of-type(1)'
).
show
().
siblings
().
hide
();
bargain
.
bargaininfoShow
();
});
//详情弹出框里的tab点击事件,成交信息,分佣提成,开票税费
_doc
.
on
(
'click'
,
'.detail-modal-header-tab>a'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
_this
.
removeClass
(
'btn-default'
).
addClass
(
'btn-info'
).
siblings
().
removeClass
(
'btn-info'
).
addClass
(
'btn-default'
);
bargain
.
detailTabIndex
=
_this
.
index
();
$
(
'.detail-modal-body-sec:nth-of-type('
+
(
bargain
.
detailTabIndex
+
1
)
+
')'
).
show
().
siblings
().
hide
();
if
(
bargain
.
detailTabIndex
==
0
){
bargain
.
bargaininfoShow
();
}
else
if
(
bargain
.
detailTabIndex
==
1
){
bargain
.
maidShow
();
}
else
{
bargain
.
taxShow
();
}
});
//详情弹出框,成交信息里的实收佣金相关的事件
var
_iYJAAObj
=
$
(
'.detail-modal-bargaininfo-commission-addarea'
);
_doc
.
on
(
'click'
,
'#bargaininfo_commission_add_btn>img'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
$
(
'.detail-modal-bargaininfo-commission-addarea>div'
).
length
>=
5
){
alert
(
'最多添加5条'
);
return
false
;
}
else
{
_iYJAAObj
.
append
(
'<div class="form-group detail-modal-bargaininfo-commission-sec"><label class="">实收佣金:</label><div class="input-group"><input type="number"class="form-control"placeholder="请输入"><div class="input-group-addon">元</div></div><label class="">收佣日期:</label><div class="input-group"><input type="date"class="form-control"placeholder="请输入"></div><mark href="javascript:;"class="detail-modal-bargaininfo-commission-cancel-pic"><img src="/resource/image/search_gb.png"/></mark></div>'
);
};
});
//详情弹出框,成交信息里的实收佣金相关的事件,点击x删除这条
_doc
.
on
(
'click'
,
'.detail-modal-bargaininfo-commission-cancel-pic'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
this
).
parent
().
remove
();
});
//详情弹出框,点击成交信息确定
_doc
.
delegate
(
"#bargaininfo_btn_save"
,
"click"
,
function
()
{
bargain
.
bargaininfoSave
();
});
//详情弹出框,点击开票税费下的新增税费,弹出框出来
_doc
.
on
(
'click'
,
'[href=
\
"#modal_new_tax
\
"]'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
bargain
.
newAddTax
({
'type'
:
_this
.
attr
(
'data-recordid'
)?
'edit'
:
'new'
,
'id'
:
_this
.
attr
(
'data-recordid'
)
});
});
//详情弹出框,新增开票税费,金额输入框输入后,自动计算税费
_doc
.
on
(
'input'
,
'#addtax_commission_input'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_trObj
=
$
(
'.addtax-modal-tax-table-datatr'
);
$
.
each
(
_trObj
,
function
(
i
,
v
)
{
v
.
childNodes
[
3
].
innerHTML
=
dealJineNum
(
Number
(
v
.
childNodes
[
2
].
innerHTML
.
split
(
'%'
)[
0
])
*
0.01
*
Number
(
$
.
trim
(
_this
.
val
()))
*
0.1
);
});
});
$
(
document
).
delegate
(
".caozuo"
,
"click"
,
function
()
{
//点击操作记录
business
.
Caozuo
();
//详情弹出框,新增开票税费,点击确定时的提交
_doc
.
on
(
'click'
,
'#addtax_commission_addok'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
newAddTaxOk
();
});
// 时间轴
$
(
document
).
delegate
(
".timeline"
,
"click"
,
function
()
{
//时间轴
// business.house_id = $ (this).attr ("data-id");
business
.
Timeline
();
//详情弹出框,分佣提成里,点击新增
_doc
.
on
(
'click'
,
'[href="#modal_new_maid"]'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
newAddMaid
();
});
// 编辑
$
(
document
).
delegate
(
".edit"
,
"click"
,
function
()
{
//点击编辑
business
.
house_id
=
$
(
this
).
attr
(
"data-id"
);
business
.
Edit
();
//详情弹出框,分佣提成里,点击新增,分佣方选择时触发的事件
_doc
.
on
(
'input'
,
'#addmaid_input_servant'
,
function
(
e
){
var
_this
=
$
(
this
);
$
(
'#addmaid_input_ywy'
).
val
(
''
);
//先置空
$
(
'#addmaid_input_shop'
).
val
(
''
);
//先置空
if
(
_this
.
val
()
===
''
){
}
else
if
(
_this
.
val
()
===
'5'
){
}
else
{
var
_rateTemp
=
bargain
.
getDefaultRadio
(
_this
.
val
());
$
(
'#addmaid_input_ratio'
).
val
(
_rateTemp
);
$
(
'#addmaid_input_cash'
).
val
(
dealJineNum
(
_rateTemp
*
bargain
.
maidTotalCommission
/
100
));
var
_arrTemp
=
bargain
.
panfangData
.
filter
(
function
(
item
,
index
,
array
){
return
(
item
.
role
==
_this
.
val
());
});
if
(
_arrTemp
.
length
===
0
){
return
false
;
}
else
if
(
_arrTemp
.
length
===
1
){
$
(
'#addmaid_input_ywy'
).
val
(
_arrTemp
[
0
].
name
+
'-'
+
_arrTemp
[
0
].
phone
).
attr
(
'data-id'
,
_arrTemp
[
0
].
id
);
bargain
.
getDepart
(
_arrTemp
[
0
].
id
,
function
(
obj
){
$
(
'#addmaid_input_shop'
).
val
(
obj
.
district_name
+
'-'
+
obj
.
store_name
);
});
}
else
{
$
(
'[href="#modal_new_maid_select"]'
).
click
();
var
_tempHtml
=
''
;
$
.
each
(
_arrTemp
,
function
(
i
,
v
)
{
_tempHtml
+=
'<li data-data="{data}">{0}-{1}</li>'
.
stringFormatObj
({
'data'
:
encodeURIComponent
(
JSON
.
stringify
(
v
)),
'0'
:
v
.
name
,
'1'
:
v
.
phone
});
});
$
(
'#addmaid_select_ul'
).
html
(
_tempHtml
);
}
}
});
$
(
document
).
delegate
(
".is_pass"
,
"click"
,
function
()
{
//点击编辑
follow
.
house_id
=
$
(
this
).
attr
(
"data-id"
);
console
.
log
(
follow
.
house_id
);
//详情弹出框,分佣提成里,点击新增,分佣方选择,弹出选择列表触发的事件
_doc
.
on
(
'click'
,
'#addmaid_select_ul>li'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_dataTemp
=
JSON
.
parse
(
decodeURIComponent
(
_this
.
attr
(
'data-data'
)));
$
(
'#addmaid_input_ywy'
).
val
(
_dataTemp
.
name
+
'-'
+
_dataTemp
.
phone
).
attr
(
'data-id'
,
_dataTemp
.
id
);
bargain
.
getDepart
(
_dataTemp
.
id
,
function
(
obj
){
$
(
'#addmaid_input_shop'
).
val
(
obj
.
district_name
+
'-'
+
obj
.
store_name
);
});
_this
.
closest
(
'.modal-content'
).
find
(
'button.close'
).
click
();
});
$
(
document
).
delegate
(
"#confirm_edit"
,
"click"
,
function
()
{
//点击编辑确定
business
.
confirmEdit
();
//详情弹出框,分佣提成里,点击新增,点击保存触发的事件
_doc
.
on
(
'click'
,
'#addmaid_ok_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
bargain
.
newAddMaidOk
();
});
$
(
document
).
delegate
(
"#new-commission"
,
"click"
,
function
()
{
//点击分佣提成
business
.
newCommission
();
business
.
Caozuo
();
//详情弹出框,分佣提成里,点击确认分佣触发的事件
_doc
.
on
(
'click'
,
'#maid_ok_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
bargain
.
mainTabIndex
===
2
){
bargain
.
maidConfirmOk
(
1
);
}
else
{
alert
(
'财务第三级审核人员才能确认分佣!'
);
}
});
//table切换
$
(
document
).
delegate
(
"#information"
,
"click"
,
function
()
{
business
.
Information
();
//详情弹出框,分佣提成里,点击保存触发的事件
_doc
.
on
(
'click'
,
'#maid_save_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
// bargain.maidSave();
bargain
.
maidConfirmOk
(
0
);
});
$
(
document
).
delegate
(
"#fees"
,
"click"
,
function
()
{
console
.
log
(
business
.
house_id
);
business
.
Fees
();
//详情弹出框,分佣提成里,点击增加实收按钮
_doc
.
on
(
'click'
,
'#maid_new_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_temp
=
$
(
'.detail-modal-maid-span-time'
);
var
_flag
=
false
;
if
(
_temp
&&
_temp
.
length
&&
_temp
.
length
>
0
){
$
.
each
(
_temp
,
function
(
i
,
v
)
{
if
(
v
.
innerHTML
==
''
){
_flag
=
true
;
return
false
;
};
});
};
if
(
_flag
){
alert
(
'前边一组收佣尚未确认分佣或成交信息里没有对应的实收佣金'
);
}
else
{
layer
.
open
({
content
:
'确认增加吗?'
,
btn
:
[
'确定'
,
'取消'
],
yes
:
function
(
_index
){
$
(
'.detail-modal-maid-mix-td'
).
append
(
document
.
getElementById
(
'reportList_maid_sub1_list_tpl'
).
innerHTML
);
layer
.
close
(
_index
);
}
});
};
});
$
(
document
).
delegate
(
"#records"
,
"click"
,
function
()
{
business
.
Records
();
//新增分佣提成,业务员input输入搜索,点击之后赋值
_doc
.
on
(
'click'
,
'#addmaid_input_ywy+ul>li'
,
function
()
{
var
_this
=
$
(
this
);
var
_id
=
_this
.
attr
(
'data-id'
);
_this
.
parent
().
prev
().
val
(
_this
.
html
()).
attr
(
'data-id'
,
_id
);
bargain
.
getDepart
(
_id
,
function
(
obj
){
$
(
'#addmaid_input_shop'
).
val
(
obj
.
district_name
+
'-'
+
obj
.
store_name
);
});
_this
.
parent
().
html
(
''
).
hide
();
});
//新增分佣提成,业务员input输入搜索
var
_ajaxObjTel
=
null
;
var
_addmaid_input_servantObj
=
$
(
'#addmaid_input_servant'
);
_doc
.
on
(
'input'
,
'#addmaid_input_ywy'
,
function
()
{
var
_this
=
$
(
this
);
if
(
_addmaid_input_servantObj
.
val
()
==
'5'
){
//当分佣方的值为5,合作方的时候,才能查询
var
_thisVal
=
$
.
trim
(
_this
.
val
());
_this
.
removeAttr
(
'data-id'
);
//移除之前携带的信息
if
(
_thisVal
!=
''
)
{
_ajaxObjTel
&&
_ajaxObjTel
.
abort
();
_ajaxObjTel
=
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/getBroker_new'
,
data
:
{
'phone'
:
$
.
trim
(
_this
.
val
())
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
if
(
data
[
'data'
].
length
>
0
)
{
var
_htmlTemp
=
''
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
_htmlTemp
+=
'<li data-id="{3}">{0}-{1}<li>'
.
stringFormatObj
({
'0'
:
item
[
'name'
],
'1'
:
item
[
'phone'
],
'3'
:
item
[
'id'
]
});
});
_this
.
next
().
show
().
html
(
_htmlTemp
);
}
else
{
_this
.
next
().
html
(
''
);
};
}
else
{
alert
(
data
[
'msg'
]);
};
}
else
{
alert
(
'数据错误'
);
};
},
error
:
function
()
{
//alert('error');
},
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
alert
(
'请求超时'
);
};
}
});
}
else
{
_this
.
next
().
hide
();
}
}
else
{}
});
//时间轴点击事件
_doc
.
on
(
'click'
,
'a[href="#modal-time"]'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_id
=
_this
.
closest
(
'tr'
).
data
(
'orderid'
);
console
.
log
(
_id
);
$
(
'.iframe-time-line'
).
attr
(
'src'
,
'/app_broker/timeline_pc?order_id='
+
_id
);
});
},
getDefaultRadio
:
function
(
v
){
switch
(
Number
(
v
)){
case
1
:
return
25
;
case
2
:
return
30
;
case
3
:
return
35
;
case
4
:
return
10
;
default
:
return
25
;
}
},
getDepart
:
function
(
s
,
fn
){
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/getAgentDistrictStore'
,
data
:
{
'id'
:
s
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
fn
&&
fn
(
_data
.
data
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
Timeline
:
function
()
{
//获取时间轴
...
...
@@ -77,7 +787,7 @@ define(['doT', 'text!temp/tax_template_tpl.html', 'css!style/home.css', 'ckfinde
'type'
:
'GET'
,
'url'
:
'/index/selectReportAll'
,
data
:
{
"order_id"
:
b
usiness
.
house
_id
"order_id"
:
b
argain
.
bargain
_id
},
dataType
:
"json"
,
success
:
function
(
data
)
{
...
...
@@ -91,34 +801,50 @@ define(['doT', 'text!temp/tax_template_tpl.html', 'css!style/home.css', 'ckfinde
}
});
},
Edit
:
function
()
{
//报告详情
$
(
".Tswitch"
).
eq
(
0
).
show
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-default"
);
$
(
"#information"
).
addClass
(
"btn-info"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
console
.
log
(
business
.
house_id
);
bargaininfoShow
:
function
()
{
//报告详情
var
bargainId
;
if
(
bargain
.
father_id
==
0
){
bargainId
=
bargain
.
bargain_id
;
}
else
{
bargainId
=
bargain
.
father_id
;
}
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/bargainInfo'
,
data
:
{
"id"
:
b
usiness
.
house_i
d
"id"
:
b
argainI
d
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
$
(
".create_time"
).
html
(
data
.
data
.
create_time
);
$
(
".user_phone"
).
html
(
data
.
data
.
user_phone
);
$
(
".user_name"
).
html
(
data
.
data
.
user_name
);
$
(
".internal_address"
).
html
(
data
.
data
.
internal_address
);
$
(
".internal_title"
).
html
(
data
.
data
.
internal_title
);
$
(
".commission"
).
val
(
data
.
data
.
commission
);
$
(
".practical_fee"
).
val
(
data
.
data
.
practical_fee
);
$
(
'#bargaininfo_shop_type'
).
html
(
data
.
data
.
shop_type
==
'1'
?
'街铺'
:
'商场'
);
$
(
'#bargaininfo_is_open'
).
val
(
data
.
data
.
is_open
);
$
(
'#bargaininfo_beizhu'
).
val
(
data
.
data
.
content
);
$
(
"#bargaininfo_user_phone"
).
html
(
hideTel
(
data
.
data
.
user_phone
));
$
(
"#bargaininfo_user_name"
).
html
(
data
.
data
.
user_name
);
$
(
"#bargaininfo_internal_address"
).
html
(
data
.
data
.
internal_address
);
$
(
"#bargaininfo_shop_num"
).
html
(
data
.
data
.
house_number
);
$
(
"#bargaininfo_type"
).
val
(
data
.
data
.
trade_type
);
$
(
"#bargaininfo_total_commission"
).
val
(
data
.
data
.
commission
);
$
(
"#bargaininfo_create_time"
).
html
(
data
.
data
.
create_time
);
bargain
.
maidTotalCommission
=
Number
(
data
.
data
.
commission
);
//总佣金
bargain
.
order_id
=
Number
(
data
.
data
.
order_id
);
//订单id
var
_inputAreaTempObj
=
$
(
'.detail-modal-bargaininfo-commission-addarea'
);
if
(
data
.
data
.
practical_fee
&&
data
.
data
.
practical_fee
.
length
>
0
){
_inputAreaTempObj
.
html
(
''
);
};
$
.
each
(
data
.
data
.
practical_fee
,
function
(
i
,
v
)
{
_inputAreaTempObj
.
append
(
'<div data-id="{id}" class="form-group detail-modal-bargaininfo-commission-sec"><label class="">实收佣金:</label><div class="input-group"><input type="number"class="form-control"placeholder="请输入"value="{0}"><div class="input-group-addon">元</div></div><label class="">收佣日期:</label><div class="input-group"><input type="date"class="form-control"placeholder="请输入"value="{1}"></div></div>'
.
stringFormatObj
({
'0'
:
v
.
money
,
'1'
:
v
.
income_time
,
'id'
:
v
.
fee_id
}));
});
}
}
else
{
alert
(
'获取失败!'
);
...
...
@@ -126,50 +852,114 @@ define(['doT', 'text!temp/tax_template_tpl.html', 'css!style/home.css', 'ckfinde
}
});
},
confirmEdit
:
function
()
{
//修改报告详情
bargaininfoSave
:
function
()
{
//修改报告详情
var
_data
=
{
'id'
:
bargain
.
bargain_id
,
'commission'
:
$
.
trim
(
$
(
'#bargaininfo_total_commission'
).
val
()),
'content'
:
$
.
trim
(
$
(
'#bargaininfo_beizhu'
).
val
()),
'is_open'
:
$
(
'#bargaininfo_is_open'
).
val
(),
'trade_type'
:
$
(
'#bargaininfo_type'
).
val
()
};
$
.
each
(
$
(
'.detail-modal-bargaininfo-commission-sec'
),
function
(
i
,
v
)
{
_data
[
'practical_fee['
+
i
+
']'
]
=
{
'fee_id'
:
v
.
getAttribute
(
'data-id'
)?
v
.
getAttribute
(
'data-id'
):
0
,
'fee'
:
$
.
trim
(
$
(
v
).
find
(
'input'
).
eq
(
0
).
val
()),
'operation_date'
:
$
.
trim
(
$
(
v
).
find
(
'input'
).
eq
(
1
).
val
())
};
});
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/editBargainInfo'
,
data
:
{
"id"
:
business
.
house_id
,
"scale_fee"
:
$
(
".commission"
).
val
(),
"practical_fee"
:
$
(
".practical_fee"
).
val
()
},
data
:
_data
,
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{}
alert
(
'修改成功'
);
bargain
.
bargaininfoShow
();
bargain
.
getList
(
0
);
}
else
{
alert
(
'获取失败!'
);
alert
(
data
.
msg
);
}
}
});
},
Caozuo
:
function
()
{
//分佣提成获取跟进详情的数据
console
.
log
(
business
);
console
.
log
(
business
.
house_id
);
maidShow
:
function
()
{
$
(
'[href="#modal_new_maid"]'
).
hide
();
//默认隐藏新增按钮
$
(
"#maid_new_table_list"
).
html
(
''
);
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/commissionList'
,
type
:
'GET'
,
url
:
'/index/commissionList'
,
data
:
{
'id'
:
bargain
.
bargain_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
$
(
"#maid_new_table_list"
).
html
(
doT
.
template
(
$
(
'#reportList_maid_list_tpl'
).
html
())(
_data
));
var
_isShowAddBtnFlag
=
true
;
$
.
each
(
$
(
'.detail-modal-maid-span-time'
),
function
(
i
,
v
)
{
if
(
v
.
innerHTML
){
_isShowAddBtnFlag
=
false
;
};
});
//如果确认时间都有,都不为空,则把新增按钮显示出来
if
(
_isShowAddBtnFlag
){
$
(
'[href="#modal_new_maid"]'
).
show
();
};
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
//通过
pass
:
function
()
{
//点击通过
var
a_url
=
''
;
if
(
bargain
.
mainTabIndex
==
0
)
{
a_url
=
"/index/checkReportAttache/0"
};
if
(
bargain
.
mainTabIndex
==
1
)
{
a_url
=
"/index/checkReportManager/1"
};
// if(bargain.mainTabIndex == 2) {
// a_url = "/index/checkReportMajordomo/2"
// };
// if(bargain.mainTabIndex == 3) {
// a_url = "/index/checkReportCashier/3"
// };
//审核来源 1.成交报告申请结单 2.待撤销(退款) 3.申请撤销成交报告
//成交报告状态 10已提交 20待撤销
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
a_url
,
data
:
{
"id"
:
business
.
house_id
"id"
:
bargain
.
bargain_id
,
"source"
:
1
,
"status"
:
10
,
"remark"
:
$
.
trim
(
$
(
"#pass_beizhu"
).
val
()),
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
var
caozuo_table
=
""
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
caozuo_table
+=
'<tr><td>'
+
item
.
role
+
'</td><td>'
+
item
.
agent_name
+
'</td><td>'
+
item
.
store_name
+
'</td><td>'
+
item
.
scale
+
'</td><td>'
+
item
.
scale_fee
+
'</td><td>'
+
item
.
practical_fee
+
'</td><td>'
+
item
.
content
+
'</td></tr>'
;
});
$
(
"#caozuo_table"
).
html
(
caozuo_table
);
$
(
"#caozuo_table tr"
).
each
(
function
(
e
)
{
//不能为空
var
temp
=
$
(
"#caozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
6
).
html
();
//获取一列的值
if
(
temp
==
'null'
)
{
$
(
"#caozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
6
).
html
(
" "
)
}
});
bargain
.
getList
(
1
);
}
}
else
{
alert
(
'获取失败!'
);
...
...
@@ -177,144 +967,430 @@ define(['doT', 'text!temp/tax_template_tpl.html', 'css!style/home.css', 'ckfinde
}
});
},
Records
:
function
()
{
//分佣提成数据
$
(
".Tswitch"
).
eq
(
0
).
hide
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
show
();
$
(
"#information"
).
removeClass
(
"btn-info"
);
$
(
"#information"
).
addClass
(
"btn-default"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-default"
);
$
(
"#records"
).
addClass
(
"btn-info"
);
// 开票税费
taxShow
:
function
()
{
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/payLogList'
,
data
:
{
"id"
:
business
.
house_id
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
var
caozuo_table
=
""
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
caozuo_table
+=
'<tr><td>'
+
item
.
create_time
+
'</td><td>'
+
item
.
money
+
'</td><td>'
+
item
.
type
+
'</td><td>'
+
item
.
pay_type
+
'</td><td>'
+
item
.
agent_name
+
'</td></tr>'
;
});
$
(
"#tcaozuo_table"
).
html
(
caozuo_table
);
$
(
"#tcaozuo_table tr"
).
each
(
function
(
e
)
{
//不能为空
var
temp_one
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
4
).
html
();
var
temp
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
();
//获取一列的值
var
temp_two
=
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
();
// 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
if
(
temp
*
1
==
10
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"支付宝"
)
}
if
(
temp
*
1
==
20
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"微信"
)
}
if
(
temp
*
1
==
30
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"pos机器"
)
}
if
(
temp
*
1
==
40
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"转账"
)
}
if
(
temp
*
1
==
50
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"现金"
)
}
if
(
temp
*
1
==
60
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
3
).
html
(
"其他"
)
}
// 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他
if
(
temp_two
*
1
==
10
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"意向金"
)
}
if
(
temp_two
*
1
==
20
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"定金"
)
}
if
(
temp_two
*
1
==
30
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"保管金"
)
}
if
(
temp_two
*
1
==
40
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"押金"
)
}
if
(
temp_two
*
1
==
50
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"租金"
)
}
if
(
temp_two
*
1
==
60
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"进场费"
)
}
if
(
temp_two
*
1
==
70
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"转让费"
)
}
if
(
temp_two
*
1
==
80
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
2
).
html
(
"其他"
)
};
if
(
temp_one
==
'null'
)
{
$
(
"#tcaozuo_table"
).
find
(
"tr"
).
eq
(
e
).
find
(
"td"
).
eq
(
4
).
html
(
" "
)
type
:
'GET'
,
url
:
'/index/getTallAge'
,
data
:
{
'bargain_id'
:
bargain
.
bargain_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
$
(
"#tax_main_box"
).
html
(
doT
.
template
(
$
(
'#reportList_shuiFee_list_tpl'
).
html
())(
_data
.
data
));
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
newAddMaid
:
function
(){
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/searchOrderAgents'
,
data
:
{
'order_id'
:
bargain
.
order_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
bargain
.
panfangData
=
_data
.
data
;
console
.
log
(
bargain
.
panfangData
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
newAddMaidOk
:
function
(){
console
.
log
(
7789
);
$
.
ajax
({
type
:
'POST'
,
url
:
'/index/addBargain'
,
data
:
{
'id'
:
bargain
.
bargain_id
,
'agent_id'
:
$
(
'#addmaid_input_ywy'
).
attr
(
'data-id'
),
'scale_fee'
:
$
(
'#addmaid_input_cash'
).
val
(),
'role'
:
$
(
'#addmaid_input_servant'
).
val
(),
'scale'
:
$
(
'#addmaid_input_ratio'
).
val
(),
'source'
:
1
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
alert
(
'新增成功!'
);
bargain
.
maidShow
();
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
maidTest
:
function
(
type
){
var
_stopFlag
=
false
;
var
_data
=
[];
var
_parObj
=
$
(
'#maid_new_table_list>tr'
);
var
_errorTips
=
'请填写完整'
;
var
_scaleTotal
=
0
;
if
(
_parObj
.
length
>
0
){
$
.
each
(
_parObj
,
function
(
i
,
v
)
{
console
.
count
(
'$v'
);
var
_$v
=
$
(
v
);
var
_agentId
=
_$v
.
attr
(
'data-agentid'
);
//经纪人id
var
_role
=
_$v
.
attr
(
'data-role'
);
//盘方等类型
var
_scaleVal
=
$
.
trim
(
_$v
.
find
(
'.detail-modal-maid-span-scale'
).
html
());
//分佣比例
var
_shouldCommissionVal
=
$
.
trim
(
_$v
.
find
(
'.detail-modal-maid-td-should-commission'
).
html
());
//应分佣金
var
_dataTemp
=
{
'bargain_id'
:
_$v
.
attr
(
'data-id'
),
//成交报告id
'last_commission_id'
:
_$v
.
attr
(
'lastid'
)?
_$v
.
attr
(
'lastid'
):
0
,
//最后一个提交的记录id
'is_account_commission'
:
type
//0是保存,1是确认分佣
};
if
(
_scaleVal
==
''
||
_shouldCommissionVal
==
''
){
_stopFlag
=
true
;
}
else
{
var
_parObj2
=
_$v
.
find
(
'.detail-modal-maid-mix-td>div'
);
if
(
_parObj2
.
length
>
0
){
$
.
each
(
_parObj2
,
function
(
i2
,
v2
)
{
console
.
count
(
'$v2'
);
var
_$v2
=
$
(
v2
);
var
_cid
=
_$v2
.
attr
(
'data-id'
);
_cid
=
_cid
?
_cid
:
0
;
//如果没有这个id,则为新增,传0
var
_sfyj
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-real-fee'
).
html
());
var
_sxf
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-service-charge'
).
html
());
var
_csjj
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-charity-fund'
).
html
());
var
_xjj
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-cash'
).
html
());
var
_ssyj
=
$
.
trim
(
_$v2
.
find
(
'.detail-modal-maid-span-practical-fee'
).
html
());
if
(
_sfyj
==
''
||
_sxf
==
''
||
_csjj
==
''
||
_xjj
==
''
||
_ssyj
==
''
){
_stopFlag
=
true
;
}
else
{
_dataTemp
[
'commission_date['
+
i2
+
']'
]
=
{
'agent_id'
:
_agentId
,
//业务员id
'role'
:
_role
,
//盘方等角色类型
'scale'
:
Number
(
_scaleVal
),
//分佣比例
'should_commission'
:
_shouldCommissionVal
,
//应分佣金
'commission_id'
:
_cid
,
//子记录id
'real_fee'
:
_sfyj
,
//实分佣金
'service_charge'
:
_sxf
,
//手续费
'charity_fund'
:
_csjj
,
//慈善基金
'cash'
:
_xjj
,
//现金奖
'practical_fee'
:
_ssyj
//实收佣金
};
}
});
}
else
{
}
};
_data
.
push
(
_dataTemp
);
});
};
$
.
each
(
$
(
'.detail-modal-maid-span-scale'
),
function
(
i
,
v
)
{
_scaleTotal
+=
Number
(
$
.
trim
(
v
.
innerHTML
));
});
if
(
_scaleTotal
!=
100
){
_stopFlag
=
true
;
_errorTips
=
'分佣比例一定要是100%,否则无法提交'
;
};
return
{
'flag'
:
_stopFlag
,
'tips'
:
_errorTips
,
'list'
:
_data
}
},
maidConfirmOk
:
function
(
type
){
var
_back
=
bargain
.
maidTest
(
type
);
//获取处理的数据
if
(
!
_back
.
flag
){
var
_len
=
_back
.
list
.
length
;
!
function
funTemp
(
count
)
{
if
(
count
>=
_len
)
{
//如果递归执行完毕则执行这条
alert
(
type
===
0
?
'保存成功'
:
'确认成功'
);
bargain
.
maidShow
();
}
else
{
alert
(
'获取失败!'
);
$
.
ajax
({
type
:
'POST'
,
url
:
'/index/addRealIncome'
,
data
:
_back
.
list
[
count
],
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
funTemp
(
++
count
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
}
}
}(
0
);
}
else
{
alert
(
_back
.
tips
);
}
},
newAddTax
:
function
(
obj
)
{
var
_tempTableObj
=
$
(
'.addtax-modal-tax-table'
);
_tempTableObj
.
attr
(
'data-type'
,
obj
[
'type'
]);
var
_url
=
''
;
var
_data
=
{};
$
(
'#addtax_commission_input'
).
val
(
''
);
//开票金额置空
$
(
'#addtax_date'
).
val
(
''
);
//开票日期置空
if
(
obj
[
'type'
]
===
'new'
){
$
(
'#modal_new_tax .modal-title'
).
html
(
'新增开票'
);
_url
=
'/index/searchBargainAgents'
;
_data
[
'bargain_id'
]
=
bargain
.
bargain_id
;
}
else
{
$
(
'#modal_new_tax .modal-title'
).
html
(
'编辑开票'
);
_tempTableObj
.
attr
(
'data-recordid'
,
obj
[
'id'
]);
_url
=
'/index/getTaxesById'
;
_data
[
'taxes_id'
]
=
obj
[
'id'
];
};
$
.
ajax
({
type
:
'GET'
,
url
:
_url
,
data
:
_data
,
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
if
(
_data
[
'data'
]
&&
_data
[
'data'
].
length
&&
_data
[
'data'
].
length
>
0
){
$
(
'#addtax_commission_input'
).
val
(
_data
[
'data'
][
0
][
'total_fee'
]);
$
(
'#addtax_date'
).
val
(
_data
[
'data'
][
0
][
'operation_date'
]);
var
_htmlTemp
=
'<tr><td>分佣方</td><td>业务员</td><td>分佣比例</td><td>税费</td></tr>'
;
$
.
each
(
_data
[
'data'
],
function
(
i
,
v
)
{
_htmlTemp
+=
'<tr class="addtax-modal-tax-table-datatr" data-id="{id}" data-role="{role}"><td>{0}</td><td>{1}</td><td>{2}%</td><td contenteditable>{3}</td></tr>'
.
stringFormatObj
({
'0'
:
v
.
role_name
,
'1'
:
v
.
name
+
'-'
+
v
.
phone
,
'2'
:
v
.
scale
,
'3'
:
(
obj
[
'type'
]
===
'new'
)?
''
:
v
.
fee
,
'role'
:
v
.
role
,
'id'
:
v
.
id
});
});
$
(
'.addtax-modal-tax-table'
).
html
(
_htmlTemp
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
};
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
newCommission
:
function
()
{
//新增分佣提成
newAddTaxOk
:
function
(){
var
_tempTableObj
=
$
(
'.addtax-modal-tax-table'
);
var
_data
=
{
'bargain_id'
:
bargain
.
bargain_id
,
'total_fee'
:
$
.
trim
(
$
(
'#addtax_commission_input'
).
val
()),
'operation_date'
:
$
(
'#addtax_date'
).
val
()
};
if
(
_tempTableObj
.
attr
(
'data-type'
)
===
'edit'
){
_data
[
'id'
]
=
_tempTableObj
.
attr
(
'data-recordid'
);
};
$
.
each
(
$
(
'.addtax-modal-tax-table-datatr'
),
function
(
i
,
v
)
{
_data
[
'tax['
+
i
+
']'
]
=
{
'fee'
:
v
.
childNodes
[
3
].
innerHTML
,
'agent_id'
:
JSON
.
parse
(
decodeURIComponent
(
sessionStorage
.
getItem
(
'pcUserInfo'
))).
id
,
'role'
:
v
.
getAttribute
(
'data-role'
),
'scale'
:
v
.
childNodes
[
2
].
innerHTML
.
split
(
'%'
)[
0
]
};
if
(
_tempTableObj
.
attr
(
'data-type'
)
===
'edit'
){
_data
[
'tax['
+
i
+
']'
][
'fee_id'
]
=
v
.
getAttribute
(
'data-id'
);
};
});
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/addBargain'
,
data
:
{
"id"
:
business
.
house_id
,
"role"
:
$
(
"#is_carefully_chosen"
).
val
(),
"scale"
:
$
(
"#commission-rate"
).
val
(),
"scale_fee"
:
$
(
"#should-commission"
).
val
(),
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
)
{
console
.
log
(
666
);
}
}
else
{
alert
(
'获取失败!'
);
}
}
type
:
'POST'
,
url
:
'/index/addTallAge'
,
data
:
_data
,
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
alert
(
'新增成功!'
);
bargain
.
taxShow
();
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
// table切换
Information
:
function
()
{
$
(
".Tswitch"
).
eq
(
0
).
show
();
$
(
".Tswitch"
).
eq
(
1
).
hide
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-default"
);
$
(
"#information"
).
addClass
(
"btn-info"
);
$
(
"#fees"
).
removeClass
(
"btn-info"
);
$
(
"#fees"
).
addClass
(
"btn-default"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
//转到一级审核
transFirstExamine
:
function
(){
$
.
ajax
({
type
:
'POST'
,
url
:
'/index/toReportListOne'
,
data
:
{
'bargain_id'
:
bargain
.
bargain_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
alert
(
'修改成功'
);
bargain
.
getList
(
1
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
Fees
:
function
()
{
$
(
".Tswitch"
).
eq
(
0
).
hide
();
$
(
".Tswitch"
).
eq
(
1
).
show
();
$
(
".Tswitch"
).
eq
(
2
).
hide
();
$
(
"#information"
).
removeClass
(
"btn-info"
);
$
(
"#information"
).
addClass
(
"btn-default"
);
$
(
"#fees"
).
removeClass
(
"btn-default"
);
$
(
"#fees"
).
addClass
(
"btn-info"
);
$
(
"#records"
).
removeClass
(
"btn-info"
);
$
(
"#records"
).
addClass
(
"btn-default"
);
account
:
function
(){
$
.
ajax
({
type
:
'POST'
,
url
:
'/index/checkOver'
,
data
:
{
'bargain_id'
:
bargain
.
bargain_id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
typeof
_data
===
'object'
)
{
if
(
_data
[
'code'
]
==
'200'
)
{
alert
(
'结单成功!'
);
bargain
.
getList
(
1
);
}
else
{
layerTipsX
(
_data
[
'msg'
]);
}
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
layerTipsX
(
'请求超时,请重试'
);
};
}
});
},
getList
:
function
(
pageNo
)
{
business
.
pageNo
=
pageNo
;
//获取一级审核,二级审核,三级审核,结单不同的ajax请求url
// switchUrl: function(){
// switch (Number(this.mainTabIndex)){
// case 0:
// return '/index/reportListOne/1';
// case 1:
// return '/index/reportListTwo/2';
// case 2:
// return '/index/reportListThree/3';
// case 3:
// return '/index/reportListStatement/4';
// default:
// return '';
// }
// },
//获取一级审核,二级审核,三级审核,结单数据列表共用的方法
getList
:
function
(
pageNo
)
{
bargain
.
pageNo
=
pageNo
;
var
params
=
{};
params
.
pageNo
=
b
usiness
.
pageNo
;
params
.
pageSize
=
b
usiness
.
pageSize
;
params
.
pageNo
=
b
argain
.
pageNo
;
params
.
pageSize
=
b
argain
.
pageSize
;
params
.
create_time
=
$
(
'#create_time'
)
.
val
();
params
.
end_time
=
$
(
'#end_time'
)
.
val
();
params
.
internal_address
=
$
(
'#internal_address'
).
val
();
...
...
@@ -337,15 +1413,16 @@ define(['doT', 'text!temp/tax_template_tpl.html', 'css!style/home.css', 'ckfinde
$
(
"#taxTotal"
).
html
(
data
.
data
.
total_fee
);
/*分页代码*/
add_page
(
data
.
data
.
total
,
pageNo
,
b
usiness
.
pageSize
,
business
.
getList
);
add_page
(
data
.
data
.
total
,
pageNo
,
b
argain
.
pageSize
,
bargain
.
getList
);
//总的税费
}
});
},
exportList
:
function
(
pageNo
)
{
business
.
pageNo
=
pageNo
;
exportList
:
function
(
pageNo
)
{
//导出分佣提成列表
bargain
.
pageNo
=
pageNo
;
var
create_time
=
$
(
'#create_time'
).
val
();
var
end_time
=
$
(
'#end_time'
).
val
();
var
internal_address
=
$
(
'#internal_address'
).
val
();
...
...
@@ -355,7 +1432,6 @@ define(['doT', 'text!temp/tax_template_tpl.html', 'css!style/home.css', 'ckfinde
window
.
open
(
'/index/exportExcel?create_time='
+
create_time
+
'&end_time='
+
end_time
+
'&internal_address='
+
internal_address
+
'&name='
+
agent
+
'&phone='
+
user_phone
+
'&house_number='
+
house_number
);
},
};
return
business
;
});
\ No newline at end of file
return
bargain
;
});
public/resource/template/commission_template_tpl.html
View file @
ee67c7d1
<script
id=
"commission_list_tpl"
type=
"text/template"
>
[
%
if
(
it
)
{
%
]
[
%
for
(
var
item
in
it
){
%
]
<
tr
class
=
"text-center"
>
<
tr
class
=
"text-center"
data
-
id
=
"[%= it[item]['id'] %]"
data
-
orderid
=
"[%= it[item]['order_id'] %]"
data
-
fatherid
=
"[%= it[item]['father_id'] %]"
>
<
td
>
[
%=
it
[
item
][
'confirm_date'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'district_store'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'agent'
]
%
]
<
/td
>
...
...
@@ -11,8 +11,8 @@
<
td
>
[
%=
it
[
item
][
'practical_fee'
]
%
]
<
/td
>
<
td
>
<
a
class
=
"btn1 btn-info
edit"
href
=
"#modal-details
"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["bargain_id"] %]'
>
详情
<
/a
>
<
a
class
=
"btn1 btn-info timeline"
href
=
"#modal-
line
time"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["bargain_id"] %]'
>
时间轴
<
/a
>
<
a
class
=
"btn1 btn-info
details-btn"
href
=
"#modal_detail
"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["bargain_id"] %]'
>
详情
<
/a
>
<
a
class
=
"btn1 btn-info timeline"
href
=
"#modal-time"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["bargain_id"] %]'
>
时间轴
<
/a
>
<
/td
>
<
/tr
>
[
%
}
%
]
...
...
public/resource/template/reportList_maidtwo_template_tpl.html
0 → 100644
View file @
ee67c7d1
<script
id=
"reportList_maid_list_tpl"
type=
"text/template"
>
[
%
if
(
it
[
'data'
]
&&
it
[
'data'
].
length
&&
it
[
'data'
].
length
>
0
)
{
%
]
[
%
var
dealT
=
function
(
g
){
if
(
g
&&
(
g
!=
"null"
)){
return
g
}
else
{
return
""
}};
%
]
[
%
for
(
var
i
in
it
[
'data'
]){
%
]
<
tr
class
=
"text-center"
data
-
id
=
"[%= it['data'][i]['id'] %]"
data
-
agentid
=
"[%= it['data'][i]['agent_id'] %]"
data
-
role
=
"[%= it['data'][i]['role'] %]"
data
-
lastid
=
"[%= it['data'][i]['last_commission_id'] %]"
>
<
td
>
[
%=
it
[
'data'
][
i
][
'role_name'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
'data'
][
i
][
'agent'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
'data'
][
i
][
'district_store'
]
%
]
<
/td
>
<
td
><
span
class
=
"detail-modal-maid-span-scale"
>
[
%=
it
[
'data'
][
i
][
'scale'
]
%
]
<
/span><span>%</
span
><
/td
>
<
td
class
=
"detail-modal-maid-td-should-commission"
>
[
%=
it
[
'data'
][
i
][
'scale_fee'
]
%
]
<
/td
>
<
td
colspan
=
"6"
class
=
"detail-modal-maid-mix-td oh"
>
[
%
if
(
it
[
'data'
][
i
][
'partial_commission'
]
&&
it
[
'data'
][
i
][
'partial_commission'
].
length
&&
it
[
'data'
][
i
][
'partial_commission'
].
length
>
0
)
{
%
]
[
%
for
(
var
j
in
it
[
'data'
][
i
][
'partial_commission'
]){
%
]
<
div
class
=
"oh"
data
-
id
=
"[%= it['data'][i]['partial_commission'][j]['id'] %]"
>
<
span
class
=
"detail-modal-maid-span-real-fee"
>
[
%=
it
[
'data'
][
i
][
'partial_commission'
][
j
][
'real_fee'
]
%
]
<
/span
>
<
span
class
=
"detail-modal-maid-span-service-charge"
>
[
%=
it
[
'data'
][
i
][
'partial_commission'
][
j
][
'service_charge'
]
%
]
<
/span
>
<
span
class
=
"detail-modal-maid-span-charity-fund"
>
[
%=
it
[
'data'
][
i
][
'partial_commission'
][
j
][
'charity_fund'
]
%
]
<
/span
>
<
span
class
=
"detail-modal-maid-span-cash"
>
[
%=
it
[
'data'
][
i
][
'partial_commission'
][
j
][
'cash'
]
%
]
<
/span
>
<
span
class
=
"detail-modal-maid-span-practical-fee"
>
[
%=
it
[
'data'
][
i
][
'partial_commission'
][
j
][
'practical_fee'
]
%
]
<
/span
>
<
span
class
=
"detail-modal-maid-span-time"
>
[
%=
dealT
(
it
[
'data'
][
i
][
'partial_commission'
][
j
][
'confirm_date'
])
%
]
<
/span
>
<
/div
>
[
%
}
%
]
[
%
}
else
{
%
]
<
div
class
=
"oh"
>
<
span
class
=
"detail-modal-maid-span-real-fee"
><
/span
>
<
span
class
=
"detail-modal-maid-span-service-charge"
>
0
<
/span
>
<
span
class
=
"detail-modal-maid-span-charity-fund"
>
0
<
/span
>
<
span
class
=
"detail-modal-maid-span-cash"
>
0
<
/span
>
<
span
class
=
"detail-modal-maid-span-practical-fee"
><
/span
>
<
span
class
=
"detail-modal-maid-span-time"
><
/span
>
<
/div>
[
%
}
%
]
<
/td
>
<
/tr
>
[
%
}
%
]
[
%
}
else
{
%
]
<
tr
>
<
td
colspan
=
"11"
style
=
"text-align:center;"
>
暂无数据
<
/td
>
<
/tr
>
[
%
}
%
]
</script>
public/resource/template/reportList_shuiFee_template_tpl.html
View file @
ee67c7d1
...
...
@@ -19,7 +19,7 @@
<
/tr
>
[
%
if
(
it
[
item
][
'fee_list'
]
&&
it
[
item
][
'fee_list'
].
length
&&
it
[
item
][
'fee_list'
].
length
>
0
)
{
%
]
[
%
for
(
var
item2
in
it
[
item
][
'fee_list'
]){
%
]
<
tr
data
-
id
=
"[%= it[item]['fee_list'][item2]['fee_id'] %]"
>
<
tr
data
-
fee
id
=
"[%= it[item]['fee_list'][item2]['fee_id'] %]"
>
<
td
>
[
%=
getInfoType
(
it
[
item
][
'fee_list'
][
item2
][
'role'
])
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'fee_list'
][
item2
][
'name'
]
+
'-'
+
it
[
item
][
'fee_list'
][
item2
][
'phone'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'fee_list'
][
item2
][
'scale'
]
%
]
<
/td
>
...
...
public/resource/template/reportList_template_tpl.html
View file @
ee67c7d1
...
...
@@ -2,7 +2,7 @@
[
%
if
(
it
[
"list"
]
&&
it
[
"list"
].
length
&&
it
[
"list"
].
length
>
0
)
{
%
]
[
%
var
sw
=
function
(
s
){
switch
(
Number
(
s
)){
case
10
:
return
"出租"
;
case
20
:
return
"增佣"
;
case
30
:
return
"代理"
;
case
40
:
return
"好处费"
;
default
:
return
s
}};
%
]
[
%
for
(
var
item
in
it
[
"list"
]){
%
]
<
tr
class
=
"text-center"
data
-
id
=
'[%= it["list"][item]["id"] %]'
>
<
tr
class
=
"text-center"
data
-
id
=
"[%= it['list'][item]['id'] %]"
data
-
orderid
=
"[%= it['list'][item]['order_id'] %]"
>
<
td
>
[
%=
it
[
"list"
][
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
"list"
][
item
][
'internal_address'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
"list"
][
item
][
'house_number'
]
%
]
<
/td
>
...
...
public/resource/template/tax_template_tpl.html
View file @
ee67c7d1
<script
id=
"tax_list_tpl"
type=
"text/template"
>
[
%
if
(
it
)
{
%
]
[
%
for
(
var
item
in
it
){
%
]
<
tr
class
=
"text-center"
>
<
tr
class
=
"text-center"
data
-
id
=
"[%= it[item]['id'] %]"
data
-
orderid
=
"[%= it[item]['order_id'] %]"
data
-
fatherid
=
"[%= it[item]['father_id'] %]"
>
<
td
>
[
%=
it
[
item
][
'create_time'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'district_store'
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
'name'
]
%
]
<
/td
>
...
...
@@ -11,8 +11,8 @@
<
td
>
<
a
class
=
"btn1 btn-info
edit"
href
=
"#modal-details
"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
详情
<
/a
>
<
a
class
=
"btn1 btn-info timeline"
href
=
"#modal-
line
time"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
时间轴
<
/a
>
<
a
class
=
"btn1 btn-info
details-btn"
href
=
"#modal_detail
"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
详情
<
/a
>
<
a
class
=
"btn1 btn-info timeline"
href
=
"#modal-time"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
时间轴
<
/a
>
<
/td
>
<
/tr
>
[
%
}
%
]
...
...
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