提交 e7b3065b 编写于 作者: doc_wei's avatar doc_wei

ERP进货统计修改第一版

上级 f77804c3
var rowId = "";
//单据的时间
var operTime = "";
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;
//初始化统计时间
operTime = getOneYMFormatDate();
//获取本月日期
// 获取本月日期
function getOneYMFormatDate(){
var date = new Date;
var year = date.getFullYear();
......@@ -28,71 +19,47 @@ layui.config({
return year.toString() + "-" + month.toString();
}
laydate.render({elem: '#operTime', type: 'month', value: operTime});
initTable();
function initTable(){
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'statistics003',
where: {materialName: $("#materialName").val(), operTime: operTime},
even: true,
page: true,
limits: [8, 16, 24, 32, 40, 48, 56],
limit: 8,
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'materialName', title: '产品名称', align: 'left', width: 250},
{ field: 'materialModel', title: '型号', align: 'left', width: 100},
{ field: 'unitName', title: '单位', align: 'left', width: 80},
{ field: 'currentTock', title: '进货数量', align: 'left', width: 100},
{ field: 'currentTockMoney', title: '进货金额', align: 'left', width: 120},
{ field: 'returnCurrentTock', title: '退货数量', align: 'left', width: 100},
{ field: 'returnCurrentTockMoney', title: '退货金额', align: 'left', width: 120 }
]],
done: function(json) {
matchingLanguage();
}
});
form.render();
}
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
loadTable();
}
return false;
});
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'statistics003',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'materialName', title: '产品名称', align: 'left', width: 250},
{ field: 'materialModel', title: '型号', align: 'left', width: 150},
{ field: 'unitName', title: '单位', align: 'left', width: 80},
{ field: 'currentTock', title: '进货数量', align: 'left', width: 100},
{ field: 'currentTockMoney', title: '进货金额', align: 'left', width: 120},
{ field: 'returnCurrentTock', title: '退货数量', align: 'left', width: 100},
{ field: 'returnCurrentTockMoney', title: '退货金额', align: 'left', width: 120 }
]],
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请选择日期", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
});
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
});
$("body").on("click", "#formSearch", function () {
refreshTable();
})
//刷新
// 刷新
function loadTable() {
if(isNull($("#operTime").val())) {//一定要记得,当createTime为空时
winui.window.msg("请选择日期.", {icon: 2, time: 2000});
}else {
operTime = $("#operTime").val();
table.reloadData("messageTable", {where:{materialName: $("#materialName").val(), operTime: operTime}});
}
table.reloadData("messageTable", {where: getTableParams()});
}
//搜索
function refreshTable(){
if(isNull($("#operTime").val())) {//一定要记得,当createTime为空时
winui.window.msg("请选择日期.", {icon: 2, time: 2000});
}else {
operTime = $("#operTime").val();
table.reloadData("messageTable", {page: {curr: 1}, where:{materialName: $("#materialName").val(), operTime: operTime}})
}
}
function getTableParams() {
return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('incomingstatistics', {});
});
......@@ -7,30 +7,10 @@
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">商品名称</label>
<div class="layui-input-inline">
<input type="text" id="materialName" name="materialName" placeholder="请输入名称" class="layui-input" />
</div>
<label class="layui-form-label">单据日期</label>
<div class="layui-input-inline">
<input type="text" id="operTime" name="operTime" placeholder="请选择单据日期" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-tip alert-info" id="showInfo">注:此处包含采购+退货+其他入库。</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<div style="width: calc(100% - 120px); float: right; padding: 8px 10px;">
<div class="layui-form-mid layui-word-aux" style="color: red !important;">注:此处包含采购+退货+其他入库。</div>
</div>
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册