From 0023766f0d4379858c2450eac5d0b56f5983deaa Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期三, 26 一月 2022 10:13:06 +0800
Subject: [PATCH] 导出word
---
zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml | 149 +++++++++++++++++++++++++++++--------------------
1 files changed, 89 insertions(+), 60 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml b/zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml
index 4666fa0..377d06c 100644
--- a/zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml
@@ -69,12 +69,37 @@
@*<script src="~/js/plugins/iTexbox/itextbox.js" type="text/javascript"></script>*@
@*<script src="~/js/plugins/iuploader/iuploader.js"></script>*@
<script src="~/js/TUJS.js"></script>
+ <script language="javascript" src="~/js/fileSaver.js" type="text/javascript"></script>
+ <script language="javascript" src="~/js/jquery.wordexport.js" type="text/javascript"></script>
</head>
<body class="gray-bg" style="overflow:auto">
<form id="formtest">
<div class="wrapper wrapper-content" id="ibox-content" style="padding:15px;">
<div class="row">
<div id="content" style="overflow-y:auto;height:100%;background: #fff;width:850px; margin: 0 auto;">
+ <style type="text/css">
+ table {
+ width: 595px;
+ font-size: 16pt;
+ font-family: 'FangSong';
+ background: #fff;
+ line-height: 1.5;
+ }
+
+ span {
+ font-size: 15pt;
+ display: inline;
+ border-bottom: 1px dashed #111;
+ }
+
+ s22pan:after {
+ content: '';
+ display: inline;
+ width: 100%;
+ margin-top: -5px;
+ border-bottom: 1px dashed #111;
+ }
+ </style>
<div id="page1" style="page-break-after:always;">
<table border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
@@ -240,54 +265,73 @@
<tr>
<td colspan="2">
鎶曡瘔浜嬮」锛�<span style="text-indent:10px">@complaintItemDTOs[i].QuestionName </span>
- <br />
- 浜嬪疄渚濇嵁锛� @Html.Raw("<span>" + (string.IsNullOrEmpty(complaintItemDTOs[i].Evidential) ? "" : complaintItemDTOs[i].Evidential.Replace(" ", " ").Replace("\r", "<br/>")) + "</span>");
- <br />
- @for (int j = 0; j < complaintItemDTOs[i].sysCodeDtls.Count; j++)
- {
-
-
- if (complaintItemDTOs[i].sysCodeDtls.Count == 1)
- {
- @Html.Raw("娉曞緥渚濇嵁锛�<span>銆�" + complaintItemDTOs[i].sysCodeDtls[j].CodeSn + "銆�" + complaintItemDTOs[i].sysCodeDtls[j].Classify2 + "锛�" + complaintItemDTOs[i].sysCodeDtls[j].Contents + "</span>")
- <br />
- }
- else
- {
- @Html.Raw("娉曞緥渚濇嵁" + (j + 1) + "锛�<span>銆�" + complaintItemDTOs[i].sysCodeDtls[j].CodeSn + "銆�" + complaintItemDTOs[i].sysCodeDtls[j].Classify2 + "锛�" + complaintItemDTOs[i].sysCodeDtls[j].Contents + "</span>")
- <br />
-
- }
- }
</td>
</tr>
+ <tr>
+ <td colspan="2">
+ 浜嬪疄渚濇嵁锛� @Html.Raw("<span>" + (string.IsNullOrEmpty(complaintItemDTOs[i].Evidential) ? "" : complaintItemDTOs[i].Evidential.Replace(" ", " ").Replace("\r", "<br/>")) + "</span>");
+ </td>
+ </tr>
+
+ @for (int j = 0; j < complaintItemDTOs[i].sysCodeDtls.Count; j++)
+ {
+
+
+ if (complaintItemDTOs[i].sysCodeDtls.Count == 1)
+ {
+ <tr>
+ <td colspan="2">
+ @Html.Raw("娉曞緥渚濇嵁锛�<span>銆�" + complaintItemDTOs[i].sysCodeDtls[j].CodeSn + "銆�" + complaintItemDTOs[i].sysCodeDtls[j].Classify2 + "锛�" + complaintItemDTOs[i].sysCodeDtls[j].Contents + "</span>")
+ </td>
+ </tr>
+ }
+ else
+ {
+ <tr>
+ <td colspan="2">
+ @Html.Raw("娉曞緥渚濇嵁" + (j + 1) + "锛�<span>銆�" + complaintItemDTOs[i].sysCodeDtls[j].CodeSn + "銆�" + complaintItemDTOs[i].sysCodeDtls[j].Classify2 + "锛�" + complaintItemDTOs[i].sysCodeDtls[j].Contents + "</span>")
+ </td>
+ </tr>
+
+ }
+ }
+
}
else
{
<tr>
<td colspan="2">
鎶曡瘔浜嬮」@((i+1)+"")锛�<span style="text-indent:10px">@complaintItemDTOs[i].QuestionName </span>
- <br />
- 浜嬪疄渚濇嵁@((i+1)+"")锛欯Html.Raw("<span>" +(string.IsNullOrEmpty(complaintItemDTOs[i].Evidential)?"": complaintItemDTOs[i].Evidential.Replace(" ", " ").Replace("\r", "<br/>")) + "</span>");
- <br />
- @for (int j = 0; j < complaintItemDTOs[i].sysCodeDtls.Count; j++)
- {
-
-
- if (complaintItemDTOs[i].sysCodeDtls.Count == 1)
- {
- @Html.Raw("娉曞緥渚濇嵁锛�<span>銆�" + complaintItemDTOs[i].sysCodeDtls[j].CodeSn + "銆�" + complaintItemDTOs[i].sysCodeDtls[j].Classify2 + "锛�" + complaintItemDTOs[i].sysCodeDtls[j].Contents + "</span>")
- <br />
- }
- else
- {
- @Html.Raw("娉曞緥渚濇嵁" + (j + 1) + "锛�<span>銆�" + complaintItemDTOs[i].sysCodeDtls[j].CodeSn + "銆�" + complaintItemDTOs[i].sysCodeDtls[j].Classify2 + "锛�" + complaintItemDTOs[i].sysCodeDtls[j].Contents + "</span>")
- <br />
-
- }
- }
</td>
</tr>
+ <tr>
+ <td colspan="2">
+ 浜嬪疄渚濇嵁@((i+1)+"")锛欯Html.Raw("<span>" + (string.IsNullOrEmpty(complaintItemDTOs[i].Evidential) ? "" : complaintItemDTOs[i].Evidential.Replace(" ", " ").Replace("\r", "<br/>")) + "</span>");
+ </td>
+ </tr>
+ @for (int j = 0; j < complaintItemDTOs[i].sysCodeDtls.Count; j++)
+ {
+
+
+ if (complaintItemDTOs[i].sysCodeDtls.Count == 1)
+ {
+ <tr>
+ <td colspan="2">
+ @Html.Raw("娉曞緥渚濇嵁锛�<span>銆�" + complaintItemDTOs[i].sysCodeDtls[j].CodeSn + "銆�" + complaintItemDTOs[i].sysCodeDtls[j].Classify2 + "锛�" + complaintItemDTOs[i].sysCodeDtls[j].Contents + "</span>")
+ </td>
+ </tr>
+ }
+ else
+ {
+ <tr>
+ <td colspan="2">
+ @Html.Raw("娉曞緥渚濇嵁" + (j + 1) + "锛�<span>銆�" + complaintItemDTOs[i].sysCodeDtls[j].CodeSn + "銆�" + complaintItemDTOs[i].sysCodeDtls[j].Classify2 + "锛�" + complaintItemDTOs[i].sysCodeDtls[j].Contents + "</span>")
+ </td>
+ </tr>
+
+ }
+ }
+
}
}
@@ -312,29 +356,7 @@
</div>
- <style type="text/css">
- table {
- width: 595px;
- font-size: 16pt;
- font-family: 'FangSong';
- background: #fff;
- line-height: 1.5;
- }
- span {
- font-size: 15pt;
- display: inline;
- border-bottom: 1px dashed #111;
- }
-
- s22pan:after {
- content: '';
- display: inline;
- width: 100%;
- margin-top: -5px;
- border-bottom: 1px dashed #111;
- }
- </style>
</div>
</div>
@@ -346,6 +368,10 @@
<a class="btn btn-success" href="javascript:void(0)" onclick="printWin();" style="margin-left:4px; border-radius:4px;">
<i class="glyphicon glyphicon-ok"></i> <span class="bold">鎵撳嵃</span>
+ </a>
+
+ <a class="btn btn-success" href="javascript:void(0)" onclick="daochuword();" style="margin-left:4px; border-radius:4px;">
+ <i class="glyphicon glyphicon-ok"></i> <span class="bold">瀵煎嚭word</span>
</a>
</div>
</div>
@@ -376,6 +402,9 @@
return false;
}
+ function daochuword() {
+ $("#content").wordExport("鎶曡瘔涔(Html.Raw(Model.TsrName))"); //fileName涓哄鍑虹殑word鏂囦欢鐨勫懡鍚�,content涓鸿瀵煎嚭鐨刪tml鍐呭瀹瑰櫒
+ }
--
Gitblit v1.9.1