浏览代码

面损耗表更新

jbb 2 年之前
父节点
当前提交
e87a7e5630
共有 1 个文件被更改,包括 42 次插入13 次删除
  1. 42 13
      src/views/reportForms/fabric-loss-table.vue

+ 42 - 13
src/views/reportForms/fabric-loss-table.vue

@@ -10,10 +10,11 @@
               <a-form-model-item label="计划单号">
                 <a-input-search
                   placeholder="请输入计划单号"
+                  v-model="planNO"
                   enter-button
                   @search="onSearch($event,'0')"
                 />
-                <a-button type="primary" :disabled="edit == '0'" @click="onSearch($event,'1')">更新</a-button>
+                <a-button type="primary" :disabled="edit == '0'" @click="onSearch(planNO,'1')">更新</a-button>
               </a-form-model-item>
             </a-col>
 
@@ -91,8 +92,8 @@
 
     <!-- 子表 -->
     <a-card style="margin:10px 0;">
-      <!-- 采购订单 -->
-      <div class="purchase-order-table">
+      <div id="cbn">
+        <div class="purchase-order-table">
         <h6 class="table-title">采购订单</h6>
 
         <a-table
@@ -135,11 +136,11 @@
       </div>
 
       <!-- 委外订单国内 -->
-      <div class="outsource-orders-table" style="margin:40px 0">
+      <div class="outsource-orders-table" style="margin:40px 0" id="mm">
         <h6 class="table-title">委外订单国内</h6>
-        <h6 @click="daYin">打印</h6>
         <a-table 
            id="print1"
+           ref="form"
           :row-key="record => record.id"
           :columns="outsourceOrderColumns" 
           :data-source="fabricLoss.fabricOMOrderList1" 
@@ -164,7 +165,7 @@
       </div>
 
       <!-- 委外订单国外 -->
-      <div class="outsourceOrder-abroad-table">
+      <div class="outsourceOrder-abroad-table" id="cb">
         <h6 class="table-title">委外订单国外</h6>
         <a-table
           :row-key="record => record.id"
@@ -294,6 +295,8 @@
           </span>
         </a-table>
       </div>
+      </div>
+      
 
       <!-- 备注信息 1 根据角色判断 显示备注 1 或备注 2-->
       <div class="note-one" style="marginTop:40px;">
@@ -306,6 +309,8 @@
           </a-form-model>
         </div>
       </div>
+      <!-- 采购订单 -->
+     
 
       <!-- 备注信息 2 根据角色判断 显示备注 1 或备注 2-->
       <!-- <div class="note-one" style="marginTop:40px;">
@@ -326,10 +331,13 @@
 
       <!-- 页面底部保存 -->
       <a-row :gutter="24" style="marginTop:40px;float:right">
-        <a-col :md="12" :sm="12">
-          <a-button type="primary" @click="save">
+        <a-col :md="12" :sm="12" style="display:flex">
+          <a-button type="primary" @click="daYin" style="margin-right:6px">
+            打印
+          </a-button> 
+            <a-button type="primary" @click="save">
             保存
-          </a-button>
+          </a-button>       
         </a-col>
       </a-row>
 
@@ -411,6 +419,7 @@ export default {
         planNum: [{ required: true, message: '请输入计划单号进行搜索', trigger: 'blur' }]
       },
       edit:'0',
+      planNO:'',//计划单号
       // 采购订单 表头
       purchaseOrderColumns: [
         { title: '货物名称', width: 180, dataIndex: 'cinvName', className: 'replacecolor', align:'left'},
@@ -522,7 +531,7 @@ export default {
         { title: '颜色', dataIndex: 'ccolor', width: 110, className: 'replacecolor' },
         { title: '损耗', dataIndex: 'cquantityLoss',  width: 120,className: 'replacecolor' },
         { title: '多发少发', dataIndex: 'iquantityMoreLess', width: 120, className: 'replacecolor' },
-        { title: '附件', dataIndex: 'enclosure', width: 120, className: 'replacecolor', scopedSlots: { customRender: 'enclosure' }, fixed: 'right'}
+        { title: '附件', dataIndex: 'enclosure', width: 120, className: 'replacecolor', scopedSlots: { customRender: 'enclosure' }}
       ],
 
       // 成本发票 表头
@@ -686,11 +695,31 @@ export default {
 
   methods: {
     daYin(){
-       const html = window.document.getElementById('print1').innerHTML;
+      //  printJS({
+	    //      printable:this.fabricLoss.fabricOMOrderList1,
+	    //      properties:[
+      //        {field:'cvcname',displayName:'制造工艺',columnSize:1},
+      //        {field:'cvenAbbName',displayName:'工厂',columnSize:1},
+      //        {field:'iquantityOut',displayName:'材料出库数量',columnSize:1},
+      //        {field:'iquantity', displayName:'计划数量',columnSize:1},
+      //        {field:'iquantityIn', displayName:'采购入库数量',columnSize:1},
+      //        {field:'cinvCode', displayName:'物料编码',columnSize:1},
+      //        {field:'cinvName', displayName:'货物名称',columnSize:1},
+      //        {field:'ccolor', displayName:'颜色',columnSize:1},
+      //        {field:'cquantityLoss', displayName:'损耗',columnSize:1},
+      //        {field:'iquantityMoreLess', displayName:'多发少发',columnSize:1},
+      //        ],
+	    //      type:'json',
+	    //      header:'C001',
+	         //样式设置
+	        //  gridStyle:'border:2px solid #3971A5;text-align: center',
+	        //  gridHeaderStyle:'color:red; border:2px solid #3971A5;'
+	    //  })
+       const html = window.document.getElementById('cbn').innerHTML
          const win = window.open();
          const style = '<style>\n'
-    + 'table{width: 100%;border-collapse: collapse;border-spacing: 0;}\n'
-    + 'th,td{width: 5%;height: 18px;padding:11px;border: 1px solid #999;font-size: 12px;color: #666;}\n'
+       + 'table{width: 100%;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
+        + 'th,td{width: 5%;height: 18px;padding:11px;border: 1px solid #999;font-size: 12px;color: #666;max-width:2000px}\n'
     + 'th{color: #333}\n'
     + 'a{color: #666; text-decoration:none;}\n'
     + 'tr[empty-template] td{text-align: center}\n'