diff --git a/erp/src/main/resources/template/js/erpstatistics/outgoingdetails.js b/erp/src/main/resources/template/js/erpstatistics/outgoingdetails.js index 9cc764863639c3c64f2cbff358c271aa8c505bfc..7f3af660419ede08acdaf6f256458fe2f955fbbe 100644 --- a/erp/src/main/resources/template/js/erpstatistics/outgoingdetails.js +++ b/erp/src/main/resources/template/js/erpstatistics/outgoingdetails.js @@ -1,146 +1,64 @@ -var rowId = ""; - layui.config({ base: basePath, version: skyeyeVersion }).extend({ window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'form', 'laydate'], function (exports) { +}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { winui.renderColor(); var $ = layui.$, form = layui.form, - laydate = layui.laydate, table = layui.table; - //初始化统计时间 - startTime = getOneYMDFormatDate();//开始日期为本月一号 - endTime = getYMDFormatDate();//结束今天的日期 - - //获取本月一号的日期 - function getOneYMDFormatDate(){ - var date = new Date; - var year = date.getFullYear(); - var month = date.getMonth() + 1; - month = (month < 10 ? "0" + month : month); - return year.toString() + "-" + month.toString() + "-" + "01"; - } - - //获取今天的时间 - function getYMDFormatDate(){ - var myDate = new Date(); - var lw = new Date(myDate); - var lastY = lw.getFullYear(); - var lastM = lw.getMonth() + 1; - var lastD = lw.getDate(); - return lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD); - } - - laydate.render({elem: '#operTime', range: '~', value: startTime + " ~ " + endTime}); - - var selOption = getFileContent('tpl/template/select-option.tpl'); - - // 初始化仓库 - erpOrderUtil.getDepotList(function (json){ - // 加载仓库数据 - $("#depotId").html(getDataUseHandlebars(selOption, json)); - form.render('select'); - // 初始化表格数据 - initTable(); + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: sysMainMation.erpBasePath + 'statistics002', + where: getTableParams(), + even: true, + page: true, + limits: getLimits(), + limit: getLimit(), + cols: [[ + { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, + { field: 'oddNumber', title: '单据编号', align: 'left', width: 250, templet: function (d) { + var str = d.oddNumber; + if (!isNull(d.parentOrderId)){ + str += '[转]'; + } + return str; + }}, + { field: 'serviceName', title: '单据类型', align: 'left', width: 100 }, + { field: 'name', title: '产品名称', align: 'left',width: 150, templet: function (d) {return d.materialMation.name}}, + { field: 'model', title: '产品型号', align: 'left',width: 150, templet: function (d) {return d.materialMation.model}}, + { field: 'norms', title: '产品规格', align: 'left',width: 150, templet: function (d) {return d.normsMation.name}}, + { field: 'unitPrice', title: '单价', align: 'left', width: 120}, + { field: 'operNumber', title: '出库数量', align: 'left', width: 100}, + { field: 'allPrice', title: '金额', align: 'left', width: 120 }, + { field: 'depotName', title: '仓库', align: 'left', width: 140 }, + { field: 'operTime', title: '出库日期', align: 'center', width: 140 } + ]], + done: function(json) { + matchingLanguage(); + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入单据编号", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); + } }); - // 报表查询->出库明细 - function initTable(){ - table.render({ - id: 'messageTable', - elem: '#messageTable', - method: 'post', - url: flowableBasePath + 'statistics002', - where: getTableParams(), - even: true, - page: true, - limits: getLimits(), - limit: getLimit(), - cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, - { field: 'defaultNumber', title: '单据编号', align: 'left', width: 250, templet: function (d) { - var str = '' + d.defaultNumber + ''; - if (!isNull(d.linkNumber)){ - str += '[转]'; - if(d.status == 2){ - str += ' [正常]'; - } else { - str += ' [预警]'; - } - } - return str; - }}, - { field: 'subTypeName', title: '单据类型', align: 'left', width: 100}, - { field: 'materialName', title: '商品名称', align: 'left', width: 150 }, - { field: 'materialModel', title: '商品型号', align: 'left', width: 100}, - { field: 'unitPrice', title: '单价', align: 'left', width: 120}, - { field: 'operNumber', title: '出库数量', align: 'left', width: 100}, - { field: 'allPrice', title: '金额', align: 'left', width: 120 }, - { field: 'depotName', title: '仓库', align: 'left', width: 140 }, - { field: 'operTime', title: '出库日期', align: 'center', width: 140 } - ]], - done: function(json) { - matchingLanguage(); - } - }); - table.on('tool(messageTable)', function (obj) { - var data = obj.data; - var layEvent = obj.event; - if (layEvent === 'details') { //详情 - details(data); - } - }); - } - form.render(); - form.on('submit(formSearch)', function (data) { - if (winui.verifyForm(data.elem)) { - table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}) - } - return false; - }); + $("body").on("click", "#reloadTable", function() { + loadTable(); + }); - // 详情 - function details(data) { - rowId = data.headerId; - var url = erpOrderUtil.getErpDetailUrl({subType: data.subType}); - _openNewWindows({ - url: url, - title: systemLanguage["com.skyeye.detailsPageTitle"][languageType], - pageId: "outgoingdetailschildpage", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - }}); + function loadTable() { + table.reloadData("messageTable", {where: getTableParams()}); } - $("body").on("click", "#reloadTable", function() { - loadTable(); - }); - - // 刷新 - function loadTable() { - table.reloadData("messageTable", {where: getTableParams()}); - } - - function getTableParams() { - // 单据的开始时间、结束时间 - var startTime = "", endTime = ""; - if (!isNull($("#operTime").val())) { - startTime = $("#operTime").val().split('~')[0].trim() + ' 00:00:00'; - endTime = $("#operTime").val().split('~')[1].trim() + ' 23:59:59'; - } - return { - materialName: $("#materialName").val(), - depotId: $("#depotId").val(), - startTime: startTime, - endTime: endTime - }; - } + function getTableParams() { + return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable")); + } exports('outgoingdetails', {}); }); diff --git a/erp/src/main/resources/template/js/erpstatistics/warehousingdetails.js b/erp/src/main/resources/template/js/erpstatistics/warehousingdetails.js index 419a734767f7f8e0779a5e027ee15047a4bd8486..b6161461ade25e9da2bf29149cde32d075fdf69e 100644 --- a/erp/src/main/resources/template/js/erpstatistics/warehousingdetails.js +++ b/erp/src/main/resources/template/js/erpstatistics/warehousingdetails.js @@ -47,6 +47,7 @@ layui.config({ } }); + form.render(); $("body").on("click", "#reloadTable", function() { loadTable(); }); diff --git a/erp/src/main/resources/template/tpl/erpstatistics/outgoingdetails.html b/erp/src/main/resources/template/tpl/erpstatistics/outgoingdetails.html index 5556d530e3e870977855c9941a585e21da979f96..ef3c5275c3d4e41a1064d6b46af71335ea8946b2 100644 --- a/erp/src/main/resources/template/tpl/erpstatistics/outgoingdetails.html +++ b/erp/src/main/resources/template/tpl/erpstatistics/outgoingdetails.html @@ -7,31 +7,9 @@
-