From 5c2e638d42a620f12c621dbe1e68dbda9271f3a4 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 13 六月 2022 15:38:12 +0800
Subject: [PATCH] 导入功能完善
---
WebTM/views/计划管理/工艺路线/Gy_RoutingBillimport.html | 292 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WebTM/views/index.html | 1
WebTM/WebTM.csproj | 1
3 files changed, 294 insertions(+), 0 deletions(-)
diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj
index 45b7569..4ae27f3 100644
--- a/WebTM/WebTM.csproj
+++ b/WebTM/WebTM.csproj
@@ -895,6 +895,7 @@
<Content Include="views\绯荤粺绠$悊\绯荤粺鍙傛暟绠$悊\Xt_SystemParameter_Edit.html" />
<Content Include="views\绯荤粺绠$悊\绯荤粺鍙傛暟绠$悊\Xt_SystemParameterList.html" />
<Content Include="views\璁″垝绠$悊\宸ヨ壓璺嚎\Gy_RoutingBill.html" />
+ <Content Include="views\璁″垝绠$悊\宸ヨ壓璺嚎\Gy_RoutingBillimport.html" />
<Content Include="views\璁″垝绠$悊\宸ヨ壓璺嚎澶х被\Gy_RoutingGroupList.html" />
<Content Include="views\璁惧绠$悊\Sb_Add_EqpConkBookBillList.html" />
<Content Include="views\璁惧绠$悊\Sb_Add_EqpMaintenanceBillList.html" />
diff --git a/WebTM/views/index.html b/WebTM/views/index.html
index 146784e..b54b02a 100644
--- a/WebTM/views/index.html
+++ b/WebTM/views/index.html
@@ -285,6 +285,7 @@
<dl class="layui-nav-child">
<dd><a lay-href="璁″垝绠$悊/宸ヨ壓璺嚎/Gy_RoutingBillList.html">宸ヨ壓璺嚎缁存姢</a></dd>
<dd><a lay-href="璁″垝绠$悊/宸ヨ壓璺嚎/Gy_RoutingBill.html">宸ヨ壓璺嚎</a></dd>
+ <dd><a lay-href="璁″垝绠$悊/宸ヨ壓璺嚎/Gy_RoutingBillimport.html">宸ヨ壓璺嚎鏁版嵁瀵煎叆</a></dd>
</dl>
<dd>
<dd><a lay-href="璁″垝绠$悊/宸ヨ壓璺嚎澶х被/Gy_RoutingGroupList.html">宸ヨ壓璺嚎澶х被</a></dd>
diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillimport.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillimport.html"
new file mode 100644
index 0000000..65b4418
--- /dev/null
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillimport.html"
@@ -0,0 +1,292 @@
+锘�<!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">
+ <div class="layui-col-md12">
+ <div class="layui-card" style="padding: 1px">
+ <div class="layui-card-body" style="padding: 1px;">
+ <form class="layui-form" action="" lay-filter="component-form-group">
+ <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-collapse">
+ <div class="layui-colla-item">
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 85px;">浼氳骞�</label>
+ <div class="layui-input-block" style="margin-left: 120px; width: 85px;">
+ <select name="HYear" id="HYear" lay-verify="HYear">
+ <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+ </select>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 85px;">浼氳鏈�</label>
+ <div class="layui-input-block" style="margin-left: 120px; width: 85px;">
+ <select name="HPeriod" id="HPeriod" lay-verify="HPeriod">
+ <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+ </select>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 85px;">宸ヤ綔绨�</label>
+ <div class="layui-input-block" style="margin-left: 120px;">
+ <input type="text" class="layui-input" name="WorkBookName" id="WorkBookName" value="Sheet1">
+ </div>
+ </div>
+ <div class="layui-inline">
+ <div class="layui-input-block" style="margin-left: 10px;min-height:0px">
+ <input type="checkbox" name="DataAppend" id="DataAppend" lay-skin="primary" lay-filter="DataAppend" title="杩藉姞">
+ <input type="hidden" name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+ </div>
+ </div>
+ </div>
+ </div>
+ <table class="" id="mainTable" lay-filter="mainTable"></table>
+ <script type="text/html" id="toolbarDemo">
+ <div class="layui-btn-container">
+ <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+ </div>
+ </script>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+</html>
+<script>
+ var treeCkData = { id: 0 };
+ var TagId = "";
+ var TagParentId = "";
+ 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
+ //#endregion
+
+ //#region 杩涘叆椤甸潰鍗冲姞杞�
+
+ //鍒濆鍖栫晫闈�
+ set_ClearBill();
+
+ //#endregion
+
+ //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+
+ //鏂囦欢涓婁紶
+ upload.render({
+ elem: '#UpLoad',
+ url: GetWEBURL() + '/Gy_RoutingBill/Gy_RoutingBillimport',
+ contentType: 'application/json',
+ exts: 'xls|xlsx', //鍏佽涓婁紶鐨勭被鍨�
+ data: {
+ "WorkBookName": function () {
+ return $("#WorkBookName").val();
+ },
+ "HOrgID": function () {
+ return sessionStorage["OrganizationID"];
+ }
+ },
+ before: function (data) {
+ loadIndex = layer.load(2);
+ this.data = {
+ "WorkBookName": $("#WorkBookName").val(),
+ "HOrgID": sessionStorage["OrganizationID"]
+
+ }
+ },
+ done: function (data1) {
+ if (data1.count == 1) {
+ option.data = data1.data;
+ table.render(option);
+ layer.close(loadIndex);
+ } else {
+ layer.close(loadIndex);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
+ }
+ },
+ error: function (err) {
+ debugger
+ layer.alert('瀵煎叆鍑虹幇寮傚父', { icon: 2 });
+ }
+ });
+
+ //閫�鍑�
+ form.on('submit(Cancel)', function () {
+ Pub_Close(2);
+ })
+
+ //瀵煎叆 淇濆瓨鏁版嵁
+ form.on('submit(btnSave)', function (data) {
+ if (table.cache["mainTable"] != null) {
+ set_AddNew(data);
+ }
+ else {
+ layer.msg("鏃犳暟鎹�,璇峰厛瀵煎叆鏁版嵁!");
+ }
+ })
+ //#endregion
+
+ //#region 鏈〉闈㈣璋冪敤鐨勬墍鏈夋柟娉�
+
+ //浼氳骞�
+ function Year() {
+ var yyyy = new Date().getFullYear();
+ var YearOption = "";
+ for (var i = 0; i <= 10; i++) {
+ YearOption += '<option style="color:blue;" value="' + (yyyy - 5 + i) + '">' + (yyyy - 5 + i) + '</option>';
+ }
+ $("#HYear").append(YearOption);
+ $("#HYear").val(yyyy)
+ form.render('select');
+ }
+
+ //浼氳鏈�
+ function Month() {
+ var MM = new Date().getMonth() + 1;
+ var MonthOption = "";
+ for (var i = 1; i <= 12; i++) {
+ MonthOption += '<option style="color:blue;" value="' + i + '">' + i + '</option>';
+ }
+ $("#HPeriod").append(MonthOption);
+ $("#HPeriod").val(MM)
+ form.render('select');
+ }
+
+ //#region 鍒濆鍖栫晫闈�
+ function set_ClearBill() {
+ Year();
+ Month();
+ //鍒濆鍖栬〃鏍�
+ set_InitGrid();
+ }
+ //#endregion
+
+ //鍒濆鍖栬〃鏍�
+ 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: '浜у搧浠g爜', title: '浜у搧浠g爜', width: 120 }
+ , { field: '浜у搧鍚嶇О', title: '浜у搧鍚嶇О', width: 120 }
+ , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 120 }
+ , { field: '鍗曚綅', title: '鍗曚綅', width: 120 }
+ , { field: '宸ヨ壓璺嚎鍚嶇О', title: '宸ヨ壓璺嚎鍚嶇О', width: 120 }
+ , { field: '鐗╂枡鍒嗙被', title: '鐗╂枡鍒嗙被', width: 120 }
+ , { field: '宸ュ簭搴忓彿', title: '宸ュ簭搴忓彿', width: 120 }
+ , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜', width: 120 }
+ , { field: '宸ュ簭', title: '宸ュ簭', width: 120 }
+ , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜', width: 120 }
+ , { field: '宸ヤ綔涓績', title: '宸ヤ綔涓績', width: 120 }
+ , { field: '鏃堕棿鍗曚綅', title: '鏃堕棿鍗曚綅', width: 120 }
+ , { field: '鍔犲伐鏁伴噺', title: '鍔犲伐鏁伴噺', width: 120 }
+ , { field: '鐝骇瀹氶', title: '鐝骇瀹氶', width: 120 }
+ , { field: '宸ュ簭宸ヤ环', title: '宸ュ簭宸ヤ环', width: 120 }
+ , { field: '涓嶅悎鏍煎崟浠�', title: '涓嶅悎鏍煎崟浠�', width: 120 }
+ , { field: '鎶ュ簾鍗曚环', title: '鎶ュ簾鍗曚环', width: 120 }
+ , { field: '鏈亾鍥哄畾寮�宸ュぉ鏁�', title: '鏈亾鍥哄畾寮�宸ュぉ鏁�', width: 120 }
+ , { field: '鏈亾寮�宸ヤ綑閲�', title: '鏈亾寮�宸ヤ綑閲�', width: 120 }
+ , { field: '涓婇亾绛夊緟澶╂暟', title: '涓婇亾绛夊緟澶╂暟', width: 120 }
+ , { field: '涓婇亾寰幆鍛ㄦ湡', title: '涓婇亾寰幆鍛ㄦ湡', width: 120 }
+ , { field: '鑷姩杞Щ', title: '鑷姩杞Щ', width: 120 }
+ , { field: '澶栧崗鏍囪', title: '澶栧崗鏍囪', width: 120 }
+ , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', width: 120 }
+ , { field: '渚涘簲鍟�', title: '渚涘簲鍟�', width: 120 }
+ , { field: '宸ヨ壓鍙傛暟', title: '宸ヨ壓鍙傛暟', width: 120 }
+ , { field: '鍥剧焊缂栧彿', title: '鍥剧焊缂栧彿', width: 120 }
+ , { field: '鏈伐搴忕‘璁よ褰�', title: '鏈伐搴忕‘璁よ褰�', width: 120 }
+ , { field: '鑹巼', title: '鑹巼', width: 120 }
+ , { field: '澶囨敞', title: '澶囨敞', width: 120 }
+ , { field: '鍥惧彿鐗堟湰', title: '鍥惧彿鐗堟湰', width: 120 }
+ , { field: '鎬昏鍥惧彿', title: '鎬昏鍥惧彿', width: 120 }
+ , { field: '鏉愯川', title: '鏉愯川', width: 120 }
+ , { field: '鎴愬搧缂栧彿', title: '鎴愬搧缂栧彿', width: 120 }
+ , { field: '鐗堟湰', title: '鐗堟湰', width: 120 }
+ , { field: '妯″叿缂栧彿', title: '妯″叿缂栧彿', width: 120 }
+ , { field: '绋嬪簭鍙�', title: '绋嬪簭鍙�', width: 120 }
+ ]]
+ };
+
+ //娓叉煋椤甸潰
+ table.render(option);
+ }
+
+ //瀵煎叆(淇濆瓨)
+ function set_AddNew(data) {
+
+ var num = [];
+ for (var i = 0; i < table.cache["mainTable"].length; i++) {
+ if (table.cache["mainTable"][i] != "") {
+ table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
+ num.push(table.cache["mainTable"][i])
+ }
+ }
+ data.field.HOrgID = sessionStorage["OrganizationID"];//缁勭粐
+ var sMainStr = JSON.stringify(data.field);
+ var sSubStr = JSON.stringify(num);
+ var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"];
+ var index = layer.load();
+
+ $.ajax({
+ type: "POST",
+ url: GetWEBURL() + "/Gy_RoutingBill/Gy_RoutingBill_btnSave",
+ async: true,
+ data: { "sMainSub": sMainSub },
+ dataType: "json",
+ success: function (data) {
+ if (data.count == 1) {
+ layer.close(index);
+ layer.msg(data.Message);
+ }
+ 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
+ //浠ヤ笂鏄痩ayui妯″潡
+ });
+</script>
\ No newline at end of file
--
Gitblit v1.9.1