myLicenceManagement.js 1.7 KB
Newer Older
doc_wei's avatar
doc_wei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

var rowId = "";

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
	winui.renderColor();
	var $ = layui.$,
		form = layui.form,
		table = layui.table;

	showList();
	// 我借用中的证照列表
	function showList(){
		table.render({
		    id: 'messageTable',
		    elem: '#messageTable',
		    method: 'post',
doc_wei's avatar
doc_wei 已提交
22
		    url: flowableBasePath + 'myhasmation003',
doc_wei's avatar
doc_wei 已提交
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
		    where: getTableParams(),
		    even: true,
		    page: true,
		    limits: getLimits(),
	    	limit: getLimit(),
		    cols: [[
		        { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
				{ field: 'companyName', title: '所属公司', align: 'left', width: 170 },
				{ field: 'licenceName', title: '资产名称', align: 'left', width: 120 },
				{ field: 'borrowName', title: '领用人', align: 'left', width: 80 },
				{ field: 'licenceAdmin', title: '管理员', align: 'left', width: 80 },
		    ]],
		    done: function(){
		    	matchingLanguage();
		    }
		});
	}

doc_wei's avatar
doc_wei 已提交
41
    $("body").on("click", "#reloadmessageTable", function() {
doc_wei's avatar
doc_wei 已提交
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
    	loadTable();
    });
	form.render();
	form.on('submit(formSearch)', function (data) {
		if (winui.verifyForm(data.elem)) {
			refreshTable();
		}
		return false;
	});

    function loadTable(){
    	table.reload("messageTable", {where: getTableParams()});
    }

	function refreshTable(){
		table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
	}
    
    function getTableParams(){
    	return {
			licenceName: $("#licenceName").val()
    	};
    }
    
    exports('myLicenceManagement', {});
});