123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- /**
- * @class 修改交接班日志
- * 功能:修改交接班日志
- */
- $(function(){
- //修改表单信息,获取记录
- if((window.location.href).indexOf('?')>-1){
- var fd_id = (window.location.href).split('?')[1];
- $('#fileListLegend').css("display","block");
- $('#fileList').css("display","block");
- var url = $.pathname() + "/ws/crud/CRUDService/getDataById/";
- var params = {
- classid : '361',
- objectID : fd_id
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- $('#fillForm').ajaxWrite({data:data});
- var name = data.list[0].value;
- $('#fillForm input[name="classid"]').val('361');
- $("#AcceptUserTree").attr("selectedValue",name);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- });
- //查询部门,生成单选下拉框数据
- $(function(){
- var url = $.pathname() + '/ws/alert/AlertTransferService/queryDept';
- $.ajax({
- url : url,
- type : 'post',
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $("#DEPT_OBJECT_361").data("data",JSON.parse(data));
- $("#DEPT_OBJECT_361").render();
- },
- error : function(){
- $.messager.alert('部门获取失败');
- }
- });
- });
- //返回主页面
- function goBack() {
- //获取iframe中的元素值
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = $.pathname()+"/page/business/em/alert/duty/transfer_daily.jsp";
- }
- //修改交接班日志
- function updateTransferDaily(){
- $("#DEPT_361").val($("#DEPT_OBJECT_361").attr("relText"));
- $form = $('#fillForm');
- //$("#classid").val("361");
- var params = "classid=361&"+$form.serialize();
- var url = $.pathname() + '/ws/crud/CRUDService/update';
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- goBack();
- $.messager.alert("保存成功",null,null,null,1);
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
- }
- //发布交接班日志
- function releaseTransferDaily(){
- $("#DEPT_361").val($("#DEPT_OBJECT_361").attr("relText"));
- $("#DAILY_STATE_361").val("发布");
- $form = $('#fillForm');
- var params = "classid=361&"+$form.serialize();
- var url = $.pathname() + '/ws/crud/CRUDService/update';
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- goBack();
- $.messager.alert("发布成功",null,null,null,1);
- },
- error : function(){
- $.messager.alert('发布失败');
- }
- });
- }
- //表单验证(修改调用)
- function updateValidateForm(containerId) {
- var valid = $(containerId).validationEngine({returnIsValid: true});
- if(valid == true){
- updateTransferDaily();
- }else{
- top.Dialog.alert('不符合填写要求,请重新填写');
- }
- }
- //表单验证(发布调用)
- function releaseValidateForm(containerId) {
- var valid = $(containerId).validationEngine({returnIsValid: true});
- if(valid == true){
- releaseTransferDaily();
- }else{
- top.Dialog.alert('不符合填写要求,请重新填写');
- }
- }
- //表单重置
- function resetForm(){
- $("#fillForm")[0].reset();
- $("#fillForm .selectTree").resetValue();
- }
|