Przeglądaj źródła

委外订单国内国外附件按钮

jbb 2 lat temu
rodzic
commit
c4d003029d
1 zmienionych plików z 34 dodań i 1 usunięć
  1. 34 1
      src/views/reportForms/fabric-loss-table.vue

+ 34 - 1
src/views/reportForms/fabric-loss-table.vue

@@ -158,6 +158,10 @@
           <span slot="purchaseInQuantity" slot-scope="text">
             <a>{{ text }}</a>
           </span>
+          <!-- 附件 -->
+          <span slot="enclosure" slot-scope="text, record"> 
+             <a-button type="primary" @click="openItemOnclosure(record)" :disabled="record.buttonStatus">附件</a-button>
+          </span>
         </a-table>
       </div>
 
@@ -181,6 +185,10 @@
           <span slot="purchaseInQuantity" slot-scope="text">
             <a>{{ text }}</a>
           </span>
+           <!-- 附件 -->
+          <span slot="enclosure" slot-scope="text, record"> 
+             <a-button type="primary" @click="openItemOnclosure(record)" disabled="record.buttonStatus">附件</a-button>
+          </span>
         </a-table>
       </div>
 
@@ -508,7 +516,8 @@ export default {
         { title: '货物名称', dataIndex: 'cinvName', width: 340, className: 'replacecolor', align:'left' },
         { title: '颜色', dataIndex: 'ccolor', width: 120, className: 'replacecolor' },
         { title: '损耗', dataIndex: 'cquantityLoss', wiclassName: 'replacecolor' },
-        { title: '多发少发', dataIndex: 'iquantityMoreLess', width: 120, className: 'replacecolor' }
+        { title: '多发少发', dataIndex: 'iquantityMoreLess', width: 120, className: 'replacecolor' },
+        { title: '附件', dataIndex: 'enclosure', width: 120, className: 'replacecolor', scopedSlots: { customRender: 'enclosure' }, }
       ],
 
       // 成本发票 表头
@@ -694,6 +703,20 @@ export default {
               else
                 this.costInvoiceIngredientColumns = this.costInvoiceIngredientColumnsAll;
               this.fabricLoss = res.result;
+              // 委外订单国内附件按钮状态
+              this.fabricLoss.fabricOMOrderList1.map(item=>{
+                item.buttonStatus = false
+                if(!item.accessorItemList||item.accessorItemList.length == 0  ){
+                  item.buttonStatus = true
+                }
+              })
+              // 委外订单国外附件按钮状态
+             this.fabricLoss.fabricOMOrderList2.map(item=>{
+                item.buttonStatus = false
+                if(!item.accessorItemList||item.accessorItemList.length == 0 ){
+                  item.buttonStatus = true
+                }
+              })
               this.fabricLoss.fabricCostClothesList.map((item,index) => {item.index = index +1})
               this.fabricLoss.fabricCostClothList.map((item,index) => {item.index = index +1})
               this.fabricLoss.fabricCostAssistList.map((item,index) => {item.index = index +1})
@@ -901,6 +924,16 @@ export default {
       }
       this.$refs.attachmentDisplay.attachmentData =  attachList;
     },
+    openItemOnclosure(record){
+      var attachList = [];
+        record.accessorItemList.forEach(e=>{
+          var attach = {};
+          attach.name = e.filename;
+          attach.src=e.fileurl;
+          attachList.push(attach);
+        });
+      this.$refs.attachmentDisplay.attachmentData =  attachList;
+    },
 
     // father
     aa() {},