ソースを参照

新增偏远物流费

zhuyiyi 6 ヶ月 前
コミット
e5bd8fa375

+ 10 - 0
BizCom/Dao/CeErpTrade.cs

@@ -495,6 +495,16 @@ namespace BizCom
             get { return _receiverId; }
             set { _receiverId = value; }
         }
+        private double _delivery_paymant = 0;
+        /// <summary>
+        /// ÎïÁ÷·Ñ
+        /// </summary>
+        [Property]
+        public double delivery_paymant
+        {
+            get { return _delivery_paymant; }
+            set { _delivery_paymant = value; }
+        }
         public object Clone()
         {
             return this.MemberwiseClone();

+ 31 - 2
SiteCore/Handler/sync.order.cs

@@ -61,7 +61,7 @@ namespace SiteCore.Handler
             string poscode = CurrentUser.UserPost.Post.Code;
             DataStruct dStruct = GetPostStruct();
             //string a = SecurityHelper.DecryptSymmetric("YDaPXIhsKgw=");
-            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\uv特殊工艺价格(1).xls");
+            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\水标售价.xlsx");
             //apiHelper.Api_SyncOrderByTime("598825");
             //apiHelper.API_GetWaybill("ZTO-CAINIAO-TZJK", "4233447147588233939");
             //apiHelper.Api_SyacOrder("2460143282114312263", "yujia");
@@ -728,6 +728,7 @@ namespace SiteCore.Handler
                     entity.IsXianHuo = 0;
                     entity.isDianziOrder = 0;
                     entity.DispatchSort = 0;
+                    entity.IsVerifyToSupplier = false;
                     entity.FinishPlaceTime = null;
 
                     entity.Update();
@@ -1366,7 +1367,6 @@ namespace SiteCore.Handler
         {
             if (UrlPostParmsCheck("ctid"))
             {
-                ;
                 string eid = GetPostString("ctid");
                 CeErpTradeCell entity = null;
                 if (eid != "") entity = CeErpTradeCell.GetByCtid(eid);
@@ -1376,6 +1376,11 @@ namespace SiteCore.Handler
                     returnErrorMsg("台湾客户需填写身份证号!");
                     return;
                 }
+                if (commonHelper.isFarAddress(father.receiver_state) && father.delivery_paymant == 0)
+                {
+                    returnErrorMsg("偏远地区需要填写物流费!");
+                    return;
+                }
                 if (entity != null)
                 {
                     if (entity.ctid.IndexOf("C") != -1)
@@ -11035,6 +11040,11 @@ namespace SiteCore.Handler
                             returnErrorMsg("台湾客户需填写身份证!");
                             return;
                         }
+                        if (commonHelper.isFarAddress(ceErpTrade.receiver_state) && ceErpTrade.delivery_paymant == 0)
+                        {
+                            returnErrorMsg("偏远地区需要填写物流费!");
+                            return;
+                        }
                         if (string.IsNullOrEmpty(ceErpTradeCellExtend.spu_id) && !entity.ctid.Contains("N_") && !entity.ctid.Contains("S_"))
                         {
                             returnErrorMsg("订单spu没有确认无法通过审核!");
@@ -13867,6 +13877,25 @@ namespace SiteCore.Handler
             }
             returnErrorMsg("缺少必要的参数");
         }
+
+        public void addDeliveryPaymant()
+        {
+            string tid = GetPostString("tid");
+            string paymant = GetPostString("paymant");
+            CeErpTrade ceErpTrade = CeErpTrade.Get(tid);
+            if (ceErpTrade != null)
+            {
+                if (!string.IsNullOrEmpty(paymant))
+                {
+                    ceErpTrade.delivery_paymant = Convert.ToDouble(paymant);
+                }
+                ceErpTrade.Update();
+                LogHelper.addLog(tid, CurrentUser.UserID, "偏远物流费:" + paymant, 6);
+                returnSuccessMsg("保存成功");
+                return;
+            }
+            returnErrorMsg("缺少必要的参数");
+        }
     }
 
 }

+ 12 - 0
SiteCore/taobao/commonHelper.cs

@@ -2712,7 +2712,19 @@ namespace SiteCore
 
         public static List<int> spu_products = new List<int>() { 4, 13, 19, 24, 28, 32, 40, 51, 57, 1971, 2319, 2377, 2521, 2524, 2533, 2538, 2542, 2554, 2556, 2557, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2568, 2569, 2570, 2571, 2572, 2619, 2625, 2636, 2637, 2638, 2645, 2646 };
         public static List<int> spu_shopIds = new List<int>() { 5, 6, 8, 10, 11, 12, 14, 15, 16, 18, 24, 27, 28, 31, 32, 56, 61 };
+        public static List<string> receiver_state = new List<string> { "内蒙古", "西藏", "甘肃", "青海", "宁夏", "新疆" };
 
+        public static bool isFarAddress(string state)
+        {
+            for (int i = 0; receiver_state.Count > i; i++)
+            {
+                if (state.Contains(receiver_state[i]))
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
         public static void setSpuData(CeErpTrade father)
         {
             string orderSql = string.Format("SELECT * FROM [dbo].[CE_ErpTradeOrder] WHERE tid = '{0}' and total_fee > 0", father.tid);

+ 9 - 9
SiteCore/taobao/tmcHelper.cs

@@ -1508,7 +1508,7 @@ namespace SiteCore
                         }
                     }
                 }
-                if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+                if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
                 {
                     entity.OrderState = -1;
                 }
@@ -1572,7 +1572,7 @@ namespace SiteCore
                     entity.IsSample = 1;
                     entity.SupplierId = Convert.ToInt32(webConfig.SampleOrderSupplier);
                     entity.IsOldCustomer = 0;
-                    if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+                    if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
                     {
                         entity.OrderState = -1;
                     }
@@ -1583,7 +1583,7 @@ namespace SiteCore
                 }
                 else
                 {
-                    if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+                    if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
                     {
                         entity.OrderState = -1;
                     }
@@ -2021,7 +2021,7 @@ namespace SiteCore
 
                 }
             }
-            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
             {
                 entity.OrderState = -1;
             }
@@ -2194,7 +2194,7 @@ namespace SiteCore
                 }
 
             }
-            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
             {
                 entity.OrderState = -1;
             }
@@ -2380,7 +2380,7 @@ namespace SiteCore
                     entity.IsOldCustomerMore = 1;
                 }
             }
-            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
             {
                 entity.OrderState = -1;
             }
@@ -2555,7 +2555,7 @@ namespace SiteCore
             entity.seller_memo = newmemo;
             entity.OtherMemo = newOtherMemo;
             entity.pay_time = father.pay_time;
-            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
             {
                 entity.OrderState = -1;
             }
@@ -2939,7 +2939,7 @@ namespace SiteCore
                 entity.FinishPlaceTime = DateTime.Now;
                 entity.SupplierId = 5;//-福广
             }
-            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
             {
                 entity.OrderState = -1;
             }
@@ -3360,7 +3360,7 @@ namespace SiteCore
                 entity.SupplierId = 5;//-福广
             }
             //台湾省要审核
-            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1)
+            if ((father.receiver_state.Contains("台湾") && string.IsNullOrEmpty(father.receiver_zip)) || entity.seller_memo.IndexOf("不要切单个") > -1 || commonHelper.isFarAddress(father.receiver_state))
             {
                 entity.OrderState = -1;
             }

+ 1 - 1
Web/EDelivery/WaitingOrder.aspx

@@ -37,7 +37,7 @@
                 <div field="payment" width="40" align="center" headeralign="center">金额</div>
                 <div field="compenPrice" width="80" align="center" headeralign="center">补差金额</div>
                 <div field="payment_cyt" width="80" align="center" headeralign="center">成本金额</div>
-                <div field="urgentCharge" width="40" align="center" headeralign="center">加急金额</div>
+                <div field="delivery_paymant" width="40" align="center" headeralign="center">偏远物流费</div>
                 <div field="CustomerUserName" width="60" align="center" headeralign="center" renderer="orderCusRenderer">客服/设计</div>
                 <div field="seller_memo" width="200" align="center" headeralign="center" renderer="memoRenderer">备注</div>
                 <div field="OtherMemo" width="100" align="center" headeralign="center">额外备注</div>

+ 35 - 1
Web/EOrder/js/p_order.js

@@ -17,7 +17,15 @@ function addFn() {
     $(".win_tb").find("textarea").val("");
     mini.get("add_win").show();
 }
-
+let far_address = ["内蒙古", "西藏", "甘肃", "青海", "宁夏", "新疆"];
+function isFar(state) {
+    for (var i = 0; i < far_address.length; i++) {
+        if (state.indexOf(far_address[i]) > -1) {
+            return true;
+        }
+    }
+    return false;
+}
 function orderAction(e) {
     var grid = e.sender;
     var record = e.record;
@@ -48,6 +56,9 @@ function orderAction(e) {
         if (record.receiver_state.indexOf("台湾") > -1) {
             html += getGridBtn("laboratory", "身份证", "setPersonIdInfo()");
         }
+        if (isFar(record.receiver_state)) {
+            html += getGridBtn("split", "物流费", "addDeliveryPaymant()");
+        }
     }
     if (record.ctid.indexOf("S_") > -1) {
         if (userPostCode == "AfterSaleMaster" || userPostCode == "SysAdmin" || userPostCode == "AfterSale" || userId == "82" || userId == "2846") {
@@ -64,7 +75,30 @@ function orderAction(e) {
     //html += getGridBtn("edit", "重置", "resetFn('" + id + "')");
     return html;
 }
+function addDeliveryPaymant() {
+    let rec = grid.getSelected();
+    let tid = rec.tid;
+    mini.prompt(`当前物流费用¥${rec.delivery_paymant || 0},请重新输入费用:`, "请输入",
+        function (action, value) {
+            if (action == "ok") {
+                if (value > 0) {
 
+                } else {
+                    return mini.showTips({
+                        content: "请填写正确费用!",
+                        state: "danger",
+                        x: "Center",
+                        y: "Center",
+                        timeout: 1000
+                    });
+                }
+                postAjax("addDeliveryPaymant", { tid, paymant: value }, function (data) {
+                    resultShow(data, "grid.reload();");
+                });
+            }
+        }
+    );
+}
 function setPersonIdInfo() {
     let rec = grid.getSelected();
     $("#textPersonId").val(rec.receiver_zip);