This commit is contained in:
shilixia 2020-11-18 10:06:30 +08:00
commit 4d89b1ed4c
24 changed files with 663 additions and 84 deletions

View File

@ -95,7 +95,7 @@ def drquestions(companyid,path,userid):
cateobj = Questioncat.objects.create(usecomp=Partment.objects.get(partid=companyid),name=cate)
if type == '单选':
if Question.objects.filter(type=1,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').exists():
Question.objects.filter(type=1,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='')
Question.objects.filter(type=1,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='', questioncat=cateobj)
else:
if right in ['A','B','C','D','E','F']:
obj = Question()
@ -115,7 +115,7 @@ def drquestions(companyid,path,userid):
elif type == '多选':
right = list(right)
if Question.objects.filter(type=2,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').exists():
Question.objects.filter(type=2,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='')
Question.objects.filter(type=2,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='', questioncat=cateobj)
else:
if [False for c in right if c not in qlist]:
pass
@ -140,7 +140,7 @@ def drquestions(companyid,path,userid):
else:
right = 'B'
if Question.objects.filter(type=3,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').exists():
Question.objects.filter(type=3,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='')
Question.objects.filter(type=3,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='', questioncat=cateobj)
else:
obj = Question()
obj.type = 3

View File

@ -0,0 +1,27 @@
# Generated by Django 2.2.8 on 2020-11-17 13:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('safesite', '0365_auto_20201115_2158'),
]
operations = [
# migrations.RemoveField(
# model_name='companyinfo',
# name='liaison_fax',
# ),
migrations.AlterField(
model_name='checktask',
name='checkplace',
field=models.TextField(default=''),
),
migrations.AlterField(
model_name='checktask',
name='userlist',
field=models.TextField(default=''),
),
]

View File

@ -0,0 +1,22 @@
# Generated by Django 2.2.8 on 2020-11-17 14:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('safesite', '0366_auto_20201117_1314'),
]
operations = [
# migrations.RemoveField(
# model_name='companyinfo',
# name='liaison_fax',
# ),
migrations.AddField(
model_name='questioncat',
name='isopen',
field=models.IntegerField(default=0),
),
]

View File

@ -693,6 +693,7 @@ class Questioncat(models.Model): # 题目分类
modifytime = models.DateTimeField(auto_now=True)
usecomp = models.ForeignKey(
Partment, on_delete=models.CASCADE, null=True, blank=True)
isopen = models.IntegerField(default=0) #默认不共享
# 题库数据表
@ -1291,13 +1292,13 @@ class Checktask(models.Model):
checktype=models.ForeignKey(Checktable,on_delete=models.CASCADE)#关联检查表
checkname=models.ManyToManyField(User,related_name='jiancha')#检查人员
checktime= models.DateTimeField(null=True, blank=True)#任务首次执行时间
checkplace=models.CharField(max_length=200)#检查地点
checkplace=models.TextField(default='')#检查地点
createuser = models.ForeignKey(User,related_name='chuangjians',on_delete=models.CASCADE)#创建人
createdate = models.DateTimeField(default = timezone.now)#创建时间
usecomp = models.ForeignKey(Partment,related_name='taskscomp',on_delete=models.CASCADE,null=True,blank=True)#创建公司
deletemark = models.IntegerField(default=1)#是否删除
tasktype = models.IntegerField(default=0)#任务执行频率1每天2每周3每月4每季度5每半年6每年
userlist = models.CharField(max_length=200,null=True,)#检查人列表
userlist = models.TextField(default='')#检查人列表
zxstate = models.IntegerField(default=1)#1同时执行2一个执行就执行
taskstate = models.IntegerField(default=1)#是否暂停1运行2暂停

View File

@ -15,16 +15,11 @@ headers = {
def getTzzs(certnum,stu_name):#特种证书(身份证号,姓名,均是字符)
certtype_code='720'
proxies = {
"http": "http://112.91.78.240:5412"
}
stu_name=parse.quote(parse.quote(stu_name))
text1 = requests.post('http://cx.mem.gov.cn//cms/html/certQuery/certQuery.do?method=getServerTime',headers=headers, proxies=proxies).text
print(text1)
text1 = requests.post('http://cx.mem.gov.cn//cms/html/certQuery/certQuery.do?method=getServerTime',headers=headers).text
sessionId = eval(text1)['time']
url = "http://cx.mem.gov.cn/cms/html/certQuery/certQuery.do?method=getCertQueryResult&ref=ch&certtype_code="+certtype_code+"&certnum="+certnum+"&stu_name="+stu_name+'&passcode=1234'+'&sessionId='+sessionId
data = requests.get(url,headers=headers, proxies=proxies).text
data = requests.get(url,headers=headers).text
tree = etree.HTML(data)
e1 = tree.xpath("//th[text()='姓名']/following-sibling::td[1]/text()")
e2 = tree.xpath("//th[text()='性别']/following-sibling::td[1]/text()")

View File

@ -178,7 +178,9 @@
.icon-inspectitem {
background: url('icons/inspectitem.png') no-repeat center center;
}
.icon-scheduleset {
background: url('icons/scheduleset.png') no-repeat center center;
}
.icon-mini-add{

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

View File

@ -213,14 +213,16 @@ function convert(rows, x) {
id: row.id,
text: row.name,
state: x,
pic: row.pic
pic: row.pic,
isopen: row.isopen
}
if(row.name=='默认分类'){
node = {
id: row.id,
text: row.name,
state: 'closed',
pic: row.pic
pic: row.pic,
isopen: row.isopen
}
}
@ -238,7 +240,7 @@ function convert(rows, x) {
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
if (row.parentId == node.id) {
var child = { id: row.id, text: row.name, pic: row.pic };
var child = { id: row.id, text: row.name, pic: row.pic, isopen:row.isopen };
if (node.children) {
node.children.push(child);
} else {

View File

@ -16,7 +16,7 @@
<input id="repeat" name="repeat" val="yes" type="hidden"></input>
</div>
<div style="margin-bottom:5px;">
<input id="tmfls" editable="false" name="tmfls" class="easyui-combotree" style="width:90%"
<input id="tmfls" editable="false" name="tmfls" style="width:90%"
data-options="label:'选择分类'" required=true />
</div>
<div style="margin-bottom:5px;text-align:center">
@ -94,7 +94,7 @@
})
$("#tmfls").combotree({
url: 'api/questioncat?a=tree3',
url: 'api/questioncat?a=tree4',
method: 'get',
multiple: true,
loadFilter: function (rows) {

View File

@ -217,7 +217,7 @@
success: function (data) {
alert(data.msg);
$("#dd").dialog("close");
$("#dd").dialog("refresh");
}
});
};

View File

@ -171,7 +171,12 @@
<!-- <button type="hidden" id="getb" onclick="test()" /> -->
<script>
$.messager.show({
title:'提示',
msg:'每晚10点-11点为维护时间,请尽量不在此时间使用',
timeout:5000,
showType:'slide'
});
var openid = $('#userindex').attr('openid');
var nickname = $('#userindex').attr('nickname');
var headimgurl = $('#userindex').attr('headimgurl');

View File

@ -54,8 +54,13 @@
<a id="drtms" onclick="javascript:$('#drtmdg').dialog('open').window('center');" class="easyui-linkbutton"
data-options="iconCls:'fa-upload',plain:true">导入试题</a>
{% endif %}
{% if request|has_permission:'b_question_copy' %}
<a id="fztms" onclick="javascript:$('#fztmdg').dialog('open').window('center');" class="easyui-linkbutton"
data-options="iconCls:'fa-clone',plain:true">复制题目至自建分类</a>
{% endif %}
{% if request|has_permission:'b_question_export' %}
<a id="exportquestionexcel" onclick="exportquestionexcel()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
{% endif %}
<div>
<form id='searchtmff'>
<select name='type' style="width:100px" class="easyui-combobox" data-options="prompt:'题型'">
@ -140,9 +145,13 @@
},
formatter: function (node) {
var s = node.text;
if (node.children) {
s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
}
if(node.isopen==1){
s +='<span style=\'color:red\'>(已共享)</span>'
}
return s;
},
onSelect: function (row) {
@ -158,6 +167,7 @@
},
formatter: function (node) {
var s = node.text;
if (node.children) {
s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
}
@ -426,4 +436,50 @@
}; //请求完成
xhr.onerror = function (evt) { $.messager.alert('提示', '失败!文件内容有误'); document.getElementById('drfile').value = ''; }; //请求失败
}
function exportquestionexcel(){
var data = $('#tmtable').datagrid('getData');
var datalist = data.rows;
var datalist_ = []
for (var j = 0, len = datalist.length; j < len; j++) {
var dic = datalist[j]
var i = {}
i["题目"] = dic.title
i["分类"] = dic.questioncat__name
i["题型"] = '单选'
if(dic.type==2){
i["题型"] = '多选'
}
else if(dic.type==3){
i["题型"] = '判断'
}
i['选项A'] = ''
i['选项B'] = ''
i['选项C'] = ''
i['选项D'] = ''
i['选项E'] = ''
i['选项F'] = ''
if(dic.answer.A){
i['选项A'] = dic.answer.A
}
if(dic.answer.B){
i['选项B'] = dic.answer.B
}
if(dic.answer.C){
i['选项C'] = dic.answer.C
}
if(dic.answer.D){
i['选项D'] = dic.answer.D
}
if(dic.answer.E){
i['选项E'] = dic.answer.E
}
if(dic.answer.F){
i['选项F'] = dic.answer.F
}
i['正确答案'] = dic.right
datalist_.push(i)
}
JSONToCSVConvertor(JSON.stringify(datalist_), "题目列表", true);
}
</script>

View File

@ -16,6 +16,10 @@
editable="false">
</select>
</div>
<div style="margin-bottom:10px">
<label>是否共享</label>
<input type="checkbox" id="isopen" name="isopen" value="1">
</div>
</form>
</div>
<script>

View File

@ -17,6 +17,10 @@
editable="false">
</select>
</div>
<div style="margin-bottom:10px">
<label>是否共享</label>
<input type="checkbox" id="isopen" name="isopen" value="1">
</div>
</form>
</div>
<script>
@ -30,6 +34,9 @@
$('#name').textbox('setValue',res.name)
$('#tmflid').val(res.id)
$('#parent').combotree('setValue',res.parent__id)
if(res.isopen == 1){
$('#isopen').attr("checked", 'checked');
}
})
function submitform() {
$.ajax({
@ -52,6 +59,7 @@
$("#mrfltree").tree('reload');
$("#zjfltree").tree('reload');
$("#dd").dialog("close");
$('#gxfltree').tree("reload")
} else { $.messager.alert('提示', '失败,该选项不可编辑!'); }
$('#submitb').linkbutton('enable');
},

View File

@ -1,10 +1,21 @@
<table id="aqzstable" style="width:auto;height:100%;"></table>
<a id="downa" href="" target="_blank" style="display:none"></a>
<div id="aqzstablebar" style="padding: 4px;height: 40px;">
<div style="width: 300px;float: right;padding: 5px;">
<div id="aqzstablebar">
<div style="width: 400px;">
<label>快捷查询</label>
<select id='kjcxaqzs' style='width:150px'>
<option value="">请选择</option>
<option value="listself">我的证书</option>
<option value="listall">全部证书</option>
</select>
</div>
<div style="padding: 5px;">
{% load myfilter %}
{% if request|has_permission:'b_safecert_add' %}
<!-- <a id="addaqzs" class="easyui-linkbutton" onclick="addaqzs()" data-options="iconCls: 'fa-plus',plain:true">新增</a> -->
<a id="addaqzs" class="easyui-linkbutton" onclick="addaqzs()" data-options="iconCls: 'fa-plus',plain:true">新增</a>
{% endif %}
{% if request|has_permission:'b_safecert_add' %}
<a id="editaqzs" class="easyui-linkbutton" onclick="editaqzs()" data-options="iconCls: 'fa-pencil',plain:true">编辑</a>
{% endif %}
{% if request|has_permission:'b_safecert_del' %}
<a id="delaqzs" class="easyui-linkbutton" onclick="delaqzs()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
@ -13,14 +24,7 @@
<a id="exportaqzsexcel" onclick="javascript:$('#aqzstable').datagrid('toExcel','证书.xls')" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
{% endif %}
</div>
<div style="padding: 5px;float: left;width: 400px;">
<label>快捷查询</label>
<select id='kjcxaqzs' style='width:150px'>
<option value="">请选择</option>
<option value="listself">我的证书</option>
<option value="listall">全部证书</option>
</select>
</div>
</div>
<script>
$(function(){
@ -101,4 +105,13 @@
$.messager.alert('提示', '未选择数据!');
}
}
function editaqzs(){
var row = $('#aqzstable').datagrid('getSelected');
if (row) {
opendg('编辑','html/safecert/edit/' + row.id)
}
else {
$.messager.alert('提示', '请先选择一条记录!');
}
}
</script>

View File

@ -1,12 +1,11 @@
<div class="easyui-layout" style="width:100%;height:100%;">
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="aqzssubmitForm()"
id="submitb">提交查询</a>
id="submitb">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
</div>
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
<form id="aqzsff" method="post" name="aqzsff" enctype="multipart/form-data">
<p style="color:red;">请输入相关信息后提交进行联网查询证书</p>
<div style="margin-bottom:5px">
<input id="aqzsry" class="easyui-textbox" style="width:480px" data-options="label:'员工',prompt:'请选择'" required=true
editable=false>
@ -14,12 +13,29 @@
<a id="chooseaqzsry" class='easyui-linkbutton' onclick="chooseaqzsry()" style="width:auto">选择</a>
</div>
<div style="margin-bottom:5px">
<input id="realname" class="easyui-textbox" name="realname" style="width:480px" data-options="
label:'真实姓名'," required=true>
<input id="zglx" class="easyui-textbox" name="zglx" style="width:480px" data-options="
label:'资格类型'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="cardnum" class="easyui-textbox" name="cardnum" style="width:480px" data-options="
label:'身份证号'," required=true>
<input id="fzjg" class="easyui-textbox" name="fzjg" style="width:480px" data-options="
label:'发证机关'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="dwlx" class="easyui-textbox" name="dwlx" style="width:480px" data-options="
label:'单位类型'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="yfsrq" class="easyui-datebox" name="yfsrq" style="width:480px" data-options="
label:'应复审'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqkssj" class="easyui-datebox" name="yxqkssj" style="width:480px" data-options="
label:'有效期开始'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqjssj" class="easyui-datebox" name="yxqjssj" style="width:480px" data-options="
label:'有效期结束'," required=true editable=false>
</div>
</div>
</form>
</div>
@ -29,7 +45,7 @@
var aqzsdata = $('#aqzsff').serializeJSON();
$.ajax({
type: "POST",
url: 'api/safecert?a=addspider',
url: 'api/safecert?a=add',
data: JSON.stringify(aqzsdata),
datatype: "json",
processData: false,

View File

@ -0,0 +1,96 @@
<div class="easyui-layout" style="width:100%;height:100%;">
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="aqzssubmitForm()"
id="submitb">提交查询</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
</div>
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
<form id="aqzsff" method="post" name="aqzsff" enctype="multipart/form-data">
<p style="color:red;">请输入相关信息后提交进行联网查询证书</p>
<div style="margin-bottom:5px">
<input id="aqzsry" class="easyui-textbox" style="width:480px" data-options="label:'员工',prompt:'请选择'" required=true
editable=false>
<input type="hidden" id="userid" name="userid" />
<a id="chooseaqzsry" class='easyui-linkbutton' onclick="chooseaqzsry()" style="width:auto">选择</a>
</div>
<div style="margin-bottom:5px">
<input id="realname" class="easyui-textbox" name="realname" style="width:480px" data-options="
label:'真实姓名'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="cardnum" class="easyui-textbox" name="cardnum" style="width:480px" data-options="
label:'身份证号'," required=true>
</div>
</form>
</div>
</div>
<script>
function aqzssubmitForm() {
var aqzsdata = $('#aqzsff').serializeJSON();
$.ajax({
type: "POST",
url: 'api/safecert?a=addspider',
data: JSON.stringify(aqzsdata),
datatype: "json",
processData: false,
contentType: "application/json;charset=utf-8",//这是原因
beforeSend: function () {
var bo = $('#aqzsff').form('validate')
if (bo == false) {
return bo
} else {
$('#submitb').linkbutton('disable');
}
loading('联网查询中,请稍等。。')
},
success: function (data) {
if (data.code == 1) {
$('#aqzstable').datagrid('reload');
$("#dd").dialog("close");
} else { $.messager.alert('提示', '相关信息错误或查询无证!'); }
$('#submitb').linkbutton('enable');
removeLoading()
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
// $("#p_test").innerHTML = "there is something wrong!";
// alert(XMLHttpRequest.status);
// alert(XMLHttpRequest.readyState);
// alert(textStatus);
removeLoading()
$('#submitb').linkbutton('enable');
}
});
}
function chooseaqzsry() {
var myh = screen.availHeight * 0.5;
$('#userdd').dialog({
maximizable: true,
title: '选择人员',
width: 700,
height: myh,
closed: false,
cache: false,
href: 'getuserf?a=aqzsry',
modal: true,
border: false,
});
$('#userdd').window('center');
}
function aaa(x) {
if (x == "aqzsry") {
userid = top.$('#in').val()
$('#userid').val(userid)
$.get("api/user?a=detail&userid=" + userid, function (result) {
if (result.userprofile__realname != null) {
$('#realname').setValue(result.userprofile__realname)
}
if (result.userprofile__cardnum != null) {
$('#cardnum').setValue(result.userprofile__cardnum)
}
});
$('#user').attr('value', top.$('#in').val());
$('#aqzsry').textbox('setValue', top.$('#in').attr('show'));
}
}
</script>

View File

@ -0,0 +1,117 @@
<div class="easyui-layout" style="width:100%;height:100%;">
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="aqzssubmitForm()"
id="submitb">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
</div>
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
<form id="aqzsff" method="post" name="aqzsff" enctype="multipart/form-data">
<div style="margin-bottom:5px">
<input id="aqzsry" class="easyui-textbox" style="width:480px" data-options="label:'员工',prompt:'请选择'" required=true
editable=false>
</div>
<div style="margin-bottom:5px">
<input id="zglx" class="easyui-textbox" name="zglx" style="width:480px" data-options="
label:'资格类型'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="fzjg" class="easyui-textbox" name="fzjg" style="width:480px" data-options="
label:'发证机关'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="dwlx" class="easyui-textbox" name="dwlx" style="width:480px" data-options="
label:'单位类型'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="yfsrq" class="easyui-datebox" name="yfsrq" style="width:480px" data-options="
label:'应复审'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqkssj" class="easyui-datebox" name="yxqkssj" style="width:480px" data-options="
label:'有效期开始'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqjssj" class="easyui-datebox" name="yxqjssj" style="width:480px" data-options="
label:'有效期结束'," required=true editable=false>
</div>
</div>
</form>
</div>
</div>
<script>
var id={{id}}
$.get('api/safecert?a=detail&id='+id,function(res){
$('#aqzsry').textbox('setValue',res.user__name)
$('#aqzsff').form('load', res)
})
function aqzssubmitForm() {
var aqzsdata = $('#aqzsff').serializeJSON();
$.ajax({
type: "POST",
url: 'api/safecert?a=add',
data: JSON.stringify(aqzsdata),
datatype: "json",
processData: false,
contentType: "application/json;charset=utf-8",//这是原因
beforeSend: function () {
var bo = $('#aqzsff').form('validate')
if (bo == false) {
return bo
} else {
$('#submitb').linkbutton('disable');
}
loading('联网查询中,请稍等。。')
},
success: function (data) {
if (data.code == 1) {
$('#aqzstable').datagrid('reload');
$("#dd").dialog("close");
} else { $.messager.alert('提示', '相关信息错误或查询无证!'); }
$('#submitb').linkbutton('enable');
removeLoading()
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
// $("#p_test").innerHTML = "there is something wrong!";
// alert(XMLHttpRequest.status);
// alert(XMLHttpRequest.readyState);
// alert(textStatus);
removeLoading()
$('#submitb').linkbutton('enable');
}
});
}
function chooseaqzsry() {
var myh = screen.availHeight * 0.5;
$('#userdd').dialog({
maximizable: true,
title: '选择人员',
width: 700,
height: myh,
closed: false,
cache: false,
href: 'getuserf?a=aqzsry',
modal: true,
border: false,
});
$('#userdd').window('center');
}
function aaa(x) {
if (x == "aqzsry") {
userid = top.$('#in').val()
$('#userid').val(userid)
$.get("api/user?a=detail&userid=" + userid, function (result) {
if (result.userprofile__realname != null) {
$('#realname').setValue(result.userprofile__realname)
}
if (result.userprofile__cardnum != null) {
$('#cardnum').setValue(result.userprofile__cardnum)
}
});
$('#user').attr('value', top.$('#in').val());
$('#aqzsry').textbox('setValue', top.$('#in').attr('show'));
}
}
</script>

View File

@ -1,19 +1,8 @@
<table id="tzzstable" style="width:auto;height:100%;"></table>
<a id="downa" href="" target="_blank" style="display:none"></a>
<div id="tzzstablebar" style="padding: 4px;height: 40px;">
<div style="width: 300px;float: right;padding: 5px;">
{% load myfilter %}
{% if request|has_permission:'b_socert_add' %}
<!-- <a id="addtzzs" class="easyui-linkbutton" onclick="addtzzs()" data-options="iconCls: 'fa-plus',plain:true">新增</a> -->
{% endif %}
{% if request|has_permission:'b_socert_del' %}
<a id="deltzzs" class="easyui-linkbutton" onclick="deltzzs()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
{% endif %}
{% if request|has_permission:'b_socert_exportexl' %}
<a id="exporttzzsexcel" onclick="javascript:$('#tzzstable').datagrid('toExcel','证书.xls')" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
{% endif %}
</div>
<div style="padding: 5px;float: left;width: 400px;">
<div id="tzzstablebar">
<div style="padding: 5px;">
<!-- <a id="tzzssearch" onclick="tzzssearch()" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">查询</a> -->
<!-- <a id="tzzsdetail" onclick="tzzsdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a> -->
<label>快捷查询</label>
@ -23,6 +12,21 @@
<option value="listall">全部证书</option>
</select>
</div>
<div style="padding: 5px;">
{% load myfilter %}
{% if request|has_permission:'b_socert_add' %}
<a id="addtzzs" class="easyui-linkbutton" onclick="addtzzs()" data-options="iconCls: 'fa-plus',plain:true">新增</a>
{% endif %}
{% if request|has_permission:'b_socert_add' %}
<a id="edittzzs" class="easyui-linkbutton" onclick="edittzzs()" data-options="iconCls: 'fa-pencil',plain:true">编辑</a>
{% endif %}
{% if request|has_permission:'b_socert_del' %}
<a id="deltzzs" class="easyui-linkbutton" onclick="deltzzs()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
{% endif %}
{% if request|has_permission:'b_socert_exportexl' %}
<a id="exporttzzsexcel" onclick="javascript:$('#tzzstable').datagrid('toExcel','证书.xls')" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
{% endif %}
</div>
<!-- <form id='searchwsff'>
<div>
<div>
@ -88,14 +92,13 @@
{ field: 'ccfzrq', title: '初次发证日期', width: 80 },
{ field: 'yfsrq', title: '应复审日期', width: 80 ,sortable:true,styler: function (value, row, index) {
switch (row.zszt) {
case 1: return 'background-color:green;'; break;
case 1: return 'background-color:green;color:white'; break;
case 2: return 'background-color:yellow;'; break;
case 3: return 'background-color:red;'; break;
case 3: return 'background-color:red;color:white'; break;
}
}},
{ field: 'yxqkssj', title: '有效期开始时间', width: 80 },
{ field: 'yxqjssj', title: '有效期结束时间', width: 80 },
{ field: 'sjfssj', title: '实际复审时间', width: 80 },
]]
});
function addtzzs(){
@ -133,12 +136,13 @@
$.messager.alert('提示', '未选择数据!');
}
}
function wsdetail(){
var row = $('#wstable').datagrid('getSelected');
function edittzzs(){
var row = $('#tzzstable').datagrid('getSelected');
if (row) {
var url = 'misshtml/detail/' + row.missid
opendg('查看详情',url)
opendg('编辑','html/socert/edit/' + row.id)
}
else { $.messager.alert('提示', '未选择数据!'); }
else {
$.messager.alert('提示', '请先选择一条记录!');
}
}
</script>

View File

@ -1,7 +1,7 @@
<div class="easyui-layout" style="width:100%;height:100%;">
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="tzzssubmitForm()"
id="submitb">提交查询</a>
id="submitb">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
</div>
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
@ -31,14 +31,14 @@
</div>
<div style="margin-bottom:5px">
<input id="yfsrq" class="easyui-datebox" name="yfsrq" style="width:480px" data-options="
label:'应复审'," >
label:'应复审'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqkssj" class="easyui-datebox" name="yxqkssj" style="width:480px" data-options="
label:'有效期开始'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqjssj" class="easyui-datebox" name="yfsrq" style="width:480px" data-options="
<input id="yxqjssj" class="easyui-datebox" name="yxqjssj" style="width:480px" data-options="
label:'有效期结束'," required=true editable=false>
</div>
<!-- <div style="margin-bottom:5px">
@ -57,7 +57,7 @@
var tzzsdata = $('#tzzsff').serializeJSON();
$.ajax({
type: "POST",
url: 'api/socert?a=addspider',
url: 'api/socert?a=add',
data: JSON.stringify(tzzsdata),
datatype: "json",
processData: false,
@ -69,22 +69,23 @@
} else {
$('#submitb').linkbutton('disable');
}
loading('联网查询中,请稍等。。')
// loading('联网查询中,请稍等。。')
},
success: function (data) {
if (data.code == 1) {
$('#tzzstable').datagrid('reload');
$("#dd").dialog("close");
} else { $.messager.alert('提示', '相关信息错误或查询无证!'); }
}
// else { $.messager.alert('提示', '相关信息错误或查询无证!'); }
$('#submitb').linkbutton('enable');
removeLoading()
// removeLoading()
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
// $("#p_test").innerHTML = "there is something wrong!";
// alert(XMLHttpRequest.status);
// alert(XMLHttpRequest.readyState);
// alert(textStatus);
removeLoading()
// removeLoading()
$('#submitb').linkbutton('enable');
}
});

View File

@ -0,0 +1,128 @@
<div class="easyui-layout" style="width:100%;height:100%;">
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="tzzssubmitForm()"
id="submitb">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
</div>
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
<form id="tzzsff" method="post" name="tzzsff" enctype="multipart/form-data">
<!-- <p style="color:red;">请输入相关信息后提交进行联网查询证书</p> -->
<div style="margin-bottom:5px">
<input id="tzzyry" class="easyui-textbox" style="width:480px" data-options="label:'员工',prompt:'请选择'" required=true
editable=false>
</div>
<div style="margin-bottom:5px">
<input id="zylb" class="easyui-textbox" name="zylb" style="width:480px" data-options="
label:'作业类别'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="fzjg" class="easyui-textbox" name="fzjg" style="width:480px" data-options="
label:'发证机关'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="czxm" class="easyui-textbox" name="czxm" style="width:480px" data-options="
label:'操作项目'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="ccfzrq" class="easyui-datebox" name="ccfzrq" style="width:480px" data-options="
label:'初次发证'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yfsrq" class="easyui-datebox" name="yfsrq" style="width:480px" data-options="
label:'应复审'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqkssj" class="easyui-datebox" name="yxqkssj" style="width:480px" data-options="
label:'有效期开始'," required=true editable=false>
</div>
<div style="margin-bottom:5px">
<input id="yxqjssj" class="easyui-datebox" name="yxqjssj" style="width:480px" data-options="
label:'有效期结束'," required=true editable=false>
</div>
<!-- <div style="margin-bottom:5px">
<input id="realname" class="easyui-textbox" name="realname" style="width:480px" data-options="
label:'真实姓名'," required=true>
</div>
<div style="margin-bottom:5px">
<input id="cardnum" class="easyui-textbox" name="cardnum" style="width:480px" data-options="
label:'身份证号'," required=true>
</div> -->
</form>
</div>
</div>
<script>
var id={{id}}
$.get('api/socert?a=detail&id='+id,function(res){
$('#tzzyry').textbox('setValue',res.user__name)
$('#tzzsff').form('load', res)
})
function tzzssubmitForm() {
var tzzsdata = $('#tzzsff').serializeJSON();
tzzsdata.id = id
$.ajax({
type: "POST",
url: 'api/socert?a=edit',
data: JSON.stringify(tzzsdata),
datatype: "json",
processData: false,
contentType: "application/json;charset=utf-8",//这是原因
beforeSend: function () {
var bo = $('#tzzsff').form('validate')
if (bo == false) {
return bo
} else {
$('#submitb').linkbutton('disable');
}
},
success: function (data) {
if (data.code == 1) {
$('#tzzstable').datagrid('reload');
$("#dd").dialog("close");
}
// else { $.messager.alert('提示', '相关信息错误或查询无证!'); }
$('#submitb').linkbutton('enable');
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
// $("#p_test").innerHTML = "there is something wrong!";
// alert(XMLHttpRequest.status);
// alert(XMLHttpRequest.readyState);
// alert(textStatus);
$('#submitb').linkbutton('enable');
}
});
}
function choosetzzyry() {
var myh = screen.availHeight * 0.5;
$('#userdd').dialog({
maximizable: true,
title: '选择人员',
width: 700,
height: myh,
closed: false,
cache: false,
href: 'getuserf?a=tzzyry',
modal: true,
border: false,
});
$('#userdd').window('center');
}
function aaa(x) {
if (x == "tzzyry") {
userid = top.$('#in').val()
$('#userid').val(userid)
$.get("api/user?a=detail&userid=" + userid, function (result) {
if (result.userprofile__realname != null) {
$('#realname').setValue(result.userprofile__realname)
}
if (result.userprofile__cardnum != null) {
$('#cardnum').setValue(result.userprofile__cardnum)
}
});
$('#user').attr('value', top.$('#in').val());
$('#tzzyry').textbox('setValue', top.$('#in').attr('show'));
}
}
</script>

View File

@ -27,7 +27,7 @@
<script></script>
<label>姓名</label><input id='sname' class='easyui-textbox' />
<input id='sname' class='easyui-textbox' data-options="prompt:'姓名/账户'"/>
<a onclick="usersearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
</div>
</div>

View File

@ -35,6 +35,7 @@ urlpatterns = [
path('rightshtml', views.rightshtml),
path('socerthtml', views.socerthtml),
path('socerthtml/add', views.socertadd),
path('html/socert/edit/<int:id>/',views.socertedit),
path('html/medetail', views.medetail),
path('html/suggest', views.suggest),
path('html/suggest/add', views.suggestadd),
@ -71,6 +72,7 @@ urlpatterns = [
path('html/examtest/detail/<int:id>/', views.examtestdetail),
path('html/safecert', views.safecert),
path('html/safecert/add', views.safecertadd),
path('html/safecert/edit/<int:id>/',views.safecertedit),
path('html/area', views.area),
path('html/areadetail', views.areadetail),
path('html/mapshow', views.mapshow),

View File

@ -284,6 +284,8 @@ def safecert(req):
def safecertadd(req):
return render(req, 'safecertadd.html')
def safecertedit(req, id):
return render(req, 'safecertedit.html', {'id': id})
def examtestdetail(req, id):
return render(req, 'examtestdetail.html', {'id': id})
@ -420,6 +422,8 @@ def socerthtml(req):
def socertadd(req):
return render(req, 'socertadd.html')
def socertedit(req, id):
return render(req, 'socertedit.html', {'id':id})
def rightshtml(req):
groupid = req.GET.get('groupid')
@ -2753,7 +2757,7 @@ def getuser(req):
companyid = getcompany(userid)
parts = Partment.objects.filter(
partlink__contains=','+companyid+',') | Partment.objects.filter(partid=companyid)
a = User.objects.filter(ubelongpart__in=parts, deletemark=1, name__contains=req.GET.get('name')).order_by(
a = User.objects.filter(ubelongpart__in=parts, deletemark=1).filter(Q(name__contains=req.GET.get('name'))|Q(username__contains=req.GET.get('name'))).order_by(
'userid').values('userid', 'empid', 'name', 'ubelongpart__partname', 'ubelongpart__partid', 'username', 'openid')
total = a.count()
return HttpResponse(transjson(total, a), content_type="application/json")
@ -4042,8 +4046,7 @@ def apisocert(req):
userid = req.session['userid']
companyid = getcompany(userid)
startnum, endnum = fenye(req)
a = Socertificate.objects.filter(usecomp=Partment.objects.get(
partid=companyid)).order_by('id') # 无deletemark
a = Socertificate.objects.filter(user__usecomp__partid=companyid).order_by('id') # 无deletemark
total = a.count()
startnum, endnum = fenye(req)
if req.GET.get('sort'):
@ -4062,6 +4065,35 @@ def apisocert(req):
a = a.values('id', 'realname', 'gender', 'zylb', 'czxm', 'fzjg',
'ccfzrq', 'yfsrq', 'yxqkssj', 'yxqjssj', 'sjfssj', 'zszt', 'url', 'cardnum')
return HttpResponse(transjson(total, a), content_type="application/json")
elif a == 'add':
postdata = json.loads(req.body.decode('utf-8'))
obj = Socertificate()
user = User.objects.get(userid = postdata['userid'])
obj.user = User.objects.get(userid = postdata['userid'])
obj.zylb = postdata['zylb']
obj.fzjg = postdata['fzjg']
obj.czxm = postdata['czxm']
obj.ccfzrq = postdata['ccfzrq']
obj.yfsrq = postdata['yfsrq']
obj.yxqkssj = postdata['yxqkssj']
obj.yxqjssj = postdata['yxqjssj']
obj.zszt = guoqi(postdata['yfsrq'])
obj.usecomp = user.usecomp
obj.save()
return JsonResponse({'code':1})
elif a == 'edit':
postdata = json.loads(req.body.decode('utf-8'))
obj = Socertificate.objects.get(id=postdata['id'])
obj.zylb = postdata['zylb']
obj.fzjg = postdata['fzjg']
obj.czxm = postdata['czxm']
obj.ccfzrq = postdata['ccfzrq']
obj.yfsrq = postdata['yfsrq']
obj.yxqkssj = postdata['yxqkssj']
obj.yxqjssj = postdata['yxqjssj']
obj.zszt = guoqi(postdata['yfsrq'])
obj.save()
return JsonResponse({'code':1})
# elif a == 'addspider':
# postdata = json.loads(req.body.decode('utf-8'))
# userid = postdata['userid']
@ -4186,7 +4218,7 @@ def apisocert(req):
elif a == 'detail':
id = req.GET.get('id')
a = Socertificate.objects.filter(id=id).values(
'id', 'realname', 'gender', 'zylb', 'czxm', 'fzjg', 'ccfzrq', 'yfsrq', 'yxqkssj', 'yxqjssj', 'sjfssj', 'user__userprofile__realname', 'user__userprofile__gender', 'user__userprofile__cardnum')
'id', 'realname', 'gender', 'zylb', 'czxm', 'fzjg', 'ccfzrq', 'yfsrq', 'yxqkssj', 'yxqjssj', 'sjfssj', 'user__userprofile__realname', 'user__userprofile__gender', 'user__userprofile__cardnum', 'user__name')
return JsonResponse(a[0])
elif a == 'getjson':
cardnum = req.GET.get('cardnum')
@ -4219,8 +4251,7 @@ def apisafecert(req):
userid = req.session['userid']
companyid = getcompany(userid)
startnum, endnum = fenye(req)
a = Safecert.objects.filter(usecomp=Partment.objects.get(
partid=companyid)).order_by('id') # 无deletemark
a = Safecert.objects.filter(user__usecomp__partid=companyid).order_by('id') # 无deletemark
total = a.count()
startnum, endnum = fenye(req)
if req.GET.get('sort'):
@ -4239,6 +4270,33 @@ def apisafecert(req):
a = a.values('id', 'realname', 'gender', 'zglx', 'dwlx',
'fzjg', 'yfsrq', 'yxqkssj', 'yxqjssj', 'zszt', 'url', 'cardnum', 'user__userprofile__realname', 'user__userprofile__gender', 'user__userprofile__cardnum')
return HttpResponse(transjson(total, a), content_type="application/json")
elif a == 'add':
postdata = json.loads(req.body.decode('utf-8'))
obj = Safecert()
user = User.objects.get(userid = postdata['userid'])
obj.user = User.objects.get(userid = postdata['userid'])
obj.zglx = postdata['zglx']
obj.fzjg = postdata['fzjg']
obj.dwlx = postdata['dwlx']
obj.yfsrq = postdata['yfsrq']
obj.yxqkssj = postdata['yxqkssj']
obj.yxqjssj = postdata['yxqjssj']
obj.zszt = guoqi(postdata['yfsrq'])
obj.usecomp = user.usecomp
obj.save()
return JsonResponse({'code':1})
elif a == 'edit':
postdata = json.loads(req.body.decode('utf-8'))
obj = Safecert.objects.get(id=postdata['id'])
obj.zylb = postdata['zglx']
obj.fzjg = postdata['fzjg']
obj.czxm = postdata['dwlx']
obj.yfsrq = postdata['yfsrq']
obj.yxqkssj = postdata['yxqkssj']
obj.yxqjssj = postdata['yxqjssj']
obj.zszt = guoqi(postdata['yfsrq'])
obj.save()
return JsonResponse({'code':1})
# elif a == 'addspider':
# postdata = json.loads(req.body.decode('utf-8'))
# userid = postdata['userid']
@ -4356,7 +4414,7 @@ def apisafecert(req):
elif a == 'detail':
id = req.GET.get('id')
a = Safecert.objects.filter(id=id).values(
'id', 'realname', 'gender', 'zglx', 'dwlx', 'fzjg', 'yfsrq', 'yxqkssj', 'yxqjssj', 'zszt', 'url', 'user__userprofile__realname', 'user__userprofile__gender', 'user__userprofile__cardnum')
'id', 'realname', 'gender', 'zglx', 'dwlx', 'fzjg', 'yfsrq', 'yxqkssj', 'yxqjssj', 'zszt', 'url', 'user__userprofile__realname', 'user__userprofile__gender', 'user__userprofile__cardnum', 'user__name')
return JsonResponse(a[0])
elif a == 'getjson':
cardnum = req.GET.get('cardnum')
@ -5024,6 +5082,12 @@ def apitool(req):
# Userprofile.objects.filter(realname='null').update(realname='')
# Userprofile.objects.filter(cardnum='null').update(cardnum='')
return JsonResponse({"code":1})
elif a == 'correct_questioncat':
# print(Questioncat.objects.filter(usecomp__partid=2184).delete())
print(Question.objects.filter(questioncat__name='冬季四防安全生产知识').count())
# Questioncat.objects.filter(usecomp__partname='广安厂').update(parent=None, link=',', deletemark=1)
# print(Questioncat.objects.filter(name='冬季四防安全生产知识').values('usecomp__partname'))
return JsonResponse({"code":1})
@ -6604,32 +6668,46 @@ def apiquestioncat(req):
companyid = getcompany(userid)
if a == 'tree1':
list_items = (Questioncat.objects.filter(usecomp__partid=1, deletemark=1)).annotate(
parentId=F('parent__id')).values('id', 'parentId', 'name')
parentId=F('parent__id')).values('id', 'parentId', 'name', 'isopen')
return HttpResponse(json.dumps(list(list_items)), content_type="application/json")
elif a == 'tree2':
list_items = (Questioncat.objects.filter(usecomp__partid=companyid, deletemark=1)).annotate(
parentId=F('parent__id')).values('id', 'parentId', 'name')
parentId=F('parent__id')).values('id', 'parentId', 'name', 'isopen')
return HttpResponse(json.dumps(list(list_items)), content_type="application/json")
elif a == 'tree3':
# 共享分类
groups = g_models.Groupmember.objects.filter(member__partid=companyid).values_list('group__id', flat=True)
companys = g_models.Groupmember.objects.filter(group__id__in=groups).values_list('member__partid', flat=True).distinct()
if companys:
pass
else:
companys = Partment.objects.filter(partid=companyid).values_list('partid', flat=True)
list_items = (Questioncat.objects.filter(usecomp__in=companys, deletemark=1)| Questioncat.objects.filter(
usecomp__partid=1, deletemark=1)).annotate(
parentId=F('parent__id')).values('id', 'parentId', 'name')
list_items = Questioncat.objects.filter(usecomp__in=companys, deletemark=1, isopen=1).annotate(
parentId=F('parent__id')).values('id', 'parentId', 'name', 'isopen')
return HttpResponse(json.dumps(list(list_items)), content_type="application/json")
elif a == 'tree4':
# 自建+共享分类
groups = g_models.Groupmember.objects.filter(member__partid=companyid).values_list('group__id', flat=True)
companys = g_models.Groupmember.objects.filter(group__id__in=groups).values_list('member__partid', flat=True).distinct()
if companys:
pass
else:
companys = Partment.objects.filter(partid=companyid).values_list('partid', flat=True)
list_items = (Questioncat.objects.filter(usecomp__in=companys, deletemark=1, isopen=1)| Questioncat.objects.filter(
usecomp__partid=companyid, deletemark=1)).distinct().annotate(
parentId=F('parent__id')).values('id', 'parentId', 'name', 'isopen')
return HttpResponse(json.dumps(list(list_items)), content_type="application/json")
elif a == 'tree':
list_items = (Questioncat.objects.filter(usecomp__partid=1, deletemark=1) | Questioncat.objects.filter(
usecomp__partid=companyid, deletemark=1)).annotate(parentId=F('parent__id')).values('id', 'parentId', 'name')
usecomp__partid=companyid, deletemark=1)).annotate(parentId=F('parent__id')).values('id', 'parentId', 'name', 'isopen')
return HttpResponse(json.dumps(list(list_items)), content_type="application/json")
elif a == 'add':
data = json.loads(req.body.decode('utf-8'))
obj = Questioncat()
name = data['name']
obj.name = name
if 'isopen' in data:
obj.isopen = 1
if 'parent' in data:
if data['parent']:
parent = data['parent']
@ -6648,17 +6726,19 @@ def apiquestioncat(req):
return JsonResponse({"code": 1})
else:
return JsonResponse({"code": 0})
return JsonResponse({"code": 1})
elif a == 'detail':
id = req.GET.get('id')
a = Questioncat.objects.filter(id=id).values(
'id', 'name', 'parent__id')[0]
'id', 'name', 'parent__id', 'isopen')[0]
return JsonResponse(a)
elif a == 'edit':
data = json.loads(req.body.decode('utf-8'))
id = data['id']
a = Questioncat.objects.get(id=id)
a.name = data['name']
a.isopen = 0
if 'isopen' in data:
a.isopen = 1
if 'parent' in data:
if data['parent']:
parent = Questioncat.objects.get(id=data['parent'])