Browse Source

前台代码优化提交20211025

MSY 3 years ago
parent
commit
2f4881d889

+ 32 - 26
src/router/index.js

@@ -8,8 +8,12 @@ const Home = () => import('@/views/Home');
 // 首页
 const Main = () => import('@/views/main/main');
 
-  // 个人中心
-  const Personal = () => import('@/views/personal/personal');
+// 个人中心
+const Personal = () => import('@/views/personal/personal');
+
+// 充值记录
+const customerRechargeMoney = () => import('@/views/customerRechargeMoney/customerRechargeMoney');
+
 // 个人中心
 const Customer = () => import('@/views/customer/Customer');
 const CustomerRecharge = () => import('@/views/customer/customerRecharge');
@@ -35,12 +39,11 @@ const selfInvoice = () => import('@/views/selfCar/invoice.vue');
 const selfCarTradeException = () => import('@/views/selfCar/selfCarTradeException.vue');
 const SelfCalculateInfo = () => import('@/views/selfCar/calculateInfo.vue');
 
-
-//平台菜单部分
+// 平台菜单部分
 
 // 发票管理部分(企业注册部分)
 const Check = () => import('@/views/platform/check/check');
-//自有车
+// 自有车
 const Apply = () => import('@/views/platform/apply/apply');
 const Already = () => import('@/views/platform/apply/already');
 const Packaging = () => import('@/views/platform/apply/packaging');
@@ -80,8 +83,11 @@ const router = new Router({
       children: [
         // 首页
         { name: 'Main', path: '/main', component: Main },
-        //个人中心
-        {name: 'Personal', path: '/personal',component: Personal},
+        // 个人中心
+        { name: 'Personal', path: '/personal', component: Personal },
+        // 充值记录
+        { name: 'customerRechargeMoney', path: '/customerRechargeMoney', component: customerRechargeMoney },
+
         // 客户管理
         { name: 'Customer', path: '/customer', component: Customer },
         { name: 'customerRecharge', path: '/CustomerRecharge', component: CustomerRecharge },
@@ -96,7 +102,7 @@ const router = new Router({
         { name: 'billwayException', path: '/billwayException', component: billwayException },
         { name: 'noCarCalculateInfo', path: '/noCarCalculateInfo', component: noCarCalculateInfo },
         { name: 'noCarCalculateInfoStatis', path: '/noCarCalculateInfoStatis', component: noCarCalculateInfoStatis },
-        
+
         { name: 'hcInvoice', path: '/hcInvoice', component: hcInvoice },
         // 自有车部分
         { name: 'selfcarRec', path: '/selfcarRec', component: selfcarRec },
@@ -105,29 +111,29 @@ const router = new Router({
         { name: 'selfCarTradeException', path: '/selfCarTradeException', component: selfCarTradeException },
         { name: 'SelfCalculateInfo', path: '/SelfCalculateInfo', component: SelfCalculateInfo },
 
-        //平台菜单部分
-        {name: 'Check', path: '/check', component: Check},
+        // 平台菜单部分
+        { name: 'Check', path: '/check', component: Check },
 
-        {name: 'Apply', path: '/apply', component: Apply},
-        {name: 'Already', path: '/already', component: Already},
-        {name: 'Packaging', path: '/packaging', component: Packaging},
-        {name: 'selfCarTradeP', path: '/selfCarTradeP', component: selfCarTradeP},
-        {name: 'Carbinding', path: '/carbinding', component: Carbinding},
-        {name: 'Carbindinglist', path: '/carbindinglist', component: Carbindinglist},
+        { name: 'Apply', path: '/apply', component: Apply },
+        { name: 'Already', path: '/already', component: Already },
+        { name: 'Packaging', path: '/packaging', component: Packaging },
+        { name: 'selfCarTradeP', path: '/selfCarTradeP', component: selfCarTradeP },
+        { name: 'Carbinding', path: '/carbinding', component: Carbinding },
+        { name: 'Carbindinglist', path: '/carbindinglist', component: Carbindinglist },
 
-        {name: 'Carupload', path: '/carupload', component: Carupload},
-        {name: 'Carsuccess', path: '/carsuccess', component: Carsuccess},
+        { name: 'Carupload', path: '/carupload', component: Carupload },
+        { name: 'Carsuccess', path: '/carsuccess', component: Carsuccess },
 
-        {name: 'Waybill', path: '/waybill', component: Waybill},
-        {name: 'Over', path: '/over', component: Over},
-        {name: 'History', path: '/history', component: History},
+        { name: 'Waybill', path: '/waybill', component: Waybill },
+        { name: 'Over', path: '/over', component: Over },
+        { name: 'History', path: '/history', component: History },
 
-        {name: 'WaybillList', path: '/waybillList', component: WaybillList},
-        {name: 'Noinvoice', path: '/noinvoice', component: Noinvoice},
-        {name: 'Trueinvoice', path: '/trueinvoice', component: Trueinvoice},
+        { name: 'WaybillList', path: '/waybillList', component: WaybillList },
+        { name: 'Noinvoice', path: '/noinvoice', component: Noinvoice },
+        { name: 'Trueinvoice', path: '/trueinvoice', component: Trueinvoice },
 
-        {name: 'Invoice', path: '/invoice', component: Invoice},
-        {name: 'List', path: '/list', component: List},
+        { name: 'Invoice', path: '/invoice', component: Invoice },
+        { name: 'List', path: '/list', component: List },
         // 参数管理
         { name: 'paramMagager', path: '/paramMagager', component: paramMagager }
       ]

+ 8 - 0
src/views/Home.vue

@@ -67,6 +67,10 @@
                     <i class="el-icon-s-tools"></i>
                     <span slot="title">个人中心</span>
                   </el-menu-item>
+                  <el-menu-item index="/customerRechargeMoney" >
+                    <i class="el-icon-s-tools"></i>
+                    <span slot="title">充值记录</span>
+                  </el-menu-item>
                   <!-- <el-menu-item index="/consumption">
                     <i class="el-icon-s-tools"></i>
                     <span slot="title">消费统计</span>
@@ -106,6 +110,10 @@
                     <i class="el-icon-s-tools"></i>
                     <span slot="title">个人中心</span>
                   </el-menu-item>
+                  <el-menu-item index="/customerRechargeMoney" >
+                    <i class="el-icon-s-tools"></i>
+                    <span slot="title">充值记录</span>
+                  </el-menu-item>
                   <el-submenu
                     v-for="item in noCarMenu"
                     :key="item.id"

+ 4 - 8
src/views/customer/custRecTime.vue

@@ -4,8 +4,8 @@
         <el-row>
           <el-col :span="24">
             <div class="top">
-               <el-input  placeholder="客户名称" class="input-demo" v-model="formCondition.customerName"></el-input>
                 <el-input  placeholder="主体名称" class="input-demo" v-model="formCondition.companyBelongName"></el-input>
+                <el-input  placeholder="公司名称" class="input-demo" v-model="formCondition.companyName"></el-input>
                <el-date-picker v-model="formCondition.serviceEndTime" type="daterange" value-format="yyyy-MM-dd HH:mm:SS" range-separator="至" start-placeholder="服务结束时间始" end-placeholder="服务结束时间止"></el-date-picker>
                <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>
                <el-button type="primary" style="margin-left: 1%;" @click="exportExcel">导出报表</el-button>
@@ -23,11 +23,7 @@
           :height="heightt"
           border
           tooltip-effect="dark">
-          <el-table-column
-            label="客户名称"
-            prop="customerName"
-            show-overflow-tooltip>
-          </el-table-column>
+        
            <el-table-column
             label="主体名称"
             prop="companyBelongName"
@@ -88,7 +84,7 @@ import XLSX from "xlsx";
         data(){
           return{
             formCondition:{
-              customerName:'',
+              companyName:'',
               serviceEndTime:'',
               companyBelongName:''
             },
@@ -114,7 +110,7 @@ import XLSX from "xlsx";
             const formData = new FormData();
             formData.append('current', this.current);
             formData.append('size', this.pagesize);
-            formData.append('customerName', this.formCondition.customerName);
+            formData.append('companyName', this.formCondition.companyName);
             formData.append('serviceEndTime', this.formCondition.serviceEndTime);
             formData.append('companyBelongName', this.formCondition.companyBelongName);
             const response = await this.$http.post(`customer/findCustomerRecTimeList`, formData);

+ 239 - 0
src/views/customerRechargeMoney/customerRechargeMoney.vue

@@ -0,0 +1,239 @@
+<template>
+    <div class="customerRecharge_container">
+      <div class="title">
+        <el-row>
+          <el-col :span="24">
+            <div class="top">
+             <el-date-picker
+                v-model="rechargeStartTime"
+                type="datetime"
+                placeholder="选择充值开始时间">
+              </el-date-picker>
+              
+              <el-date-picker
+                class="input-demo"
+                v-model="rechargeEndTime"
+                type="datetime"
+                placeholder="选择充值结束时间">
+              </el-date-picker>
+
+
+              
+               <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>
+               <el-button type="primary" style="margin-left: 1%;" @click="exportExcel">导出报表</el-button>
+
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+      <!-- 表格部分 -->
+        <template>
+        <el-table
+          class="table"
+          v-loading="loading"
+          ref="multipleTable"
+          :data="customerRechargeList"
+          :height="heightt"
+          border
+          tooltip-effect="dark">
+        
+         <!--  <el-table-column
+            prop="aMony"
+            label="充值前账户余额"
+            show-overflow-tooltip>
+            <template slot-scope="scope">
+               <span>{{scope.row.beforeMony-scope.row.rechargeMony| rounding}}</span>
+            </template>
+          </el-table-column> -->
+           <el-table-column
+            prop="beforeMony"
+            label="当前余额"
+            show-overflow-tooltip>
+            <template slot-scope="scope">
+               <span>{{scope.row.beforeMony| rounding}}</span>
+            </template>
+          </el-table-column>
+           <el-table-column
+            prop="rechargeMony"
+            label="充值金额"
+            show-overflow-tooltip>
+            <template slot-scope="scope">
+               <span>{{scope.row.rechargeMony| rounding}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="rechargeTime"
+            label="充值日期"
+            show-overflow-tooltip>
+          </el-table-column>
+        </el-table>
+      </template> 
+      <!-- 分页 -->
+      <div class="block">
+        <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="current"
+        :page-sizes="[6, 8, 10, 20, 50, 100]"
+        :page-size="pagesize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total">
+        </el-pagination>
+      </div>
+    </div>
+</template>
+<script type="text/javascript">
+import FileSaver from "file-saver";
+import XLSX from "xlsx";
+      export default {
+        data(){
+          return{
+            formCondition:{
+              rechargeStartTime:'',
+              rechargeEndTime:''
+            },
+            hightt:'0px',
+            customerRechargeList:[],
+            current: 1,
+            pagesize: 8,
+            total:''
+          }
+        },
+        created() {
+          this.heightt = tableHeight;
+          this.loadData();
+        },
+        filters: {
+            rounding (value) {
+              return value.toFixed(2)
+            }
+        },
+        methods:{
+          // 列表展示
+          async loadData() {
+            this.customerName = sessionStorage.getItem('userName');
+
+            const formData = new FormData();
+            formData.append('current', this.current);
+            formData.append('size', this.pagesize);
+            formData.append('customerName',  this.customerName);
+            formData.append('rechargeStartTime',  this.rechargeStartTime);
+            formData.append('rechargeEndTime',  this.rechargeEndTime);
+
+            const response = await this.$http.post(`customer/findCustomerRecharge`, formData);
+            if (response.data.code === 0) {
+              this.customerRechargeList = response.data.data.records;
+              this.total = response.data.data.total;
+            }
+          },
+          firstLoadData(){
+            this.current = 1;
+            this.pagesize = 8;
+            this.loadData();
+          },
+          // 分页方法
+          handleSizeChange(val) {
+            this.pagesize = val;
+            this.loadData();
+            console.log(`每页 ${val} 条`);
+          },
+          handleCurrentChange(val) {
+            this.current = val;
+              this.loadData();
+            // console.log(`当前页: ${val}`);
+          },
+     async exportExcel() {
+      let curr = this.current;
+      let pagesize1 = this.pagesize;
+      this.current = 1; 
+      this.pagesize = this.total;
+      await this.loadData();
+      // 设置当前日期
+      let time = new Date();
+      //console.log(time);
+      let year = time.getFullYear();
+      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 });
+      /* 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();
+      return wbout;
+    },
+        }
+      };
+</script>
+<style>
+.customerRecharge_container {
+  border: 1px solid #d9d9d9;
+  border-radius: 10px;
+}
+.customerRecharge_container .title {
+  font-size: 5px;
+  margin-bottom: 20px;
+}
+.customerRecharge_container .top {
+  padding-top: 20px;
+  padding-left: 20px;
+}
+.customerRecharge_container .text {
+  display: inline-block;
+  color: #000;
+  font-size: 16px ;
+  margin-left: 1%;
+}
+.customerRecharge_container .input-demo {
+  display: inline-block;
+  width: 20%;
+  margin-left: 1%;
+}
+.customerRecharge_container .block {
+  font-size: 5px;
+  text-align: center;
+  margin-top: 25px;
+  margin-bottom: 25px;
+}
+.customerRecharge_container .el-dialog {
+  width: 60%;
+}
+.customerRecharge_container .el-dialog__header, .el-dialog__body {
+  padding: 0 20px;
+}
+.customerRecharge_container .tou {
+  font-size: 20px;
+  height: 30px;
+  line-height: 30px;
+  padding-top: 15px;
+}
+.customerRecharge_container .line {
+  margin-top: 15px;
+  margin-bottom: 15px;
+  width: 100%;
+  height: 2px;
+  background-color: #d9d9d9;
+}
+.customerRecharge_container .xinxi {
+  text-align: center;
+  margin: 15px auto;
+  font-size: 18px;
+}
+</style>

+ 17 - 6
src/views/noCar/calculateInfo.vue

@@ -5,10 +5,11 @@
           <el-col :span="24">
             <div class="top">
                <div class="demo-input-suffix">
-                <el-input  placeholder="客户名称" class="input-demo" v-model="formCondition.customId"></el-input>
+                <el-input  placeholder="主体名称" class="input-demo" v-model="formCondition.companyLongName"></el-input>
 
                 <el-input  placeholder="购方税号" class="input-demo" v-model="formCondition.buyerTaxpayerCode"></el-input>
                  <el-input  placeholder="购方名称" class="input-demo" v-model="formCondition.buyerName"></el-input>
+                 <el-input  placeholder="交易Id" class="input-demo" v-model="formCondition.tradeId"></el-input>
 
               </div>
               <div class="demo-input-suffix" style="margin-top: 5px;margin-left: 10px;">
@@ -37,8 +38,8 @@
             show-overflow-tooltip>
           </el-table-column>
           <el-table-column
-            label="客户名称"
-            prop="customId"
+            label="主体名称"
+            prop="companyLongName"
             show-overflow-tooltip>
           </el-table-column>
            <el-table-column
@@ -97,6 +98,12 @@ import XLSX from "xlsx";
         data(){
           return{
             formCondition:{
+              companyLongName:'',
+              buyerTaxpayerCode:'',
+              buyerName:'',
+              invoiceMakeTime:'',
+              tradeId:'',
+              calculateTime:''
             },
             calculateInfo:[],
             current: 1,
@@ -125,9 +132,13 @@ import XLSX from "xlsx";
             const formData = new FormData();
             formData.append('current', this.current);
             formData.append('size', this.pagesize);
-            for(var i in this.formCondition){
-                formData.append(i,this.formCondition[i]);
-            }
+
+            formData.append('companyLongName', this.formCondition.companyLongName);
+            formData.append('buyerTaxpayerCode', this.formCondition.buyerTaxpayerCode);
+            formData.append('buyerName', this.formCondition.buyerName);
+            formData.append('invoiceMakeTime', this.formCondition.invoiceMakeTime);
+            formData.append('calculateTime', this.formCondition.calculateTime);
+            formData.append('tradeId', this.formCondition.tradeId);
             const response = await this.$http.post(`noCar/findNocarCalculateInfo`, formData);
             if (response.data.code === 0) {
               this.calculateInfo = response.data.data.records;

+ 0 - 2
src/views/platform/check/check.vue

@@ -256,7 +256,6 @@
         this.customerName = sessionStorage.getItem('userName');
         this.formUserList.customerName = sessionStorage.getItem('userName');
         this.formUserList.bussinessType = sessionStorage.getItem('roleId');
-        debugger
         if(this.formUserList.bussinessType == 1) {
           const formData = new FormData();
           formData.append('current', this.current);
@@ -317,7 +316,6 @@
       },
       // 新增发票信息
       addData(formName) {
-        debugger
         this.$refs[formName].validate(async (valid) => {
           if(valid) {
             const response = await this.$http.post(`customer/customerRecAdd`, this.formUserList);

+ 22 - 12
src/views/selfCar/calculateInfo.vue

@@ -3,16 +3,19 @@
       <div class="title">
         <el-row>
           <el-col :span="24">
-            <div class="top">
-               <el-input  placeholder="客户名称" class="input-demo" v-model="formCondition.customId"></el-input>
+       <div class="top">
+            <div class="demo-input-suffix">
+               <el-input  placeholder="主体名称" class="input-demo" v-model="formCondition.companyLongName"></el-input>
+               <el-input  placeholder="公司名称" class="input-demo" v-model="formCondition.companyName"></el-input>
                <el-input  placeholder="税号" class="input-demo" v-model="formCondition.companyReferencenum"></el-input>
                <el-input  placeholder="etc卡号" class="input-demo" v-model="formCondition.etcNum"></el-input>
-               <el-date-picker v-model="formCondition.calTime" type="monthrange" value-format="yyyy-MM" range-separator="至" start-placeholder="计费开始" end-placeholder="计费结束"></el-date-picker>
             </div>
-            <div class="top">
+            <div class="demo-input-suffix" style="margin-top: 5px;margin-left: 10px;">
+               <el-date-picker v-model="formCondition.calTime" type="monthrange" value-format="yyyy-MM" range-separator="至" start-placeholder="计费开始" end-placeholder="计费结束"></el-date-picker>
                <el-button type="success" style="margin-left: 1%;" @click="firstLoadData">查询</el-button>
                <el-button type="primary" style="margin-left: 1%;" @click="exportExcel">导出报表</el-button>
             </div>
+             </div>
           </el-col>
         </el-row>
       </div>
@@ -27,13 +30,13 @@
           border
           tooltip-effect="dark">
           <el-table-column
-            prop="companyNum"
-            label="企业编号"
+            prop="companyLongName"
+            label="主体名称"
             show-overflow-tooltip>
           </el-table-column>
           <el-table-column
-            label="客户名称"
-            prop="customId"
+            label="公司名称"
+            prop="companyName"
             show-overflow-tooltip>
           </el-table-column>
           <el-table-column
@@ -79,6 +82,11 @@ import XLSX from "xlsx";
         data(){
           return{
             formCondition:{
+              companyName:'',
+              companyReferencenum:'',
+              etcNum:'',
+              calTime:'',
+              companyLongName:''
             },
             calculateInfo:[],
              hightt:'0px',
@@ -107,10 +115,12 @@ import XLSX from "xlsx";
             const formData = new FormData();
             formData.append('current', this.current);
             formData.append('size', this.pagesize);
-             for(var i in this.formCondition){
-                formData.append(i,this.formCondition[i]);
-            }
-
+            formData.append('companyName', this.formCondition.companyName);
+            formData.append('companyReferencenum', this.formCondition.companyReferencenum);
+            formData.append('etcNum', this.formCondition.etcNum);
+            formData.append('calTime', this.formCondition.calTime);
+            formData.append('companyLongName', this.formCondition.companyLongName);
+           
             const response = await this.$http.post(`selfCar/findSelfcarCalculateInfo`, formData);
             if (response.data.code === 0) {
               this.calculateInfo = response.data.data.records;