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.

479 lines
24 KiB
JavaScript

12 months ago

Ext.namespace('Shipping');
//#region 列字段
var myfield = [];
var myfield2 = [];
var Columnfield = [
{ name: 'GID', type: 'string' }, //惟一编号
{ name: 'LOCKFLAG', type: 'bool' }, //是否锁定
{ name: 'ISISSUE', type: 'bool' }, //是否发布
{ name: 'LANE', type: 'string' }, //航线
{ name: 'PODLOAD', type: 'string' }, //起运港
{ name: 'PORTDISCHARGEID', type: 'string' }, //卸货港ID
{ name: 'PORTDISCHARGE', type: 'string' }, //卸货港中文
{ name: 'CARRIER', type: 'string' }, //船公司
{ name: 'VIA', type: 'string' }, //中转港
{ name: 'VIA2', type: 'string' }, //中转港2
{ name: 'ETD', type: 'string' }, //开航日/船期
{ name: 'TT', type: 'string' }, //航程
{ name: 'EFFECTIVEDATE', type: 'DateTime' }, //生效期/开始日期
{ name: 'VALIDDATE', type: 'DateTime' }, //有效期/结束日期
{ name: 'COMMODITY', type: 'string' }, //品名/特殊商品
{ name: 'CONTRACTNO', type: 'string' }, //约号
{ name: 'CONTRACTBSNO', type: 'string' }, //约号序列号
{ name: 'REMARK', type: 'string' }, //备注
{ name: 'INPUTBYREF', type: 'string' }, //备注
{ name: 'INPUTTIME', type: 'string' } //备注
];
//#endregion
//#region 列
var zlcolumn = [
{
sortable: false,
dataIndex: 'GID',
text: '惟一编号',
align: 'center',
hidden: true,
width: 0
},
{
dataIndex: 'LOCKFLAG',
text: '锁定',
align: 'center',
width: 40,
renderer: function (value) {
if (value == true) {
return "<img src='../../../../TruckMng/Content/Images/Lock.png'/>";
}
else {
return "";
}
}
},
{
dataIndex: 'ISISSUE',
text: '发布',
align: 'center',
width: 40,
renderer: function (value) {
if (value == true) {
return "<img src='../../../../TruckMng/Content/Images/Lock.png'/>";
}
else {
return "";
}
}
},
{
dataIndex: 'LANE',
text: '航线',
width: 80,
sortable: true,
editor: this.comboxLANE
},
{
dataIndex: 'PODLOAD',
text: '起运港',
width: 100,
sortable: true,
editor: this.comboxPODLOAD
},
{
dataIndex: 'PORTDISCHARGEID',
text: '卸货港',
width: 100,
sortable: true,
editor: this.comboxPORTDISCHARGEID
},
{
dataIndex: 'PORTDISCHARGE',
text: '卸货港中文',
width: 100,
sortable: true,
editor: this.comboxPORTDISCHARGE
},
{
dataIndex: 'CARRIER',
text: '船公司',
width: 100,
sortable: true,
editor: this.comboxCARRIER
},
{
dataIndex: 'VIA',
text: '中转港',
width: 100,
sortable: true,
editor: this.comboxVIA
},
{
dataIndex: 'VIA2',
text: '中转港2',
width: 100,
sortable: true,
editor: this.comboxVIA
},
{
dataIndex: 'ETD',
text: '船期',
width: 80,
sortable: true,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'TT',
text: '航程',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'COMMODITY',
text: '特殊商品',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'CONTRACTNO',
text: '约号',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'CONTRACTBSNO',hidden:true,
text: 'CONTRACTBSNO'
},
{
dataIndex: 'CTN0DETENTION',
text: '目的港免箱期_小柜',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'CTN1DETENTION',
text: '目的港免箱期_大柜',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'CTN2DETENTION',
text: '目的港免箱期_超高',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'CTN3DETENTION',
text: '目的港免箱期_小冻',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'CTN4DETENTION',
text: '目的港免箱期_超冻',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'REMARK',
text: '备注',
width: 200,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
dataIndex: 'INPUTBYREF',
text: '录入人',
width: 200
},
{
dataIndex: 'INPUTTIME',
text: '录入时间',
width: 200
}
];
//#endregion
function getCrmPriceColumn(_onCellBiaoShiClick, _storeListBiaoShi, _storeListXGCS, _initgirdcolums, _girdcolums, _formname, _storeList, _gridList, _onDetailClick) {
var feeList;
var ctnList;
_this = this;
//取其他费用权限
this.storeFeeData = Ext.create('DsExt.ux.RefTableStore', {
model: 'XiaLaKuangModel',
proxy: { url: '/MvcShipping/MsCrmPriceCarrier/GetFeeName' }
});
this.storeFeeData.load({
params: {},
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
feeList = r;
//取 集装箱箱型权限
this.storeCtnData = Ext.create('DsExt.ux.RefTableStore', {
model: 'XiaLaKuangModel',
proxy: { url: '/MvcShipping/MsCrmPriceCarrier/GetCtn' }
});
this.storeCtnData.load({
params: {},
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
ctnList = r;
//取 报价权限
this.storeMonthData = Ext.create('DsExt.ux.RefTableStore', {
model: 'XiaLaKuangModel',
proxy: { url: '/MvcShipping/MsCrmPriceCarrier/GetBaoJia' }
});
this.storeMonthData.load({
params: {},
callback: function (r, options, success) {
if (success) {
//#region 列循环
if (r.length != 0) {
//#region 列循环_其他费用
if (feeList != null) {
var acolumn2 = [];
for (i = 0; i < feeList.length; i++) {
var memberyf = feeList[i];
myfield2.push({ name: memberyf.data.VALUE, type: 'string' });
acolumn2.push({
dataIndex: memberyf.data.VALUE, //"列名"
text: memberyf.data.NAME, //"标题"
align: 'right',
width: 200,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
});
this.strHeader += ",[" + memberyf.data.NAME + "]";
};
if (acolumn2.length > 0) {
for (var k in acolumn2) {
zlcolumn.push(acolumn2[k]);
}
}
}
//#endregion
//#region 列循环_报价
for (j = 0; j < ctnList.length; j++) {
var ctn = ctnList[j];
var acolumn = [];
for (i = 0; i < r.length; i++) {
var memberyf = r[i];
myfield.push({ name: ctn.data.VALUE + memberyf.data.VALUE, type: 'decimal' });
zlcolumn.push({
dataIndex: ctn.data.VALUE + memberyf.data.VALUE, //"列名"
text: ctn.data.NAME + memberyf.data.NAME, //"标题"
align: 'right',
width: 70,
editor: {
//xtype: 'textfield',
xtype: 'numberfield',
selectOnFocus: true,
listeners: {
scope: this,
'render': function (_field, eOpts) {//自定义函数,定义双击事件
_field.getEl().on('dblclick', function (e, t, eOpts) {
//var sValue = _field.getValue();
//var sFIELDNAME = _field.name;
//_onCellBiaoShiClick(sFIELDNAME, _gridList); //_this
});
}
}
},
renderer: function (value, mCss, record, iRow, iCol, stores, views) {
//查询运价标识提取样式表数据匹配GID修改单元格颜色样式
for (var k = 0; k < _storeListBiaoShi.getCount(); k++) {
var member = _storeListBiaoShi.getAt(k);
var iFIELDCONTENT = parseInt(member.data.FIELDCONTENT);
var sFIELDNAME = member.data.FIELDNAME.toString().trim();
var sFIELDNAME2 = record.fields.keys[iCol - 1];
var sLINKGID = member.data.LINKGID.toString();
var sGID = record.data.GID.toString();
var iFIELDTYPE = parseInt(member.data.FIELDTYPE);
if (sLINKGID == sGID && sFIELDNAME == sFIELDNAME2 && iFIELDTYPE == 1) {
mCss.tdCls = Shipping.GetXGridCellClass(iFIELDCONTENT);
}
if (sLINKGID == sGID && sFIELDNAME == sFIELDNAME2 && iFIELDTYPE == 3) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/edit.png'/>";
}
}
for (var k = 0; k < _storeListXGCS.getCount(); k++) {
var member = _storeListXGCS.getAt(k);
var sFIELDNAME = member.data.FIELDNAME.toString().trim();
var sFIELDNAME2 = record.fields.keys[iCol - 1];
var sLINKGID = member.data.LINKGID.toString();
var sGID = record.data.GID.toString();
var iFIELDTYPE = parseInt(member.data.FIELDTYPE);
var iHJ = parseInt(member.data.hj) - 1;
if (sLINKGID == sGID && sFIELDNAME == sFIELDNAME2 && iFIELDTYPE == 2) {
if (iHJ == 1) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/001.png'/>";
}
else if (iHJ == 2) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/002.png'/>";
}
else if (iHJ == 3) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/003.png'/>";
}
else if (iHJ == 4) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/004.png'/>";
}
else if (iHJ == 5) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/005.png'/>";
}
else if (iHJ == 6) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/006.png'/>";
}
else if (iHJ == 7) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/007.png'/>";
}
else if (iHJ == 8) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/008.png'/>";
}
else if (iHJ == 9) {
value = value + " " + "<img src='../../../../TruckMng/Content/Images/009.png'/>";
}
}
}
return value;
},
listeners: {
scope: this,
'dblclick': function (_gridView, _td, iRow, iCol, e, record) {
//var sFIELDNAME = record.fields.keys[iCol - 1];
_column = _gridList.columns[iCol];
var sFIELDNAME = _column.dataIndex;
//_this.onCellBiaoShiClick(sFIELDNAME);
//20200506 将原来的批注/修改历史窗口
CONTRACTBSNO = record.get("CONTRACTBSNO");
PODLOAD = record.get("PODLOAD");
PORTDISCHARGEID = record.get("PORTDISCHARGEID");
VIA = record.get("VIA");
VIA2 = record.get("VIA2");
fieldname = sFIELDNAME;
//改为显示费用来源明细
//Ext.Msg.show({
// title: '提示',
// msg: CONTRACTBSNO + "<br />" + fieldname,
// icon: Ext.Msg.Info,
// buttons: Ext.Msg.OK
//});
_onDetailClick(fieldname, CONTRACTBSNO, PODLOAD, PORTDISCHARGEID, VIA, VIA2);
}
}
});
this.strHeader += ",[" + memberyf.data.NAME + "]";
};
}
//#endregion
}
for (var k in myfield2) {
Columnfield.push(myfield2[k]);
}
for (var k in myfield) {
Columnfield.push(myfield[k]);
}
zlcolumn.push(
{
dataIndex: 'EFFECTIVEDATE',
text: '开始日期',
align: 'center',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80,
editor: {
xtype: 'datefield',
format: 'Y-m-d',
value: currdate.format('yyyy-MM-dd'),
allowBlank: false,
selectOnFocus: true
}
});
zlcolumn.push(
{
dataIndex: 'VALIDDATE',
text: '结束日期',
align: 'center',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80,
editor: {
xtype: 'datefield',
format: 'Y-m-d',
value: currdate.format('yyyy-MM-dd'),
allowBlank: false,
selectOnFocus: true
}
});
_initgirdcolums = _girdcolums;
_girdcolums = zlcolumn;
_girdcolums = DsTruck.GetGridPanel(USERID, _formname, _girdcolums, 1);
_gridList.reconfigure(_storeList, _girdcolums);
Ext.Msg.hide();
//#endregion
}
},
async: false,
scope: this
});
}
}
},
async: false,
scope: this
});
}
}
},
async: false,
scope: this
});
}