Browse Source

前端代码合并提交

Administrator 3 years ago
parent
commit
da6f31b8d7

+ 0 - 2
src/views/customer/Customer.vue

@@ -977,8 +977,6 @@ import XLSX from "xlsx";
             };
             this.customer['id'] = 0;
             this.customer['accstatus'] = 0;
-            this.current = 1;
-            this.pagesize = 8;
           },
           custRecClose() {
             this.recVis = false,

+ 0 - 1
src/views/noCar/billway.vue

@@ -268,7 +268,6 @@ import XLSX from "xlsx";
             }
           },
     importExcel (content) {
-      debugger
     const file = content.file
     // let file = file.files[0] // 使用传统的input方法需要加上这一步
     const filename = file.name

+ 49 - 30
src/views/noCar/calculateInfo.vue

@@ -177,11 +177,20 @@ import XLSX from "xlsx";
                              spinner: 'el-icon-loading',
                              background: 'rgba(0, 0, 0, 0.7)'
                            });
-         let curr = this.current;
-      let pagesize1 = this.pagesize;
-      this.current = 1;
-      this.pagesize = this.total;
-      await this.loadData();
+        
+        var recodes = [];
+            for(var j=1;j<=this.total/10000+1;j++){
+               const formData = new FormData();
+                formData.append('current', j);
+                formData.append('size', 10000);
+                for(var i in this.formCondition){
+                    formData.append(i,this.formCondition[i]);
+                }
+                const response = await this.$http.post(`noCar/findNocarCalculateInfo`, formData);
+                if (response.data.code === 0) {
+                recodes = recodes.concat(response.data.data.records);
+                }
+            }
       // 设置当前日期
       let time = new Date();
       //console.log(time);
@@ -189,32 +198,42 @@ import XLSX from "xlsx";
       let month = time.getMonth() + 1;
       let day = time.getDate();
       let name = "无车计费查询列表_"+year + "" + month + "" + day;
-      // console.log(name)
-      /* generate workbook object from table */
-      //  .table要导出的是哪一个表格
-      var wb = XLSX.utils.table_to_book(document.querySelector(".table"),{ raw: true });
-      this.formartNum(wb);
-      /* get binary string as output */
-      var wbout = XLSX.write(wb, {
-        bookType: "xlsx",
-        bookSST: true,
-        type: "array"
-      });
-      try {
-        //  name+'.xlsx'表示导出的excel表格名字
-        FileSaver.saveAs(
-          new Blob([wbout], { type: "application/octet-stream" }),
-          name + ".xlsx"
-        );
-      } catch (e) {
-        if (typeof console !== "undefined") console.log(e, wbout);
-      }
-       this.current = curr;
-      this.pagesize = pagesize1;
-      this.loadData();
-      loading.close();
-      return wbout;
+       let cloums = [
+                          {"title":"主体名称","key":"companyLongName"},
+                          {"title":"购方名称","key":"buyerName"},
+                          {"title":"购方税号","key":"buyerTaxpayerCode"},
+                          {"title":"交易Id","key":"tradeId"},
+                          {"title":"费用","key":"fee"},
+                          {"title":"计费时间","key":"calculateTime"},
+                          {"title":"开票时间","key":"invoiceMakeTime"},
+                    ];
+      await this.exportExcelComm(cloums,recodes,name,loading);
     },
+     // 导出Excel
+          exportExcelComm(columns,list,excelName,loading){
+                  require.ensure([], () => {
+                      const { export_json_to_excel } = require('@/vendor/Export2Excel');
+                      let tHeader = []
+                      let filterVal = []
+                      columns.forEach(item =>{
+                          tHeader.push(item.title)
+                          filterVal.push(item.key)
+                      })
+                      for(var i =0;i<list.length/200000;i++){
+                        const data = this.formatJson(filterVal, list.slice(i*200000,(i+1)*200000>list.length?list.length:(i+1)*200000));
+                        export_json_to_excel(tHeader, data, excelName+'_'+i);
+                      }
+                      
+                      loading.close();
+                  })
+            },
+            formatJson (filterVal, jsonData) {
+            return jsonData.map(v => filterVal.map(j => {
+              return v[j];
+              
+              }));
+          },
+    
         }
       };
 </script>

+ 1 - 1
src/views/noCar/calculateInfostatis.vue

@@ -72,7 +72,7 @@ import XLSX from "xlsx";
         },
         created() {
           this.heightt = tableHeight;
-          this.loadData();
+         // this.loadData();
         },
          filters: {
             rounding (value) {

+ 1 - 1
src/views/noCar/invoice.vue

@@ -503,7 +503,7 @@ import XLSX from "xlsx";
                     let name = "无车发票查询列表_"+year + "" + month + "" + day;
                     let cloums = [
                       {"title":"企业编号","key":"companyNum"},
-                      {"title":"公司名称","key":"companyName"},
+                      {"title":"公司名称","key":"buyerName"},
                       {"title":"运单号","key":"waybillNum"},
                       {"title":"购方税号","key":"buyerTaxpayerCode"},
                       {"title":"车牌号码","key":"plateNum"},

+ 1 - 1
src/views/platform/apply/apply.vue

@@ -26,7 +26,7 @@
                 type="datetime"
                 placeholder="选择开始日期时间"
                 style="margin-left: 1%;"
-                @change="changeStartDate">
+               >
                </el-date-picker>
               <el-date-picker
                 v-model="endTime"

+ 2 - 1
src/views/platform/apply/selfCarTrade.vue

@@ -123,7 +123,8 @@ import XLSX from "xlsx";
           return{
             formCondition:{
               customId:'',
-              status:2
+              status:2,
+              companyName:''
             },
              multipleSelection:[],
             statusList:[{status:1,statusName:"待开票"},{status:2,statusName:"开票中"},{status:3,statusName:"已开票"}],

+ 1 - 1
src/views/platform/invoice/list.vue

@@ -466,7 +466,7 @@ export default{
                     let name = "无车发票查询列表_"+year + "" + month + "" + day;
                     let cloums = [
                       {"title":"企业编号","key":"companyNum"},
-                      {"title":"公司名称","key":"companyName"},
+                      {"title":"公司名称","key":"buyerName"},
                       {"title":"运单号","key":"waybillNum"},
                       {"title":"购方税号","key":"buyerTaxpayerCode"},
                       {"title":"车牌号码","key":"plateNum"},