|
@@ -7,7 +7,7 @@ import { mapState } from 'vuex';
|
|
import uni from '@/utils/uniHooks';
|
|
import uni from '@/utils/uniHooks';
|
|
import { getUrlParams } from '@/utils/index.js';
|
|
import { getUrlParams } from '@/utils/index.js';
|
|
import { Dialog, Toast } from 'vant';
|
|
import { Dialog, Toast } from 'vant';
|
|
-import { invoicesDetail, submitInvoice, invoiceEmails } from '@/api/parking';
|
|
|
|
|
|
+import { invoicesDetail, submitInvoice, invoiceEmails, invoicesOrders } from '@/api/parking';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
@@ -79,16 +79,19 @@ export default {
|
|
// console.log('===>onShow', options);
|
|
// console.log('===>onShow', options);
|
|
// console.log('===>onShow', options.ids);
|
|
// console.log('===>onShow', options.ids);
|
|
console.log(typeof this.invoiceAmount)
|
|
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) {
|
|
if (options.ids) {
|
|
const ids = options.ids;
|
|
const ids = options.ids;
|
|
if (ids.indexOf(',') > -1) {
|
|
if (ids.indexOf(',') > -1) {
|
|
@@ -130,10 +133,17 @@ export default {
|
|
}),
|
|
}),
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- getInvoicesOrders: async function () {
|
|
|
|
|
|
+ getInvoicesOrders: async function (id) {
|
|
try {
|
|
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)
|
|
console.log('1.28 查看发票关联的订单支付详情::::', res)
|
|
} catch {
|
|
} catch {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -163,17 +173,20 @@ export default {
|
|
},
|
|
},
|
|
changeHeader() {
|
|
changeHeader() {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- path: 'parkingChooseHeader?ids=' + this.ids,
|
|
|
|
|
|
+ path: 'parkingChooseHeader',
|
|
|
|
+ query: {
|
|
|
|
+ ids:this.ids,
|
|
|
|
+ invoiceDetailList: JSON.stringify(this.invoiceDetailList),
|
|
|
|
+ money: this.invoiceAmount
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
gotoDetail() {
|
|
gotoDetail() {
|
|
- this.$store.commit('setTempParkingOrder', this.parkingOrder);
|
|
|
|
-
|
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: 'parkingOrderDetail?useParkingOrderCache=true',
|
|
path: 'parkingOrderDetail?useParkingOrderCache=true',
|
|
query: {
|
|
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({
|
|
// this.$router.push({
|
|
@@ -315,42 +328,42 @@ export default {
|
|
// self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo'
|
|
// self.$baseURL + 'api/1.0/invoice/getInvoiceEmailInfo'
|
|
// );
|
|
// );
|
|
// console.log(421, data);
|
|
// 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 () {
|
|
submit: async function () {
|
|
const self = this;
|
|
const self = this;
|