From 8bc35e9afde93deb79155c90d1d13f04edd9d527 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期五, 19 九月 2025 10:38:03 +0800
Subject: [PATCH] 供应商送货信息excel导入

---
 WebTM/WebTM.csproj.user                                  |    2 
 WebTM/views/基础资料/基础资料/Gy_SupplierDeliveryInfo_Excel.html |  291 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 WebTM/layuiadmin/Scripts/webConfig.js                    |    5 
 WebTM/WebTM.csproj                                       |    1 
 4 files changed, 296 insertions(+), 3 deletions(-)

diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj
index 1d328bd..f94efcd 100644
--- a/WebTM/WebTM.csproj
+++ b/WebTM/WebTM.csproj
@@ -556,6 +556,7 @@
     <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_Repair_Excel.html" />
     <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_Maintain_Excel.html" />
     <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_DotCheck_Excel.html" />
+    <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_SupplierDeliveryInfo_Excel.html" />
     <Content Include="views\鍩虹璧勬枡\宸ヨ祫鍩虹璧勬枡\Gy_WorkType_Excel.html" />
     <Content Include="views\鍩虹璧勬枡\鐢熶骇鍩虹璧勬枡\Add_Edit_Gy_ProcMul.html" />
     <Content Include="views\鍩虹璧勬枡\鐢熶骇鍩虹璧勬枡\Gy_BadReason_Excel.html" />
diff --git a/WebTM/WebTM.csproj.user b/WebTM/WebTM.csproj.user
index 74bb036..5ba8ac9 100644
--- a/WebTM/WebTM.csproj.user
+++ b/WebTM/WebTM.csproj.user
@@ -2,7 +2,7 @@
 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <NameOfLastUsedPublishProfile>D:\鏅轰簯杩堟�漒MES\MES-WEB-LayUI\WebTM\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
-    <NameOfLastUsedPublishProfile>D:\鏅轰簯LMes\MESWMS-LayUI\WebTM\Properties\PublishProfiles\LAYUI.pubxml</NameOfLastUsedPublishProfile>
+    <NameOfLastUsedPublishProfile>D:\GitHub\MES-WEB-LAYUI-HK\WebTM\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
     <ProjectView>ProjectFiles</ProjectView>
     <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
     <UseIISExpress>true</UseIISExpress>
diff --git a/WebTM/layuiadmin/Scripts/webConfig.js b/WebTM/layuiadmin/Scripts/webConfig.js
index d4f383c..470fabe 100644
--- a/WebTM/layuiadmin/Scripts/webConfig.js
+++ b/WebTM/layuiadmin/Scripts/webConfig.js
@@ -7,10 +7,11 @@
     //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //鏉ㄤ箰鏈湴閰嶇疆
     //var WEBURL = "http://localhost:8082/API/";    //鏉滆春鏈湴閰嶇疆
     /*var WEBURL = "http://localhost:8082/API/";    //寮犵憺骞挎湰鍦伴厤缃�*/
-    var WEBURL = "http://localhost:81/API/"    //缈佹稕娑涙湰鍦伴厤缃�
+/*    var WEBURL = "http://localhost:81/API/"    //缈佹稕娑涙湰鍦伴厤缃�*/
     //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //鏉ㄤ箰鏈湴閰嶇疆
     //var WEBURL = "http://47.96.97.237/API/";          //鏅轰簯鏈嶅姟鍣�
-    var WEBURL = "http://localhost:8082/LuBaoAPI/";  //浣欐�濇澃鏈湴閰嶇疆
+/*    var WEBURL = "http://localhost:8082/LuBaoAPI/";  //浣欐�濇澃鏈湴閰嶇疆*/
+    var WEBURL = "http://localhost:84/HK_API/";  //鏉庢灄淇婃湰鍦伴厤缃�
     //var WEBURL = "http://localhost:8088/ARAPI/";      //浣欐�濇澃鏈湴閰嶇疆(瀹夌憺)
     //var WEBURL = "http://61.164.86.218:8099/ABAPI/";  //濂ラ偊
     //var WEBURL = "http://10.1.4.155/API/";            //姹熶赴瀹㈡埛NEW
diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SupplierDeliveryInfo_Excel.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SupplierDeliveryInfo_Excel.html"
new file mode 100644
index 0000000..fcbf1cb
--- /dev/null
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SupplierDeliveryInfo_Excel.html"
@@ -0,0 +1,291 @@
+锘�
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <title>渚涘簲鍟嗛�佽揣淇℃伅瀵煎叆</title>
+    <link rel="stylesheet" href="../../../../layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../../../layuiadmin/style/admin.css" media="all">
+    <script src="../../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
+    <script src="../../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../../layuiadmin/Scripts/json2.js"></script>
+    <script src="../../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
+    <script src="../../../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../../../layuiadmin/PubCustom.js"></script>
+</head>
+<body>
+    <div class="layui-fluid" style="padding: 0;">
+        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
+            <div class="layui-card-body" style="padding: 1px;">
+                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
+                    <div style="padding: 10px; ">
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">瀵煎叆鏁版嵁</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Cancel" id="Cancel">閫�鍑�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="UpLoad" id="UpLoad">鏂囦欢涓婁紶</button>
+                    </div>
+                    <div class="layui-tab" lay-filter="tab-POStockInBill">
+                        <div class="layui-tab-content">
+                            <!--鍩烘湰淇℃伅-->
+                            <div class="layui-tab-item layui-show">
+                                <div class="layui-form-item" style="padding-top: 10px;">
+
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+
+                    <table class="" id="mainTable" lay-filter="mainTable"></table>
+                    <script type="text/html" id="toolbarDemo">
+                        <div class="layui-btn-container">
+                        </div>
+                    </script>
+                </form>
+            </div>
+        </div>
+    </div>
+</body>
+</html>
+<script type="text/html" id="barDemo">
+    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+</script>
+<script>
+
+    layui.config({
+        base: '../../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+    }).extend({
+        index: 'lib/index' //涓诲叆鍙fā鍧�
+    }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate', 'util', 'upload'], function () {
+        //#region 鍏敤鍙橀噺
+        var $ = layui.$
+            , admin = layui.admin
+            , layer = layui.layer
+            , table = layui.table
+            , form = layui.form
+            , element = layui.element
+            , laypage = layui.laypage
+            , laydate = layui.laydate
+            , util = layui.util
+            , tree = layui.tree
+            , util = layui.util
+            , upload = layui.upload
+
+
+        var option = [];
+        var isButtonDisabled = false; // 鎸夐挳鐘舵�佹爣蹇�
+        var countdownTimer = null; // 鍊掕鏃跺畾鏃跺櫒
+        //#endregion
+
+        //#region 杩涘叆椤甸潰鍗冲姞杞�
+
+        //鍒濆鍖栫晫闈�
+        set_ClearBill();
+
+
+        //#endregion
+
+        //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+
+        //鏂囦欢涓婁紶
+        upload.render({
+            elem: '#UpLoad',
+            url: GetWEBURL() + '/Gy_SupplierDeliveryInfo_ExcelController/Gy_Process_Excel',
+            contentType: 'application/json',
+            exts: 'xls|xlsx', //鍏佽涓婁紶鐨勭被鍨�
+            before: function () {
+                loadingIndex = layer.load(1, {
+                    shade: [0.1, '#fff'],
+                    content: '<div style="padding: 20px; text-align: center;">鏂囦欢涓婁紶涓紝璇风◢鍊�...</div>'
+                });
+            },
+            done: function (data1) {
+                if (loadingIndex) {
+                    layer.close(loadingIndex);
+                    loadingIndex = null;
+                }
+
+                if (data1.count == 1) {
+                    option.data = data1.data;
+                    table.render(option);
+                    layer.msg('鏂囦欢涓婁紶鎴愬姛锛�', { icon: 1 });
+                } else {
+                    layer.alert(data1.code + data1.Message, { icon: 5 });
+                }
+            },
+            error: function (err) {
+                if (loadingIndex) {
+                    layer.close(loadingIndex);
+                    loadingIndex = null;
+                }
+
+                layer.alert('瀵煎叆鍑虹幇寮傚父锛�' + JSON.stringify(err), { icon: 2 });
+            }
+        });
+        //琛屽唴浜嬩欢
+        table.on('tool(mainTable)', function (obj) {
+            set_GridDelete(obj);   //琛屽唴鍒犻櫎
+        });
+
+        //瀵煎叆  淇濆瓨鏁版嵁
+        form.on('submit(btnSave)', function (data) {
+            // 濡傛灉鎸夐挳宸茶绂佺敤锛岀洿鎺ヨ繑鍥�
+            if (isButtonDisabled) {
+                return false;
+            }
+
+            if (table.cache["mainTable"] != null) {
+                // 绂佺敤鎸夐挳骞跺惎鍔ㄥ�掕鏃�
+                disableButtonWithCountdown(4);
+
+                set_AddNew(data);
+            }
+            else {
+                layer.msg("鏃犳暟鎹�,璇峰厛瀵煎叆鏁版嵁!");
+            }
+        })
+
+        //閫�鍑�
+        form.on('submit(Cancel)', function () {
+            Pub_Close(1);
+        })
+
+
+        //#endregion
+
+        //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
+
+        //#region 鍒濆鍖栫晫闈�
+        function set_ClearBill() {
+            //鍒濆鍖栬〃鏍�
+            set_InitGrid();
+        }
+        //#endregion
+        // 绂佺敤鎸夐挳骞跺惎鍔ㄥ�掕鏃�
+        function disableButtonWithCountdown(seconds) {
+            if (countdownTimer) {
+                clearInterval(countdownTimer);
+            }
+
+            isButtonDisabled = true;
+            var btn = $("#btnSave");
+            var originalText = btn.text();
+            btn.addClass("btn-disabled");
+            btn.prop("disabled", true);
+
+            var remaining = seconds;
+            btn.html('璇风瓑寰� <span class="countdown-text">' + remaining + '</span> 绉�');
+
+            countdownTimer = setInterval(function () {
+                remaining--;
+
+                if (remaining <= 0) {
+                    clearInterval(countdownTimer);
+                    isButtonDisabled = false;
+                    btn.removeClass("btn-disabled");
+                    btn.prop("disabled", false);
+                    btn.text(originalText);
+                } else {
+                    btn.html('璇风瓑寰� <span class="countdown-text">' + remaining + '</span> 绉�');
+                }
+            }, 1000);
+        }
+
+        //鍒濆鍖栬〃鏍�
+        function set_InitGrid() {
+            option = {
+                elem: '#mainTable'
+                , toolbar: '#toolbarDemo'
+                , height: 'full-120'
+                , page: true
+                , cellMinWidth: 90
+                , limit: 50
+                , limits: [50, 500, 5000, 20000]
+                , loading: false
+                , cols: [[
+                    { type: 'checkbox', fixed: 'left' }
+                    , { field: 'HItemID', title: 'HItemID', sort: true, hide: true }
+                    , { field: '鐗╂枡缂栫爜', title: '鐗╂枡缂栫爜' }
+                    , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О' }
+                    , { field: '渚涘簲鍟�', title: '渚涘簲鍟�' }
+                    , { field: 'HSupplierID', title: 'HSupplierID', hide: true }
+                    , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', hide: true }
+                    , { field: '姣忔墭绠辨暟閲�', title: '姣忔墭绠辨暟閲�' }
+                    , { field: '鎵樼鏁�', title: '鎵樼鏁�' }
+                    , { field: '閫佽揣鏁伴噺', title: '閫佽揣鏁伴噺' }
+                    , { field: 'HMaterID', title: 'HMaterID', hide: true}
+
+                    , { field: '鐢ㄦ埛鍚嶇О', title: '鐢ㄦ埛鍚嶇О', hide: true }
+                    , { field: '鏃ユ湡', title: '鏃ユ湡', hide: true }
+       
+                    , { field: '缁勭粐', title: '缁勭粐', hide: true}
+                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
+                ]]
+            };
+
+            //娓叉煋椤甸潰
+            table.render(option);
+            //DisPlay_HideColumn();
+        }
+
+        //琛屽唴鍒犻櫎
+        function set_GridDelete(obj) {
+            var data = obj.data;
+            var rowIndex = $(obj.tr).attr("data-index");
+            if (obj.event === 'del') {
+                layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
+                    console.log("绱㈠紩涓�:" + rowIndex);
+                    if (rowIndex === '0') {
+                        layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
+                    } else {
+                        var oldData = option.data;
+                        oldData.splice(obj.tr.data('index'), 1)
+                        option.data = oldData;//灏嗘暟鎹粦瀹氬埌data涓�
+                        table.render(option);
+                        layer.close(index);
+                    }
+                });
+            }
+        }
+
+        //瀵煎叆(淇濆瓨)
+        function set_AddNew(data) {
+            var num = [];
+            for (var i = 0; i < option.data.length; i++) {
+                if (option.data[i] != "") {
+                    num.push(option.data[i])
+                }
+            }
+
+            var sSubStr = JSON.stringify(num);
+            var sMainSub = sSubStr + '&鍜�' + sessionStorage["HUserName"] + '&鍜�' + sessionStorage["OrganizationID"];
+            var index = layer.load();
+            $.ajax({
+                type: "POST",
+                url: GetWEBURL() + "/Gy_SupplierDeliveryInfo_ExcelController/Excel_btnSave",
+                async: false,
+                data: { "sMainSub": sMainSub },
+                dataType: "json",
+                success: function (data) {
+                    if (data.count == 1) {
+                        layer.close(index);
+                        layer.msg(data.Message);
+                        option.data = data;
+                        table.cache["mainTable"] = null;
+                        table.render(option);
+                    }
+                    else {
+                        layer.close(index);
+                        layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    }
+                },
+                error: function (err) {
+                    layer.close(index);
+                    layer.msg("閿欒:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                }
+            });
+        }
+
+        //#endregion
+
+    });
+
+</script>
\ No newline at end of file

--
Gitblit v1.9.1