safesite/safesite/templates/accesstrouble.html

578 lines
36 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="easyui-layout" style="width:100%;height:100%">
<div id='southdiv' data-options="region:'south'" style="width:100%;height:50px;text-align:center;padding:5px 0">
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="submitpass()"
style="width:auto" id="pass">提交</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="submitreject()"
style="width:auto" id="reject">驳回</a>
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()"
style="width:auto">取消</a>
</div>
<div data-options="region:'center'" style="width:100%;height:100%;padding:5px 15px;">
<div class='labeldiv'>流程信息</div>
<div><span id="0">待新增</span><span id="1">----->待评估</span><span id="7">----->整改措施/方案待提交</span><span
id="2">----->整改措施/方案待确认</span></div>
<div><span id="3">----->待整改</span><span id="4">----->待审核</span><span id="5">----->待复查</span><span
id="6">----->已归档</span></div>
<form id="accessff" method="post" enctype="multipart/form-data">
<input id="shresult" name="shresult" value="pass" style="display:none;" />
<div id="yhxq">
<div id="yhxqh" class='labeldiv'>隐患详情</div>
<div style="margin-bottom:5px">
<input editable="false" class="easyui-combobox" name="yhdj" id="yhdj" style="width:480px;"
data-options="
label:'隐患等级',
method: 'get',
valueField:'value',
textField:'text',
" required=true /></div>
<div style="margin-bottom:5px">
<input editable="false" class="easyui-combobox" name="jclx" id="jclx" style="width:480px;"
data-options="
label:'检查类型:',
method: 'get',
valueField:'value',
textField:'text',
" required=true /></div>
<div style="margin-bottom:5px">
<input id="fxsj" editable="false" type="text" name="fxsj" class="easyui-datetimebox"
style="width:480px" data-options="label:'发现时间',currentText:'今天',closeText:'关闭'" required=true>
</div>
<div style="margin-bottom:5px">
<input editable="false" class="easyui-textbox" name="yhqy" id="yhqy" style="width:480px" data-options="
label:'发现区域'
" />
</div>
<div style="margin-bottom:5px">
<input id="yhdd" class="easyui-textbox" name="yhdd" style="width:480px" data-options="label:'隐患地点'"
required=true>
</div>
<div style="margin-bottom:5px">
<input id="yhms" class="easyui-textbox" name="yhms" style="width:480px;height:60px"
data-options="label:'隐患描述',multiline:true" required=true>
<!-- <a id="duibiao" class='easyui-linkbutton' onclick="duibiaoaccess()" style="width:auto" >对标</a> -->
</div>
<div style="margin-bottom:5px">
<input type="hidden" name="yhtp" id="yhtp" />
<label>隐患图片</label>
</div>
<ul id="addImage" class="imgul"></ul>
</div>
<div id="jxpg" style="margin-bottom:5px;display:none">
<label style="font-weight:bold;color:red;font-size: 18px">驳回重填</label>
<input type="checkbox" onclick="shide2()" id="checkboxid2"></input>
<label style="font-weight:bold;color:red;font-size: 18px">转交他人</label>
<input type="checkbox" onclick="shide()" id="checkboxid"></input>
</div>
<div id="newpgr">
<div style="margin-bottom:5px">
<input id="newbm" name="newbm" class="easyui-textbox" style="width:480px" editable="false"
data-options="
label:'评估部门:',
method: 'get',
loadFilter: function(rows){
return convert(rows);
},
formatter:function(node){
var s = node.text;
if (node.children){
s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
}
return s;
},
" required=true /></div>
<div style="margin-bottom:5px">
<input id="newr" name="newr" editable="false" class="easyui-textbox" style="width:480px"
data-options="label:'新评估人'" required=true>
</div>
</div>
<div id="pg">
<div id="pgh" class='labeldiv'>评估详情</div>
<div style="margin-bottom:5px">
<input editable="false" class="easyui-combobox" name="yhpg" id="yhpg" style="width:480px;"
data-options="
label:'隐患评估',
method: 'get',
valueField:'value',
textField:'text',
" required=true />
</div>
<div style="margin-bottom:5px">
<input class="easyui-combotree" editable="false" name="yhlxo" id="yhlxo" style="width:480px;" data-options="
url:'',
label:'隐患因素',
method: 'get',
valueField:'value',
textField:'text',
" />
</div>
<div style="margin-bottom:5px">
<input class="easyui-combobox" name="yhlx" id="yhlx" style="width:480px;" editable="false"
data-options="
label:'隐患大类',
method: 'get',
valueField:'value',
textField:'text',
groupField:'group'
" required=true /></div>
<div style="margin-bottom:5px">
<input class="easyui-combobox" name="yhlb" id="yhlb" style="width:480px;" editable="false"
data-options="
label:'隐患类别',
method: 'get',
valueField:'value',
textField:'text',
groupField:'group'
" required=true />
</div>
</div>
<div id="zpzgr">
<div id="zpzgrh" class='labeldiv'>整改通知</div>
<div style="margin-bottom:5px">
<input id="zgbm" name="zgbm" class="easyui-textbox" style="width:480px;" editable="false"
data-options="
label:'整改部门',
method: 'get',
loadFilter: function(rows){
return convert(rows);
},
formatter:function(node){
var s = node.text;
if (node.children){
s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
}
return s;
},
" required=true /></div>
<div style="margin-bottom:5px">
<input id="zgr" name="zgr" editable="false" class="easyui-textbox" style="width:480px"
data-options="label:'整改人'" required=true>
</div>
<input id="zgqx" editable="false" type="text" name="zgqx" class="easyui-datetimebox" style="width:480px"
data-options="label:'整改期限',currentText:'今天',closeText:'关闭'" required=true>
</div>
<div id="fxcs">
<div id="fxcsh" class='labeldiv'>措施/方案</div>
<div style="margin-bottom:5px">
<input id="yyfx" class="easyui-textbox" name="yyfx" style="width:480px;height:60px"
data-options="label:'原因分析',multiline:true,prompt:'如不填写将由整改人填写'" />
</div>
<div style="margin-bottom:5px">
<input id="zgcs" class="easyui-textbox" name="zgcs" style="width:480px;height:60px"
data-options="label:'整改措施',multiline:true,prompt:'如不填写将由整改人填写'" />
</div>
</div>
<div id="zgxq">
<div class='labeldiv'>整改结果</div>
<div style="margin-bottom:5px">
<input id="zgms" class="easyui-textbox" name="zgms" style="width:480px;height:60px"
data-options="label:'整改描述',multiline:true" required=true></div>
<div style="margin-bottom:5px">
<input type="hidden" name="zghtp" id="zghtp" />
<label>整改后图片</label><input type="file" id="file2" name="" accept="image/*"
style="margin-left: 15px" />
<span id='ps2' style="display:none">
<progress id="progressBar2" value="0" max="100" style="width: 100px;"></progress>
<span id="percentage2"></span><span id="time2"></span></span>
</div>
<ul id="addImage2" class="imgul"></ul>
</div>
<div id="shyjdiv">
<div id="shyjh" class='labeldiv'>审核信息</div>
<input id="shyj" class="easyui-textbox" name="shyj" style="width:480px;" value=""
data-options="label:'审核意见'">
</div>
<div id="fcyjdiv">
<div id="fcyjh" class='labeldiv'>复查信息</div>
<input id="fcyj" class="easyui-textbox" name="fcyj" style="width:480px;" value=""
data-options="label:'审核意见'">
</div>
<div id="pgyjdiv" style="display:none">
<div id="pgyjh" class='labeldiv'>退回原因</div>
<input id="pgyj" class="easyui-textbox" name="pgyj" style="width:480px;" value=""
data-options="label:'退回原因'">
</div>
</form>
</div>
</div>
<script>
//$(function () {
$('#newpgr').hide();
var a = GetQueryString("troubleid");
$.ajax({
type: "POST",
url: 'getyh?troubleid=' + a,
datatype: "json",
beforeSend: function () { },
success: function (data) {
$("#" + data.yhzt).css({ "color": "red", "font-weight": "bold" });
$("#yhdj").textbox('setValue', data.yhdj__dickeyname).textbox('disable');
$("#jclx").textbox('setValue', data.jclx__dickeyname).textbox('disable');
$("#fxsj").textbox('setValue', data.fxsj).textbox('disable');
$("#yhdd").textbox('setValue', data.yhdd).textbox('disable');
$("#fxbm").textbox('setValue', data.fxbm__partname).textbox('disable');
$("#fxr").textbox('setValue', data.fxr__name).textbox('disable');
$("#yhqy").textbox('setValue', data.yhqy__name).textbox('disable');
$("#yhms").textbox('setValue', data.yhms);
$("#zgms").textbox('setValue', data.zgms);
$("#yyfx").textbox('setValue', data.yyfx);
$("#zgcs").textbox('setValue', data.zgcs);
var yhtp = data.yhtp;
for (var i = 0; i < yhtp.length; i++) {
$("#addImage").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "yhtpimg" width="120" height="120" filepath="' + yhtp[i] + '" src="http://' + window.location.host + '/' + yhtp[i] + '"/></li>');
}
if (yhtp == []) { $("#addImage").append('<b >无图片</b>') }
var zghtp = data.zghtp;
if (data.yhzt == 5) {
if (zghtp == []) { $("#addImage2").append('<b >无图片</b>') }
else { for (var i = 0; i < zghtp.length; i++) { $("#addImage2").append('<li style="display: inline-block; margin-right:10px;"><img onclick="bigger(this)" class = "zghtpimg" width="120" height="120" filepath="' + zghtp[i] + '" src="http://' + window.location.host + '/' + zghtp[i] + '"/></li>'); } }
if (data.zgms == '' && data.sybzt == 0) {
$("#pg,#zpzgr,#fxcs,#zgxq,#shyjdiv,#reject,#fcyjdiv").hide();
} //无隐患
else if (data.zgms != '' && data.sybzt == 0) { //已整改完成
$('#zpzgr').hide();
// $("#yhpg").combobox({ url: '/getdickey?dicclass=19&a=combobox', });
// $("#yhpg").combobox('setValue', data.yhpg__dickeyid);
// $("#yhlx").combobox({
// url: '/getdicclass?dicid=15', onSelect: function (node) {
// $('#yhlb').combobox({ url: '/getdickey?dicclass=' + node.value + '&a=combobox', });
// $("#yhlb").combobox('setValue', data.yhlb__dickeyid);
// }
// });
// $("#yhlx").combobox('setValue', data.yhlx__dicid);
$("#yhpg").textbox('setValue', data.yhpg__dickeyname).textbox('disable');
$("#yhlxo").textbox('setValue', data.yhlxo__dickeyname).textbox('disable');
$("#yhlx").textbox('setValue', data.yhlx__dicname).textbox('disable');
$("#yhlb").textbox('setValue', data.yhlb__dickeyname).textbox('disable');
$("#yhms,#zgms,#yyfx,#zgcs").textbox('disable');
$("#file2,#shyjdiv").hide();
$("#yhxqh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '</span><span style="font-weight:bold">提报并完成整改</span></div>');
}
else {//正常流程
$('#file2').hide();
$("#yhms").textbox('disable');
$("#yhpg").textbox('setValue', data.yhpg__dickeyname).textbox('disable');
$("#yhlxo").textbox('setValue', data.yhlxo__dickeyname).textbox('disable');
$("#yhlx").textbox('setValue', data.yhlx__dicname).textbox('disable');
$("#yhlb").textbox('setValue', data.yhlb__dickeyname).textbox('disable');
$("#zgbm").textbox('setValue', data.zgbm__partname).textbox('disable');
$("#zgr").textbox('setValue', data.zgr__name).textbox('disable');
$("#zgqx").datetimebox('setValue', data.zgqx).textbox('disable');
$("#yyfx").textbox('setValue', data.yyfx).textbox('disable');
$("#zgcs").textbox('setValue', data.zgcs).textbox('disable');
$("#zgms").textbox('setValue', data.zgms).textbox('disable');
$("#shyj").textbox('setValue', data.shyj).textbox('disable');
$("#yhxqh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '</span><span style="font-weight:bold">提报</span></div>');
$("#zpzgrh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.zpr__ubelongpart__partname + ' ' + data.zpr__name + ' ' + '</span><span style="font-weight:bold">指派整改</span></div>');
$("#shyjh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.shr__ubelongpart__partname + ' ' + data.shr__name + ' ' + '</span><span style="font-weight:bold">完成整改结果审核</span></div>');
}
}
else if (data.yhzt == 3) {
$("#fcyjdiv,#shyjdiv,#reject,#jxpg").hide(); $("#pass").linkbutton({ text: '提交整改结果' });
$("#yhms").textbox('disable');
$("#yhpg").textbox('setValue', data.yhpg__dickeyname).textbox('disable');
$("#yhlxo").textbox('setValue', data.yhlxo__dickeyname).textbox('disable');
$("#yhlx").textbox('setValue', data.yhlx__dicname).textbox('disable');
$("#yhlb").textbox('setValue', data.yhlb__dickeyname).textbox('disable');
$("#zgbm").textbox('setValue', data.zgbm__partname).textbox('disable');
$("#zgr").textbox('setValue', data.zgr__name).textbox('disable');
$("#zgqx").datetimebox('setValue', data.zgqx).textbox('disable');
$("#yyfx").textbox('setValue', data.yyfx).textbox('disable');
$("#zgcs").textbox('setValue', data.zgcs).textbox('disable');
$("#file2").show();
$("#yhxqh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '</span><span style="font-weight:bold">提报</span></div>');
$("#pgh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.pgr__ubelongpart__partname + ' ' + data.pgr__name + ' ' + '</span><span style="font-weight:bold">完成评估</span></div>');
$("#zpzgrh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.zpr__ubelongpart__partname + ' ' + data.zpr__name + ' ' + '</span><span style="font-weight:bold">指派整改</span></div>');
if (data.csqrr__name != null) {
$("#fxcsh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.csqrr__ubelongpart__partname + ' ' + data.csqrr__name + ' ' + '</span><span style="font-weight:bold">确认整改措施/方案</span></div>');
}
if (data.shresult == 2) {
$("#shyjdiv").show(); $("#shyj").textbox('setValue', data.shyj).textbox('disable');
$("#shyjh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.shr__ubelongpart__partname + ' ' + data.shr__name + ' ' + '</span><span style="font-weight:bold">驳回该整改结果</span></div>');
}
if (data.shresult == 3) {
$("#fcyjdiv").show(); $("#fcyj").textbox('setValue', data.fcyj).textbox('disable');
$("#fcyjh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fcr__ubelongpart__partname + ' ' + data.fcr__name + ' ' + '</span><span style="font-weight:bold">驳回该整改结果</span></div>');
}
if (data.sybzt == 4 || data.sybzt == 5) {
for (var i = 0; i < zghtp.length; i++) { $("#addImage2").append('<li style="display: inline-block; margin-right:10px;"><img onclick="bigger(this)" class = "zghtpimg" width="120" height="120" filepath="' + zghtp[i] + '" src="http://' + window.location.host + '/' + zghtp[i] + '"/><button href="#" onclick="removep(this)" >删除</button></li>'); }
}
}
else if (data.yhzt == 4) {
$('#fcyjdiv,#file2').hide();
$("#yhms").textbox('disable');
$("#yhpg").textbox('setValue', data.yhpg__dickeyname); $("#yhpg").textbox('disable');
$("#yhlxo").textbox('setValue', data.yhlxo__dickeyname).textbox('disable');
$("#yhlx").textbox('setValue', data.yhlx__dicname); $("#yhlx").textbox('disable');
$("#yhlb").textbox('setValue', data.yhlb__dickeyname); $("#yhlb").textbox('disable');
$("#zgbm").textbox('setValue', data.zgbm__partname); $("#zgbm").textbox('disable');
$("#zgr").textbox('setValue', data.zgr__name); $("#zgr").textbox('disable');
$("#zgqx").datetimebox('setValue', data.zgqx); $("#zgqx").textbox('disable');
$("#yyfx").textbox('setValue', data.yyfx); $("#yyfx").textbox('disable');
$("#zgcs").textbox('setValue', data.zgcs); $("#zgcs").textbox('disable');
$("#zgms").textbox('setValue', data.zgms); $("#zgms").textbox('disable');
$("#shyj").textbox('setValue', data.shyj);
$("#yhxqh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '</span><span style="font-weight:bold">提报</span></div>');
$("#pgh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.pgr__ubelongpart__partname + ' ' + data.pgr__name + ' ' + '</span><span style="font-weight:bold">完成评估</span></div>');
$("#zpzgrh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.zpr__ubelongpart__partname + ' ' + data.zpr__name + ' ' + '</span><span style="font-weight:bold">指派整改</span></div>');
if (zghtp == []) { $("#addImage2").append('<b >无图片</b>') }
else { for (var i = 0; i < zghtp.length; i++) { $("#addImage2").append('<li style="display: inline-block; margin-right:10px;"><img onclick="bigger(this)" class = "zghtpimg" width="120" height="120" filepath="' + zghtp[i] + '" src="http://' + window.location.host + '/' + zghtp[i] + '"/></li>'); } }
}
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;//这里改成>=即可在任意地方匹配
},
});
}
});
// 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');
// $('#yhlb').combobox({ url: 'getdickey?dicclass=' + data.yhlx__dicid + '&a=combobox', }).combobox('setValue', data.yhlb__dickeyid).combobox('readonly');
// $("#zgbm").combotree('setValue', data.zgbm__partid).combotree('readonly');
// $('#zgr').combobox({ url: 'getuser?partid=' + data.zgbm__partid + '&a=combobox', });
// $("#yhxqh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '</span><span style="font-weight:bold">提报</span></div>');
// $("#pgh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.pgr__ubelongpart__partname + ' ' + data.pgr__name + ' ' + '</span><span style="font-weight:bold">完成评估</span></div>');
// }
// else {
$("#yhlxo").combotree({url:'getdickey?dicclass=56&a=combobox'});
$("#yhlx").combobox({
url: 'getdicclass?dicid=15', onSelect: function (node) {
$('#yhlb').combotree({ url: 'getdickey?dicclass=' + node.value + '&a=combobox', });
}
});
$("#yhxqh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '</span><span style="font-weight:bold">提报</span></div>');
// }
}
else if (data.yhzt == 7) {
$('#fcyjdiv,#file2,#zgxq,#shyjdiv,#jxpg,#csyj,#reject').hide();
$("#yhms").textbox('disable');
$("#yhpg").textbox('setValue', data.yhpg__dickeyname); $("#yhpg").textbox('disable');
$("#yhlxo").textbox('setValue', data.yhlxo__dickeyname).textbox('disable');
$("#yhlx").textbox('setValue', data.yhlx__dicname); $("#yhlx").textbox('disable');
$("#yhlb").textbox('setValue', data.yhlb__dickeyname); $("#yhlb").textbox('disable');
$("#zgbm").textbox('setValue', data.zgbm__partname); $("#zgbm").textbox('disable');
$("#zgr").textbox('setValue', data.zgr__name); $("#zgr").textbox('disable');
$("#zgqx").datetimebox('setValue', data.zgqx); $("#zgqx").textbox('disable');
$("#yhxqh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '</span><span style="font-weight:bold">提报</span></div>');
$("#pgh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.pgr__ubelongpart__partname + ' ' + data.pgr__name + ' ' + '</span><span style="font-weight:bold">完成评估</span></div>');
$("#zpzgrh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.zpr__ubelongpart__partname + ' ' + data.zpr__name + ' ' + '</span><span style="font-weight:bold">指派整改</span></div>');
}
else if (data.yhzt == 2) {
$('#fcyjdiv,#file2,#zgxq,#shyjdiv,#jxpg,#reject').hide();
$("#yhms").textbox('disable');
$("#yhpg").textbox('setValue', data.yhpg__dickeyname); $("#yhpg").textbox('disable');
$("#yhlxo").textbox('setValue', data.yhlxo__dickeyname).textbox('disable');
$("#yhlx").textbox('setValue', data.yhlx__dicname); $("#yhlx").textbox('disable');
$("#yhlb").textbox('setValue', data.yhlb__dickeyname); $("#yhlb").textbox('disable');
$("#zgbm").textbox('setValue', data.zgbm__partname); $("#zgbm").textbox('disable');
$("#zgr").textbox('setValue', data.zgr__name); $("#zgr").textbox('disable');
$("#zgqx").datetimebox('setValue', data.zgqx); $("#zgqx").textbox('disable');
$("#yyfx").textbox('setValue', data.yyfx);
$("#zgcs").textbox('setValue', data.zgcs);
$("#yhxqh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.fxbm__partname + ' ' + data.fxr__name + ' ' + '</span><span style="font-weight:bold">提报</span></div>');
$("#pgh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.pgr__ubelongpart__partname + ' ' + data.pgr__name + ' ' + '</span><span style="font-weight:bold">完成评估</span></div>');
$("#zpzgrh").after('<div style="margin-bottom:5px"><span style="color:blue;font-weight:bold">' + data.zpr__ubelongpart__partname + ' ' + data.zpr__name + ' ' + '</span><span style="font-weight:bold">指派整改</span></div>');
}
},
complete: function (XMLHttpRequest, textStatus) {
},
error: function () {
}
});
//});
function shide() {
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 {
$('#checkboxid2').removeAttr("disabled");
$("#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'); }
}
function submitreject() {
$("#shresult").attr("value", 'reject');
$.messager.confirm('提示', '确定驳回重新整改吗?', function (r) {
if (r) { submit(); }
});
}
function submitpass() {
$.messager.confirm('提示', '确定提交吗?', function (r) {
if (r) { submit(); }
});
}
function submit() {
var yhdata = $('#accessff').serializeJSON();
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'; }
}
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
console.log(yhdata)
if (myCheck(checkarray)) {
$.ajax({
url: "accessyh",
type: "POST",
data: JSON.stringify(yhdata),
contentType: "application/json;charset=utf-8",
onSubmit: function () { $('#pass').linkbutton('disable'); },
success: function (data) {
if (data.code == 1) {
//var href = top.$('#main').attr('src');
$('#yhtable').datagrid('reload');
$("#dd").dialog("close");
}
else { $.messager.alert('提示', '失败!'); $('#pass').linkbutton('enable'); }
},
});
} else { $.messager.alert('提示', '缺少必填项!'); }
}
document.getElementById('file2').onchange = function () {
var fileObj = this.files[0];
var url = 'upfile'
var form = new FormData();
if (fileObj.size / 1024 > 500) { //大于1M进行压缩上传
$("#file2").after('<span id="tip" style="color:blue">图片大于500k,正在压缩...</span>');
photoCompress(fileObj, {
quality: 0.2
}, function (base64Codes) {
//console.log("压缩后:" + base.length / 1024 + " " + base);
var bl = convertBase64UrlToBlob(base64Codes);
form.append("upfile", bl, fileObj.name); // 文件对象
xhr = new XMLHttpRequest(); // XMLHttpRequest 对象
xhr.open("post", url, true); //post方式url为服务器请求地址true 该参数规定请求是否异步处理。
$("#tip").remove();
$('#ps2').show();
xhr.onload = function (evt) { //服务断接收完文件返回的结果
var data = JSON.parse(evt.target.responseText);
if (data.code = 1) {
$('#ps2').hide();
$("#addImage2").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "zghtpimg" width="120" height="120" filepath="' + data.filepath + '" src="http://' + window.location.host + '/' + data.filepath + '"/><button href="#" onclick="removep(this)" >删除</button></li>');
document.getElementById('file2').value = '';
} else { alert("上传失败!"); }
}; //请求完成
xhr.onerror = function (evt) { alert("上传失败!"); $('#ps2').hide(); };; //请求失败
xhr.upload.onprogress = progressFunction;//【上传进度调用方法实现】
xhr.upload.onloadstart = function () {//上传开始执行方法
ot = new Date().getTime(); //设置上传开始时间
oloaded = 0;//设置上传开始时以上传的文件大小为0
};
xhr.send(form); //开始上传发送form数据
});
} else { //小于等于1M 原图上传
form.append("upfile", fileObj); // 文件对象
xhr = new XMLHttpRequest(); // XMLHttpRequest 对象
xhr.open("post", url, true); //post方式url为服务器请求地址true 该参数规定请求是否异步处理。
xhr.onload = function (evt) { //服务断接收完文件返回的结果
var data = JSON.parse(evt.target.responseText);
if (data.code = 1) {
$('#ps2').hide();
$("#addImage2").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "zghtpimg" width="120" height="120" filepath="' + data.filepath + '" src="http://' + window.location.host + '/' + data.filepath + '"/><button href="#" onclick="removep(this)" >删除</button></li>');
document.getElementById('file2').value = '';
} else { alert("上传失败!"); }
}; //请求完成
xhr.onerror = function (evt) { alert("上传失败!"); $('#ps2').hide(); };; //请求失败
xhr.send(form); //开始上传发送form数据
}
//上传进度实现方法,上传过程中会频繁调用该方法
function progressFunction(evt) {
var progressBar = document.getElementById("progressBar2");
var percentageDiv = document.getElementById("percentage2");
// event.total是需要传输的总字节event.loaded是已经传输的字节。如果event.lengthComputable不为真则event.total等于0
if (evt.lengthComputable) {//
progressBar.max = evt.total;
progressBar.value = evt.loaded;
percentageDiv.innerHTML = Math.round(evt.loaded / evt.total * 100) + "%";
}
var time = document.getElementById("time2");
var nt = new Date().getTime();//获取当前时间
var pertime = (nt - ot) / 1000; //计算出上次调用该方法时到现在的时间差单位为s
ot = new Date().getTime(); //重新赋值时间,用于下次计算
var perload = evt.loaded - oloaded; //计算该分段上传的文件大小单位b
oloaded = evt.loaded;//重新赋值已上传文件大小,用以下次计算
//上传速度计算
var speed = perload / pertime;//单位b/s
var bspeed = speed;
var units = 'b/s';//单位名称
if (speed / 1024 > 1) {
speed = speed / 1024;
units = 'k/s';
}
if (speed / 1024 > 1) {
speed = speed / 1024;
units = 'M/s';
}
speed = speed.toFixed(1);
//剩余时间
var resttime = ((evt.total - evt.loaded) / bspeed).toFixed(1);
time.innerHTML = ',速度:' + speed + units + ',剩余时间:' + resttime + 's';
if (bspeed == 0) time.innerHTML = '上传已取消';
}
}
function duibiaoaccess() {
var yhmsdata = $('#yhms').val()
loading('正在比对,请稍等..');
$.post('api/duibiao', { 'yhms': yhmsdata }, function (result, status) {
if (result.code = 1) {
html = '<p style="color:red;margin-left: 10px">根据您的描述,搜索到以下安标结果:</p>'
for (var j = 0, len = result.data.length; j < len; j++) {
html = html + '<p style="margin-left: 10px;margin-right: 10px">' + result.data[j] + '</p>'
}
$("<div/>").dialog({
title: '对标结果',
width: 800,
height: 400,
closed: false,
cache: false,
content: html,
modal: true,
border: false,
onClose: function () {
$(this).dialog('close');
}
});
}
removeLoading()
});
}
</script>
</div>