Kaynağa Gözat

开票相关接口联调

lock.qiu@kerryprops.com 2 yıl önce
ebeveyn
işleme
706d32506a

+ 3 - 3
src/pages/parkingFee/components/base/parkingReceipt/parkingOrderDetail.vue

@@ -10,7 +10,7 @@
     <div class="order-list">
       <div class="order-item" v-for="(item, index) in orderList" :key="index" @click="gotoDetail(item)">
         <!-- 0:停车缴费  1:活动报名 2:积分兑换 -->
-        <template v-if="item.invoiceCategory === 0">
+        <template>
           <div class="item-header">
             <div>{{ item.orderNo }}-{{ item.vehicleNo }}</div>
             <div class="red">¥{{ item.totalPaidAmount }}</div>
@@ -21,8 +21,8 @@
             <div>停车时长: 停车时长: {{ item.serviceMin | parkingTime }}</div>
           </div>
         </template>
-        <template v-else-if="item.invoiceCategory === 1"></template>
-        <template v-else-if="item.invoiceCategory === 2"></template>
+        <!-- <template v-else-if="item.invoiceCategory === 1"></template>
+        <template v-else-if="item.invoiceCategory === 2"></template> -->
       </div>
     </div>
   </scroll-view>

+ 66 - 53
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, invoiceEmails } from '@/api/parking';
+import { invoicesDetail, submitInvoice, invoiceEmails, invoicesOrders } from '@/api/parking';
 
 export default {
   data() {
@@ -79,16 +79,19 @@ export default {
       // console.log('===>onShow', options);
       // console.log('===>onShow', options.ids);
       console.log(typeof this.invoiceAmount)
-      this.invoiceAmount = Number(options.money).toFixed(2);
-      this.$store.commit('setTempParkingOrder', options.invoiceDetailList);
-      this.$store.commit('setTempParkingMoney', this.invoiceAmount);
-      this.parkingDetailList = JSON.parse(options.invoiceDetailList)
-      console.log('this.invoiceAmount', this.invoiceAmount)
-      if (options.type && options.money) {
-        this.type = options.type;
-        
+      if (this.pageOptions.againInvoiceFlag) {
+        this.getInvoicesOrders(options.invoiceId)
+      } else {
+        this.invoiceAmount = Number(options.money).toFixed(2);
+        this.$store.commit('setTempParkingOrder', options.invoiceDetailList);
+        this.$store.commit('setTempParkingMoney', this.invoiceAmount);
+        // if (typeof options.invoiceDetailList === 'object') {
+          this.parkingDetailList = JSON.parse(options.invoiceDetailList)
+        // }
         
       }
+      
+      console.log('this.invoiceAmount', this.invoiceAmount)
       if (options.ids) {
         const ids = options.ids;
         if (ids.indexOf(',') > -1) {
@@ -130,10 +133,17 @@ export default {
     }),
   },
   methods: {
-    getInvoicesOrders: async function () {
+    getInvoicesOrders: async function (id) {
       try {
-        const res = await invoicesOrders()
-        
+        const res = await invoicesOrders(id)
+        this.invoiceAmount = res.invoiceTotalAmount
+        this.orderQuantity = res.invoicedOrders.length
+        this.parkingOrder = res.invoicedOrders
+        this.$store.commit('setTempParkingOrder', JSON.stringify(res.invoicedOrders));
+        this.$store.commit('setTempParkingMoney', res.invoiceTotalAmount);
+        this.ids = res.invoicedOrders.map(item=>{
+          return item.id
+        })
         console.log('1.28 查看发票关联的订单支付详情::::', res)
       } catch {
         uni.showToast({
@@ -163,17 +173,20 @@ export default {
     },
     changeHeader() {
       this.$router.push({
-        path: 'parkingChooseHeader?ids=' + this.ids,
+        path: 'parkingChooseHeader',
+        query: {
+          ids:this.ids,
+          invoiceDetailList: JSON.stringify(this.invoiceDetailList),
+          money: this.invoiceAmount
+        }
       });
     },
     gotoDetail() {
-      this.$store.commit('setTempParkingOrder', this.parkingOrder);
-
       this.$router.push({
         path: 'parkingOrderDetail?useParkingOrderCache=true',
         query: {
-          invoiceDetailList: this.pageOptions.invoiceDetailList,
-          money: this.pageOptions.money
+          invoiceDetailList: this.pageOptions.againInvoiceFlag ? JSON.stringify(this.parkingOrder) : this.pageOptions.invoiceDetailList,
+          money: this.invoiceAmount
         }
       });
       // this.$router.push({
@@ -315,42 +328,42 @@ export default {
       //   self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo'
       // );
       // console.log(421, data);
-      uni.request({
-        url: self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo',
-        method: 'POST',
-        data: data,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          if (res.data.code === 0) {
-            console.log('获取用户邮箱信息', res.data);
-            if (res.data.data) {
-              this.emailAsDefault = true;
-              this.condition.mailbox = res.data.data;
-            } else {
-              this.emailAsDefault = false;
-              this.condition.mailbox = '';
-            }
-          } else {
-            /* uni.showToast({
-             title: res.data.msg,
-             duration: 2000,
-             icon: 'none',
-             }); */
-            Toast({
-              message: res.data.msg,
-            });
-          }
-        },
-        fail: () => {
-          Toast({
-            title: '服务器开小差了呢,请您稍后再试',
-          });
-          /* uni.showToast({
-           title: '服务器开小差了呢,请您稍后再试',
-           icon: 'none',
-           }); */
-        },
-      });
+      // uni.request({
+      //   url: self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo',
+      //   method: 'POST',
+      //   data: data,
+      //   header: JSON.parse(uni.getStorageSync('handleUser')),
+      //   success: (res) => {
+      //     if (res.data.code === 0) {
+      //       console.log('获取用户邮箱信息', res.data);
+      //       if (res.data.data) {
+      //         this.emailAsDefault = true;
+      //         this.condition.mailbox = res.data.data;
+      //       } else {
+      //         this.emailAsDefault = false;
+      //         this.condition.mailbox = '';
+      //       }
+      //     } else {
+      //       /* uni.showToast({
+      //        title: res.data.msg,
+      //        duration: 2000,
+      //        icon: 'none',
+      //        }); */
+      //       Toast({
+      //         message: res.data.msg,
+      //       });
+      //     }
+      //   },
+      //   fail: () => {
+      //     Toast({
+      //       title: '服务器开小差了呢,请您稍后再试',
+      //     });
+      //     /* uni.showToast({
+      //      title: '服务器开小差了呢,请您稍后再试',
+      //      icon: 'none',
+      //      }); */
+      //   },
+      // });
     },
     submit: async function () {
       const self = this;

+ 54 - 49
src/pages/parkingFee/mixins/parkingReceipt/parkingInvoice.js

@@ -4,7 +4,7 @@ import downloadBtnIcon from '../../static/images/download.png';
 import arrowIcon from '../../static/images/arrows.png';
 import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks';
-import { invoicesDeatil } from '@/api/parking';
+import { invoicesDeatil, invoicesOrders } from '@/api/parking';
 export default {
   data() {
     return {
@@ -12,7 +12,40 @@ export default {
       arrowIcon: arrowIcon,
       downloadBtnIcon: downloadBtnIcon,
       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: {
@@ -25,6 +58,7 @@ export default {
   created() {
     console.log('查看发票详情的id', this.$route.query);
     this.id = this.$route.query.id;
+    this.getInvoicesOrders(this.id)
   },
   mounted() {
     setTimeout(() => {
@@ -41,59 +75,30 @@ export default {
     }),
   },
   methods: {
+    getInvoicesOrders: async function (id) {
+      try {
+        const res = await invoicesOrders(id)
+        this.invoiceAmount = res.invoiceTotalAmount
+        this.orderQuantity = res.invoicedOrders.length
+        this.parkingOrder = res.invoicedOrders
+        console.log('1.28 查看发票关联的订单支付详情::::', res)
+      } catch {
+        uni.showToast({
+          title: '服务器开小差了呢,请您稍后再试',
+          icon: 'none',
+        });
+      }
+    },
     // 根据发票id获取发票详情信息(含发票抬头信息),
     getInvoicedDetail: async function (id) {
       //
       // console.log('根据发票id获取发票详情信息(含发票抬头信息),', id);
-      // const self = this;
+      const self = this;
       // self.$md(data);
       try {
         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) {
+        console.log('支付订单详情', res)
           self.order = res;
-        } else {
-          uni.showToast({
-            title: res.data.msg,
-            duration: 2000,
-            icon: 'none',
-          });
-        }
       } catch {
         uni.showToast({
           title: '服务器开小差了呢,请您稍后再试',
@@ -132,9 +137,9 @@ export default {
     },
     gotoRecordDetail() {
       this.$router.push({
-        path: 'parkingOrderDetail?id=' + this.order.id,
+        path: 'parkingOrderDetail',
         query: {
-          order: JSON.stringify(this.order)
+          id: this.order.id,
         }
       });
     },

+ 18 - 18
src/pages/parkingFee/mixins/parkingReceipt/parkingOrderDetail.js

@@ -27,12 +27,13 @@ export default {
       console.log('tempParkingOrder.invoiceDetailList:::', tempParkingOrder.invoiceDetailList)
       const orderList = JSON.parse(tempParkingOrder.invoiceDetailList);
       console.log(231,options)
-      orderList.forEach((item) => {
-        item.invoiceCategory = 0;
-      });
+      // orderList.forEach((item) => {
+      //   item.invoiceCategory = 0;
+      // });
       this.orderList = orderList;
     } else {
       this.useParkingOrderCache = false;
+      this.getInvoicedDetail(this.id);
     }
   },
   mounted() {
@@ -41,9 +42,6 @@ export default {
         title: '支付订单详情',
       });
     }, 300);
-    if (!this.useParkingOrderCache) {
-      this.getInvoicedDetail(this.id);
-    }
   },
   filters: {
     parkingTime(val) {
@@ -70,20 +68,22 @@ export default {
     // 根据发票id获取支付记录详情信息
     getInvoicedDetail: async function(id) {
       const self = this;
-      self.$md(data);
       try {
         const res = await invoicesOrders(id)
-        if (res.data.code === 0) {
-          self.order = res.data.data.list[0];
-          self.parFee = (res.data.data.invoiceAmount / 100).toFixed(2);
-          self.orderList = res.data.data.invoicedOrders;
-        } else {
-          uni.showToast({
-            title: res.data.msg,
-            duration: 2000,
-            icon: 'none',
-          });
-        }
+        this.parFee = res.invoiceTotalAmount
+        this.orderList = res.invoicedOrders
+        console.log(res, '订单支付详情');
+        // if (res.data.code === 0) {
+        //   self.order = res.data.data.list[0];
+        //   self.parFee = (res.data.data.invoiceAmount / 100).toFixed(2);
+        //   self.orderList = res.data.data.invoicedOrders;
+        // } else {
+        //   uni.showToast({
+        //     title: res.data.msg,
+        //     duration: 2000,
+        //     icon: 'none',
+        //   });
+        // }
       } catch {
         uni.showToast({
           title: '服务器开小差了呢,请您稍后再试',

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

@@ -388,11 +388,13 @@ export default {
     },
     // 重新开票
     tryGoToInvoicing(item) {
+      console.log(item, 'chooseHeaderchooseHeaderchooseHeader')
       this.$router.push({
         path: 'parkingApplication',
         query: {
           ids: item.ids,
           invoiceId: item.id,
+          againInvoiceFlag: true
         },
       });
     },

+ 1 - 0
vue.config.js

@@ -114,6 +114,7 @@ module.exports = {
         },
       },
       '/msApi': {
+        // target: 'http://172.20.50.208:8080',
         target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
         // target: 'http://172.21.203.140:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL   2023-2-9
         // target: 'http://172.21.203.20:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL