vehicleManageInspectionDetails.js 1.3 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
var enclosureList = new Array();

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
	winui.renderColor();
	layui.use(['form'], function (form) {
		var index = parent.layer.getFrameIndex(window.name);
	    var $ = layui.$;
	    var reg = new RegExp("<br>", "g");
	    
	    showGrid({
		 	id: "showForm",
doc_wei's avatar
doc_wei 已提交
17
		 	url: flowableBasePath + "inspection006",
doc_wei's avatar
doc_wei 已提交
18 19 20 21 22
		 	params: {rowId:parent.rowId},
		 	pagination: false,
		 	template: getFileContent('tpl/vehicleManageInspection/vehicleManageInspectionDetailsTemplate.tpl'),
		 	ajaxSendLoadBefore: function(hdb){
		 	},
W
weizhiqiang 已提交
23
		 	ajaxSendAfter:function (json) {
doc_wei's avatar
doc_wei 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36
		 		// 附件回显
			    if(json.bean.enclosureInfo.length != 0 && json.bean.enclosureInfo != ""){
			    	enclosureList = json.bean.enclosureInfo;
			    	var str = "";
	    			$.each([].concat(enclosureList), function(i, item){
	    				str += '<a rowid="' + item.id + '" class="enclosureItem" rowpath="' + item.fileAddress + '" href="javascript:;" style="color:blue;">' + item.name + '</a><br>';
	    			});
	    			$("#enclosureUploadBtn").html(str);
		        }
		        matchingLanguage();
		 	}
		});
	    
doc_wei's avatar
doc_wei 已提交
37
	    $("body").on("click", ".enclosureItem", function() {
doc_wei's avatar
doc_wei 已提交
38 39 40 41
	    	download(fileBasePath + $(this).attr("rowpath"), $(this).html());
	    });
	});
});