New file |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <meta charset="utf-8" /> |
| | | <title>ææè®¡åæ¥è¡¨(éè´è®¢å维度)</title> |
| | | <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> |
| | | <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> |
| | | <script src="../../../layuiadmin/layui/layui.js"></script> |
| | | <script src="../../../layuiadmin/Scripts/json2.js"></script> |
| | | <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script> |
| | | <script src="../../../layuiadmin/Scripts/webConfig.js"></script> |
| | | <script src="../../../layuiadmin/PubCustom.js"></script> |
| | | |
| | | </head> |
| | | <body> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card" style="padding: 1px"> |
| | | <div class="layui-card-body" style="padding: 1px;"> |
| | | <form class="layui-form" action="" lay-filter="component-form-group"> |
| | | <div 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" style="width: 85px;">ç»ç»</label> |
| | | <div class="layui-input-block" style="margin-left: 120px; width: 185px;"> |
| | | <select name="HORGID" id="HORGID" lay-verify="HORGID"> |
| | | <!--å¨ææ¸²æç»ç»--> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">æææ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="date" class="layui-input" lay-verify="HBEGINDATE" name="HBEGINDATE" id="HBEGINDATE" style="padding-left: 78px;"> |
| | | </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="HENDDATE" name="HENDDATE" id="HENDDATE" style="padding-left: 78px;"> |
| | | </div> |
| | | </div> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">æ¥è¯¢</button> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch">éç½®</button> |
| | | <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;"> |
| | | <div class="layui-row" style="margin-top:10px;"> |
| | | <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="hidden" class="layui-input" lay-verify="HMATERIALID" name="HMATERIALID" id="HMATERIALID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <input type="text" class="layui-input" lay-verify="HMATERIALNAME" name="HMATERIALNAME" id="HMATERIALNAME" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMATERIALID" id="btnHMATERIALID" 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="hidden" class="layui-input" lay-verify="HSUPPLIERID" name="HSUPPLIERID" id="HSUPPLIERID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <input type="text" class="layui-input" lay-verify="HSUPPLIERNAME" name="HSUPPLIERNAME" id="HSUPPLIERNAME" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSUPPLIERID" id="btnHSUPPLIERID" 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;">éæ±åå·</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HXQD" id="HXQD"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row" style="margin-top:10px;"> |
| | | <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="HPURORDERNO" id="HPURORDERNO"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="" id="mainTable" lay-filter="mainTable"></table> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | </html> |
| | | <script> |
| | | var treeCkData = { id: 0 }; |
| | | var TagId = ""; |
| | | var TagParentId = ""; |
| | | layui.config({ |
| | | base: '../../../layuiadmin/' //éæèµæºæå¨è·¯å¾ |
| | | }).extend({ |
| | | index: 'lib/index', //主å
¥å£æ¨¡å |
| | | }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate', 'util'], function () { |
| | | //#region å
¬ç¨åé |
| | | var $ = layui.$ |
| | | , admin = layui.admin |
| | | , layer = layui.layer |
| | | , table = layui.table |
| | | , form = layui.form |
| | | , element = layui.element |
| | | , laypage = layui.laypage |
| | | , laydate = layui.laydate |
| | | , util = layui.util |
| | | , tree = layui.tree |
| | | , util = layui.util |
| | | var sWhere = ""; |
| | | var option = []; |
| | | //#endregion |
| | | |
| | | //#region è¿å
¥é¡µé¢å³å è½½ |
| | | |
| | | //åå§åçé¢ |
| | | set_ClearBill(); |
| | | |
| | | //#endregion |
| | | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | | |
| | | //#region 产åç¼ç |
| | | form.on('submit(btnHMATERIALID)', function (data) { |
| | | btnHMATERIALID(); |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region ä¾åºå |
| | | form.on('submit(btnHSUPPLIERID)', function (data) { |
| | | btnHSUPPLIERID(); |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region éç½®æé® |
| | | form.on('submit(btnReSearch)', function (data) { |
| | | set_ClearQuery(); |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region æ¥è¯¢æé® |
| | | form.on('submit(btnSearch)', function (data) { |
| | | get_FastQuery(2); |
| | | }); |
| | | //#endregion |
| | | |
| | | //#endregion |
| | | |
| | | //#region æ¬é¡µé¢è¢«è°ç¨çæææ¹æ³ |
| | | |
| | | //#region åå§åçé¢ |
| | | function set_ClearBill() { |
| | | //åå§åæ¥æ |
| | | $("#HBEGINDATE").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd")); |
| | | $("#HENDDATE").val(Format(new Date(), "yyyy-MM-dd")); |
| | | //ç产ç»ç»å è½½ |
| | | Organ(); |
| | | //åå§åè¡¨æ ¼ |
| | | set_InitGrid(); |
| | | //å¿«éè¿æ»¤ |
| | | //get_FastQuery(1); |
| | | } |
| | | //#endregion |
| | | |
| | | //#region åå§åè¡¨æ ¼æ¹æ³ |
| | | function set_InitGrid() { |
| | | var columns = []; |
| | | var myDate = new Date(); |
| | | var yyyy = myDate.getFullYear(); |
| | | var MM = myDate.getMonth() + 1; |
| | | var dd = myDate.getDate(); |
| | | var SumMonth = 31; //卿䏤æä¹å·® new Date(yyyy, MM, 0).getDate() |
| | | |
| | | |
| | | columns.push({ type: 'checkbox', fixed: 'left' }); |
| | | columns.push({ field: 'åæ®å·', title: 'éè´ç»ç»' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'ç©æåç§°' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'ç©æè§æ ¼' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'ä¾åºå' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'å计' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'éè´è®¢åå·' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'éæ±åå·' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'æè¦' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: '夿³¨' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'éè´å' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'ç©æç¼ç ' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: '计éåä½' }); |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'æææææ°é' }); |
| | | for (var i = 0; i <= (SumMonth - dd); i++) { |
| | | columns.push({ field: Format(yyyy + '/' + (MM - 1) + '/' + (dd + i), 'yyyy-MM-dd'), title: Format(yyyy + '/' + (MM - 1) + '/' + (dd + i), 'MM.dd'), edit: 'text', width: 70 })//0 |
| | | } |
| | | for (var i = 1; i < dd; i++) { |
| | | columns.push({ field: Format(yyyy + '/' + MM + '/' + i, 'yyyy-MM-dd'), title: Format(yyyy + '/' + MM + '/' + i, 'MM.dd'), edit: 'text', width: 70 })//0 |
| | | } |
| | | columns.push({ field: 'hmainid', title: 'ææè®¡åå计' }); |
| | | |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 'full-50' |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | , loading: false |
| | | , cols: [columns] |
| | | }; |
| | | table.render(option); |
| | | } |
| | | //#endregion |
| | | |
| | | //è·åç»ç» |
| | | 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>'; |
| | | } |
| | | $("#HORGID").append(Organization); |
| | | $("#HORGID").val(sessionStorage["OrganizationID"]) |
| | | form.render('select'); |
| | | } |
| | | layer.closeAll("loading"); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //#region æ¥è¯¢ |
| | | function get_Display(sWhere) { |
| | | var ajaxLoad = layer.load(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Sc_WorkBillSortBill/Sc_WorkBillSortBillList', |
| | | type: "GET", |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | option.data = result.data; |
| | | table.render(option); |
| | | layer.close(ajaxLoad); |
| | | //layer.alert("æ¥è¯¢æå", { icon: 1 }); |
| | | } else { |
| | | layer.close(ajaxLoad); |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(ajaxLoad); |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //#endregion |
| | | |
| | | //#region å¿«éè¿æ»¤ |
| | | function get_FastQuery(number) { |
| | | var HORGID = ""; |
| | | if (number == 1) { |
| | | HORGID = sessionStorage["OrganizationID"]; |
| | | } |
| | | else { |
| | | HORGID = $("#HORGID").val();//ç»ç» |
| | | } |
| | | var HBEGINDATE = $("#HBEGINDATE").val();//æææ¥æ |
| | | var HENDDATE = $("#HENDDATE").val();//è³ |
| | | var HMATERIALID = $("#HMATERIALID").val();//ç©æ/产å |
| | | var HSUPPLIERID = $("#HSUPPLIERID").val();//ä¾åºå |
| | | var HXQD = $("#HXQD").val();//éæ±åå· |
| | | var HPURORDERNO = $("#HPURORDERNO").val();//éè´è®¢åå· |
| | | |
| | | sWhere = { |
| | | HORGID: HORGID |
| | | , HBEGINDATE: HBEGINDATE |
| | | , HENDDATE: HENDDATE |
| | | , HMATERIALID: HMATERIALID |
| | | , HSUPPLIERID: HSUPPLIERID |
| | | , HXQD: HXQD |
| | | , HPURORDERNO: HPURORDERNO |
| | | } |
| | | get_Display(JSON.stringify(sWhere)); |
| | | sWhere = "";//è°ç¨æ¥å£åæ¸
空sWhereç¼å |
| | | } |
| | | //#endregion |
| | | |
| | | //#region éç½®è¿æ»¤æ¡ä»¶æ¹æ³ |
| | | function set_ClearQuery() { |
| | | $("#HORGID").val(sessionStorage["OrganizationID"]);//ç»ç» |
| | | $("#HBEGINDATE").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));//æææ¥æ |
| | | $("#HENDDATE").val(Format(new Date(), "yyyy-MM-dd"));//è³ |
| | | $("#HMATERIALID").val("");//ç©æ/产å |
| | | $("#HMATERIALNAME").val(""); |
| | | $("#HSUPPLIERID").val("");//ä¾åºå |
| | | $("#HSUPPLIERNAME").val(""); |
| | | $("#HXQD").val("");//éæ±åå· |
| | | $("#HPURORDERNO").val("");//éè´è®¢åå· |
| | | form.render('select'); |
| | | sWhere = ""; |
| | | } |
| | | //#endregion |
| | | |
| | | //ç©æå表 |
| | | function btnHMATERIALID() { |
| | | layer.open({ |
| | | type: 2 //ç±»å |
| | | , skin: 'layui-layer-rim'//å ä¸è¾¹æ¡ |
| | | , area: ['90%', '90%']//å¤§å° |
| | | , title: 'ç©æå表'//æ é¢ |
| | | , shift: 2//å¼¹åºå¨ç» |
| | | , content: ['../../Baseset/åºç¡èµæ/Gy_MaterialList.html', 'yes'] |
| | | , btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) {//æé®ãæé®ä¸ãçåè° |
| | | var iframeWindow = window['layui-layer-iframe' + index] //è·åå¼¹æ¡é¡µé¢ |
| | | var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//è·åtableçelem:"#test" |
| | | if (checkStatus.data.length === 0) { |
| | | return layer.msg('è¯·éæ©æ°æ®'); |
| | | } |
| | | //è·åæ°æ® |
| | | $("#HMATERIALID").val(checkStatus.data[0].HItemID); |
| | | $("#HMATERIALNAME").val(checkStatus.data[0].HName); |
| | | layer.close(index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | , btn2: function (index, layero) { } |
| | | }) |
| | | } |
| | | |
| | | //ä¾åºå |
| | | function btnHSUPPLIERID() { |
| | | layer.open({ |
| | | type: 2 //ç±»å |
| | | , skin: 'layui-layer-rim'//å ä¸è¾¹æ¡ |
| | | , area: ['90%', '90%']//å¤§å° |
| | | , title: 'ä¾åºåå表'//æ é¢ |
| | | , shift: 2//å¼¹åºå¨ç» |
| | | , content: ['../../Baseset/åºç¡èµæ/Gy_SupplierList.html', 'yes'] |
| | | , btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) {//æé®ãæé®ä¸ãçåè° |
| | | var iframeWindow = window['layui-layer-iframe' + index] //è·åå¼¹æ¡é¡µé¢ |
| | | var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//è·åtableçelem:"#test" |
| | | if (checkStatus.data.length === 0) { |
| | | return layer.msg('è¯·éæ©æ°æ®'); |
| | | } |
| | | //è·åæ°æ® |
| | | $("#HSUPPLIERID").val(checkStatus.data[0].HItemID); |
| | | $("#HSUPPLIERNAME").val(checkStatus.data[0].HName); |
| | | layer.close(index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | , btn2: function (index, layero) { } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | //#endregion |
| | | //以䏿¯layui模å |
| | | }); |
| | | </script> |