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/MvcShipping/Viewsjs/WMS/WMSAudit.js

1031 lines
32 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
DsTruck.WMSAudit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.WMSAudit.superclass.constructor.call(this);
};
Ext.extend(Shipping.WMSAudit, Ext.Panel, {
PageSize: 500,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
BSNO: "",
initUIComponents: function () {
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'WMSOUTmb',
remoteSort: true,
pageSize: this.PageSize,
proxy: {
type: 'ajax',
url: '/MvcShipping/WMS/GetWMSOUTList',
reader: {
idProperty: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.formname = "WMSAudit";
//枚举参照
//表参照
this.storeBuyer = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeBuyer.load({ params: { condition: " ISCONTROLLER=1 "} });
this.comboxBuyer = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeBuyer,
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.storeUser = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeUser.load({ params: { condition: ""} });
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操作人',
store: this.storeUser,
name: 'OP',
valueField: 'UserName',
displayField: 'UserName'
});
this.comboxINPUTBY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '录入人',
store: this.storeUser,
name: 'INPUTBY', id: "INPUTBY",
valueField: 'UserName',
displayField: 'UserName',
value: SHOWNAME
});
this.column = [
{
sortable: true, hidden: true,
dataIndex: 'GID',
header: '惟一编号',
width: 80
}, {
dataIndex: 'ISLOCK',
header: '是否入账',
width: 60,
renderer: function (value, cellmeta) {
if (value == 'True') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
}, {
dataIndex: 'ISCHANGE',
header: '是否是货权转移',
width: 92,
renderer: function (value, cellmeta) {
if (value == 'True') {
return "<img src='../../../../TruckMng/Content/Images/submit.png' />";
}
}
},
{
sortable: true, hidden: true,
dataIndex: 'ASSOCIATEDNO',
header: '关联号',
width: 80
},
{
sortable: true,
dataIndex: 'BSNO',
header: '仓单明细号',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CLIENTGID',
header: '客户GID',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CLIENTCODE',
header: '客户编码',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '客户名称',
width: 80
},
{
sortable: true,
dataIndex: 'DODATE',
header: '操作时间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'STORAGECODE',
header: '仓库编码',
width: 80
},
{
sortable: true,
dataIndex: 'STORAGENAME',
header: '仓库名称',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'AREACODE',
header: '库位编码',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'AREANAME',
header: '库位名称',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'GOODSCODE',
header: '货物编号',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '货物名称/品名',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'GOODSTYPE',
header: '货物类型',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'GOODSMODEL',
header: '型号',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'GOODSSTANDARD',
header: '规格',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'GOODSPACK',
header: '包装',
width: 80
},
{
sortable: true,
dataIndex: 'CHARGEUNIT',
header: '计费单位',
width: 80
},
// {
// sortable: true,
// dataIndex: 'GOODSPACKSTOCK',
// header: '剩余件数',
// width: 80
// },
{
sortable: true,
dataIndex: 'GOODSPFSL',
header: '出库量',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSOUTFEE',
header: '应收仓储费',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSOUTFEEAP',
header: '应付仓储费',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'TRUCKNO',
header: '车号',
width: 80
},
{
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'ISDELETE',
header: '是否废除',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'DELETETIME',
header: '废除时间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'DELETEUSER',
header: '废除操作人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CREATEUSER',
header: '创建人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CREATETIME',
header: '创建时间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MODIFIEDUSER',
header: '最后一次更新操作人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MODIFIEDTIME',
header: '最后一次更新操作时间',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSPACKPFSL',
header: '出库件数',
width: 80
},
{
sortable: true,
dataIndex: 'TRUCKNAME',
header: '装卸队名称',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'WMSOP',
header: '制表人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'STOREMAN',
header: '保管人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'LOCKTIME',
header: '锁定时间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'LOCKUSER',
header: '锁定操作人',
width: 80
},
{
sortable: true,
dataIndex: 'ARFEE',
header: '出库费应收',
width: 80
},
{
sortable: true,
dataIndex: 'APFEE',
header: '出库费应付',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'INSPECTIONNO',
header: '审批单号',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMNO',
header: '报关单号/备案清单号',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CORPID',
header: '分公司代码',
width: 80
},
{
sortable: true,
dataIndex: 'CLIENTNAMEOLD',
header: '货权转移的客户',
width: 80
},
{
sortable: true,
dataIndex: 'OLDCUSTFEEDATE',
header: '上家承担仓储期',
width: 80
},
{
sortable: true,
dataIndex: 'CLIENTBSNO',
header: '不同客户的重复的出库单/客户出库仓单号',
width: 80
},
{
sortable: true,
dataIndex: 'ARCLIENT',
header: '应收账款客户',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'INGIDNEW',
header: '货权入库wmsgid',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'VALIDDATE',
header: '有效期',
width: 80
},
{
sortable: true,
dataIndex: 'TOTALNO',
header: '件数大写',
width: 80
},
{
sortable: true,
dataIndex: 'REMARK2',
header: '备注2/发货须知',
width: 80
},
{
sortable: true,
dataIndex: 'MBLNONEW',
header: '货权转移的分单',
width: 80
},
{
sortable: true,
dataIndex: 'ARCLIENTWMSOUT',
header: '仓储费应收客户',
width: 80
},
{
sortable: true,
dataIndex: 'BZTCHNO',
header: '批次号',
width: 80
},
{
sortable: true,
dataIndex: 'ISCOLLECTING',
header: '是否代收费',
width: 80
}
];
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 50
});
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
//collapsed: false,
//collapsible: true,
viewConfig: {
autoFill: true,
enableTextSelection: true
},
columns: [new Ext.grid.RowNumberer()],
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, 1);
//使用者id表名 中间column数组跳过一开始的几列
this.gridList.reconfigure(this.storeList, this.column);
this.gridList.columns[0] = new Ext.grid.RowNumberer();
////////////////////////////
//#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: [
////////
]
}]
}, //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.comboxOP,
this.comboxINPUTBY,
{
fieldLabel: 'hiddenfield',
xtype: 'hiddenfield',
name: 'hidden3', flex: 1
}
]
}]
}, //end items(fieldset 3)
{//fieldset 4
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: []
}]
}, //end items(fieldset 4)
{//fieldset 5
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
]
}]
} //end items(fieldset 5)
]//end root items
});
//#endregion formSearch
//费用列表
this.CBMSearch = new Ext.form.Checkbox({
fieldLabel: '高级查询',
listeners: {
change: function (newValue, oldValue, eOpts)//change事件
{
//alert(newValue.checked);
if (newValue.checked) {
Ext.getCmp("panelSearch").show();
} else {
Ext.getCmp("panelSearch").hide();
}
}
}
});
//查询工具条
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);
//alert(this.column[0].id);
},
scope: this
}, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', this.CBMSearch, '-', { id: "BSNO",
fieldLabel: "编号",
labelWidth: 55,
xtype: 'textfield',
name: 'BSNO'
}
]
});
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.BSNO = record.data.BSNO;
this.storebill.load({ params: { condition: " BsNo='" + this.BSNO + "' " },
callback: function (r, options, success) {
if (success) {
if (r.length == 1) {
//this.formEdit.getForm().loadRecord(this.storebill.getAt(0));
this.panelFee.EditRecord = this.storebill.getAt(0);
this.panelFee.strBSNO = this.BSNO;
this.panelFee.StoreDateCurr.load({ params: { optype: "op_Seai", bsno: this.BSNO} });
this.panelFee.StoreUnit.load({ params: { bsno: this.BSNO} });
this.panelFee.storeBodySum.load({ params: { bsno: this.BSNO} });
this.panelFee.storeDrChFee.load({ params: { billno: this.BSNO, type: 1, optype: "op_Seai"} });
this.panelFee.storeCrChFee.load({ params: { billno: this.BSNO, type: 2, optype: "op_Seai"} });
}
}
},
scope: this
});
}, this);
this.panelFee = new Shipping.FeeEditGrid({
region: 'center',
layout: 'border'
});
///////////////////////////////////////
this.storebill = Ext.create('Ext.data.Store', {
model: 'MsSeai',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsSeaiFee/GetBLData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//var condition = " BsNo='" + this.BSNO + "'";
// this.panelFee.StoreBill = this.storebill;
//this.panelFee.strBSNO = this.BSNO;
this.panelFee.stroplb = 'op_Seai';
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "WTDW-委托单位", "CUSTTYPE": "委托单位", "CUSTNAME": "CUSTOMERNAME" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CGS-船公司", "CUSTTYPE": "船公司", "CUSTNAME": "CARRIER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "DCDL-订舱代理", "CUSTTYPE": "订舱代理", "CUSTNAME": "FORWARDER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "BGH-报关行", "CUSTTYPE": "报关行", "CUSTNAME": "CUSTOMSER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CD-车队", "CUSTTYPE": "车队", "CUSTNAME": "TRUCKER" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "FHR-发货人", "CUSTTYPE": "发货人", "CUSTNAME": "SHIPPERID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "SHR-收货人", "CUSTTYPE": "收货人", "CUSTNAME": "CONSIGNEEID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "TZR-通知人", "CUSTTYPE": "通知人", "CUSTNAME": "NOTIFYPARTYID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "DL-代理", "CUSTTYPE": "代理", "CUSTNAME": "AGENTID" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CZ-场站", "CUSTTYPE": "场站", "CUSTNAME": "YARD" });
this.panelFee.StoreDrOpRange.load({ params: { optype: "modSeaiRecvFeeManagement"} });
this.panelFee.StoreCrOpRange.load({ params: { optype: "modSeaiPayFeeManagement"} });
this.panelFee.storeFeeNameRef.load({ params: { condition: " ISSEA='1' "} });
this.panelChFee = new Ext.Panel({
//
layout: "border",
region: 'south',
margin: '0 0',
height: 450, //width: 450,
split: true,
items: [/*this.panelChFee_YS, this.panelChFee_YF*/
this.panelFee
]
});
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.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 30,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border", id: "panelSearch",
region: "north",
height: 40, 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
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
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
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var HTH = Ext.getCmp("BSNO").getValue();
sql = sql + getAndConSql(sql, HTH, " (V.MBLNO like '%" + HTH + "%' or V.CUSTNO like '%" + HTH + "%') ");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "V.CUSTOMERNAME = '" + CUSTOMERNAME + "'");
var OP = form.findField('OP').getValue();
sql = sql + getAndConSql(sql, OP, "V.OP = '" + OP + "'");
var INPUTBY = form.findField('INPUTBY').getValue();
sql = sql + getAndConSql(sql, INPUTBY, "V.INPUTBY = '" + INPUTBY + "'");
return sql;
},
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] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
return ret;
},
// alert(this.OprationStatus.ToString());
// alert(this.storeList.toString());
// alert(this.SelectedRecord.toString());
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);
}
});