Browse Source

面料损耗表更新按钮

jbb 2 years ago
parent
commit
ed30d5efe2
1 changed files with 32 additions and 4 deletions
  1. 32 4
      src/views/reportForms/fabric-loss-table.vue

+ 32 - 4
src/views/reportForms/fabric-loss-table.vue

@@ -11,8 +11,9 @@
                 <a-input-search
                   placeholder="请输入计划单号"
                   enter-button
-                  @search="onSearch"
+                  @search="onSearch($event,'1')"
                 />
+                <a-button type="primary" :disabled="edit == '1'" @click="onSearch($event,'0')">更新</a-button>
               </a-form-model-item>
             </a-col>
 
@@ -136,7 +137,9 @@
       <!-- 委外订单国内 -->
       <div class="outsource-orders-table" style="margin:40px 0">
         <h6 class="table-title">委外订单国内</h6>
+        <h6 @click="daYin">打印</h6>
         <a-table 
+           id="print1"
           :row-key="record => record.id"
           :columns="outsourceOrderColumns" 
           :data-source="fabricLoss.fabricOMOrderList1" 
@@ -407,6 +410,7 @@ export default {
       validatorRules: {
         planNum: [{ required: true, message: '请输入计划单号进行搜索', trigger: 'blur' }]
       },
+      edit:'1',
       // 采购订单 表头
       purchaseOrderColumns: [
         { title: '货物名称', width: 180, dataIndex: 'cinvName', className: 'replacecolor', align:'left'},
@@ -680,17 +684,31 @@ export default {
   },
 
   methods: {
+    daYin(){
+       const html = window.document.getElementById('print1').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'
+    + 'th{color: #333}\n'
+    + 'a{color: #666; text-decoration:none;}\n'
+    + 'tr[empty-template] td{text-align: center}\n'
++ '</style>';
+  win.document.write(style+html);
+  win.focus();
+  win.print();
+  win.close();
+    },
     // 【计划单号】 搜索
-    onSearch(value) {
+    onSearch(value,update) {
       if (value == "" || value == null){
         this.$message.error('请输入计划号!');
       }else{
         this.loading = true;
         this.$nextTick(() => {
-          getFabricLossDatas({csocode:value}).then(res => {
+          getFabricLossDatas({csocode:value,update:update}).then(res => {
             this.loading = false;
             if (res.success) {
-
               // 开票成本成衣:获取原币和本币金额是否完全相同,完全相同隐藏美元列
               var findList = this.fabricLoss.fabricCostClothesList.filter(e=>e.ioriSum!=e.isum);
               if (findList.length == 0)
@@ -704,6 +722,7 @@ export default {
               else
                 this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsAll;
               this.fabricLoss = res.result;
+              this.edit = this.fabricLoss.edit
               // 委外订单国内附件按钮状态
               this.fabricLoss.fabricOMOrderList1.map(item=>{
                 item.buttonStatus = false
@@ -1052,4 +1071,13 @@ export default {
   border: none;
   padding: 0;
 }
+/deep/ .ant-form-item-children {
+  display: flex;
+}
+/deep/ form :not(.ant-input-group-wrapper) > .ant-input-group, form .ant-input-group-wrapper{
+  width: 65% !important;
+}
+/deep/ .ant-input-group{
+  padding-right: 6px !important;
+}
 </style>