Browse Source

开票相关更改

lock.qiu@kerryprops.com 2 years ago
parent
commit
f1eab7c9cc

+ 9 - 1
src/api/parking/index.js

@@ -129,9 +129,17 @@ export function invoicesAgainSandEmail(invoiceId) {
 // 提交发票申请
 
 export function submitInvoice(params) {
-  return window.requestms.post(`/invoices`,params, { loading: true });
+  return window.requestms.post(`/invoices/`,params, { loading: true });
 
 }
+// 查询会员默认邮箱信息
+
+export function invoiceEmails() {
+  return window.requestms.get(`/invoice-emails/current-user-default-email`, { loading: true });
+
+}
+
+
 // 1.19 无牌车出场
 /**
  * 

+ 8 - 8
src/pages/parkingFee/components/base/parkingReceipt/parkingInvoice.vue

@@ -6,13 +6,13 @@
         <div class="part-item lines header">
           <span class="part-item-key">抬头</span>
           <div class="part-item-value" @click="showHeader">
-            {{ order.invoiceTitleName }}
+            {{ order.invoiceTitle.titleName }}
             <img class="invoice-header-arrow" :src="arrowIcon" mode="widthFix" />
           </div>
         </div>
         <div class="part-item">
           <span class="part-item-key">开票订单号</span>
-          <span class="part-item-value">{{ order.orderno }}</span>
+          <span class="part-item-value">{{ order.invoiceOrderNo }}</span>
         </div>
         <div class="part-item">
           <span class="part-item-key">发票类型</span>
@@ -21,7 +21,7 @@
         <div class="part-item">
           <span class="part-item-key">开票日期</span>
           <span class="part-item-value">{{
-              order.paperDrewDate ? order.paperDrewDate : '-'
+              order.invoiceTime ? order.invoiceTime : '-'
             }}</span>
         </div>
         <div class="part-item">
@@ -33,7 +33,7 @@
         <div class="part-item">
           <span class="part-item-key">发票代码</span>
           <span class="part-item-value">{{
-              order.invoiceCode ? order.invoiceCode : '-'
+              order.invoiceNumber ? order.invoiceNumber : '-'
             }}</span>
         </div>
         <div class="part-item">
@@ -45,14 +45,14 @@
         <div class="part-item">
           <span class="part-item-key">总金额</span>
           <span class="part-item-value"
-          ><span class="purple">{{ order.invoiceAmount / 100 }}</span
+          ><span class="purple">{{ order.invoiceAmount }}</span
           >元</span
           >
         </div>
         <div class="part-item">
-        <span class="part-item-key"
-        >共<span class="purple">{{ order.payNumber }}笔</span>缴费记录</span
-        >
+        <!-- <span class="part-item-key"
+        >共<span class="purple">{{ order.invoiceItem.length }}笔</span>缴费记录</span
+        > -->
           <div class="part-item-value" @click="gotoRecordDetail">
             <span>查看详情</span>
             <img class="invoice-header-arrow" :src="arrowIcon" mode="widthFix" />

+ 2 - 2
src/pages/parkingFee/components/base/parkingReceipt/parkingReceipt.vue

@@ -160,13 +160,13 @@
                 >{{ item.orderNo }}-{{ item.vehicleNo }}
                 </div
                 >
-                <div v-else>{{ item.invoiceTitleName }}的停车发票</div>
+                <div v-else>{{ item.titleName }}的停车发票</div>
                 <div v-if="tabIndex == 1" style="color: #ed1c24"
                 >¥{{item.totalPaidAmount}}
                 </div
                 >
                 <div v-else style="color: #ed1c24"
-                >¥{{item.totalPaidAmount}}
+                >¥{{item.invoiceTotalAmount}}
                 </div
                 >
               </div>

+ 2 - 2
src/pages/parkingFee/components/officeBlue/parkingFeeCoupon.vue

@@ -35,7 +35,7 @@
           </div>
         </van-checkbox-group>
         <!-- 为避免冲突,小程序 和 H5 跳转 CRM小程序:积分商城 的逻辑分开处理 -->
-        <div :class="['guide-box', 'mgb-110', !couponList?.length && 'flex-bottom']" v-if="platform === 'miniprogram'">
+        <div :class="['guide-box', 'mgb-110', !couponList.length && 'flex-bottom']" v-if="platform === 'miniprogram'">
           <div class="guide-title">优惠券兑换指导</div>
           <div class="guide-desc" @click="navigateToMiniProgram">
             停车优惠券可直接使用,若您还没有兑换或继续兑换,可前往
@@ -43,7 +43,7 @@
             进行兑换
           </div>
         </div>
-        <div :class="['guide-box', 'mgb-110', !couponList?.length && 'flex-bottom']" v-if="platform === 'micromessenger'">
+        <div :class="['guide-box', 'mgb-110', !couponList.length && 'flex-bottom']" v-if="platform === 'micromessenger'">
           <div class="guide-title">优惠券兑换指导</div>
           <div class="guide-desc">
             停车优惠券可直接使用,若您还没有兑换或继续兑换,可前往

+ 15 - 3
src/pages/parkingFee/mixins/parkingReceipt/parkingApplication.js

@@ -7,7 +7,7 @@ import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks';
 import { getUrlParams } from '@/utils/index.js';
 import { Dialog, Toast } from 'vant';
-import { invoicesDetail, submitInvoice } from '@/api/parking';
+import { invoicesDetail, submitInvoice, invoiceEmails } from '@/api/parking';
 
 export default {
   data() {
@@ -26,7 +26,7 @@ export default {
         // invoiceCategory: 0, // 发票类型 0:停车缴费  1:活动
         invoiceType: 'GVAT', // 发票类型:gvat-增值税普通发票svat-增值税专⽤发票gvate-增值税电⼦普票发票svate-增值税电⼦专⽤发票
         remark: '',
-        invoiceTitle: [], // long|发票抬头id
+        invoiceTitle: {}, // long|发票抬头id
         parkOrderList: [], // 被选中的缴费记录id
         email: '',
         emailAsDefault: true
@@ -64,6 +64,7 @@ export default {
         title: '发票申请',
       });
     }, 300);
+    this.getEmail()
     // console.clear();
     const query = getUrlParams();
     // console.log('是否重新回到改页面', this.pageOptions);
@@ -128,6 +129,17 @@ export default {
     }),
   },
   methods: {
+    getEmail: async function () {
+      try {
+        const res = await invoiceEmails()
+        console.log('邮箱::::', res)
+      } catch {
+        uni.showToast({
+          title: '服务器开小差了呢,请您稍后再试',
+          icon: 'none',
+        });
+      }
+    },
     changeShowMore() {
       this.isShow = !this.isShow;
     },
@@ -356,7 +368,7 @@ export default {
       });
 
       
-      params.invoiceTitle = [{id: this.headerInfo.id}]
+      params.invoiceTitle.id = this.headerInfo.id
       params.totalAmount = Number(this.invoiceAmount)
       console.log('params.parkOrderList::', params)
   // params.openid = this.openid;

+ 7 - 3
src/pages/parkingFee/mixins/parkingReceipt/parkingChangeHeader.js

@@ -62,9 +62,9 @@ export default {
     if (options.type == 'edit') {
       this.condition = JSON.parse(this.$route.query.item)
     }
-    console.log(this.globalData);
+    console.log('this.condition::::', this.condition, this.globalData, this.$route.query.id);
     if (options.type) this.type = options.type;
-    if (options.id) (this.id = options.id), this.getInvoiceTitleById();
+    // if (options.id) (this.id = options.id), this.getInvoiceTitleById();
     // 埋点本地化
     this.preUrl = uni.getStorageSync('previousUrl');
     uni.setStorageSync(
@@ -101,7 +101,7 @@ export default {
       //   id: this.id,
       // };
         try {
-          const res = await invoicesEdittitles(this.id)
+          const res = await invoicesEdittitles(this.$route.query.id)
           if (res.content.length > 0 ) {
             console.log('res:::', res)
             self.condition = res.data.data;
@@ -150,6 +150,7 @@ export default {
       let res = null
       try {
         if (this.type === 'add') {
+          
           res = await invoicesNewtitles(this.condition)
           if (res) {
             this.$router.back();
@@ -157,6 +158,9 @@ export default {
   
         } else if (this.type === 'edit') {
           res = await invoicesEdittitles(this.condition, this.$route.query.id)
+          if (res) {
+            this.$router.back();
+          }
         }
       } catch {
         uni.showToast({

+ 79 - 7
src/pages/parkingFee/mixins/parkingReceipt/parkingInvoice.js

@@ -11,7 +11,42 @@ export default {
       picUrl: this.$picUrl,
       arrowIcon: arrowIcon,
       downloadBtnIcon: downloadBtnIcon,
-      order: {},
+      order: {
+        id: 1219562352,
+        invoiceOrderNo: "INVyedUsFwdkelQbxeTeQOvaScfqIOOmaa",
+        pdfUrl: "https://232.pdf",
+        invoiceType: "增值税普通发票",
+        invoiceNumber: "UMaAIKKIkknjWEXJUfPxxQHeWKEJ",
+        invoiceCode: "43253254324",
+        invoiceTotalAmount: 0.72,
+        email: "LlN@qq.com",
+        remark: "gNfZBdyFGRajVfJNonEnOinZj",
+        invoiceTitleId: 1188957731,
+        invoiceTime: "20220228",
+        invoiceTitle: {
+            id: 1018954901,
+            titleName: "QvBQYuxiXXVytGCxzVllpgTJKhRQq",
+            companyAddress: "上海浦东"
+        },
+        invoiceItem: [
+            {
+                "id": 1295249578,
+                "invoiceItemNo": "SY32342432043250-辽A8889",
+                "invoiceAmount": 0.99,
+                "parkName": "沈阳家里停车场",
+                "enterTime": "2026-02-13 16:23:01",
+                "parkTotalTime": 39088943
+            },
+            {
+                "id": 12952495798,
+                "invoiceItemNo": "SY32342432043250-辽A8889",
+                "invoiceAmount": 0.99,
+                "parkName": "沈阳家里停车场",
+                "enterTime": "2026-02-13 16:23:01",
+                "parkTotalTime": 39088943
+            }
+        ]
+    },
       webviewStyles: {
         progress: {
           color: '#FF3333',
@@ -30,7 +65,8 @@ export default {
         title: '发票详情',
       });
     }, 300);
-    this.getInvoicedDetail(this.id);
+      // const res = await invoicesDeatil(id)
+    // this.getInvoicedDetail(this.id);
   },
   computed: {
     ...mapState({
@@ -42,12 +78,48 @@ export default {
     getInvoicedDetail: async function (id) {
       //
       // console.log('根据发票id获取发票详情信息(含发票抬头信息),', id);
-      const self = this;
-      self.$md(data);
+      // const self = this;
+      // self.$md(data);
       try {
-        const res = await invoicesNotapplied(id)
-        if (res.data.code === 0) {
-          self.order = res.data.data;
+        // const res = await invoicesDeatil(id)
+        res = {
+          id: 1219562352,
+          invoiceOrderNo: "INVyedUsFwdkelQbxeTeQOvaScfqIOOmaa",
+          pdfUrl: "https://232.pdf",
+          invoiceType: "增值税普通发票",
+          invoiceNumber: "UMaAIKKIkknjWEXJUfPxxQHeWKEJ",
+          invoiceCode: "43253254324",
+          invoiceTotalAmount: 0.72,
+          email: "LlN@qq.com",
+          remark: "gNfZBdyFGRajVfJNonEnOinZj",
+          invoiceTitleId: 1188957731,
+          invoiceTime: "20220228",
+          invoiceTitle: {
+              "id": 1018954901,
+              "titleName": "QvBQYuxiXXVytGCxzVllpgTJKhRQq",
+              "companyAddress": "上海浦东"
+          },
+          invoiceItem: [
+              {
+                  "id": 1295249578,
+                  "invoiceItemNo": "SY32342432043250-辽A8889",
+                  "invoiceAmount": 0.99,
+                  "parkName": "沈阳家里停车场",
+                  "enterTime": "2026-02-13 16:23:01",
+                  "parkTotalTime": 39088943
+              },
+              {
+                  "id": 12952495798,
+                  "invoiceItemNo": "SY32342432043250-辽A8889",
+                  "invoiceAmount": 0.99,
+                  "parkName": "沈阳家里停车场",
+                  "enterTime": "2026-02-13 16:23:01",
+                  "parkTotalTime": 39088943
+              }
+          ]
+      }
+        if (res) {
+          self.order = res;
         } else {
           uni.showToast({
             title: res.data.msg,

+ 55 - 0
src/pages/parkingFee/mixins/parkingReceipt/parkingReceipt.js

@@ -184,6 +184,61 @@ export default {
           res = await invoicesNotapplied(params)
         } else {
           res = await invoicesCompleted(params)
+          res = {
+            content: [      
+                {
+                    id: 2,
+                    titleName: "XX科技公司",
+                    taxNo: "yedUsFwdWbxeTeQOv",
+                    defaultOrNot: true,
+                    companyAddress: "上海静安",
+                    companyTel: "02189878983",
+                    depositBank: "招商银行",
+                    depositAccount: "43499892879472445",
+                    invoiceTitleType: "COMPANY",
+                    status: 2,
+                    invoiceTotalAmount:0.4
+                },
+                {
+                    id: 1,
+                    titleName: "XX科技公司",
+                    taxNo: "yedUsFwdkelQ",
+                    defaultOrNot: true,
+                    companyAddress: "上海静安",
+                    companyTel: "02189878983",
+                    depositBank: "招商银行",
+                    depositAccount: "43499892879472445",
+                    invoiceTitleType: "COMPANY",
+                    status: 2,
+                    invoiceTotalAmount: 10.00
+                }
+            ],
+            "pageable": {
+                "sort": {
+                    "unsorted": false,
+                    "sorted": true,
+                    "empty": false
+                },
+                "pageNumber": 0,
+                "pageSize": 4,
+                "offset": 0,
+                "unpaged": false,
+                "paged": true
+            },
+            "last": true,
+            "totalPages": 1,
+            "totalElements": 3,
+            "first": true,
+            "sort": {
+                "unsorted": false,
+                "sorted": true,
+                "empty": false
+            },
+            "number": 0,
+            "numberOfElements": 3,
+            "size": 4,
+            "empty": false
+        }
         }
           console.log('99', res)
           if (res) {

+ 1 - 0
src/pages/parkingFee/mixins/vehicleAddOrEdit.js

@@ -174,6 +174,7 @@ export default {
             // const result = resp.data;
             if (result && result.code == '000000') {
               if (result.data) {
+                console.log(22);
                 Toast({
                   message: '绑定车牌成功',
                   onClose: () => {