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