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.

1197 lines
40 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.MsOpPriceProjectAuditIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpPriceProjectAuditIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpPriceProjectAuditIndex, Ext.Panel, {
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
PageSize: 100,
initUIComponents: function () {
this.formname = "formOpPriceProjectAuditIndex"; //页面名称
var salefield = [
{ name: 'GID', type: 'string' },
{ name: 'PRICETYPE', type: 'string' },
{ name: 'LINE', type: 'string' },
{ name: 'COUNTRY', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' },
{ name: 'TRANSPORT', type: 'string' },
{ name: 'CARRIER', type: 'string' },
{ name: 'WEEKETD', type: 'string' },
{ name: 'VOYAGE', type: 'string' },
{ name: 'VALIDETD', type: 'string' },
{ name: 'SERVICE', type: 'string' },
{ name: 'GOODTYPE', type: 'string' },
{ name: 'CTNSTATUS', type: 'string' },
{ name: 'AGENTNAME', type: 'string' },
{ name: 'AGENTATTN', type: 'string' },
{ name: 'AGENTADDR', type: 'string' },
{ name: 'DEBITCORPNAME', type: 'string' },
{ name: 'PRICEDATE', type: 'string' },
{ name: 'TOTALRMB', type: 'string' },
{ name: 'TOTALUSD', type: 'string' },
{ name: 'TOTALEUR', type: 'string' },
{ name: 'TOTALJPY', type: 'string' },
{ name: 'OTRMB', type: 'string' },
{ name: 'OTUSD', type: 'string' },
{ name: 'OTEUR', type: 'string' },
{ name: 'BEGINDATE', type: 'string' },
{ name: 'ENDDATE', type: 'string' },
{ name: 'PRJECTTYPE', type: 'string' },
{ name: 'PRJECTSOURCE', type: 'string' },
{ name: 'ISTRANSPORT', type: 'string' },
{ name: 'RENTOFDAY', type: 'string' },
{ name: 'RENTAMOUNT', type: 'string' },
{ name: 'ISBEST', type: 'string' },
{ name: 'PRJECTMAR', type: 'string' },
{ name: 'OTJPY', type: 'string' },
{ name: 'OTHER1COST', type: 'number' },
{ name: 'OTHER2COST', type: 'number' },
{ name: 'OTHER3COST', type: 'number' },
{ name: 'OTHER4COST', type: 'number' },
{ name: 'OTHER5COST', type: 'number' },
{ name: 'OTHER6COST', type: 'number' },
{ name: 'OTHER7COST', type: 'number' },
{ name: 'OTHER8COST', type: 'number' },
{ name: 'OTHER9COST', type: 'number' },
{ name: 'OTHER10COST', type: 'number' },
{ name: 'OTHER11COST', type: 'number' },
{ name: 'TTL1COST', type: 'number' },
{ name: 'TTL2COST', type: 'number' },
{ name: 'TTL3COST', type: 'number' },
{ name: 'TTL4COST', type: 'number' },
{ name: 'TTL5COST', type: 'number' },
{ name: 'TTL6COST', type: 'number' },
{ name: 'REMARKS', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'INPUTBYREF', type: 'string' },
{ name: 'OP', type: 'string' },
{ name: 'OPREF', type: 'string' },
{ name: 'BSSTATUS', type: 'string' },
{ name: 'ISSTOP', type: 'string' },
{ name: 'REASON', type: 'string' },
{ name: 'AUDITOPERATORREF', type: 'string' },
{ name: 'AUDITDATE', type: 'string' },
{ name: 'INPUTTIME', type: 'string' },
{ name: 'COMPANYID', type: 'string' }
];
this.initgirdcolums = [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'COMPANYID',
header: 'COMPANYID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'PRICETYPE',
header: 'PRICETYPE',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'AGENTNAME',
header: '代理名称',
width: 100
}, {
sortable: true,
dataIndex: 'PRJECTTYPE',
header: '方案类别',
width: 60
}, {
sortable: true,
dataIndex: 'PRJECTSOURCE',
header: '运价来源',
width: 60
}, {
sortable: true,
dataIndex: 'BEGINDATE',
header: '开始日期',
width: 60
}, {
sortable: true,
dataIndex: 'ENDDATE',
header: '结束日期',
width: 60
}, {
sortable: true,
dataIndex: 'ISTRANSPORT',
header: '是否中转',
width: 60,
renderer: function (value, meta) {
if (value == '1') {
return "是";
}
}
}, {
sortable: true,
dataIndex: 'ISBEST',
header: '是否最优方案',
width: 60,
renderer: function (value, meta) {
if (value == '1') {
return "是";
}
}
}, {
sortable: true,
dataIndex: 'PRJECTMARK',
header: '方案批注',
width: 100
}, {
sortable: true,
dataIndex: 'OPREF',
header: '维护人',
width: 100
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: '起运港',
width: 100
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '目的港',
width: 100
}, {
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 100
}, {
sortable: true,
dataIndex: 'VOYAGE',
header: '航程',
width: 100
}, {
sortable: true,
dataIndex: 'VALIDETD',
header: '有效期',
width: 100
}, {
sortable: true,
dataIndex: 'SERVICE',
header: '运输条款',
width: 100
}, {
sortable: true,
dataIndex: 'GOODTYPE',
header: '货物类别',
width: 100
}, {
sortable: true,
dataIndex: 'CTNSTATUS',
header: '箱状态',
width: 100
}, {
sortable: true,
dataIndex: 'REMARKS',
header: '备注',
width: 200
}, {
sortable: true,
dataIndex: 'OTHER1COST',
header: '出口海运费',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER2COST',
header: '出口港杂费',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER3COST',
header: '目的港DAP费用',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER4COST',
header: '目的港加热相关',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER5COST',
header: '回程起运港堆场费用',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER6COST',
header: '回程起运港杂费',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER7COST',
header: '回程海运费',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER8COST',
header: '回程目的港杂费',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER9COST',
header: '改装费',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER10COST',
header: '清洗相关费用',
width: 100
}, {
sortable: true,
dataIndex: 'OTHER11COST',
header: '清洗调拨费',
width: 100
}, {
sortable: true,
dataIndex: 'TTL1COST',
header: '罐租成本',
width: 100
}, {
sortable: true,
dataIndex: 'TTL2COST',
header: '成本合计',
width: 100
}, {
sortable: true,
dataIndex: 'TTL4COST',
header: '客户罐成本',
width: 100
}, {
sortable: true,
dataIndex: 'TTL6COST',
header: '回程成本合计',
width: 100
}, {
sortable: true,
dataIndex: 'INPUTBYREF',
header: '创建人',
width: 100
}, {
sortable: true,
dataIndex: 'INPUTTIME',
header: '创建时间',
width: 100
}, {
sortable: true,
dataIndex: 'AUDITOPERATORREF',
header: '审核人',
width: 100
}, {
sortable: true,
dataIndex: 'AUDITDATE',
header: '审核时间',
width: 100
}, {
sortable: true,
dataIndex: 'BSSTATUS',
header: '方案状态',
width: 80
}, {
sortable: true,
dataIndex: 'REASON',
header: '驳回原因',
width: 80
}, {
sortable: true,
dataIndex: 'ISSTOP',
header: '是否停用',
width: 80
}
];
this.girdcolums = this.initgirdcolums;
_this = this;
Ext.define('MsOpPrice', {
extend: 'Ext.data.Model',
fields: salefield
});
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpPrice',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpPrice/GetProjectDataList',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
//定义Grid
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,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
// this.InitGrid(this.girdcolums, '');
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
// this.SelectedRecord = record;
// this.OprationStatus = 'edit';
// // DsOpenEditWin('/MvcContainer/MsOpPrice/SeaeEdit', record.data.GID);
// var openSet = "height=500, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 500) / 2 + ",Left= " + (screen.width - 600) / 2
// var openType = record.data.GID;
// var openUrl = "/MvcContainer/MsOpPrice/YardEdit";
// window.open(openUrl, openType, openSet);
}, this);
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
this.gridList.columns[1] = new Ext.grid.RowNumberer();
//#region 费用信息
this.storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpPriceItems',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpPrice/GetPriceItemsList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.bodycolumn = [{
sortable: true,
dataIndex: 'GID',
header: '编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'LINKGID',
header: '业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'ITEMSNO',
header: '序号',
renderer: Ext.util.Format.numberRenderer('00'),
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '付款方',
width: 110
}, {
sortable: true,
dataIndex: 'FEENAME',
header: '费用名称',
width: 140
}, {
sortable: true,
dataIndex: 'UNIT',
header: '标准',
width: 100
}, {
sortable: true,
dataIndex: 'CURRENCY',
header: '币别',
width: 100
}, {
sortable: true,
dataIndex: 'UNITPRICE',
header: '单价',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 110
}, {
sortable: true,
dataIndex: 'REMARKS',
header: '备注',
width: 250
}, {
sortable: true,
dataIndex: 'PRICECLASS',
header: '类别归属',
width: 100
}, {
sortable: true,
dataIndex: 'ISSTOP',
header: '是否停用', //'是否海运',
width: 60,
renderer: function (value, cellmeta) {
if (value == '1' || value == true || value == 'true') {
return "是";
} else {
return "否";
}
}
}, {
sortable: true,
dataIndex: 'FEESTATUS_REF',
header: '费用状态',
width: 60
}, {
sortable: true,
dataIndex: 'INPUTBYREF',
header: '创建人',
width: 60
}, {
sortable: true,
dataIndex: 'INPUTTIME',
header: '创建日期',
width: 80
}, {
sortable: true,
dataIndex: 'MODIFYUSERREF',
header: '录入人',
width: 60
}, {
sortable: true,
dataIndex: 'MODIFYTIME',
header: '录入日期',
width: 80
}, {
sortable: true,
dataIndex: 'AUDITNAME',
header: '审核人',
width: 60
}, {
sortable: true,
dataIndex: 'AUDITDATE',
header: '审核日期',
width: 80
}];
//明细表表格
this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridListBody = new Ext.grid.GridPanel({
store: this.storeBodyList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
plugins: [this.gridListCellEditing],
selModel: this.GridCheckBoxModel,
viewConfig: {
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FEESTATUS');
return Shipping.FeeGetRowClass(feeStatus);
}
},
selType: 'cellmodel',
//tbar: [{
// text: "审核通过",
// iconCls: "btnadd",
// handler: function (button, event) {
// this.onAuditPassClick();
// },
// scope: this
//},
// '-',
// {
// text: "驳回提交",
// iconCls: "btndelete",
// handler: function (button, event) {
// this.onAuditBackClick();
// },
// scope: this
// }],
columns: this.bodycolumn
});
this.gridListCellEditing.on('beforeedit', function (editor, e) {
return this.cellEditingChFeeBeforeEdit(editor, e);
}, this);
this.panelBody = new Ext.Panel({
title: '运价详细信息',
layout: "border",
region: 'south',
height: 300,
animate: true,
split: true,
// autoScroll: true,
// containerScroll: true,
frame: false,
items: [this.gridListBody]
});
//#endregion
//#region formSearch 查询面板
//客户加载_场站
this.storeYARD = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeYARD.load({ params: { condition: "ISYARD='1'"} });
//场站
this.comboxYARD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '场站',
store: this.storeYARD,
forceSelection: true,
name: 'YARD',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.storePORTLOAD = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
autoLoad: true,
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
this.storePORTLOAD.load();
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '起运港',
store: this.storePORTLOAD,
name: 'PORTLOAD',
valueField: 'PORT',
queryMode: 'local',
displayField: 'PORT',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
this.storeCodeDisport.load();
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '目的港',
store: this.storeCodeDisport,
name: 'PORTDISCHARGE',
valueField: 'PORT',
queryMode: 'local',
displayField: 'PORT',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCountry = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCodeCountry',
proxy: { url: '/MvcShipping/MsCodeCountry/GetDataList' }
});
this.storeCountry.load({ params: { condition: ""} });
this.comboxCountry = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '国家',
store: this.storeCountry,
name: 'COUNTRY',
valueField: 'COUNTRY',
displayField: 'COUNTRY',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeAddDCType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeAddDCType.add({ "DC": "", "NAME": "全部" });
this.storeAddDCType.add({ "DC": "1", "NAME": "未审核" });
this.storeAddDCType.add({ "DC": "2", "NAME": "已审核" });
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '审核状态',
store: this.storeAddDCType,
valueField: 'DC',
displayField: 'NAME',
forceSelection: true,
name: 'DC',
value: '1',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
_this = this;
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: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxPORTLOAD,this.comboxPORTDISCHARGE, this.comboxYARD, this.comboxCountry, this.comboxaddDCType, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
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
}]
}
]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
},
scope: this
}, '-', {
text: "保存列表样式",
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: "审核通过",
iconCls: "btnadd",
handler: function (button, event) {
this.onAuditBillPassClick();
},
scope: this
},
'-',
{
text: "驳回提交",
iconCls: "btndelete",
handler: function (button, event) {
this.onAuditBillBackClick();
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList, this.panelBody]
});
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext, pricetype: PRICETYPE });
}, this);
this.gridList.getSelectionModel().on('select', function (model, record, index) {
var billno = record.data.GID;
var sql = "";
sql = " LINKGID='" + billno + "'";
_this.storeBodyList.load({ params: { condition: sql} });
}, this);
this.storeBodyList.on('beforeload', function (store) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
this.gridList.getSelectionModel().select(0);
}
selections = this.gridList.getSelectionModel().getSelection();
var rec = selections[0];
var acondition = " LINKGID='" + rec.data.GID + "'";
Ext.apply(store.proxy.extraParams, { condition: acondition });
}, this);
this.sqlcontext = '';
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.onRefreshClick();
// this.InitGrid(this.girdcolums,this.sqlcontext);
}, //end initUIComponents
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext, pricetype: PRICETYPE },
waitMsg: "正在查询数据...",
scope: this
});
},
onDsQuery: function () {
var sql = this.sqlcontext;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, pricetype: PRICETYPE },
waitMsg: "正在查询数据...",
scope: this
});
},
onAuditBillPassClick: 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.BSSTATUS;
if (BILLSTATUS == '提交审核') {
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: '/MvcContainer/MsOpPrice/AuditBillList',
params: {
bill: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.storeBodyList.removeAll();
_this.storeList.reload();
Ext.Msg.show({ title: '提示', msg: '审核成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
onAuditBillBackClick: 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.BSSTATUS;
if ((BILLSTATUS == '提交审核' || BILLSTATUS == '审核通过')) {
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: '/MvcContainer/MsOpPrice/AuditBillBack',
params: {
bill: jsonbodyAddDatas,
reasean: text
},
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.reload();
}
} else {
Ext.MessageBox.alert('错误', response.responseText);
}
},
scope: this
});
}
}
});
},
onAuditPassClick: function () {
var selections = this.gridListBody.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.FEESTATUS;
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: '/MvcContainer/MsOpPrice/AuditList',
params: {
bill: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.storeBodyList.reload();
Ext.Msg.show({ title: '提示', msg: '审核成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
onAuditBackClick: function () {
var selections = this.gridListBody.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.FEESTATUS;
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: '/MvcContainer/MsOpPrice/AuditBack',
params: {
bill: jsonbodyAddDatas,
reasean: text
},
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.storeBodyList.reload();
}
} else {
Ext.MessageBox.alert('错误', response.responseText);
}
},
scope: this
});
}
}
});
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = " b.PRICETYPE='" + PRICETYPE + "'";
var StrAudit = " EXISTS (select 1 from op_price left join workflow_using wu on wu.bsno=op_price.GID left join workflow_step st "
StrAudit = StrAudit + " on (st.WORKFLOWID=wu.WORKFLOWID and st.GROUPID=WU.CurrentID) where b.GID=op_price.GID "
StrAudit = StrAudit + " and (wu.TYPENO=812 or wu.TYPENO=813) "
StrAudit = StrAudit + " and isnull((power(2,(ST.STEPNO)) & wu.stepno),0)>0 and st.AUDITOR='" + GID + "' and op_price.BSSTATUS='提交审核' "
StrAudit = StrAudit + " ) ";
var PORTLOAD = form.findField('PORTLOAD').getValue();
sql = sql + getAndConSql(sql, PORTLOAD, " b.PORTLOAD like '%" + PORTLOAD + "%' ");
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
sql = sql + getAndConSql(sql, PORTDISCHARGE, " b.PORTDISCHARGE like '%" + PORTDISCHARGE + "%' ");
var YARD = form.findField('YARD').getValue();
sql = sql + getAndConSql(sql, YARD, " b.YARD='" + YARD + "'");
var COUNTRY = form.findField('COUNTRY').getValue();
sql = sql + getAndConSql(sql, COUNTRY, " b.COUNTRY='" + COUNTRY + "'");
var DC = form.findField('DC').getValue();
if (DC != '') {
if (DC == '1') {
sql = sql + getAndConSql(sql, DC, StrAudit);
} else if (DC == '2') {
sql = sql + getAndConSql(sql, DC, " EXISTS (select 1 from op_price_items where b.GID=op_price_items.LINKGID AND FEESTATUS=0 ) ");
}
}
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
return ret;
}
});