socert up

This commit is contained in:
caoqianming 2020-11-16 17:40:35 +08:00
parent ad148a0598
commit 8e4d807398
8 changed files with 172 additions and 30 deletions

View File

@ -1291,13 +1291,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

@ -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>
@ -95,7 +99,6 @@
}},
{ field: 'yxqkssj', title: '有效期开始时间', width: 80 },
{ field: 'yxqjssj', title: '有效期结束时间', width: 80 },
{ field: 'sjfssj', title: '实际复审时间', width: 80 },
]]
});
function addtzzs(){

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,
@ -75,7 +75,8 @@
if (data.code == 1) {
$('#tzzstable').datagrid('reload');
$("#dd").dialog("close");
} else { $.messager.alert('提示', '相关信息错误或查询无证!'); }
}
// else { $.messager.alert('提示', '相关信息错误或查询无证!'); }
$('#submitb').linkbutton('enable');
removeLoading()
},

View File

@ -0,0 +1,125 @@
<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>
<input type="hidden" id="userid" name="userid" />
<a id="choosetzzyry" class='easyui-linkbutton' onclick="choosetzzyry()" style="width:auto">选择</a>
</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>
function tzzssubmitForm() {
var tzzsdata = $('#tzzsff').serializeJSON();
$.ajax({
type: "POST",
url: 'api/socert?a=add',
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');
}
loading('联网查询中,请稍等。。')
},
success: function (data) {
if (data.code == 1) {
$('#tzzstable').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 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

@ -4060,6 +4060,22 @@ 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 == 'addspider':
# postdata = json.loads(req.body.decode('utf-8'))
# userid = postdata['userid']