Merge branch 'master' of https://e.coding.net/ctcdevteam/safesite
This commit is contained in:
commit
b388dce777
|
@ -11,6 +11,7 @@ media/
|
|||
aspnet_client/
|
||||
static/
|
||||
mysite/settings.py
|
||||
safesite/token.txt
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
@ -105,7 +106,10 @@ ipython_config.py
|
|||
#Pipfile.lock
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
celerybeat-schedule.bak
|
||||
celerybeat-schedule.dat
|
||||
celerybeat-schedule.dir
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
'utc_enabled', (1024, 4)
|
||||
'tz', (1536, 23)
|
||||
'entries', (2048, 587)
|
||||
'__version__', (512, 15)
|
||||
'tz', (1536, 23)
|
||||
'utc_enabled', (1024, 4)
|
||||
'entries', (2048, 568)
|
||||
|
|
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
'utc_enabled', (1024, 4)
|
||||
'tz', (1536, 23)
|
||||
'entries', (2048, 587)
|
||||
'__version__', (512, 15)
|
||||
'tz', (1536, 23)
|
||||
'utc_enabled', (1024, 4)
|
||||
'entries', (2048, 568)
|
||||
|
|
|
@ -1 +1 @@
|
|||
1640
|
||||
14104
|
||||
|
|
|
@ -169,7 +169,7 @@ def index(req):
|
|||
misstime__range=(first_day, first_day_of_next_month)).count()
|
||||
trainnum = s_models.Train.objects.filter(deletemark=1, usecomp__in=companys,
|
||||
starttime__range=(first_day, first_day_of_next_month)).count()
|
||||
companynum = len(companys)
|
||||
companynum = companys.count()
|
||||
usernum = s_models.User.objects.filter(deletemark=1, usecomp__in=companys).count()
|
||||
return render(req, 'groups/index.html', locals())
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ app.conf.update(
|
|||
'schedule': crontab(minute=2),
|
||||
#'args': (5, 6)
|
||||
},
|
||||
'risk-task': {
|
||||
'task': 'safesite.tasks.risktask',
|
||||
'riskact-task': {
|
||||
'task': 'safesite.tasks.riskacttask',
|
||||
'schedule': timedelta(minutes=1),
|
||||
#'args': (5, 6)
|
||||
},
|
||||
|
|
|
@ -145,8 +145,8 @@ CELERY_TIMEZONE='Asia/Shanghai'
|
|||
CELERY_ENABLE_UTC=True
|
||||
|
||||
##配置session
|
||||
#SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
||||
SESSION_COOKIE_AGE = 2400
|
||||
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
||||
#SESSION_COOKIE_AGE = 2400
|
||||
SESSION_SAVE_EVERY_REQUEST = True
|
||||
|
||||
#日志配置
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
# Generated by Django 2.2.7 on 2019-11-25 14:14
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0293_auto_20191119_1811'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
# migrations.RemoveField(
|
||||
# model_name='companyinfo',
|
||||
# name='liaison_fax',
|
||||
# ),
|
||||
migrations.AlterField(
|
||||
model_name='socertificate',
|
||||
name='url',
|
||||
field=models.CharField(blank=True, max_length=1000, null=True),
|
||||
),
|
||||
]
|
|
@ -361,7 +361,7 @@ class Socertificate(models.Model):#特种作业证书
|
|||
yxqjssj = models.DateField(null=True,blank=True)
|
||||
sjfssj = models.DateField(null=True,blank=True)
|
||||
zszt = models.IntegerField(choices = type_choices,null=True,blank=True)
|
||||
url = models.CharField(max_length=200,null=True,blank=True)
|
||||
url = models.CharField(max_length=1000,null=True,blank=True)
|
||||
|
||||
class Safecert(models.Model):#安全资格证书
|
||||
type_choices = (
|
||||
|
@ -506,7 +506,7 @@ class Operspxq(models.Model):#作业审批流
|
|||
spbm = models.ForeignKey(Partment, on_delete=models.CASCADE,null=True,blank=True)
|
||||
spr = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
action = models.CharField(max_length=200)
|
||||
checked = models.IntegerField(default=1)#0未通过,1通过,2转交
|
||||
checked = models.IntegerField(default=1)#0未通过,1通过,2提交
|
||||
submittime = models.DateTimeField(default = timezone.now)
|
||||
|
||||
class Operzyry(models.Model):#作业确认人
|
||||
|
|
|
@ -582,4 +582,4 @@ $.get('api/check_session',function(res){
|
|||
})
|
||||
}
|
||||
var t1 = window.setInterval(update, 1000 * 60)
|
||||
var t2 = window.setInterval(checksession,1000*60*31)
|
||||
var t2 = window.setInterval(checksession,1000*60*41)
|
|
@ -35,6 +35,7 @@ def send_wechatmsgs(postdict,tolist):
|
|||
except:
|
||||
pass
|
||||
|
||||
|
||||
@shared_task
|
||||
def send_wechatmsg(postdict):
|
||||
with open(dirname + 'token.txt','r',encoding= 'utf-8') as f:
|
||||
|
|
|
@ -1,445 +0,0 @@
|
|||
|
||||
//import API from '../../../utils/API.js'
|
||||
import ArrayUtils from 'ArrayUtils.js'
|
||||
//import EventBus from '../../../components/NotificationCenter/WxNotificationCenter.js'
|
||||
|
||||
let TEACHER_ID = 'teacher';
|
||||
let TEACHER_DEPARTMENT_ID = 't_department';
|
||||
let TEACHER_SUBJECT_ID = 't_subject';
|
||||
let TEACHER_GRADECLASS_ID = 't_gradeclass';
|
||||
let STUDENT_ID = 'student';
|
||||
let PARENT_ID = 'parent'
|
||||
|
||||
let TEACHER = {
|
||||
id: TEACHER_ID,
|
||||
name: '教师',
|
||||
parentId: '',
|
||||
checked: false,
|
||||
isPeople: false,
|
||||
children: [
|
||||
{
|
||||
id: TEACHER_DEPARTMENT_ID,
|
||||
name: '部门',
|
||||
parentId: 'teacher',
|
||||
checked: false,
|
||||
isPeople: false,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
id: TEACHER_SUBJECT_ID,
|
||||
name: '学科',
|
||||
parentId: 'teacher',
|
||||
checked: false,
|
||||
isPeople: false,
|
||||
children: []
|
||||
},
|
||||
{
|
||||
id: TEACHER_GRADECLASS_ID,
|
||||
name: '年级班级',
|
||||
parentId: 'teacher',
|
||||
checked: false,
|
||||
isPeople: false,
|
||||
children: []
|
||||
},
|
||||
]
|
||||
}
|
||||
let STUDENT = {
|
||||
id: STUDENT_ID,
|
||||
name: '学生',
|
||||
parentId: '',
|
||||
checked: false,
|
||||
isPeople: false,
|
||||
children: []
|
||||
}
|
||||
let PARENT = {
|
||||
id: PARENT_ID,
|
||||
name: '家长',
|
||||
parentId: '',
|
||||
checked: false,
|
||||
isPeople: false,
|
||||
children: []
|
||||
}
|
||||
let ORIGINAL_DATA = [
|
||||
TEACHER, STUDENT, PARENT
|
||||
]
|
||||
|
||||
Page({
|
||||
data: {
|
||||
currentList: [], //当前展示的列表
|
||||
selectList: [], //已选择的元素列表
|
||||
originalList: [], //最原始的数据列表
|
||||
indexList: [], //存储目录层级的数组,用于准确的返回上一层
|
||||
selectList: [], //已选中的人员列表
|
||||
},
|
||||
|
||||
onLoad: function (options) {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '选择人员'
|
||||
})
|
||||
this.init();
|
||||
},
|
||||
|
||||
init() {
|
||||
//用户的单位id
|
||||
this.unitId = getApp().globalData.userInfo.unitId;
|
||||
//用户类型
|
||||
this.userType = 0;
|
||||
//上次选中的列表,用于判断是不是取消选中了
|
||||
this.lastTimeSelect = []
|
||||
|
||||
this.setData({
|
||||
currentList: ORIGINAL_DATA, //当前展示的列表
|
||||
originalList: ORIGINAL_DATA, //最原始的数据列表
|
||||
})
|
||||
},
|
||||
|
||||
clickItem(res) {
|
||||
console.log(res)
|
||||
let index = res.currentTarget.id;
|
||||
let item = this.data.currentList[index]
|
||||
|
||||
console.log("item", item)
|
||||
|
||||
if (!item.isPeople) {
|
||||
//点击教师,下一层数据是写死的,不用请求接口
|
||||
if (item.id === TEACHER_ID) {
|
||||
this.userType = 2;
|
||||
this.setData({
|
||||
currentList: item.children
|
||||
})
|
||||
} else if (item.id === TEACHER_SUBJECT_ID) {
|
||||
if (item.children.length === 0) {
|
||||
this._getTeacherSubjectData()
|
||||
} else {
|
||||
//children的长度不为0时,更新 currentList
|
||||
this.setData({
|
||||
currentList: item.children
|
||||
})
|
||||
}
|
||||
} else if (item.id === TEACHER_DEPARTMENT_ID) {
|
||||
if (item.children.length === 0) {
|
||||
this._getTeacherDepartmentData()
|
||||
} else {
|
||||
//children的长度不为0时,更新 currentList
|
||||
this.setData({
|
||||
currentList: item.children
|
||||
})
|
||||
}
|
||||
} else if (item.id === TEACHER_GRADECLASS_ID) {
|
||||
if (item.children.length === 0) {
|
||||
this._getTeacherGradeClassData()
|
||||
} else {
|
||||
//children的长度不为0时,更新 currentList
|
||||
this.setData({
|
||||
currentList: item.children
|
||||
})
|
||||
}
|
||||
} else if (item.id === STUDENT_ID) {
|
||||
this.userType = 1;
|
||||
if (item.children.length === 0) {
|
||||
this._getStudentGradeClassData()
|
||||
} else {
|
||||
//children的长度不为0时,更新 currentList
|
||||
this.setData({
|
||||
currentList: item.children
|
||||
})
|
||||
}
|
||||
} else if (item.id === PARENT_ID) {
|
||||
this.userType = 3;
|
||||
if (item.children.length === 0) {
|
||||
this._getParentGradeClassData()
|
||||
} else {
|
||||
//children的长度不为0时,更新 currentList
|
||||
this.setData({
|
||||
currentList: item.children
|
||||
})
|
||||
}
|
||||
} else {
|
||||
//children的长度为0时,请求服务器
|
||||
if (item.children.length === 0) {
|
||||
this._getUserByGroup(item)
|
||||
} else {
|
||||
//children的长度不为0时,更新 currentList
|
||||
this.setData({
|
||||
currentList: item.children
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//将当前的索引存入索引目录中。索引多一个表示目录多一级
|
||||
let indexes = this.data.indexList
|
||||
indexes.push(index)
|
||||
//是目录不是具体的用户
|
||||
this.setData({
|
||||
indexList: indexes
|
||||
})
|
||||
//清空上次选中的元素列表,并设置上一层的选中状态给lastTimeSelect
|
||||
this.setLastTimeSelectList();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//返回按钮
|
||||
goBack() {
|
||||
let indexList = this.data.indexList
|
||||
if (indexList.length > 0) {
|
||||
//返回时删掉最后一个索引
|
||||
indexList.pop()
|
||||
if (indexList.length == 0) {
|
||||
//indexList长度为0说明回到了最顶层
|
||||
this.setData({
|
||||
currentList: this.data.originalList,
|
||||
indexList: indexList
|
||||
})
|
||||
} else {
|
||||
//循环将当前索引的对应数组赋值给currentList
|
||||
let list = this.data.originalList
|
||||
for (let i = 0; i < indexList.length; i++) {
|
||||
let index = indexList[i]
|
||||
list = list[index].children
|
||||
}
|
||||
this.setData({
|
||||
currentList: list,
|
||||
indexList: indexList
|
||||
})
|
||||
}
|
||||
//清空上次选中的元素列表,并设置上一层的选中状态给lastTimeSelect
|
||||
this.setLastTimeSelectList();
|
||||
}
|
||||
},
|
||||
|
||||
//清空上次选中的元素列表,并设置上一层的选中状态给lastTimeSelect
|
||||
setLastTimeSelectList() {
|
||||
this.lastTimeSelect = []
|
||||
this.data.currentList.forEach(item => {
|
||||
if (item.checked) {
|
||||
this.lastTimeSelect.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//获取教师部门数据
|
||||
_getTeacherDepartmentData() {
|
||||
this._commonRequestMethod(2, 'department')
|
||||
},
|
||||
|
||||
//请求教师的学科数据
|
||||
_getTeacherSubjectData() {
|
||||
this._commonRequestMethod(2, 'subject')
|
||||
},
|
||||
|
||||
//请求教师的年级班级
|
||||
_getTeacherGradeClassData() {
|
||||
this._commonRequestMethod(2, 'gradeclass')
|
||||
},
|
||||
|
||||
//请求学生的年级班级
|
||||
_getStudentGradeClassData() {
|
||||
this._commonRequestMethod(1, 'gradeclass')
|
||||
},
|
||||
|
||||
//请求家长的年级班级
|
||||
_getParentGradeClassData() {
|
||||
this._commonRequestMethod(3, 'gradeclass')
|
||||
},
|
||||
|
||||
//根据部门查询人
|
||||
_getUserByGroup(item) {
|
||||
let params = {
|
||||
userType: this.userType,
|
||||
unitId: this.unitId,
|
||||
groupType: item.type,
|
||||
groupId: item.id
|
||||
}
|
||||
console.log('params', params)
|
||||
// getApp().get(API.selectUserByGroup(), params, result => {
|
||||
// console.log('result', result)
|
||||
// let list = this.transformData(result.data.data, item.id)
|
||||
// this.setData({
|
||||
// currentList: list
|
||||
// })
|
||||
// this.addList2DataTree()
|
||||
// //清空上次选中的元素列表,并设置上一层的选中状态给lastTimeSelect。写在这里防止异步请求时执行顺序问题
|
||||
// this.setLastTimeSelectList();
|
||||
// })
|
||||
},
|
||||
|
||||
//通用的请求部门方法
|
||||
_commonRequestMethod(userType, groupType) {
|
||||
wx.showLoading({
|
||||
title: '',
|
||||
})
|
||||
let params = {
|
||||
userType: userType,
|
||||
unitId: this.unitId,
|
||||
groupType: groupType
|
||||
}
|
||||
console.log('params', params)
|
||||
getApp().get(API.selectUsersByUserGroupsTree(), params, result => {
|
||||
console.log('result', result)
|
||||
wx.hideLoading()
|
||||
let data = result.data.data
|
||||
this.setData({
|
||||
currentList: data
|
||||
})
|
||||
this.addList2DataTree();
|
||||
//清空上次选中的元素列表,并设置上一层的选中状态给lastTimeSelect。写在这里防止异步请求时执行顺序问题
|
||||
this.setLastTimeSelectList();
|
||||
})
|
||||
},
|
||||
|
||||
//将请求的数据转化为需要的格式
|
||||
transformData(list, parentId) {
|
||||
//先将数据转化为固定的格式
|
||||
let newList = []
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let item = list[i]
|
||||
newList.push({
|
||||
id: item.id,
|
||||
name: item.realName,
|
||||
parentId: parentId,
|
||||
checked: false,
|
||||
isPeople: true,
|
||||
userType: item.userType,
|
||||
gender: item.gender,
|
||||
children: []
|
||||
})
|
||||
}
|
||||
return newList;
|
||||
},
|
||||
|
||||
//将当前列表挂载在原数据树上, 目前支持5层目录,如需更多接着往下写就好
|
||||
addList2DataTree() {
|
||||
let currentList = this.data.currentList;
|
||||
let originalList = this.data.originalList;
|
||||
let indexes = this.data.indexList
|
||||
switch (indexes.length) {
|
||||
case 1:
|
||||
originalList[indexes[0]].children = currentList
|
||||
break;
|
||||
case 2:
|
||||
originalList[indexes[0]].children[indexes[1]].children = currentList
|
||||
break;
|
||||
case 3:
|
||||
originalList[indexes[0]].children[indexes[1]].children[indexes[2]].children = currentList
|
||||
break;
|
||||
case 4:
|
||||
originalList[indexes[0]].children[indexes[1]].children[indexes[2]].children[indexes[3]].children = currentList
|
||||
break;
|
||||
case 5:
|
||||
originalList[indexes[0]].children[indexes[1]].children[indexes[2]].children[indexes[3]].children[indexes[4]].children = currentList
|
||||
break;
|
||||
}
|
||||
|
||||
this.setData({
|
||||
originalList: originalList
|
||||
})
|
||||
console.log("originalList", originalList)
|
||||
},
|
||||
|
||||
//选框变化回调
|
||||
checkChange(res) {
|
||||
console.log(res)
|
||||
let values = res.detail.value
|
||||
let selectItems = []
|
||||
//将值取出拼接成 id,name 格式
|
||||
values.forEach(value => {
|
||||
let arrs = value.split(",")
|
||||
selectItems.push({ id: arrs[0], name: arrs[1] })
|
||||
})
|
||||
console.log("selectItems", selectItems)
|
||||
console.log("lastTimeSelect", this.lastTimeSelect)
|
||||
|
||||
//将本次选择的与上次选择的比对,本次比上次多说明新增了,本次比上次少说明删除了,找出被删除的那条数据,在footer中也删除
|
||||
if (selectItems.length > this.lastTimeSelect.length) {
|
||||
//将 selectList 与 selectItems 拼接并去重
|
||||
let newList = this.data.selectList.concat(selectItems)
|
||||
newList = ArrayUtils.checkRepeat(newList)
|
||||
this.setData({
|
||||
selectList: newList
|
||||
})
|
||||
} else {
|
||||
//找出取消勾选的item,从selectList中删除
|
||||
//比对出取消勾选的是哪个元素
|
||||
let diffItem = {}
|
||||
this.lastTimeSelect.forEach(item => {
|
||||
let flag = false;
|
||||
selectItems.forEach(item2 => {
|
||||
if (item.id === item2.id) {
|
||||
flag = true
|
||||
}
|
||||
})
|
||||
if (!flag) {
|
||||
diffItem = item
|
||||
console.log("diff=", item)
|
||||
}
|
||||
})
|
||||
//找出被删除的元素在 selectList 中的位置
|
||||
let list = this.data.selectList
|
||||
let delIndex = 0;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].id === diffItem.id) {
|
||||
delIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//从list中删除这个元素
|
||||
list.splice(delIndex, 1)
|
||||
this.setData({
|
||||
selectList: list
|
||||
})
|
||||
}
|
||||
console.log("selectList", this.data.selectList)
|
||||
//更新 currentList 选中状态并重新挂载在数据树上,以保存选择状态
|
||||
this.updateCurrentList(this.data.currentList, this.data.selectList)
|
||||
},
|
||||
|
||||
//footer点击删除回调
|
||||
footerDelete(res) {
|
||||
console.log(res)
|
||||
this.setData({
|
||||
selectList: res.detail.selectList
|
||||
})
|
||||
|
||||
console.log('selectList', this.data.selectList)
|
||||
this.updateCurrentList(this.data.currentList, res.detail.selectList)
|
||||
},
|
||||
|
||||
//点击 footer 的确定按钮提交数据
|
||||
submitData(res) {
|
||||
let selectList = this.data.selectList
|
||||
//通过 WxNotificationCenter 发送选择的结果通知
|
||||
//EventBus.postNotificationName("SelectPeopleDone", selectList)
|
||||
//将选择结果存入 app.js 的 globalData
|
||||
getApp().globalData.selectPeopleList = selectList
|
||||
//返回
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
console.log("selectdone", selectList)
|
||||
},
|
||||
|
||||
//更新 currentList 并将更新后的列表挂载在数据树上
|
||||
updateCurrentList(currentList, selectList) {
|
||||
let newList = []
|
||||
currentList.forEach(item => {
|
||||
let flag = false;
|
||||
selectList.forEach(item2 => {
|
||||
if (item.id === item2.id) {
|
||||
flag = true
|
||||
}
|
||||
})
|
||||
if (flag) {
|
||||
item.checked = true
|
||||
} else {
|
||||
item.checked = false
|
||||
}
|
||||
newList.push(item)
|
||||
})
|
||||
this.setData({
|
||||
currentList: newList
|
||||
})
|
||||
this.addList2DataTree()
|
||||
this.setLastTimeSelectList()
|
||||
}
|
||||
})
|
|
@ -8,7 +8,7 @@
|
|||
<form id="gcff" method="post" name="gcff" enctype="multipart/form-data">
|
||||
<div style="margin-bottom:5px">
|
||||
<input class="easyui-textbox" id="lookersname" style="width:480px;height:60px" editable="false"
|
||||
data-options="label:'观察人',multiline:true,prompt:'请选择'" required=true>
|
||||
data-options="label:'参与/陪同人',multiline:true,prompt:'请选择'" required=true>
|
||||
<input type="hidden" id="lookers" name="lookers" />
|
||||
<a id="chooserys" class='easyui-linkbutton' onclick="choseusers('lookers')" style="width:auto">选择</a>
|
||||
</div>
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
var headimgurl = $('#userindex').attr('headimgurl');
|
||||
var issuper = {{ issuper }};
|
||||
if (issuper == 1) { $('#setupb').show() }
|
||||
if (openid == 0 && issuper != 1) { $('#wxdg').dialog(); } else { $('#bindwx').text('解绑微信'); };
|
||||
if ((openid == 0 ||openid == 'None') && issuper != 1) { $('#wxdg').dialog(); } else { $('#bindwx').text('解绑微信'); };
|
||||
if (headimgurl != 0 && headimgurl != 'None') { $('#headimg').attr('src', headimgurl); }
|
||||
function logout() {
|
||||
$.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {
|
||||
|
@ -184,7 +184,7 @@
|
|||
});
|
||||
}
|
||||
function bindwx() {
|
||||
if (openid == 0) {
|
||||
if (openid == 0 ||openid == 'None') {
|
||||
$('#wxdg').dialog('open');
|
||||
} else {
|
||||
var str = '你已绑定昵称为' + nickname + '的微信号,确定解绑吗?'
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
{ field: 'lookplace', title: '观察地点', width: 150 },
|
||||
{ field: 'actname', title: '作业名称', width: 200 },
|
||||
{ field: 'looktime', title: '观察时间', width: 200 },
|
||||
{ field: 'looker__name', title: '观察记录人', width: 200 },
|
||||
{ field: 'looker__name', title: '观察人', width: 200 },
|
||||
{ field: 'lookeder', title: '被观察对象', width: 200 },
|
||||
{ field: 'otherunsafe', title: '过程和交流记录', width: 300 },
|
||||
]]
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td style="width:50%">所属部门:{{lookpart__partname}}</td>
|
||||
<td>观察人记录人:{{looker__name}}</td>
|
||||
<td>观察人:{{looker__name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">观察人员:{{lookers}}</td>
|
||||
<td colspan="2">参与/陪同人:{{lookers}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开始时间:{{looktime| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
{ field: 'train__trainname', title: '培训名称', width: 200 },
|
||||
{ field: 'train__trainplace', title: '培训地点', width: 80 },
|
||||
{ field: 'train__starttime', title: '开始时间', width: 200 },
|
||||
{ field: 'train__duration', title: '时长(小时)', width: 50 },
|
||||
{ field: 'checked', title: '签到情况', width: 80 , styler: function (value, row, index) {
|
||||
if (value == 0) {
|
||||
return 'background-color:yellow;';
|
||||
|
@ -77,7 +78,13 @@
|
|||
return '已微信签到'
|
||||
}
|
||||
}},
|
||||
{ field: 'train__lecturer__name', title: '授课人', width: 200 },
|
||||
{ field: 'train__teacher', title: '授课人', width: 200},
|
||||
{ field: 'examtestdetail', title: '考试详情', width: 200, formatter: function (value, row, index) {
|
||||
if(value != null){
|
||||
return '<a target="_blank" href="/html/examhistory/'+value+'" >点击查看</a>'
|
||||
}
|
||||
|
||||
} },
|
||||
]]
|
||||
});
|
||||
function grpxsearch(){
|
||||
|
|
|
@ -89,9 +89,6 @@
|
|||
{ field: 'yxqkssj', title: '有效期开始时间', width: 80 },
|
||||
{ field: 'yxqjssj', title: '有效期结束时间', width: 80 },
|
||||
{ field: 'sjfssj', title: '实际复审时间', width: 80 },
|
||||
{ field: 'url', title: '官网地址', width: 80 ,formatter: function(value,row,index){
|
||||
return '<a style="color:blue" target="_blank" href="'+row.url+'">官网地址</a>';
|
||||
} },
|
||||
]]
|
||||
});
|
||||
function addtzzs(){
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
border:false,
|
||||
columns: [[
|
||||
{ field: 'jyid', title: 'ID', hidden: true },
|
||||
{ field: 'jynum', title: '编号', width: 120 },
|
||||
{ field: 'jynum', title: '编号', width: 180 },
|
||||
{
|
||||
field: 'jyzt', title: '流程状态', width: 80, styler: function (value, row, index) {
|
||||
switch (value) {
|
||||
|
@ -93,7 +93,6 @@
|
|||
{ field: 'jylb__dickeyname', title: '建议类别', width: 120 },
|
||||
{ field: 'dqxz', title: '当前现状', width: 200 },
|
||||
{ field: 'jynr', title: '建议内容', width: 400 },
|
||||
{ field: 'jyfk', title: '建议反馈', width: 400 },
|
||||
{
|
||||
field: 'accept', title: '建议状态', width: 80, styler: function (value, row, index) {
|
||||
switch (value) {
|
||||
|
@ -108,6 +107,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{ field: 'submittime', title: '提出时间', width: 120 },
|
||||
]]
|
||||
});
|
||||
function addjy(){
|
||||
|
|
|
@ -1 +1 @@
|
|||
27_Nrr7EPn934_zjHeLG6DRBRwEXlDbM5bzcILgg4urLbZmI-8pK5wAp9RM_LoeQEhD5TfjTYeqDNuLnclzD32EnEnYaY9kdD2B8F6fnrmt2LTKQ2L6fJwsAen43eF72Q0PsgWWIt_KPtTqrjMrUKAaAGAGWM
|
||||
27_ZMzXL6pksqZTNkvIvgYF-nBi-6821AXB_40FIB0yfBPtcoS5dLtefEygNYYUSYtoKkElSyqpRPulZ02rkOEwK5HZvcGkS8NZdUos3noO8CcI_xnjHAA2XernXtZcd6IYLZowAW2kQECiKiQpPVEfAHAWCL
|
|
@ -126,110 +126,110 @@ def upfile(req):
|
|||
return JsonResponse({"code":1,"filename":file_name,"filepath":filepath})
|
||||
|
||||
#html页面
|
||||
@check_login
|
||||
|
||||
def riskas(req):
|
||||
return render(req,'riskas.html')
|
||||
@check_login
|
||||
|
||||
def reportedit(req):
|
||||
return render(req,'reportedit.html',{'year':req.GET.get('year'),'month':req.GET.get('month'),'part':req.GET.get('part')})
|
||||
@check_login
|
||||
|
||||
def riskedit(req,id):
|
||||
return render(req,'riskedit.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def riskcheck(req):#风险点排查记录
|
||||
return render(req,'riskactcheck.html')
|
||||
@check_login
|
||||
|
||||
def taskdo(req):
|
||||
return render(req,'taskdo.html')
|
||||
@check_login
|
||||
|
||||
def task(req):
|
||||
return render(req,'task.html')
|
||||
@check_login
|
||||
|
||||
def riskactchose(req):
|
||||
area = 0
|
||||
if req.GET.get('area',None):
|
||||
area = req.GET.get('area')
|
||||
return render(req,'riskactchose.html',locals())
|
||||
@check_login
|
||||
|
||||
def riskactedit(req,id):
|
||||
return render(req,'riskactedit.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def riskactadd(req):
|
||||
return render(req,'riskactadd.html')
|
||||
@check_login
|
||||
|
||||
def riskadd(req,id):
|
||||
return render(req,'riskadd.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def risk(req):
|
||||
return render(req,'risk.html')
|
||||
@check_login
|
||||
|
||||
def inspect(req):
|
||||
return render(req,'inspect.html')
|
||||
@check_login
|
||||
|
||||
def equipment(req):
|
||||
return render(req,'equipment.html')
|
||||
@check_login
|
||||
|
||||
def areaedit(req,id):
|
||||
return render(req,'areaedit.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def areaadd(req):
|
||||
return render(req,'areaadd.html')
|
||||
@check_login
|
||||
|
||||
def areadetail(req):
|
||||
id = req.GET.get('id')
|
||||
return render(req,'areadetail.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def mapshow(req):
|
||||
return render(req,'mapshow.html')
|
||||
@check_login
|
||||
|
||||
def area(req):
|
||||
return render(req,'area.html')
|
||||
@check_login
|
||||
|
||||
def personaltrain(req):
|
||||
return render(req,'personaltrain.html')
|
||||
@check_login
|
||||
|
||||
def examtest(req):
|
||||
return render(req,'examtest.html')
|
||||
@check_login
|
||||
|
||||
def safecert(req):
|
||||
return render(req,'safecert.html')
|
||||
@check_login
|
||||
|
||||
def safecertadd(req):
|
||||
return render(req,'safecertadd.html')
|
||||
@check_login
|
||||
|
||||
def examtestdetail(req,id):
|
||||
return render(req,'examtestdetail.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def examtestadd(req):
|
||||
return render(req,'examtestadd.html')
|
||||
@check_login
|
||||
|
||||
def examtestadd2(req):
|
||||
return render(req,'examtestadd2.html')
|
||||
@check_login
|
||||
|
||||
def questionchoose(req):
|
||||
return render(req,'questionchoose.html')
|
||||
@check_login
|
||||
|
||||
def exampaperedit(req,id):
|
||||
return render(req,'exampaperedit.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def exampaperadd(req):
|
||||
return render(req,'exampaperadd.html')
|
||||
@check_login
|
||||
|
||||
def exampaper(req):
|
||||
return render(req,'exampaper.html')
|
||||
@check_login
|
||||
|
||||
def examhistory(req,id):
|
||||
return render(req,'examhistory.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def questionadd(req):
|
||||
return render(req,'questionadd.html')
|
||||
@check_login
|
||||
|
||||
def questionadd2(req):
|
||||
return render(req,'questionadd2.html')
|
||||
@check_login
|
||||
|
||||
def questionadd3(req):
|
||||
return render(req,'questionadd3.html')
|
||||
@check_login
|
||||
|
||||
def questionedit(req,id):
|
||||
obj = Question.objects.get(id=id)
|
||||
if obj.type==1:
|
||||
|
@ -238,140 +238,140 @@ def questionedit(req,id):
|
|||
return render(req,'questionedit2.html',{'id':id})
|
||||
elif obj.type==3:
|
||||
return render(req,'questionedit3.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def question(req):
|
||||
return render(req,'question.html')
|
||||
@check_login
|
||||
|
||||
def questioncatadd(req):
|
||||
return render(req,'questioncatadd.html')
|
||||
@check_login
|
||||
|
||||
def questioncatedit(req,id):
|
||||
return render(req,'questioncatedit.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def operationspjdadd(req):
|
||||
return render(req,'operationspjdadd.html')
|
||||
@check_login
|
||||
|
||||
def fxcsadd(req):
|
||||
return render(req,'fxcsadd.html')
|
||||
@check_login
|
||||
|
||||
def operationadd(req,zyid):
|
||||
return render(req,'operationadd.html',{'zyid':zyid})
|
||||
@check_login
|
||||
|
||||
def operationdetail(req,zyid):
|
||||
return render(req,'operationdetail.html',{'zyid':zyid})
|
||||
@check_login
|
||||
|
||||
def operation(req):
|
||||
return render(req,'operation.html')
|
||||
@check_login
|
||||
|
||||
def zuoyepeizhi(req):
|
||||
return render(req,'zuoyepeizhi.html')
|
||||
@check_login
|
||||
|
||||
def notice(req):
|
||||
return render(req,'notice.html')
|
||||
@check_login
|
||||
|
||||
def noticeadd(req):
|
||||
return render(req,'noticeadd.html')
|
||||
@check_login
|
||||
|
||||
def noticedetail(req,id):
|
||||
return render(req,'noticedetail.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def noticeedit(req,id):
|
||||
return render(req,'noticeedit.html',{'id':id})
|
||||
@check_login
|
||||
|
||||
def suggestupdate(req,jyid):
|
||||
return render(req,'suggestupdate.html',{'jyid':jyid})
|
||||
@check_login
|
||||
|
||||
def suggestdetail(req,jyid):
|
||||
return render(req,'suggestdetail.html',{'jyid':jyid})
|
||||
@check_login
|
||||
|
||||
def suggestadd(req):
|
||||
return render(req,'suggestadd.html')
|
||||
@check_login
|
||||
|
||||
def suggest(req):
|
||||
return render(req,'suggest.html')
|
||||
@check_login
|
||||
|
||||
def medetail(req):
|
||||
return render(req,'medetail.html')
|
||||
@check_login
|
||||
|
||||
def socerthtml(req):
|
||||
return render(req,'socert.html')
|
||||
@check_login
|
||||
|
||||
def socertadd(req):
|
||||
return render(req,'socertadd.html')
|
||||
@check_login
|
||||
|
||||
def rightshtml(req):
|
||||
groupid = req.GET.get('groupid')
|
||||
return render(req,'rights.html',{'groupid':groupid})
|
||||
@check_login
|
||||
|
||||
def misshtml(req):
|
||||
return render(req,'miss.html')
|
||||
@check_login
|
||||
|
||||
def missadd(req):
|
||||
return render(req,'missadd.html')
|
||||
@check_login
|
||||
|
||||
def missdetail(req,missid):
|
||||
return render(req,'missdetail.html',{'missid':missid})
|
||||
@check_login
|
||||
|
||||
def troublehtml(req):
|
||||
return render(req,'trouble.html')
|
||||
@check_login
|
||||
|
||||
def observehtml(req):
|
||||
return render(req,'observe.html')
|
||||
@check_login
|
||||
|
||||
def addobserve(req):
|
||||
return render(req,'addobserve.html')
|
||||
@check_login
|
||||
|
||||
def accesstrouble(req):
|
||||
return render(req,'accesstrouble.html')
|
||||
@check_login
|
||||
|
||||
def addtrouble(req):
|
||||
return render(req,'addtrouble.html')
|
||||
@check_login
|
||||
|
||||
def dichtml(req):
|
||||
return render(req,'dichtml.html')
|
||||
@check_login
|
||||
|
||||
def putreehtml(req):
|
||||
return render(req,'putree.html')
|
||||
@check_login
|
||||
|
||||
def usergroup(req):
|
||||
return render(req,'usergroup.html')
|
||||
@check_login
|
||||
|
||||
def getuserf(req):
|
||||
return render(req,'getuser.html')
|
||||
@check_login
|
||||
|
||||
def getusersf(req):
|
||||
return render(req,'getusers.html')
|
||||
@check_login
|
||||
|
||||
def trainhtml(req):
|
||||
return render(req,'train.html')
|
||||
@check_login
|
||||
|
||||
def abtrain(req):
|
||||
return render(req,'abtrain.html')
|
||||
@check_login
|
||||
|
||||
def drillhtml(req):
|
||||
return render(req,'drill.html')
|
||||
@check_login
|
||||
|
||||
def abdrill(req):
|
||||
return render(req,'abdrill.html')
|
||||
@check_login
|
||||
|
||||
def reporthtml(req):
|
||||
return render(req,'report.html')
|
||||
@check_login
|
||||
|
||||
def troubleashtml(req):
|
||||
return render(req,'troubleashtml.html')
|
||||
@check_login
|
||||
|
||||
def userhtml(req):
|
||||
return render(req,'userhtml.html')
|
||||
@check_login
|
||||
|
||||
def bhrhtml(req):
|
||||
return render(req,'behavior.html')
|
||||
@check_login
|
||||
|
||||
def trainfigure(req):
|
||||
return render(req,'trainfigure.html')
|
||||
@check_login
|
||||
|
||||
def equipmentfigure(req):
|
||||
return render(req,'equipmentfigure.html')
|
||||
@check_login
|
||||
|
||||
def mainhtml(req):
|
||||
#计算一些数据
|
||||
userid = req.session['userid']
|
||||
|
@ -403,6 +403,7 @@ def login(req):
|
|||
if user.exists():
|
||||
if check_password(password,user[0].epassword):
|
||||
req.session['userid'] = user[0].userid
|
||||
req.session.set_expiry(60*40)
|
||||
return redirect('index')
|
||||
else:
|
||||
msg = '密码错误'
|
||||
|
@ -578,48 +579,53 @@ def getspr(ubp):
|
|||
|
||||
def getsprs(userid,ubp):
|
||||
currentpart=ubp
|
||||
a=getsprs_ubp2(userid,currentpart)
|
||||
a=getsprs_ubp(userid,currentpart)
|
||||
while a==False:
|
||||
currentpart=currentpart.parentid #已找不到上级部门
|
||||
if currentpart:
|
||||
a=getsprs_ubp2(userid,currentpart)
|
||||
a=getsprs_ubp(userid,currentpart)
|
||||
else:
|
||||
return User.objects.get(ubelongpart=currentpart,issuper=1)
|
||||
return a
|
||||
|
||||
def getsprs_ubp(userid,ubp):
|
||||
def getsprs_ubp(userid,ubp):#主管和被授权人员
|
||||
a=ubp
|
||||
if a.aqy !=',':
|
||||
aqystr = a.aqy
|
||||
aqylist = aqystr.split(',')
|
||||
aqylist = list(map(int, list(filter(None, aqylist))))
|
||||
if userid in aqylist:
|
||||
return [userid]
|
||||
else:
|
||||
if ',' + str(userid) + ',' in a.bmzg:
|
||||
return [userid]
|
||||
else:
|
||||
return aqylist
|
||||
# if a.aqy !=',':
|
||||
# aqystr = a.aqy
|
||||
# aqylist = aqystr.split(',')
|
||||
# aqylist = list(map(int, list(filter(None, aqylist))))
|
||||
# if userid in aqylist:
|
||||
# return [userid]
|
||||
# else:
|
||||
# if ',' + str(userid) + ',' in a.bmzg:
|
||||
# return [userid]
|
||||
# else:
|
||||
# return aqylist
|
||||
if a.bmzg !=',':
|
||||
zgstr = a.bmzg
|
||||
zglist = zgstr.split(',')
|
||||
zglist = list(map(int, list(filter(None, zglist))))
|
||||
bsqstr = a.bsq
|
||||
bsqlist = list(map(int, list(filter(None, bsqstr.split(',')))))
|
||||
if userid in zglist:
|
||||
return [userid]
|
||||
elif userid in bsqlist:
|
||||
zglist.append(userid)
|
||||
return zglist
|
||||
else:
|
||||
return zglist
|
||||
else:
|
||||
return False
|
||||
|
||||
def getsprs_ubp2(userid,ubp):
|
||||
a=ubp
|
||||
if a.aqy !=',' or a.bmzg !=',':
|
||||
allstr = a.aqy + a.bmzg
|
||||
alllist = allstr.split(',')
|
||||
alist = list(map(int, list(filter(None, alllist))))
|
||||
return alist
|
||||
else:
|
||||
return False
|
||||
# def getsprs_ubp2(userid,ubp):
|
||||
# a=ubp
|
||||
# if a.aqy !=',' or a.bmzg !=',':
|
||||
# allstr = a.aqy + a.bmzg
|
||||
# alllist = allstr.split(',')
|
||||
# alist = list(map(int, list(filter(None, alllist))))
|
||||
# return alist
|
||||
# else:
|
||||
# return False
|
||||
|
||||
|
||||
def menutree(req):
|
||||
|
@ -1355,7 +1361,7 @@ def getdickey(req):
|
|||
if req.GET.get('dicclass')=='33':
|
||||
for i in a:
|
||||
objs = Operationspjd.objects.filter(zylx=Dickey.objects.get(dickeyid=i['dickeyid']),usecomp=Partment.objects.get(partid=companyid))
|
||||
str='作业负责人-作业部门安全员-属地部门安全员'
|
||||
str='作业负责人-作业部门-属地部门'
|
||||
for x in objs:
|
||||
str = str + '-' + x.jdmc
|
||||
i['splcdetail'] = str
|
||||
|
@ -1730,7 +1736,7 @@ def troublehandle(req):
|
|||
a = a.filter(Q(zgbm__in=parts) | Q(fxbm__in=parts,zgbm=None))
|
||||
total = a.count()
|
||||
startnum,endnum=fenye(req)
|
||||
obj = a.order_by('-xgsj')[startnum:endnum].values('troubleid','fxr__userid','fxr__name','yhms','yhzt','fxsj','tbsj','yhlb__dickeyname','todouser__name','yhpg__dickeyname','yhnum','yhdj__dickeyname','shresult','zgqx','yhtp','zghtp','todouser__userid')
|
||||
obj = a.order_by('-fxsj')[startnum:endnum].values('troubleid','fxr__userid','fxr__name','yhms','yhzt','fxsj','tbsj','yhlb__dickeyname','todouser__name','yhpg__dickeyname','yhnum','yhdj__dickeyname','shresult','zgqx','yhtp','zghtp','todouser__userid')
|
||||
return HttpResponse(transjson(total,obj),content_type="application/json")
|
||||
elif a == 'listarea':
|
||||
userid = req.session['userid']
|
||||
|
@ -2581,7 +2587,7 @@ def pxhandle(req):
|
|||
a = a.filter(starttime__lte=jssj)
|
||||
total=a.count()
|
||||
startnum,endnum=fenye(req)
|
||||
obj=a.order_by('-modifytime')[startnum:endnum].values('trainnum','trainid','state','trainplace','starttime','trainname','traintype__dickeyname','teacher','lecturer__name','submituser__name','submituser__userid')
|
||||
obj=a.order_by('-starttime')[startnum:endnum].values('trainnum','trainid','state','trainplace','starttime','trainname','traintype__dickeyname','teacher','lecturer__name','submituser__name','submituser__userid')
|
||||
return HttpResponse(transjson(total,obj),content_type="application/json")
|
||||
elif req.GET.get('a')=='detailhtml':
|
||||
trainid = req.GET.get('trainid')
|
||||
|
@ -2787,7 +2793,7 @@ def ylhandle(req):
|
|||
a = a.filter(starttime__lte=jssj)
|
||||
total=a.count()
|
||||
startnum,endnum=fenye(req)
|
||||
obj=a.order_by('-modifytime')[startnum:endnum].values('drillnum','drillid','state','drillplace','starttime','drillname','drilltype__dickeyname','chief__name','submituser__name','submituser__userid')
|
||||
obj=a.order_by('-starttime')[startnum:endnum].values('drillnum','drillid','state','drillplace','starttime','drillname','drilltype__dickeyname','chief__name','submituser__name','submituser__userid')
|
||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||
|
||||
def gchandle(req):
|
||||
|
@ -3195,7 +3201,7 @@ def importusers(req):
|
|||
|
||||
@apicheck_login
|
||||
def apicompany(req):
|
||||
if int(request.session.get('userid'))==8:
|
||||
if int(req.session.get('userid'))==8:
|
||||
a = req.GET.get('a')
|
||||
menurights = '11,1,2,3,4,5,6,7,8,9,10,12,13,15,16,17,18,19,20,21,22,23,24,28,29,32,36,46,47,48,50'#菜单编码
|
||||
if a=='add':
|
||||
|
@ -3901,7 +3907,7 @@ def apisuggest(req):
|
|||
if req.GET.get('jssj'):
|
||||
a = a.filter(submittime__lte=req.GET.get('jssj'))
|
||||
total = a.count()
|
||||
a = a[startnum:endnum].values('jyid','jylb__dickeyname','jyr__name','jybm__partname','dqxz','jynr','jynum','jyzt','todouser__userid','todouser__name','jyqy__name','jydd','submittime','accept')
|
||||
a = a.order_by('-submittime')[startnum:endnum].values('jyid','jylb__dickeyname','jyr__name','jybm__partname','dqxz','jynr','jynum','jyzt','todouser__userid','todouser__name','jyqy__name','jydd','submittime','accept')
|
||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||
elif a == 'exportexcel':
|
||||
userid = req.session['userid']
|
||||
|
@ -4159,6 +4165,13 @@ def apitool(req):
|
|||
i.epassword = make_password(i.password)
|
||||
i.save()
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'correct_operation':
|
||||
for i in Operation.objects.all():
|
||||
if i.zyzt['zyzt'] == '待关闭' or i.zyzt['zyzt'] == '已关闭':
|
||||
if 'jdmc' in i.zyzt:
|
||||
i.zyzt['jdmc'] =''
|
||||
i.save()
|
||||
return JsonResponse({"code":1})
|
||||
|
||||
|
||||
|
||||
|
@ -4352,6 +4365,7 @@ def apinotice(req):
|
|||
|
||||
def apioperation(req):
|
||||
a = req.GET.get('a')
|
||||
userid = req.session['userid']
|
||||
if a == 'add':
|
||||
userid = req.session['userid']
|
||||
oneuser = User.objects.get(userid=userid)
|
||||
|
@ -4375,9 +4389,9 @@ def apioperation(req):
|
|||
obj.zyzt = {'zyzt':'确认中','index':0}
|
||||
obj.save()
|
||||
splc = []
|
||||
splc.append({'jdmc':'作业负责人','sprs':[userid]})
|
||||
splc.append({'jdmc':'作业部门审批中','sprs':getsprs(userid,obj.zybm)})
|
||||
splc.append({'jdmc':'属地部门审批中','sprs':getsprs(userid,obj.sdbm)})
|
||||
splc.append({'jdmc':'作业负责人审批','sprs':[userid]})
|
||||
splc.append({'jdmc':'作业部门审批','sprs':getsprs(userid,obj.zybm)})
|
||||
splc.append({'jdmc':'属地部门审批','sprs':getsprs(userid,obj.sdbm)})
|
||||
for i in Operationspjd.objects.filter(zylx=obj.zylx,usecomp=Partment.objects.get(partid=getcompany(userid))).order_by('id'):
|
||||
splc.append({'jdmc':i.jdmc,'sprs':i.sprs})
|
||||
obj.zyzt['splc']=splc
|
||||
|
@ -4386,7 +4400,50 @@ def apioperation(req):
|
|||
b=[]#发送通知
|
||||
for i in data['zyry']:
|
||||
x=User.objects.get(userid=i)
|
||||
m = Operzyry(oper=obj,operzyry=x)
|
||||
if int(userid)==int(i):#申请人包含作业人直接确认
|
||||
m = Operzyry.objects.create(oper=obj,operzyry=x,checked=1)
|
||||
if Operzyry.objects.filter(oper=obj,checked=0).exists():
|
||||
pass
|
||||
else:#工作人员全部确认
|
||||
obj.zyzt['zyzt'] = '审批中'
|
||||
obj.zyzt['index'] = 0
|
||||
index = obj.zyzt['index']
|
||||
sprs = [] #初始化审批人列表
|
||||
if 'sprs' in obj.zyzt['splc'][index]:
|
||||
sprs = obj.zyzt['splc'][index]['sprs']
|
||||
else:
|
||||
sprs = [obj.zyzt['splc'][index]['spr']]
|
||||
jdmc = obj.zyzt['splc'][index]['jdmc']
|
||||
obj.zyzt['jdmc'] = jdmc
|
||||
obj.todousers = sprs
|
||||
obj.save()
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批,审批节点:' + obj.zyzt['jdmc']
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'请您及时完成审批!'
|
||||
}
|
||||
}
|
||||
}
|
||||
tolist = list(User.objects.filter(userid__in=sprs).values_list('openid',flat=True))
|
||||
send_wechatmsgs.delay(postdict,tolist)
|
||||
return JsonResponse({"code":1})
|
||||
else:
|
||||
m = Operzyry.objects.create(oper=obj,operzyry=x)
|
||||
m.save()
|
||||
b.append(x.openid)
|
||||
|
||||
|
@ -4459,6 +4516,8 @@ def apioperation(req):
|
|||
zyid=req.GET.get('zyid')
|
||||
a = Operation.objects.filter(zyid=zyid)
|
||||
x = a.values('zyid','zydd','zylx__dickeyname','zynum','zyfzr__name','zynr','zyzt','zyimg','submittime','zybm__partname','sdbm__partname','kssj','jssj','fxcs','zyimg2')[0]
|
||||
for i in x['zyzt']['splc']:
|
||||
i['sprs'] = ','.join(list(User.objects.filter(userid__in=i['sprs']).values_list('name',flat=True)))
|
||||
if x['zyimg']!='':
|
||||
x['zyimg'] = x['zyimg'].split('?')
|
||||
else:
|
||||
|
@ -4469,8 +4528,10 @@ def apioperation(req):
|
|||
x['zyimg2']=[]
|
||||
x['fxcs'] = list(Fxcs.objects.filter(id__in=x['fxcs'].split('?')).values('id','fxfx','aqcs','cslx'))
|
||||
#确认详情
|
||||
qrxq = Operzyry.objects.filter(oper=Operation.objects.get(zyid=zyid)).values('operzyry__name','checked')
|
||||
qrxqobjs = Operzyry.objects.filter(oper=Operation.objects.get(zyid=zyid))
|
||||
qrxq = qrxqobjs.values('operzyry__name','checked')
|
||||
x['qrxq'] = list(qrxq)
|
||||
x['zyry'] = ','.join(list(qrxqobjs.values_list('operzyry__name',flat=True)))
|
||||
#审批详情
|
||||
spxq = Operspxq.objects.filter(oper=Operation.objects.get(zyid=zyid)).order_by('submittime').values('jdmc','spbm__partname','spr__name','submittime','checked')
|
||||
x['spxq'] = list(spxq)
|
||||
|
@ -4483,30 +4544,32 @@ def apioperation(req):
|
|||
userid = req.session['userid']
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
zyid = data['zyid']
|
||||
obj = Operation.objects.get(zyid=zyid)
|
||||
Operzyry.objects.filter(oper__zyid=zyid,operzyry__userid=userid).update(checked=1)
|
||||
if Operzyry.objects.filter(oper__zyid=zyid,checked=0).exists():
|
||||
pass
|
||||
else:
|
||||
obj = Operation.objects.get(zyid=zyid)
|
||||
else:#工作人员全部确认
|
||||
nowzt = obj.zyzt
|
||||
obj.zyzt['zyzt'] = '审批中'
|
||||
obj.zyzt['index'] = 0
|
||||
index = obj.zyzt['index']
|
||||
obj.zyzt['jdmc'] = obj.zyzt['splc'][index]['jdmc']
|
||||
spruser = User.objects.get(userid=userid)
|
||||
sprs = [] #初始化审批人列表
|
||||
if 'sprs' in obj.zyzt['splc'][index]:
|
||||
sprs = obj.zyzt['splc'][index]['sprs']
|
||||
else:
|
||||
sprs = [obj.zyzt['splc'][index]['spr']]
|
||||
jdmc = obj.zyzt['splc'][index]['jdmc']
|
||||
obj.zyzt['jdmc'] = jdmc
|
||||
obj.todousers = sprs
|
||||
obj.save()
|
||||
for i in sprs:
|
||||
postdict={
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':User.objects.get(userid=i).openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批:'
|
||||
'value':obj.zylx.dickeyname + '作业审批,审批节点:' + obj.zyzt['jdmc']
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
|
@ -4522,92 +4585,45 @@ def apioperation(req):
|
|||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
tolist = list(User.objects.filter(userid__in=sprs).values_list('openid',flat=True))
|
||||
send_wechatmsgs.delay(postdict,tolist)
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'spzy':
|
||||
userid = req.session['userid']
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
zyid = data['zyid']
|
||||
obj = Operation.objects.get(zyid=zyid)
|
||||
oldtodo = obj.todousers
|
||||
oldjdmc = obj.zyzt['jdmc']
|
||||
oldindex = obj.zyzt['index']
|
||||
nextindex = obj.zyzt['index']+1
|
||||
spruser = User.objects.get(userid=userid)
|
||||
if 'zzsp' in data:#关闭审批
|
||||
obj.zyzt['zyzt'] = '待关闭'
|
||||
obj.todouser = obj.zyfzr
|
||||
obj.todousers = None
|
||||
obj.save()
|
||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':obj.zyfzr.openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批通过:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'你是作业负责人,可以开始作业,作业完成请及时关闭!'
|
||||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
if 'zjsp' in data:#转交审批
|
||||
newsprs = data['newsprs']#新审批人
|
||||
obj.todousers = newsprs
|
||||
obj.save()
|
||||
for i in newsprs:
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':User.objects.get(userid=i).openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'请您及时完成审批!'
|
||||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsg.delay(postdict)
|
||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=2,spbm=spruser.ubelongpart)
|
||||
return JsonResponse({"code":1})
|
||||
try:
|
||||
if oldindex == 0:
|
||||
Operspxq.objects.create(oper=obj,jdmc=obj.zyzt['splc'][0]['jdmc'],spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
spr1 = data['spr1'] if 'spr1' in data else None
|
||||
spr2 = data['spr2'] if 'spr2' in data else None
|
||||
if spr1:
|
||||
obj.zyzt['splc'][1]['sprs'] = [spr1] #作业部门审批人
|
||||
if spr2:
|
||||
obj.zyzt['splc'][2]['sprs'] = [spr2] #属地部门审批人
|
||||
while nextindex<len(obj.zyzt['splc']):
|
||||
nextsplc = obj.zyzt['splc'][nextindex]
|
||||
obj.zyzt['zyzt'] = '审批中'
|
||||
obj.zyzt['index'] = nextindex
|
||||
obj.zyzt['jdmc'] = nextsplc['jdmc']
|
||||
obj.todousers = nextsplc['sprs']
|
||||
obj.save()
|
||||
for i in nextsplc['sprs']:
|
||||
if userid in nextsplc['sprs']:#本人可审批直接跳过
|
||||
Operspxq.objects.create(oper=obj,jdmc=nextsplc['jdmc'],spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
else:
|
||||
obj.zyzt['zyzt'] = '审批中'
|
||||
obj.zyzt['index'] = nextindex
|
||||
obj.zyzt['jdmc'] = nextsplc['jdmc']
|
||||
obj.todousers = nextsplc['sprs']
|
||||
obj.save()
|
||||
tolist = list(User.objects.filter(userid__in=nextsplc['sprs']).values_list('openid',flat=True))
|
||||
toliststr = ','.join(list(User.objects.filter(userid__in=nextsplc['sprs']).values_list('name',flat=True)))
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':User.objects.get(userid=i).openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批:'
|
||||
'value':obj.zylx.dickeyname + '作业审批,审批节点:' + obj.zyzt['jdmc']
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
|
@ -4619,26 +4635,33 @@ def apioperation(req):
|
|||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'请您及时完成审批!'
|
||||
'value':'请您及时完成审批!可审批人:'+toliststr
|
||||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsg.delay(postdict)
|
||||
|
||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
except :
|
||||
obj.zyzt['zyzt'] = '待关闭'
|
||||
obj.todouser = None
|
||||
obj.todousers = [obj.zyfzr.userid]
|
||||
send_wechatmsgs.delay(postdict,tolist)
|
||||
return JsonResponse({"code":1})
|
||||
nextindex = nextindex + 1
|
||||
if 'zjsp' in data:#转交上级审批
|
||||
if spruser.ubelongpart.parentid:
|
||||
newsprs = getsprs(userid,spruser.ubelongpart.parentid)
|
||||
else:
|
||||
newsprs = getsprs(userid,spruser.usecomp)
|
||||
#newsprs = data['newsprs']#新审批人
|
||||
obj.zyzt['jdmc'] = '上级审批'
|
||||
obj.zyzt['index'] = nextindex
|
||||
obj.todousers = newsprs
|
||||
obj.zyzt['splc'].insert(nextindex,{'jdmc':'上级审批','sprs':newsprs})
|
||||
obj.save()
|
||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
tolist = list(User.objects.filter(userid__in=newsprs).values_list('openid',flat=True))
|
||||
toliststr = ','.join(list(User.objects.filter(userid__in=newsprs).values_list('name',flat=True)))
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':obj.zyfzr.openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批通过:'
|
||||
'value':obj.zylx.dickeyname + '作业审批,审批节点:' + obj.zyzt['jdmc']
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
|
@ -4650,11 +4673,43 @@ def apioperation(req):
|
|||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'你是作业负责人,可以开始作业,作业完成请及时关闭!'
|
||||
'value':'请您及时完成审批!可审批人:'+toliststr
|
||||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsg.delay(postdict)
|
||||
send_wechatmsgs.delay(postdict,tolist)
|
||||
Operspxq.objects.create(oper=obj,jdmc=obj.zyzt['splc'][nextindex-1]['jdmc'],spr=spruser,checked=2,spbm=spruser.ubelongpart)
|
||||
return JsonResponse({"code":1})
|
||||
obj.zyzt['zyzt'] = '待关闭'
|
||||
obj.zyzt['jdmc'] = ''
|
||||
obj.zyzt['index'] = nextindex
|
||||
obj.todouser = None
|
||||
obj.todousers = [obj.zyfzr.userid]
|
||||
obj.save()
|
||||
postdict={
|
||||
'touser':obj.zyfzr.openid,
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批通过:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'你是作业负责人,可以开始作业,作业完成请及时关闭!'
|
||||
}
|
||||
}
|
||||
}
|
||||
Operspxq.objects.create(oper=obj,jdmc=obj.zyzt['splc'][nextindex-1]['jdmc'],spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'gbzy':#关闭作业
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
|
@ -4664,6 +4719,7 @@ def apioperation(req):
|
|||
obj = Operation.objects.get(zyid=zyid)
|
||||
obj.zyimg2 = '?'.join(zyimg2)
|
||||
obj.zyzt['zyzt']='已关闭'
|
||||
obj.zyzt['jdmc']=''
|
||||
obj.todouser = None
|
||||
obj.todousers = None
|
||||
obj.save()
|
||||
|
@ -5280,14 +5336,14 @@ def apiexamtestdetail(req):
|
|||
def apitrain(req):
|
||||
if req.GET.get('a')=='listjoin':
|
||||
userid = req.session['userid']
|
||||
objs = Trainuser.objects
|
||||
objs = Trainuser.objects.filter(train__deletemark=1)
|
||||
if req.GET.get('sry'):
|
||||
objs = objs.filter(participant__userid=req.GET.get('sry'))
|
||||
else:
|
||||
objs = objs.filter(participant__userid=userid)
|
||||
total= objs.count()
|
||||
startnum,endnum=fenye(req)
|
||||
objs=objs[startnum:endnum].values('train__trainnum','train__trainid','train__state','train__trainplace','train__starttime','train__trainname','train__teacher','train__lecturer__name','participant__name','participant__name','checked')
|
||||
objs=objs[startnum:endnum].values('train__trainnum','train__trainid','train__state','train__trainplace','train__starttime','train__trainname','train__teacher','train__lecturer__name','participant__name','participant__name','checked','train__duration','examtestdetail')
|
||||
return HttpResponse(transjson(total,objs),content_type="application/json")
|
||||
|
||||
def apiquestioncat(req):
|
||||
|
@ -5541,7 +5597,7 @@ def apiinspect(req):
|
|||
a = a.filter(state=state)
|
||||
total=a.count()
|
||||
startnum,endnum=fenye(req)
|
||||
a = a.order_by('-id')[startnum:endnum].values('id','state','content','creattime','equipment__num','equipment__name','equipment__area__name','user__name','user__ubelongpart__partname','trouble__yhzt','trouble__yhnum','trouble__yhms')
|
||||
a = a.order_by('-creattime')[startnum:endnum].values('id','state','content','creattime','equipment__num','equipment__name','equipment__area__name','user__name','user__ubelongpart__partname','trouble__yhzt','trouble__yhnum','trouble__yhms')
|
||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||
elif a == 'exportexcel':
|
||||
objs = Inspect.objects.filter(usecomp__partid=companyid)
|
||||
|
|
Loading…
Reference in New Issue