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.

1016 lines
35 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.AgentPriceHistryFee = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.AgentPriceHistryFee.superclass.constructor.call(this);
};
//需求编号SR2017071700006-1
Ext.extend(Shipping.AgentPriceHistryFee, Ext.Panel, {
PageSize: 10,
parentWin: null,
SelectedRecord: null,
StoreFee: null,
EditRecord: null,
initUIComponents: function () {
//#region formSearch 下拉框信息加载
//权限范围
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "MsCrmQuotation"} });
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOpCode.load();
//报价人
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '报价人',
store: this.storeOpCode,
forceSelection: true,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
});
//录入人
this.comboxCREATEUSER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '录入人',
store: this.storeOpCode,
forceSelection: true,
name: 'CREATEUSER',
valueField: 'UserName',
displayField: 'CodeAndName',
value: SHOWNAME,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
});
//品名code_msds//需求编号SR2017072600008-1
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'CodeMsdsModel',
proxy: { url: '/MvcShipping/MsCrmQuotation/GetCodeMsdsList' }
});
this.storeCodeGoodsList.load();
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '品名',
store: this.storeCodeGoodsList,
matchFieldWidth: false, //下拉款自适应宽度
name: 'GOODSNAME',
valueField: 'CHEMICALCGOODSNAME', //GOODNAME
displayField: 'CodeAndName',
listeners: {
'render': function (_field, eOpts) {//自定义函数,定义双击事件
_field.getEl().on('dblclick', function (e, t, eOpts) {
var sValue = t.value.toString();
var sLen = sValue.indexOf("|");
if (sLen > -1) {
sValue = sValue.substring(0, (sLen - 1));
}
else {
sValue = "";
}
//
var openSet = "height=700, width=1224, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcContainer/MsCodeMSDS/MsdsView?handle=check&goodsname=" + sValue;
window.open(openUrl, openType, openSet);
});
}
}
});
//客户名称
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,
matchFieldWidth: false, //下拉款自适应宽度
forceSelection: true,
name: 'SHORTNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
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/GetCustomRefList' }
});
this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船公司',
store: this.storeCARRIER,
matchFieldWidth: false, //下拉款自适应宽度
forceSelection: true,
name: 'CARRIER',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
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/GetCustomRefList' }
});
this.storeFORWARDER.load({ params: { condition: "ISAGENT='1'"} });
this.comboxFORWARDER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '使用代理',
store: this.storeFORWARDER,
matchFieldWidth: false, //下拉款自适应宽度
forceSelection: true,
name: 'FORWARDER',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
});
//枚举维护表tSysEnumValue_货物类别97028//需求编号SR2017072600008-3
this.storeTSysEnumValueCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.TSysEnumValueDataModel',
proxy: { url: '/CommMng/BasicDataRef/GetTSysEnumValueList' }
});
this.storeTSysEnumValueCode.load({ params: { condition: " and EnumTypeID=97028"} }); //货物类别
this.comboxGOODSTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '产品类别',
store: this.storeTSysEnumValueCode,
forceSelection: true,
name: 'GOODSTYPE',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
listeners: {
scope: this,
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
});
//国内港口(起运港)//需求编号SR2017072600008-4
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
//model: 'DsShipping.ux.CodeLoadportModel',
//proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList' }
//需求编号SR2017071700006-5
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
this.storeCodeLoadport.load();
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '起运港',
store: this.storeCodeLoadport,
matchFieldWidth: false, //下拉款自适应宽度
name: 'PORTLOAD',
valueField: 'PORT',
displayField: 'PORT', //'CodeAndName',
forceSelection: true,
listeners: {
scope: this,
keyup: 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',
matchFieldWidth: false, //下拉款自适应宽度
valueField: 'PORT',
displayField: 'PORT', //'CodeAndName',
forceSelection: true,
listeners: {
scope: this,
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
});
//集装箱
this.storeCodeCtn = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeCtnModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' }
});
this.storeCodeCtn.load();
this.comboxCTNALL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '箱型',
store: this.storeCodeCtn,
name: 'CTNCODE',
valueField: 'CTN',
displayField: 'CTN',
listeners: {
scope: this,
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
});
//箱状态(同代理报价中的箱状态)
this.StoreCTNSTATUS = Ext.create('DsExt.ux.RefEnumStore', {});
this.StoreCTNSTATUS.load({ params: { enumTypeId: 97029} });
this.comboxCTNSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCTNSTATUS,
fieldLabel: '箱状态',
forceSelection: true,
name: 'CTNSTATUS',
valueField: 'EnumValueName',
displayField: 'EnumValueName',
listeners: {
scope: this,
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
});
//运输条款
this.storeSERVICE = Ext.create('DsExt.ux.RefTableStore', {
model: 'CODE_SERVICE',
proxy: { url: '/CommMng/BasicDataRef/GetCodeServiceList' }
});
this.storeSERVICE.load({ params: { condition: ""} });
this.comboxSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '运输条款',
store: this.storeSERVICE,
forceSelection: true,
name: 'SERVICE',
valueField: 'SERVICE',
displayField: 'SERVICE'
});
//#endregion
//#region formSearch 查询条件
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: 'QUOTATIONCODE',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
}, this.comboxCustCode, this.comboxSALE, this.comboxCARRIER, this.comboxCTNALL]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxPORTLOAD, this.comboxPORTDISCHARGE, this.comboxGOODSNAME, this.comboxGOODSTYPE, this.comboxCTNSTATUS]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxFORWARDER, this.comboxSERVICE, {
fieldLabel: '从有效期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'VALIDDATEBgn',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'VALIDDATEEnd',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
this.onRefreshClick();
}
}
}
}, {
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
text: "重置",
flex: 1, xtype: 'button',
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, {
xtype: 'button',
flex: 1,
text: "查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
xtype: 'button',
flex: 1,
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
}//, { xtype: 'hiddenfield' }
]
}]
}]
}]
});
//#endregion formSearch
//#region 主表
//#region 定义数据集
this.StoreList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsCrmQuotationEntity',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCrmQuotation/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#endregion
//#region 列定义
this.girdcolums = [{
sortable: false,
dataIndex: 'GID',
header: '惟一值',
align: 'center',
hidden: true,
width: 0
},
{
sortable: false,
dataIndex: 'QUOTATIONCODE',
header: '报价编号',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'SHORTNAME',
header: '客户名称',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'TEL',
header: '联系方式',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'EMAIL',
header: '邮箱',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'SALE',
header: '报价人',
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'CREATEUSER',
header: '录入人',
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'CREATETIME',
header: '录入时间',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'PORTLOAD',
header: '起运港',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'PORTDISCHARGE',
header: '目的港',
align: 'center',
width: 150
},
{
sortable: false,
dataIndex: 'CARRIER',
header: '船公司',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'CTNCODE',
header: '箱型',
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'CTNNUM',
header: '箱量',
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'GOODSTYPE',
header: '产品类别',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'GOODSNAME',
header: '品名',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'UNNO',
header: 'UN', //需求编号SR2017080400003
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'DCLASS',
header: '危险品等级', //需求编号SR2017080400003
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'QUOTATIONDATE',
header: '报价时间',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'VALIDDATE',
header: '有效期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'SERVICE',
header: '运输条款',
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'CTNSTATUS',
header: '箱状态',
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'FORWARDER',
header: '使用代理',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'COMMISSIONRATE',
header: '佣金比率',
align: 'center',
width: 80
},
{
sortable: false,
dataIndex: 'FBPPORTLOAD',
header: '起运港免箱天数',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'CQPORTLOAD',
header: '起运港超期标准',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'FBPPORTDISCHARGE',
header: '目的港免箱天数',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'CQPORTDISCHARGE',
header: '目的港超期标准',
align: 'center',
width: 100
},
{
sortable: false,
dataIndex: 'RMBHJ',
header: '人民币合计', //需求编号SR2017071700006-2、3、4
align: 'right',
summaryType: 'sum',
summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
width: 80
},
{
sortable: false,
dataIndex: 'USDHJ',
header: 'USD合计', //需求编号SR2017071700006-2、3、4
align: 'right',
summaryType: 'sum',
summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
width: 80
},
{
sortable: false,
dataIndex: 'REMARK',
header: '备注',
align: 'center',
width: 200
}];
//#endregion
//#region gridList列表显示信息
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.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, //允许复制数据
autoFill: 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]
});
//#endregion
//#endregion
//#region 费用表
//#region 定义数据集
this.storeDetailList = Ext.create('Ext.data.Store', {
model: 'CrmQuotationDetailModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCrmQuotation/GetDetailList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#endregion
//#region 列定义
this.girdcolumsDetail = [{
sortable: false,
dataIndex: 'GID',
header: '', //唯一编码
hidden: true,
width: 0
},
{
sortable: false,
dataIndex: 'FEENAME',
header: '费用名称',
align: 'center',
width: 200,
editor: this.comboxFeeName
},
{
sortable: false,
dataIndex: 'CURRENCY',
header: '币别',
align: 'center',
width: 80,
editor: this.comboxCurr
},
{
sortable: false,
dataIndex: 'UNIT',
header: '单位',
align: 'center',
width: 80,
editor: this.comboxUnit
},
{
sortable: false,
dataIndex: 'UNITPRICE',
header: '金额',
align: 'right',
width: 120,
editor: {
xtype: 'numberfield',
allowBlank: false,
selectOnFocus: true, //得到焦点时自动选择文本
allowDecimals: true, //允许输入小数
nanText: '请输入有效小数',
minValue: -999999999.99,
maxValue: 999999999.99,
value: 0.00,
keyNavEnabled: false, //键盘导航是否可用,启用后可以通过键盘的上下箭头调整数值
hideTrigger: true, //是否隐藏上下调节按钮
mouseWheelEnabled: false, //鼠标滚轮是否可用,启用后可以通过滚动鼠标滚轮调整数值
//step: 2,//通过调节按钮、键盘、鼠标滚轮调节数值时的大小
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 40) {
this.onAddClick();
}
else if (e.getKey() == e.ENTER) {
this.onAddClick();
}
else if (e.getKey() == e.TAB) {
this.onAddClick();
}
},
scope: this
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
}
}, {
sortable: false,
dataIndex: 'LINKGID',
header: '', //唯一编码
hidden: true,
width: 0
}];
//#endregion
//#region gridList列表显示信息
this.feeGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridListDetail = new Ext.grid.GridPanel({
border: false,
region: 'south',
height: 240,
store: this.storeDetailList,
enableHdMenu: false, //是否显示表格列的菜单
hideHeaders: false, //是否隐藏表头
enableColumnHide: false, ///隐藏表头列
sortableColumns: false, ///隐藏表头排序
rowLines: true,
columnLines: true,
selModel: this.feeGridCheckBoxModel,
loadMask: { msg: "数据加载中,请稍等..." },
selType: 'cellmodel',
columns: this.girdcolumsDetail
});
//#endregion
//#endregion
//#region 按钮工具条/页面布局
this.panelBtn = new Ext.Panel({
border: false,
region: "north",
tbar: [{
text: "引入运价",
iconCls: "btnadd",
handler: function (button, event) {
this.onAddDetailClick(button, event);
},
scope: this
}, {
text: "取消退出",
xtype: "button",
handler: function (button, event) {
window.close();
},
scope: this
}]
}); //end 按钮Toolbar
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 126,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
border: false,
items: [this.panelTop, this.gridList, this.gridListDetail]
});
//#endregion
//#region 页面加载
this.parentWin = window.parent.opener;
if (this.parentWin) {
var ret = this.parentWin.OprationSwap2();
this.StoreFee = ret[0];
this.EditRecord = ret[1];
}
this.StoreList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.StoreList.on('load', function (store, records) {
if (store.getCount() > 0) {
this.gridList.getSelectionModel().select(0);
}
}, this);
this.gridList.getSelectionModel().on('select', function (model, record, index) {
var sGID = record.data.GID;
this.storeDetailList.load({ params: { condition: "LINKGID='" + sGID + "'"} });
}, this);
this.onRefreshClick();
//#endregion
}, //end initUIComponents
//#region 查询
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 });
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
//报价编号
var QUOTATIONCODE = form.findField('QUOTATIONCODE').getValue();
sql = sql + getAndConSql(sql, QUOTATIONCODE, "QUOTATIONCODE like '%" + QUOTATIONCODE + "%'");
//客户名称
var SHORTNAME = form.findField('SHORTNAME').getValue();
sql = sql + getAndConSql(sql, SHORTNAME, "SHORTNAME='" + SHORTNAME + "'");
//报价人
var SALE = form.findField('SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "SALE='" + SALE + "'");
//船公司
var CARRIER = form.findField('CARRIER').getValue();
sql = sql + getAndConSql(sql, CARRIER, "CARRIER='" + CARRIER + "'");
//国内港口(起运港)//需求编号SR2017072600008-4
var PORTLOAD = form.findField('PORTLOAD').getValue();
sql = sql + getAndConSql(sql, PORTLOAD, "PORTLOAD='" + PORTLOAD + "'");
//国际港口(目的港)
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
sql = sql + getAndConSql(sql, PORTDISCHARGE, "PORTDISCHARGE='" + PORTDISCHARGE + "'");
//集装箱
var CTNCODE = form.findField('CTNCODE').getValue();
sql = sql + getAndConSql(sql, CTNCODE, "CTNCODE='" + CTNCODE + "'");
//品名
var GOODSNAME = form.findField('GOODSNAME').getValue();
sql = sql + getAndConSql(sql, GOODSNAME, "GOODSNAME='" + GOODSNAME + "'");
//产品类别
var GOODSTYPE = form.findField('GOODSTYPE').getValue();
sql = sql + getAndConSql(sql, GOODSTYPE, "GOODSTYPE='" + GOODSTYPE + "'");
//箱状态
var CTNSTATUS = form.findField('CTNSTATUS').getValue();
sql = sql + getAndConSql(sql, CTNSTATUS, "CTNSTATUS='" + CTNSTATUS + "'");
//使用代理
var FORWARDER = form.findField('FORWARDER').getValue();
sql = sql + getAndConSql(sql, FORWARDER, "FORWARDER='" + FORWARDER + "'");
//运输条款
var SERVICE = form.findField('SERVICE').getValue();
sql = sql + getAndConSql(sql, SERVICE, "SERVICE='" + SERVICE + "'");
//有效期
var VALIDDATEBgn = form.findField('VALIDDATEBgn').getRawValue();
sql = sql + getAndConSql(sql, VALIDDATEBgn, "CONVERT(char(10), VALIDDATE, 20) >='" + VALIDDATEBgn + "'");
var VALIDDATEEnd = form.findField('VALIDDATEEnd').getRawValue();
sql = sql + getAndConSql(sql, VALIDDATEEnd, "CONVERT(char(10), VALIDDATE, 20) <='" + VALIDDATEEnd + "'");
return sql;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
},
onDsQuery: function () {
var sql = this.sqlcontext;
this.StoreList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据,请稍等...",
scope: this
});
},
//#endregion
//#region 引入运价
onAddDetailClick: function (button, event) {
var myDate = new Date();
var selectedRecords = this.feeGridCheckBoxModel.selected.items;
if (selectedRecords.length == 0) {
this.feeGridCheckBoxModel.selectAll();
selectedRecords = this.feeGridCheckBoxModel.selected.items;
}
for (i = 0; i < selectedRecords.length; i += 1) {
var memberyf = selectedRecords[i];
record = Ext.create('CrmQuotationDetailModel', {
GID: '*',
FEENAME: memberyf.data.FEENAME,
CURRENCY: memberyf.data.CURRENCY,
UNIT: memberyf.data.UNIT,
UNITPRICE: memberyf.data.UNITPRICE,
RMBHJ: 0, //需求编号SR2017071700006-2、3、4
USDHJ: 0, //需求编号SR2017071700006-2、3、4
LINKGID: this.EditRecord.get('GID')
});
record.id = NewGuid();
record.internalId = NewGuid();
this.StoreFee.add(record);
};
window.closeAction = 'destroy';
window.close();
}
//#endregion
});