修改发票信息联调错误,修改充值记录按表计查询,我的新增发票抬头

This commit is contained in:
qiaomu 2024-04-26 09:20:44 +08:00
parent b7e831662e
commit cbe7db0ac1
22 changed files with 176 additions and 62 deletions

View File

@ -1,11 +1,11 @@
{ {
"pages": [ "pages": [
"pages/home/index", "pages/home/index",
"pages/rechargeRecord/index",
"pages/invoiceList/index", "pages/invoiceList/index",
"pages/invoiceDetail/index", "pages/invoiceDetail/index",
"pages/invoiceDetailContent/index", "pages/invoiceDetailContent/index",
"pages/invoicing/index", "pages/invoicing/index",
"pages/rechargeRecord/index",
"pages/member/index", "pages/member/index",
"pages/login/index", "pages/login/index",
"pages/handleLogin/index", "pages/handleLogin/index",
@ -18,8 +18,8 @@
"pages/questions/index", "pages/questions/index",
"pages/editInvoice/index", "pages/editInvoice/index",
"pages/rechargeDetail/index", "pages/rechargeDetail/index",
"pages/agreements/index" "pages/agreements/index",
"pages/updateInvoice/index"
], ],
"tabBar": { "tabBar": {
"list": [ "list": [

View File

@ -5,7 +5,10 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
text: {
type: String,
value: '暂无数据'
},
}, },
/** /**
@ -19,6 +22,8 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
refresh() {
this.triggerEvent("refresh")
}
} }
}) })

View File

@ -1,4 +1,4 @@
<!--components/empty/index.wxml--> <!--components/empty/index.wxml-->
<van-empty description="描述文字"> <van-empty description="{{text}}">
<van-button round type="danger" class="bottom-button">按钮</van-button> <van-button type="info" bind:click="refresh" custom-style="width: 300rpx; margin-top:60rpx;" > 刷 新 </van-button>
</van-empty> </van-empty>

View File

@ -1 +1,5 @@
/* components/empty/index.wxss */ /* components/empty/index.wxss */
.bottom-button {
width: 320rpx;
height: 80rpx;
}

View File

@ -1,5 +1,5 @@
import { getAlreadyInvoiceList } from "../../../../service/invoice" import { getAlreadyInvoiceList } from "../../../../service/invoice"
import { alertInfo } from "../../../../utils/index"; import { alertInfo, loadingFunc } from "../../../../utils/index";
import request from '../../../../utils/request' import request from '../../../../utils/request'
const { OK } = request; const { OK } = request;
// pages/invoiceList/components/already/index.js // pages/invoiceList/components/already/index.js
@ -43,8 +43,11 @@ Component({
page: page + 1, page: page + 1,
}) })
}, },
onRefresh() {
loadingFunc(() => this.getList())
},
scrollToLower() { scrollToLower() {
this.getList(); loadingFunc(() => this.getList())
}, },
jumpToDetail() { jumpToDetail() {
wx.navigateTo({ wx.navigateTo({

View File

@ -1,6 +1,7 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-button": "@vant/weapp/button/index" "van-button": "@vant/weapp/button/index",
"empty": "/components/empty/index"
} }
} }

View File

@ -1,7 +1,7 @@
<!--pages/invoiceList/components/already/index.wxml--> <!--pages/invoiceList/components/already/index.wxml-->
<scroll-view scroll-y lower-threshold="100px" bindscrolltolower="scrollToLower" style="height: 80vh;" scroll-top="{{topHeight}}px" class="scrView"> <scroll-view wx:if="{{list.length}}" scroll-y lower-threshold="100px" bindscrolltolower="scrollToLower" style="height: 80vh;" scroll-top="{{topHeight}}px" class="scrView">
<view class="card" wx:for="{{list}}"> <view class="card" wx:for="{{list}}">
<view class="left"> <view class="left">
<view class="title"> <view class="title">
@ -28,4 +28,7 @@
</view> </view>
</view> </view>
<view style="height: 50rpx;"></view> <view style="height: 50rpx;"></view>
</scroll-view> </scroll-view>
<view wx:else>
<empty text="暂无数据" bind:refresh="onRefresh" />
</view>

View File

@ -29,8 +29,8 @@
</view> </view>
<view wx:else slot="input" style="margin-top: -10rpx;"> <view wx:else slot="input" style="margin-top: -10rpx;">
<view wx:if="{{formData.type === 0}}"> 普通电子发票 </view> <view wx:if="{{detail.type === 0}}"> 普通电子发票 </view>
<view wx:elif="{{formData.type === 1}}"> 增值税专用电子发票 </view> <view wx:elif="{{detail.type === 1}}"> 增值税专用电子发票 </view>
<view wx:else>-</view> <view wx:else>-</view>
</view> </view>
</van-field> </van-field>
@ -44,7 +44,7 @@
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
> >
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}"> <view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}">
<van-radio-group direction="horizontal" bind:change="onChangeHeaderType"> <van-radio-group direction="horizontal" bind:change="onChangeHeaderType" value="{{formData.headerType}}">
<van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">企业单位</van-radio> <van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">企业单位</van-radio>
<van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio> <van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio>
</van-radio-group> </van-radio-group>
@ -54,8 +54,8 @@
slot="input" slot="input"
style="margin-top: -10rpx;" style="margin-top: -10rpx;"
> >
<view wx:if="{{formData.headerType === 0}}"> 企业单位 </view> <view wx:if="{{detail.headerType === 0}}"> 企业单位 </view>
<view wx:elif="{{formData.headerType === 1}}"> 个人/非企业单位 </view> <view wx:elif="{{detail.headerType === 1}}"> 个人/非企业单位 </view>
<view wx:else>-</view> <view wx:else>-</view>
</view> </view>
</van-field> </van-field>
@ -83,7 +83,7 @@
<van-field <van-field
value="{{detail.tin}}" value="{{detail.tin}}"
label="发票税号" label="发票税号"
wx:if="{{formData.headerType === 0}}" wx:if="{{(editType === 'edit' && formData.headerType === 0) || (editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入发票税号' : ''}}" placeholder="{{editType === 'edit' ? '请输入发票税号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
@ -104,7 +104,7 @@
<van-field <van-field
value="{{detail.bank}}" value="{{detail.bank}}"
label="开户行" label="开户行"
wx:if="{{formData.headerType === 0}}" wx:if="{{(editType === 'edit' && formData.headerType === 0) || (editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入开户行' : ''}}" placeholder="{{editType === 'edit' ? '请输入开户行' : ''}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
@ -125,7 +125,7 @@
<van-field <van-field
value="{{detail.account}}" value="{{detail.account}}"
label="银行账号" label="银行账号"
wx:if="{{formData.headerType === 0}}" wx:if="{{(editType === 'edit' && formData.headerType === 0) || (editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}" placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
@ -146,7 +146,7 @@
<van-field <van-field
value="{{detail.address}}" value="{{detail.address}}"
label="地址" label="地址"
wx:if="{{formData.headerType === 0}}" wx:if="{{(editType === 'edit' && formData.headerType === 0) || (editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}" placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
@ -167,7 +167,7 @@
<van-field <van-field
value="{{detail.phone}}" value="{{detail.phone}}"
label="电话" label="电话"
wx:if="{{formData.headerType === 0}}" wx:if="{{(editType === 'edit' && formData.headerType === 0) || (editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}" placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"

View File

@ -1,6 +1,6 @@
// pages/invoiceList/components/notyet/index.js // pages/invoiceList/components/notyet/index.js
import { getInvoiceList } from '../../../../service/invoice'; import { getInvoiceList } from '../../../../service/invoice';
import { alertInfo } from '../../../../utils/index'; import { alertInfo, loadingFunc } from '../../../../utils/index';
import request from '../../../../utils/request'; import request from '../../../../utils/request';
const { OK } = request; const { OK } = request;
@ -40,6 +40,9 @@ Component({
// } // }
this.setData({ list: data, selectList: new Array(data?.length).map(() => false) }) this.setData({ list: data, selectList: new Array(data?.length).map(() => false) })
}, },
onRefresh() {
loadingFunc(() => this.init())
},
onChange(e) { onChange(e) {
const { id, index } = e.currentTarget.dataset; const { id, index } = e.currentTarget.dataset;
// let newList = this.data.chooseList; // let newList = this.data.chooseList;

View File

@ -2,6 +2,7 @@
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-checkbox": "@vant/weapp/checkbox/index", "van-checkbox": "@vant/weapp/checkbox/index",
"van-button": "@vant/weapp/button/index" "van-button": "@vant/weapp/button/index",
"empty": "/components/empty/index"
} }
} }

View File

@ -1,5 +1,6 @@
<view wx:if="{{list.length}}">
<van-checkbox-group value="{{ chooseList }}" bind:change="onChange" max="{{ 2 }}"> <van-checkbox-group value="{{ chooseList }}" bind:change="onChange" max="{{ 2 }}" >
<view class="cardWrapper" wx:for="{{list}}" wx:key="index"> <view class="cardWrapper" wx:for="{{list}}" wx:key="index">
<view class="content"> <view class="content">
<view class="left"> <view class="left">
@ -29,5 +30,8 @@
<view class="allMoney"> ¥ {{selectMoney}} </view> <view class="allMoney"> ¥ {{selectMoney}} </view>
<van-button size="small" type="info" bind:click="next" disabled="{{!selectCount}}"> 下一步 </van-button> <van-button size="small" type="info" bind:click="next" disabled="{{!selectCount}}"> 下一步 </van-button>
</view> </view>
</view>
<view wx:else>
<empty bind:refresh="onRefresh" />
</view>

View File

@ -17,7 +17,7 @@ Page({
{ name: '删除', }, { name: '删除', },
], ],
selectData: {}, selectData: {},
active: 1, active: 0,
}, },
/** /**

View File

@ -67,6 +67,11 @@ Page({
this.setData({ user: result.data }) this.setData({ user: result.data })
wx.setStorageSync('user', result.data) wx.setStorageSync('user', result.data)
}, },
jumpToUpdateInvoice() {
wx.navigateTo({
url: '/pages/updateInvoice/index',
})
},
async getUnReadNumber() { async getUnReadNumber() {
const dot = await getDot(); const dot = await getDot();
this.setData({ this.setData({

View File

@ -15,6 +15,7 @@
</view> </view>
</view> </view>
</van-cell> </van-cell>
<van-cell title="发票抬头" value="" is-link bind:tap="jumpToUpdateInvoice" />
<van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" /> <van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" />
<van-cell title="退出登录" value="" is-link bind:tap="logout" /> <van-cell title="退出登录" value="" is-link bind:tap="logout" />
<!-- </van-cell-group> --> <!-- </van-cell-group> -->

View File

@ -1,5 +1,5 @@
import { getRechargeList } from "../../service/recharge"; import { getRechargeList } from "../../service/recharge";
import { getOwnTenementList } from "../../service/tenement"; import { getTenementMeterList } from "../../service/meter";
import { getYears, alertInfo } from "../../utils/index"; import { getYears, alertInfo } from "../../utils/index";
import request from "../../utils/request"; import request from "../../utils/request";
const { OK } = request; const { OK } = request;
@ -16,13 +16,13 @@ Page({
list: [ list: [
], ],
tenement: "",
tenementName: "",
show: false, show: false,
columns: [], columns: [],
type: "", type: "",
title: "", title: "",
amount: 0, amount: 0,
codeId: "",
meterCode: ""
}, },
clickYear() { clickYear() {
this.setData({ this.setData({
@ -32,12 +32,12 @@ Page({
title: "年份" title: "年份"
}) })
}, },
clickTenement() { clickMeter() {
this.setData({ this.setData({
type: "tenement", type: "meter",
columns: this.data.tenements, columns: this.data.meterList.map(item => ({ id: item.id, name: `${item.code}-${item.address}`, code: item.code })),
show: true, show: true,
title: "商户" title: "表计"
}) })
}, },
onOk(e) { onOk(e) {
@ -46,8 +46,8 @@ Page({
this.onChangeYear(value.id) this.onChangeYear(value.id)
return; return;
} }
if (type === "tenement") { if (type === "meter") {
this.onChangeTenement(value) this.onChangeMeter(value)
return; return;
} }
}, },
@ -75,14 +75,15 @@ Page({
}) })
this.init(currentYear, tenement) this.init(currentYear, tenement)
}, },
onChangeTenement(e) { onChangeMeter(e) {
const { id, name } = e; const { id, code } = e;
console.log('e', e)
const { year } = this.data; const { year } = this.data;
// const currentYear = years[Number(e)] // const currentYear = years[Number(e)]
this.setData({ this.setData({
// year: currentYear, // year: currentYear,
tenement: id, codeId: id,
tenementName: name, meterCode: code,
type: "", type: "",
show: false, show: false,
title: "" title: ""
@ -93,26 +94,28 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const { year, tenement } = this.data; const { year } = this.data;
this.init(year, tenement); const tenement = wx.getStorageSync('tenement')
this.getTenementsList(); this.init(year, '');
this.getMeters(tenement?.id);
}, },
async getTenementsList() { refreshEmpty() {
const { code, message, data } = await getOwnTenementList() const tenement = wx.getStorageSync('tenement')
this.init(year, '');
this.init(year, tenement);
},
async getMeters(id) {
const { code, message, data } = await getTenementMeterList(id);
if (code !== OK) { if (code !== OK) {
alertInfo(message) alertInfo(message)
return return;
} }
let tenements = [{id: "", name: "全部"}]; this.setData({
data.forEach(item => { meterList: data || [],
if (item.tenements) {
tenements = [...tenements, ...item.tenements]
}
}) })
this.setData({ tenements })
}, },
async init(year, tenement) { async init(year, codeId) {
const { code, message, data = [], amount = 0 } = await getRechargeList(year, tenement); const { code, message, data = [], amount = 0 } = await getRechargeList(year, codeId);
if (code !== OK) { if (code !== OK) {
alertInfo(message) alertInfo(message)
return; return;

View File

@ -4,7 +4,8 @@
"scrollPageWrapper": "/components/scrollPageWrapper/index", "scrollPageWrapper": "/components/scrollPageWrapper/index",
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"custom-status-bar": "/components/customStatusBar/index", "custom-status-bar": "/components/customStatusBar/index",
"custom-picker": "/components/picker/index" "custom-picker": "/components/picker/index",
"empty": "/components/empty/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }

View File

@ -8,8 +8,8 @@
</view> </view>
<!-- </picker> --> <!-- </picker> -->
<!-- <picker bindchange="onChangeYear" value="{{index}}" range="{{years}}"> --> <!-- <picker bindchange="onChangeYear" value="{{index}}" range="{{years}}"> -->
<view class="tenementPicker" bind:tap="clickTenement"> <view class="tenementPicker" bind:tap="clickMeter">
<view wx:if="{{tenementName}}" class="tenementName"> {{ tenementName }} </view> <view wx:if="{{meterCode}}" class="tenementName"> {{ meterCode }} </view>
<view wx:else> 全部 </view> <view wx:else> 全部 </view>
<image src="/assets/images/down.png" mode="" class="down" /> <image src="/assets/images/down.png" mode="" class="down" />
</view> </view>
@ -18,7 +18,7 @@
合计: {{amount}}元 合计: {{amount}}元
</view> </view>
</view> </view>
<view class="wrapper"> <view class="wrapper" wx:if="{{list.length}}">
<view class="recordsWrapper"> <view class="recordsWrapper">
<view class="recordsItem border" wx:for="{{list}}" wx:key="index" bind:tap="jumpToDetail" data-id="{{item.id}}"> <view class="recordsItem border" wx:for="{{list}}" wx:key="index" bind:tap="jumpToDetail" data-id="{{item.id}}">
<view class="type"> 充值 </view> <view class="type"> 充值 </view>
@ -31,5 +31,7 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:else>
<empty bind:refresh="refreshEmpty" />
</view>
<custom-picker title="{{title}}" show="{{show}}" valueKey="name" columns="{{columns}}" bind:ok="onOk" bind:cancel="onCancel" type="{{type}}" /> <custom-picker title="{{title}}" show="{{show}}" valueKey="name" columns="{{columns}}" bind:ok="onOk" bind:cancel="onCancel" type="{{type}}" />

View File

@ -0,0 +1,66 @@
// pages/updateInvoice/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,7 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"info": "/pages/invoiceList/components/info/index"
},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,3 @@
<!--pages/updateInvoice/index.wxml-->
<navigator title="发票抬头" canBack="{{true}}" />
<info />

View File

@ -0,0 +1 @@
/* pages/updateInvoice/index.wxss */

View File

@ -2,8 +2,9 @@ import apis from '../utils/request';
const { GET, POST, PUT, DELETE } = apis const { GET, POST, PUT, DELETE } = apis
// 获取充值记录 // 获取充值记录
export const getRechargeList = async function(year, tenement) { export const getRechargeList = async function(year, codeId) {
return await GET(`/wx/getRechargeList?year=${year}&tenement=${tenement}`); const tenement = wx.getStorageSync('tenement')?.id
return await GET(`/wx/getRechargeList?year=${year}&tenement=${tenement}&codeId=${codeId}`);
} }
// 预备充值请求 // 预备充值请求