作业审批
This commit is contained in:
parent
47310b5d5f
commit
af81fbf1d0
File diff suppressed because one or more lines are too long
|
@ -32,6 +32,17 @@ function canvasDataURL(path, obj, callback) {
|
||||||
scale = w / h;
|
scale = w / h;
|
||||||
w = obj.width || w;
|
w = obj.width || w;
|
||||||
h = obj.height || (w / scale);
|
h = obj.height || (w / scale);
|
||||||
|
if(w <= h ){
|
||||||
|
if(w>640){
|
||||||
|
w = 640
|
||||||
|
h = w/scale
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(h>640){
|
||||||
|
h=640
|
||||||
|
w = h*scale
|
||||||
|
}
|
||||||
|
}
|
||||||
var quality = 0.7; // 默认图片质量为0.7
|
var quality = 0.7; // 默认图片质量为0.7
|
||||||
//生成canvas
|
//生成canvas
|
||||||
var canvas = document.createElement('canvas');
|
var canvas = document.createElement('canvas');
|
||||||
|
@ -45,9 +56,9 @@ function canvasDataURL(path, obj, callback) {
|
||||||
canvas.setAttributeNode(anh);
|
canvas.setAttributeNode(anh);
|
||||||
ctx.drawImage(that, 0, 0, w, h);
|
ctx.drawImage(that, 0, 0, w, h);
|
||||||
// 图像质量
|
// 图像质量
|
||||||
if (obj.quality && obj.quality <= 1 && obj.quality > 0) {
|
// if (obj.quality && obj.quality <= 1 && obj.quality > 0) {
|
||||||
quality = obj.quality;
|
// quality = obj.quality;
|
||||||
}
|
// }
|
||||||
// quality值越小,所绘制出的图像越模糊
|
// quality值越小,所绘制出的图像越模糊
|
||||||
var base64 = canvas.toDataURL('image/jpeg', quality);
|
var base64 = canvas.toDataURL('image/jpeg', quality);
|
||||||
// 回调函数返回base64的值
|
// 回调函数返回base64的值
|
||||||
|
@ -62,7 +73,6 @@ function convertBase64UrlToBlob(urlData) {
|
||||||
}
|
}
|
||||||
return new Blob([u8arr], { type: mime });
|
return new Blob([u8arr], { type: mime });
|
||||||
}
|
}
|
||||||
|
|
||||||
//取消上传
|
//取消上传
|
||||||
function cancleUploadFile() {
|
function cancleUploadFile() {
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,16 @@
|
||||||
$("#yhms").textbox('disable');
|
$("#yhms").textbox('disable');
|
||||||
$('#fcyjdiv,#file2,#zgxq,#shyjdiv,#csyj,#reject').hide(); $('#jxpg').show();
|
$('#fcyjdiv,#file2,#zgxq,#shyjdiv,#csyj,#reject').hide(); $('#jxpg').show();
|
||||||
$("#yhpg").combobox({ url: 'getdickey?dicclass=19&a=combobox', });
|
$("#yhpg").combobox({ url: 'getdickey?dicclass=19&a=combobox', });
|
||||||
$("#zgbm").combotree({ url: 'parthandle?a=tree3', onSelect: function (node) { $('#zgr').combobox({ url: 'getuser?partid=' + node.id + '&a=combobox', }); } });
|
$("#zgbm").combotree({ url: 'parthandle?a=tree3', onSelect: function (node) {
|
||||||
|
$('#zgr').combobox({
|
||||||
|
url: 'getuser?partid=' + node.id + '&a=combobox',
|
||||||
|
editable: false,
|
||||||
|
filter: function (q, row) {
|
||||||
|
var opts = $(this).combobox('options');
|
||||||
|
return row[opts.textField].indexOf(q) >= 0;//这里改成>=即可在任意地方匹配
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} });
|
||||||
// if (data.yhpg__dickeyname != '' & data.yhpg__dickeyname != null) {
|
// if (data.yhpg__dickeyname != '' & data.yhpg__dickeyname != null) {
|
||||||
// $("#yhpg").combobox('setValue', data.yhpg__dickeyid).combobox('readonly');
|
// $("#yhpg").combobox('setValue', data.yhpg__dickeyid).combobox('readonly');
|
||||||
// $("#yhlx").combobox({ url: 'getdicclass?dicid=15' }).combobox('setValue', data.yhlx__dicid).combobox('readonly');
|
// $("#yhlx").combobox({ url: 'getdicclass?dicid=15' }).combobox('setValue', data.yhlx__dicid).combobox('readonly');
|
||||||
|
|
|
@ -219,9 +219,7 @@
|
||||||
var form = new FormData();
|
var form = new FormData();
|
||||||
if (fileObj.size / 1024 > 500) { //大于500k,进行压缩上传
|
if (fileObj.size / 1024 > 500) { //大于500k,进行压缩上传
|
||||||
$("#file").after('<span id="tip" style="color:blue">图片大于500k,正在压缩...</span>');
|
$("#file").after('<span id="tip" style="color:blue">图片大于500k,正在压缩...</span>');
|
||||||
photoCompress(fileObj, {
|
photoCompress(fileObj, {}, function (base64Codes) {
|
||||||
quality: 0.2
|
|
||||||
}, function (base64Codes) {
|
|
||||||
//console.log("压缩后:" + base.length / 1024 + " " + base);
|
//console.log("压缩后:" + base.length / 1024 + " " + base);
|
||||||
var bl = convertBase64UrlToBlob(base64Codes);
|
var bl = convertBase64UrlToBlob(base64Codes);
|
||||||
form.append("upfile", bl, fileObj.name); // 文件对象
|
form.append("upfile", bl, fileObj.name); // 文件对象
|
||||||
|
@ -310,9 +308,7 @@
|
||||||
var form = new FormData();
|
var form = new FormData();
|
||||||
if (fileObj.size / 1024 > 500) { //大于500k,进行压缩上传
|
if (fileObj.size / 1024 > 500) { //大于500k,进行压缩上传
|
||||||
$("#file2").after('<span id="tip" style="color:blue">图片大于500k,正在压缩...</span>');
|
$("#file2").after('<span id="tip" style="color:blue">图片大于500k,正在压缩...</span>');
|
||||||
photoCompress(fileObj, {
|
photoCompress(fileObj, {}, function (base64Codes) {//quality: 0.2
|
||||||
quality: 0.2
|
|
||||||
}, function (base64Codes) {
|
|
||||||
//console.log("压缩后:" + base.length / 1024 + " " + base);
|
//console.log("压缩后:" + base.length / 1024 + " " + base);
|
||||||
var bl = convertBase64UrlToBlob(base64Codes);
|
var bl = convertBase64UrlToBlob(base64Codes);
|
||||||
form.append("upfile", bl, fileObj.name); // 文件对象
|
form.append("upfile", bl, fileObj.name); // 文件对象
|
||||||
|
|
|
@ -263,7 +263,7 @@ float: left;">
|
||||||
|
|
||||||
<div style="width:70%;float:left;height:100%;margin-top: 10px;" align=center>
|
<div style="width:70%;float:left;height:100%;margin-top: 10px;" align=center>
|
||||||
<div style="margin-left:10px;margin-right: 10px">
|
<div style="margin-left:10px;margin-right: 10px">
|
||||||
<div id="panelx" class="easyui-panel" title="各指标数量趋势" data-options="iconCls:'fa-bar-chart',closable:true,
|
<div class="easyui-panel" title="各指标数量趋势" data-options="iconCls:'fa-bar-chart',closable:true,
|
||||||
collapsible:true,"
|
collapsible:true,"
|
||||||
align=center style="height:100%">
|
align=center style="height:100%">
|
||||||
<div id='gzbqst' style="width:90%;height:500px;"></div>
|
<div id='gzbqst' style="width:90%;height:500px;"></div>
|
||||||
|
@ -326,6 +326,12 @@ float: left;">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div style="width:100%;height:800px">
|
||||||
|
<div id="panelx" class="easyui-panel" data-options="iconCls:'fa-bar-chart'" >
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//首页总数统计
|
//首页总数统计
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -372,13 +378,12 @@ float: left;">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var data=JSON.parse(localStorage.getItem("data"));
|
var data=JSON.parse(localStorage.getItem("data"));
|
||||||
|
bindmap9('gzbqst')
|
||||||
if(data.rights.indexOf('30')!=-1){ //有无地图功能
|
if(data.rights.indexOf('30')!=-1){ //有无地图功能
|
||||||
$('#panelx').panel({
|
$('#panelx').panel({
|
||||||
href:'html/mapshow',
|
href:'html/mapshow',
|
||||||
title:'地图展示'
|
title:'地图展示'
|
||||||
})
|
})
|
||||||
}else{
|
|
||||||
bindmap9('gzbqst')
|
|
||||||
}
|
}
|
||||||
$("#sfxbm").combotree({
|
$("#sfxbm").combotree({
|
||||||
url: 'parthandle?a=tree',
|
url: 'parthandle?a=tree',
|
||||||
|
|
|
@ -72,6 +72,10 @@
|
||||||
<input id="B" class="easyui-textbox" name="B" style="width:480px;" data-options="label:'选项B'," value="错" editable=false/>
|
<input id="B" class="easyui-textbox" name="B" style="width:480px;" data-options="label:'选项B'," value="错" editable=false/>
|
||||||
<input name="right" type="radio" value="B" />
|
<input name="right" type="radio" value="B" />
|
||||||
</div>
|
</div>
|
||||||
|
<div style="margin-top:5px;margin-bottom:5px">
|
||||||
|
<input id="resolution" class="easyui-textbox" name="resolution" style="width:480px;height:80px"
|
||||||
|
data-options="label:'解析',multiline:true" />
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -93,6 +93,7 @@
|
||||||
//$('#station').combobox('setValue',res.station__groupid)
|
//$('#station').combobox('setValue',res.station__groupid)
|
||||||
$('#label').textbox('setValue',res.label)
|
$('#label').textbox('setValue',res.label)
|
||||||
$('#title').textbox('setValue',res.title)
|
$('#title').textbox('setValue',res.title)
|
||||||
|
$('#resolution').textbox('setValue',res.resolution)
|
||||||
for(var key in res.answer){
|
for(var key in res.answer){
|
||||||
$('#'+key).textbox('setValue',res.answer[key])
|
$('#'+key).textbox('setValue',res.answer[key])
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,7 @@
|
||||||
//$('#station').combobox('setValue',res.station__groupid)
|
//$('#station').combobox('setValue',res.station__groupid)
|
||||||
$('#label').textbox('setValue',res.label)
|
$('#label').textbox('setValue',res.label)
|
||||||
$('#title').textbox('setValue',res.title)
|
$('#title').textbox('setValue',res.title)
|
||||||
|
$('#resolution').textbox('setValue',res.resolution)
|
||||||
for(var key in res.answer){
|
for(var key in res.answer){
|
||||||
$('#'+key).textbox('setValue',res.answer[key])
|
$('#'+key).textbox('setValue',res.answer[key])
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,10 @@
|
||||||
<input id="B" class="easyui-textbox" name="B" style="width:480px;" data-options="label:'选项B'," value="错" editable=false/>
|
<input id="B" class="easyui-textbox" name="B" style="width:480px;" data-options="label:'选项B'," value="错" editable=false/>
|
||||||
<input id="Bcheck" name="right" type="radio" value="B" />
|
<input id="Bcheck" name="right" type="radio" value="B" />
|
||||||
</div>
|
</div>
|
||||||
|
<div style="margin-top:5px;margin-bottom:5px">
|
||||||
|
<input id="resolution" class="easyui-textbox" name="resolution" style="width:480px;height:80px"
|
||||||
|
data-options="label:'解析',multiline:true" />
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -83,6 +87,7 @@
|
||||||
// $('#station').combobox('setValue',res.station__groupid)
|
// $('#station').combobox('setValue',res.station__groupid)
|
||||||
$('#label').textbox('setValue',res.label)
|
$('#label').textbox('setValue',res.label)
|
||||||
$('#title').textbox('setValue',res.title)
|
$('#title').textbox('setValue',res.title)
|
||||||
|
$('#resolution').textbox('setValue',res.resolution)
|
||||||
for(var key in res.answer){
|
for(var key in res.answer){
|
||||||
$('#'+key).textbox('setValue',res.answer[key])
|
$('#'+key).textbox('setValue',res.answer[key])
|
||||||
}
|
}
|
||||||
|
|
|
@ -493,6 +493,11 @@ def getsprs(ubp):
|
||||||
|
|
||||||
def getsprs_ubp(ubp):
|
def getsprs_ubp(ubp):
|
||||||
a=ubp
|
a=ubp
|
||||||
|
if a.aqy !=',':
|
||||||
|
aqystr = a.aqy
|
||||||
|
aqylist = aqystr.split(',')
|
||||||
|
aqylist = list(map(int, list(filter(None, aqylist))))
|
||||||
|
return aqylist
|
||||||
if a.bmzg !=',':
|
if a.bmzg !=',':
|
||||||
zgstr = a.bmzg
|
zgstr = a.bmzg
|
||||||
zglist = zgstr.split(',')
|
zglist = zgstr.split(',')
|
||||||
|
@ -3401,19 +3406,19 @@ def apipartuser(req):
|
||||||
if req.GET.get('parentid')=='company':
|
if req.GET.get('parentid')=='company':
|
||||||
lst=[]
|
lst=[]
|
||||||
company = User.objects.get(userid=userid).usecomp
|
company = User.objects.get(userid=userid).usecomp
|
||||||
partobjs = Partment.objects.filter(parentid=company)
|
partobjs = Partment.objects.filter(parentid=company,deletemark=1)
|
||||||
for i in partobjs:
|
for i in partobjs:
|
||||||
lst.append({'id':i.partid,'name':i.partname,'parentId':0,'checked':False,'isPeople':False,'children':[]})
|
lst.append({'id':i.partid,'name':i.partname,'parentId':0,'checked':False,'isPeople':False,'children':[]})
|
||||||
userobjs = User.objects.filter(ubelongpart=company).exclude(issuper=1)
|
userobjs = User.objects.filter(ubelongpart=company,deletemark=1).exclude(issuper=1)
|
||||||
for i in userobjs:
|
for i in userobjs:
|
||||||
lst.append({'id':i.userid,'name':i.name,'parentId':0,'checked':False,'isPeople':True,'children':[]})
|
lst.append({'id':i.userid,'name':i.name,'parentId':0,'checked':False,'isPeople':True,'children':[]})
|
||||||
return JsonResponse({"code":1,"data":lst})
|
return JsonResponse({"code":1,"data":lst})
|
||||||
else:
|
else:
|
||||||
lst=[]
|
lst=[]
|
||||||
partobjs = Partment.objects.filter(parentid=req.GET.get('parentid'))
|
partobjs = Partment.objects.filter(parentid=req.GET.get('parentid'),deletemark=1)
|
||||||
for i in partobjs:
|
for i in partobjs:
|
||||||
lst.append({'id':i.partid,'name':i.partname,'parentId':0,'checked':False,'isPeople':False,'children':[]})
|
lst.append({'id':i.partid,'name':i.partname,'parentId':0,'checked':False,'isPeople':False,'children':[]})
|
||||||
userobjs = User.objects.filter(ubelongpart=req.GET.get('parentid')).exclude(issuper=1)
|
userobjs = User.objects.filter(ubelongpart=req.GET.get('parentid'),deletemark=1).exclude(issuper=1)
|
||||||
for i in userobjs:
|
for i in userobjs:
|
||||||
lst.append({'id':i.userid,'name':i.name,'parentId':0,'checked':False,'isPeople':True,'children':[]})
|
lst.append({'id':i.userid,'name':i.name,'parentId':0,'checked':False,'isPeople':True,'children':[]})
|
||||||
return JsonResponse({"code":1,"data":lst})
|
return JsonResponse({"code":1,"data":lst})
|
||||||
|
@ -4111,7 +4116,8 @@ def apioperation(req):
|
||||||
return res
|
return res
|
||||||
elif a == 'qrzy':
|
elif a == 'qrzy':
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
zyid = req.POST.get('zyid')
|
data = json.loads(req.body.decode('utf-8'))
|
||||||
|
zyid = data['zyid']
|
||||||
Operzyry.objects.filter(oper__zyid=zyid,operzyry__userid=userid).update(checked=1)
|
Operzyry.objects.filter(oper__zyid=zyid,operzyry__userid=userid).update(checked=1)
|
||||||
if Operzyry.objects.filter(oper__zyid=zyid,checked=0).exists():
|
if Operzyry.objects.filter(oper__zyid=zyid,checked=0).exists():
|
||||||
pass
|
pass
|
||||||
|
@ -4122,7 +4128,10 @@ def apioperation(req):
|
||||||
obj.zyzt['index'] = 0
|
obj.zyzt['index'] = 0
|
||||||
index = obj.zyzt['index']
|
index = obj.zyzt['index']
|
||||||
obj.zyzt['jdmc'] = obj.zyzt['splc'][index]['jdmc']
|
obj.zyzt['jdmc'] = obj.zyzt['splc'][index]['jdmc']
|
||||||
sprs = obj.zyzt['splc'][index]['sprs']
|
if 'sprs' in obj.zyzt['splc'][index]:
|
||||||
|
sprs = obj.zyzt['splc'][index]['sprs']
|
||||||
|
else:
|
||||||
|
sprs = [obj.zyzt['splc'][index]['spr']]
|
||||||
obj.todousers = sprs
|
obj.todousers = sprs
|
||||||
obj.save()
|
obj.save()
|
||||||
for i in sprs:
|
for i in sprs:
|
||||||
|
@ -4151,13 +4160,14 @@ def apioperation(req):
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
elif a == 'spzy':
|
elif a == 'spzy':
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
zyid = req.POST.get('zyid')
|
data = json.loads(req.body.decode('utf-8'))
|
||||||
|
zyid = data['zyid']
|
||||||
obj = Operation.objects.get(zyid=zyid)
|
obj = Operation.objects.get(zyid=zyid)
|
||||||
oldtodo = obj.todousers
|
oldtodo = obj.todousers
|
||||||
oldjdmc = obj.zyzt['jdmc']
|
oldjdmc = obj.zyzt['jdmc']
|
||||||
nextindex = obj.zyzt['index']+1
|
nextindex = obj.zyzt['index']+1
|
||||||
spruser = User.objects.get(userid=userid)
|
spruser = User.objects.get(userid=userid)
|
||||||
if req.POST.get('zzsp',None):
|
if 'zzsp' in data:
|
||||||
obj.zyzt['zyzt'] = '待关闭'
|
obj.zyzt['zyzt'] = '待关闭'
|
||||||
obj.todouser = obj.zyfzr
|
obj.todouser = obj.zyfzr
|
||||||
obj.todousers = None
|
obj.todousers = None
|
||||||
|
@ -4186,6 +4196,35 @@ def apioperation(req):
|
||||||
}
|
}
|
||||||
send_wechatmsg.delay(postdict)
|
send_wechatmsg.delay(postdict)
|
||||||
return JsonResponse({"code":1})
|
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,
|
||||||
|
'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:
|
try:
|
||||||
nextsplc = obj.zyzt['splc'][nextindex]
|
nextsplc = obj.zyzt['splc'][nextindex]
|
||||||
obj.zyzt['zyzt'] = '审批中'
|
obj.zyzt['zyzt'] = '审批中'
|
||||||
|
@ -4220,8 +4259,8 @@ def apioperation(req):
|
||||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||||
except :
|
except :
|
||||||
obj.zyzt['zyzt'] = '待关闭'
|
obj.zyzt['zyzt'] = '待关闭'
|
||||||
obj.todouser = obj.zyfzr
|
obj.todouser = None
|
||||||
obj.todousers = None
|
obj.todousers = [obj.zyfzr.userid]
|
||||||
obj.save()
|
obj.save()
|
||||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||||
postdict={
|
postdict={
|
||||||
|
@ -4256,6 +4295,7 @@ def apioperation(req):
|
||||||
obj.zyimg2 = '?'.join(zyimg2)
|
obj.zyimg2 = '?'.join(zyimg2)
|
||||||
obj.zyzt['zyzt']='已关闭'
|
obj.zyzt['zyzt']='已关闭'
|
||||||
obj.todouser = None
|
obj.todouser = None
|
||||||
|
obj.todousers = None
|
||||||
obj.save()
|
obj.save()
|
||||||
return JsonResponse({"code":1})
|
return JsonResponse({"code":1})
|
||||||
elif a == 'todonum':
|
elif a == 'todonum':
|
||||||
|
|
Loading…
Reference in New Issue