zhuyiyi 1 miesiąc temu
rodzic
commit
4f97d62178

+ 9 - 0
BizCom/Dao/CeErpTradeCellExtend.cs

@@ -463,6 +463,15 @@ namespace BizCom
             get { return _toType; }
             set { _toType = value; }
         }
+
+        private string _tempId = "";
+
+        [Property]
+        public string tempId
+        {
+            get { return _tempId; }
+            set { _tempId = value; }
+        }
         public static CeErpTradeCellExtend getByTid(string ctid)
         {
             return FindFirst(Expression.Sql(string.Format("ctid='{0}'", ctid)));

+ 1 - 1
SiteCore/Handler/sync.dic.cs

@@ -307,7 +307,7 @@ namespace SiteCore.Handler
                     returnSuccess("[]");
                     return;
                 }
-                string sql = "select * from Ce_ErpDesignInfo where  type = " + type + " and tarId = " + tarId;
+                string sql = "select d.*,p.PType from Ce_ErpDesignInfo d LEFT JOIN CE_ErpProduct p on d.designId = p.id where  type = " + type + " and tarId = " + tarId;
                 DataTable dt = null;
                 try
                 {

+ 18 - 2
SiteCore/Handler/sync.getbase.cs

@@ -189,9 +189,21 @@ namespace SiteCore.Handler
         public void get_sel_product()
         {
             string sql = "select id,PMaterial,ptype as name from ce_erpproduct ";
-            if (CurrentUser.UserPost.Post.Code != "SysAdmin" && CurrentUser.User.pemDesign.Length > 0)
+            string key = GetPostString("key");
+            string value = GetPostString("value");
+
+            List<string> where = new List<string>();
+            if (!string.IsNullOrEmpty(key))
             {
-                sql += " where ID in (" + CurrentUser.User.pemDesign + ")";
+                where.Add("ptype like '%" + key + "%'");
+                if (!string.IsNullOrEmpty(value))
+                {
+                    where.Add("id not in (" + value + ") ");
+                }
+            }
+            if (CurrentUser.UserPost.Post.Code != "SysAdmin" && CurrentUser.UserPost.Post.Code != "Place" && CurrentUser.User.pemDesign.Length > 0)
+            {
+                where.Add("  ID in (" + CurrentUser.User.pemDesign + ")");
 
                 if (CurrentUser.User.pemDesign.Length == 0)
                 {
@@ -199,6 +211,10 @@ namespace SiteCore.Handler
                     return;
                 }
             }
+            if (where.Count > 0)
+            {
+                sql += "where " + string.Join(" and ", where);
+            }
             DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
             con.Response.Write(Utils.Serialization.JsonString.DataTable2MiniAjaxJson(dt));
         }

+ 34 - 4
SiteCore/Handler/sync.order.cs

@@ -66,7 +66,6 @@ namespace SiteCore.Handler
 
             DataStruct dStruct = GetPostStruct();
             //string a = SecurityHelper.DecryptSymmetric("BnK3+504SQ8=");
-            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\修筠评价12单\\早哥不吃羊\\新建文本文档.txt");
             //apiHelper.Api_SyncOrderByTime("598825");
             //apiHelper.API_GetWaybill("ZTO-CAINIAO-TZJK", "4233447147588233939");
             //apiHelper.Api_SyacOrder("2460143282114312263", "yujia");
@@ -12771,7 +12770,7 @@ namespace SiteCore.Handler
             DataTable afterSaleData = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
             data.Merge(afterSaleData);
 
-            sql = string.Format("SELECT SupplierId, ProductId, seller_memo, ProductCount, ProductName, payment, SupplierName, UnusualTime, FinishPlaceTime, OrderState, FinishDeliveryTime, AfterSaleState=0,AfterSaleReason = '',delivery=1 FROM view_ErpTradeCell  WHERE orderstate = 6  AND IsSample = 0  AND SupplierId > 0  AND  FinishPlaceTime > '2025-11-01 00:00:31.000' AND IsRefund <= 1 AND status = 'NOT_SHIPPED' AND LEN( ProductName ) > 0 AND SupplierId not in (86,10,105)", startMonthDate, endMonthDate);
+            sql = string.Format("SELECT SupplierId, ProductId, seller_memo, ProductCount, ProductName, payment, SupplierName, UnusualTime, FinishPlaceTime, OrderState, FinishDeliveryTime, AfterSaleState=0,AfterSaleReason = '',delivery=1 FROM view_ErpTradeCell  WHERE orderstate = 6  AND IsSample = 0  AND SupplierId > 0  AND  FinishPlaceTime > '2025-11-01 00:00:31.000' AND IsRefund <= 1 AND status = 'NOT_SHIPPED' AND LEN( ProductName ) > 0 AND SupplierId not in (86,10,105,86)", startMonthDate, endMonthDate);
             DataTable deliveryData = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
             data.Merge(deliveryData);
             //不干胶-----1,卡片-----29
@@ -13938,8 +13937,11 @@ namespace SiteCore.Handler
             DataStruct dStruct = GetPostStruct();
             List<string> lw = new List<string>();
 
-            string supplier = GetPostString("supplier");
-            if (supplier.Length > 0) lw.Add(string.Format("supplierName = '{0}'", supplier));
+            string txtKey = GetPostString("txtKey");
+            if (txtKey.Length > 0)
+            {
+                lw.Add(string.Format("(supplierName = '{0}' or productName like '%{0}%')", txtKey));
+            }
 
 
             string posTag = CurrentUser.UserPost.Post.Code;
@@ -14239,6 +14241,34 @@ namespace SiteCore.Handler
             }
             returnErrorMsg("缺少必要的参数");
         }
+
+        public void setCellTeampId()
+        {
+            string ctid = GetPostString("ctid");
+            string tempId = GetPostString("tempId");
+            if (!string.IsNullOrEmpty(ctid))
+            {
+                CeErpTradeCellExtend ceErpTradeCellExtend = CeErpTradeCellExtend.getByTid(ctid);
+                if (ceErpTradeCellExtend == null)
+                {
+                    ceErpTradeCellExtend = new CeErpTradeCellExtend();
+                    ceErpTradeCellExtend.ctid = ctid;
+                }
+                ceErpTradeCellExtend.tempId = tempId;
+                if (ceErpTradeCellExtend.ID > 0)
+                {
+                    ceErpTradeCellExtend.Update();
+                }
+                else
+                {
+                    ceErpTradeCellExtend.Create();
+                }
+                LogHelper.addLog(ceErpTradeCellExtend.ctid, CurrentUser.UserID, "修改模板id" + tempId, 6);
+                returnSuccessMsg("保存成功");
+                return;
+            }
+            returnErrorMsg("缺少必要的参数");
+        }
     }
 
 }

+ 13 - 9
SiteCore/Handler/sync.orderReport.cs

@@ -2028,10 +2028,11 @@ namespace SiteCore.Handler
 
             }
 
-            sql.AppendFormat("SELECT AfterSaleReason, COUNT ( * ) AS total  FROM CE_ErpTradeCell o  WHERE o.AfterSaleState >= 1  {0} GROUP BY AfterSaleReason", sqlDate);
+            sql.AppendFormat("SELECT o.AfterSaleReason,p.PType, COUNT ( * ) AS total  FROM CE_ErpTradeCell o LEFT JOIN CE_ErpProduct p ON o.ProductId = p.id  WHERE o.AfterSaleState >= 1  {0} GROUP BY o.AfterSaleReason,p.PType", sqlDate);
             DataTable dtafter = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
 
             DataTable dt = new DataTable();
+            dt.Columns.Add(new DataColumn("PType", typeof(string)));
             dt.Columns.Add(new DataColumn("AfterSaleReason1", typeof(string)));
             dt.Columns.Add(new DataColumn("AfterSaleReason2", typeof(string)));
             dt.Columns.Add(new DataColumn("AfterSaleReason3", typeof(string)));
@@ -2043,34 +2044,37 @@ namespace SiteCore.Handler
             dr_he[2] = 0;
             dr_he[3] = 0;
             dr_he[4] = 0;
+            dr_he[5] = 0;
             foreach (DataRow row in dtafter.Rows)
             {
                 string reason = row["AfterSaleReason"].ToString();
+                string productName = row["PType"].ToString();
                 string[] reason_list = reason.Split(new char[] { '|' });
                 DataRow dr = dt.NewRow();
+                dr[0] = productName;
                 if (reason_list.Length > 0)
                 {
-                    dr[0] = reason_list[0];
+                    dr[1] = reason_list[0];
                 }
                 if (reason_list.Length > 1)
                 {
-                    dr[1] = reason_list[1];
+                    dr[2] = reason_list[1];
                 }
                 if (reason_list.Length > 2)
                 {
-                    dr[2] = reason_list[2];
+                    dr[3] = reason_list[2];
                 }
-                dr[3] = row["total"];
-                dr[4] = 0;
+                dr[4] = row["total"];
+                dr[5] = 0;
 
                 dt.Rows.Add(dr);
-                dr_he[3] = Convert.ToDecimal(dr_he[3]) + Convert.ToDecimal(dr[3]);
+                dr_he[4] = Convert.ToDecimal(dr_he[4]) + Convert.ToDecimal(dr[4]);
             }
             foreach (DataRow row in dt.Rows)
             {
-                row[4] = Math.Round(Math.Round(Convert.ToDecimal(row[3]) / Convert.ToDecimal(dr_he[3]), 4) * 100, 2);
+                row[5] = Math.Round(Math.Round(Convert.ToDecimal(row[4]) / Convert.ToDecimal(dr_he[4]), 4) * 100, 2);
             }
-            dr_he[4] = 100;
+            dr_he[5] = 100;
             DataView dv = new DataView(dt);
             //dv.Sort = "AllOrder desc";
             DataTable dtNew = dv.ToTable();

+ 1 - 0
SiteCore/taobao/designHelper.cs

@@ -327,6 +327,7 @@ namespace SiteCore.Handler
                 PostVars.Add("discountAmount", ceErpTradeCellExtend.discountAmount.ToString());//折扣金额
                 PostVars.Add("differentAmount", ceErpTradeCellExtend.differentAmount.ToString());//补差金额
                 PostVars.Add("differentSplitNo", ceErpTradeCellExtend.differentSplitNo);//补差识别号
+                PostVars.Add("templateCode", ceErpTradeCellExtend.tempId);//模板id
             }
             return PostVars;
         }

+ 10 - 0
Web/EArc/SupplierProductTime.aspx

@@ -99,6 +99,16 @@
             if (e.value == "1") return "启用";
             return "<span style=\"color:#ff0000\">禁用</span>";
         }
+        function view_search() {
+            var form = new mini.Form("#m_grid");
+            var data = form.getData(true, false);
+            var txtKey = $("#txtKey").val();;
+            //var s = mini.encode(data);
+            //alert(s);
+            //form.setIsValid(false);
+            //console.log("565656565", data);
+            grid.load({ txtKey });
+        }
     </script>
     <style type="text/css">
         .win_tb {

+ 1 - 0
Web/ECharts/AfterSaleGather.aspx

@@ -413,6 +413,7 @@
                         <div id="total_reason_grid" class="mini-datagrid panel" sortmode="client" style="width: 100%; height: 300px;" showemptytext="true" showpager="false" ondrawsummarycell="onDrawSummaryCell"
                             emptytext="暂无记录" url="../handler/sync.ashx?t=get_erp_aftersale_reason_gather">
                             <div property="columns">
+                                <div field="PType" name="PType" width="60" align="center" headeralign="center" allowsort="true">品类</div>
                                 <div field="AfterSaleReason1" name="AfterSaleReason1" width="60" align="center" headeralign="center" allowsort="true">一级原因</div>
                                 <div field="AfterSaleReason2" name="AfterSaleReason2" datatype="int" width="60" align="center" headeralign="center" allowsort="true">二级原因</div>
                                 <div field="AfterSaleReason3" name="AfterSaleReason3" datatype="int" width="60" align="center" headeralign="center" allowsort="true">三级原因</div>

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

@@ -99,8 +99,37 @@ function actionRenderer(e) {
     html += getGridBtn("edit", "备注", "memoFn('" + id + "')");
     html += getGridBtn("notify1", "加急", "urgencyFn('" + id + "')");
     html += getGridBtn("memo", "文件", "fileUrlFn('" + record.tid + "')");
+    if (record.tempId) {
+        html += getGridBtn("undo", "下载模板", "daownTempFile('" + record.tempId + "')");
+    }
     return html;
 }
+function daownTempFile(tempId) {
+    let url = "https://template.lingtao8.com/template/api/getTemplate"
+    $.ajax({
+        url: url,
+        type: "POST",
+        data: { templateCode: tempId },
+        datatype: "json",
+        success: function (result) {
+            if (result.code == 200) {
+                let file = result?.data?.templateDownUrl
+                let templateName = result?.data?.templateName;
+                if (file) {
+                    let a = document.createElement("a");
+                    a.href = file;
+                    a.download = templateName;
+                    a.click();
+                }
+            }
+            progressHide();
+        },
+        error: function (data) {
+            progressHide();
+            alert("未找到模板!");
+        }
+    });
+}
 function onTagRefund(e) {
     var rec = grid.getSelected();
     edit_id = rec.ctid;

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

@@ -170,6 +170,9 @@ function actionRenderer(e) {
     html += getGridBtn("notify1", "加急", "urgencyFn('" + id + "')");
     html += getGridBtn("memo", "文件", "fileUrlFn('" + record.tid + "')");
     html += getGridBtn("memo", "客户文件", "oriFileUrlFn('" + record.tid + "','" + record.ctid + "')");
+    if (record.tempId) {
+        html += getGridBtn("undo", "下载模板", "daownTempFile('" + record.tempId + "')");
+    }
     //if (record.IsNeedDesignPrice == 1) {
     //    html += getGridBtn("izc", "设计费", "priceFn('" + id + "')");
     //}
@@ -177,6 +180,31 @@ function actionRenderer(e) {
 
     return html;
 }
+function daownTempFile(tempId) {
+    let url = "https://template.lingtao8.com/template/api/getTemplate"
+    $.ajax({
+        url: url,
+        type: "POST",
+        data: { templateCode: tempId },
+        datatype: "json",
+        success: function (result) {
+            if (result.code == 200) {
+                let file = result?.data?.templateDownUrl;
+                let templateName = result?.data?.templateName;
+                if (file) {
+                    let a = document.createElement("a");
+                    a.href = file;
+                    a.download = templateName;
+                    a.click();
+                }
+            }
+        },
+        error: function (data) {
+            progressHide();
+            alert("未找到模板!");
+        }
+    });
+}
 
 function fileUrlFn(tid) {
     postAjax("checkout_form_data", { tid }, function (data) {

+ 14 - 0
Web/EOrder/OrderList.aspx

@@ -190,6 +190,7 @@
         <li name="edit" iconcls="icon-mation" onclick="onOriFileVisit('PACK_FILE')">查看包裹图片</li>
         <li name="edit" iconcls="icon-mation" onclick="onOriFileVisit('AUTH_FILE')">授权文件</li>
         <li name="edit" iconcls="icon-split" onclick="onOpenTemplate">查看模板</li>
+        <li name="edit" iconcls="icon-split" onclick="viewTempImage">查看模板图片</li>
         <!-- <li name="edit" iconcls="icon-hostrepertory" onclick="onOpenInvoice">发票</li> -->
     </ul>
 
@@ -961,6 +962,19 @@
         <iframe src="" id="knowledge_wev" style="width: 100%; height: 100%"></iframe>
     </div>
     <script>
+        function onSetTemplate() {
+            let rec = grid.getSelected();
+            let ctid = rec.ctid;
+            let tempId = rec.tempId;
+            mini.prompt(`当前模板号为:${tempId ? tempId : "--"}`, "请输入", function (action, value) {
+                if (action == "ok") {
+                    let params = { ctid, tempId: value }
+                    postAjax("setCellTeampId", params, function (data) {
+                        resultShow(data, "grid.reload();");
+                    });
+                }
+            })
+        }
         function onOpenTemplate() {
             let rec = grid.getSelected();
             let url = 'https://template.lingtao8.com/template/controlSell?orderNumber=' + rec.ctid;

+ 26 - 0
Web/EOrder/js/p_order.js

@@ -68,6 +68,9 @@ function orderAction(e) {
     if (!record.spu_id) {
         html += getGridBtn("edit", "spu", "changeSpuId('" + record.tid + "','" + id + "')");
     }
+    if (record.tempId) {
+        html += getGridBtn("undo", "填写模板", "onSetTemplate('" + record.tempId + "')");
+    }
     if (record.OrderState < 7) {
         html += getGridBtn("word", "上传地址", "uploaderAddress('" + record.ctid + "','" + record.seller_memo + "')");
     }
@@ -1246,6 +1249,29 @@ function viewCdrImg(id) {
     //$("#r_img").attr("src", url);
 }
 
+function viewTempImage() {
+    let rec = grid.getSelected();
+    let tempId = rec.tempId;
+    let url = "https://template.lingtao8.com/template/api/getTemplate"
+    $.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 viewPayImg(id) {
     var rec = grid.getSelected();
     var url = viewUrl + "/" + new Date(rec.pay_time).format("yyyyMM") + "/" + rec.PayProofImg;

+ 3 - 0
Web/js/view.render.js

@@ -61,6 +61,9 @@
     if (record.authCount > 0) {
         html += "<span class=\"word_tui word_green\" style='background-color:#3ed3f5'>授</span>";
     }
+    if (record.tempId) {
+        html += "<span class=\"word_tui word_green\" style='background-color:#3ed3f5'>模</span>";
+    }
     let nowTime = Math.ceil(new Date().getTime() / 1000);
     if (record.StartDesignTime) {
         let startDesignTime = record.StartDesignTime ? new Date(record.StartDesignTime).getTime() / 1000 : 0;