zhuyiyi 5 өдөр өмнө
parent
commit
d52094e9ad

+ 2 - 0
BizCom/Enum/MessageState.cs

@@ -5,5 +5,7 @@
         订单审核 = 0,
         订单审核 = 0,
         订单退款 = 1,
         订单退款 = 1,
         订单改价 = 2,
         订单改价 = 2,
+        尺寸单位规范 = 3,
+        拒绝打回 = 4,
     }
     }
 }
 }

+ 103 - 3
SiteCore/Handler/sync.order.cs

@@ -11368,7 +11368,7 @@ namespace SiteCore.Handler
         {
         {
             int userid = CurrentUser.UserID;
             int userid = CurrentUser.UserID;
             StringBuilder sql = new StringBuilder();
             StringBuilder sql = new StringBuilder();
-            sql.AppendFormat("select top 1 * from CE_ErpMessageTip c where (c.userId = '{0}' ) and c.isVisit = 0  and c.type = 3;", userid);
+            sql.AppendFormat("select top 1 * from CE_ErpMessageTip c where (c.userId = '{0}' ) and c.isVisit = 0  and c.type in (3,4);", userid);
             DataTable dth = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
             DataTable dth = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
             List<string> ids = new List<string>();
             List<string> ids = new List<string>();
 
 
@@ -14718,6 +14718,7 @@ namespace SiteCore.Handler
         public void applyOrderBack()
         public void applyOrderBack()
         {
         {
             string ctid = GetPostString("ctid");
             string ctid = GetPostString("ctid");
+            string reason = GetPostString("reason");
             if (!string.IsNullOrEmpty(ctid))
             if (!string.IsNullOrEmpty(ctid))
             {
             {
                 CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(ctid);
                 CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(ctid);
@@ -14741,9 +14742,47 @@ namespace SiteCore.Handler
                         return;
                         return;
                     }
                     }
                 }
                 }
+                string sql = string.Format("select Con,UserId from CE_ErpTradeLog where tid = '{0}'", ceErpTradeCell.ctid);
+                DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+                if (dataTable != null && dataTable.Rows.Count > 0)
+                {
+                    foreach (DataRow row in dataTable.Rows)
+                    {
+                        if (row["Con"].ToString().Contains("拒绝打回"))
+                        {
+                            returnErrorMsg("被拒绝过无法继续申请");
+                            return;
+                        }
+                    }
+                }
                 ceErpTradeCell.IsReturn = 4;
                 ceErpTradeCell.IsReturn = 4;
                 ceErpTradeCell.Update();
                 ceErpTradeCell.Update();
-                LogHelper.addLog(ceErpTradeCell.ctid, CurrentUser.UserID, "申请打回", ceErpTradeCell.OrderState);
+                LogHelper.addLog(ceErpTradeCell.ctid, CurrentUser.UserID, "申请打回:" + reason, ceErpTradeCell.OrderState);
+                returnSuccessMsg("保存成功");
+                return;
+            }
+            returnErrorMsg("缺少必要的参数");
+        }
+        public void cancelApplyOrderBack()
+        {
+            string ctid = GetPostString("ctid");
+            if (!string.IsNullOrEmpty(ctid))
+            {
+                CeErpTradeCell ceErpTradeCell = CeErpTradeCell.GetByCtid(ctid);
+                if (ceErpTradeCell == null)
+                {
+                    returnErrorMsg("找不到订单");
+                    return;
+                }
+                if (ceErpTradeCell.IsReturn != 4)
+                {
+                    returnErrorMsg("订单未在申请阶段");
+                    return;
+                }
+
+                ceErpTradeCell.IsReturn = 0;
+                ceErpTradeCell.Update();
+                LogHelper.addLog(ceErpTradeCell.ctid, CurrentUser.UserID, "取消申请打回", ceErpTradeCell.OrderState);
                 returnSuccessMsg("保存成功");
                 returnSuccessMsg("保存成功");
                 return;
                 return;
             }
             }
@@ -14793,6 +14832,10 @@ namespace SiteCore.Handler
                 lw.Add(string.Format("SupplierId in ({0})", CurrentUser.User.pemVend));
                 lw.Add(string.Format("SupplierId in ({0})", CurrentUser.User.pemVend));
                 lw.Add(string.Format("OrderState = 6"));
                 lw.Add(string.Format("OrderState = 6"));
             }
             }
+            else if (CurrentUser.UserPost.Post.Code == "Place" || CurrentUser.UserPost.Post.Code == "PlaceMr")
+            {
+                lw.Add("OrderState = 5");
+            }
 
 
             lw.Add(string.Format("IsReturn = 4"));
             lw.Add(string.Format("IsReturn = 4"));
 
 
@@ -14820,7 +14863,30 @@ namespace SiteCore.Handler
                     returnErrorMsg("找不到订单");
                     returnErrorMsg("找不到订单");
                     return;
                     return;
                 }
                 }
-
+                string sql = string.Format("select Con,UserId from CE_ErpTradeLog where tid = '{0}' order by ID desc", ceErpTradeCell.ctid);
+                DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+                int userId = 0;
+                if (dataTable != null && dataTable.Rows.Count > 0)
+                {
+                    foreach (DataRow row in dataTable.Rows)
+                    {
+                        if (row["Con"].ToString().Contains("申请打回:"))
+                        {
+                            userId = Convert.ToInt32(row["UserId"]);
+                        }
+                    }
+                }
+                if (userId > 0)
+                {
+                    CeErpMessageTip ct = new CeErpMessageTip();
+                    ct.tid = ceErpTradeCell.ctid;
+                    ct.sectionId = 0;
+                    ct.userId = userId;
+                    ct.type = 4;
+                    ct.isVisit = false;
+                    ct.content = ceErpTradeCell.ctid + ",申请打回被拒绝:" + reason;
+                    ct.Create();
+                }
                 ceErpTradeCell.IsReturn = 0;
                 ceErpTradeCell.IsReturn = 0;
                 ceErpTradeCell.Update();
                 ceErpTradeCell.Update();
                 LogHelper.addLog(ceErpTradeCell.ctid, CurrentUser.UserID, "拒绝打回:" + reason, ceErpTradeCell.OrderState);
                 LogHelper.addLog(ceErpTradeCell.ctid, CurrentUser.UserID, "拒绝打回:" + reason, ceErpTradeCell.OrderState);
@@ -14829,6 +14895,40 @@ namespace SiteCore.Handler
             }
             }
             returnErrorMsg("缺少必要的参数");
             returnErrorMsg("缺少必要的参数");
         }
         }
+
+        public void getApplyBackCount()
+        {
+            string sql = string.Format("SELECT top 1 ctid FROM [dbo].[CE_ErpTradeCell]");
+
+            List<string> lw = new List<string>();
+            lw.Add("IsReturn = 4");
+            if (CurrentUser.UserPost.Post.Code == "Supplier")
+            {
+                lw.Add("OrderState = 6");
+                lw.Add(string.Format("SupplierId in ({0})", CurrentUser.User.pemVend));
+            }
+            else if (CurrentUser.UserPost.Post.Code == "Place" || CurrentUser.UserPost.Post.Code == "PlaceMr")
+            {
+                lw.Add("OrderState = 5");
+            }
+            else
+            {
+                ReturnSuccess("{" + string.Format("\"data\":{0}", "0") + "}");
+                return;
+            }
+            sql += " where " + string.Join(" and ", lw.ToArray());
+            DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+            List<string> list = new List<string>();
+            if (dataTable != null && dataTable.Rows.Count > 0)
+            {
+                foreach (DataRow row in dataTable.Rows)
+                {
+                    list.Add(row["ctid"].ToString());
+                }
+            }
+            ReturnSuccess("{" + string.Format("\"data\":{0}", "\"" + string.Join(",", list) + "\"") + "}");
+            return;
+        }
     }
     }
 }
 }
 
 

+ 1 - 1
Web/EDelivery/ApplyBack.aspx

@@ -7,7 +7,7 @@
 </asp:Content>
 </asp:Content>
 <asp:Content ID="Content4" ContentPlaceHolderID="content" runat="Server">
 <asp:Content ID="Content4" ContentPlaceHolderID="content" runat="Server">
     <div class="mini-fit">
     <div class="mini-fit">
-        <div id="m_grid" class="mini-datagrid" style="width: 100%; height: 100%;" allowunselect="true" showemptytext="true" contextmenu="#gridMenu" emptytext="暂无记录" url="../handler/sync.ashx?t=get_erp_applybackorderlist">
+        <div id="m_grid" class="mini-datagrid" style="width: 100%; height: 100%;" showemptytext="true" contextmenu="#gridMenu" emptytext="暂无记录" url="../handler/sync.ashx?t=get_erp_applybackorderlist">
             <div property="columns">
             <div property="columns">
                 <div field="ctid" width="110" align="center" headeralign="center" renderer="orderIdRenderer">订单编号</div>
                 <div field="ctid" width="110" align="center" headeralign="center" renderer="orderIdRenderer">订单编号</div>
                 <div field="pay_time" width="80" align="center" headeralign="center" renderer="orderPTimeRenderer">付款时间</div>
                 <div field="pay_time" width="80" align="center" headeralign="center" renderer="orderPTimeRenderer">付款时间</div>

+ 1 - 0
Web/EOrder/OrderList.aspx

@@ -192,6 +192,7 @@
         <!--<li name="edit" iconcls="icon-split" onclick="onOpenTemplate">查看模板</li>-->
         <!--<li name="edit" iconcls="icon-split" onclick="onOpenTemplate">查看模板</li>-->
         <li name="edit" iconcls="icon-split" onclick="viewTempImage">查看模板图片</li>
         <li name="edit" iconcls="icon-split" onclick="viewTempImage">查看模板图片</li>
         <li name="edit" iconcls="icon-hostrepertory" onclick="applyBack">申请打回</li>
         <li name="edit" iconcls="icon-hostrepertory" onclick="applyBack">申请打回</li>
+        <li name="edit" iconcls="icon-library" onclick="cancelApplyBack">取消申请打回</li>
     </ul>
     </ul>
 
 
 
 

+ 27 - 2
Web/EOrder/js/p_order.js

@@ -1460,9 +1460,35 @@ function onCopyUpLoaderUrl(e) {
 
 
 function applyBack() {
 function applyBack() {
     var rec = grid.getSelected();
     var rec = grid.getSelected();
-    postAjax("applyOrderBack", { ctid: rec.ctid }, function (data) {
+    mini.prompt("请输入原因:", "申请",
+        function (action, value) {
+            if (action == "ok") {
+                var parms = new Object();
+                if (value == "") {
+                    showToast("请填写申请理由");
+                    return;
+                }
+                parms.ctid = rec.ctid;
+                parms.reason = value;
+                postAjax("applyOrderBack", parms, function (data) {
+                    resultShow(data, "grid.reload();");
+                });
+            } else {
+
+            }
+        },
+        true
+    );
+
+}
+
+function cancelApplyBack() {
+    var rec = grid.getSelected();
+    if (!confirm("确认取消申请?")) return;
+    postAjax("cancelApplyOrderBack", { ctid: rec.ctid }, function (data) {
         resultShow(data, "grid.reload();");
         resultShow(data, "grid.reload();");
     });
     });
+
 }
 }
 
 
 function downloadFileFn(e) {
 function downloadFileFn(e) {
@@ -1476,7 +1502,6 @@ function downloadFileFn(e) {
         //for (var i = 0; i < sels.length; i++) {
         //for (var i = 0; i < sels.length; i++) {
         //    pArr.push(sels[i].ctid);
         //    pArr.push(sels[i].ctid);
         //}
         //}
-        console.log("downurl", downUrl);
         //fileDown(downUrl, "hexdata=" + pArr.join(",") + "&onlyfile=1" + "&userid=" + userId);
         //fileDown(downUrl, "hexdata=" + pArr.join(",") + "&onlyfile=1" + "&userid=" + userId);
 
 
         var total = sels.length;
         var total = sels.length;

+ 23 - 39
Web/js/index.js

@@ -190,7 +190,7 @@ function getMyTipOrder() {
             isTipedAfterSale = 0;
             isTipedAfterSale = 0;
             afterSaleVerifyIdx = 0;
             afterSaleVerifyIdx = 0;
         }
         }
-
+        //tip-content提示
         postAjax("get_erp_my_tiporder", "af=" + isTipedAfterSale, function (data) {
         postAjax("get_erp_my_tiporder", "af=" + isTipedAfterSale, function (data) {
             var toOrderState = 0;
             var toOrderState = 0;
             if (data.length > 0) {
             if (data.length > 0) {
@@ -310,45 +310,12 @@ function getMyTipOrder() {
                 }, intervalTime);
                 }, intervalTime);
             }
             }
         }, function (data) { }, false);
         }, function (data) { }, false);
-        postAjax("back_supplier_audit", "", function (data) {
-            if (data.length > 0) {
-                mini.showMessageBox({
-                    title: "提示",
-                    iconCls: "mini-messagebox-question",
-                    buttons: ["同意撤回订单", "不同意"],
-                    message: "有订单需要撤回处理:" + data[0]["tid"],
-                    callback: function (action) {
-                        if (action == "同意撤回订单") {
-                            mini.showMessageBox({
-                                title: "提示",
-                                iconCls: "mini-messagebox-question",
-                                buttons: ["确认撤回订单", "不同意"],
-                                message: "有订单需要撤回处理:" + data[0]["tid"],
-                                callback: function (action) {
-                                    if (action == "确认撤回订单") {
-                                        postAjax("upd_supplier_audit", { ctid: data[0]["tid"], returnreason: "1" }, function (data) {
-                                            resultShow(data);
-                                        });
-                                    } else if (action == "不同意") {
-
-                                        postAjax("upd_supplier_audit", { ctid: data[0]["tid"], returnreason: "2" }, function (data) {
-                                            resultShow(data);
-                                        });
-                                    }
-                                }
-                            });
-
-                        } else if (action == "不同意") {
 
 
-                            postAjax("upd_supplier_audit", { ctid: data[0]["tid"], returnreason: "2" }, function (data) {
-                                resultShow(data);
-                            });
-                        }
+        postAjax("back_supplier_audit", "", function (data) {
 
 
-                    }
-                });
-            }
         }, function (data) { }, false);
         }, function (data) { }, false);
+
+        //线下单审核订单
         postAjax("verified_to_order", "", function (data) {
         postAjax("verified_to_order", "", function (data) {
 
 
             if (data.length > 0) {
             if (data.length > 0) {
@@ -367,6 +334,7 @@ function getMyTipOrder() {
                 });
                 });
             }
             }
         }, function () { }, false);
         }, function () { }, false);
+        //退款提示
         postAjax("refund_order_tip", "", function (data) {
         postAjax("refund_order_tip", "", function (data) {
             if (data.length > 0) {
             if (data.length > 0) {
                 let content = "";
                 let content = "";
@@ -391,7 +359,7 @@ function getMyTipOrder() {
                 }
                 }
             }
             }
         }, function (data) { }, false);
         }, function (data) { }, false);
-
+        //共创修改备注
         postAjax("change_order_info", "", function (data) {
         postAjax("change_order_info", "", function (data) {
             if (data.length > 0) {
             if (data.length > 0) {
                 let item = data[0];
                 let item = data[0];
@@ -420,7 +388,7 @@ function getMyTipOrder() {
                 });
                 });
             }
             }
         }, function (data) { }, false)
         }, function (data) { }, false)
-
+        //messageTip提示不需要操作类提示
         postAjax("size_order_tip", "", function (data) {
         postAjax("size_order_tip", "", function (data) {
             if (data.length > 0) {
             if (data.length > 0) {
                 let content = "";
                 let content = "";
@@ -440,6 +408,22 @@ function getMyTipOrder() {
                 }
                 }
             }
             }
         }, function (data) { }, false);
         }, function (data) { }, false);
+
+        //messageTip提示不需要操作类提示
+        postAjax("getApplyBackCount", "", function (data) {
+            if (data.data == 0 || data.data.length == 0) {
+                return;
+            }
+            mini.showMessageBox({
+                title: "提示",
+                iconCls: "mini-messagebox-question",
+                buttons: ["我知道了"],
+                message: "订单申请打回,请及时处理。\n\r" + "订单号:" + data.data,
+                callback: function (action) {
+
+                }
+            });
+        }, function (data) { }, false);
     }
     }
     else {
     else {
         laterTipIdx--;
         laterTipIdx--;