提交 6847e2d5 authored 作者: 李思鑫's avatar 李思鑫

change

上级 acfae641
......@@ -634,7 +634,8 @@ def ajaxBanquetList(request):
"(select name from banquet_policy where id = strategy_id), "+\
"reason, "+\
"actual_qty_x, "+\
"actual_qty_p "+\
"actual_qty_p,"+\
"COALESCE ((select last_name from company_user WHERE id = permiter_id ), '')"+\
"from banquet_apply "+sWhere+" order by id desc"
cur.execute(sql)
rs = cur.fetchall()
......@@ -669,6 +670,7 @@ def ajaxBanquetList(request):
'reason': r[25],
'actual_qty_x': r[26],
'actual_qty_p': r[27],
'permiter': r[28]
}
if r[12] == 0:
......
......@@ -7027,6 +7027,42 @@ def ajax_company(request,obj):
return ajaxGetWorkCardByLabelCode(request)
elif obj == 'getCompanyUserbyName':#通过名称模糊查询user
return ajaxGetCompanyUserbyName(request)
elif obj == 'getCompanyByName':
return ajaxGetCompanyByName(request)
def ajaxGetCompanyByName(request):
data={
'e':'',
'list':[]
}
name=request.GET.get('name','')
ancestor_id=request.GET.get('ancestor_id','')
parent_id=request.GET.get('parent_id','')
is_terminal=request.GET.get('is_terminal','')
if name:
sWhere = f"name like '%{name}%' and is_delete=false"
if ancestor_id:
sWhere += f" and ancestor_id={ancestor_id}"
if is_terminal:
sWhere += f" and is_terminal={is_terminal} "
if parent_id:
sWhere += f" and parent_id={parent_id}"
sql = f"""
select id,name from company_company
where {sWhere}
"""
cur=connection.cursor()
cur.execute(sql)
for r in cur.fetchall():
data['list'].append({
'id':r[0],
'name':r[1],
})
else:
data['e'] ='数据丢失'
return JsonResponse(data)
#用户名称模糊搜索
def ajaxGetCompanyUserbyName(request):
......
......@@ -677,6 +677,10 @@ urlpatterns = [
#2024-10-11 lisin 查询最近一次物流记录
url(r'^wx/ajax/recent_inventory_record/$', wx_views.ajax_recent_inventory_record),
#2024-12-13 lisin 怀庄大坛酒 nfc绑定产品信息
url(r'^wx/ajax/get_nfc_bind_product/$', wx_views.get_nfc_bind_product),
#2020-08-04
url(r'^wx/fw/wl/$', wx_views.fwcode_to_wlcode),
......@@ -1184,7 +1188,7 @@ urlpatterns = [
url(r'^test/consumer_winner_hit/$', sal_views.test_consumer_winner_hit),
url(r'^test/zsk_pay/$', wx_views.test_zsk),
# url(r'^test/zsk_pay/$', wx_views.test_zsk),
url(r'^wx/kangnian/terminal/$', wx_views.kangnian_getTerminal),
......
......@@ -405,7 +405,6 @@ class Activity_Person_Lottery_Plan_Form(ModelForm):
fields = '__all__'
widgets = {
'company': forms.HiddenInput(),
'win_scan_num': forms.HiddenInput(),
}
def __init__(self, *args, **kwargs):
self._user = kwargs.pop('user')
......
......@@ -2951,7 +2951,7 @@ class Activity_Person_Lottery_Plan(models.Model):
(1,_('每人都中'))), default=0)
remark = models.CharField(_('备注说明'), max_length=100, blank=True, null=True)
tm = models.DateTimeField(_('时间'), auto_now_add=True)
# win_scan_num=models.IntegerField(_('第几次扫码中奖'))
win_scan_num=models.IntegerField(_('第几次扫码中奖'),default=1)
class Meta:
verbose_name = _('活动人员抽奖计划')
......
差异被折叠。
{% load i18n %}
<ol class="breadcrumb">
<li>{% trans "存货管理" %}</li>
<li>{% trans "发货TXT上传" %}</li>
<li>{% trans "发货TXT上传2" %}</li>
</ol>
<script type="text/javascript">
$(document).ready(function(){
//2024-11-11
{% ifequal request.user.company_id request.user.ancestor_id %}
q_all='1';
{% else %}
q_all='0';
{% endifequal %}
$('#obj_form form .form-group').css('min-height','35px');
$('#product_label').autocomplete({
source: function(request, response) {
$.ajax({
url: '/obj/ajax/autocomplete/product/',
url: '/obj/ajax/autocomplete/product/?query_all=1',
dataType: "json",
data: {
term: $("#product_label").val() ,//搜索栏里的内容
......@@ -27,11 +34,12 @@
$("#product_label").val(ui.item.label);
return false;
}
});
});
/*
$('#company_to_label').autocomplete({
source: function(request, response) {
$.ajax({
url: '/obj/ajax/autocomplete/agent/?query_all=1',
url: '/obj/ajax/autocomplete/agent/?query_all='+q_all,
dataType: "json",
data: {
term: $("#product_label").val() ,//搜索栏里的内容
......@@ -48,11 +56,12 @@
return false;
}
});
*/
$('#company_to_label').autocomplete({
source: function(request, response) {
$.ajax({
url: '/obj/ajax/autocomplete/agent/?query_all=1',
url: '/obj/ajax/autocomplete/agent/?query_all='+q_all,
dataType: "json",
data: {
term: $("#company_to_label").val() ,//搜索栏里的内容
......@@ -70,6 +79,7 @@
}
});
console.log('-----',$("#store_to_label").val())
$('#store_fr_label').autocomplete({
source: function(request, response) {
$.ajax({
......@@ -90,8 +100,9 @@
return false;
}
});
$('#store_to_label').autocomplete({
$('#store_to_label').autocomplete({
source: function(request, response) {
$.ajax({
url: '/obj/ajax/autocomplete/store/',
......@@ -111,7 +122,6 @@
return false;
}
});
$('input[name="info"]').change(function(){
info=$('input[name="info"]:checked').attr('value');
if(info=='custom'){
......@@ -149,10 +159,10 @@
switch($('#vtype_id').val()){
case '2':
if ($.isEmpty($("#company_to_id").val())||$.isEmpty($("#product_id").val())||$.isEmpty($("#store_fr_id").val())||$.isEmpty($("#column").val())){
if ($.isEmpty($("#company_to_id").val())||$.isEmpty($("#product_id").val())||$.isEmpty($("#column").val())){
//bootbox.alert("{% trans '经销商,产品,发货仓库,标签号码所在列不能为空!' %}", function() {});
toastr.error(
"经销商,产品,仓库,标签号码所在列不能为空!",
"经销商,产品,标签号码所在列不能为空!",
"操作错误:",
{timeOut: 800, positionClass: "toast-center-center"}
);
......
......@@ -31,7 +31,11 @@
border-bottom: 1px solid gray;
}
</style>
{% if e %}
<div class="alert alert-danger">
{{ e }}
</div>
{% endif %}
<div class="alert alert-success" role="alert" style="display: none">保存成功!</div>
<div class="form-group">
<label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'batch_no' %} </label>
......@@ -63,6 +67,10 @@
<label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'win_method' %} </label>
<div class="col-sm-10">{{ form.win_method }}</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'win_scan_num' %} </label>
<div class="col-sm-10">{{ form.win_scan_num }}</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'remark' %} </label>
<div class="col-sm-10">{{ form.remark }}</div>
......@@ -70,14 +78,9 @@
<div class="form-group">
<label class="col-sm-2 control-label ">{% get_verbose_field_name form.instance 'consumer_ids' %} </label>
<ul>
{% for id in form.consumer_ids %}
<li>{{ id }}</li>
{% empty %}
<label class="col-sm-2 control-label">{% trans "添加opendi" %}</label>
<input type="text" name="id" class="col-sm-10"/>
{% endfor %}
</ul>
<div class="col-sm-10">
<textarea type="text" name="consumer_ids" id="id_consumer_ids" required="" class="form-control" placeholder="多个用户id请用英文,号隔开"></textarea>
</div>
</div>
<div>
......
......@@ -36,15 +36,18 @@
$('#dt_fr').val('{{date_from}}');
$('#dt_to').val('{{date_to}}');
$('#hx_type').val('{{hx_type}}');
$('.btn-qry').click(function () {
var date_from, date_to;
date_fr = $('#dt_fr').val();
date_to = $('#dt_to').val();
hx_type = $('#hx_type').val();
var params = [];
if (date_fr != '') { params.push('date_from=' + date_fr) };
if (date_to != '') { params.push('date_to=' + date_to) };
if (hx_type != '') { params.push('hx_type=' + hx_type) };
if (params.length == 0) {
bootbox.alert("{% trans '请先输入查询条件!'%}");
} else {
......@@ -148,6 +151,13 @@
<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-addon">{% trans "核销类型"%}</span>
<select class="form-control" id="hx_type">
<option value="1">{% trans "消费者"%}</option>
<option value="2" selected>{% trans "终端/经销商"%}</option>
</select>
</div>
<div class="col-sm-2 input-group">
<span class='input-group-btn'>
<a type="button" class='btn btn-primary btn-qry'>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论