incomingstatistics.js 2.0 KB
Newer Older
Skyeye云's avatar
Skyeye云 已提交
1 2 3 4 5 6

layui.config({
    base: basePath,
    version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
Skyeye云's avatar
Skyeye云 已提交
7
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
Skyeye云's avatar
Skyeye云 已提交
8 9 10 11 12
    winui.renderColor();
    var $ = layui.$,
        form = layui.form,
        table = layui.table;
        
Skyeye云's avatar
Skyeye云 已提交
13
	// 获取本月日期
Skyeye云's avatar
Skyeye云 已提交
14 15 16 17 18 19 20 21
	function getOneYMFormatDate(){
		 var date = new Date;
		 var year = date.getFullYear(); 
		 var month = date.getMonth() + 1;
		 month = (month < 10 ? "0" + month : month); 
		 return year.toString() + "-" + month.toString();
	}
	
Skyeye云's avatar
Skyeye云 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
	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()});
			});
		}
	});
Skyeye云's avatar
Skyeye云 已提交
49

Skyeye云's avatar
Skyeye云 已提交
50
	form.render();
Skyeye云's avatar
Skyeye云 已提交
51 52 53 54
    $("body").on("click", "#reloadTable", function() {
        loadTable();
    });

Skyeye云's avatar
Skyeye云 已提交
55
    // 刷新
W
weizhiqiang 已提交
56
    function loadTable() {
Skyeye云's avatar
Skyeye云 已提交
57
		table.reloadData("messageTable", {where: getTableParams()});
Skyeye云's avatar
Skyeye云 已提交
58 59
    }

Skyeye云's avatar
Skyeye云 已提交
60 61 62
	function getTableParams() {
		return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
	}
Skyeye云's avatar
Skyeye云 已提交
63 64 65

    exports('incomingstatistics', {});
});