提交 ce1f4de3 authored 作者: 蒋代伟's avatar 蒋代伟

更新

上级 d4d5e01e
......@@ -1254,7 +1254,7 @@ urlpatterns = [
#用户积分信息
url(r'^company/bonuspoints/infor/(?P<comapny_id>\d+)/$',company_views.bonuspoints_infor),
url(r'^company/bonuspoints/infor/details/(?P<activity_name>\w+)/(?P<log_id>\d+)/$',company_views.bonuspoints_infor_details),
url(r'^company/bonuspoints/infor/details/(?P<activity_name>\w+)/(?P<log_id>\d+)/$',company_views.bonuspoints_infor_details),
# 诗仙太白积分提现
url(r'^company/sxtb/rebate/wx_withdraw/$', wx_views.wx_withdraw_cash),
......@@ -1318,10 +1318,12 @@ urlpatterns = [
#2023 07-14 经销商查询标签信息
url(r'^inventory/agent/label/query/(?P<ancestor_id>\d+)/$',inventory_views.agent_label_query),
#url(r'^inventory/batch/summary/',inventory_views.batch_summary),
# 进销存库存
url(r'^inventory/product/summary/$',inventory_views.batch_summary),
url(r'^inventory/product/summary/(?P<product_id>\d+)/$',inventory_views.batch_summary_details),
url(r'^inventory/stack/demolition/(?P<company_id>\d+)/$',inventory_views.demolition_stack)
# 垛标解除绑定
url(r'^inventory/stack/demolition/(?P<company_id>\d+)/$',inventory_views.demolition_stack),
]
if settings.DEBUG:
......
差异被折叠。
差异被折叠。
......@@ -921,7 +921,7 @@ def qz_toggle_anniversary(request):
# 2020-09-09
@login_required
def channelpromotion(request, id=None):
data = {'form': None, 'is_saved': False, 'companys': [],'triggers':[]}
data = {'form': None, 'is_saved': False, 'companys': [], 'triggers': []}
cur = connection.cursor()
u = request.user
c = u.company
......@@ -944,9 +944,9 @@ def channelpromotion(request, id=None):
subdiv_ids = []
saldivision = []
# 2022-11-29
# 2022-11-29
for t in ChannelPromotionTrigger.objects.all():
data['triggers'].append({'id':str(t.id),'text':t.name})
data['triggers'].append({'id': str(t.id), 'text': t.name})
if u.id != 1:
cur.execute(
......@@ -984,10 +984,10 @@ def channelpromotion(request, id=None):
data['div_ids'] = div_ids
data['subdiv_ids'] = subdiv_ids
#2023-05-04
aformset = AccumulattionFormset(instance=obj)
# 2023-05-04
aformset = AccumulattionFormset(instance=obj)
# 2023-05-25
cformset=CustomizeRebateFormset(instance=obj)
cformset = CustomizeRebateFormset(instance=obj)
else:
form = ChannelPromotionsForm(request.POST, request.FILES, instance=obj)
formset = ChannelRebateFormset(request.POST, request.FILES, instance=obj)
......@@ -995,22 +995,21 @@ def channelpromotion(request, id=None):
# 2023-05-04
aformset = AccumulattionFormset(request.POST, request.FILES, instance=obj)
# 2023-05-25
cformset=CustomizeRebateFormset(request.POST, request.FILES, instance=obj)
cformset = CustomizeRebateFormset(request.POST, request.FILES, instance=obj)
if form.is_valid():
p=form.save()
p = form.save()
if aformset.is_valid():
aformset.save()
if cformset.is_valid():
cformset.save()
#del_ids = []
#for f in formset.deleted_forms:
# del_ids = []
# for f in formset.deleted_forms:
# if f.instance.id:
# del_ids.append(f.instance.id)
#p = form.save()
#for f in formset:
# p = form.save()
# for f in formset:
# f.instance.promotion = p
# if f.is_valid():
# if f.instance.id not in del_ids:
......@@ -1022,9 +1021,9 @@ def channelpromotion(request, id=None):
data['is_saved'] = is_saved
# 2023-05-04
data['aformset']=aformset
data['aformset'] = aformset
# 2023-05-25
data['cformset']=cformset
data['cformset'] = cformset
return render(request, 'sales/channelpromotions.html', data)
......@@ -1956,7 +1955,7 @@ def rebate_period_action(request, what):
data['data'] = d
elif what == 'list_application':
# clmns=['id','经销商/分销商名称','所属战区','申请人' ,'应付款金额','申请提现(元)','微信钱包','银行卡','当前状态','发票','内勤审票','财务审票','出纳付款','申请时间']
# clmns=['id','经销商/分销商名称','所属战区','申请人','应付款金额','申请提现(元)','微信钱包','银行卡','当前状态','发票','内勤审票','财务审票','出纳付款','申请时间']
# clmns=['id','经销商/分销商名称','所属战区','申请人','类别','应付款','提现','税率%','税额','合计','微信钱包','银行卡','状态','发票','内勤','财务','出纳','申请时间']
clmns = ['id', '经销商/分销商', '所属战区', '申请人', '本期奖励', '提现', '税率%', '税额', '合计', '微信钱包',
'银行卡', '状态', '发票', '内勤', '财务', '申请时间']
......
{% load i18n %}
<style>
<style>
.word-wrap{
width: 100%;white-space: normal;word-wrap: break-word;word-break: break-all;
}
......@@ -37,14 +37,14 @@
<script type="text/javascript">
$(document).ready(function(){
var page_length=10;
$(document).ready(function(){
var page_length=10;
var table=$('#tb').DataTable({
dom: 'Bfrtip',
autoWidth: true,
pageLength: page_length,
buttons: [{extend:'excelHtml5',text: '导出到Excel'}],
buttons: [{extend:'excelHtml5',text: '导出到Excel'}],
language:lng,
//order: {{order|safe}},
order: [[ 12, "desc" ]],
......@@ -53,16 +53,40 @@
{% if not allown_delete %}
{ targets: [13], visible: false }
{% endif %}
] ,
data:{{data|safe}},
//columnDefs: [{"targets": [0, 10 ], "visible": false }],
createdRow: function ( row, data, index) {
$(row).attr('obj_id', data[16]);
//if(parseInt(data[4])>0){
// $('td',row).eq(0).addClass("details-control");
//};
if ( $.isEmpty(data[13]) ) {
$('td:eq(12)', row).html(
'<button class="delete btn btn-sm btn-danger">删除</button>'
);
}
{% if show_add %}
$('td:eq(1)', row).html(
'<a class="edit" href="/obj/edit/agent/' +data[16] + '/">' + data[1] + '</a>'
);
$('td:eq(6)',row).html(
'<a class="edit btn btn-sm btn-default " href="/obj/edit/outlets/' + data[16] + '/">' + data[6] + '</a>'
)
{% else %}
$('td:eq(1)', row).html( data[1] );
$('td:eq(6)',row).html( data[6] )
{% endif %}
{#if ( $.isEmpty(data[12]) ) {#}
{# $('td:eq(11)', row).html(#}
{# '<button class="approve btn btn-sm btn-primary">审核通过</button>'#}
{# );#}
{# }#}
}
});
......@@ -79,7 +103,7 @@
success: function(res) {
if(res.e == '') {
var html='<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;width:100%;">',d,s;
for(var i in res.data){
for(var i in res.data){
d=res.data[i];
if(d.remark==''){
s='无特殊情况备注';
......@@ -96,12 +120,12 @@
}
}
});
}
});
}
});
*/
table.columns().every( function () {
var that = this;
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();
......@@ -133,23 +157,23 @@
});
*/
$(".btn-obj-add").click(function () {
$(".btn-obj-add").click(function () {
event.preventDefault();
$.RefreshContent($(this).attr('href'));
$.RefreshContent($(this).attr('href'));
})
$('#tb').on("click","td a.edit",function(event){
event.preventDefault();
$.RefreshContent($(this).attr('href'));
});
event.preventDefault();
$.RefreshContent($(this).attr('href'));
});
$('#tb').on('click','button.approve',function(){
$('#tb').on('click','button.approve',function(){
var tr=$(this).closest('tr');
var td=$(this).closest('td');
var name=$(tr).find('a.edit').text();
var id=$(tr).attr('obj_id');
var msg = name+':\n您确定要通过当前加盟商的审核吗?';
var id=$(tr).attr('obj_id');
var msg = name+':\n您确定要通过当前加盟商的审核吗?';
if (confirm(msg)==true){
$.ajax({
type:'GET',
......@@ -162,13 +186,13 @@
});
};
});
$('#tb').on('click','button.delete',function(){
$('#tb').on('click','button.delete',function(){
var tr=$(this).closest('tr');
var td=$(this).closest('td');
var name=$(tr).find('a.edit').text();
var id=$(tr).attr('obj_id');
var msg ='您确定要删除加盟商"'+name+'"及其下门店吗?';
var id=$(tr).attr('obj_id');
var msg ='您确定要删除加盟商"'+name+'"及其下门店吗?';
if (confirm(msg)==true){
$.ajax({
type:'GET',
......@@ -189,7 +213,7 @@
<ol class="breadcrumb">
<li>{{subtt.0}}</li>
<li>加盟商列表</li>
<li>加盟商列表</li>
</ol>
......@@ -202,7 +226,7 @@
</a>
</span>
</div>
</div>
</div>
{% endif %}
......@@ -217,11 +241,14 @@
</thead>
<tbody></tbody>
<tfoot>
{% for c in clmns %}
<th><input type="text" placeholder="{{c}}"></th>
{% endfor %}
{% for c in clmns %}
<th><input type="text" placeholder="{{c}}"></th>
{% endfor %}
</tfoot>
</table>
</div>
</div>
</div>
{% load i18n %}
<style>
#tb tbody .r{
font-weight:bold;
color:red;
}
</style>
<ol class="breadcrumb">
<li> {% trans "进出存报表" %} </li>
<li> {% trans "出入库统计" %} </li>
</ol>
<script type="text/javascript">
$(document).ready(function(){
$('.datepicker').datepicker({dateFormat: 'yy-mm-dd'});
$('.datepicker').datepicker('setDate',new Date());
setDatePickerZh();
$('#product_label').autocomplete({
source: function(request, response) {
$.ajax({
url: '/obj/ajax/autocomplete/product/',
dataType: "json",
data: {
term: $("#product_label").val() ,//搜索栏里的内容
//company_id: $('#id_company').val() ,//额外参数
},
success: function(data) {
response(data);
}
});
},
select: function (event, ui) {
$("#product_id").val(ui.item.value);
$("#product_label").val(ui.item.label);
return false;
}
});
$('#agent_label').autocomplete({
source: function(request, response) {
$.ajax({
url: '/obj/ajax/autocomplete/agent/',
dataType: "json",
data: {
term: $("#agent_label").val() ,//搜索栏里的内容
//company_id: $('#id_company').val() ,//额外参数
},
success: function(data) {
response(data);
}
});
},
select: function (event, ui) {
$("#agent_id").val(ui.item.value);
$("#agent_label").val(ui.item.label);
return false;
}
});
$('.btn-qry').click(function(){
var product_id='',agent_id='',code='';
if (!$.isEmpty($('#product_id').val())){
product_id=$('#product_id').val();
};
if (!$.isEmpty($('#agent_id').val())){
agent_id=$('#agent_id').val();
};
if (!$.isEmpty($('#code').val())){
code=$('#code').val();
};
date_fr=$('#dt_fr').val();
date_to=$('#dt_to').val();
var params=[];
if(product_id!=''){
params.push('product_id='+product_id);
params.push('product_label='+$('#product_label').val());
};
if(agent_id!=''){
params.push('agent_id='+agent_id);
params.push('agent_label='+$('#agent_label').val());
};
if(code!=''){
params.push('code='+code);
};
if(date_fr!=''){params.push('date_fr='+date_fr)};
if(date_to!=''){params.push('date_to='+date_to)};
if(params.length==0){
bootbox.alert("{% trans '请先输入查询条件!'%}");
}else{
$.RefreshContent('{{request.path}}?'+params.join('&'));
}
});
{% ifnotequal params.dt_fr '' %}
$('#dt_fr').val('{{params.dt_fr}}');
{% endifnotequal %}
{% ifnotequal params.dt_to '' %}
$('#dt_to').val('{{params.dt_to}}');
{% endifnotequal %}
{% ifnotequal params.product_id '' %}
$('#product_id').val('{{params.product_id}}');
$("#product_label").val('{{params.product_label}}');
{% endifnotequal %}
{% ifnotequal params.agent_id '' %}
$('#agent_id').val('{{params.agent_id}}');
$("#agent_label").val('{{params.agent_label}}');
{% endifnotequal %}
var table=$('#tb').DataTable({
//"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
//"bLengthChange":true,
dom: 'Bfrtip',
autoWidth: false,
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();
}
});
});
$('#tb').on("click","td a",function(event){
$(event.target.parentNode).addClass('row_selected');
event.preventDefault();
$.OpenDlg($(this).attr('href'),'产品库存-明细列表',1000,700);
});
});
</script>
<form role="form" class="form-inline" style="display: none;margin-top:0px;">
<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>
{% ifequal user.company.level_id 1 %}
<div class="col-sm-2 input-group">
<input class="form-control" id="product_label" placeholder='所有产品' />
<input type='hidden' id='product_id' />
</div>
{% ifequal voucher.id 2 %}
<div class="col-sm-2 input-group">
<input class="form-control" id="agent_label" placeholder='所有经销商' />
<input type='hidden' id='agent_id' />
</div>
{% endifequal %}
{% ifequal voucher.id 1 %}
<div class="col-sm-2 input-group">
<input class="form-control" id="code" placeholder='所有生产批次' />
</div>
{% endifequal %}
{% endifequal %}
<div style="float:right;">
<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>
<div id="inventory-list" class="table-responsive">
<div class='x_panel'>
<table id="tb" class="table table-striped table-bordered dt-responsive" width="100%" >
<thead><tr>
{% for c in clmns %}
<th>{{c}}</th>
{% endfor %}
</tr></thead>
<tbody></tbody>
<tfoot>
{% for c in clmns %}
<th><input type="text" placeholder="{{c}}"></th>
{% endfor %}
</tfoot>
</table>
</div>
</div>
{% load i18n %}
<style>
.inventory-tt .g{
color:green;
margin-right:10px;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
var table=$('#tb-dlg').DataTable({
dom: 'Bfrtip',
autoWidth: false,
buttons: [{extend:'excelHtml5',text:'导出到Excel'}],
language:lng,
destroy:true,
data:{{dataset|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();
}
});
});
});
</script>
<div class='inventory-tt'>
<span>产品名称:<span class='g'>{{p_name}}</span></span>
</div>
<div class="clearfix"></div>
<div id="inventory-list" class="table-responsive">
<table id="tb-dlg" class="table table-striped table-bordered dt-responsive" width="100%">
<thead>
{% for c in clmns %}
<th>{{c}}</th>
{% endfor %}
</thead>
<tbody></tbody>
<tfoot>
{% for c in clmns %}
<th><input tyext='text' placeholder='{{c}}' /></th>
{% endfor %}
</tfoot>
</table>
</div>
{% load i18n %}
<style>
#tb tbody .r{
font-weight:bold;
color:red;
}
</style>
<ol class="breadcrumb">
<li> {% trans "物流查询" %}</li>
<li> {% trans "数据推送" %}</li>
</ol>
<script type="text/javascript">
$(document).ready(function(){
$('.datepicker').datepicker({dateFormat: 'yy-mm-dd'});
$('.datepicker').datepicker('setDate',new Date());
setDatePickerZh();
$('.btn-qry').click(function(){
var product_id='',agent_id='',code='';
date_fr=$('#dt_fr').val();
date_to=$('#dt_to').val();
var params=[];
if(date_fr!=''){params.push('date_fr='+date_fr)};
if(date_to!=''){params.push('date_to='+date_to)};
if(params.length==0){
bootbox.alert("{% trans '请先输入查询条件!'%}");
}else{
$.RefreshContent('{{request.path}}?'+params.join('&'));
}
});
{% ifnotequal dt_fr '' %}
$('#dt_fr').val('{{dt_fr}}');
{% endifnotequal %}
{% ifnotequal dt_to '' %}
$('#dt_to').val('{{dt_to}}');
{% endifnotequal %}
function RefreshData(){
date_fr=$('#dt_fr').val();
date_to=$('#dt_to').val();
var params=[];
if(date_fr!=''){params.push('date_fr='+date_fr)};
if(date_to!=''){params.push('date_to='+date_to)};
var url='/thirdparty/delivery/post/data/?'+params.join('&');
$.ajax({
type:'GET',
processData: false,
contentType: 'application/json; charset=utf-8',
url:url,
success:function(data){
var table=$('#tb').DataTable({
dom: 'Bfrtip',
column:data.clmns,
autoWidth: false,
buttons: [{extend:'excelHtml5',text:'导出到Excel'}],
language:lng,
columns:data.clmns,
data:data.data,
createdRow: function( nRow, aData, iDataIndex ) {
if ( !$.isEmpty(aData.tm_push) ) {
$('td:eq(11)', nRow).html(
'<button class="btn btn-primary btn-xs btn-log" batch_code='+aData.batch_code+' '+
'href="/thirdparty/delivery/post/log/?batch_id='+aData.batch_id+'">查看</button>'
);
}
}
});
table.column(0).visible(false);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert('连接服务器失败');
return;
}
});
//if(params.length==0){
// bootbox.alert("{% trans '请先输入查询条件!'%}");
//}else{
// $.RefreshContent('{{request.path}}?'+params.join('&'));
//}
};
RefreshData();
$('#tb').on('click','.btn-log',function(){
var url=$(this).attr('href');
var code=$(this).attr('batch_code')
$.ajax({
type:'GET',
processData: false,
contentType: 'application/json; charset=utf-8',
url:url,
success:function(data){
var html='';
for (var i in data){
html=html+"<tr>"+
"<td>"+data[i].time+"</td>"+
"<td>"+data[i].result+"</td>"+
"</tr>";
};
$('#dlg-log .modal-title').html("单据编号:"+code);
$('#tb-post-log tbody').html(html);
$('#dlg-log').modal('show');
}
});
});
});
</script>
<form role="form" class="form-inline" style="margin-top:0px;">
<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 style="float:right;">
<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>
<div id="post-list" class="table-responsive">
<div class='x_panel'>
<table id="tb" class="table table-striped table-bordered dt-responsive" width="100%" >
<thead><tr>
{% for c in clmns %}
<th>{{c.title}}</th>
{% endfor %}
</tr></thead>
<tbody></tbody>
<tfoot>
{% for c in clmns %}
<th><input type="text" placeholder="{{c.title}}"></th>
{% endfor %}
</tfoot>
</table>
</div>
</div>
<div class="modal fade" id="dlg-log" 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">&times;</button>
<h4 class="modal-title"></h4>
</div>
<div class="modal-body">
<table id='tb-post-log' class="table table-striped table-bordered dt-responsive" width="100%" >
<thead><tr>
<th>推送时间</th>
<th>返回信息</th>
</tr></thead>
<tbody></tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论