From 26de0696f74e183e3aadad2e9ff1918b40e5c8cc Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期四, 09 三月 2023 13:46:27 +0800
Subject: [PATCH] 修改导出文书word

---
 zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml |  175 +++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 105 insertions(+), 70 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml b/zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml
index 4b41243..c8ccea6 100644
--- a/zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/CooperOrder/Printtousushu.cshtml
@@ -90,21 +90,21 @@
     @*<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>
+    <script language="javascript" src="~/js/fileSaver.js?v=2" type="text/javascript"></script>
+    <script language="javascript" src="~/js/jquery.wordexport.js?v=2" 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-x:hidden;  overflow-y:auto;height:100%;background: #fff;width:850px; margin: 0 auto;">
-                    <style type="text/css">
+                    <style type="text/css" >
                         table {
                             width: 595px;
                             font-size: 14pt;
                             font-family: 'FangSong';
                             background: #fff;
-                            line-height: 1.5;
+                            line-height: 150%;
                         }
 
                         span {
@@ -124,7 +124,7 @@
                     <div id="page1" style="page-break-after:always;">
                         <table border="0" align="center" cellpadding="3" cellspacing="0">
                             <tr>
-                                <td colspan="2" style="font-size:29.3px;text-align:center">鎶曡瘔涔︼紙姝f湰锛�</td>
+                                <td colspan="2" style="font-size:21px; text-align: center "><b>鎶曡瘔涔︼紙姝f湰锛�</b></td>
                             </tr>
                             <tr>
                                 <td colspan="2"><b>涓�銆佹姇璇夌浉鍏充富浣撳熀鏈俊鎭�</b></td>
@@ -407,11 +407,11 @@
                                 }
                             }
                             @*<tr>
-            <td colspan="2" align="left">璇锋眰锛�<span>@Model.RequestInfoName</span></td>
-        </tr>*@
+                        <td colspan="2" align="left">璇锋眰锛�<span>@Model.RequestInfoName</span></td>
+                    </tr>*@
                             @*<tr>
-            <td colspan="2" style="height:15px"></td>
-        </tr>*@
+                        <td colspan="2" style="height:15px"></td>
+                    </tr>*@
                             <tr>
                                 <td align="left">绛惧瓧(绛剧珷)锛�</td>
                                 <td align="left">鍏珷锛�</td>
@@ -428,22 +428,22 @@
 
                 <div id="zhuti">
                     @{
-                                        for (int i = 0; i < yinyezhizhaosssss.Count; i++)
-                                        {
-                        <div style="page-break-after:always;">
-                            <img src="@yinyezhizhaosssss[i].Filepath" alt="" style="height: auto; max-width: 100%; ">
+                        for (int i = 0; i < yinyezhizhaosssss.Count; i++)
+                        {
+                            <div style="page-break-after:always;">
+                                <img src="@yinyezhizhaosssss[i].Filepath" alt="" style="height: auto; max-width: 100%; ">
 
-                        </div>
-                                        }
+                            </div>
+                        }
 
 
-                            for (int i = 0; i < shenfenzhengsssss.Count; i++)
-                                        {
-                        <div style="page-break-after:always;">
-                            <img src="@shenfenzhengsssss[i].Filepath" alt="" style="height: auto; max-width: 100%; ">
+                        for (int i = 0; i < shenfenzhengsssss.Count; i++)
+                        {
+                            <div style="page-break-after:always;">
+                                <img src="@shenfenzhengsssss[i].Filepath" alt="" style="height: auto; max-width: 100%; ">
 
-                        </div>
-                                        }
+                            </div>
+                        }
                     }
 
                     <div style="page-break-after:always;">
@@ -451,8 +451,9 @@
                             <tr>
                                 <td colspan="2" style="font-size:29.3px;text-align:center">娉曞畾浠h〃浜鸿祫鏍艰瘉鏄庝功</td>
                             </tr>
+
                             <tr>
-                                <td colspan="2">鍏硅瘉鏄�&nbsp;  @(cooperatecustomCustomerDTO.FName)  &nbsp;鍦�   &nbsp;@(cooperatecustomCustomerDTO.Name)  &nbsp; 浠�    &nbsp;@(cooperatecustomCustomerDTO.Zhiwu) &nbsp;   鑱屽姟锛屾槸   &nbsp;@(cooperatecustomCustomerDTO.Name) &nbsp;  鐨勬硶瀹氫唬琛ㄤ汉銆�</td>
+                                <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;鍏硅瘉鏄�&nbsp;  @(cooperatecustomCustomerDTO.FName)  &nbsp;鍦�   &nbsp;@(cooperatecustomCustomerDTO.Name)  &nbsp; 浠�    &nbsp;@(cooperatecustomCustomerDTO.Zhiwu) &nbsp;   鑱屽姟锛屾槸   &nbsp;@(cooperatecustomCustomerDTO.Name) &nbsp;  鐨勬硶瀹氫唬琛ㄤ汉銆�</td>
                             </tr>
                             <tr>
                                 <td colspan="2" align="left">&nbsp; &nbsp; 鐗规璇佹槑銆�</td>
@@ -475,49 +476,56 @@
 
                 <div id="zhuti1">
                     @{
-                                        for (int i = 0; i < yinyezhizhaosssss.Count; i++)
-                                        {
-                        <div style="page-break-after:always;">
+                        for (int i = 0; i < yinyezhizhaosssss.Count; i++)
+                        {
+                            <br clear=all style="page-break-before:always" mce_style="page-break-before:always">
+
                             <img src="@yinyezhizhaosssss[i].Filepath" alt="" style="height: auto; max-width: 100%; ">
 
-                        </div>
-                                        }
+
+                        }
 
 
-                            for (int i = 0; i < shenfenzhengsssss.Count; i++)
-                                        {
-                        <div style="page-break-after:always;">
+                        for (int i = 0; i < shenfenzhengsssss.Count; i++)
+                        {
+                            <br clear=all style="page-break-before:always" mce_style="page-break-before:always">
+
                             <img src="@shenfenzhengsssss[i].Filepath" alt="" style="height: auto; max-width: 100%; ">
 
-                        </div>
-                                        }
-                    }
 
-                    <div style="page-break-after:always;">
-                        <table border="0" align="center" cellpadding="3" cellspacing="0">
-                            <tr>
-                                <td colspan="2" style="font-size:29.3px;text-align:center">娉曞畾浠h〃浜鸿祫鏍艰瘉鏄庝功</td>
-                            </tr>
-                            <tr>
-                                <td colspan="2">鍏硅瘉鏄�&nbsp;  @(cooperatecustomCustomerDTO.FName)  &nbsp;鍦�   &nbsp;@(cooperatecustomCustomerDTO.Name)  &nbsp; 浠�    &nbsp;@(cooperatecustomCustomerDTO.Zhiwu) &nbsp;   鑱屽姟锛屾槸   &nbsp;@(cooperatecustomCustomerDTO.Name) &nbsp;  鐨勬硶瀹氫唬琛ㄤ汉銆�</td>
-                            </tr>
-                            <tr>
-                                <td colspan="2" align="left">&nbsp; &nbsp; 鐗规璇佹槑銆�</td>
-                            </tr>
-                            <tr>
-                                <td colspan="2" style="height:50px"></td>
-                            </tr>
-                            <tr>
-                                <td colspan="2" align="right">宸濆嵃鏂囧寲闆嗗洟鑲′唤鏈夐檺鍏徃锛堝叕绔狅級</td>
-                            </tr>
-                            <tr>
-                                <td colspan="2" align="right">鏃ユ湡锛欯Model.Modifytime.Value.ToString("yyyy骞碝M鏈坉d鏃�")</td>
-                            </tr>
-                        </table>
-                    </div>
+                        }
+                    }
+                    <br clear=all style="page-break-before:always" mce_style="page-break-before:always">
+
+                    <table border="0" align="center" cellpadding="3" cellspacing="0">
+                        <tr>
+                            <td colspan="2" style="font-size:29.3px;text-align:center">娉曞畾浠h〃浜鸿祫鏍艰瘉鏄庝功</td>
+                        </tr>
+
+                        <tr>
+                            <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鍏硅瘉鏄�&nbsp;  @(cooperatecustomCustomerDTO.FName)  &nbsp;鍦�   &nbsp;@(cooperatecustomCustomerDTO.Name)  &nbsp; 浠�    &nbsp;@(cooperatecustomCustomerDTO.Zhiwu) &nbsp;   鑱屽姟锛屾槸   &nbsp;@(cooperatecustomCustomerDTO.Name) &nbsp;  鐨勬硶瀹氫唬琛ㄤ汉銆�</td>
+                        </tr>
+                        <tr>
+                            <td colspan="2" align="left">&nbsp; &nbsp; 鐗规璇佹槑銆�</td>
+                        </tr>
+                        <tr>
+                            <td colspan="2" style="height:50px"></td>
+                        </tr>
+                        <tr>
+                            <td colspan="2" align="right">宸濆嵃鏂囧寲闆嗗洟鑲′唤鏈夐檺鍏徃锛堝叕绔狅級</td>
+                        </tr>
+                        <tr>
+                            <td colspan="2" align="right">鏃ユ湡锛欯Model.Modifytime.Value.ToString("yyyy骞碝M鏈坉d鏃�")</td>
+                        </tr>
+                    </table>
+
 
 
                 </div>
+
+
+
+               
             </div>
 
         </div>
@@ -542,6 +550,7 @@
     <script type="text/javascript">
         $('#zhuti').hide();
         $('#zhuti1').hide();
+        
 
         function printWin() {
 
@@ -551,7 +560,7 @@
                 , content: '   <div class="clearfix layer-area" style="padding-bottom:15px;"> ' +
                     ' <label class="text-right col-sm-6 col-md-6 control-label">鍓湰鏁伴噺</label>' +
                     '   <div class="col-sm-6 col-md-6">' +
-                    ' <input class="form-control" label="鍓湰鏁伴噺" name="PrintNums" id="PrintNums" labtype="txt" addvisible="true"   type="number" value="@(PrintNum)" oninput="if(value.length>2)value=value.slice(0,2)" >' +
+                    ' <input class="form-control" label="鍓湰鏁伴噺" name="PrintNums" id="PrintNums" labtype="txt" addvisible="true"   type="text" value="@(PrintNum)" oninput="if(value.length>2)value=value.slice(0,2)" >' +
 
 
                     '</div>' +
@@ -627,7 +636,7 @@
                 , content: '   <div class="clearfix layer-area" style="padding-bottom:15px;"> ' +
                     ' <label class="text-right col-sm-6 col-md-6 control-label">鍓湰鏁伴噺</label>' +
                     '   <div class="col-sm-6 col-md-6">' +
-                    ' <input class="form-control" label="鍓湰鏁伴噺" name="PrintNums" id="PrintNums" labtype="txt" addvisible="true"   type="number" value="0" oninput="if(value.length>2)value=value.slice(0,2)" >' +
+                    ' <input class="form-control" label="鍓湰鏁伴噺" name="PrintNums" id="PrintNums" labtype="txt" addvisible="true"   type="text" value="0" oninput="if(value.length>2)value=value.slice(0,2)" >' +
 
 
                     '</div>' +
@@ -645,31 +654,57 @@
                 yes: function (index, layero) {
 
 
+                    
 
-
-                    var pt = document.getElementById("page1").innerHTML;
+                    var pt = $('#page1').html();
                     var zhutiziliao = $('#zhutiziliao').val();
+                     $('#content').append(' <div id ="zhutilinshi">  <style type="text/css" >'+
+                         ' table {' +
+                          'width: 595px;' +
+                          'font-size: 14pt;' +
+                         ' font-family: "FangSong";' +
+                          'background: #fff;' +
+                          ' line-height: 150%;' +
+                          ' }' +
+
+                          '  span {' +
+                          ' font-size: 14pt;' +
+                          'display: inline;' +
+            
+                          ' }' +
+
+                          ' s22pan: after {' +
+                         '    content: "";' +
+                          '   display: inline;' +
+                          '   width: 100%;' +
+                          '  margin-top: -5px;' +
+                          ' }' +
+                '     </style >  </div >');
+                
+                    $('#zhutilinshi').append($('#page1').html());
                     if (zhutiziliao == "0") {
-                        $('#content').append(' <div id ="zhutilinshi"> </div >');
-                        $('#zhutilinshi').append(document.getElementById("zhuti1").innerHTML);
+                     
+                        $('#zhutilinshi').append($('#zhuti1').html());
 
                     }
                     var a = parseInt($('#PrintNums').val());
 
                     pt = pt.replace("鎶曡瘔涔︼紙姝f湰锛�","鎶曡瘔涔︼紙鍓湰锛�");
-        if (a > 0) {
-            $('#content').append(' <div id ="fuben"> </div >');
-            for (var i = 0; i < a; i++) {
-                $('#fuben').append(' <div style="page-break-after:always;">' + pt +' </div>');
-            }
+                    if (a > 0) {
+                        for (var i = 0; i < a; i++) {
+                            $('#zhutilinshi').append('  <br clear=all style="page-break-before:always" mce_style="page-break-before:always"> ' + pt + ' ');
 
-            }
+                        }
 
-                    $("#content").wordExport("鎶曡瘔涔(Html.Raw(Model.TsrName))");                  //fileName涓哄鍑虹殑word鏂囦欢鐨勫懡鍚�,content涓鸿瀵煎嚭鐨刪tml鍐呭瀹瑰櫒
-                    $('#fuben').remove();
+                    }
+                   // console.log(document.getElementById("zhutilinshi").innerHTML);
+                     
+
+
+                    $("#zhutilinshi").wordExport("鎶曡瘔涔(Html.Raw(Model.TsrName))");                  //fileName涓哄鍑虹殑word鏂囦欢鐨勫懡鍚�,content涓鸿瀵煎嚭鐨刪tml鍐呭瀹瑰櫒
                     $('#zhutilinshi').remove();
                     layer.close(index);
-                    $('#zhuti').hide();
+                    $('#zhuti1').hide();
 
                     return false;
 

--
Gitblit v1.9.1