/*
*文件用途说明:用于评估报告打印
*作者姓名:小严
*制作日期:2017-09-21
*/
import $ from "jquery";
var ifDecoration = false;
var ifAttached = false;
var ifOther = false;
var annexNum = 1;
//var P_Money = "";
window.onload = function() {
var ID = $("#InvestigateTable_Assessment\\.ID").val();
GetInformationFromAssessment(ID);
var P_Money = "";
var IsLDF = "";
var InLayer = "";
var AllLayer = "";
var Orientation = "";
var StructureID_text = "";
var Jzmj = "";
var CompletedYear = "";
var ProjectName = "";
var LandTransferMoneyFormula = "";
//读取评估表信息
function GetInformationFromAssessment(id) {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentByID.ashx?ID=" +
id,
dataType: "JSON",
async: false,
cache: false,
success: function(data) {
//加载评估表信息
loadAssessment(data);
//加载调查表信息
loadInvestigateTable();
//加载估价对象自定义概况
loadSurvey();
////加载比准案例房地产状况
//loadProperty()
//加载装修
if (ifDecoration) {
loadDecoration1();
} else {
loadDecoration();
$("#printdiv1").hide();
}
//加载附属物
if (ifAttached) {
loadAttached1();
} else {
loadAttached();
$("#printdiv2").hide();
}
//加载其他
loadOther();
//加载房屋部位信息
//loadHouseLocation();
}
});
//加载评估表信息
function loadAssessment(data) {
//项目名称
$("#Title").html(
data.item[0]["ProjectName"] + "国有土地上住宅用房征收评估分户报告"
);
$("#ProjectName").html(data.item[0]["ProjectName"]);
ProjectName = data.item[0]["ProjectName"];
//编号
$("#No").html(data.item[0]["AssessmentNo"]);
//被征收人
$("#Bzsr").html(data.item[0]["Bzsr"]);
//房屋坐落
$("#Fwzl").html(data.item[0]["Fwzl"]);
//房屋部位
// $("#Orientation").html(data.item[0]["Orientation"]);
//所在层/总层数
InLayer = data.item[0]["InLayer"] || "";
AllLayer = data.item[0]["AllLayer"] || "";
$("#Layer").html(InLayer + "/" + AllLayer);
//落地房
IsLDF = data.item[0]["IsLDF"];
if (IsLDF == "是") {
$("#Orientation").html("/");
$("#StructureID_text").html("/");
$("#CompletedYear").html("/");
} else {
//朝向
$("#Orientation").html(data.item[0]["Orientation"]);
//结构等级
$("#StructureID_text").html(data.item[0]["StructureID_text"]);
//建造年份
$("#CompletedYear").html(data.item[0]["CompletedYear"]);
}
Orientation = data.item[0]["Orientation"];
StructureID_text = data.item[0]["StructureID_text"];
//建筑面积
//$("#BuildingArea").html(parseFloat(data.item[0]["BuildingArea"]));
$("#BuildingArea1").html(parseFloat(data.item[0]["BuildingArea"]));
Jzmj = data.item[0]["Jzmj"];
//建造年份
//$("#CompletedYear").html(data.item[0]["CompletedYear"]);
CompletedYear = data.item[0]["CompletedYear"];
//地段
$("#Section").html(data.item[0]["Section"]);
//底层情况
$("#Underlying").html(data.item[0]["Underlying"]);
//土地性质
$("#LandWay").html(data.item[0]["LandWay"]);
//土地面积
$("#LandArea").html(parseFloat(data.item[0]["LandArea"]));
//独用天井使用面积
$("#CourtyardArea").html(parseFloat(data.item[0]["CourtyardArea"]));
//独用晒台使用面积
$("#ShaitaiArea").html(parseFloat(data.item[0]["ShaitaiArea"]));
//围墙类别
$("#WallType").html(data.item[0]["WallType"]);
//围墙面积
$("#WallArea").html(parseFloat(data.item[0]["WallArea"]));
//车房类别
$("#GarageType").html(data.item[0]["GarageType"]);
//车房房号
$("#GarageNo").html(data.item[0]["GarageNo"]);
//车房面积
$("#GarageArea").html(parseFloat(data.item[0]["GarageArea"]));
//价值时点
var MoneyPoint = data.item[0]["MoneyPoint"].split("/");
if (MoneyPoint.length > 1)
$("#MoneyPoint").html(
MoneyPoint[0] +
"/" +
MoneyPoint[1] +
"/" +
MoneyPoint[2].split(" ")[0].substring(0, 2)
);
else {
MoneyPoint = data.item[0]["MoneyPoint"].split("-");
if (MoneyPoint.length > 1)
$("#MoneyPoint").html(
MoneyPoint[0] +
"/" +
MoneyPoint[1] +
"/" +
MoneyPoint[2].split(" ")[0].substring(0, 2)
);
else $("#MoneyPoint").html(data.item[0]["MoneyPoint"].split(" ")[0]);
}
//结构修正系数
$("#StructureRatio").html(parseFloat(data.item[0]["StructureRatio"]));
//使用年限调整系数
$("#YearRatio").html(parseFloat(data.item[0]["YearRatio"]));
//朝向差价率
$("#OrientationRatio").html(parseFloat(data.item[0]["OrientationRatio"]));
//层次差价率
$("#LayerRatio").html(parseFloat(data.item[0]["LayerRatio"]));
//层高修正系数
$("#LayerHighRatio").html(parseFloat(data.item[0]["LayerHighRatio"]));
//容积率修正系数
$("#VolumeRatio").html(parseFloat(data.item[0]["VolumeRatio"]));
/*
* 打印稿中显示其他因素修正系数
*/
if (parseFloat(data.item[0]["OtherRatio"]) > 0) {
OtherRatiohtml =
"
| 其他因素调整系数 | " +
parseFloat(data.item[0]["OtherRatio"]) +
" |
";
$("#PropertyTr").before(OtherRatiohtml);
var rowspan = parseFloat($("#PropertyTd").attr("rowspan")).add(1);
$("#PropertyTd").attr("rowspan", rowspan);
$("#PropertyMo").attr("rowspan", rowspan);
}
//房屋评估价值
$("#HousingAssessmentValue").html(
parseFloat(data.item[0]["HousingAssessmentValue"])
);
//加载比准案例房地产状况
loadProperty();
//评估比准价格×结构修正系数×使用年限调整系数×(1±层次差价率)×(1±朝向差价率)×建筑面积
if (parseFloat(data.item[0]["OtherRatio"]) > 0) {
$("#Calculation_Process").html(
P_Money +
"×" +
parseFloat(data.item[0]["StructureRatio"]) +
"×" +
data.item[0]["YearRatio"] +
"×(1" +
(parseFloat(data.item[0]["LayerRatio"]) < 0 ?
parseFloat(data.item[0]["LayerRatio"]) :
"+" + parseFloat(data.item[0]["LayerRatio"])) +
"%)×(1" +
(parseFloat(data.item[0]["OrientationRatio"]) < 0 ?
parseFloat(data.item[0]["OrientationRatio"]) :
"+" + parseFloat(data.item[0]["OrientationRatio"])) +
"%)×" +
parseFloat(data.item[0]["OtherRatio"]) +
"×" +
parseFloat(data.item[0]["Jzmj"]) +
"=" +
parseFloat(data.item[0]["HousingAssessmentValue"]) +
"元"
);
} else {
$("#Calculation_Process").html(
" " +
P_Money +
"×" +
parseFloat(data.item[0]["StructureRatio"]) +
"×" +
data.item[0]["YearRatio"] +
"×(1" +
(parseFloat(data.item[0]["LayerRatio"]) < 0 ?
parseFloat(data.item[0]["LayerRatio"]) :
"+" + parseFloat(data.item[0]["LayerRatio"])) +
"%)×(1" +
(parseFloat(data.item[0]["OrientationRatio"]) < 0 ?
parseFloat(data.item[0]["OrientationRatio"]) :
"+" + parseFloat(data.item[0]["OrientationRatio"])) +
"%)×" +
parseFloat(data.item[0]["Jzmj"]) +
"=" +
parseFloat(data.item[0]["HousingAssessmentValue"]) +
"元"
);
}
//装修面积
$("#DecorateArea").html(parseFloat(data.item[0]["DecorateArea"] || 0));
//装修评估价值
$("#DecorateAssessedValue").html(
parseFloat(data.item[0]["DecorateAssessedValue"] || 0)
);
//附属物评估价值
$("#AttachedAssessedValue").html(
parseFloat(data.item[0]["AttachedAssessedValue"] || 0)
);
LandTransferMoneyFormula = data.item[0]["LandTransferMoneyFormula"];
//土地金额显示
loadLandMoney();
//加载市场价评估显示
loadMarketPriceAssessed(data.item[0]);
//评估总金额
var countValue = parseFloat(data.item[0]["countValue"]);
$("#countValue_DX").html(AmountLtoU(countValue));
$("#countValue_XX").html(countValue + "元");
//备注
if (data.item[0]["Note"] != "") {
var noteArray = data.item[0]["Note"].split("\r\n");
var noteHtml = "";
for (var i = 0; i < noteArray.length; i++) {
noteHtml +=
"" + noteArray[i] + "
";
}
$("#Note").html(noteHtml);
}
//装修类别
if (data.item[0]["DecorationType"] == "1") {
ifDecoration = true;
$("#DecorateArea").html("0");
$("#DecorateAssessedValue").html(
parseFloat(data.item[0]["DecorateAssessedValue"] || 0) +
"
详见附件" +
annexNum
);
annexNum++;
}
//附属物类别
if (data.item[0]["AttachedType"] == "1") {
ifAttached = true;
$("#AttachedAssessedValue").html(
parseFloat(data.item[0]["AttachedAssessedValue"] || 0) +
"详见附件" +
annexNum
);
annexNum++;
}
}
function loadInvestigateTable() {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetInvestigateTable.ashx?id=" +
id,
async: false,
success: function(data) {
var tempData = JSON.parse(data);
$("#BuildingArea").html(parseFloat(tempData[0]["Area"]));
}
});
}
//加载市场价评估显示
function loadMarketPriceAssessed(data1) {
$("#BuildingArea1")
.parent()
.html(
'' +
'| ' +
data1["Jzmj"] +
" |
"
);
//
$("#Parts")
.parent()
.html(
''
);
$("#LayerRatio")
.parent()
.html(
'' +
'| ' +
data1["LayerRatio"] +
" |
"
);
$("#OrientationRatio")
.parent()
.html(
'' +
'| ' +
data1["OrientationRatio"] +
" |
"
);
$("#StructureRatio")
.parent()
.html(
'' +
'| ' +
data1["StructureRatio"] +
" |
"
);
$("#YearRatio")
.parent()
.html(
'' +
'| ' +
data1["YearRatio"] +
" |
"
);
$("#HousingAssessmentValue")
.parent()
.html(
'' +
'| ' +
data1["HousingAssessmentValue"] +
" |
"
);
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentChildren.ashx?action=HouseLocaion&parentID=" +
id,
async: false,
success: function(data) {
if (data != null && data.length > 0) {
//获取所有的属性值
var keys = Object.keys(data[0]);
//console.log(keys, "keys");
var tempLocationName = "";
var landhtml = "";
var pgLandmtml =
"| 所在层/总层数 | 朝向 | 结构 | 建筑面积(㎡) | 建造年份 |
| " +
InLayer +
"/" +
AllLayer +
" | " +
Orientation +
" | " +
StructureID_text +
" | " +
Jzmj +
" | " +
CompletedYear +
" |
";
for (var item = 0; item < data.length; item++) {
var tempItem = item;
var nextTempItem = item + 1;
keys.forEach(function(k) {
var nextTempClass = "tdc " + k + nextTempItem;
$("td." + k + tempItem)
.parent()
.append(
'' +
data[item][k] +
" | "
);
});
landhtml +=
" " +
P_Money +
"×" +
parseFloat(data[item]["StructureRatio"]) +
"×" +
data[item]["YearRatio"] +
"×(1" +
(parseFloat(data[item]["LayerRatio"]) < 0 ?
parseFloat(data[item]["LayerRatio"]) :
"+" + parseFloat(data[item]["LayerRatio"])) +
"%)×(1" +
(parseFloat(data[item]["OrientationRatio"]) < 0 ?
parseFloat(data[item]["OrientationRatio"]) :
"+" + parseFloat(data[item]["OrientationRatio"])) +
"%)×" +
parseFloat(data[item]["BuildArea"]) +
"=" +
parseFloat(data[item]["HousingAssessmentValue"]) +
"元
";
pgLandmtml +=
"| " +
data[item]["InLayer"] +
"/" +
data[item]["AllLayer"] +
" | " +
data[item]["Orientation"] +
" | " +
data[item]["StructureID_text"] +
" | " +
data[item]["BuildArea"] +
" | " +
data[item]["BuildYear"] +
" |
";
}
if (IsLDF == "是") {
var rowspan = parseFloat($("#SurveyTd").attr("rowspan"))
.add(2)
.add(data.length);
$("#SurveyTd").attr("rowspan", rowspan);
$("#SurveyTr0").after(pgLandmtml);
}
$("#Calculation_Process").after(landhtml);
} else {
$("#house").attr("style", "display:none;");
$("#house1").attr("style", "display:none;");
}
}
});
}
//加载土地金额显示
function loadLandMoney() {
var moneyChoose = initData["InvestigateTable_Assessment_MoneyChoose"];
if (moneyChoose.index != "") {
var titleArray = new Array(4);
var valueArray = new Array(4);
var index = 0;
if (moneyChoose.indexOf("1") > -1) {
titleArray[index] = "土地出让
金";
if (LandTransferMoneyFormula == null) {
valueArray[index] =
"楼面地价×实际容积率×土地面积×扣除比例
" +
parseFloat(
initData["InvestigateTable_Assessment_LandTransferMoney"]
);
} else {
valueArray[index] =
LandTransferMoneyFormula +
"
" +
parseFloat(
initData["InvestigateTable_Assessment_LandTransferMoney"]
);
}
index++;
} else if (moneyChoose.indexOf("2") > -1) {
titleArray[index] = "地价
调整";
valueArray[index] =
"按房屋用途计算的楼面地价-按土地用途计算的楼面地价)×房屋建筑面积
" +
parseFloat(initData["InvestigateTable_Assessment_AdjustLandMoney"]);
index++;
}
if (moneyChoose.indexOf("0") > -1) {
titleArray[index] = "超容积率土地评估金额";
valueArray[index] =
"(证载土地面积-按标准容积率计算的土地面积)×楼面地价×容积率×综合费用修正系数
" +
parseFloat(
initData["InvestigateTable_Assessment_LandCompensationMoney"]
);
index++;
}
if (moneyChoose.indexOf("2") > -1 && moneyChoose.indexOf("1") > -1) {
titleArray[index] = "地价
调整";
valueArray[index] =
"按房屋用途计算的楼面地价-按土地用途计算的楼面地价)×房屋建筑面积
" +
parseFloat(initData["InvestigateTable_Assessment_AdjustLandMoney"]);
index++;
}
if (moneyChoose.indexOf("4") > -1) {
titleArray[index] = "补缴多余土地出让金";
valueArray[index] =
"土地性质为国有非出让土地的,出让金按土地评估价的20%扣除
" +
parseFloat(
initData["InvestigateTable_Assessment_PaymentLandTransferMoney"]
);
index++;
}
var html = "";
for (var i = 0; i < index; i++) {
if (i % 2 == 0) {
html +=
"| " +
titleArray[i] +
" | " +
valueArray[i] +
" | ";
} else {
html +=
"" +
titleArray[i] +
" | " +
valueArray[i] +
" |
";
}
}
if (index % 2 != 0) {
html += " | ";
}
$("#LandMoneyTr").before(html);
}
}
//加载估价对象自定义概况
function loadSurvey() {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentChildren.ashx?action=Survey&parentID=" +
id,
async: false,
//cache: false,
success: function(data) {
var NameString = "";
var ValueString = "";
for (var i = 0, c = data.length; i < c; i++) {
var elem = data[i];
if (i <= 4) {
$("#Name_Survey" + i + "").html(elem["S_Name"]);
$("#Value_Survey" + i + "").html(elem["S_Value"]);
}
if (i == 5) {
NameString += elem["S_Name"];
ValueString += elem["S_Value"];
}
if (i > 5) {
NameString += "," + elem["S_Name"];
ValueString += "," + elem["S_Value"];
}
}
if (NameString != "" && ValueString != "") {
var SurveyHtml0 = "";
var SurveyHtml1 = "
";
var NameArray = NameString.split(",");
var ValueArray = ValueString.split(",");
var MaxNum = 9;
if (NameArray.length % 9 == 0)
MaxNum = parseInt(NameArray.length / 9).mul(9);
else
MaxNum = parseInt(NameArray.length / 9)
.add(1)
.mul(9);
for (var i = 0; i < MaxNum; i++) {
if (i < NameArray.length) {
if (i % 9 < 1) {
SurveyHtml0 +=
"| " + NameArray[i] + " | ";
SurveyHtml1 +=
"" + ValueArray[i] + " | ";
} else {
SurveyHtml0 +=
"" + NameArray[i] + " | ";
SurveyHtml1 +=
"" + ValueArray[i] + " | ";
}
} else {
if (i % 9 < 1) {
SurveyHtml0 += " | ";
SurveyHtml1 += " | ";
} else {
SurveyHtml0 += " | ";
SurveyHtml1 += " | ";
}
}
if ((i + 1) % 9 == 0) {
SurveyHtml0 += "
";
SurveyHtml1 += "";
var Num = parseInt(i / 9);
$("#SurveyTr" + Num + "").after(SurveyHtml0 + SurveyHtml1);
var rowspan = parseFloat($("#SurveyTd").attr("rowspan")).add(2);
$("#SurveyTd").attr("rowspan", rowspan);
SurveyHtml0 = "";
SurveyHtml1 = "
";
}
}
}
}
});
}
//加载比准案例房地产状况
function loadProperty() {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentChildren.ashx?action=Property&parentID=" +
id,
async: false,
//cache: false,
success: function(data) {
var PropertyHtml =
"
| 比准案例房地产状况 | 建筑结构 | 建造年份 | 朝向 | 层次 | 土地性质/用途 | 比准价格(元/㎡) |
";
for (var i = 0, c = data.length; i < c; i++) {
var elem = data[i];
PropertyHtml += "";
PropertyHtml +=
"| " + elem["P_Structure"] + " | ";
var Time = elem["P_BuildYear"];
if (Time != null && Time != "") Time = Time.replace(/T.*/g, "");
else Time = "";
PropertyHtml += "" + Time + " | ";
PropertyHtml +=
"" + elem["P_Orientation"] + " | ";
PropertyHtml +=
"" + elem["P_Layer"] + " | ";
PropertyHtml +=
"" + elem["P_LandType"] + " | ";
PropertyHtml +=
"" +
parseFloat(elem["P_Money"]) +
" | ";
PropertyHtml += "
";
P_Money = parseFloat(elem["P_Money"]);
}
if (data.length > 0) {
$("#PropertyTr").after(PropertyHtml);
var rowspan = parseFloat($("#PropertyTd").attr("rowspan"))
.add(data.length)
.add(1);
$("#PropertyTd").attr("rowspan", rowspan);
}
}
});
}
//加载装修
function loadDecoration() {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentChildren.ashx?action=Decorate&parentID=" +
id,
async: false,
//cache: false,
success: function(data) {
if (data.length > 0) {
var DecorateHtml = "";
var RowNum = 0;
for (var i = 0, c = data.length; i < c; i++) {
var elem = data[i];
RowNum++;
DecorateHtml += "";
DecorateHtml +=
"| " + elem["D_HouseNo"] + " | ";
DecorateHtml +=
"" +
parseFloat(elem["D_UsingArea"]) +
" | ";
DecorateHtml +=
"" +
parseFloat(elem["D_UnitPrice"]) +
" | ";
if (i + 1 < data.length) {
i++;
elem = data[i];
DecorateHtml +=
"" + elem["D_HouseNo"] + " | ";
DecorateHtml +=
"" +
parseFloat(elem["D_UsingArea"]) +
" | ";
DecorateHtml +=
"" +
parseFloat(elem["D_UnitPrice"]) +
" | ";
DecorateHtml += "
";
} else {
DecorateHtml += " | ";
DecorateHtml += " | ";
DecorateHtml += " | ";
DecorateHtml += "";
}
}
if (data.length > 0) {
$("#DecorateTr0").after(DecorateHtml);
var rowspan = parseFloat($("#DecorateTd").attr("rowspan")).add(
RowNum
);
$("#DecorateTd").attr("rowspan", rowspan);
}
} else {
$("#DecorateTr0").remove();
$("#DecorateTr1").remove();
}
}
});
}
//加载分部分项装修评估表
function loadDecoration1() {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentChildren.ashx?action=Decorate1&parentID=" +
id,
async: false,
success: function(data) {
if (data.length > 0) {
var decorateHtml =
"| 阳台 | " +
" | " +
" | " +
"客厅 | " +
" | " +
" |
";
//+ "| 卧室(阳) | "
//+ " | "
//+ " | "
//+ "餐厅 | "
//+ " | "
//+ " |
"
//+ "| 卧室(南) | "
//+ " | "
//+ " | "
//+ "厨房 | "
//+ " | "
//+ " |
"
//+ "| 卧室(北) | "
//+ " | "
//+ " | "
//+ "卫生间 | "
//+ " | "
//+ " |
"
$("#DecorateTr0").after(decorateHtml);
var rowspan = parseFloat($("#DecorateTd").attr("rowspan")).add(1);
$("#DecorateTd").attr("rowspan", rowspan);
var decorateHtml1 = "";
for (var i = 0, c = data.length; i < c; i++) {
var elem = data[i];
decorateHtml1 += "";
decorateHtml1 += "| " + elem["D1_No"] + " | ";
decorateHtml1 += "" + elem["D1_Name"] + " | ";
decorateHtml1 +=
"" + parseFloat(elem["D1_New"]) + " | ";
decorateHtml1 += "" + elem["D1_Unit"] + " | ";
decorateHtml1 +=
"" + parseFloat(elem["D1_Number"]) + " | ";
decorateHtml1 +=
"" + parseFloat(elem["D1_UnitPrice"]) + " | ";
decorateHtml1 +=
"" + parseFloat(elem["D1_Money"]) + " | ";
decorateHtml1 += "" + elem["D1_Remark"] + " | ";
decorateHtml1 += "
";
}
$("#Decorate").after(decorateHtml1);
}
}
});
}
//加载附属物
function loadAttached() {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentChildren.ashx?action=Attached&parentID=" +
id,
async: false,
//cache: false,
success: function(data) {
if (data.length > 0) {
var AttachedHtml = "";
for (var i = 0, c = data.length; i < c; i++) {
var elem = data[i];
AttachedHtml += "";
AttachedHtml +=
"| " + elem["A_Name"] + " | ";
AttachedHtml +=
"" +
parseFloat(elem["A_Area"]) +
" | ";
AttachedHtml +=
"" +
parseFloat(elem["A_UnitPrice"]) +
" | ";
AttachedHtml +=
"" + elem["A_New"] + " | ";
AttachedHtml +=
"" +
parseFloat(elem["A_PGMoney"]) +
" | ";
AttachedHtml +=
"" + elem["A_Remark"] + " | ";
AttachedHtml += "
";
}
if (data.length > 0) {
$("#AttachedTr0").after(AttachedHtml);
var rowspan = parseFloat($("#AttachedTd").attr("rowspan")).add(
data.length
);
$("#AttachedTd").attr("rowspan", rowspan);
}
} else {
$("#AttachedTr0").remove();
$("#AttachedTr1").remove();
}
}
});
}
//加载其他附属物
function loadAttached1() {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentChildren.ashx?action=Attached1&parentID=" +
id,
async: false,
success: function(data) {
if (data.length > 0) {
var attachedHtml =
"" +
" | " +
" | " +
" | " +
" | " +
" | " +
" | " +
"
";
$("#AttachedTr0").after(attachedHtml);
var rowspan = parseFloat($("#AttachedTd").attr("rowspan")).add(1);
$("#AttachedTd").attr("rowspan", rowspan);
var attachedHtml1 = "";
for (var i = 0, c = data.length; i < c; i++) {
var elem = data[i];
attachedHtml1 += "";
attachedHtml1 += "| " + elem["A1_No"] + " | ";
attachedHtml1 += "" + elem["A1_Name"] + " | ";
attachedHtml1 +=
"" + parseFloat(elem["A1_New"]) + " | ";
attachedHtml1 += "" + elem["A1_Unit"] + " | ";
attachedHtml1 +=
"" + parseFloat(elem["A1_Number"]) + " | ";
attachedHtml1 +=
"" + parseFloat(elem["A1_UnitPrice"]) + " | ";
attachedHtml1 +=
"" + parseFloat(elem["A1_Money"]) + " | ";
attachedHtml1 += "" + elem["A1_Remark"] + " | ";
attachedHtml1 += "
";
}
$("#Attached").after(attachedHtml1);
}
}
});
}
//加载其他
function loadOther() {
$.ajax({
url: "/Platform/PgInvestigateTable/ReportFile/GetAssessmentChildren.ashx?action=Other&parentID=" +
id,
async: false,
success: function(data) {
var sumA = 0;
if (data.length > 0) {
ifOther = true;
var otherHtml = "";
for (var i = 0, c = data.length; i < c; i++) {
var elem = data[i];
otherHtml += "";
otherHtml += "| " + elem["O_No"] + " | ";
otherHtml += "" + elem["O_Name"] + " | ";
otherHtml +=
"" + parseFloat(elem["O_New"]) + " | ";
otherHtml += "" + elem["O_Unit"] + " | ";
otherHtml +=
"" + parseFloat(elem["O_Number"]) + " | ";
otherHtml +=
"" + parseFloat(elem["O_UnitPrice"]) + " | ";
otherHtml +=
"" + parseFloat(elem["O_Money"]) + " | ";
otherHtml += "" + elem["O_Remark"] + " | ";
otherHtml += "
";
sumA += parseFloat(elem["O_Money"]);
}
otherHtml +=
"| 合计 | " +
sumA +
"元 |
";
$("#Other").after(otherHtml);
} else {
$("#printdiv3").hide();
}
}
});
}
}
};
function prn_preview5() {
var ID = $("#InvestigateTable_Assessment\\.ID").val();
$.post("/Platform/OperateLog/List.aspx?action=getdata&type=setlog", {
contents: "{0}一条评估记录",
id: ID,
instanceTable: "InvestigateTable_Assessment",
title: "{0}在{1}{2}一条评估记录",
type: "打印"
});
lod();
function lod() {
LODOP = getLodop();
LODOP.PRINT_INIT("");
LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4");
LODOP.SET_PRINT_MODE("DOUBLE_SIDED_PRINT", 1);
var showhtml = document.getElementById("printdiv").innerHTML;
LODOP.ADD_PRINT_HTM("10mm", "14mm", "100%", "95%", showhtml);
LODOP.SET_PRINT_STYLEA(0, "ItemType", 4);
LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
if (ifDecoration) {
LODOP.NewPage();
showhtml = document.getElementById("printdiv1").innerHTML;
LODOP.ADD_PRINT_HTM("10mm", "14mm", "100%", "87%", showhtml);
LODOP.SET_PRINT_STYLEA(0, "ItemType", 4);
LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
}
if (ifAttached) {
LODOP.NewPage();
showhtml = document.getElementById("printdiv2").innerHTML;
LODOP.ADD_PRINT_HTM("10mm", "14mm", "100%", "87%", showhtml);
LODOP.SET_PRINT_STYLEA(0, "ItemType", 4);
LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
}
if (ifOther) {
LODOP.NewPage();
showhtml = document.getElementById("printdiv3").innerHTML;
LODOP.ADD_PRINT_HTM("10mm", "14mm", "100%", "87%", showhtml);
LODOP.SET_PRINT_STYLEA(0, "ItemType", 4);
LODOP.SET_PRINT_STYLEA(0, "Horient", 3);
LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
}
LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "100%");
LODOP.PREVIEW();
}
}