From 3e7002c37f961446a43d1c5f2dc1baeaf1e42fa9 Mon Sep 17 00:00:00 2001
From: caoqianming
Date: Wed, 18 Sep 2019 21:22:49 +0800
Subject: [PATCH 01/17] =?UTF-8?q?=E6=B3=95=E5=BE=8B=E6=B3=95=E8=A7=84?=
=?UTF-8?q?=E3=80=81=E9=9B=86=E5=9B=A2=E7=AB=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
safesite/daoru.py | 9 +++++++++
safesite/templates/areaedit.html | 2 ++
2 files changed, 11 insertions(+)
diff --git a/safesite/daoru.py b/safesite/daoru.py
index a6f9cb2b..47291199 100644
--- a/safesite/daoru.py
+++ b/safesite/daoru.py
@@ -44,6 +44,15 @@ def makeqr4(data):
img.save(filepath)
return filepath
+def makeqr_area(data):
+ upload_folder = 'media/qr_area'
+ if not os.path.exists(upload_folder):
+ os.mkdir(upload_folder)
+ img = qrcode.make(data=data)
+ filepath = os.path.join(upload_folder, data.split('=')[1]+'.png').replace('\\','/')
+ img.save(filepath)
+ return filepath
+
def drequipments(companyid,path):
wb = load_workbook(path)
sheet = wb.worksheets[0]
diff --git a/safesite/templates/areaedit.html b/safesite/templates/areaedit.html
index 5e98a58a..a855f6a9 100644
--- a/safesite/templates/areaedit.html
+++ b/safesite/templates/areaedit.html
@@ -16,6 +16,8 @@
+ 区域二维码
+
diff --git a/safesite/templates/mgtindex.html b/safesite/templates/mgtindex.html
new file mode 100644
index 00000000..09e87bae
--- /dev/null
+++ b/safesite/templates/mgtindex.html
@@ -0,0 +1,78 @@
+
+
+
+
\ No newline at end of file
diff --git a/safesite/urls.py b/safesite/urls.py
index 8d3309ca..d57b2a1c 100644
--- a/safesite/urls.py
+++ b/safesite/urls.py
@@ -172,4 +172,5 @@ urlpatterns = [
path('datashow/charthandle', views.charthandle),
path('companyinfo/', views.companyinfo),
path('rlt/',include('safesite.rlt.urls')),
+ path('mgt/',include('safesite.mgt.urls')),
]
From 08e42ae7adc62b1ba17e031443592ec5358d22eb Mon Sep 17 00:00:00 2001
From: shilixia <2309368887@qq.com>
Date: Tue, 8 Oct 2019 09:53:16 +0800
Subject: [PATCH 11/17] sc
---
safesite/templates/mgtadd.html | 52 ++++++++++++++++------------------
1 file changed, 25 insertions(+), 27 deletions(-)
diff --git a/safesite/templates/mgtadd.html b/safesite/templates/mgtadd.html
index aa038f57..6424b9b4 100644
--- a/safesite/templates/mgtadd.html
+++ b/safesite/templates/mgtadd.html
@@ -128,7 +128,7 @@
选择文件
-
+
@@ -215,37 +215,35 @@
$(".el-upload-list").css("display", "block");
$(".el-upload-list li").css("border", "1px solid #20a0ff");
$("#videoName").text(fileObj.name);
+ var fileObj = document.getElementById("file").files[0]; // js 获取文件对象
+ if (fileObj == undefined || fileObj == "") {
+ alert("请选择文件");
+ return false;
+ };
+ var imagSize = document.getElementById("file").files[0].size;
+ if (imagSize > 1024 * 1024 * 10) {
+ alert("视频大小为:" + (imagSize / (1024 * 1024)).toFixed(2) + "M,超出了上传大小," + "请选择3M以内的视频!");
+ return false;
+ }
+ var url = "mgt/upload"; // 接收上传文件的后台地址
+ var form = new FormData(); // FormData 对象
+ form.append("mf", fileObj); // 文件对象
+ xhr = new XMLHttpRequest(); // XMLHttpRequest 对象
+ xhr.open("post", url, true); //post方式,url为服务器请求地址,true 该参数规定请求是否异步处理。
+ xhr.onload = uploadComplete; //请求完成
+ xhr.onerror = uploadFailed; //请求失败
+ xhr.upload.onprogress = progressFunction; //【上传进度调用方法实现】
+ xhr.upload.onloadstart = function () { //上传开始执行方法
+ ot = new Date().getTime(); //设置上传开始时间
+ oloaded = 0; //设置上传开始时,以上传的文件大小为0
+ };
+ xhr.send(form); //开始上传,发送form数据
} else {
alert("请选择文件");
}
}
- /*点击提交*/
- function sub() {
- var fileObj = document.getElementById("file").files[0]; // js 获取文件对象
- if (fileObj == undefined || fileObj == "") {
- alert("请选择文件");
- return false;
- };
- var imagSize = document.getElementById("file").files[0].size;
- if (imagSize > 1024 * 1024 * 10) {
- alert("视频大小为:" + (imagSize / (1024 * 1024)).toFixed(2) + "M,超出了上传大小," + "请选择3M以内的视频!");
- return false;
- }
- var url = "mgt/upload"; // 接收上传文件的后台地址
- var form = new FormData(); // FormData 对象
- form.append("mf",fileObj); // 文件对象
- xhr = new XMLHttpRequest(); // XMLHttpRequest 对象
- xhr.open("post", url, true); //post方式,url为服务器请求地址,true 该参数规定请求是否异步处理。
- xhr.onload = uploadComplete; //请求完成
- xhr.onerror = uploadFailed; //请求失败
- xhr.upload.onprogress = progressFunction; //【上传进度调用方法实现】
- xhr.upload.onloadstart = function () { //上传开始执行方法
- ot = new Date().getTime(); //设置上传开始时间
- oloaded = 0; //设置上传开始时,以上传的文件大小为0
- };
- xhr.send(form); //开始上传,发送form数据
- }
+
//上传进度实现方法,上传过程中会频繁调用该方法
function progressFunction(evt) {
From 21be18b1a461627091c5bf6ab7499e8001aa35fe Mon Sep 17 00:00:00 2001
From: caoqianming
Date: Tue, 8 Oct 2019 21:29:55 +0800
Subject: [PATCH 12/17] zuoye
---
.../migrations/0273_auto_20191008_1604.py | 29 +++
safesite/models.py | 6 +-
safesite/templates/operationspjdadd.html | 8 +-
safesite/templates/suggest.html | 2 +-
safesite/templates/zuoyepeizhi.html | 2 +-
safesite/views.py | 168 +++++++++++-------
6 files changed, 145 insertions(+), 70 deletions(-)
create mode 100644 safesite/migrations/0273_auto_20191008_1604.py
diff --git a/safesite/migrations/0273_auto_20191008_1604.py b/safesite/migrations/0273_auto_20191008_1604.py
new file mode 100644
index 00000000..459197f0
--- /dev/null
+++ b/safesite/migrations/0273_auto_20191008_1604.py
@@ -0,0 +1,29 @@
+# Generated by Django 2.1.5 on 2019-10-08 16:04
+
+import django.contrib.postgres.fields
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('safesite', '0272_auto_20190925_1657'),
+ ]
+
+ operations = [
+ # migrations.AddField(
+ # model_name='area',
+ # name='qrcode',
+ # field=models.CharField(blank=True, max_length=200, null=True),
+ # ),
+ migrations.AddField(
+ model_name='operation',
+ name='todousers',
+ field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None),
+ ),
+ migrations.AddField(
+ model_name='operationspjd',
+ name='sprs',
+ field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, null=True, size=None),
+ ),
+ ]
diff --git a/safesite/models.py b/safesite/models.py
index 524f261f..29504ac0 100644
--- a/safesite/models.py
+++ b/safesite/models.py
@@ -1,7 +1,7 @@
from django.db import models
import uuid
import django.utils.timezone as timezone
-from django.contrib.postgres.fields import JSONField
+from django.contrib.postgres.fields import JSONField,ArrayField
import jwt
import datetime
# Create your models here.
@@ -466,6 +466,7 @@ class Operation(models.Model):#作业表
zyzt = JSONField()
fxcs = models.CharField(max_length=200)
todouser = models.ForeignKey(User,related_name='zyclr',on_delete=models.CASCADE,null=True,blank=True)
+ todousers = ArrayField(models.IntegerField(), blank=True,null=True)
usecomp = models.ForeignKey(Partment,on_delete=models.CASCADE,null=True,blank=True,default=1)
class Fxcs(models.Model):#作业分析措施
@@ -508,12 +509,13 @@ class Operzyry(models.Model):#作业确认人
modifytime = models.DateTimeField(auto_now = True)
submittime = models.DateTimeField(default = timezone.now)
-class Operationspjd(models.Model):#作业审批节点
+class Operationspjd(models.Model):#作业审批节点配置
id = models.AutoField(primary_key=True)
zylx = models.ForeignKey(Dickey, on_delete=models.CASCADE,null=True,blank=True)
jdmc = models.CharField(max_length=100)
spbm = models.ForeignKey(Partment,related_name='spbm',on_delete=models.CASCADE,null=True,blank=True)#审批部门
spr = models.ForeignKey(User,related_name='spr',on_delete=models.CASCADE,null=True,blank=True)#审批部门
+ sprs = ArrayField(models.IntegerField(), blank=True,null=True)
submittime = models.DateTimeField(u'创建时间',default = timezone.now)
modifytime = models.DateTimeField(auto_now = True)
usecomp = models.ForeignKey(Partment,on_delete=models.CASCADE,null=True,blank=True)
diff --git a/safesite/templates/operationspjdadd.html b/safesite/templates/operationspjdadd.html
index fde8ca25..d7f20fd9 100644
--- a/safesite/templates/operationspjdadd.html
+++ b/safesite/templates/operationspjdadd.html
@@ -13,7 +13,7 @@
required=true />
-
@@ -22,9 +22,13 @@
+
+
+
+
+
+
+
+
+
+