customerreconciliation.js 2.0 KB
Newer Older
doc_wei's avatar
doc_wei 已提交
1 2 3 4 5 6

layui.config({
    base: basePath,
    version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
7
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
doc_wei's avatar
doc_wei 已提交
8 9 10 11 12
    winui.renderColor();
    var $ = layui.$,
        form = layui.form,
        table = layui.table;
    
13 14 15 16 17 18 19 20 21 22 23 24 25 26
	table.render({
		id: 'messageTable',
		elem: '#messageTable',
		method: 'post',
		url: sysMainMation.erpBasePath + 'statistics005',
		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;
doc_wei's avatar
doc_wei 已提交
27
				if (!isNull(d.parentOrderId)) {
28 29 30 31 32 33
					str += '<span class="state-new">[转]</span>';
				}
				return str;
			}},
			{ field: 'serviceName', title: '单据类型', align: 'left', width: 100 },
			{ field: 'holderMation', title: '客户', align: 'left', width: 150, templet: function (d) {
doc_wei's avatar
doc_wei 已提交
34
				return getNotUndefinedVal(d.holderMation?.name);
35 36 37 38 39 40 41 42 43 44 45 46 47
			}},
			{ field: 'totalPrice', title: '合计金额', align: 'left', width: 100},
			{ field: 'operTime', title: '单据日期', align: 'center', width: 150}
		]],
		done: function(json) {
			matchingLanguage();
			initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form,
				{value: "请选择日期", type: 'month', defaultValue: getOneYMFormatDate(), required: 'required'},
				function () {
				table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
			});
		}
	});
doc_wei's avatar
doc_wei 已提交
48

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

54 55 56 57 58 59 60 61 62 63 64
	function loadTable() {
		table.reloadData("messageTable", {where: getTableParams()});
	}

	function getTableParams() {
		var params = {};
		if ($("#messageTableKeyWord").length == 0) {
			params["keyword"] = getOneYMFormatDate();
		}
		return $.extend(true, params, initTableSearchUtil.getSearchValue("messageTable"));
	}
doc_wei's avatar
doc_wei 已提交
65 66 67

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