From d54f92cdb1bdba14494dbd6bc595f151fe64b306 Mon Sep 17 00:00:00 2001 From: hanxuntao Date: Thu, 29 Aug 2024 08:58:51 +0800 Subject: [PATCH] 1 --- .../ChInvoicehexiaoEdit.js | 6 + .../Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js | 5 + .../Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js | 5 + .../Controllers/MsOpSeaeController.cs | 6 + .../Controllers/MsOpVgmSendController.cs | 306 +++++ .../DAL/MsOpSaleRpt/MsOpSaleRptDAL.cs | 25 +- .../DAL/MsOpVgmSend/MsOpVgmSendDAL.cs | 415 ++++++ .../Models/MsOpVgmSend/MsOpVgmSend.cs | 158 +++ .../MvcShipping/Views/MsOpVgmSend/Edit.aspx | 37 + .../MvcShipping/Views/MsOpVgmSend/Index.aspx | 35 + .../Viewsjs/MsOpRailway/MsOpRailwayIndex.js | 2 + .../Viewsjs/MsOpRailway/MsOpRailwaySZIndex.js | 2 + .../Viewsjs/MsOpSaleRpt/MsOpSaleRptIndex.js | 36 +- .../Viewsjs/MsOpSeae/MsOpSeaeEdit.js | 10 +- .../MvcShipping/Viewsjs/MsOpVgmSend/Edit.js | 26 + .../MvcShipping/Viewsjs/MsOpVgmSend/Index.js | 31 + .../Viewsjs/MsOpVgmSend/MsOpVgmSendEdit.js | 617 +++++++++ .../Viewsjs/MsOpVgmSend/MsOpVgmSendIndex.js | 1216 +++++++++++++++++ .../Viewsjs/MsOpVgmSend/MsOpVgmSendModel.js | 45 + .../Viewsjs/MsWlBs/MsPcEdit_ZXIndex.js | 2 +- DSWeb/DSWeb.csproj | 10 + 21 files changed, 2977 insertions(+), 18 deletions(-) create mode 100644 DSWeb/Areas/MvcShipping/Controllers/MsOpVgmSendController.cs create mode 100644 DSWeb/Areas/MvcShipping/DAL/MsOpVgmSend/MsOpVgmSendDAL.cs create mode 100644 DSWeb/Areas/MvcShipping/Models/MsOpVgmSend/MsOpVgmSend.cs create mode 100644 DSWeb/Areas/MvcShipping/Views/MsOpVgmSend/Edit.aspx create mode 100644 DSWeb/Areas/MvcShipping/Views/MsOpVgmSend/Index.aspx create mode 100644 DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/Edit.js create mode 100644 DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/Index.js create mode 100644 DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendEdit.js create mode 100644 DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendIndex.js create mode 100644 DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendModel.js diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_Invoicehexiao/ChInvoicehexiaoEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_Invoicehexiao/ChInvoicehexiaoEdit.js index 231878f6..c75c2eae 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_Invoicehexiao/ChInvoicehexiaoEdit.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_Invoicehexiao/ChInvoicehexiaoEdit.js @@ -3337,6 +3337,12 @@ Ext.extend(Shipping.MsChInvoicehexiaoEdit, Ext.Panel, { Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '必须填折算汇率!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; }; + if (UsdExrate < 0) { + Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '折算汇率不能小于0!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + + } + var recs = DsStoreQueryBy(me.storeCurrExrate, 'CURR', bfcurr); if (recs.getCount() > 0) { diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js index 1cdc6f86..2813f1f4 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceAppEdit.js @@ -5106,6 +5106,11 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, { Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.surezesuanhuil, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; }; + if (UsdExrate < 0) { + Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '折算汇率不能小于0!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + + } var recs = DsStoreQueryBy(me.storeCurrExrate, 'CURR', bfcurr); if (recs.getCount() > 0) { // var dfdata = DFrecords.getAt(0).data; diff --git a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js index 5ffa1429..a056b312 100644 --- a/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js +++ b/DSWeb/Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceBLEdit.js @@ -6042,6 +6042,11 @@ Ext.extend(Shipping.MsChInvoiceBLEdit, Ext.Panel, { Ext.Msg.show({ title: Zi.LAN.Prompt, msg: Zi.LAN.surezesuanhuil, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return; }; + if (UsdExrate < 0) { + Ext.Msg.show({ title: Zi.LAN.Prompt, msg: '折算汇率不能小于0!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + + } var recs = DsStoreQueryBy(me.storeCurrExrate, 'CURR', bfcurr); if (recs.getCount() > 0) { diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs index 6bafbca6..b65971c4 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpSeaeController.cs @@ -16196,6 +16196,12 @@ namespace DSWeb.MvcShipping.Controllers return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose22) }; } + if (MsOpSeaeYunZongBsList == null || MsOpSeaeYunZongBsList.Count == 0) { + var jsonRespose22 = new JsonResponse { Success = false, Message = "没有要订阅的运踪"}; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose22) }; + + } + var MsOpSeaeYunZong = new MsOpSeaeYunZongNew(); diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsOpVgmSendController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsOpVgmSendController.cs new file mode 100644 index 00000000..4cca1d00 --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Controllers/MsOpVgmSendController.cs @@ -0,0 +1,306 @@ +using System; +using System.Linq; +using System.Web.Mvc; +using DSWeb.MvcShipping.DAL.MsOpSaleRptDAL; +using DSWeb.MvcShipping.Models.MsOpSaleRpt; +using DSWeb.MvcShipping.Helper; +using DSWeb.MvcShipping.Comm.Cookie; +using HcUtility.Comm; +using HcUtility.Core; +using System.Collections.Generic; +using DSWeb.EntityDA; +using DSWeb.SoftMng.Filter; +using Renci.SshNet.Common; +using DSWeb.MvcShipping.DAL.MsOpVgmSendDAL; +using DSWeb.MvcShipping.Models.MsOpVgmSend; + +namespace DSWeb.MvcShipping.Controllers +{ + [JsonRequestBehavior] + public class MsOpVgmSendController : Controller + { + public ActionResult Index() + { + return View(); + } + + public ActionResult Edit() + { + return View(); + } + public ActionResult ModifyEdit() + { + return View(); + } + public ActionResult ModifyHisEdit() + { + return View(); + } + [SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器 + public ContentResult GetDataList(int start, int limit, string sort, string condition) + { + var dataList = MsOpVgmSendDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort); + var list = dataList.Skip(start).Take(limit); + var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() }); + return new ContentResult() { Content = json }; + } + [SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器 + public ContentResult GetDataListStr(string sort, string condition) + { + var dataListStr = MsOpVgmSendDAL.GetDataListStr(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort); + var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = dataListStr }); + return new ContentResult() { Content = json }; + } + + //public ContentResult GetDataListSum(int start, int limit, string sort, string condition) + //{ + // var dataList = MsOpSeaePreDAL.GetDataListSum(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort); + // var list = dataList.Skip(start).Take(limit); + // var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = list.ToList() }); + // return new ContentResult() { Content = json }; + //} + [SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器 + public ContentResult GetData(string handle, string condition) + { + MsOpVgmSend head = null; + if (handle == "edit") + { + head = MsOpVgmSendDAL.GetData(condition); + } + if (head == null) + { + head = new MsOpVgmSend(); +// head.OP = Convert.ToString(Session["SHOWNAME"]); + // head.CREATEUSER + } + + + var json = JsonConvert.Serialize( + new { Success = true, Message = "查询成功", data = head }); + return new ContentResult() { Content = json }; + } + + + + public ContentResult Save(string opstatus, string data) + { + 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() == "") + { + var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; + } + // + T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); + var headData = JsonConvert.Deserialize(data); + var isPost = true; + var errorstr = ""; + var iscreatecustno = false; + + ////分公司代码 + //if (headData.CORPID == "" || headData.CORPID == null) + //{ + // headData.CORPID = Convert.ToString(Session["COMPANYID"]); + //} + + //分公司代码 + if (headData.BSNO == "" || headData.BSNO == null) + { + headData.BSNO = "topseaevgm" + Guid.NewGuid().ToString().Replace("-",""); + } + + + string rq = T_ALL_DA.GetStrSQL("rq", "select getdate() as rq"); + // + if (opstatus == "add") + { + headData.DbOperationType = DbOperationType.DbotIns; + // + + headData.SENDERUSER = Convert.ToString(Session["USERID"]);//创建人 + headData.SENDTIME = DateTime.Parse(rq);//创建时间 + headData.VGMSTATUS = "未发送"; + } + else if (opstatus == "edit") + { + headData.DbOperationType = DbOperationType.DbotUpd; + headData.ModelUIStatus = "E"; + } + else + { + headData.DbOperationType = DbOperationType.DbotDel; + } + //if (headData.CTNNUM == null) { headData.CTNNUM = 0; } + + + + + if (isPost) + { + var modb = new ModelObjectDB(); + DBResult result = modb.Save(headData); + var BSNO = headData.BSNO; + + + + var jsonRespose = new JsonResponse + { + Success = result.Success, + Message = result.Message, + Data = MsOpSaleRptDAL.GetData("BSNO='" + BSNO + "'") + }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + } + else { + var jsonRespose = new JsonResponse { Success = false, Message =errorstr }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + } + } + + + + [SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器 + public ContentResult GetVgmCtnList(string condition, string sort) + { + var dataList = MsOpVgmSendDAL.GetVgmCtnList(condition, sort); + var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() }); + return new ContentResult() { Content = json }; + } + + + + + + public ContentResult Delete(string data) + { + 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() == "") + { + var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; + } + // + var head = JsonConvert.Deserialize(data); + var BSNO = head.BSNO; + var modb = new ModelObjectDB(); + DBResult result = modb.Delete(head); + + var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + } + // + + + public ContentResult DeleteList(string data) + { + 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() == "") + { + var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; + } + // + DBResult result = new DBResult(); + var headList = JsonConvert.Deserialize>(data); + if (headList != null) + { + foreach (var enumValue in headList) + { + var modb = new ModelObjectDB(); + result = modb.Delete(enumValue); + } + } + + var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + } + + + public ContentResult NewData() + { + 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() == "") + { + var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; + } + // + var result = MsOpSaleRptDAL.NewData(Convert.ToString(Session["USERID"])); + + var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + } + + public ContentResult SubmitAudit() + { + 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() == "") + { + var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; + } + // + var result = MsOpSaleRptDAL.SubmitAudit(Convert.ToString(Session["USERID"])); + + var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + } + + + public ContentResult LockList(string data,string type="1") + { + 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() == "") + { + var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; + } + // + T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); + DBResult result = new DBResult(); + var headList = JsonConvert.Deserialize>(data); + if (headList != null) + { + foreach (var enumValue in headList) + { + if (type == "1") + { + var blUpSQL = " update op_sale_rpt set RPTSTATUS='锁定',LOCKTIME=GETDATE(),LOCKUSER='" + Convert.ToString(Session["USERID"]).ToString() + "' where GID='" + enumValue.GID + "'"; + bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL); + } + else { + var blUpSQL = " update op_sale_rpt set RPTSTATUS='发布' where GID='" + enumValue.GID + "'"; + bool 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 CancelSubList(string data) + { + 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() == "") + { + var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) }; + } + // + T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA(); + DBResult result = new DBResult(); + var headList = JsonConvert.Deserialize>(data); + if (headList != null) + { + foreach (var enumValue in headList) + { + var blUpSQL = " update op_sale_rpt set RPTSTATUS='未发布' where GID='" + enumValue.GID + "'"; + bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL); + + } + } + result.Success = true; + result.Message = "更新成功!"; + + var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + } + } + + +} + diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSaleRpt/MsOpSaleRptDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSaleRpt/MsOpSaleRptDAL.cs index 34c75790..87500895 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSaleRpt/MsOpSaleRptDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSaleRpt/MsOpSaleRptDAL.cs @@ -12,6 +12,7 @@ using HcUtility.Core; using static System.Windows.Forms.VisualStyles.VisualStyleElement; using DSWeb.MvcShipping.Models.CodeCtnEdi; using com.sun.tools.@internal.xjc.reader.gbind; +using org.junit.rules; namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL { @@ -20,8 +21,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL #region Inquery DataList static public List GetDataList(string strCondition, string userid, string usercode, string companyid, string sort = null) { - var rangstr = ""; -// GetRangDAStr("index", userid, usercode, companyid); + var rangstr = GetRangDAStr("index", userid, usercode, companyid); if (!string.IsNullOrEmpty(rangstr)) { if (!string.IsNullOrEmpty(strCondition)) @@ -55,7 +55,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL static public string GetDataListStr(string strCondition, string userid, string usercode, string companyid, string sort = null) { - var rangstr = ""; + var rangstr = GetRangDAStr("index", userid, usercode, companyid); if (!string.IsNullOrEmpty(rangstr)) { @@ -449,7 +449,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL strSql.Append("SELECT"); strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID"); strSql.Append(" from VW_User_Authority"); - strSql.Append(" where [NAME]='modOpOtherList' and USERID='" + userid + "' and ISDELETE=0"); + strSql.Append(" where [NAME]='modSaleRptList' and USERID='" + userid + "' and ISDELETE=0"); string visiblerange = "4"; string operaterange = "4"; @@ -469,22 +469,21 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL } if (visiblerange == "4") { - str = " (OP='" + username + "' OR CREATEUSER='" + userid + "' OR SALE='" + username + "' OR CUSTSERVICE='" + username + "')"; + str = " SALE='" + username + "'"; } else if (visiblerange == "3") { - str = " (OP='" + username + "' OR CREATEUSER='" + userid + "' OR SALE='" + username + "' OR CUSTSERVICE='" + username + "')"; + str = " SALE='" + username + "'"; } else if (visiblerange == "2") { var rangeDa = new RangeDA(); var deptname = rangeDa.GetDEPTNAME(userid); - str = " (OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))" - + " OR CREATEUSER in (select GID from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "')))"; + str = " SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"; } else if (visiblerange == "1") { - str = " (UPPER(op_other.Corpid)='" + companyid + "' or op_other.SALECORPID='" + companyid + "') "; + str = " SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') "; } else if (visiblerange == "5") { @@ -500,11 +499,11 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL { if (str == "") { - str = " (op_other.Corpid='" + Convert.ToString(reader["COMPANYID"]) + "' or op_other.SALECORPID='" + Convert.ToString(reader["COMPANYID"]) + "' "; + str = " (SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + Convert.ToString(reader["COMPANYID"]) + "') "; } else { - str = str + " or op_other.Corpid='" + Convert.ToString(reader["COMPANYID"]) + "' or op_other.SALECORPID='" + Convert.ToString(reader["COMPANYID"]) + "'"; + str = str + " or SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + Convert.ToString(reader["COMPANYID"]) + "')"; }; } str = str + ")"; @@ -513,7 +512,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL } else { - str = " (UPPER(op_other.Corpid)='" + companyid + "') "; + str = " SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') "; } } @@ -546,7 +545,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSaleRptDAL reader.Close(); } if (opstr == "") opstr = "('" + username + "')"; - str = " (OP in " + opstr + " or CREATEUSER in " + opstr + " or CUSTSERVICE IN " + opstr + " or SALE IN " + opstr + " )"; + str = " (OP in " + opstr + " )"; } else diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpVgmSend/MsOpVgmSendDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpVgmSend/MsOpVgmSendDAL.cs new file mode 100644 index 00000000..7eb381d0 --- /dev/null +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpVgmSend/MsOpVgmSendDAL.cs @@ -0,0 +1,415 @@ +using System; +using System.Data; +using System.Data.Common; +using System.Collections.Generic; +using System.Text; +using DSWeb.MvcShipping.Models.MsOpVgmSend; +using Microsoft.Practices.EnterpriseLibrary.Data; +using DSWeb.EntityDA; +using DSWeb.Areas.CommMng.Models; +using HcUtility.Comm; +using DSWeb.MvcShipping.Models.MsOpPrice; + +namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL +{ + public class MsOpVgmSendDAL + { + #region Inquery DataList + static public List GetDataList(string strCondition, string userid, string usercode, string companyid, string sort = null) + { + var rangstr = GetRangDAStr("index", userid, usercode, companyid); + if (!string.IsNullOrEmpty(rangstr)) + { + if (!string.IsNullOrEmpty(strCondition)) + { + strCondition = strCondition + " and " + rangstr; + } + else + { + strCondition = rangstr; + } + } + // + String strSql = "SELECT *,(select top 1 showname from [user] where GID=op_seae_vgm_send.SENDERUSER) as SENDERUSERREF FROM op_seae_vgm_send "; + if (!string.IsNullOrEmpty(strCondition)) + { + strSql += " where " + strCondition; + } + var sortstring = DatasetSort.Getsortstring(sort); + if (!string.IsNullOrEmpty(sortstring)) + { + strSql += " order by " + sortstring; + } + else + { + strSql += " order by ETD desc"; + } + return SetData(strSql); + } + + static public string GetDataListStr(string strCondition, string userid, string usercode, string companyid, string sort = null) + { + var rangstr = GetRangDAStr("index", userid, usercode, companyid); + + if (!string.IsNullOrEmpty(rangstr)) + { + if (!string.IsNullOrEmpty(strCondition)) + { + strCondition = strCondition + " and " + rangstr; + } + else + { + strCondition = rangstr; + } + } + // + String strSql = "SELECT *,(select top 1 showname from [user] where GID=op_seae_vgm_send.SENDERUSER) as SENDERUSERREF FROM op_seae_vgm_send "; + if (!string.IsNullOrEmpty(strCondition)) + { + strSql += " where " + strCondition; + } + var sortstring = DatasetSort.Getsortstring(sort); + if (!string.IsNullOrEmpty(sortstring)) + { + strSql += " order by " + sortstring; + } + else + { + strSql += " order by ETD desc"; + } + return strSql.ToString(); + } + + static public MsOpVgmSend GetData(string condition) + { + String strSql = "SELECT *,(select top 1 showname from [user] where GID=op_seae_vgm_send.SENDERUSER) as SENDERUSERREF FROM op_seae_vgm_send "; + if (!string.IsNullOrEmpty(condition)) + { + strSql += " where " + condition; + } + var list=SetData(strSql); + if (list.Count > 0) + { + return list[0]; + } + return new MsOpVgmSend(); + } + + + + + private static List SetData(String strSql) + { + var headList = new List(); + Database db = DatabaseFactory.CreateDatabase(); + using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) + { + while (reader.Read()) + { + MsOpVgmSend data = new MsOpVgmSend(); + #region Set DB data to Object + data.GID = Convert.ToString(reader["GID"]); + data.BSNO = Convert.ToString(reader["BSNO"]); + data.VGMSTATUS = Convert.ToString(reader["VGMSTATUS"]); + data.MBLNO = Convert.ToString(reader["MBLNO"]); + data.CUSTNO = Convert.ToString(reader["CUSTNO"]); + data.CARRIER = Convert.ToString(reader["CARRIER"]); + data.LOADPORT = Convert.ToString(reader["LOADPORT"]); + data.MATOU = Convert.ToString(reader["MATOU"]); + data.VESSEL = Convert.ToString(reader["VESSEL"]); + data.VOYNO = Convert.ToString(reader["VOYNO"]); + data.VGM_TIME = Convert.ToString(reader["VGM_TIME"]); + data.SENDERUSER = Convert.ToString(reader["SENDERUSER"]); + data.SENDERUSERREF = Convert.ToString(reader["SENDERUSERREF"]); + if (reader["CTNNUM"] != DBNull.Value) + data.CTNNUM = Convert.ToInt16(reader["CTNNUM"]); + if (reader["ISCARRIER"] != DBNull.Value) + data.ISCARRIER = Convert.ToBoolean(reader["ISCARRIER"]); + if (reader["ISYGT"] != DBNull.Value) + data.ISYGT = Convert.ToBoolean(reader["ISYGT"]); + + if (reader["SENDTIME"] != DBNull.Value) + data.SENDTIME = Convert.ToDateTime(reader["SENDTIME"]); + + + + #endregion + headList.Add(data); + } + reader.Close(); + } + return headList; + } + + + #endregion + + #region 明细表 + + static public List GetVgmCtnList(string strCondition, string sort = null) + { + + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append("*"); + strSql.Append(" from op_seae_vgm_ctn "); + + if (!string.IsNullOrEmpty(strCondition)) + { + strSql.Append(" WHERE " + strCondition); + } + var sortstring = DatasetSort.Getsortstring(sort); + if (!string.IsNullOrEmpty(sortstring)) + { + strSql.Append(" order by " + sortstring); + } + else + { + strSql.Append(" order by CTNALL "); + + } + + return SetVgmCtnData(strSql); + } + + private static List SetVgmCtnData(StringBuilder strSql) + { + var headList = new List(); + Database db = DatabaseFactory.CreateDatabase(); + using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) + { + while (reader.Read()) + { + MsOpVgmCtn data = new MsOpVgmCtn(); + #region Set DB data to Object + data.CTN_ID = Convert.ToString(reader["CTN_ID"]); + data.BSNO = Convert.ToString(reader["BSNO"]); + data.CTNALL = Convert.ToString(reader["CTNALL"]); + data.SENDGID = Convert.ToString(reader["SENDGID"]); + data.CNTRNO = Convert.ToString(reader["CNTRNO"]); + data.SEALNO = Convert.ToString(reader["SEALNO"]); + data.WEIGHTYPE = Convert.ToString(reader["WEIGHTYPE"]); + data.YARD = Convert.ToString(reader["YARD"]); + data.WEIGHDATE = Convert.ToString(reader["WEIGHDATE"]); + if (reader["KGS"] != DBNull.Value) + data.KGS = Convert.ToDecimal(reader["KGS"]);// + + if (reader["TAREWEIGHT"] != DBNull.Value) + data.TAREWEIGHT = Convert.ToDecimal(reader["TAREWEIGHT"]);// + if (reader["VGMKGS"] != DBNull.Value) + data.VGMKGS = Convert.ToDecimal(reader["VGMKGS"]);// + + #endregion + headList.Add(data); + } + reader.Close(); + } + return headList; + } + + + + + + public static DBResult SaveDetail(string LE_ID, List bodyList) + { + var result = new DBResult(); + Database db = DatabaseFactory.CreateDatabase(); + using (var conn = db.CreateConnection()) + { + conn.Open(); + var tran = conn.BeginTransaction(); + try + { + var cmddelete = db.GetSqlStringCommand(@"delete from op_seae_vgm_ctn where SENDGID='" + LE_ID + "'"); + db.ExecuteNonQuery(cmddelete, tran); + + var cntr = ""; + if (bodyList != null) + { + foreach (var enumValue in bodyList) + { + var cmdInsert = db.GetSqlStringCommand(@"insert into op_seae_vgm_ctn ([CTN_ID],[BSNO],[SENDGID],[CTNALL],[CNTRNO],[SEALNO],[KGS],[TAREWEIGHT],[WEIGHTYPE],[VGMKGS],[YARD],[WEIGHDATE]) + values (NEWID(),'" + enumValue.BSNO + "','" + LE_ID + "','" + enumValue.CTNALL + "','" + enumValue.CNTRNO + "','" + enumValue.SEALNO + "'," + enumValue.KGS + "," + enumValue.TAREWEIGHT + ",'" + enumValue.WEIGHTYPE + "'," + enumValue.VGMKGS + ",'" + enumValue.YARD + "','" + enumValue.WEIGHDATE + "')"); + db.ExecuteNonQuery(cmdInsert, tran); + + } + } + + tran.Commit(); + } + catch (Exception) + { + tran.Rollback(); + result.Success = false; + result.Message = "保存出现错误,请重试或联系系统管理员"; + return result; + } + } + + result.Success = true; + result.Message = "保存成功" + result.Message; + return result; + } + + + #endregion + + + + #region 判断编码是否有重复 + static public int GetRdCount(string strCondition) + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(" Count(BSNO) AS CT "); + strSql.Append(" from op_seae_pre "); + if (strCondition.Trim() != String.Empty) + { + strSql.Append(" where " + strCondition); + } + var ct=0; + Database db = DatabaseFactory.CreateDatabase(); + using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) + { + while (reader.Read()) + { + + ct = Convert.ToInt16(reader["CT"]); + + } + reader.Close(); + } + return ct; + } + #endregion + + + + + + #region Rang权限范围 + public static string GetRangDAStr(string tb, string userid, string username, string companyid) + { + string str = ""; + var strSql = new StringBuilder(); + strSql.Append("SELECT"); + strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID"); + strSql.Append(" from VW_User_Authority"); + strSql.Append(" where [NAME]='modSaleRptList' and USERID='" + userid + "' and ISDELETE=0"); + + string visiblerange = "4"; + string operaterange = "4"; + string AUTHORITYID = ""; + + Database db = DatabaseFactory.CreateDatabase(); + using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) + { + while (reader.Read()) + { + visiblerange = Convert.ToString(reader["VISIBLERANGE"]); + operaterange = Convert.ToString(reader["OPERATERANGE"]); + AUTHORITYID = Convert.ToString(reader["AUTHORITYID"]); + break; + } + reader.Close(); + } + if (visiblerange == "4") + { + str = " SALE='" + username + "'"; + } + else if (visiblerange == "3") + { + str = " SALE='" + username + "'"; + } + else if (visiblerange == "2") + { + var rangeDa = new RangeDA(); + var deptname = rangeDa.GetDEPTNAME(userid); + str = " SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"; + } + else if (visiblerange == "1") + { + str = " SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') "; + } + else if (visiblerange == "5") + { + if (tb == "index") + { + var userstr = new StringBuilder(); + userstr.Append(" select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1"); + Database userdb = DatabaseFactory.CreateDatabase(); + using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString())) + { + str = ""; + while (reader.Read()) + { + if (str == "") + { + str = " (SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + Convert.ToString(reader["COMPANYID"]) + "') "; + } + else + { + str = str + " or SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + Convert.ToString(reader["COMPANYID"]) + "')"; + }; + } + str = str + ")"; + reader.Close(); + } + } + else + { + str = " SALE in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') "; + } + + } + else if (visiblerange == "6") + { + if (tb == "index") + { + var opstr = ""; + var userstr = new StringBuilder(); + userstr.Append(" select OPID,(select SHOWNAME from [user] where GID=user_authority_range_op.OPID) SHOWNAME from user_authority_range_op where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1"); + Database userdb = DatabaseFactory.CreateDatabase(); + using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString())) + { + + while (reader.Read()) + { + + + if (opstr == "") + { + opstr = " ('" + Convert.ToString(reader["SHOWNAME"]) + "'"; + } + else + { + opstr = opstr + ",'" + Convert.ToString(reader["SHOWNAME"]) + "'"; + }; + } + + if (opstr != "") opstr = opstr + ")"; + reader.Close(); + } + if (opstr == "") opstr = "('" + username + "')"; + str = " (OP in " + opstr + " )"; + + } + else + { + str = " (UPPER(op_other.Corpid)='" + companyid + "') "; + } + + } + + else if (visiblerange == "0") + { + str = " 1=1 "; + } + return str; + } + #endregion + + + } +} diff --git a/DSWeb/Areas/MvcShipping/Models/MsOpVgmSend/MsOpVgmSend.cs b/DSWeb/Areas/MvcShipping/Models/MsOpVgmSend/MsOpVgmSend.cs new file mode 100644 index 00000000..e941efe9 --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Models/MsOpVgmSend/MsOpVgmSend.cs @@ -0,0 +1,158 @@ +using System; +using HcUtility.Core; +using Newtonsoft.Json; + +namespace DSWeb.MvcShipping.Models.MsOpVgmSend +{ + [JsonObject] + public class MsOpVgmSend : ModelObjectBillHead + { + #region 属性 + private string _GID = "topseaevgm" + Guid.NewGuid().ToString();//业务编号 + /// + /// 业务唯一编号 + /// + [ModelDB(MDBType = ModelDBOprationType.All, IsPrimary = true)] + public string GID + { + get { return _GID; } + set { _GID = value; } + } + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string BSNO { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string MBLNO{ get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string CUSTNO { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string CARRIER { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string LOADPORT { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string MATOU { get; set; } + [ModelDB] + public string VGMSTATUS { get; set; } + [ModelDB] + public bool ISCARRIER { get; set; } + [ModelDB] + public bool ISYGT { get; set; } + [ModelDB] + public string SENDTYPE { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string VESSEL { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string VOYNO { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string VGM_TIME { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public int CTNNUM { get; set; } + + private string _createuser = ""; + /// + /// 创建人 + /// + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string SENDERUSER + { + get { return _createuser; } + set { _createuser = value; } + } + + public string SENDERUSERREF { get; set; } + + private DateTime _createtime = DateTime.Now; + /// + /// 创建时间 + /// + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public DateTime SENDTIME + { + get { return _createtime; } + set { _createtime = value; } + } + + #endregion + + public MsOpVgmSend() + { + TableName = "op_seae_vgm_send"; + } + + override public string GetBillNoFieldName() + { + return "BSNO"; + } + } + + + [JsonObject] + public class MsOpVgmCtn : ModelObjectBillHead + { + #region 属性 + private string _GID = "topseaevgm" + Guid.NewGuid().ToString();//业务编号 + /// + /// 业务唯一编号 + /// + [ModelDB(MDBType = ModelDBOprationType.All, IsPrimary = true)] + public string CTN_ID + { + get { return _GID; } + set { _GID = value; } + } + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string BSNO { get; set; } + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string SENDGID { get; set; } + + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string CTNALL { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string CNTRNO { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public string SEALNO { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public decimal KGS { get; set; } + + [ModelDB(MDBType = ModelDBOprationType.Insert)] + public decimal TAREWEIGHT { get; set; } + [ModelDB] + public string WEIGHTYPE { get; set; } + [ModelDB] + public decimal VGMKGS { get; set; } + + [ModelDB] + public string YARD { get; set; } + [ModelDB] + public string WEIGHDATE { get; set; } + + + + #endregion + + public MsOpVgmCtn() + { + TableName = "op_seae_vgm_ctn"; + } + + override public string GetBillNoFieldName() + { + return "BSNO"; + } + } + + + +} diff --git a/DSWeb/Areas/MvcShipping/Views/MsOpVgmSend/Edit.aspx b/DSWeb/Areas/MvcShipping/Views/MsOpVgmSend/Edit.aspx new file mode 100644 index 00000000..47d208de --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Views/MsOpVgmSend/Edit.aspx @@ -0,0 +1,37 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/MvcShipping/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> + + + + + + + + + + + + + + + + +
+
diff --git a/DSWeb/Areas/MvcShipping/Views/MsOpVgmSend/Index.aspx b/DSWeb/Areas/MvcShipping/Views/MsOpVgmSend/Index.aspx new file mode 100644 index 00000000..2670c4cd --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Views/MsOpVgmSend/Index.aspx @@ -0,0 +1,35 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/MvcShipping/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> + + + + + + + + + + + + + + +
+
diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpRailway/MsOpRailwayIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpRailway/MsOpRailwayIndex.js index 0693a55f..ac788aa4 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpRailway/MsOpRailwayIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpRailway/MsOpRailwayIndex.js @@ -1478,6 +1478,7 @@ Ext.extend(Shipping.MsOpRailwayIndex, Ext.Panel, { var sql = this.getCondition(); this.sqlcontext = sql; this.PageSize = this.Pagenum.getValue(); + this.storeList.currentPage = 1; this.storeList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: sql }, waitMsg: "正在查询数据...", @@ -1490,6 +1491,7 @@ Ext.extend(Shipping.MsOpRailwayIndex, Ext.Panel, { //var girdcolums = this.gridList.getColumnMode(); var sql = this.sqlcontext; this.PageSize = this.Pagenum.getValue(); + this.storeList.currentPage = 1; this.storeList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: sql }, waitMsg: "正在查询数据...", diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpRailway/MsOpRailwaySZIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpRailway/MsOpRailwaySZIndex.js index a8de1ce3..36436c3f 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpRailway/MsOpRailwaySZIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpRailway/MsOpRailwaySZIndex.js @@ -1245,6 +1245,8 @@ Ext.extend(Shipping.MsOpRailwayIndex, Ext.Panel, { var sql = this.getCondition(); this.sqlcontext = sql; this.PageSize = this.Pagenum.getValue(); + this.storeList.currentPage = 1; + this.storeList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: sql }, waitMsg: "正在查询数据...", diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSaleRpt/MsOpSaleRptIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSaleRpt/MsOpSaleRptIndex.js index f462cee3..93d36470 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSaleRpt/MsOpSaleRptIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSaleRpt/MsOpSaleRptIndex.js @@ -24,7 +24,8 @@ Ext.extend(Shipping.MsOpSaleRptIndex, Ext.Panel, { this.REMARK =''; this.OTREMARK = ''; this.BsNo = ''; - this.modOpSaleRptAdd =0; + this.modOpSaleRptAdd = 0; + this.modOpSaleRptReadOnly = 0; this.storePLList = Ext.create('Ext.data.Store', { model: 'MsOpSaleRpt' @@ -598,7 +599,8 @@ Ext.extend(Shipping.MsOpSaleRptIndex, Ext.Panel, { btnEdit.setVisible(false); var btnEdit = Ext.getCmp('btnsave'); btnEdit.setVisible(true); - _thisSaleRpt.sqlcontext = " SALE='" + SHOWNAME + "'"; + _thisSaleRpt.sqlcontext = " SALE='" + SHOWNAME + "' and RPTSTATUS='发布' "; + _thisSaleRpt.onDsQuery(); } else { @@ -624,6 +626,28 @@ Ext.extend(Shipping.MsOpSaleRptIndex, Ext.Panel, { scope: this }); + Ext.Ajax.request({ + waitMsg: '', + url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', + params: { + modulename: "modOpSaleRptReadOnly" + }, + callback: function (options, success, response) { + if (success) { + var result = Ext.JSON.decode(response.responseText); + if (result.Success != true) { + + } else { + _thisSaleRpt.modOpSaleRptReadOnly = 1; + + } + } else { + + } + }, + scope: this + }); + }, //end initUIComponents @@ -972,6 +996,12 @@ Ext.extend(Shipping.MsOpSaleRptIndex, Ext.Panel, { Ext.Msg.show({ title:'提示', msg:'当前状态不允许修改!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法修改! canedit = false; } + if (_thisSaleRpt.modOpSaleRptReadOnly == 1) { + + Ext.Msg.show({ title: '提示', msg: '没有修改权限!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法修改! + canedit = false; + } + return canedit; }, @@ -985,7 +1015,7 @@ Ext.extend(Shipping.MsOpSaleRptIndex, Ext.Panel, { var sql = ''; if (_thisSaleRpt.modOpSaleRptAdd == '0') { - sql = " SALE='" + SHOWNAME + "'" + sql = " RPTSTATUS='发布' " } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js index 250cc9aa..d0e78100 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js @@ -18895,7 +18895,15 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { //#region 东胜VGM onCreateDSVGMClick: function (menu, event) { - this.winDSVGMShow.show(); + + var BSNO = this.formHead.getForm().findField('BSNO').getValue(); + var openSet = "height=300, width=900, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 300) / 2 + ",Left= " + (screen.width - 900) / 2 + var openType = "_blank"; + var openUrl = ""; + openUrl = "../../MvcShipping/MsOpVgmSend/Edit?handle=check&bsno="+BSNO; + window.open(openUrl, openType, openSet); + +// this.winDSVGMShow.show(); }, onSendDSVGM: function (mblno, userid, type) { var BSNO = this.formHead.getForm().findField('BSNO').getValue(); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/Edit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/Edit.js new file mode 100644 index 00000000..a540cd62 --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/Edit.js @@ -0,0 +1,26 @@ + +Ext.BLANK_IMAGE_URL = '../../TruckMng/Content/Images/s.gif'; +var panelEdit = null; +Ext.onReady(function () { + Ext.QuickTips.init(); + Ext.form.Field.prototype.msgTarget = 'side'; + + panelEdit = Ext.create('Shipping.MsOpVgmSendEdit', { + id:'OpPriceEdit', + layout: 'border', + region: 'center' }); + + + var view = new Ext.Viewport({ + layout: 'border', + renderTo: 'viewport', + border: false, + items: [ + panelEdit + ] + }); +}); + +function getSaved() { + return panelEdit.getIsModify(); +} \ No newline at end of file diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/Index.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/Index.js new file mode 100644 index 00000000..a8f35577 --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/Index.js @@ -0,0 +1,31 @@ +Ext.BLANK_IMAGE_URL = '../../TruckMng/Content/Images/s.gif'; +var panelIndex = null; +Ext.onReady(function () { + Ext.QuickTips.init(); + Ext.form.Field.prototype.msgTarget = 'side'; + + panelIndex = new window.Shipping.MsOpSaleRptIndex({ + layout: 'border' + }); + + var view = new Ext.Viewport({ + layout: 'border', + renderTo: 'viewport', + border: false, + items: [{ + region: 'center', + layout: 'fit', + items: [panelIndex] + }] + }); + + +}); + +function OprationSwap() { + return panelIndex.OprationSwap(); +} + +function AddNewRecord(record) { + panelIndex.AddNewRecord(record); +} diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendEdit.js new file mode 100644 index 00000000..f7f85762 --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendEdit.js @@ -0,0 +1,617 @@ +Ext.namespace('Shipping'); + +Shipping.MsOpVgmSendEdit = function (config) { + Ext.applyIf(this, config); + this.initUIComponents(); + window.Shipping.MsOpVgmSendEdit.superclass.constructor.call(this); +}; + +Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, { + + ParentWin: null, + OpStatus: 'add', + StoreList: null, + EditRecord: null, + + initUIComponents: function () { + this.serialNo = 0; + this.workSerialNo = 0; + this.bodyDel = []; + + //#region 编辑form + + //枚举参照相关(编辑form) + + //客户加载_委托单位 + //客户加载_船公司 + this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsShipping.ux.CustomRefModel', + proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' } + }); + + this.storeCARRIER.load(); + + //船公司 + this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', { + fieldLabel: '船公司', //'船公司', + store: this.storeCARRIER, + forceSelection: true, + queryMode: 'remote', + minChars: 0, + queryParam: 'CODENAME', + name: 'CARRIER', + valueField: 'CustName', + displayField: 'CodeAndName' + }); + + this.storeLOADPORT = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsExtEnumModel', + proxy: { url: '/CommMng/PubSys/GetEnumValueList' } + }); + this.storeLOADPORT.load({ params: { enumTypeId: 96303 } }); + + this.comboxLOADPORT = Ext.create('DsExt.ux.RefTableCombox', { + fieldLabel:'口岸', + flex: 1, + store: this.storeLOADPORT, + name: 'LOADPORT', + valueField: 'EnumValueName', + displayField: 'EnumValueName' + }); + + this.storeMATOU = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsExtEnumModel', + proxy: { url: '/CommMng/PubSys/GetEnumValueList' } + }); + this.storeMATOU.load({ params: { enumTypeId: 96304 } }); + + this.comboxMATOU = Ext.create('DsExt.ux.RefTableCombox', { + fieldLabel:'码头', + flex: 2, + store: this.storeMATOU, + name: 'PKGTYPE', + valueField: 'EnumValueName', + displayField: 'EnumValueName' + }); + + + this.storeCtnList = Ext.create('Ext.data.Store', { + model: 'MsOpVgmCtn', + remoteSort: true, + proxy: { + type: 'ajax', + url: '/MvcShipping/MsOpVgmSend/GetVgmCtnList', + reader: { + id: 'ID', + root: 'data', + totalProperty: 'totalCount' + } + } + }); + //箱型_集装箱列表中的下拉框加载 + this.storeCodeCtn = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsShipping.ux.CodeCtnModel', + proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' } + }); + this.storeCodeCtn.load(); + this.comboxCTNALL = Ext.create('DsExt.ux.RefTableCombox', { + store: this.storeCodeCtn, + forceSelection: true, + name: 'CTNALL', + valueField: 'CTN', + displayField: 'CTN' + }); + + //客户加载_场站 + this.storeYARD = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsShipping.ux.CustomRefModel', + proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListYARD' } + }); + // this.storeYARD.loadData(this.mainWin.GetPubStore("OPSEAE_YARD").data.items); + this.storeYARD.load(); + // + this.comboxYARD = Ext.create('DsExt.ux.RefTableCombox', { + store: this.storeYARD, + forceSelection: true, + queryMode: 'remote', + minChars: 1, + queryParam: 'CODENAME', + name: 'YARD', + valueField: 'CustName', + displayField: 'CodeAndName' + }); + + //集装箱_称重方式 + this.StoreWEIGHTYPE = Ext.create('Ext.data.Store', { + fields: ['NAME'] + }); + this.StoreWEIGHTYPE.add({ "NAME":'SM2' }); + this.StoreWEIGHTYPE.add({ "NAME":'SM1' }); + this.StoreWEIGHTYPE.add({ "NAME": "" }); + this.comboxWEIGHTYPE = Ext.create('DsExt.ux.RefTableCombox', { + store: this.StoreWEIGHTYPE, + forceSelection: true, + name: 'WEIGHTYPE', + valueField: 'NAME', + displayField: 'NAME' + }); + + this.gridListCellEditing = Ext.create('Ext.grid.plugin.CellEditing', { + clicksToEdit: 1 + }); + this.CtnGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); + this.gridList = new Ext.grid.GridPanel({ + store: this.storeCtnList, + enableHdMenu: false, + region: 'center', + loadMask: { msg: "数据加载中,请稍等..." }, + trackMouseOver: true, + disableSelection: false, + plugins: [this.gridListCellEditing], + selModel: this.CtnGridCheckBoxModel, + selType: 'cellmodel', + columns: [{ + sortable: true, + dataIndex: 'CTN_ID', + header: 'CTN_ID', //'编号', + hidden: true, + width: 0 + }, { + sortable: true, + dataIndex: 'BSNO', + header: 'BSNO', //'业务编号', + hidden: true, + width: 0 + }, { + sortable: true, + dataIndex: 'SENDGID', + header: 'SENDGID', //'业务编号', + hidden: true, + width: 0 + }, + { + dataIndex: 'CTNALL', + header: '箱型', //'箱型', + width: 65, + editor: this.comboxCTNALL + }, { + dataIndex: 'CNTRNO', + header: '箱号', //'箱号', + width: 100, + editor: { + xtype: 'textfield', + selectOnFocus: true + }, + renderer: function (value, cellmeta) { + return value.trim(); + } + }, { + dataIndex: 'SEALNO', + header: '封号', //'封号', + width: 100, + editor: { + xtype: 'textfield', + selectOnFocus: true + } + }, { + dataIndex: 'KGS', + header:'毛重', //'重量', + width: 80, + editor: { + xtype: 'textfield', + selectOnFocus: true + } + }, { + dataIndex: 'TAREWEIGHT', + header: '箱皮重', //'箱皮重', + width: 80, + editor: { + xtype: 'textfield', + selectOnFocus: true + } + }, { + dataIndex: 'WEIGHTYPE', + header: '称重方式', //'称重方式', + width: 80, + editor: this.comboxWEIGHTYPE + }, { + dataIndex: 'VGMKGS', + header: 'VGM重量', //'参考重量', + width: 80, + renderer: function (value, meta, record) { + return Add(record.data.KGS, record.data.TAREWEIGHT); + + } + }, { + dataIndex: 'WEIGHDATE', + header: '称重时间', //'箱皮重', + width: 80, + editor: { + xtype: 'textfield', + selectOnFocus: true + } + }, { + dataIndex: 'YARD', + header:'场站', //'箱状态', + width: 100, + editor: this.comboxYARD + }] + }); + + this.panelBodyCtn = new Ext.Panel({ + layout: "border", + height: 150, + //margin: '5 10', + frame: true, + items: [this.gridList] + }); + + + //表参照相关(编辑form) + + + + //编辑form + this.formEdit = Ext.widget('form', { + region: 'center', + frame: true, + bodyPadding: 5, + autoScroll: true, + fieldDefaults: { + margins: '2 2 2 2', + labelAlign: 'right', + flex: 1, + labelWidth: 90, + msgTarget: 'qtip' + }, + + items: [ + {//fieldset 1 + xtype: 'fieldset', + defaultType: 'textfield', + layout: 'anchor', + defaults: { + anchor: '100%' + }, + items: [{ + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + fieldLabel: 'GID', + name: 'GID', flex: 0, hidden: true, margins: '0' + }, { + fieldLabel: 'BSNO', + name: 'BSNO', flex: 0, hidden: true, margins: '0' + },{ + fieldLabel: '船名', + name: 'VESSEL' + },{ + fieldLabel: '航次', + name: 'VOYNO' + }, { + fieldLabel: '订舱编号', + name: 'CUSTNO' + }, { + fieldLabel: '截至日期', + format: 'Y-m-d', + flex: 1, + xtype: 'datefield', + name: 'VGM_TIME' + }] + }, { + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [this.comboxCARRIER, this.comboxLOADPORT, this.comboxMATOU] + + }, { + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + fieldLabel: '备注', + name: 'REMARK' + }] + + }, this.panelBodyCtn + ]//end items(fieldset 1) + }//end fieldset 1 + ]//end root items + }); //end this.formEdit + + //#endregion + + //按钮Toolbar + this.panelBtn = new Ext.Panel({ + region: "south", + fbar: [ { + text: "关闭", + handler: function (button, event) { + window.close(); + }, + scope: this + }, { + text: "发送历史", + handler: function (button, event) { + this.LoadData('add', ''); + }, + scope: this + }, '-', { + text: "发送", + handler: function (button, event) { + this.winVGMShow.show(); + }, + scope: this + }] + }); //end 按钮Toolbar + + + //#region 布局 + //控件布局 + this.panelTop = new Ext.Panel({ + layout: "border", + region: "north", + height: 310, + items: [this.formEdit, this.panelBtn] + }); + + Ext.apply(this, { + items: [this.panelTop] + }); + + //#endregion + + //绑定查询窗体 + this.ParentWin = window.parent.opener; + + //初始化数据 + this.InitData(); + + //#region 东胜VGM + + this.formVGMShow = Ext.widget('form', { + frame: true, + region: 'center', + bodyPadding: 5, + fieldDefaults: { + margins: '2 2 2 2', + labelAlign: 'right', + flex: 1, + labelWidth: 90, + msgTarget: 'qtip' + }, + items: [{ + xtype: 'container', + defaultType: 'textfield', + layout: 'anchor', + defaults: { anchor: '100%' }, + items: [{ + xtype: 'checkboxgroup', + fieldLabel: '发送方', //'文件功能', + items: [{ + xtype: "checkbox", //checkbox控件 + name: "ISCARRIER", + boxLabel: "", + fieldLabel: "船公司", + inputValue: true, //选中的值 + uncheckedValue: false, //未选中的值 + checked: true //绘制时的选中状态 + }, { + xtype: "checkbox", //checkbox控件 + name: "ISYGT", + boxLabel: "", + fieldLabel: "运港通", + inputValue: true, //选中的值 + uncheckedValue: false, //未选中的值 + checked: true //绘制时的选中状态 + }] + },{ + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [{ + xtype: 'radiogroup', + fieldLabel:'操作类型', //'文件功能', + id: 'vGMFILEROLE', + defaults: { flex: 1 }, + layout: 'hbox', + items: [{ + boxLabel: "新增", //'原始', + name: 'FILEROLE', + inputValue: '9', + checked: true + }, { + boxLabel: "修改", //'更新', + name: 'FILEROLE', + inputValue: '5' + }, { + boxLabel: "取消", //'删除', + name: 'FILEROLE', + inputValue: '1' + }] + }] + } + ]//end items(fieldset 1) + }]//end root items + }); + me = this; + this.winVGMShow = Ext.create('Ext.window.Window', { + title: "东胜VGM", //"生成宁波电子口岸报文", + width: 450, + //height : 120, + //plain : true, + iconCls: "addicon", + resizable: false, + // 是否可以拖动 + // draggable:false, + collapsible: true, // 允许缩放条 + closeAction: 'close', + closable: true, + modal: 'true', + buttonAlign: "center", + bodyStyle: "padding:0 0 0 0", + items: [this.formVGMShow], + buttons: [{ + text: "发送VGM", //"生成并发送VGM报文", + minWidth: 70, + handler: function () { + var MBLNO = me.formHead.getForm().findField('MBLNO').value; + var cgFILEROLE = Ext.getCmp('vGMFILEROLE'); + var FILEROLE = cgFILEROLE.getValue(); + + me.onSendVGM(MBLNO, USERID, FILEROLE); + } + }, { + text: "关闭", //"关闭", + minWidth: 70, + handler: function () { + me.winVGMShow.close(); + } + }] + }); + //#endregion + + + //绑定事件 + + }, //end initUIComponents + + InitData: function () { + //this.opStatus = 'add'; + //var condition = ''; + //if (this.ParentWin) { + // var ret = this.ParentWin.OprationSwap(); + // this.opStatus = ret[0]; + // this.StoreList = ret[1]; + // this.editRecord = ret[2]; + //} + + //if (this.opStatus == 'edit') + // condition = " GID='" + this.editRecord.get('GID') + "'"; + + //this.LoadData(this.opStatus, condition); + + }, //end InitData + + LoadData: function (opstatus, condition) { + this.serialNo = 0; + this.workSerialNo = 0; + this.bodyDel = []; + + this.opStatus = opstatus; + Ext.Ajax.request({ + waitMsg: '正在查询主表数据...', + url: '/MvcShipping/MsCodeFactry/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; + } + + var data = result.data; + this.formEdit.getForm().reset(); + this.formEdit.getForm().setValues(data); + + } else { + Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); + } + }, + scope: this + }); + + + }, // end LoadDate + + + Save: function (type) { + var basicForm = this.formEdit.getForm(); + + if (!basicForm.isValid()) { + return; + } + + + + basicForm.findField('GID').setDisabled(false); + var data = basicForm.getValues(); + basicForm.findField('GID').setDisabled(true); + if (this.opStatus == 'add') { + data.GID = NewGuid(); + } + + + Ext.Msg.wait('正在保存数据, 请稍侯..'); + Ext.Ajax.request({ + waitMsg: '正在保存数据...', + url: '/MvcShipping/MsCodeFactry/Save', + scope: this, + params: { + opstatus: this.opStatus, + data: Ext.JSON.encode(data) + }, + callback: function (options, success, response) { + if (success) { + Ext.MessageBox.hide(); + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + var returnData = jsonresult.Data; + this.formEdit.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('MsCodeFactry', 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'; + + basicForm.findField('GID').setDisabled(true); + + + } else if (type == '1') { + window.close(); + } else { + this.LoadData('add', ''); + basicForm.findField('GID').setDisabled(false); + } + } 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 + }); + } + } + }); + } //end save + + + +}); + + diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendIndex.js new file mode 100644 index 00000000..f6d2acd0 --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendIndex.js @@ -0,0 +1,1216 @@ +Ext.namespace('Shipping'); + +Shipping.MsOpVgmSendIndex = function (config) { + Ext.applyIf(this, config); + this.initUIComponents(); + window.Shipping.MsOpVgmSendIndex.superclass.constructor.call(this); +}; + +Ext.extend(Shipping.MsOpVgmSendIndex, Ext.Panel, { + PageSize: 30, + OprationStatus: null, //仅当弹出界面时使用 + SelectedRecord: null, + sqlcontext: '', + selectbsno: '', + sortfield: '', + sortdire: '', + + + initUIComponents: function () { + this.formname = "MsOpVgmSendIndex"; //页面名称 + //定义数据集 + + this.AMOUNT = 0; + this.REMARK =''; + this.OTREMARK = ''; + this.BsNo = ''; + this.modOpSaleRptAdd = 0; + this.modOpSaleRptReadOnly = 0; + + this.storePLList = Ext.create('Ext.data.Store', { + model: 'MsOpSaleRpt' + }); + + this.storeList = Ext.create('Ext.data.Store', { + pageSize: this.PageSize, + model: 'MsOpSaleRpt', + remoteSort: true, + proxy: { + type: 'ajax', + url: '/MvcShipping/MsOpSaleRpt/GetDataList', + reader: { + id: 'BSNO', + root: 'data', + totalProperty: 'totalCount' + } + } + }); + + Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, { + width: 50 + }); + + _thisSaleRpt = this; + + this.Pagenum = Ext.create('Ext.form.field.Number', { + name: 'bottles', + fieldLabel: '每页记录数', + labelAlign: 'right', + value: this.PageSize, + maxValue: 100000, + width: 180, + minValue: 0, + listeners: { + specialkey: function (field, e) { + if (e.getKey() == e.ENTER) { + _this.onRefreshClick(); + } + } + } + }); + + this.initgirdcolums = [{ + sortable: true, + dataIndex: 'GID', + header: '业务编号', + hidden: true, + width: 80 + }, { + sortable: true, + dataIndex: 'BSNO', + header: '业务编号', + hidden: true, + width: 80 + }, { + sortable: true, + dataIndex: 'RPTSTATUS', + header: '状态', + width: 80 + }, { + sortable: true, + dataIndex: 'CUSTOMERNAME', + header: '客户名称', + width: 80 + }, { + sortable: true, + dataIndex: 'MBLNO', + header: '主提单号', + width: 80 + }, { + sortable: true, + dataIndex: 'ACCDATE', + header: '会计期间', + width: 80 + }, { + sortable: true, + dataIndex: 'SALE', + header: '销售', + width: 80 + }, { + sortable: true, + dataIndex: 'ETD', + header: '开船日期', + width: 80 + }, { + sortable: true, + dataIndex: 'STLDATE', + header: '应结日期', + width: 80 + }, { + sortable: true, + dataIndex: 'NODAY', + header: '超期', + width: 80 + }, { + sortable: true, + dataIndex: 'REMARK', + header: '备注', + width: 200, //'备注', + editor: { + xtype: 'textfield', + selectOnFocus: true, + enableKeyEvents: true + }, + width: 150 + }, { + sortable: true, + dataIndex: 'PLANDATE', + header: '计划回收时间', + allowBlank: false, + editor: { + xtype: 'datefield', + format: 'Y-m-d', + selectOnFocus: true + }, + renderer: Ext.util.Format.dateRenderer('Y-m-d'), + width: 120 + }, { + sortable: true, + dataIndex: 'RMBDR', + header: 'RMB应收', + width: 80 + }, { + sortable: true, + dataIndex: 'USDDR', + header: 'USD应收', + width: 80 + }, { + sortable: true, + dataIndex: 'STLRMBDR', + header: 'RMB已收', + width: 80 + }, { + sortable: true, + dataIndex: 'STLUSDDR', + header: 'USD已收', + width: 80 + }, { + sortable: true, + dataIndex: 'BALRMBDR', + header: 'RMB未收', + width: 80 + }, { + sortable: true, + dataIndex: 'BALUSDDR', + header: 'USD未收', + width: 80 + }, { + sortable: true, + dataIndex: 'TTLBALDR', + header: '未收合计', + width: 80 + }, { + sortable: true, + dataIndex: 'CREATEUSER', + header: '创建人', + width: 80 + }, { + sortable: true, + dataIndex: 'CREATETIME', + header: '创建日期', + width: 80 + }, { + sortable: true, + dataIndex: 'MODIFIEDUSER', + header: '修改人', + width: 80 + }, { + sortable: true, + dataIndex: 'MODIFIEDTIME', + header: '修改日期', + width: 80 + }, { + sortable: true, + dataIndex: 'LOCKTIME', + header: '锁定时间', + width: 80 + } + ]; + + this.girdcolums = this.initgirdcolums; + + + this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { + clicksToEdit: 1 + }); + + //定义Grid + this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); + + + this.gridList = new Ext.grid.GridPanel({ + store: this.storeList, + enableHdMenu: false, + region: 'center', + loadMask: { msg: "数据加载中,请稍等..." }, + trackMouseOver: true, + disableSelection: false, + selModel: this.GridCheckBoxModel, + plugins: [this.cellEditing], + + columns: this.girdcolums, + viewConfig: { + enableTextSelection: true, //允许复制数据 + autoFill: true + }, + // paging bar on the bottom + bbar: [Ext.create('Ext.PagingToolbar', { + store: this.storeList, + displayInfo: true, + displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录', + emptyMsg: "没有数据" + }), this.Pagenum] + }); + + /////////////以下部分为获取存储的gridpanel显示样式 + this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列 + this.girdcolums.unshift(new Ext.grid.RowNumberer()); + this.gridList.reconfigure(this.storeList, this.girdcolums); + //////////////////////////// + + this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) { + //this.SelectedRecord = record; + //this.OprationStatus = 'edit'; + //DsOpenEditWin('/MvcShipping/MsOpOther/Edit', record.data.BSNO); + this.BsNo = record.data.BSNO; + }, this); + + this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) { + this.sortfield = column.dataIndex; + this.sortdire = direction; + }, this); + + this.cellEditing.on('beforeedit', function (editor, e) { + return this.cellEditingBeforeEdit(editor, e); + }, this); + + //#region formSearch 查询条件 + + + + + + //客户加载_委托单位 + this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsShipping.ux.CustomRefModel', + proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' } + }); +// this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} }); + //委托单位 + this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', { + fieldLabel: '客户名称', + store: this.storeCustCode, + labelWidth: 70, + forceSelection: true, + queryMode: 'remote', + minChars: 1, + queryParam: 'CODENAME', + name: 'CUSTOMERNAME', + valueField: 'CustName', + displayField: 'CodeAndName', + enableKeyEvents: true, + listeners: { + //specialkey: function (field, e) { + keyup: function (field, e) { + if (e.getKey() == e.ENTER) { + _thisSaleRpt.onRefreshClick(); + } + } + } + }); + + + this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsShipping.ux.UserRefModel', + proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' } + }); + this.storeOpCode.load(); + this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', { + fieldLabel: '销售', //'揽货人', + store: this.storeOpCode, + name: 'SALE', + valueField: 'UserName', + displayField: 'CodeAndName' + }); + + + this.storeRPTSTATUS = Ext.create('Ext.data.Store', { + fields: ['FSTATUS', 'NAME'] + }); + this.storeRPTSTATUS.add({ "FSTATUS": "未发布", "NAME": "未发布"}); + this.storeRPTSTATUS.add({ "FSTATUS": "发布", "NAME": "发布" }); + this.storeRPTSTATUS.add({ "FSTATUS": "锁定", "NAME": "锁定" }); + + this.comboxRPTSTATUS = Ext.create('DsExt.ux.RefTableCombox', { + fieldLabel: '状态', + store: this.storeRPTSTATUS, + + valueField: 'FSTATUS', + displayField: 'NAME', + forceSelection: true, + name: 'RPTSTATUS', + value: '', + enableKeyEvents: true, + listeners: { + keyup: function (field, e) { + if (e.getKey() == e.ENTER) { + _thisSaleRpt.onRefreshClick(); + } + } + } + }); + + + + this.formSearch = Ext.widget('form', { + frame: true, + region: 'center', + bodyPadding: 5, + fieldDefaults: { + margins: '2 2 2 2', + labelAlign: 'right', + flex: 1, + labelWidth: 40, + msgTarget: 'qtip' + }, + + items: [{ + xtype: 'container', + defaultType: 'textfield', + layout: 'anchor', + defaults: { + anchor: '100%' + }, + items: [{ + xtype: 'container', + layout: 'hbox', + defaultType: 'textfield', + items: [this.comboxRPTSTATUS,{ + fieldLabel: '从会计期间', + labelWidth: 70, + format: 'Y-m', + xtype: 'datefield', + name: 'FRACCDATE', + enableKeyEvents: true, + listeners: { + keyup: function (field, e) { + if (e.getKey() == e.ENTER) { + _thisSaleRpt.onRefreshClick(); + } + } + } + }, { + fieldLabel: '至', + labelWidth: 20, + format: 'Y-m', + xtype: 'datefield', + name: 'TOACCDATE', + enableKeyEvents: true, + listeners: { + keyup: function (field, e) { + if (e.getKey() == e.ENTER) { + _thisSaleRpt.onRefreshClick(); + } + } + } + }, { + fieldLabel: '从开船日期', + format: 'Y-m-d', + labelWidth: 70, + xtype: 'datefield', + name: 'FRETD', + enableKeyEvents: true, + listeners: { + keyup: function (field, e) { + if (e.getKey() == e.ENTER) { + _thisSaleRpt.onRefreshClick(); + } + } + } + }, { + fieldLabel: '至', + format: 'Y-m-d', + labelWidth: 20, + xtype: 'datefield', + name: 'TOETD', + enableKeyEvents: true, + listeners: { + keyup: function (field, e) { + if (e.getKey() == e.ENTER) { + _thisSaleRpt.onRefreshClick(); + } + } + } + }, this.comboxCustCode,{ + fieldLabel: '主提单号', + labelWidth: 70, + name: 'MBLNO', + enableKeyEvents: true, + listeners: { + keyup: function (field, e) { + if (e.getKey() == e.ENTER) { + _thisSaleRpt.onRefreshClick(); + } + } + } + }, this.comboxSALE, { + xtype: 'button', + width: 90, + text: "查询", + iconCls: "btnrefresh", + handler: function (button, event) { + this.onRefreshClick(button, event); + }, + scope: this + }] + }] + }] + }); + //#endregion formSearch + + //查询工具条 + this.panelBtn = new Ext.Panel({ + region: "north", + tbar: [{ + text: '导入', //"EXCEL模板导出", + iconCls: "btnexportexcel", + id: 'btnexportexcel', + + handler: function (button, event) { + _thisSaleRpt.onImportBillClick(); + + }, + scope: this + }, { + text: "删除", + iconCls: "btndelete", + id: 'btndelete', + handler: function (button, event) { + this.onDeleteListClick(button, event); + }, scope: this + }, '-', { + id: 'btnSubmitAudit', + text: '发布', + tooltip: '发布', + handler: function (button, event) { + this.onSubmitAuditClick(); + }, + scope: this + }, '-', { + id: 'btnCancelSubmitAudit', + text: '取消发布', + tooltip: '取消发布', + handler: function (button, event) { + this.CancelSubList(); + }, + scope: this + }, '-', { + id: 'btnLock', + text: '锁定', + tooltip: '锁定', + handler: function (button, event) { + this.onLockClick(); + }, + scope: this + }, { + text: "保存", + iconCls: "btnsave", + id: 'btnsave', + + handler: function (button, event) { + this.onPostDetailClick(button, event); + }, + scope: this + }, + '-', { + text: "保存列表样式", + id: "btntest", + menu: [ + { text: "保存", + handler: function (button, event) { + this.girdcolums = DsTruck.SaveGridPanel(USERID, _thisSaleRpt.formname, _thisSaleRpt.gridList.columns, _thisSaleRpt.girdcolums, 1, true); + } + }, { text: "初始化", + handler: function (menu, event) { + _thisSaleRpt.girdcolums = DsTruck.SaveGridPanel(USERID, _thisSaleRpt.formname, _thisSaleRpt.gridList.columns, _thisSaleRpt.initgirdcolums, 1, true); + } + }], + scope: this + }, '-', + { + text: "打印", + iconCls: 'btnprint', + menu: [ + { text: "全部", + handler: function (menu, event) { + _thisSaleRpt.Print(); + } + }, { text: "选择打印", + handler: function (menu, event) { + _thisSaleRpt.PrintSelect(); + } + }], + + scope: this + }, { + text: "导出EXCEL", + handler: function (button, event) { + GridExportExcelPage(_thisSaleRpt.gridList); + + } + }] + }); + + + this.panelTop = new Ext.Panel({ + layout: "border", + region: "north", + height: 65, + items: [this.formSearch, this.panelBtn] + }); + + + + + + + + Ext.apply(this, { + items: [this.panelTop, this.gridList] + }); + + //this.sqlcontext = ""; + + //this.storeList.load({ + // params: { start: 0, limit: this.PageSize, sort: '', condition: _thisSaleRpt.sqlcontext }, + // waitMsg: "正在查询数据...", + // scope: this + //}); + + this.storeList.on('beforeload', function (store) { + Ext.apply(store.proxy.extraParams, { condition: _thisSaleRpt.sqlcontext }); + }, this); + + + + //签单方式 + Ext.Ajax.request({ + waitMsg: '', + url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', + params: { + modulename: "modOpSaleRptAdd" + }, + callback: function (options, success, response) { + if (success) { + var result = Ext.JSON.decode(response.responseText); + if (result.Success != true) { + + var btnEdit = Ext.getCmp('btnexportexcel'); + btnEdit.setVisible(false); + var btnEdit = Ext.getCmp('btndelete'); + btnEdit.setVisible(false); + var btnEdit = Ext.getCmp('btnSubmitAudit'); + btnEdit.setVisible(false); + var btnEdit = Ext.getCmp('btnCancelSubmitAudit'); + btnEdit.setVisible(false); + + + var btnEdit = Ext.getCmp('btnLock'); + btnEdit.setVisible(false); + var btnEdit = Ext.getCmp('btnsave'); + btnEdit.setVisible(true); + _thisSaleRpt.sqlcontext = " SALE='" + SHOWNAME + "' and RPTSTATUS='发布' "; + _thisSaleRpt.onDsQuery(); + + } else { + + _thisSaleRpt.modOpSaleRptAdd = 1; + var btnEdit = Ext.getCmp('btnexportexcel'); + btnEdit.setVisible(true); + var btnEdit = Ext.getCmp('btndelete'); + btnEdit.setVisible(true); + var btnEdit = Ext.getCmp('btnSubmitAudit'); + btnEdit.setVisible(true); + var btnEdit = Ext.getCmp('btnCancelSubmitAudit'); + btnEdit.setVisible(true); + var btnEdit = Ext.getCmp('btnLock'); + btnEdit.setVisible(true); + var btnEdit = Ext.getCmp('btnsave'); + btnEdit.setVisible(false); + + } + } else { + + } + }, + scope: this + }); + + Ext.Ajax.request({ + waitMsg: '', + url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable', + params: { + modulename: "modOpSaleRptReadOnly" + }, + callback: function (options, success, response) { + if (success) { + var result = Ext.JSON.decode(response.responseText); + if (result.Success != true) { + + } else { + _thisSaleRpt.modOpSaleRptReadOnly = 1; + + } + } else { + + } + }, + scope: this + }); + + + }, //end initUIComponents + + onRefreshClick: function (button, event) { + var sql = this.getCondition(); + this.sqlcontext = sql; + this.PageSize = this.Pagenum.getValue(); + + this.storeList.pageSize = this.PageSize; + this.storeList.load({ + params: { start: 0, limit: this.PageSize, sort: '', condition: sql }, + waitMsg: "正在查询数据...", + scope: this + }); + }, + + onDsQuery: function () { + //var girdcolums = this.gridList.getColumnMode(); + var sql = this.sqlcontext; + this.PageSize = this.Pagenum.getValue(); + + this.storeList.pageSize = this.PageSize; + this.storeList.load({ + params: { start: 0, limit: this.PageSize, sort: '', condition: sql }, + waitMsg: "正在查询数据...", + scope: this + }); + + }, + + + onPostDetailClick: function (button, event) { + + var bodyDrChFeeDatas = []; + var i; + + + for (i = 0; i < this.storeList.getCount(); i += 1) { + var member = this.storeList.getAt(i); + var PLANDATE = member.data.PLANDATE; + if (PLANDATE != '') + PLANDATE = Ext.util.Format.date(PLANDATE, 'Y-m-d'); + member.data.PLANDATE = PLANDATE; + bodyDrChFeeDatas.push(member); + + }; + var jsonChFeeBody = ConvertGIDRecordsToJson(bodyDrChFeeDatas); + + + + Ext.Msg.wait('正在保存数据, 请稍侯..'); + Ext.Ajax.request({ + waitMsg: '正在保存数据...', + url: '/MvcShipping/MsOpSaleRpt/SaveDetail', + scope: this, + params: { + body: jsonChFeeBody + }, + callback: function (options, success, response) { + if (success) { + Ext.MessageBox.hide(); + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + + this.onRefreshClick(); + + } 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 + }); + } + } + }); + }, //end save + + onSubmitAuditClick: function () { + + + Ext.MessageBox.confirm('提示', '确定发布所有未发布的业务吗?', function (btn) { + if (btn == 'yes') { + Ext.Msg.wait('正在提交数据...'); + Ext.Ajax.request({ + waitMsg: '正在提交数据...', + url: '/MvcShipping/MsOpSaleRpt/SubmitAudit', + + callback: function (options, success, response) { + if (success) { + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + _thisSaleRpt.onRefreshClick(); + Ext.Msg.show({ title: '提示', msg: '发布成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + } + else { + Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); + } + } + }, + failure: function (response, options) { + Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + }, + success: function (response, options) { + }, + scope: this + }); //end Ext.Ajax.request + } + }, this); + + }, + + CancelSubList: function (button, event) { + var selections = this.gridList.getSelectionModel().getSelection(); + if (selections.length == 0) { + Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + var reg = new RegExp("<", "g"); //创建正则RegExp对象 + var stringObj = ""; + var bodyAddDatas = []; + var icount = 0; + for (var i = 0; i < selections.length; i++) { + var rec = selections[i]; + var isdelete = true; + if (rec.data.RPTSTATUS != '发布') { + Ext.Msg.show({ title: '警告', msg: '当前状态不允许取消发布!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); + isdelete = false; + return; + } + + if (isdelete) { + + bodyAddDatas.push(rec); + icount = icount + 1; + } + } + + + + Ext.MessageBox.confirm('提示', "确实要取消发布选中的【" + icount.toString() + "】票业务吗?", function (btn) { + if (btn == 'yes') { + + var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); + Ext.Msg.wait('正在锁定....'); + Ext.Ajax.request({ + waitMsg: '正在锁定....', + url: '/MvcShipping/MsOpSaleRpt/CancelSubList', + params: { + data: jsonbodyAddDatas + }, + callback: function (options, success, response) { + if (success) { + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + _thisSaleRpt.storeList.reload(); + 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 }); + } + } + }, + failure: function (response, options) { + Ext.Msg.show({ title: '警告', msg: '服务器响应出错', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + }, + success: function (response, options) { }, + scope: this + }); //end Ext.Ajax.request + } + }, this); + + + }, + onDeleteListClick: function (button, event) { + var selections = this.gridList.getSelectionModel().getSelection(); + if (selections.length == 0) { + Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + var reg = new RegExp("<", "g"); //创建正则RegExp对象 + var stringObj = ""; + var bodyAddDatas = []; + var icount = 0; + for (var i = 0; i < selections.length; i++) { + var rec = selections[i]; + var isdelete = true; + if (rec.data.RPTSTATUS != '未发布') { + Ext.Msg.show({ title: '警告', msg: '已发布,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); + isdelete = false; + return; + } + + if (isdelete) { + + bodyAddDatas.push(rec); + icount = icount + 1; + } + } + + + + Ext.MessageBox.confirm('提示', "确实要删除选中的【" + icount.toString() + "】票业务吗?", function (btn) { + if (btn == 'yes') { + + var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); + Ext.Msg.wait('正在删除....'); + Ext.Ajax.request({ + waitMsg: '正在删除....', + url: '/MvcShipping/MsOpSaleRpt/DeleteList', + params: { + data: jsonbodyAddDatas + }, + callback: function (options, success, response) { + if (success) { + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + _thisSaleRpt.storeList.reload(); + 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 }); + } + } + }, + failure: function (response, options) { + Ext.Msg.show({ title:'警告', msg: '服务器响应出错', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + }, + success: function (response, options) { }, + scope: this + }); //end Ext.Ajax.request + } + }, this); + + + }, + + onLockClick: function (button, event) { + var selections = this.gridList.getSelectionModel().getSelection(); + if (selections.length == 0) { + Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + var reg = new RegExp("<", "g"); //创建正则RegExp对象 + var stringObj = ""; + var bodyAddDatas = []; + var icount = 0; + for (var i = 0; i < selections.length; i++) { + var rec = selections[i]; + var isdelete = true; + if (rec.data.RPTSTATUS != '发布') { + Ext.Msg.show({ title: '警告', msg: '当前状态不允许锁定!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); + isdelete = false; + return; + } + + if (isdelete) { + + bodyAddDatas.push(rec); + icount = icount + 1; + } + } + + + + Ext.MessageBox.confirm('提示', "确实要锁定选中的【" + icount.toString() + "】票业务吗?", function (btn) { + if (btn == 'yes') { + + var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas); + Ext.Msg.wait('正在锁定....'); + Ext.Ajax.request({ + waitMsg: '正在锁定....', + url: '/MvcShipping/MsOpSaleRpt/LockList', + params: { + data: jsonbodyAddDatas + }, + callback: function (options, success, response) { + if (success) { + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + _thisSaleRpt.storeList.reload(); + 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 }); + } + } + }, + failure: function (response, options) { + Ext.Msg.show({ title: '警告', msg: '服务器响应出错', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + }, + success: function (response, options) { }, + scope: this + }); //end Ext.Ajax.request + } + }, this); + + + }, + onClearSql: function () { + var form = this.formSearch.getForm(); + form.reset(); + }, //onDeleteClick + + + //#region EXCEL导入 + + onImportBillClick: function () { + Ext.MessageBox.confirm('提示', '确定引入超期欠费的业务吗?', function (btn) { + if (btn == 'yes') { + Ext.Msg.wait('正在引入数据...'); + Ext.Ajax.request({ + waitMsg: '正在引入数据...', + url: '/MvcShipping/MsOpSaleRpt/NewData', + callback: function (options, success, response) { + if (success) { + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + _thisSaleRpt.onRefreshClick(); + Ext.Msg.show({ title: '提示', msg: '引入成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + } + else { + Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK }); + } + } + }, + failure: function (response, options) { + Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + }, + success: function (response, options) { + }, + scope: this + }); //end Ext.Ajax.request + } + }, this); + }, + + //#endregion + cellEditingBeforeEdit: function (editor, e) { + + var RPTSTATUS = e.record.get('RPTSTATUS'); + var canedit = true; + if (RPTSTATUS!= '发布') { + Ext.Msg.show({ title:'提示', msg:'当前状态不允许修改!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法修改! + canedit = false; + } + if (_thisSaleRpt.modOpSaleRptReadOnly == 1) { + + Ext.Msg.show({ title: '提示', msg: '没有修改权限!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法修改! + canedit = false; + } + + return canedit; + + }, + getCondition: function () { + var form = this.formSearch.getForm(); + if (!form.isValid()) { + Ext.Msg.alert('提示', '查询条件赋值错误,请检查。'); + return ''; + } + + var sql = ''; + + if (_thisSaleRpt.modOpSaleRptAdd == '0') { + sql = " RPTSTATUS='发布' " + } + + + var MBLNO = form.findField('MBLNO').getValue(); + sql = sql + getAndConSql(sql, MBLNO, "MBLNO like '%" + MBLNO + "%'"); + + + //会计期间 + var FRACCDATE = form.findField('FRACCDATE').getRawValue(); + sql = sql + getAndConSql(sql, FRACCDATE, "ACCDATE>='" + FRACCDATE + "'"); + + var TOACCDATE = form.findField('TOACCDATE').getRawValue(); + sql = sql + getAndConSql(sql, TOACCDATE, "ACCDATE<='" + TOACCDATE + "' "); + + var FRETD = form.findField('FRETD').getRawValue(); + sql = sql + getAndConSql(sql, FRETD, "ETD>='" + FRETD + "'"); + + var TOETD = form.findField('TOETD').getRawValue(); + sql = sql + getAndConSql(sql, TOETD, "ETD<='" + TOETD + "' "); + + + + + var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue(); + sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'"); + + var SALE = form.findField('SALE').getValue(); + sql = sql + getAndConSql(sql, SALE, "SALE= '" + SALE + "'"); + + var RPTSTATUS = form.findField('RPTSTATUS').getValue(); + sql = sql + getAndConSql(sql, RPTSTATUS, "RPTSTATUS= '" + RPTSTATUS + "'"); + + + + + return sql; + }, + OprationSwap: function () { + var ret = new Array(); + ret[0] = this.OprationStatus; + ret[1] = this.storeList; + ret[2] = this.SelectedRecord; + ret[3] = this.selectbsno; + ret[4] = 'op_plan'; + ret[5] = this.storePLList; + return ret; + }, + onExportClick: function (button, event) { + + if (this.storeList.getCount() == 0) { + return; + } + + var sortstr = ''; + + Ext.Msg.wait('正在组织数据, 请稍侯..'); + Ext.Ajax.request({ + waitMsg: '正在组织数据...', + url: '/MvcShipping/MsOpSaleRpt/GetDataListStr', + //(int start, int limit, string sort, string condition, int billtype) + scope: this, + params: { + start: 0, + limit: 10000000, + sort: sortstr, + condition: _thisSaleRpt.sqlcontext, + billtype: 0 + }, + callback: function (options, success, response) { + if (success) { + Ext.MessageBox.hide(); + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + var returnstr = jsonresult.data; + var condition = jsonresult.Message; + if (condition != '') condition = ' where ' + condition; + var sql1 = returnstr; + sql1 = sql1.replace(/\+/g, "@@@") + if (sql1 != '') { + + GridExportBySql(sql1, this.formname, '收费计划列表.xls'); + } + + } 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 + }); + } + } + }); + }, + + Print: function () { + + if (this.storeList.getCount() == 0) { + return; + } + + Ext.Msg.wait('正在组织数据, 请稍侯..'); + Ext.Ajax.request({ + waitMsg: '正在组织数据...', + url: '/MvcShipping/MsOpSaleRpt/GetDataListStr', + scope: this, + params: { + condition: _thisSaleRpt.sqlcontext, + printstr: 'true' + }, + callback: function (options, success, response) { + if (success) { + Ext.MessageBox.hide(); + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + var returnstr = jsonresult.data; + var printType = 'MSOPPLANLIST'; + var sql1 = returnstr; + var sql2 = ""; + var sql3 = ""; + var sql4 = ""; + var sql5 = ""; + var sql6 = ""; + + PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); + + } 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 + }); + } + } + }); + }, + + + PrintSelect: function () { + + + if (this.storeList.getCount() == 0) { + return; + } + var selectedRecords = []; + var storeadd = null; + selectedRecords = this.GridCheckBoxModel.selected.items; + + + if (selectedRecords.length == 0) { + Ext.Msg.show({ title: '提示', msg: '请先选择要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); + return; + } + + var sortstr = ''; + + if (this.sortfield != '' && this.sortdire != '') { + + sortstr = this.sortfield + ' ' + this.sortdire; + } + + if (sortstr == "") sortstr = "SFNO " + + var feeGidSql = ''; + for (var i = 0; i < selectedRecords.length; i++) { + var record = selectedRecords[i]; + var feeGId = "'" + record.get('BSNO') + "'"; + if (feeGidSql == '') { + feeGidSql = feeGId; + } else { + feeGidSql = feeGidSql + "," + feeGId; + } + }; + + var bsno = '11111'; + var selections = this.gridList.getSelectionModel().getSelection(); + if (selections.length != 0) { + var record = selections[0]; + bsno = record.data.BSNO; + } + + var printType = 'MSOPPLANLISTSELECT'; + var sql1 = "select * from op_salerpt WHERE BSNO IN (" + feeGidSql + ") order by " + sortstr; + var sql2 = "select * from op_plan where BSNO='" + bsno + "'"; + var sql3 = ""; + var sql4 = ""; + var sql5 = ""; + var sql6 = ""; + + PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6); + } +}); + + diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendModel.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendModel.js new file mode 100644 index 00000000..d1743801 --- /dev/null +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpVgmSend/MsOpVgmSendModel.js @@ -0,0 +1,45 @@ +Ext.define('MsOpVgmSend', { + extend: 'Ext.data.Model', + idProperty: 'GID', + fields: [ + { name: 'GID', type: 'string' }, // 业务编号 + { name: 'BSNO', type: 'string' }, // 业务编号 + { name: 'MBLNO', type: 'string' }, + { name: 'VGMSTATUS', type: 'string' }, // 委托单位 + { name: 'CUSTNO', type: 'string' }, // 会计期间 + { name: 'CARRIER', type: 'string' }, + { name: 'LOADPORT', type: 'string' }, // 揽货人 + { name: 'MATOU', type: 'string' }, // + { name: 'ISCARRIER', type: 'bool' }, // + { name: 'ISYGT', type: 'bool' }, // + { name: 'SENDTYPE', type: 'string' }, // + { name: 'REMARK', type: 'string' }, + { name: 'VESSEL', type: 'string' }, + { name: 'VOYNO', type: 'string' }, + { name: 'VGM_TIME', type: 'string' }, + { name: 'CTNNUM', type: 'number' }, // + { name: 'SENDERUSER', type: 'string' }, // 创建人 + { name: 'SENDERUSERREF', type: 'string' }, // 创建人 + { name: 'SENDTIME', type: 'string' } + + ] +}); + +Ext.define('MsOpVgmCtn', { + extend: 'Ext.data.Model', + idProperty: 'GID', + fields: [ + { name: 'CTN_ID', type: 'string' }, // 业务编号 + { name: 'BSNO', type: 'string' }, // 业务编号 + { name: 'SENDGID', type: 'string' }, + { name: 'CTNALL', type: 'string' }, // 委托单位 + { name: 'CNTRNO', type: 'string' }, // 会计期间 + { name: 'SEALNO', type: 'string' }, + { name: 'KGS', type: 'number' }, // + { name: 'TAREWEIGHT', type: 'number' }, // + { name: 'VGMKGS', type: 'number' }, // + { name: 'YARD', type: 'string' }, // 创建人 + { name: 'WEIGHDATE', type: 'string' } + + ] +}); diff --git a/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcEdit_ZXIndex.js b/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcEdit_ZXIndex.js index c86bf252..d8185131 100644 --- a/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcEdit_ZXIndex.js +++ b/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcEdit_ZXIndex.js @@ -1528,7 +1528,7 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, { } }, this.comboxTRUCKERQ //, this.comboxFeeNameRef - , this.comboxPcBillType, this.comboxRtnDocStatus, + , this.comboxPcBillType, this.comboxRtnDocStatus, this.comboxOnlyMaster, { text: "重置条件", iconCls: "btnreset", diff --git a/DSWeb/DSWeb.csproj b/DSWeb/DSWeb.csproj index 35f2f78b..66ddad85 100644 --- a/DSWeb/DSWeb.csproj +++ b/DSWeb/DSWeb.csproj @@ -2495,6 +2495,11 @@ + + + + + @@ -3682,6 +3687,8 @@ + + @@ -8420,6 +8427,7 @@ + @@ -8468,6 +8476,7 @@ + @@ -8529,6 +8538,7 @@ +