|
|
@ -26,6 +26,8 @@ Ext.extend(Shipping.MsOpSeaeCustomEdiEdit, Ext.Panel, {
|
|
|
|
//this.bodyDel = [];
|
|
|
|
//this.bodyDel = [];
|
|
|
|
this.itemindex = 1;
|
|
|
|
this.itemindex = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.MASTERNO = getUrlParam('MASTERNO');
|
|
|
|
|
|
|
|
|
|
|
|
//#region 数据集
|
|
|
|
//#region 数据集
|
|
|
|
|
|
|
|
|
|
|
|
this.StoreCargoid = Ext.create('Ext.data.Store', {
|
|
|
|
this.StoreCargoid = Ext.create('Ext.data.Store', {
|
|
|
@ -1375,47 +1377,95 @@ Ext.extend(Shipping.MsOpSeaeCustomEdiEdit, Ext.Panel, {
|
|
|
|
this.serialNo = 0;
|
|
|
|
this.serialNo = 0;
|
|
|
|
//this.bodyDel = [];
|
|
|
|
//this.bodyDel = [];
|
|
|
|
this.opStatus = opstatus;
|
|
|
|
this.opStatus = opstatus;
|
|
|
|
|
|
|
|
_this = this;
|
|
|
|
|
|
|
|
if (this.MASTERNO) {
|
|
|
|
|
|
|
|
|
|
|
|
Ext.Ajax.request({
|
|
|
|
Ext.Ajax.request({
|
|
|
|
waitMsg: '正在查询主表数据...',
|
|
|
|
waitMsg: '正在查询主表数据...',
|
|
|
|
url: '/MvcShipping/MsOpSeaeEdi/GetData',
|
|
|
|
url: '/MvcShipping/MsOpSeaeEdi/GetData_OpOther',
|
|
|
|
params: {
|
|
|
|
params: {
|
|
|
|
handle: opstatus,
|
|
|
|
MASTERNO: _this.MASTERNO
|
|
|
|
condition: condition
|
|
|
|
},
|
|
|
|
},
|
|
|
|
callback: function (options, success, response) {
|
|
|
|
callback: function (options, success, response) {
|
|
|
|
if (success) {
|
|
|
|
if (success) {
|
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
|
var result = Ext.JSON.decode(response.responseText);
|
|
|
|
if (!result.Success) {
|
|
|
|
if (!result.Success) {
|
|
|
|
Ext.Msg.show({
|
|
|
|
Ext.Msg.show({
|
|
|
|
title: '提示',
|
|
|
|
title: '提示',
|
|
|
|
msg: result.Message,
|
|
|
|
msg: result.Message,
|
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
|
icon: Ext.MessageBox.ERROR,
|
|
|
|
buttons: Ext.Msg.OK
|
|
|
|
buttons: Ext.Msg.OK
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = result.data;
|
|
|
|
data = result.data;
|
|
|
|
|
|
|
|
|
|
|
|
this.formHead.getForm().reset();
|
|
|
|
if (data.BSNO == "") {
|
|
|
|
this.formHead.getForm().setValues(data);
|
|
|
|
_this.opStatus = "add";
|
|
|
|
this.formEdit.getForm().reset();
|
|
|
|
data.BSNO == _this.MASTERNO;
|
|
|
|
this.formEdit.getForm().setValues(data);
|
|
|
|
data.MFNO == _this.MASTERNO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.LoadInit();
|
|
|
|
this.formHead.getForm().reset();
|
|
|
|
this.GetEditStatus();
|
|
|
|
this.formHead.getForm().setValues(data);
|
|
|
|
} else {
|
|
|
|
this.formEdit.getForm().reset();
|
|
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
|
|
this.formEdit.getForm().setValues(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
this.LoadInit();
|
|
|
|
scope: this
|
|
|
|
this.GetEditStatus();
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
if (this.opStatus == 'edit') {
|
|
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
|
|
this.storeBodyList.load({ params: { condition: condition} });
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
scope: this
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.storeBodyList.load({ params: { condition: "MFNO='" + this.MASTERNO + "'" } });
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
condition = "MFNO='XX'";
|
|
|
|
|
|
|
|
this.storeBodyList.load({ params: { condition: condition} });
|
|
|
|
Ext.Ajax.request({
|
|
|
|
|
|
|
|
waitMsg: '正在查询主表数据...',
|
|
|
|
|
|
|
|
url: '/MvcShipping/MsOpSeaeEdi/GetData',
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
handle: opstatus,
|
|
|
|
|
|
|
|
condition: condition
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = result.data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.formHead.getForm().reset();
|
|
|
|
|
|
|
|
this.formHead.getForm().setValues(data);
|
|
|
|
|
|
|
|
this.formEdit.getForm().reset();
|
|
|
|
|
|
|
|
this.formEdit.getForm().setValues(data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.LoadInit();
|
|
|
|
|
|
|
|
this.GetEditStatus();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
scope: this
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.opStatus == 'edit') {
|
|
|
|
|
|
|
|
this.storeBodyList.load({ params: { condition: condition } });
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
condition = "MFNO='XX'";
|
|
|
|
|
|
|
|
this.storeBodyList.load({ params: { condition: condition } });
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, // end LoadDate
|
|
|
|
}, // end LoadDate
|
|
|
|
//#endregion
|
|
|
|
//#endregion
|
|
|
@ -1448,6 +1498,12 @@ Ext.extend(Shipping.MsOpSeaeCustomEdiEdit, Ext.Panel, {
|
|
|
|
var data = this.formHead.getForm().getValues(false, false, false);
|
|
|
|
var data = this.formHead.getForm().getValues(false, false, false);
|
|
|
|
var data2 = this.formEdit.getForm().getValues(false, false, false);
|
|
|
|
var data2 = this.formEdit.getForm().getValues(false, false, false);
|
|
|
|
this.formHead.getForm().findField('MFNO').setDisabled(true);
|
|
|
|
this.formHead.getForm().findField('MFNO').setDisabled(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.MASTERNO) {
|
|
|
|
|
|
|
|
data.BSNO = this.MASTERNO;
|
|
|
|
|
|
|
|
data.MFNO = this.MASTERNO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
Ext.Msg.wait('正在保存数据, 请稍侯..');
|
|
|
|
Ext.Msg.wait('正在保存数据, 请稍侯..');
|
|
|
|
Ext.Ajax.request({
|
|
|
|
Ext.Ajax.request({
|
|
|
@ -1471,36 +1527,41 @@ Ext.extend(Shipping.MsOpSeaeCustomEdiEdit, Ext.Panel, {
|
|
|
|
this.formEdit.getForm().setValues(returnData);
|
|
|
|
this.formEdit.getForm().setValues(returnData);
|
|
|
|
this.formHead.getForm().reset();
|
|
|
|
this.formHead.getForm().reset();
|
|
|
|
this.formHead.getForm().setValues(returnData);
|
|
|
|
this.formHead.getForm().setValues(returnData);
|
|
|
|
//
|
|
|
|
|
|
|
|
if (this.opStatus == 'add') {
|
|
|
|
if (this.MASTERNO) {
|
|
|
|
var arrNewRecords = this.StoreList.add(returnData);
|
|
|
|
this.LoadData(this.opStatus, "");
|
|
|
|
this.editRecord = arrNewRecords[0];
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (this.opStatus == 'edit') {
|
|
|
|
if (this.opStatus == 'add') {
|
|
|
|
var editp = Ext.create('MsSeaeEdiModel', returnData);
|
|
|
|
var arrNewRecords = this.StoreList.add(returnData);
|
|
|
|
this.editRecord.fields.each(function (field) {
|
|
|
|
this.editRecord = arrNewRecords[0];
|
|
|
|
if (field.persist) {
|
|
|
|
}
|
|
|
|
name = field.name;
|
|
|
|
else if (this.opStatus == 'edit') {
|
|
|
|
if (name != 'id')
|
|
|
|
var editp = Ext.create('MsSeaeEdiModel', returnData);
|
|
|
|
this.editRecord.set(name, editp.get(name));
|
|
|
|
this.editRecord.fields.each(function (field) {
|
|
|
|
}
|
|
|
|
if (field.persist) {
|
|
|
|
}, this);
|
|
|
|
name = field.name;
|
|
|
|
this.editRecord.commit();
|
|
|
|
if (name != 'id')
|
|
|
|
}
|
|
|
|
this.editRecord.set(name, editp.get(name));
|
|
|
|
if (type == '0') {
|
|
|
|
}
|
|
|
|
this.opStatus = 'edit';
|
|
|
|
}, this);
|
|
|
|
basicForm2.findField('MFNO').setDisabled(true);
|
|
|
|
this.editRecord.commit();
|
|
|
|
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
|
|
|
|
}
|
|
|
|
var memberbody = this.storeBodyList.getAt(j);
|
|
|
|
if (type == '0') {
|
|
|
|
memberbody.set("MFNO", this.editRecord.get('MFNO'));
|
|
|
|
this.opStatus = 'edit';
|
|
|
|
memberbody.commit();
|
|
|
|
basicForm2.findField('MFNO').setDisabled(true);
|
|
|
|
};
|
|
|
|
for (var j = 0; j < this.storeBodyList.getCount(); j += 1) {
|
|
|
|
|
|
|
|
var memberbody = this.storeBodyList.getAt(j);
|
|
|
|
|
|
|
|
memberbody.set("MFNO", this.editRecord.get('MFNO'));
|
|
|
|
} else if (type == '1') {
|
|
|
|
memberbody.commit();
|
|
|
|
window.close();
|
|
|
|
};
|
|
|
|
} else if (type == '2') {
|
|
|
|
|
|
|
|
this.LoadData('add', '');
|
|
|
|
|
|
|
|
|
|
|
|
} else if (type == '1') {
|
|
|
|
|
|
|
|
window.close();
|
|
|
|
|
|
|
|
} else if (type == '2') {
|
|
|
|
|
|
|
|
this.LoadData('add', '');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
|
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
|