From 8e651dc1cbe2275c8bb4f8e0b08fb819d8df3ef8 Mon Sep 17 00:00:00 2001 From: alina <1449359159@qq.com> Date: Wed, 15 Mar 2023 09:10:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A8=82=E5=96=AE=E5=BE=8C=E8=87=BA=E8=A6=81?= =?UTF-8?q?=E8=83=BD=E9=A1=AF=E7=A4=BA=E4=B8=8A=E5=82=B3=E7=9A=84=E5=8C=AF?= =?UTF-8?q?=E6=AC=BE=E5=96=AE=E5=9C=96=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShowEasy/BookingMaintain_UpdService.cs | 57 ++++++++++++------- .../Entity/Sugar/SETB_SAL_BookingOnline.cs | 8 ++- .../ViewModels/View_SAL_BookingOnline.cs | 2 + .../Page/ShowEasy/BookingMaintain_Upd.html | 26 +++++++-- .../pages/ShowEasy/BookingMaintain_Upd.js | 49 ++++++++++++++-- 5 files changed, 109 insertions(+), 33 deletions(-) diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/BookingMaintain_UpdService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/BookingMaintain_UpdService.cs index 9e08ccd..41a4bb0 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/BookingMaintain_UpdService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/BookingMaintain_UpdService.cs @@ -29,21 +29,19 @@ namespace EasyBL.WEBAPP.WSM do { var sBookingID = _fetchString(i_crm, @"BookingID"); - var oEntity = db.Queryable - ((t1, t2, t3, t4, t5, t6) => + var oEntity = db.Queryable + ((t1, t2, t3, t4, t5, t6,t7) => new object[] { JoinType.Left, t1.OrgID == t2.OrgID && t1.CreateUser == t2.MemberID, JoinType.Left, t1.OrgID == t3.OrgID && t1.ModifyUser == t3.MemberID, JoinType.Left, t1.ServiceID == t4.ServiceID && t1.OrgID==t4.OrgID && t1.LangType==t4.LangID, JoinType.Left, t1.OrgID == t5.OrgID && t1.Account == t5.Account , - JoinType.Left, t1.OrgID == t6.OrgID && t4.SupplierID == t6.SupplierID && t4.LangID == t6.LangType - - - + JoinType.Left, t1.OrgID == t6.OrgID && t4.SupplierID == t6.SupplierID && t4.LangID == t6.LangType, + JoinType.Left, t1.BookingID == t7.BookingID } ) - .Where((t1, t2, t3, t4, t5, t6) => t1.OrgID == i_crm.ORIGID && t1.BookingID == sBookingID) - .Select((t1, t2, t3, t4, t5, t6) => new View_SAL_BookingOnline + .Where((t1, t2, t3, t4, t5, t6, t7) => t1.OrgID == i_crm.ORIGID && t1.BookingID == sBookingID) + .Select((t1, t2, t3, t4, t5, t6, t7) => new View_SAL_BookingOnline { ServiceID = SqlFunc.GetSelfAndAutoFill(t1.ServiceID), CreateUserName = t2.MemberName, @@ -51,10 +49,15 @@ namespace EasyBL.WEBAPP.WSM MemberName = t5.LastName + t5.FirstName, MemberEmail=t5.Email, ServiceName=t4.ServiceName, - SupplierName=t6.CompanyName + SupplierName=t6.CompanyName, + PaymentRemittance=t7.Remittance }) .Single(); + + + + rm = new SuccessResponseMessage(null, i_crm); rm.DATA.Add(BLWording.REL, oEntity); } while (false); @@ -76,7 +79,7 @@ namespace EasyBL.WEBAPP.WSM #endregion 預訂維護(單筆查詢 call BookingMaintainQryService QueryOne) - #region 確認 拒絕 + #region 確認 拒絕 更新供應商狀態與訂單狀態 /// /// 確認拒絕 /// @@ -264,7 +267,7 @@ namespace EasyBL.WEBAPP.WSM #endregion Onsite管理其他資訊編輯(修改) - #region 處理中,已完成 + #region 更新供應商狀態 處理中,已完成 /// /// 處理中,已完成 /// @@ -437,8 +440,7 @@ namespace EasyBL.WEBAPP.WSM #endregion Onsite管理其他資訊編輯(修改) - - #region 修改狀態 + #region 訂單修改 /// /// 供應商管理編輯(修改) @@ -458,9 +460,11 @@ namespace EasyBL.WEBAPP.WSM { var sBookingID = _fetchString(i_crm, @"BookingID"); - var oNewEntity = _fetchEntity(i_crm); - - + var oNewEntity = _fetchEntity(i_crm); + //供應商狀態已完成 付款狀態已完成的時候,訂單狀態自動變成已完成 + if (oNewEntity.SupplierStatus == "04" && oNewEntity.PaymentStatus == "03") { + oNewEntity.BookingStatus = "03"; + } var oBookingOnline = new SETB_SAL_BookingOnline { PaymentStatus = oNewEntity.PaymentStatus, @@ -473,8 +477,8 @@ namespace EasyBL.WEBAPP.WSM .UpdateColumns(it => new { it.PaymentStatus, it.BookingStatus, it.Message, it.ModifyUser, it.ModifyDate }) .Where(x => x.BookingID == sBookingID && x.OrgID == i_crm.ORIGID).ExecuteCommand(); - //訂單狀態進行中 付款狀態已付款時 - if (iRel > 0 && (oNewEntity.PaymentStatus == "03" && oNewEntity.BookingStatus=="02")) { + //訂單狀態進行中 付款狀態已付款時 且是第一次發送時 + if (iRel > 0 && (oNewEntity.PaymentStatus == "03" && string.IsNullOrEmpty(oNewEntity.PSendMailFlag))) { var objBookingOnline = db.Queryable ((t1, t2, t3,t4) => @@ -530,10 +534,7 @@ namespace EasyBL.WEBAPP.WSM if (oNewEntity.PaymentStatus == "03") { - //收款后 - - try { //開始寄信 @@ -553,6 +554,20 @@ namespace EasyBL.WEBAPP.WSM oEmail.Attachments = null; oEmail.EmailTo = toEmail; var bSend = new MailService(i_crm.ORIGID, true).MailFactory(oEmail, out sError); + + + var sUploadTime = db.Updateable() //更新付款時間 + .UpdateColumns(x => new SETB_SAL_Payment { PaymentDate = DateTime.Now }) + .Where(x => x.BookingID == objBookingOnline.BookingID) + .ExecuteCommand(); + + var sBookingStatus = db.Updateable() //更新已付款發送郵件的記錄 + .UpdateColumns(x => new SETB_SAL_BookingOnline { PSendMailFlag = objBookingOnline.PaymentStatus }) + .Where(x => x.BookingID == objBookingOnline.BookingID) + .ExecuteCommand(); + + + } catch (Exception) { diff --git a/EuroTran/Entity/Sugar/SETB_SAL_BookingOnline.cs b/EuroTran/Entity/Sugar/SETB_SAL_BookingOnline.cs index 0995e43..b73d93e 100644 --- a/EuroTran/Entity/Sugar/SETB_SAL_BookingOnline.cs +++ b/EuroTran/Entity/Sugar/SETB_SAL_BookingOnline.cs @@ -218,7 +218,13 @@ namespace Entity.Sugar public string Message { get; set; } public const string CN_MESSAGE = "Message"; - + /// + /// Desc: + /// Default: + /// Nullable:False + /// + public string PSendMailFlag { get; set; } + public const string CN_PSENDMAILFLAG = "PSendMailFlag"; } } diff --git a/EuroTran/Entity/ViewModels/View_SAL_BookingOnline.cs b/EuroTran/Entity/ViewModels/View_SAL_BookingOnline.cs index 02567dc..e3a7fb6 100644 --- a/EuroTran/Entity/ViewModels/View_SAL_BookingOnline.cs +++ b/EuroTran/Entity/ViewModels/View_SAL_BookingOnline.cs @@ -23,5 +23,7 @@ namespace Entity.ViewModels public string ExhibitionName { get; set; } public string CurrencyName { get; set; } + + public string PaymentRemittance { get; set; } } } \ No newline at end of file diff --git a/EuroTran/WebApp/Page/ShowEasy/BookingMaintain_Upd.html b/EuroTran/WebApp/Page/ShowEasy/BookingMaintain_Upd.html index c7cb5a1..6cbbaec 100644 --- a/EuroTran/WebApp/Page/ShowEasy/BookingMaintain_Upd.html +++ b/EuroTran/WebApp/Page/ShowEasy/BookingMaintain_Upd.html @@ -13,6 +13,8 @@ + + @@ -39,6 +41,9 @@ 訂購號碼 + + +
@@ -62,6 +67,7 @@
+
- +
@@ -183,8 +189,8 @@
- - + +
@@ -262,6 +268,14 @@ + + +
diff --git a/EuroTran/WebApp/Scripts/pages/ShowEasy/BookingMaintain_Upd.js b/EuroTran/WebApp/Scripts/pages/ShowEasy/BookingMaintain_Upd.js index 66ce2ca..1e12326 100644 --- a/EuroTran/WebApp/Scripts/pages/ShowEasy/BookingMaintain_Upd.js +++ b/EuroTran/WebApp/Scripts/pages/ShowEasy/BookingMaintain_Upd.js @@ -177,10 +177,12 @@ var fnPageInit = function () { //啓用 當訂單狀態進行中,已完成,付款狀態可使用 $('#PaymentStatus').prop('disabled', false); } - - - - + //訂單狀態禁用了,所有的形態都是自動產生的 + $('#BookingStatus').prop('disabled', true); + if (pargs.data.PaymentRemittance) { + $("#divPaymentRemittance").show(); + fnGetUploadFiles(pargs.data.PaymentRemittance, fnUpload, 'fileInput1');//, 'fileInput1' + } } }); @@ -263,9 +265,46 @@ var fnPageInit = function () { }); }); + //訂單取消 + $('#btnBookingCancel').click(function () { + var data = {}; + data.BookingID = $('#BookingID').val(); + data.BookingStatus = "04";//已取消 + return g_api.ConnectLite("BookingMaintain_Upd", "UpdateSupplierStatus", data, function (res) { + if (res.RESULT) { + showMsgAndGo(i18next.t("message.Modify_Success"), "BookingMaintain_Qry", ''); // ╠message.Save_Success⇒新增成功╣ + } + else { + showMsg(i18next.t("message.Modify_Failed") + '
' + res.MSG, 'error');// ╠message.Insert_Failed⇒新增失敗╣ + } + }, function () { + showMsg(i18next.t("message.Modify_Error"), 'error');// ╠message.Insert_Error⇒新增資料異常╣ + }); + }); + } }), + /** + * 上傳附件 + * @param {Array} files 當前文件 + * @param {String} parentid + * @param {String} inputid file input id + */ + fnUpload = function (files, parentid, inputid) { + var option = {}; + option.limit = 1; + option.type = 'one'; + option.theme = 'dragdropbox1'; + option.input = $('#fileInput1'); + option.parentid = parentid; + option.extensions = ['jpg', 'jpeg', 'png', 'bmp', 'gif', 'png', 'svg']; + option.folder = 'Booking'; + if (files) { + option.files = files; + } + fnUploadRegister(option); + }, /** * 停用輸入 @@ -292,4 +331,4 @@ var fnPageInit = function () { }; -require(['base', 'select2', 'jsgrid', 'util', 'cando'], fnPageInit); \ No newline at end of file +require(['base', 'select2', 'jsgrid', 'util', 'filer', 'cando'], fnPageInit); \ No newline at end of file