Index: ssts-web/src/main/webapp/disinfectsystem/customform/formdefinitionView.js =================================================================== diff -u -r36764 -r41124 --- ssts-web/src/main/webapp/disinfectsystem/customform/formdefinitionView.js (.../formdefinitionView.js) (revision 36764) +++ ssts-web/src/main/webapp/disinfectsystem/customform/formdefinitionView.js (.../formdefinitionView.js) (revision 41124) @@ -781,6 +781,12 @@ }] }], buttons : [{ + id : 'saveBtnAndNew', + text : '另存为', + handler : function(){ + newSave(); + } + },{ id : 'saveBtn', text : '保存', handler : saveFormDefinition @@ -839,7 +845,71 @@ submitFormDefinitionForm(action_save); } -function submitFormDefinitionForm(actionType){ +//ZSYKEQ-34:另存为 +var newSaveMsgWin; +function newSave(){ + newSaveMsgWin = new top.Ext.Window({ + id: 'newSaveMsgWin', + layout: 'fit', + title: '请确认另存为信息', + width: 400, + border: false, + modal: true, + height: 130, + plain: true, + items: [ + new top.Ext.FormPanel({ + id: 'newSaveMsgForm', + frame: true, + labelSeparator: ':', + labelAlign: 'right', + fileUpload: true, + bodyStyle: 'padding:5px 5px 0px 5px;', + width: 400, + columnWidth: 1, + labelWidth: 130, + autoScroll: true, + height: 130, + items: [{ + columnWidth: 1, + layout: 'form', + labelAlign: "right", + items: [{ + xtype: 'textfield', + fieldLabel: "请输入新的表单名称", + allowBlank: false, + blankText: '请输入新的表单名称!', + name: "newName", + id: "newName", + anchor: '100%' + }] + }], + buttons: [{ + id: 'newSaveBtn', + text: '保存', + handler: function () { + var newName = top.Ext.getCmp('newName').getValue(); + if(newName == ''){ + showResult('表单名称不能为空!'); + return + } + submitFormDefinitionForm(action_save, true); + } + }, { + id: 'newCancelBtn', + text: '取消', + handler: function () { + newSaveMsgWin.close(); + } + }] + }) + ] + }); + newSaveMsgWin.show(); + top.Ext.getCmp('newName').focus(false, 100); +} + +function submitFormDefinitionForm(actionType, saveAs){ var formPanel = top.Ext.getCmp('formDefinitionForm'); if (!formPanel.form.isValid()) { showResult('请正确填写表单各值'); @@ -876,6 +946,13 @@ showResult(submitFaildMsg); return false; } + + if(saveAs){ + var newName = top.Ext.getCmp('newName').getValue(); + top.Ext.getCmp("formName").setValue(newName); + top.Ext.getCmp("id").setValue(''); + newSaveMsgWin.close(); + } formPanel.form.submit({ url : WWWROOT + '/disinfectSystem/formDefinitionAction!saveFormDefinition.do', @@ -887,7 +964,11 @@ showResult(action.result.message); if(action.result.success){ grid.dwrReload(); - top.Ext.getCmp("formDefinitionWin").close(); + if(!saveAs){ + top.Ext.getCmp("formDefinitionWin").close(); + }else { + top.Ext.getCmp("saveBtn").enable(); + } } }, failure : function(form, action) {