diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsInfoClientController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsInfoClientController.cs index c028801d..bf776868 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsInfoClientController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsInfoClientController.cs @@ -1012,10 +1012,11 @@ namespace DSWeb.MvcShipping.Controllers return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } - public ContentResult SaveContractAll(string opstatus, string data,string body) + public ContentResult SaveContractAll(string opstatus, string data,string body,string rangebody) { var headData = JsonConvert.Deserialize(data); var bodyList = JsonConvert.Deserialize>(body); + var rangeList = JsonConvert.Deserialize>(rangebody); if (opstatus == "add") { @@ -1041,6 +1042,7 @@ namespace DSWeb.MvcShipping.Controllers if(result.Success==true) { result = MsInfoClientDAL.SaveAccDateDetail(headData, bodyList, Convert.ToString(Session["USERID"])); + result = MsInfoClientDAL.SaveInfoContractRange(headData.GID, rangeList, Convert.ToString(Session["USERID"])); } var jsonRespose = new JsonResponse @@ -1079,6 +1081,19 @@ namespace DSWeb.MvcShipping.Controllers } } + public ContentResult GetContractRangeList(string condition) + { + var dataList = MsInfoClientDAL.GetContractRangeList(condition); + var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() }); + return new ContentResult() { Content = json }; + } + public ContentResult DeleteContractRange(string data) + { + var head = JsonConvert.Deserialize(data); + DBResult result = MsInfoClientDAL.DeleteContractRange(head); + var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message }; + return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; + } #endregion #region 银行 diff --git a/DSWeb/Areas/MvcShipping/DAL/MsChFee/MsChFeeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsChFee/MsChFeeDAL.cs index 4cba9966..bd44b399 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsChFee/MsChFeeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsChFee/MsChFeeDAL.cs @@ -2651,7 +2651,8 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append(" where p.bsno='" + bsno + "'"); strSql.Append(" GROUP BY P.SIZE,P.CTN,P.CTNALL order by PKGS desc"); } - else { + else + { strSql.Append("SELECT top 1 1 PKGS,0 KGS,0 CBM,0 AS NETWEIGHT,"); strSql.Append("'' as SIZE,'' AS CTN,0 AS CTNNUM,0 AS TEU,'' AS CTNALL"); strSql.Append(" from op_seae "); @@ -2662,7 +2663,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL } - return SetSeaeCtnUnitData(strSql, bstype,lan); + return SetSeaeCtnUnitData(strSql, bstype, lan); } else if (tops == "topseai" || bstype == "op_Seai") { @@ -2676,7 +2677,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append(" from OP_CTN P "); strSql.Append(" where p.bsno='" + bsno + "'"); strSql.Append(" GROUP BY P.SIZE,P.CTN,P.CTNALL order by PKGS desc"); - return SetSeaeCtnUnitData(strSql, bstype,lan); + return SetSeaeCtnUnitData(strSql, bstype, lan); } else if (bstype == "apply") { @@ -2684,7 +2685,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append("'' as SIZE,'' AS CTN,0 AS CTNNUM,0 AS TEU,'' AS CTNALL"); strSql.Append(" from op_apply "); strSql.Append(" where bsno='" + bsno + "'"); - return SetSeaeCtnUnitData(strSql, bstype,lan); + return SetSeaeCtnUnitData(strSql, bstype, lan); } else if (bstype == "crm_seaeorder") { @@ -2698,7 +2699,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append(" from crm_seaeorderctn P "); strSql.Append(" where p.ordno='" + bsno + "'"); strSql.Append(" GROUP BY P.CTNALL order by PKGS desc "); - return SetSeaeCtnUnitData(strSql, bstype,lan); + return SetSeaeCtnUnitData(strSql, bstype, lan); } else if (bstype == "op_other") { @@ -2706,7 +2707,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append("'' as SIZE,CTNALL AS CTN,CTNNUM,0 AS TEU,CTNALL"); strSql.Append(" from op_other "); strSql.Append(" where bsno='" + bsno + "'"); - return SetSeaeCtnUnitData(strSql, bstype,lan); + return SetSeaeCtnUnitData(strSql, bstype, lan); } else if (bstype == "op_railway") { @@ -2728,7 +2729,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append("'' as SIZE,'' AS CTN,0 CTNNUM,0 AS TEU,'' CTNALL"); strSql.Append(" from op_aire "); strSql.Append(" where bsno='" + bsno + "'"); - return SetSeaeCtnUnitData(strSql, bstype,lan); + return SetSeaeCtnUnitData(strSql, bstype, lan); } else if (bstype == "op_airi") { @@ -2736,7 +2737,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append("'' as SIZE,'' AS CTN,0 CTNNUM,0 AS TEU,'' CTNALL"); strSql.Append(" from op_airi"); strSql.Append(" where bsno='" + bsno + "'"); - return SetSeaeCtnUnitData(strSql, bstype,lan); + return SetSeaeCtnUnitData(strSql, bstype, lan); } else if (bstype == "import_main") { @@ -2759,7 +2760,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append(" where ASSOCIATEDNO='" + bsno + "'"); return SetWMSINUnitData(strSql); } - else if (bstype == "op_sub_seaorder"|| bstype == "op_suborder") + else if (bstype == "op_sub_seaorder" || bstype == "op_suborder") { strSql.Append("SELECT PKGS,KGS,CBM,0 AS NETWEIGHT,"); strSql.Append("'' as SIZE,'' AS CTN,0 AS CTNNUM,0 AS TEU,'' AS CTNALL"); @@ -2771,11 +2772,116 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL strSql.Append(" from op_seaorder_ctn P "); strSql.Append(" where p.BSNO IN (SELECT BSNO FROM op_sub_seaorder WHERE ORDNO='" + bsno + "')"); strSql.Append(" GROUP BY P.CTNALL order by PKGS desc "); - return SetSeaeCtnUnitData(strSql, bstype,lan); + return SetSeaeCtnUnitData(strSql, bstype, lan); } - else return SetCtnUnitData(strSql,lan); + else if (bstype == "tMsWlPcHead") { + return SetPcCtnUnitData(bsno, lan); + } + else return SetCtnUnitData(strSql, lan); } + private static List SetPcCtnUnitData(string bsno, string lan) + { + decimal ctnnum = 0; + int teu = 0; + var bodyList = new List(); + var strSqla = new StringBuilder(); + strSqla.Append("SELECT CTNALL,SUM(CTNNUM) CTNNUM from op_letter_yard_ctn where LE_ID='"+bsno+ "' GROUP BY CTNALL"); + Database db = DatabaseFactory.CreateDatabase(); + using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSqla.ToString())) + { + while (reader.Read()) + { + MsFeeUnit Data = new MsFeeUnit(); + Data.SUNIT = Convert.ToString(reader["CTNALL"]); + Data.UNIT = Convert.ToString(reader["CTNALL"]); + Data.QUANTITY = Convert.ToInt32(reader["CTNNUM"]); + ctnnum = ctnnum + Data.QUANTITY; + if (Data.UNIT.IndexOf("20") >= 0) + { + teu = teu + Convert.ToInt32(Data.QUANTITY); + } + else { + teu = teu + Convert.ToInt32(Data.QUANTITY * 2); + } + bodyList.Add(Data); + } + reader.Close(); + } + + + var data = new MsFeeUnit(); + data.SUNIT = "P-单票"; + data.UNIT = "单票"; + data.QUANTITY = 1; + bodyList.Add(data); + var data2 = new MsFeeUnit(); + data2.SUNIT = "J-件"; + data2.UNIT = "件数"; + data2.QUANTITY = 0; + bodyList.Add(data2); + var data4 = new MsFeeUnit(); + data4.SUNIT = "Z-重量"; + data4.UNIT = "重量"; + data4.QUANTITY = 0; + bodyList.Add(data4); + var data3 = new MsFeeUnit(); + data3.SUNIT = "T-TEU"; + data3.UNIT = "TEU"; + data3.QUANTITY = teu; + bodyList.Add(data3); + + var data5 = new MsFeeUnit(); + data5.SUNIT = "C-CBM"; + data5.UNIT = "CBM"; + data5.QUANTITY = 0; + bodyList.Add(data5); + + var data6 = new MsFeeUnit(); + data6.SUNIT = "X-箱型"; + data6.UNIT = "箱型"; + data6.QUANTITY = ctnnum; + bodyList.Add(data6); + + var data7 = new MsFeeUnit(); + data7.SUNIT = "B-BILL"; + data7.UNIT = "BILL"; + data7.QUANTITY = 0; + bodyList.Add(data7); + + var data8 = new MsFeeUnit(); + data8.SUNIT = "V-车"; + data8.UNIT = "车"; + data8.QUANTITY = 1; + bodyList.Add(data8); + + var data9 = new MsFeeUnit(); + data9.SUNIT = "T-天"; + data9.UNIT = "天"; + data9.QUANTITY = 1; + bodyList.Add(data9); + var data10 = new MsFeeUnit(); + data10.SUNIT = "G-个"; + data10.UNIT = "个"; + data10.QUANTITY = 0; + bodyList.Add(data10); + var data11 = new MsFeeUnit(); + data11.SUNIT = "S-小时"; + data11.UNIT = "小时"; + data11.QUANTITY = 0; + bodyList.Add(data11); + var data18 = new MsFeeUnit(); + data18.SUNIT = "J-JOB"; + data18.UNIT = "JOB"; + data18.QUANTITY = 1; + bodyList.Add(data18); + var data19 = new MsFeeUnit(); + data19.SUNIT = "T-托"; + data19.UNIT = "托"; + data19.QUANTITY = 1; + bodyList.Add(data19); + return bodyList; + } private static List SetCtnUnitData(StringBuilder strSql,string lan) { var bodyList = new List(); diff --git a/DSWeb/Areas/MvcShipping/DAL/MsInfoClient/MsInfoClientDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsInfoClient/MsInfoClientDAL.cs index fef86703..2b778f54 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsInfoClient/MsInfoClientDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsInfoClient/MsInfoClientDAL.cs @@ -89,7 +89,8 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient strSql.Append(",(select showname from [user] where gid=info_client.MODIFIEDUSER) MODIFIEDUSERREF,ESHORTNAME,WMSFEERATETYPE "); strSql.Append(",(select top 1 name from company where gid=CORPID)[CORPNAME] "); - + strSql.Append(",ISNULL((select COUNT(1) CT from Receipt_Doc d left join info_client_contract c on (c.GID=D.BSNO) where C.LINKID=info_client.GID),0) as CONTRACTCT "); + strSql.Append(" from info_client where 1=1 "); @@ -178,6 +179,7 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient strSql.Append(",case WHEN BLSTATUS=0 THEN '合作客户' else '潜在客户' end CUSTPROP"); strSql.Append(",(select showname from [user] where gid=info_client.MODIFIEDUSER) MODIFIEDUSERREF,ESHORTNAME,WMSFEERATETYPE "); strSql.Append(",(select top 1 name from company where gid=CORPID)[CORPNAME] "); + strSql.Append(",ISNULL((select COUNT(1) CT from Receipt_Doc d left join info_client_contract c on (c.GID=D.BSNO) where C.LINKID=info_client.GID),0) as CONTRACTCT "); strSql.Append(" from info_client where 1=1 "); @@ -271,6 +273,7 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient strSql.Append(",case WHEN BLSTATUS=0 THEN '合作客户' else '潜在客户' end CUSTPROP"); strSql.Append(",(select showname from [user] where gid=info_client.MODIFIEDUSER) MODIFIEDUSERREF,ESHORTNAME,WMSFEERATETYPE "); strSql.Append(",(select top 1 name from company where gid=CORPID)[CORPNAME] "); + strSql.Append(",ISNULL((select COUNT(1) CT from Receipt_Doc d left join info_client_contract c on (c.GID=D.BSNO) where C.LINKID=info_client.GID),0) as CONTRACTCT "); strSql.Append(" from info_client where 1=1 "); @@ -311,6 +314,7 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient strSql.Append(",case WHEN BLSTATUS=0 THEN '合作客户' else '潜在客户' end CUSTPROP"); strSql.Append(",(select showname from [user] where gid=info_client.MODIFIEDUSER) MODIFIEDUSERREF,ESHORTNAME,WMSFEERATETYPE "); strSql.Append(",(select top 1 name from company where gid=CORPID)[CORPNAME] "); + strSql.Append(",ISNULL((select COUNT(1) CT from Receipt_Doc d left join info_client_contract c on (c.GID=D.BSNO) where C.LINKID=info_client.GID),0) as CONTRACTCT "); strSql.Append(" from info_client where 1=1 "); @@ -496,6 +500,11 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient data.ISSHIPPINGAGENT = Convert.ToBoolean(reader["ISSHIPPINGAGENT"]);//船代 if (reader["ISWHARF"] != DBNull.Value) data.ISWHARF = Convert.ToBoolean(reader["ISWHARF"]);//码头 + int CONTRACTCT = 0; + if (reader["CONTRACTCT"] != DBNull.Value) + CONTRACTCT = Convert.ToInt32(reader["CONTRACTCT"]); + if (CONTRACTCT > 0) data.ISCONTRACT = true; + else data.ISCONTRACT = false; #endregion @@ -973,6 +982,9 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient strSql.Append("[CANCELDATE],[CHIEF],[REMARK],[CORPID],[CREATEUSER],[CREATETIME],[DEPTGID]"); strSql.Append(",(select ShowName from [user] where GID=info_client_contract.CREATEUSER) as CREATEUSERREF"); strSql.Append(",(select SHORTNAME from info_client where GID=info_client_contract.LINKID) as CUSTNAME"); + strSql.Append(",ISNULL((select COUNT(1) CT from info_client_contract_range where LINKID=info_client_contract.GID),0) as RANGCT "); + + strSql.Append(" from info_client_contract where 1=1 "); var rangstr = ""; @@ -1041,30 +1053,30 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient } if (visiblerange == "4") { - str = " (CREATEUSER='" + userid + "')"; + str = " (CREATEUSER='" + userid + "' or GID IN (SELECT LINKID FROM info_client_contract_range WHERE USERID='"+userid+ "'))"; } else if (visiblerange == "3") { - str = " (CREATEUSER='" + userid + "')"; + str = " (CREATEUSER='" + userid + "' or GID IN (SELECT LINKID FROM info_client_contract_range WHERE USERID='" + userid + "'))"; } else if (visiblerange == "2") { var rangeDa = new RangeDA(); var deptid = rangeDa.GetDEPTGID(userid); - str = " DEPTGID='" + deptid + "' "; + str = " (DEPTGID='" + deptid + "' or GID IN (SELECT LINKID FROM info_client_contract_range WHERE USERID='" + userid + "'))"; } else if (visiblerange == "1") { - str = " CREATEUSER in (select USERID from vw_user where COMPANYID='" + companyid + "') "; + str = " (CREATEUSER in (select USERID from vw_user where COMPANYID='" + companyid + "') or GID IN (SELECT LINKID FROM info_client_contract_range WHERE USERID='" + userid + "'))"; } else if (visiblerange == "5") { - str = " CREATEUSER in (select USERID from vw_user where COMPANYID IN (select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1)) "; + str = " (CREATEUSER in (select USERID from vw_user where COMPANYID IN (select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1)) or GID IN (SELECT LINKID FROM info_client_contract_range WHERE USERID='" + userid + "'))"; } else if (visiblerange == "6") { - str = " EXISTS (select 1 from user_authority_range_op P left join [user] u on (u.GID=P.OPID) where (info_client_contract.CREATEUSER=U.GID) AND P.userid='" + userid + "' and P.AUTHORITYID='" + AUTHORITYID + "' and P.VISIBLERANGE=1) "; + str = " (EXISTS (select 1 from user_authority_range_op P left join [user] u on (u.GID=P.OPID) where (info_client_contract.CREATEUSER=U.GID) AND P.userid='" + userid + "' and P.AUTHORITYID='" + AUTHORITYID + "' and P.VISIBLERANGE=1) or GID IN (SELECT LINKID FROM info_client_contract_range WHERE USERID='" + userid + "')) "; //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"); @@ -1158,17 +1170,167 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient data.CREATETIME = Convert.ToString(reader["CREATETIME"]); data.CREATEUSER = Convert.ToString(reader["CREATEUSER"]); data.CREATEUSERREF = Convert.ToString(reader["CREATEUSERREF"]); + data.ISRANGE = false; + var rangct = 0; + if (reader["RANGCT"] != DBNull.Value) + rangct = Convert.ToInt32(reader["RANGCT"]); + if (rangct > 0) + data.ISRANGE = true; + + #endregion + headList.Add(data); + } + reader.Close(); + } + return headList; + } + + static public List GetContractRangeList(string strCondition) + { + var strSql = new StringBuilder(); + strSql.Append("SELECT * "); + strSql.Append(",(select showname from [user] where gid=info_client_contract_range.USERID) SHOWNAME from info_client_contract_range where 1=1"); + if (!string.IsNullOrEmpty(strCondition)) + { + strSql.Append(" and " + strCondition); + } + + strSql.Append(" order by MODIFIEDTIME"); + return SetContractRangeData(strSql); + } + + + private static List SetContractRangeData(StringBuilder strSql) + { + var headList = new List(); + Database db = DatabaseFactory.CreateDatabase(); + + using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) + { + while (reader.Read()) + { + MsInfoContractRange data = new MsInfoContractRange(); + #region Set DB data to Object + data.GID = (reader["GID"] == null ? "" : Convert.ToString(reader["GID"]));//GID + data.LINKID = (reader["LINKID"] == null ? "" : Convert.ToString(reader["LINKID"]));//公司关联id + data.USERID = Convert.ToString(reader["USERID"]); + data.SHOWNAME = Convert.ToString(reader["SHOWNAME"]); + data.MODIFIEDUSER = Convert.ToString(reader["MODIFIEDUSER"]); + if (reader["MODIFIEDTIME"] != DBNull.Value) + data.MODIFIEDTIME = Convert.ToDateTime(reader["MODIFIEDTIME"]).ToString("yyyy-MM-dd hh:mm:ss"); #endregion headList.Add(data); } reader.Close(); } + return headList; } + public static DBResult SaveInfoContractRange(string GID, List bodyList, string userid) + { + var result = new DBResult(); + + + Database db = DatabaseFactory.CreateDatabase(); + using (var conn = db.CreateConnection()) + { + conn.Open(); + var tran = conn.BeginTransaction(); + + try + { + var cmdInsert = + db.GetSqlStringCommand( + @"insert into info_client_contract_range (GID,LINKID,USERID,MODIFIEDUSER,MODIFIEDTIME) + values (@GID,@LINKID,@USERID,@MODIFIEDUSER,@MODIFIEDTIME) "); + + var cmdUpdate = + db.GetSqlStringCommand( + @"update info_client_contract_range set USERID=@USERID,MODIFIEDUSER=@MODIFIEDUSER,MODIFIEDTIME=@MODIFIEDTIME where GID=@GID "); + if (bodyList != null) + { + foreach (var enumValue in bodyList) + { + if (enumValue.LINKID == "*" || enumValue.LINKID == "") + { + cmdInsert.Parameters.Clear(); + db.AddInParameter(cmdInsert, "@GID", DbType.String, enumValue.GID); + db.AddInParameter(cmdInsert, "@LINKID", DbType.String, GID); + db.AddInParameter(cmdInsert, "@USERID", DbType.String, enumValue.USERID); + db.AddInParameter(cmdInsert, "@MODIFIEDUSER", DbType.String, userid); + db.AddInParameter(cmdInsert, "@MODIFIEDTIME", DbType.String, DateTime.Now.ToString()); + db.ExecuteNonQuery(cmdInsert, tran); + } + else + { + + cmdUpdate.Parameters.Clear(); + db.AddInParameter(cmdUpdate, "@GID", DbType.String, enumValue.GID); + db.AddInParameter(cmdUpdate, "@USERID", DbType.String, enumValue.USERID); + db.AddInParameter(cmdUpdate, "@MODIFIEDUSER", DbType.String, userid); + db.AddInParameter(cmdUpdate, "@MODIFIEDTIME", DbType.String, DateTime.Now.ToString()); + + db.ExecuteNonQuery(cmdUpdate, tran); + } + } + } + + + + tran.Commit(); + } + catch (Exception) + { + tran.Rollback(); + + result.Success = false; + result.Message = "保存出现错误,请重试或联系系统管理员"; + + return result; + } + } + + result.Success = true; + result.Message = "保存成功" + result.Message; + + return result; + } + + public static DBResult DeleteContractRange(MsInfoContractRange headData) + { + 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 info_client_contract_range where GID='" + headData.GID + "'"); + db.ExecuteNonQuery(cmdDelete, tran); + + + tran.Commit(); + } + catch (Exception) + { + tran.Rollback(); + result.Success = false; + result.Message = "删除出现错误,请重试或联系系统管理员"; + return result; + } + } + + // + result.Success = true; + result.Message = "操作成功"; + return result; + } #endregion public static DBResult SaveCustFee(MsClient headData, List bodyList, string userid) diff --git a/DSWeb/Areas/MvcShipping/Models/MsInfoClient/MsInfoClient.cs b/DSWeb/Areas/MvcShipping/Models/MsInfoClient/MsInfoClient.cs index 52a6d752..2027d6f4 100644 --- a/DSWeb/Areas/MvcShipping/Models/MsInfoClient/MsInfoClient.cs +++ b/DSWeb/Areas/MvcShipping/Models/MsInfoClient/MsInfoClient.cs @@ -1092,7 +1092,7 @@ namespace DSWeb.MvcShipping.Models.MsInfoClient [ModelDB] public bool? ISWHARF { get; set; } - + public bool? ISCONTRACT { get; set; } #endregion diff --git a/DSWeb/Areas/MvcShipping/Models/MsInfoClient/MsInfoContract.cs b/DSWeb/Areas/MvcShipping/Models/MsInfoClient/MsInfoContract.cs index 9f6cea03..86cc4c0e 100644 --- a/DSWeb/Areas/MvcShipping/Models/MsInfoClient/MsInfoContract.cs +++ b/DSWeb/Areas/MvcShipping/Models/MsInfoClient/MsInfoContract.cs @@ -167,8 +167,8 @@ namespace DSWeb.MvcShipping.Models.MsInfoContract get { return _CREATEUSERREF; } set { _CREATEUSERREF = value; } } - - #endregion + public bool ISRANGE { get; set; } + #endregion public MsInfoContract() { @@ -181,8 +181,18 @@ namespace DSWeb.MvcShipping.Models.MsInfoContract } } + [JsonObject] + public class MsInfoContractRange : ModelObjectBillHead + { + public string GID { get; set; } + public string LINKID { get; set; } + public string USERID { get; set; } + + public string SHOWNAME { get; set; } + public string MODIFIEDUSER { get; set; } + public string MODIFIEDTIME { get; set; } + } - // } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeOpMustField/MsCodeOpMustFieldEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeOpMustField/MsCodeOpMustFieldEdit.js index 752682db..ac596e50 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeOpMustField/MsCodeOpMustFieldEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeOpMustField/MsCodeOpMustFieldEdit.js @@ -96,6 +96,8 @@ Ext.extend(Shipping.MsCodeOpMustFieldEdit, Ext.Panel, { this.StoreField.load({ params: { optable: "op_truck_bulk_pc" } }); } if (combo.value == '仓储入库') { this.StoreField.load({ params: { optable: "WMS" } }); + } if (combo.value == '内贸海运业务') { + this.StoreField.load({ params: { optable: "op_InternalTrade" } }); } } } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeOpMustField/MsCodeOpMustFieldIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeOpMustField/MsCodeOpMustFieldIndex.js index 43fd090b..012cd60f 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeOpMustField/MsCodeOpMustFieldIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsCodeOpMustField/MsCodeOpMustFieldIndex.js @@ -110,6 +110,8 @@ Ext.extend(Shipping.MsCodeOpMustFieldIndex, Ext.Panel, { this.StoreField.load({ params: { optable: "WMS" } }); } if (combo.value == '仓储出库') { this.StoreField.load({ params: { optable: "WMS_OUT" } }); + } if (combo.value == '内贸海运业务') { + this.StoreField.load({ params: { optable: "op_InternalTrade" } }); } } } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractDsEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractDsEdit.js index 44ce1c54..e539fa17 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractDsEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractDsEdit.js @@ -66,6 +66,108 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, { displayField: 'CodeAndFull' }); + this.storeContractRangeList = Ext.create('Ext.data.Store', { + model: 'MsInfoClientContractRange', + remoteSort: true, + proxy: { + type: 'ajax', + url: '/MvcShipping/MsInfoClient/GetContractRangeList', + reader: { + id: 'GID', + root: 'data', + totalProperty: 'totalCount' + } + } + }); + //箱型_集装箱列表中的下拉框加载 + this.storeOpCode2 = Ext.create('DsExt.ux.RefTableStore', { + model: 'DsShipping.ux.UserRefModel', + proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' } + }); + this.storeOpCode2.load(); + this.comboxUser = Ext.create('DsExt.ux.RefTableCombox', { + store: this.storeOpCode2, + forceSelection: true, + name: 'USERID', + valueField: 'GID', + displayField: 'CodeAndName' + }); + + + + + this.gridListRangeCellEditing = Ext.create('Ext.grid.plugin.CellEditing', { + clicksToEdit: 1 + }); + this.gridListRange = new Ext.grid.GridPanel({ + store: this.storeContractRangeList, + enableHdMenu: false, + region: 'center', + loadMask: { msg: "数据加载中,请稍等..." }, + trackMouseOver: true, + disableSelection: false, + plugins: [this.gridListRangeCellEditing], + selType: 'cellmodel', + + tbar: [ + { + text: '增加明细', //'增加明细', + tooltip: '增加明细', //'增加明细', + id: "btnadddetail", + iconCls: "btnadddetail", + handler: function (button, event) { + this.addDetail(); + }, + scope: this + }, '-', { + text: '删除明细', //'删除明细', + tooltip: '删除明细', //'删除明细', + id: "btndeldetail", + iconCls: "btndeletedetail", + handler: function (button, event) { + this.deleteDetail(); + }, + scope: this + }], + + columns: [{ + sortable: true, + dataIndex: 'GID', + header: '编号', + hidden: true, + width: 0 + }, { + dataIndex: 'USERID', + header: '人员', //'箱型', + width: 120, + editor: this.comboxUser, + renderer: function (value, p, record) { + return record.data.SHOWNAME; + }, + } + + ] + }); + + this.storeContractRangeList.on('beforeload', function (store) { + var billNo = this.editRecord.get('GID'); + var condition = "LINKID='" + billNo + "'"; + Ext.apply(store.proxy.extraParams, { condition: condition }); + }, this); + + this.panelBodyRange = new Ext.Panel({ + title: '合同查看人员', //'集装箱信息', + layout: "border", + region: 'east', + width: 250, + margin: '5 20', + frame: true, + items: [this.gridListRange] + }); + this.gridListRange.on('edit', function (editor, e, eOpts) { + this.gridRangeAfterEdit(editor, e, eOpts); + }, this); + //编辑form this.formEdit = Ext.widget('form', { @@ -155,6 +257,7 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, { grow: true, fieldLabel: Zi.LAN.REMARK, //'备 注', height: 60, + flex: 3, name: 'REMARK', anchor: '100%' }] @@ -469,7 +572,7 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, { //autoScroll: true, // containerScroll: true, frame: false, - items: [this.panel_ACCDATEEdit] + items: [this.panel_ACCDATEEdit, this.panelBodyRange] }); @@ -722,6 +825,7 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, { this.strBSNO = data.GID; this.storeBodyList_ACCDATE.load({ params: { condition: "LINKGID='" + data.LINKID + "'", isedit: "1" } }); + this.storeContractRangeList.load({ params: { condition: "LINKID='" + data.GID + "'" } }); //if (this.opStatus == 'add') { // this.formEdit.getForm().findField('LINKID').setValue(this.MainEditRecord.GID); @@ -762,6 +866,13 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, { } var ACCDATEbody = ConvertRecordsToJson(bodydatas2); + var bodydatas3 = []; + for (var i = 0; i < this.storeContractRangeList.getCount(); i += 1) { + var member = this.storeContractRangeList.getAt(i); + bodydatas3.push(member); + } + var rangebody = ConvertRecordsToJson(bodydatas3); + Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu); Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在保存数据...', @@ -770,7 +881,8 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, { params: { opstatus: this.opStatus, data: Ext.JSON.encode(data), - body: ACCDATEbody + body: ACCDATEbody, + rangebody: rangebody }, callback: function (options, success, response) { if (success) { @@ -781,6 +893,7 @@ Ext.extend(Shipping.MsInfoClientContractDsEdit, Ext.Panel, { this.formEdit.getForm().setValues(returnData); this.strBSNO = returnData.GID; this.storeBodyList_ACCDATE.load({ params: { condition: "CONTRACTGID='" + returnData.GID + "'", isedit: "1" } }); + this.storeContractRangeList.load({ params: { condition: "LINKID='" + returnData.GID + "'"} }); if (this.opStatus == 'add') { var arrNewRecords = this.StoreList.insert(0, returnData); this.editRecord = this.StoreList.getAt(0); @@ -1017,7 +1130,72 @@ SetACCDATE: function () { }, //#endregion + gridRangeAfterEdit: function (editor, e, eOpts) { + if (e.field == 'USERID') { + var records = DsStoreQueryBy(this.storeOpCode2, 'GID', e.value); + if (records.getCount() > 0) { + var data = records.getAt(0).data; + var CLIENTNAME = data.UserName; + e.record.set('SHOWNAME', CLIENTNAME); + } + } + }, + + + addDetail: function () { + var record = Ext.create('MsInfoClientContractRange', { + GID: NewGuid(), + LINKID: '*', + USERID: '', + SHOWNAME: '' + }); + this.storeContractRangeList.add(record); + var n = this.storeContractRangeList.getCount(); + this.gridListRangeCellEditing.startEditByPosition({ row: n - 1, column: 1 }); + }, + deleteDetail: function () { + var selectedRecords = this.gridListRange.selModel.getSelection(); + for (var i = 0; i < selectedRecords.length; i++) { + var rec = selectedRecords[i]; + if (rec.data.LINKID == "" || rec.data.LINKID == "*")//如果是新增但没有保存的数据,没有必要提交到后台 + { + this.storeContractRangeList.remove(selectedRecords[i]); + } + else { + Ext.MessageBox.confirm('提示', '确实要删除该数据吗?', function (btn) { + if (btn == 'yes') { + Ext.Msg.wait('正在操作数据'); + Ext.Ajax.request({ + waitMsg: '正在操作数据', //'正在删除数据...', + url: '/MvcShipping/MsInfoClient/DeleteContractRange', + params: { + data: Ext.JSON.encode(rec.data) + }, + callback: function (options, success, response) { + if (success) { + var jsonresult = Ext.JSON.decode(response.responseText); + if (jsonresult.Success) { + this.storeContractRangeList.remove(rec); + + 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 }); + }, + scope: this + }); //end Ext.Ajax.request + } + }, this); + } + //this.storeBodyList.remove(selectedRecords[i]); + } + }, //#region 上传图片 onAddFileClick: function (button, event) { diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractDsIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractDsIndex.js index 64e4e835..6d3d0d3c 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractDsIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractDsIndex.js @@ -111,7 +111,21 @@ Ext.extend(Shipping.MsInfoClientContractDsIndex, Ext.Panel, { dataIndex: 'CREATETIME', header: Zi.LAN.CREATETIME, //'录入日期', width: 120 - }]; + }, + { + sortable: true, + dataIndex: 'ISRANGE', + header: Zi.LAN.ISRANGE, //'录入日期', + width: 120, + renderer: function (value, cellmeta, record) { + if (value) { + return Zi.LAN.YES; + } else { + return Zi.LAN.NO; + } + + } + }]; this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractIndex.js index cf789fae..d3457157 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientContractIndex.js @@ -107,7 +107,21 @@ Ext.extend(Shipping.MsInfoClientContractIndex, Ext.Panel, { dataIndex: 'CREATETIME', header: Zi.LAN.CREATETIME, //'录入日期', width: 120 - }]; + }, + { + sortable: true, + dataIndex: 'ISRANGE', + header: Zi.LAN.ISRANGE, //'录入日期', + width: 120, + renderer: function (value, cellmeta, record) { + if (value) { + return Zi.LAN.YES; + } else { + return Zi.LAN.NO; + } + + } + }]; this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel'); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientIndex.js index 73bf9c1d..6da2417b 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientIndex.js @@ -296,6 +296,20 @@ Ext.extend(Shipping.MsInfoClientIndex, Ext.Panel, { dataIndex: 'MODIFIEDTIME', header: Zi.LAN.MODIFIEDTIME, //'录入日期', width: 120 + }, + { + sortable: true, + dataIndex: 'ISCONTRACT', + header: Zi.LAN.ISCONTRACT, //'录入日期', + width: 120, + renderer: function (value, cellmeta, record) { + if (value) { + return Zi.LAN.YES; + } else { + return Zi.LAN.NO; + } + + } } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientModel.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientModel.js index 0cb67689..8dfb7b50 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientModel.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/MsInfoClientModel.js @@ -111,6 +111,7 @@ , { name: 'CONTRACTSTATUS', type: 'string' } , { name: 'CONTRACTDATE', type: 'string' } , { name: 'WMSFEERATETYPE', type: 'string' } + , { name: 'ISCONTRACT', type: 'bool' } ] }); @@ -171,6 +172,7 @@ Ext.define('MsInfoClientContractModel', { { name: 'STARTDATE', type: 'string' }, { name: 'CANCELDATE', type: 'string' }, { name: 'CHIEF', type: 'string' }, + { name: 'ISRANGE', type: 'bool' }, { name: 'REMARK', type: 'string' }, { name: 'CORPID', type: 'string' }, { name: 'DEPTGID', type: 'string' }, @@ -328,7 +330,7 @@ Ext.define('MsInfoClientRoleModel', { { name: 'GID', type: 'string' }, { name: 'LINKID', type: 'string' }, { name: 'SHOWNAME', type: 'string' }, - { name: 'ROLE', type: 'string' }, + { name: 'USERID', type: 'string' }, { name: 'BEGINDATE', type: 'string' }, { name: 'ENDDATE', type: 'string' }, { name: 'CREATETIME', type: 'string' }, @@ -354,4 +356,17 @@ Ext.define('MsInfoClientWebUser', { { name: 'MODIFIEDUSER', type: 'string' }, { name: 'MODIFIEDTIME', type: 'string' } ] +}); + +Ext.define('MsInfoClientContractRange', { + extend: 'Ext.data.Model', + idProperty: 'GID', + fields: [ + { name: 'GID', type: 'string' }, + { name: 'LINKID', type: 'string' }, + { name: 'USERID', type: 'string' }, + { name: 'SHOWNAME', type: 'string' }, + { name: 'MODIFIEDUSER', type: 'string' }, + { name: 'MODIFIEDTIME', type: 'string' } + ] }); \ No newline at end of file diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/Zi_en-us.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/Zi_en-us.js index 4e9910eb..2e5bc6f7 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/Zi_en-us.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/Zi_en-us.js @@ -307,4 +307,6 @@ Zi.LAN.NO = "否"; Zi.LAN.GJHL = "根据汇率设置"; Zi.LAN.GDFYWH = '固定费用维护'; Zi.LAN.QSYBCM = '确实要保存吗?'; -Zi.LAN.ISINVDEF = '是否开票默认账户'; \ No newline at end of file +Zi.LAN.ISINVDEF = '是否开票默认账户'; +Zi.LAN.ISRANGE = '否划分人员权限'; +Zi.LAN.ISCONTRACT = '是否上传合同'; \ No newline at end of file diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/Zi_zh-cn.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/Zi_zh-cn.js index 089965f8..af906e51 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/Zi_zh-cn.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsInfoClient/Zi_zh-cn.js @@ -309,6 +309,8 @@ Zi.LAN.GJHL = "根据汇率设置"; Zi.LAN.GDFYWH = '固定费用维护'; Zi.LAN.QSYBCM = '确实要保存吗?'; Zi.LAN.ISINVDEF = '是否开票默认账户'; +Zi.LAN.ISRANGE = '否划分人员权限'; +Zi.LAN.ISCONTRACT = '是否上传合同'; diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpAire/MsOpAireEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpAire/MsOpAireEdit.js index d53562ff..8c64de29 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpAire/MsOpAireEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpAire/MsOpAireEdit.js @@ -110,6 +110,10 @@ Ext.extend(Shipping.MsOpAireEdit, Ext.Panel, { displayField: 'CodeAndName' }); //揽货人 + this.storeOpCode2.on('beforeload', function (store) { + var CUSTOMERNAME = this.formHead.getForm().findField('CUSTOMERNAME').getValue(); + Ext.apply(store.proxy.extraParams, { CUSTOMERNAME: CUSTOMERNAME }); + }, this); this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '揽货人', store: this.storeOpCode2, diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpAiri/MsOpAiriEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpAiri/MsOpAiriEdit.js index b5d42820..d9640588 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpAiri/MsOpAiriEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpAiri/MsOpAiriEdit.js @@ -102,6 +102,10 @@ Ext.extend(Shipping.MsOpAiriEdit, Ext.Panel, { displayField: 'CodeAndName', value: SHOWNAME }); + this.storeOpCode2.on('beforeload', function (store) { + var CUSTOMERNAME = this.formHead.getForm().findField('CUSTOMERNAME').getValue(); + Ext.apply(store.proxy.extraParams, { CUSTOMERNAME: CUSTOMERNAME }); + }, this); //揽货人 this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: '揽货人', diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiEdit.js index 295c0312..f6e6eb66 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeai/MsOpSeaiEdit.js @@ -97,15 +97,22 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, { //揽货人 this.storeSALECode = Ext.create('DsExt.ux.RefTableStore', { model: 'DsShipping.ux.UserRefModel', - proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' } + proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' } }); - this.storeSALECode.load(); + //this.storeSALECode.load(); + this.storeSALECode.on('beforeload', function (store) { + var CUSTOMERNAME = this.formHead.getForm().findField('CUSTOMERNAME').getValue(); + Ext.apply(store.proxy.extraParams, { CUSTOMERNAME: CUSTOMERNAME }); + }, this); this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', { fieldLabel: Zi.LAN.SALE, //'揽货人', store: this.storeSALECode, //flex: 0.8, forceSelection: true, id: 'SALE', + queryMode: 'remote', + minChars: 0, + queryParam: 'CODENAME', name: 'SALE', valueField: 'UserName', displayField: 'CodeAndName', diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOp_InternalTrade/MsOp_InternalTradeEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOp_InternalTrade/MsOp_InternalTradeEdit.js index 8b29c4cb..9c21eb06 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOp_InternalTrade/MsOp_InternalTradeEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOp_InternalTrade/MsOp_InternalTradeEdit.js @@ -1835,7 +1835,7 @@ Ext.extend(Shipping.MsOp_InternalTradeEdit, Ext.Panel, { parentWin = window.parent.opener; this.LoadInitData(); - + this.LoadMustBe(); this.InitData(); //#region 其他 @@ -2295,6 +2295,39 @@ Ext.extend(Shipping.MsOp_InternalTradeEdit, Ext.Panel, { } return str_num; + }, + LoadMustBe: function () { + this.storeMustBe.load({ + params: { condition: "BSTYPE='内贸海运业务'" }, + callback: function (r, options, success) { + if (success) { + if (this.storeMustBe.getCount() > 0) { + for (var j = 0; j < this.storeMustBe.getCount(); j += 1) { + var member = this.storeMustBe.getAt(j); + var headfield = this.formHead.getForm().findField(member.data.FIELDNAME); + if (headfield != NaN && headfield != null) { + if (member.data.ISMUST == "1") + headfield.allowBlank = false; + if (member.data.ISCOLOR == "1") + headfield.setFieldStyle({ background: '#ffc' }); + if (member.data.ISREADONLY == "1") + headfield.setReadOnly(true); + + } + + + }; + + + } else { + + } + } + }, + scope: this + }); + + }, setSaveBtnStatus: function (enable) { diff --git a/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcEdit_WFSDIndex.js b/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcEdit_WFSDIndex.js index 83bbcf94..63c648ce 100644 --- a/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcEdit_WFSDIndex.js +++ b/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcEdit_WFSDIndex.js @@ -1308,6 +1308,7 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, { text: "新建", id: "btnadd", //hidden: true, iconCls: "btnadd", handler: function (button, event) { + this.SelectedstoreList = this.storeList; this.OprationStatus = 'add'; this.SelectPGID = ''; @@ -1315,6 +1316,42 @@ Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, { // this.onAddPCClick(); }, scope: this + }, { + text: "复制新建", id: "btnaddcopy", //hidden: true, + iconCls: "btnadd", + handler: 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 record = selections[0]; + this.SelectedRecord = record; + this.SelectedstoreList = this.storeList; + this.OprationStatus = 'copy'; + this.SelectPGID = ''; + DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/Edit'); + // this.onAddPCClick(); + }, + scope: this + }, { + text: "复制新建(含费用)", id: "btnaddcopyfee", //hidden: true, + iconCls: "btnadd", + handler: 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 record = selections[0]; + this.SelectedRecord = record; + this.SelectedstoreList = this.storeList; + this.OprationStatus = 'copyfee'; + this.SelectPGID = ''; + DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/Edit'); + // this.onAddPCClick(); + }, + scope: this }, { text: "删除", id: "btndelete", //hidden: true, iconCls: "btndelete", diff --git a/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcWFSDEdit.js b/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcWFSDEdit.js index 41cf1c5a..22dfd3aa 100644 --- a/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcWFSDEdit.js +++ b/DSWeb/Areas/TruckMng/Viewsjs/MsWlBs/MsPcWFSDEdit.js @@ -1362,10 +1362,12 @@ Ext.extend(DsTruck.MsPcWFSDEdit, Ext.Panel, { this.selectPGID = ret[3]; } - if (this.opStatus == 'edit') + if (this.opStatus == 'edit' || this.opStatus == 'copy' || this.opStatus == 'copyfee') condition = " BillNo='" + this.editRecord.get('BillNo') + "'"; - - this.LoadData(this.opStatus, condition); + if (this.opStatus == 'copy' || this.opStatus == 'copyfee') + this.LoadCopyData(this.opStatus, condition); + else + this.LoadData(this.opStatus, condition); }, //end InitData @@ -1505,6 +1507,165 @@ Ext.extend(DsTruck.MsPcWFSDEdit, Ext.Panel, { }); + }, // end LoadDate + + LoadCopyData: function (opstatus, condition) { + + this.fixSerialNo = 0; + this.fixBodyDel = []; + + this.opStatus = opstatus; + Ext.Ajax.request({ + waitMsg: '正在查询主表数据...', + url: '/TruckMng/PcHeadEdit_WFSD/GetData', + params: { + handle: 'edit', + 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); + + var basicForm = this.formEdit.getForm(); + + basicForm.findField('gId').setDisabled(false); + var field = basicForm.findField('gId'); + var BSNO = 'PC' + NewGuid(); + var oldbsno = field.getValue(); + var oldmasterno = basicForm.findField('PGid').getValue(); + field.setValue(BSNO); + if (oldbsno == "" || oldbsno == oldmasterno) { + field = basicForm.findField('PGid'); + field.setValue(BSNO); + } + field = basicForm.findField('BillNo'); + field.setValue(''); + if (this.opStatus == 'copyfee') { + this.LoadCopyFeeData(oldbsno, BSNO); + } else { + _thisPc.panelFee.strBSNO = BSNO; + _thisPc.panelFee.storeDrChFee.removeAll(); + _thisPc.panelFee.storeCrChFee.removeAll(); + } + this.editRecord.set('gId', BSNO); + this.opStatus = 'add'; + + if (this.selectPGID != '') { + var PGid = this.formEdit.getForm().findField('PGid'); + PGid.setValue(this.selectPGID); + if (this.editRecord != NaN && this.editRecord != null) { + this.formEdit.getForm().findField('CustomerName').setValue(this.editRecord.get('CustomerName')); + this.formEdit.getForm().findField('F_CustomerName').setValue(this.editRecord.get('F_CustomerName')); + this.formEdit.getForm().findField('LinkMan').setValue(this.editRecord.get('LinkMan')); + this.formEdit.getForm().findField('CustName').setValue(this.editRecord.get('CustName')); + this.formEdit.getForm().findField('DispatchName').setValue(this.editRecord.get('DispatchName')); + this.formEdit.getForm().findField('BLTYPE').setValue('派车分票'); + this.formEdit.getForm().findField('DstArea').setValue(this.editRecord.get('DstArea')); + this.formEdit.getForm().findField('DetiNation').setValue(this.editRecord.get('DetiNation')); + this.formEdit.getForm().findField('LoadPlace').setValue(this.editRecord.get('LoadPlace')); + this.formEdit.getForm().findField('PcBillType').setValue(this.editRecord.get('PcBillType')); + this.formEdit.getForm().findField('ExpDate').setValue(this.editRecord.get('ExpDate')); + this.formEdit.getForm().findField('ArriveDate').setValue(this.editRecord.get('ArriveDate')); + this.formEdit.getForm().findField('ReturnDate').setValue(this.editRecord.get('ReturnDate')); + this.formEdit.getForm().findField('TruckNo').setValue(this.editRecord.get('TruckNo')); + } + } + this.LoadPeriod(); + if (data.PCSTATUSREF != '完成') { + this.setSaveBtnStatus(true); + } else { + this.setSaveBtnStatus(false); + } + var editp = Ext.create('PCmb', data); + + + + var children = this.tabSeaepanel.items; + if (children) { + for (var i = children.length - 1, len = 0; i >= len; i--) { + if (children.items[i].id) { + if (children.items[i].id == 'pnlmodPcAmendFee') { + children.items[i].close(); + } + } + } + } + + this.paneltabfeeamend = new Shipping.PcAmendFee({ + id: 'pnlmodPcAmendFee', + layout: "border", + region: "center", + autoScroll: true, + frame: false, + closable: true, + title: '更改单信息' + }); + + + this.tabSeaepanel.add(this.paneltabfeeamend); + this.tabSeaepanel.doLayout(); + + + this.panelReceipt = new Shipping.ReceiptEditGrid({ + region: 'center', + layout: 'border', + title: '单据信息' + }); + + + this.panelReceipt.EditRecord = this.editRecord; + this.panelReceipt.stroplb = 'tMsWlPcHead'; + this.panelReceipt.strBSNO = BSNO; + this.panelReceipt.strMBLNO = this.editRecord.get('MblNoSe'); + this.panelReceipt.StoreDrOpRange.load({ params: { optype: "modOpReceiptManagement" } }); + this.panelReceipt.storeDrOpReceipt.load({ params: { billno: BSNO, optype: "tMsWlPcHead" } }); + this.panelReceipt.storeDocList.load({ params: { condition: " BSNO='" + BSNO+ "'" } }); + + this.tabSeaepanel.add(this.panelReceipt); + this.tabSeaepanel.doLayout(); + + var paneltabitems = new Ext.Panel({ + id: 'pnlopstatus', + layout: "fit", + region: "center", + autoScroll: true, + frame: false, + closable: true, + title: '状态管理', + html: ' ' + }); + this.tabSeaepanel.add(paneltabitems); + this.tabSeaepanel.doLayout(); + + if (data.CustomerName != '') { + var s = " LINKID in (select gid from [info_client] where SHORTNAME='" + data.CustomerName + "')"; + this.storeInfoClientContact.load({ params: { condition: s } }); + } + + } else { + Ext.MessageBox.alert('请求出现错误,请重试', response.responseText); + } + }, + scope: this + }); + + }, // end LoadDate LoadFeeData: function (EditRecord) { @@ -1529,8 +1690,76 @@ Ext.extend(DsTruck.MsPcWFSDEdit, Ext.Panel, { //this.storeBodyFix.load({ params: { billno: bsno } }); }, // end LoadDate + LoadCopyFeeData: function (oldbsno, bsno) { + this.panelFee.EditRecord = this.editRecord; + this.panelFee.strBSNO = bsno; + this.panelFee.StoreDateCurr.load({ params: { optype: "tMsWlPcHead", bsno: oldbsno } }); + this.panelFee.StoreUnit.load({ params: { bsno: oldbsno, bstype: "tMsWlPcHead" } }); + + this.panelFee.storeDrChFee.load({ + params: { billno: oldbsno, type: 1, optype: "tMsWlPcHead" }, + callback: function (r, options, success) { + if (success) { + + if (_thisPc.panelFee.storeDrChFee.getCount() > 0) { + for (var j = 0; j < _thisPc.panelFee.storeDrChFee.getCount(); j += 1) { + var memberbody = _thisPc.panelFee.storeDrChFee.getAt(j); + memberbody.set("GId", NewGuid()); + memberbody.set("BsNo", "*"); + memberbody.set("FeeStatus",1); + memberbody.commit(); + } + } else { + _thisPc.panelFee.storeDrChFee.removeAll(); + } + } + }, + scope: this }); + this.panelFee.storeCrChFee.load({ + params: { billno: oldbsno, type: 2, optype: "tMsWlPcHead" }, + callback: function (r, options, success) { + if (success) { + if (_thisPc.panelFee.storeCrChFee.getCount() > 0) { + for (var j = 0; j < _thisPc.panelFee.storeCrChFee.getCount(); j += 1) { + var memberbody = _thisPc.panelFee.storeCrChFee.getAt(j); + memberbody.set("GId", NewGuid()); + memberbody.set("BsNo", "*"); + memberbody.set("FeeStatus", 1); + memberbody.commit(); + } + } else { + _thisPc.panelFee.storeCrChFee.removeAll(); + } + } + }, + scope: this + }); + this.panelFee.storeBodySum.removeAll(); + this.panelFee.storeChFeeGain.removeAll(); + this.panelFee.storeBodyList_GuDingFeeWeiHu.load(); + this.storeCtnList.load({ + params: { condition: "LE_ID='" + oldbsno + "'" }, + callback: function (r, options, success) { + if (success) { + if (_this.storeCtnList.getCount() > 0) { + for (var j = 0; j < _this.storeCtnList.getCount(); j += 1) { + var memberbody = _this.storeCtnList.getAt(j); + memberbody.set("BSNO", "*"); + memberbody.commit(); + } + } else { + _this.storeCtnList.removeAll(); + } + } + }, + scope: this + }); + + //this.storeBodyFix.load({ params: { billno: bsno } }); + }, // end LoadDate + LoadPeriod: function (opstatus) { Ext.Ajax.request({ waitMsg: Zi.LAN.ZhengZaiChaXunShuJu, //'正在查询主表数据...', @@ -1676,6 +1905,9 @@ Ext.extend(DsTruck.MsPcWFSDEdit, Ext.Panel, { memberbody.commit(); }; + this.panelFee.strBSNO = LE_ID; + this.panelFee.StoreDateCurr.load({ params: { optype: "tMsWlPcHead", bsno: LE_ID } }); + this.panelFee.StoreUnit.load({ params: { bsno: LE_ID, bstype: "tMsWlPcHead" } }); } else if (type == '1') { window.close(); } else {