From 069cecec5eb63a82a7c46fb1b331289246040226 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期六, 31 十二月 2022 23:03:43 +0800 Subject: [PATCH] 器具状态;器具报废申请;器具寿命耗用;设备状态 --- WebTM/views/模治具管理/模治具仓库管理/Sc_MouldScrapRequestBillList.html | 531 ++++ WebTM/views/模治具管理/模治具仓库管理/Sc_MouldStatusChangeBill.html | 762 ++++++ WebTM/views/设备管理/设备状态/Sb_EquipStatusChangeBill.html | 762 ++++++ WebTM/views/模治具管理/模治具仓库管理/Sc_MouldLifeUseBillList.html | 522 ++++ WebTM/views/基础资料/基础资料/Gy_EquipStatus.html | 556 ++++ WebTM/views/模治具管理/模治具仓库管理/Sc_Add_MouldLifeUseBillList.html | 763 ++++++ WebTM/views/基础资料/基础资料/Gy_MouldStatusEdit.html | 266 ++ WebTM/views/模治具管理/模治具仓库管理/Sc_MouldScrapRequestBill.html | 895 +++++++ WebTM/views/基础资料/基础资料/Gy_EquipStatusEdit.html | 266 ++ WebTM/views/设备管理/设备状态/Sb_EquipStatusChangeBillList.html | 525 ++++ WebTM/views/index.html | 10 WebTM/views/基础资料/基础资料/Gy_MouldStatus.html | 556 ++++ WebTM/views/模治具管理/模治具仓库管理/Sc_MouldStatusChangeBillList.html | 525 ++++ WebTM/WebTM.csproj | 12 14 files changed, 6,951 insertions(+), 0 deletions(-) diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj index b0567bb..f6dbdec 100644 --- a/WebTM/WebTM.csproj +++ b/WebTM/WebTM.csproj @@ -195,8 +195,12 @@ <Content Include="views\鍩虹璧勬枡\鍏敤鍩虹璧勬枡\Add_Edit_Gy_PackType.html" /> <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_CustLocationEdit.html" /> <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_CustLocationList.html" /> + <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_EquipStatus.html" /> + <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_EquipStatusEdit.html" /> <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_MatePriceSup.html" /> <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_MatePriceSupEdit.html" /> + <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_MouldStatus.html" /> + <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_MouldStatusEdit.html" /> <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_Operator.html" /> <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_OperatorEdit.html" /> <Content Include="views\鍩虹璧勬枡\鍩虹璧勬枡\Gy_PaymentConditionEdit.html" /> @@ -842,6 +846,8 @@ <Content Include="views\妯℃不鍏风鐞哱妯″叿鍏朵粬鍑哄簱鍗昞Sc_MouldOtherOutBill_PDA.html" /> <Content Include="views\妯℃不鍏风鐞哱妯″叿鍏朵粬鍏ュ簱鍗昞Sc_MouldOtherInBill_PDA.html" /> <Content Include="views\妯℃不鍏风鐞哱妯″叿閲囪喘鍏ュ簱鍗昞Sc_MouldProdInBill_PDA.html" /> + <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_Add_MouldLifeUseBillList.html" /> + <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldLifeUseBillList.html" /> <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldMoveStockStepOutBill.html" /> <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldMoveStockStepInBill.html" /> <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldMoveStockStepInBillList.html" /> @@ -871,6 +877,10 @@ <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldProdOutBillList.html" /> <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldScrapInBillList.html" /> <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldScrapOutBillList.html" /> + <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldScrapRequestBill.html" /> + <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldScrapRequestBillList.html" /> + <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldStatusChangeBill.html" /> + <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏蜂粨搴撶鐞哱Sc_MouldStatusChangeBillList.html" /> <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏风偣妫�淇濆吇\Sc_MouldDotCheckBill_PDA.html" /> <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏风偣妫�淇濆吇\Sc_MouldMaintainBill_PDA.html" /> <Content Include="views\妯℃不鍏风鐞哱妯℃不鍏风鐞哱BatchGen_MouldFile.html" /> @@ -1063,6 +1073,8 @@ <Content Include="views\璁惧绠$悊\璁惧妗f\Gy_EquipFileBillResume.html" /> <Content Include="views\璁惧绠$悊\璁惧妗f\Gy_EquipFileMainEdit.html" /> <Content Include="views\璁惧绠$悊\璁惧妗f\Gy_EquipFileMainList.html" /> + <Content Include="views\璁惧绠$悊\璁惧鐘舵�乗Sb_EquipStatusChangeBill.html" /> + <Content Include="views\璁惧绠$悊\璁惧鐘舵�乗Sb_EquipStatusChangeBillList.html" /> <Content Include="views\璁惧绠$悊\璁惧缁翠慨娲惧伐鍗昞Sb_EquipRepairSendWorkBillEdit.html" /> <Content Include="views\璁惧绠$悊\璁惧缁翠慨娲惧伐鍗昞Sb_EquipRepairSendWorkBillList.html" /> <Content Include="views\璁惧绠$悊\璁惧瑙勭▼鍗昞Sb_EquipDotCheckRuleEdit.html" /> diff --git a/WebTM/views/index.html b/WebTM/views/index.html index d9be408..3030d5c 100644 --- a/WebTM/views/index.html +++ b/WebTM/views/index.html @@ -621,6 +621,10 @@ <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldOtherOutBillEdit.html">鍣ㄥ叿鍏朵粬鍑哄簱鍗�</a></dd> <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldOtherOutBillList.html">鍣ㄥ叿鍏朵粬鍑哄簱鍗曠淮鎶�</a></dd> <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldMoveStockStepOutButNotStepInList.html">鍣ㄥ叿鍒嗘寮忚皟鍑烘湭璋冨叆鎶ヨ〃</a></dd> + <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldScrapRequestBill.html">鍣ㄥ叿鎶ュ簾鐢宠鍗�</a></dd> + <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldScrapRequestBillList.html">鍣ㄥ叿鎶ュ簾鐢宠鍗曠淮鎶�</a></dd> + <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldStatusChangeBill.html">鍣ㄥ叿鐘舵�佸彉鏇村崟</a></dd> + <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldStatusChangeBillList.html">鍣ㄥ叿鐘舵�佸彉鏇村崟缁存姢</a></dd> </dl> </dd> <dd> @@ -628,6 +632,8 @@ <dl class="layui-nav-child"> <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_Add_MouldLifeChangeBillList.html">瀵垮懡璋冩暣鍗�</a></dd> <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldLifeChangeBillList.html">瀵垮懡璋冩暣鍗曠淮鎶�</a></dd> + <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_Add_MouldLifeUseBillList.html">瀵垮懡鑰楃敤鍗�</a></dd> + <dd><a lay-href="妯℃不鍏风鐞�/妯℃不鍏蜂粨搴撶鐞�/Sc_MouldLifeUseBillList.html">瀵垮懡鑰楃敤鍗曠淮鎶�</a></dd> </dl> </dd> <dd> @@ -690,6 +696,8 @@ <dd><a lay-href="璁惧绠$悊/璁惧澶囧搧澶囦欢/Sb_EquipSparepartsBillList.html">璁惧澶囧搧澶囦欢缁存姢</a></dd> <dd><a lay-href="璁惧绠$悊/璁惧澶囧搧澶囦欢/Sb_EquipSparepartsChangeBill.html">璁惧澶囧搧澶囦欢鍙樻洿鍗�</a></dd> <dd><a lay-href="璁惧绠$悊/璁惧澶囧搧澶囦欢/Sb_EquipSparepartsChangeBillList.html">璁惧澶囧搧澶囦欢鍙樻洿鍗曠淮鎶�</a></dd> + <dd><a lay-href="璁惧绠$悊/璁惧鐘舵��/Sb_EquipStatusChangeBill.html">璁惧鐘舵�佸彉鏇村崟</a></dd> + <dd><a lay-href="璁惧绠$悊/璁惧鐘舵��/Sb_EquipStatusChangeBillList.html">璁惧鐘舵�佸彉鏇村崟缁存姢</a></dd> </dl> </dd> <dd> @@ -935,6 +943,8 @@ <dd><a lay-href="鍩虹璧勬枡/鍩虹璧勬枡/Gy_Operator.html">涓氬姟鍛樺垪琛�</a></dd> <dd><a lay-href="鍩虹璧勬枡/鍩虹璧勬枡/Gy_Work.html">浣滀笟鍒楄〃</a></dd> <dd><a lay-href="鍩虹璧勬枡/鍩虹璧勬枡/Gy_Staff.html">鍛樺伐鍒楄〃</a></dd> + <dd><a lay-href="鍩虹璧勬枡/鍩虹璧勬枡/Gy_MouldStatus.html">鍣ㄥ叿鐘舵�佸垪琛�</a></dd> + <dd><a lay-href="鍩虹璧勬枡/鍩虹璧勬枡/Gy_EquipStatus.html">璁惧鐘舵�佸垪琛�</a></dd> </dl> </dd> <dd> 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_EquipStatus.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_EquipStatus.html" new file mode 100644 index 0000000..b4facd5 --- /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_EquipStatus.html" @@ -0,0 +1,556 @@ +锘�<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>璁惧鐘舵�佸垪琛�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> + <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> + <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> + <script src="../../../layuiadmin/layui/layui.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 class="layui-collapse"> + <div class="layui-colla-item"> + <div class="layui-colla-title layui-inline"> + <div class="layui-inline"> + <span>鏇村</span> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">浠g爜</label> + <div class="layui-input-block"> + <input type="text" class="layui-input" name="HNumber" id="HNumber"> + </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: 185px;"> + <select name="HUseFlag" id="HUseFlag" lay-filter="HUseFlag"> + <option value="鏈娴�">鏈娴�</option> + <option value="鏈娇鐢�" selected>鏈娇鐢�</option> + <option value="宸蹭娇鐢�">宸蹭娇鐢�</option> + </select> + </div> + + </div> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button> + <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;"> + <div class="layui-row" style="margin-top:10px;"> + <div class="layui-row" style="margin-top:5px"> + <div class="layui-inline"> + <label class="layui-form-label">杩囨护</label> + <div class="layui-input-block"> + <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;"> + </select> + </div> + </div> + <div class="layui-inline"> + <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;"> + <option value="0" selected="selected"></option> + <option value="=">=</option> + <option value=">=">>=</option> + <option value=">">></option> + <option value="<="><=</option> + <option value="<"><</option> + <option value="<>"><></option> + <option value="7">鍖呭惈</option> + <option value="8">宸﹀寘鍚�</option> + <option value="9">鍙冲寘鍚�</option> + <option value="10">涓嶅寘鍚�</option> + </select> + </div> + <div class="layui-inline"> + <input type="text" class="layui-input" value="" name="ColContent" id="ColContent"> + </div> + </div> + </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="btn-Add" id="btn-Add"><i class="layui-iconlayuiiconfileb"></i>鏂板</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="btn-Edit"><i class="layuiiconlayuiiconform"></i>缂栬緫</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="btn-Delete"><i class="layuiiconlayuiicon-delete"></i>鍒犻櫎</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-iconlayuiiconrefresh-3"></i>鍒锋柊</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layuiiconform"></i>鍒楄缃�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Close"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> + </div> + </script> + </form> + </div> + </div> + </div> + </div> + <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> + layui.config({ + base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], 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 + var sWhere = ""; + + var option = []; + var Organization = sessionStorage["Organization"]; + var HModName = "Gy_EquipStatus"; + //涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞� + var titleData = ["HItemID", "HUSEORGID", "HCREATEORGID", "鐖剁骇ID"]; + //#endregion + + //#region 杩涘叆椤甸潰鍗冲姞杞� + + //鍒濆鍖栫晫闈� + set_ClearBill(); + + //#endregion + + //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� + + //#region 澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + switch (obj.event) { + //鏂板鎸夐挳 + case 'btn-Add': + set_AddNew(); + break; + case 'btn-Edit': + set_ShowBill(); + break; + case 'btn-Delete': + set_DeleteBill(); + break; + //鍒锋柊 + case 'get_Refresh': get_Refresh(); + break; + //閫�鍑烘寜閽� + case 'btn-Close': + parent.layui.admin.events.closeThisTabs(); + break; + //鍒楄缃� + case 'set_HideColumn': + get_HideColumn(); + break; + }; + }); + //#endregion + + //#region 閲嶇疆鎸夐挳 + form.on('submit(btnReSearch)', function (data) { + set_ClearQuery(); + }); + //#endregion + + //#region 鏌ヨ鎸夐挳 + form.on('submit(btnSearch)', function (data) { + get_FastQuery(); + }); + //#endregion + + //#endregion + + //#region 鏈〉闈㈣璋冪敤鐨勬墍鏈夋柟娉� + + //#region 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栬〃鏍� + set_InitGrid(); + //鏌ヨ + get_Display(sWhere); + } + //#endregion + + //#region 鍒濆鍖栬〃鏍兼柟娉� + function set_InitGrid() { + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , height: 500 + , page: true + , cellMinWidth: 90 + , limit: 50 + , limits: [50, 500, 5000, 20000] + }; + } + //#endregion + + //#region 閲嶇疆杩囨护鏉′欢鏂规硶 + function set_ClearQuery() { + $("#HNumber").val(""); + $("#HUseFlag").val("鏈娇鐢�"); + $("#ColContent").val(""); + $("#ColName").val("0"); + $("#Comparator").val("0"); + form.render('select'); + sWhere = ""; + } + //#endregion + + //#region 鏌ヨ + function get_Display(sWhere) { + var wait = layer.load();//閬僵 + var ajaxLoad = layer.load(); + $.ajax({ + url: GetWEBURL() + '/Gy_EquipStatus/Gy_EquipStatusList', + type: "GET", + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": Organization}, + success: function (data1) { + if (data1.count == 1) { + var data = []; + var col = []; + //缁欑┖鐨勬暟缁勮祴鍊� + for (var key in data1.list) { + data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); + } + //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋 + col.push({ type: 'checkbox', fixed: 'left' }); + for (var i = 0; i < data.length; i++) { + if ($.inArray(data[i].name, titleData) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒� + } + else { + switch (data[i].Type) { + //int + case 'DateTime': + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 }); + break; + default: + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 }); + } + } + } + + //鍔ㄦ�佹樉绀哄垪鍚� + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , cols: [col] + , data: data1.data + , height: 'full-80' + , page: true + , cellMinWidth: 90 + , limit: 50 + , limits: [50, 500, 5000, 20000] + } + table.render(option); + + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + + layer.close(ajaxLoad); + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + //layer.alert("鏌ヨ鎴愬姛", { icon: 1 }); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + } + //#endregion + + //#region 蹇�熻繃婊� + function get_FastQuery() { + var HNumber = $("#HNumber").val(); + var HUseFlag = $("#HUseFlag").val(); + var ColName = $("#ColName").val();//澶嶉�夋 + var Comparator = $("#Comparator").val() + var ColContent = $("#ColContent").val(); + if (ColName != 0 && Comparator != 0) { + var com = ""; + switch (Comparator) { + case "7": + com = "like'%" + ColContent + "%'"; + break; + case "8": + com = "like'%" + ColContent + "'"; + break; + case "9": + com = "like'" + ColContent + "%'"; + break; + case "10": + com = "not like'%" + ColContent + "%'"; + break; + default: + com = "" + Comparator + "'" + ColContent + "'"; + break; + } + sWhere += " and " + ColName + " " + com; + } + if (HNumber) { + sWhere += " and 浠g爜 like '%" + HNumber + "%'"; + } + if (HUseFlag) { + sWhere += " and 浣跨敤鐘舵�� like '%" + HUseFlag + "%'"; + } + get_Display(sWhere); + sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 + } + //#endregion + + //#region 鍒犻櫎 + function set_DeleteBill() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var ItemID = data[0].HItemID.toString(); + layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) { + var wait = layer.load(); + //#region 閫昏緫鍒犻櫎鏂规硶 + $.ajax({ + url: GetWEBURL() + 'Gy_EquipStatus/Delete', + type: "GET", + data: { "HItemID": ItemID, "user": sessionStorage["HUserName"]}, + success: function (result) { + //淇敼涓哄姛鍚庡埛鏂扮晫闈� + get_FastQuery(); + if (result.count == 1) { + layer.msg(result.Message, { icon: 1 }, function () { + //鍏抽棴褰撳墠frame + layer.close(wait); + }); + } else { + layer.alert(result.code + result.Message, { icon: 5 }); + layer.close(wait); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + layer.close(wait); + } + }); + }) + } + else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒'); + } + } + //#endregion + //#endregion + + //#region 鏂板 + function set_AddNew() { + layer.open({ + type: 2, + skin: 'layui-layer-rim', //鍔犱笂杈规 + title: '鏂板璁惧鐘舵��', + closeBtn: 1, + shift: 2, + area: ['100%', '100%'], + maxmin: true, + content: '../鍩虹璧勬枡/Gy_EquipStatusEdit.html', + end: function () { + //鍒锋柊椤甸潰, + get_FastQuery(table, option); + }, + success: function (layero, index) { + + } + }); + } + //#endregion + + //#region 缂栬緫鍗曟嵁 + function set_ShowBill() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var hID = data[0].HItemID.toString(); + //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉 + layer.open({ + type: 2 + , area: ['100%', '100%'] + , title: '缂栬緫璁惧鐘舵��' + , shade: 0.6 //閬僵閫忔槑搴� + , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲 + , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚� + , content: '../鍩虹璧勬枡/Gy_EquipStatusEdit.html?hID=' + hID + , resize: false + , cancel: function () { + //$(".layui-btn").removeClass("layui-btn-disabled"); + } + , end: function () { + //鍒锋柊椤甸潰, + get_FastQuery(table, option); + } + }) + + } else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒'); + } + } + //#endregion + + //#region 鍒锋柊 + function get_Refresh() { + set_ClearQuery(); + get_Display(sWhere); + } + //#endregion + + //#region 闅愯棌鍒楄缃� + function get_HideColumn() { + var colName = ""; + var contentUrl = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colName += option.cols[0][i]["title"] + ","; + } + var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞 + var urlLen = urlStr.split('/'); + for (var i = 0; i < urlLen.length - 4; i++) { + contentUrl += "../"; + } + colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜 + + contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; + + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "闅愯棌鍒楄缃�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["50%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: [contentUrl, "yes"] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + //#endregion + + //#region 鏄剧ず鍒楁暟鎹� + function DisPlay_HideColumn() { + $.ajax({ + url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', + type: "GET", + data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.data.length != 0) { + var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 + /* var titleData = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�*/ + + dataCol = data1.data[0].HGridString.split(','); + + for (var i = 0; i < option.cols[0].length - 2; i++) { + if (dataCol[i]) { + var dataCols = dataCol[i].split('|'); + } + //闅愯棌鍒� + if (dataCols[1] == 1) { + option.cols[0][i + 1]["hide"] = true; + } + //璁剧疆鍒楀 + if (dataCols[3] > 0) { + option.cols[0][i + 1]["width"] = dataCols[3]; + } + //璁剧疆鍐呭瀛椾綋澶у皬 + if (data1.data[0].HFontSize != 0) { + option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; + } else { + option.cols[0][i + 1]["style"] = "font-size:100%"; + } + //璁剧疆鍒楀 + //if (data1.data[0].HColumnWidth != 0) { + // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; + //} else { + // option.cols[0][i + 1]["width"] = ""; + //} + //鏄剧ず鍒� + if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { + option.cols[0][i + 1]["hide"] = false; + } + //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) + switch (dataCols[2]) { + case "L": + option.cols[0][i + 1]["align"] = "left"; + break; + case "M": + option.cols[0][i + 1]["align"] = "center"; + break; + case "R": + option.cols[0][i + 1]["align"] = "right"; + break; + } + } + + //鍙栨秷鍐荤粨鍒� + for (var i = 1; i < option.cols[0].length - 1; i++) { + if (option.cols[0][i]["fixed"] != null) { + option.cols[0][i]["fixed"] = null; + } + else { + break; + } + } + //鍐荤粨鍒� + if (data1.data[0].HFixCols != 0) { + for (var i = 0; i < data1.data[0].HFixCols; i++) { + if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { + data1.data[0].HFixCols += 1; + } + option.cols[0][i + 1]["fixed"] = "left"; + } + } + table.render(option); + } else { + table.render(option); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }) + } + //#endregion + + //#region 鍒楁槑鏄剧ず涓嬫媺妗� + function ColFilter() { + var Organization = '<option value="0" selected="selected" ></option>'; + for (var i = 1; i < option.cols[0].length; i++) { + if (option.cols[0][i].hide != true) { + Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>'; + } + } + $("#ColName").empty(); + $("#ColName").append(Organization); + form.render('select'); + } + //#endregion + }); + //#endregion + </script> + +</body> +</html> \ No newline at end of file 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_EquipStatusEdit.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_EquipStatusEdit.html" new file mode 100644 index 0000000..d3eac47 --- /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_EquipStatusEdit.html" @@ -0,0 +1,266 @@ +锘�<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <title>鏂板/缂栬緫璁惧鐘舵�佸垪琛�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> + <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> + <style type="text/css"> + .layui-form-label { + width: 85px; + } + + .layui-form-item .layui-input-inline { + width: 50%; + } + + .layui-inline { + width: 290px; + } + + .layui-form-item .layui-inline { + margin-right: 0px; + } + </style> +</head> +<body> + <div id="layout1" class="layui-fluid"> + <div class="layui-row layui-col-space15"> + <div class="layui-col-md12"> + <div class="layui-card"> + <form id="form0" class="layui-form" lay-filter="component-form-group" action=""> + <div class="layui-card-header"> + <div class="layui-btn-group"> + <button type="button" id="Saver" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button> + <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button> + </div> + </div> + <div class="layui-card-body"> + <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"> + <ul class="layui-tab-title"> + <li class="layui-this">鍩烘湰淇℃伅</li> + </ul> + <h1 style="text-align:center;"><b>鍣ㄥ叿鐘舵��</b></h1> + <div class="layui-tab-content"> + <div class="layui-tab-item layui-show"> + <div class="layui-form-item" style="padding-top: 10px;"> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;">浠g爜</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HNumber" id="HNumber"> + <input id="HItemID" name="HItemID" value="0" type="hidden" /> + <input id="HMakeEmp" name="HMakeEmp" value="" type="hidden" /> + </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="HName" id="HName"> + </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: 185px;"> + <input type="hidden" class="layui-input" lay-verify="HCREATEORGID" name="HCREATEORGID" id="HCREATEORGID"> + <select name="HUSEORGID" id="HUSEORGID" lay-verify="HUSEORGID"> + <!--鍔ㄦ�佹覆鏌撶粍缁�--> + </select> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label"> 澶囨敞锛�</label> + <div class="layui-input-inline "> + <textarea placeholder="璇疯緭鍏ョ淮澶囨敞" class="layui-textarea" name="HRemark" id="HRemark"></textarea> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">绂佺敤鏍囧織锛�</label> + <div class="layui-input-inline"> + <input type="checkbox" name="HStopflag" id="HStopflag" lay-skin="primary" lay-filter="checkbox" value="true" title="鏄惁绂佺敤"> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </form> + </div> + </div> + </div> + </div> +</body> +</html> + +<script> + layui.config({ + base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], 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 + + //#endregion + + //#region 杩涘叆椤甸潰鍗冲姞杞� + + var params = getUrlVars(); + //var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷 1娣诲姞 淇濆瓨 2澶嶅埗 3 缂栬緫 + var linterid = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜 + + //鍒ゆ柇鏄惁鏂板 + if (linterid == null || linterid == 0) { + + } + else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new + //绂佺敤缁勭粐閫夐」 + $("#HUSEORGID").attr("disabled", true); + RoadBillMain(linterid); + } + + set_ClearBill(); + + //#endregion + + //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� + + //淇濆瓨鎻愪氦 + form.on('submit(Saver)', function (data) {//鎻愪氦 + set_AddNew(data); + }); + + //閫�鍑� + form.on('submit(Exit)', function (data) { + Pub_Close(1); + }); + + //#endregion + + //#region 鏈〉闈㈣璋冪敤鐨勬墍鏈夋柟娉� + + // 鍒濆鍖栫晫闈� + function set_ClearBill() { + Organ(); + $("#HCREATEORGID").val(sessionStorage["OrganizationID"]); + $("#HMakeEmp").val(sessionStorage["HUserName"]); + } + + //鑾峰彇缁勭粐 + function Organ() { + //鑾峰彇鐧诲綍椤电粍缁囧垪 + var Organization = ''; + $.ajax({ + type: "get", + url: GetWEBURL() + "/Web/GetOrganizations", + success: function (result) { + if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝 + var data = result.data; + for (var i = 0; i < data.length; i++) { + Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>'; + } + $("#HUSEORGID").append(Organization); + $("#HUSEORGID").val(sessionStorage["OrganizationID"]) + form.render('select'); + } + layer.closeAll("loading"); + } + }) + } + + //淇濆瓨HMaker + function set_AddNew(data) { + var sMainStr = JSON.stringify(data.field); + var sMainSub = sMainStr + ";" + sessionStorage["HUserName"]; + + var index = layer.load(); + $.ajax({ + type: "POST", + url: GetWEBURL() + "/Gy_EquipStatus/Gy_EquipStatusEdit", + async: true, + data: { "msg": sMainSub }, + dataType: "json", + success: function (data) { + if (data.count == 1) { + $('#Saver').addClass("layui-btn-disabled").attr("disabled", true); + layer.close(index); + layer.msg("鎻愪氦鎴愬姛"); + } + 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: "娓╅Θ鎻愮ず" }); + } + }); + } + + //缂栬緫 椤甸潰璧嬪�� + function RoadBillMain(linterid)//鍔犺浇琛ㄥご + { + var sWhere = " and HItemID='" + linterid + "'"; + $.ajax({ + url: GetWEBURL() + "/Gy_EquipStatus/Gy_EquipStatusList", + type: "GET", + async: false, + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": sessionStorage["Organization"]}, + success: function (d) { + var IsHStopflag = d.data[0].绂佺敤鏍囧織; + if (IsHStopflag == 1) { + $("input[name='HStopflag']").prop("checked", true); + } + //涓昏〃 + form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫�� + "HItemID": d.data[0].HItemID + , "HNumber": d.data[0].浠g爜 + , "HName": d.data[0].鍚嶇О + , "HCREATEORGID": d.data[0].HCREATEORGID + , "HUSEORGID": d.data[0].HUSEORGID + , "HStopflag": d.data[0].绂佺敤鏍囧織 + , "HRemark": d.data[0].澶囨敞 + }); + form.render('checkbox'); + form.render('select'); + } + }) + } + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + + //#endregion + + }); +</script> \ No newline at end of file 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_MouldStatus.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_MouldStatus.html" new file mode 100644 index 0000000..de9d8fa --- /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_MouldStatus.html" @@ -0,0 +1,556 @@ +锘�<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>鍣ㄥ叿鐘舵�佸垪琛�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> + <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> + <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> + <script src="../../../layuiadmin/layui/layui.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 class="layui-collapse"> + <div class="layui-colla-item"> + <div class="layui-colla-title layui-inline"> + <div class="layui-inline"> + <span>鏇村</span> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">浠g爜</label> + <div class="layui-input-block"> + <input type="text" class="layui-input" name="HNumber" id="HNumber"> + </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: 185px;"> + <select name="HUseFlag" id="HUseFlag" lay-filter="HUseFlag"> + <option value="鏈娴�">鏈娴�</option> + <option value="鏈娇鐢�" selected>鏈娇鐢�</option> + <option value="宸蹭娇鐢�">宸蹭娇鐢�</option> + </select> + </div> + + </div> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button> + <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;"> + <div class="layui-row" style="margin-top:10px;"> + <div class="layui-row" style="margin-top:5px"> + <div class="layui-inline"> + <label class="layui-form-label">杩囨护</label> + <div class="layui-input-block"> + <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;"> + </select> + </div> + </div> + <div class="layui-inline"> + <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;"> + <option value="0" selected="selected"></option> + <option value="=">=</option> + <option value=">=">>=</option> + <option value=">">></option> + <option value="<="><=</option> + <option value="<"><</option> + <option value="<>"><></option> + <option value="7">鍖呭惈</option> + <option value="8">宸﹀寘鍚�</option> + <option value="9">鍙冲寘鍚�</option> + <option value="10">涓嶅寘鍚�</option> + </select> + </div> + <div class="layui-inline"> + <input type="text" class="layui-input" value="" name="ColContent" id="ColContent"> + </div> + </div> + </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="btn-Add" id="btn-Add"><i class="layui-iconlayuiiconfileb"></i>鏂板</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="btn-Edit"><i class="layuiiconlayuiiconform"></i>缂栬緫</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="btn-Delete"><i class="layuiiconlayuiicon-delete"></i>鍒犻櫎</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-iconlayuiiconrefresh-3"></i>鍒锋柊</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layuiiconform"></i>鍒楄缃�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Close"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> + </div> + </script> + </form> + </div> + </div> + </div> + </div> + <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> + layui.config({ + base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], 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 + var sWhere = ""; + + var option = []; + var Organization = sessionStorage["Organization"]; + var HModName = "Gy_MouldStatus"; + //涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞� + var titleData = ["HItemID", "HUSEORGID", "HCREATEORGID", "鐖剁骇ID"]; + //#endregion + + //#region 杩涘叆椤甸潰鍗冲姞杞� + + //鍒濆鍖栫晫闈� + set_ClearBill(); + + //#endregion + + //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� + + //#region 澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + switch (obj.event) { + //鏂板鎸夐挳 + case 'btn-Add': + set_AddNew(); + break; + case 'btn-Edit': + set_ShowBill(); + break; + case 'btn-Delete': + set_DeleteBill(); + break; + //鍒锋柊 + case 'get_Refresh': get_Refresh(); + break; + //閫�鍑烘寜閽� + case 'btn-Close': + parent.layui.admin.events.closeThisTabs(); + break; + //鍒楄缃� + case 'set_HideColumn': + get_HideColumn(); + break; + }; + }); + //#endregion + + //#region 閲嶇疆鎸夐挳 + form.on('submit(btnReSearch)', function (data) { + set_ClearQuery(); + }); + //#endregion + + //#region 鏌ヨ鎸夐挳 + form.on('submit(btnSearch)', function (data) { + get_FastQuery(); + }); + //#endregion + + //#endregion + + //#region 鏈〉闈㈣璋冪敤鐨勬墍鏈夋柟娉� + + //#region 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栬〃鏍� + set_InitGrid(); + //鏌ヨ + get_Display(sWhere); + } + //#endregion + + //#region 鍒濆鍖栬〃鏍兼柟娉� + function set_InitGrid() { + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , height: 500 + , page: true + , cellMinWidth: 90 + , limit: 50 + , limits: [50, 500, 5000, 20000] + }; + } + //#endregion + + //#region 閲嶇疆杩囨护鏉′欢鏂规硶 + function set_ClearQuery() { + $("#HNumber").val(""); + $("#HUseFlag").val("鏈娇鐢�"); + $("#ColContent").val(""); + $("#ColName").val("0"); + $("#Comparator").val("0"); + form.render('select'); + sWhere = ""; + } + //#endregion + + //#region 鏌ヨ + function get_Display(sWhere) { + var wait = layer.load();//閬僵 + var ajaxLoad = layer.load(); + $.ajax({ + url: GetWEBURL() + '/Gy_MouldStatus/Gy_MouldStatusList', + type: "GET", + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": Organization}, + success: function (data1) { + if (data1.count == 1) { + var data = []; + var col = []; + //缁欑┖鐨勬暟缁勮祴鍊� + for (var key in data1.list) { + data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); + } + //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋 + col.push({ type: 'checkbox', fixed: 'left' }); + for (var i = 0; i < data.length; i++) { + if ($.inArray(data[i].name, titleData) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒� + } + else { + switch (data[i].Type) { + //int + case 'DateTime': + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 }); + break; + default: + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 }); + } + } + } + + //鍔ㄦ�佹樉绀哄垪鍚� + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , cols: [col] + , data: data1.data + , height: 'full-80' + , page: true + , cellMinWidth: 90 + , limit: 50 + , limits: [50, 500, 5000, 20000] + } + table.render(option); + + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + + layer.close(ajaxLoad); + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + //layer.alert("鏌ヨ鎴愬姛", { icon: 1 }); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + } + //#endregion + + //#region 蹇�熻繃婊� + function get_FastQuery() { + var HNumber = $("#HNumber").val(); + var HUseFlag = $("#HUseFlag").val(); + var ColName = $("#ColName").val();//澶嶉�夋 + var Comparator = $("#Comparator").val() + var ColContent = $("#ColContent").val(); + if (ColName != 0 && Comparator != 0) { + var com = ""; + switch (Comparator) { + case "7": + com = "like'%" + ColContent + "%'"; + break; + case "8": + com = "like'%" + ColContent + "'"; + break; + case "9": + com = "like'" + ColContent + "%'"; + break; + case "10": + com = "not like'%" + ColContent + "%'"; + break; + default: + com = "" + Comparator + "'" + ColContent + "'"; + break; + } + sWhere += " and " + ColName + " " + com; + } + if (HNumber) { + sWhere += " and 浠g爜 like '%" + HNumber + "%'"; + } + if (HUseFlag) { + sWhere += " and 浣跨敤鐘舵�� like '%" + HUseFlag + "%'"; + } + get_Display(sWhere); + sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 + } + //#endregion + + //#region 鍒犻櫎 + function set_DeleteBill() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var ItemID = data[0].HItemID.toString(); + layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) { + var wait = layer.load(); + //#region 閫昏緫鍒犻櫎鏂规硶 + $.ajax({ + url: GetWEBURL() + 'Gy_MouldStatus/Delete', + type: "GET", + data: { "HItemID": ItemID, "user": sessionStorage["HUserName"]}, + success: function (result) { + //淇敼涓哄姛鍚庡埛鏂扮晫闈� + get_FastQuery(); + if (result.count == 1) { + layer.msg(result.Message, { icon: 1 }, function () { + //鍏抽棴褰撳墠frame + layer.close(wait); + }); + } else { + layer.alert(result.code + result.Message, { icon: 5 }); + layer.close(wait); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + layer.close(wait); + } + }); + }) + } + else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒'); + } + } + //#endregion + //#endregion + + //#region 鏂板 + function set_AddNew() { + layer.open({ + type: 2, + skin: 'layui-layer-rim', //鍔犱笂杈规 + title: '鏂板鍣ㄥ叿鐘舵��', + closeBtn: 1, + shift: 2, + area: ['100%', '100%'], + maxmin: true, + content: '../鍩虹璧勬枡/Gy_MouldStatusEdit.html', + end: function () { + //鍒锋柊椤甸潰, + get_FastQuery(table, option); + }, + success: function (layero, index) { + + } + }); + } + //#endregion + + //#region 缂栬緫鍗曟嵁 + function set_ShowBill() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var hID = data[0].HItemID.toString(); + //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉 + layer.open({ + type: 2 + , area: ['100%', '100%'] + , title: '缂栬緫鍣ㄥ叿鐘舵��' + , shade: 0.6 //閬僵閫忔槑搴� + , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲 + , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚� + , content: '../鍩虹璧勬枡/Gy_MouldStatusEdit.html?hID=' + hID + , resize: false + , cancel: function () { + //$(".layui-btn").removeClass("layui-btn-disabled"); + } + , end: function () { + //鍒锋柊椤甸潰, + get_FastQuery(table, option); + } + }) + + } else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒'); + } + } + //#endregion + + //#region 鍒锋柊 + function get_Refresh() { + set_ClearQuery(); + get_Display(sWhere); + } + //#endregion + + //#region 闅愯棌鍒楄缃� + function get_HideColumn() { + var colName = ""; + var contentUrl = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colName += option.cols[0][i]["title"] + ","; + } + var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞 + var urlLen = urlStr.split('/'); + for (var i = 0; i < urlLen.length - 4; i++) { + contentUrl += "../"; + } + colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜 + + contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; + + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "闅愯棌鍒楄缃�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["50%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: [contentUrl, "yes"] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + //#endregion + + //#region 鏄剧ず鍒楁暟鎹� + function DisPlay_HideColumn() { + $.ajax({ + url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', + type: "GET", + data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.data.length != 0) { + var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 + /* var titleData = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�*/ + + dataCol = data1.data[0].HGridString.split(','); + + for (var i = 0; i < option.cols[0].length - 2; i++) { + if (dataCol[i]) { + var dataCols = dataCol[i].split('|'); + } + //闅愯棌鍒� + if (dataCols[1] == 1) { + option.cols[0][i + 1]["hide"] = true; + } + //璁剧疆鍒楀 + if (dataCols[3] > 0) { + option.cols[0][i + 1]["width"] = dataCols[3]; + } + //璁剧疆鍐呭瀛椾綋澶у皬 + if (data1.data[0].HFontSize != 0) { + option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; + } else { + option.cols[0][i + 1]["style"] = "font-size:100%"; + } + //璁剧疆鍒楀 + //if (data1.data[0].HColumnWidth != 0) { + // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; + //} else { + // option.cols[0][i + 1]["width"] = ""; + //} + //鏄剧ず鍒� + if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { + option.cols[0][i + 1]["hide"] = false; + } + //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) + switch (dataCols[2]) { + case "L": + option.cols[0][i + 1]["align"] = "left"; + break; + case "M": + option.cols[0][i + 1]["align"] = "center"; + break; + case "R": + option.cols[0][i + 1]["align"] = "right"; + break; + } + } + + //鍙栨秷鍐荤粨鍒� + for (var i = 1; i < option.cols[0].length - 1; i++) { + if (option.cols[0][i]["fixed"] != null) { + option.cols[0][i]["fixed"] = null; + } + else { + break; + } + } + //鍐荤粨鍒� + if (data1.data[0].HFixCols != 0) { + for (var i = 0; i < data1.data[0].HFixCols; i++) { + if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { + data1.data[0].HFixCols += 1; + } + option.cols[0][i + 1]["fixed"] = "left"; + } + } + table.render(option); + } else { + table.render(option); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }) + } + //#endregion + + //#region 鍒楁槑鏄剧ず涓嬫媺妗� + function ColFilter() { + var Organization = '<option value="0" selected="selected" ></option>'; + for (var i = 1; i < option.cols[0].length; i++) { + if (option.cols[0][i].hide != true) { + Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>'; + } + } + $("#ColName").empty(); + $("#ColName").append(Organization); + form.render('select'); + } + //#endregion + }); + //#endregion + </script> + +</body> +</html> \ No newline at end of file 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_MouldStatusEdit.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_MouldStatusEdit.html" new file mode 100644 index 0000000..b245004 --- /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_MouldStatusEdit.html" @@ -0,0 +1,266 @@ +锘�<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <title>鏂板/缂栬緫鍣ㄥ叿鐘舵�佸垪琛�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> + <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> + <style type="text/css"> + .layui-form-label { + width: 85px; + } + + .layui-form-item .layui-input-inline { + width: 50%; + } + + .layui-inline { + width: 290px; + } + + .layui-form-item .layui-inline { + margin-right: 0px; + } + </style> +</head> +<body> + <div id="layout1" class="layui-fluid"> + <div class="layui-row layui-col-space15"> + <div class="layui-col-md12"> + <div class="layui-card"> + <form id="form0" class="layui-form" lay-filter="component-form-group" action=""> + <div class="layui-card-header"> + <div class="layui-btn-group"> + <button type="button" id="Saver" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button> + <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button> + </div> + </div> + <div class="layui-card-body"> + <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"> + <ul class="layui-tab-title"> + <li class="layui-this">鍩烘湰淇℃伅</li> + </ul> + <h1 style="text-align:center;"><b>鍣ㄥ叿鐘舵��</b></h1> + <div class="layui-tab-content"> + <div class="layui-tab-item layui-show"> + <div class="layui-form-item" style="padding-top: 10px;"> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;">浠g爜</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HNumber" id="HNumber"> + <input id="HItemID" name="HItemID" value="0" type="hidden" /> + <input id="HMakeEmp" name="HMakeEmp" value="" type="hidden" /> + </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="HName" id="HName"> + </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: 185px;"> + <input type="hidden" class="layui-input" lay-verify="HCREATEORGID" name="HCREATEORGID" id="HCREATEORGID"> + <select name="HUSEORGID" id="HUSEORGID" lay-verify="HUSEORGID"> + <!--鍔ㄦ�佹覆鏌撶粍缁�--> + </select> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label"> 澶囨敞锛�</label> + <div class="layui-input-inline "> + <textarea placeholder="璇疯緭鍏ョ淮澶囨敞" class="layui-textarea" name="HRemark" id="HRemark"></textarea> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">绂佺敤鏍囧織锛�</label> + <div class="layui-input-inline"> + <input type="checkbox" name="HStopflag" id="HStopflag" lay-skin="primary" lay-filter="checkbox" value="true" title="鏄惁绂佺敤"> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </form> + </div> + </div> + </div> + </div> +</body> +</html> + +<script> + layui.config({ + base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], 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 + + //#endregion + + //#region 杩涘叆椤甸潰鍗冲姞杞� + + var params = getUrlVars(); + //var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷 1娣诲姞 淇濆瓨 2澶嶅埗 3 缂栬緫 + var linterid = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜 + + //鍒ゆ柇鏄惁鏂板 + if (linterid == null || linterid == 0) { + + } + else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new + //绂佺敤缁勭粐閫夐」 + $("#HUSEORGID").attr("disabled", true); + RoadBillMain(linterid); + } + + set_ClearBill(); + + //#endregion + + //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� + + //淇濆瓨鎻愪氦 + form.on('submit(Saver)', function (data) {//鎻愪氦 + set_AddNew(data); + }); + + //閫�鍑� + form.on('submit(Exit)', function (data) { + Pub_Close(1); + }); + + //#endregion + + //#region 鏈〉闈㈣璋冪敤鐨勬墍鏈夋柟娉� + + // 鍒濆鍖栫晫闈� + function set_ClearBill() { + Organ(); + $("#HCREATEORGID").val(sessionStorage["OrganizationID"]); + $("#HMakeEmp").val(sessionStorage["HUserName"]); + } + + //鑾峰彇缁勭粐 + function Organ() { + //鑾峰彇鐧诲綍椤电粍缁囧垪 + var Organization = ''; + $.ajax({ + type: "get", + url: GetWEBURL() + "/Web/GetOrganizations", + success: function (result) { + if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝 + var data = result.data; + for (var i = 0; i < data.length; i++) { + Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>'; + } + $("#HUSEORGID").append(Organization); + $("#HUSEORGID").val(sessionStorage["OrganizationID"]) + form.render('select'); + } + layer.closeAll("loading"); + } + }) + } + + //淇濆瓨HMaker + function set_AddNew(data) { + var sMainStr = JSON.stringify(data.field); + var sMainSub = sMainStr + ";" + sessionStorage["HUserName"]; + + var index = layer.load(); + $.ajax({ + type: "POST", + url: GetWEBURL() + "/Gy_MouldStatus/Gy_MouldStatusEdit", + async: true, + data: { "msg": sMainSub }, + dataType: "json", + success: function (data) { + if (data.count == 1) { + $('#Saver').addClass("layui-btn-disabled").attr("disabled", true); + layer.close(index); + layer.msg("鎻愪氦鎴愬姛"); + } + 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: "娓╅Θ鎻愮ず" }); + } + }); + } + + //缂栬緫 椤甸潰璧嬪�� + function RoadBillMain(linterid)//鍔犺浇琛ㄥご + { + var sWhere = " and HItemID='" + linterid + "'"; + $.ajax({ + url: GetWEBURL() + "/Gy_MouldStatus/Gy_MouldStatusList", + type: "GET", + async: false, + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": sessionStorage["Organization"]}, + success: function (d) { + var IsHStopflag = d.data[0].绂佺敤鏍囧織; + if (IsHStopflag == 1) { + $("input[name='HStopflag']").prop("checked", true); + } + //涓昏〃 + form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫�� + "HItemID": d.data[0].HItemID + , "HNumber": d.data[0].浠g爜 + , "HName": d.data[0].鍚嶇О + , "HCREATEORGID": d.data[0].HCREATEORGID + , "HUSEORGID": d.data[0].HUSEORGID + , "HStopflag": d.data[0].绂佺敤鏍囧織 + , "HRemark": d.data[0].澶囨敞 + }); + form.render('checkbox'); + form.render('select'); + } + }) + } + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + + //#endregion + + }); +</script> \ No newline at end of file diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldLifeUseBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldLifeUseBillList.html" new file mode 100644 index 0000000..c2d3a33 --- /dev/null +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldLifeUseBillList.html" @@ -0,0 +1,763 @@ +锘�<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <title>鍣ㄥ叿瀵垮懡鑰楃敤鍗�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> + <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> + <style> + .main-btn { /*澶撮儴涓绘寜閽�*/ + padding: 0 2px; /*璋冩暣鎸夐挳宸﹀彸绌洪殭澶у皬*/ + height: 30px; + line-height: 30px; + } + + .btn-title { + font-size: 16px; + } + /* 闃叉涓嬫媺妗嗙殑涓嬫媺鍒楄〃琚殣钘�---蹇呴』璁剧疆--- */ + .layui-table-cell { + overflow: visible !important; + } + /* 浣垮緱涓嬫媺妗嗕笌鍗曞厓鏍煎垰濂藉悎閫� */ + td .layui-form-select { + margin-top: -10px; + margin-left: -15px; + margin-right: -15px; + } + + .layui-form-item .layui-inline { + margin-top: 5px; + margin-bottom: 5px; + margin-right: 0px; + } + + .layui-form-label { + width: 25%; + } + </style> + +</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="btnEdit" id="btnEdit">閫�鍑�</button> + </div> + <div class="layui-tab" lay-filter="tab-POStockInBill"> + <ul class="layui-tab-title" lay-filter="tab-all"> + <li lay-id="1" style="padding:1px;" class="layui-this">鍩烘湰淇℃伅</li> + <li lay-id="2" style="padding:1px;">鍒跺崟淇℃伅</li> + </ul> + <div class="layui-tab-content"> + <!--鍩烘湰淇℃伅--> + <div class="layui-tab-item layui-show"> + <div class="layui-form-item" style="padding-top: 10px;"> + <div class="layui-row"> + <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="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly> + <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;">鏃ユ湡</label> + <div class="layui-input-block" style="margin-left: 122px;"> + <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 68px;"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">璋冩暣鍘熷洜</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HReason" id="HReason"> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">璐熻矗浜� </label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HMangerName" name="HMangerName" id="HMangerName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HMangerID" id="HMangerID" lay-verify="HMangerID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHManger" id="btnHManger" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">閮ㄩ棬</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDept" id="btnHDept" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鎽樿</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HExplanation" id="HExplanation"> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label"> 澶囨敞</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HRemark" id="HRemark"> + </div> + </div> + </div> + </div> + </div> + <!--鍒跺崟淇℃伅--> + <div class="layui-tab-item"> + <div class="layui-form-item"> + <div class="layui-row"> + <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="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly> + </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="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly> + </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="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + <div class="layui-row"> + <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="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly> + </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="HDeleteMan " id="HDeleteMan " style="background-color:#efefef4d;" readonly> + </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="HBacker " id="HBacker " style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + <div class="layui-row"> + <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="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly> + </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="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly> + </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="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly> + </div> + </div> + <div class="layui-row"> + <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="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly> + </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="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly> + </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="HBackDate" id="HBackDate" style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + + <table class="layui-hide" 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="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button> + <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>--> + </div> + </script> + </form> + </div> + </div> + </div> + <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(['index', 'form', 'laydate', 'table', 'element', 'laydate'], function () { + + //#region 鍏叡鍙橀噺 + + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laydate = layui.laydate + var option = []; + + //#endregion + + //#region 杩涘叆椤甸潰鍗冲姞杞� + + var rowdata = [{ + "HMaterID": 0, "鍣ㄥ叿": "", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0,"HNewLeaveLife": 0, "HRemark": "" + }]; + + var params = getUrlVars(); + var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷 1娣诲姞 淇濆瓨 2澶嶅埗 3 缂栬緫 + var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜 + + //鍒濆鍖� + set_ClearBill(); + + if (linterid == null || linterid == 0) { + OperationType = 1; + $.ajax({ + url: GetWEBURL() + "/Web/GetMAXNum", + type: "GET", + data: { "HBillType": '3845' }, + success: function (d) { + $("#HInterID").val(d.data[0].HInterID); + $("#HBillNo").val(d.data[0].HBillNo); + $("#HInterID").val(d.data[0].HInterID); + } + }); + } + else {//濡傛灉淇敼鍒欒蛋涓嬮潰 + //绂佺敤缁勭粐閫夐」 + $("#HPRDORGID").attr("disabled", true); + $("#HDate").attr("disabled", true); + RoadBillMain(linterid); + $("#HInterID").val(linterid); + } + + $("#HMaker").val(sessionStorage["HUserName"]); + + //#endregion + + //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� + + //澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + //鏂板琛岃〃鏍兼暟鎹� + var NewRow = { + "HMaterID": 0, "鍣ㄥ叿": "", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HNewLeaveLife": 0, + "HRemark": "" + }; + switch (obj.event) { + case 'btn-AddLine': + table.cache["mainTable"].push(NewRow); + option.data = table.cache["mainTable"]; + + table.render(option); + + //鍒锋柊澶嶉�夋 + checkRefresh(); + break; + case 'btn-CopyLine': + var copydata = JSON.stringify(data); + if (data.length <= 0) { + layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒"); + } + else if (data.length > 1) { + layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒"); + } + else { + var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'[' + var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']' + table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂 + option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓� + table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓� + //鍒锋柊澶嶉�夋 + checkRefresh(); + } + break; + ////鍒楄缃� + //case 'set_HideColumn': + // get_HideColumn(); + // break; + } + }); + + //閫夋嫨鍙樻洿浜� + form.on('submit(btnHManger)', function () { + get_btnHManger(); + }); + + //閫夋嫨璐熻矗閮ㄩ棬 + form.on('submit(btnHDept)', function () { + get_btnHDept(); + }); + + //閫夋嫨璁惧涓绘。 + form.on('submit(btnHEquip)', function () { + get_btnHEquip(); + }); + + //閫夋嫨缁勭粐 + form.on('submit(btnHOrg)', function () { + get_btnHOrg(); + }); + + //閫�鍑� + form.on('submit(btnEdit)', function (data) { + if (OperationType == 1 && linterid != "") { + Pub_Close(2); + } else { + Pub_Close(1); + } + }); + + //淇濆瓨鎻愪氦 + form.on('submit(btnSave)', function (data) {//鎻愪氦 + set_AddNew(data); + }); + + //琛屽唴浜嬩欢 + table.on('tool(mainTable)', function (obj) { + set_GridDelete(obj); //琛屽唴鍒犻櫎 + set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫� + + var data = obj.data; + if (obj.event == 'HBeginDate') { + var field = $(this).data('field'); + laydate.render({ + elem: this.firstChild + , show: true //鐩存帴鏄剧ず + , closeStop: this + , done: function (nowDate) { + //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊 + data[field] = nowDate; + obj.update(data); + //鍒锋柊澶嶉�夋 + //checkRefresh(); + } + }); + } + + if (obj.event == 'HEndDate') { + var field = $(this).data('field'); + laydate.render({ + elem: this.firstChild + , show: true //鐩存帴鏄剧ず + , closeStop: this + , done: function (nowDate) { + //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊 + data[field] = nowDate; + obj.update(data); + //鍒锋柊澶嶉�夋 + //checkRefresh(); + } + }); + } + }); + + table.on('edit(mainTable)', function (obj) { + var value = obj.value //寰楀埌淇敼鍚庣殑鍊� + , data = obj.data //寰楀埌鎵�鍦ㄨ鎵�鏈夐敭鍊� + , field = obj.field; //寰楀埌瀛楁 + + var HNewLeaveLife = data.HNewLeaveLife //鏈鍓╀綑瀵垮懡 + , HDesignLife = data.HDesignLife //璁捐瀵垮懡 + , HLeaveLife = data.HLeaveLife //鍘熷墿浣欏鍛� + , HUseLife = data.HUseLife //鏈鑰楃敤 + + if (linterid == null || linterid == 0) { + obj.update({ + HLeaveLife: parseFloat(HDesignLife).toFixed(2), //鏂板鐘舵�佷笅锛屽師鍓╀綑瀵垮懡 = 璁捐瀵垮懡 + }); + } + + if (HUseLife == 0 && linterid == null || linterid == 0) { + obj.update({ + HNewLeaveLife: parseFloat(HDesignLife).toFixed(2), //鏂板鐘舵�佷笅,鏈鍓╀綑瀵垮懡 = 璁捐瀵垮懡 + }); + } + + if ((HLeaveLife - HUseLife) < 0) { + layer.msg("鍓╀綑瀵垮懡涓嶈冻锛岃閲嶆柊杈撳叆锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" }); + obj.update({ + HUseLife: 0, + }); + table.render(option); + } else { + obj.update({ + HNewLeaveLife: parseFloat(HLeaveLife - HUseLife).toFixed(2), //鏈鍓╀綑瀵垮懡 = 鍘熷墿浣欏鍛� - 鏈鑰楃敤 + }); + } + }) + + //#endregion + + //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶 + + // 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栨棩鏈� + $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); + //鍒濆鍖� 缁勭粐 + Organ(); + + set_InitGrid(); + } + + //鑾峰彇缁勭粐 + function Organ() { + //鑾峰彇鐧诲綍椤电粍缁囧垪 + var Organization = ''; + $.ajax({ + type: "get", + url: GetWEBURL() + "/Web/GetOrganizations", + success: function (result) { + if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝 + var data = result.data; + for (var i = 0; i < data.length; i++) { + Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>'; + } + $("#HPRDORGID").append(Organization); + $("#HPRDORGID").val(sessionStorage["OrganizationID"]) + form.render('select'); + } + layer.closeAll("loading"); + } + }) + } + + function set_InitGrid() { + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , limit: 500 + , height: 500 + , loading: false + , cols: [[ //琛ㄥご + { type: 'checkbox', totalRowText: '鍚堣琛�' } + , { type: 'numbers', title: '搴忓彿', totalRow: true } + , { field: 'HMaterID', title: 'HMaterID ', width: 100, hide: true } + , { field: '鍣ㄥ叿', title: '鍣ㄥ叿', edit: 'text', event: "HMaterID" }//f7 + , { field: 'HUnitID', title: 'HUnitID ', width: 100, hide: true } + , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', edit: 'text', event: "HUnitID" }//f7 + , { field: 'HDesignLife', title: '璁捐瀵垮懡', edit: 'text'} + , { field: 'HLeaveLife', title: '鍘熷墿浣欏鍛�', edit: 'text'}//f7 + , { field: 'HUseLife', title: '鏈鑰楃敤', edit: 'text' }//f7 + , { field: 'HNewLeaveLife', title: '鏈鍓╀綑瀵垮懡' }//f7 + , { field: 'HRemark', title: '琛ㄤ綋澶囨敞', edit: 'text' }//f7 + , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 80 } + ]] + } + + option.data = rowdata; + table.render(option); + } + + //閮ㄩ棬 + function get_btnHDept() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '閮ㄩ棬'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../Baseset/鍩虹璧勬枡/Gy_DepartmentList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HDeptID").val(checkStatus.data[0].HItemID); + $("#HDeptName").val(checkStatus.data[0].HName); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //璐熻矗浜� + function get_btnHManger() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '璐熻矗浜� '//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../Baseset/鍩虹璧勬枡/Gy_EmployeeList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HMangerID").val(checkStatus.data[0].HItemID); + $("#HMangerName").val(checkStatus.data[0].HName); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //琛屽唴蹇嵎閿瓫閫� + function set_GridCellCheck(obj) { + $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) { + if (event.key == "F7") { + //鍣ㄥ叿 + if (obj.event == "HMaterID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "鍣ㄥ叿鍒楄〃" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_MouldFileMainList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "鍣ㄥ叿": checkStatus.data[0].HName + , "HMaterID": checkStatus.data[0].HInterID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //璁¢噺鍗曚綅 + if (obj.event == "HUnitID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "璁¢噺鍗曚綅鍒楄〃" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_UnitList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "璁¢噺鍗曚綅": checkStatus.data[0].HName + , "HUnitID": checkStatus.data[0].HItemID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + obj.event = ""; + return false; + } + }) + } + + //琛屽唴鍒犻櫎 + 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 { + obj.del(); + option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓� + table.reload(option); + layer.close(index); + } + }); + } + } + + //澶氶�� 鍒锋柊琛ㄦ牸 + function checkRefresh() { + + } + + //淇濆瓨 + 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]) + + //if (linterid && num[i].HUseLife != 0 ) { + // num[i].HLeaveLife = num[i].HNewLeaveLife + //} + } + } + + + var sMainStr = JSON.stringify(data.field); + var sSubStr = JSON.stringify(num); + //var hentryid = linteridSub;//瀛愯〃 鎺掑簭id + var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"]; + + var index = layer.load(); + $.ajax({ + type: "POST", + url: GetWEBURL() + "/Sc_MouldLifeUseBill/MouldLifeUseBillEdit", + async: true, + data: { "sMainSub": sMainSub }, + dataType: "json", + success: function (data) { + if (data.count == 1) { + $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true); + layer.close(index); + layer.msg("鎻愪氦鎴愬姛"); + } + 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: "娓╅Θ鎻愮ず" }); + } + }); + } + + //缂栬緫 椤甸潰璧嬪�� + function RoadBillMain(linterid)//鍔犺浇琛ㄥご + { + $.ajax({ + url: GetWEBURL() + "/Sc_MouldLifeUseBill/cx", + type: "GET", + async: false, + data: { "HInterID": linterid }, + success: function (d) { + + //$("#HPRDORGID").val(d.data[0].HPRDORGID); + //涓昏〃 + form.val("formData", { + "HBillNo": d.data[0].鍗曟嵁鍙� + , "HInterID": d.data[0].HMainID + , "HDate": Format(new Date(d.data[0].鏃ユ湡), "yyyy-MM-dd") + , "HRemark": d.data[0].琛ㄥご澶囨敞 + , "HMangerID": d.data[0].HMangerID + , "HMangerName": d.data[0].璐熻矗浜� + , "HDeptID": d.data[0].HDeptID + , "HDeptName": d.data[0].閮ㄩ棬 + , "HReason": d.data[0].璋冩暣鍘熷洜 + , "HExplanation": d.data[0].鎽樿 + , "HMaker": d.data[0].鍒跺崟浜� + , "HMakeDate": Format(new Date(d.data[0].鍒跺崟鏃ユ湡), "yyyy-MM-dd") + }); + + //瀛愯〃 璧嬪�� + var rowdata = []; + for (var i = 0; i < d.data.length; i++) { + rowdata.push( + { + "HMaterID": d.data[i].HMaterID, "鍣ㄥ叿": d.data[i].鍣ㄥ叿, "HUnitID": d.data[i].HUnitID, "璁¢噺鍗曚綅": d.data[i].璁¢噺鍗曚綅, + "HDesignLife": d.data[i].璁捐瀵垮懡, "HLeaveLife": d.data[i].鏈鍓╀綑瀵垮懡, "HUseLife": 0, + "HNewLeaveLife": d.data[i].鏈鍓╀綑瀵垮懡,"HRemark": d.data[i].琛ㄤ綋澶囨敞 + } + ) + } + option.data = rowdata; + table.render(option); + form.render('select'); + } + }) + } + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + + //#endregion + + }); + + + </script> +</body> +</html> \ No newline at end of file diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldLifeUseBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldLifeUseBillList.html" new file mode 100644 index 0000000..c1b03cc --- /dev/null +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldLifeUseBillList.html" @@ -0,0 +1,522 @@ +锘�<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>鍣ㄥ叿瀵垮懡鑰楃敤鍗曠淮鎶�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> + <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> + <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> + <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 class="layui-collapse"> + <div class="layui-colla-item"> + <div class="layui-colla-title layui-inline"> + <div class="layui-inline"> + <span>鏇村</span> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鏃ユ湡</label> + <div class="layui-input-block"> + <input type="date" class="layui-input" id="HDate"> + </div> + </div> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch" style="margin-left:10px"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button> + + <div class="layui-colla-content"> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label">杩囨护</label> + <div class="layui-input-block"> + <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;"> + </select> + </div> + </div> + <div class="layui-inline"> + <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;"> + <option value="0" selected="selected"></option> + <option value="=">=</option> + <option value=">=">>=</option> + <option value=">">></option> + <option value="<="><=</option> + <option value="<"><</option> + <option value="<>"><></option> + <option value="7">鍖呭惈</option> + <option value="8">宸﹀寘鍚�</option> + <option value="9">鍙冲寘鍚�</option> + <option value="10">涓嶅寘鍚�</option> + </select> + </div> + <div class="layui-inline"> + <input type="text" class="layui-input" value="" name="ColContent" id="ColContent"> + </div> + </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_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Edit"><i class="layui-icon layui-icon-form"></i>缂栬緫</button> + + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button> + </div> + </script> + </form> + </div> + </div> + </div> + </div> + <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/zgqCustom/zgqCustom.js"></script> + <script> + layui.config({ + base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () { + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laypage = layui.laypage + , laydate = layui.laydate + + var sWhere = ""; + var HModName = "Sc_MouldLifeUseBillList"; + + var params = getUrlVars(); + + //鍒ゆ柇鏄惁鏈夊弬鏁颁紶閫� + + + //鍒濆鍖栬〃鏍� + DisPlay_HideColumn(); + //鍒濆鍖栫晫闈� + set_ClearBill(); + //#endregion + + + //澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + switch (obj.event) { + //鏂板 + case 'set_AddNew': set_AddNew(); + break; + //缂栬緫 + case 'set_Edit': set_Edit(); + break; + //鍒犻櫎 + case 'set_DeleteBill': set_DeleteBill(); + break; + //鍒锋柊 + case 'get_Refresh': get_Refresh(); + break; + //閫�鍑烘寜閽� + case 'get_Exit': Pub_Close(2); + break; + //鍒楄缃� + case 'set_HideColumn': get_HideColumn(); + break; + }; + }); + + //閲嶇疆鎸夐挳 + form.on('submit(btnReSearch)', function (data) { + set_ClearQuery(); + }); + + //鏌ヨ鎸夐挳 + form.on('submit(btnSearch)', function (data) {//閫夋嫨浠撲綅 + get_FastQuery(); + }); + + //#region 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栬〃鏍� + set_InitGrid(); + //鏌ヨ + get_FastQuery(); + } + //#endregion + + + function set_InitGrid() { + $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , height: 'full-50' + , page: true + , cellMinWidth: 90 + , limit: 50 + , limits: [50, 500, 5000, 20000] + , cols: [[ + { type: 'checkbox', fixed: 'left' } + , { field: 'HMainID', title: 'HMainID', sort: true, width: 165, hide: true } + , { field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 165} + , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 } + , { field: 'HMangerID', title: 'HMangerID', sort: true, width: 165, hide: true } + , { field: '璐熻矗浜�', title: '璐熻矗浜�', sort: true, width: 165 } + , { field: 'HDeptID', title: 'HDeptID', sort: true, width: 165, hide: true } + , { field: '閮ㄩ棬', title: '閮ㄩ棬', sort: true, width: 165 } + , { field: '璁捐瀵垮懡', title: '璁捐瀵垮懡', sort: true, width: 165 } + , { field: '鍘熷墿浣欏鍛�', title: '鍘熷墿浣欏鍛�', sort: true, width: 165 } + , { field: '鏈鑰楃敤', title: '涓婃鑰楃敤', sort: true, width: 165 } + , { field: '鏈鍓╀綑瀵垮懡', title: '涓婃鍓╀綑瀵垮懡', sort: true, width: 165 } + , { field: '璋冩暣鍘熷洜', title: '璋冩暣鍘熷洜', sort: true, width: 165 } + , { field: '鎽樿', title: '鎽樿', sort: true, width: 165 } + , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞' } + , { field: 'HMaterID', title: 'HMaterID', sort: true, width: 165, hide: true } + , { field: '鍣ㄥ叿', title: '鍣ㄥ叿', sort: true, width: 165 } + , { field: 'HUnitID', title: 'HUnitID', sort: true, width: 165, hide: true } + , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', sort: true, width: 165 } + , { field: '骞�', title: '骞�', sort: true, width: 170 } + , { field: '鏈�', title: '鏈�', sort: true, width: 170 } + , { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞', width: 115 } + ]] + }; + } + + //#region 鏌ヨ + function get_Display(sWhere) { + var ajaxLoad = layer.load(); + $.ajax({ + url: GetWEBURL() + '/Sc_MouldLifeUseBill/list', + type: "GET", + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.count == 1) { + option.data = data1.data; + table.render(option); + layer.close(ajaxLoad); + + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + //layer.alert("鏌ヨ鎴愬姛", { icon: 1 }); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + + } + //#endregion + + //#region 蹇�熻繃婊� + function get_FastQuery() { + var HDate = $("#HDate").val();;//寮�濮嬫棩鏈� + var ColName = $("#ColName").val();//澶嶉�夋 + var Comparator = $("#Comparator").val() + var ColContent = $("#ColContent").val(); + + if (ColName != 0 && Comparator != 0) { + var com = ""; + switch (Comparator) { + case "7": + com = "like'%" + ColContent + "%'"; + break; + case "8": + com = "like'%" + ColContent + "'"; + break; + case "9": + com = "like'" + ColContent + "%'"; + break; + case "10": + com = "not like'%" + ColContent + "%'"; + break; + default: + com = "" + Comparator + "'" + ColContent + "'"; + break; + } + sWhere += " and " + ColName + " " + com; + } + + if (HDate) { + sWhere += " and 鏃ユ湡 <= '" + HDate + "'"; + } + get_Display(sWhere); + sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 + } + //#endregion + + //#region 閲嶇疆杩囨护鏉′欢鏂规硶 + function set_ClearQuery() { + $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));//鏃ユ湡 + $("#btnSearch").click(); + $("#ColContent").val(""); + $("#ColName").val("0"); + $("#Comparator").val("0"); + form.render('select'); + sWhere = ""; + } + //#endregion + + //鏂板 + function set_AddNew() { + layer.open({ + type: 2 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['100%', '100%'] + , title: '鍣ㄥ叿瀵垮懡鑰楃敤鏇村崟鏂板' + , shift: 0//寮瑰嚭鍔ㄧ敾 + , content: './Sc_Add_MouldLifeUseBillList.html?OperationType=1&linterid=' + , end: function () { + //鍒锋柊椤甸潰, + location.reload(); + } + }) + } + + // 缂栬緫 + function set_Edit() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var linterid = data[0].HMainID; + + layer.open({ + type: 2 + , area: ['100%', '100%'] + , title: '鍣ㄥ叿瀵垮懡鑰楃敤鏇村崟缂栬緫' + , shift: 0//寮瑰嚭鍔ㄧ敾 + , content: './Sc_Add_MouldLifeUseBillList.html?OperationType=3&linterid=' + linterid +'' + , end: function () { + //鍒锋柊椤甸潰, + location.reload(); + } + }) + } else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒'); + } + } + + //#region 鍒犻櫎 + function set_DeleteBill() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var hmainid = data[0].HMainID; + layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) { + var wait = layer.load(); + //閫昏緫鍒犻櫎鏂规硶 + $.ajax({ + url: GetWEBURL() + '/Sc_MouldLifeUseBill/Delete', + type: "GET", + data: { "HInterID": hmainid, "user": sessionStorage["HUserName"]}, + success: function (result) { + if (result.count == 1) { + layer.msg(result.Message, { icon: 1 }, function () { + // 寰楀埌frame绱㈠紩 + var index = layer.getFrameIndex(window.name); + //鍏抽棴褰撳墠frame + layer.close(wait); + //淇敼涓哄姛鍚庡埛鏂扮晫闈� + window.location.reload(); + }); + } else { + layer.alert(result.code + result.Message, { icon: 5 }); + layer.close(wait); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + layer.close(wait); + } + }); + }) + } + else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒'); + } + + } + //#endregion + + //#region 鍒锋柊 + function get_Refresh() { + set_ClearQuery(); + get_Display(sWhere); + } + //#endregion + + //闅愯棌鍒楄缃� + function get_HideColumn() { + var colName = ""; + var contentUrl = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colName += option.cols[0][i]["title"] + ","; + } + var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞 + var urlLen = urlStr.split('/'); + for (var i = 0; i < urlLen.length - 4; i++) { + contentUrl += "../"; + } + colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜 + + contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; + + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "闅愯棌鍒楄缃�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["50%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: [contentUrl, "yes"] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //鏄剧ず鍒楁暟鎹� + function DisPlay_HideColumn() { + $.ajax({ + url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', + type: "GET", + data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.data.length != 0) { + + + var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 + var titleData = ["HMainID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞� + + dataCol = data1.data[0].HGridString.split(','); + + for (var i = 0; i < option.cols[0].length - 2; i++) { + var dataCols = dataCol[i].split('|'); + //闅愯棌鍒� + if (dataCols[1] == 1) { + option.cols[0][i + 1]["hide"] = true; + } + //璁剧疆鍒楀 + if (dataCols[3] > 0) { + option.cols[0][i + 1]["width"] = dataCols[3]; + } + //璁剧疆鍐呭瀛椾綋澶у皬 + if (data1.data[0].HFontSize != 0) { + option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; + } else { + option.cols[0][i + 1]["style"] = "font-size:100%"; + } + //璁剧疆鍒楀 + //if (data1.data[0].HColumnWidth != 0) { + // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; + //} else { + // option.cols[0][i + 1]["width"] = ""; + //} + //鏄剧ず鍒� + if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { + option.cols[0][i + 1]["hide"] = false; + } + //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) + switch (dataCols[2]) { + case "L": + option.cols[0][i + 1]["align"] = "left"; + break; + case "M": + option.cols[0][i + 1]["align"] = "center"; + break; + case "R": + option.cols[0][i + 1]["align"] = "right"; + break; + } + } + + //鍙栨秷鍐荤粨鍒� + for (var i = 1; i < option.cols[0].length - 1; i++) { + if (option.cols[0][i]["fixed"] != null) { + option.cols[0][i]["fixed"] = null; + } + else { + break; + } + } + //鍐荤粨鍒� + if (data1.data[0].HFixCols != 0) { + for (var i = 0; i < data1.data[0].HFixCols; i++) { + if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { + data1.data[0].HFixCols += 1; + } + option.cols[0][i + 1]["fixed"] = "left"; + } + } + table.render(option); + } else { + table.render(option); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }) + } + + //鍒楁槑鏄剧ず涓嬫媺妗� + function ColFilter() { + var Organization = '<option value="0" selected="selected" ></option>'; + for (var i = 1; i < option.cols[0].length; i++) { + if (option.cols[0][i].hide != true) { + Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>'; + } + } + $("#ColName").empty(); + $("#ColName").append(Organization); + form.render('select'); + } + + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + //#endregion + + //浠ヤ笂鏄痩ayui妯″潡 + }); + + </script> + +</body> +</html> \ No newline at end of file diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapRequestBill.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapRequestBill.html" new file mode 100644 index 0000000..f491b92 --- /dev/null +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapRequestBill.html" @@ -0,0 +1,895 @@ +锘�<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <title>鍣ㄥ叿鎶ュ簾鐢宠鍗�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> + <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> + <style> + .main-btn { /*澶撮儴涓绘寜閽�*/ + padding: 0 2px; /*璋冩暣鎸夐挳宸﹀彸绌洪殭澶у皬*/ + height: 30px; + line-height: 30px; + } + + .btn-title { + font-size: 16px; + } + /* 闃叉涓嬫媺妗嗙殑涓嬫媺鍒楄〃琚殣钘�---蹇呴』璁剧疆--- */ + /*.layui-table-cell { + overflow: visible !important; + }*/ + /* 浣垮緱涓嬫媺妗嗕笌鍗曞厓鏍煎垰濂藉悎閫� */ + /*td .layui-form-select { + margin-top: -10px; + margin-left: -15px; + margin-right: -15px; + }*/ + + .layui-form-item .layui-inline { + margin-top: 5px; + margin-bottom: 5px; + margin-right: 0px; + } + + .layui-form-label { + width: 25%; + } + </style> + +</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="btnEdit" id="btnEdit">閫�鍑�</button> + </div> + <div class="layui-tab" lay-filter="tab-POStockInBill"> + <ul class="layui-tab-title" lay-filter="tab-all"> + <li lay-id="1" style="padding:1px;" class="layui-this">鍩烘湰淇℃伅</li> + <li lay-id="2" style="padding:1px;">鍒跺崟淇℃伅</li> + </ul> + <div class="layui-tab-content"> + <!--鍩烘湰淇℃伅--> + <div class="layui-tab-item layui-show"> + <div class="layui-form-item" style="padding-top: 10px;"> + <div class="layui-row"> + <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="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly> + <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID"> + </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="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 70px;"> + </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="HReason" id="HReason"> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">閮ㄩ棬</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDept" id="btnHDept" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">璐熻矗浜�</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HMangerName" name="HMangerName" id="HMangerName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HMangerID" id="HMangerID" lay-verify="HMangerID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHManger" id="btnHManger" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐢宠浜�</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HEmpName" name="HEmpName" id="HEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HEmpID" id="HEmpID" lay-verify="HEmpID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmp" id="btnHEmp" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鎶ュ簾浠撳簱</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HWHName" name="HWHName" id="HWHName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHWH" id="btnHWH" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label"> 澶囨敞</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HRemark" id="HRemark"> + </div> + </div> + </div> + </div> + </div> + <!--鍒跺崟淇℃伅--> + <div class="layui-tab-item"> + <div class="layui-form-item"> + <div class="layui-row"> + <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="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly> + </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="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly> + </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="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + <div class="layui-row"> + <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="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly> + </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="HDeleteMan " id="HDeleteMan " style="background-color:#efefef4d;" readonly> + </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="HBacker " id="HBacker " style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + <div class="layui-row"> + <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="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly> + </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="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly> + </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="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly> + </div> + </div> + <div class="layui-row"> + <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="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly> + </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="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly> + </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="HBackDate" id="HBackDate" style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + + <table class="layui-hide" 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="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button> + <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>--> + </div> + </script> + </form> + </div> + </div> + </div> + <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(['index', 'form', 'laydate', 'table', 'element', 'laydate'], function () { + + //#region 鍏叡鍙橀噺 + + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laydate = layui.laydate + var option = []; + + //#endregion + + //#region 杩涘叆椤甸潰鍗冲姞杞� + + var rowdata = [{ + "HMaterID": 0, "鍣ㄥ叿": "", "HPropertyID": 0, "杈呭姪灞炴��": "", "HSecUnitID": "0", "杈呭姪璁¢噺鍗曚綅": "", "HUnitID": 0, "璁¢噺鍗曚綅": "" + , "HWHID": "0", "鎶ュ簾浠撳簱": "", "HQty": "0", "HPrice": "0", "HMoney": "0", "HDesignLife": "0", "HLeaveLife": "0", "HRemark": "" + , "HSecUnitRate": "0" + }]; + //鍒濆鍖�,"HQty":"0" + set_ClearBill(); + + var params = getUrlVars(); + var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷 1娣诲姞 淇濆瓨 2澶嶅埗 3 缂栬緫 + var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜 + + if (linterid == null || linterid == 0) { + OperationType = 1; + $.ajax({ + url: GetWEBURL() + "/Web/GetMAXNum", + type: "GET", + data: { "HBillType": '3823' }, + success: function (d) { + $("#HInterID").val(d.data[0].HInterID); + $("#HBillNo").val(d.data[0].HBillNo); + $("#HInterID").val(d.data[0].HInterID); + } + }); + } + else {//濡傛灉淇敼鍒欒蛋涓嬮潰 + //绂佺敤缁勭粐閫夐」 + $("#HPRDORGID").attr("disabled", true); + $("#HDate").attr("disabled", true); + RoadBillMain(linterid); + $("#HInterID").val(linterid); + } + + $("#HMaker").val(sessionStorage["HUserName"]); + + //#endregion + + //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� + + //澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + //鏂板琛岃〃鏍兼暟鎹� + var NewRow = { + "HMaterID": 0, "鍣ㄥ叿": "", "HPropertyID": 0, "杈呭姪灞炴��": "", "HSecUnitID": "0", "杈呭姪璁¢噺鍗曚綅": "", "HUnitID": 0, "璁¢噺鍗曚綅": "" + , "HWHID": "0", "鎶ュ簾浠撳簱": "", "HQty": "0", "HPrice": "0", "HMoney": "0", "HDesignLife": "0", "HLeaveLife": "0", "HRemark": "" + , "HSecUnitRate": "0" + }; + switch (obj.event) { + case 'btn-AddLine': + table.cache["mainTable"].push(NewRow); + option.data = table.cache["mainTable"]; + + table.render(option); + //鍒锋柊澶嶉�夋 + checkRefresh(); + break; + case 'btn-CopyLine': + var copydata = JSON.stringify(data); + if (data.length <= 0) { + layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒"); + } + else if (data.length > 1) { + layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒"); + } + else { + var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'[' + var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']' + table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂 + option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓� + table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓� + //鍒锋柊澶嶉�夋 + checkRefresh(); + } + break; + ////鍒楄缃� + //case 'set_HideColumn': + // get_HideColumn(); + // break; + } + }); + + //閫夋嫨閮ㄩ棬 + form.on('submit(btnHDept)', function () { + get_btnHDept(); + }); + + //閫夋嫨鐢宠浜� + form.on('submit(btnHEmp)', function () { + get_btnHEmp(); + }); + + //閫夋嫨璐熻矗浜� + form.on('submit(btnHManger)', function () { + get_btnHManger(); + }); + + //閫夋嫨鎶ュ簾浠撳簱 + form.on('submit(btnHWH)', function () { + get_btnHWH(); + }); + + //閫�鍑� + form.on('submit(btnEdit)', function (data) { + if (OperationType == 1 && linterid != "") { + Pub_Close(2); + } else { + Pub_Close(1); + } + }); + + //淇濆瓨鎻愪氦 + form.on('submit(btnSave)', function (data) {//鎻愪氦 + set_AddNew(data); + }); + + //琛屽唴浜嬩欢 + table.on('tool(mainTable)', function (obj) { + set_GridDelete(obj); //琛屽唴鍒犻櫎 + set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫� + + var data = obj.data; + if (obj.event == 'HBeginDate') { + var field = $(this).data('field'); + laydate.render({ + elem: this.firstChild + , show: true //鐩存帴鏄剧ず + , closeStop: this + , done: function (nowDate) { + //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊 + data[field] = nowDate; + obj.update(data); + //鍒锋柊澶嶉�夋 + //checkRefresh(); + } + }); + } + + if (obj.event == 'HEndDate') { + var field = $(this).data('field'); + laydate.render({ + elem: this.firstChild + , show: true //鐩存帴鏄剧ず + , closeStop: this + , done: function (nowDate) { + //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊 + data[field] = nowDate; + obj.update(data); + //鍒锋柊澶嶉�夋 + //checkRefresh(); + } + }); + } + }); + + //#endregion + + //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶 + + // 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栨棩鏈� + $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); + //鍒濆鍖� 缁勭粐 + Organ(); + + set_InitGrid(); + } + + //鑾峰彇缁勭粐 + function Organ() { + //鑾峰彇鐧诲綍椤电粍缁囧垪 + var Organization = ''; + $.ajax({ + type: "get", + url: GetWEBURL() + "/Web/GetOrganizations", + success: function (result) { + if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝 + var data = result.data; + for (var i = 0; i < data.length; i++) { + Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>'; + } + $("#HPRDORGID").append(Organization); + $("#HPRDORGID").val(sessionStorage["OrganizationID"]) + form.render('select'); + } + layer.closeAll("loading"); + } + }) + } + + function set_InitGrid() { + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , limit: 500 + , height: 500 + , loading: false + , cols: [[ //琛ㄥご + { type: 'checkbox', totalRowText: '鍚堣琛�' } + , { type: 'numbers', title: '搴忓彿', totalRow: true } + , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true } + , { field: '鍣ㄥ叿', title: '鍣ㄥ叿', width: 100, edit: 'text', event: "HMaterID" }//f7 + , { field: 'HPropertyID', title: 'HPropertyID', width: 100, hide: true } + , { field: '杈呭姪灞炴��', title: '杈呭姪灞炴��', width: 100, edit: 'text', event: "HPropertyID" }//f7 + , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true } + , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', width: 100, edit: 'text', event: "HUnitID" }//f7 + , { field: 'HSecUnitID', title: 'HSecUnitID', width: 100, hide: true } + , { field: '杈呭姪璁¢噺鍗曚綅', title: '杈呭姪璁¢噺鍗曚綅', width: 100, edit: 'text', event: "HSecUnitID" }//f7 + , { field: 'HWHID', title: 'HWHID', width: 100, hide: true } + , { field: '鎶ュ簾浠撳簱', title: '鎶ュ簾浠撳簱', width: 100, edit: 'text', event: "HWHID" }//f7 + , { field: 'HQty', title: '鏁伴噺', edit: 'text' } + , { field: 'HPrice', title: '鍗曚环', edit: 'text' } + , { field: 'HMoney', title: '閲戦', edit: 'text' } + , { field: 'HSecUnitRate', title: '鎹㈢畻鐜�', edit: 'text' } + , { field: 'HDesignLife', title: '璁捐瀵垮懡', edit: 'text' } + , { field: 'HLeaveLife', title: '鍓╀綑瀵垮懡', edit: 'text' } + , { field: 'HRemark', title: '琛ㄤ綋澶囨敞', edit: 'text' }//f7 + , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo',width: 80 } + ]] + } + + option.data = rowdata; + table.render(option); + } + + //閮ㄩ棬 + function get_btnHDept() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '閮ㄩ棬'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../Baseset/鍩虹璧勬枡/Gy_DepartmentList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HDeptID").val(checkStatus.data[0].HItemID); + $("#HDeptName").val(checkStatus.data[0].HName); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //鐢宠浜� + function get_btnHEmp() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '鐢宠浜�'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HEmpID").val(checkStatus.data[0].HItemID); + $("#HEmpName").val(checkStatus.data[0].鑱屽憳鍚嶇О); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //璐熻矗浜� + function get_btnHManger() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '璐熻矗浜�'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HMangerID").val(checkStatus.data[0].HItemID); + $("#HMangerName").val(checkStatus.data[0].鑱屽憳鍚嶇О); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //鎶ュ簾浠撳簱 + function get_btnHWH() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '鎶ュ簾浠撳簱'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../Baseset/鍩虹璧勬枡/Gy_WarehouseList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HWHID").val(checkStatus.data[0].HItemID); + $("#HWHName").val(checkStatus.data[0].HName); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //琛屽唴蹇嵎閿瓫閫� + function set_GridCellCheck(obj) { + $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) { + if (event.key == "F7") { + //鍣ㄥ叿 + if (obj.event == "HMaterID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "鍣ㄥ叿鍒楄〃" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_MouldFileMainList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "鍣ㄥ叿": checkStatus.data[0].HName + , "HMaterID": checkStatus.data[0].HInterID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //杈呭姪灞炴�� + if (obj.event == "HPropertyID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "杈呭姪灞炴�у垪琛�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_PropertyList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "杈呭姪灞炴��": checkStatus.data[0].杈呭姪灞炴�у悕绉� + , "HPropertyID": checkStatus.data[0].hitemid + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //杈呭姪璁¢噺鍗曚綅 + if (obj.event == "HSecUnitID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "杈呭姪璁¢噺鍗曚綅鍒楄〃" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_UnitList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "杈呭姪璁¢噺鍗曚綅": checkStatus.data[0].HName + , "HSecUnitID": checkStatus.data[0].HItemID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //璁¢噺鍗曚綅 + if (obj.event == "HUnitID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "璁¢噺鍗曚綅" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_UnitList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "璁¢噺鍗曚綅": checkStatus.data[0].HName + , "HUnitID": checkStatus.data[0].HItemID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //鎶ュ簾浠撳簱 + if (obj.event == "HWHID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "鎶ュ簾浠撳簱" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_WarehouseList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "鎶ュ簾浠撳簱": checkStatus.data[0].HName + , "HWHID": checkStatus.data[0].HItemID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + obj.event = ""; + return false; + } + }) + } + + //琛屽唴鍒犻櫎 + 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 { + obj.del(); + option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓� + table.reload(option); + layer.close(index); + } + }); + } + } + + //澶氶�� 鍒锋柊琛ㄦ牸 + function checkRefresh() { + + } + + //淇濆瓨 + 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]) + } + } + + var sMainStr = JSON.stringify(data.field); + var sSubStr = JSON.stringify(num); + //var hentryid = linteridSub;//瀛愯〃 鎺掑簭id + var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"]; + + var index = layer.load(); + $.ajax({ + type: "POST", + url: GetWEBURL() + "/Sc_MouldScrapRequestBill/MouldScrapRequestBillEdit", + async: true, + data: { "sMainSub": sMainSub }, + dataType: "json", + success: function (data) { + if (data.count == 1) { + $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true); + layer.close(index); + layer.msg("鎻愪氦鎴愬姛"); + } + 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: "娓╅Θ鎻愮ず" }); + } + }); + } + + //缂栬緫 椤甸潰璧嬪�� + function RoadBillMain(linterid)//鍔犺浇琛ㄥご + { + $.ajax({ + url: GetWEBURL() + "/Sc_MouldScrapRequestBill/cx", + type: "GET", + async: false, + data: { "HInterID": linterid }, + success: function (d) { + + //$("#HPRDORGID").val(d.data[0].HPRDORGID); + //涓昏〃 + form.val("formData", { + "HBillNo": d.data[0].鍗曟嵁鍙� + , "HInterID": d.data[0].hmainid + , "HDate": Format(new Date(d.data[0].鏃ユ湡), "yyyy-MM-dd") + , "HReason": d.data[0].鎶ュ簾鍘熷洜 + , "HDeptID": d.data[0].HDeptID + , "HDeptName": d.data[0].閮ㄩ棬 + , "HEmpID": d.data[0].HEmpID + , "HEmpName": d.data[0].鐢宠浜� + , "HMangerID": d.data[0].HMangerID + , "HMangerName": d.data[0].璐熻矗浜� + , "HWHID": d.data[0].HWHID + , "HWHName": d.data[0].鎶ュ簾浠撳簱 + , "HRemark": d.data[0].澶囨敞 + , "HMaker": d.data[0].鍒跺崟浜� + , "HMakeDate": Format(new Date(d.data[0].鍒跺崟鏃ユ湡), "yyyy-MM-dd") + , "HUpDater": d.data[0].淇敼浜� + , "HUpDateDate": Format(new Date(d.data[0].淇敼鏃ユ湡), "yyyy-MM-dd") + }); + + //瀛愯〃 璧嬪�� + var rowdata = []; + for (var i = 0; i < d.data.length; i++) { + rowdata.push( + { + "HMaterID": d.data[i].HMaterID, "鍣ㄥ叿": d.data[i].妯″叿, "HPropertyID": d.data[i].HPropertyID, "杈呭姪灞炴��": d.data[i].杈呭姪灞炴��, + "HSecUnitID": d.data[i].HSecUnitID, "杈呭姪璁¢噺鍗曚綅": d.data[i].杈呭姪璁¢噺鍗曚綅, "HUnitID": d.data[i].HUnitID, "璁¢噺鍗曚綅": d.data[i].璁¢噺鍗曚綅 + , "HWHID": d.data[i].HWHID, "鎶ュ簾浠撳簱": d.data[i].瀛愭姤搴熶粨搴�, "HQty": d.data[i].瀹炴敹鏁伴噺, "HPrice": d.data[i].鍗曚环, + "HMoney": d.data[i].閲戦, "HDesignLife": d.data[i].璁捐瀵垮懡, "HLeaveLife": d.data[i].鍓╀綑瀵垮懡, "HRemark": d.data[i].琛ㄤ綋澶囨敞 + , "HSecUnitRate": d.data[i].鎹㈢畻鐜� + } + ) + } + option.data = rowdata; + table.render(option); + form.render('select'); + } + }) + } + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + + //#endregion + + }); + + + </script> +</body> +</html> \ No newline at end of file diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapRequestBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapRequestBillList.html" new file mode 100644 index 0000000..ec1c64e --- /dev/null +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldScrapRequestBillList.html" @@ -0,0 +1,531 @@ +锘�<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>鍣ㄥ叿鎶ュ簾鐢宠鍗曠淮鎶�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> + <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> + <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> + <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 class="layui-collapse"> + <div class="layui-colla-item"> + <div class="layui-colla-title layui-inline"> + <div class="layui-inline"> + <span>鏇村</span> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鏃ユ湡</label> + <div class="layui-input-block"> + <input type="date" class="layui-input" id="HDate"> + </div> + </div> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch" style="margin-left:10px"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button> + + <div class="layui-colla-content"> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label">杩囨护</label> + <div class="layui-input-block"> + <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;"> + </select> + </div> + </div> + <div class="layui-inline"> + <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;"> + <option value="0" selected="selected"></option> + <option value="=">=</option> + <option value=">=">>=</option> + <option value=">">></option> + <option value="<="><=</option> + <option value="<"><</option> + <option value="<>"><></option> + <option value="7">鍖呭惈</option> + <option value="8">宸﹀寘鍚�</option> + <option value="9">鍙冲寘鍚�</option> + <option value="10">涓嶅寘鍚�</option> + </select> + </div> + <div class="layui-inline"> + <input type="text" class="layui-input" value="" name="ColContent" id="ColContent"> + </div> + </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_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Edit"><i class="layui-icon layui-icon-form"></i>缂栬緫</button> + + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button> + </div> + </script> + </form> + </div> + </div> + </div> + </div> + <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/zgqCustom/zgqCustom.js"></script> + <script> + layui.config({ + base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () { + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laypage = layui.laypage + , laydate = layui.laydate + + var sWhere = ""; + var HModName = "Sc_MouldScrapRequestBillList"; + + var params = getUrlVars(); + + //鍒ゆ柇鏄惁鏈夊弬鏁颁紶閫� + + + //鍒濆鍖栬〃鏍� + DisPlay_HideColumn(); + //鍒濆鍖栫晫闈� + set_ClearBill(); + //#endregion + + + //澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + switch (obj.event) { + //鏂板 + case 'set_AddNew': set_AddNew(); + break; + //缂栬緫 + case 'set_Edit': set_Edit(); + break; + //鍒犻櫎 + case 'set_DeleteBill': set_DeleteBill(); + break; + //鍒锋柊 + case 'get_Refresh': get_Refresh(); + break; + //閫�鍑烘寜閽� + case 'get_Exit': Pub_Close(2); + break; + //鍒楄缃� + case 'set_HideColumn': get_HideColumn(); + break; + }; + }); + + //閲嶇疆鎸夐挳 + form.on('submit(btnReSearch)', function (data) { + set_ClearQuery(); + }); + + //鏌ヨ鎸夐挳 + form.on('submit(btnSearch)', function (data) {//閫夋嫨浠撲綅 + get_FastQuery(); + }); + + //#region 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栬〃鏍� + set_InitGrid(); + //鏌ヨ + get_FastQuery(); + } + //#endregion + + + function set_InitGrid() { + $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , height: 'full-50' + , page: true + , cellMinWidth: 90 + , limit: 50 + , limits: [50, 500, 5000, 20000] + , cols: [[ + { type: 'checkbox', fixed: 'left' } + , { field: 'hmainid', title: 'hmainid', sort: true, width: 165, hide: true } + , { field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 165} + , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 } + , { field: 'HEmpID', title: 'HEmpID', sort: true, width: 165, hide: true } + , { field: '鐢宠浜�', title: '鐢宠浜�', sort: true, width: 165 } + , { field: 'HMangerID', title: 'HMangerID', sort: true, width: 165, hide: true } + , { field: '璐熻矗浜�', title: '璐熻矗浜�', sort: true, width: 165 } + , { field: '鎶ュ簾浠撳簱', title: '鎶ュ簾浠撳簱', sort: true, width: 165 } + , { field: 'HDeptID', title: 'HDeptID', sort: true, width: 165, hide: true } + , { field: '閮ㄩ棬', title: '閮ㄩ棬', sort: true, width: 165 } + , { field: '鎶ュ簾鍘熷洜', title: '鎶ュ簾鍘熷洜', sort: true, width: 165 } + , { field: '鎽樿', title: '鎽樿', sort: true, width: 165 } + , { field: '澶囨敞', title: '澶囨敞', sort: true, width: 165 } + , { field: 'HMaterID', title: 'HMaterID', sort: true, width: 165, hide: true } + , { field: '妯″叿', title: '妯″叿', sort: true, width: 165 } + , { field: 'HUnitID', title: 'HUnitID', sort: true, width: 165, hide: true } + , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', sort: true, width: 165 } + , { field: 'HPropertyID', title: 'HPropertyID', sort: true, width: 165, hide: true } + , { field: '杈呭姪灞炴��', title: '杈呭姪灞炴��', sort: true, width: 165 } + , { field: 'HSecUnitID', title: 'HSecUnitID', sort: true, width: 165, hide: true } + , { field: '杈呭姪璁¢噺鍗曚綅', title: '杈呭姪璁¢噺鍗曚綅', sort: true, width: 165 } + , { field: '鎹㈢畻鐜�', title: '鎹㈢畻鐜�', sort: true, width: 165 } + , { field: '瀹炴敹鏁伴噺', title: '瀹炴敹鏁伴噺', sort: true, width: 165 } + , { field: '鍗曚环', title: '鍗曚环', sort: true, width: 165 } + , { field: '閲戦', title: '閲戦', sort: true, width: 165 } + , { field: '璁捐瀵垮懡', title: '璁捐瀵垮懡', sort: true, width: 165 } + , { field: '鍓╀綑瀵垮懡', title: '鍓╀綑瀵垮懡', sort: true, width: 165 } + , { field: 'HWHID', title: 'HWHID', sort: true, width: 165, hide: true } + , { field: '瀛愭姤搴熶粨搴�', title: '瀛愭姤搴熶粨搴�', sort: true, width: 165 } + , { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞', width: 115 } + ]] + }; + } + + //#region 鏌ヨ + function get_Display(sWhere) { + var ajaxLoad = layer.load(); + $.ajax({ + url: GetWEBURL() + '/Sc_MouldScrapRequestBill/list', + type: "GET", + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.count == 1) { + option.data = data1.data; + table.render(option); + layer.close(ajaxLoad); + + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + //layer.alert("鏌ヨ鎴愬姛", { icon: 1 }); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + + } + //#endregion + + //#region 蹇�熻繃婊� + function get_FastQuery() { + var HDate = $("#HDate").val();;//寮�濮嬫棩鏈� + var ColName = $("#ColName").val();//澶嶉�夋 + var Comparator = $("#Comparator").val() + var ColContent = $("#ColContent").val(); + + if (ColName != 0 && Comparator != 0) { + var com = ""; + switch (Comparator) { + case "7": + com = "like'%" + ColContent + "%'"; + break; + case "8": + com = "like'%" + ColContent + "'"; + break; + case "9": + com = "like'" + ColContent + "%'"; + break; + case "10": + com = "not like'%" + ColContent + "%'"; + break; + default: + com = "" + Comparator + "'" + ColContent + "'"; + break; + } + sWhere += " and " + ColName + " " + com; + } + + if (HDate) { + sWhere += " and 鏃ユ湡 <= '" + HDate + "'"; + } + get_Display(sWhere); + sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 + } + //#endregion + + //#region 閲嶇疆杩囨护鏉′欢鏂规硶 + function set_ClearQuery() { + $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));//鏃ユ湡 + $("#btnSearch").click(); + $("#ColContent").val(""); + $("#ColName").val("0"); + $("#Comparator").val("0"); + form.render('select'); + sWhere = ""; + } + //#endregion + + //鏂板 + function set_AddNew() { + layer.open({ + type: 2 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['100%', '100%'] + , title: '鍣ㄥ叿鎶ュ簾鐢宠鍗曟柊澧�' + , shift: 0//寮瑰嚭鍔ㄧ敾 + , content: './Sc_MouldScrapRequestBill.html?OperationType=1&linterid=' + , end: function () { + //鍒锋柊椤甸潰, + location.reload(); + } + }) + } + + // 缂栬緫 + function set_Edit() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var linterid = data[0].hmainid; + + layer.open({ + type: 2 + , area: ['100%', '100%'] + , title: '鍣ㄥ叿鎶ュ簾鐢宠鍗曠紪杈�' + , shift: 0//寮瑰嚭鍔ㄧ敾 + , content: './Sc_MouldScrapRequestBill.html?OperationType=3&linterid=' + linterid +'' + , end: function () { + //鍒锋柊椤甸潰, + location.reload(); + } + }) + } else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒'); + } + } + + //#region 鍒犻櫎 + function set_DeleteBill() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var hmainid = data[0].hmainid; + layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) { + var wait = layer.load(); + //閫昏緫鍒犻櫎鏂规硶 + $.ajax({ + url: GetWEBURL() + '/Sc_MouldScrapRequestBill/Delete', + type: "GET", + data: { "HInterID": hmainid, "user": sessionStorage["HUserName"]}, + success: function (result) { + if (result.count == 1) { + layer.msg(result.Message, { icon: 1 }, function () { + // 寰楀埌frame绱㈠紩 + var index = layer.getFrameIndex(window.name); + //鍏抽棴褰撳墠frame + layer.close(wait); + //淇敼涓哄姛鍚庡埛鏂扮晫闈� + window.location.reload(); + }); + } else { + layer.alert(result.code + result.Message, { icon: 5 }); + layer.close(wait); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + layer.close(wait); + } + }); + }) + } + else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒'); + } + + } + //#endregion + + //#region 鍒锋柊 + function get_Refresh() { + set_ClearQuery(); + get_Display(sWhere); + } + //#endregion + + //闅愯棌鍒楄缃� + function get_HideColumn() { + var colName = ""; + var contentUrl = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colName += option.cols[0][i]["title"] + ","; + } + var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞 + var urlLen = urlStr.split('/'); + for (var i = 0; i < urlLen.length - 4; i++) { + contentUrl += "../"; + } + colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜 + + contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; + + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "闅愯棌鍒楄缃�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["50%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: [contentUrl, "yes"] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //鏄剧ず鍒楁暟鎹� + function DisPlay_HideColumn() { + $.ajax({ + url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', + type: "GET", + data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.data.length != 0) { + + + var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 + var titleData = ["hmainid", "HEmpID", "HMangerID", "HDeptID", "HMaterID", "HPropertyID", "HSecUnitID","HWHID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞� + + dataCol = data1.data[0].HGridString.split(','); + + for (var i = 0; i < option.cols[0].length - 2; i++) { + var dataCols = dataCol[i].split('|'); + //闅愯棌鍒� + if (dataCols[1] == 1) { + option.cols[0][i + 1]["hide"] = true; + } + //璁剧疆鍒楀 + if (dataCols[3] > 0) { + option.cols[0][i + 1]["width"] = dataCols[3]; + } + //璁剧疆鍐呭瀛椾綋澶у皬 + if (data1.data[0].HFontSize != 0) { + option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; + } else { + option.cols[0][i + 1]["style"] = "font-size:100%"; + } + //璁剧疆鍒楀 + //if (data1.data[0].HColumnWidth != 0) { + // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; + //} else { + // option.cols[0][i + 1]["width"] = ""; + //} + //鏄剧ず鍒� + if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { + option.cols[0][i + 1]["hide"] = false; + } + //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) + switch (dataCols[2]) { + case "L": + option.cols[0][i + 1]["align"] = "left"; + break; + case "M": + option.cols[0][i + 1]["align"] = "center"; + break; + case "R": + option.cols[0][i + 1]["align"] = "right"; + break; + } + } + + //鍙栨秷鍐荤粨鍒� + for (var i = 1; i < option.cols[0].length - 1; i++) { + if (option.cols[0][i]["fixed"] != null) { + option.cols[0][i]["fixed"] = null; + } + else { + break; + } + } + //鍐荤粨鍒� + if (data1.data[0].HFixCols != 0) { + for (var i = 0; i < data1.data[0].HFixCols; i++) { + if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { + data1.data[0].HFixCols += 1; + } + option.cols[0][i + 1]["fixed"] = "left"; + } + } + table.render(option); + } else { + table.render(option); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }) + } + + //鍒楁槑鏄剧ず涓嬫媺妗� + function ColFilter() { + var Organization = '<option value="0" selected="selected" ></option>'; + for (var i = 1; i < option.cols[0].length; i++) { + if (option.cols[0][i].hide != true) { + Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>'; + } + } + $("#ColName").empty(); + $("#ColName").append(Organization); + form.render('select'); + } + + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + //#endregion + + //浠ヤ笂鏄痩ayui妯″潡 + }); + + </script> + +</body> +</html> \ No newline at end of file diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldStatusChangeBill.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldStatusChangeBill.html" new file mode 100644 index 0000000..a681af4 --- /dev/null +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldStatusChangeBill.html" @@ -0,0 +1,762 @@ +锘�<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <title>鍣ㄥ叿鐘舵�佸彉鏇村崟</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> + <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> + <style> + .main-btn { /*澶撮儴涓绘寜閽�*/ + padding: 0 2px; /*璋冩暣鎸夐挳宸﹀彸绌洪殭澶у皬*/ + height: 30px; + line-height: 30px; + } + + .btn-title { + font-size: 16px; + } + /* 闃叉涓嬫媺妗嗙殑涓嬫媺鍒楄〃琚殣钘�---蹇呴』璁剧疆--- */ + .layui-table-cell { + overflow: visible !important; + } + /* 浣垮緱涓嬫媺妗嗕笌鍗曞厓鏍煎垰濂藉悎閫� */ + td .layui-form-select { + margin-top: -10px; + margin-left: -15px; + margin-right: -15px; + } + + .layui-form-item .layui-inline { + margin-top: 5px; + margin-bottom: 5px; + margin-right: 0px; + } + + .layui-form-label { + width: 25%; + } + </style> + +</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="btnEdit" id="btnEdit">閫�鍑�</button> + </div> + <div class="layui-tab" lay-filter="tab-POStockInBill"> + <ul class="layui-tab-title" lay-filter="tab-all"> + <li lay-id="1" style="padding:1px;" class="layui-this">鍩烘湰淇℃伅</li> + <li lay-id="2" style="padding:1px;">鍒跺崟淇℃伅</li> + </ul> + <div class="layui-tab-content"> + <!--鍩烘湰淇℃伅--> + <div class="layui-tab-item layui-show"> + <div class="layui-form-item" style="padding-top: 10px;"> + <div class="layui-row"> + <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="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly> + <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;">鏃ユ湡</label> + <div class="layui-input-block" style="margin-left: 122px;"> + <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 68px;"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鍙樻洿鍘熷洜</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HReason" id="HReason"> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐢宠浜�</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HEmpName" name="HEmpName" id="HEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HEmpID" id="HEmpID" lay-verify="HEmpID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmp" id="btnHEmp" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">閮ㄩ棬</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDept" id="btnHDept" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鎽樿</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HExplanation" id="HExplanation"> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label"> 澶囨敞</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HRemark" id="HRemark"> + </div> + </div> + </div> + </div> + </div> + <!--鍒跺崟淇℃伅--> + <div class="layui-tab-item"> + <div class="layui-form-item"> + <div class="layui-row"> + <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="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly> + </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="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly> + </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="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + <div class="layui-row"> + <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="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly> + </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="HDeleteMan " id="HDeleteMan " style="background-color:#efefef4d;" readonly> + </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="HBacker " id="HBacker " style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + <div class="layui-row"> + <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="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly> + </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="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly> + </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="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly> + </div> + </div> + <div class="layui-row"> + <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="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly> + </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="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly> + </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="HBackDate" id="HBackDate" style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + + <table class="layui-hide" 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="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button> + <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>--> + </div> + </script> + </form> + </div> + </div> + </div> + <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(['index', 'form', 'laydate', 'table', 'element', 'laydate'], function () { + + //#region 鍏叡鍙橀噺 + + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laydate = layui.laydate + var option = []; + + var StatusIDVal = []; + //#endregion + + //#region 杩涘叆椤甸潰鍗冲姞杞� + + var rowdata = [{ + "HMaterID": 0, "鍣ㄥ叿": "", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HQty": 0, "HStatusID_Old": 0, "鍘熺姸鎬�": "", "HRemark": "", + "HStatusID_New":0,"鏂扮姸鎬�":"" + }]; + //鍒濆鍖� + set_ClearBill(); + + var params = getUrlVars(); + var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷 1娣诲姞 淇濆瓨 2澶嶅埗 3 缂栬緫 + var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜 + + if (linterid == null || linterid == 0) { + OperationType = 1; + $.ajax({ + url: GetWEBURL() + "/Web/GetMAXNum", + type: "GET", + data: { "HBillType": '3844' }, + success: function (d) { + $("#HInterID").val(d.data[0].HInterID); + $("#HBillNo").val(d.data[0].HBillNo); + $("#HInterID").val(d.data[0].HInterID); + } + }); + } + else {//濡傛灉淇敼鍒欒蛋涓嬮潰 + //绂佺敤缁勭粐閫夐」 + $("#HPRDORGID").attr("disabled", true); + $("#HDate").attr("disabled", true); + RoadBillMain(linterid); + $("#HInterID").val(linterid); + } + + $("#HMaker").val(sessionStorage["HUserName"]); + + //#endregion + + //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� + + //澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + //鏂板琛岃〃鏍兼暟鎹� + var NewRow = { + "HMaterID": 0, "鍣ㄥ叿": "", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HQty": 0, "HStatusID_Old": 0, "鍘熺姸鎬�": "", "HRemark": "", + "HStatusID_New": 0, "鏂扮姸鎬�": "" + }; + switch (obj.event) { + case 'btn-AddLine': + table.cache["mainTable"].push(NewRow); + option.data = table.cache["mainTable"]; + + table.render(option); + //鍒锋柊澶嶉�夋 + checkRefresh(); + break; + case 'btn-CopyLine': + var copydata = JSON.stringify(data); + if (data.length <= 0) { + layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒"); + } + else if (data.length > 1) { + layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒"); + } + else { + var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'[' + var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']' + table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂 + option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓� + table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓� + //鍒锋柊澶嶉�夋 + checkRefresh(); + } + break; + ////鍒楄缃� + //case 'set_HideColumn': + // get_HideColumn(); + // break; + } + }); + + //閫夋嫨鍙樻洿浜� + form.on('submit(btnHEmp)', function () { + get_btnHEmp(); + }); + + //閫夋嫨璐熻矗閮ㄩ棬 + form.on('submit(btnHDept)', function () { + get_btnHDept(); + }); + + //閫夋嫨璁惧涓绘。 + form.on('submit(btnHEquip)', function () { + get_btnHEquip(); + }); + + //閫夋嫨缁勭粐 + form.on('submit(btnHOrg)', function () { + get_btnHOrg(); + }); + + //閫�鍑� + form.on('submit(btnEdit)', function (data) { + if (OperationType == 1 && linterid != "") { + Pub_Close(2); + } else { + Pub_Close(1); + } + }); + + //淇濆瓨鎻愪氦 + form.on('submit(btnSave)', function (data) {//鎻愪氦 + set_AddNew(data); + }); + + //琛屽唴浜嬩欢 + table.on('tool(mainTable)', function (obj) { + set_GridDelete(obj); //琛屽唴鍒犻櫎 + set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫� + + var data = obj.data; + if (obj.event == 'HBeginDate') { + var field = $(this).data('field'); + laydate.render({ + elem: this.firstChild + , show: true //鐩存帴鏄剧ず + , closeStop: this + , done: function (nowDate) { + //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊 + data[field] = nowDate; + obj.update(data); + //鍒锋柊澶嶉�夋 + //checkRefresh(); + } + }); + } + + if (obj.event == 'HEndDate') { + var field = $(this).data('field'); + laydate.render({ + elem: this.firstChild + , show: true //鐩存帴鏄剧ず + , closeStop: this + , done: function (nowDate) { + //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊 + data[field] = nowDate; + obj.update(data); + //鍒锋柊澶嶉�夋 + //checkRefresh(); + } + }); + } + }); + + //#endregion + + //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶 + + // 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栨棩鏈� + $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); + //鍒濆鍖� 缁勭粐 + Organ(); + + set_InitGrid(); + } + + //鑾峰彇缁勭粐 + function Organ() { + //鑾峰彇鐧诲綍椤电粍缁囧垪 + var Organization = ''; + $.ajax({ + type: "get", + url: GetWEBURL() + "/Web/GetOrganizations", + success: function (result) { + if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝 + var data = result.data; + for (var i = 0; i < data.length; i++) { + Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>'; + } + $("#HPRDORGID").append(Organization); + $("#HPRDORGID").val(sessionStorage["OrganizationID"]) + form.render('select'); + } + layer.closeAll("loading"); + } + }) + } + + function set_InitGrid() { + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , limit: 500 + , height: 500 + , loading: false + , cols: [[ //琛ㄥご + { type: 'checkbox', totalRowText: '鍚堣琛�' } + , { type: 'numbers', title: '搴忓彿', totalRow: true } + , { field: 'HMaterID', title: 'HMaterID ', width: 100, hide: true } + , { field: '鍣ㄥ叿', title: '鍣ㄥ叿', edit: 'text', event: "HMaterID" }//f7 + , { field: 'HUnitID', title: 'HUnitID ', width: 100, hide: true } + , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', edit: 'text', event: "HUnitID" }//f7 + , { field: 'HQty', title: '鏁伴噺', edit: 'text' } + , { field: 'HStatusID_Old', title: 'HStatusID_Old ', width: 100, hide: true } + , { field: '鍘熺姸鎬�', title: '鍘熺姸鎬�', edit: 'text', hide: true }//f7 + , { field: 'HStatusID_New', title: 'HStatusID_New ', width: 100, hide: true } + , { field: '鏂扮姸鎬�', title: '鐘舵��', event: "HStatusID_New", edit: 'text' }//f7 + , { field: 'HRemark', title: '琛ㄤ綋澶囨敞', edit: 'text' }//f7 + , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 80 } + ]] + } + + option.data = rowdata; + table.render(option); + } + + //閮ㄩ棬 + function get_btnHDept() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '閮ㄩ棬'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../Baseset/鍩虹璧勬枡/Gy_DepartmentList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HDeptID").val(checkStatus.data[0].HItemID); + $("#HDeptName").val(checkStatus.data[0].HName); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //鐢宠浜� + function get_btnHEmp() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '鐢宠浜�'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HEmpID").val(checkStatus.data[0].HItemID); + $("#HEmpName").val(checkStatus.data[0].鑱屽憳鍚嶇О); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //琛屽唴蹇嵎閿瓫閫� + function set_GridCellCheck(obj) { + $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) { + if (event.key == "F7") { + //鍣ㄥ叿 + if (obj.event == "HMaterID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "鍣ㄥ叿鍒楄〃" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_MouldFileMainList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "鍣ㄥ叿": checkStatus.data[0].HName + , "HMaterID": checkStatus.data[0].HInterID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //璁¢噺鍗曚綅 + if (obj.event == "HUnitID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "璁¢噺鍗曚綅鍒楄〃" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_UnitList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "璁¢噺鍗曚綅": checkStatus.data[0].HName + , "HUnitID": checkStatus.data[0].HItemID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //鐘舵�� + if (obj.event == "HStatusID_New") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "鍣ㄥ叿鐘舵�佸垪琛�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../鍩虹璧勬枡/鍩虹璧勬枡/Gy_MouldStatus.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "鏂扮姸鎬�": checkStatus.data[0].鍚嶇О + , "HStatusID_New": checkStatus.data[0].HItemID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + obj.event = ""; + return false; + } + }) + } + + //琛屽唴鍒犻櫎 + 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 { + obj.del(); + option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓� + table.reload(option); + layer.close(index); + } + }); + } + } + + //澶氶�� 鍒锋柊琛ㄦ牸 + function checkRefresh() { + + } + + //淇濆瓨 + 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]) + } + } + + for (var j = 0; j < num.length; j++) { + if (num[j].HStatusID_New != StatusIDVal[j]) { + num[j].HStatusID_Old = StatusIDVal[j] + } + } + + var sMainStr = JSON.stringify(data.field); + var sSubStr = JSON.stringify(num); + //var hentryid = linteridSub;//瀛愯〃 鎺掑簭id + var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"]; + + var index = layer.load(); + $.ajax({ + type: "POST", + url: GetWEBURL() + "/Sc_MouldStatusChangeBill/MouldStatusChangeBillEdit", + async: true, + data: { "sMainSub": sMainSub }, + dataType: "json", + success: function (data) { + if (data.count == 1) { + $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true); + layer.close(index); + layer.msg("鎻愪氦鎴愬姛"); + } + 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: "娓╅Θ鎻愮ず" }); + } + }); + } + + //缂栬緫 椤甸潰璧嬪�� + function RoadBillMain(linterid)//鍔犺浇琛ㄥご + { + $.ajax({ + url: GetWEBURL() + "/Sc_MouldStatusChangeBill/cx", + type: "GET", + async: false, + data: { "HInterID": linterid }, + success: function (d) { + + //$("#HPRDORGID").val(d.data[0].HPRDORGID); + //涓昏〃 + form.val("formData", { + "HBillNo": d.data[0].鍗曟嵁鍙� + , "HInterID": d.data[0].HMainID + , "HDate": Format(new Date(d.data[0].鏃ユ湡), "yyyy-MM-dd") + , "HRemark": d.data[0].琛ㄥご澶囨敞 + , "HEmpID": d.data[0].HEmpID + , "HEmpName": d.data[0].鐢宠浜� + , "HDeptID": d.data[0].HDeptID + , "HDeptName": d.data[0].閮ㄩ棬 + , "HReason": d.data[0].鍙樻洿鍘熷洜 + , "HExplanation": d.data[0].鎽樿 + , "HMaker": d.data[0].鍒跺崟浜� + , "HMakeDate": Format(new Date(d.data[0].鍒跺崟鏃ユ湡), "yyyy-MM-dd") + }); + + //瀛愯〃 璧嬪�� + var rowdata = []; + for (var i = 0; i < d.data.length; i++) { + rowdata.push( + { + "HMaterID": d.data[i].HMaterID, "鍣ㄥ叿": d.data[i].鍣ㄥ叿, "HUnitID": d.data[i].HUnitID, "璁¢噺鍗曚綅": d.data[i].璁¢噺鍗曚綅, + "HQty": d.data[i].鏁伴噺, "HStatusID_Old": d.data[i].HStatusID_Old, "鍘熺姸鎬�": d.data[i].鍘熺姸鎬�, "HRemark": d.data[i].琛ㄤ綋澶囨敞, + "HStatusID_New": d.data[i].HStatusID_New, "鏂扮姸鎬�": d.data[i].鏂扮姸鎬� + } + ) + StatusIDVal.push(d.data[i].HStatusID_New); + } + option.data = rowdata; + table.render(option); + form.render('select'); + } + }) + } + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + + //#endregion + + }); + + + </script> +</body> +</html> \ No newline at end of file diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldStatusChangeBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldStatusChangeBillList.html" new file mode 100644 index 0000000..0edee38 --- /dev/null +++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\344\273\223\345\272\223\347\256\241\347\220\206/Sc_MouldStatusChangeBillList.html" @@ -0,0 +1,525 @@ +锘�<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>鍣ㄥ叿鐘舵�佸彉鏇村崟缁存姢</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> + <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> + <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> + <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 class="layui-collapse"> + <div class="layui-colla-item"> + <div class="layui-colla-title layui-inline"> + <div class="layui-inline"> + <span>鏇村</span> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鏃ユ湡</label> + <div class="layui-input-block"> + <input type="date" class="layui-input" id="HDate"> + </div> + </div> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch" style="margin-left:10px"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button> + + <div class="layui-colla-content"> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label">杩囨护</label> + <div class="layui-input-block"> + <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;"> + </select> + </div> + </div> + <div class="layui-inline"> + <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;"> + <option value="0" selected="selected"></option> + <option value="=">=</option> + <option value=">=">>=</option> + <option value=">">></option> + <option value="<="><=</option> + <option value="<"><</option> + <option value="<>"><></option> + <option value="7">鍖呭惈</option> + <option value="8">宸﹀寘鍚�</option> + <option value="9">鍙冲寘鍚�</option> + <option value="10">涓嶅寘鍚�</option> + </select> + </div> + <div class="layui-inline"> + <input type="text" class="layui-input" value="" name="ColContent" id="ColContent"> + </div> + </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_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Edit"><i class="layui-icon layui-icon-form"></i>缂栬緫</button> + + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button> + </div> + </script> + </form> + </div> + </div> + </div> + </div> + <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/zgqCustom/zgqCustom.js"></script> + <script> + layui.config({ + base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () { + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laypage = layui.laypage + , laydate = layui.laydate + + var sWhere = ""; + var HModName = "Sc_MouldStatusChangeBillList"; + + var params = getUrlVars(); + + //鍒ゆ柇鏄惁鏈夊弬鏁颁紶閫� + + + //鍒濆鍖栬〃鏍� + DisPlay_HideColumn(); + //鍒濆鍖栫晫闈� + set_ClearBill(); + //#endregion + + + //澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + switch (obj.event) { + //鏂板 + case 'set_AddNew': set_AddNew(); + break; + //缂栬緫 + case 'set_Edit': set_Edit(); + break; + //鍒犻櫎 + case 'set_DeleteBill': set_DeleteBill(); + break; + //鍒锋柊 + case 'get_Refresh': get_Refresh(); + break; + //閫�鍑烘寜閽� + case 'get_Exit': Pub_Close(2); + break; + //鍒楄缃� + case 'set_HideColumn': get_HideColumn(); + break; + }; + }); + + //閲嶇疆鎸夐挳 + form.on('submit(btnReSearch)', function (data) { + set_ClearQuery(); + }); + + //鏌ヨ鎸夐挳 + form.on('submit(btnSearch)', function (data) {//閫夋嫨浠撲綅 + get_FastQuery(); + }); + + //#region 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栬〃鏍� + set_InitGrid(); + //鏌ヨ + get_FastQuery(); + } + //#endregion + + + function set_InitGrid() { + $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , height: 'full-50' + , page: true + , cellMinWidth: 90 + , limit: 50 + , limits: [50, 500, 5000, 20000] + , cols: [[ + { type: 'checkbox', fixed: 'left' } + , { field: 'HMainID', title: 'HMainID', sort: true, width: 165, hide: true } + , { field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 165} + , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 } + , { field: 'HStatusID_Old', title: 'HStatusID_Old', sort: true, width: 165, hide: true } + , { field: '鍘熺姸鎬�', title: '鍘熺姸鎬�', sort: true, width: 165 } + , { field: 'HStatusID_New', title: 'HStatusID_New', sort: true, width: 165, hide: true } + , { field: '鏂扮姸鎬�', title: '鏂扮姸鎬�', sort: true, width: 165 } + , { field: 'HEmpID', title: 'HEmpID', sort: true, width: 165, hide: true } + , { field: '鐢宠浜�', title: '鐢宠浜�', sort: true, width: 165 } + , { field: 'HDeptID', title: 'HDeptID', sort: true, width: 165, hide: true } + , { field: '閮ㄩ棬', title: '閮ㄩ棬', sort: true, width: 165 } + , { field: '鍙樻洿鍘熷洜', title: '鍙樻洿鍘熷洜', sort: true, width: 165 } + , { field: '鎽樿', title: '鎽樿', sort: true, width: 165 } + , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞' } + , { field: 'HMaterID', title: 'HMaterID', sort: true, width: 165, hide: true } + , { field: '鍣ㄥ叿', title: '鍣ㄥ叿', sort: true, width: 165 } + , { field: 'HUnitID', title: 'HUnitID', sort: true, width: 165, hide: true } + , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', sort: true, width: 165 } + , { field: '骞�', title: '骞�', sort: true, width: 170 } + , { field: '鏈�', title: '鏈�', sort: true, width: 170 } + , { field: '鏁伴噺', title: '鏁伴噺', sort: true, width: 170 } + , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', sort: true, width: 165 } + , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 120, templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>" } + , { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞', width: 115 } + ]] + }; + } + + //#region 鏌ヨ + function get_Display(sWhere) { + var ajaxLoad = layer.load(); + $.ajax({ + url: GetWEBURL() + '/Sc_MouldStatusChangeBill/list', + type: "GET", + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.count == 1) { + option.data = data1.data; + table.render(option); + layer.close(ajaxLoad); + + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + //layer.alert("鏌ヨ鎴愬姛", { icon: 1 }); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + + } + //#endregion + + //#region 蹇�熻繃婊� + function get_FastQuery() { + var HDate = $("#HDate").val();;//寮�濮嬫棩鏈� + var ColName = $("#ColName").val();//澶嶉�夋 + var Comparator = $("#Comparator").val() + var ColContent = $("#ColContent").val(); + + if (ColName != 0 && Comparator != 0) { + var com = ""; + switch (Comparator) { + case "7": + com = "like'%" + ColContent + "%'"; + break; + case "8": + com = "like'%" + ColContent + "'"; + break; + case "9": + com = "like'" + ColContent + "%'"; + break; + case "10": + com = "not like'%" + ColContent + "%'"; + break; + default: + com = "" + Comparator + "'" + ColContent + "'"; + break; + } + sWhere += " and " + ColName + " " + com; + } + + if (HDate) { + sWhere += " and 鏃ユ湡 <= '" + HDate + "'"; + } + get_Display(sWhere); + sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 + } + //#endregion + + //#region 閲嶇疆杩囨护鏉′欢鏂规硶 + function set_ClearQuery() { + $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));//鏃ユ湡 + $("#btnSearch").click(); + $("#ColContent").val(""); + $("#ColName").val("0"); + $("#Comparator").val("0"); + form.render('select'); + sWhere = ""; + } + //#endregion + + //鏂板 + function set_AddNew() { + layer.open({ + type: 2 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['100%', '100%'] + , title: '鍣ㄥ叿鐘舵�佸彉鏇村崟鏂板' + , shift: 0//寮瑰嚭鍔ㄧ敾 + , content: './Sc_MouldStatusChangeBill.html?OperationType=1&linterid=' + , end: function () { + //鍒锋柊椤甸潰, + location.reload(); + } + }) + } + + // 缂栬緫 + function set_Edit() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var linterid = data[0].HMainID; + + layer.open({ + type: 2 + , area: ['100%', '100%'] + , title: '鍣ㄥ叿鐘舵�佸彉鏇村崟缂栬緫' + , shift: 0//寮瑰嚭鍔ㄧ敾 + , content: './Sc_MouldStatusChangeBill.html?OperationType=3&linterid=' + linterid +'' + , end: function () { + //鍒锋柊椤甸潰, + location.reload(); + } + }) + } else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒'); + } + } + + //#region 鍒犻櫎 + function set_DeleteBill() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var hmainid = data[0].HMainID; + layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) { + var wait = layer.load(); + //閫昏緫鍒犻櫎鏂规硶 + $.ajax({ + url: GetWEBURL() + '/Sc_MouldStatusChangeBill/Delete', + type: "GET", + data: { "HInterID": hmainid, "user": sessionStorage["HUserName"]}, + success: function (result) { + if (result.count == 1) { + layer.msg(result.Message, { icon: 1 }, function () { + // 寰楀埌frame绱㈠紩 + var index = layer.getFrameIndex(window.name); + //鍏抽棴褰撳墠frame + layer.close(wait); + //淇敼涓哄姛鍚庡埛鏂扮晫闈� + window.location.reload(); + }); + } else { + layer.alert(result.code + result.Message, { icon: 5 }); + layer.close(wait); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + layer.close(wait); + } + }); + }) + } + else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒'); + } + + } + //#endregion + + //#region 鍒锋柊 + function get_Refresh() { + set_ClearQuery(); + get_Display(sWhere); + } + //#endregion + + //闅愯棌鍒楄缃� + function get_HideColumn() { + var colName = ""; + var contentUrl = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colName += option.cols[0][i]["title"] + ","; + } + var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞 + var urlLen = urlStr.split('/'); + for (var i = 0; i < urlLen.length - 4; i++) { + contentUrl += "../"; + } + colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜 + + contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; + + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "闅愯棌鍒楄缃�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["50%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: [contentUrl, "yes"] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //鏄剧ず鍒楁暟鎹� + function DisPlay_HideColumn() { + $.ajax({ + url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', + type: "GET", + data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.data.length != 0) { + + + var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 + var titleData = ["HMainID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞� + + dataCol = data1.data[0].HGridString.split(','); + + for (var i = 0; i < option.cols[0].length - 2; i++) { + var dataCols = dataCol[i].split('|'); + //闅愯棌鍒� + if (dataCols[1] == 1) { + option.cols[0][i + 1]["hide"] = true; + } + //璁剧疆鍒楀 + if (dataCols[3] > 0) { + option.cols[0][i + 1]["width"] = dataCols[3]; + } + //璁剧疆鍐呭瀛椾綋澶у皬 + if (data1.data[0].HFontSize != 0) { + option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; + } else { + option.cols[0][i + 1]["style"] = "font-size:100%"; + } + //璁剧疆鍒楀 + //if (data1.data[0].HColumnWidth != 0) { + // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; + //} else { + // option.cols[0][i + 1]["width"] = ""; + //} + //鏄剧ず鍒� + if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { + option.cols[0][i + 1]["hide"] = false; + } + //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) + switch (dataCols[2]) { + case "L": + option.cols[0][i + 1]["align"] = "left"; + break; + case "M": + option.cols[0][i + 1]["align"] = "center"; + break; + case "R": + option.cols[0][i + 1]["align"] = "right"; + break; + } + } + + //鍙栨秷鍐荤粨鍒� + for (var i = 1; i < option.cols[0].length - 1; i++) { + if (option.cols[0][i]["fixed"] != null) { + option.cols[0][i]["fixed"] = null; + } + else { + break; + } + } + //鍐荤粨鍒� + if (data1.data[0].HFixCols != 0) { + for (var i = 0; i < data1.data[0].HFixCols; i++) { + if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { + data1.data[0].HFixCols += 1; + } + option.cols[0][i + 1]["fixed"] = "left"; + } + } + table.render(option); + } else { + table.render(option); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }) + } + + //鍒楁槑鏄剧ず涓嬫媺妗� + function ColFilter() { + var Organization = '<option value="0" selected="selected" ></option>'; + for (var i = 1; i < option.cols[0].length; i++) { + if (option.cols[0][i].hide != true) { + Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>'; + } + } + $("#ColName").empty(); + $("#ColName").append(Organization); + form.render('select'); + } + + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + //#endregion + + //浠ヤ笂鏄痩ayui妯″潡 + }); + + </script> + +</body> +</html> \ No newline at end of file diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\212\266\346\200\201/Sb_EquipStatusChangeBill.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\212\266\346\200\201/Sb_EquipStatusChangeBill.html" new file mode 100644 index 0000000..ed9dc0e --- /dev/null +++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\212\266\346\200\201/Sb_EquipStatusChangeBill.html" @@ -0,0 +1,762 @@ +锘�<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <title>璁惧鐘舵�佸彉鏇村崟</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> + <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> + <style> + .main-btn { /*澶撮儴涓绘寜閽�*/ + padding: 0 2px; /*璋冩暣鎸夐挳宸﹀彸绌洪殭澶у皬*/ + height: 30px; + line-height: 30px; + } + + .btn-title { + font-size: 16px; + } + /* 闃叉涓嬫媺妗嗙殑涓嬫媺鍒楄〃琚殣钘�---蹇呴』璁剧疆--- */ + .layui-table-cell { + overflow: visible !important; + } + /* 浣垮緱涓嬫媺妗嗕笌鍗曞厓鏍煎垰濂藉悎閫� */ + td .layui-form-select { + margin-top: -10px; + margin-left: -15px; + margin-right: -15px; + } + + .layui-form-item .layui-inline { + margin-top: 5px; + margin-bottom: 5px; + margin-right: 0px; + } + + .layui-form-label { + width: 25%; + } + </style> + +</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="btnEdit" id="btnEdit">閫�鍑�</button> + </div> + <div class="layui-tab" lay-filter="tab-POStockInBill"> + <ul class="layui-tab-title" lay-filter="tab-all"> + <li lay-id="1" style="padding:1px;" class="layui-this">鍩烘湰淇℃伅</li> + <li lay-id="2" style="padding:1px;">鍒跺崟淇℃伅</li> + </ul> + <div class="layui-tab-content"> + <!--鍩烘湰淇℃伅--> + <div class="layui-tab-item layui-show"> + <div class="layui-form-item" style="padding-top: 10px;"> + <div class="layui-row"> + <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="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly> + <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;">鏃ユ湡</label> + <div class="layui-input-block" style="margin-left: 122px;"> + <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 68px;"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鍙樻洿鍘熷洜</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HReason" id="HReason"> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐢宠浜�</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HEmpName" name="HEmpName" id="HEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HEmpID" id="HEmpID" lay-verify="HEmpID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmp" id="btnHEmp" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">閮ㄩ棬</label> + <div class="layui-input-block" style="margin-left: 77px;"> + <input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> + <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0"> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDept" id="btnHDept" style="padding: 0 10px;float: right;margin-right: 3px;"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鎽樿</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HExplanation" id="HExplanation"> + </div> + </div> + </div> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label"> 澶囨敞</label> + <div class="layui-input-block" style="margin-left: 120px;"> + <input type="text" class="layui-input" name="HRemark" id="HRemark"> + </div> + </div> + </div> + </div> + </div> + <!--鍒跺崟淇℃伅--> + <div class="layui-tab-item"> + <div class="layui-form-item"> + <div class="layui-row"> + <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="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly> + </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="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly> + </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="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + <div class="layui-row"> + <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="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly> + </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="HDeleteMan " id="HDeleteMan " style="background-color:#efefef4d;" readonly> + </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="HBacker " id="HBacker " style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + <div class="layui-row"> + <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="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly> + </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="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly> + </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="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly> + </div> + </div> + <div class="layui-row"> + <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="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly> + </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="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly> + </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="HBackDate" id="HBackDate" style="background-color:#efefef4d;" readonly> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + + <table class="layui-hide" 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="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button> + <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>--> + </div> + </script> + </form> + </div> + </div> + </div> + <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(['index', 'form', 'laydate', 'table', 'element', 'laydate'], function () { + + //#region 鍏叡鍙橀噺 + + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laydate = layui.laydate + var option = []; + + var StatusIDVal = []; + //#endregion + + //#region 杩涘叆椤甸潰鍗冲姞杞� + + var rowdata = [{ + "HEquipID": 0, "璁惧": "", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HQty": 0, "HStatusID_Old": 0, "鍘熺姸鎬�": "", "HRemark": "", + "HStatusID_New":0,"鏂扮姸鎬�":"" + }]; + //鍒濆鍖� + set_ClearBill(); + + var params = getUrlVars(); + var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷 1娣诲姞 淇濆瓨 2澶嶅埗 3 缂栬緫 + var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜 + + if (linterid == null || linterid == 0) { + OperationType = 1; + $.ajax({ + url: GetWEBURL() + "/Web/GetMAXNum", + type: "GET", + data: { "HBillType": '3916' }, + success: function (d) { + $("#HInterID").val(d.data[0].HInterID); + $("#HBillNo").val(d.data[0].HBillNo); + $("#HInterID").val(d.data[0].HInterID); + } + }); + } + else {//濡傛灉淇敼鍒欒蛋涓嬮潰 + //绂佺敤缁勭粐閫夐」 + $("#HPRDORGID").attr("disabled", true); + $("#HDate").attr("disabled", true); + RoadBillMain(linterid); + $("#HInterID").val(linterid); + } + + $("#HMaker").val(sessionStorage["HUserName"]); + + //#endregion + + //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� + + //澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + //鏂板琛岃〃鏍兼暟鎹� + var NewRow = { + "HEquipID": 0, "璁惧": "", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HQty": 0, "HStatusID_Old": 0, "鍘熺姸鎬�": "", "HRemark": "", + "HStatusID_New": 0, "鏂扮姸鎬�": "" + }; + switch (obj.event) { + case 'btn-AddLine': + table.cache["mainTable"].push(NewRow); + option.data = table.cache["mainTable"]; + + table.render(option); + //鍒锋柊澶嶉�夋 + checkRefresh(); + break; + case 'btn-CopyLine': + var copydata = JSON.stringify(data); + if (data.length <= 0) { + layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒"); + } + else if (data.length > 1) { + layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒"); + } + else { + var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'[' + var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']' + table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂 + option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓� + table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓� + //鍒锋柊澶嶉�夋 + checkRefresh(); + } + break; + ////鍒楄缃� + //case 'set_HideColumn': + // get_HideColumn(); + // break; + } + }); + + //閫夋嫨鍙樻洿浜� + form.on('submit(btnHEmp)', function () { + get_btnHEmp(); + }); + + //閫夋嫨璐熻矗閮ㄩ棬 + form.on('submit(btnHDept)', function () { + get_btnHDept(); + }); + + //閫夋嫨璁惧涓绘。 + form.on('submit(btnHEquip)', function () { + get_btnHEquip(); + }); + + //閫夋嫨缁勭粐 + form.on('submit(btnHOrg)', function () { + get_btnHOrg(); + }); + + //閫�鍑� + form.on('submit(btnEdit)', function (data) { + if (OperationType == 1 && linterid != "") { + Pub_Close(2); + } else { + Pub_Close(1); + } + }); + + //淇濆瓨鎻愪氦 + form.on('submit(btnSave)', function (data) {//鎻愪氦 + set_AddNew(data); + }); + + //琛屽唴浜嬩欢 + table.on('tool(mainTable)', function (obj) { + set_GridDelete(obj); //琛屽唴鍒犻櫎 + set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫� + + var data = obj.data; + if (obj.event == 'HBeginDate') { + var field = $(this).data('field'); + laydate.render({ + elem: this.firstChild + , show: true //鐩存帴鏄剧ず + , closeStop: this + , done: function (nowDate) { + //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊 + data[field] = nowDate; + obj.update(data); + //鍒锋柊澶嶉�夋 + //checkRefresh(); + } + }); + } + + if (obj.event == 'HEndDate') { + var field = $(this).data('field'); + laydate.render({ + elem: this.firstChild + , show: true //鐩存帴鏄剧ず + , closeStop: this + , done: function (nowDate) { + //鏃堕棿閫夋嫨瀹屾垚锛岃鏁版嵁鏇存柊 + data[field] = nowDate; + obj.update(data); + //鍒锋柊澶嶉�夋 + //checkRefresh(); + } + }); + } + }); + + //#endregion + + //#region 姝ら〉闈㈡墍鏈夌殑鏂规硶 + + // 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栨棩鏈� + $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); + //鍒濆鍖� 缁勭粐 + Organ(); + + set_InitGrid(); + } + + //鑾峰彇缁勭粐 + function Organ() { + //鑾峰彇鐧诲綍椤电粍缁囧垪 + var Organization = ''; + $.ajax({ + type: "get", + url: GetWEBURL() + "/Web/GetOrganizations", + success: function (result) { + if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝 + var data = result.data; + for (var i = 0; i < data.length; i++) { + Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>'; + } + $("#HPRDORGID").append(Organization); + $("#HPRDORGID").val(sessionStorage["OrganizationID"]) + form.render('select'); + } + layer.closeAll("loading"); + } + }) + } + + function set_InitGrid() { + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , limit: 500 + , height: 500 + , loading: false + , cols: [[ //琛ㄥご + { type: 'checkbox', totalRowText: '鍚堣琛�' } + , { type: 'numbers', title: '搴忓彿', totalRow: true } + , { field: 'HEquipID', title: 'HEquipID ', width: 100, hide: true } + , { field: '璁惧', title: '璁惧', edit: 'text', event: "HEquipID" }//f7 + , { field: 'HUnitID', title: 'HUnitID ', width: 100, hide: true } + , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', edit: 'text', event: "HUnitID" }//f7 + , { field: 'HQty', title: '鏁伴噺', edit: 'text' } + , { field: 'HStatusID_Old', title: 'HStatusID_Old ', width: 100, hide: true } + , { field: '鍘熺姸鎬�', title: '鍘熺姸鎬�', edit: 'text', hide: true }//f7 + , { field: 'HStatusID_New', title: 'HStatusID_New ', width: 100, hide: true } + , { field: '鏂扮姸鎬�', title: '鐘舵��', event: "HStatusID_New", edit: 'text' }//f7 + , { field: 'HRemark', title: '琛ㄤ綋澶囨敞', edit: 'text' }//f7 + , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 80 } + ]] + } + + option.data = rowdata; + table.render(option); + } + + //閮ㄩ棬 + function get_btnHDept() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '閮ㄩ棬'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../Baseset/鍩虹璧勬枡/Gy_DepartmentList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HDeptID").val(checkStatus.data[0].HItemID); + $("#HDeptName").val(checkStatus.data[0].HName); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //鐢宠浜� + function get_btnHEmp() { + layer.open({ + type: 2//寮圭獥绫诲瀷 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['90%', '90%']//澶у皬 + , title: '鐢宠浜�'//鏍囬 + , shift: 2//寮瑰嚭鍔ㄧ敾 + , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html', 'yes'] + , btn: ['纭畾', '鍙栨秷'] + , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟 + var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + //鑾峰彇鏁版嵁 + $("#HEmpID").val(checkStatus.data[0].HItemID); + $("#HEmpName").val(checkStatus.data[0].鑱屽憳鍚嶇О); + + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , btn2: function (index, layero) { } + }) + } + + //琛屽唴蹇嵎閿瓫閫� + function set_GridCellCheck(obj) { + $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) { + if (event.key == "F7") { + //璁惧 + if (obj.event == "HEquipID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "璁惧鍒楄〃" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_EquipFileBillMainList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "璁惧": checkStatus.data[0].HName + , "HEquipID": checkStatus.data[0].HInterID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //璁¢噺鍗曚綅 + if (obj.event == "HUnitID") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "璁¢噺鍗曚綅鍒楄〃" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../Baseset/鍩虹璧勬枡/Gy_UnitList.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "璁¢噺鍗曚綅": checkStatus.data[0].HName + , "HUnitID": checkStatus.data[0].HItemID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //鐘舵�� + if (obj.event == "HStatusID_New") { + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "璁惧鐘舵�佸垪琛�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["90%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: ['../../鍩虹璧勬枡/鍩虹璧勬枡/Gy_EquipStatus.html', 'yes'] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鎸夐挳涓� 鐨勫洖璋� + var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 + var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� + + if (checkStatus.data.length != 1) { + return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + } + + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + obj.update({ + "鏂扮姸鎬�": checkStatus.data[0].鍚嶇О + , "HStatusID_New": checkStatus.data[0].HItemID + }) + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + obj.event = ""; + return false; + } + }) + } + + //琛屽唴鍒犻櫎 + 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 { + obj.del(); + option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓� + table.reload(option); + layer.close(index); + } + }); + } + } + + //澶氶�� 鍒锋柊琛ㄦ牸 + function checkRefresh() { + + } + + //淇濆瓨 + 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]) + } + } + + for (var j = 0; j < num.length; j++) { + if (num[j].HStatusID_New != StatusIDVal[j]) { + num[j].HStatusID_Old = StatusIDVal[j] + } + } + + var sMainStr = JSON.stringify(data.field); + var sSubStr = JSON.stringify(num); + //var hentryid = linteridSub;//瀛愯〃 鎺掑簭id + var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"]; + + var index = layer.load(); + $.ajax({ + type: "POST", + url: GetWEBURL() + "/Sb_EquipStatusChangeBill/EquipStatusChangeBillEdit", + async: true, + data: { "sMainSub": sMainSub }, + dataType: "json", + success: function (data) { + if (data.count == 1) { + $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true); + layer.close(index); + layer.msg("鎻愪氦鎴愬姛"); + } + 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: "娓╅Θ鎻愮ず" }); + } + }); + } + + //缂栬緫 椤甸潰璧嬪�� + function RoadBillMain(linterid)//鍔犺浇琛ㄥご + { + $.ajax({ + url: GetWEBURL() + "/Sb_EquipStatusChangeBill/cx", + type: "GET", + async: false, + data: { "HInterID": linterid }, + success: function (d) { + + //$("#HPRDORGID").val(d.data[0].HPRDORGID); + //涓昏〃 + form.val("formData", { + "HBillNo": d.data[0].鍗曟嵁鍙� + , "HInterID": d.data[0].HMainID + , "HDate": Format(new Date(d.data[0].鏃ユ湡), "yyyy-MM-dd") + , "HRemark": d.data[0].琛ㄥご澶囨敞 + , "HEmpID": d.data[0].HEmpID + , "HEmpName": d.data[0].鐢宠浜� + , "HDeptID": d.data[0].HDeptID + , "HDeptName": d.data[0].閮ㄩ棬 + , "HReason": d.data[0].鍙樻洿鍘熷洜 + , "HExplanation": d.data[0].鎽樿 + , "HMaker": d.data[0].鍒跺崟浜� + , "HMakeDate": Format(new Date(d.data[0].鍒跺崟鏃ユ湡), "yyyy-MM-dd") + }); + + //瀛愯〃 璧嬪�� + var rowdata = []; + for (var i = 0; i < d.data.length; i++) { + rowdata.push( + { + "HEquipID": d.data[i].HEquipID, "璁惧": d.data[i].璁惧, "HUnitID": d.data[i].HUnitID, "璁¢噺鍗曚綅": d.data[i].璁¢噺鍗曚綅, + "HQty": d.data[i].鏁伴噺, "HStatusID_Old": d.data[i].HStatusID_Old, "鍘熺姸鎬�": d.data[i].鍘熺姸鎬�, "HRemark": d.data[i].琛ㄤ綋澶囨敞, + "HStatusID_New": d.data[i].HStatusID_New, "鏂扮姸鎬�": d.data[i].鏂扮姸鎬� + } + ) + StatusIDVal.push(d.data[i].HStatusID_New); + } + option.data = rowdata; + table.render(option); + form.render('select'); + } + }) + } + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + + //#endregion + + }); + + + </script> +</body> +</html> \ No newline at end of file diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\212\266\346\200\201/Sb_EquipStatusChangeBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\212\266\346\200\201/Sb_EquipStatusChangeBillList.html" new file mode 100644 index 0000000..215ec47 --- /dev/null +++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\347\212\266\346\200\201/Sb_EquipStatusChangeBillList.html" @@ -0,0 +1,525 @@ +锘�<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>璁惧鐘舵�佸彉鏇村崟缁存姢</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> + <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> + <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> + <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 class="layui-collapse"> + <div class="layui-colla-item"> + <div class="layui-colla-title layui-inline"> + <div class="layui-inline"> + <span>鏇村</span> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鏃ユ湡</label> + <div class="layui-input-block"> + <input type="date" class="layui-input" id="HDate"> + </div> + </div> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch" style="margin-left:10px"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> + </button> + <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button> + + <div class="layui-colla-content"> + <div class="layui-row"> + <div class="layui-inline"> + <label class="layui-form-label">杩囨护</label> + <div class="layui-input-block"> + <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;"> + </select> + </div> + </div> + <div class="layui-inline"> + <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;"> + <option value="0" selected="selected"></option> + <option value="=">=</option> + <option value=">=">>=</option> + <option value=">">></option> + <option value="<="><=</option> + <option value="<"><</option> + <option value="<>"><></option> + <option value="7">鍖呭惈</option> + <option value="8">宸﹀寘鍚�</option> + <option value="9">鍙冲寘鍚�</option> + <option value="10">涓嶅寘鍚�</option> + </select> + </div> + <div class="layui-inline"> + <input type="text" class="layui-input" value="" name="ColContent" id="ColContent"> + </div> + </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_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Edit"><i class="layui-icon layui-icon-form"></i>缂栬緫</button> + + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button> + </div> + </script> + </form> + </div> + </div> + </div> + </div> + <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/zgqCustom/zgqCustom.js"></script> + <script> + layui.config({ + base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index', //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () { + var $ = layui.$ + , admin = layui.admin + , layer = layui.layer + , table = layui.table + , form = layui.form + , element = layui.element + , laypage = layui.laypage + , laydate = layui.laydate + + var sWhere = ""; + var HModName = "Sb_EquipStatusChangeBillList"; + + var params = getUrlVars(); + + //鍒ゆ柇鏄惁鏈夊弬鏁颁紶閫� + + + //鍒濆鍖栬〃鏍� + DisPlay_HideColumn(); + //鍒濆鍖栫晫闈� + set_ClearBill(); + //#endregion + + + //澶村伐鍏锋爮浜嬩欢 + table.on('toolbar(mainTable)', function (obj) { + switch (obj.event) { + //鏂板 + case 'set_AddNew': set_AddNew(); + break; + //缂栬緫 + case 'set_Edit': set_Edit(); + break; + //鍒犻櫎 + case 'set_DeleteBill': set_DeleteBill(); + break; + //鍒锋柊 + case 'get_Refresh': get_Refresh(); + break; + //閫�鍑烘寜閽� + case 'get_Exit': Pub_Close(2); + break; + //鍒楄缃� + case 'set_HideColumn': get_HideColumn(); + break; + }; + }); + + //閲嶇疆鎸夐挳 + form.on('submit(btnReSearch)', function (data) { + set_ClearQuery(); + }); + + //鏌ヨ鎸夐挳 + form.on('submit(btnSearch)', function (data) {//閫夋嫨浠撲綅 + get_FastQuery(); + }); + + //#region 鍒濆鍖栫晫闈� + function set_ClearBill() { + //鍒濆鍖栬〃鏍� + set_InitGrid(); + //鏌ヨ + get_FastQuery(); + } + //#endregion + + + function set_InitGrid() { + $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , height: 'full-50' + , page: true + , cellMinWidth: 90 + , limit: 50 + , limits: [50, 500, 5000, 20000] + , cols: [[ + { type: 'checkbox', fixed: 'left' } + , { field: 'HMainID', title: 'HMainID', sort: true, width: 165, hide: true } + , { field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 165} + , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 } + , { field: 'HStatusID_Old', title: 'HStatusID_Old', sort: true, width: 165, hide: true } + , { field: '鍘熺姸鎬�', title: '鍘熺姸鎬�', sort: true, width: 165 } + , { field: 'HStatusID_New', title: 'HStatusID_New', sort: true, width: 165, hide: true } + , { field: '鏂扮姸鎬�', title: '鏂扮姸鎬�', sort: true, width: 165 } + , { field: 'HEmpID', title: 'HEmpID', sort: true, width: 165, hide: true } + , { field: '鐢宠浜�', title: '鐢宠浜�', sort: true, width: 165 } + , { field: 'HDeptID', title: 'HDeptID', sort: true, width: 165, hide: true } + , { field: '閮ㄩ棬', title: '閮ㄩ棬', sort: true, width: 165 } + , { field: '鍙樻洿鍘熷洜', title: '鍙樻洿鍘熷洜', sort: true, width: 165 } + , { field: '鎽樿', title: '鎽樿', sort: true, width: 165 } + , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞' } + , { field: 'HEquipID', title: 'HEquipID', sort: true, width: 165, hide: true } + , { field: '璁惧', title: '璁惧', sort: true, width: 165 } + , { field: 'HUnitID', title: 'HUnitID', sort: true, width: 165, hide: true } + , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', sort: true, width: 165 } + , { field: '骞�', title: '骞�', sort: true, width: 170 } + , { field: '鏈�', title: '鏈�', sort: true, width: 170 } + , { field: '鏁伴噺', title: '鏁伴噺', sort: true, width: 170 } + , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', sort: true, width: 165 } + , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 120, templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>" } + , { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞', width: 115 } + ]] + }; + } + + //#region 鏌ヨ + function get_Display(sWhere) { + var ajaxLoad = layer.load(); + $.ajax({ + url: GetWEBURL() + '/Sb_EquipStatusChangeBill/list', + type: "GET", + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.count == 1) { + option.data = data1.data; + table.render(option); + layer.close(ajaxLoad); + + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + //layer.alert("鏌ヨ鎴愬姛", { icon: 1 }); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + + } + //#endregion + + //#region 蹇�熻繃婊� + function get_FastQuery() { + var HDate = $("#HDate").val();;//寮�濮嬫棩鏈� + var ColName = $("#ColName").val();//澶嶉�夋 + var Comparator = $("#Comparator").val() + var ColContent = $("#ColContent").val(); + + if (ColName != 0 && Comparator != 0) { + var com = ""; + switch (Comparator) { + case "7": + com = "like'%" + ColContent + "%'"; + break; + case "8": + com = "like'%" + ColContent + "'"; + break; + case "9": + com = "like'" + ColContent + "%'"; + break; + case "10": + com = "not like'%" + ColContent + "%'"; + break; + default: + com = "" + Comparator + "'" + ColContent + "'"; + break; + } + sWhere += " and " + ColName + " " + com; + } + + if (HDate) { + sWhere += " and 鏃ユ湡 <= '" + HDate + "'"; + } + get_Display(sWhere); + sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 + } + //#endregion + + //#region 閲嶇疆杩囨护鏉′欢鏂规硶 + function set_ClearQuery() { + $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));//鏃ユ湡 + $("#btnSearch").click(); + $("#ColContent").val(""); + $("#ColName").val("0"); + $("#Comparator").val("0"); + form.render('select'); + sWhere = ""; + } + //#endregion + + //鏂板 + function set_AddNew() { + layer.open({ + type: 2 + , skin: 'layui-layer-rim' //鍔犱笂杈规 + , area: ['100%', '100%'] + , title: '璁惧鐘舵�佸彉鏇村崟鏂板' + , shift: 0//寮瑰嚭鍔ㄧ敾 + , content: './Sb_EquipStatusChangeBill.html?OperationType=1&linterid=' + , end: function () { + //鍒锋柊椤甸潰, + location.reload(); + } + }) + } + + // 缂栬緫 + function set_Edit() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var linterid = data[0].HMainID; + + layer.open({ + type: 2 + , area: ['100%', '100%'] + , title: '璁惧鐘舵�佸彉鏇村崟缂栬緫' + , shift: 0//寮瑰嚭鍔ㄧ敾 + , content: './Sb_EquipStatusChangeBill.html?OperationType=3&linterid=' + linterid +'' + , end: function () { + //鍒锋柊椤甸潰, + location.reload(); + } + }) + } else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒'); + } + } + + //#region 鍒犻櫎 + function set_DeleteBill() { + var checkStatus = table.checkStatus('mainTable') + , data = checkStatus.data; + if (checkStatus.data.length === 1) { + var hmainid = data[0].HMainID; + layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) { + var wait = layer.load(); + //閫昏緫鍒犻櫎鏂规硶 + $.ajax({ + url: GetWEBURL() + '/Sb_EquipStatusChangeBill/Delete', + type: "GET", + data: { "HInterID": hmainid, "user": sessionStorage["HUserName"]}, + success: function (result) { + if (result.count == 1) { + layer.msg(result.Message, { icon: 1 }, function () { + // 寰楀埌frame绱㈠紩 + var index = layer.getFrameIndex(window.name); + //鍏抽棴褰撳墠frame + layer.close(wait); + //淇敼涓哄姛鍚庡埛鏂扮晫闈� + window.location.reload(); + }); + } else { + layer.alert(result.code + result.Message, { icon: 5 }); + layer.close(wait); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + layer.close(wait); + } + }); + }) + } + else { + layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒'); + } + + } + //#endregion + + //#region 鍒锋柊 + function get_Refresh() { + set_ClearQuery(); + get_Display(sWhere); + } + //#endregion + + //闅愯棌鍒楄缃� + function get_HideColumn() { + var colName = ""; + var contentUrl = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colName += option.cols[0][i]["title"] + ","; + } + var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞 + var urlLen = urlStr.split('/'); + for (var i = 0; i < urlLen.length - 4; i++) { + contentUrl += "../"; + } + colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜 + + contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName; + + layer.open({ + type: 2 + , skin: "layui-layer-rim" //鍔犱笂杈规 + , title: "闅愯棌鍒楄缃�" //鏍囬 + , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 + , shift: 2 //寮瑰嚭鍔ㄧ敾 + , area: ["50%", "90%"] //绐椾綋澶у皬 + , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� + , content: [contentUrl, "yes"] + , btn: ["纭畾", "鍙栨秷"] + , btn1: function (index, laero) { + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + + //鏄剧ず鍒楁暟鎹� + function DisPlay_HideColumn() { + $.ajax({ + url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', + type: "GET", + data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.data.length != 0) { + + + var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 + var titleData = ["HMainID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞� + + dataCol = data1.data[0].HGridString.split(','); + + for (var i = 0; i < option.cols[0].length - 2; i++) { + var dataCols = dataCol[i].split('|'); + //闅愯棌鍒� + if (dataCols[1] == 1) { + option.cols[0][i + 1]["hide"] = true; + } + //璁剧疆鍒楀 + if (dataCols[3] > 0) { + option.cols[0][i + 1]["width"] = dataCols[3]; + } + //璁剧疆鍐呭瀛椾綋澶у皬 + if (data1.data[0].HFontSize != 0) { + option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; + } else { + option.cols[0][i + 1]["style"] = "font-size:100%"; + } + //璁剧疆鍒楀 + //if (data1.data[0].HColumnWidth != 0) { + // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; + //} else { + // option.cols[0][i + 1]["width"] = ""; + //} + //鏄剧ず鍒� + if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { + option.cols[0][i + 1]["hide"] = false; + } + //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) + switch (dataCols[2]) { + case "L": + option.cols[0][i + 1]["align"] = "left"; + break; + case "M": + option.cols[0][i + 1]["align"] = "center"; + break; + case "R": + option.cols[0][i + 1]["align"] = "right"; + break; + } + } + + //鍙栨秷鍐荤粨鍒� + for (var i = 1; i < option.cols[0].length - 1; i++) { + if (option.cols[0][i]["fixed"] != null) { + option.cols[0][i]["fixed"] = null; + } + else { + break; + } + } + //鍐荤粨鍒� + if (data1.data[0].HFixCols != 0) { + for (var i = 0; i < data1.data[0].HFixCols; i++) { + if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { + data1.data[0].HFixCols += 1; + } + option.cols[0][i + 1]["fixed"] = "left"; + } + } + table.render(option); + } else { + table.render(option); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }) + } + + //鍒楁槑鏄剧ず涓嬫媺妗� + function ColFilter() { + var Organization = '<option value="0" selected="selected" ></option>'; + for (var i = 1; i < option.cols[0].length; i++) { + if (option.cols[0][i].hide != true) { + Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>'; + } + } + $("#ColName").empty(); + $("#ColName").append(Organization); + form.render('select'); + } + + + //鑾峰彇鍙傛暟 + function getUrlVars() { + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + return vars; + } + //#endregion + + //浠ヤ笂鏄痩ayui妯″潡 + }); + + </script> + +</body> +</html> \ No newline at end of file -- Gitblit v1.9.1