Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
ypt_mgw_local
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
苏星豪
ypt_mgw_local
Commits
7a064fcf
提交
7a064fcf
authored
9月 26, 2023
作者:
蒋代伟
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
步奖批量删除
上级
cd526fec
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
139 行增加
和
10 行删除
+139
-10
urls.py
datacenter/urls.py
+1
-0
views.py
sales/views.py
+19
-3
list_staff_saldiv.html
templates/company/list_staff_saldiv.html
+1
-1
lotteryseeds.html
templates/sales/lotteryseeds.html
+118
-6
没有找到文件。
datacenter/urls.py
浏览文件 @
7a064fcf
...
...
@@ -1031,6 +1031,7 @@ urlpatterns = [
url
(
r'^sales/lotteryseeds/$'
,
sal_views
.
lotteryseeds
),
url
(
r'^sales/lottery/$'
,
sal_views
.
lottery
),
url
(
r'^sales/lotteryseeds/delete/(?P<id>\d+)/$'
,
sal_views
.
lotteryseeds_delete
),
url
(
r'^sales/lotteryseeds/batch_delete/$'
,
sal_views
.
lotteryseeds_batch_delete
),
#奖品指定
url
(
r'^sales/lotterywinnerseeds/$'
,
sal_views
.
lotterywinnerseeds
),
url
(
r'^sales/winner_lottery/$'
,
sal_views
.
winner_lottery
),
...
...
sales/views.py
浏览文件 @
7a064fcf
...
...
@@ -4669,7 +4669,7 @@ def lotteryseeds(request):
data
=
{
'data'
:
[],
'clmns'
:
[],
'e'
:
[],
'subtt'
:
[
'营销活动'
,
'奖池布奖'
],
'murl'
:
''
,
'dt'
:
True
,
'add'
:
True
,
'clmns2'
:
[],
'cnts'
:
[],
'clmns3'
:
[],
'cnts2'
:
[]}
data
[
'clmns'
]
=
[
'标签序号'
,
'活动'
,
'奖品'
,
'第二奖品'
,
'产品'
,
'批次'
,
'经销商'
,
'状态'
,
'备注'
,
'时间'
,
'是否终端返利'
,
'操作'
]
data
[
'clmns'
]
=
[]
data
[
'show_add'
]
=
True
data
[
'murl'
]
=
'/sales/lottery/'
dt
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
...
...
@@ -4699,8 +4699,8 @@ def lotteryseeds(request):
is_terminal
=
'是'
else
:
is_terminal
=
'否'
data
[
'data'
]
.
append
([
check_box
=
'<input class="checkchild" value="'
+
str
(
r
[
10
])
+
'" type="checkbox">'
data
[
'data'
]
.
append
([
check_box
,
r
[
0
],
r
[
1
],
r
[
2
],
...
...
@@ -4816,6 +4816,22 @@ def lotteryseeds_delete(request, id=None):
return
redirect
(
'/sales/lotteryseeds/'
)
# 布奖批量删除
@login_required
def
lotteryseeds_batch_delete
(
request
):
if
request
.
method
==
'POST'
:
otteryseeds_ids
=
request
.
POST
.
get
(
'otteryseeds_ids'
,
''
)
if
otteryseeds_ids
:
otteryseeds
=
otteryseeds_ids
.
split
(
','
)
print
(
otteryseeds
)
for
os_id
in
otteryseeds
:
obj
=
LotterySeeds
.
objects
.
get
(
id
=
int
(
os_id
),
company_id
=
request
.
user
.
company
.
id
)
if
obj
:
obj
.
delete
()
return
redirect
(
'/sales/lotteryseeds/'
)
# return JsonResponse(data={})
@login_required
def
lotterywinnerseeds_delete
(
request
,
id
=
None
):
if
id
:
...
...
templates/company/list_staff_saldiv.html
浏览文件 @
7a064fcf
...
...
@@ -74,4 +74,4 @@
</table>
</div>
</div>
</div
</div
>
templates/sales/lotteryseeds.html
浏览文件 @
7a064fcf
...
...
@@ -4,6 +4,7 @@
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
(){
var
page_length
=
10
;
var
value
=
[]
var
table
=
$
(
'#tb'
).
DataTable
({
dom
:
'Bfrtip'
,
autoWidth
:
true
,
...
...
@@ -83,9 +84,93 @@
}
});
{
%
endif
%
}
$
(
".checkall"
).
on
(
'click'
,
function
()
{
var
list_before
=
$
(
'.checkchild'
)
for
(
var
i
=
0
;
i
<
list_before
.
length
;
i
++
)
{
if
(
list_before
[
i
].
checked
)
{
console
.
log
(
1
)
$
(
".checkchild"
).
prop
(
"checked"
,
false
);
break
;
}
else
{
console
.
log
(
0
)
$
(
".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"
);
console
.
log
(
check
)
if
(
check
){
console
.
log
(
this
.
value
)
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/lotteryseeds/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
:
{
otteryseeds_ids
:
value
.
join
(
','
),
delflag
:
1
},
success
:
function
(
html
)
{
table
.
draw
();
$
.
RefreshContent
(
'sales/lotteryseeds/'
)
{
#
$
(
'#bg-modal .modal-body'
).
html
(
html
);
#
}
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
alert
(
'连接服务器失败'
);
}
})
}
}
else
{
alert
(
'请勾选需要删除的内容!'
)
}
})
});
function
deleteItem
(
id
){
var
r
=
confirm
(
'您确定要删除吗?'
);
if
(
r
){
...
...
@@ -151,15 +236,42 @@
<h4>
明细
</h4>
<table
id=
'tb'
class=
"table table-striped table-bordered dt-responsive nowrap"
cellspacing=
"0"
width=
"100%"
>
<thead>
{% for c in clmns %}
<th>
{{c}}
</th>
{% endfor %}
{# {% for c in clmns %}#}
{#
<th>
{{c}}
</th>
#}
{# {% endfor %}#}
<tr>
<th>
<input
type=
"checkbox"
class =
"checkall"
id=
"group_checkbox"
style=
"display: none;"
/><label
for=
"group_checkbox"
>
全选/反选
</label>
</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>
{% for c in clmns %}
<th><input
type=
"text"
placeholder=
"{{c}}"
></th>
{% endfor %}
<th>
<span
class=
"btn btn-sm btn-danger btn-delete-all"
>
批量删除
</span>
</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>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论