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

3801 lines
142 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.MsChfeelock = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsChfeelock.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsChfeelock, Ext.Panel, {
PageSize: 100,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '1=1',
AccDate: null,
IsAccDate: '',
sortfield: '',
sortdire: '',
ISRATE: true,
tbRATE: 0,
VOUDATE: null,
PREPARED: '',
initUIComponents: function () {
this.formname = 'frmMsChfeelock';
this.MsPeriod = null;
Ext.Ajax.timeout = 12000000;
this.sqlcontext = '1=1';
this.storeModuleEnable = Ext.create('Ext.data.Store', {
model: 'DsShipping.ux.ModuleModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnableList',
reader: {
id: 'id',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'BSNO', type: 'string' },
{ name: 'OPLB', type: 'string' },
{ name: 'OPTYPE', type: 'string' },
{ name: 'BLTYPE', type: 'string' },
{ name: 'OPLBNAME', type: 'string' },
{ name: 'BSTYPE', type: 'string' },
{ name: 'CUSTOMERNAME', type: 'string' },
{ name: 'OPSTATUS', type: 'string' },
{ name: 'ACCDATE', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'MBLNO', type: 'string' },
{ name: 'HBLNO', type: 'string' },
{ name: 'ETD', type: 'string' },
{ name: 'VESSEL', type: 'string' },
{ name: 'VOYNO', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'CREATETIME', type: 'string' },
{ name: 'BSSTATUS', type: 'string' },
{ name: 'FEESTATUS', type: 'string' },
{ name: 'ISVOU', type: 'string' },
{ name: 'VOUNO', type: 'string' },
{ name: 'BSSTATUSREF', type: 'string' },
{ name: 'FEESTATUSREF', type: 'string' },
{ name: 'ETDCLOSEREF', type: 'string' },
{ name: 'DRCLOSEREF', type: 'string' },
{ name: 'CRCLOSEREF', type: 'string' },
{ name: 'DRFEESTATUS', type: 'string' },
{ name: 'CRFEESTATUS', type: 'string' },
{ name: 'ETA', type: 'string' },
{ name: 'SALE', type: 'string' },
{ name: 'OP', type: 'string' },
{ name: 'DOC', type: 'string' },
{ name: 'CUSTSERVICE', type: 'string' },
{ name: 'FRCUSTSERVICE', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' },
{ name: 'CUSTOMNO', type: 'string' },
{ name: 'CONTRACTNO', type: 'string' },
{ name: 'SERVICECONTRACTNO', type: 'string' },
{ name: 'ACCDATE', type: 'string' },
{ name: 'CARRIER', type: 'string' },
{ name: 'BSSOURCE', type: 'string' },
{ name: 'BSSOURCEDETAIL', type: 'string' },
{ name: 'CARGOID', type: 'string' },
{ name: 'DCLASS', type: 'string' },
{ name: 'LANE', type: 'string' },
{ name: 'YARD', type: 'string' },
{ name: 'SALEDEPT', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'REMARK2', type: 'string' },
{ name: 'FORWARDER', type: 'string' },
{ name: 'CNTRTOTAL', type: 'string' },
{ name: 'TRADETYPE', type: 'string' },
{ name: 'GOODSNAME', type: 'string' },
{ name: 'OPDATE', type: 'string' },
{ name: 'CUSTOMDATE', type: 'string' },
{ name: 'ENTERP', type: 'string' },
{ name: 'ISPRINTPR', type: 'string' },
{ name: 'BSCLOSETIME', type: 'string' },
{ name: 'BSCLOSEOP', type: 'string' },
{ name: 'FEECLOSETIME', type: 'string' },
{ name: 'FEECLOSEOP', type: 'string' },
{ name: 'NETWEIGHT', type: 'number' },
{ name: 'KGS', type: 'number' },
{ name: 'TEU', type: 'number' },
{ name: 'CNTR1', type: 'number' },
{ name: 'CNTR2', type: 'number' },
{ name: 'CNTR3', type: 'number' },
{ name: 'CNTR4', type: 'number' },
{ name: 'CNTR5', type: 'number' },
{ name: 'CNTR6', type: 'number' },
{ name: 'CNTR7', type: 'number' },
{ name: 'CNTR8', type: 'number' },
{ name: 'CNTR9', type: 'number' },
{ name: 'CNTR10', type: 'number' },
{ name: 'OTCNTR', type: 'number' },
{ name: 'RMBDR', type: 'number' },
{ name: 'RMBCR', type: 'number' },
{ name: 'USDDR', type: 'number' },
{ name: 'USDCR', type: 'number' },
{ name: 'OTDR', type: 'number' },
{ name: 'OTCR', type: 'number' },
{ name: 'TTLDR', type: 'number' },
{ name: 'TTLCR', type: 'number' },
{ name: 'RMBPROFIT', type: 'number' },
{ name: 'USDPROFIT', type: 'number' },
{ name: 'OTPROFIT', type: 'number' },
{ name: 'TTLPROFIT', type: 'number' },
{ name: 'TTLINVDR', type: 'number' },
{ name: 'TTLDUIDR', type: 'number' },
{ name: 'PROFITRATE', type: 'string' },
{ name: 'BillFeeStatus', type: 'string' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/Account/Chfee_lock/BsListData',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BSNO',
header: '编号',
hidden: true,
width: 130
}, {
sortable: true,
id: '',
align: 'center',
dataIndex: 'BSSTATUSREF',
header: '业务锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '已锁定' || value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
id: '',
align: 'center',
dataIndex: 'FEESTATUSREF',
header: '费用锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '已锁定' || value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
}, {
sortable: true,
dataIndex: 'ISVOU',
header: '已生成凭证',
width: 80,
renderer: function (value, meta, record) {
if (value == 'true')
return '√';
else
return '';
}
}, {
sortable: true,
id: '',
dataIndex: 'BillFeeStatus',
header: '整票状态', //'整票状态',
width: 60,
renderer: function (value, meta) {
if (value == '0') {
return "未提交";
} else if (value == '1') {
meta.tdCls = 'feestatus_refer';
return "整票提交";
} else if (value == '2') {
meta.tdCls = 'feestatus_pass';
return "审核通过";
} else if (value == '4') {
meta.tdCls = 'feestatus_nopass';
return "整票驳回";
} else {
return "";
}
}
}, {
sortable: true,
dataIndex: 'VOUNO',
header: '内部凭证号',
width: 70
}, {
sortable: true,
dataIndex: 'ISPRINTPR',
header: '打印核算单',
width: 80,
renderer: function (value, meta, record) {
if (value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
id: '',
dataIndex: 'DRFEESTATUS',
header: '应收费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
var svalue = "";
if (value != "") {
if (value == '0:') {
meta.tdCls = 'feestatus_pass';
svalue = "审核通过";
} else if (value == '1:') {
svalue = "录入状态";
} else if (value == '2:') {
meta.tdCls = 'feestatus_refer';
svalue = "提交审核";
} else if (value == '8:') {
meta.tdCls = 'feestatus_refer';
svalue = "部分结算";
} else if (value == '9:') {
meta.tdCls = 'feestatus_settle';
svalue = "结算完毕";
} else if (value == '') {
svalue = "未录入";
} else if (value.indexOf("9:") > -1) {
meta.tdCls = 'feestatus_settle';
svalue = "部分结算";
} else if (value.indexOf("0:") > -1) {
meta.tdCls = 'feestatus_pass';
svalue = "部分审核";
} else if (value.indexOf("2:") > -1) {
meta.tdCls = 'feestatus_refer';
svalue = "部分提交";
}
}
return svalue;
}
},
{
sortable: true,
id: '',
dataIndex: 'CRFEESTATUS',
header: '应付费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
var svalue = "";
if (value != "") {
if (value == '0:') {
meta.tdCls = 'feestatus_pass';
svalue = "审核通过";
} else if (value == '1:') {
svalue = "录入状态";
} else if (value == '2:') {
meta.tdCls = 'feestatus_refer';
svalue = "提交审核";
} else if (value == '8:') {
meta.tdCls = 'feestatus_refer';
svalue = "部分结算";
} else if (value == '9:') {
meta.tdCls = 'feestatus_settle';
svalue = "结算完毕";
} else if (value == '') {
svalue = "未录入";
} else if (value.indexOf("9:") > -1) {
meta.tdCls = 'feestatus_settle';
svalue = "部分结算";
} else if (value.indexOf("0:") > -1) {
meta.tdCls = 'feestatus_pass';
svalue = "部分审核";
} else if (value.indexOf("2:") > -1) {
meta.tdCls = 'feestatus_refer';
svalue = "部分提交";
}
}
return svalue;
}
}, {
sortable: true,
id: '',
align: 'center',
dataIndex: 'ETDCLOSEREF',
header: 'ETD锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '已锁定' || value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
id: '',
align: 'center',
dataIndex: 'DRCLOSEREF',
header: '应收锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '已锁定' || value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
id: '',
align: 'center',
dataIndex: 'CRCLOSEREF',
header: '应付锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '已锁定' || value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
id: '',
align: 'center',
dataIndex: 'TTLDUIDR',
header: '应收对帐',
width: 60,
renderer: function (value, cellmeta, record) {
var ttldr = record.data.TTLDR;
if (value == 0)
return '未对账';
else if (value == ttldr) {
cellmeta.tdCls = 'feestatus_pass';
return '已对账';
}
else if (value != ttldr) {
cellmeta.tdCls = 'feestatus_refer';
return '部分对账';
}
else
return '';
}
}, {
sortable: true,
dataIndex: 'OPLBNAME',
header: '业务类型',
width: 70
}, {
sortable: true,
dataIndex: 'BLTYPE',
header: '装运方式',
width: 70
}, {
sortable: true,
dataIndex: 'OPTYPE',
header: '更改单',
width: 70
}, {
sortable: true,
dataIndex: 'BSTYPE',
header: '运输类型',
width: 70
},
{
sortable: true,
id: '',
dataIndex: 'OPSTATUS',
header: '业务状态',
width: 60
}, {
sortable: true,
dataIndex: 'ACCDATE',
header: '会计期间',
width: 86
}, {
sortable: true,
dataIndex: 'OPDATE',
header: '业务日期',
width: 86
}, {
sortable: true,
dataIndex: 'CUSTOMDATE',
header: '报关日期',
width: 86
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 120
}, {
sortable: true,
dataIndex: 'CUSTNO',
header: '委托编号',
width: 136
}, {
sortable: true,
dataIndex: 'CUSTOMNO',
header: '报关单号',
width: 136
}, {
sortable: true,
dataIndex: 'CONTRACTNO',
header: '运费协议号',
width: 136
}, {
sortable: true,
dataIndex: 'SERVICECONTRACTNO',
header: '服务合同号',
width: 136
}, {
sortable: true,
dataIndex: 'ENTERP',
header: '经营单位',
width: 100
}, {
sortable: true,
dataIndex: 'MBLNO',
header: '主提单号',
width: 120
}, {
sortable: true,
dataIndex: 'HBLNO',
header: '分提单号',
width: 120
}, {
sortable: true,
dataIndex: 'BSSOURCE',
header: '业务来源',
width: 100
}, {
sortable: true,
dataIndex: 'BSSOURCEDETAIL',
header: '来源明细',
width: 100
}, {
sortable: true,
dataIndex: 'BSCLOSEOP',
header: '业务锁定人',
width: 120
}, {
sortable: true,
dataIndex: 'BSCLOSETIME',
header: '业务锁定时间',
width: 120
}, {
sortable: true,
dataIndex: 'FEECLOSEOP',
header: '费用锁定人',
width: 120
}, {
sortable: true,
dataIndex: 'FEECLOSETIME',
header: '费用锁定时间',
width: 120
}, {
sortable: true,
dataIndex: 'ETD',
header: '开船日期',
width: 86
}, {
sortable: true,
dataIndex: 'VESSEL',
header: '船名',
width: 200
}, {
sortable: true,
dataIndex: 'VOYNO',
header: '航次',
width: 50
}, {
sortable: true,
dataIndex: 'ETA',
header: '预抵日期',
width: 86
}, {
sortable: true,
dataIndex: 'SALE',
header: '业务员',
width: 80
}, {
sortable: true,
dataIndex: 'OP',
header: '操作',
width: 80
}, {
sortable: true,
dataIndex: 'DOC',
header: '单证',
width: 80
}, {
sortable: true,
dataIndex: 'CUSTSERVICE',
header: '客服',
width: 80
}, {
sortable: true,
dataIndex: 'FRCUSTSERVICE',
header: '海外客服',
width: 80
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: '起运港',
width: 80
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '目的港',
width: 150
}, {
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 80
}, {
sortable: true,
dataIndex: 'CARGOID',
header: '业务标识',
width: 80
}, {
sortable: true,
dataIndex: 'DCLASS',
header: '危品等级',
width: 100
}, {
sortable: true,
dataIndex: 'TEU',
header: 'TEU',
width: 80
}, {
sortable: true,
dataIndex: 'KGS',
header: 'KGS',
width: 80
}, {
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 80
}, {
sortable: true,
dataIndex: 'LANE',
header: '航线',
width: 80
}, {
sortable: true,
dataIndex: 'SALEDEPT',
header: '所属部门',
width: 80
}, {
sortable: true,
dataIndex: 'YARD',
header: '场站',
width: 80
}, {
sortable: true,
dataIndex: 'CNTRTOTAL',
header: '箱型箱量',
width: 80
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 80
}, {
sortable: true,
dataIndex: 'REMARK2',
header: '其他备注',
width: 80
}, {
sortable: true,
dataIndex: 'RMBDR',
header: 'RMB应收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBCR',
header: 'RMB应付',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBPROFIT',
header: 'RMB利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDDR',
header: 'USD应收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDCR',
header: 'USD应付',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDPROFIT',
header: 'USD利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTDR',
header: '其他币别应收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTCR',
header: '其他币别应付',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTPROFIT',
header: '其他币别利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLDR',
header: '合计应收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLCR',
header: '合计应付',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLPROFIT',
header: '合计利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
summaryType: 'sum',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'PROFITRATE',
header: '利润率',
width: 80
}
];
this.girdcolums = this.initgirdcolums;
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
columns: this.girdcolums,
viewConfig: {
enableTextSelection: true
},
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "/Account/Chfee_lock/Chfee_lockDetail";
window.open(openUrl, openType, openSet);
}, this);
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.columns[1] = new Ext.grid.RowNumberer();
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
//#region formSearch
//#region formSearch枚举参照相关
this.StoreOpLb = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreOpLb.load({ params: { enumTypeId: 96005} });
this.comboxOpLb = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务类型',
store: this.StoreOpLb,
forceSelection: true,
name: 'PS_OPLB',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBsType.load({ params: { enumTypeId: 96004} });
this.comboxBsType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '运输类型',
store: this.storeBsType,
name: 'PS_BSTYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeSalesCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeSalesCode.load();
this.comboxSalesCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeSalesCode,
forceSelection: true,
name: 'PS_SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOpCode.load();
this.comboxOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操 作',
store: this.storeOpCode,
forceSelection: true,
name: 'PS_OP',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
name: 'PS_CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeEnterpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomerRefModel',
proxy: { url: '/MvcShipping/MsBaseInfo/GetCustomerRefList' }
});
this.storeEnterpCode.load({ params: { condition: "ISENTERP='1'"} });
this.comboxEnterp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '经营单位',
store: this.storeEnterpCode,
forceSelection: true,
name: 'PS_ENTERP',
valueField: 'DESCRIPTION',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.StoreOpLock = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreOpLock.add({ "OpLb": "全部" });
this.StoreOpLock.add({ "OpLb": "已锁定" });
this.StoreOpLock.add({ "OpLb": "未锁定" });
this.comboxOpLock = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务锁定',
store: this.StoreOpLock,
forceSelection: true,
//labelWidth: 60,
//flex: 0.5,
name: 'PS_OPLOCK',
valueField: 'OpLb',
displayField: 'OpLb',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.StoreFeeLock = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreFeeLock.add({ "OpLb": "全部" });
this.StoreFeeLock.add({ "OpLb": "已锁定" });
this.StoreFeeLock.add({ "OpLb": "未锁定" });
this.comboxFeeLock = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '费用锁定',
store: this.StoreFeeLock,
forceSelection: true,
//flex: 0.5,
//labelWidth: 60,
name: 'PS_FEELOCK',
valueField: 'OpLb',
displayField: 'OpLb',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.StoreIsVou = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreIsVou.add({ "OpLb": "全部" });
this.StoreIsVou.add({ "OpLb": "已生成" });
this.StoreIsVou.add({ "OpLb": "未生成" });
this.comboxIsVou = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '生成凭证',
store: this.StoreIsVou,
forceSelection: true,
// flex: 0.5,
//labelWidth: 60,
name: 'PS_ISVOU',
valueField: 'OpLb',
displayField: 'OpLb',
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.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.storeFSTATUS = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeFSTATUS.add({ "FSTATUS": "0", "NAME": "全部" });
this.storeFSTATUS.add({ "FSTATUS": "1", "NAME": "仅已审核" });
this.storeFSTATUS.add({ "FSTATUS": "2", "NAME": "仅未审核" });
this.comboxFSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '费用审核',
store: this.storeFSTATUS,
valueField: 'FSTATUS',
displayField: 'NAME',
//labelWidth: 60,
//flex: 0.5,
forceSelection: true,
name: 'FSTATUS',
value: '0',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
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.storeOPTYPE.add({ "FSTATUS": "普通货有更改单", "NAME": "普通货有更改单" });
this.comboxOPTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '更改单',
store: this.storeOPTYPE,
valueField: 'FSTATUS',
displayField: 'NAME',
//flex: 0.5,
//labelWidth: 60,
forceSelection: true,
name: 'OPTYPE',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#endregion
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: '记忆查询条件',
checked: true,
width: 20
});
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxOpLb, {
fieldLabel: '编号',
name: 'PS_MBLNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '船名',
name: 'PS_VESSEL',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '航次',
name: 'PS_VOYNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
// , {
// fieldLabel: '品名',
// name: 'PS_GOODSNAME',
// enableKeyEvents: true,
// listeners: {
// specialkey: function (field, e) {
// if (e.getKey() == e.ENTER) {
// _this.onRefreshClick();
// }
// }
// }
// },
, this.comboxOp, this.comboxBillFeeStatus, this.comboxFSTATUS
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxBsType, this.comboxSalesCode, this.comboxCustCode, {
fieldLabel: '从业务日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到业务日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxOpLock, this.comboxFeeLock
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxEnterp, {
fieldLabel: '从ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_ETDDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '从会计期间',
xtype: 'monthfield',
name: 'PS_ACCDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到会计期间',
xtype: 'monthfield',
name: 'PS_ACCDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxIsVou, this.comboxOPTYPE
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
_this = this;
this.SearchBtn = new Ext.Button({
text: '隐藏查询',
handler: function () {
if (_this.SearchBtn.text == '隐藏查询') {
_this.panelSearch.hide();
_this.SearchBtn.setText("显示查询");
} else {
_this.panelSearch.show();
_this.SearchBtn.setText("隐藏查询");
}
}
});
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
var isvisible = true;
var issavevalue = false;
if (_this.SearchBtn.text == '隐藏查询')
isvisible = true
else
isvisible = false;
if (this.CheckSaveQuery.checked)
issavevalue = true
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
this.onRefreshClick(button, event);
},
scope: this
}, '-', {
text: "生成凭证",
id: "btnCreateVoucher",
handler: function (button, event) {
_this.winCreateVouShow.show();
},
scope: this
}, '-', {
text: "费用锁定",
id: "btnFeeLock",
handler: function (button, event) {
this.winFeeCloseShow.show();
},
scope: this
}, {
text: "费用解锁",
id: "btnFeeUnLock",
handler: function (button, event) {
this.winFeeUnCloseShow.show();
},
scope: this
}, {
text: "业务锁定",
id: "btnBsLock",
menu: [
{ text: "所选业务锁定",
handler: function (menu, event) {
_this.onSelLockClick(menu, event, 2);
}
}, { text: "全部业务锁定",
handler: function (menu, event) {
_this.onAllLockClick(menu, event, 2);
}
}],
scope: this
}, {
text: "业务解锁",
id: "btnBsUnLock",
menu: [
{ text: "所选业务解锁",
handler: function (menu, event) {
_this.onSelUnLockClick(2,'1');
}
}, { text: "全部业务解锁",
handler: function (menu, event) {
_this.onAllUnLockClick(2, '1');
}
}],
scope: this
}, {
text: "ETD锁定/解锁",
hidden: true,
id: "BSCLOSE-ETDCLOSE",
menu: [{
text: "ETD锁定日期设置",
handler: function (menu, event) {
_this.winETDCLOSEDATEShow.show();
}
},{
text: "所选业务ETD锁定",
handler: function (menu, event) {
_this.onSelBsLockClick('ETD');
}
}, {
text: "全部业务ETD锁定",
handler: function (menu, event) {
_this.onAllBsLockClick('ETD');
}
},
{
text: "所选业务ETD解锁",
handler: function (menu, event) {
_this.onSelBsUnLockClick('ETD');
}
}, {
text: "全部业务ETD解锁",
handler: function (menu, event) {
_this.onAllBsUnLockClick('ETD');
}
}],
scope: this
}, {
text: "应收费用锁定/解锁",
hidden: true,
id: "BSCLOSE-DRCLOSE",
menu: [{
text: "所选业务应收费用锁定",
handler: function (menu, event) {
_this.onSelBsLockClick('应收');
}
}, {
text: "全部业务应收费用锁定",
handler: function (menu, event) {
_this.onAllBsLockClick('应收');
}
},
{
text: "所选业务应收费用解锁",
handler: function (menu, event) {
_this.onSelBsUnLockClick('应收');
}
}, {
text: "全部业务应收费用解锁",
handler: function (menu, event) {
_this.onAllBsUnLockClick('应收');
}
}],
scope: this
}, {
text: "应付费用锁定/解锁",
hidden: true,
id: "BSCLOSE-CRCLOSE",
menu: [{
text: "所选业务应付费用锁定",
handler: function (menu, event) {
_this.onSelBsLockClick('应付');
}
}, {
text: "全部业务应付费用锁定",
handler: function (menu, event) {
_this.onAllBsLockClick('应付');
}
},
{
text: "所选业务应付费用解锁",
handler: function (menu, event) {
_this.onSelBsUnLockClick('应付');
}
}, {
text: "全部业务应付费用解锁",
handler: function (menu, event) {
_this.onAllBsUnLockClick('应付');
}
}],
scope: this
}, '-', {
xtype: 'button',
text: "高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
menu: [
{ text: "全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: "选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}, { text: "核算单打印",
handler: function (menu, event) {
_this.onPrintGainClick();
}
}],
scope: this
}, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', this.SearchBtn, {
xtype: 'button',
width: 90,
text: "清空条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, '-', {
text: "保存列表样式",
id: "btntest",
menu: [
{ text: "保存",
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, { text: "初始化",
handler: function (menu, event) {
_this.InitGrid(_this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-', {
text: "其他操作",
menu: [
{
text: '查看罐箱业务成本核算',
handler: function (menu, event) {
_this.onCheckCtnApply();
}
}, {
text: '查看罐箱业务卡',
handler: function (menu, event) {
_this.onCheckCtnBsCard();
}
}],
scope: this
}, '-', this.CheckSaveQuery
]
});
this.CheckAccMonth = new Ext.form.Checkbox({
fieldLabel: '修改会计期间',
checked: false,
width: 100
});
this.CheckBsClose = new Ext.form.Checkbox({
fieldLabel: '同时业务封账',
checked: false,
width: 100
});
this.formAccMonthShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.CheckAccMonth, {
fieldLabel: '会计期间',
xtype: 'monthfield',
name: 'AccDate'
}, this.CheckBsClose
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
id: 'rLOCKTYPE',
defaults: {
flex: 1
},
layout: 'hbox',
items: [
{
boxLabel: '选择',
name: 'LOCKTYPE',
checked: true,
inputValue: 'S'
}, {
boxLabel: '全部',
name: 'LOCKTYPE',
inputValue: 'A'
}
]
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winFeeCloseShow = Ext.create('Ext.window.Window', {
title: "费用封帐",
width: 520,
//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.formAccMonthShow],
buttons: [{
text: "确认封帐",
minWidth: 70,
handler: function () {
var form = me.formAccMonthShow.getForm();
var cgLOCKTYPE = Ext.getCmp('rLOCKTYPE');
var LOCKTYPE = cgLOCKTYPE.getValue();
if (me.CheckAccMonth.checked) {
me.AccDate = form.findField('AccDate').getRawValue();
if (me.AccDate == '' || me.AccDate == null || me.AccDate == undefined) {
Ext.Msg.show({ title: '提示', msg: '必须会计期间!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
me.IsAccDate = '1';
} else me.IsAccDate = '0';
if (LOCKTYPE.LOCKTYPE == 'A') {
_this.onFeeLockAll()
} else {
_this.onSelFeeLockClick()
}
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winFeeCloseShow.close();
}
}]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 29,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 96,
items: [this.formSearch]
});
this.panelBodyChFee = new Ext.Panel({
title: '业务明细',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.gridList]
});
this.tabpanel = new Ext.TabPanel
({
activeTab: 0,
autoWidth: true,
border: false,
frame: false,
region: 'center',
id: "TabPanelID",
enableTabScroll: true,
items:
[
this.panelBodyChFee
]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.tabpanel]
});
this.storeList.on('beforeload', function (store) {
var sql = this.sqlcontext;
Ext.apply(store.proxy.extraParams, { condition: sql, type: locktype,
printstr: 'false'
});
}, this);
this.GetBtnStatus();
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.LoadPeriod();
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
this.CheckISRATE = new Ext.form.Checkbox({
fieldLabel: '系统录入汇率',
checked: true,
width: 120
});
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOpCode.load();
//客服
this.comboxPREPARED = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '制单人',
store: this.storeOpCode,
forceSelection: true,
name: 'PREPARED',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME
});
this.formCreateVouShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.CheckISRATE, {
fieldLabel: '凭证汇率',
id: 'tbRATE',
name: 'tbRATE'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxPREPARED, {
fieldLabel: '凭证日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'VouDate'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
id: 'rSLTYPE',
defaults: {
flex: 1
},
layout: 'hbox',
items: [
{
boxLabel: '选择',
name: 'SLTYPE',
checked: true,
inputValue: 'S'
}, {
boxLabel: '全部',
name: 'SLTYPE',
inputValue: 'A'
}
]
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winCreateVouShow = Ext.create('Ext.window.Window', {
title: "生成凭证",
width: 420,
//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.formCreateVouShow],
buttons: [{
text: "生成凭证",
minWidth: 70,
handler: function () {
var form = me.formCreateVouShow.getForm();
var cgLOCKTYPE = Ext.getCmp('rSLTYPE');
var SLTYPE = cgLOCKTYPE.getValue();
me.VOUDATE = form.findField('VouDate').getRawValue();
if (me.VOUDATE == '') {
Ext.Msg.show({ title: '提示', msg: '凭证日期为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
me.PREPARED = form.findField('PREPARED').getValue();
me.tbRATE = form.findField('tbRATE').getValue();
if (me.CheckISRATE.checked) {
me.ISRATE = true;
} else me.ISRATE = false;
if (SLTYPE.SLTYPE== 'A') {
me.onCreateVoucherAll()
} else {
me.onCreateVoucherSel()
}
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winCreateVouShow.close();
}
}]
});
Ext.define('MsFeeCurr', {
extend: 'Ext.data.Model',
idProperty: 'CURR',
fields: [
{ name: 'CURR', type: 'string' },
{ name: 'DEFRATE', type: 'number' },
{ name: 'CRDEFRATE', type: 'number' }
]
});
this.StoreDateCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeNowCurrList' }
});
this.StoreDateCurr.load({ params: { optype: "modPayFeeSettlementLock" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
var records = DsStoreQueryBy(_this.StoreDateCurr, 'CURR', 'USD');
if (records.getCount() > 0) {
var ffdata = records.getAt(0).data;
var DEFRATE = ffdata.DEFRATE;
Ext.getCmp('tbRATE').setValue(DEFRATE);
} else {
Ext.getCmp('tbRATE').setValue(0);
}
}
}
}
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modBsLockBig"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
_this.CheckBsClose.setVisible(false);
} else {
_this.CheckBsClose.setVisible(true);
}
} else {
}
},
scope: this
});
this.CheckUnBsClose = new Ext.form.Checkbox({
fieldLabel: '业务同时解账',
checked: false,
width: 100
});
this.formUnCloseShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.CheckUnBsClose
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
id: 'runLOCKTYPE',
defaults: {
flex: 1
},
layout: 'hbox',
items: [
{
boxLabel: '选择',
name: 'LOCKTYPE',
checked: true,
inputValue: 'S'
}, {
boxLabel: '全部',
name: 'LOCKTYPE',
inputValue: 'A'
}
]
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winFeeUnCloseShow = Ext.create('Ext.window.Window', {
title: "费用解封",
width: 520,
//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.formUnCloseShow ],
buttons: [{
text: "确认解封",
minWidth: 70,
handler: function () {
var form = me.formUnCloseShow.getForm();
var cgLOCKTYPE = Ext.getCmp('runLOCKTYPE');
var LOCKTYPE = cgLOCKTYPE.getValue();
var bsunclose = '0';
if (me.CheckUnBsClose.checked) bsunclose = '1';
if (LOCKTYPE.LOCKTYPE == 'A') {
me.onAllUnLockClick(1,bsunclose)
} else {
me.onSelUnLockClick(1,bsunclose)
}
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winFeeUnCloseShow.close();
}
}]
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modBsUnLock"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
_this.CheckUnBsClose.setVisible(false);
} else {
_this.CheckUnBsClose.setVisible(true);
}
} else {
}
},
scope: this
});
this.LoadModuleEnable();
this.formETDCLOSEDATEShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: 'ETD锁定日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'CLOSEETDDAY'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsCompanys/GetNoPicData',
params: {
condition: " GID='" + COMPANYID+"'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
this.formETDCLOSEDATEShow.getForm().findField('CLOSEETDDAY').setValue(data.CLOSEETDDAY);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
this.winETDCLOSEDATEShow = Ext.create('Ext.window.Window', {
title: "ETD锁定日期设置",
width: 320,
//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.formETDCLOSEDATEShow],
buttons: [{
text: "确认设置",
minWidth: 70,
handler: function () {
var form = me.formETDCLOSEDATEShow.getForm();
var CLOSEETDDAY = form.findField('CLOSEETDDAY').getRawValue();
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsCompanys/SaveEtdCloseDay',
params: {
companyid: COMPANYID,
CLOSEETDDAY: CLOSEETDDAY
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winETDCLOSEDATEShow.close();
}
}]
});
}, //end initUIComponents
LoadPeriod: function () {
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;
this.MsPeriod = data;
this.formAccMonthShow.getForm().findField('AccDate').setMinValue(this.MsPeriod.PERIOD);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onSelLockClick: function (menu, event, type) {
//判断是否具有解锁权限
var autype = type == 2 ? 4 : 3;
_this = this;
Ext.Ajax.request({
waitMsg: '正在获取权限...',
url: '/Account/Chfee_lock/CheckAuthority',
params: {
autype: autype
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
var GidStr = '';
var records = _this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要锁定的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var Gid = rec.data.BSNO;
var status = rec.data.BSSTATUS;
if (type == 2)
status = rec.data.BSSTATUS
else status = rec.data.FEESTATUS
if (status != true) {
bodyAddDatas.push(rec);
}
}
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: '/Account/Chfee_lock/SelLock',
params: {
data: jsonbodyAddDatas,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
} else {
Ext.Msg.show({ title: '提示', msg: '没有锁定权限!' });
}
}
}
});
},
onSelFeeLockClick: function (menu, event, type) {
_this = this;
var autype = 3;
Ext.Ajax.request({
waitMsg: '正在获取权限...',
url: '/Account/Chfee_lock/CheckAuthority',
params: {
autype: autype
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
var GidStr = '';
var records = _this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要锁定的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (_this.CheckAccMonth.checked) {
_this.IsAccDate = '1'
} else _this.IsAccDate = '0'
if (_this.CheckBsClose.checked) {
_this.isbslock = '1'
} else _this.isbslock = '0'
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var Gid = rec.data.BSNO;
var status = rec.data.FEESTATUS
if (status != true) {
bodyAddDatas.push(rec);
}
}
//_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: '/Account/Chfee_lock/SelFeeLock',
params: {
data: jsonbodyAddDatas,
isAccDate: _this.IsAccDate,
AccDate: _this.AccDate,
isbslock: _this.isbslock
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
_this.winFeeCloseShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
} else {
Ext.Msg.show({ title: '提示', msg: '没有锁定权限!' });
}
} else {
Ext.Msg.show({ title: '提示', msg: '数据访问失败!' });
}
}
});
},
onAllLockClick: function (menu, event, type) {
if (this.storeList.getCount() == 0) {
Ext.Msg.show({ title: '提示', msg: '没有业务明细,无法锁定!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
Ext.Ajax.request({
waitMsg: '正在锁定...',
url: '/Account/Chfee_lock/AllLock',
params: {
billsql: _this.sqlcontext,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onFeeLockAll: function () {
if (this.storeList.getCount() == 0) {
Ext.Msg.show({ title: '提示', msg: '没有业务明细,无法锁定!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (this.CheckAccMonth.checked) {
this.IsAccDate = '1'
} else this.IsAccDate = '0'
if (this.CheckBsClose.checked) {
this.isbslock = '1'
} else this.isbslock = '0'
_this = this;
Ext.Ajax.request({
waitMsg: '正在锁定...',
url: '/Account/Chfee_lock/onFeeLockAll',
params: {
billsql: _this.sqlcontext,
isAccDate: _this.IsAccDate,
AccDate: _this.AccDate,
isbslock: _this.isbslock
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
_this.winFeeCloseShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onSelUnLockClick: function (type, bsunclose) {
//判断是否具有解锁权限
Ext.Ajax.request({
waitMsg: '正在获取权限...',
url: '/Account/Chfee_lock/CheckAuthority',
params: {
autype: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
var records = this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要解除锁定的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
//
var strGids = "";
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var Gid = rec.data.BSNO;
var status = rec.data.BSSTATUS;
if (type == 2) {
status = rec.data.BSSTATUS
if (status = true) {
bodyAddDatas.push(rec);
strGids += "," + Gid;
}
}
else {
status = rec.data.FEESTATUS;
var ACCDATE = rec.data.ACCDATE;
var oDate1 = new Date(ACCDATE + '-01');
var oDate2 = new Date(this.MsPeriod.PERIOD + '-01');
if (oDate1.getTime() < oDate2.getTime()) {
Ext.Msg.show({ title: '提示', msg: '本期已月末结账,无法解锁!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
if (status = true) {
bodyAddDatas.push(rec);
strGids += "," + Gid;
}
}
}
}
//
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: '提示', msg: '没有要解除锁定的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
if (strGids != "") {
strGids = strGids.toString().substr(1);
}
Ext.Ajax.request({
waitMsg: '正在判断锁定...',
url: '/Account/Chfee_lock/isSelUnLock',
params: {
strGids: strGids
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: '正在解除锁定...',
url: '/Account/Chfee_lock/SelUnLock',
params: {
data: jsonbodyAddDatas,
type: type,
bsunclose: bsunclose
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.show({ title: '提示', msg: "解除锁定成功!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
_this.winFeeUnCloseShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
} else {
Ext.MessageBox.alert('提示', '没有解锁权限!');
}
} else {
Ext.MessageBox.alert('网络请求失败!');
}
},
scope: this
});
},
onAllUnLockClick: function (type,bsunclose) {
//判断是否具有解锁权限
Ext.Ajax.request({
waitMsg: '正在获取权限...',
url: '/Account/Chfee_lock/CheckAuthority',
params: {
autype: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
if (_this.storeList.getCount() == 0) {
Ext.Msg.show({ title: '提示', msg: '没有业务明细,无法解除锁定!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
Ext.Ajax.request({
waitMsg: '正在判断...',
url: '/Account/Chfee_lock/isAllUnLock',
params: {
billsql: _this.sqlcontext,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
Ext.Ajax.request({
waitMsg: '正在解除锁定...',
url: '/Account/Chfee_lock/AllUnLock',
params: {
billsql: _this.sqlcontext,
type: type,
bsunclose: bsunclose
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.show({ title: '提示', msg: "解除锁定成功!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
_this.winFeeUnCloseShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
} else {
Ext.MessageBox.alert('提示', '没有解锁权限!');
}
} else {
Ext.MessageBox.alert('网络请求失败!');
}
}
});
},
onSelBsLockClick: function (type) {
var records = this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要' + type + '锁定的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
//
var strGids = "";
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var Gid = rec.data.BSNO;
var status = '';
if (type=='ETD')
status = rec.data.ETDCLOSEREF;
else if (type == '应收')
status = rec.data.DRCLOSEREF;
else if (type == '应付')
status = rec.data.CRCLOSEREF;
if (status!='锁定')
bodyAddDatas.push(rec);
}
//
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: '/Account/Chfee_lock/SelBsLock',
params: {
data: jsonbodyAddDatas,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.show({ title: '提示', msg: "锁定成功!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
onAllBsLockClick: function (type) {
if (this.storeList.getCount() == 0) {
Ext.Msg.show({ title: '提示', msg: '没有业务明细,无法锁定!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
Ext.Ajax.request({
waitMsg: '正在锁定...',
url: '/Account/Chfee_lock/BsLockAll',
params: {
billsql: _this.sqlcontext,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onSelBsUnLockClick: function (type) {
var records = this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要取消' + type + '锁定的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
//
var strGids = "";
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var Gid = rec.data.BSNO;
var status = '';
if (type == 'ETD')
status = rec.data.ETDCLOSEREF;
else if (type == '应收')
status = rec.data.DRCLOSEREF;
else if (type == '应付')
status = rec.data.CRCLOSEREF;
if (status == '已锁定')
bodyAddDatas.push(rec);
}
//
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: '/Account/Chfee_lock/SelBsUnLock',
params: {
data: jsonbodyAddDatas,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.show({ title: '提示', msg: "解除锁定成功!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
onAllBsUnLockClick: function (type) {
if (this.storeList.getCount() == 0) {
Ext.Msg.show({ title: '提示', msg: '没有业务明细,无法锁定!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
Ext.Ajax.request({
waitMsg: '正在锁定...',
url: '/Account/Chfee_lock/BsLockUnAll',
params: {
billsql: _this.sqlcontext,
type: type
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onCreateVoucherSel: function () {
var records = _this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要生成凭证的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var ISVOU = rec.data.ISVOU;
if (ISVOU == 'true') {
Ext.Msg.show({ title: '提示', msg: '已生成凭证,无法重复生成!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
bodyAddDatas.push(rec);
}
}
//_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.Msg.wait('正在生成凭证...');
Ext.Ajax.request({
waitMsg: '正在锁定...',
url: '/Account/Chfee_lock/CreateVouSel',
params: {
data: jsonbodyAddDatas,
ISRATE: _this.ISRATE,
tbRATE: _this.tbRATE,
strVOUDATE: _this.VOUDATE,
strPREPARED: _this.PREPARED
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
_this.winCreateVouShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
onCreateVoucherAll: function () {
if (this.storeList.getCount() == 0) {
Ext.Msg.show({ title: '提示', msg: '没有业务明细,无法生成凭证!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
Ext.Msg.wait('正在生成凭证...');
Ext.Ajax.request({
waitMsg: '生成凭证...',
url: '/Account/Chfee_lock/CreateVouAll',
params: {
billsql: _this.sqlcontext,
ISRATE: _this.ISRATE,
tbRATE: _this.tbRATE,
strVOUDATE: _this.VOUDATE,
strPREPARED: _this.PREPARED
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.onDsQuery();
_this.winCreateVouShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onCreateVoucher: function (button, event) {
var records = this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要生成凭证的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var strGids = "";
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var Gid = rec.data.BSNO;
status = rec.data.FEESTATUS;
var ISVOU = rec.data.ISVOU;
if (ISVOU == 'true') {
Ext.Msg.show({ title: '提示', msg: '已生成凭证,无法重复生成!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
if (status = true) {
strGids += "," + Gid;
}
}
}
if (strGids != '') {
var feature = "height=200, width=350, toolbar=no, menubar=no,scrollbars=no, resizable=0,location=no, status=no,Top= " + (screen.height / 2 - 100) + ",Left= " + (screen.width / 2 - 200);
var URLs = "../../CW/CwVouchersAdding.aspx?handle=v_op_bill&gids=" + strGids;
window.open(URLs, "生成凭证信息", feature);
}
},
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition())
return;
this.PageSize = this.Pagenum.getValue();
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql, type: locktype },
waitMsg: "正在查询数据...",
scope: this
});
},
onDsQuery: function (button, event) {
this.PageSize = this.Pagenum.getValue();
var sql = this.sqlcontext;
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql, type: locktype },
waitMsg: "正在查询数据...",
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
/*
var sqldata = form.getValues();
sql = Ext.JSON.encode(sqldata);
*/
if (locktype == 'BSVOUCHER') {
sql = ' B.FEESTATUS=1 ';
}
var mblNo = form.findField('PS_MBLNO').getValue();
sql = sql + getAndConSql(sql, mblNo, " (B.CUSTNO like '%" + mblNo + "%' or B.MBLNO like '%" + mblNo + "%' or B.HBLNO like '%" + mblNo + "%' or B.CUSTOMNO like '%" + mblNo + "%' or B.ORDERNO like '%" + mblNo + "%')");
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " B.OPDATE>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " B.OPDATE<='" + expDate_Max + " 23:59:59'");
var etdDate_Min = form.findField('PS_ETDDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Min, " B.ETD>='" + etdDate_Min + "'");
var etdDate_Max = form.findField('PS_ETDDATEEND').getRawValue();
sql = sql + getAndConSql(sql, etdDate_Max, " B.ETD<='" + etdDate_Max + " 23:59:59'");
var accDate_Min = form.findField('PS_ACCDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, accDate_Min, " B.ACCDATE>='" + accDate_Min + "'");
var accDate_Max = form.findField('PS_ACCDATEEND').getRawValue();
sql = sql + getAndConSql(sql, accDate_Max, " B.ACCDATE<='" + accDate_Max + "'");
var ENTERP = form.findField('PS_ENTERP').getValue();
sql = sql + getAndConSql(sql, ENTERP, "B.ENTERP='" + ENTERP + "'");
var CUSTOMERNAME = form.findField('PS_CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "B.CUSTOMERNAME='" + CUSTOMERNAME + "'");
var SALE = form.findField('PS_SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "B.SALE='" + SALE + "'");
var OP = form.findField('PS_OP').getValue();
sql = sql + getAndConSql(sql, OP, "B.OP='" + OP + "'");
var BSTYPE = form.findField('PS_BSTYPE').getValue();
sql = sql + getAndConSql(sql, BSTYPE, "B.BSTYPE='" + BSTYPE + "'");
var OPLB = form.findField('PS_OPLB').getValue();
sql = sql + getAndConSql(sql, OPLB, "B.OPLBNAME='" + OPLB + "'");
var VESSEL = form.findField('PS_VESSEL').getValue();
sql = sql + getAndConSql(sql, VESSEL, "B.VESSEL like '%" + VESSEL + "%'");
var VOYNO = form.findField('PS_VOYNO').getValue();
sql = sql + getAndConSql(sql, VOYNO, "B.VOYNO like '%" + VOYNO + "%'");
// var GOODSNAME = form.findField('PS_GOODSNAME').getValue();
// sql = sql + getAndConSql(sql, GOODSNAME, "B.GOODSNAME like '%" + GOODSNAME + "%'");
var PS_OPLOCK = form.findField('PS_OPLOCK').getValue();
if (PS_OPLOCK == '已锁定')
sql = sql + getAndConSql(sql, PS_OPLOCK, "B.BSSTATUS=1");
else if (PS_OPLOCK == '未锁定')
sql = sql + getAndConSql(sql, PS_OPLOCK, "B.BSSTATUS=0");
var PS_FEELOCK = form.findField('PS_FEELOCK').getValue();
if (PS_FEELOCK == '已锁定')
sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=1");
else if (PS_FEELOCK == '未锁定')
sql = sql + getAndConSql(sql, PS_FEELOCK, "B.FEESTATUS=0");
var PS_ISVOU = form.findField('PS_ISVOU').getValue();
if (PS_ISVOU == '已生成')
sql = sql + getAndConSql(sql, PS_ISVOU, "B.ISVOU=1");
else if (PS_ISVOU == '未生成')
sql = sql + getAndConSql(sql, PS_ISVOU, " ISNULL(B.ISVOU,0)=0");
var BillFeeStatus = form.findField('BillFeeStatus').getValue();
sql = sql + getAndConSql(sql, BillFeeStatus, "BillFeeStatus='" + BillFeeStatus + "'");
var OPTYPE = form.findField('OPTYPE').getValue();
if (OPTYPE == '普通货' || OPTYPE == '更改单') {
sql = sql + getAndConSql(sql, OPTYPE, " B.OPTYPE='" + OPTYPE + "' ");
} else if (OPTYPE == '普通货有更改单') {
sql = sql + getAndConSql(sql, OPTYPE, " EXISTS (select 1 from OP_AMEND WHERE PARENTID=B.BSNO) ");
}
var FSTATUS = form.findField('FSTATUS').getValue();
if (FSTATUS == '' || FSTATUS == null || FSTATUS == undefined || FSTATUS == 0) {
}
else {
if (sql == '') {
if (FSTATUS == 1) {
sql = ' EXISTS (select 1 from CH_FEE WHERE B.BSNO=CH_FEE.BSNO AND (CH_FEE.FEESTATUS=0 or CH_FEE.FEESTATUS=8 or CH_FEE.FEESTATUS=9) AND CH_FEE.FEESTATUS<>1 AND CH_FEE.FEESTATUS<>2) '
} else if (FSTATUS == 2) {
sql = ' EXISTS (select 1 from CH_FEE WHERE B.BSNO=CH_FEE.BSNO AND (CH_FEE.FEESTATUS!=0 AND CH_FEE.FEESTATUS!=8 AND CH_FEE.FEESTATUS!=9) AND (CH_FEE.FEESTATUS=1 OR CH_FEE.FEESTATUS=2)) '
}
}
else {
if (FSTATUS == 1) {
sql = sql + ' AND EXISTS (select 1 from CH_FEE WHERE B.BSNO=CH_FEE.BSNO AND (CH_FEE.FEESTATUS=0 or CH_FEE.FEESTATUS=8 or CH_FEE.FEESTATUS=9) AND CH_FEE.FEESTATUS<>1 AND CH_FEE.FEESTATUS<>2) '
} else if (FSTATUS == 2) {
sql = sql + ' AND EXISTS (select 1 from CH_FEE WHERE B.BSNO=CH_FEE.BSNO AND (CH_FEE.FEESTATUS!=0 AND CH_FEE.FEESTATUS!=8 AND CH_FEE.FEESTATUS!=9) AND (CH_FEE.FEESTATUS=1 OR CH_FEE.FEESTATUS=2)) '
}
}
}
return sql;
},
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return false;
}
return true;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.SelectedRecord.data.BSNO;
ret[4] = "chfee_lock";
return ret;
},
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
return ret;
},
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
},
LoadModuleEnable: function () {
this.storeModuleEnable.load({
params: { condition: "sys_module.[NAME] like 'BSCLOSE-%'" },
callback: function (r, options, success) {
if (success) {
if (this.storeModuleEnable.getCount() > 0) {
for (var j = 0; j < this.storeModuleEnable.getCount(); j += 1) {
var member = this.storeModuleEnable.getAt(j);
var btnEdit = Ext.getCmp(member.data.NAME);
btnEdit.setVisible(true);
};
} else {
}
}
},
scope: this
});
},
GetBtnStatus: function () {
var btnFeeLock = Ext.getCmp('btnFeeLock');
var btnFeeUnLock = Ext.getCmp('btnFeeUnLock');
var btnBsLock = Ext.getCmp('btnBsLock');
var btnBsUnLock = Ext.getCmp('btnBsUnLock');
var btnCreateVoucher = Ext.getCmp('btnCreateVoucher');
if (locktype == 'BS') {
btnBsLock.setVisible(true);
btnBsUnLock.setVisible(true);
btnFeeLock.setVisible(false);
btnFeeUnLock.setVisible(false);
btnCreateVoucher.setVisible(false);
} else if (locktype == 'FEE') {
btnBsLock.setVisible(false);
btnBsUnLock.setVisible(false);
btnFeeLock.setVisible(true);
btnFeeUnLock.setVisible(true);
btnCreateVoucher.setVisible(false);
} else if (locktype == 'BSVOUCHER') {
btnBsLock.setVisible(false);
btnBsUnLock.setVisible(false);
btnFeeLock.setVisible(false);
btnFeeUnLock.setVisible(false);
btnCreateVoucher.setVisible(true);
var form = this.formSearch.getForm();
form.findField('PS_ISVOU').setValue('未生成');
}
},
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var sortstr = '';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/Account/Chfee_lock/BsListData',
scope: this,
params: {
start: 0, limit: this.PageSize,
condition: _this.sqlcontext,
type: locktype,
printstr: 'true',
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 printType = 'MSLOCKLIST';
var sql1 = returnstr;
var sql2 = "select SUBSTRING(CONVERT(char(15),ETD,111),1,7) AS 月份,OP,max(UNCLOSEOP) UNCLOSEOP,SUM(CASE WHEN UNCLOSECOUNT=1 THEN 1 ELSE 0 END) 一次解锁票数 ";
sql2 = sql2 + ",SUM(CASE WHEN UNCLOSECOUNT>=2 THEN 1 ELSE 0 END) 二次解锁票数 from v_op_unclose B"
if (this.sqlcontext != '')
sql2 = sql2 + " where B.CORPID='" + COMPANYID + "' and " + this.sqlcontext;
sql2 = sql2 + " GROUP BY SUBSTRING(CONVERT(char(15),ETD,111),1,7),OP";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} 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 () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var selectedRecords = [];
var storeadd = null;
selectedRecords = this.GridCheckBoxModel.selected.items;
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var sortstr = ' CUSTNO desc ';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('BSNO') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.BSNO;
}
var printType = 'MSLOCKLISTSELECT';
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 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
onPrintGainClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
var strbsno = record.data.BSNO;
var stroplb = record.data.OPLB;
var stroptype = record.data.OPTYPE;
var opstr = " BSNO='" + strbsno + "'"
if (stroptype == '更改单') {
opstr = " BSNO IN (SELECT PARENTID FROM OP_AMEND WHERE BSNO='" + strbsno + "')"
}
_this = this;
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsChFee/GetGainPrint',
scope: this,
params: {
bsno: strbsno,
oplb: stroplb
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (stroplb == 'op_seae') {
var printType = 'SEAEGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE " + opstr;
} else if (stroplb == 'op_apply') {
var printType = 'APPLYGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE " + opstr;
} else if (stroplb == 'op_seai') {
var printType = 'SEAIGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seai WHERE " + opstr;
} else if (stroplb == 'op_bulk') {
var printType = 'BULKGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_bulk WHERE " + opstr;
} else if (stroplb == 'op_other') {
var printType = 'OTHERGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_other WHERE " + opstr;
} else if (stroplb == 'op_railway') {
var printType = 'RAILWAYGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_railway WHERE " + opstr;
} else if (stroplb == 'op_aire') {
var printType = 'AIREGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_aire WHERE " + opstr;
} else if (stroplb == 'op_airi') {
var printType = 'AIRIGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_airi WHERE " + opstr;
};
// sql3 = sql3 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人 from ch_fee c where c.Gid in (" + feeGidSql + ") order by sort,LineNum ";
var sql2 = "SET LANGUAGE 'us_english' Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人 from ch_fee c where c.BSNO='" + strbsno + "' and c.FEETYPE=1 order by sort,LineNum ";
var sql3 = "SET LANGUAGE 'us_english' Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人 from ch_fee c where c.BSNO='" + strbsno + "' and c.FEETYPE=2 order by sort,LineNum ";
//全部费用利润 或 海运费利润 或 仓储利润
var sql4 = "SELECT BSNO"
+ ",SUM(RMBDR) as RMBDR,SUM(RMBCR) as RMBCR,SUM(USDDR) as USDDR,SUM(USDCR) as USDCR"
+ ",SUM(RMBDR+USDTORMBDR) as DRTTL"
+ ",SUM(RMBCR+USDTORMBCR) as CRTTL"
+ ",(SUM(RMBDR)-SUM(RMBCR)) AS RMBPROFIT"
+ ",(SUM(USDDR)-SUM(USDCR)) AS USDPROFIT"
+ ",SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR) as TTLPROFIT"
//+ ",(CAST(CAST(CASE WHEN SUM(RMBCR+USDTORMBCR) = 0 THEN 100 ELSE (ROUND((case when SUM(RMBDR+USDTORMBDR)=0 then 0 else (SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR))/SUM(RMBDR+USDTORMBDR) END),4))*100 END as decimal(18,2)) as varchar(20))+'%') AS PROFITRATE"
+ ",(CAST(CAST(CASE WHEN SUM(RMBCR+USDTORMBCR) = 0 THEN 100 ELSE (ROUND(((SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR))/SUM(RMBCR+USDTORMBCR)),4))*100 END as decimal(18,2)) as varchar(20))+'%') AS PROFITRATE"
+ ",'" + SHOWNAME + "' as CREATEUSER,GETDATE() as CREATETIME "
+ " FROM ("
+ "SELECT BSNO,CURRENCY,FEETYPE"
+ ",SUM(CASE WHEN CURRENCY='RMB' AND FEETYPE = 1 THEN AMOUNT ELSE 0 END) as RMBDR"
+ ",SUM(CASE WHEN CURRENCY='RMB' AND FEETYPE = 2 THEN AMOUNT ELSE 0 END) as RMBCR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 1 THEN AMOUNT ELSE 0 END) as USDDR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 2 THEN AMOUNT ELSE 0 END) as USDCR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 1 THEN AMOUNT*EXCHANGERATE ELSE 0 END) as USDTORMBDR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 2 THEN AMOUNT*EXCHANGERATE ELSE 0 END) as USDTORMBCR "
+ " FROM ch_fee WHERE 1=1 and BSNO='" + strbsno + "'"
+ " GROUP BY BSNO,CURRENCY,EXCHANGERATE,FEETYPE "
+ " ) AS C GROUP BY BSNO ";
var sql5 = "exec GetPrintData '" + strbsno + "'";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} 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
});
}
}
});
}
//#region 打开业务卡费用审批
, getselectrecord: function () {
var selections = this.GridCheckBoxModel.selected.items;
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
return selections[0];
}
, onCheckCtnApply: function () {
//恒成 费用锁定中,点击放箱号(或者单独有个按钮也可以)可以跳出业务卡费用审批模块(已自动搜索出该放箱号对应的结果)
///MvcContainer/MsOpCtnApply / CostEdit
rec = this.getselectrecord();
BSNO = rec.data.BSNO;
//condition = "(select APPLYNO from v_op_bs where BSNO='" + BSNO + "')";
DsOpenMultiEditWin('/MvcContainer/MsOpCtnBsCard/ChFeeAudit?opener=HENGCHENG&BSNO=' + BSNO);
}
, onCheckCtnBsCard: function () {
//恒成 费用锁定中,点击放箱号(或者单独有个按钮也可以)可以跳出业务卡费用审批模块(已自动搜索出该放箱号对应的结果)
///MvcContainer/MsOpCtnApply / CostEdit
rec = this.getselectrecord();
BSNO = rec.data.BSNO;
//condition = "(select APPLYNO from v_op_bs where BSNO='" + BSNO + "')";
DsOpenMultiEditWin('/MvcContainer/MsOpCtnBsCard/CtnStatusIndex?opener=HENGCHENG&BSNO=' + BSNO);
}
//#endregion
});