You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/TruckMng/Viewsjs/MsWlBsAudit/MsWlBsAuditIndex.js

1048 lines
35 KiB
JavaScript

3 years ago
Ext.namespace('DsTruck');
DsTruck.MsWlBsAuditIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.MsWlBsAuditIndex.superclass.constructor.call(this);
};
Ext.extend(DsTruck.MsWlBsAuditIndex, Ext.Panel, {
PageSize: 100,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
initUIComponents: function () {
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsWlBizBill',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsWlBsAudit/GetDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#region 主grid
this.column = [{
sortable: true,
dataIndex: 'BillType',
header: '单据类型',
renderer: function (value, p, record) { return value + '-' + record.data.BillType_Ref; },
width: 70
},{
sortable: true,
dataIndex: 'BsType',
header: '业务类型',
renderer: function (value, p, record) { return value + '-' + record.data.BsType_Ref; },
width: 70
}, {
sortable: true,
dataIndex: 'BillNo',
header: '派车单号',
width: 130
}, {
sortable: true,
dataIndex: 'BsBillNo',
header: '托单号',
width: 130
}, {
sortable: true,
dataIndex: 'TruckNo',
header: '车牌号',
width: 70
}, {
sortable: true,
dataIndex: 'DrvName',
header: '司机',
width: 60
}, {
sortable: true,
dataIndex: 'CustName',
header: '客户名称',
width: 120
}, {
sortable: true,
dataIndex: 'ContainerNos',
header: '箱型箱量',
width: 120
}, {
sortable: true,
dataIndex: 'FuelQty',
header: '加油量',
width: 60
}, {
sortable: true,
dataIndex: 'CustDate',
header: '派车日期/委托日期',
width: 100
}, {
sortable: true,
dataIndex: 'MblNo',
header: '提单号',
width: 120
}, {
sortable: true,
dataIndex: 'EtDate',
header: '开船日期',
width: 80
}, {
sortable: true,
dataIndex: 'BillStatus',
header: '业务锁定状态',
renderer: function (value, p, record) { return value + '-' + record.data.BillStatus_Ref; },
width: 120
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: '费用锁定状态',
renderer: function (value, p, record) { return value + '-' + record.data.FeeStatus_Ref; },
width: 120
}, {
sortable: true,
dataIndex: 'DdCode_Ref',
header: '调度',
width: 80
}, {
sortable: true,
dataIndex: 'ContainerNo',
header: '箱号',
width: 80
}, {
sortable: true,
dataIndex: 'YardCode_Ref',
header: '拖箱场站',
width: 80
}, {
sortable: true,
dataIndex: 'DetiNation',
header: '工厂地址',
width: 100
}, {
sortable: true,
dataIndex: 'DGTYPE',
header: '危险品类型',
width: 80
}, {
sortable: true,
dataIndex: 'DGTYPECODE',
header: '危险品代码',
width: 80
}, {
sortable: true,
dataIndex: 'LoadPlace',
header: '起运地',
width: 80
}, {
sortable: true,
dataIndex: 'DstArea',
header: '目的地',
width: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: '备注',
width: 150
}, {
sortable: true,
dataIndex: 'Ton',
header: '货重(吨)',
width: 80
}
];
this.gridListCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
layout: "border",
//height: 150,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.gridListCheckBoxModel,
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
if (record.get('FeeStatus') == '1' || record.get('BillStatus') == '1')
return 'feestatus_tj';
return '';
}
},
columns:this.column,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
/////////////以下部分为获取存储的gridpanel显示样式
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column);
//使用者id表名 中间column数组
this.column.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.column);
//#endregion
//#region 固定费用明细表
//明细表表格相关
this.storeCreditDebitRef = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeCreditDebitRef.load({ params: { enumTypeId: 99020} });
this.comboxCreditDebitRef = Ext.create('DsExt.ux.RefEnumCombox', {
store: this.storeCreditDebitRef,
name: 'CreditDebit'
});
this.storeFeeTypeCodeRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.FeeTypeRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetFeeTypeRefList' }
});
this.storeFeeTypeCodeRef.load({ params: { condition: ""} });
this.comboxFeeTypeCodeRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeTypeCodeRef,
name: 'FeeTypeCode',
valueField: 'FeeCode',
displayField: 'CodeAndName'
});
//明细表-数据集
this.storeBodyFix = Ext.create('Ext.data.Store', {
model: 'MsWlFeeFixed',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsWlBsAudit/GetFixFeeDataList',
reader: {
id: 'BillNo,SerialNo',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//明细表表格
this.gridListFix = new Ext.grid.GridPanel({
store: this.storeBodyFix,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: [{
sortable: true,
dataIndex: 'BillNo',
header: '单据号',
hidden: true,
width: 120
}, {
sortable: true,
hidden: true,
dataIndex: 'SerialNo',
header: '序号',
width: 40
}, {
sortable: true,
dataIndex: 'FeeTypeCode',
header: '费用编码',
renderer: function (value, p, record) {
if (value == null || value == '')
return '';
else
return value + '-' + record.data.FeeTypeCode_Ref;
},
editor: this.comboxFeeTypeCodeRef,
width: 80
}, {
sortable: true,
dataIndex: 'FeeTypeName',
header: '费用名称',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'FsTotal',
header: '金额',
width: 60
}, {
sortable: true,
dataIndex: 'Remark',
header: '备注',
width: 150
}
]
});
//#endregion
//#region 费用表
//明细表表格相关
this.storeFeeTypeRef = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeFeeTypeRef.load({ params: { enumTypeId: 99020} });
this.comboxFeeTypeRef = Ext.create('DsExt.ux.RefEnumCombox', {
store: this.storeFeeTypeRef,
name: 'FeeType'
});
this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.FeeTypeRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetFeeTypeRefList' }
});
this.storeFeeNameRef.load({ params: { condition: ""} });
this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRef,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName'
});
this.storeCustomerNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustomerNameRef.load({ params: { condition: ""} });
this.comboxCustomerNameRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRef,
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//明细表-数据集
this.storeBodyChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsChFee/GetAuditDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//明细表表格
this.feeGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.cellEditingDrChFee = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.gridListChFee = new Ext.grid.GridPanel({
store: this.storeBodyChFee,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.feeGridCheckBoxModel,
plugins: [this.cellEditingDrChFee],
selType: 'cellmodel',
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
return DsTruck.MsChFeeGetRowClass(feeStatus);
}
},
tbar: [{
id:"btnFeeAuditPass",
text: '审核通过',
tooltip: '审核通过',
iconCls: "btnconfirm",
handler: function (button, event) {
this.onAuditPassClick(button, event);
},
scope: this
}, '-', {
id:"btnFeeAuditReject",
text: '驳回提交',
tooltip: '驳回提交',
iconCls: "btnrefuse",
handler: function (button, event) {
this.onAuditRefuseClick(button, event);
},
scope: this
}],
bbar: [
{ xtype: "label", id: "YS", text: "应收" }
, "-"
, { xtype: "label", id: "YF", text: " 应付" }
, "-"
, { xtype: "label", id: "LR", text: " 利润" }
],
columns: [{
sortable: true,
dataIndex: 'GId',
header: '惟一编号',
hidden: true,
width: 160
}, {
sortable: true,
dataIndex: 'BsNo',
header: '业务编号',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: '费用状态',
renderer: function (value, p, record) {
return record.data.FeeStatus_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeType',
header: '收付方式',
renderer: function (value, p, record) {
if (value == null || value == '')
return value;
else
return value + '-' + record.data.FeeType_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeName',
header: '费用名称',
width: 100
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: '费用英文名称',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'CustomerType',
header: '客户类别',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'CustomerName',
header: '结算对象',
width: 120
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: '单价',
width: 60
}, {
sortable: true,
dataIndex: 'Quantity',
header: '数量',
width: 60
}, {
sortable: true,
dataIndex: 'Amount',
header: '金额',
width: 60
}, {
sortable: true,
dataIndex: 'Currency',
header: '币别',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'Settlement',
header: '结算金额',
width: 60
}, {
sortable: true,
dataIndex: 'OrderAmount',
header: '申请金额',
width: 60
}, {
sortable: true,
dataIndex: 'Invoice',
header: '开票金额',
width: 60
}, {
sortable: true,
dataIndex: 'Remark',
header: '备注',
width: 150
}, {
sortable: true,
dataIndex: 'SubmitDate',
header: '提交时间',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'Auditoperator',
header: '审核人',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'AuditDate',
header: '审核时间',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'EnteroPerator',
header: '录入人',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'EnterDate',
header: '录入时间',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'AuditStatus',
header: '审核状态',
hidden: true,
width: 100
}
]
});
//#endregion
this.cellEditingDrChFee.on('beforeedit', function (editor, e) {
return this.cellEditingChFeeBeforeEdit(editor, e);
}, this);
//#region formSearch
//#region formSearch枚举参照相关
this.storeBillStatus = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBillStatus.load({ params: { enumTypeId: 99026} });
this.comboxBillStatus = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '业务锁定状态',
store: this.storeBillStatus,
name: 'BillStatus'
});
this.storeFeeStatus = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeFeeStatus.load({ params: { enumTypeId: 99027} });
this.comboxFeeStatus = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '费用锁定状态',
store: this.storeFeeStatus,
name: 'FeeStatus'
});
this.storeChFeeStatus = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeChFeeStatus.load({ params: { enumTypeId: 99024} });
this.comboxChFeeStatus = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '路单的费用状态',
store: this.storeChFeeStatus,
name: 'ChFeeStatus'
});
//#endregion
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '物流号',
name: 'BillNo'
}, this.comboxBillStatus, this.comboxFeeStatus,
{
fieldLabel: '委托单位',
name: 'CustName'
}, {
fieldLabel: '调度员姓名',
name: 'DispatchName'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: '提单号',
name: 'MblNo'
}, {
fieldLabel: '从委托派车日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'CustDate_Min'
}, {
fieldLabel: '至委托派车日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'CustDate_Max'
}, {
fieldLabel: '车牌号',
name: 'TruckNo',
flex:1
}, this.comboxChFeeStatus
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//#region 按钮ToolBar
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
},
'-',
{
id:"btnFeeLock",
text: "费用锁定",
iconCls: "btnsubmit",
handler: function (button, event) {
this.onFeeLockClick(button, event);
},
scope: this
},
{
id:"btnBillLock",
text: "单据锁定",
iconCls: "btnsubmit",
handler: function (button, event) {
this.onBillLockClick(button, event);
},
scope: this
},
'-',
{
text: "保存列表样式",
id: "btntest",
handler: function (button, event) {
var formname = this.formname;
var tempcolumns = this.gridList.columns;
DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column, 0, false);
},
scope: this
}
]
});
//#endregion
//#region 布局
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 100,
items: [this.formSearch, this.panelBtn]
});
this.panelYW = new Ext.Panel({
layout: "border",
region: "north",
height: 240,
split: true,
items: [this.gridList]
});
this.panelBodyFix = new Ext.Panel({
title: '固定费用(仅报销,不计入利润统计)',
layout: "border",
region: 'west',
width: 270,
margin: '5 10',
items: [this.gridListFix]
});
this.panelBodyChFee = new Ext.Panel({
title: '费用(计入利润统计的应收应付)',
layout: "border",
region: 'center',
margin: '5 10',
items: [this.gridListChFee]
});
this.panelFee = new Ext.Panel({
layout: "border",
region: "center",
items: [
this.panelBodyFix, this.panelBodyChFee
]
});
Ext.apply(this, {
items: [this.panelTop,this.panelYW, this.panelFee]
});
//#endregion
//#region 事件绑定
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.storeList.on('load', function (store, records) {
if (store.getCount() > 0) {
this.gridList.getSelectionModel().select(0);
//this.gridListCheckBoxModel.selectAll();
}
}, this);
var _this = this;
this.gridList.getSelectionModel().on('select', function (model, record, index) {
//alert(record.data.BillNo);
var gid = record.data.GId;
var billNo = record.data.BillNo;
var billType = record.data.BillType;
this.storeBodyChFee.load({
params: { billno: gid }
,
callback: function (options, success, response) {
_this.SetHJ();
}
});
this.storeBodyFix.load({ params: { billno: gid, billtype: billType} });
}, this);
//#endregion
//#region 自动刷新(已经提交但是尚未审核的业务,哪怕一票货中有一笔费用没审核也显示)
this.onAutoRefresh();
//#endregion
this.SetBtnRight();
}, //end initUIComponents
onAutoRefresh: function () {
var sql = ' GId in (select BsNo from ch_fee where FeeStatus=2 group by BsNo)';
this.storeList.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var billNo = form.findField('BillNo').getValue();
sql = sql + getAndConSql(sql, billNo, "BillNo like '%" + billNo + "%'");
var billStatus = form.findField('BillStatus').getValue();
sql = sql + getAndConSql(sql, billStatus, "BillStatus = '" + billStatus + "'");
var feeStatus = form.findField('FeeStatus').getValue();
sql = sql + getAndConSql(sql, feeStatus, "FeeStatus = '" + feeStatus + "'");
var custName = form.findField('CustName').getValue();
sql = sql + getAndConSql(sql, custName, " (CustName like '%" + custName + "%' or Customername like '%" + custName + "%' or F_Customername like '%" + custName + "%' )");
var dispatchName = form.findField('DispatchName').getValue();
sql = sql + getAndConSql(sql, dispatchName, "DispatchName like '%" + dispatchName + "%'");
var mblNo = form.findField('MblNo').getValue();
sql = sql + getAndConSql(sql, mblNo, "MblNo like '%" + mblNo + "%'");
var custDate_Min = form.findField('CustDate_Min').getRawValue();
sql = sql + getAndConSql(sql, custDate_Min, "CustDate >= '" + custDate_Min + "'");
var custDate_Max = form.findField('CustDate_Max').getRawValue();
sql = sql + getAndConSql(sql, custDate_Max, "CustDate <= '" + custDate_Max + " 23:59:59'");
var truckNo = form.findField('TruckNo').getValue();
sql = sql + getAndConSql(sql, truckNo, "TruckNo like '%" + truckNo + "%'");
var ChFeeStatus = form.findField('ChFeeStatus').getValue();
sql = sql + getAndConSql(sql, ChFeeStatus, " GId in (select BsNo from ch_fee where FeeStatus=" + ChFeeStatus + " group by BsNo)");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
return ret;
},
cellEditingChFeeBeforeEdit: function (editor, e) {
var chfeefeeStatus = e.record.get('FeeStatus');
var canedit = chfeefeeStatus == 1 || chfeefeeStatus == 6 ;
return canedit;
},
onAuditPassClick: function (button, event) {
var records = this.feeGridCheckBoxModel.selected.items;
DsTruck.MsChFeeAudit(records, 0, '正在审核数据, 请稍侯..');
},
onAuditRefuseClick: function (button, event) {
var records = this.feeGridCheckBoxModel.selected.items;
DsTruck.MsChFeeAudit(records, 6, '正在驳回提交数据, 请稍侯..');
},
onFeeLockClick: function (button, event) {
this.onLockClick('0', '1', '正在锁定费用数据', '费用锁定成功');
},
onBillLockClick: function (button, event) {
this.onLockClick('1', '1', '正在锁定单据数据', '单据锁定成功');
},
onLockClick: function (lockType, newStatus, waitMsg, successMsg) {
var records = this.gridListCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示',
msg: '请首先选择业务单据',
icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK
});
return;
}
var hasFuelQtyZero = false;
for (var i = 0; i < records.length; i++)
{
var rec = records[i];
if(rec.data.BillType == '1' && rec.data.FuelQty == 0)
{
hasFuelQtyZero = true;
break;
}
}
if(hasFuelQtyZero)
{
Ext.MessageBox.confirm('提示', '存在尚未录入加油量的派车单,是否继续?',
function (btn) {
if (btn == 'yes')
{
this.lock(records,lockType, newStatus, waitMsg, successMsg);
}
},this
);
}
else
{
this.lock(records,lockType, newStatus, waitMsg, successMsg);
}
},
lock: function (records,lockType, newStatus, waitMsg, successMsg)
{
var jsondata = ConvertRecordsToJsonAll(records);
Ext.Msg.wait(waitMsg);
Ext.Ajax.request({
waitMsg: waitMsg,
url: '/TruckMng/MsWlBsAudit/Lock',
scope: this,
params: {
jsonbilllist: jsondata,
lockType: lockType,
newStatus: newStatus
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var statusFieldName = jsonresult.Data;
var newStatusRef = '未锁定';
if (newStatus == '1')
newStatusRef = '已锁定';
for (var i = 0; i < records.length; i++) {
var record = records[i];
record.set(statusFieldName, newStatus);
record.set(statusFieldName + '_Ref', newStatusRef);
record.commit();
}
Ext.Msg.show({ title: '提示',
msg: successMsg,
icon: Ext.Msg.INFO, buttons: Ext.Msg.OK
});
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
SetBtnRight: function() {
var btnFeeLock = Ext.getCmp('btnFeeLock');
var btnBillLock = Ext.getCmp('btnBillLock');
var btnFeeAuditPass = Ext.getCmp('btnFeeAuditPass');
var btnFeeAuditReject = Ext.getCmp('btnFeeAuditReject');
Ext.Msg.wait('正在设置按钮权限');
Ext.Ajax.request({
waitMsg: '正在设置按钮权限',
url: '/CommMng/PubSys/GetUserRightRange',
scope: this,
params: {
rangeValues: 'modTruckFee_Lock;modTruckFee_Audit;modTruckFee_Reject'
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var rightList = jsonresult.Data;
var length = rightList.length;
for (var i = 0; i < length; i++) {
var right = rightList[i];
if ('modTruckFee_Lock' == right.RightName) {
this.setBtnRightEnabled(btnFeeLock, right.HasRight);
this.setBtnRightEnabled(btnBillLock, right.HasRight);
}
else if ('modTruckFee_Audit' == right.RightName)
{
this.setBtnRightEnabled(btnFeeAuditPass, right.HasRight);
}else if ('btnFeeAuditReject' == right.RightName)
{
this.setBtnRightEnabled(btnFeeAuditReject, right.HasRight);
}
}
var ss = '1';
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
setBtnRightEnabled: function (btn, enbaled) {
// alert(enbaled);
if (enbaled) {
btn.enable();
} else {
btn.disable();
}
},
SetHJ: function () {
var YS = 0;
var YF = 0;
var LR = 0;
for (i = 0; i < this.storeBodyChFee.getCount(); i += 1) {
var memberyf = this.storeBodyChFee.getAt(i);
var amount = memberyf.data.Amount;
if (memberyf.data.FeeType == "1") {
YS = Add(YS, amount);
}
if (memberyf.data.FeeType == "2") {
YF = Add(YF, amount);
}
};
LR = Cut(YS, YF);
Ext.getCmp("YS").setText("应收: " + YS);
Ext.getCmp("YF").setText(" 应付: " + YF);
Ext.getCmp("LR").setText(" 利润: " + LR);
},
});