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

1440 lines
48 KiB
JavaScript

6 months ago
Ext.namespace('Shipping');
Shipping.MsOpPriceAuditIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpPriceAuditIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpPriceAuditIndex, Ext.Panel, {
PageSize: 30,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
selectbsno: '',
sortfield: '',
sortdire: '',
billno:'',
initUIComponents: function () {
this.formname = "MsOpPriceAuditIndex"; //页面名称
//定义数据集
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modOpPriceList" } });
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpPrice',
remoteSort: true,
proxy: {
type: 'ajax',
4 months ago
url: '/MvcShipping/MsOpPrice/GetAuditDataList',
6 months ago
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 50
});
_this = this;
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: 'GID',
header: '业务编号',
hidden: true,
width: 80
},
{
sortable: true,
dataIndex: 'BILLSTATUSREF',
header: '报价单状态',
align: 'center',
width: 60
5 months ago
},
{
sortable: true,
dataIndex: 'PRICETYPE',
header: '报价单类型',
align: 'center',
width: 60
}, {
6 months ago
sortable: true,
dataIndex: 'BILLNO',
header: '报价单号',
width: 80
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 80
}, {
sortable: true,
dataIndex: 'SALE',
header: '揽货人',
width: 80
}, {
sortable: true,
dataIndex: 'ORDNO',
header: '订舱编号',
width: 80
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: '装货港',
width: 80
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '卸货港',
width: 80
}, {
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 80
}, {
sortable: true,
dataIndex: 'FORWARDER',
header: '供应商',
width: 80
}, {
sortable: true,
dataIndex: 'VIA',
header: '中转港',
width: 80
}, {
sortable: true,
dataIndex: 'ETD',
header: '开船日期',
width: 80
}, {
sortable: true,
dataIndex: 'TT',
header: '航程',
width: 80
}, {
sortable: true,
dataIndex: 'TTLFREIGHT',
header: '运费总价',
width: 80
}, {
sortable: true,
dataIndex: 'RMBOT',
header: '国内杂费',
width: 80
}, {
sortable: true,
dataIndex: 'USDOT',
header: '国外杂费美金',
width: 80
5 months ago
}, {
sortable: true,
dataIndex: 'OTHEROT',
header: '其他币别杂费',
width: 80
}, {
sortable: true,
dataIndex: 'SELLTTLFREIGHT',
header: '卖价运费总价',
width: 80
}, {
sortable: true,
dataIndex: 'SELLRMBOT',
header: '卖价国内杂费',
width: 80
}, {
sortable: true,
dataIndex: 'SELLUSDOT',
header: '卖价国外杂费美金',
width: 80
}, {
sortable: true,
dataIndex: 'SELLOTHEROT',
header: '卖价其他币别杂费',
width: 80
6 months ago
}, {
sortable: true,
dataIndex: 'CREATEUSER',
header: '录入人',
width: 80
}, {
sortable: true,
dataIndex: 'CREATETIME',
header: '录入日期',
width: 80
}, {
sortable: true,
dataIndex: 'MODIFIEDUSER',
header: '修改人',
width: 80
}, {
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: '修改日期',
width: 80
}, {
sortable: true,
dataIndex: 'PQENDDATE',
header: '询价截止时间',
width: 80
}, {
sortable: true,
dataIndex: 'EFFECTIVEDATE',
header: '生效日期',
width: 80
}, {
sortable: true,
dataIndex: 'VALIDDATE',
header: '失效日期',
width: 80
}, {
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 80
}];
this.girdcolums = this.initgirdcolums;
//定义Grid
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
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, //允许复制数据
5 months ago
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var PRICETYPE = record.get('PRICETYPE');
if (PRICETYPE == '报价')
return 'feestatus_pass';
}
6 months ago
},
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
/////////////以下部分为获取存储的gridpanel显示样式
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.columns[0] = new Ext.grid.RowNumberer();
////////////////////////////
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
5 months ago
if (record.data.PRICETYPE == '报价')
DsOpenEditWin('/MvcShipping/MsOpPrice/SellEdit', record.data.BILLNO);
else
DsOpenEditWin('/MvcShipping/MsOpPrice/Edit', record.data.BILLNO);
6 months ago
}, this);
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
//#region formSearch 查询条件
_this = this;
//人员信息加载
this.storeSaleCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.storeSaleCode.load();
//操 作
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeSaleCode,
forceSelection: true,
name: 'SALE',
queryMode: 'remote',
//flex: 0.5,
minChars: 0,
queryParam: 'CODENAME',
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/GetCustomRefListController' }
});
// this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
//委托单位
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
//specialkey: function (field, e) {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//客户加载_船公司
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
});
//船公司
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船公司', //'船公司',
store: this.storeCARRIER,
//forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
name: 'CARRIER',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
//specialkey: function (field, e) {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//客户加载_订舱代理
this.storeFORWARDER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListFORWARDER' }
});
//船公司
this.comboxFORWARDER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '供应商', //'订舱代理',
store: this.storeFORWARDER,
forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
name: 'FORWARDER',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
//specialkey: function (field, e) {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportListRm' }
});
this.storeCodeLoadport.load();
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装货港',
store: this.storeCodeLoadport,
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
name: 'PORTLOAD',
valueField: 'PORT',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
//specialkey: function (field, e) {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '卸货港',
store: this.storeCodeDisport,
name: 'PORTDISCHARGE',
valueField: 'PORT',
queryMode: 'remote',
matchFieldWidth: false,
minChars: 1,
queryParam: 'PORT',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
//specialkey: function (field, e) {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//人员信息加载
this.storeINPUTBYCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.storeINPUTBYCode.load();
this.comboxINPUTBY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel:'录入人', //'录入人',
store: this.storeINPUTBYCode,
forceSelection: true,
name: 'CREATEUSER',
valueField: 'GID',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
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.storeAddDCType.add({ "DC": "", "NAME": '全部' });
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '报价单状态',
store: this.storeAddDCType,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'BILLSTATUS',
value: '2',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '报价单号',
name: 'BILLNO',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxFORWARDER, this.comboxCustCode, {
fieldLabel: '订舱编号',
name: 'ORDNO',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxSALE, this.comboxCARRIER, {
xtype: 'button',
width: 90,
text: "查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxaddDCType,this.comboxPORTLOAD, this.comboxPORTDISCHARGE,{
fieldLabel: '从录入日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDBgn',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到录入日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDEnd',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxINPUTBY, {
xtype: 'button',
width: 90,
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
}]
}]
}]
});
//#endregion formSearch
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [, '-', {
text: '审核通过', //审核通过
iconCls: "btnadd",
handler: function (button, event) {
this.onAuditPassClick();
},
scope: this
},
'-',
{
text: '驳回提交', //驳回提交
iconCls: "btndelete",
handler: function (button, event) {
this.onAuditBackClick();
},
scope: this
5 months ago
},
'-',
{
text: '查看相关报价', //驳回提交
handler: function (button, event) {
this.onViewPriceClick();
},
scope: this
6 months ago
}, {
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.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
menu: [
{ text: "全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: "选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}, '-' ,{
text:'导出EXCEL', //"EXCEL模板导出",
iconCls: "btnexportexcel",
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 95,
items: [this.formSearch, this.panelBtn]
});
//#region 批量修改窗体
this.storeCtnList = Ext.create('Ext.data.Store', {
model: 'MsOpPriceFreight',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpPrice/GetPriceFreightList',
reader: {
id: 'ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListCtn = new Ext.grid.GridPanel({
store: this.storeCtnList,
enableHdMenu: false,
title: '运费', //'集装箱信息',
region: 'west',
width: 520,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'ID',
header: '编号',
hidden: true,
width: 0
}, {
dataIndex: 'CTNALL',
header: '箱型', //'箱型',
width: 80
}, {
dataIndex: 'CTNNUM',
header: '箱量', //'箱量',
width: 100
}
, {
dataIndex: 'PRICE',
header: '运价', //'箱量',
width: 100
}, {
dataIndex: 'BASEPRICE',
header: '底价', //'箱量',
width: 100
}, {
dataIndex: 'SELLPRICE',
header: '报价', //'箱量',
width: 100
}
]
});
this.storeCtnList.on('beforeload', function (store) {
var billNo = _this.billno;
var condition = "BSNO='" + billNo + "'";
Ext.apply(store.proxy.extraParams, { condition: condition });
}, this);
this.storeOtherList = Ext.create('Ext.data.Store', {
model: 'MsOpPriceOther',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpPrice/GetPriceOtherList',
reader: {
id: 'ID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridListOther = new Ext.grid.GridPanel({
store: this.storeOtherList,
enableHdMenu: false,
title: '杂费', //'集装箱信息',
region: 'west',
width: 320,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'ID',
header: '编号',
hidden: true,
width: 0
}, {
dataIndex: 'FEENAME',
header: '费用名称', //'箱型',
width: 80
}, {
dataIndex: 'CURRENCY',
header: '币别', //'箱型',
width: 80
}, {
dataIndex: 'AMOUNT',
header: '金额', //'箱量',
width: 100
}
]
});
this.storeOtherList.on('beforeload', function (store) {
var billNo = _this.billno;
var condition = "BSNO='" + billNo + "'";
Ext.apply(store.proxy.extraParams, { condition: condition });
}, this);
//#region 附件上传
this.storeChfeeFile = Ext.create('Ext.data.Store', {
model: 'FeeFileModel',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/Account/Chfee_payapplication/GetFileList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//表格
this.FeeFileColumns = [
{
sortable: true, hidden: true,
dataIndex: 'GID', readOnly: true,
header: 'GID',
width: 80
}, {
sortable: true, hidden: false,
dataIndex: 'File_OriginalName', readOnly: true,
header: '文件名称', //文件名称
renderer: function (value, p, record) {
return '<a href="' + "/Areas/Account/Files/" + record.data.BillNo + '/' + record.data.File_Name + '" target="_blank" style=' + '"text-decoration:none"' + ' >' + value + '</a>';
},
width: 180
}, {
sortable: true, hidden: false,
dataIndex: 'UpdateTime', readOnly: true,
header: '上传日期', //上传日期
width: 80
}, {
sortable: true, hidden: false,
dataIndex: 'Operator', readOnly: true,
header: '上传人', //上传者
width: 80
}, {
sortable: true, hidden: true,
dataIndex: 'File_Name', readOnly: true,
header: 'FFF', //文件物理名称
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'File_Path',
header: 'File_Path',
width: 80
}, {
xtype: 'actioncolumn',
width: 50,
text: '操作', //操作
items: [{
icon: '/images/icons/btnSearch.gif', // Use a URL in the icon config
tooltip: '预览',
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = "/Areas/Account/Files/" + rec.get('BillNo') + '/' + rec.get('File_Name') + '?a=' + Math.random();
var imgView = new Shipping.FileView({ filePath: filePath });
imgView.show();
}
}]
}
];
var selCertModel = Ext.create('Ext.selection.CheckboxModel');
this.fileGrid = new Ext.grid.GridPanel({
store: this.storeChfeeFile,
title: '附件', //'集装箱信息',
enableHdMenu: false,
layout: 'border',
region: 'center',
loadMask: { msg: '数据加载中,请稍等...' }, //数据加载中,请稍等...
trackMouseOver: true,
disableSelection: false,
selModel: selCertModel,
singleSelect: true,
selType: 'rowmodel',
columns: this.FeeFileColumns
});
//#endregion附件上传
this.panelBody = new Ext.Panel({
layout: "border",
region: "south",
height: 200,
items: [this.gridListCtn, this.gridListOther, this.fileGrid]
});
//#endregion
Ext.apply(this, {
items: [this.panelTop, this.gridList, this.panelBody]
});
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
this.sqlcontext = " b.BILLSTATUS=2";
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext },
waitMsg: "正在查询数据...",
scope: this
});
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
}, this);
this.gridList.getSelectionModel().on('select', function (model, record, index) {
_this.billno = record.data.GID;
this.storeCtnList.load({ params: { condition: "BSNO='" + _this.billno + "'" } });
this.storeOtherList.load({ params: { condition: "BSNO='" + _this.billno + "'" } });
this.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: _this.billno } });
}, this);
}, //end initUIComponents
InitGrid: function (grid) {
//var agirdcolums = Ext.clone(this.gridList.columns);
var agirdcolums = grid;
this.storecodeservice.load({ params: { condition: "OPTYPE='7'" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
for (i = 0; i < this.storecodeservice.getCount(); i += 1) {
var itemindex = i + 1;
var memberyf = this.storecodeservice.getAt(i);
for (var j = 0; j < agirdcolums.length; j++) {
if ((agirdcolums[j].dataIndex == 'Is' + memberyf.data.OPField) || (agirdcolums[j].dataIndex ==memberyf.data.OPField)) {
agirdcolums[j].header = memberyf.data.SERVICENAME;
// agirdcolums[j].hidden = false;
}
}
};
}
this.gridList.reconfigure(this.storeList, agirdcolums);
}
},
scope: this
});
// this.gridList.reconfigure(this.storeList, agirdcolums);
},
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.sqlcontext;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onAuditPassClick: function () {
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 bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.BILLSTATUS;
if ((BILLSTATUS == '6' || BILLSTATUS == '2')) {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: '提示', msg: '没有要审核的数据', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.confirm('提示','确定要审核通过吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在审核....');
Ext.Ajax.request({
waitMsg: '正在审核....',
url: '/MvcShipping/MsOpPrice/AuditList',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.storeList.reload();
_this.storeCtnList.removeAll();
_this.storeOtherList.removeAll();
_this.storeChfeeFile.removeAll();
if (jsonresult.Message != '审核通过') {
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
} else Ext.Msg.hide();
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
onAuditBackClick: function () {
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 bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BILLSTATUS = rec.data.BILLSTATUS;
if ((BILLSTATUS == '0' || BILLSTATUS == '2')) {
bodyAddDatas.push(rec);
} else {
Ext.Msg.show({ title: '提示', msg: '没有要驳回审核的数据', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
_this = this;
Ext.MessageBox.show({
title: "确认驳回!",
msg: "请输入驳回原因!",
width: 300,
buttons: Ext.MessageBox.OKCANCEL,
multiline: true,
fn: function (btn, text) {
if (btn == "ok") {
Ext.Ajax.request({
waitMsg: "正在驳回数据...",
url: '/MvcShipping/MsOpPrice/AuditBackList',
params: {
data: jsonbodyAddDatas,
reason: text
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.storeList.reload();
_this.storeCtnList.removeAll();
_this.storeOtherList.removeAll();
_this.storeChfeeFile.removeAll();
Ext.Msg.hide();
}
else {
Ext.Msg.show({ title:'错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg:'服务器响应出错', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}
});
},
5 months ago
onViewPriceClick: function () {
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 ORDNO = selections[0].data.ORDNO;
DsOpenEditWin('/MvcShipping/MsOpPrice/HistryIndex?ORDNO=' + ORDNO+'&ISXJ=1', "相关询价查看", "600", "940", "10", "10");
},
6 months ago
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var BILLNO = form.findField('BILLNO').getValue();
BILLNO = BILLNO.trim();
sql = sql + getAndConSql(sql, BILLNO, "BILLNO like '%" + BILLNO + "%'");
var BILLSTATUS = form.findField('BILLSTATUS').getValue();
sql = sql + getAndConSql(sql, BILLSTATUS, "BILLSTATUS= " + BILLSTATUS);
var ORDNO = form.findField('ORDNO').getValue();
sql = sql + getAndConSql(sql, ORDNO, "ORDNO like '%" + ORDNO + "%'");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
var FORWARDER = form.findField('FORWARDER').getValue();
sql = sql + getAndConSql(sql, FORWARDER, "FORWARDER= '" + FORWARDER + "'");
var SALE = form.findField('SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "SALE= '" + SALE + "'");
var CREATEUSER = form.findField('CREATEUSER').getValue();
sql = sql + getAndConSql(sql, CREATEUSER, "CREATEUSER= '" + CREATEUSER + "'");
var CARRIER = form.findField('CARRIER').getValue();
sql = sql + getAndConSql(sql, CARRIER, "CARRIER= '" + CARRIER + "'");
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
sql = sql + getAndConSql(sql, PORTDISCHARGE, "PORTDISCHARGE= '" + PORTDISCHARGE + "'");
var ETDBgn = form.findField('ETDBgn').getRawValue();
sql = sql + getAndConSql(sql, ETDBgn, "CONVERT(char(10), CREATETIME, 20) >='" + ETDBgn + "'");
var ETDEnd = form.findField('ETDEnd').getRawValue();
sql = sql + getAndConSql(sql, ETDEnd, "CONVERT(char(10), CREATETIME, 20) <='" + ETDEnd + "'");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.selectbsno;
ret[4] = 'op_other';
ret[5] = this.storePLList;
return ret;
},
onExportClick: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsOpPrice/GetDataListStr',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true'
},
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 = 'MSOPPRICELIST';
var sql1 = returnstr;
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
});
}
}
});
},
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsOpPrice/GetDataListStr',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true'
},
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 = 'MSOPPRICELIST';
var sql1 = returnstr;
var sql2 = "";
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 = '';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
if (sortstr == "") sortstr = "CREATETIME desc"
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('GID') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.GID;
}
var printType = 'MSOPPRICELISTSELECT';
var sql1 = "select * from op_price WHERE GID IN (" + feeGidSql + ") order by " + sortstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
//#region 2018年2月7日 李进举 鼎世 批量整票提交
onPiLiangZhengPiaoTiJiaoClick: function (type) {
var selections = this.GridCheckBoxModel.selected.items;
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要更新的业务!
return;
}
var BSNOStr = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BSNO = "'" + rec.data.BSNO + "'";
if (BSNOStr == '')
BSNOStr = BSNO;
else {
BSNOStr = BSNOStr + ',' + BSNO;
}
}
if (BSNOStr == '') {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.MeiYouYaoGengXinDeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpSeae/PiLiangZhengPiaoTiJiao',
params: {
bsno: BSNOStr,
statusvalue: 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 {
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext, load: 'true' },
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //"正在查询数据...",
scope: this
});
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.OK,
buttons: Ext.Msg.OK
});
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
}
//#endregion
});