瀏覽代碼

发票查询

mashengyi 3 年之前
父節點
當前提交
4f23f08073
共有 1 個文件被更改,包括 32 次插入123 次删除
  1. 32 123
      src/views/platform/invoice/list.vue

+ 32 - 123
src/views/platform/invoice/list.vue

@@ -8,7 +8,6 @@
               <el-input  placeholder="运单编号" class="input-demo" v-model="waybillNum"></el-input>
               <el-input  placeholder="车牌号" class="input-demo" v-model="plateNum"></el-input>
               <el-input  placeholder="发票号码" class="input-demo" v-model="invoiceNum"></el-input>
-              <el-input  placeholder="批次号" class="input-demo" v-model="batchNumber"></el-input>
             </div>
           </el-col>
         </el-row>
@@ -32,15 +31,15 @@
 
               <label style="margin-left: 1%;">发票抬头:</label>
               <el-select v-model="taxPlayerCode" placeholder="请选择发票抬头">
-                <el-option
-                  v-for="item in option"
-                  :key="item.dutyParagraph"
-                  :label="item.company"
-                  :value="item.dutyParagraph">
+                 <el-option
+                  v-for="item in companyList"
+                  :key="item.companyName"
+                  :label="item.companyName"
+                  :value="item.companyName">
                 </el-option>
               </el-select>
 
-              <el-button type="success" style="margin-left: 1%;" @click="queryLook">查询</el-button>
+              <el-button type="success" style="margin-left: 1%;" @click="loadData">查询</el-button>
               <el-button type="success" style="margin-left: 1%;" @click="exportOut">导出</el-button>
 <!--              <el-button type="success" style="margin-left: 1%;" @click="packDownload"-->
 <!--                         v-loading.fullscreen.lock="fullscreenLoading">打包下载-->
@@ -75,7 +74,7 @@
               </template>
             </el-table-column>
             <el-table-column
-              prop="transactionId"
+              prop="feeCount"
               label="计费条数"
               show-overflow-tooltip>
             </el-table-column>
@@ -207,8 +206,7 @@ export default{
       pagesize: 8,
       total: 0,
       usertable: [],
-      allmeterList: [],
-      option: [],
+      companyList: [],
       waybillNum: "",
       taxPlayerCode: "",
       plateNum: "",
@@ -217,102 +215,37 @@ export default{
       endTime: "",
       batchNumber: '',
       invoiceUrl: '',
+      allmeterList:[],
       formUserList: {
         "userName":"",
         "roleId":"",
         "userId":""
       },
-
-      multipleSelection: [],
       packDownloadDisabled: false,
     }
   },
   created() {
-    this.loadData();
-    this.loadInvoice();
-    this.loadAllMeter();
+    this.initCompanyList();
   },
   methods: {
     // 列表展示
     async loadData() {
-      this.formUserList.userName = sessionStorage.getItem('userName');
-      this.formUserList.userId = sessionStorage.getItem('userId');
-      this.formUserList.roleId = sessionStorage.getItem('roleId');
-      if(this.formUserList.roleId == 1) {
-        const formData = new FormData();
-        formData.append('current', this.current);
-        formData.append('size', this.pagesize);
-        const response = await this.$http.post(`searchInvoiceResult/list`, formData);
-        if (response.data.code === 0) {
-          this.loading = false;
-          this.usertable = response.data.data.records;
-          this.total = response.data.data.total;
-        };
-      }else{
-        const formData = new FormData();
-        formData.append('current', this.current);
-        formData.append('size', this.pagesize);
-        formData.append('userId', this.formUserList.userId);
-        const response = await this.$http.post(`searchInvoiceResult/list`, formData);
-        if (response.data.code === 0) {
-          this.loading = false;
-          this.usertable = response.data.data.records;
-          this.total = response.data.data.total;
-        };
-      };
-    },
-    //查询发票抬头
-    async loadInvoice() {
-      const response = await this.$http.post(`invoice/${this.formUserList.userId}`);
-      if(response.data.code === 0) {
-        this.option = response.data.data;
-      }
-    },
-    //查询
-    async queryLook() {
-      if(this.startTime !== '' || this.endTime !== '') {
-        this.startTime = (new Date(this.startTime)).getTime();
-        this.endTime = (new Date(this.endTime)).getTime();
-      }
-
-      if(this.formUserList.roleId == 1) {
         const formData = new FormData();
         formData.append('current', this.current);
         formData.append('size', this.pagesize);
         formData.append('waybillNum', this.waybillNum);
         formData.append('plateNum', this.plateNum);
-        formData.append('taxPlayerCode', this.taxPlayerCode);
+        formData.append('companyName', this.taxPlayerCode);
         formData.append('invoiceNum', this.invoiceNum);
-        formData.append('batchNumber', this.batchNumber);
-        formData.append('startTime', this.startTime);
-        formData.append('endTime', this.endTime);
-        const response = await this.$http.post(`searchInvoiceResult/list`, formData);
+        //formData.append('startTime', this.startTime);
+        //formData.append('endTime', this.endTime);
+        const response = await this.$http.post(`noCar/findNocarInvoices`, formData);
         if (response.data.code === 0) {
           this.loading = false;
           this.usertable = response.data.data.records;
           this.total = response.data.data.total;
           this.loadAllMeter();
         };
-      }else{
-        const formData = new FormData();
-        formData.append('current', this.current);
-        formData.append('size', this.pagesize);
-        formData.append('userId', this.formUserList.userId);
-        formData.append('waybillNum', this.waybillNum);
-        formData.append('taxPlayerCode', this.taxPlayerCode);
-        formData.append('plateNum', this.plateNum);
-        formData.append('invoiceNum', this.invoiceNum);
-        formData.append('batchNumber', this.batchNumber);
-        formData.append('startTime', this.startTime);
-        formData.append('endTime', this.endTime);
-        const response = await this.$http.post(`searchInvoiceResult/list`, formData);
-        if (response.data.code === 0) {
-          this.loading = false;
-          this.usertable = response.data.data.records;
-          this.total = response.data.data.total;
-          this.loadAllMeter();
-        };
-      };
     },
     //打包下载
     async packDownload() {
@@ -325,48 +258,32 @@ export default{
       this.$message({type: 'info', message: '正在下载,请稍等,请勿重复下载。'});
       this.fullscreenLoading = false;
       // console.log(this.formList.nums);
-    },
-    // 点击表格选框时触发的事件
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
+    } ,
+    async initCompanyList(){
+            const response = await this.$http.post(`lowerService/customeRecQueryList`, {"customerName":sessionStorage.getItem('userName')});
+            if (response.data.code === 0) {
+              this.companyList = response.data.data;
+            }
+            this.taxPlayerCode = this.companyList[0]['companyName'];
+            this.loadData();
     },
     // 查询发票统计
     async loadAllMeter() {
-      if(this.startTime !== '' || this.endTime !== '') {
-        this.startTime = (new Date(this.startTime)).getTime();
-        this.endTime = (new Date(this.endTime)).getTime();
-      }
-      this.formUserList.userId = sessionStorage.getItem('userId');
-      if(this.formUserList.roleId == 1) {
-        const formData = new FormData();
-        formData.append('waybillNum', this.waybillNum);
-        formData.append('plateNum', this.plateNum);
-        formData.append('taxPlayerCode', this.taxPlayerCode);
-        formData.append('invoiceNum', this.invoiceNum);
-        formData.append('batchNumber', this.batchNumber);
-        formData.append('startTime', this.startTime);
-        formData.append('endTime', this.endTime);
-        const response = await this.$http.post(`searchInvoiceResult/statistics`, formData);
-        if (response.data.code === 0) {
-          this.loading = false;
-          this.allmeterList = response.data.data;
-        };
-      }else{
-        const formData = new FormData();
-        formData.append('userId', this.formUserList.userId);
+       const formData = new FormData();
         formData.append('waybillNum', this.waybillNum);
         formData.append('plateNum', this.plateNum);
-        formData.append('taxPlayerCode', this.taxPlayerCode);
+        formData.append('companyName', this.taxPlayerCode);
         formData.append('invoiceNum', this.invoiceNum);
         formData.append('batchNumber', this.batchNumber);
-        formData.append('startTime', this.startTime);
-        formData.append('endTime', this.endTime);
-        const response = await this.$http.post(`searchInvoiceResult/statistics`, formData);
+        //formData.append('startTime', this.startTime);
+        //formData.append('endTime', this.endTime);
+        const response = await this.$http.post(`noCar/findNocarInvoicesStatic`, formData);
         if (response.data.code === 0) {
           this.loading = false;
-          this.allmeterList = response.data.data;
+          var allmeter = response.data.data;
+          this.allmeterList.push(allmeter);
+          console.log(this.allmeterList)
         };
-      };
     },
     // 展示发票全部信息
     checkLook(user) {
@@ -386,20 +303,12 @@ export default{
     // 分页方法
     handleSizeChange(val) {
       this.pagesize = val;
-      if(this.waybillNum !== '' || this.plateNum !== '' || this.invoiceNum !== '' || this.batchNumber !== '' || this.startTime !== '' || this.endTime !== '') {
-        this.queryLook();
-      }else{
-        this.loadData();
-      };
+     this.loadData();
       console.log(`每页 ${val} 条`);
     },
     handleCurrentChange(val) {
       this.current = val;
-      if(this.waybillNum !== '' || this.plateNum !== '' || this.invoiceNum !== '' || this.batchNumber !== '' || this.startTime !== '' || this.endTime !== '') {
-        this.queryLook();
-      }else{
-        this.loadData();
-      };
+      this.loadData();
       console.log(`当前页: ${val}`);
     },