设备导入bug
This commit is contained in:
parent
68b2e848f2
commit
06d358c568
|
@ -457,9 +457,9 @@ def drequipments(companyid,path):
|
|||
numsdict[num]=name
|
||||
i = i+1
|
||||
if numsdict:
|
||||
return {'code':1,'msg':'全部导入成功!'}
|
||||
else:
|
||||
return {'code':2,'msg':'部分未导入成功!','info':numsdict}
|
||||
else:
|
||||
return {'code':1,'msg':'全部导入成功!'}
|
||||
|
||||
|
||||
def drusers(companyid,path):
|
||||
|
|
|
@ -382,12 +382,12 @@
|
|||
removeLoading();
|
||||
if (data.code == 1) {
|
||||
$.messager.alert('提示', data.msg, 'info', function () {
|
||||
$("#main").panel({ href: 'html/equipment', title: '设备设施' });
|
||||
$("#sbtable").datagrid('reload');
|
||||
});
|
||||
}
|
||||
else if (data.code == 2) {
|
||||
$.messager.alert('提示', data.msg + data.info, 'info', function () {
|
||||
$("#main").panel({ href: 'html/equipment', title: '用户' });
|
||||
$("#sbtable").datagrid('reload');
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -4027,11 +4027,8 @@ def drapi(req):
|
|||
with open(filepath, 'wb') as f:
|
||||
f.write(req.FILES['upfile'].read())
|
||||
# try:
|
||||
equipmentdict = drequipments(companyid, filepath)
|
||||
if equipmentdict:
|
||||
return JsonResponse({"code": 2, "equipmentdict": equipmentdict})
|
||||
else:
|
||||
return JsonResponse({"code": 1})
|
||||
ret = drequipments(companyid, filepath)
|
||||
return JsonResponse(ret)
|
||||
elif a == 'risk':
|
||||
userid = req.session['userid']
|
||||
companyid = getcompany(userid)
|
||||
|
|
Loading…
Reference in New Issue