From 8f7fd017ffa14e6b3e2ec0a984e9370d88cb7c09 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期四, 03 四月 2025 08:58:17 +0800
Subject: [PATCH]  修改送货日期

---
 CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx.cs          |   89 ++++++++++++++
 CY_ECommercePlatform/CY.WebForm/CY.WebForm.csproj                                   |   12 ++
 CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx.designer.cs |   62 ++++++++++
 CY_ECommercePlatform/CY.WebForm/Pages/business/FileUploadHandler.ashx.cs            |   96 ++++++++++++++++
 CY_ECommercePlatform/CY.WebForm/Pages/work/MyRequestAdd.aspx                        |    4 
 CY_ECommercePlatform/CY.WebForm/Pages/business/FileUploadHandler.ashx               |    1 
 CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx             |   46 +++++++
 CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanList.aspx                 |    9 +
 CY_ECommercePlatform/CY.WebForm/Pages/business/Waixiefukuanshenqing.aspx            |    4 
 9 files changed, 318 insertions(+), 5 deletions(-)

diff --git a/CY_ECommercePlatform/CY.WebForm/CY.WebForm.csproj b/CY_ECommercePlatform/CY.WebForm/CY.WebForm.csproj
index 7b52558..f6872de 100644
--- a/CY_ECommercePlatform/CY.WebForm/CY.WebForm.csproj
+++ b/CY_ECommercePlatform/CY.WebForm/CY.WebForm.csproj
@@ -1898,6 +1898,7 @@
     <Content Include="Pages\business\DeliverPlanShifou.aspx" />
     <Content Include="Pages\business\DeliverPlanLishiPrint.aspx" />
     <Content Include="Pages\business\DeliverPlanPaicheZhuyishixiang.aspx" />
+    <Content Include="Pages\business\DeliverPlanTimeEdit.aspx" />
     <Content Include="Pages\business\SHejiOrderEdit.aspx" />
     <Content Include="Pages\business\ShejijijianEdit.aspx" />
     <Content Include="Pages\business\ShejijijianList.aspx" />
@@ -3437,6 +3438,16 @@
     </Compile>
     <Compile Include="Pages\business\DeliverPlanPaicheZhuyishixiang.aspx.designer.cs">
       <DependentUpon>DeliverPlanPaicheZhuyishixiang.aspx</DependentUpon>
+    </Compile>
+    <Compile Include="Pages\business\DeliverPlanTimeEdit.aspx.cs">
+      <DependentUpon>DeliverPlanTimeEdit.aspx</DependentUpon>
+      <SubType>ASPXCodeBehind</SubType>
+    </Compile>
+    <Compile Include="Pages\business\DeliverPlanTimeEdit.aspx.designer.cs">
+      <DependentUpon>DeliverPlanTimeEdit.aspx</DependentUpon>
+    </Compile>
+    <Compile Include="Pages\business\FileUploadHandler.ashx.cs">
+      <DependentUpon>FileUploadHandler.ashx</DependentUpon>
     </Compile>
     <Compile Include="Pages\business\SHejiOrderEdit.aspx.cs">
       <DependentUpon>SHejiOrderEdit.aspx</DependentUpon>
@@ -9417,6 +9428,7 @@
     <Content Include="Pages\business\SendAllCorEmail.aspx" />
     <Content Include="OnlineAdviserLOGO.ashx" />
     <None Include="packages.config" />
+    <Content Include="Pages\business\FileUploadHandler.ashx" />
     <None Include="Pages\common\skin\Thumbs.db" />
     <Content Include="Pages\sysInquiry\CalculatePaperPriceHandler.ashx" />
     <Content Include="Pages\Templet\Default\Shared\Company.Master" />
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanList.aspx b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanList.aspx
index 3ea3c20..50f23bd 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanList.aspx
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanList.aspx
@@ -308,6 +308,13 @@
            // OpenWindowByUrl();
             OpenWindowByUrl('/Pages/business/DeliverPlanPrint.aspx?DeliverTime=' + DeliveryTime + '&CarId=' + CarId + '&DriverId=' + DriverId + '&CustormerName=' + CustormerName + '&BusinessManager=' + BusinessManager + '&Paiche=' + Paiche, '', '');
         }
+
+
+        //鏌ョ湅瀹㈡埛璧勬枡
+        function ViewTime(Keyid, DelayTime) {
+            top.Dialog.open({ URL: "/Pages/business/DeliverPlanTimeEdit.aspx?Keyid=" + Keyid + "&DelayTime=" + DelayTime, Title: "寤惰繜閫佽揣鏃堕棿", Width: 300, Height: 300 });
+        }
+
     </script>
     <style type="text/css">
         .tableStyleXS th { padding: 1px 0 1px 3px; background-image:none; border-bottom:1px solid #CCC; }
@@ -566,7 +573,7 @@
                                     <%#Eval("SellerOrderId")%>
                                 </td>
                                 <td>
-                                    <%#Eval("DeliverTime", "{0:yyyy-MM-dd}")%>
+                              <a href='javascript:void(0)' title='鐐瑰嚮淇敼閫佽揣鏃ユ湡' class='a_under' onclick='ViewTime("<%#Eval("Keyid")%>","<%#Eval("DeliverTime", "{0:yyyy-MM-dd}")%>")'> <%#Eval("DeliverTime", "{0:yyyy-MM-dd}")%>    </a>      
                                 </td>
                                 <%--<td>
                                       <%#Eval("DeliveredTime", "{0:yyyy-MM-dd}")%>
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx
new file mode 100644
index 0000000..b55f86a
--- /dev/null
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx
@@ -0,0 +1,46 @@
+锘�<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DeliverPlanTimeEdit.aspx.cs" Inherits="CY.WebForm.Pages.business.DeliverPlanTimeEdit" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+    <title>鏂板/淇敼寤惰繜瀹屽伐鏃堕棿</title>
+    <uc:CMSHead ID="CMSHead1" runat="server" />
+    <script src="../../js/business/Custom.js" type="text/javascript"></script>
+     <script type="text/javascript">
+
+        
+
+     </script>
+</head>
+<body>
+    <form runat="server" id="form1" class="form2">
+        <fieldset>
+            <legend>鍩烘湰淇℃伅</legend>
+            <table class="tableStyle" width="100%">
+		        <tr>
+                      <td class="ali03 ">寤惰繜瀹屽伐鏃堕棿锛�</td>
                     
                     <td ><input id="txtDelayTime" type="text" runat="server"  maxlength="50" class=" date w90px" datefmt="yyyy-MM-dd"  /></td>
+
+
+                   
+                </tr>
+                 <tr>
+                   
+                    
+                    <td class="ali02" colspan="2">
+                        
+                        <asp:Button ID="btn_Submit" Text="淇濆瓨" runat="server" OnClick="btn_Submit_Config" /> 
+                       
+                        <input type="hidden" id="HideKeyid" runat="server" /></td>
+                     
+                </tr>
+	        </table>
+        </fieldset>
+        
+       
+    </form>
+</body>
+<script type="text/javascript">
+     
+</script>
+</html>
\ No newline at end of file
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx.cs
new file mode 100644
index 0000000..a0eb817
--- /dev/null
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx.cs
@@ -0,0 +1,89 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using CY.BLL;
+using CY.Model;
+using CY.Infrastructure.Query;
+using CY.Infrastructure.Common;
+using CY.BLL.Sys;
+using System.Text;
+using CY.BLL.OA;
+using CY.BLL.EC;
+
+namespace CY.WebForm.Pages.business
+{
+    public partial class DeliverPlanTimeEdit : BasePage
+    {
+         OA_DeliverPlanBLL oA_DeliverPlanBLL = null;
+        
+        public DeliverPlanTimeEdit()
+        {
+
+            oA_DeliverPlanBLL = new OA_DeliverPlanBLL();
+            
+        }
+        protected void Page_Load(object sender, EventArgs e)
+        {
+            try
+            {
+                if (!IsPostBack)
+                {
+                    this.HideKeyid.Value = Request["Keyid"].ToString2();
+                    this.txtDelayTime.Value = Request["DelayTime"].ToString2();
+                }
+               
+               
+            }
+            catch (Exception ex)
+            {
+                PAGEHandleException(ex);
+                Response.Clear();
+                Response.Write("-1");
+            }
+            //Response.End();
+        }
+
+
+        //鎻愪氦浜嬩欢
+        protected void btn_Submit_Config(object sender, EventArgs e)
+        {
+            
+
+            try
+            {
+             
+                if (string.IsNullOrEmpty(this.HideKeyid.Value))
+                {
+                    JavaScript.MessageBox("娌℃湁璁㈠崟id", this);
+                }
+                if (this.txtDelayTime.Value.ToDateTime2() == null)
+                {
+                    JavaScript.MessageBox("璇锋纭~鍐欏欢杩熷畬宸ユ椂闂�", this);
+                }
+                string Keyid = this.HideKeyid.Value;
+                DateTime DelayTime = this.txtDelayTime.Value.ToDateTime2().Value;
+
+               var oA_DeliverPlan = oA_DeliverPlanBLL.GetModelByKeyid(Keyid.ToGuid2(),null,null);
+                oA_DeliverPlan.DeliverTime = DelayTime;
+                oA_DeliverPlan.Updater = CurrentUser.TrueMemberId;
+                oA_DeliverPlan.LastUpdateTime = DateTime.Now;
+
+                bool result = oA_DeliverPlanBLL.UpdateModel(oA_DeliverPlan);
+
+                if (result)
+                    JavaScript.MessageBox("鏇存柊鎴愬姛", this, true, true);
+                else
+                    JavaScript.MessageBox("鏇存柊澶辫触", this);
+
+            }
+            catch (Exception ex)
+            {
+                PAGEHandleException(ex);
+                JavaScript.MessageBox("鎿嶄綔澶辫触", this);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx.designer.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx.designer.cs
new file mode 100644
index 0000000..31b3664
--- /dev/null
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanTimeEdit.aspx.designer.cs
@@ -0,0 +1,62 @@
+锘�//------------------------------------------------------------------------------
+// <鑷姩鐢熸垚>
+//     姝や唬鐮佺敱宸ュ叿鐢熸垚銆�
+//
+//     瀵规鏂囦欢鐨勬洿鏀瑰彲鑳藉鑷翠笉姝g‘鐨勮涓猴紝濡傛灉
+//     閲嶆柊鐢熸垚浠g爜锛屽垯鎵�鍋氭洿鏀瑰皢涓㈠け銆�
+// </鑷姩鐢熸垚>
+//------------------------------------------------------------------------------
+
+namespace CY.WebForm.Pages.business
+{
+
+
+    public partial class DeliverPlanTimeEdit
+    {
+
+        /// <summary>
+        /// CMSHead1 鎺т欢銆�
+        /// </summary>
+        /// <remarks>
+        /// 鑷姩鐢熸垚鐨勫瓧娈点��
+        /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲��
+        /// </remarks>
+        protected global::CY.WebForm.Pages.common.CMSHead CMSHead1;
+
+        /// <summary>
+        /// form1 鎺т欢銆�
+        /// </summary>
+        /// <remarks>
+        /// 鑷姩鐢熸垚鐨勫瓧娈点��
+        /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲��
+        /// </remarks>
+        protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+        /// <summary>
+        /// txtDelayTime 鎺т欢銆�
+        /// </summary>
+        /// <remarks>
+        /// 鑷姩鐢熸垚鐨勫瓧娈点��
+        /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲��
+        /// </remarks>
+        protected global::System.Web.UI.HtmlControls.HtmlInputText txtDelayTime;
+
+        /// <summary>
+        /// btn_Submit 鎺т欢銆�
+        /// </summary>
+        /// <remarks>
+        /// 鑷姩鐢熸垚鐨勫瓧娈点��
+        /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲��
+        /// </remarks>
+        protected global::System.Web.UI.WebControls.Button btn_Submit;
+
+        /// <summary>
+        /// HideKeyid 鎺т欢銆�
+        /// </summary>
+        /// <remarks>
+        /// 鑷姩鐢熸垚鐨勫瓧娈点��
+        /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲��
+        /// </remarks>
+        protected global::System.Web.UI.HtmlControls.HtmlInputHidden HideKeyid;
+    }
+}
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/FileUploadHandler.ashx b/CY_ECommercePlatform/CY.WebForm/Pages/business/FileUploadHandler.ashx
new file mode 100644
index 0000000..48e2be2
--- /dev/null
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/FileUploadHandler.ashx
@@ -0,0 +1 @@
+锘�<%@ WebHandler Language="C#" CodeBehind="FileUploadHandler.ashx.cs" Class="CY.WebForm.Pages.business.FileUploadHandler" %>
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/FileUploadHandler.ashx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/FileUploadHandler.ashx.cs
new file mode 100644
index 0000000..97663b3
--- /dev/null
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/FileUploadHandler.ashx.cs
@@ -0,0 +1,96 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Web;
+using System.Web.Script.Serialization;
+
+namespace CY.WebForm.Pages.business
+{
+    /// <summary>
+    /// FileUploadHandler 鐨勬憳瑕佽鏄�
+    /// </summary>
+    public class FileUploadHandler : IHttpHandler
+    {
+
+        public void ProcessRequest(HttpContext context)
+        {
+            context.Response.ContentType = "application/json";
+
+            try
+            {
+                if (context.Request.Files.Count > 0)
+                {
+                    HttpPostedFile file = context.Request.Files["file"];
+
+                    // 楠岃瘉鏂囦欢
+                    if (file.ContentLength > 0)
+                    {
+                        // 妫�鏌ユ枃浠跺ぇ灏忔槸鍚﹁秴杩�5MB
+                        if (file.ContentLength > 5 * 1024 * 1024) // 5MB
+                        {
+                            throw new Exception("鏂囦欢涓嶈兘澶т簬5M");
+                        }
+                        // 璁剧疆淇濆瓨璺緞
+                        string fileName = DateTime.Now.ToString("HHmmssfff")+ Path.GetFileName(file.FileName);
+                        string riqi = DateTime.Now.ToString("yyyyMMdd");
+                        string fileDirectory = "/UpFile/UpFile/" + riqi + "/";
+                        if ((fileDirectory + fileName).Length>400) // 5MB
+                        {
+                            throw new Exception("鏂囦欢鍚嶅瓧杩囬暱");
+                        }
+                        string fileExtension = Path.GetExtension(fileName);
+                        string savePath = context.Server.MapPath("~"+ fileDirectory) + fileName;
+
+                        // 纭繚鐩綍瀛樺湪
+                        if (!Directory.Exists(context.Server.MapPath("~"+ fileDirectory)))
+                        {
+                            Directory.CreateDirectory(context.Server.MapPath("~"+ fileDirectory));
+                        }
+
+                        // 淇濆瓨鏂囦欢
+                        file.SaveAs(savePath);
+
+                        // 杩斿洖JSON鍝嶅簲
+                        var response = new
+                        {
+                            code = 1,
+                            message = "鏂囦欢涓婁紶鎴愬姛",
+                            fileName = fileName,
+                            fileSize = file.ContentLength,
+                            data = fileDirectory + fileName
+                        };
+
+                        context.Response.Write(new JavaScriptSerializer().Serialize(response));
+                    }
+                    else
+                    {
+                        throw new Exception("鏂囦欢鍐呭涓虹┖");
+                    }
+                }
+                else
+                {
+                    throw new Exception("娌℃湁鎺ユ敹鍒版枃浠�");
+                }
+            }
+            catch (Exception ex)
+            {
+                var errorResponse = new
+                {
+                    code = 2,
+                    message = ex.Message
+                };
+
+                context.Response.Write(new JavaScriptSerializer().Serialize(errorResponse));
+            }
+        }
+
+        public bool IsReusable
+        {
+            get
+            {
+                return false;
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/Waixiefukuanshenqing.aspx b/CY_ECommercePlatform/CY.WebForm/Pages/business/Waixiefukuanshenqing.aspx
index 7a4456a..a2dc2c7 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/business/Waixiefukuanshenqing.aspx
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/Waixiefukuanshenqing.aspx
@@ -199,7 +199,7 @@
 
 
                 $.ajax({
-                    url: 'https://yocaisim.51zhengcai.com/api/UpFile/UpdateFile', // 鏇挎崲涓轰綘鐨勬湇鍔″櫒绔偣
+                    url: '/Pages/business/FileUploadHandler.ashx', // 鏇挎崲涓轰綘鐨勬湇鍔″櫒绔偣
                     type: 'POST',
                     data: formData,
                     contentType: false,
@@ -217,7 +217,7 @@
                             $('a[name="HrefAttachmentFapiao"]').last().html('<img src="' + response.data+'" width="20" height="20" />');
                             alertMsg('涓婁紶鎴愬姛');
                         } else {
-                            alertMsg('涓婁紶澶辫触');
+                            alertMsg(response.message);
                         }
 
 
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/work/MyRequestAdd.aspx b/CY_ECommercePlatform/CY.WebForm/Pages/work/MyRequestAdd.aspx
index 232079f..294c596 100644
--- a/CY_ECommercePlatform/CY.WebForm/Pages/work/MyRequestAdd.aspx
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/work/MyRequestAdd.aspx
@@ -120,7 +120,7 @@
 
 
             $.ajax({
-                url: 'https://yocaisim.51zhengcai.com/api/UpFile/UpdateFile', // 鏇挎崲涓轰綘鐨勬湇鍔″櫒绔偣
+                url: '/Pages/business/FileUploadHandler.ashx', // 鏇挎崲涓轰綘鐨勬湇鍔″櫒绔偣
                 type: 'POST',
                 data: formData,
                 contentType: false,
@@ -138,7 +138,7 @@
                         $('a[name="HrefAttachmentFapiao"]').last().html('<img src="' + response.data + '" width="20" height="20" />');
                         alertMsg('涓婁紶鎴愬姛');
                     } else {
-                        alertMsg('涓婁紶澶辫触');
+                        alertMsg(response.message);
                     }
 
 

--
Gitblit v1.9.1