'舱单业务完成20221114'

DS7_JingHan
ddlucky 2 years ago
parent 47f256323b
commit 58ec0e9a90

@ -496,7 +496,8 @@ namespace DSWeb.MvcShipping.Controllers
headData.DbOperationType = DbOperationType.DbotIns; headData.DbOperationType = DbOperationType.DbotIns;
// //
headData.OPLB="op_other";//业务类型 headData.OPLB="op_other";//业务类型
headData.OPLBNAME = "散杂运输";//业务类型名称 if(string.IsNullOrWhiteSpace(headData.OPLBNAME))
headData.OPLBNAME = "散杂运输";//业务类型名称
headData.BSSTATUS = false;//业务状态 headData.BSSTATUS = false;//业务状态
headData.FEESTATUS = false;//费用状态 headData.FEESTATUS = false;//费用状态
headData.ISVOU = false;//是否生成凭证 headData.ISVOU = false;//是否生成凭证
@ -581,50 +582,6 @@ namespace DSWeb.MvcShipping.Controllers
} }
} }
public ContentResult Save_CangDan(string opstatus, string data, string data2, string data3,string body)
{
var r1 = Save_Base(opstatus, data, data2);
if (r1.Success) {
var _head = (MsOpOtherEntity)r1.Data;
//如果保存成功 则根据 data3更新op_seae_edi表 根据body更新crm_seaeorderctn
var cdc = new DSWeb.Common.DB.CommonDataContext();
if (opstatus == "add") {
//新增业务和明细
var newedihead = JsonConvert.Deserialize<op_seae_edi_md>(data3);
newedihead.BSNO= _head.BSNO;
newedihead.MFNO = _head.BSNO;
newedihead.MASTERNO = _head.BSNO;
newedihead.CUSTNO= _head.CUSTNO;
cdc.op_seae_edi.Add(newedihead);
}
if (opstatus == "edit") {
var edihead = JsonConvert.Deserialize<op_seae_edi_md>(data3);
edihead.BSNO = _head.BSNO;
edihead.MFNO = _head.BSNO;
edihead.MASTERNO = _head.BSNO;
edihead.CUSTNO = _head.CUSTNO;
cdc.op_seae_edi.AddOrUpdate(edihead);
}
var bodylist = JsonConvert.Deserialize<List<op_seae_edi_ctn_md>>(body);
if (bodylist != null)
foreach (var item in bodylist) {
item.MFNO = _head.BSNO;
if (string.IsNullOrWhiteSpace(item.ctn_id)) {
item.ctn_id = Guid.NewGuid().ToString();
}
cdc.op_seae_edi_ctn.AddOrUpdate(item);
}
cdc.SaveChanges();
}
return new ContentResult() { Content = JsonConvert.Serialize(r1) };
}
public ContentResult PiliangServiceFee(string bill, string fee) public ContentResult PiliangServiceFee(string bill, string fee)
{ {
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "") if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")

@ -22,6 +22,8 @@ using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.SoftMng.DAL.SoftSysTable; using DSWeb.SoftMng.DAL.SoftSysTable;
using DSWeb.Areas.Account.DAL.Chfee_Settlement; using DSWeb.Areas.Account.DAL.Chfee_Settlement;
using DSWeb.MvcShipping.DAL.MsChFeeDAL; using DSWeb.MvcShipping.DAL.MsChFeeDAL;
using DSWeb.Common.DB;
using DSWeb.Areas.MvcShipping.Helper;
namespace DSWeb.MvcShipping.Controllers namespace DSWeb.MvcShipping.Controllers
{ {
@ -82,6 +84,43 @@ namespace DSWeb.MvcShipping.Controllers
return new ContentResult() { Content = json }; return new ContentResult() { Content = json };
} }
/// <summary>
/// 通过OP_Other的编辑页菜单打开
/// 如有业务则按原逻辑返回 如无则新建记录 并将提单号 分单号 etd抄写后返回
/// </summary>
/// <param name="handle"></param>
/// <param name="condition"></param>
/// <returns></returns>
public ContentResult GetData_OpOther(string MASTERNO)
{
MsOpSeaeEdi head = null;
head = MsOpSeaeEdiDAL.GetData("B.MASTERNO='"+ MASTERNO + "'");
if (head == null || head.BSNO=="")
{
head = new MsOpSeaeEdi();
head.INPUTBY = Convert.ToString(Session["SHOWNAME"]);
var cdc = new CommonDataContext();
var opotherlist = cdc.op_other.Where(x => x.BSNO == MASTERNO).ToList();
if (opotherlist != null && opotherlist.Count > 0) {
var opother = opotherlist[0];
head = AutoMapperHelper.MapTo<op_other_md, MsOpSeaeEdi>(opother);
head.MASTERNO = MASTERNO;
head.BSNO = "";
head.MFNO = "";
}
}
var json = JsonConvert.Serialize(
new { Success = true, Message = "查询成功", data = head });
return new ContentResult() { Content = json };
}
public ContentResult GetBodyList(string condition) public ContentResult GetBodyList(string condition)
{ {
var dataList = MsOpSeaeEdiDAL.GetBodyList(condition); var dataList = MsOpSeaeEdiDAL.GetBodyList(condition);

@ -446,6 +446,9 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
items: [{ items: [{
fieldLabel: '业务编号', fieldLabel: '业务编号',
name: 'BSNO', hidden: true name: 'BSNO', hidden: true
}, {
fieldLabel: 'OPLBNAME',
name: 'OPLBNAME', hidden: true
}, { }, {
fieldLabel: '业务状态', fieldLabel: '业务状态',
readOnly: true, readOnly: true,
@ -981,17 +984,34 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
closable: true, closable: true,
title: record.data.DESCRIPTION title: record.data.DESCRIPTION
}); });
} else { } else {
var paneltabitems = new Ext.Panel({
id: 'pnl' + record.data.NAME, if (record.data.NAME == 'modOpSeaeEdiEdit') {
layout: "fit", var _url = record.data.MODULEURL + "?MASTERNO=" + this.editRecord.get('BSNO');
region: "center", var paneltabitems = new Ext.Panel({
autoScroll: true, id: 'pnl' + record.data.NAME,
frame: false, layout: "fit",
closable: true, region: "center",
title: record.data.DESCRIPTION, autoScroll: true,
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + record.data.MODULEURL + '"> </iframe>' frame: false,
}); closable: true,
title: record.data.DESCRIPTION,
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + _url + '"> </iframe>'
});
} else {
var paneltabitems = new Ext.Panel({
id: 'pnl' + record.data.NAME,
layout: "fit",
region: "center",
autoScroll: true,
frame: false,
closable: true,
title: record.data.DESCRIPTION,
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="' + record.data.MODULEURL + '"> </iframe>'
});
}
} }
this.tabOtherPanel.add(paneltabitems); this.tabOtherPanel.add(paneltabitems);
this.tabOtherPanel.setActiveTab(paneltabitems); this.tabOtherPanel.setActiveTab(paneltabitems);
@ -1401,6 +1421,7 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
return; return;
} }
data = result.data; data = result.data;
data.OPLBNAME = "舱单申报";
this.formHead.getForm().reset(); this.formHead.getForm().reset();
this.formHead.getForm().setValues(data); this.formHead.getForm().setValues(data);
this.formEdit.getForm().reset(); this.formEdit.getForm().reset();
@ -1463,34 +1484,6 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
}); });
this.panelFee.storeChFeeGain.load({ params: { bsno: data.BSNO, optype: "op_other" } }); this.panelFee.storeChFeeGain.load({ params: { bsno: data.BSNO, optype: "op_other" } });
var edi_condition = "MFNO='" + data.BSNO +"'";
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.formBill.getForm().reset();
_this.formBill.getForm().setValues(data);
}
}
});
} else { } else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
} }
@ -1803,11 +1796,6 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
return; return;
} }
var basicForm3 = this.formBill.getForm();
if (!basicForm3.isValid()) {
return;
}
if (this.accdatesameetd == 1) { if (this.accdatesameetd == 1) {
var ETD = this.formEdit.getForm().findField('ETD').getRawValue(); var ETD = this.formEdit.getForm().findField('ETD').getRawValue();
@ -1843,8 +1831,6 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
this.formHead.getForm().findField('BSNO').setDisabled(true); this.formHead.getForm().findField('BSNO').setDisabled(true);
var data2 = this.formEdit.getForm().getValues(false, false, false); var data2 = this.formEdit.getForm().getValues(false, false, false);
var data3 = this.formBill.getForm().getValues(false, false, false);
var bodydatas = []; var bodydatas = [];
for (var i = 0; i < this.storeBodyList.getCount(); i += 1) { for (var i = 0; i < this.storeBodyList.getCount(); i += 1) {
var member = this.storeBodyList.getAt(i); var member = this.storeBodyList.getAt(i);
@ -1858,14 +1844,12 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
Ext.Msg.wait('正在保存数据, 请稍侯..'); Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({ Ext.Ajax.request({
waitMsg: '正在保存数据...', waitMsg: '正在保存数据...',
url: '/MvcShipping/MsOpOther/Save_CangDan', url: '/MvcShipping/MsOpOther/Save',
scope: this, scope: this,
params: { params: {
opstatus: this.opStatus, opstatus: this.opStatus,
data: Ext.JSON.encode(data), data: Ext.JSON.encode(data),
data2: Ext.JSON.encode(data2), data2: Ext.JSON.encode(data2)
data3: Ext.JSON.encode(data3),
body: jsonBody
}, },
callback: function (options, success, response) { callback: function (options, success, response) {
if (success) { if (success) {
@ -2089,6 +2073,7 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
}); });
this.GetEditStatus(); this.GetEditStatus();
this.formHead.getForm().findField("OPLBNAME").setValue("舱单申报");
}, },

@ -1770,7 +1770,8 @@ Ext.extend(Shipping.MsOpOtherIndex, Ext.Panel, {
return ''; return '';
} }
var sql = ''; //var sql = '';
var sql = "OPLBNAME='舱单申报'";
var MBLNO = form.findField('MBLNO').getValue(); var MBLNO = form.findField('MBLNO').getValue();
sql = sql + getAndConSql(sql, MBLNO, "MBLNO like '%" + MBLNO + "%'"); sql = sql + getAndConSql(sql, MBLNO, "MBLNO like '%" + MBLNO + "%'");

@ -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 });

Loading…
Cancel
Save