You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4874 lines
180 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Ext.namespace('Shipping');
Shipping.MsChfeeAudit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsChfeeAudit.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsChfeeAudit, Ext.Panel, {
ParentWin: null, //弹出式
ParentPanel: null, //Tab页编辑模式
OpStatus: 'add',
EditRecord: null,
RefBillNo: '*',
DataLoading: true,
stroplb: '',
strOPTYPE: '普通货',
strBSNO: '',
strMBSNO: '',
FeeStatus: '',
feeType: 0,
PageSize: 50,
sqlcontext: '',
isAmend: '0',
bslistsortfield: '',
bslistsortdire: '',
initUIComponents: function () {
Ext.Ajax.timeout = 120000;
this.formname = 'FormBLAuditBL';
this.strMBSNO = '';
this.isAmend = '0';
this.AMENDSELFWORKFLOW = 0;
this.AUDITNOBACK = 0;
this.ISBLFEE = 1;
this.strOPTYPE = '普通货';
this.lowprofitrate = false;
//明细表-数据集
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 40
});
this.storeDrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/Account/Chfee_Audit/GetBLDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeCrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/Account/Chfee_Audit/GetBLDataList',
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.CheckAll = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.OnlyAuditBusiness, //仅需审核业务
checked: true,
width: 120
});
this.initgirdDrcolums = [{
sortable: true,
dataIndex: 'GId',
header: '惟一编号', //唯一编号
hidden: true,
width: 160
}, {
sortable: true,
dataIndex: 'BsNo',
header: '业务编号', //业务编号
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: Zi.LAN.CostStatus, //费用状态
renderer: function (value, p, record) {
return record.data.FeeStatus_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeName',
header: Zi.LAN.NameFeePayable, //应收费用名称
width: 100
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: Zi.LAN.CostEnglishName, //费用英文名称
width: 120
}, {
sortable: true,
dataIndex: 'CustomerType',
header: Zi.LAN.CustomerCategory, //客户类别
width: 80
}, {
sortable: true,
dataIndex: 'CustomerName',
header: Zi.LAN.SettlementObject, //结算对象
width: 120
}, {
sortable: true,
dataIndex: 'Unit',
header: Zi.LAN.UnitStandard, //单位标准
width: 60
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: Zi.LAN.price, //单价
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TaxUnitPrice',
header: Zi.LAN.TaxPrice, //含税单价
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Quantity',
header: Zi.LAN.Num, //数量
width: 60
}, {
sortable: true,
dataIndex: 'TaxRate',
header: Zi.LAN.taxRate, //税率
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'Tax',
header: Zi.LAN.Tax, //税率
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'NoTaxAmount',
header: Zi.LAN.NotaxRate, //不含税金额
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Amount',
header: Zi.LAN.Money, //金额
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Currency',
header: Zi.LAN.Currency, //币别
width: 40
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: Zi.LAN.exchangeRate, //汇率
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'AccTaxRate',
header: Zi.LAN.OutTaxRate, //进项税率
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'AccTax',
header: Zi.LAN.OutTax, //进项税率
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'AccAmount',
header: Zi.LAN.OutAmount, //进项税率
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: Zi.LAN.Remarks, //备注
width: 150
}, {
sortable: true,
dataIndex: 'IsAdvancedpay',
header: Zi.LAN.WhetherToAdvance, //是否垫付
width: 60
}, {
sortable: true,
dataIndex: 'IsInvoice',
header: Zi.LAN.Nnvoice, //不开发票
width: 60
}, {
sortable: true,
dataIndex: 'FeeFrt',
header: 'FRT',
width: 40
}, {
sortable: true,
dataIndex: 'Commissionrate',
header: Zi.LAN.CommissionRate, //佣金比率
width: 60
}, {
sortable: true,
dataIndex: 'OpName',
header: Zi.LAN.notIncludederson, //录入人
width: 60
}, {
sortable: true,
dataIndex: 'EnterDate',
header: Zi.LAN.EnterDate, //录入日期
//renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Auditoperator',
header: Zi.LAN.Auditor, //审核人
width: 60
}, {
sortable: true,
dataIndex: 'AuditDate',
header: Zi.LAN.ReviewDate, //审核日期
//renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Settlement',
header: Zi.LAN.SettlementAmount, //结算金额
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Invoice',
header: Zi.LAN.BillingAmount, //已开票金额
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OrderAmount',
header: Zi.LAN.ShenQingJinE, //已开票金额
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'InvoiceNum',
header: Zi.LAN.InvoiceNumber, //发票号码
width: 80
}, {
sortable: true,
dataIndex: 'SALECORP',
header: Zi.LAN.SALECORP, //发票号码
width: 80
}, {
sortable: true,
dataIndex: 'Reason',
header: Zi.LAN.Reason, //发票号码
width: 80
}, {
sortable: true,
dataIndex: 'IsOpen',
header: Zi.LAN.IsOpen, //'是否机密',
renderer: function (value, cellmeta) {
if (value == 'True' || value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
}, {
sortable: true,
dataIndex: 'INPUTMODE',
header: '业务卡引入', //'是否机密',
renderer: function (value, cellmeta) {
if (value != '') {
return "√";
} else return "×";
},
width: 60
}, {
sortable: true,
dataIndex: 'CTNNO',
header:'箱号', //发票号码
width: 80
}
];
this.girdDrcolums = this.initgirdDrcolums;
this.feeDrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
this.gridDrChFee = new Ext.grid.GridPanel({
store: this.storeDrChFee,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },//数据加载中
trackMouseOver: true,
disableSelection: false,
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: [{
xtype: 'label',
labelAlign: 'right',
width: 60,
html: "<a><font color='#6B8E23'><B>" + Zi.LAN.ChargesPayable + "</B></font></a>"
}, '-', {
text: Zi.LAN.ViewInformation,//查看信息
tooltip: '查看信息',
handler: function (button, event) {
_this.onViewDetailClick(button, event, 1);
},
scope: this
}
, '-', {
text: Zi.LAN.SavelistStyle,//保存列表样式
menu: [
{ text: Zi.LAN.Save, //保存
handler: function (button, event) {
_this.girdDrcolums = DsTruck.SaveGridPanel(userid, 'FEEDRGRIDADBL', _this.gridDrChFee.columns, _this.girdDrcolums, 0, true);
}
}, { text: Zi.LAN.Initialization, //初始化
handler: function (menu, event) {
_this.gridDrChFee.reconfigure(this.storeDrChFee, _this.initgirdDrcolums);
_this.girdDrcolums = DsTruck.SaveGridPanel(userid, 'FEEDRGRIDADBL', _this.gridDrChFee.columns, _this.initgirdDrcolums, 0, true);
}
}],
scope: this
}
//, '-', {
// text: Zi.LAN.ShowWorkflow,//显示工作流
// tooltip: '显示工作流',
// handler: function (button, event) {
// this.onViewWorkFlowDetailClick(button, event, 1);
// },
// scope: this
// }
],
columns: this.girdDrcolums
});
this.girdDrcolums = DsTruck.GetGridPanel(userid, 'FEEDRGRIDADBL', this.girdDrcolums, 0); //使用者id表名中间column数组跳过一开始的几列
this.initgirdCrcolums = [{
sortable: true,
dataIndex: 'GId',
header: '惟一编号',
hidden: true,
width: 160
}, {
sortable: true,
dataIndex: 'BsNo',
header: '业务编号',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: Zi.LAN.CostStatus, //费用状态
renderer: function (value, p, record) {
return record.data.FeeStatus_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeName',
header: Zi.LAN.NamePayable, //应付费用名称
width: 100
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: Zi.LAN.CostEnglishName, //费用英文名称
width: 120
}, {
sortable: true,
dataIndex: 'CustomerType',
header: Zi.LAN.CustomerCategory, //客户类别
width: 80
}, {
sortable: true,
dataIndex: 'CustomerName',
header: Zi.LAN.SettlementObject, //结算对象
width: 120
}, {
sortable: true,
dataIndex: 'Unit',
header: Zi.LAN.UnitStandard, //单位标准
width: 60
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: Zi.LAN.price, //单价
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TaxUnitPrice',
header: Zi.LAN.TaxPrice, //含税单价
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Quantity',
header: Zi.LAN.Num, //数量
width: 60
}, {
sortable: true,
dataIndex: 'TaxRate',
header: Zi.LAN.taxRate, //税率
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'Tax',
header: Zi.LAN.Tax, //税率
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'NoTaxAmount',
header: Zi.LAN.NotaxRate, //不含税金额
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Amount',
header: Zi.LAN.Money, //金额
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Currency',
header: Zi.LAN.Currency, //币别
width: 40
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: Zi.LAN.exchangeRate, //汇率
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'AccTaxRate',
header: Zi.LAN.InputTaxRate,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'AccTax',
header: Zi.LAN.InputTax,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'AccAmount',
header: Zi.LAN.InputAmount,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: Zi.LAN.Remarks, //备注
width: 150
}, {
sortable: true,
dataIndex: 'IsAdvancedpay',
header: Zi.LAN.WhetherToAdvance, //是否垫付
width: 60
}, {
sortable: true,
dataIndex: 'IsInvoice',
header: Zi.LAN.Nnvoice,
width: 60
}, {
sortable: true,
dataIndex: 'FeeFrt',
header: 'FRT',
width: 40
}, {
sortable: true,
dataIndex: 'Commissionrate',
header: Zi.LAN.CommissionRate,
width: 60
}, {
sortable: true,
dataIndex: 'OpName',
header: Zi.LAN.notIncludederson, //录入人
width: 60
}, {
sortable: true,
dataIndex: 'EnterDate',
header: Zi.LAN.EnterDate, //录入日期
//renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Auditoperator',
header: Zi.LAN.Auditor, //审核人
width: 60
}, {
sortable: true,
dataIndex: 'AuditDate',
header: Zi.LAN.ReviewDate, //审核日期
//renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Settlement',
header: Zi.LAN.SettlementAmount, //结算金额
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OrderAmount',
header: Zi.LAN.ShenQingJinE,
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'SALECORP',
header: Zi.LAN.SALECORP, //发票号码
width: 80
}, {
sortable: true,
dataIndex: 'Reason',
header: Zi.LAN.Reason, //原因
width: 80
}, {
sortable: true,
dataIndex: 'IsOpen',
header: Zi.LAN.IsOpen, //'是否机密',
renderer: function (value, cellmeta) {
if (value == 'True' || value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
}, {
sortable: true,
dataIndex: 'INPUTMODE',
header: '业务卡引入', //'是否机密',
renderer: function (value, cellmeta) {
if (value != '') {
return "√";
} else return "×";
},
width: 60
}, {
sortable: true,
dataIndex: 'CTNNO',
header: '箱号', //发票号码
width: 80
}, {
sortable: true,
dataIndex: 'WmsOutBsNo',
header: '成本核算引入', //'是否机密',
renderer: function (value, cellmeta, record) {
if ((value != '') && (record.data.FeeName == '罐箱费') && (record.data.IsCrmOrderFee == 'True' || record.data.IsCrmOrderFee == 'true' || record.data.IsCrmOrderFee == '1')) {
return "√";
} else return "×";
},
width: 60
}
];
this.girdCrcolums = this.initgirdCrcolums;
this.feeCrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
this.gridCrChFee = new Ext.grid.GridPanel({
store: this.storeCrChFee,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
disableSelection: false,
selModel: this.feeCrGridCheckBoxModel,
selType: 'cellmodel',
viewConfig: {
autoFill: true,
enableTextSelection: 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: [{
xtype: 'label',
labelAlign: 'right',
width: 60,
html: "<a><font color='#6B8E23'><B>" + Zi.LAN.Payable + "</B></font></a>"
}, '-', {
text: Zi.LAN.ViewInformation,//查看信息
tooltip: '查看信息',
handler: function (button, event) {
_this.onViewDetailClick(button, event, 2);
},
scope: this
}, '-', {
text: Zi.LAN.SavelistStyle, //保存列表样式
menu: [
{
text: Zi.LAN.Save, //保存
handler: function (button, event) {
_this.girdCrcolums = DsTruck.SaveGridPanel(userid, 'FEECRGRIDADBL', _this.gridCrChFee.columns, _this.girdCrcolums, 0, true);
}
}, {
text: Zi.LAN.Initialization, //初始化
handler: function (menu, event) {
_this.gridCrChFee.reconfigure(this.storeCrChFee, _this.initgirdCrcolums);
_this.girdCrcolums = DsTruck.SaveGridPanel(userid, 'FEECRGRIDADBL', _this.gridCrChFee.columns, _this.initgirdCrcolums, 0, true);
}
}],
scope: this
}
],
columns: this.girdCrcolums
});
this.girdCrcolums = DsTruck.GetGridPanel(userid, 'FEECRGRIDADBL', this.girdCrcolums, 0); //使用者id表名中间column数组跳过一开始的几列
////明细表表格
this.InitDrGrid(this.girdDrcolums);
this.InitCrGrid(this.girdCrcolums);
this.storeBodySum = Ext.create('Ext.data.Store', {
model: 'MsOPGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetBLCurrGainList',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeBodyAmendSum = Ext.create('Ext.data.Store', {
model: 'MsOPAmendGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetAmendGainList',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeBodyTtlSum = Ext.create('Ext.data.Store', {
model: 'MsOPGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetBLOPGainList',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridSum = new Ext.grid.GridPanel({
store: this.storeBodySum,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },//数据加载
trackMouseOver: true,
disableSelection: false,
columns: [{
header: "<a href='#'><font color='#FF0000'>币别</font></a>",//总计
sortable: false,
align: 'center',
dataIndex: 'CURR',
width: 160
}
, {
header: Zi.LAN.TaxIncluded,//应收含税
dataIndex: 'DR',
align: 'right',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
width: 160
}
, {
header: Zi.LAN.YingFuHanShui,//应付含税
dataIndex: 'CR',
align: 'right',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
width: 160
}
, {
header: Zi.LAN.notIncludedID,//利润含税
dataIndex: 'PR',
align: 'right',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
width: 160
}
]
});
this.panelCurrSum = new Ext.Panel({
title: Zi.LAN.BiBieSum,//币别合计
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.gridSum]
});
this.tabTotal = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
height: 180,
frame: false,
region: 'south',
enableHdMenu: false,
// region: 'center',
title: Zi.LAN.ChangeProfitBefore,//利润统计
//collapsed: true,
collapsible: true,
split: true,
enableTabScroll: true,
items:
[
this.panelCurrSum
]
});
this.storeBillList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsChFeedoBill',
remoteSort: true,
proxy: {
type: 'ajax',
timeout: 120000,
url: '/Account/Chfee_Audit/GetBLList',
reader: {
id: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: Zi.LAN.PageNum,//每页记录数
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.AddGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.initgirdcolums = [{
sortable: true,
id: '',
dataIndex: '',
header: '',
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: 'BSNO',
width: 0
}, {
sortable: true,
dataIndex: 'BLTYPE',
header:'业务类型',//业务类别
width: 80
}, {
sortable: true,
dataIndex: 'OPLBNAME',
header: Zi.LAN.ServiceCategory,//业务类别
width: 80
}, {
sortable: true,
dataIndex: 'OPTYPE',
header: Zi.LAN.ChangeSingle,//更改单
width: 80
}, {
sortable: true,
dataIndex: 'CUSTNO',
header: Zi.LAN.DelegateNumber,//委托编号
width: 120
}, {
sortable: true,
dataIndex: 'MBLNO',
header: Zi.LAN.ladingNumber,//主提单号
width: 120
}, {
sortable: true,
dataIndex: 'SLNO',
header:'更改次数',//更改单
width: 80
}, {
sortable: true,
dataIndex: 'HBLNO',
header: Zi.LAN.FenladingNumber, //分提单号
width: 120
}, {
sortable: true,
dataIndex: 'ORDERNO',
header: Zi.LAN.ORDERNO, //分提单号
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMNO',
header: Zi.LAN.DeclarationNumber, //报关单号
width: 120
}, {
sortable: true,
id: '',
align: 'center',
dataIndex: 'BSSTATUSREF',
header: Zi.LAN.BusinessLock,//业务锁定
width: 60,
renderer: function (value, cellmeta) {
if (value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
id: '',
align: 'center',
dataIndex: 'FEESTATUSREF',
header: Zi.LAN.Costlock,//费用锁定
width: 60,
renderer: function (value, cellmeta) {
if (value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
id: '',
dataIndex: 'DRFEESTATUS',
header: Zi.LAN.ChargesPayable,//应收费用
align: 'center',
width: 60,
renderer: function (value, meta) {
if (value == '审核通过') {
meta.tdCls = 'feestatus_pass';
} else if (value == '录入状态') {
} else if (value == '提交审核') {
meta.tdCls = 'feestatus_refer';
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_refer';
} else if (value == '结算完毕') {
meta.tdCls = 'feestatus_settle';
} else if (value == '未录入') {
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_settle';
} else if (value == '部分审核') {
meta.tdCls = 'feestatus_pass';
} else if (value == '部分提交') {
meta.tdCls = 'feestatus_refer';
}
return value;
}
},
{
sortable: true,
id: '',
dataIndex: 'CRFEESTATUS',
header: Zi.LAN.Payable,//应付费用
align: 'center',
width: 60,
renderer: function (value, meta) {
if (value == '审核通过') {
meta.tdCls = 'feestatus_pass';
} else if (value == '录入状态') {
} else if (value == '提交审核') {
meta.tdCls = 'feestatus_refer';
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_refer';
} else if (value == '结算完毕') {
meta.tdCls = 'feestatus_settle';
} else if (value == '未录入') {
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_settle';
} else if (value == '部分审核') {
meta.tdCls = 'feestatus_pass';
} else if (value == '部分提交') {
meta.tdCls = 'feestatus_refer';
}
return value;
}
}, {
sortable: true,
dataIndex: 'OPSTATUS',
header: Zi.LAN.CostStatus,//费用状态
width: 180
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.Requester,//委托单位
width: 100
}, {
sortable: true,
dataIndex: 'ETD',
header: Zi.LAN.SailingDate,//开船日期
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 100
}, {
sortable: true,
dataIndex: 'ETA',
header: '到港日期',//开船日期
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 100
}, {
sortable: true,
dataIndex: 'SALE',
header: Zi.LAN.LanhuoPeople,//揽货人
width: 80
}, {
sortable: true,
dataIndex: 'CNTRTOTAL',
header: Zi.LAN.Changing,//集装箱
width: 120
}, {
sortable: true,
dataIndex: 'ACCDATE',
header: Zi.LAN.kuaiJiQJ, //会计期间
width: 80
}, {
sortable: true,
dataIndex: 'BSSOURCE',
header: Zi.LAN.BusinessSource, //业务来源
width: 80
}, {
sortable: true,
dataIndex: 'BSSOURCEDETAIL',
header: '账单类型', //业务来源
width: 80
}, {
sortable: true,
dataIndex: 'ENTERP',
header: Zi.LAN.BusinessUnit, //经营单位
width: 80
}, {
sortable: true,
dataIndex: 'OP',
header: Zi.LAN.Operating, //操作
width: 80
}, {
sortable: true,
dataIndex: 'INPUTBY',
header: Zi.LAN.notIncludederson, //录入人
width: 80
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: Zi.LAN.loadingDock, //起运港
width: 120
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: Zi.LAN.PORTDISCHARGE, //目的港
width: 120
}, {
sortable: true,
dataIndex: 'PLACERECEIPT',
header: Zi.LAN.PLACERECEIPT, //收货地
width: 120
}, {
sortable: true,
dataIndex: 'DESTINATION',
header: Zi.LAN.DESTINATION, //目的地
width: 120
}, {
sortable: true,
dataIndex: 'VESSEL',
header: Zi.LAN.ShipName, //船名
width: 150
}, {
sortable: true,
dataIndex: 'VOYNO',
header: Zi.LAN.Voyage, //航次
width: 60
}, {
sortable: true,
dataIndex: 'CARRIER',
header: Zi.LAN.CARRIER, //航次
width: 60
}, {
sortable: true,
dataIndex: 'BLFRT',
header: Zi.LAN.BLFRT, //航次
width: 60
}, {
sortable: true,
dataIndex: 'CUSTOMSNUM',
header: Zi.LAN.NumberDeclarations, //报关项数
width: 60
}, {
sortable: true,
dataIndex: 'CONTRACTNO',
header:'合同号', //报关项数
width: 60
}, {
sortable: true,
dataIndex: 'PKGS',
header: Zi.LAN.NumberOfpieces, //件数
width: 60
}, {
sortable: true,
dataIndex: 'KGS',
header: Zi.LAN.Weight, //重量
width: 60
}, {
sortable: true,
dataIndex: 'CBM',
header: Zi.LAN.Size, //尺码
width: 60
}, {
sortable: true,
dataIndex: 'REMARK',
header: Zi.LAN.Remarks, //备注
width: 80
}, {
sortable: true,
dataIndex: 'REMARK2',
header: Zi.LAN.Remarks2, //备注
width: 80
}, {
sortable: true,
dataIndex: 'REASON',
header:'更改原因', //备注
width: 80,
renderer: function (value, meta) {
meta.tdCls = 'mblno';
btnurl = getGridCopyButton(value);
return btnurl + value;
}
}, {
sortable: true,
dataIndex: 'INVNO',
header: Zi.LAN.INVNO, //报关单号
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'BillFeeStatus',
header: Zi.LAN.BillFeeStatus, //'整票状态',
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 if (value == '4') {
meta.tdCls = 'feestatus_nopass';
return "账单驳回";
} else {
return "";
}
}
}, {
sortable: true,
dataIndex: 'LOWRATE',
header: '利润率低于3%', //'服务项目7',
width: 100,
renderer: function (value, meta, record) {
var lsValue = record.data.TTLPRRATE;
if (parseFloat(lsValue) < 3)
{
meta.tdCls = 'feestatus_nopass';
return '是';
}
else {
return '';
}
}
}, {
sortable: true,
dataIndex: 'BILLFEESTATUSTIME',
header: Zi.LAN.BILLFEESTATUSTIME, //报关单号
width: 120
}, {
sortable: true,
dataIndex: 'APPLYNO',
header:'用箱申请号', //报关单号
width: 120
}, {
sortable: true,
dataIndex: 'OPFEECOUNT',
header: '操作费计算量',
width: 70
}, {
sortable: true,
dataIndex: 'OPCOUNT',
header: '考核票数',
width: 70
}, {
sortable: true,
dataIndex: 'SORT',
header: '审核级别',
width: 70
}, {
sortable: true,
dataIndex: 'AUDITUSERREF',
header: '当前审核人',
width: 70
}, {
sortable: true,
dataIndex: 'LASTAUDITTIME',
header: '最后审核日期',
width: 70
}, {
sortable: true,
dataIndex: 'ISFUMIGATION',
header: Zi.LAN.ISFUMIGATION, //'服务项目1',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISCUSTOMS',
header: Zi.LAN.ISCUSTOMS, //'服务项目4',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISINSPECTION',
header: Zi.LAN.ISINSPECTION, //'服务项目5',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISAGENT',
header: Zi.LAN.ISAGENT, //'服务项目7',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISLAND',
header: '送货', //'服务项目7',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'PROFIT',
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 '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLPRRATE',
header: '利润率',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 3) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}
];
this.girdcolums = this.initgirdcolums;
this.gridBillList = new Ext.grid.GridPanel({
store: this.storeBillList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.LoadData },
trackMouseOver: true,
viewConfig: {
autoFill: true,
enableTextSelection: true
},
disableSelection: false,
selModel: this.AddGridCheckBoxModel,
columns: this.girdcolums,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeBillList,
displayInfo: true,
displayMsg: Zi.LAN.FenYe,//数据加载
emptyMsg: Zi.LAN.NoAudtid //没有要审核的数据
}), this.Pagenum]
});
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.girdcolums.unshift(new Ext.grid.RowNumberer());
this.gridBillList.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 = "";
var BSNO = record.data.BSNO;
if (record.data.OPTYPE == '更改单') BSNO = record.data.PARENTID;
if (record.data.OPLBNAME == "海运出口") {
openUrl = "../../MvcShipping/MsOpSeae/EditView?handle=check&bsno=" + BSNO;
}
else if (record.data.OPLBNAME == "海运进口") {
openUrl = "../../MvcShipping/MsOpSeai/EditView?handle=check&bsno=" + BSNO;
} else if (record.data.OPLBNAME == "空运出口") {
openUrl = "../../MvcShipping/MsOpAire/EditView?handle=check&bsno=" + BSNO;
} else if (record.data.OPLBNAME == "空运进口") {
openUrl = "../../MvcShipping/MsOpAiri/EditView?handle=check&bsno=" + BSNO;
} else if (record.data.OPLBNAME == "报关业务") {
openUrl = "../../MvcShipping/MsOpApply/EditView?handle=check&bsno=" + BSNO;
} else {
openUrl = "../../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + record.data.BSNO;
}
window.open(openUrl, openType, openSet);
// DsOpenEditWin("/TruckMng/MsWlPc/Edit");
}, this);
this.gridBillList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.bslistsortfield = column.dataIndex;
this.bslistsortdire = direction;
}, 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: Zi.LAN.BusinessType,//业务类型
store: this.StoreOpLb,
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: Zi.LAN.TypeTransport,//运输类型
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: Zi.LAN.LanhuoPeople,//揽货人
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.storeOp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOp.load();
this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.Operating,//操作
width: 90,
store: this.storeOp,
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: Zi.LAN.Requester,//委托单位
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.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.VesselModel',
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
});
this.storeVoyVeg.load({ params: { condition: ""} });
this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.ShipName,//船名
store: this.storeVoyVeg,
valueField: 'VESSEL',
name: 'PS_VESSEL',
displayField: 'VESSEL',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
Ext.define('OpSeaeShipper', {
extend: 'Ext.data.Model',
idProperty: 'SHIPPERID',
fields: [
{ name: 'SHIPPERID', type: 'string' },
{ name: 'CODENAME', type: 'string' },
{ name: 'SHORTNAME', type: 'string' },
{ name: 'CodeAndName', type: 'string' },
{ name: 'SHIPPERDETAIL', type: 'string' },
{ name: 'SHIPPERTYPE', type: 'int' },
{ name: 'LOADADDRESS', type: 'string' },
{ name: 'DELIVERADDRESS', type: 'string' },
{ name: 'ISPUBLIC', type: 'bool' }
]
});
this.storeagent = Ext.create('DsExt.ux.RefTableStore', {
model: 'OpSeaeShipper',
proxy: { url: '/MvcShipping/MsOpSeae/GetShipperList' }
});
this.storeagent.load({ params: { condition: "shippertype=4 "} });
this.comboxAgent = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.ForeignAgent,//国外代理
store: this.storeagent,
forceSelection: true,
name: 'PS_AGENT',
valueField: 'SHORTNAME',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//业务来源
this.storeSource = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceModel',
proxy: { url: '/CommMng/BasicDataRef/GetSource' }
});
this.storeSource.load();
this.storeSourceDetail = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceDetailModel',
proxy: { url: '/CommMng/BasicDataRef/GetSourceDetail2' }
});
this.comboxBSSOURCE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.BusinessSource,//业务来源
store: this.storeSource,
forceSelection: true,
name: 'BSSOURCE',
valueField: 'SourceName',
displayField: 'SourceName'
});
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: Zi.LAN.WhetherCostIsSubmitted,//是否费用提交
store: this.storeFEEUP,
valueField: 'FSTATUS',
displayField: 'NAME',
// flex: 0.7,
labelWidth: 90,
forceSelection: true,
name: 'ISFEEUP',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeBillFeeStatus = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeBillFeeStatus.add({ "FSTATUS": "", "NAME": "全部" });
this.storeBillFeeStatus.add({ "FSTATUS": "1", "NAME": "账单提交" });
this.storeBillFeeStatus.add({ "FSTATUS": "2", "NAME": "审核通过" });
this.storeBillFeeStatus.add({ "FSTATUS": "4", "NAME": "账单驳回" });
this.storeBillFeeStatus.add({ "FSTATUS": "0", "NAME": "账单未提交" });
this.storeBillFeeStatus.add({ "FSTATUS": "5", "NAME": "未最终审核" });
this.comboxBillFeeStatus = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '审核状态', //是否开垫付
store: this.storeBillFeeStatus,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'BillFeeStatus',
value: '',
// flex: 0.7,
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeOPTYPE = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeOPTYPE.add({ "FSTATUS": "", "NAME": "全部" });
this.storeOPTYPE.add({ "FSTATUS": "普通货", "NAME": "普通货" });
this.storeOPTYPE.add({ "FSTATUS": "更改单", "NAME": "更改单" });
this.comboxOPTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '普通货/更改单', //是否开垫付
store: this.storeOPTYPE,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'OPTYPE',
value: '',
labelWidth: 110,
// flex: 0.7,
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeLASTAUDITDAY = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeLASTAUDITDAY.add({ "FSTATUS": "", "NAME": "" });
this.storeLASTAUDITDAY.add({ "FSTATUS": "0", "NAME": "否" });
this.storeLASTAUDITDAY.add({ "FSTATUS": "1", "NAME": "是" });
this.comboxLASTAUDITDAY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel:'超过1个工作日未审核',//是否费用提交
store: this.storeLASTAUDITDAY,
valueField: 'FSTATUS',
displayField: 'NAME',
// flex: 0.7,
labelWidth: 120,
forceSelection: true,
name: 'LASTAUDITDAY',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeLASTAUDITDAY2 = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeLASTAUDITDAY2.add({ "FSTATUS": "", "NAME": "" });
this.storeLASTAUDITDAY2.add({ "FSTATUS": "0", "NAME": "否" });
this.storeLASTAUDITDAY2.add({ "FSTATUS": "1", "NAME": "是" });
this.comboxLASTAUDITDAY2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '当前未审超一个工作日',//是否费用提交
store: this.storeLASTAUDITDAY2,
valueField: 'FSTATUS',
displayField: 'NAME',
// flex: 0.7,
labelWidth: 130,
forceSelection: true,
name: 'LASTAUDITDAY2',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#endregion
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.RememberQuery,//记忆查询条件
checked: true,
width: 120
});
this.storeAuditCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserActionRefListRm' }
});
this.storeAuditCode.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { MODULENAME: 'modBLFeeAudit' });
}, this);
this.storeAuditCode.load();
this.comboxAuditCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '审核人', //揽货人
store: this.storeAuditCode,
forceSelection: true,
name: 'PS_AUDIT',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true
});
this.storeAuditCode2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserActionRefListRm' }
});
this.storeAuditCode2.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { MODULENAME: 'modBLFeeAudit' });
}, this);
this.storeAuditCode2.load();
this.comboxAuditCode2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '当前审核人', //揽货人
store: this.storeAuditCode2,
forceSelection: true,
name: 'PS_AUDIT2',
valueField: 'GID',
displayField: 'CodeAndName',
enableKeyEvents: true
});
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 0,
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: Zi.LAN.SingleNumber,//单号
name: 'PS_MBLNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel:'审核日期',//从业务日期
format: 'Y-m-d',
labelWidth: 80,
xtype: 'datefield',
name: 'PS_AUDITBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel:'至',//至业务日期
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_AUDITEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxOPTYPE, { xtype: 'hiddenfield' }, {
xtype: 'button',
width: 90,//执行查询
text: Zi.LAN.Executequery,
iconCls: "btnrefresh",
handler: function (button, event) {
// _this.LoadData(this.opStatus, "", this.RefBillNo);
this.onRefreshClick(button, event);
var isvisible = true;
var issavevalue = false;
isvisible = true;
if (this.CheckSaveQuery.checked)
issavevalue = true
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
},
scope: this
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxAuditCode, this.comboxSalesCode, this.comboxCustCode, {
fieldLabel: Zi.LAN.FromBusinessDate,//从业务日期
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.ToBusinessDate,//至业务日期
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, { xtype: 'hiddenfield' }, {
xtype: 'button',
width: 90,
text: Zi.LAN.ResetCondition,//重置
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxAuditCode2, {
fieldLabel: Zi.LAN.FromAccountingPeriod,//从会计期间
xtype: 'monthfield',
name: 'PS_ACCDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: Zi.LAN.ToAccountingPeriod,//至会计期间
xtype: 'monthfield',
name: 'PS_ACCDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxOp, this.comboxBillFeeStatus, this.comboxLASTAUDITDAY2, {
xtype: 'button',
width: 90,
text: Zi.LAN.AdvancedSearch,//高级查询
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
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//查询工具条
_this = this;
this.SearchBtn = new Ext.Button({
text: Zi.LAN.ShowQuery,
handler: function () {
if (_this.SearchBtn.text == Zi.LAN.HideQuery) {
_this.panelSearch.hide();
_this.SearchBtn.setText(Zi.LAN.ShowQuery);
} else {
_this.panelSearch.show();
_this.SearchBtn.setText(Zi.LAN.HideQuery);
}
}
});
this.storeAddDCType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeAddDCType.add({ "DC": "0", "NAME": "全部" });
this.storeAddDCType.add({ "DC": "1", "NAME": "待审核" });
this.storeAddDCType.add({ "DC": "2", "NAME": "已审核" });
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.FYchakan,//费用查看范围
store: this.storeAddDCType,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'DC',
value: '0'
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [this.SearchBtn, '-',
{
xtype: 'button',
text: Zi.LAN.ReLoad,//刷新
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
var isvisible = true;
var issavevalue = false;
isvisible = true;
if (this.CheckSaveQuery.checked)
issavevalue = true
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
},
scope: this
}
, '-', this.CheckAll, '-', this.CheckSaveQuery, '-', {
text: Zi.LAN.SavelistStyle, //保存列表样式
id: "btntest",
menu: [
{ text: Zi.LAN.Save, //保存
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridBillList.columns, _this.girdcolums, 1, true);
}
}, { text: Zi.LAN.Initialization, //初始化
handler: function (menu, event) {
_this.gridBillList.reconfigure(this.storeBillList, _this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridBillList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, {
text: Zi.LAN.LooKYUanPiao, //查看原票费用
id: 'ViewFee',
handler: function (button, event) {
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 = "";
openUrl = "../../MvcShipping/MsOpBill/MsOpFeeView?handle=check&bsno=" + this.strMBSNO;
window.open(openUrl, openType, openSet);
},
scope: this
}, '-', {
text: '审核通过',
tooltip: '审核通过',
handler: function (button, event) {
_this.onSelAuditClick(button, event);
},
scope: this
}, '-', {
text: '审核驳回',
tooltip: '审核驳回',
handler: function (button, event) {
_this.onSelAuditBackClick(button, event,'0');
},
scope: this
}, '-', {
text: '特殊驳回',
tooltip: '特殊驳回',
id: 'SelAuditBack2',
handler: function (button, event) {
_this.onSelAuditBackClick(button, event,'1');
},
scope: this
}, '-', {
text: '撤销最终审核',
tooltip: '整票审核',
handler: function (button, event) {
_this.onCancelAuditClick(button, event);
},
scope: this
}, '-',
{
text: "修改考核票数及计算量",
handler: function (button, event) {
var records = _this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var rec = records[0];
//if (rec.data.BillFeeStatus != 1 && rec.data.BillFeeStatus != 1) {
// Ext.Msg.show({ title: '提示', msg: '当前状态不允许修改!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
if (SHOWNAME != rec.data.AUDITUSERREF && SHOWNAME != rec.data.LASTAUDITUSER) {
Ext.Msg.show({ title: '提示', msg: '只有当前审核人才允许修改!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.BillFeeStatus == 1) {
_this.formModify.getForm().findField('OPFEECOUNT').setValue(rec.data.OPFEECOUNT);
_this.formModify.getForm().findField('OPCOUNT').setValue(rec.data.OPCOUNT);
_this.winModifyShow.show();
} else {
var ACCDATE = rec.data.ACCDATE;
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;
var oDate1 = new Date(ACCDATE + '-01');
var oDate2 = new Date(data.PERIOD + '-01');
if (oDate1.getTime() < oDate2.getTime()) {
Ext.Msg.show({ title: '提示', msg: '当前会计期间已月末结转,不允许修改!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this.formModify.getForm().findField('OPFEECOUNT').setValue(rec.data.OPFEECOUNT);
_this.formModify.getForm().findField('OPCOUNT').setValue(rec.data.OPCOUNT);
_this.winModifyShow.show();
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
scope: this
}, '-',
{
text: Zi.LAN.btnprintview, //"打印",
iconCls: 'btnprint',
handler: function (button, event) {
_this.PrintSelect(1);
},
scope: this
}, '-',
{
text: Zi.LAN.btnprint, //"打印",
iconCls: 'btnprint',
handler: function (button, event) {
_this.PrintSelect();
},
scope: this
}, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 29,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 90,
items: [this.formSearch]
});
Ext.define('MsOpAuditDetail', {
extend: 'Ext.data.Model',
idProperty: 'ADID',
fields: [
{ name: 'ADID', type: 'string' },
{ name: 'BSNO', type: 'string' },
{ name: 'ERRDATA', type: 'string' },
{ name: 'OPREMARK', type: 'string' },
{ name: 'ERRMSG', type: 'string' },
{ name: 'AUDITTYPE', type: 'string' },
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATEUSERREF', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'SORT', type: 'number' }
]
});
this.storeAuditDetailList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpAuditDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpAuditDetail/GetListData',
reader: {
id: 'ADID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.initgirdAuditDetailcolums = [{
sortable: true,
dataIndex: 'ADID',
header: 'ADID',
hidden: true,
width: 150
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 150
}, {
sortable: true,
dataIndex: 'ERRMSG',
header: '审核描述',
width: 120
}, {
sortable: true,
dataIndex: 'OPREMARK',
header: '错误说明',
width: 150
}, {
sortable: true,
dataIndex: 'ERRDATA',
header: '错误数据',
width: 120
}, {
sortable: true,
dataIndex: 'AUDITTYPE',
header: '是否匹配', //'是否机密',
renderer: function (value, cellmeta) {
if (value == '1') {
return "匹配异常";
} else return "匹配一致";
},
width: 60
}, {
sortable: true,
dataIndex: 'CREATETIME',
header: '提交时间',
// renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s'),
width: 120
}, {
sortable: true,
dataIndex: 'CREATEUSER',
header: '提交人(审核人)',
width: 80
}
];
this.girdAuditDetailcolums = this.initgirdAuditDetailcolums;
this.CheckBoxAuditDetailModel = Ext.create('Ext.selection.CheckboxModel');
this.storeAUDITTYPE = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeAUDITTYPE.add({ "FSTATUS": "", "NAME": "全部" });
this.storeAUDITTYPE.add({ "FSTATUS": "1", "NAME": "未匹配" });
this.storeAUDITTYPE.add({ "FSTATUS": "0", "NAME": "已匹配" });
this.comboxAUDITTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '匹配状态', //是否开垫付
store: this.storeAUDITTYPE,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'AUDITTYPE',
id: 'PS_AUDITTYPE',
value: '1',
// flex: 0.7,
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.storeAuditDetailList.load();
}
},
'select': function (combo, records, eOpts) {
if (records.length > 0) {
_this.storeAuditDetailList.load();
}
}
}
});
//定义Grid
this.gridAuditDetailList = new Ext.grid.GridPanel({
store: this.storeAuditDetailList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
viewConfig: {
autoFill: true,
enableTextSelection: true
},
selModel: this.CheckBoxAuditDetailModel,
selType: 'cellmodel',
tbar: [{
text: Zi.LAN.SavelistStyle, //保存列表样式
menu: [
{
text: Zi.LAN.Save, //保存
handler: function (button, event) {
_this.girdAuditDetailcolums = DsTruck.SaveGridPanel(userid, 'AuditDetail', _this.gridAuditDetailList.columns, _this.girdAuditDetailcolums, 0, true);
}
}, {
text: Zi.LAN.Initialization, //初始化
handler: function (menu, event) {
_this.gridAuditDetailList.reconfigure(this.storeAuditDetailList, _this.initgirdAuditDetailcolums);
_this.girdAuditDetailcolums = DsTruck.SaveGridPanel(userid, 'AuditDetail', _this.gridAuditDetailList.columns, _this.initgirdAuditDetailcolums, 0, true);
}
}],
scope: this
}, this.comboxAUDITTYPE],
columns: this.girdAuditDetailcolums ,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeAuditDetailList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.girdAuditDetailcolums = DsTruck.GetGridPanel(userid, 'AuditDetail', this.girdAuditDetailcolums, 0);
this.gridAuditDetailList.reconfigure(this.storeAuditDetailList, this.girdAuditDetailcolums);
this.storeAuditDetailList.on('beforeload', function (store) {
var AUDITTYPE = Ext.getCmp('PS_AUDITTYPE').getValue();
var sql = "BSNO='" + this.strBSNO + "'";
if (AUDITTYPE != '') sql = sql + " and AUDITTYPE='" + AUDITTYPE + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.panelAudit = new Ext.Panel({
title: '审核匹配信息',
// layout: "border",
layout: "border",
split: true,
// region: 'north',
// height: 560,
region: 'east',
width:500,
items: [
this.gridAuditDetailList
]
});
this.panelDrChFee = new Ext.Panel({
// title: '应收费用',
layout: "border",
flex: 1,
frame: true,
split: true,
region: 'west',
width: 320,
split: true,
items: [this.gridDrChFee]
});
this.panelCrChFee = new Ext.Panel({
// title: '应付费用',
layout: "border",
// anchor: '100% 50%',
region: 'center',
// region: 'center',
flex: 1,
frame: true,
items: [this.gridCrChFee]
});
this.panelFeeDetail = new Ext.Panel({
// title: '费用信息',
// layout: "border",
layout: "border",
// region: 'north',
// height: 560,
region: 'center',
items: [
this.panelDrChFee, this.panelCrChFee
]
});
this.panelAmendFee = new Ext.Panel({
title: '更改单信息',
// layout: "border",
layout: "border",
region: 'south',
height: 22
});
this.panelFee = new Ext.Panel({
// title: '费用信息',
// layout: "border",
layout: "border",
// region: 'north',
// height: 560,
region: 'center',
items: [
this.panelFeeDetail, this.panelAmendFee,this.tabTotal
]
});
//#region 日志表
Ext.define('MsOpAuditLog', {
extend: 'Ext.data.Model',
idProperty: 'ADLGID',
fields: [
{ name: 'ADLGID', type: 'string' },
{ name: 'BSNO', type: 'string' },
{ name: 'ERRMSG', type: 'string' },
{ name: 'ERROP', type: 'string' },
{ name: 'ERRCUST', type: 'string' },
{ name: 'AUDITTYPE', type: 'string' },
{ name: 'AUDITREMARK', type: 'string' },
{ name: 'PRREASON', type: 'string' },
{ name: 'AUDITUSER', type: 'string' },
{ name: 'AUDITUSERREF', type: 'string' },
{ name: 'AUDITTIME', type: 'string' },
{ name: 'ISAMEND', type: 'string' },
{ name: 'SORT', type: 'number' }
]
});
this.storeLog = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpAuditLog',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpAuditDetail/GetAuditLogList',
reader: {
id: 'ADLGID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.initLogcolumn = [
{
sortable: true, hidden: true,
dataIndex: 'ADLGID',
header: 'ADLGID',
width: 130
}, {
sortable: true, hidden: true,
dataIndex: 'BSNO',
header: 'BSNO',
width: 70,
align: 'center'
},
{
sortable: true,
dataIndex: 'AUDITUSER',
header: '操作人',
width: 80
},
{
sortable: true,
dataIndex: 'AUDITTIME',
header: '操作时间',
//renderer: 'Y-m-d H:i:s',
width: 90
},
{
sortable: true,
dataIndex: 'AUDITTYPE',
header: '类型',
width: 80
},
{
sortable: true,
dataIndex: 'AUDITREMARK',
header: '备注或审核意见',
width: 120
}, {
sortable: true,
dataIndex: 'ISAMEND',
header: '建更改单', //'是否机密',
renderer: function (value, cellmeta) {
if (value == 'True' || value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
},
{
sortable: true,
dataIndex: 'PRREASON',
header: '利润率低/亏损原因',
width: 120
},
{
sortable: true,
dataIndex: 'ERRMSG',
header: '原因归属',
width: 80
},
{
sortable: true,
dataIndex: 'ERROP',
header: '责任人',
width: 200
},
{
sortable: true,
dataIndex: 'ERRCUST',
header: '责任单位',
width: 200
}
];
this.Logcolumn = this.initLogcolumn;
this.gridList_Log = new Ext.grid.GridPanel({
store: this.storeLog,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
//selModel: this.MainCB,
columns: this.Logcolumn,
tbar: [{
text: Zi.LAN.SavelistStyle, //保存列表样式
menu: [
{
text: Zi.LAN.Save, //保存
handler: function (button, event) {
_this.Logcolumn = DsTruck.SaveGridPanel(userid, 'AuditDetailLog', _this.gridList_Log.columns, _this.Logcolumn, 0, true);
}
}, {
text: Zi.LAN.Initialization, //初始化
handler: function (menu, event) {
_this.gridList_Log.reconfigure(this.storeLog, _this.initLogcolumn);
_this.Logcolumn = DsTruck.SaveGridPanel(userid, 'AuditDetailLog', _this.gridList_Log.columns, _this.initLogcolumn, 0, true);
}
}],
scope: this
}],
//plugins: [this.cellEditing],
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
},
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeLog,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.Logcolumn = DsTruck.GetGridPanel(userid, 'AuditDetailLog', this.Logcolumn, 0);
this.gridList_Log.reconfigure(this.storeLog, this.Logcolumn);
this.storeLog.on('beforeload', function (store) {
var sql = " BSNO='" + this.strBSNO+"'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.panelLogList = new Ext.Panel({
title: '审核日志',
layout: "border",
region: 'east',
width: 500,
//height: 300,
margin: '1 1',
split: true,
items: [this.gridList_Log]
});
this.panelBody = new Ext.Panel({
title: '详细信息', //'委托信息',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
frame: false,
//closable:true,
items: [this.panelFee, this.panelAudit]
});
this.panelBill = new Ext.Panel({
// title: '业务信息',
layout: "border",
region: 'north',
//autoScroll: true,
height: 200,
frame: true,
split: true,
items: [this.gridBillList, this.panelLogList ]
});
//#endregion
//#region 布局
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.panelBill, this.panelBody]
});
//#endregion
// this.opStatus = 'add';
_this = this;
this.storeBillList.on('beforeload', function (store) {
var sql = this.sqlcontext;
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
}, this);
this.storeBillList.on('load', function (store, records) {
if (store.getCount() > 0) {
this.gridBillList.getSelectionModel().select(0);
} else {
_this.storeDrChFee.removeAll();
_this.storeCrChFee.removeAll();
_this.storeBodySum.load({
params: { bsno:'11' },
callback: function (r, options, success) {
if (success) {
//_this.setTotalHead();
}
}
});
_this.storeAuditDetailList.removeAll();;
_this.storeLog.removeAll();;
_this.panelAmendFee.setVisible(false);
_this.storeBodyTtlSum.removeAll();
_this.setTotalHead();
}
}, this);
this.CheckAll.addListener('change', function (field, newValue, oldValue, eOpts) {
this.CheckChange(field, newValue, oldValue, eOpts);
}, this);
_this = this;
this.gridBillList.getSelectionModel().on('select', function (model, record, index) {
var bsno = record.data.BSNO;
var optype = record.data.OPLBNAME;
var OPTYPE = record.data.OPTYPE;
var bltype = record.data.BLTYPE;
this.strOPTYPE = OPTYPE;
this.stroplb = record.data.OPLB;
this.strBSNO = record.data.BSNO;
this.strMBSNO = record.data.PARENTID;
this.FeeStatus = record.data.FEESTATUS;
var isAll = '0';
this.storeLog.removeAll();
this.storeAuditDetailList.removeAll();
var condition ="";
this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: this.stroplb, isAll: isAll, condition: condition } });
this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: this.stroplb, isAll: isAll, condition: condition } });
var AUDITTYPE = Ext.getCmp('PS_AUDITTYPE').getValue();
var sql = "BSNO='" + bsno + "'";
if (AUDITTYPE != '') sql = sql + " and AUDITTYPE='" + AUDITTYPE + "'";
this.storeAuditDetailList.load({ params: { start: 0, limit: this.PageSize, condition: sql} });
this.storeLog.load({ params: { condition: " (BSNO='" + bsno + "') " } });
this.storeBodySum.load({
params: { bsno: bsno, bltype: bltype },
callback: function (r, options, success) {
if (success) {
//_this.setTotalHead();
}
}
});
this.storeBodyTtlSum.load({
params: { bsno: bsno, bltype: bltype },
callback: function (r, options, success) {
if (success) {
_this.setTotalHead();
}
}
});
if (this.strOPTYPE=='更改单') {
var amendsql = " PARENTID='" + this.strMBSNO + "' and CREATETIME<='" + record.data.CREATETIME+"' ";
// var amendsql = " PARENTID='" + this.strMBSNO + "' ";
this.storeBodyAmendSum.load({
params: { bsno: bsno, condition: amendsql },
callback: function (r, options, success) {
if (success) {
_this.setAmendTotalHead();
}
}
});
_this.panelAmendFee.setVisible(true);
} else {
_this.panelAmendFee.setVisible(false);
}
//this.storeChFeeGain.load({ params: { bsno: bsno, bltype: bltype} });
}, this);
this.InitData();
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
this.gridBillList.reconfigure(this.storeBillList, this.girdcolums);
//this.gridBillList.columns[1] = new Ext.grid.RowNumberer();
//#region 费用锁定
//#endregion
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='AMENDSELFWORKFLOW'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.AMENDSELFWORKFLOW = 1;
} else {
}
}
} else {
}
},
scope: this
});
this.panelSearch.hide();
this.storeAuditer = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserActionRefListRm' }
});
this.storeAuditer.load(({ params: { MODULENAME: 'modBLFeeAudit' } }));
this.comboxAuditer = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '下一步审核人', //揽货人
store: this.storeAuditer,
forceSelection: true,
name: 'PS_AUDIT',
id: 'PS_AUDIT',
valueField: 'GID',
displayField: 'CodeAndName',
enableKeyEvents: true
});
this.storeIsAmend = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeIsAmend.add({ "DC": "1", "NAME": "是" });
this.storeIsAmend.add({ "DC": "0", "NAME": "否" });
this.comboxIsAmend= Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: "是否生成更改单",
store: this.storeIsAmend,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'ISAMEND',
listeners: {
scope: this,
change: function (field, newValue, oldValue, eOpts) {
if (newValue == null || newValue == '') return;
if (newValue != oldValue) {
if (newValue == '1') {
var submitop = '';
for (var j = 0; j < _this.storeLog.getCount(); j += 1) {
var memberbody = _this.storeLog.getAt(j);
if (memberbody.data.AUDITTYPE == '提交审核') submitop = memberbody.data.AUDITUSER;
};
_this.formAuditShow.getForm().findField('AMENDOP').setValue(submitop);
}
}
}
}
});
this.CheckIsFinish = new Ext.form.Checkbox({
fieldLabel: '是否最终审核', //'不输出箱号封号',
readOnly:true,
checked: false,
name: 'ISFINISH'
});
this.storeMyAuditDetailList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpAuditDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpAuditDetail/GetListData',
reader: {
id: 'ADID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.CheckBoxMyAuditDetailModel = Ext.create('Ext.selection.CheckboxModel');
this.storeMyAUDITTYPE = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeMyAUDITTYPE.add({ "FSTATUS": "", "NAME": "全部" });
this.storeMyAUDITTYPE.add({ "FSTATUS": "1", "NAME": "未匹配" });
this.storeMyAUDITTYPE.add({ "FSTATUS": "0", "NAME": "已匹配" });
this.comboxMyAUDITTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '匹配状态', //是否开垫付
store: this.storeMyAUDITTYPE,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'AUDITTYPE',
id: 'PS_MYAUDITTYPE',
value: '1',
// flex: 0.7,
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.storeMyAuditDetailList.load();
}
},
'select': function (combo, records, eOpts) {
if (records.length > 0) {
_this.storeMyAuditDetailList.load();
}
}
}
});
this.storeMyAuditDetailList.on('beforeload', function (store) {
var AUDITTYPE = Ext.getCmp('PS_MYAUDITTYPE').getValue();
if (this.isAmend) AUDITTYPE = Ext.getCmp('PS_MYAUDITTYPE2').getValue();
var sql = "BSNO='" + this.strBSNO + "' AND CREATEUSER='" + SHOWNAME + "'";
if (AUDITTYPE != '') sql = sql + " and AUDITTYPE='" + AUDITTYPE + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
//定义Grid
this.gridMyAuditDetailList = new Ext.grid.GridPanel({
store: this.storeMyAuditDetailList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
viewConfig: {
autoFill: true,
enableTextSelection: true
},
selModel: this.CheckBoxMyAuditDetailModel,
selType: 'cellmodel',
tbar: [this.comboxMyAUDITTYPE],
columns: this.girdAuditDetailcolums,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeMyAuditDetailList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridMyAuditDetailList.reconfigure(this.storeMyAuditDetailList, this.girdAuditDetailcolums);
this.panelMyAudit = new Ext.Panel({
title: '审核匹配信息',
// layout: "border",
layout: "border",
split: true,
height: 200,
// region: 'north',
// height: 560,
region: 'center',
width: 600,
items: [
this.gridMyAuditDetailList
]
});
this.CheckBoxMyAuditDetailModel2 = Ext.create('Ext.selection.CheckboxModel');
this.comboxMyAUDITTYPE2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '匹配状态', //是否开垫付
store: this.storeMyAUDITTYPE,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'AUDITTYPE',
id: 'PS_MYAUDITTYPE2',
value: '1',
// flex: 0.7,
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.storeMyAuditDetailList.load();
}
},
'select': function (combo, records, eOpts) {
if (records.length > 0) {
_this.storeMyAuditDetailList.load();
}
}
}
});
this.gridMyAuditDetailList2 = new Ext.grid.GridPanel({
store: this.storeMyAuditDetailList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
viewConfig: {
autoFill: true,
enableTextSelection: true
},
selModel: this.CheckBoxMyAuditDetailModel2,
selType: 'cellmodel',
tbar: [this.comboxMyAUDITTYPE2],
columns: this.girdAuditDetailcolums,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeMyAuditDetailList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridMyAuditDetailList2.reconfigure(this.storeMyAuditDetailList, this.girdAuditDetailcolums);
this.panelMyAudit2 = new Ext.Panel({
title: '审核匹配信息',
// layout: "border",
layout: "border",
split: true,
// region: 'north',
height: 200,
region: 'center',
width: 600,
items: [
this.gridMyAuditDetailList2
]
});
this.storeAmendOp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.comboxAmendOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '更改接收人', //'客服',
store: this.storeAmendOp,
//forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
name: 'AMENDOP',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true
});
this.storeSourceDetail = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storeSourceDetail.load({ params: { enumTypeId: 97063 } });
this.comboxBSSOURCEDETAIL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '账单类型', //'来源明细',
store: this.storeSourceDetail,
// forceSelection: true,
name: 'BSSOURCEDETAIL',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
this.formAuditShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 80,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxAuditer, this.comboxIsAmend
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.CheckIsFinish, this.comboxAmendOp
]
},{
fieldLabel: '审核意见', //'AGENT',
name: 'AUDITREMARK',
xtype: 'textareafield',
grow: true,
height: 40,
anchor: '100%',
flex: 1.8
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '利润率',
name: 'TTLPRRATE'
}, {
fieldLabel: '利润率低/亏损原因', //'AGENT',
name: 'PRREASON',
xtype: 'textareafield',
grow: true,
hidden: true,
height: 40,
anchor: '100%',
flex: 1.8
}
]
} , this.comboxBSSOURCEDETAIL
]//end items(fieldset 1)
}, this.panelMyAudit
]//end root items
});
this.winAuditShow = Ext.create('Ext.window.Window', {
title: "审核通过",
width: 620,
//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",
items: [this.formAuditShow],
buttons: [{
text: "确认审核",
minWidth: 70,
handler: function () {
var form = _this.formAuditShow.getForm();
var auditer = form.findField('PS_AUDIT').getValue();
var ISAMEND = form.findField('ISAMEND').getValue();
var AMENDOP = form.findField('AMENDOP').getValue();
var ISFINISH = '0';
if (_this.CheckIsFinish.checked)
ISFINISH = '1';
var AUDITREMARK = form.findField('AUDITREMARK').getValue();
if (ISFINISH == '0' && (auditer == '' || auditer == undefined)) {
Ext.Msg.show({ title: '提示', msg: '不是最终审核,下一步审核人不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var PRREASON = form.findField('PRREASON').getValue();
if (_this.lowprofitrate) {
if (PRREASON == '') {
Ext.Msg.show({ title: '提示', msg: '利润率低/亏损原因不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
}
var BSSOURCEDETAIL = form.findField('BSSOURCEDETAIL').getValue();
_this.onSelAuditfn(auditer, AUDITREMARK, ISAMEND, AMENDOP, ISFINISH, false, '', '', '', PRREASON,BSSOURCEDETAIL);
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
_this.winAuditShow.close();
}
}]
});
this.storeAuditer2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserActionRefListRm' }
});
this.storeAuditer2.load(({ params: { MODULENAME: 'modBLFeeAudit' } }));
this.comboxAuditer2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '下一步审核人', //揽货人
store: this.storeAuditer2,
forceSelection: true,
name: 'PS_AUDIT',
valueField: 'GID',
displayField: 'CodeAndName',
enableKeyEvents: true
});
this.storeIsAmend2 = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeIsAmend2.add({ "DC": "1", "NAME": "是" });
this.storeIsAmend2.add({ "DC": "0", "NAME": "否" });
this.comboxIsAmend2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: "是否生成更改单",
labelWidth: 100,
store: this.storeIsAmend2,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'ISAMEND',
listeners: {
scope: this,
change: function (field, newValue, oldValue, eOpts) {
if (newValue == null || newValue == '') return;
if (newValue != oldValue) {
if (newValue == '1') {
var submitop = '';
for (var j = 0; j < _this.storeLog.getCount(); j += 1) {
var memberbody = _this.storeLog.getAt(j);
if (memberbody.data.AUDITTYPE == '提交审核') submitop = memberbody.data.AUDITUSER;
};
_this.formAuditShow2.getForm().findField('AMENDOP').setValue(submitop);
}
}
}
}
});
this.storeAmendOp2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.comboxAmendOp2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '更改接收人', //'客服',
store: this.storeAmendOp2,
//forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
name: 'AMENDOP',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true
});
this.CheckIsFinish2 = new Ext.form.Checkbox({
fieldLabel: '是否最终审核', //'不输出箱号封号',
readOnly: true,
checked: false,
name: 'ISFINISH'
});
this.storeErrOp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeErrOp.load();
this.comboxErrOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '责任人', //揽货人
labelWidth: 60,
store: this.storeErrOp,
forceSelection: true,
name: 'ERROP',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true
});
this.storeErrCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
//this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'" } });
this.comboxErrCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '责任单位',//委托单位
labelWidth: 70,
store: this.storeErrCustCode,
//forceSelection: true,
name: 'ERRCUST',
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true
});
this.storeSourceDetail2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsExtEnumModel',
proxy: { url: '/CommMng/PubSys/GetEnumValueList' }
});
this.storeSourceDetail2.load({ params: { enumTypeId: 97063 } });
this.comboxBSSOURCEDETAIL2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '账单类型', //'来源明细',
//labelWidth: 70,
store: this.storeSourceDetail2,
// forceSelection: true,
name: 'BSSOURCEDETAIL',
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
this.formAuditShow2 = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 80,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxAuditer2, this.comboxErrOp,this.comboxErrCustCode
]
},{
fieldLabel: '原因归属', //'AGENT',
name: 'ERRREASON',
xtype: 'textareafield',
grow: true,
height: 40,
anchor: '100%',
flex: 1.8
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.CheckIsFinish2, this.comboxIsAmend2, this.comboxAmendOp2
]
},{
fieldLabel: '审核意见', //'AGENT',
name: 'AUDITREMARK',
xtype: 'textareafield',
grow: true,
height: 40,
anchor: '100%',
flex: 1.8
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '利润率',
name: 'TTLPRRATE'
}, {
fieldLabel: '利润率低/亏损原因', //'AGENT',
name: 'PRREASON',
xtype: 'textareafield',
grow: true,
hidden: true,
height: 40,
anchor: '100%',
flex: 1.8
}
]
}, this.comboxBSSOURCEDETAIL2,this.panelMyAudit2
]//end root items
});
this.winAuditShow2 = Ext.create('Ext.window.Window', {
title: "审核通过",
width: 620,
//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",
items: [this.formAuditShow2],
buttons: [{
text: "确认审核",
minWidth: 70,
handler: function () {
var form = _this.formAuditShow2.getForm();
var auditer = form.findField('PS_AUDIT').getValue();
var ERROP = form.findField('ERROP').getValue();
var ERRCUST = form.findField('ERRCUST').getValue();
var ERRREASON = form.findField('ERRREASON').getValue();
var ISAMEND = form.findField('ISAMEND').getValue();
var AMENDOP = form.findField('AMENDOP').getValue();
var ISFINISH = '0';
if (_this.CheckIsFinish2.checked)
ISFINISH = '1';
var AUDITREMARK = form.findField('AUDITREMARK').getValue();
if (ISFINISH == '0' && (auditer == '' || auditer == undefined)) {
Ext.Msg.show({ title: '提示', msg: '不是最终审核,下一步审核人不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var PRREASON = form.findField('PRREASON').getValue();
if (_this.lowprofitrate) {
if (PRREASON == '') {
Ext.Msg.show({ title: '提示', msg: '利润率低/亏损原因不能为空!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
}
var BSSOURCEDETAIL = form.findField('BSSOURCEDETAIL').getValue();
_this.onSelAuditfn(auditer, AUDITREMARK, ISAMEND, AMENDOP, ISFINISH, true, ERROP, ERRREASON, ERRCUST, PRREASON, BSSOURCEDETAIL);
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
_this.winAuditShow2.close();
}
}]
});
this.formModify = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '操作费计算量', //'服务合同号',
labelWidth: 90,
name: 'OPFEECOUNT'
}, {
fieldLabel: '考核票数', //'申请放箱号',
// readOnly:true,
name: 'OPCOUNT'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
}); //end this.formEdit
this.winModifyShow = Ext.create('Ext.window.Window', {
title: "操作计算量及考核票数修改", //"批量修改",
width: 360,
//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",
items: [this.formModify],
buttons: [{
text: "确认修改", //"确认修改",
minWidth: 70,
handler: function () {
_this.onModifyClick()
}
}, {
text: "关闭", //"关闭",
minWidth: 70,
handler: function () {
_this.winModifyShow.close();
}
}]
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modAuditBLIsFinish"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
_this.CheckIsFinish.setRawValue(true);
_this.CheckIsFinish.setReadOnly(false);
_this.CheckIsFinish2.setRawValue(true);
_this.CheckIsFinish2.setReadOnly(false);
}
} else {
}
},
scope: this
});
this.gridDrChFee.getSelectionModel().on('select', function (model, record, index) {
var FeeName = record.data.FeeName;
for (i = 0; i < this.storeCrChFee.getCount(); i += 1) {
var memberyf = this.storeCrChFee.getAt(i);
var recchange = memberyf.getChanges();
if ((FeeName != '') && (memberyf.data.FeeName == FeeName)) {
memberyf.set("ISSEL", '1');
} else {
memberyf.set("ISSEL", '0');
}
if (isEmptyObject(recchange)) memberyf.commit();
};
}, this);
this.gridCrChFee.getSelectionModel().on('select', function (model, record, index) {
var FeeName = record.data.FeeName;
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i);
var recchange = memberyf.getChanges();
if ((FeeName != '') && (memberyf.data.FeeName == FeeName)) {
memberyf.set("ISSEL", '1');
} else {
memberyf.set("ISSEL", '0');
}
if (isEmptyObject(recchange)) memberyf.commit();
};
}, this);
var SelAuditBack2 = Ext.getCmp('SelAuditBack2');
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "SelAuditBack2"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
SelAuditBack2.enable();
} else {
SelAuditBack2.disable();
}
} else {
SelAuditBack2.disable();
}
},
scope: this
});
}, //end initUIComponents
//#region 加载数据
InitData: function () {
var condition = '';
/*
if (this.ParentPanel) {
var ret = this.ParentPanel.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.editRecord = ret[2];
this.RefBillNo = ret[3];
}
*/
// this.panelSearch.hide();
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.PageSize = this.Pagenum.getValue();
this.storeBillList.pageSize = this.PageSize;
// this.BillSql = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0) ";
this.BillSql = " a.AUDITUSER='" + userid + "' and isnull(a.ISFINISH,0)<>1 ";
_this = this;
this.sqlcontext = this.BillSql;
this.storeBillList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql },
waitMsg: Zi.LAN.NowSelect,//正在查询
callback: function (r, options, success) {
if (success) {
this.DataLoading = false;
if (r.length > 0) {
this.gridBillList.getSelectionModel().select(0);
} else {
var bsno = '1';
var optype = '1';
var isAll = '0';
_this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll } });
_this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll } });
_this.storeBodySum.load({ params: { bsno: bsno },
callback: function (r, options, success) {
if (success) {
_this.setTotalHead();
}
}
});
_this.storeAuditDetailList.load({ params: { start: 0, limit: this.PageSize, condition: "BSNO='" + bsno + "'" } });
_this.storeLog.load({ params: { condition: " (BSNO='" + bsno + "') " } });
_this.panelAmendFee.setVisible(false);
_this.storeBodyTtlSum.removeAll();
_this.setTotalHead();
//_this.storeChFeeGain.load({ params: { bsno: bsno} });
//_this.storeBLList.removeAll();
}
}
},
scope: this
});
// var el = Ext.get("gridDrChFee");
}, // end LoadDate
InitDrGrid: function (grid) {
var agirdcolums = grid;
this.gridDrChFee.reconfigure(this.storeDrChFee, agirdcolums);
},
InitCrGrid: function (grid) {
var agirdcolums = grid;
this.gridCrChFee.reconfigure(this.storeCrChFee, agirdcolums);
},
setTotalHead: function () {
var ref = this.getProfitNum();
rmbdr = ref.rmbdr;
rmbcr = ref.rmbcr;
rmbprofit = ref.rmbprofit;
usddr = ref.usddr;
usdcr = ref.usdcr;
rmbdr = ref.rmbdr;
usdprofit = ref.usdprofit;
otdr = ref.otdr;
otcr = ref.otcr;
otprofit = ref.otprofit;
ttldr = ref.ttldr;
ttlcr = ref.ttlcr;
ttlprofit = ref.ttlprofit;
profitrate = ref.profitrate;
noacctaxttldr = ref.noacctaxttldr;
noacctaxttlcr = ref.noacctaxttlcr;
acctaxttldr = ref.acctaxttldr;
acctaxttlcr = ref.acctaxttlcr;
var rmblb = "";
var usdlb = "";
var otlb = "";
var ttllb = "";
if (this.onlyfeedr == 1) {
rmbcr = '***'; rmbprofit = '***'; usdcr = '***'; usdprofit = '***'; otcr = '***'; otprofit = '***'; ttlcr = '***'; ttlprofit = '***';
}
if (this.onlyfeecr == 1) {
rmbdr = '***'; rmbprofit = '***'; usddr = '***'; usdprofit = '***'; otdr = '***'; otprofit = '***'; ttldr = '***'; ttlprofit = '***';
}
if (rmbdr != 0 || rmbcr != 0 || rmbprofit != 0) {
var feecolor = 'green';
if (rmbprofit < 0) feecolor = 'red';
rmblb = "&nbsp&nbsp&nbsp" + LOCALCURR + Zi.LAN.profit + ":<font size='3' color='" + feecolor + "'>" + returnfloat(rmbprofit) + "</font>&nbsp&nbsp&nbsp|";
}
if (usddr != 0 || usdcr != 0 || usdprofit != 0) {
var feecolor = 'green';
if (usdprofit < 0) feecolor = 'red';
usdlb = "&nbsp&nbsp&nbsp"+Zi.LAN.USDprofit + "<font size='3' color='" + feecolor + "'>" + returnfloat(usdprofit) + "</font>&nbsp&nbsp&nbsp|";
}
if (otdr != 0 || otcr != 0 || otprofit != 0) {
var feecolor = 'green';
if (otprofit < 0) feecolor = 'red';
otlb = "&nbsp&nbsp&nbsp" +Zi.LAN.Otherprofit + "<font size='3' color='" + feecolor + "'>" + returnfloat(otprofit) + "</font>&nbsp&nbsp&nbsp|";
}
//if (ttldr != 0 || ttlcr != 0 || ttlprofit != 0) {
var feecolor = 'green';
if (ttlprofit < 0) feecolor = 'red';
ttllb = "&nbsp&nbsp&nbsp" + Zi.LAN.ReceivableSum + ": <font size='3' color='" + feecolor + "'>" + returnfloat(ttldr) + "</font> &nbsp&nbsp" + Zi.LAN.profitSum + ":<font size='3' color='" + feecolor + "'>" + returnfloat(ttlcr) + "</font> &nbsp&nbsp" + Zi.LAN.Hejiprofit + "<font size='3' color='" + feecolor + "'>" + returnfloat(ttlprofit) + "</font>&nbsp&nbsp" + Zi.LAN.ProfitMargins + "<font size='3' color='" + feecolor + "'>" + returnfloat(profitrate) + "</font>";
//}
this.tabTotal.setTitle(Zi.LAN.TotalProfit + rmblb + usdlb + otlb + ttllb);
},
getProfitNum: function () {
var rmbdr = 0;
var rmbcr = 0;
var usddr = 0;
var usdcr = 0;
var otdr = 0;
var otcr = 0;
var ttldr = 0;
var ttlcr = 0;
var rmbprofit = 0;
var usdprofit = 0;
var otprofit = 0;
var ttlprofit = 0;
var profitrate = 0;
var noacctaxttldr = 0;
var noacctaxttlcr = 0;
var acctaxttldr = 0;
var acctaxttlcr = 0;
for (i = 0; i < this.storeBodyTtlSum.getCount(); i += 1) {
var memberyf = this.storeBodyTtlSum.getAt(i);
if (memberyf.data.CURR == LOCALCURR) {
rmbdr = memberyf.data.DR;
rmbcr = memberyf.data.CR;
rmbprofit = memberyf.data.PR;
} else if (memberyf.data.CURR == 'USD') {
usddr = memberyf.data.DR;
usdcr = memberyf.data.CR;
usdprofit = memberyf.data.PR;
} if (memberyf.data.CURR == '其他币别') {
otdr = memberyf.data.DR;
otcr = memberyf.data.CR;
otprofit = memberyf.data.PR;
} if (memberyf.data.CURR == '合计') {
ttldr = memberyf.data.DR;
ttlcr = memberyf.data.CR;
ttlprofit = memberyf.data.PR;
profitrate = memberyf.data.PROFITRATE;
noacctaxttldr = memberyf.data.NOACCTAXRATEDR;
noacctaxttlcr = memberyf.data.NOACCTAXRATECR;
acctaxttldr = memberyf.data.ACCTAXDR;
acctaxttlcr = memberyf.data.ACCTAXCR;
}
//ttldr = Add(ttldr,memberyf.data.TTLDR);
//ttlcr = Add(ttlcr,memberyf.data.TTLCR);
}
//ttlprofit = Add(ttldr, -ttlcr);
//if (ttldr != 0) {
// profitrate = Mul(Div(ttlprofit, ttldr, 4), 100).toFixed(2);;
//}
return { rmbdr: rmbdr, rmbcr: rmbcr, rmbprofit: rmbprofit, usddr: usddr, usdcr: usdcr, usdprofit: usdprofit, otdr: otdr, otcr: otcr, otprofit: otprofit, ttldr: ttldr, ttlcr: ttlcr, ttlprofit: ttlprofit, profitrate: profitrate, noacctaxttldr: noacctaxttldr, noacctaxttlcr: noacctaxttlcr, acctaxttldr: acctaxttldr, acctaxttlcr: acctaxttlcr };
},
setAmendTotalHead: function () {
var ttlprofit = 0;
var profit = 0;
var profitrate = 0;
var beforettlprofit = 0;
for (i = 0; i < this.storeBodyAmendSum.getCount(); i += 1) {
var memberyf = this.storeBodyAmendSum.getAt(i);
profitrate = memberyf.data.TTLPRRATE;
profit = memberyf.data.PR;
ttlprofit = memberyf.data.TTLPR;
}
beforettlprofit = Add(ttlprofit, -profit);
var rmblb = "";
var usdlb = "";
var otlb = "";
var ttllb = "";
var feecolor = 'green';
if (ttlprofit < 0) feecolor = 'red';
ttllb = "更改前利润: <font size='3' color='" + feecolor + "'>" + returnfloat(beforettlprofit) + "</font> &nbsp&nbsp更改后利润:<font size='3' color='" + feecolor + "'>" + returnfloat(ttlprofit) + "</font> &nbsp&nbsp更改后利润率<font size='3' color='" + feecolor + "'>" + returnfloat(profitrate) + "</font>";
//}
this.panelAmendFee.setTitle(ttllb);
},
//#endregion
//#region 明细操作
onRefreshClick: function (button, event) {
// var girdcolums = this.gridList.getColumnMode();
this.BillSql = this.getCondition();
_this = this;
this.PageSize = this.Pagenum.getValue();
this.storeBillList.pageSize = this.PageSize;
this.sqlcontext = this.BillSql;
this.storeBillList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql },
waitMsg: Zi.LAN.NowSelect,//正在查询数据
callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
this.gridBillList.getSelectionModel().select(0);
} else {
var bsno = '1';
var optype = '1';
var isAll = '0';
// isAll = this.comboxaddDCType.getValue();
_this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll } });
_this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll } });
_this.storeBodySum.load({ params: { bsno: bsno },
callback: function (r, options, success) {
if (success) {
_this.setTotalHead();
}
}
});
_this.storeAuditDetailList.load({ params: { start: 0, limit: this.PageSize, condition: "BSNO='" + bsno + "'" } });
_this.storeLog.load({ params: { condition: " (BSNO='" + bsno + "') " } });
_this.panelAmendFee.setVisible(false);
_this.storeBodyTtlSum.removeAll();
_this.setTotalHead();
}
}
},
scope: this
});
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
this.PageSize = this.Pagenum.getValue();
this.storeBillList.pageSize = this.PageSize;
this.BillSql = this.sqlcontext;
this.storeBillList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.BillSql },
waitMsg: Zi.LAN.NowSelect,//正在查询数据
callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
this.gridBillList.getSelectionModel().select(0);
} else {
var bsno = '1';
var optype = '1';
var isAll = '0';
_this.storeDrChFee.load({ params: { bsno: bsno, type: 1, optype: optype, isAll: isAll } });
_this.storeCrChFee.load({ params: { bsno: bsno, type: 2, optype: optype, isAll: isAll } });
_this.storeBodySum.load({ params: { bsno: bsno },
callback: function (r, options, success) {
if (success) {
_this.setTotalHead();
}
}
});
_this.storeAuditDetailList.load({ params: { start: 0, limit: this.PageSize, condition: "BSNO='" + bsno + "'" } });
_this.storeLog.load({ params: { condition: " (BSNO='" + bsno + "') " } });
_this.panelAmendFee.setVisible(false);
_this.storeBodyTtlSum.removeAll();
_this.setTotalHead();
}
}
},
scope: this
});
},
CheckChange: function (field, newValue, oldValue, eOpts) {
this.onRefreshClick();
},
onModifyClick: function (menu, event) {
var GidStr = '';
var records = this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
icount = 0;
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
bodyAddDatas.push(rec);
icount = icount + 1;
}
var data = this.formModify.getForm().getValues();
_this = this;
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: '提示', msg: '没有要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return;
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: '正在操作数据...',
url: '/MvcShipping/MsOpAuditDetail/modify',
params: {
data: jsonbodyAddDatas,
modifydata: Ext.JSON.encode(data)
},
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.Msg.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.storeBillList.reload();
_this.winModifyShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
onSelAuditClick: function (menu, event) {
var records = this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (records.length > 1) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg:'不允许批量审核!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.isAmend = false;
this.lowprofitrate = false;
var BSSOURCEDETAIL = '';
for (var i = 0; i < records.length; i++) {
var rec = records[i];
if (rec.data.AUDITUSERREF != SHOWNAME) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: '不是当前审核人,不允许审核!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.OPTYPE == '更改单') {
this.isAmend = true;
}
var TTLPRRATE = rec.data.TTLPRRATE;
var BSSOURCEDETAIL = rec.data.BSSOURCEDETAIL;
if (((TTLPRRATE < 3) || (TTLPRRATE == '') || (TTLPRRATE== null)) && (rec.data.OPLBNAME == '海运出口')) {
this.lowprofitrate = true;
}
}
var submitop = '';
for (var j = 0; j < this.storeLog.getCount(); j += 1) {
var memberbody = this.storeLog.getAt(j);
if (memberbody.data.AUDITTYPE == '提交审核') submitop = memberbody.data.AUDITUSER;
};
var ISAMEND = '0';
if (this.isAmend) ISAMEND = '1';
Ext.Ajax.request({
waitMsg: '正在添加数据...', //'正在添加数据...',
url: '/MvcShipping/MsOpAuditDetail/IsAutoAudit',
params: {
oplb: rec.data.OPLB,
bsno: rec.data.BSNO,
isamend: ISAMEND,
issubmit: false
},
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 {
this.storeMyAuditDetailList.load();
if (this.isAmend) {
if (this.storeLog.getCount() > 0) {
var memberyf = this.storeLog.getAt(this.storeLog.getCount() - 1);
this.formAuditShow2.getForm().findField('ERROP').setValue(memberyf.data.ERROP);
this.formAuditShow2.getForm().findField('ERRCUST').setValue(memberyf.data.ERRCUST);
this.formAuditShow2.getForm().findField('ERRREASON').setValue(memberyf.data.ERRMSG);
this.formAuditShow2.getForm().findField('AUDITREMARK').setValue(memberyf.data.AUDITREMARK);
this.formAuditShow2.getForm().findField('ISAMEND').setValue(0);
this.formAuditShow2.getForm().findField('AMENDOP').setValue('');
this.formAuditShow2.getForm().findField('PRREASON').setValue(memberyf.data.PRREASON);
} else {
this.formAuditShow2.getForm().reset();
}
if (this.isAmend) {
this.formAuditShow2.getForm().findField('BSSOURCEDETAIL').setValue('');
this.formAuditShow2.getForm().findField('BSSOURCEDETAIL').setVisible(false);
} else {
this.formAuditShow2.getForm().findField('BSSOURCEDETAIL').setValue(BSSOURCEDETAIL);
this.formAuditShow2.getForm().findField('BSSOURCEDETAIL').setVisible(true);
}
//this.formAuditShow2.getForm().findField('PRREASON').setValue('');
this.formAuditShow2.getForm().findField('TTLPRRATE').setValue(TTLPRRATE);
if (_this.lowprofitrate) {
this.formAuditShow2.getForm().findField('PRREASON').setVisible(true);
this.formAuditShow2.getForm().findField('TTLPRRATE').setVisible(true);
} else {
this.formAuditShow2.getForm().findField('PRREASON').setVisible(false);
this.formAuditShow2.getForm().findField('TTLPRRATE').setVisible(false);
}
this.winAuditShow2.show();
} else {
if (this.storeLog.getCount() > 0) {
var memberyf = this.storeLog.getAt(this.storeLog.getCount() - 1);
this.formAuditShow.getForm().findField('AUDITREMARK').setValue(memberyf.data.AUDITREMARK);
this.formAuditShow.getForm().findField('ISAMEND').setValue(0);
this.formAuditShow.getForm().findField('AMENDOP').setValue('');
this.formAuditShow.getForm().findField('PRREASON').setValue(memberyf.data.PRREASON);
} else {
this.formAuditShow.getForm().reset();
this.formAuditShow.getForm().findField('ISAMEND').setValue(0);
this.formAuditShow.getForm().findField('AMENDOP').setValue('');
}
if (this.isAmend) {
this.formAuditShow.getForm().findField('BSSOURCEDETAIL').setValue('');
this.formAuditShow.getForm().findField('BSSOURCEDETAIL').setVisible(false);
} else {
this.formAuditShow.getForm().findField('BSSOURCEDETAIL').setValue(BSSOURCEDETAIL);
this.formAuditShow.getForm().findField('BSSOURCEDETAIL').setVisible(true);
}
//this.formAuditShow.getForm().findField('BSSOURCEDETAIL').setValue(BSSOURCEDETAIL);
//this.formAuditShow.getForm().findField('PRREASON').setValue('');
this.formAuditShow.getForm().findField('TTLPRRATE').setValue(TTLPRRATE);
if (_this.lowprofitrate) {
this.formAuditShow.getForm().findField('PRREASON').setVisible(true);
this.formAuditShow.getForm().findField('TTLPRRATE').setVisible(true);
} else {
this.formAuditShow.getForm().findField('PRREASON').setVisible(false);
this.formAuditShow.getForm().findField('TTLPRRATE').setVisible(false);
}
this.winAuditShow.show();
}
}
} else {
Ext.MessageBox.alert('服务器响应出错', response.responseText);
}
},
scope: this
});
},
onSelAuditfn: function (auditer, AUDITREMARK, ISAMEND, AMENDOP, ISFINISH, amend, ERROP, ERRREASON, ERRCUST, PRREASON, BSSOURCEDETAIL) {
var GidStr = '';
var records = this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
bodyAddDatas.push(rec);
}
var bodydatas = [];
for (var i = 0; i < this.storeMyAuditDetailList.getCount(); i += 1) {
var member = this.storeMyAuditDetailList.getAt(i);
bodydatas.push(member);
}
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LoaclYeWuNo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
var jsonbodyDatas = ConvertRecordsToJsonAll(bodydatas);
Ext.Msg.wait(Zi.LAN.ZZShenHe);
Ext.Ajax.request({
waitMsg: Zi.LAN.zzaiLoacal,
url: '/MvcShipping/MsOpAuditDetail/AuditBL',
params: {
data: jsonbodyAddDatas,
isamend: ISAMEND,
amendop: AMENDOP,
audit: auditer,
auditremark: AUDITREMARK,
isfinish: ISFINISH,
errmsg: ERRREASON,
errop: ERROP,
errcust: ERRCUST,
auditbody: jsonbodyDatas,
prreason: PRREASON,
bssourcedetail: BSSOURCEDETAIL
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.hide();
_this.storeBillList.reload();
if (amend)
this.winAuditShow2.close()
else
this.winAuditShow.close();
Ext.MessageBox.hide();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
},
onSelAuditBackClick: function (menu, event, isnotstlstr) {
var GidStr = '';
var records = this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
if (rec.data.BillFeeStatus!="1") {
Ext.Msg.show({ title: '提示', msg: '请先撤销最终审核,才能驳回审核!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.AUDITUSERREF == SHOWNAME) {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title:'提示', msg:'只有审核人,才能驳回审核!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
}
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.LoaclYeWuNo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
//提示', '确定删除该记录吗?
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait(Zi.LAN.ZZShenHe);
Ext.MessageBox.show({
title: "确认驳回!",
msg: '请输入驳回原因!',
width: 300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: function (btn, text) {
if (btn == "ok") {
Ext.Ajax.request({
waitMsg: Zi.LAN.zzaiLoacal,
url: '/MvcShipping/MsOpAuditDetail/SelAuditBackBL',
params: {
data: jsonbodyAddDatas,
reason: text,
isnotstl: isnotstlstr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.hide();
// Ext.Msg.show({ title: Zi.LAN.TiShi, msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// _this.onRefreshClick();
_this.storeBillList.reload();
//_this.storeDrChFee.reload();
//_this.storeCrChFee.reload();
//_this.storeAuditDetailList.reload();
//_this.storeLog.reload();
Ext.MessageBox.hide();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
}
});
}
},
onCancelAuditClick: function (menu, event) {
var records = _this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var rec = records[0];
if (SHOWNAME !='翟春娣') {
Ext.Msg.show({ title: '提示', msg: '只有最终审核人才允许驳回!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.BillFeeStatus != 2) {
Ext.Msg.show({ title: '提示', msg: '当前状态不允许撤销!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var isamend = "0";
if (rec.data.OPTYPE == '更改单') isamend="1";
Ext.MessageBox.confirm('提示', "确实要撤销选中的账单审核吗?", function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在操作数据...');
Ext.Ajax.request({
waitMsg: '正在操作数据...',
url: '/MvcShipping/MsOpAuditDetail/CloseAuditBL',
params: {
bsno: rec.data.BSNO,
oplb: rec.data.OPLB,
isamend: isamend
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (!jsonresult.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
else {
_this.storeBillList.reload();
Ext.MessageBox.hide();
}
}
},
failure: function (response, options) {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}, this);
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait(Zi.LAN.ZZShenHe);
Ext.MessageBox.show({
title: "确认驳回!",
msg: '请输入驳回原因!',
width: 300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: function (btn, text) {
if (btn == "ok") {
Ext.Ajax.request({
waitMsg: Zi.LAN.zzaiLoacal,
url: '/MvcShipping/MsOpAuditDetail/SelAuditBackBL',
params: {
data: jsonbodyAddDatas,
reason: text
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.hide();
_this.storeBillList.reload();
Ext.MessageBox.hide();
}
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
}
}
});
},
onSelViewClick: function (menu, event) {
var GidStr = '';
var records = this.AddGridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.SelectShenHe, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bsno = records[0].data.BSNO;
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=" + bsno + "&name=";
window.open(openUrl, openType, openSet);
},
UpListStatus: function (bsno) {
Ext.Ajax.request({
waitMsg: Zi.LAN.OnSelect,
url: '/Account/Chfee_Audit/GetBLData',
params: {
handle: 'edit',
condition: " BSNO='" + bsno + "'",
isapp: false
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
var data = result.data;
for (i = 0; i < this.storeBillList.getCount(); i += 1) {
var memberyf = this.storeBillList.getAt(i);
if (memberyf.data.BSNO == bsno) {
memberyf.data.DRFEESTATUS = data.DRFEESTATUS;
memberyf.data.CRFEESTATUS = data.CRFEESTATUS;
memberyf.data.FEESTATUS = data.FEESTATUS;
memberyf.data.FEESTATUSREF = data.FEESTATUSREF;
memberyf.commit();
}
};
} else {
Ext.MessageBox.alert(Zi.LAN.Error, response.responseText);
}
},
scope: this
});
},
onViewDetailClick: function (button, event, type) {
var openSet = "height=540, 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 () {
var feeStatus = 0;
if (feeStatus == '0' || feeStatus == false || feeStatus == 'false')
return true;
else {//"此票委托已费用已锁定,不允许操作费用!"
Ext.Msg.show({ title: Zi.LAN.E, msg: Zi.LAN.FeiYongYisD, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return false;
}
},
//#endregion
getFeeStatus: function () {
var feeStatus = this.EditRecord.get('FEESTATUS');
return feeStatus;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onClearClick
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
var feestr ='';
if (feestr != '') feestr = " and " + feestr;
/*
var sqldata = form.getValues();
sql = Ext.JSON.encode(sqldata);
*/
var StrAudit = " a.AUDITUSER='" + userid + "' and isnull(a.ISFINISH,0)<>1 and b.BillFeeStatus=1 ";
//var StrAudit = " (OPTYPE='更改单' or (OPTYPE='普通货' and BSNO=MASTERNO)) AND EXISTS (select 1 from workflow_using wu left join workflow_step st on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) "
//StrAudit = StrAudit + " where wu.bsno=v_op_bill.BSNO "
//StrAudit = StrAudit + " and wu.TYPENO=602 "
//StrAudit = StrAudit + " and isnull((power(2,(ST.STEPNO)) & wu.stepno),0)>0 and st.AUDITOR='" + userid + "' "
//StrAudit = StrAudit + " ) ";
if (_this.SearchBtn.text != Zi.LAN.HideQuery) {
return StrAudit
}
var mblNo = form.findField('PS_MBLNO').getValue();
// sql = sql + getAndConSql(sql, mblNo, "(MblNo like '%" + mblNo + "%' or hblNo like '%" + mblNo + "%' OR CUSTNO like '%" + mblNo + "%' OR CUSTOMNO like '%" + mblNo + "%' OR ORDERNO like '%" + mblNo + "%')");
sql = sql + getAndConSql(sql, mblNo, " (CUSTNO+' '+MBLNO+' '+HBLNO+' '+CUSTOMNO+' '+ORDERNO like '%" + mblNo + "%')");
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " OPDATE>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " OPDATE<='" + expDate_Max + " 23:59:59'");
var accDate_Min = form.findField('PS_ACCDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, accDate_Min, " ACCDATE>='" + accDate_Min + "'");
var accDate_Max = form.findField('PS_ACCDATEEND').getRawValue();
sql = sql + getAndConSql(sql, accDate_Max, " ACCDATE<='" + accDate_Max + "'");
var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
//var LASTAUDITDAY = form.findField('LASTAUDITDAY').getValue();
//if (LASTAUDITDAY == '0') {
// sql = sql + getAndConSql(sql, LASTAUDITDAY, " NOT EXISTS (select 1 from V_OP_AUDIT_LOG_LASTAUDIT L WHERE L.BSNO=B.BSNO and [dbo].[CalculateWorkingDays](L.LASTAUDITTIME,L.AUDITTIME)>2 )");
//} else if (LASTAUDITDAY == '1') {
// sql = sql + getAndConSql(sql, LASTAUDITDAY, " EXISTS (select 1 from V_OP_AUDIT_LOG_LASTAUDIT L WHERE L.BSNO=B.BSNO and [dbo].[CalculateWorkingDays](L.LASTAUDITTIME,L.AUDITTIME)>2 )");
//}
var LASTAUDITDAY2 = form.findField('LASTAUDITDAY2').getValue();
if (LASTAUDITDAY2 == '0') {
sql = sql + getAndConSql(sql, LASTAUDITDAY2, " NOT EXISTS (select 1 from v_op_audit_log_MAX L WHERE L.BSNO=B.BSNO and [dbo].[CalculateWorkingDays](L.AUDITTIME,GETDATE())>2 )");
} else if (LASTAUDITDAY2 == '1') {
sql = sql + getAndConSql(sql, LASTAUDITDAY2, " EXISTS (select 1 from v_op_audit_log_MAX L WHERE L.BSNO=B.BSNO and [dbo].[CalculateWorkingDays](L.AUDITTIME,GETDATE())>2 )");
}
if (this.CheckAll.checked) {
sql = sql + getAndConSql(sql, StrAudit, StrAudit);
};
//var AGENT = form.findField('PS_AGENT').getValue();
//sql = sql + getAndConSql(sql, AGENT, "AGENTID='" + AGENT + "'");
var SALE = form.findField('PS_SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "SALE='" + SALE + "'");
var OP = form.findField('PS_OP').getValue();
sql = sql + getAndConSql(sql, OP, "OP='" + OP + "'");
var OPLB = form.findField('PS_OPLB').getValue();
sql = sql + getAndConSql(sql, OPLB, "OPLBNAME='" + OPLB + "'");
//var VESSEL = form.findField('PS_VESSEL').getValue();
//sql = sql + getAndConSql(sql, VESSEL, "VESSEL like '%" + VESSEL + "%'");
//var VOYNO = form.findField('PS_VOYNO').getValue();
//sql = sql + getAndConSql(sql, VOYNO, "VOYNO like '%" + VOYNO + "%'");
//var BSSOURCE = form.findField('BSSOURCE').getValue();
//sql = sql + getAndConSql(sql, BSSOURCE, "BSSOURCE='" + BSSOURCE + "'");
var BillFeeStatus = form.findField('BillFeeStatus').getValue();
if (BillFeeStatus == "5") {
sql = sql + getAndConSql(sql, BillFeeStatus, "isnull(BillFeeStatus,0)<>2");
} else
sql = sql + getAndConSql(sql, BillFeeStatus, "isnull(BillFeeStatus,0)=" + BillFeeStatus );
var OPTYPE = form.findField('OPTYPE').getValue();
sql = sql + getAndConSql(sql, OPTYPE, "OPTYPE='" + OPTYPE + "'");
var auditlog = '';
var PS_AUDITBGN = form.findField('PS_AUDITBGN').getRawValue();
auditlog = auditlog + getAndConSql(auditlog, PS_AUDITBGN, " AUDITTIME>='" + PS_AUDITBGN + "'");
var PS_AUDITEND = form.findField('PS_AUDITEND').getRawValue();
auditlog = auditlog + getAndConSql(auditlog, PS_AUDITEND, " AUDITTIME<='" + PS_AUDITEND + " 23:59:59'");
var PS_AUDIT = form.findField('PS_AUDIT').getValue();
auditlog = auditlog + getAndConSql(auditlog, PS_AUDIT, "AUDITUSER='" + PS_AUDIT + "'");
sql = sql + getAndConSql(sql, auditlog, " EXISTS (select 1 from op_audit_log L WHERE L.BSNO=B.BSNO and " + auditlog + " ) ");
var auditlog2 = '';
var PS_AUDIT2 = form.findField('PS_AUDIT2').getValue();
sql = sql + getAndConSql(sql, PS_AUDIT2, "a.AUDITUSER='" + PS_AUDIT2 + "'");
//sql = sql + getAndConSql(sql, auditlog2, " EXISTS (select 1 from V_OP_AUDIT_LOG L WHERE L.BSNO=B.BSNO and " + auditlog2 + " ) ");
return sql;
},
onExportClick: function (button, event) {
_this = this;
if (this.storeBillList.getCount() == 0) {
return;
}
var bsno = '11111';
var selections = this.gridBillList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.GID;
}
var sortstr = '';
if (this.bslistsortfield != '' && this.bslistsortdire != '') {
sortstr = this.bslistsortfield + ' ' + this.bslistsortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/Account/Chfee_Audit/GetBLListStr',
scope: this,
params: {
condition: _this.sqlcontext,
sort: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var sql1 = returnstr;
sql1 = sql1.replace(/\+/g, "@@@")
sql1 = sql1.replace(/\>/g, "&&&")
sql1 = sql1.replace(/\</g, "%%%")
if (sql1 != '') {
GridExportBySql(sql1, this.formname, '账单审核列表.xls');
}
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
PrintSelect: function (rptmode) {
var selections = this.gridBillList.getSelectionModel().getSelection();
if (selections.length == 0) {
//Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var sortstr = 'ETD,MBLNO';
if (this.bslistsortfield != '' && this.bslistsortdire != '') {
sortstr = this.bslistsortfield + ' ' + this.bslistsortdire;
}
var feeGidSql = '';
for (var i = 0; i < selections.length; i++) {
var record = selections[i];
var feeGId = "'" + record.get('BSNO') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var record = selections[0];
var BSNO = record.data.BSNO;
var printType = 'MSCHFEAUDITSEL';
var sql1 = "select * from V_OP_BILL WHERE BSNO IN (" + feeGidSql + ") order by " + sortstr;
var sql2 = "SELECT * FROM V_OP_BILL WHERE BSNO='" + BSNO + "'";
var sql3 = "select * from CH_FEE WHERE FEETYPE=1 AND BSNO IN (" + feeGidSql + ") order by BSNO,SORT";
var sql4 = "select * from CH_FEE WHERE FEETYPE=2 AND BSNO IN (" + feeGidSql + ") order by BSNO,SORT";
var sql5 = "";
var sql6 = "";
if (rptmode == 1) {
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, '', 'MSCHFEAUDITSEL', 1);
} else PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
});