zhuyiyi 2 сар өмнө
parent
commit
2d4db34246

+ 171 - 0
BizCom/Dao/CeErpInvoice.cs

@@ -0,0 +1,171 @@
+using Castle.ActiveRecord;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BizCom
+{
+    [ActiveRecord("CE_ErpInvoice")]
+    public class CeErpInvoice : ComBase<CeErpInvoice>
+    {
+        /// <summary>
+        /// ID
+        /// </summary>
+        [PrimaryKey(PrimaryKeyType.Native)]
+        public int ID { get; set; }
+
+        private string _tid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string tid
+        {
+            get { return _tid; }
+            set { _tid = value; }
+        }
+        private string _ctid = "";
+        /// <summary>
+        ///
+        /// </summary>
+        [Property]
+        public string ctid
+        {
+            get { return _ctid; }
+            set { _ctid = value; }
+        }
+
+        private string _status = "";
+
+        /// <summary>
+        /// 状态 
+        /// PENDING_REVIEW 待审核
+        /// PENDING_INVOICE 待开票
+        /// FINISH 已完成
+        /// FAIL 开票失败
+        /// ALREADY_RED 已红冲
+        /// CANCEL 已取消
+        /// BACK 已驳回
+        /// ERROR 错误
+        /// </summary>
+        [Property]
+        public string status
+        {
+            get { return _status; }
+            set { _status = value; }
+        }
+
+        /// <summary>
+        /// 完成时间
+        /// </summary>
+        [Property]
+        public DateTime? finishtime { get; set; }
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        [Property]
+        private DateTime? createtime { get; set; }
+
+        private string _message = "";
+        /// <summary>
+        /// 
+        /// </summary>
+        [Property]
+        public string message
+        {
+            get { return _message; }
+            set { _message = value; }
+        }
+
+        private int _createId = 0;
+        /// <summary>
+        /// 
+        /// </summary>
+        [Property]
+        public int createId
+        {
+            get { return _createId; }
+            set { _createId = value; }
+        }
+
+        private string _buyerTitle = "";
+        /// <summary>
+        /// 购买抬头
+        /// </summary>
+        [Property]
+        public string buyerTitle
+        {
+            get { return _buyerTitle; }
+            set { _buyerTitle = value; }
+        }
+        private string _buyerSn = "";
+        /// <summary>
+        /// 购买识别号
+        /// </summary>
+        [Property]
+        public string buyerSn
+        {
+            get { return _buyerSn; }
+            set { _buyerSn = value; }
+        }
+
+        private string _sellerTitle = "";
+        /// <summary>
+        /// 卖方抬头
+        /// </summary>
+        [Property]
+        public string sellerTitle
+        {
+            get { return _sellerTitle; }
+            set { _sellerTitle = value; }
+        }
+        private string _sellerSn = "";
+        /// <summary>
+        /// 卖方识别号
+        /// </summary>
+        [Property]
+        public string sellerSn
+        {
+            get { return _sellerSn; }
+            set { _sellerSn = value; }
+        }
+
+        private double _price = 0.0;
+        /// <summary>
+        /// 开票金额
+        /// </summary>
+        [Property]
+        public double price
+        {
+            get { return _price; }
+            set { _price = value; }
+        }
+
+        private double _taxRate = 0.0;
+        /// <summary>
+        /// 税率
+        /// </summary>
+        [Property]
+        public double taxRate
+        {
+            get { return _taxRate; }
+            set { _taxRate = value; }
+        }
+
+        private double _taxPrice = 0.0;
+        /// <summary>
+        /// 税费
+        /// </summary>
+        [Property]
+        public double taxPrice
+        {
+            get { return _taxPrice; }
+            set { _taxPrice = value; }
+        }
+
+
+    }
+}

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

@@ -62,10 +62,11 @@ namespace SiteCore.Handler
 
 
             string poscode = CurrentUser.UserPost.Post.Code;
+
             DataStruct dStruct = GetPostStruct();
 
-            //string a = SecurityHelper.DecryptSymmetric("YDaPXIhsKgw=");
-            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\领淘文件名命名规范.xls");
+            //string a = SecurityHelper.DecryptSymmetric("iG5fU/YBNxc=");
+            //jiemiUtils.ossFileDecrypt("C:\\Users\\231010\\Downloads\\新建文件夹\\tj21hf.psd");
             //apiHelper.Api_SyncOrderByTime("598825");
             //apiHelper.API_GetWaybill("ZTO-CAINIAO-TZJK", "4233447147588233939");
             //apiHelper.Api_SyacOrder("2460143282114312263", "yujia");
@@ -249,6 +250,11 @@ namespace SiteCore.Handler
             {
                 lw.Add(string.Format("seller_memo like '%{0}%'", sellermemo));
             }
+            string otherMemo = GetPostString("otherMemo");
+            if (otherMemo.Length > 0)
+            {
+                lw.Add(string.Format("otherMemo like '%{0}%'", otherMemo));
+            }
             string backReason = GetPostString("backReason");
             if (backReason.Length > 0)
             {
@@ -14073,6 +14079,35 @@ namespace SiteCore.Handler
             returnSuccessMsg("保存成功");
 
         }
+
+        public void getInvoiceOrder()
+        {
+            string tid = GetPostString("tid");
+            CeErpTrade ceErpTrade = CeErpTrade.Get(tid);
+            List<string> tids = new List<string>();
+
+            if (!string.IsNullOrEmpty(ceErpTrade.buyer_nick) && !string.IsNullOrEmpty(ceErpTrade.buyer_id))
+            {
+                string sql = string.Format("SELECT tid FROM [dbo].[CE_ErpTrade] WHERE buyer_id = '{0}' AND seller_nick = '{1}' order by pay_time desc;", ceErpTrade.buyer_id, ceErpTrade.seller_nick);
+                DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
+                foreach (DataRow dr in dt.Rows)
+                {
+                    tids.Add("'" + dr["tid"].ToString() + "'");
+                }
+            }
+            else
+            {
+                tids.Add("'" + ceErpTrade.tid + "'");
+            }
+
+            DataTable cell_dt = new DataTable();
+            if (tids.Count > 0)
+            {
+                cell_dt = DbHelper.DbConn.ExecuteDataset(string.Format("SELECT * FROM [dbo].[CE_ErpTradeCell] WHERE tid in ({0});", string.Join(",", tids))).Tables[0];
+            }
+            ReturnSuccess(Utils.Serialization.JsonString.DataTable2MiniAjaxJson(cell_dt));
+            return;
+        }
     }
 
 }

+ 1 - 1
SiteCore/taobao/commonHelper.cs

@@ -2821,7 +2821,7 @@ namespace SiteCore
         public static DataTable getSameOrderList(CeErpTradeCell entity, CeErpTrade ceErpTrade)
         {
             StringBuilder sql = new StringBuilder();
-            sql.AppendFormat("select ctid,IsSF,seller_memo,OtherMemo,productId,FinishPlaceTime,ProductCount,OrderSn from view_ErpTradeCell where SupplierId={0} and orderstate=6 and IsSample = 0", entity.SupplierId);
+            sql.AppendFormat("select ctid,IsSF,seller_memo,OtherMemo,productId,FinishPlaceTime,ProductCount,OrderSn from view_ErpTradeCell where SupplierId={0} and orderstate=6 and IsSample = 0 AND ShopId = {1}", entity.SupplierId, entity.ShopId);
             if (string.IsNullOrEmpty(ceErpTrade.receiverId))
             {
                 sql.AppendFormat(" and (tid='{0}');", entity.tid);

+ 10 - 0
SiteCore/taobao/dataHelper.cs

@@ -206,6 +206,7 @@ namespace SiteCore.Handler
             CeErpTrade ceErpTrade = CeErpTrade.Get(ceErpTradeCell.tid);
             Dictionary<string, object> data = new Dictionary<string, object>();
             data.Add("ctid", ceErpTradeCell.ctid);
+            data.Add("isSF", ceErpTradeCell.IsSF);
             if (ceErpTrade != null)
             {
                 data.Add("province", ceErpTrade.receiver_state);
@@ -326,6 +327,15 @@ namespace SiteCore.Handler
             return;
 
         }
+
+        public void getOrderInvoiceInfo()
+        {
+            string tids = GetPostString("tids");
+            List<string> list = tids.Split(',').ToList();
+
+            return;
+        }
+
         //http://47.114.150.226:88/Handler/dataHelper.ashx?t=update_spu_info   post请求参数(参数放body中):string spuId(淘宝订单号)
         public void update_spu_info()
         {

+ 75 - 14
Web/DicPage.aspx

@@ -152,11 +152,9 @@
                 html += '<tr>';
 
                 html += `<td class="td1">店铺:</td><td class="td2">${item.shopName}</td>
-                         <td class="td1">技能</td><td class="td2">
-                            <div id="design_${item.shopId}" class="mini-combobox" style="width: 300px;" popupwidth="300" textfield="name" valuefield="id" value="${item.designIds}" data='${JSON.stringify(productList)}' multiselect="true" showclose="true" onvaluechanged="desgingChange('${item.shopId}')"><div property="columns">
-    <div header="全部" field="name"></div>
-</div></div>
-                         </td>`
+                         <td class="td1">操作</td><td class="td2">
+                            <button type="button" onclick="showDesignPop('${item.shopId}')">修改技能</button>
+                        </td>`
 
                 html += '</tr>';
             })
@@ -171,17 +169,59 @@
         }
 
         function saveShopDesign() {
-            let id = $("#hId").val();
+            let tarId = $("#hId").val();
+            if (!tarId) {
+                saveFn(true)
+                return;
+            }
+            let data = []
+            let shopIds = [];
+            shop_list?.map(item => {
+                shopIds.push(item.shopId)
+            })
             let params = {
+                tarId,
                 type: 0,
-                data: JSON.stringify(shop_list),
-                tarId: id,
+                shopIds: shopIds.join(",")
             }
-            postAjax("save_dic_info", params, function (data) {
-                resultShow(data);
+            postAjax("save_shop_info", params, function (data) {
+                resultShow(data); 
             })
         }
+        var selectShopId = 0;
+        function saveShopDesignFun() {
+            let designId = mini.get("showDesign").getValue();
+            let id = $("#hId").val();
 
+            let data = []
+            shop_list?.map(item => {
+                if (item.shopId == selectShopId) {
+                    data.push({ designIds: designId, shopId: selectShopId, orders: item.orders })
+                }
+            })
+            let index = shop_list.findIndex(item => item.shopId == selectShopId);
+            let params = {
+                tarId: id,
+                type: 0, shopId: selectShopId,
+                data: JSON.stringify(data)
+            };
+            postAjax("save_dic_info", params, function (data) {
+                shop_list[index].designIds = designId
+                canceShopDesignFun();
+            })
+        }
+        function canceShopDesignFun() {
+            mini.get("showDesign_win").hide();
+        }
+        function showDesignPop(shopId) {
+            selectShopId = shopId;
+            let shop = shop_list.find(item => item.shopId == shopId);
+            if (!shop) {
+                shop.designIds = "";
+            }
+            mini.get("showDesign").setValue(shop.designIds);
+            mini.get("showDesign_win").show();
+        }
         function getDesignInfo() {
 
             if (shopList.length == 0 || productList.length == 0) {
@@ -236,10 +276,8 @@
                         html += '<tr>';
 
                         html += `<td class="td1">店铺:</td><td class="td2">${item.shopName}</td>
-                                  <td class="td1">技能</td><td class="td2">
-                                     <div id="design_${item.shopId}" class="mini-combobox" style="width: 300px;" popupwidth="300" textfield="name" valuefield="id" value="${item.designIds}" data='${JSON.stringify(productList)}' multiselect="true" showclose="true" onvaluechanged="desgingChange('${item.shopId}')"><div property="columns">
-    <div header="全部" field="name"></div>
-</div></div>
+                                  <td class="td1">操作</td><td class="td2">
+                                    <button type="button" onclick="showDesignPop('${item.shopId}')">修改技能</button>
                                   </td>`
 
                         html += '</tr>';
@@ -261,6 +299,29 @@
         <input type="hidden" id="hPemShop" />
         <a id="code_href" target="_blank" href="#">提示</a>
     </div>
+    <div id="showDesign_win" class="mini-window" title="店铺技能" style="width: 750px; height: 170px; position: relative; display: none">
+        <table class="win_tb" border="0" cellpadding="0" cellspacing="1">
+            <tr>
+                <td class="td1"></td>
+                <td class="td2" colspan="3">
+                    <div id="showDesign" class="mini-combobox" url="./Handler/sync.ashx?t=get_sel_product" style="width: 750px;" popupwidth="300" textfield="name" valuefield="id" multiselect="true" showclose="true">
+                        <div property="columns">
+                            <div header="全部" field="name"></div>
+                        </div>
+                    </div>
+                </td>
+            </tr>
+            <tr>
+                <td colspan="4">
+                    <div class="win_btn" style="text-align: center;">
+                        <a class="mini-button" iconcls="icon-ok" onclick="saveShopDesignFun">保存</a>&nbsp;
+                <a class="mini-button" iconcls="icon-cancel" onclick="canceShopDesignFun">取消</a>
+                    </div>
+                </td>
+            </tr>
+        </table>
+
+    </div>
     <div class="mini-layout" style="width: 100%; height: 100%;">
         <div id="m_tree_div" runat="server" region="west" runat="server" showheader="true" showspliticon="true" bodystyle="padding-left:1px;" width="200" minwidth="100" maxwidth="350">
             <input id="txtTreeKey" type="text" style="width: 92%;" />

+ 74 - 4
Web/EOrder/OrderList.aspx

@@ -186,8 +186,9 @@
         <li name="edit" iconcls="icon-add" onclick="onAddWechatTag">已添加微信</li>
         <li name="edit" iconcls="icon-epay" onclick="onShowRule">知识库</li>
         <li name="edit" iconcls="icon-stop" onclick="onReturnVisit">客户回访</li>
-        <li name="edit" iconcls="icon-stop" onclick="onOriFileVisit('ORI_FILE')">上传客户文件</li>
-        <li name="edit" iconcls="icon-stop" onclick="onOriFileVisit('PACK_FILE')">查看包裹图片</li>
+        <li name="edit" iconcls="icon-dispatch" onclick="onOriFileVisit('ORI_FILE')">上传客户文件</li>
+        <li name="edit" iconcls="icon-mation" onclick="onOriFileVisit('PACK_FILE')">查看包裹图片</li>
+        <!-- <li name="edit" iconcls="icon-hostrepertory" onclick="onOpenInvoice">发票</li> -->
     </ul>
 
 
@@ -805,7 +806,7 @@
             <tr>
                 <td colspan="5">
                     <div class="win_btn" style="text-align: center;">
-                        <a class="mini-button" iconcls="icon-ok" onclick="saveUploaderOriFileFn">确定</a>&nbsp;
+                        <a class="mini-button" iconcls="icon-ok" onclick="cancelUploaderOriFileFn">确定</a>&nbsp;
                         <a class="mini-button" iconcls="icon-cancel" onclick="cancelUploaderOriFileFn">取消</a>
                     </div>
                 </td>
@@ -910,11 +911,70 @@
             </tr>
         </table>
     </div>
+    <div id="invoice_win" class="mini-window" title="发票信息" style="width: 1000px; height: 500px; position: relative; display: none">
+        <table class="win_tb" border="0" cellpadding="0" cellspacing="1">
+            <tr>
+                <td class="td1">开票类型</td>
+                <td class="td2" colspan="3" style="display: flex; align-items: center">
+                    <label for="one" style="flex: 1">
+                        <input type="radio" name="type" id="one" checked="checked" />
+                        一单一票
+                    </label>
+                    <label for="together" style="flex: 1">
+                        <input type="radio" name="type" id="together" />
+                        合并开票
+                    </label>
+                    <label for="spilt" style="flex: 1">
+                        <input type="radio" name="type" id="spilt" />
+                        一单分割多票
+                    </label>
+                </td>
+            </tr>
+            <tr>
+                <td class="td1">待开票订单</td>
+                <td class="td2" colspan="3" id="invoice_order"></td>
+            </tr>
+
+            <tr>
+                <td class="td1">开票备注</td>
+                <td class="td2" colspan="3">
+                    <textarea style="width: 500px; height: 50px"></textarea>
+                </td>
+            </tr>
+            <tr>
+                <td colspan="4">
+                    <div class="win_btn" style="text-align: center;">
+                        <a class="mini-button" iconcls="icon-ok" onclick="savePersonInfoFn">邀请开票</a>&nbsp;
+                        <a class="mini-button" iconcls="icon-cancel" onclick="cancelPersonInfoFn">取消</a>
+                    </div>
+                </td>
+            </tr>
+        </table>
+    </div>
     <div id="knowledge_win" class="mini-window" title="知识库" style="width: 750px; height: 570px; position: relative; display: none">
         <iframe src="" id="knowledge_wev" style="width: 100%; height: 100%"></iframe>
     </div>
     <script>
 
+        function onOpenInvoice(e) {
+            let item = grid.getSelected();
+            postAjax("getInvoiceOrder", { tid: item.tid }, function (data) {
+                let html = `<div>`;
+                for (let i = 0; i < data.length; i++) {
+                    let item = data[i];
+                    html += `<div style="display: flex;align-items: center;gap: 10px;border:1px solid #c1c1c1;padding:10px 5px;">
+                        <div style="flex:1"><input type="checkbox" val="${item.ctid}"></div>
+                        <div style="flex:2">${item.ctid}</div>
+                        <div style="flex:11">${item.seller_memo}</div>
+                        <div style="flex:1">${item.payment}</div>
+                    </div>`
+                }
+                html += `</div>`;
+                $("#invoice_order").empty().append(html);
+                mini.get("invoice_win").show();
+            });
+        }
+
         function onShowRule(e) {
             var rec = grid.getSelected();
             let spu_id = rec.spu_id;
@@ -972,12 +1032,22 @@
         }
 
         function getAddress(that) {
-            mini.prompt("请输入地址:", "请输入",
+            mini.prompt("请输入地址:台湾,香港无法识别!", "请输入",
                 function (action, value) {
                     if (action == "ok") {
                         let parse_data = window.smart(value)
                         let inputs = that.closest("tr").querySelectorAll("input");
                         let { address, city, county, name, phone, province, street } = parse_data;
+                        if (value.indexOf(province) == -1) {
+                            mini.showTips({
+                                    content: "识别错误,格式不正确请手动填写或填写正确格式!",
+                                    state: "danger",
+                                    x: "Center",
+                                    y: "Center",
+                                    timeout: 1000
+                                });
+                            return;
+                        }
                         inputs.forEach(item => {
                             let data_name = item.dataset.name;
                             if (data_name == "province") {

+ 1 - 1
Web/EOrder/OrderList.aspx.cs

@@ -8,7 +8,7 @@ public partial class EOrder_OrderList : BasePage
         _repTitle = "订单列表";
         PmTag = "orderlist";
         //_selfCheckPermission = true;
-        _filterItem = "order,shop,wang,fukuan,moeny,memo,cus,des,state,oldcus,assign_time,addwechat,upload_time,finish_time,backreason,isNewSearch,overtime,delivery_time,spudata";
+        _filterItem = "order,shop,wang,fukuan,moeny,memo,cus,des,state,oldcus,assign_time,addwechat,upload_time,finish_time,backreason,isNewSearch,overtime,delivery_time,spudata,otherMemo";
         _keyFilterVisible = false;
         _addVisible = false;
     }

+ 13 - 5
Web/EOrder/js/p_order.js

@@ -240,7 +240,7 @@ function searchFn() {
         ctid: s.tid, shopname: s.shop, buyer_nick: s.ww, customer: s.customer, design: s.design, orderState: s.state, addwechat: s.addwechat,
         date1: s.date1, date2: s.date2, price1: s.price1, price2: s.price2, address: s.address, seller_memo: s.memo, isoldcus: s.isoldcus, apdate1: s.assigndate1, apdate2: s.assigndate2
         , uploaddate1: s.uploaddate1, uploaddate2: s.uploaddate2, finishdate1: s.finishdate1, finishdate2: s.finishdate2, urgent: urgent, back: back, offlineSearch: offlineSearch, backReason: s.backreason, isNew: isNewSearch,
-        overtime: s.overtime, deliverydate1: s.deliverydate1, deliverydate2: s.deliverydate2, spudata: s.spudata
+        overtime: s.overtime, deliverydate1: s.deliverydate1, deliverydate2: s.deliverydate2, spudata: s.spudata, otherMemo: s.otherMemo
     }
     grid.load(parmsObj);
 
@@ -318,7 +318,14 @@ function memoFn(eid) {
     var rec = grid.getSelected();
     var mm = rec.seller_memo;
     if (mm != "") mm = mm.replace(/&lt;br&gt;/g, "\n");
-    $("#txtMemo").val(mm);
+    $("#txtMemo").val(mm).attr("readonly", true);
+    $("#txtQnMemo").val("").show();
+
+    if (rec.IsSample > 0 || rec.ctid.indexOf("N_") > -1 || rec.seller_memo.indexOf("现货") > -1 || rec.seller_memo.indexOf("礼物") > -1) {
+        $("#txtQnMemo").hide();
+        $("#txtMemo").attr("readonly", false);
+    }
+
     mini.get("memo_win").show();
 
     mini.get("aMemoMsgGai").setChecked(false);
@@ -366,6 +373,7 @@ function saveMemoFn() {
     var parms = new Object();
     parms.ctid = edit_id;
     parms.seller_memo = $("#txtMemo").val();
+    parms.qn_memo = $("#txtQnMemo").val();
     if (_memo_msg == "") {
         _memo_msg = 0;
     }
@@ -980,7 +988,7 @@ $(function () {
         var s = openPageData;
         grid.load({
             ctid: s.tid, shopname: s.shop, buyer_nick: s.ww, customer: s.customer, design: s.design, orderState: s.state,
-            date1: s.date1, date2: s.date2, price1: s.price1, price2: s.price2, address: s.address, seller_memo: s.memo, isoldcus: s.isoldcus, backReason: s.txtBackReason
+            date1: s.date1, date2: s.date2, price1: s.price1, price2: s.price2, address: s.address, seller_memo: s.memo, isoldcus: s.isoldcus, backReason: s.txtBackReason, otherMemo: s.otherMemo
         });
         var form = new mini.Form("#ctl00_f_all");
         if (form != undefined && form != null) {
@@ -1197,7 +1205,7 @@ function searchUrgencyFn() {
     var s = data;
     grid.load({
         tid: s.tid, shopname: s.shop, buyer_nick: s.ww,
-        date1: _startTime, date2: _endTime, price1: s.price1, price2: s.price2, address: s.address, seller_memo: s.memo, urgency: 1, backReason: s.txtBackReason
+        date1: _startTime, date2: _endTime, price1: s.price1, price2: s.price2, address: s.address, seller_memo: s.memo, urgency: 1, backReason: s.txtBackReason, otherMemo: s.otherMemo
     });
 }
 
@@ -1207,7 +1215,7 @@ function searchAfterSaleFn() {
     var s = data;
     grid.load({
         tid: s.tid, shopname: s.shop, buyer_nick: s.ww,
-        date1: _startTime, date2: _endTime, price1: s.price1, price2: s.price2, address: s.address, seller_memo: s.memo, after: 1, backReason: s.txtBackReason
+        date1: _startTime, date2: _endTime, price1: s.price1, price2: s.price2, address: s.address, seller_memo: s.memo, after: 1, backReason: s.txtBackReason, otherMemo: s.otherMemo
     });
 }
 

+ 1 - 0
Web/Global.asax

@@ -114,6 +114,7 @@
                                  typeof(CeErpSukuraData),
                                  typeof(CeErpDeliverMark),
                                  typeof(CeErpPackData),
+                                 typeof(CeErpInvoice),
                                  typeof(CeErpPackDataItem),
                                  typeof(CeErpSupplierProductTime),
                                  typeof(CeErpTradeCellFile),