vehicleManageInsuranceDetails.js 2.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

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 insuranceaddtableTemplate = $('#insuranceaddtableTemplate').html();
	    
	    showGrid({
		 	id: "showForm",
doc_wei's avatar
doc_wei 已提交
16
		 	url: flowableBasePath + "insurance006",
doc_wei's avatar
doc_wei 已提交
17 18 19 20 21
		 	params: {rowId:parent.rowId},
		 	pagination: false,
		 	template: getFileContent('tpl/vehicleManageInsurance/vehicleManageInsuranceDetailsTemplate.tpl'),
		 	ajaxSendLoadBefore: function(hdb){
		 	},
W
weizhiqiang 已提交
22
		 	ajaxSendAfter:function (json) {
doc_wei's avatar
doc_wei 已提交
23 24
		 		var coveragestr = "";
		 		var arr = json.bean.coverageId.split(",");
25 26 27 28
				for(var i = 0; i < arr.length; i++){
					var str = arr[i].split("-");
					for(var j = 0; j < str.length; j++){
						coveragestr = coveragestr + str[0] + ",";
doc_wei's avatar
doc_wei 已提交
29
					}
30 31 32 33
				}

				// 车辆险种
				sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["admVehicleCoverage"]["key"], 'checkbox', "coverageChoose", json.bean.coverageId, form);
W
weizhiqiang 已提交
34 35 36 37

				// 附件回显
				skyeyeEnclosure.showDetails({"enclosureUploadBtn": json.bean.enclosureInfo});

doc_wei's avatar
doc_wei 已提交
38
		        matchingLanguage();
39 40 41
				// 车辆险种
				sysDictDataUtil.queryDictDataListByDictTypeCode(sysDictData["admVehicleCoverage"]["key"], function (data) {
					var row = data.rows;
42
					var coveragearr = coveragestr.split(",");
43
					for(var i = 0;i < data.total; i++){
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
						var params = {
							id: row[i].id,
							name: row[i].name
						};
						var f = false;
						for(var m = 0;m < coveragearr.length; m++){
							if(row[i].id == coveragearr[m]){
								f = true;
							}
						}
						if(f){
							$("#addTable").append(getDataUseHandlebars(insuranceaddtableTemplate, params));
						}
						form.render('checkbox');
					}
					var arr = json.bean.coverageId.split(",");
					for(var i = 0; i < arr.length; i++){
						var str = arr[i].split("-");
						for(var j = 0; j < str.length; j++){
							var fu = $("#addTable").find("span[rowId="+str[0]+"]").parent();
							fu.next().find("span").html(str[1]);//对应的保费
							fu.next().next().find("span").html(str[2]);//对应的保额
							if(str.length > 3){
								fu.next().next().next().find("span").html(str[3]);//对应的备注
							}
						}
					}
71
				});
doc_wei's avatar
doc_wei 已提交
72 73
		 	}
		});
W
weizhiqiang 已提交
74

doc_wei's avatar
doc_wei 已提交
75 76
	});
});