Ext.namespace('Shipping');
Shipping.YJFeeEditGrid = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.YJFeeEditGrid.superclass.constructor.call(this);
};
Ext.extend(Shipping.YJFeeEditGrid, Ext.Panel, {
ParentWin: null, //弹出式
ParentPanel: null, //Tab页编辑模式
OpStatus: 'add',
StoreBill: null,
StoreCustType: null,
EditRecord: null,
RefBillNo: '*',
DataLoading: true,
stroplb: '',
strBSNO: '',
strMBLNO: '',
WMSOUTBSNO: '',
feeType: 0,
CR_condition: "",
DR_condition: "",
PageSize: 100,
sqlcontext: '1=1',
defFeeName: '',
defFeeCurr: '',
OprationSwap: function () {
var ret = new Array();
ret[0] = this.stroplb;
ret[1] = this.feeType;
ret[2] = this.storeDrChFee;
ret[3] = this.storeCrChFee;
return ret;
},
// region: 'center',
initUIComponents: function () {
this.feeDrSerialNo = 0;
this.feeDrBodyDel = [];
this.feeCrSerialNo = 0;
this.feeCrBodyDel = [];
this.CustTypeMust = 0;
this.FeeFrtMust = 0;
this.formname = 'frmYJFeeEditGrid';
this.MsPeriod = null;
this.defFeeName = '单证费2',
this.defFeeCurr = 'USD',
this.YJMUSTBEFEECLOSE = 0;
this.sqlcontext = '1=1';
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'BSNO', type: 'string' },
{ name: 'OPLB', type: 'string' },
{ name: 'OPTYPE', type: 'string' },
{ name: 'OPLBNAME', type: 'string' },
{ name: 'BSTYPE', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'OPSTATUS', type: 'string' },
{ name: 'ACCDATE', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'MBLNO', type: 'string' },
{ name: 'HBLNO', type: 'string' },
{ name: 'ETD', type: 'string' },
{ name: 'VESSEL', type: 'string' },
{ name: 'VOYNO', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'BSSTATUS', type: 'string' },
{ name: 'FEESTATUS', type: 'string' },
{ name: 'BSSTATUSREF', type: 'string' },
{ name: 'FEESTATUSREF', type: 'string' },
{ name: 'DRFEESTATUS', type: 'string' },
{ name: 'CRFEESTATUS', type: 'string' },
{ name: 'SALE', type: 'string' },
{ name: 'OP', type: 'string' },
{ name: 'DOC', type: 'string' },
{ name: 'CUSTSERVICE', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' },
{ name: 'CUSTOMNO', type: 'string' },
{ name: 'CONTRACTNO', type: 'string' },
{ name: 'SERVICECONTRACTNO', type: 'string' },
{ name: 'ACCDATE', type: 'string' },
{ name: 'CARRIER', type: 'string' },
{ name: 'BSSOURCE', type: 'string' },
{ name: 'LANE', type: 'string' },
{ name: 'FORWARDER', type: 'string' },
{ name: 'CNTRTOTAL', type: 'string' },
{ name: 'TRADETYPE', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'OPDATE', type: 'string' },
{ name: 'CUSTOMDATE', type: 'string' },
{ name: 'ENTERP', type: 'string' },
{ name: 'ISPRINTPR', type: 'string' },
{ name: 'NETWEIGHT', type: 'number' },
{ name: 'KGS', type: 'number' },
{ name: 'TEU', type: 'number' },
{ name: 'CNTR1', type: 'number' },
{ name: 'CNTR2', type: 'number' },
{ name: 'CNTR3', type: 'number' },
{ name: 'CNTR4', type: 'number' },
{ name: 'CNTR5', type: 'number' },
{ name: 'CNTR6', type: 'number' },
{ name: 'CNTR7', type: 'number' },
{ name: 'CNTR8', type: 'number' },
{ name: 'CNTR9', type: 'number' },
{ name: 'CNTR10', type: 'number' },
{ name: 'OTCNTR', type: 'number' },
{ name: 'RMBDR', type: 'number' },
{ name: 'RMBCR', type: 'number' },
{ name: 'USDDR', type: 'number' },
{ name: 'USDCR', type: 'number' },
{ name: 'OTDR', type: 'number' },
{ name: 'OTCR', type: 'number' },
{ name: 'TTLDR', type: 'number' },
{ name: 'TTLCR', type: 'number' },
{ name: 'RMBPROFIT', type: 'number' },
{ name: 'USDPROFIT', type: 'number' },
{ name: 'OTPROFIT', type: 'number' },
{ name: 'TTLPROFIT', type: 'number' },
{ name: 'PROFITRATE', type: 'string' },
{ name: 'BillFeeStatus', type: 'string' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_lock/BsListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义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.initgirdcolums = [{
sortable: true,
dataIndex: 'BSNO',
header: '编号',
hidden: true,
width: 130
}, {
sortable: true,
id: '',
align: 'center',
dataIndex: 'BSSTATUSREF',
header: '业务锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '已锁定' || value == '锁定') {
return "";
}
}
},
{
sortable: true,
id: '',
align: 'center',
dataIndex: 'FEESTATUSREF',
header: '费用锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '已锁定' || value == '锁定') {
return "";
}
}
}, {
sortable: true,
dataIndex: 'ISPRINTPR',
header: '打印核算单',
width: 80,
renderer: function (value, meta, record) {
if (value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
id: '',
dataIndex: 'DRFEESTATUS',
header: '应收费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
var svalue = "";
if (value != "") {
if (value == '0:') {
meta.tdCls = 'feestatus_pass';
svalue = "审核通过";
} else if (value == '1:') {
svalue = "录入状态";
} else if (value == '2:') {
meta.tdCls = 'feestatus_refer';
svalue = "提交审核";
} else if (value == '8:') {
meta.tdCls = 'feestatus_refer';
svalue = "部分结算";
} else if (value == '9:') {
meta.tdCls = 'feestatus_settle';
svalue = "结算完毕";
} else if (value == '') {
svalue = "未录入";
} else if (value.indexOf("9:") > -1) {
meta.tdCls = 'feestatus_settle';
svalue = "部分结算";
} else if (value.indexOf("0:") > -1) {
meta.tdCls = 'feestatus_pass';
svalue = "部分审核";
} else if (value.indexOf("2:") > -1) {
meta.tdCls = 'feestatus_refer';
svalue = "部分提交";
}
}
return svalue;
}
},
{
sortable: true,
id: '',
dataIndex: 'CRFEESTATUS',
header: '应付费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
var svalue = "";
if (value != "") {
if (value == '0:') {
meta.tdCls = 'feestatus_pass';
svalue = "审核通过";
} else if (value == '1:') {
svalue = "录入状态";
} else if (value == '2:') {
meta.tdCls = 'feestatus_refer';
svalue = "提交审核";
} else if (value == '8:') {
meta.tdCls = 'feestatus_refer';
svalue = "部分结算";
} else if (value == '9:') {
meta.tdCls = 'feestatus_settle';
svalue = "结算完毕";
} else if (value == '') {
svalue = "未录入";
} else if (value.indexOf("9:") > -1) {
meta.tdCls = 'feestatus_settle';
svalue = "部分结算";
} else if (value.indexOf("0:") > -1) {
meta.tdCls = 'feestatus_pass';
svalue = "部分审核";
} else if (value.indexOf("2:") > -1) {
meta.tdCls = 'feestatus_refer';
svalue = "部分提交";
}
}
return svalue;
}
}, {
sortable: true,
dataIndex: 'OPLBNAME',
header: '业务类型',
width: 70
}, {
sortable: true,
dataIndex: 'OPTYPE',
header: '更改单',
width: 70
}, {
sortable: true,
dataIndex: 'BSTYPE',
header: '运输类型',
width: 70
},
{
sortable: true,
id: '',
dataIndex: 'OPSTATUS',
header: '业务状态',
width: 60
}, {
sortable: true,
dataIndex: 'ACCDATE',
header: '会计期间',
width: 86
}, {
sortable: true,
dataIndex: 'OPDATE',
header: '业务日期',
width: 86
}, {
sortable: true,
dataIndex: 'CUSTOMDATE',
header: '报关日期',
width: 86
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 120
}, {
sortable: true,
dataIndex: 'CUSTNO',
header: '委托编号',
width: 136
}, {
sortable: true,
dataIndex: 'CUSTOMNO',
header: '报关单号',
width: 136
}, {
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合约号',
width: 136
}, {
sortable: true,
dataIndex: 'SERVICECONTRACTNO',
header: '参考号',
width: 136
}, {
sortable: true,
dataIndex: 'ENTERP',
header: '经营单位',
width: 100
}, {
sortable: true,
dataIndex: 'MBLNO',
header: '主提单号',
width: 120
}, {
sortable: true,
dataIndex: 'HBLNO',
header: '分提单号',
width: 120
}, {
sortable: true,
dataIndex: 'ETD',
header: '开船日期',
width: 86
}, {
sortable: true,
dataIndex: 'VESSEL',
header: '船名',
width: 200
}, {
sortable: true,
dataIndex: 'VOYNO',
header: '航次',
width: 50
}, {
sortable: true,
dataIndex: 'SALE',
header: '业务员',
width: 80
}, {
sortable: true,
dataIndex: 'OP',
header: '操作',
width: 80
}, {
sortable: true,
dataIndex: 'DOC',
header: '单证',
width: 80
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: '起运港',
width: 80
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '目的港',
width: 150
}, {
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 80
}, {
sortable: true,
dataIndex: 'BSSOURCE',
header: '业务来源',
width: 120
}, {
sortable: true,
dataIndex: 'TEU',
header: 'TEU',
width: 80
}, {
sortable: true,
dataIndex: 'KGS',
header: 'KGS',
width: 80
}, {
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 80
}, {
sortable: true,
dataIndex: 'RMBDR',
header: 'RMB应收',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBCR',
header: 'RMB应付',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBPROFIT',
header: 'RMB利润',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDDR',
header: 'USD应收',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDCR',
header: 'USD应付',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDPROFIT',
header: 'USD利润',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTDR',
header: '其他币别应收',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTCR',
header: '其他币别应付',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTPROFIT',
header: '其他币别利润',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLDR',
header: '合计应收',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLCR',
header: '合计应付',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLPROFIT',
header: '合计利润',
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'PROFITRATE',
header: '利润率',
width: 80
},{
sortable: true,
dataIndex: 'BillFeeStatus',
header: '整票状态',
width: 60,
renderer: function (value, meta) {
if (value == '0') {
return "未提交";
}else if (value == '1') {
meta.tdCls = 'feestatus_refer';
return "整票提交";
}else if (value == '2') {
meta.tdCls = 'feestatus_pass';
return "审核通过";
}else {
return "";
}
}
}
];
this.girdcolums = this.initgirdcolums;
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
columns: this.girdcolums,
viewConfig: {
enableTextSelection: true
},
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
if (record.data.OPLBNAME == "报关业务") {
openUrl = "../../MvcShipping/MsOpApply/ApplyFeeView?handle=check&bsno=" + record.data.BSNO;
} else {
openUrl = "../../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO;
}
window.open(openUrl, openType, openSet);
}, this);
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.columns[1] = new Ext.grid.RowNumberer();
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
this.gridList.getSelectionModel().on('select', function (model, record, index) {
var drmodify = _thisyjfee.storeDrChFee.getModifiedRecords();
if (drmodify.length != 0)
_thisyjfee.onPostDetailClick();
_thisyjfee.EditRecord = record;
_thisyjfee.strBSNO = _thisyjfee.EditRecord.get('BSNO');
_thisyjfee.StoreDateCurr.load({ params: { optype: "op_Seae", bsno: _thisyjfee.strBSNO} });
_thisyjfee.StoreUnit.load({ params: { bsno: _thisyjfee.strBSNO, bstype: "op_Seae"} });
_thisyjfee.strMBLNO = _thisyjfee.EditRecord.get('MBLNO');
var sql = "";
sql = " BSNO='" + record.data.BSNO + "' AND ISOPEN=1 ";
this.storeDrChFee.load({ params: { billno: _thisyjfee.strBSNO, type: 2, optype: "op_Seae", condition: sql} });
}, this);
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _thisyjfee.sqlcontext, type: locktype });
}, this);
//#region formSearch
//#region formSearch枚举参照相关
this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreOpLb.load({ params: { enumTypeId: 96005} });
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务类型',
store: this.StoreOpLb,
forceSelection: true,
name: 'PS_OPLB',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBsType.load({ params: { enumTypeId: 96004} });
this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '运输类型',
store: this.storeBsType,
name: 'PS_BSTYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeSalesCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeSalesCode.load();
this.comboxSalesCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操 作',
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_OP',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
name: 'PS_CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeEnterpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomerRefModel',
proxy: { url: '/MvcShipping/MsBaseInfo/GetCustomerRefList' }
});
this.storeEnterpCode.load({ params: { condition: "ISENTERP='1'"} });
this.comboxEnterp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '经营单位',
store: this.storeEnterpCode,
forceSelection: true,
name: 'PS_ENTERP',
valueField: 'DESCRIPTION',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.StoreOpLock = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreOpLock.add({ "OpLb": "全部" });
this.StoreOpLock.add({ "OpLb": "已锁定" });
this.StoreOpLock.add({ "OpLb": "未锁定" });
this.comboxOpLock = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务锁定',
store: this.StoreOpLock,
forceSelection: true,
labelWidth: 60,
name: 'PS_OPLOCK',
valueField: 'OpLb',
displayField: 'OpLb',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.StoreFeeLock = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreFeeLock.add({ "OpLb": "全部" });
this.StoreFeeLock.add({ "OpLb": "已锁定" });
this.StoreFeeLock.add({ "OpLb": "未锁定" });
this.comboxFeeLock = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '费用锁定',
store: this.StoreFeeLock,
forceSelection: true,
labelWidth: 60,
name: 'PS_FEELOCK',
valueField: 'OpLb',
displayField: 'OpLb',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeFEEUP = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeFEEUP.add({ "FSTATUS": "", "NAME": "" });
this.storeFEEUP.add({ "FSTATUS": "0", "NAME": "否" });
this.storeFEEUP.add({ "FSTATUS": "1", "NAME": "是" });
this.comboxFEEUP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '费用提交',
store: this.storeFEEUP,
valueField: 'FSTATUS',
displayField: 'NAME',
flex: 0.5,
labelWidth: 60,
forceSelection: true,
name: 'ISFEEUP',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeFSTATUS = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeFSTATUS.add({ "FSTATUS": "0", "NAME": "全部" });
this.storeFSTATUS.add({ "FSTATUS": "1", "NAME": "仅已审核" });
this.storeFSTATUS.add({ "FSTATUS": "2", "NAME": "仅未审核" });
this.comboxFSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '费用审核',
store: this.storeFSTATUS,
valueField: 'FSTATUS',
displayField: 'NAME',
labelWidth: 60,
flex: 0.5,
forceSelection: true,
name: 'FSTATUS',
value: '0',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#endregion
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: '记忆查询条件',
checked: true,
width: 20
});
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxOpLb, {
fieldLabel: '编号',
name: 'PS_MBLNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '船名',
name: 'PS_VESSEL',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '航次',
name: 'PS_VOYNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
// , {
// fieldLabel: '品名',
// name: 'PS_GOODSNAME',
// enableKeyEvents: true,
// listeners: {
// specialkey: function (field, e) {
// if (e.getKey() == e.ENTER) {
// _this.onRefreshClick();
// }
// }
// }
// },
, this.comboxOp, this.comboxFEEUP, this.comboxFSTATUS
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxBsType, this.comboxSalesCode, this.comboxCustCode, {
fieldLabel: '从业务日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到业务日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxOpLock
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxEnterp, {
fieldLabel: '从ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '从会计期间',
xtype: 'monthfield',
name: 'PS_ACCDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '从会计期间',
xtype: 'monthfield',
name: 'PS_ACCDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxFeeLock
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
_this = this;
this.SearchBtn = new Ext.Button({
text: '隐藏查询',
handler: function () {
if (_this.SearchBtn.text == '隐藏查询') {
_this.panelSearch.hide();
_this.SearchBtn.setText("显示查询");
} else {
_this.panelSearch.show();
_this.SearchBtn.setText("隐藏查询");
}
}
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
var isvisible = true;
var issavevalue = false;
if (_this.SearchBtn.text == '隐藏查询')
isvisible = true
else
isvisible = false;
if (this.CheckSaveQuery.checked)
issavevalue = true
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
this.onRefreshClick(button, event);
},
scope: this
}, '-', {
xtype: 'button',
text: "高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}, '-', this.SearchBtn, {
xtype: 'button',
width: 90,
text: "清空条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, '-', {
text: "保存列表样式",
id: "btntest",
menu: [
{ text: "保存",
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, { text: "初始化",
handler: function (menu, event) {
_this.InitGrid(_this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-', {
text: "CZF确认",
handler: function (button, event) {
_this.CZFTiJiao();
},
scope: this
}, '-', {
text: 'EXCEL导入',
tooltip: 'EXCEL导入',
iconCls: "btnexportexcel",
handler: function (button, event) {
this.onImportDetailClick(button, event);
},
scope: this
},this.CheckSaveQuery
]
});
this.StoreDrOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeOP',
proxy: { url: '/MvcShipping/MsChFee/GetFeeOpRang' }
});
this.StoreCrOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeOP',
proxy: { url: '/MvcShipping/MsChFee/GetFeeOpRang' }
});
this.StoreCustType = Ext.create('Ext.data.Store', {
fields: ['SCUSTTYPE', 'CUSTTYPE', 'CUSTNAME']
});
this.comboxCustType = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCustType,
forceSelection: true,
name: 'CustomerType',
valueField: 'CUSTTYPE',
displayField: 'SCUSTTYPE'
});
this.StoreFeeFrt = Ext.create('Ext.data.Store', {
fields: ['Frt']
});
this.StoreFeeFrt.add({ "Frt": "PP" });
this.StoreFeeFrt.add({ "Frt": "CC" });
this.comboxFeeFrt = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreFeeFrt,
forceSelection: true,
name: 'FeeFrt',
valueField: 'Frt',
displayField: 'Frt'
});
this.storeFeeType = Ext.create('Ext.data.Store', {
fields: ['FType', 'NAME']
});
this.storeFeeType.add({ "FType":1, "NAME": "收" });
this.storeFeeType.add({ "FType": 2, "NAME": "付" });
this.comboxFeeType = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeType,
valueField: 'FType',
displayField: 'NAME',
forceSelection: true,
name: 'FeeType'
});
this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' }
});
this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRef,
forceSelection: true,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName'
});
this.storeCustomerNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.comboxCustomerNameRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRef,
forceSelection: true,
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.StoreUnit = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeUnit',
proxy: { url: '/MvcShipping/MsChFee/GetCtnUnitList' }
});
this.comboxUnit = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreUnit,
name: 'Unit',
valueField: 'UNIT',
displayField: 'SUNIT'
});
this.StoreDateCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeDateCurrList' }
});
this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurr.load({ params: { condition: ""} });
this.comboxCurr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCurr,
forceSelection: true,
name: 'Currency',
valueField: 'CURR',
displayField: 'CURR'
});
//明细表-数据集
this.storeDrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeChFeeModify = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetModifyData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.cellEditingDrChFee = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.feeDrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_thisyjfee = this;
this.initgirdDrcolums = [{
sortable: true,
dataIndex: 'GId',
header: Zi.LAN.FEE.GID2, //'惟一编号',
hidden: true,
width: 160
}, {
sortable: true,
dataIndex: 'BsNo',
header: Zi.LAN.FEE.BSNO2, //'业务编号',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: Zi.LAN.FEE.FEESTATUS, //'费用状态',
renderer: function (value, p, record) {
return record.data.FeeStatus_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeName',
header: '费用名称', //'应收费用名称',
editor: this.comboxFeeNameRef,
width: 90
}, {
sortable: true,
dataIndex: 'FeeType',
header: '收付', //'应收费用名称',
editor: this.comboxFeeType,
width: 20,
renderer: function (value, cellmeta) {
if (value == 'true' || value == '1'|| value == 1) {
return "收";
} else return "付";
},
}, {
sortable: true,
dataIndex: 'CustomerType',
header: Zi.LAN.FEE.CustomerType, //'客户类别',
editor: this.comboxCustType,
// hidden: true,
width: 75
}, {
sortable: true,
dataIndex: 'CustomerName',
header: Zi.LAN.FEE.CUSTOMERNAME, //'结算对象',
editor: this.comboxCustomerNameRef,
width: 110
}, {
sortable: true,
dataIndex: 'Unit',
header: Zi.LAN.FEE.Unit, //'单位标准',
editor: this.comboxUnit,
width: 60
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: Zi.LAN.FEE.UnitPrice, //'不含税单价',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
decimalPrecision: 4,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 8)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 8)
}
}
}
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TaxRate',
header: Zi.LAN.FEE.TaxRate, //'税率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 9)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 9)
}
}
}
},
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;
},
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'TaxUnitPrice',
header: Zi.LAN.FEE.TaxUnitPrice, //'单价',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
decimalPrecision: 4,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 10)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 10)
}
}
}
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Quantity',
header: Zi.LAN.FEE.Quantity, //'数量',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
allowDecimals: true,
decimalPrecision: 4,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 11)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 11)
}
}
}
},
width: 60
}, {
sortable: true,
dataIndex: 'NoTaxAmount',
header: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 12)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 12)
}
}
}
},
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Amount',
header: Zi.LAN.FEE.Amount, //'金额',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 13)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 13)
}
}
}
},
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;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Currency',
header: Zi.LAN.FEE.Currency, //'币别',
editor: this.comboxCurr,
width: 40
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: Zi.LAN.FEE.ExChangerate, //'汇率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
decimalPrecision: 6,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 15)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 15)
}
}
}
},
// renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 6, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'AccTaxRate',
header: Zi.LAN.FEE.AccTaxRate2, //'销项税率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 16)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 16)
}
}
}
},
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; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: Zi.LAN.FEE.REMARK, //'备注',
editor: {
xtype: 'textfield',
selectOnFocus: true,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 17)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 17)
}
}
}
},
width: 150
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: Zi.LAN.FEE.FeeDescription, //'费用英文名称',
editor: {
xtype: 'textfield',
selectOnFocus: true,
enableKeyEvents: true,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 18)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 18)
}
}
}
},
width: 150
}, {
sortable: true,
dataIndex: 'IsOpen',
header: Zi.LAN.FEE.IsOpen, //'是否机密',
hidden: true,
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
}, {
sortable: true,
dataIndex: 'IsAdvancedpay',
header: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == '1') {
return "√";
}
},
width: 60
}, {
sortable: true,
dataIndex: 'IsInvoice',
header: Zi.LAN.FEE.IsInvoice, //'禁开发票',
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == '1' || value == true) {
return "√";
}
},
width: 60
}, {
sortable: true,
dataIndex: 'FeeFrt',
header: Zi.LAN.FEE.FeeFrt, //'FRT',
editor: this.comboxFeeFrt,
width: 40
}, {
sortable: true,
dataIndex: 'Commissionrate',
header: Zi.LAN.FEE.Commissionrate, //'佣金比率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisyjfee.onNextKeyClick(1, 20)
} else if (e.getKey() == 38) {
_thisyjfee.onUpKeyClick(1, 20)
}
}
}
},
width: 60
}, {
sortable: true,
dataIndex: 'OpName',
header: Zi.LAN.FEE.OpName, //'录入人',
width: 60
}, {
sortable: true,
dataIndex: 'EnterDate',
header: Zi.LAN.FEE.EnterDate, //'录入日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Settlement',
header: Zi.LAN.FEE.Settlement, //'结算金额',
align: 'right',
width: 80,
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: 'Invoice',
header: Zi.LAN.FEE.Invoice, //'已开票金额',
align: 'right',
width: 80,
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: 'InvoiceNum',
header: Zi.LAN.FEE.InvoiceNum, //'发票号码',
width: 80
}, {
sortable: true,
dataIndex: 'DebitNo',
header: Zi.LAN.FEE.DebitNo, //'対帐编号',
width: 80
}, {
sortable: true,
dataIndex: 'Auditoperator',
header: Zi.LAN.FEE.Auditoperator, //'审核人',
width: 60
}, {
sortable: true,
dataIndex: 'AuditDate',
header: Zi.LAN.FEE.AuditDate, //'审核日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'MODIFIEDUSER',
header: Zi.LAN.FEE.MODIFIEDUSER, //'修改人',
width: 60
}, {
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: Zi.LAN.FEE.MODIFIEDTIME, //'修改日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s'),
width: 130
}, {
sortable: true,
dataIndex: 'OrderInvoice',
header: Zi.LAN.FEE.OrderInvoice, //'发票申请金额',
align: 'right',
width: 80,
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;
}
}, {
dataIndex: 'UNINVOICE',
header: Zi.LAN.FEE.UNINVOICE, //'未开票金额',
width: 60,
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: 'PreAmount',
header: Zi.LAN.FEE.PreAmount, //'预估金额',
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;
},
align: 'right',
width: 80
}, {
dataIndex: 'Tax',
header: Zi.LAN.FEE.Tax, //'税额',
width: 60
}, {
sortable: true,
dataIndex: 'INPUTMODE',
header: Zi.LAN.FEE.INPUTMODE, //'录入方式',
width: 150
}, {
sortable: true,
dataIndex: 'LOCALCURR',
header: Zi.LAN.FEE.LOCALCURR, //'本位币',
width: 150
}
];
this.girdDrcolums = this.initgirdDrcolums;
this.gridDrChFee = new Ext.grid.GridPanel({
store: this.storeDrChFee,
enableHdMenu: false,
region: 'center',
id: 'gridDrChFee',
//allowDeselect:true,
loadMask: { msg: Zi.LAN.FEE.ShuJuJiaZaiZhongQingShaoDeng },
trackMouseOver: true,
disableSelection: false,
plugins: [this.cellEditingDrChFee],
selModel: this.feeDrGridCheckBoxModel,
selType: 'cellmodel',
viewConfig: {
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
var ISSEL = record.get('ISSEL');
if (ISSEL == '1')
return Shipping.FeeGetRowClassFont(feeStatus);
else
return Shipping.FeeGetRowClass(feeStatus);
}
},
tbar: [{
text: '',
tooltip: '添加佣金', //'添加应收费用',
iconCls: "btnadd",
id: 'btnFeeAddDr',
handler: function (button, event) {
this.onAddDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: '',
tooltip: '保存', //保存应收费用',
iconCls: "btnsave",
id: 'btnFeeSaveDr',
handler: function (button, event) {
this.onPostDetailClick(button, event, 1);
},
scope: this
},
'-', {
text: '',
tooltip: '删除费用', //删除应收费用',
iconCls: "btndelete",
id: 'btnFeeDelDr',
handler: function (button, event) {
this.onDelDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: '',
tooltip: '取消修改', //取消修改',
iconCls: "btncancel",
id: 'btnFeeCancelDr',
handler: function (button, event) {
this.onCancelDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeRefDr, //刷新应收',
iconCls: "btnrefresh",
id: 'btnFeeRefDr',
handler: function (button, event) {
this.LoadDrChFee();
},
scope: this
}, '-', {
text: Zi.LAN.FEE.btnFeeAuditDr, //'提交审核',
tooltip: Zi.LAN.FEE.btnFeeAuditDr, //'提交审核',
id: 'btnFeeAuditDr',
menu:
[
{ text: Zi.LAN.FEE.btnFeeAuditDr, //"提交审核",
handler: function (menu, event) {
_thisyjfee.onSubmitAuditClick(menu, event, 1);
}
}, { text: Zi.LAN.FEE.SubmitAuditDr, //"应收提交",
handler: function (menu, event) {
_thisyjfee.onSubmitAuditAllClick(menu, event, 1);
}
}, { text: Zi.LAN.FEE.SubmitAuditBill, //"整票提交",
handler: function (menu, event) {
_thisyjfee.onSubmitAuditBillClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.CancelAuditNew, //"撤销提交",
handler: function (menu, event) {
_thisyjfee.onCancelAuditNewClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.ViewWorkFlow, //"查看工作流",
handler: function (menu, event) {
_thisyjfee.onViewWorkFlowDetailClick(menu, event, 1);
}
}],
scope: this
},
'-', {
text: Zi.LAN.FEE.ShenModify, //'申请修改',
tooltip: Zi.LAN.FEE.ShenModify, //'申请修改',
id: 'btnFeeShenDr',
handler: function (button, event) {
this.onShenModifyClick(button, event, 1);
},
scope: this
},
'-', {
text: Zi.LAN.FEE.ShenDelete, //'申请删除',
tooltip: Zi.LAN.FEE.ShenDelete, //'申请删除',
id: 'btnFeeShenDelDr',
handler: function (button, event) {
this.onShenDeleteClick(button, event, 1);
},
scope: this
},
'-', {
text: Zi.LAN.FEE.CancelShen, //'取消申请',
tooltip: Zi.LAN.FEE.CancelShen, //'取消申请',
id: 'btnFeeShenCancelDr',
handler: function (button, event) {
this.onCancelShenClick(button, event, 1);
},
scope: this
}, '-', {
text: Zi.LAN.FEE.btntest, //"保存列表样式",
menu: [
{ text: Zi.LAN.FEE.SaveGridPanel, //"保存",
handler: function (button, event) {
_thisyjfee.girdDrcolums = DsTruck.SaveGridPanel(GID, 'YJFEEDRGRID', _thisyjfee.gridDrChFee.columns, _thisyjfee.girdDrcolums, 0, true);
}
}, { text: Zi.LAN.FEE.SaveGridPanel2, //"初始化",
handler: function (menu, event) {
_thisyjfee.gridDrChFee.reconfigure(this.storeList, _thisyjfee.initgirdDrcolums);
_thisyjfee.girdDrcolums = DsTruck.SaveGridPanel(GID, 'YJFEEDRGRID', _thisyjfee.gridDrChFee.columns, _thisyjfee.initgirdDrcolums, 0, true);
}
}],
scope: this
}],
columns: this.girdDrcolums
});
this.girdDrcolums = DsTruck.GetGridPanel(GID, 'YJFEEDRGRID', this.girdDrcolums, 0); //使用者id,表名,中间column数组,跳过一开始的几列
// this.gridDrChFee.reconfigure(this.storeDrChFee, this.girdDrcolums);
this.gridDrChFee.on('edit', function (editor, e, eOpts) {
this.gridListChFeeAfterEdit(editor, e, eOpts);
}, this);
this.cellEditingDrChFee.on('beforeedit', function (editor, e) {
return this.cellEditingChFeeBeforeEdit(editor, e);
}, this);
_thisyjfee = this;
this.InitDrGrid(this.girdDrcolums);
//#region 申请修改和删除界面
this.comboxFeeFrtModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreFeeFrt,
forceSelection: true,
fieldLabel: Zi.LAN.FEE.Frt, //'FRT',
name: 'FeeFrt',
valueField: 'Frt',
displayField: 'Frt'
});
this.storeFeeNameRefModify = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' }
});
this.storeFeeNameRefModify.load({ params: { condition: ""} });
this.comboxFeeNameRefModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRefModify,
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
forceSelection: true,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName'
});
this.storeCustomerNameRefM = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustomerNameRefM.load({ params: { condition: ""} });
this.comboxCustomerNameRefModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRefM,
forceSelection: true,
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME, //'结费对象',
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.comboxUnitModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreUnit,
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
name: 'Unit',
valueField: 'UNIT',
displayField: 'SUNIT'
});
this.CheckIsAdvancedpay = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
uncheckedValue: '0',
inputValue: '1',
name: 'IsAdvancedpay'
});
this.comboxCurrModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCurr,
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
forceSelection: true,
name: 'Currency',
valueField: 'CURR',
displayField: 'CURR',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (this.DataLoading == true) return;
var CURR = records[0].data.CURR;
var form = _thisyjfee.NewFeeEdit.getForm();
if (CURR == 'RMB') {
form.findField('ExChangerate').setValue(1);
} else {
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', CURR);
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
var DEFRATE = ffdata.DEFRATE;
form.findField('ExChangerate').setValue(DEFRATE);
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', CURR);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
var DEFRATE = dfdata.DEFRATE;
form.findField('ExChangerate').setValue(DEFRATE);
} else {
form.findField('ExChangerate').setValue(1);
}
}
}
}
}
}
});
_thisyjfee = this;
this.NewFeeEdit = Ext.widget('form', {
frame: true,
region: 'center',
trackResetOnLoad: true,
title: Zi.LAN.FEE.NewFeeEdit, //'费用新值',
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: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel:'IsOpen', //'Remark',
name: 'IsOpen', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeType, //'FeeType',
name: 'FeeType', flex: 0, hidden: true, margins: '0'
}, this.comboxFeeNameRefModify, this.comboxCustomerNameRefModify, this.comboxUnitModify]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
xtype: 'numberfield',
name: 'UnitPrice',
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;
},
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisyjfee.NewFeeEdit.getForm();
var unitPrice = newValue;
var FeeName = form.findField('FeeName').getValue();
var quantity = form.findField('Quantity').getValue();
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (taxrate != null) {
var taxrateb = parseFloat(1 + parseFloat(taxrate / 100));
var TaxUnitPrice = (parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var notaxamount = (parseFloat(unitPrice).mul(quantity)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
xtype: 'numberfield',
name: 'TaxRate',
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisyjfee.NewFeeEdit.getForm();
var unitPrice = form.findField('UnitPrice').getValue();
var FeeName = form.findField('FeeName').getValue();
var quantity = form.findField('Quantity').getValue();
var taxrate = newValue;
this.DataLoading = true;
if (unitPrice != null) {
var taxrateb = parseFloat(1 + parseFloat(taxrate / 100));
var TaxUnitPrice = (parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var notaxamount = form.findField('NoTaxAmount').getValue();
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
xtype: 'numberfield',
name: 'TaxUnitPrice',
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;
},
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisyjfee.NewFeeEdit.getForm();
var quantity = form.findField('Quantity').getValue();
var TaxUnitPrice = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (TaxUnitPrice != 0) {
var taxrateb = parseFloat(1 + parseFloat(taxrate / 100));
var unitPrice = (parseFloat(TaxUnitPrice).div(parseFloat(taxrateb))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
}
if (quantity != null) {
var amount = (parseFloat(TaxUnitPrice).mul(quantity)).toFixed(2);
form.findField('Amount').setValue(amount);
var notaxamount = (parseFloat(amount).div(taxrateb)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
}
this.DataLoading = false;
}
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
xtype: 'numberfield',
name: 'Quantity',
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;
},
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisyjfee.NewFeeEdit.getForm();
var unitPrice = form.findField('UnitPrice').getValue();
var FeeName = form.findField('FeeName').getValue();
var quantity = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (taxrate != null) {
var taxrateb = parseFloat(1 + parseFloat(taxrate / 100));
var TaxUnitPrice = (parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var notaxamount = (parseFloat(unitPrice).mul(quantity)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
xtype: 'numberfield',
name: 'NoTaxAmount',
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;
},
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisyjfee.NewFeeEdit.getForm();
var notaxamount = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (taxrate != null) {
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
}
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
xtype: 'numberfield',
name: 'Amount',
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;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCurrModify, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
xtype: 'numberfield',
labelWidth: 60,
decimalPrecision: 6,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
xtype: 'numberfield',
name: 'AccTaxRate'
}, this.CheckIsAdvancedpay
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Reason3, //'修改原因',
name: 'Reason'
}, {
fieldLabel: Zi.LAN.FEE.REMARK, //'备注',
name: 'Remark'
}]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.OldFee = Ext.widget('form', {
frame: true,
region: 'center',
title: Zi.LAN.FEE.OldFee, //'费用旧值',
trackResetOnLoad: true,
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: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.Remark, //'Remark',
name: 'Remark', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel:'IsOpen', //'Remark',
name: 'IsOpen', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME2, //'费用对象',
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
readOnly: true,
name: 'Unit'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
readOnly: true,
name: 'UnitPrice',
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;
}
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
readOnly: true,
name: 'TaxUnitPrice',
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;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
readOnly: true,
name: 'NoTaxAmount',
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;
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
readOnly: true,
name: 'Amount',
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;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
readOnly: true,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
readOnly: true,
name: 'AccTaxRate'
}, {
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
readOnly: true,
name: 'IsAdvancedpay'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.DeleteFee = Ext.widget('form', {
frame: true,
region: 'center',
trackResetOnLoad: true,
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: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel:'IsOpen', //'Remark',
name: 'IsOpen', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeType, //'FeeType',
name: 'FeeType', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
name: 'FeeName', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME2, //'费用对象',
name: 'CustomerName', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
name: 'Unit', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
name: 'UnitPrice', flex: 0, hidden: true, margins: '0',
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;
}
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
name: 'TaxRate', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
name: 'TaxUnitPrice', flex: 0, hidden: true, margins: '0',
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;
}
}, {
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
name: 'Quantity', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
name: 'NoTaxAmount', flex: 0, hidden: true, margins: '0',
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;
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
name: 'Amount', flex: 0, hidden: true, margins: '0',
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;
}
}, {
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
name: 'Currency', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
name: 'ExChangerate', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
name: 'AccTaxRate', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
name: 'IsAdvancedpay', flex: 0, hidden: true, margins: '0'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Reason2, //'删除原因',
flex: 2,
name: 'Reason'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.NewFeeShowDr = Ext.widget('form', {
frame: true,
region: 'east',
hidden: true,
title: Zi.LAN.FEE.NewFeeShow, //'费用修改新值',
width: 600,
trackResetOnLoad: true,
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: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel:'IsOpen', //'Remark',
name: 'IsOpen', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME2, //'费用对象',
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
readOnly: true,
name: 'Unit'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
readOnly: true,
name: 'UnitPrice',
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;
}
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
readOnly: true,
name: 'TaxUnitPrice',
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;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
readOnly: true,
name: 'NoTaxAmount',
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;
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
readOnly: true,
name: 'Amount',
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;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
readOnly: true,
labelWidth: 60,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
readOnly: true,
labelWidth: 60,
name: 'AccTaxRate'
}, {
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
readOnly: true,
labelWidth: 60,
name: 'IsAdvancedpay'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Reason3, //'修改原因',
readOnly: true,
flex: 2,
name: 'Reason'
}, {
fieldLabel: Zi.LAN.FEE.REMARK, //'备注',
flex: 1,
labelWidth: 40,
readOnly: true,
name: 'Remark'
}, {
fieldLabel: Zi.LAN.FEE.MODIFIEDUSER2, //'申请人',
readOnly: true,
labelWidth: 60,
name: 'MODIFIEDUSER'
}, {
fieldLabel: Zi.LAN.FEE.MODIFIEDTIME2, //'申请时间',
readOnly: true,
labelWidth: 60,
name: 'MODIFIEDTIME'
}]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winShenModifyShow = Ext.create('Ext.window.Window', {
title: Zi.LAN.FEE.winShenModifyShow, //"费用申请修改",
width: 600,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
layout: "anchor",
items: [this.OldFee, this.NewFeeEdit],
buttons: [{
text: Zi.LAN.FEE.TiJiaoShenQing, //"提交申请",
minWidth: 70,
handler: function () {
var form = _thisyjfee.NewFeeEdit.getForm();
var FeeName = form.findField('FeeName').getValue();
if (FeeName == '' || FeeName == null || FeeName == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //费用名称不能为空!'
return;
};
var CustomerName = form.findField('CustomerName').getValue();
if (CustomerName == '' || CustomerName == null || CustomerName == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JieFeiDuiXiangBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var TaxRate = form.findField('TaxRate').getValue();
if (TaxRate == null || TaxRate == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.ShuiLvBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'税率不能为空!'
return;
};
var Currency = form.findField('Currency').getValue();
if (Currency == '' || Currency == null || Currency == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = form.findField('ExChangerate').getValue();
if (ExChangerate == '' || ExChangerate == null || ExChangerate == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //汇率不能为空!
return;
};
var REASON = form.findField('Reason').getValue();
if (REASON == '' || REASON == null || REASON == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.XiuGaiYuanYinBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var type = form.findField('FeeType').getValue();
_thisyjfee.onCreateModifyClick(type);
}
}, {
text: Zi.LAN.FEE.CancelShen, //"取消申请",
minWidth: 70,
handler: function () {
_thisyjfee.winShenModifyShow.close();
}
}]
});
this.winShenDeleteShow = Ext.create('Ext.window.Window', {
title: Zi.LAN.FEE.winShenDeleteShow, //"费用申请删除",
width: 600,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
layout: "anchor",
items: [this.DeleteFee],
buttons: [{
text: Zi.LAN.FEE.TiJiaoShenQing, //"提交申请",
minWidth: 70,
handler: function () {
var form = _thisyjfee.DeleteFee.getForm();
var REASON = form.findField('Reason').getValue();
if (REASON == '' || REASON == null || REASON == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.ShanChuYuanYinBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //删除原因不能为空!
return;
};
var type = form.findField('FeeType').getValue();
_thisyjfee.onCreateDeleteClick(type);
}
}, {
text: Zi.LAN.FEE.CancelShen, //"取消申请",
minWidth: 70,
handler: function () {
_thisyjfee.winShenDeleteShow.close();
}
}]
});
this.AuditBackReasonDr = Ext.widget('form', {
frame: true,
region: 'east',
trackResetOnLoad: true,
hidden: true,
width: 300,
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: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.FEE.Reason4, //'驳回原因',
height: 70,
name: 'Reason',
anchor: '100%'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion
this.panelDrChFee = new Ext.Panel({
//title: '应收费用',
layout: "border",
region: 'east',
width: 580,
anchor: '100% 50%',
frame: true,
split: true,
items: [this.gridDrChFee, this.NewFeeShowDr, this.AuditBackReasonDr]
});
//#region 布局
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 29,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 96,
items: [this.formSearch]
});
this.panelBodyChFee = new Ext.Panel({
title: '业务明细',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.gridList]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.panelBodyChFee, this.panelDrChFee]
});
//#endregion
this.opStatus = 'add';
/*
parentWin = window.parent.opener;
{
if (parentWin) {
var ret = parentWin.OprationSwap();
var fun = ret[4];
}
}
*/
_thisyjfee = this;
this.gridDrChFee.getSelectionModel().on('select', function (model, record, index) {
var FeeStatus = record.data.FeeStatus;
var GId = record.data.GId;
if (FeeStatus == 3) {
this.NewFeeShowDr.setVisible(true);
this.storeChFeeModify.load({ params: { FeeID: GId, ApplyType: 2 },
callback: function (r, options, success) {
if (success) {
_thisyjfee.NewFeeShowDr.getForm().loadRecord(_thisyjfee.storeChFeeModify.getAt(0));
}
},
scope: this
});
} else {
this.NewFeeShowDr.setVisible(false);
}
if (FeeStatus == 6) {
var reason = this.AuditBackReasonDr.getForm().findField('Reason').setValue(record.data.Reason);
this.AuditBackReasonDr.setVisible(true);
} else {
this.AuditBackReasonDr.setVisible(false);
}
var FeeName = record.data.FeeName;
}, this);
this.InitData();
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='YJFEENAME'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
_thisyjfee.defFeeName = data.PARAMVALUE;
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='YJFEECURR'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
_thisyjfee.defFeeCurr = data.PARAMVALUE;
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg:'正在查询主表数据...', //'正在查询主表数据...',
url: '/Account/ChMonthClose/GetNowPeriod',
params: {
condition: ''
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
_thisyjfee.MsPeriod = data;
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='YJMUSTBEFEECLOSE'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
_thisyjfee.YJMUSTBEFEECLOSE = data.PARAMVALUE;
}
} else {
}
},
scope: this
});
}, //end initUIComponents
//#region 加载数据
InitData: function () {
var condition = '';
this.LoadData(this.opStatus, condition, this.RefBillNo);
}, //end InitData
LoadData: function (opstatus, condition, refbillno) {
this.feeCrSerialNo = 0;
this.feeCrBodyDel = [];
this.feeCrSerialNo = 0;
this.feeCrBodyDel = [];
this.opStatus = opstatus;
this.stroplb = 'op_Seae';
this.StoreCustType.add({ "SCUSTTYPE": "WTDW-委托单位", "CUSTTYPE": "委托单位", "CUSTNAME": "CUSTOMERNAME" });
this.StoreCustType.add({ "SCUSTTYPE": "CGS-船公司", "CUSTTYPE": "船公司", "CUSTNAME": "CARRIER" });
this.StoreCustType.add({ "SCUSTTYPE": "DCDL-订舱代理", "CUSTTYPE": "订舱代理", "CUSTNAME": "FORWARDER" });
this.StoreCustType.add({ "SCUSTTYPE": "BGH-报关行", "CUSTTYPE": "报关行", "CUSTNAME": "CUSTOMSER" });
this.StoreCustType.add({ "SCUSTTYPE": "CD-车队", "CUSTTYPE": "车队", "CUSTNAME": "TRUCKER" });
this.StoreCustType.add({ "SCUSTTYPE": "FHR-发货人", "CUSTTYPE": "发货人", "CUSTNAME": "SHIPPERID" });
this.StoreCustType.add({ "SCUSTTYPE": "SHR-收货人", "CUSTTYPE": "收货人", "CUSTNAME": "CONSIGNEEID" });
this.StoreCustType.add({ "SCUSTTYPE": "TZR-通知人", "CUSTTYPE": "通知人", "CUSTNAME": "NOTIFYPARTYID" });
this.StoreCustType.add({ "SCUSTTYPE": "DL-代理", "CUSTTYPE": "代理", "CUSTNAME": "AGENTID" });
this.StoreCustType.add({ "SCUSTTYPE": "CZ-场站", "CUSTTYPE": "场站", "CUSTNAME": "YARD" });
this.StoreCustType.add({ "SCUSTTYPE": "CDD-船代", "CUSTTYPE": "船代", "CUSTNAME": "SHIPAGENCY" });
this.StoreCustType.add({ "SCUSTTYPE": "", "CUSTTYPE": "", "CUSTNAME": "" });
this.StoreDrOpRange.load({ params: { optype: "modRecvFeeManagement"} });
this.StoreCrOpRange.load({ params: { optype: "modPayFeeManagement"} });
this.storeCustomerNameRef.load({ params: { condition: "" } });
this.storeFeeNameRef.load({ params: { condition: "ISSEA='1' "} });
}, // end LoadDate
//#endregion
//#region 明细操作
onNextKeyClick: function (type, col) {
var rows = this.gridDrChFee.getSelectionModel().getSelection();
var row = rows[rows.length - 1];
var s = this.gridDrChFee.getStore();
var number = s.indexOf(row) + 1;
if (number == this.gridDrChFee.getStore().getCount()) {
this.onAddDetailClick(s, event);
} else {
this.cellEditingDrChFee.startEditByPosition({ row: number, column: col });
}
},
onUpKeyClick: function (type, col) {
var rows = this.gridDrChFee.getSelectionModel().getSelection();
var row = rows[rows.length - 1];
var s = this.gridDrChFee.getStore();
var number = s.indexOf(row) - 1;
if (number < 0) number = 0;
this.cellEditingDrChFee.startEditByPosition({ row: number, column: col });
},
onAddDetailClick: function (button, event) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg:"当前会计期间已月末结账!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var store = null;
store = this.storeDrChFee;
var custtype = '';
var newSerialno = this.GetHandleSerialNo(store);
var newsort = store.getCount() + 1;
var myDate = new Date();
var exrate=1;
if (_thisyjfee.defFeeCurr == LOCALCURR) {
exrate=1;
} else {
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR',_thisyjfee.defFeeCurr);
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
exrate=ffdata.CRDEFRATE;
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', _thisyjfee.defFeeCurr);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
exrate=dfdata.CRDEFRATE;
} else {
exrate=0;
}
}
}
var record = null;
record = Ext.create('MsChFee', {
GId: NewGuid(),
BsNo: '*',
FeeStatus: 1,
FeeStatus_Ref: '录入状态',
FeeType: 2,
FeeName: _thisyjfee.defFeeName,
FeeDescription: '',
CustomerType: custtype,
CustomerName: '',
Unit: '单票',
UnitPrice: 0,
TaxUnitPrice: 0,
Quantity: 1,
TaxRate: 0,
NoTaxAmount: 0,
Amount: 0,
AccTaxRate: 0,
Currency:_thisyjfee.defFeeCurr,
ExChangerate: exrate,
Reason: '',
Remark: '',
Commissionrate: 0,
Settlement: 0,
Invoice: 0,
OrderAmount: 0,
OrderInvoice: 0,
SubmitDate: null,
Auditoperator: '',
AuditDate: null,
EnteroPerator: USERID,
OpName: SHOWNAME,
EnterDate: myDate,
DebitNo: '',
IsDebit: "0",
IsOpen: "1",
IsAdvancedpay: "0",
Sort: newSerialno,
IsInvoice: "0",
FeeFrt: '',
IsCrmOrderFee: "0",
ISACC: "0",
AuditStatus: 0,
InvoiceNum: '',
ChequeNum: '',
LOCALCURR: LOCALCURR,
WmsOutBsNo: this.WMSOUTBSNO,
UNINVOICE: 0
});
var z = store.add(record);
var editColumnIndex = 0;
var cellediting = null;
cellediting = this.cellEditingDrChFee;
editColumnIndex = 4;
var n = store.getCount();
var feeid = z[0].internalId;
var rown = store.data.keys.indexOf(feeid);
cellediting.startEditByPosition({ row: rown, column: editColumnIndex });
},
onCancelDetailClick: function (menu, event) {
var store = null;
store = this.storeDrChFee;
for (var i = 0; i < store.getCount(); i += 1) {
var member = store.getAt(i);
member.reject();
}
},
GetHandleSerialNo: function (store) {
var result = 0;
if (result == 0) {
for (var i = 0; i < store.getCount(); i += 1) {
var member = store.getAt(i);
if (parseInt(member.data.Sort) > parseInt(result)) {
result = member.data.Sort;
}
}
}
result = parseInt(result) + 1;
return result;
},
onDelDetailClick: function (button, event) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg:"当前会计期间已月末结账!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var feeGidSql = '';
var selectedRecords = [];
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
var candelete = this.CheckChFeeDelete(selectedRecords, 1);
if (candelete == false)
return;
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
Ext.MessageBox.confirm(Zi.LAN.FEE.TiShi, '确定要删除选中的费用吗?', function (btn) {
if (btn == 'yes') {
if (selectedRecords.length > 0) {
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.BsNo == "*") //如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeDrChFee.remove(selectedRecords[i]);
} else {
var feeGId = "'" + rec.data.GId + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
}
}
}
_thisyjfee = this;
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
if (feeGidSql != '') {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在删除数据...',
url: '/MvcShipping/MsChFee/Delete',
params: {
bsno: _thisyjfee.strBSNO,
data: feeGidSql
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
for (var i = 0; i < selectedRecords.length; i++) {
this.storeDrChFee.remove(selectedRecords[i]);
}
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.FEE.JingGao, msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: "删除成功!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
}
}, this);
},
CheckChFeeDelete: function (records, type) {
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: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengShanChuFuHeTiaoJianDeFeiYong, //'只能删除费用状态为[录入状态]和[驳回提交]的费用,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
if (canDelete) {
var op = rec.data.EnteroPerator;
var opname = rec.data.OpName;
if (type == 1) {
var recop = DsStoreQueryBy(this.StoreDrOpRange, 'OPID', op);
if (recop.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限删除' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
}
} else if (type == 2) {
var recop = DsStoreQueryBy(this.StoreCrOpRange, 'OPID', op);
if (recop.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限删除' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
}
}
}
if (canDelete) {
if (rec.data.Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //当前费用已开出发票无法删除!'
canDelete = false;
}
}
if (canDelete) {
if (rec.data.OrderAmount != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //当前费用已申请费用无法删除!'
canDelete = false;
}
}
if (canDelete) {
if (rec.data.OrderInvoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //当前费用已申请开票无法删除!'
canDelete = false;
}
}
if (canDelete) {
if (rec.data.IsDebit == 'True' || rec.data.IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //当前费用已対帐无法删除!'
canDelete = false;
}
}
}
return canDelete;
},
onPostDetailClick: function (button, event) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i);
bodyDrChFeeDatas.push(memberyf);
var ExChangerate = memberyf.data.ExChangerate;
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
_thisyjfee = this;
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsChFee/Save',
scope: this,
params: {
bsno: _thisyjfee.strBSNO,
chfeebody: jsonChFeeBody,
isyj:'1'
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_thisyjfee.LoadDrChFee();
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onShenModifyClick: function (button, event) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg:"当前会计期间已月末结账!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var selectedRecords = [];
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
if (selectedRecords.count == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var rec = selectedRecords[0];
if (rec.data.FeeStatus != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongZhangTaiWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.Settlement != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiJieSuanWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.IsDebit == 'True' || rec.data.IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //当前费用已対帐无法申请修改!'
return;
}
if (rec.data.Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.OrderAmount != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.OrderInvoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.DataLoading = true;
this.NewFeeEdit.getForm().loadRecord(rec);
this.OldFee.getForm().loadRecord(rec);
this.DataLoading = false;
this.winShenModifyShow.show();
},
onCreateModifyClick: function (type) {
var feeGIdSql = '';
var form = this.NewFeeEdit.getForm();
var data = this.NewFeeEdit.getForm().getValues();
var olddata = this.OldFee.getForm().getValues();
_thisyjfee = this;
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: '/Account/Chfee_Audit/ShenModify',
params: {
data: Ext.JSON.encode(data),
olddata: Ext.JSON.encode(olddata),
optype: _thisyjfee.stroplb,
isyj:'1'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisyjfee.LoadDrChFee();
_thisyjfee.winShenModifyShow.close();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
},
onShenDeleteClick: function (button, event, type) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg:"当前会计期间已月末结账!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var selectedRecords = [];
if (type == '1') {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
}
if (selectedRecords.count == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //没有选择要申请删除的业务!
return;
}
var rec = selectedRecords[0];
if (rec.data.FeeStatus != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongZhuangTaiWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.Settlement != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiJieSuanWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.SangQianFeiYongYiKaiChuFaPiaoWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.IsDebit == 'True' || rec.data.IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //当前费用已対帐无法申请删除!'
return;
}
if (rec.data.OrderAmount != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.OrderInvoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.DataLoading = true;
this.DeleteFee.getForm().loadRecord(rec);
this.DataLoading = false;
this.winShenDeleteShow.show();
},
onCreateDeleteClick: function (type) {
var feeGIdSql = '';
var form = this.DeleteFee.getForm();
var data = this.DeleteFee.getForm().getValues();
_thisyjfee = this;
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在申请删除...',
url: '/Account/Chfee_Audit/ShenDelete',
params: {
data: Ext.JSON.encode(data),
optype: _thisyjfee.stroplb,
isyj:'1'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisyjfee.LoadDrChFee();
_thisyjfee.winShenDeleteShow.close();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
},
onCancelShenClick: function (button, event, type) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg:"当前会计期间已月末结账!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var selectedRecords = [];
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
if (selectedRecords.count == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //没有选择要取消申请的业务!
return;
}
var rec = selectedRecords[0];
if (rec.data.FeeStatus != 3 && rec.data.FeeStatus != 4) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongZhuangTaiWuFaQuXiaoShenQing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
// var bodyDrChFeeDatas = [];
// bodyDrChFeeDatas.push(rec);
// var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在取消申请...',
url: '/Account/Chfee_Audit/CancelShenYj',
params: {
Feeid: rec.data.GId,
optype: _thisyjfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
this.LoadDrChFee(button, event);
this.NewFeeShowDr.setVisible(false);
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
},
onViewDetailClick: function (button, event, type) {
var openSet = "height=740, width=890, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 540) / 2 + ",Left= " + (screen.width - 890) / 2
var openType = "_blank";
//打开费用“历史信息查询”页面
// var openUrl = "../../Shipping/FeeHistory.aspx?bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type;
var openUrl = "../../MvcShipping/MsOpBill/MsFeeHistoryView??bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type;
window.open(openUrl, openType, openSet);
},
getAllowOperationDetail: function () {
// return true;
var accdate=_thisyjfee.EditRecord.get('ACCDATE');
var oDate1 = new Date(accdate + '-01');
var oDate2 = new Date(_thisyjfee.MsPeriod.PERIOD + '-01');
if (oDate1.getTime() >= oDate2.getTime()) return true;
else return false;
if (this.YJMUSTBEFEECLOSE == 1) {
var feeStatus = this.getFeeStatus();
if (feeStatus == '0' || feeStatus == '' || typeof (feeStatus) == 'undefined' || feeStatus == false || feeStatus == 'false')
return true;
else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: "此票委托已费用已锁定,不允许操作费用!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return false;
}
}
},
//#endregion
InitDrGrid: function (grid) {
_thisyjfee = this;
var agirdcolums = grid;
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='Feenotopen'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
_thisyjfee.gridDrChFee.reconfigure(_thisyjfee.storeDrChFee, agirdcolums);
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == 'IsOpen')
agirdcolums[j].hidden = false;
}
} else {
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == 'IsOpen')
agirdcolums[j].hidden = true;
}
}
_thisyjfee.gridDrChFee.reconfigure(_thisyjfee.storeDrChFee, agirdcolums);
}
} else {
_this.gridDrChFee.reconfigure(_this.storeDrChFee, agirdcolums);
}
},
scope: this
});
},
//#region 表格的AfterEdit
gridListChFeeAfterEdit: function (editor, e, eOpts) {
if (e.value == e.originalValue) return;
//var BSNO = e.record.get('BSNO');
if (e.field == 'UnitPrice') {
var unitPrice = e.record.data['UnitPrice'];
var quantity = e.record.data['Quantity'];
var taxrate = e.record.data['TaxRate'];
if (taxrate != null) {
var taxrateb = Add(1, Div(taxrate, 100));
//parseFloat(1 + parseFloat(taxrate).mul(0.01));
var TaxUnitPrice = Mul(unitPrice, taxrateb);
//(parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
var notaxamount = Mul(unitPrice, quantity); //(parseFloat(unitPrice).mul(quantity)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount);
////taxrate = Div(taxrate, 100);
//parseFloat(taxrate).mul(0.01);
// tax = notaxamount * taxrate;
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
var amount = Add(notaxamount, tax); //(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);// e.record.set('Amount', Ext.util.Format.number(amount, '0.00'));
e.record.set('Amount', amount);
}
else if (e.field == 'CustomerName') {
var records = DsStoreQueryBy(this.storeCustomerNameRef, 'CustName', e.value);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var FEEFRT = data.FEEFRT;
if (FEEFRT != '')
e.record.set('FeeFrt', FEEFRT);
}
}
else if (e.field == 'TaxUnitPrice') {
var TaxUnitPrice = e.record.data['TaxUnitPrice'];
// if (e.value != 0) {
var quantity = e.record.data['Quantity'];
var taxrate = e.record.data['TaxRate'];
var taxrateb = Add(1, Div(taxrate, 100), 4); //parseFloat(1 + parseFloat(taxrate).mul(0.01));
var unitPrice = Div(TaxUnitPrice, taxrateb); //(parseFloat(TaxUnitPrice).div(parseFloat(taxrateb))).toFixed(2);
e.record.set('UnitPrice', unitPrice);
if (quantity != null) {
var amount = Mul(TaxUnitPrice, quantity);
//(parseFloat(TaxUnitPrice).mul(quantity)).toFixed(2);
e.record.set('Amount', amount);
var notaxamount = Div(amount, taxrateb);
//(parseFloat(amount).div(taxrateb)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount);
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
}
// }
} else if (e.field == 'Quantity') {
var unitPrice = e.record.data['UnitPrice'];
var quantity = e.record.data['Quantity'];
var TaxUnitPrice = e.record.data['TaxUnitPrice'];
var taxrate = e.record.data['TaxRate'];
if (taxrate != null) {
var taxrateb = Add(1, Div(taxrate, 100));
if ((TaxUnitPrice == null || TaxUnitPrice == 0 || TaxUnitPrice == NaN) && (unitPrice != null)) {
var TaxUnitPrice = Mul(unitPrice, taxrateb);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
}
if (unitPrice != null) {
var notaxamount = Mul(unitPrice, quantity); //(parseFloat(unitPrice).mul(quantity)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount);
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
}
if (TaxUnitPrice != null) {
var amount = Mul(TaxUnitPrice, quantity); //(parseFloat(unitPrice).mul(quantity)).toFixed(2);
e.record.set('Amount', amount);
}
}
else if (e.field == 'FeeName') {
var records = DsStoreQueryBy(this.storeFeeNameRef, 'Name', e.value);
var FEENAME = e.value;
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var Currency = data.DefaultCurr;
var Description = data.Description;
var DEFAULTUNIT = data.DefaultUnit;
var DefaultDebitRef = data.DefaultDebitRef;
var DefaultCreditRef = data.DefaultCreditRef;
var UNIT = '';
var custtype = '';
var FeeType = e.record.data['FeeType'];
var codeFEETYPE = data.FEETYPE;
var FEEFRT = data.FEEFRT;
//alert(codeFEETYPE);
e.record.set('Currency', Currency);
e.record.set('FeeDescription', Description);
if (FEEFRT != '') {
e.record.set('FeeFrt', FEEFRT);
}
if (DEFAULTUNIT == "1" || DEFAULTUNIT == "11") {
e.record.set('Unit', "单票");
e.record.set('Quantity', 1);
UNIT = '单票';
} else if (DEFAULTUNIT == "2") {
e.record.set('Unit', "重量");
UNIT = '重量';
//设置重量,如果是进口的设置净重 Quantity
//获取业务类型 获取重量 设置
} else if (DEFAULTUNIT == "5") {
e.record.set('Unit', "TEU");
UNIT = 'TEU';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else if (DEFAULTUNIT == "6") {
e.record.set('Unit', "净重");
UNIT = '净重';
//如果是进口的设置净重
} else if (DEFAULTUNIT == "10" || DEFAULTUNIT == "3") {
e.record.set('Unit', "尺码");
UNIT = '尺码';
//如果是进口的设置净重
} else if (DEFAULTUNIT == "9") {
var Unitrecords = DsStoreQueryLikeBy(this.StoreUnit, 'UNIT', 1, '2');
if (Unitrecords.getCount() > 0) {
var ffdata = Unitrecords.getAt(0).data;
var aUNIT = ffdata.UNIT;
e.record.set('Unit', aUNIT);
UNIT = aUNIT;
} else {
var Unitrecords = DsStoreQueryLikeBy(this.StoreUnit, 'UNIT', 1, '4');
if (Unitrecords.getCount() > 0) {
var ffdata = Unitrecords.getAt(0).data;
var aUNIT = ffdata.UNIT;
e.record.set('Unit', aUNIT);
UNIT = aUNIT;
}
}
//如果是进口的设置净重
} else {
e.record.set('Unit', DEFAULTUNIT);
UNIT = DEFAULTUNIT;
}
if (Currency != LOCALCURR) {
var FeeType = e.record.data['FeeType'];
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', Currency);
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
if (FeeType == 2)
var DEFRATE = ffdata.CRDEFRATE;
else
var DEFRATE = ffdata.DEFRATE;
e.record.set('ExChangerate', DEFRATE);
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', Currency);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
if (FeeType == 2)
var DEFRATE = dfdata.CRDEFRATE;
else
var DEFRATE = dfdata.DEFRATE;
e.record.set('ExChangerate', DEFRATE);
} else {
e.record.set('ExChangerate', 0);
}
}
} else { e.record.set('ExChangerate', 1); };
var Unitrecords = DsStoreQueryBy(this.StoreUnit, 'UNIT', UNIT);
var QUANTITY = 1;
if (Unitrecords.getCount() > 0) {
var Unitdata = Unitrecords.getAt(0).data;
QUANTITY = Unitdata.QUANTITY;
if ((UNIT == '重量') && (QUANTITY == 0)) {
Unitrecords = DsStoreQueryBy(this.StoreUnit, 'UNIT', '净重');
if (Unitrecords.getCount() > 0) {
Unitdata = Unitrecords.getAt(0).data;
QUANTITY = Unitdata.QUANTITY;
}
}
e.record.set('Quantity', QUANTITY);
} else {
e.record.set('Quantity', 1);
}
var taxrate = e.record.data['TaxRate'];
if (taxrate == null) taxrate = 0;
var unitPrice = e.record.data['UnitPrice'];
var notaxamount = Mul(unitPrice, QUANTITY); //(parseFloat(unitPrice).mul(QUANTITY)).toFixed(2);
if (notaxamount == null || notaxamount == NaN) notaxamount = 0;
e.record.set('NoTaxAmount', notaxamount); //taxrate = parseFloat(taxrate) / 100;
var tax = Mul3(notaxamount, taxrate, 0.01); //parseFloat(notaxamount).mul(taxrate);
var amount = Add(notaxamount, tax); //(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
if (amount == null || amount == NaN) amount = 0;
e.record.set('Amount', amount);
// var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
var CustomerName = e.record.data['CustomerName'];
if (CustomerName == '') {
if (FeeType == 2) {
var recordcust = DsStoreQueryBy(this.StoreCustType, 'CUSTTYPE', DefaultCreditRef);
if (recordcust.getCount() > 0) {
var data = recordcust.getAt(0).data;
var CUSTNAME = this.EditRecord.get(data.CUSTNAME);
e.record.set('CustomerType', DefaultCreditRef);
e.record.set('CustomerName', CUSTNAME);
} else {
}
} else {
var recordcust = DsStoreQueryBy(this.StoreCustType, 'CUSTTYPE', DefaultDebitRef);
if (recordcust.getCount() > 0) {
var data = recordcust.getAt(0).data;
var CUSTNAME = this.EditRecord.get(data.CUSTNAME);
e.record.set('CustomerType', DefaultDebitRef);
e.record.set('CustomerName', CUSTNAME);
} else {
}
}
}
} else {
e.record.set('Currency', LOCALCURR);
e.record.set('FeeDescription', '');
}
}
else if (e.field == 'TaxRate') {
var taxrate = e.record.data['TaxRate'];
var unitPrice = e.record.data['UnitPrice'];
var quantity = e.record.data['Quantity'];
if (unitPrice != null) {
var taxrateb = Add(1, Div(taxrate, 100, 4), 4);
//parseFloat(1 + parseFloat(taxrate).mul(0.01));
var TaxUnitPrice = Mul(unitPrice, taxrateb);
//(parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
var notaxamount = e.record.data['NoTaxAmount'];
////taxrate = Div(taxrate, 100);
//parseFloat(taxrate).mul(0.01);
var tax = Div(Mul(notaxamount, taxrate), 100);
//parseFloat(notaxamount).mul(taxrate);
var amount = Add(notaxamount, tax);
//(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
e.record.set('Amount', amount);
e.record.set('Tax', tax);
}
else if (e.field == 'NoTaxAmount') {
var taxrate = e.record.data['TaxRate'];
var notaxamount = e.record.data['NoTaxAmount'];
////taxrate = parseFloat(taxrate).mul(0.01);
var tax = Div(Mul(notaxamount, taxrate), 100);
//parseFloat(notaxamount).mul(taxrate);
var amount = Add(notaxamount, tax);
//(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
e.record.set('Amount', amount);
e.record.set('Tax', tax);
/*
var amount = parseFloat(notaxamount) + parseFloat(notaxamount * taxrate / 100);
e.record.set('Amount', Ext.util.Format.number(amount, '0.00'));
*/
}
else if (e.field == 'Amount') {
var taxrate = e.record.data['TaxRate'];
var amount = e.record.data['Amount'];
if (taxrate != null) {
var taxrateb = Add(1, Mul(taxrate, 0.01)); //parseFloat(1 + parseFloat(taxrate.mul(0.01)));
var notaxamount = Div(amount, taxrateb); //(parseFloat(amount).div(taxrateb)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount);
var quantity = e.record.data['Quantity'];
if (quantity != null && quantity != 0) {
var unitPrice = Div(notaxamount, quantity); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
e.record.set('UnitPrice', unitPrice);
var TaxUnitPrice = Div(amount, quantity);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
};
}
else if (e.field == 'Unit') {
var records = DsStoreQueryBy(this.StoreUnit, 'UNIT', e.value);
var QUANTITY = 1;
if (records.getCount() > 0) {
var data = records.getAt(0).data;
QUANTITY = data.QUANTITY;
e.record.set('Quantity', QUANTITY);
} else {
e.record.set('Quantity', 1);
}
var taxrate = e.record.data['TaxRate'];
if (taxrate == null) taxrate = 0;
var unitPrice = e.record.data['UnitPrice'];
var notaxamount = Mul(unitPrice, QUANTITY); //(parseFloat(unitPrice).mul(QUANTITY)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount); //taxrate = parseFloat(taxrate) / 100;
var tax = Mul3(notaxamount, taxrate, 0.01); //parseFloat(notaxamount).mul(taxrate);
var amount = Add(notaxamount, tax); //(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
e.record.set('Amount', amount);
e.record.set('Tax', tax);
} else if (e.field == 'Currency') {
var FeeType = e.record.data['FeeType'];
if (e.value == LOCALCURR) {
e.record.set('ExChangerate', 1);
} else {
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', e.value);
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
if (FeeType == 2)
var DEFRATE = ffdata.CRDEFRATE;
else
var DEFRATE = ffdata.DEFRATE;
e.record.set('ExChangerate', DEFRATE);
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', e.value);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
if (FeeType == 2)
var DEFRATE = dfdata.CRDEFRATE;
else
var DEFRATE = dfdata.DEFRATE;
e.record.set('ExChangerate', DEFRATE);
} else {
e.record.set('ExChangerate', 0);
}
}
}
} else if (e.field == 'CustomerType') {
var records = DsStoreQueryBy(this.StoreCustType, 'CUSTTYPE', e.value);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var CUSTNAME = this.EditRecord.get(data.CUSTNAME);
e.record.set('CustomerName', CUSTNAME);
} else {
// e.record.set('CustomerName', 0);
}
}
},
setHeadFieldValue: function (fieldName, value) {
var field = this.formtotal.getForm().findField(fieldName);
field.setValue(value);
},
//#endregion
cellEditingChFeeBeforeEdit: function (editor, e) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
return false;
}
var chfeefeeStatus = e.record.get('FeeStatus');
var canedit = chfeefeeStatus == 1 || chfeefeeStatus == 6 || chfeefeeStatus == 2;
var IsDebit = e.record.get('IsDebit');
if (canedit) {
if (IsDebit == 'True' || IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //当前费用已対帐无法修改!
canedit = false;
}
};
if (canedit) {
if (e.record.get('Invoice') != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
if (canedit) {
if (e.record.get('OrderAmount') != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
if (canedit) {
if (e.record.get('OrderInvoice') != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
if (canedit) {
var type = e.record.get('FeeType');
var op = e.record.get('EnteroPerator');
var opname = e.record.get('OpName');
if (type == 1) {
var records = DsStoreQueryBy(this.StoreDrOpRange, 'OPID', op);
if (records.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限修改' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
} else if (type == 2) {
var records = DsStoreQueryBy(this.StoreCrOpRange, 'OPID', op);
if (records.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限修改' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
}
return canedit;
},
refBillNoSeChange: function (field, newValue, oldValue) {
// if (newValue != oldValue) {
// alert(newValue + "," + oldValue);
// }
},
onSubmitAuditClick: function (button, event, type) {
var GidStr = '';
var allow = this.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
store = this.storeDrChFee;
var modifyrecords = store.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = store.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var records = this.feeDrGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYaoTiJiaoShenHeDeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要提交审核的费用!
return;
}
var insert;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (this.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (this.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
if (insert == true) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var iSuccess = 0;
var iFailure = 0;
var postCount = 0;
var postBillNO = "";
var loadVal = 0;
var bodyDrChFeeDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong, //'只能费用状态为[录入状态]和[驳回提交]的费用才能提交审核,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
bodyDrChFeeDatas.push(rec);
GidStr = GidStr + Gid;
}
}
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
_thisyjfee = this;
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: '/Account/Chfee_Audit/SubmitAuditNewYj',
params: {
feebody: jsonChFeeBody,
optype: _thisyjfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisyjfee.LoadDrChFee(button, event);
if (result.Data != '') {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: '已提交审核,' + result.Data,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditNewClick: function (button, event, type) {
var GidStr = '';
var allow = this.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
store = this.storeDrChFee;
var modifyrecords = store.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = store.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYaoTiJiaoShenHeDeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var insert;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //客户名称不能为空!
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (this.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //客户类别为空,不能提交!
return;
};
}
if (this.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
if (insert == true) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var iSuccess = 0;
var iFailure = 0;
var postCount = 0;
var postBillNO = "";
var loadVal = 0;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong, //'只能费用状态为[录入状态]和[驳回提交]的费用才能提交审核,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
}
_thisyjfee = this;
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: '/Account/Chfee_Audit/SubmitAuditYj',
params: {
GidStr: GidStr,
optype: _thisyjfee.stroplb,
bsno: _thisyjfee.strBSNO
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisyjfee.LoadDrChFee(button, event);
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditAllClick: function (button, event, type) {
var GidStr = '';
var allow = this.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
store = this.storeDrChFee;
for (var i = 0; i < store.getCount(); i++) {
var rec = store.getAt(i);
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (this.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (this.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
var modifyrecords = store.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = store.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i);
bodyDrChFeeDatas.push(memberyf);
var ExChangerate = memberyf.data.ExChangerate;
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
_thisyjfee = this;
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsChFee/Save',
scope: this,
params: {
bsno: _thisyjfee.strBSNO,
type: type,
chfeebody: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
for (var i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var member = this.storeDrChFee.getAt(i);
member.set("BsNo", _thisyjfee.strBSNO);
member.commit();
}
this.onSubmitAuditAllfn(button, event, type);
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
} else {
this.onSubmitAuditAllfn(button, event, type);
}
},
onSubmitAuditAllfn: function (button, event, type) {
var GidStr = '';
var store = null;
store = this.storeDrChFee;
var bodyDrChFeeDatas = [];
for (var i = 0; i < store.getCount(); i++) {
var rec = store.getAt(i);
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
} else {
bodyDrChFeeDatas.push(rec);
GidStr = GidStr + ',' + Gid;
}
}
_thisyjfee = this;
if (GidStr == '') {
} else {
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: '/Account/Chfee_Audit/SubmitAuditNewYj',
params: {
feebody: jsonChFeeBody,
optype: _thisyjfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisyjfee.LoadDrChFee(button, event);
if (result.Data != '' && result.Data != null) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: '已提交审核,' + result.Data,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditBillClick: function (button, event, type) {
var GidStr = '';
var allow = this.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
store = this.storeDrChFee;
for (var i = 0; i < this.storeDrChFee.getCount(); i++) {
var rec = this.storeDrChFee.getAt(i);
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (this.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (this.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //FRT为空,不能提交!
return;
};
}
}
var modifyrecords = this.storeDrChFee.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = this.storeDrChFee.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i);
bodyDrChFeeDatas.push(memberyf);
var ExChangerate = memberyf.data.ExChangerate;
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
_thisyjfee = this;
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsChFee/Save',
scope: this,
params: {
bsno: _thisyjfee.strBSNO,
type: type,
chfeebody: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
for (var i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var member = this.storeDrChFee.getAt(i);
member.set("BsNo", _thisyjfee.strBSNO);
member.commit();
}
this.onSubmitAuditBillfn(button, event, type);
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
} else {
this.onSubmitAuditBillfn(button, event, type);
}
},
onSubmitAuditBillfn: function (button, event, type) {
var GidStr = '';
var bodyDrChFeeDatas = [];
for (var i = 0; i < this.storeDrChFee.getCount(); i++) {
var rec = this.storeDrChFee.getAt(i);
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
} else {
bodyDrChFeeDatas.push(rec);
GidStr = GidStr + ',' + Gid;
}
}
_thisyjfee = this;
if (GidStr == '') {
} else {
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: '/Account/Chfee_Audit/SubmitAuditBLYj',
params: {
feebody: jsonChFeeBody,
optype: _thisyjfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisyjfee.LoadDrChFee(button, event);
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onCancelAuditNewClick: function (menu, event, type) {
var GidStr = '';
var allow = this.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
store = this.storeDrChFee;
var modifyrecords = store.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = store.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var records = this.feeDrGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var iSuccess = 0;
var iFailure = 0;
var postCount = 0;
var postBillNO = "";
var loadVal = 0;
var bodyDrChFeeDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 2;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong2, //'只能费用状态为[提交审核]的费用才能撤销提交审核,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
bodyDrChFeeDatas.push(rec);
}
}
_thisyjfee = this;
if (GidStr == '') {
} else {
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: '/Account/Chfee_Audit/CancelAuditYj',
params: {
GidStr: GidStr,
optype: _thisyjfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisyjfee.LoadDrChFee();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onViewWorkFlowDetailClick:function(button, event, type){
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = records[0];
var feeStatus = record.data.FeeStatus;
var Gid = record.data.GId;
var WorkFlowName = "YjFeefyAudit";
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
var openUrl = "../../Account/Chfee_payapplication/Map?bsno=" + Gid + "&name=" + WorkFlowName;
window.open(openUrl, openType, openSet);
},
onNoIvoiceClick: function (button, event, type) {
var GidStr = '';
var records = this.feeDrGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
_this = this;
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在提交数据...',
url: '/Account/Chfee_Audit/NoIvoice',
params: {
bill: GidStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisyjfee.LoadDrChFee();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onCancelNoIvoiceClick: function (button, event, type) {
var GidStr = '';
var records = this.feeDrGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
// isAll = this.comboxaddDCType.getValue();
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
_this = this;
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在提交数据...',
url: '/Account/Chfee_Audit/CancelNoIvoice',
params: {
bill: GidStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisyjfee.LoadDrChFee();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
getModifyStatus: function () {
var drmodify = this.storeDrChFee.getModifiedRecords();
if (drmodify.length != 0) {
return true
} else {
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i);
if (memberyf.data.BsNo == "*")
return true
}
return false;
}
},
getFeeStatus: function () {
var feeStatus = this.EditRecord.get('FEESTATUS');
return feeStatus;
/*
//if (this.EditRecord == null || typeof (this.EditRecord) == 'undefined') {
// return '';
//} else {
var feeStatus = this.EditRecord.get('FEESTATUS');
if (typeof (this.EditRecord) == 'undefined') {
return "0";
} else {
return feeStatus;
}
//}
*/
},
getBillStatus: function () {
// var basicForm = this.formEdit.getForm();
// var billStatus = basicForm.findField('BillStatus').value;
// return billStatus;
},
getCustName: function () {
// var custName = this.formEdit.getForm().findField('RefCustomerName');
//return custName.getValue();
},
onImportDetailClick: function (button, event) {
me = this;
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 20,
frame: true,
autoScroll: false,
border: false,
fileUpload: true,
items: [{
xtype: 'fileuploadfield',
id: 'LoadExcel',
name: 'LoadExcel',
emptyText: '请选择EXCEL文件',
fieldLabel: 'EXCEL',
buttonText: '选择文件',
allowBlank: false,
width: 200,
buttonCfg:
{
iconCls: 'uploaddialog'
},
anchor: '98%'
}],
buttons: [{
text: '上传',
type: 'submit',
handler: function () {
var UserFilePath = Ext.getCmp('LoadExcel').getValue();
if (!CheckFileExt(UserFilePath, /.xls|.xlsx|.csv/i)) {
Ext.Msg.show({ title: '错误', msg: '请选择EXCEL文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/MvcShipping/MsChFee/ImportFee',
waitMsg: 'UpLoading',
method: 'POST',
// params: {
// bsno: BSNO
// },
success: function (form, action) {
win.close(this);
Ext.Msg.show({ title: '提示', msg:action.result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
failure: function (form, action) {
form.reset();
if (action.failureType == Ext.form.Action.SERVER_INVALID)
Ext.MessageBox.alert('警告', action.result.Message);
}
});
}
}, {
text: '关闭',
type: 'submit',
handler: function () {
win.close(this);
}
}]
});
var win = new Ext.Window({
title: "上传 EXCEL",
width: 380,
height: 120,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
return;
},
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition())
return;
this.PageSize = this.Pagenum.getValue();
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql, type: locktype },
waitMsg: "正在查询数据...",
scope: this
});
},
onDsQuery: function (button, event) {
this.PageSize = this.Pagenum.getValue();
var sql = this.sqlcontext;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql, type: locktype },
waitMsg: "正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
/*
var sqldata = form.getValues();
sql = Ext.JSON.encode(sqldata);
*/
var mblNo = form.findField('PS_MBLNO').getValue();
sql = sql + getAndConSql(sql, mblNo, " (B.CUSTNO like '%" + mblNo + "%' or B.MBLNO like '%" + mblNo + "%' or B.HBLNO like '%" + mblNo + "%' or B.CUSTOMNO like '%" + mblNo + "%' or B.ORDERNO like '%" + mblNo + "%')");
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " B.OPDATE>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " B.OPDATE<='" + expDate_Max + " 23:59:59'");
var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Min, " B.ETD>='" + etdDate_Min + "'");
var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Max, " B.ETD<='" + etdDate_Max + " 23:59:59'");
var accDate_Min = form.findField('PS_ACCDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, accDate_Min, " B.ACCDATE>='" + accDate_Min + "'");
var accDate_Max = form.findField('PS_ACCDATEEND').getRawValue();
sql = sql + getAndConSql(sql, accDate_Max, " B.ACCDATE<='" + accDate_Max + "'");
var ENTERP = form.findField('PS_ENTERP').getValue();
sql = sql + getAndConSql(sql, ENTERP, "B.ENTERP='" + ENTERP + "'");
var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "B.CUSTOMERNAME='" + CUSTOMERNAME + "'");
var SALE = form.findField('PS_SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "B.SALE='" + SALE + "'");
var OP = form.findField('PS_OP').getValue();
sql = sql + getAndConSql(sql, OP, "B.OP='" + OP + "'");
var BSTYPE = form.findField('PS_BSTYPE').getValue();
sql = sql + getAndConSql(sql, BSTYPE, "B.BSTYPE='" + BSTYPE + "'");
var OPLB = form.findField('PS_OPLB').getValue();
sql = sql + getAndConSql(sql, OPLB, "B.OPLBNAME='" + OPLB + "'");
var VESSEL = form.findField('PS_VESSEL').getValue();
sql = sql + getAndConSql(sql, VESSEL, "B.VESSEL like '%" + VESSEL + "%'");
var VOYNO = form.findField('PS_VOYNO').getValue();
sql = sql + getAndConSql(sql, VOYNO, "B.VOYNO like '%" + VOYNO + "%'");
// var GOODSNAME = form.findField('PS_GOODSNAME').getValue();
// sql = sql + getAndConSql(sql, GOODSNAME, "B.GOODSNAME like '%" + GOODSNAME + "%'");
var PS_OPLOCK = form.findField('PS_OPLOCK').getValue();
if (PS_OPLOCK == '已锁定')
sql = sql + getAndConSql(sql, PS_OPLOCK, "B.BSSTATUS=1");
else if (PS_OPLOCK == '未锁定')
sql = sql + getAndConSql(sql, PS_OPLOCK, "B.BSSTATUS=0");
var PS_FEELOCK = form.findField('PS_FEELOCK').getValue();
if (PS_FEELOCK == '已锁定')
sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=1");
else if (PS_FEELOCK == '未锁定')
sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=0");
var ISFEEUP = form.findField('ISFEEUP').getValue();
if (ISFEEUP == '0') {
sql = sql + getAndConSql(sql, ISFEEUP, " NOT EXISTS (select 1 from OP_STATUS WHERE B.BSNO=OP_STATUS.BSNO AND OP_STATUS.STTYPE='2') ");
} else if (ISFEEUP == '1') {
sql = sql + getAndConSql(sql, ISFEEUP, " EXISTS (select 1 from OP_STATUS WHERE B.BSNO=OP_STATUS.BSNO AND OP_STATUS.STTYPE='2') ");
}
var FSTATUS = form.findField('FSTATUS').getValue();
if (FSTATUS == '' || FSTATUS == null || FSTATUS == undefined || FSTATUS == 0) {
}
else {
if (sql == '') {
if (FSTATUS == 1) {
sql = ' EXISTS (select 1 from CH_FEE WHERE B.BSNO=CH_FEE.BSNO AND (CH_FEE.FEESTATUS=0 or CH_FEE.FEESTATUS=8 or CH_FEE.FEESTATUS=9) AND CH_FEE.FEESTATUS<>1 AND CH_FEE.FEESTATUS<>2) '
} else if (FSTATUS == 2) {
sql = ' EXISTS (select 1 from CH_FEE WHERE B.BSNO=CH_FEE.BSNO AND (CH_FEE.FEESTATUS!=0 AND CH_FEE.FEESTATUS!=8 AND CH_FEE.FEESTATUS!=9) AND (CH_FEE.FEESTATUS=1 OR CH_FEE.FEESTATUS=2)) '
}
}
else {
if (FSTATUS == 1) {
sql = sql + ' AND EXISTS (select 1 from CH_FEE WHERE B.BSNO=CH_FEE.BSNO AND (CH_FEE.FEESTATUS=0 or CH_FEE.FEESTATUS=8 or CH_FEE.FEESTATUS=9) AND CH_FEE.FEESTATUS<>1 AND CH_FEE.FEESTATUS<>2) '
} else if (FSTATUS == 2) {
sql = sql + ' AND EXISTS (select 1 from CH_FEE WHERE B.BSNO=CH_FEE.BSNO AND (CH_FEE.FEESTATUS!=0 AND CH_FEE.FEESTATUS!=8 AND CH_FEE.FEESTATUS!=9) AND (CH_FEE.FEESTATUS=1 OR CH_FEE.FEESTATUS=2)) '
}
}
}
return sql;
},
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return false;
}
return true;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
setSaveBtnStatus: function (enable) {
var bsbtnSave = Ext.getCmp('pcbtnSave');
var bsbtnSaveAndClose = Ext.getCmp('pcbtnSaveAndClose');
var bsbtnSaveAndNew = Ext.getCmp('pcbtnSaveAndNew');
var pcbtnNew = Ext.getCmp('pcbtnNew');
if (enable) {
bsbtnSave.enable();
bsbtnSaveAndClose.enable();
bsbtnSaveAndNew.enable();
pcbtnNew.enable();
} else {
//bsbtnSave.disable();
//bsbtnSaveAndClose.disable();
bsbtnSaveAndNew.disable();
pcbtnNew.disable();
}
},
onPrintSelectDetailClick: function (button, event, type) {
var MBLNO = "";
var USDEXRATE = 0;
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', 'USD');
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
USDEXRATE = ffdata.DEFRATE;
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', 'USD');
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
USDEXRATE = dfdata.DEFRATE;
}
}
var selectedRecords = [];
var storeadd = null;
if (type == 1) {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
MBLNO = this.strMBLNO + "应收费用";
} else if (type == 2) {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
MBLNO = this.strMBLNO + "应付费用";
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.stroplb == 'op_Seae') {
var printType = '';
if (type == 1) {
printType = 'SEAEDRFEE';
} else { printType = 'SEAECRFEE'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Apply') {
var printType = '';
if (type == 1) {
printType = 'APPLYDRFEE';
} else { printType = 'APPLYCRFEE'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Seai') {
var printType = '';
if (type == 1) {
printType = 'SEAIDRFEE';
} else { printType = 'SEAICRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_seai WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Bulk') {
var printType = '';
if (type == 1) {
printType = 'BULKDRFEE';
} else { printType = 'BULKCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_bulk WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_other') {
var printType = '';
if (type == 1) {
printType = 'OTHERDRFEE';
} else { printType = 'OTHERCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_other WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_railway') {
var printType = '';
if (type == 1) {
printType = 'RAILWAYDRFEE';
} else { printType = 'RAILWAYCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_railway WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Aire') {
var printType = '';
if (type == 1) {
printType = 'AIREDRFEE';
} else { printType = 'AIRECRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_aire WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Airi') {
var printType = '';
if (type == 1) {
printType = 'AIRIDRFEE';
} else { printType = 'AIRICRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_airi WHERE BsNo = '" + this.strBSNO + "'";
};
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "''" + record.get('GId') + "''";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var sql2 = " declare @sql varchar(8000) ";
sql2 = sql2 + " set @sql = 'select bsno '";
sql2 = sql2 + " select @sql = @sql + ' , sum(case feename when ''' + feename + ''' then amount else 0 end) [' + feename + ']' ";
sql2 = sql2 + " from (select name as feename from code_fee where name in ";
sql2 = sql2 + " ('掏箱费','港杂费','关税','增值税','监管费','滞报金','保证金','滞纳金', ";
sql2 = sql2 + " '二次换单费','换单费','报检费','仓储费','分拨费','港杂费','港建费','港口包干费', ";
sql2 = sql2 + " '验货费','熏蒸费','还柜吊柜费','转栈费','海运费','空运费','捆绑费', ";
sql2 = sql2 + " '铁路运费','公路运费','短途运输费','木检运费','搬倒费','装箱费','修箱费', ";
sql2 = sql2 + " '滞箱费','出入库费','拆箱费','吊箱费',";
sql2 = sql2 + " '国际运费','报关费','保险费','包干费','THC','运费','商检验货费','集装箱费'";
sql2 = sql2 + " )) as a set @sql = @sql + ' from ch_fee where bsno=''" + this.strBSNO + "'' ' ";
if (feeGidSql != '') {
sql2 = sql2 + " set @sql = @sql + ' and Gid in (" + feeGidSql + ") '";
}
sql2 = sql2 + "set @sql = @sql +' group by bsno ' exec(@sql) ";
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('GId') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var sql3 = "";
if (feeGidSql != '') {
sql3 = sql3 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.Gid in (" + feeGidSql + ") order by sort,LineNum ";
}
var sql4 = " Select ic.*,icc.showname,icc.addr from info_client ic ";
sql4 = sql4 + " left join info_client_contact icc on icc.linkid=ic.gid where shortname=(select customername from v_op_bill where bsno='" + this.strBSNO + "')";
var sql5 = "";
var sql6 = " SELECT " + USDEXRATE + " AS USDEXRATE FROM [USER]";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO);
},
onPrintCustDetailClick: function (button, event, type) {
var MBLNO = "";
var USDEXRATE = 0;
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', 'USD');
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
USDEXRATE = ffdata.DEFRATE;
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', 'USD');
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
USDEXRATE = dfdata.DEFRATE;
}
}
var selectedRecords = [];
var storeadd = null;
if (type == 1) {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == 2) {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui); //函数(onAddDetailClick)的参数type类型设置的不对
return;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.stroplb == 'op_Seae') {
var printType = '';
if (type == 1) {
printType = 'SEAEDRFEE';
} else { printType = 'SEAECRFEE'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Apply') {
var printType = '';
if (type == 1) {
printType = 'APPLYDRFEE';
} else { printType = 'APPLYCRFEE'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Seai') {
var printType = '';
if (type == 1) {
printType = 'SEAIDRFEE';
} else { printType = 'SEAICRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_seai WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Bulk') {
var printType = '';
if (type == 1) {
printType = 'BULKDRFEE';
} else { printType = 'BULKCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_bulk WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_other') {
var printType = '';
if (type == 1) {
printType = 'OTHERDRFEE';
} else { printType = 'OTHERCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_other WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_railway') {
var printType = '';
if (type == 1) {
printType = 'RAILWAYDRFEE';
} else { printType = 'RAILWAYCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_railway WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Aire') {
var printType = '';
if (type == 1) {
printType = 'AIREDRFEE';
} else { printType = 'AIRECRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_aire WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Airi') {
var printType = '';
if (type == 1) {
printType = 'AIRIDRFEE';
} else { printType = 'AIRICRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_airi WHERE BsNo = '" + this.strBSNO + "'";
};
var custname = '';
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
custname = record.get('CustomerName');
var FeeType = record.get('FeeType');
var BsNo = record.get('BsNo');
};
if (type == 1) {
MBLNO = this.strMBLNO + "应收费用" + custname;
} else if (type == 2) {
MBLNO = this.strMBLNO + "应付费用" + custname;
}
var sql2 = " declare @sql varchar(8000) ";
sql2 = sql2 + " set @sql = 'select bsno '";
sql2 = sql2 + " select @sql = @sql + ' , sum(case feename when ''' + feename + ''' then amount else 0 end) [' + feename + ']' ";
sql2 = sql2 + " from (select name as feename from code_fee where name in ";
sql2 = sql2 + " ('掏箱费','港杂费','关税','增值税','监管费','滞报金','保证金','滞纳金', ";
sql2 = sql2 + " '二次换单费','换单费','报检费','仓储费','分拨费','港杂费','港建费','港口包干费', ";
sql2 = sql2 + " '验货费','熏蒸费','还柜吊柜费','转栈费','海运费','空运费','捆绑费', ";
sql2 = sql2 + " '铁路运费','公路运费','短途运输费','木检运费','搬倒费','装箱费','修箱费', ";
sql2 = sql2 + " '滞箱费','出入库费','拆箱费','吊箱费',";
sql2 = sql2 + " '国际运费','报关费','保险费','包干费','THC','运费','商检验货费','集装箱费'";
sql2 = sql2 + " )) as a set @sql = @sql + ' from ch_fee where bsno=''" + this.strBSNO + "'' ' ";
if (custname != '') {
sql2 = sql2 + " set @sql = @sql + ' and CustomerName=''" + custname + "'' and Bsno=''" + BsNo + "'' and feetype=" + FeeType + " '";
}
sql2 = sql2 + "set @sql = @sql +' group by bsno ' exec(@sql) ";
var sql3 = "";
sql3 = sql3 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.CustomerName='" + custname + "' and c.BsNo='" + BsNo + "' and c.feetype=" + FeeType + " order by sort,LineNum ";
var sql4 = " Select ic.*,icc.showname,icc.addr from info_client ic ";
sql4 = sql4 + " left join info_client_contact icc on icc.linkid=ic.gid where shortname=(select customername from v_op_bill where bsno='" + this.strBSNO + "')";
var sql5 = "";
var sql6 = " SELECT " + USDEXRATE + " AS USDEXRATE FROM [USER]";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO);
},
onPrintAllDetailClick: function (button, event, type) {
var MBLNO = "";
if (type == 1) {
MBLNO = this.strMBLNO + "应收费用";
} else if (type == 2) {
MBLNO = this.strMBLNO + "应付费用";
}
if (this.stroplb == 'op_Seae') {
var printType = '';
if (type == 1) {
printType = 'SEAEDRFEEALL';
} else { printType = 'SEAECRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Apply') {
var printType = '';
if (type == 1) {
printType = 'APPLYDRFEEALL';
} else { printType = 'APPLYCRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Seai') {
var printType = '';
if (type == 1) {
printType = 'SEAIDRFEEALL';
} else { printType = 'SEAICRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seai WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Bulk') {
var printType = '';
if (type == 1) {
printType = 'BULKDRFEEALL';
} else { printType = 'BULKCRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_bulk WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_other') {
var printType = '';
if (type == 1) {
printType = 'OTHERDRFEEALL';
} else { printType = 'OTHERCRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_other WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_railway') {
var printType = '';
if (type == 1) {
printType = 'RAILWAYDRFEEALL';
} else { printType = 'RAILWAYCRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_railway WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Aire') {
var printType = '';
if (type == 1) {
printType = 'AIREDRFEEALL';
} else { printType = 'AIRECRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_aire WHERE BsNo = '" + this.strBSNO + "'";
} else if (this.stroplb == 'op_Airi') {
var printType = '';
if (type == 1) {
printType = 'AIRIDRFEEALL';
} else { printType = 'AIRICRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_airi WHERE BsNo = '" + this.strBSNO + "'";
};
var sql2 = "SET LANGUAGE 'us_english' SELECT *,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where BsNo='" + this.strBSNO + "' and FEETYPE=" + type + " order by sort,LineNum ";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO);
},
onPrintGainClick: function (button, event, type) {
var MBLNO = this.strMBLNO;
_this = this;
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiChaXunShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiChaXunShuJu, //'正在组织数据...',
url: '/MvcShipping/MsChFee/GetGainPrint',
scope: this,
params: {
bsno: _thisyjfee.strBSNO,
oplb: _thisyjfee.stroplb
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (_this.stroplb == 'op_Seae') {
var printType = 'SEAEGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE BSNO = '" + _this.strBSNO + "'";
} else if (_this.stroplb == 'op_Apply') {
var printType = 'APPLYGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE BSNO = '" + _this.strBSNO + "'";
} else if (_this.stroplb == 'op_Seai') {
var printType = 'SEAIGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seai WHERE BSNO = '" + _this.strBSNO + "'";
} else if (_this.stroplb == 'op_Bulk') {
var printType = 'BULKGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_bulk WHERE BSNO = '" + _this.strBSNO + "'";
} else if (_this.stroplb == 'op_other') {
var printType = 'OTHERGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_other WHERE BSNO = '" + _this.strBSNO + "'";
} else if (_this.stroplb == 'op_railway') {
var printType = 'RAILWAYGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_railway WHERE BSNO = '" + _this.strBSNO + "'";
} else if (_this.stroplb == 'op_Aire') {
var printType = 'AIREGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_aire WHERE BSNO = '" + _this.strBSNO + "'";
} else if (_this.stroplb == 'op_Airi') {
var printType = 'AIRIGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_airi WHERE BSNO = '" + _this.strBSNO + "'";
};
// sql3 = sql3 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人 from ch_fee c where c.Gid in (" + feeGidSql + ") order by sort,LineNum ";
var sql2 = "SET LANGUAGE 'us_english' Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.BSNO='" + _this.strBSNO + "' and c.FEETYPE=1 order by sort,LineNum ";
var sql3 = "SET LANGUAGE 'us_english' Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.BSNO='" + _this.strBSNO + "' and c.FEETYPE=2 order by sort,LineNum ";
//全部费用利润 或 海运费利润 或 仓储利润
var sql4 = "SELECT BSNO"
+ ",SUM(RMBDR) as RMBDR,SUM(RMBCR) as RMBCR,SUM(USDDR) as USDDR,SUM(USDCR) as USDCR"
+ ",SUM(RMBDR+USDTORMBDR) as DRTTL"
+ ",SUM(RMBCR+USDTORMBCR) as CRTTL"
+ ",(SUM(RMBDR)-SUM(RMBCR)) AS RMBPROFIT"
+ ",(SUM(USDDR)-SUM(USDCR)) AS USDPROFIT"
+ ",SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR) as TTLPROFIT"
//+ ",(CAST(CAST(CASE WHEN SUM(RMBCR+USDTORMBCR) = 0 THEN 100 ELSE (ROUND((case when SUM(RMBDR+USDTORMBDR)=0 then 0 else (SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR))/SUM(RMBDR+USDTORMBDR) END),4))*100 END as decimal(18,2)) as varchar(20))+'%') AS PROFITRATE"
+ ",(CAST(CAST(CASE WHEN SUM(RMBCR+USDTORMBCR) = 0 THEN 100 ELSE (ROUND(((SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR))/SUM(RMBCR+USDTORMBCR)),4))*100 END as decimal(18,2)) as varchar(20))+'%') AS PROFITRATE"
+ ",'" + SHOWNAME + "' as CREATEUSER,GETDATE() as CREATETIME "
+ " FROM ("
+ "SELECT BSNO,CURRENCY,FEETYPE"
+ ",SUM(CASE WHEN CURRENCY='RMB' AND FEETYPE = 1 THEN AMOUNT ELSE 0 END) as RMBDR"
+ ",SUM(CASE WHEN CURRENCY='RMB' AND FEETYPE = 2 THEN AMOUNT ELSE 0 END) as RMBCR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 1 THEN AMOUNT ELSE 0 END) as USDDR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 2 THEN AMOUNT ELSE 0 END) as USDCR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 1 THEN AMOUNT*EXCHANGERATE ELSE 0 END) as USDTORMBDR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 2 THEN AMOUNT*EXCHANGERATE ELSE 0 END) as USDTORMBCR "
+ " FROM ch_fee WHERE 1=1 and BSNO='" + _this.strBSNO + "'"
+ " GROUP BY BSNO,CURRENCY,EXCHANGERATE,FEETYPE "
+ " ) AS C GROUP BY BSNO ";
var sql5 = "exec GetPrintData '" + _this.strBSNO + "'";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO);
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
LoadDrChFee: function (button, event) {
var sql = "";
sql = " BSNO='" +_thisyjfee.strBSNO+ "' AND ISOPEN=1 ";
this.storeDrChFee.load({ params: { billno: _thisyjfee.strBSNO, type: 2, optype: "op_Seae", condition: sql} });
},
setBtnStatusDr: function (enable) {
var btnFeeAddDr = Ext.getCmp('btnFeeAddDr');
var btnFeeSaveDr = Ext.getCmp('btnFeeSaveDr');
var btnFeeDelDr = Ext.getCmp('btnFeeDelDr');
var btnFeeCancelDr = Ext.getCmp('btnFeeCancelDr');
var btnFeeAuditDr = Ext.getCmp('btnFeeAuditDr');
var btnFeeShenDr = Ext.getCmp('btnFeeShenDr');
var btnFeeShenDelDr = Ext.getCmp('btnFeeShenDelDr');
var btnFeeShenCancelDr = Ext.getCmp('btnFeeShenCancelDr');
var btnFeeImpAddDr = Ext.getCmp('btnFeeImpAddDr');
if (enable) {
btnFeeAddDr.enable();
btnFeeSaveDr.enable();
btnFeeDelDr.enable();
btnFeeCancelDr.enable();
btnFeeAuditDr.enable();
btnFeeShenDr.enable();
btnFeeShenDelDr.enable();
btnFeeShenCancelDr.enable();
btnFeeImpAddDr.enable();
} else {
btnFeeAddDr.disable();
btnFeeSaveDr.disable();
btnFeeDelDr.disable();
btnFeeCancelDr.disable();
btnFeeAuditDr.disable();
btnFeeShenDr.disable();
btnFeeShenDelDr.disable();
btnFeeShenCancelDr.disable();
btnFeeImpAddDr.disable();
}
},
setBtnStatusCr: function (enable) {
var btnFeeAddDr = Ext.getCmp('btnFeeAddCr');
var btnFeeSaveDr = Ext.getCmp('btnFeeSaveCr');
var btnFeeDelDr = Ext.getCmp('btnFeeDelCr');
var btnFeeCancelDr = Ext.getCmp('btnFeeCancelCr');
var btnFeeAuditDr = Ext.getCmp('btnFeeAuditCr');
var btnFeeShenDr = Ext.getCmp('btnFeeShenCr');
var btnFeeShenDelDr = Ext.getCmp('btnFeeShenDelCr');
var btnFeeShenCancelDr = Ext.getCmp('btnFeeShenCancelCr');
var btnFeeImpAddDr = Ext.getCmp('btnFeeImpAddCr');
if (enable) {
btnFeeAddDr.enable();
btnFeeSaveDr.enable();
btnFeeDelDr.enable();
btnFeeCancelDr.enable();
btnFeeAuditDr.enable();
btnFeeShenDr.enable();
btnFeeShenDelDr.enable();
btnFeeShenCancelDr.enable();
btnFeeImpAddDr.enable();
} else {
btnFeeAddDr.disable();
btnFeeSaveDr.disable();
btnFeeDelDr.disable();
btnFeeCancelDr.disable();
btnFeeAuditDr.disable();
btnFeeShenDr.disable();
btnFeeShenDelDr.disable();
btnFeeShenCancelDr.disable();
btnFeeImpAddDr.disable();
}
},
LoadDrChFee2: function (condition) {
this.DR_condition = condition;
this.storeDrChFee.load({ params: { billno: this.strBSNO, type: 1, optype: this.stroplb, condition: condition }
, callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
// _thisyjfee.storeDrChFee.getSelectionModel().select(0);
} else {
}
}
},
scope: this
});
},
//#region 2018年2月7日 李进举 鼎世 CZF提交
CZFTiJiao: function (menu, event, type) {
var selections = this.GridCheckBoxModel.selected.items;
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要更新的业务!
return;
}
var BSNOStr = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BSNO = "'" + rec.data.BSNO + "'";
if (BSNOStr == '')
BSNOStr = BSNO;
else {
BSNOStr = BSNOStr + ',' + BSNO;
}
}
if (BSNOStr == '') {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoGengXinDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpSeae/PiLiangZhengPiaoTiJiao',
params: {
bsno: BSNOStr,
statusvalue:2
},
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;
}else {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.OK,
buttons: Ext.Msg.OK
});
this.onRefreshClick();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
}
//#endregion
});