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

出库明细整改

上级 3f97d9c9
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();
});
// 报表查询->出库明细
function initTable(){
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'statistics002',
url: sysMainMation.erpBasePath + 'statistics002',
where: getTableParams(),
even: true,
page: true,
......@@ -63,21 +22,17 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'defaultNumber', title: '单据编号', align: 'left', width: 250, templet: function (d) {
var str = '<a lay-event="details" class="notice-title-click">' + d.defaultNumber + '</a>';
if (!isNull(d.linkNumber)){
{ field: 'oddNumber', title: '单据编号', align: 'left', width: 250, templet: function (d) {
var str = d.oddNumber;
if (!isNull(d.parentOrderId)){
str += '<span class="state-new">[转]</span>';
if(d.status == 2){
str += '<span class="state-up"> [正常]</span>';
} else {
str += '<span class="state-down"> [预警]</span>';
}
}
return str;
}},
{ field: 'subTypeName', title: '单据类型', align: 'left', width: 100},
{ field: 'materialName', title: '商品名称', align: 'left', width: 150 },
{ field: 'materialModel', title: '商品型号', align: 'left', width: 100},
{ 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 },
......@@ -86,60 +41,23 @@ layui.config({
]],
done: function(json) {
matchingLanguage();
}
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入单据编号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
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;
});
// 详情
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) {
}});
}
$("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
};
return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('outgoingdetails', {});
......
......@@ -47,6 +47,7 @@ layui.config({
}
});
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
});
......
......@@ -7,31 +7,9 @@
<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">
<select id="depotId" lay-search></select>
</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-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>
<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.
先完成此消息的编辑!
想要评论请 注册