DS7_JinGang
hanxuntao 2 years ago
parent 6ecb5d860c
commit 37fc5dc7ef

@ -166,7 +166,47 @@ namespace DSWeb.MvcShipping.Controllers
new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });//list.ToList()
return new ContentResult() { Content = json };
}
public ContentResult updatetaskbs(string bsno, string body)
{
var result = new DBResult();
var bodyList = JsonConvert.Deserialize<List<OpTaskFieldValue>>(body);
if (bodyList != null && bodyList.Count != 0) {
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
foreach (var bill in bodyList) {
if (bill.FEILDNAME == "船名")
{
var blUpSQL = " update OP_SEAE SET VESSEL='" + bill.FEILDVALUE + "' where BSNO='" + bsno + "'";
var bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}else if (bill.FEILDNAME == "航次")
{
var blUpSQL = " update OP_SEAE SET VOYNO='" + bill.FEILDVALUE + "' where BSNO='" + bsno + "'";
var bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else if (bill.FEILDNAME == "提单号")
{
var blUpSQL = " update OP_SEAE SET MBLNO='" + bill.FEILDVALUE + "' where BSNO='" + bsno + "'";
var bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else if (bill.FEILDNAME == "卸货港")
{
var blUpSQL = " update OP_SEAE SET PORTDISCHARGE='" + bill.FEILDVALUE + "' where BSNO='" + bsno + "'";
var bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
else if (bill.FEILDNAME == "目的港")
{
var blUpSQL = " update OP_SEAE SET DESTINATION='" + bill.FEILDVALUE + "' where BSNO='" + bsno + "'";
var bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
}
}
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult UpTaskOver(string data)
{

@ -1186,8 +1186,8 @@ Ext.extend(Shipping.MsOpSeaeTaskView, Ext.Panel, {
}, {
sortable: true,
dataIndex: 'FEILDVALUE',
header: '值',
width: 150
header: '值',
width: 250
}
];
@ -1195,6 +1195,13 @@ Ext.extend(Shipping.MsOpSeaeTaskView, Ext.Panel, {
this.gridTaskFieldValueList = new Ext.grid.GridPanel({
store: this.storeTaskFieldValueList,
enableHdMenu: false,
tbar: [{
text: '更新业务数据',
handler: function (button, event) {
this.uptaskbs();
},
scope: this
}],
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
@ -1478,6 +1485,7 @@ Ext.extend(Shipping.MsOpSeaeTaskView, Ext.Panel, {
this.panelFee.show();
} else if (tasktype == 'MSC BC') {
this.storeTaskFieldValueList.load();
this.tabSeaepanel.remove(this.panelfee);
this.tabSeaepanel.remove(this.panelpdf);
}
@ -1637,6 +1645,46 @@ Ext.extend(Shipping.MsOpSeaeTaskView, Ext.Panel, {
},
//#endregion
uptaskbs: function () {
var BSNO = this.editRecord.get('BSNO').toString().trim();
var bodydatas = [];
for (var i = 0; i < this.storeTaskFieldValueList.getCount(); i += 1) {
var member = this.storeTaskFieldValueList.getAt(i);
bodydatas.push(member);
}
var jsonBody = ConvertRecordsToJsonAll(bodydatas);
Ext.Msg.wait('正在更新数据');
Ext.Ajax.request({
waitMsg: '正在更新数据', //'正在保存数据...',
url: '/MvcShipping/MsOpTask/updatetaskbs',
scope: this,
params: {
bsno: BSNO,
body: jsonBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
} else {
Ext.Msg.show({ title:'错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: '提示',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
onUpTransStatusClick: function (transstatus) {

Loading…
Cancel
Save