提交 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 = _('活动人员抽奖计划')
......
......@@ -590,7 +590,7 @@ def edit_obj(request, obj_name, id=None):
data['form'] = form
data['is_saved'] = is_saved
if u.id in [1, 3506, 3886, 3901, 2908, 3214 ,109538, 110399, 126139]:
if u.id in [1, 3506, 3886, 3901, 2908, 3214 ,109538, 110399, 126139, 82470]:
can_edit = True
# if u.id == 3886:
# can_edit=True
......@@ -696,7 +696,6 @@ def ajax_consumer_redeem(request):
}
data['agent'] = agent
if w.award_cat == '福袋':
label_code = request.GET.get('label_code', '')
if label_code:
......@@ -4958,8 +4957,7 @@ def activity_lottery(request):
'e': ''
}
activity_id = request.POST.get('activity_id', '')
batch_id = request.POST.get('batch_id', '')
batch_id=batch_id[0:-1]
batch_ids = request.POST.get('batch_id', '')[0:-1]
awards_ = request.POST.get('awards', '')
remark = request.POST.get('remark', '')
lotteryMethod = request.POST.get('lotteryMethod', '')
......@@ -4969,15 +4967,17 @@ def activity_lottery(request):
is_terminal_rebate=request.POST.get('is_terminal_rebate','')
code_range = request.POST.get('code_range', '')
if activity_id and batch_id and awards_:
if activity_id and batch_ids and awards_:
awards = json.loads(awards_)
cur = connection.cursor()
cur.execute("select product_id,code,company_to_id from inventory_batch where id = " + batch_id + "")
r = cur.fetchone()
rs = []
cur.execute("select product_id,code,company_to_id,id from inventory_batch where id in (" + batch_ids + ")")
batchs = cur.fetchall()
for r in batchs:
product_id = r[0]
batch_no = r[1]
agent_id = r[2]
batch_id = r[3]
codesql = "code"
if abcode == 'B':
codesql = "(select code_b from label.lbl_abcode where code_a = code)"
......@@ -4986,10 +4986,17 @@ def activity_lottery(request):
tb_name = 'label.t'+code_range
s = f"""select {codesql}, id, package_id, parent_id from {tb_name} a
where parent_id in (SELECT label_id from stkdetails.c{ancestor_id} WHERE batch_id = {batch_id}) and package_id=1 order by parent_id"""
# 如果是箱标布奖
if lotteryMethod == '4':
s = f"""
select code,id,package_id,parent_id from {tb_name} where id in (
SELECT label_id from stkdetails.c{ancestor_id} WHERE batch_id = {batch_id} and package_id=3
)
"""
cur.execute(s)
rs = cur.fetchall()
if len(rs) == 0:
rows = cur.fetchall()
if len(rows) == 0:
if lotteryMethod != '4':
cur.execute(f"""
select {codesql},id,package_id,(select parent_id from {tb_name} where a.parent_id=id) parent_id from {tb_name} a
where parent_id in (
......@@ -5000,31 +5007,28 @@ def activity_lottery(request):
and package_id=1
order by parent_id
""")
rs = cur.fetchall()
rows = cur.fetchall()
for row in rows:
rs.append({
'label_code': row[0],
'label_id': row[1],
'label_pkg': row[2],
'label_pk_id': row[3],
'product_id': product_id,
'batch_no': batch_no,
'agent_id': agent_id,
'batch_id': batch_id
})
if lotteryMethod == "1":
if lotteryMethod == "1" or lotteryMethod == '4':
shuffle(rs)
i = 0
is_terminal_rebate = 'f'
for r in awards:
award_id = r['award_id']
num = r['num']
for n in range(0, num):
s = LotterySeeds(
company_id=company_id,
activity_id=activity_id,
award_id=award_id,
label_code=rs[i][0],
label_pkg=rs[i][2],
label_id=rs[i][1],
label_pk_id=rs[i][3],
product_id=product_id,
remark=remark,
agent_id=agent_id,
batch_no=batch_no,
batch_id=batch_id,
is_terminal_rebate=is_terminal_rebate
)
s.save()
rs[i]['award_id'] = award_id
i = i + 1
elif lotteryMethod == "2" or lotteryMethod == "3":
boxBottleNum = int(request.POST.get('boxBottleNum', '0'))
......@@ -5054,33 +5058,49 @@ def activity_lottery(request):
continue
for n in range(0, num):
s = LotterySeeds(
company_id=company_id,
activity_id=activity_id,
award_id=award_id,
label_code=r[i][0],
label_pkg=r[i][2],
label_id=r[i][1],
label_pk_id=r[i][3],
product_id=product_id,
remark=remark,
agent_id=agent_id,
batch_no=batch_no,
batch_id=batch_id,
is_terminal_rebate=is_terminal_rebate
)
s.save()
rs[i]['award_id'] = award_id
i = i + 1
a['lotteried_num'] = a['lotteried_num'] + 1
if group:
lottery_groups.append(group)
is_terminal_rebate = 't' if is_terminal_rebate == '1' else "f"
if rs:
values = []
award_id = 0
label_code = ''
label_pkg = ''
label_id = 0
label_pk_id = 0
product_id = 0
agent_id = 0
batch_no = ''
batch_id = 0
for r in rs:
if 'award_id' not in r:
continue
award_id = r['award_id'] if r['award_id'] else 'null'
label_code = r['label_code']
label_pkg=r['label_pkg'] if r['label_pkg'] else 1
label_id=r['label_id']
label_pk_id = r['label_pk_id'] if r['label_pk_id'] else 0
product_id = r['product_id'] if r['product_id'] else 0
agent_id=r['agent_id'] if r['agent_id'] else 0
batch_no=r['batch_no'] if r['batch_no'] else ''
batch_id=r['batch_id'] if r['batch_id'] else 0
values.append(f"({str(company_id)},{activity_id},{str(award_id)},'{label_code}',{str(label_pkg)},{str(label_id)},{str(label_pk_id)},{str(product_id)},{str(agent_id)},'{batch_no}',{str(batch_id)},'{remark}','{is_terminal_rebate}')")
n = math.ceil(len(values) / 1000)
for idx in range(n):
s = f"insert into sales_lotteryseeds (company_id, activity_id, award_id, label_code, label_pkg, label_id, label_pk_id, product_id, agent_id, batch_no, batch_id, remark, is_terminal_rebate) values "
if n == 0:
cs = values[0: 1000]
else:
cs = values[idx*1000: idx*1000+1000]
s = s + ','.join(cs)
cur.execute(s)
else:
data['e'] = '数据丢失'
return JsonResponse(data)
# 单枚布奖
@login_required
def lottery_single(request, id=None):
......@@ -5098,6 +5118,7 @@ def lottery_single(request, id=None):
award = request.POST.get('award', '')
award2 = request.POST.get('award2', '')
remark = request.POST.get('remark', '')
label_type = request.POST.get('label_type', '')
company_id = request.user.company.id
if label_codes and activity and award:
# o = form.save(False)
......@@ -5112,6 +5133,7 @@ def lottery_single(request, id=None):
#print(label_code)
label_id = None
package_id = None
if label_type == 'a':
cur.execute(
"select coalesce((select code_a from label.lbl_abcode where code_b='" + label_code + "'),'" + label_code + "')")
rrrr = cur.fetchone()
......@@ -5833,7 +5855,7 @@ def do_hexiao(request):
# 如果不需要审核
if not is_need_permit:
record.is_money_returned = True
if company_id == "199264" or company_id == "209388":
if company_id == "199264" or company_id == "209388" or company_id == "200399":
record.is_need_agent_writeoff = True
if award.send_hb_after_hexiao:
......@@ -5942,6 +5964,8 @@ def hexiao_record_list(request):
sub_only: bool = request.GET.get('sub_only')
applyer_id = request.GET.get('applyer_id', '')
is_agent_writeoff = request.GET.get('is_agent_writeoff', '')
dt_default = datetime.datetime.now().strftime('%Y-%m-%d')
dt_fr_default = (datetime.datetime.now() - datetime.timedelta(days=7)).strftime('%Y-%m-%d')
dt_fr = request.GET.get('tm_start', dt_fr_default)
......@@ -5949,17 +5973,20 @@ def hexiao_record_list(request):
if company_id:
cur = connection.cursor()
if agent_id:
swhere = f"company_id={company_id} and agent_id={agent_id} and tm::date >= '{dt_fr}' and tm::date <= '{dt_to}'"
elif user_id:
swhere = f"company_id={company_id} and user_id={user_id} and is_need_dispatch = true and is_permit = true and tm::date >= '{dt_fr}' and tm::date <= '{dt_to}'"
if applyer_id: #核销人
swhere += f"and applyer_id={applyer_id}"
if sub_only:
parent_agent_id: bool = request.GET.get('parent_agent_id')
swhere += f" AND parent_agent_id = {parent_agent_id}"
if applyer_id: #核销人
swhere += f"and applyer_id={applyer_id}"
if is_agent_writeoff:
swhere += f" and is_agent_writeoff = {is_agent_writeoff}"
# 2023-03-25 川酒客制化排序
is_redeemed = ''
if company_id:
......@@ -6242,7 +6269,7 @@ def do_hexiao_accept(request):
@login_required
def hexiao_record(request):
data = {'data': [], 'clmns': [], 'e': [], 'subtt': ['营销活动', '奖品核销'], 'murl': '', 'dt': False, 'add': True}
data['clmns'] = ['级别','核销单位', '核销人', '核销人名称', '活动信息', '奖品名称', '消费者信息', '状态', '备注', '标签序号', '时间',
data['clmns'] = ['级别', '核销单位','父级', '核销人', '核销人名称', '活动信息', '奖品名称', '消费者信息', '状态', '备注', '标签序号', '时间',
'审核', '操作']
data['show_add'] = True
data['murl'] = '/company/news/edit/'
......@@ -6276,7 +6303,8 @@ def hexiao_record(request):
is_permit,
coalesce((select username from company_user where id = applyer_id),''),
coalesce((select label_code from sales_consumerwinner where id = winner_id),''),
(select (select name from company_level where id = c.level_id) from company_company c where name=agent_name and ancestor_id = company_id ),
(select (select name from company_level where id = c.level_id) from company_company c where id= agent_id),
coalesce((select name from company_company where id = (select parent_id from company_company where id = agent_id)),''),
coalesce((select last_name from company_user where id = applyer_id),'')
FROM sales_hexiao_record WHERE
company_id = """ + company_id + """ and
......@@ -6298,7 +6326,7 @@ def hexiao_record(request):
tm = r[11]
is_permit = r[12]
agent_level = r[15] if r[15] else ''
applyer_name = r[16]
applyer_name = r[17]
dispatch_status = ''
if is_need_dispatch:
......@@ -6340,6 +6368,7 @@ def hexiao_record(request):
data['data'].append([
agent_level,
agent_name,
r[16],
r[13],
applyer_name,
activity_name,
......@@ -6656,13 +6685,14 @@ def hexiao_get_my_return_money(request):
@login_required
def no_hexiao_record(request):
data = {'data': [], 'clmns': [], 'e': [], 'subtt': ['奖品核销', '未核销记录'], 'murl': '', 'dt': False, 'add': True}
data['clmns'] = [_('活动名称'),_('奖项'), _('奖品'), _('微信昵称'), _('微信头像'), _('姓名'), _('电话'), _('地址'), _('中奖时间'), _('领奖时间'), _('经销商'), _('区域'),_('生产批次'),_('标签序号'),_('箱码'),_('备注')]
data['clmns'] = [_('级别'),_('经销商'),_('活动名称'),_('奖项'), _('奖品'), _('微信昵称'), _('微信头像'), _('姓名'), _('电话'), _('地址'), _('中奖时间'), _('领奖时间'), _('经销商'), _('区域'),_('生产批次'),_('标签序号'),_('箱码'),_('备注')]
data['show_add'] = True
data['murl'] = '/company/news/edit/'
d = datetime.datetime.now()
dt_fr = request.GET.get('date_from', (d + datetime.timedelta(days=-7)).strftime('%Y-%m-%d'))
dt_to = request.GET.get('date_to', (d + datetime.timedelta(days=1)).strftime("%Y-%m-%d"))
hx_type = request.GET.get('hx_type', '2') #默认为经销终端的待核销记录
if dt_fr > dt_to:
dt_fr, dt_to = dt_to, dt_fr
......@@ -6670,10 +6700,14 @@ def no_hexiao_record(request):
dt_fr, dt_to = dt_fr, dt_to
data["date_from"] = dt_fr
data["date_to"] = dt_to
data["hx_type"] = hx_type
company_id = str(request.user.company.id)
sWhere=" where dt between '"+dt_fr+"' and '"+dt_to+"' "
cur = connection.cursor()
if hx_type == '1':
data['clmns'] = [_('活动名称'),_('奖项'), _('奖品'), _('微信昵称'), _('微信头像'), _('姓名'), _('电话'), _('地址'), _('中奖时间'), _('领奖时间'), _('经销商'), _('区域'),_('生产批次'),_('标签序号'),_('箱码'),_('备注')]
s="select " +\
"coalesce((select name from sales_activities where id=a.activity_id),'')," +\
"coalesce(b.name,'未中奖'),"+\
......@@ -6709,8 +6743,92 @@ def no_hexiao_record(request):
data['data'].append([
r[0], r[1], r[2], r[3], img, r[5],r[6], r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[17],r[14]
])
return render(request, 'sales/hexiao_record_no.html', data)
elif hx_type == '2':
data['clmns'] = ['待核销上级','待核销上级级别','已核销单位', '核销人', '核销人名称', '活动信息', '奖品名称', '消费者信息', '状态', '备注', '标签序号', '时间' ]
cur.execute("""SELECT
id,
agent_name,
activity_name,
award_name,
(select wx_headimgurl from sales_consumeraccount where id = consumer_id),
(select wx_nickname from sales_consumeraccount where id = consumer_id),
is_need_dispatch,
is_dispatched,
is_need_money_return,
is_money_returned,
remark,--10
tm,
is_permit,
coalesce((select username from company_user where id = applyer_id),''),
coalesce((select label_code from sales_consumerwinner where id = winner_id),''),
(select (select name from company_level where id = c.level_id) from company_company c where name=agent_name and ancestor_id = company_id ),
coalesce((select last_name from company_user where id = applyer_id),''),
(select (select name from company_company where id = c.parent_id) from company_company c where id=agent_id and ancestor_id = company_id),
(select (select ((select name from company_level where id = up_c.level_id)) from company_company up_c where id = c.parent_id) from company_company c where id=agent_id and ancestor_id = company_id )
FROM sales_hexiao_record WHERE
company_id = """ + company_id + """ and is_agent_writeoff=False and is_need_agent_writeoff=True and
(tm BETWEEN '""" + dt_fr + """' and '""" + dt_to + """') order by id desc""")
rows = cur.fetchall()
for r in rows:
id = r[0]
agent_name = r[1]
activity_name = r[2]
award_name = r[3]
wx_headimgurl = r[4]
wx_nickname = r[5]
is_need_dispatch = r[6]
is_dispatched = r[7]
is_need_money_return = r[8]
is_money_returned = r[9]
remark = r[10]
tm = r[11]
is_permit = r[12]
agent_level = r[15] if r[15] else ''
applyer_name = r[16]
parent_company_name = r[17] if r[17] else '/'
parent_company_level = r[18] if r[18] else '/'
dispatch_status = ''
if is_need_dispatch:
if is_dispatched:
dispatch_status = '已配送'
else:
dispatch_status = '<span style="color:#F00;line-height:0">需要配送</span>'
else:
dispatch_status = '不需要配送'
# 如果是代金券
if is_need_money_return:
if is_money_returned:
dispatch_status = '已返现'
else:
dispatch_status = '<span style="color:#F00;line-height:0">需要返现</span>'
remark = '无'
if remark:
remark = remark
img = ''
if wx_headimgurl:
img = "<img src='" + wx_headimgurl + "' style='width:30px' /> " + wx_nickname
data['data'].append([
parent_company_name,
parent_company_level,
# agent_level,
agent_name,
r[13],
applyer_name,
activity_name,
award_name,
img,
# consumer_name+consumer_phone,
dispatch_status,
remark,
r[14],
tm.strftime("%Y-%m-%d %H:%M:%S"),
])
return render(request, 'sales/hexiao_record_no.html', data)
@login_required
def label_scan_list(request):
......@@ -7539,12 +7657,12 @@ def marketActivityList(request, obj):
if h['redeemProducts']['value']:
for pp in h['redeemProducts']['value']:
redeemProducts=''
if pp['name']:
if 'name' in pp and pp['name']:
redeemProducts=pp['name']
if pp['qty_x']:
if 'qty_x' in pp and pp['qty_x']:
redeem_x=str(pp['qty_x'])+'箱'
redeemProducts=redeemProducts+redeem_x
if pp['qty_p']:
if 'qty_p' in pp and pp['qty_p']:
redeem_p=str(pp['qty_p'])+'瓶'
redeemProducts=redeemProducts+redeem_p
b.append(redeemProducts)
......@@ -10254,6 +10372,7 @@ def activity_person_lottery_plan_list(request):
@login_required
def activity_person_lottery_plan_edit(request, id=None):
e = None
if id:
obj = Activity_Person_Lottery_Plan.objects.get(id=int(id))
else:
......@@ -10272,7 +10391,8 @@ def activity_person_lottery_plan_edit(request, id=None):
batch_no = request.POST.get('batch_no', None)
win_method = request.POST.get('win_method', None)
company_id = request.user.company.id
if tm_start and tm_end and activity and award and consumer_ids:
win_scan_num = request.POST.get('win_scan_num', None)
if tm_start and tm_end and activity and award and consumer_ids and win_scan_num:
obj = Activity_Person_Lottery_Plan()
obj.company_id = company_id
......@@ -10284,9 +10404,10 @@ def activity_person_lottery_plan_edit(request, id=None):
obj.batch_no = batch_no
obj.win_method = win_method
obj.consumer_ids = consumer_ids.split(',')
obj.win_scan_num = win_scan_num
obj.save()
return render(request, 'sales/activity_person_lottery_plan.html', {'form': form})
return render(request, 'sales/activity_person_lottery_plan.html', {'form': form, 'e':e})
@login_required
def activity_person_lottery_plan_delete(request, id=None):
......
{% 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() ,//搜索栏里的内容
......@@ -28,10 +35,11 @@
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({
......@@ -91,6 +101,7 @@
}
});
$('#store_to_label').autocomplete({
source: function(request, response) {
$.ajax({
......@@ -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,14 +36,17 @@
$('#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 '请先输入查询条件!'%}");
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论