|
@@ -1,3 +1,4 @@
|
|
|
|
+<!-- 我的发票 -->
|
|
<template>
|
|
<template>
|
|
<view class="invoice">
|
|
<view class="invoice">
|
|
<z-paging ref="paging" v-model="invoiceList" @query="queryList">
|
|
<z-paging ref="paging" v-model="invoiceList" @query="queryList">
|
|
@@ -16,22 +17,33 @@
|
|
</u-navbar>
|
|
</u-navbar>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<view class="invoice-list">
|
|
<view class="invoice-list">
|
|
- <view class="invoice-list-item" v-for="(item, index) in invoiceList" :key="index">
|
|
|
|
|
|
+ <view class="invoice-list-item" v-for="(item, index) in invoiceList" :key="index" @click="invoiceItemClick(item)">
|
|
<view class="invoice-list-item-left">
|
|
<view class="invoice-list-item-left">
|
|
<view class="invoice-list-item-left-item" v-for="(child, childIndex) in invoiceObjectList" :key="childIndex">
|
|
<view class="invoice-list-item-left-item" v-for="(child, childIndex) in invoiceObjectList" :key="childIndex">
|
|
<view class="left">{{ child.label }}</view>
|
|
<view class="left">{{ child.label }}</view>
|
|
<view class="right">
|
|
<view class="right">
|
|
- <template v-if="child.type === 'money'">¥{{ item[child.key] }}</template>
|
|
|
|
|
|
+ <template v-if="child.type === 'money'">
|
|
|
|
+ <text class="money">¥{{ item[child.key] }}</text>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else-if="child.type === 'status'">
|
|
|
|
+ <text class="status">
|
|
|
|
+ {{ item[child.key] }}
|
|
|
|
+ </text>
|
|
|
|
+ <u-tag :text="formatStatus(item['status'])" :type="formatStatusType(item['status'])" mode="dark" />
|
|
|
|
+ </template>
|
|
<template v-else>
|
|
<template v-else>
|
|
{{ item[child.key] }}
|
|
{{ item[child.key] }}
|
|
</template>
|
|
</template>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="invoice-list-item-right"></view>
|
|
|
|
|
|
+ <view class="invoice-list-item-right">
|
|
|
|
+ <u-icon name="arrow-right" color="#909399" size="28" />
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</z-paging>
|
|
</z-paging>
|
|
|
|
+ <!-- 选择开票类型 -->
|
|
<u-select v-model="chooseRecords.show" :list="chooseRecords.list" @confirm="chooseRecordsConfirm" />
|
|
<u-select v-model="chooseRecords.show" :list="chooseRecords.list" @confirm="chooseRecordsConfirm" />
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -40,17 +52,16 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- invoiceList: [
|
|
|
|
- { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
|
|
|
|
- { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
|
|
|
|
- { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
|
|
|
|
- { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' }
|
|
|
|
- ],
|
|
|
|
|
|
+ invoiceList: [],
|
|
invoiceObjectList: [
|
|
invoiceObjectList: [
|
|
- { label: '主题:', key: 'title' },
|
|
|
|
- { label: '金额:', key: 'price', type: 'money' },
|
|
|
|
- { label: '申请开票时间:', key: 'applyTime' }
|
|
|
|
|
|
+ { label: '', key: 'title', type: 'status' },
|
|
|
|
+ { label: '', key: 'price', type: 'money' },
|
|
|
|
+ { label: '申请时间:', key: 'applyTime' }
|
|
],
|
|
],
|
|
|
|
+ queryParams: {
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10
|
|
|
|
+ },
|
|
chooseRecords: {
|
|
chooseRecords: {
|
|
show: false,
|
|
show: false,
|
|
list: [
|
|
list: [
|
|
@@ -84,7 +95,7 @@ export default {
|
|
addInvoice() {
|
|
addInvoice() {
|
|
this.chooseRecords.show = true;
|
|
this.chooseRecords.show = true;
|
|
},
|
|
},
|
|
- /**
|
|
|
|
|
|
+ /**
|
|
* @description: 开发票选择确认
|
|
* @description: 开发票选择确认
|
|
* @param {*} val
|
|
* @param {*} val
|
|
* @return {*}
|
|
* @return {*}
|
|
@@ -97,19 +108,71 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- /**
|
|
|
|
|
|
+ /**
|
|
* @description: 分页触发
|
|
* @description: 分页触发
|
|
* @param {*} pageNo
|
|
* @param {*} pageNo
|
|
* @param {*} pageSize
|
|
* @param {*} pageSize
|
|
* @return {*}
|
|
* @return {*}
|
|
*/
|
|
*/
|
|
queryList(pageNo, pageSize) {
|
|
queryList(pageNo, pageSize) {
|
|
|
|
+ this.queryParams.pageNum = pageNo;
|
|
|
|
+ this.queryParams.pageSize = pageSize;
|
|
|
|
+ // this.getInvoiceList();
|
|
this.$refs.paging.complete([
|
|
this.$refs.paging.complete([
|
|
- { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
|
|
|
|
- { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
|
|
|
|
- { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' },
|
|
|
|
- { title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30' }
|
|
|
|
|
|
+ { id: 1, title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30', status: 0 },
|
|
|
|
+ { id: 2, title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30', status: 1 },
|
|
|
|
+ { id: 3, title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30', status: 2 },
|
|
|
|
+ { id: 4, title: '停车服务', price: 0.03, applyTime: '2023-06-12 11:21:30', status: 1 }
|
|
]);
|
|
]);
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * @description: 获取发票列表
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
+ async getInvoiceList() {
|
|
|
|
+ const { code, data } = await this.$u.api.invoiceModuleApi.getInvoiceListApi({ ...this.queryParams });
|
|
|
|
+ if (code === 200) {
|
|
|
|
+ this.$refs.paging.complete(data?.rows || []);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * @description: 单条发票点击
|
|
|
|
+ * @param {*} item
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
+ invoiceItemClick(item) {
|
|
|
|
+ this.$u.route({
|
|
|
|
+ url: '/pages/invoiceModule/invoiceDetails/invoiceDetails',
|
|
|
|
+ params: {
|
|
|
|
+ id: item.id
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * @description: 初始化状态
|
|
|
|
+ * @param {*} val
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
+ formatStatus(val) {
|
|
|
|
+ const statusObj = {
|
|
|
|
+ 0: '申请中',
|
|
|
|
+ 1: '已开票',
|
|
|
|
+ 2: '开票失败'
|
|
|
|
+ };
|
|
|
|
+ return statusObj[val];
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * @description: 初始化状态按钮样式
|
|
|
|
+ * @param {*} val
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
+ formatStatusType(val) {
|
|
|
|
+ const statusTypeObj = {
|
|
|
|
+ 0: 'info',
|
|
|
|
+ 1: 'primary',
|
|
|
|
+ 2: 'error'
|
|
|
|
+ };
|
|
|
|
+ return statusTypeObj[val];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|