Form 和 Grid之间切换,列表和增删改
//Store
contractAction.contractAttachmentsStore = new Ext.data.Store({
??? proxy : new Ext.data.HttpProxy({
??????? url : 'BLL/ModuleBusiness/Contract/Operation.aspx?cmd=htfile2' // 注意路径!
??? }),
??? baseParams : {
??????? id : contract_htdetail_gethtid
??????? // 合同ID
??? },
??? reader : new Ext.data.JsonReader({
??????? root : 'FileList',
??????? fields : [{
??????????? name : "UploadID",
??????????? mapping : "UploadID"
??????? }, "UploadFileName", "UploadCategory", "UploadRemark", {
??????????? name : "UploadCreateDatetime",
??????????? type : "date",
??????????? dateFormat : "Y-m-d"
??????? }, "UploadName", "UploadFilePath", "UploadStage", "UploadCategoryID", "UploadCreateUserName"]
??? }),
??? remoteSort : false
});
contractAction.contractAttachmentsStore.load();
//ColumnModel
contractAction.contractAttachmentsCm = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), new Ext.grid.CheckboxSelectionModel(), {
??? header : "ID",
??? dataIndex : "UploadID",
??? width : 150,
??? hidden : true,
??? fixed : true,
??? sortable : false
}, {
??? header : WooI18N.ModuleBusiness.Contract.ContractFileNameText,
??? dataIndex : "UploadFileName",
??? width : 150,
??? sortable : false
}, {
??? header : WooI18N.ModuleBusiness.Contract.ContractFileCategoryText,
??? dataIndex : "UploadCategory",
??? width : 100
}, {
??? header : WooI18N.ModuleBusiness.Contract.ContractFileUploadDateText,
??? dataIndex : "UploadCreateDatetime",
??? width : 150,
??? renderer : Ext.util.Format.dateRenderer('Y-m-d')
??? //i18n-ylj
}, {
??? header : WooI18N.ModuleBusiness.Contract.ContractFileRemarkText,
??? dataIndex : "UploadRemark",
??? width : 250
}, {
??? header : "附件类别ID",
??? dataIndex : "UploadCategoryID",
??? width : 120,
??? hidden : true,
??? fixed : true,
??? sortable : false
}, {
??? header : WooI18N.ModuleBusiness.Contract.ContractFileUploadNameText,
??? dataIndex : "UploadName",
??? width : 120,
??? sortable : false
}, {
??? header : WooI18N.ModuleBusiness.Contract.ContractFileUploadUserText,
??? dataIndex : 'UploadCreateUserName',
??? width : 80,
??? sortable : false
}, {
??? header : WooI18N.ModuleBusiness.Contract.ContractFileStageText,
??? dataIndex : "UploadStage",
??? width : 120,
??? sortable : false
}, {
??? header : WooI18N.ModuleBusiness.Contract.ContractFilePathText,
??? dataIndex : "UploadFilePath",
??? width : 120,
??? renderer : contractAction.renderOnHtmlDownload,
??? sortable : false
}]);
//End
//EditGridPanel
contractAction.contractAttachmentsGrid = new Ext.grid.EditorGridPanel({
??? index : 0,
??? id : "contractAction.contractAttachmentsGrid",
??? layout : "fit",
??? height : 280,
??? width : 760,
??? cm : contractAction.contractAttachmentsCm,
??? autoScroll : true,
??? store : contractAction.contractAttachmentsStore,
??? sm : new Ext.grid.CheckboxSelectionModel(),
??? autoExpandColumn : 3,
??? viewConfig : {
??????? forceFit : true
??? },
??? tbar : [{//增加
??????? text : WooI18N.ModuleBusiness.Contract.ContractButtonAddText,
??????? iconCls : 'add',
??????? handler : contractAction.AddAttachmentHandler
??? }, {//修改
??????? text : WooI18N.ModuleBusiness.Contract.ContractButtonModifyText,
??????? iconCls : 'edit',
??????? handler : contractAction.EditAttachmentHandler
??? }, {//删除
??????? text : WooI18N.ModuleBusiness.Contract.ContractButtonDeleteText,// fileno
??????? iconCls : 'remove',
??????? handler : contractAction.DeleteAttachmentHandler
??? }]
});
//AddForm
contractAction.AttachmentsForm = new Ext.form.FormPanel({
??? id : 'contractAction.AttachmentsForm',
??? index : 1,
??? autoScroll : true,
??? autoHeight : true,
??? layout : 'form',
??? labelAlign : 'top',
??? bodyStyle : 'padding:5px',
??? labelWidth : 80,
??? labelAlign : "right",
??? border : false,
??? items : [{
??????? xtype : "fieldset",
??????? title : WooI18N.ModuleBusiness.Contract.FileInfo,
??????? width : 760,
??????? autoHeight : true,
??????? layout : 'tableform',
??????? layoutConfig : {
??????????? columns : 2
??????? },
??????? items : [new Ext.form.Hidden({
??????????? name : 'defaultValue',
??????????? colspan : 2,
??????????? value : '0',
??????????? id : 'contract_htdetail_defaultValueForFile2'
??????? }), {
??????????? xtype : 'fileuploadfield', //'textfield',
??????????? id : 'contractAction.fileShowName',
??????????? name : "FileName",//"UploadName",
??????????? fieldLabel : WooI18N.ModuleBusiness.Contract.ContractFileUploadNameText,
??????????? allowBlank : false,
??????????? maxLength : 50,
??????????? colspan : 2,
??????????? maxLengthText : WooI18N.ModuleBusiness.Contract.LengthInfo,
??????????? blankText : WooI18N.ModuleBusiness.Contract.UploadFileText,
??????????? style : 'background: url(Resources/images/pen.gif) no-repeat 3px center;padding-left:15px;width:370px;',
??????????? readOnly : true,
??????????? listeners : {
??????????????? 'fileselected' : function(fb, v) {
??????????????????? Ext.getCmp('contract_htdetail_defaultValueForFile2').setValue('1');
??????????????? }
??????????? }
??????? }, {
??????????? width : 450,
??????????? colspan : 2,
??????????? xtype : 'textfield',
??????????? fieldLabel : WooI18N.ModuleBusiness.Contract.ContractFileNameText,
??????????? allowBlank : false,
??????????? maxLength : 50,
??????????? maxLengthText : WooI18N.ModuleBusiness.Contract.LengthInfo,
??????????? name : 'UploadFileName',
??????????? style : 'background: url(Resources/images/pen.gif) no-repeat 3px center;padding-left:15px;'
??????? }, {
??????????? xtype : "combo",
??????????? width : 435,
??????????? colspan : 2,
??????????? hiddenName : "UploadCategory",
??????????? allowBlank : false,
??????????? style : 'background: url(Resources/images/pen.gif) no-repeat 3px center;padding-left:15px;',
??????????? blankText : WooI18N.ModuleBusiness.Contract.InputFileCategory,
??????????? fieldLabel : WooI18N.ModuleBusiness.Contract.ContractFileCategoryText,
??????????? store : new Ext.data.Store({
??????????????? proxy : new Ext.data.HttpProxy({
??????????????????? url : 'BLL/ModuleBusiness/Contract/Operation.aspx?cmd=fileCategoryList'
??????????????? }),
??????????????? reader : new Ext.data.JsonReader({
??????????????????? root : 'fileCategoryList',
??????????????????? fields : [{
??????????????????????? name : 'LbID'
??????????????????? }, {
??????????????????????? name : 'LbName'
??????????????????? }]
??????????????? }),
??????????????? remoteSort : false
??????????? }),
??????????? valueField : 'LbID',
??????????? emptyText : WooI18N.ModuleBusiness.Contract.FileEmptyText,
??????????? displayField : 'LbName',
??????????? editable : false,
??????????? typeAhead : true,
??????????? triggerAction : 'all',
??????????? mode : 'remote',
??????????? readOnly : true,
??????????? selectOnFocus : true,
??????????? allowBlank : false,
??????????? listWidth : 435,
??????????? listClass : 'x-combo-list-small',
??????????? listeners : {
??????????????? "change" : {
??????????????????? fn : function(_this, _newValue, _oldValue) {
??????????????????????? // 选择的类别所对应的合同ID
??????????????????????? Ext.getCmp("contract_htdetail_fileType").setValue(_newValue);
??????????????????? }
??????????????? }
??????????? }
??????? }, {
??????????? width : 435,
??????????? colspan : 2,
??????????? xtype : "combo",
??????????? name : "UploadStage",
??????????? allowBlank : false,
??????????? readOnly : true,
??????????? blankText : WooI18N.ModuleBusiness.Contract.InputStage,
??????????? style : 'background: url(Resources/images/pen.gif) no-repeat 3px center;padding-left:15px;',
??????????? // colspan : 2,
??????????? fieldLabel : WooI18N.ModuleBusiness.Contract.ContractFileStageText,
??????????? store : new Ext.data.Store({
??????????????? // 附件的阶段列表 是为原始的合同上传附件还是变更后的合同上传附件
??????????????? proxy : new Ext.data.HttpProxy({
??????????????????? url : 'BLL/ModuleBusiness/Contract/Operation.aspx?cmd=Contractstage'
??????????????? }),
??????????????? baseParams : {
??????????????????? id : contract_htdetail_gethtid
??????????????????? // 合同的ID
??????????????? },
??????????????? reader : new Ext.data.JsonReader({
??????????????????? root : 'StageList',
??????????????????? fields : [{
??????????????????????? name : 'ContractStage'// 阶段名称
??????????????????? }, {
??????????????????????? name : 'ContractBakChangeTimes'// 阶段所对应的PX值
??????????????????? }, {
??????????????????????? name : 'ContractBakID'// 合同BAK中的ID
??????????????????? }, {
??????????????????????? name : 'ContractID'// 合同表的ID
??????????????????? }]
??????????????? }),
??????????????? remoteSort : false
??????????? }),
??????????? listeners : {
??????????????? "change" : {
??????????????????? fn : function(_this, _newValue, _oldValue) {
??????????????????????? // 选择的阶段所对应的PX值
??????????????????????? Ext.getCmp("contract_htdetail_ContractBakChangeTimes").setValue(this.getValue());
??????????????????? }
??????????????? }
??????????? },
??????????? valueField : 'ContractBakChangeTimes',
??????????? displayField : 'ContractStage',
??????????? emptyText : WooI18N.ModuleBusiness.Contract.InputEmptyStage,
??????????? editable : false,
??????????? typeAhead : true,
??????????? triggerAction : 'all',
??????????? mode : 'remote',
??????????? selectOnFocus : true,
??????????? allowBlank : false,
??????????? listWidth : 435,
??????????? listClass : 'x-combo-list-small'
??????? },
??????? //??????????? {
??????? //??????????????? colspan : 2,
??????? //??????????????? layout : 'tableform',
??????? //??????????????? border : false,
??????? //??????????????? items : [{
??????? //??????????????????? xtype : 'textfield',
??????? //??????????????????? name : "UploadName",
??????? //??????????????????? fieldLabel : WooI18N.ModuleBusiness.Contract.ContractFileUploadNameText,
??????? //??????????????????? readOnly : true,
??????? //??????????????????? maxLength : 50,
??????? //??????????????????? maxLengthText : WooI18N.ModuleBusiness.Contract.LengthInfo,
??????? //??????????????????? id : "contract_htdetail_filename",
??????? //??????????????????? allowBlank : false,
??????? //??????????????????? style : 'background: url(Resources/images/pen.gif) no-repeat 3px center;padding-left:15px;',
??????? //??????????????????? blankText : WooI18N.ModuleBusiness.Contract.UploadFileText,
??????? //??????????????????? width : 390
??????? //??????????????? }, {
??????? //??????????????????? xtype : "button",
??????? //??????????????????? text : WooI18N.ModuleBusiness.Contract.ContractButtonBrowseText,
??????? //??????????????????? style : 'padding-left:10px;',
??????? //??????????????????? handler : function() {
??????? //??????????????????????? contract_htdetail_dialog.show();
??????? //??????????????????? }
??????? //??????????????? }]
??????? //??????????? },
??????? {
??????????? name : "UploadRemark",
??????????? colspan : 2,
??????????? width : 450,
??????????? fieldLabel : WooI18N.ModuleBusiness.Contract.ContractFileRemarkText,
??????????? xtype : "textarea",
??????????? maxLength : 1000,
??????????? maxLengthText : WooI18N.ModuleBusiness.Contract.LengthInfo,
??????????? height : 50
??????? }, new Ext.form.Hidden({// 上传到服务器的路径
??????????? name : "UploadFilePath",
??????????? id : 'contract_htdetail_path'
??????? }), new Ext.form.Hidden({ // 附件类别的ID
??????????? name : "UploadCategoryID",
??????????? id : 'contract_htdetail_fileType'
??????? }), new Ext.form.Hidden({
??????????? name : 'UploadName',
??????????? id : 'contract_htdetail_filename'
??????? }), new Ext.form.Hidden({// 为哪个阶段的合同上传的附件
??????????? id : "contract_htdetail_ContractBakChangeTimes",
??????????? name : "ContractBakChangeTimes"
??????? })]
??? }],
??? buttons : [{
??????? text : WooI18N.ModuleBusiness.Contract.ContractButtonSaveText,
??????? id : 'contract_htdetail_filesave',
??????? handler : function() {
??????????? contractAction.contract_htdetail_FormSubmit(contractAction.AttachmentsForm, contractAction.contractAttachmentsGrid, contractAction.contractAttachmentsPanel, "file", contract_htdetail_fileID, "contract_htdetail_filesave");
??????? }
??? }, {
??????? text : WooI18N.ModuleBusiness.Contract.ContractButtonReturnText,
??????? handler : function() {
??????????? Woo.Common.SetActiveCard(contractAction.contractAttachmentsPanel, 0);
??????? }
??? }]
});
//AttachmentPanel
contractAction.contractAttachmentsPanel = new Ext.Panel({
??? id : 'contractActionAttachment',
??? renderTo : 'contractActionPlanFinanceDiv',
??? layout : 'card',
??? activeItem : 0,
??? height : 300,
??? autoScroll : true,
??? items : [contractAction.contractAttachmentsGrid, contractAction.AttachmentsForm]
});
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//增加合同附件Handler
contractAction.AddAttachmentHandler = function() {
??? //??????????????????? if (isHaveFileRemarkPermission == "OK") {
??? // this.formPanel.getForm().reset();//重置增加的表单
??? // 操作选择阶段的下拉列表
??? //??????????????????? if (contract_htdetail_ContractState == "未执行" || contract_htdetail_ContractState == "执行中" || contract_htdetail_ContractState == WooI18N.ModuleBusiness.Contract.ContractState1 || contract_htdetail_ContractState == WooI18N.ModuleBusiness.Contract.ContractState2) {//i18n-ylj
??? contract_htdetail_fileID = "";
??? // 让保存按钮能用
??? contractAction.contract_htdetail_CreateFinance(contractAction.contractAttachmentsStore, contractAction.contractAttachmentsPanel);
??? contractAction.AttachmentsForm.getForm().reset();
??? var _UploadStage = contractAction.AttachmentsForm.getForm().findField("UploadStage");
??? if (_UploadStage) {// 如果存在这个控件
??????? if (_UploadStage.rendered && _UploadStage.emptyText) {// 如果渲染过了 并且有默认的空文本
??????????? // 给这个控件增加默认的样式
??????????? _UploadStage.el.addClass(_UploadStage.emptyClass);
??????????? // 给这个控件增加默认的文本
??????????? _UploadStage.setRawValue(_UploadStage.emptyText);
??????? }
??? }
??? Ext.getCmp("contract_htdetail_filesave").enable();// 新建文件时使保存按钮能用
??? //??????????????????? } else {
??? //??????????????????????? Woo.Common.operationNotice(contractAction.contractAttachmentsGrid, WooI18N.ModuleBusiness.Contract.ContractStateText + contract_htdetail_ContractState + WooI18N.ModuleBusiness.Contract.CantAddText);
??? //??????????????????? }
??? //??????????????????? } else {
??? //??????????????????????? Woo.Common.operationNotice(contractAction.contractAttachmentsGrid, WooI18N.ModuleBusiness.Contract.FileUploadPermission);
??? //??????????????????? }
}
//编辑合同附件Handler
contractAction.EditAttachmentHandler = function() {
??? //??????????????????? if (isHaveFileRemarkPermission == "OK") {
??? // this.formPanel.getForm().reset();//重置修改的表单
??? //??????????????????????? if (contract_htdetail_ContractState == "未执行" || contract_htdetail_ContractState == "执行中" || contract_htdetail_ContractState == WooI18N.ModuleBusiness.Contract.ContractState1 || contract_htdetail_ContractState == WooI18N.ModuleBusiness.Contract.ContractState2) {//i18n-ylj
??? var selectedKeys = contractAction.contractAttachmentsGrid.selModel.selections.keys; // returns
??? if (selectedKeys.length != 1) {
??????? Ext.MessageBox.alert(WooI18N.ModuleBusiness.Contract.Tips, WooI18N.ModuleBusiness.Contract.SelectMoreRecordText);
??? } else {
??????? var id = contractAction.contractAttachmentsGrid.getSelectionModel().getSelected();// 取得要修改的记录
??????? var _itemID = id.get("UploadID");// 取得修改记录的ID
??????? try {
??????????? // 是否有修改的权限
??????????? //??????????????????????????? if ((contractDirtyTimes != "0" && (contract_htdetail_ContractState == "未执行" || contract_htdetail_ContractState == WooI18N.ModuleBusiness.Contract.ContractState1)) || (contract_htdetail_ContractState == "执行中" || contract_htdetail_ContractState == WooI18N.ModuleBusiness.Contract.ContractState2)) {//i18n-ylj
??????????? var contract_htdetail_conn1 = Ext.lib.Ajax.getConnectionObject().conn;
??????????? contract_htdetail_conn1.open("GET", 'BLL/Core/checkPermission.aspx?cmd=editConFile&fileID=' + _itemID + '&conID=' + contract_htdetail_gethtid + '&rand=' + Math.round(Math.random() * (10000 - 1)).toString(), false);
??????????? contract_htdetail_conn1.send(null);
??????????? var _text = contract_htdetail_conn1.responseText;
??????????? if (_text == "False") {
??????????????? _text = WooI18N.ModuleBusiness.Contract.ModifyTimeFilePermission;
??????????????? // contract_htdetail_DelayMessage(this.listPanel, _text);//修改信息提示
??????????????? Woo.Common.operationNotice(contractAction.contractAttachmentsGrid, _text);
??????????? } else {
??????????????? // 如果有权限修改 就绑定修改的FormPanel
??????????????? contract_htdetail_fileID = contractAction.contractAttachmentsGrid.getSelectionModel().getSelected().get('UploadID');
??????????????? contractAction.contract_htdetail_DobindT(contractAction.contractAttachmentsPanel, contractAction.AttachmentsForm, contractAction.contractAttachmentsGrid, contract_htdetail_fileID, contract_htdetail_gethtid, "file", "contract_htdetail_filesave");
??????????? }
??????????? //??????????????????????????? } else {
??????????? //??????????????????????????????? // 如果有权限修改 就绑定修改的FormPanel
??????????? //??????????????????????????????? contract_htdetail_fileID = contractAction.contractAttachmentsGrid.getSelectionModel().getSelected().get('UploadID');
??????????? //??????????????????????????????? contractAction.contract_htdetail_DobindT(contractAction.contractAttachmentsPanel, contractAction.AttachmentsForm, contractAction.contractAttachmentsGrid, contract_htdetail_fileID, contract_htdetail_gethtid, "file", "contract_htdetail_filesave");
??????????? //??????????????????????????? }
??????? }
??????? catch (e) {
??????????? alert(e + "/r/n/r/n" + e.stack);
??????? }
??? }
??? //??????????????????????? } else {
??? //??????????????????????????? Woo.Common.operationNotice(contractAction.contractAttachmentsGrid, WooI18N.ModuleBusiness.Contract.ContractStateText + contract_htdetail_ContractState + WooI18N.ModuleBusiness.Contract.CantModifyText);
??? //??????????????????????? }
??? //??????????????????? } else {
??? //??????????????????????? Woo.Common.operationNotice(contractAction.contractAttachmentsGrid, WooI18N.ModuleBusiness.Contract.FileModifyPermission);
??? //??????????????????????? // }
??? //??????????????????? }
}
//删除合同附件Handler
contractAction.DeleteAttachmentHandler = function() {
??? try {
??????? //??????????????????? if (isHaveFileRemarkPermission == "OK") {
??????? //??????????????????????? if (contract_htdetail_ContractState == "未执行" || contract_htdetail_ContractState == "执行中" || contract_htdetail_ContractState == WooI18N.ModuleBusiness.Contract.ContractState1 || contract_htdetail_ContractState == WooI18N.ModuleBusiness.Contract.ContractState2) {//i18n-ylj
??????? contract_htdetail_EditorGridDel(contractAction.contractAttachmentsGrid, contractAction.contractAttachmentsStore, "file");
??????? //??????????????????????? } else {
??????? //??????????????????????????? Woo.Common.operationNotice(contractAction.contractAttachmentsGrid, WooI18N.ModuleBusiness.Contract.ContractStateText + contract_htdetail_ContractState + WooI18N.ModuleBusiness.Contract.CantDeleteText);
??????? //??????????????????????? }
??????? //??????????????????? } else {
??????? //??????????????????????? Woo.Common.operationNotice(contractAction.contractAttachmentsGrid, WooI18N.ModuleBusiness.Contract.FileDeletePermission);
??????? //??????????????????? }
??? }
??? catch (e) {
??????? alert(e + "\r\n\r\n" + e.stack)
??? }
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//增加时Form和Grid切换
contractAction.contract_htdetail_CreateFinance = function(_store, _panel) {
??? _store.reload({
??????? callback : function() {
??????????? Woo.Common.SetActiveCard(_panel, 1);
??????? }
??? });
}
//修改合同备注、合同附件时绑定修改的FromPanel _panel:导航的Panel _form:新建、修改的FormPanel _grid:GridPanel列表 _id:绑定信息的ID contractid:合同ID type:备注还是附件
contractAction.contract_htdetail_DobindT = function(_panel, _form, _grid, _id, contractid, type, btnId) {
??? Woo.Common.SetActiveCard(_panel, 1);
??? var thisUrl = "";
??? if (type == "remark") {
??????? thisUrl = 'BLL/ModuleBusiness/Contract/Operation.aspx?cmd=bindremark&rand=' + Math.round(Math.random() * (10000 - 1)).toString();// &id=' + _id;
??? } else if (type == "file") {
??????? thisUrl = 'BLL/ModuleBusiness/Contract/Operation.aspx?cmd=bindfile&rand=' + Math.round(Math.random() * (10000 - 1)).toString();// &id=' + _id;
??? }
??? Ext.Ajax.request({
??????? url : thisUrl,
??????? method : 'POST',
??????? params : {
??????????? id : _id
??????? },
??????? failure : function(response, options) {
??????????? Ext.MessageBox.hide();
??????????? Ext.MessageBox.alert(WooI18N.ModuleBusiness.Contract.Warning, WooI18N.ModuleBusiness.Contract.Notice);
??????? },
??????? success : function(response, options) {
??????????? Ext.MessageBox.hide();
??????????? var formvalue = Ext.decode(response.responseText);
??????????? _form.getForm().setValues(formvalue);
??????????? if (type == "file") {
??????????????? Ext.getCmp('contractAction.fileShowName').setValue(formvalue.UploadName);
??????????? }
??????????? Ext.getCmp(btnId).enable();
??????? }
??? });
}
//删除合同附件、合同备注中选择的记录 _grid: 那个GridPanel选中的记录需要删除 _store:grid的Store属性 type:删除备注还是福建
function contract_htdetail_EditorGridDel(_grid, _store, type) {//
??? var selectedKeys = _grid.selModel.selections.keys;
??? if (selectedKeys.length > 0) {
??????? Ext.MessageBox.confirm(WooI18N.ModuleBusiness.Contract.Tips, WooI18N.ModuleBusiness.Contract.ContractDeleteTip, function(btn) {
??????????? if (btn != "yes") return;
??????????? var selectedRows = _grid.getSelections();
??????????? var tips = 0;
??????????? var ids = "";
??????????? var thisUrl = "";
??????????? if (selectedRows) {
??????????????? if (type == "remark") {
??????????????????? thisUrl = "BLL/ModuleBusiness/Contract/Operation.aspx?cmd=DeleteRemark2";
??????????????????? for (var i = 0, len = selectedRows.length; i < len; i++) {
??????????????????????? var id = selectedRows[i].get("ID");
??????????????????????? ids += id + ",";
??????????????????? }
??????????????? } else if (type == "file") {
??????????????????? thisUrl = "BLL/ModuleBusiness/Contract/Operation.aspx?cmd=DeleteFile2";
??????????????????? for (var i = 0, len = selectedRows.length; i < len; i++) {
??????????????????????? var id = selectedRows[i].get("UploadID");
??????????????????????? ids += id + ",";
??????????????????? }
??????????????? } else if (type == "consult") {
??????????????????? thisUrl = "BLL/ModuleBusiness/Contract/Operation.aspx?cmd=DeleteConsult";
??????????????????? for (var i = 0, len = selectedRows.length; i < len; i++) {
??????????????????????? var id = selectedRows[i].get("ID");
??????????????????????? ids += id + ",";
??????????????????? }
??????????????? }
??????????????? if (tips == 1) {
??????????????????? Ext.MessageBox.alert(WooI18N.ModuleBusiness.Contract.Tips, WooI18N.ModuleBusiness.Contract.CantDelete);
??????????????? } else {
??????????????????? Ext.Ajax.request({
??????????????????????? url : thisUrl,
??????????????????????? params : {
??????????????????????????? id : ids,// 删除记录的ID 格式 1,2,3,4,
??????????????????????????? conID : contract_htdetail_gethtid
??????????????????????????? // 合同ID
??????????????????????? },
??????????????????????? failure : function(response, options) {
??????????????????????????? Ext.MessageBox.hide();
??????????????????????????? Ext.MessageBox.alert(WooI18N.ModuleBusiness.Contract.Warning, WooI18N.ModuleBusiness.Contract.Notice);
??????????????????????? },
??????????????????????? success : function(response, options) {
??????????????????????????? //??????????????????????????????? var strText = response.responseText;
??????????????????????????? var strText = "";
??????????????????????????? switch (response.responseText) {
??????????????????????????????? case "108" :
??????????????????????????????????? strText = WooI18N.ModuleBusiness.Contract.NotDeleteRemark;// '合同的状态为"已完成、已终止、已作废"不能删除备忘';
??????????????????????????????????? break;
??????????????????????????????? case "109" :
??????????????????????????????????? strText = WooI18N.ModuleBusiness.Contract.ObjectDeleteFailure;// '删除失败!';
??????????????????????????????????? break;
??????????????????????????????? case "110" :
??????????????????????????????????? strText = WooI18N.ModuleBusiness.Contract.ObjectDeleteSuccess;//'删除成功!';
??????????????????????????????????? break;
??????????????????????????????? case "111" :
??????????????????????????????????? strText = WooI18N.ModuleBusiness.Contract.NotTimeDeleteRemark;// '某些说明不能删除!已经超过24小时。';
??????????????????????????????????? break;
??????????????????????????????? case "112" :
??????????????????????????????????? strText = WooI18N.ModuleBusiness.Contract.NotDeleteFile;// '合同的状态为"已完成、已终止、已作废"不能删除附件';
??????????????????????????????????? break;
??????????????????????????????? case "113" :
??????????????????????????????????? strText = WooI18N.ModuleBusiness.Contract.NotTimeDeleteFile;// '某些附件不能删除!已经超过24小时。';
??????????????????????????????????? break;
??????????????????????????? }
??????????????????????????? Woo.Common.operationNotice(_grid, strText);
??????????????????????????? _store.reload();
??????????????????????? }
??????????????????? });
??????????????? }
??????????? }
??????? });
??? } else {
??????? Woo.Common.operationNotice(_grid, WooI18N.ModuleBusiness.Contract.SelectLeastRecordText);
??? }
}
//