Ext.namespace('DsTruck'); DsTruck.MsChFeeGetRowClass = function (feeStatus) { if (feeStatus == 2) { return 'feestatus_refer'; } else if (feeStatus == 0) { return 'feestatus_pass'; } else if (feeStatus == 6) { return 'feestatus_nopass'; } else if (feeStatus == 8 || feeStatus == 9) { return 'feestatus_settle'; } else if (feeStatus == 3) { return 'feestatus_shenmodify'; } return ''; } DsTruck.RONGZIGetRowClass = function (feeStatus) { ///参数形如 123.33/120.00 的形式 ///前面是融资金额 后面是收回金额 ///如前半为0 返回1 ///如前后相等且不为零 返回8 ///如前半不为0 前半大于后半 返回3 var result = DsTruck.RONGZIState(feeStatus); ///其他 返回2 if (result == 2) result = 1; return DsTruck.MsChFeeGetRowClass(result); } DsTruck.RONGZIState = function (feeStatus) { ///参数形如 123.33/120.00 的形式 ///前面是融资金额 后面是收回金额 ///如前半为0 返回1 ///如前后相等且不为零 返回8 ///如前半不为0 前半大于后半 返回3 ///其他 返回2 var str = feeStatus.split('/'); var rongzi = parseFloat(str[0]); var shouhui = parseFloat(str[1]); var result = 1; if (rongzi == 0) { result = 1; } else if (rongzi == shouhui) { result = 8; } else if (rongzi > shouhui) { result = 3; } else result = 2; return result; } DsTruck.FinanceGetRowClass = function (FinanceStatus) { if (FinanceStatus == 1) { return 'feestatus_pass'; } else { return 'feestatus_nopass'; } return ''; } DsTruck.CheckChFeeDelete = function (records, OPRange) { 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; } if (canDelete == true) { var op = rec.data.EnteroPerator; var opname = rec.data.OpName; var recop = DsStoreQueryBy(OPRange, 'OPID', op); if (recop.getCount() > 0) { } else { Ext.Msg.show({ title: '提示', msg: '你没有权限删除' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); canDelete = false; } } } return true; } DsTruck.CheckChFeeDelete_Sales = function (records, OPRange) { 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; } if (canDelete == true) { var op = rec.data.EnteroPerator; var opname = rec.data.OpName; var recop = DsStoreQueryBy(OPRange, 'GID', op); if (recop.getCount() > 0) { } else { Ext.Msg.show({ title: '提示', msg: '你没有权限删除' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); canDelete = false; } } } return canDelete; }