Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
ypt_mgw_local
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
苏星豪
ypt_mgw_local
Commits
d5e65d8d
提交
d5e65d8d
authored
8月 01, 2024
作者:
李思鑫
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
川酒 添加终端返利明细表
上级
3844966d
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
265 行增加
和
1 行删除
+265
-1
urls.py
datacenter/urls.py
+2
-1
views.py
sales/views.py
+38
-0
agentwinner_list.html
templates/sales/agentwinner_list.html
+225
-0
没有找到文件。
datacenter/urls.py
浏览文件 @
d5e65d8d
...
@@ -553,7 +553,8 @@ urlpatterns = [
...
@@ -553,7 +553,8 @@ urlpatterns = [
url
(
r'^sales/kangnian_labelquery_page/$'
,
sal_views
.
kangnian_labelquery_page
),
url
(
r'^sales/kangnian_labelquery_page/$'
,
sal_views
.
kangnian_labelquery_page
),
url
(
r'^sales/kangnian_labelquery/$'
,
sal_views
.
kangnian_labelquery
),
url
(
r'^sales/kangnian_labelquery/$'
,
sal_views
.
kangnian_labelquery
),
#2024-7-31 lisin
url
(
r'^sales/agentwinner/list/$'
,
sal_views
.
agentwinner_list
),
...
...
sales/views.py
浏览文件 @
d5e65d8d
...
@@ -10003,3 +10003,40 @@ def orders_action(request,action='list'):
...
@@ -10003,3 +10003,40 @@ def orders_action(request,action='list'):
cur
.
close
()
cur
.
close
()
return
render
(
request
,
'sales/order/'
+
action
+
'_orders.html'
,
data
)
return
render
(
request
,
'sales/order/'
+
action
+
'_orders.html'
,
data
)
@login_required
def
agentwinner_list
(
request
):
data
=
{
'data'
:
[],
'clmus'
:
[],
'e'
:
[],
'subtt'
:
[
'营销活动'
,
'返利明细'
],
'murl'
:
''
,
'dt'
:
True
,
'add'
:
True
}
dt
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
dt_fr
=
request
.
GET
.
get
(
'date_from'
,
dt
)
dt_to
=
request
.
GET
.
get
(
' '
,
dt
)
data
[
"date_from"
]
=
dt_fr
data
[
"date_to"
]
=
dt_to
dt_to
=
(
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
days
=
1
))
.
strftime
(
"
%
Y-
%
m-
%
d"
)
f
=
"ancestor_id ="
+
str
(
request
.
user
.
company
.
id
)
+
"and tm >='"
+
dt_fr
+
"' and tm <='"
+
dt_to
+
"'"
cur
=
connection
.
cursor
()
cur
.
execute
(
"select id, (select name from sales_activities WHERE id = activity_id), "
+
"(select name from company_company WHERE id = a.company_id),"
+
"award_name, award_cat, to_char(tm_redeemed,'yyyy-mm-dd HH24:MI:SS'), label_code, award_points, award_amount, use_status, is_need_hexiao, is_hexiao,"
+
"(select name from company_company WHERE id = a.write_off_company_id),"
+
"to_char(write_off_tm,'yyyy-mm-dd HH24:MI:SS'), coalesce(remark,'')"
+
"FROM sales_agentwinner a where "
+
f
)
rs
=
cur
.
fetchall
()
for
r
in
rs
:
data
[
'data'
]
.
append
([
r
[
1
],
r
[
2
],
r
[
3
],
r
[
4
]
if
r
[
4
]
else
'/'
,
r
[
5
]
if
r
[
5
]
else
'/'
,
r
[
6
]
if
r
[
6
]
else
'/'
,
r
[
7
]
if
r
[
7
]
else
'/'
,
r
[
8
]
if
r
[
8
]
else
'/'
,
'是'
if
r
[
9
]
else
'否'
,
'是'
if
r
[
10
]
else
'否'
,
'是'
if
r
[
11
]
else
'否'
,
r
[
12
]
if
r
[
12
]
else
'/'
,
r
[
13
]
if
r
[
13
]
else
'/'
,
r
[
14
]
])
return
render
(
request
,
'sales/agentwinner_list.html'
,
data
)
\ No newline at end of file
templates/sales/agentwinner_list.html
0 → 100644
浏览文件 @
d5e65d8d
{% load i18n %}
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
(){
var
page_length
=
10
;
var
value
=
[]
var
table
=
$
(
'#tb'
).
DataTable
({
dom
:
'Bfrtip'
,
autoWidth
:
true
,
pageLength
:
page_length
,
buttons
:
[{
extend
:
'excelHtml5'
,
text
:
'导出到Excel'
}],
language
:
lng
,
data
:{{
data
|
safe
}}
});
table
.
columns
().
every
(
function
()
{
var
that
=
this
;
$
(
'input'
,
this
.
footer
()
).
on
(
'keyup change clear'
,
function
()
{
if
(
that
.
search
()
!==
this
.
value
)
{
that
.
search
(
this
.
value
).
draw
();
}
});
});
$
(
'#data-content .btn-obj-add'
).
click
(
function
(){
event
.
preventDefault
();
$
.
RefreshContent
(
$
(
this
).
attr
(
'href'
));
});
{
%
if
dt
%
}
$
(
'.datepicker'
).
datepicker
({
dateFormat
:
'yy-mm-dd'
});
$
(
'.datepicker'
).
datepicker
(
'setDate'
,
new
Date
());
setDatePickerZh
();
$
(
'#dt_fr'
).
val
(
'{{date_from}}'
);
$
(
'#dt_to'
).
val
(
'{{date_to}}'
);
$
(
'.btn-qry'
).
click
(
function
(){
var
date_from
,
date_to
;
date_fr
=
$
(
'#dt_fr'
).
val
();
date_to
=
$
(
'#dt_to'
).
val
();
var
params
=
[];
if
(
date_fr
!=
''
){
params
.
push
(
'date_from='
+
date_fr
)};
if
(
date_to
!=
''
){
params
.
push
(
'date_to='
+
date_to
)};
if
(
params
.
length
==
0
){
bootbox
.
alert
(
"{% trans '请先输入查询条件!'%}"
);
}
else
{
$
.
RefreshContent
(
'{{request.path}}?'
+
params
.
join
(
'&'
));
}
});
{
%
endif
%
}
$
(
".checkall"
).
on
(
'click'
,
function
()
{
var
list_before
=
$
(
'.checkchild'
)
for
(
var
i
=
0
;
i
<
list_before
.
length
;
i
++
)
{
if
(
list_before
[
i
].
checked
)
{
$
(
".checkchild"
).
prop
(
"checked"
,
false
);
break
;
}
else
{
$
(
".checkchild"
).
prop
(
"checked"
,
true
);
break
;
}
}
var
list
=
$
(
'.checkchild'
)
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
list
[
i
].
checked
)
{
if
(
value
.
indexOf
(
parseInt
(
list
[
i
].
value
))
!=-
1
)
{
{
#
value
.
push
(
parseInt
(
list
[
i
].
value
))
#
}
}
else
{
value
.
push
(
parseInt
(
list
[
i
].
value
))
}
}
else
{
if
(
$
.
inArray
(
parseInt
(
list
[
i
].
value
),
value
)
==
-
1
)
{
//$.inArray(元素, 数组) == -1 表示要删除的元素不在原数组中
}
else
{
value
.
splice
(
$
.
inArray
(
parseInt
(
list
[
i
].
value
),
value
),
1
);
}
$
(
".checkchild"
).
prop
(
"checked"
,
false
);
}
}
});
$
(
"#tb"
).
on
(
'click'
,
'.checkchild'
,
function
(
e
){
var
check
=
$
(
this
).
prop
(
"checked"
);
if
(
check
){
if
(
value
.
indexOf
(
parseInt
(
this
.
value
))){
value
.
push
(
parseInt
(
this
.
value
))
}
}
else
{
if
(
$
.
inArray
(
parseInt
(
this
.
value
),
value
)
==
-
1
){
//$.inArray(元素, 数组) == -1 表示要删除的元素不在原数组中
}
else
{
value
.
splice
(
$
.
inArray
(
parseInt
(
this
.
value
),
value
),
1
);
}
}
})
var
url
=
'sales/activity/person_lottery_plan_batch_delete/'
;
$
(
'.btn-delete-all'
).
click
(
function
()
{
if
(
value
.
length
>
0
)
{
var
r
=
confirm
(
'您确定要删除吗?'
);
if
(
r
)
{
console
.
log
(
value
)
$
.
ajax
({
type
:
'post'
,
url
:
url
,
data
:
{
ids
:
value
.
join
(
','
),
delflag
:
1
},
success
:
function
(
html
)
{
table
.
draw
();
$
.
RefreshContent
(
'/sales/activity/person_lottery_plan_list/'
)
{
#
$
(
'#bg-modal .modal-body'
).
html
(
html
);
#
}
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
alert
(
'连接服务器失败'
);
}
})
}
}
else
{
alert
(
'请勾选需要删除的内容!'
)
}
})
});
function
deleteItem
(
id
){
var
r
=
confirm
(
'您确定要删除吗?'
);
if
(
r
){
var
durl
=
'/sales/activity/person_lottery_plan_delete/'
+
id
+
'/'
$
.
RefreshContent
(
durl
);
}
}
</script>
<ol
class=
"breadcrumb"
>
<li>
{{subtt.0}}
</li>
<li>
{{subtt.1}}
</li>
</ol>
<!-- {% if perms.company.sys_admin %}
<div class="title_right">
<div class="pull-right">
<span class='input-group'>
<a type="button" class='btn btn-obj-add l-a create-btn' href='/sales/activity/person_lottery_plan_edit'>
<span class='glyphicon glyphicon-plus' style='padding-right:5px;'></span>{% trans '新建人员投奖计划' %}
</a>
</span>
</div>
</div>
{% endif%} -->
{% if dt %}
<form
role=
"form"
class=
"form-inline"
style=
"margin-top:0px;padding-left:10px;"
>
<div
class=
"col-sm-2 input-group"
>
<span
class=
"input-group-addon"
>
{% trans "开始日期"%}
</span>
<input
class=
"datepicker form-control"
id=
"dt_fr"
/>
</div>
<div
class=
"col-sm-2 input-group"
>
<span
class=
"input-group-addon"
>
{% trans "结束日期"%}
</span>
<input
class=
"datepicker form-control"
id=
"dt_to"
/>
</div>
<div
class=
"col-sm-2 input-group"
>
<span
class=
'input-group-btn'
>
<a
type=
"button"
class=
'btn btn-primary btn-qry'
>
<span
class=
'glyphicon glyphicon-search'
style=
'padding-right:5px;'
></span>
{% trans '查找' %}
</a>
</span>
</div>
</form>
<div
class=
"clearfix"
></div>
{% endif %}
<div
class=
"col-md-12 col-sm-12 col-xs-12"
>
<div
class=
"x_panel"
>
<div
class=
"table-responsive"
>
<h4>
明细
</h4>
<table
id=
'tb'
class=
"table table-striped table-bordered dt-responsive nowrap"
cellspacing=
"0"
width=
"100%"
>
<thead>
<tr>
<th>
活动名称
</th>
<th>
公司
</th>
<th>
奖品
</th>
<th>
奖品类型
</th>
<th>
领奖时间
</th>
<th>
标签号
</th>
<th>
奖品积分
</th>
<th>
折合现金
</th>
<th>
是否已使用
</th>
<th>
是否需要核销
</th>
<th>
是否已核销
</th>
<th>
核销人
</th>
<th>
核销时间
</th>
<th>
备注
</th>
</tr>
</thead>
<tbody></tbody>
<tfoot>
<th><input
type=
"text"
placeholder=
"活动名称"
></th>
<th><input
type=
"text"
placeholder=
"公司"
></th>
<th><input
type=
"text"
placeholder=
"奖品"
></th>
<th><input
type=
"text"
placeholder=
"奖品类型"
></th>
<th><input
type=
"text"
placeholder=
"领奖时间"
></th>
<th><input
type=
"text"
placeholder=
"标签号"
></th>
<th><input
type=
"text"
placeholder=
"奖品积分"
></th>
<th><input
type=
"text"
placeholder=
"折合现金"
></th>
<th><input
type=
"text"
placeholder=
"是否已使用"
></th>
<th><input
type=
"text"
placeholder=
"是否需要核销"
></th>
<th><input
type=
"text"
placeholder=
"是否已核销"
></th>
<th><input
type=
"text"
placeholder=
"核销人"
></th>
<th><input
type=
"text"
placeholder=
"核销时间"
></th>
<th><input
type=
"text"
placeholder=
"备注"
></th>
</tfoot>
</table>
</div>
</div>
</div>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论