From e8f73c78476c044fdcc66fe31f84284d0d34a536 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 23 Nov 2020 17:33:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E9=A2=98=E6=97=B6=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- safesite/templates/accesstrouble.html | 204 ++++++++++++++------------ safesite/templates/addtrouble.html | 11 ++ safesite/views.py | 9 +- 3 files changed, 125 insertions(+), 99 deletions(-) diff --git a/safesite/templates/accesstrouble.html b/safesite/templates/accesstrouble.html index 983b45b5..21a857b9 100644 --- a/safesite/templates/accesstrouble.html +++ b/safesite/templates/accesstrouble.html @@ -1,15 +1,18 @@
流程信息
-
待新增----->待评估----->整改措施/方案待提交----->整改措施/方案待确认
-
----->待整改----->待审核----->待复查----->已归档
+
待新增----->待评估----->整改措施/方案待提交----->整改措施/方案待确认
+
----->待整改----->待审核----->待复查----->已归档
@@ -21,8 +24,7 @@ method: 'get', valueField:'value', textField:'text', - " - required=true />
+ " required=true />
+ " required=true />
-
+ + +
+ +
- - + +
@@ -56,7 +66,7 @@ - +
@@ -74,8 +84,7 @@ } return s; }, - " - required=true />
+ " required=true />
@@ -90,8 +99,7 @@ method: 'get', valueField:'value', textField:'text', - " - required=true /> + " required=true />
+ " required=true />
+ " required=true />
@@ -132,11 +138,10 @@ } return s; }, - " - required=true />
+ " required=true />
- +
@@ -144,20 +149,23 @@
措施/方案
- +
- +
整改结果
-
+
- + @@ -166,15 +174,18 @@
审核信息
- +
复查信息
- +
@@ -200,6 +211,8 @@ $("#zgms").textbox('setValue', data.zgms); $("#yyfx").textbox('setValue', data.yyfx); $("#zgcs").textbox('setValue', data.zgcs); + console.log(data.yhqy__name) + // $("#yhqy").textbox('setValue', data.yhqy__name); var yhtp = data.yhtp; for (var i = 0; i < yhtp.length; i++) { $("#addImage").append('
  • '); @@ -208,7 +221,7 @@ var zghtp = data.zghtp; if (data.yhzt == 5) { if (zghtp == []) { $("#addImage2").append('无图片') } - else{for (var i = 0; i < zghtp.length; i++) { $("#addImage2").append('
  • '); }} + else { for (var i = 0; i < zghtp.length; i++) { $("#addImage2").append('
  • '); } } if (data.zgms == '' && data.sybzt == 0) { $("#pg,#zpzgr,#fxcs,#zgxq,#shyjdiv,#reject,#fcyjdiv").hide(); } //无隐患 @@ -274,7 +287,7 @@ $("#fcyjdiv").show(); $("#fcyj").textbox('setValue', data.fcyj).textbox('disable'); $("#fcyjh").after('
    ' + data.fcr__ubelongpart__partname + ' ' + data.fcr__name + ' ' + '驳回该整改结果
    '); } - if(data.sybzt==4||data.sybzt==5){ + if (data.sybzt == 4 || data.sybzt == 5) { for (var i = 0; i < zghtp.length; i++) { $("#addImage2").append('
  • '); } } } @@ -294,23 +307,25 @@ $("#yhxqh").after('
    ' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '提报
    '); $("#pgh").after('
    ' + data.pgr__ubelongpart__partname + ' ' + data.pgr__name + ' ' + '完成评估
    '); $("#zpzgrh").after('
    ' + data.zpr__ubelongpart__partname + ' ' + data.zpr__name + ' ' + '指派整改
    '); - if (zghtp == []){ $("#addImage2").append('无图片') } - else{for (var i = 0; i < zghtp.length; i++) { $("#addImage2").append('
  • '); }} + if (zghtp == []) { $("#addImage2").append('无图片') } + else { for (var i = 0; i < zghtp.length; i++) { $("#addImage2").append('
  • '); } } } else if (data.yhzt == 1) { $("#yhms").textbox('disable'); $('#fcyjdiv,#file2,#zgxq,#shyjdiv,#csyj,#reject').hide(); $('#jxpg').show(); $("#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', - editable: false, - filter: function (q, row) { - var opts = $(this).combobox('options'); - return row[opts.textField].indexOf(q) >= 0;//这里改成>=即可在任意地方匹配 - }, - }); - } }); + $("#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) { // $("#yhpg").combobox('setValue', data.yhpg__dickeyid).combobox('readonly'); // $("#yhlx").combobox({ url: 'getdicclass?dicid=15' }).combobox('setValue', data.yhlx__dicid).combobox('readonly'); @@ -321,12 +336,12 @@ // $("#pgh").after('
    ' + data.pgr__ubelongpart__partname + ' ' + data.pgr__name + ' ' + '完成评估
    '); // } // else { - $("#yhlx").combobox({ - url: 'getdicclass?dicid=15', onSelect: function (node) { - $('#yhlb').combobox({ url: 'getdickey?dicclass=' + node.value + '&a=combobox', }); - } - }); - $("#yhxqh").after('
    ' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '提报
    '); + $("#yhlx").combobox({ + url: 'getdicclass?dicid=15', onSelect: function (node) { + $('#yhlb').combobox({ url: 'getdickey?dicclass=' + node.value + '&a=combobox', }); + } + }); + $("#yhxqh").after('
    ' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '提报
    '); // } } @@ -372,16 +387,17 @@ if ($('#checkboxid').prop('checked') == true) { $('#checkboxid2').attr("disabled", "disabled"); $("#pg,#zpzgr,#fxcs").hide(); $('#newpgr').show(); $("#newbm").combotree({ url: 'parthandle?a=tree', onSelect: function (node) { $('#newr').combobox({ url: '/getuser?partid=' + node.id + '&a=combobox', }); } }); - } else { + } else { $('#checkboxid2').removeAttr("disabled"); - $("#pg,#zpzgr,#fxcs").show(); $('#newpgr').hide(); $("#yhpg,#yhlx,#yhlb").combobox('clear'); $("#zgr").textbox('clear'); $("#zgqx").datetimebox('clear'); } + $("#pg,#zpzgr,#fxcs").show(); $('#newpgr').hide(); $("#yhpg,#yhlx,#yhlb").combobox('clear'); $("#zgr").textbox('clear'); $("#zgqx").datetimebox('clear'); + } } function shide2() { if ($('#checkboxid2').prop('checked') == true) { $("#shresult").attr("value", 'reject'); $('#checkboxid').attr("disabled", "disabled"); - $("#pg,#zpzgr,#fxcs,#newpgr").hide(); $('#pgyjdiv').show(); - } else { $("#pg,#zpzgr,#fxcs").show(); $('#newpgr,#pgyjdiv').hide(); $('#checkboxid').removeAttr("disabled");$("#shresult").attr("value", 'pass');} + $("#pg,#zpzgr,#fxcs,#newpgr").hide(); $('#pgyjdiv').show(); + } else { $("#pg,#zpzgr,#fxcs").show(); $('#newpgr,#pgyjdiv').hide(); $('#checkboxid').removeAttr("disabled"); $("#shresult").attr("value", 'pass'); } } function submitreject() { @@ -397,20 +413,20 @@ } function submit() { var yhdata = $('#accessff').serializeJSON(); - var a = GetQueryString("troubleid");yhdata['troubleid']=a; - var b = GetQueryString("yhzt");yhdata['yhzt']=b; - var checkarray=[] + var a = GetQueryString("troubleid"); yhdata['troubleid'] = a; + var b = GetQueryString("yhzt"); yhdata['yhzt'] = b; + var checkarray = [] if (b == 3) { var checkarray = [yhdata['zgms']]; } else if (b == 1) { - if ($('#checkboxid').prop('checked') == true) { var checkarray = [yhdata['yhms'], yhdata['newbm'], yhdata['newr']]; yhdata['zppg']='yes'; } - else if($('#checkboxid2').prop('checked') == true){yhdata['accept']='yes'} - else { var checkarray = [yhdata['yhms'], yhdata['yhpg'], yhdata['yhlx'], yhdata['yhlb'], yhdata['zgbm'], yhdata['zgr'], yhdata['zgqx']]; yhdata['zppg']='no'; } + if ($('#checkboxid').prop('checked') == true) { var checkarray = [yhdata['yhms'], yhdata['newbm'], yhdata['newr']]; yhdata['zppg'] = 'yes'; } + else if ($('#checkboxid2').prop('checked') == true) { yhdata['accept'] = 'yes' } + else { var checkarray = [yhdata['yhms'], yhdata['yhpg'], yhdata['yhlx'], yhdata['yhlb'], yhdata['zgbm'], yhdata['zgr'], yhdata['zgqx']]; yhdata['zppg'] = 'no'; } } else if (b == 7) { var checkarray = [yhdata['zgcs']] } else if (b == 2) { var checkarray = [yhdata['zgcs']] } var zghtp = new Array(); $(".zghtpimg").each(function () { zghtp.push($(this).attr("filepath")); }); - yhdata['zghtp']=zghtp + yhdata['zghtp'] = zghtp console.log(yhdata) if (myCheck(checkarray)) { $.ajax({ @@ -518,32 +534,32 @@ } } - function duibiaoaccess(){ - var yhmsdata = $('#yhms').val() - loading('正在比对,请稍等..'); - $.post('api/duibiao', { 'yhms': yhmsdata }, function (result, status) { - if (result.code = 1) { - html = '

    根据您的描述,搜索到以下安标结果:

    ' - for (var j = 0, len = result.data.length; j < len; j++) { - html = html + '

    ' + result.data[j] + '

    ' - } - $("
    ").dialog({ - title: '对标结果', - width: 800, - height: 400, - closed: false, - cache: false, - content: html, - modal: true, - border: false, - onClose: function () { - $(this).dialog('close'); - } - }); + function duibiaoaccess() { + var yhmsdata = $('#yhms').val() + loading('正在比对,请稍等..'); + $.post('api/duibiao', { 'yhms': yhmsdata }, function (result, status) { + if (result.code = 1) { + html = '

    根据您的描述,搜索到以下安标结果:

    ' + for (var j = 0, len = result.data.length; j < len; j++) { + html = html + '

    ' + result.data[j] + '

    ' } - removeLoading() - }); - - } + $("
    ").dialog({ + title: '对标结果', + width: 800, + height: 400, + closed: false, + cache: false, + content: html, + modal: true, + border: false, + onClose: function () { + $(this).dialog('close'); + } + }); + } + removeLoading() + }); + + }
    \ No newline at end of file diff --git a/safesite/templates/addtrouble.html b/safesite/templates/addtrouble.html index 27e4c736..cefde17e 100644 --- a/safesite/templates/addtrouble.html +++ b/safesite/templates/addtrouble.html @@ -30,10 +30,19 @@ textField:'text', " />
    +
    +
    + +
    @@ -179,6 +188,7 @@ } }); $("#jclx").combobox({ url: 'getdickey?dicclass=14&a=combobox', }); + $("#yhqy").combobox({ url: 'api/area?a=tree', }); $('#pg,#zghxq,#fxcs,#zpzgr').hide(); if (a == 'edityh') { $.ajax({ @@ -192,6 +202,7 @@ $("#yhdd").textbox('setValue', data.yhdd); $("#yhms").textbox('setValue', data.yhms); $("#fxsj").datetimebox('setValue', data.fxsj); + $("#yhqy").combobox('setValue', data.yhqy__id); if (data.yhtp != '') { var yhtp = data.yhtp for (var i = 0; i < yhtp.length; i++) { $("#addImage").append('
  • '); } diff --git a/safesite/views.py b/safesite/views.py index 8141b4f2..827c157b 100644 --- a/safesite/views.py +++ b/safesite/views.py @@ -1221,7 +1221,7 @@ def getyh(req): userid = req.session['userid'] troubleid = req.GET.get('troubleid') a = Trouble.objects.filter(troubleid=troubleid).values('sybzt', 'troubleid', 'fxr__userid', 'fxr__name', 'yhms', 'yhzt', 'fxsj', 'tbsj', 'yhlb__dickeyname', 'yhlb__dickeyid', 'todouser__name', 'yhpg__dickeyname', 'yhnum', 'yhdd', 'fxbm__partname', 'yhdj__dickeyname', 'yhdj__dickeyid', 'yhpg__dickeyname', 'yhpg__dickeyid', 'jclx__dickeyname', 'jclx__dickeyid', 'yhlx__dicname', - 'yhlx__dicid', 'yyfx', 'zgcs', 'yhtp', 'zghtp', 'zgms', 'zgbm__partname', 'zgbm__partid', 'zgr__name', 'zgqx', 'fcr__ubelongpart__partname', 'fcr__name', 'shr__ubelongpart__partname', 'shr__name', 'pgr__ubelongpart__partname', 'pgr__name', 'zpr__ubelongpart__partname', 'zpr__name', 'csqrr__ubelongpart__partname', 'csqrr__name', 'shyj', 'fcyj', 'shresult', 'zgbm', 'zgr', 'pgyj')[0] + 'yhlx__dicid', 'yyfx', 'zgcs', 'yhtp', 'zghtp', 'zgms', 'zgbm__partname', 'zgbm__partid', 'zgr__name', 'zgqx', 'fcr__ubelongpart__partname', 'fcr__name', 'shr__ubelongpart__partname', 'shr__name', 'pgr__ubelongpart__partname', 'pgr__name', 'zpr__ubelongpart__partname', 'zpr__name', 'csqrr__ubelongpart__partname', 'csqrr__name', 'shyj', 'fcyj', 'shresult', 'zgbm', 'zgr', 'pgyj', 'yhqy__name', 'yhqy__id')[0] # print(a['yhtp']) if a['yhtp'] != '': a['yhtp'] = a['yhtp'].split('?') @@ -1893,7 +1893,7 @@ def troublehandle(req): troubleid = req.GET.get('troubleid') a = Trouble.objects.filter(troubleid=troubleid) x = a.values('yhnum', 'fxr__name', 'yhms', 'yhzt', 'fxsj', 'tbsj', 'yhlb__dickeyname', 'yhpg__dickeyname', 'yhdd', 'fxbm__partname', 'yhdj__dickeyname', 'yhpg__dickeyname', - 'jclx__dickeyname', 'yhlx__dicname', 'yyfx', 'zgcs', 'yhtp', 'zghtp', 'zgms', 'zgbm__partname', 'zgr__name', 'zgqx', 'yhqy__name')[0] + 'jclx__dickeyname', 'yhlx__dicname', 'yyfx', 'zgcs', 'yhtp', 'zghtp', 'zgms', 'zgbm__partname', 'zgr__name', 'zgqx', 'yhqy__name', 'yhqy__id')[0] b = TroubleAccess.objects.filter(troubleid=a[0]).order_by( 'accesssj').values('clr__name', 'opinion', 'action', 'accesssj') x['lcxq'] = list(b) @@ -6270,8 +6270,7 @@ def apiexamtest(req): objpaper.total = {'total': {'num': totalnum, 'score': totalscore}, 'dx': { 'num': dxnum, 'score': dxs}, 'duox': {'num': duoxnum, 'score': duoxs}, 'pd': {'num': pdnum, 'score': pds}} objpaper.save() - questionobjs = Question.objects.filter( - questioncat__id__in=data['tmfls']) + questionobjs = Question.objects.filter(questioncat__id__in=data['tmfls'], deletemark=1) if 'repeat' in data and data['repeat'] == 'no': excludequestions = ExamTest.objects.filter(usecomps__contains=','+companyid + ',').exclude(nousecomps__contains=','+companyid+',').values_list('exampaper__question__id',flat=True).distinct() @@ -6791,7 +6790,7 @@ def apiarea(req): mapobj = Map.objects.filter(usecomp__partid=companyid, deletemark=1) if mapobj.count() == 1: objs = Area.objects.filter(belongmap=mapobj[0], deletemark=1).order_by( - 'order').values('id', 'name') + 'order').annotate(parentId=F('parent__id')).values('id', 'parentId', 'name') return HttpResponse(json.dumps(list(objs)), content_type="application/json") elif a == 'add': data = json.loads(req.body.decode('utf-8'))