safesite/safesite/templates/riskactedit.html

124 lines
5.8 KiB
HTML

<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="fxdsubmitForm()" 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="fxdff" method="post" name="fxdff" enctype="multipart/form-data">
<div style="margin-bottom:5px">
<input id="fxdqy" class="easyui-combotree" name="area" style="width:480px" data-options="
label:'风险区域',
url: '',
method: 'get',
editable: false,
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;
},"
>
</div>
<div style="margin-bottom:5px">
<input id="fxdlx" class="easyui-combobox" name="type" style="width:480px" data-options="
label:'类型',
url: '',
method: 'get',
editable: false,"
required=true>
</div>
<div style="margin-top:10px;margin-bottom:5px">
<input id="fxdmc" class="easyui-textbox" name="name" style="width:480px" data-options="label:'名称'"
required=true />
</div>
<div style="margin-bottom:5px">
<input id="jtwz" class="easyui-textbox" name="place" style="width:480px" data-options="label:'具体位置'"
/>
</div>
<div style="margin-top:10px;margin-bottom:5px">
<input id="group" class="easyui-combobox" name="group" style="width:480px" data-options="label:'所属岗位',url:'grouphandle?a=combobox'"
required=true editable=false/>
</div>
<div style="margin-top:10px;margin-bottom:5px">
<select id="gkcj" class="easyui-combobox" name="gkcj" style="width:480px" data-options="label:'管控层级'"
required=true editable=false>
<option value="公司级">公司级</option>
<option value="部门级">部门级</option>
<option value="班组级">班组级</option>
<option value="岗位级">岗位级</option>
</select>
</div>
<div style="margin-top:10px;margin-bottom:5px">
<input id="zrbm" class="easyui-combotree" name="zrbm" style="width:480px"
data-options="label:'责任部门',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 editable=false/>
</div>
<div style="margin-top:10px;margin-bottom:5px">
<input id="zrr" class="easyui-combobox" name="zrr" style="width:480px" data-options="label:'责任人'"
required=true editable=false/>
</div>
</form>
<div class="labeldiv">风险点二维码</div>
<img id="qrcode" height=240px width=240px>
</div>
</div>
<script>
var id = {{id}}
$.get('api/riskact?a=detail&id='+id,function(res){
var data = res.data
console.log(data)
$('#fxdqy').combotree({'url':'api/area?a=tree'}).combotree('setValue',data.area__id)
$('#fxdlx').combobox({'url':'getdickey?a=combobox&dicclass=53'}).combobox('setValue',data.type__dickeyid)
$('#fxdmc').textbox('setValue',data.name)
$('#jtwz').textbox('setValue',data.place)
$('#qrcode').attr('src',data.qrcode)
$('#group').combobox('setValue', data.group__groupid)
$("#zrbm").combotree({
url: 'parthandle?a=tree',
onSelect: function (node) {
$('#zrr').combobox({
url: 'getuser?partid=' + node.id + '&a=combobox', });
} }).combotree('setValue',data.zrbm__partid);
$('#zrr').combobox({
url: 'getuser?partid=' + data.zrbm__partid + '&a=combobox', }).combobox('setValue',data.zrr__userid);
})
function fxdsubmitForm() {
var data = $('#fxdff').serializeJSON();
data['id']=id
$.ajax({
type: "POST",
url: 'api/riskact?a=edit',
data: JSON.stringify(data),
datatype: "json",
processData: false,
contentType: "application/json;charset=utf-8",
beforeSend: function () {
var bo = $('#fxdff').form('validate')
if (bo == false) {
return bo
} else {
$('#submitb').linkbutton('disable');
}
},
success: function (data) {
if (data.code == 1) {
$('#riskacttable').datagrid('reload');
$("#dd").dialog("close");
} else { $.messager.alert('提示', '失败!'); }
$('#submitb').linkbutton('enable');
},
});
}
</script>