Ext.namespace('DsTruck'); DsTruck.MsChFeeAudit = function (records, newStatus, waitMsg, USERID,CanDo) { var jsondata = ConvertRecordsToJsonAll(records); Ext.Msg.wait(waitMsg); Ext.Ajax.request({ waitMsg: waitMsg, url: '/Import/MsChFee/Audit', scope: this, params: { newStatus: newStatus, list: jsondata, USERID: USERID, CanDo:CanDo//是否能不受自动逻辑限制 True为不受限制(财务界面) False为受限(业务界面) }, callback: function (options, success, response) { if (success) { Ext.MessageBox.hide(); var jsonresult = Ext.JSON.decode(response.responseText); if (jsonresult.Success) { var newStatusRef = jsonresult.data; for (var i = 0; i < records.length; i++) { var record = records[i]; var _r = newStatusRef[i]; record.set('FeeStatus', _r.NewStatus); record.set('FeeStatus_Ref', _r.NewStatusRef); record.commit(); } //////////////// /* if (newStatus == 8 || newStatus == 9) for (var i = 0; i < records.length; i++) { var record = records[i]; Ext.Ajax.request({ // waitMsg: '正在生成结算...', url: '/Import/CWSettlement/Settlement', params: { newStatus: newStatus, GId: record.get('GId') }, callback: function (_count) { //alert('初始化完成'); }, scope: this }); } //request over*/ /////////////////////// } else { Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } else { var jsonresult = Ext.JSON.decode(response.responseText); Ext.Msg.show({ title: '请重试', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); } } }); }, DsTruck.CheckChFeeDelete = function (records) { for (var i = 0; i < records.length; i++) { var rec = records[i]; var feeStatus = rec.data.FeeStatus; var canDelete = feeStatus == 1 || feeStatus == 6; if (canDelete == false) { Ext.Msg.show({ title: '提示', msg: '只能删除费用状态为[录入状态]和[驳回提交]的费用,请重新选择', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return false; } } return true; } /*, DsTruck.CheckFinanceInsert = function (records) { for (var i = 0; i < records.length; i++) { var rec = records[i]; var FinanceStatus = rec.data.FinanceStatus; var canInsert = feeStatus == 0 || feeStatus == 1; if (canInsert == false) { Ext.Msg.show({ title: '提示', msg: '只能批量保存,请重新选择', icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); return false; } } return true; }*/