Ext.namespace('DsTruck');
DsTruck.CWAuditIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.CWAuditIndex.superclass.constructor.call(this);
};
Ext.extend(DsTruck.CWAuditIndex, Ext.Panel, {
PageSize: 500,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
ContractNo: "",
initUIComponents: function () {
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'XXHmb',
remoteSort: true,
pageSize: this.PageSize,
proxy: {
type: 'ajax',
url: '/Import/CWAudit/GetAuditDataList',
reader: {
idProperty: 'id' + 'cgid',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.formname = "CWAudit";
//枚举参照
this.storeport = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeport.load({ params: { enumTypeId: 10} });
this.comboxport = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '目的港',
store: this.storeport,
id: "comboxport",
name: 'port',
labelWidth: 50,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeMainstate = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeMainstate.load({ params: { enumTypeId: 3} });
this.comboxMainstate = Ext.create('Ext.ux.form.field.BoxSelect', {
fieldLabel: '合同状态',
autosize: true,
bodyPadding: 5,
flex: 2,
width: 500,
labelWidth: 90,
store: this.storeMainstate,
queryMode: 'local',
triggerOnClick: false,
valueField: 'EnumValueId',
displayField: 'EnumValueName'
});
//表参照
this.storeCountry = Ext.create('DsExt.ux.RefTableStore', {
model: 'ConutryRef',
proxy: { url: '/CommMng/BasicDataRef/GetCountryRefList' }
});
this.storeCountry.load({ params: { condition: ""} });
this.comboxCountry = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '进口国',
store: this.storeCountry,
name: 'countryid',
valueField: 'countryid',
displayField: 'country_idandname'
});
this.storeCargoinfo = Ext.create('DsExt.ux.RefTableStore', {
model: 'CargoRef',
proxy: { url: '/CommMng/BasicDataRef/GetCargoRefList' }
});
this.storeCargoinfo.load({ params: { condition: ""} });
this.comboxCargoinfo = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: 'HS代码',
store: this.storeCargoinfo,
name: 'Cargoinfo_id',
valueField: 'id',
displayField: 'codeandname'
//HS代码
});
this.storeBuyer = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeBuyer.load({ params: { condition: " isagentcn=1 "} });
this.comboxBuyer = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户',
store: this.storeBuyer,
name: 'buyer',
valueField: 'CustName',
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', {
fieldLabel: '结算对象',
store: this.storeCustomerNameRef,
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.storeCargociq = Ext.create('DsExt.ux.RefTableStore', {
model: 'CargociqRef',
proxy: { url: '/CommMng/BasicDataRef/GetCargociqRefList' }
});
this.storeCargociq.load({ params: { condition: ""} });
this.comboxCargociq = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: 'ciq代码',
store: this.storeCargociq,
name: 'Cargociq_id',
valueField: 'id',
displayField: 'codeandname'
//ciq代码
});
this.storeCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'companymb',
proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' }
});
this.storeCompany.load({ params: { condition: ""} });
this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '用证公司',
store: this.storeCompany,
name: 'company',
valueField: 'gid',
displayField: 'name'
});
this.storeRemind = Ext.create('DsExt.ux.RefTableStore', {
model: 'remind',
proxy: { url: '/CommMng/BasicDataRef/Getimportremind' }
});
this.storeRemind.load({ params: { condition: ""} });
this.comboxRemind = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务提醒',
store: this.storeRemind,
name: 'Remind',
valueField: 'RemindSql',
displayField: 'RemindName',
triggerAction: 'all',
selectOnFocus: true,
listeners: {
change: function (field, newValue, oldValue) {
this.onGetremind(field, newValue, oldValue);
},
scope: this
}
});
this.storeWriteoffs = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeWriteoffs.load({ params: { enumTypeId: 0} });
this.comboxWriteoffs = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '核销完成',
store: this.storeWriteoffs,
name: 'Writeoffs'
});
this.storeFeetype = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeFeetype.load({ params: { enumTypeId: 22} });
this.comboxFeetype = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '收付方向',
store: this.storeFeetype,
name: 'Feetype'
});
this.storeFeeName = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.FeeTypeRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetFeeTypeRefList' }
});
this.storeFeeName.load({ params: { condition: ""} });
this.comboxFeeName = Ext.create('Ext.ux.form.field.BoxSelect', {
fieldLabel: '费用名称',
//renderTo: 'basicBoxselect',height:60,pinList: false,
//autoHeight:true,width: 500,stacked: true,
autosize: true,
bodyPadding: 7,
flex: 2,
labelWidth: 90,
store: this.storeFeeName,
queryMode: 'local',
triggerOnClick: false,
valueField: 'Name',
displayField: 'CodeAndName'
});
this.column = [{
sortable: true,
dataIndex: 'seller',
header: '贸易商',
width: 80
}, {
sortable: true,
dataIndex: 'buyer',
header: '购货方',
width: 80
}, {
sortable: true,
dataIndex: 'ContractNo',
header: '合同序列号',
width: 120
}, {
sortable: true,
dataIndex: 'HTH',
header: '合同号',
width: 80
}, {
sortable: true,
dataIndex: 'country',
header: '进口国',
width: 80
}, {
sortable: true,
dataIndex: 'countryid',
header: 'countryid',
hidden: true,
width: 80
}, {
sortable: true,
dataIndex: 'portRef',
header: '目的港',
width: 80
}, {
sortable: true,
dataIndex: 'companyname',
header: '用证公司',
width: 80
}, {
sortable: true,
dataIndex: 'name',
header: '货物名称',
width: 80
}, {
sortable: true,
dataIndex: 'MainstateRef',
header: '合同状态',
width: 80
}, {
sortable: true,
dataIndex: 'ArrivalDate',
header: '到港日',
width: 80
}, {
sortable: true,
dataIndex: 'tax_date',
header: '出税日期',
width: 80
}, {
sortable: true,
dataIndex: 'tax_paydate',
header: '付税日期',
width: 80
}, {
sortable: true, dataIndex: 'id', header: 'id', hidden: true
},
{
dataIndex: 'TimeMark', header: 'TimeMark', hidden: true
},
{
sortable: true,
dataIndex: 'cgid',
header: 'cgid',
hidden: true,
width: 80
}, {
sortable: true,
dataIndex: 'BillNo',
header: '提单号',
width: 80
},
{
sortable: true,
dataIndex: 'ContainerNo',
header: '箱号',
width: 80
},
{
sortable: true,
dataIndex: 'SealNo',
header: '铅封号',
width: 80
},
{
sortable: true,
dataIndex: 'Maoli',
header: '毛利润',
width: 80
},
{
sortable: true,
dataIndex: 'FHPROFIT',
header: '付汇利润',
width: 80
},
{
sortable: true,
dataIndex: 'LCPROFIT',
header: '冷藏利润',
width: 80
},{
sortable: true,
dataIndex: 'OTPROFIT',
header: '代理利润',
width: 80
}, {
sortable: true,
dataIndex: 'HK_profit',
header: '货款利润',
width: 80
}, {
sortable: true,
dataIndex: 'RZ_profit',
header: '融资款利润',
width: 80
}
];
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 50
});
//定义Grid
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var Mainstate = record.get('Mainstate');
return DsTruck.CWAuditGetRowClass(Mainstate);
}
},
columns: [new Ext.grid.RowNumberer()],
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
/////////////以下部分为获取存储的gridpanel显示样式
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column);
this.column.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.column);
////////////////////////////
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.BSNO = record.data.ContractNo;
this.OprationStatus = 'view';
DsOpenEditWin('/Import/PortOperate/Edit', this.BSNO, "750", "1000");
}, this);
//#region formSearch
//#region formSearch枚举参照相关
//#endregion
this.formSearch = Ext.widget('form', {
frame: true,
region: 'north',
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: 'ContractNo',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},
this.comboxCompany,
this.comboxCountry,
{
fieldLabel: '贸易商',
name: 'seller',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '备注中包含',
name: 'remark',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}]
}]
}, //end items(fieldset 1)
{//fieldset 2
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
//this.comboxCargoinfo,
//this.comboxCargociq//, this.comboxCountry
]
}]
}, //end fieldset 2
{//fieldset 3
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxBuyer,
this.comboxCustomerNameRef,
this.comboxMainstate,
this.comboxRemind]
}]
}, //end items(fieldset 3)
{//fieldset 4
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '提单号',
name: 'BillNo',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '箱号',
name: 'ContainerNo',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '申请单号/结算单号',
name: 'DH',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '从..到港日',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ArrivalDate_min',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到..到港日',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ArrivalDate_max',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}]
}]
}, //end items(fieldset 4)
{//fieldset 5
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: '从..会计期间',
xtype: 'monthfield',
name: 'ACCDATE_min', flex: 1,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到..会计期间',
xtype: 'monthfield',
name: 'ACCDATE_max', flex: 1,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},this.comboxFeetype
,this.comboxFeeName,
{
fieldLabel: 'hiddenfield',
xtype: 'hiddenfield',
name: 'hidden3',flex:0
}
]
}]
} //end items(fieldset 5)
]//end root items
});
//#endregion formSearch
//费用列表
//#region 费用表
//#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.storecurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'currRef',
proxy: { url: '/CommMng/BasicDataRef/GetcurrRefList' }
});
this.storecurr.load({ params: { condition: ""} });
this.comboxcurr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storecurr,
name: 'currid',
valueField: 'codename',
displayField: 'codename'
//币别
});
Ext.define('DeductibleMd', {
extend: 'Ext.data.Model',
fields: [
{ name: 'IsOpen', type: 'string' },
{ name: 'IsOpen_Ref', type: 'string' }
]
});
var IsOpenData = [{ "IsOpen": "0", "IsOpen_Ref": "否" },
{ "IsOpen": "1", "IsOpen_Ref": "是"}];
this.storeIsOpenType = Ext.create('Ext.data.Store', {
model: 'DeductibleMd',
data: IsOpenData
});
this.comboxIsOpen = Ext.create('DsExt.ux.RefEnumCombox', {
//fieldLabel: '是否机密费用',
forceSelection: true,
readOnly:false,
store: this.storeIsOpenType,
name: 'IsOpen',
valueField: 'IsOpen',
displayField: 'IsOpen_Ref'
});
//#endregion
//明细表-数据集
this.storeBodyChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/Import/XXH/GetFeeList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeBodyChFee_YF = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/Import/XXH/GetFeeList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//明细表表格
this.cellEditingChFee = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.feeGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
this.gridListChFee = new Ext.grid.GridPanel({
store: this.storeBodyChFee,
enableHdMenu: false,
region: 'center',
//height: 600,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.cellEditingChFee],
selModel: this.feeGridCheckBoxModel,
selType: 'cellmodel',
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
return DsTruck.MsChFeeGetRowClass(feeStatus);
}
},
tbar: [{ xtype: 'label', id: 'label2', text: "应收费用" }, {
id: "btnSave",
text: '全部保存更改',
tooltip: '保存更改',
iconCls: "btnsave",
handler: function (button, event) {
this.Save();
//alert(USERID);
},
scope: this
}, '-', {
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
}, { xtype: "label", id: "zongshu", text: "",
handler: function () { ; }
}
],
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: 75
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: '费用英文名称',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'CustomerType',
header: '客户类别',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'CustomerName',
header: '结算对象',
width: 100
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: '单价',
editor: {
xtype: 'numberfield',
selectOnFocus: true
},
width: 85,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Quantity',
header: '数量(税率)',
width: 60
}, {
sortable: true,
dataIndex: 'Amount',
header: '金额',
width: 85,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Currency',
header: '币别',
editor: this.comboxcurr,
width: 60
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: '汇率',
editor: {
xtype: 'textfield',
selectOnFocus: true
},
width: 60
}, {
sortable: true,
dataIndex: 'SettlementDate',
header: '结算情况',
width: 150
}, {
sortable: true,
dataIndex: 'Remark',
header: '备注',
editor: {
xtype: 'textfield',
selectOnFocus: true
},
width: 150
}, {
sortable: true,
dataIndex: 'CARGO_GID',
header: '对应商品信息',
//editor: this.comboxCargo_CHFEE,
width: 120,
renderer: function (value, p, record) {
return record.data.CARGO_NAME;
}
}, {
sortable: true, hidden: true,
dataIndex: 'CARGO_NAME',
header: 'CARGO_NAME'
}, {
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
}, {
sortable: true,
dataIndex: 'ACCDATE',
header: '会计期间',
//hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'VOUCHERNO',
header: '凭证号',
//hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'IsOpen',
header: '是否机密费用',
editor: this.comboxIsOpen,
width: 80,
renderer: function (value, p, record) {
return record.data.IsOpen_Ref;
}
}, {
sortable: true, hidden: true,
dataIndex: 'IsOpen_Ref',
header: 'IsOpen_Ref'
}
]
});
/////--//////
this.cellEditingChFee_YF = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.feeGridCheckBoxModel_YF = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
this.gridListChFee_YF = new Ext.grid.GridPanel({
store: this.storeBodyChFee_YF,
enableHdMenu: false,
region: 'center',
//height: 600,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.cellEditingChFee_YF],
selModel: this.feeGridCheckBoxModel_YF,
selType: 'cellmodel',
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
return DsTruck.MsChFeeGetRowClass(feeStatus);
}
},
tbar: [{ xtype: 'label', id: 'label1', text: "应付费用", height: 22 },
{ xtype: "label", id: "zongshu_YF", text: "",
handler: function () { ; }
}
],
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: 75
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: '费用英文名称',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'CustomerType',
header: '客户类别',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'CustomerName',
header: '结算对象',
width: 100
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: '单价',
editor: {
xtype: 'numberfield',
selectOnFocus: true
},
width: 85,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Quantity',
header: '数量(税率)',
width: 60
}, {
sortable: true,
dataIndex: 'Amount',
header: '金额',
width: 85,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Currency',
header: '币别',
editor: this.comboxcurr,
width: 60
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: '汇率',
editor: {
xtype: 'textfield',
selectOnFocus: true
},
width: 60
}, {
sortable: true,
dataIndex: 'SettlementDate',
header: '结算情况',
width: 150
}, {
sortable: true,
dataIndex: 'Remark',
header: '备注',
editor: {
xtype: 'textfield',
selectOnFocus: true
},
width: 150
}, {
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
}, {
sortable: true,
dataIndex: 'ACCDATE',
header: '会计期间',
//hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'VOUCHERNO',
header: '凭证号',
//hidden: true,
width: 100
}, {
sortable: true,
dataIndex: 'IsOpen',
header: '是否机密费用',
editor: this.comboxIsOpen,
width: 80,
renderer: function (value, p, record) {
return record.data.IsOpen_Ref;
}
}, {
sortable: true, hidden: true,
dataIndex: 'IsOpen_Ref',
header: 'IsOpen_Ref'
}
]
});
//费用列表 over
_this = this;
this.CBMSearch = new Ext.form.Checkbox({
fieldLabel: '高级查询',
listeners: {
change: function (newValue, oldValue, eOpts)//change事件
{
//alert(newValue.checked);
if (newValue.checked) {
_this.panelSearch.show();
} else {
_this.panelSearch.hide();
}
}
}
});
/*
var Locked = [
{ "id": '0', "name": "未审核" },
{ "id": '1', "name": "包含已审核"}];
this.StoreLocked = Ext.create('Ext.data.Store', {
model: 'CMBmb',
data: Locked
});
this.comboxLocked = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '是否财务锁定',
store: this.StoreLocked,
name: 'ContractStatus',
valueField: 'id',
displayField: 'name',
id: "ContractStatus",
value:'0'
});*/
this.CheckUnpassed = new Ext.form.Checkbox({
fieldLabel: '显示待审核', flex: 1,
id: "CheckUnpassed"
});
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
},
{
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
},
scope: this
}, {
text: "保存列表样式",
id: "btntest",
handler: function (button, event) {
//this.column = DsTruck.SaveGridPanel(USERID, this.formname, this.gridList.columns, this.column, 1, false);
var tempcolumns = this.gridList.columns;
DsTruck.SaveGridPanel(USERID, this.formname, tempcolumns, this.column, 1, false);
},
scope: this
}, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', this.CBMSearch, '-', { id: "S_HTH",
fieldLabel: "合同号/提单号/箱号",
labelWidth: 115,
xtype: 'textfield',
name: 'HTH',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxport, this.CheckUnpassed
]
});
////////--------显示毛利 begin
this.formML = Ext.widget('form', { // layout: "border",
region: 'south',
frame: true,
bodyPadding: 2,
fieldDefaults: {
margins: '1 1 1 1',
labelAlign: 'right',
flex: 5,
//labelWidth: 90,//label标签宽度
msgTarget: 'qtip',
sourcelabelWidth: '100'
},
tbar: [
{
text: "账单审核通过", id: "ZDPASS",
iconCls: "btncomm",
handler: function (button, event) {
this.onPassClick(button, event);
},
scope: this
}, {
text: "合同完成",
iconCls: "btnconfirm", id: "ContractOver",
handler: function (button, event) {
this.onOverClick(button, event);
},
scope: this
}],
items: [
{ //fieldset 1
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{ //1
//container_1
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{//0
fieldLabel: '人民币应收',
// allowBlank: false,
readOnly: true,
name: 'RMBYS'
}, {
fieldLabel: '人民币应付',
// allowBlank: false,
readOnly: true,
name: 'RMBYF'
}, {
fieldLabel: '人民币毛利',
// allowBlank: false,
readOnly: true,
name: 'RMBML'
}]//0
},
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '美元应收',
// allowBlank: false,
readOnly: true,
name: 'USDYS'
}, {
fieldLabel: '美元应付',
// allowBlank: false,
readOnly: true,
name: 'USDYF'
}, {
fieldLabel: '美元毛利',
// allowBlank: false,
readOnly: true,
name: 'USDML'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
/*
{
fieldLabel: '付汇利润',
// allowBlank: false,
disabled: true,
name: 'FHPROFIT'
}, {
fieldLabel: '冷藏利润',
// allowBlank: false,
disabled: true,
name: 'LCPROFIT'
}, {
fieldLabel: '代理利润',
// allowBlank: false,
disabled: true,
name: 'OTPROFIT'
},
*/
{
fieldLabel: '毛利',
// allowBlank: false,
readOnly: true,
name: 'ML'
}]
}
]//container_1 //1
}//fieldset 1
]
}); //end this.formEdit
////////--------显示毛利 end
this.InitData();
//集中绑定事件
this.gridListChFee.on('edit', function (editor, e, eOpts) {
this.gridListChFeeAfterEdit(editor, e, eOpts);
}, this);
this.gridListChFee_YF.on('edit', function (editor, e, eOpts) {
this.gridListChFeeAfterEdit(editor, e, eOpts);
}, this);
this.cellEditingChFee.on('beforeedit', function (editor, e) {
//Ext.getCmp("zongshu").setText("1234");
return this.cellEditingChFeeBeforeEdit(editor, e);
}, this);
this.cellEditingChFee_YF.on('beforeedit', function (editor, e) {
//Ext.getCmp("zongshu").setText("1234");
return this.cellEditingChFeeBeforeEdit(editor, e);
}, this);
this.gridListChFee.getSelectionModel().on('select', function (button, event) {
//Ext.getCmp("zongshu").setText("1234");
this.onSelectFee(button, event);
}, this);
this.gridListChFee_YF.getSelectionModel().on('select', function (button, event) {
//Ext.getCmp("zongshu").setText("1234");
this.onSelectFee(button, event);
}, this);
this.gridListChFee.on('cellclick', function (button, event) {
//Ext.getCmp("zongshu").setText("1234");
this.onSelectFee(button, event);
}, this);
this.gridListChFee_YF.on('cellclick', function (button, event) {
//Ext.getCmp("zongshu").setText("1234");
this.onSelectFee(button, event);
}, this);
//选择load
this.gridList.getSelectionModel().on('select', function (model, record, index) {
this.ContractNo = record.data.ContractNo;
//this.storeBodyChFee.load({ params: { billno: ContractNo} });
this.storeBodyChFee.load({ params: { billno: this.ContractNo, Feetype: '1'} });
this.storeBodyChFee_YF.load({ params: { billno: this.ContractNo, Feetype: '2'} });
Ext.Ajax.request({
waitMsg: '正在查询毛利数据...',
url: '/Import/XXH/GetML',
params: {
contractno: this.ContractNo
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
var data = result.data;
this.formML.getForm().setValues(data);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
}); //request over
}, this);
//布局
this.panelChFee_YS = new Ext.Panel({
layout: "border",
region: 'west',
margin: '0 0',
//height: 450,
width: 530,
split: true,
items: [this.gridListChFee]
});
this.panelChFee_YF = new Ext.Panel({
// title: '货物信息和许可证使用',
layout: "border",
region: 'center',
margin: '0 0',
//height: 450,
width: 450,
split: true,
items: [this.gridListChFee_YF]
});
this.panelChFee = new Ext.Panel({
//
layout: "border",
region: 'south',
margin: '0 0',
height: 260, //width: 450,
split: true,
items: [this.panelChFee_YS, this.panelChFee_YF]
});
/*
this.panelgridList = new Ext.Panel({
//
layout: "border",
region: 'north',
margin: '0 0',
//height: 200, //width: 450,
split: true,
items: [this.gridList]
});*/
this.panelContract = new Ext.Panel({
//title: '',
layout: "border",
region: 'center',
//height: 550,
margin: '1 2',
split: true,
items: [this.gridList, this.panelChFee, this.formML]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 30,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 130, hidden: true,
items: [this.formSearch]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.panelContract]
});
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
}, //end initUIComponents
InitData: function () {
Ext.Ajax.request({
waitMsg: '正在查询用户权限...',
url: '/CommMng/BasicDataRef/GetAuthorityRange',
params: {
modName: "modXXH_CWAudit",
USERID: USERID
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
rec = result.data;
//alert(rec.VISIBLERANGE);
//alert(rec.OPERATERANGE);
//可操作为0则全都可见,1可以审核可以通过可以修改无法完成,2无法审核无法通过无法修改可以完成
var VISIBLERANGE = rec.VISIBLERANGE;
if (VISIBLERANGE == '0') {
Ext.getCmp("btnFeeAuditPass").enable();
Ext.getCmp("btnFeeAuditReject").enable();
Ext.getCmp("btnSave").enable();
Ext.getCmp("ZDPASS").enable();
Ext.getCmp("ContractOver").enable();
} else
if (VISIBLERANGE == '1') {
Ext.getCmp("btnFeeAuditPass").enable();
Ext.getCmp("btnFeeAuditReject").enable();
Ext.getCmp("btnSave").enable();
Ext.getCmp("ZDPASS").enable();
Ext.getCmp("ContractOver").disable();
} else
if (VISIBLERANGE == '2') {
Ext.getCmp("btnFeeAuditPass").disable();
Ext.getCmp("btnFeeAuditReject").disable();
Ext.getCmp("btnSave").disable();
Ext.getCmp("ZDPASS").disable();
Ext.getCmp("ContractOver").enable();
} else {
Ext.getCmp("btnFeeAuditPass").disable();
Ext.getCmp("btnFeeAuditReject").disable();
Ext.getCmp("btnSave").disable();
Ext.getCmp("ZDPASS").disable();
Ext.getCmp("ContractOver").disable();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
}); //request over
}, //end InitData
cellEditingFixBeforeEdit: function (editor, e) {
var feeStatus = this.getFeeStatus();
var billStatus = this.getBillStatus();
var canedit = feeStatus == '0' && billStatus == '0';
return canedit;
},
cellEditingChFeeBeforeEdit: function (editor, e) {
var chfeefeeStatus = e.record.get('FeeStatus');
var canedit = chfeefeeStatus == 1 || chfeefeeStatus == 2; //|| chfeefeeStatus == 6;
//alert(canedit);
return canedit;
},
onSelectFee: function (button, event) {
//Ext.getCmp("zongshu").setText("1234");
var selectedRecords = this.gridListChFee.selModel.getSelection();
var sum = 0;
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
sum = sum + rec.get("Amount");
}
sum = sum.toFixed(2);
Ext.getCmp("zongshu").setText(" 选中金额:" + sum);
var selectedRecords_YF = this.gridListChFee_YF.selModel.getSelection();
var sum_YF = 0;
for (var i = 0; i < selectedRecords_YF.length; i++) {
var rec = selectedRecords_YF[i];
sum_YF = sum_YF + rec.get("Amount");
}
sum_YF = sum_YF.toFixed(2);
Ext.getCmp("zongshu_YF").setText(" 选中金额:" + sum_YF);
},
gridListChFeeAfterEdit: function (editor, e, eOpts) {
if (e.field == 'ExChangerate' || e.field == 'UnitPrice') {
var unitPrice = e.record.data['UnitPrice'];
var quantity = e.record.data['Quantity'];
//var ExChangerate = e.record.data['ExChangerate'];
e.record.set('Amount', (unitPrice * quantity /** ExChangerate*/).toFixed(2));
}
if (e.field == 'Currency') {
//var ExChangerate = parseFloat(e.record.get('ExChangerate'));
if (e.record.get('Currency') == 'RMB') {
e.record.set('ExChangerate', '1');
}
}
},
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onPassClick: function (button, event) {
this.onSetStatus("6")
},
onOverClick: function (button, event) {
this.onSetStatus("7")
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/Import/XXH/Delete',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.remove(record);
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}, //onDeleteClick
onSetStatus: function (Status) {
Ext.Ajax.request({//
waitMsg: '正在初始化库存数据...',
url: '/Import/XXH/SetStatus',
params: {
ContractNo: this.ContractNo,
NewMainstate: Status
},
callback: function (options, success, response) {
if (success) {
if (response.responseText == "1") {
alert("成功");
//------------------
/*
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: 500, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});*/
//------------------
} else
{ alert("失败"); }
}
},
scope: this
}); //request over
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = ' M.ISDELETE=0 and M.contractno in(select distinct bsno from ch_fee where feestatus<>1 ) ';
var HTH = Ext.getCmp("S_HTH").getValue();
sql = sql + getAndConSql(sql, HTH, "(M.HTH like '%" + HTH + "%' or M.billno like '%"+HTH+"%' or M.containerno like '%"+HTH+"%')");
var _CS = Ext.getCmp('CheckUnpassed').checked;
if (_CS == true) {
sql = sql + getAndConSql(sql, '1111', "(M.ContractNo in (select distinct bsno from ch_fee where feestatus=2))");
} else {
}
//var HTH = form.findField('HTH').getValue();
//sql = sql + getAndConSql(sql, HTH, "M.HTH like '%" + HTH + "%'");
var ContractNo = form.findField('ContractNo').getValue();
sql = sql + getAndConSql(sql, ContractNo, "M.ContractNo like '%" + ContractNo + "%'");
var company = form.findField('company').getValue();
sql = sql + getAndConSql(sql, company, "M.company = '" + company + "'");
var countryid = form.findField('countryid').getValue();
sql = sql + getAndConSql(sql, countryid, "m.countryid like '%" + countryid + "%'");
//var port = form.findField('port').getValue();
//sql = sql + getAndConSql(sql, port, "m.port = " + port + "");
var port = Ext.getCmp("comboxport").getValue();
sql = sql + getAndConSql(sql, port, "m.port = " + port + "");
/*
var Cargoinfo_id = form.findField('Cargoinfo_id').getValue();
//alert(Cargoinfo_id);
sql = sql + getAndConSql(sql, Cargoinfo_id, "cg.Cargoinfo_id = " + Cargoinfo_id + "");
var Cargociq_id = form.findField('Cargociq_id').getValue();
//alert(Cargociq_id);
sql = sql + getAndConSql(sql, Cargociq_id, "cg.Cargociq_id = " + Cargociq_id + "");
*/
var Mainstate = this.comboxMainstate.getValue();
if (Mainstate != "") {
sql = sql + getAndConSql(sql, Mainstate, "m.Mainstate in (" + Mainstate + ")");
}
var seller = form.findField('seller').getRawValue();
sql = sql + getAndConSql(sql, seller, "M.seller like '%" + seller + "%'");
var buyer = form.findField('buyer').getValue();
sql = sql + getAndConSql(sql, buyer, "M.buyer like '%" + buyer + "%'");
var CustomerName = form.findField('CustomerName').getValue();
sql = sql + getAndConSql(sql, CustomerName, "M.contractno in(select bsno from ch_fee where customername like '%" + CustomerName + "%')");
var BillNo = form.findField('BillNo').getRawValue();
sql = sql + getAndConSql(sql, BillNo, "m.BillNo like '%" + BillNo + "%'");
var ContainerNo = form.findField('ContainerNo').getRawValue();
sql = sql + getAndConSql(sql, ContainerNo, "m.ContainerNo like '%" + ContainerNo + "%'");
var DH = form.findField('DH').getValue(); //结算单号/申请单号
sql = sql + getAndConSql(sql, DH, "M.Contractno in ( select distinct BSNO from ch_fee_do where billno like '%" + DH + "%')");
var remark = form.findField('remark').getValue();
sql = sql + getAndConSql(sql, remark, "m.remark like '%" + remark + "%'");
var Remind = form.findField('Remind').getValue();
sql = sql + getAndConSql(sql, Remind, Remind);
var ArrivalDate_min = form.findField('ArrivalDate_min').getRawValue();
sql = sql + getAndConSql(sql, ArrivalDate_min, "m.ArrivalDate >= '" + ArrivalDate_min + "'");
var ArrivalDate_max = form.findField('ArrivalDate_max').getRawValue();
sql = sql + getAndConSql(sql, ArrivalDate_max, "m.ArrivalDate <= '" + ArrivalDate_max + " 23:59:59'");
var ACCDATE_min = form.findField('ACCDATE_min').getRawValue();
sql = sql + getAndConSql(sql, ACCDATE_min, " M.contractno in(select distinct bsno from ch_fee where ACCDATE >= '" + ACCDATE_min + "')");
var ACCDATE_max = form.findField('ACCDATE_max').getRawValue();
sql = sql + getAndConSql(sql, ACCDATE_max, " M.contractno in(select distinct bsno from ch_fee where ACCDATE <= '" + ACCDATE_max + "')");
var _CS = Ext.getCmp('CheckUnpassed').checked;
if (_CS == true) {
var Feetype = form.findField('Feetype').getValue();
sql = sql + getAndConSql(sql, Feetype, " M.contractno in(select distinct bsno from ch_fee where feetype = " + Feetype + " and feestatus=2)");
} else {
}
var _CS = Ext.getCmp('CheckUnpassed').checked;
if (_CS == true) {
var FeeName = this.getStrValue(this.comboxFeeName.getValue());
sql = sql + getAndConSql(sql, FeeName, "M.contractno in(select distinct bsno from ch_fee where FeeName in (" + FeeName + ") and feestatus=2)");
} else {
}
return sql;
},
getStrValue: function (list) {
var _list = [];
for (var _i = 0; _i < list.length; _i++) {
_list.push("'" + list[_i] + "'");
}
return _list;
},
onGetremind: function (field, newValue, oldValue) {
if (newValue != null) {
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: newValue },
waitMsg: "正在查询数据...",
scope: this
});
}
},
OprationSwap: function () {
var ret = new Array();
ret[0] = 'view';
ret[1] = this.BSNO;
//ret[2] = this.SelectedRecord;
return ret;
},
// alert(this.OprationStatus.ToString());
// alert(this.storeList.toString());
// alert(this.SelectedRecord.toString());
onAuditPassClick: function (button, event) {
//审核通过时标记审核人AUDITOR
var records = this.feeGridCheckBoxModel.selected.items;
//for each
if (records.length > 0) {
DsTruck.MsChFeeAudit(records, 0, '正在审核数据, 请稍侯..', USERID,"True");
}
var records = this.feeGridCheckBoxModel_YF.selected.items;
if (records.length > 0) {
DsTruck.MsChFeeAudit(records, 0, '正在审核数据, 请稍侯..', USERID, "True");
}
},
onAuditRefuseClick: function (button, event) {
var records = this.feeGridCheckBoxModel.selected.items;
if (records.length > 0) {
DsTruck.MsChFeeAudit(records, 6, '正在审核数据, 请稍侯..', USERID, "True");
}
var records = this.feeGridCheckBoxModel_YF.selected.items;
if (records.length > 0) {
DsTruck.MsChFeeAudit(records, 6, '正在审核数据, 请稍侯..', USERID, "True");
}
}, //驳回提交
Save: function (type) {
//费用
var bodyChFeeDatas = [];
for (i = 0; i < this.storeBodyChFee.getCount(); i += 1) {
var memberyf = this.storeBodyChFee.getAt(i);
bodyChFeeDatas.push(memberyf);
var amount = memberyf.data.Amount;
if (amount == 0) {
Ext.Msg.show({ title: '警告',
msg: '费用的金额不允许为0,请修改后再保存',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
return;
}
};
for (i = 0; i < this.storeBodyChFee_YF.getCount(); i += 1) {
var memberyf = this.storeBodyChFee_YF.getAt(i);
bodyChFeeDatas.push(memberyf);
var amount = memberyf.data.Amount;
if (amount == 0) {
Ext.Msg.show({ title: '警告',
msg: '费用的金额不允许为0,请修改后再保存',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
return;
}
};
var jsonChFeeBody = ConvertRecordsToJson(bodyChFeeDatas);
if (jsonChFeeBody == "") {
return;
}
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/Import/CWAudit/Save',
scope: this,
params: {
chfeebody: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
//alert("保存成功");
var returnData = jsonresult.Data;
//this.storeBodyChFee.getForm().setValues(returnData);
this.storeBodyChFee.commitChanges();
this.storeBodyChFee_YF.commitChanges();
} 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
});
}
//alert('03');
}
});
},
OprationSwap: function () {
var ret = new Array();
ret[0] = 'edit';
ret[1] = "";
ret[2] = this.SelectedRecord;
return ret;
},
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
}
});