Pārlūkot izejas kodu

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

luobang 2 gadi atpakaļ
vecāks
revīzija
d71b02e8df

+ 23 - 1
src/views/TMS/components/domesticMine/wagonLoadAdd.vue

@@ -741,13 +741,33 @@ export default {
       this.drawer = true;
       console.log("scope:",scope);
       this.index=scope.$index;
+      this.resultForeignShipName=scope.row.sendStation+scope.row.unloadPoint;
+      this.onclick();
     },
     //修改选中
     orderChange(selection) {
         console.log("order:",selection);
         this.batchId=selection.batchId;
         this.purchaseOrderId=selection.purchaseOrderId;
-        console.log("temp",this.tableData[0]);
+        let selected=this.tableData[this.index];
+        // 选中多个
+        let selects = this.$refs.importExcel.selection;
+        // //查询多个:查询所有品名、发货单位、发站、卸货地点相同的行
+        // let selects = this.tableData.filter((item)=>{
+        //   return item.productName==selected.productName &&  item.sendStation==selected.sendStation && item.unloadPoint==selected.unloadPoint
+        // });
+        //多个配单
+        selects.forEach((item)=>{
+          item.batchId=selection.batchId;
+          item.purchaseOrderId=selection.purchaseOrderId;
+          item.supplierId=selection.supplierId;
+          item.supplierName=selection.supplierName;
+          item.materialId=selection.materialId;
+          item.materialName=selection.materialName;
+          item.purchaseOrderNo=selection.purchaseOrderNo;
+          item.unloadPoint=selection.resultForeignShipName;
+        });
+        // 单个配单
         this.tableData[this.index].batchId=selection.batchId;
         this.tableData[this.index].purchaseOrderId=selection.purchaseOrderId;
         this.tableData[this.index].supplierId=selection.supplierId;
@@ -760,6 +780,8 @@ export default {
     },
     handleClose(done) {
       this.$refs.ordertable.$refs.mainTable.setCurrentRow();//清除选项
+      //清空选中
+      this.$refs.importExcel.clearSelection();
       done();
     }
   }

+ 5 - 3
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailsOrderNew.vue

@@ -789,11 +789,11 @@
             ref="statementUpload"
             list-type="picture-card"
             action="/api/v1/otms/addtmstruckArrivalResult"
-            :limit="1"
+            :limit="10"
             :on-change="fileChange1"
             :on-preview="handlePictureCardPreview"
             :on-exceed="exceed"
-            accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
+            accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
             :auto-upload="false"
           >
             <i class="el-icon-plus"></i>
@@ -1568,7 +1568,9 @@ export default {
         })
         console.log(orderList, 'orderList')
         let formData = new window.FormData()
-        formData.append('file0', this.statementList[0].raw)
+        this.statementList.forEach((item,index)=>{
+          formData.append('file'+index, item.raw)
+        });
         formData.append('orderList', orderList)
         formData.append('excludeTax', this.excludeTax)
         formData.append('userId', getCookie('userId'))

+ 20 - 2
src/views/statisticalReport/components/salesLogisticsStatistics/steelTransportReport.vue

@@ -28,7 +28,7 @@
           </el-button>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="exportAllReportToExcel"
+          <el-button type="primary" @click="exportToExcel('钢材运输情况统计表')"
             >下载Excel</el-button
           >
         </el-form-item>
@@ -41,6 +41,7 @@
       <div class="null"></div>
       <el-table
         :data="tableData"
+        id="tableRef"
         ref="tableRef"
         border
         :cell-style="cellStyle"
@@ -260,7 +261,24 @@ export default {
   },
   mounted() {},
   methods: {
-    // exportAllReportToExcel() {},
+    exportToExcel(tableTitle="表格标题") {
+        let tables = document.getElementById("tableRef");//此处是拿表格document元素,也可以取父div的ref
+        let table_book = XLSX.utils.table_to_book(tables);
+        var table_write = XLSX.write(table_book, {
+            bookType: "xlsx",
+            bookSST: true,
+            type: "array"
+        });
+        try {
+            FileSaver.saveAs(
+                new Blob([table_write], { type: "application/octet-stream" }),
+                tableTitle+".xlsx"
+            );
+        } catch (e) {
+            if (typeof console !== "undefined") console.log(e, table_write);
+        }
+        return table_write;
+    },
 
     steelTransportReport() {
       this.axios