assetReportList.js 3.3 KB
Newer Older
doc_wei's avatar
doc_wei 已提交
1

doc_wei's avatar
doc_wei 已提交
2

doc_wei's avatar
doc_wei 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15
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;

doc_wei's avatar
doc_wei 已提交
16
	// 资产明细列表
doc_wei's avatar
doc_wei 已提交
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
	table.render({
		id: 'messageTable',
		elem: '#messageTable',
		method: 'post',
		url: flowableBasePath + 'queryAssetReportList',
		where: getTableParams(),
		even: true,
		page: true,
		limits: getLimits(),
		limit: getLimit(),
		cols: [[
			{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
			{ field: 'assetNum', title: '资产编号', width: 160, templet: function (d) {
				return '<a lay-event="details" class="notice-title-click">' + d.assetNum + '</a>';
			}},
			{ field: 'unitPrice', title: '采购单价', width: 100 },
			{ field: 'fromName', title: '资产来源', width: 120 },
34 35 36 37
			{ field: 'barCodeMation', title: '条形码', align: 'center', width: 100, templet: function (d) {
				return '<img src="' + systemCommonUtil.getFilePath(d.barCodeMation.imagePath) + '" class="photo-img" lay-event="barCode" style="width: 100px">';
			}},
			{ field: 'stateName', title: '状态', align: 'center', width: 100 },
doc_wei's avatar
doc_wei 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
			{ field: 'assetAdmin', title: '管理员', width: 80 },
			{ field: 'useUserName', title: '申领人', width: 120 },
			{ field: 'storageArea', title: '存放区域', width: 140 },
			{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
			{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
			{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
			{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
			{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#messageTableBar' }
		]],
		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);
60 61
		} else if (layEvent === 'barCode') { // 条形码预览
			systemCommonUtil.showPicImg(systemCommonUtil.getFilePath(data.barCodeMation.imagePath));
doc_wei's avatar
doc_wei 已提交
62 63 64 65 66 67
		}
    });

	// 详情
	function details(data) {
		rowId = data.id;
doc_wei's avatar
doc_wei 已提交
68
		// todo 资产明细列表
doc_wei's avatar
doc_wei 已提交
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
		_openNewWindows({
			url: "",
			title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
			pageId: "assetManageDetails",
			area: ['90vw', '90vh'],
			callBack: function (refreshCode) {
			}});
	}

	form.render();
    $("body").on("click", "#reloadTable", function() {
    	loadassetTable();
    });

    function loadassetTable() {
    	table.reloadData("messageTable", {where: getTableParams()});
    }

    function getTableParams() {
		return $.extend(true, {assetId: parent.rowId}, initTableSearchUtil.getSearchValue("messageTable"));
    }

doc_wei's avatar
doc_wei 已提交
91
    exports('assetReportList', {});
doc_wei's avatar
doc_wei 已提交
92
});