完善发票和充值
This commit is contained in:
parent
7648ace524
commit
c102434221
6
app.json
6
app.json
@ -1,17 +1,19 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
|
"pages/login/index",
|
||||||
"pages/invoiceList/index",
|
"pages/invoiceList/index",
|
||||||
"pages/rechargeRecord/index",
|
"pages/rechargeRecord/index",
|
||||||
"pages/meterList/index",
|
"pages/meterList/index",
|
||||||
"pages/recharge/index",
|
"pages/recharge/index",
|
||||||
"pages/login/index",
|
|
||||||
"pages/handleLogin/index",
|
"pages/handleLogin/index",
|
||||||
"pages/member/index",
|
"pages/member/index",
|
||||||
"pages/my/index",
|
"pages/my/index",
|
||||||
"pages/questions/index",
|
"pages/questions/index",
|
||||||
"pages/home/index",
|
"pages/home/index",
|
||||||
"pages/index/index",
|
"pages/index/index",
|
||||||
"pages/qrCode/index"
|
"pages/qrCode/index",
|
||||||
|
"pages/invoiceDetail/index",
|
||||||
|
"pages/editInvoice/index"
|
||||||
],
|
],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"list": [
|
"list": [
|
||||||
|
@ -30,7 +30,6 @@ Component({
|
|||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
async onInput(e) {
|
async onInput(e) {
|
||||||
console.log('this.type', this.data.type)
|
|
||||||
// this.setData({
|
// this.setData({
|
||||||
// visible: true,
|
// visible: true,
|
||||||
// list: [e.detail, e.detail, e.detail]
|
// list: [e.detail, e.detail, e.detail]
|
||||||
|
75
pages/editInvoice/index.js
Normal file
75
pages/editInvoice/index.js
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
import { getInvoiceInfoDetail } from "../../service/invoice";
|
||||||
|
|
||||||
|
// pages/invoiceInfo/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
detail: {}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
const { id } = options;
|
||||||
|
console.log('options', options)
|
||||||
|
if (id !== "-1") {
|
||||||
|
this.init(id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async init(id) {
|
||||||
|
const { code, message, data } = await getInvoiceInfoDetail(id)
|
||||||
|
this.setData({ detail: data });
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
6
pages/editInvoice/index.json
Normal file
6
pages/editInvoice/index.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index"
|
||||||
|
}
|
||||||
|
}
|
50
pages/editInvoice/index.wxml
Normal file
50
pages/editInvoice/index.wxml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<van-cell-group>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.name }}"
|
||||||
|
label="公司名称"
|
||||||
|
border="{{ false }}"
|
||||||
|
placeholder="请选择公司名称"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.tin }}"
|
||||||
|
label="税号"
|
||||||
|
border="{{ false }}"
|
||||||
|
placeholder="请输入税号"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.address }}"
|
||||||
|
label="单位地址"
|
||||||
|
border="{{ false }}"
|
||||||
|
placeholder="请输入单位地址"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.phone }}"
|
||||||
|
label="电话"
|
||||||
|
border="{{ false }}"
|
||||||
|
placeholder="请输入电话"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.bank }}"
|
||||||
|
label="开户银行"
|
||||||
|
border="{{ false }}"
|
||||||
|
placeholder="请输入开户银行"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.account }}"
|
||||||
|
label="开户账号"
|
||||||
|
border="{{ false }}"
|
||||||
|
placeholder="请输入开户账号"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.email }}"
|
||||||
|
label="邮箱"
|
||||||
|
border="{{ false }}"
|
||||||
|
placeholder="请输入邮箱"
|
||||||
|
/>
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<view class="wrapper operate">
|
||||||
|
<van-button type="info" block style="margin-left: 30rpx;flex: 1;">保存</van-button>
|
||||||
|
</view>
|
6
pages/editInvoice/index.wxss
Normal file
6
pages/editInvoice/index.wxss
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/* pages/editInvoice/index.wxss */
|
||||||
|
.operate {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
}
|
74
pages/invoiceDetail/index.js
Normal file
74
pages/invoiceDetail/index.js
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
import { getInvoiceInfoDetail } from "../../service/invoice";
|
||||||
|
|
||||||
|
// pages/invoiceInfo/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
detail: {}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
const { id } = options;
|
||||||
|
this.init(id);
|
||||||
|
},
|
||||||
|
async init(id) {
|
||||||
|
const { code, message, data } = await getInvoiceInfoDetail(id)
|
||||||
|
this.setData({ detail: data });
|
||||||
|
},
|
||||||
|
handleBack() {
|
||||||
|
wx.navigateBack()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
6
pages/invoiceDetail/index.json
Normal file
6
pages/invoiceDetail/index.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index"
|
||||||
|
}
|
||||||
|
}
|
50
pages/invoiceDetail/index.wxml
Normal file
50
pages/invoiceDetail/index.wxml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<!--pages/invoiceInfo/index.wxml-->
|
||||||
|
<van-cell-group>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.name }}"
|
||||||
|
label="公司名称"
|
||||||
|
border="{{ false }}"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.tin }}"
|
||||||
|
label="税号"
|
||||||
|
border="{{ false }}"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.address }}"
|
||||||
|
label="单位地址"
|
||||||
|
border="{{ false }}"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.phone }}"
|
||||||
|
label="电话"
|
||||||
|
border="{{ false }}"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.bank }}"
|
||||||
|
label="开户银行"
|
||||||
|
border="{{ false }}"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.account }}"
|
||||||
|
label="开户账号"
|
||||||
|
border="{{ false }}"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.email }}"
|
||||||
|
label="邮箱"
|
||||||
|
border="{{ false }}"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<view class="wrapper operate">
|
||||||
|
<van-button type="default" block style="flex: 1" bind:click="handleBack">返回</van-button>
|
||||||
|
<van-button type="info" block style="margin-left: 30rpx;flex: 1;">编辑</van-button>
|
||||||
|
</view>
|
7
pages/invoiceDetail/index.wxss
Normal file
7
pages/invoiceDetail/index.wxss
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/* pages/invoiceInfo/index.wxss */
|
||||||
|
|
||||||
|
.operate {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
}
|
@ -1,3 +1,7 @@
|
|||||||
|
import { deleteInvoiceInfo, getInvoiceInfoList } from "../../service/invoice";
|
||||||
|
import { alertInfo, alertSuccess, wxModal } from "../../utils/index";
|
||||||
|
import request from '../../utils/request'
|
||||||
|
const { OK } = request
|
||||||
// pages/invoiceList/index.js
|
// pages/invoiceList/index.js
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@ -5,7 +9,14 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
list: [],
|
||||||
|
show: false,
|
||||||
|
actions: [
|
||||||
|
{ name: '查看', },
|
||||||
|
{ name: '编辑', },
|
||||||
|
{ name: '删除', },
|
||||||
|
],
|
||||||
|
selectData: {}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,9 +37,53 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
const { data, code, message } = await getInvoiceInfoList()
|
||||||
|
this.setData({ list: data })
|
||||||
|
},
|
||||||
|
operate(e) {
|
||||||
|
const { data } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
selectData: data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.setData({ show: false, selectData: {} });
|
||||||
|
},
|
||||||
|
onSelect(e) {
|
||||||
|
const type = e.detail.name;
|
||||||
|
switch(type) {
|
||||||
|
case "编辑":
|
||||||
|
break;
|
||||||
|
case "查看":
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/invoiceDetail/index?id=' + this.data.selectData.id,
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case "删除":
|
||||||
|
this.handleDelete();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleDelete() {
|
||||||
|
const { id } = this.data.selectData;
|
||||||
|
await wxModal({ content: "确定要删除当前记录吗?" })
|
||||||
|
const { code, message } = await deleteInvoiceInfo(id)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("删除成功")
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
handleCreate() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/editInvoice/index?id=-1',
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面隐藏
|
* 生命周期函数--监听页面隐藏
|
||||||
*/
|
*/
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {
|
||||||
|
"van-action-sheet": "@vant/weapp/action-sheet/index",
|
||||||
|
"van-button": "@vant/weapp/button/index"
|
||||||
|
},
|
||||||
"navigationBarTitleText": "开票信息"
|
"navigationBarTitleText": "开票信息"
|
||||||
}
|
}
|
@ -1,2 +1,27 @@
|
|||||||
<!--pages/invoiceList/index.wxml-->
|
<!--pages/invoiceList/index.wxml-->
|
||||||
<text>pages/invoiceList/index.wxml</text>
|
<view class="wrapper">
|
||||||
|
<view
|
||||||
|
wx:for="{{list}}"
|
||||||
|
wx:key="index"
|
||||||
|
class="item"
|
||||||
|
>
|
||||||
|
<view style="flex: 1"> {{ item.tenement.name }} </view>
|
||||||
|
<view class="operate">
|
||||||
|
<view class="primaryTextBtn" data-data="{{item}}" bind:tap="operate"> 操作 </view>
|
||||||
|
<!-- <view class="primaryTextBtn" style="margin-left: 24rpx;"> 编辑 </view>
|
||||||
|
<view class="dangerTextBtn" style="margin-left: 24rpx;"> 删除 </view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="margin-top: 10vh;">
|
||||||
|
<van-button type="info" block bind:click="handleCreate">创建一个</van-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<van-action-sheet
|
||||||
|
show="{{ show }}"
|
||||||
|
actions="{{ actions }}"
|
||||||
|
bind:close="onClose"
|
||||||
|
bind:select="onSelect"
|
||||||
|
cancel-text="取消"
|
||||||
|
/>
|
@ -1 +1,15 @@
|
|||||||
/* pages/invoiceList/index.wxss */
|
/* pages/invoiceList/index.wxss */
|
||||||
|
.wrapper {
|
||||||
|
margin-left: 24rpx;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 10rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.operate {
|
||||||
|
display: flex;
|
||||||
|
}
|
@ -39,7 +39,6 @@ Component({
|
|||||||
},
|
},
|
||||||
async agree(e) {
|
async agree(e) {
|
||||||
const { user } = e.currentTarget.dataset;
|
const { user } = e.currentTarget.dataset;
|
||||||
console.log('user', user)
|
|
||||||
await wxModal({ content: `同意${user.nickName}的申请?` })
|
await wxModal({ content: `同意${user.nickName}的申请?` })
|
||||||
const { code, message } = await approveUser({ userId: user.id, type: 1 })
|
const { code, message } = await approveUser({ userId: user.id, type: 1 })
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
|
@ -39,7 +39,6 @@ Component({
|
|||||||
},
|
},
|
||||||
async setAdmin(e) {
|
async setAdmin(e) {
|
||||||
const { user } = e.currentTarget.dataset;
|
const { user } = e.currentTarget.dataset;
|
||||||
console.log('user', user)
|
|
||||||
await wxModal({ content: `你的管理员身份将转交给${user.nickName}` })
|
await wxModal({ content: `你的管理员身份将转交给${user.nickName}` })
|
||||||
const { code, message } = await approveUser({ userId: user.id, type: 2 })
|
const { code, message } = await approveUser({ userId: user.id, type: 2 })
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
|
@ -21,12 +21,10 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const { tenement, code } = options
|
const { tenement, code } = options
|
||||||
console.log('options', options)
|
|
||||||
this.init({ tenement, code })
|
this.init({ tenement, code })
|
||||||
},
|
},
|
||||||
async init(options) {
|
async init(options) {
|
||||||
const { code, message, data = {}} = await getMeterDetail(options)
|
const { code, message, data = {}} = await getMeterDetail(options)
|
||||||
console.log('data', data)
|
|
||||||
this.setData({
|
this.setData({
|
||||||
detail: data
|
detail: data
|
||||||
})
|
})
|
||||||
|
@ -46,7 +46,6 @@ Page({
|
|||||||
},
|
},
|
||||||
async init(year) {
|
async init(year) {
|
||||||
const { code, message, data } = await getRechargeList(year);
|
const { code, message, data } = await getRechargeList(year);
|
||||||
console.log('data', data)
|
|
||||||
this.setData({
|
this.setData({
|
||||||
list: data
|
list: data
|
||||||
})
|
})
|
||||||
|
@ -17,11 +17,16 @@ export const updateInvoiceInfo = async function(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 删除发票信息
|
// 删除发票信息
|
||||||
export const deleteInvoiceInfo = async function(data) {
|
export const deleteInvoiceInfo = async function(id) {
|
||||||
return await DELETE(`/wx/deleteInvoiceInfo/${id}`, data);
|
return await DELETE(`/wx/deleteInvoiceInfo/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取可开发票列表
|
// 获取可开发票列表
|
||||||
export const getInvoiceList = async function() {
|
export const getInvoiceList = async function() {
|
||||||
return await GET(`/wx/getInvoiceList`);
|
return await GET(`/wx/getInvoiceList`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取创建的发开票信息详情
|
||||||
|
export const getInvoiceInfoDetail = async function(id) {
|
||||||
|
return await GET(`/wx/getInvoiceInfoDetail/${id}`);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user