daoru trouble
This commit is contained in:
parent
4dd7e88f52
commit
63646dc011
|
@ -197,6 +197,7 @@ def drtodotroubles(companyid,path,userid):
|
|||
sheetimages = sheet._images #获取图片列表
|
||||
username = User.objects.get(userid=userid).username
|
||||
while sheet['B'+str(i)].value:
|
||||
try:
|
||||
jclx = sheet['A'+str(i)].value
|
||||
yhdj = sheet['B'+str(i)].value
|
||||
yhlxo = sheet['C'+str(i)].value
|
||||
|
@ -275,7 +276,7 @@ def drtodotroubles(companyid,path,userid):
|
|||
for image in sheetimages:
|
||||
if image.anchor._from.row == i-1 and image.anchor._from.col == 18:
|
||||
imagedata = image._data()#图片二进制数据
|
||||
file_name = datetime.now().strftime('%Y%m%d%H%M%S') + '_yh.jpg'
|
||||
file_name = datetime.now().strftime('%Y%m%d%H%M%S') + '_yh'+str(i)+'.jpg'
|
||||
user_upload_folder = os.path.join('media', username)
|
||||
if not os.path.exists(user_upload_folder):
|
||||
os.mkdir(user_upload_folder)
|
||||
|
@ -285,7 +286,7 @@ def drtodotroubles(companyid,path,userid):
|
|||
f.write(imagedata)
|
||||
obj.yhtp = filepath
|
||||
obj.yhzt = 3 #待整改
|
||||
obj.yhnum = 'YH'+datetime.now().strftime('%Y%m%d%H%M%S')
|
||||
obj.yhnum = 'YH'+datetime.now().strftime('%Y%m%d%H%M%S')+str(i)
|
||||
obj.usecomp = Partment.objects.get(partid=companyid)
|
||||
obj.save()
|
||||
postdict = {
|
||||
|
@ -314,6 +315,8 @@ def drtodotroubles(companyid,path,userid):
|
|||
postdict['touser'] = obj.todouser.openid
|
||||
send_wechatmsg.delay(postdict)
|
||||
i = i + 1
|
||||
except:
|
||||
return '第'+str(i)+'行数据错误,导入终止!'
|
||||
|
||||
|
||||
def drequipments(companyid,path):
|
||||
|
|
|
@ -399,7 +399,7 @@ data-options="iconCls:'fa-upload',resizable:true,modal:true,closed:true,border:f
|
|||
});
|
||||
}
|
||||
else if (data.code == 2) {
|
||||
$.messager.alert('提示', data.msg, 'info', function () {
|
||||
$.messager.alert('警告', data.msg, 'info', function () {
|
||||
$("#yhtable").datagrid('reload');
|
||||
});
|
||||
}
|
||||
|
|
|
@ -181,13 +181,10 @@ urlpatterns = [
|
|||
path('test',views.test),
|
||||
path('.well-known/pki-validation/fileauth.txt',views.vewechat),#验证
|
||||
path('miniprogram/boUR15vyNu.txt',views.minip_px),
|
||||
<<<<<<< HEAD
|
||||
path('api/getresbilitydata',views.getresbilitydata),#责任制
|
||||
path('api/getprodata',views.getprodata),#操作规程
|
||||
=======
|
||||
path('boUR15vyNu.txt',views.minip_px),
|
||||
|
||||
>>>>>>> a4a3b20c8aa023a59b49709971b32d9bc8d9bb43
|
||||
|
||||
#合作模块
|
||||
path('edu/',include('safesite.edu.urls')),
|
||||
|
|
BIN
sheetimage.png
BIN
sheetimage.png
Binary file not shown.
Before Width: | Height: | Size: 846 B |
Loading…
Reference in New Issue