Browse Source

修改跟单逻辑

zhuyiyi 2 tuần trước cách đây
mục cha
commit
480bf6a7fb

+ 44 - 8
SiteCore/Handler/sync.order.cs

@@ -7093,8 +7093,14 @@ namespace SiteCore.Handler
             if (sellermemo.Length > 0) lw.Add(string.Format("seller_memo like '%{0}%'", sellermemo));
             string orderState = GetPostString("orderState");
             if (orderState.Length > 0) lw.Add(string.Format("OrderState like '%{0}%'", orderState));
+
+            string searchType = GetPostString("searchType");
+
             string afterState = GetPostString("afterstate");
-            if (afterState.Length > 0) lw.Add(string.Format("AfterSaleState={0}", afterState));
+            if (searchType != "documentary")
+            {
+                if (afterState.Length > 0) lw.Add(string.Format("AfterSaleState={0}", afterState));
+            }
 
             string date1 = GetPostString("date1");
             string date2 = GetPostString("date2");
@@ -7148,7 +7154,6 @@ namespace SiteCore.Handler
                 string shopid = CurrentUser.User.pemShop;
                 lw.Add(string.Format("shopId in ({0})", shopid));
             }
-            string searchType = GetPostString("searchType");
             if (searchType == "wait")
             {
                 lw.Add(string.Format("HandleTime is null"));
@@ -7156,8 +7161,8 @@ namespace SiteCore.Handler
             }
             if (searchType == "documentary")
             {
-                lw.Add(string.Format("HandleTime is not null and TextResult in ('重印-转设计师','重印-转下单员') AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' "));
-
+                lw.Add(string.Format(" AfterSaleState > 2 AND HandleTime is not null and TextResult in ('重印-转设计师','重印-转下单员') AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' AND AfterSalSend = 0 "));
+                afterState = "2";
             }
             if (searchType == "handling")
             {
@@ -8129,7 +8134,7 @@ namespace SiteCore.Handler
                 if (type == "Handling")
                 {
 
-                    string sql = string.Format("select count(*) as number from view_AfterSaleList where aftersalestate=1 AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' and HandleTime is not null and TextResult in ('','联系不上客户','无需售后','退差价','退款','加购','包邮顺丰','退款+退快递费','下单后退款,重拍+包邮顺丰','下单后退款,重拍','待处理','催发货/改快递/改地址','退差价+包邮顺丰')" + (mainwhere.Length > 0 ? (" and " + mainwhere) : ""));
+                    string sql = string.Format("select count(*) as number from view_AfterSaleList where aftersalestate=1 AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' and HandleTime is not null " + (mainwhere.Length > 0 ? (" and " + mainwhere) : ""));
                     DataTable dt = null;
                     try
                     {
@@ -8197,7 +8202,7 @@ namespace SiteCore.Handler
                 if (type == "documentary")
                 {
                     //跟单中
-                    string sql4 = string.Format("select count(*) as number from view_AfterSaleList where  aftersalestate=1 and HandleTime is not null AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' and TextResult in ('重印-转设计师','重印-转下单员') " + (mainwhere.Length > 0 ? (" and " + mainwhere) : ""));
+                    string sql4 = string.Format("select count(*) as number from view_AfterSaleList where  aftersalestate > 2 and HandleTime is not null AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' and TextResult in ('重印-转设计师','重印-转下单员') AND AfterSalSend = 0 " + (mainwhere.Length > 0 ? (" and " + mainwhere) : ""));
                     DataTable dt4 = null;
                     try
                     {
@@ -8302,7 +8307,7 @@ namespace SiteCore.Handler
                 if (type == "Handling")
                 {
                     //处理中
-                    string sql4 = string.Format("select count(*) as number from view_AfterSaleList where aftersalestate=1 AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' and HandleTime is not null and TextResult in ('','联系不上客户','无需售后','退差价','退款','加购','包邮顺丰','退款+退快递费','下单后退款,重拍+包邮顺丰','下单后退款,重拍','待处理','催发货/改快递/改地址','退差价+包邮顺丰')" + (mainwhere.Length > 0 ? (" and " + mainwhere) : ""));
+                    string sql4 = string.Format("select count(*) as number from view_AfterSaleList where aftersalestate=1 AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' and HandleTime is not null " + (mainwhere.Length > 0 ? (" and " + mainwhere) : ""));
                     DataTable dt4 = null;
                     try
                     {
@@ -8336,7 +8341,7 @@ namespace SiteCore.Handler
                 if (type == "documentary")
                 {
                     //跟单中
-                    string sql6 = string.Format("select count(*) as number from view_AfterSaleList where  aftersalestate=1 AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' and HandleTime is not null and TextResult in ('重印-转设计师','重印-转下单员') " + (mainwhere.Length > 0 ? (" and " + mainwhere) : ""));
+                    string sql6 = string.Format("select count(*) as number from view_AfterSaleList where  aftersalestate > 2 AND AfterSaleBackReason = '' AND AfterSaleSupplierMemo = '' and HandleTime is not null and TextResult in ('重印-转设计师','重印-转下单员') AND AfterSalSend = 0 " + (mainwhere.Length > 0 ? (" and " + mainwhere) : ""));
                     DataTable dt6 = null;
                     try
                     {
@@ -12166,6 +12171,37 @@ namespace SiteCore.Handler
                 returnErrorMsg("找不到指定售后单对应的原始订单!");
             }
         }
+
+        public void aftersale_documentary_finish()
+        {
+            if (UrlPostParmsCheck("ctid"))
+            {
+                string ctid = GetPostString("ctid");
+                if (ctid.Length > 0)
+                {
+                    CeErpTradeAfterSaleExtend ceErpTradeAfterSaleExtend = CeErpTradeAfterSaleExtend.getByTid(ctid);
+                    if (ceErpTradeAfterSaleExtend == null)
+                    {
+                        ceErpTradeAfterSaleExtend = new CeErpTradeAfterSaleExtend();
+                        ceErpTradeAfterSaleExtend.tid = ctid;
+                    }
+                    ceErpTradeAfterSaleExtend.AfterSalSend = 1;
+                    if (ceErpTradeAfterSaleExtend.ID > 0)
+                    {
+                        ceErpTradeAfterSaleExtend.Update();
+                    }
+                    else
+                    {
+                        ceErpTradeAfterSaleExtend.Create();
+                    }
+                    LogHelper.addLog(ctid, CurrentUser.UserID, "跟单完成", 6, 4);
+                    returnSuccessMsg("修改成功!");
+                    return;
+
+                }
+                returnErrorMsg("找不到指定售后单对应的原始订单!");
+            }
+        }
         public void aftersale_batch_audit_master()
         {
             if (UrlPostParmsCheck("ctids"))

+ 1 - 1
Web/EAfterSale/Handling.aspx

@@ -139,7 +139,7 @@
                 <div field="SupplierName" width="30" align="center" headeralign="center">供应商</div>
                 <div field="AfterSaleSupplierMemo" width="80" align="center" headeralign="center">不认可</div>
                 <div field="AfterSaleBackImg" width="30" align="center" headeralign="center" renderer="SaleBackImgRenderer">不认可图</div>
-                <div name="action" width="50" headeralign="center" align="center" renderer="actionRenderer" cellstyle="padding:0;">#</div>
+                <div name="action" width="60" headeralign="center" align="center" renderer="actionRenderer" cellstyle="padding:0;">#</div>
             </div>
         </div>
     </div>

+ 10 - 0
Web/EAfterSale/js/Handling.js

@@ -196,6 +196,9 @@ function actionRenderer(e) {
         html += getGridBtn("yes", "预完成", "preFinishFn('" + id + "')");
         html += getGridBtn("sc", "修改", "handleFn('" + id + "')");
     }
+    if (record.AfterSaleState > 2) {
+        html += getGridBtn("preview", "跟单完成", "documentaryFinishFn('" + id + "')");
+    }
     if (userPostCode == "AfterSaleMaster") {
         //html += getGridBtn("stop", "删除", "cancelFn('" + id + "')");
         html += getGridBtn("notify1", "售后终止", "endFn('" + id + "')");
@@ -214,6 +217,13 @@ function actionRenderer(e) {
     return html;
 }
 
+function documentaryFinishFn(ctid) {
+    if (!confirm("跟单完成,确认?")) return;
+    postAjax("aftersale_documentary_finish", "ctid=" + ctid, function (data) {
+        resultShow(data, "grid.reload();");
+    });
+}
+
 function verifyYes(ctid) {
     if (!confirm("通过售后单,确认?")) return;
     postAjax("aftersale_audit_master", "ctid=" + ctid, function (data) {

+ 26 - 13
Web/EDesign/DesignList.aspx

@@ -1,8 +1,11 @@
 <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/ErpView.master" AutoEventWireup="true" CodeFile="DesignList.aspx.cs" Inherits="EDesign_DesignList" %>
 
 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
+    <link href="../css/imgbox.css" rel="stylesheet" />
+    <script src="../js/imgbox-1.0.3.js"></script>
     <script type="text/javascript" src="js/DesignList.js?v=<%=SiteVer %>"></script>
-   
+
+
 </asp:Content>
 <asp:Content ID="Content2" ContentPlaceHolderID="btn" runat="Server">
     <a id="btnTransDesign" class="mini-button mini-button-primary" runat="server" visible="false" iconcls="icon-reload" onclick="transFn()">设计转单</a>
@@ -12,7 +15,7 @@
 
 <asp:Content ID="Content4" ContentPlaceHolderID="content" runat="Server">
     <div class="mini-fit">
-        <div id="m_grid" class="mini-datagrid" style="width: 100%; height: 100%;" contextMenu="#gridMenu" showemptytext="true" emptytext="暂无记录"  url="../handler/sync.ashx?t=get_erp_designlist">
+        <div id="m_grid" class="mini-datagrid" style="width: 100%; height: 100%;" contextmenu="#gridMenu" showemptytext="true" emptytext="暂无记录" url="../handler/sync.ashx?t=get_erp_designlist">
             <div property="columns">
                 <%--                <div field="Sort" width="50" align="center" headerAlign="center">排序</div>--%>
                 <%--                <div field="ComName" width="120" align="center" headerAlign="center">公司名称</div>--%>
@@ -26,18 +29,18 @@
                 <div field="seller_memo" width="100" align="center" headeralign="center" renderer="memoRenderer">备注</div>
                 <div field="OtherMemo" width="100" align="center" headeralign="center">额外备注</div>
                 <div name="orderstatus" width="50" align="center" headeralign="center" renderer="orderStatusRenderer">状态</div>
-                <div field="WaitDesignTime" width="60" align="center" dateFormat="yyyy-MM-dd HH:mm" headeralign="center">派单时间</div>
+                <div field="WaitDesignTime" width="60" align="center" dateformat="yyyy-MM-dd HH:mm" headeralign="center">派单时间</div>
                 <div name="address" width="130" align="center" headeralign="center" renderer="addressRenderer">收货地址</div>
                 <div name="action" width="80" headeralign="center" align="center" renderer="actionRenderer" cellstyle="padding:0;">#</div>
             </div>
         </div>
     </div>
 
-    <ul id="gridMenu" class="mini-contextmenu" onbeforeopen="onBeforeOpen">              
-        <li name="edit" iconCls="icon-copy" onclick="onCopyOrder">复制单号</li>  
-        <li name="edit" iconCls="icon-copy" onclick="onCopyBuyerNick">复制旺旺号</li>  
-        <li name="edit" iconCls="icon-user" onclick="onTagRefund">退款挽回</li>  
-        <li name="edit" iconCls="icon-xiaoshou" onclick="onTagMore">推多数量</li>  
+    <ul id="gridMenu" class="mini-contextmenu" onbeforeopen="onBeforeOpen">
+        <li name="edit" iconcls="icon-copy" onclick="onCopyOrder">复制单号</li>
+        <li name="edit" iconcls="icon-copy" onclick="onCopyBuyerNick">复制旺旺号</li>
+        <li name="edit" iconcls="icon-user" onclick="onTagRefund">退款挽回</li>
+        <li name="edit" iconcls="icon-xiaoshou" onclick="onTagMore">推多数量</li>
     </ul>
 
     <div id="memo_win" class="mini-window" title="备注信息" style="width: 550px; height: 260px; position: relative; display: none">
@@ -73,7 +76,7 @@
             <tr>
                 <td class="td1">加急时间</td>
                 <td class="td2">
-                    <input id="txtUrgencyTime" name="sign_date1" data-options="{otype:'daterange',havetime:'1'}" class="mini-textbox inp-time"/>
+                    <input id="txtUrgencyTime" name="sign_date1" data-options="{otype:'daterange',havetime:'1'}" class="mini-textbox inp-time" />
                 </td>
             </tr>
             <tr>
@@ -87,7 +90,7 @@
         </table>
     </div>
 
-     <div id="trans_win" class="mini-window" title="设计转单" style="width: 360px; height: 180px; position: relative; display: none">
+    <div id="trans_win" class="mini-window" title="设计转单" style="width: 360px; height: 180px; position: relative; display: none">
         <table class="win_tb" border="0" cellpadding="0" cellspacing="1">
             <tr>
                 <td class="td1">本部设计</td>
@@ -110,9 +113,19 @@
         <table class="win_tb" border="0" cellpadding="0" cellspacing="1">
             <tr>
                 <td class="td1">售后原因</td>
-                <td class="td2"><select id="reason" style="width:80%;"><option value="客服问题">客服问题</option><option value="设计问题">设计问题</option><option value="客户问题">客户问题</option><option value="车间问题">车间问题</option>
-                    <option value="下单问题">下单问题</option><option value="快递问题">快递问题</option><option value="超成本">超成本</option><option value="重复下单">重复下单</option><option value="报价系统问题">报价系统问题</option>
-                    <option value="没按报价系统报价">没按报价系统报价</option></select>
+                <td class="td2">
+                    <select id="reason" style="width: 80%;">
+                        <option value="客服问题">客服问题</option>
+                        <option value="设计问题">设计问题</option>
+                        <option value="客户问题">客户问题</option>
+                        <option value="车间问题">车间问题</option>
+                        <option value="下单问题">下单问题</option>
+                        <option value="快递问题">快递问题</option>
+                        <option value="超成本">超成本</option>
+                        <option value="重复下单">重复下单</option>
+                        <option value="报价系统问题">报价系统问题</option>
+                        <option value="没按报价系统报价">没按报价系统报价</option>
+                    </select>
                 </td>
             </tr>
             <tr>

+ 2 - 0
Web/EDesign/MyDesignList.aspx

@@ -1,6 +1,8 @@
 <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/ErpView.master" AutoEventWireup="true" CodeFile="MyDesignList.aspx.cs" Inherits="EDesign_MyDesignList" %>
 
 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
+    <link href="../css/imgbox.css" rel="stylesheet" />
+    <script src="../js/imgbox-1.0.3.js"></script>
     <script type="text/javascript" src="js/MyDesignList.js?v=<%=SiteVer %>"></script>
 
 </asp:Content>

+ 24 - 0
Web/EDesign/js/DesignList.js

@@ -101,9 +101,33 @@ function actionRenderer(e) {
     html += getGridBtn("memo", "文件", "fileUrlFn('" + record.tid + "')");
     if (record.tempId) {
         html += getGridBtn("undo", "下载模板", "daownTempFile('" + record.tempId + "')");
+        html += getGridBtn("undo", "查看模板图片", "viewTempImage('" + record.tempId + "')");
     }
     return html;
 }
+
+function viewTempImage(tempId) {
+    let url = "https://template.lingtao8.com/template/api/getTemplate"
+    if (!tempId) {
+        showToast("无模板编号。无法查看!");
+    }
+    $.ajax({
+        url: url,
+        type: "POST",
+        data: { templateCode: tempId },
+        datatype: "jsonp",
+        success: function (result) {
+            if (result.code == 200) {
+                let image = result?.data?.templateImagePath;
+                const img = YYZIMG.show(image)
+            }
+        },
+        error: function (data) {
+            progressHide();
+            alert("查无模板错误!");
+        }
+    });
+}
 function daownTempFile(tempId) {
     let url = "https://template.lingtao8.com/template/api/getTemplate"
     $.ajax({

+ 24 - 0
Web/EDesign/js/MyDesignList.js

@@ -172,6 +172,7 @@ function actionRenderer(e) {
     html += getGridBtn("memo", "客户文件", "oriFileUrlFn('" + record.tid + "','" + record.ctid + "')");
     if (record.tempId) {
         html += getGridBtn("undo", "下载模板", "daownTempFile('" + record.tempId + "')");
+        html += getGridBtn("undo", "查看模板图片", "viewTempImage('" + record.tempId + "')");
     }
     //if (record.IsNeedDesignPrice == 1) {
     //    html += getGridBtn("izc", "设计费", "priceFn('" + id + "')");
@@ -180,6 +181,29 @@ function actionRenderer(e) {
 
     return html;
 }
+function viewTempImage(tempId) {
+    let url = "https://template.lingtao8.com/template/api/getTemplate"
+    if (!tempId) {
+        showToast("无模板编号。无法查看!");
+    }
+    $.ajax({
+        url: url,
+        type: "POST",
+        data: { templateCode: tempId },
+        datatype: "jsonp",
+        success: function (result) {
+            if (result.code == 200) {
+                let image = result?.data?.templateImagePath;
+                const img = YYZIMG.show(image)
+            }
+        },
+        error: function (data) {
+            progressHide();
+            alert("查无模板错误!");
+        }
+    });
+}
+
 function daownTempFile(tempId) {
     let url = "https://template.lingtao8.com/template/api/getTemplate"
     $.ajax({