Compare commits

...

7 Commits

21 changed files with 603 additions and 127 deletions

View File

@ -1,9 +1,9 @@
{ {
"pages": [ "pages": [
"pages/home/index", "pages/home/index",
"pages/electricQuery/index",
"pages/billDetail/index", "pages/billDetail/index",
"pages/billList/index", "pages/billList/index",
"pages/electricQuery/index",
"pages/rechargeRecord/index", "pages/rechargeRecord/index",
"pages/invoiceList/index", "pages/invoiceList/index",
"pages/invoiceDetail/index", "pages/invoiceDetail/index",

View File

@ -1,20 +1,9 @@
import { getReportDetail } from "../../service/report"; import { getReportDetail } from "../../service/report";
import { alertInfo } from "../../utils/index"; import { alertInfo, getPixelRatio } from "../../utils/index";
import request from '../../utils/request' import request from '../../utils/request'
import * as echarts from '../../components/echarts/echarts'; import * as echarts from '../../components/echarts/echarts';
const { OK } = request const { OK } = request
const getPixelRatio = () => {
let pixelRatio = 0
wx.getSystemInfo({
success: function (res) {
pixelRatio = res.pixelRatio
},
fail: function () {
pixelRatio = 0
}
})
return pixelRatio
}
// pages/billDetail/index.js // pages/billDetail/index.js
Page({ Page({

View File

@ -1,10 +1,10 @@
// pages/electricQuery/index.js // pages/electricQuery/index.js
import { getAccountingList, getElectricityList, getMeterReadingList } from "../../service/accounting"; import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../service/accounting";
import { getTenementMeterList } from "../../service/meter"; import { getTenementMeterList } from "../../service/meter";
import dayjs from "../../utils/dayjs"; import dayjs from "../../utils/dayjs";
import request from '../../utils/request'; import request from '../../utils/request';
import * as echarts from '../../components/echarts/echarts'; import * as echarts from '../../components/echarts/echarts';
import { alertInfo } from "../../utils/index"; import { alertInfo, getPixelRatio, loadingFunc } from "../../utils/index";
const { OK } = request; const { OK } = request;
Page({ Page({
@ -99,6 +99,52 @@ Page({
return; return;
} }
this.setData({ list: data, electricNumber, meterNumber }) this.setData({ list: data, electricNumber, meterNumber })
if (!data?.length) {
return;
}
this.selectComponent('#echarts').init((canvas, width, height) => {
// 初始化图表
const pieChart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: getPixelRatio(),
});
const ids = [...new Set(data?.map(item => item?.meter?.id))]
const options = {
tooltip: {
trigger: 'axis'
},
legend: {
data: data?.map(item => item?.meter?.address),
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: [...new Set(data?.map(item => item.time))]
},
yAxis: {
type: 'value'
},
series: ids?.map(item => {
const element = data?.find(i => i?.meter?.id === item)
return {
name: element?.meter?.address,
type: 'line',
stack: 'Total',
data: data?.filter(ele => ele?.meter?.id === item).map(item => item.number)
}})
};
pieChart.setOption(options);
// 注意这里一定要返回 chart 实例,否则会影响事件处理等
return pieChart;
});
}, },
async getReadingList() { async getReadingList() {
const { meterId } = this.data; const { meterId } = this.data;
@ -109,6 +155,37 @@ Page({
} }
this.setData({ meterReadingList: data }) this.setData({ meterReadingList: data })
}, },
async export() {
loadingFunc(async () => {
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay } = this.data;
let time;
switch(timeType) {
case 1:
time = yearMonth;
break;
case 2:
time = year;
break;
default:
time = yearMonthDay;
break;
}
const data = await exportElectricityList({ type: timeType, meter: meterId, time: time })
// if (code !== OK) {
// alertInfo(message)
// return;
// }
wx.openDocument({
filePath: data.tempFilePath,
fileType: ['xlsx'],
success() {
},
fail(err) {
}
})
})
},
async getAccountingBalanceList() { async getAccountingBalanceList() {
const { meterId } = this.data; const { meterId } = this.data;
const { code, message, data } = await getAccountingList(meterId) const { code, message, data } = await getAccountingList(meterId)
@ -147,11 +224,7 @@ Page({
}) })
}, },
onOk(e) { onOk(e) {
const { type, value = {} } = e.detail;
const { id, code } = e.detail.value; const { id, code } = e.detail.value;
console.log('e', e)
const { year } = this.data;
// const currentYear = years[Number(e)]
this.setData({ this.setData({
// year: currentYear, // year: currentYear,
meterId: id, meterId: id,

View File

@ -9,7 +9,8 @@
"table": "/components/table/table", "table": "/components/table/table",
"empty": "/components/empty/index", "empty": "/components/empty/index",
"timePicker": "/components/timePicker/index", "timePicker": "/components/timePicker/index",
"accountingCard": "./components/accountingCard/index" "accountingCard": "./components/accountingCard/index",
"echarts": "/components/echarts/ec-canvas"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }

View File

@ -53,7 +53,7 @@
<view class="timeText" wx:else> {{year}} </view> <view class="timeText" wx:else> {{year}} </view>
<van-icon name="arrow-down" /> <van-icon name="arrow-down" />
</view> </view>
<van-button type="info" size="small"> 导出 </van-button> <van-button type="info" size="small" bind:click="export"> 导出 </van-button>
</view> </view>
</view> </view>
<view wx:elif="{{queryType === 1}}"> <view wx:elif="{{queryType === 1}}">
@ -94,14 +94,16 @@
</view> </view>
</view> </view>
<!-- <echarts <echarts
style="width:200rpx;height:200rpx;position:relative" style="width:200rpx;height:180rpx;"
id="echarts" id="echarts"
class='mychart-bar' class='mychart-bar'
canvas-id="mychart-bar" canvas-id="mychart-bar"
ec="{{ ec }}" ec="{{ ec }}"
forceUseOldCanvas="{{false}}"
wx:if="{{list.length}}"
> >
</echarts> --> </echarts>
<custom-picker <custom-picker
title="{{title}}" title="{{title}}"
show="{{show}}" show="{{show}}"

View File

@ -6,7 +6,8 @@
"van-field": "@vant/weapp/field/index", "van-field": "@vant/weapp/field/index",
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"van-tab": "@vant/weapp/tab/index", "van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index" "van-tabs": "@vant/weapp/tabs/index",
"navigator": "/components/navigator/index"
}, },
"navigationBarTitleText": "绑定商户" "navigationStyle": "custom"
} }

View File

@ -1,5 +1,6 @@
<!--pages/handleLogin/index.wxml--> <!--pages/handleLogin/index.wxml-->
<!-- <topbar /> --> <!-- <topbar /> -->
<navigator title="绑定商户" canBack="{{true}}" />
<van-tabs> <van-tabs>
<van-tab title="扫码绑定"> <van-tab title="扫码绑定">
<view class="codeContent"> <view class="codeContent">

View File

@ -79,7 +79,7 @@ Page({
park: value, park: value,
tenement: value.tenements?.[0] tenement: value.tenements?.[0]
}) })
wx.setStorageSync('park', park) wx.setStorageSync('park', value)
wx.setStorageSync('tenement', value.tenements?.[0]) wx.setStorageSync('tenement', value.tenements?.[0])
break; break;
case "tenement": case "tenement":
@ -160,7 +160,6 @@ Page({
paySign: data?.paySign, paySign: data?.paySign,
signType: 'RSA', signType: 'RSA',
success: (res) => { success: (res) => {
console.log('success', res)
alertSuccess("充值成功") alertSuccess("充值成功")
that.setData({ that.setData({
money: null money: null
@ -190,7 +189,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.setUser();
this.getAllList(); this.getAllList();
this.watchTenement(); this.watchTenement();
this.watchPark(); this.watchPark();
@ -210,10 +209,8 @@ Page({
set: function (newVal) { set: function (newVal) {
// const oldValue = value; // const oldValue = value;
wx.setStorageSync('tenement', newVal) wx.setStorageSync('tenement', newVal)
if (value !== newVal) { that.getMeters(newVal);
that.getMeters(newVal); that.setUser();
that.setUser();
}
value = newVal; value = newVal;
} }
}); });
@ -313,7 +310,9 @@ Page({
this.setData({ this.setData({
...updateDatas ...updateDatas
}, () => { }, () => {
this.getMeters({ id: updateDatas.tenement.id }) if (updateDatas?.tenement?.id) {
this.getMeters({ id: updateDatas?.tenement?.id })
}
}) })
}, },
jumpToRecord() { jumpToRecord() {

View File

@ -70,14 +70,21 @@
title-width="132rpx" title-width="132rpx"
border="{{ false }}" border="{{ false }}"
/> />
<van-field
wx:elif="{{editType === 'edit' && formData.headerType === 0 }}"
value="{{formData.name || '--'}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}"
disabled="{{true}}"
title-width="132rpx"
border="{{ true }}"
/>
<van-field <van-field
wx:else wx:else
value="{{formData.name}}" value="{{formData.name}}"
label="发票抬头" label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
disabled="{{formData.headerType !== 1}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx" title-width="132rpx"
bind:change="onChangeText" bind:change="onChangeText"
data-name="name" data-name="name"
@ -102,8 +109,6 @@
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'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx" title-width="132rpx"
bind:change="onChangeText" bind:change="onChangeText"
data-name="tin" data-name="tin"
@ -126,8 +131,6 @@
wx:if="{{editType === 'edit' && formData.headerType === 0}}" wx:if="{{editType === 'edit' && formData.headerType === 0}}"
placeholder="{{'请输入开户行'}}" placeholder="{{'请输入开户行'}}"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
autosize="{{true}}"
type="textarea"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"
@ -154,8 +157,6 @@
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'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"
@ -182,8 +183,6 @@
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'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"
@ -210,8 +209,6 @@
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'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"
@ -237,8 +234,6 @@
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'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"
@ -269,8 +264,6 @@
label="电子邮箱" label="电子邮箱"
custom-style="padding-left: 0; padding-right: 0;" custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}" readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx" title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}" border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText" bind:change="onChangeText"

View File

@ -20,19 +20,19 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad() { onLoad() {
const user = wx.getStorageSync('user') // const user = wx.getStorageSync('user')
if (!user || !user.id) { // if (!user || !user.id) {
return; // return;
} // }
// if (user.status === 0 || user.status === 2) { // if (user.status === 0 || user.status === 2) {
// wx.redirectTo({ // wx.redirectTo({
// url: '/pages/waitApprove/index', // url: '/pages/waitApprove/index',
// }) // })
// return // return
// } // }
wx.switchTab({ // wx.switchTab({
url: '/pages/home/index', // url: '/pages/home/index',
}) // })
}, },
/** /**

View File

@ -69,7 +69,7 @@ Page({
}, },
jumpToUpdateInvoice() { jumpToUpdateInvoice() {
wx.navigateTo({ wx.navigateTo({
url: '/pages/updateInvoice/index', url: '/pages/invoiceList/index?tab=2',
}) })
}, },
async getUnReadNumber() { async getUnReadNumber() {

View File

@ -1,7 +1,9 @@
{ {
"usingComponents": { "usingComponents": {
"van-image": "@vant/weapp/image/index" "van-image": "@vant/weapp/image/index",
"navigator": "/components/navigator/index"
}, },
"navigationBarTitleText": "二维码" "navigationBarTitleText": "二维码",
"navigationStyle": "custom"
} }

View File

@ -8,7 +8,7 @@
</view> </view>
</view> --> </view> -->
<navigator title="二维码" canBack="{{true}}" />
<view class="wrapper"> <view class="wrapper">
<view class="image"> <view class="image">
<van-image width="400rpx" height="400rpx" src="{{url}}" /> <van-image width="400rpx" height="400rpx" src="{{url}}" />

View File

@ -1,7 +1,5 @@
/* pages/qrCode/index.wxss */ /* pages/qrCode/index.wxss */
.wrapper { .wrapper {
width: 100vw;
height: 100vh;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -22,7 +20,6 @@
.tenement { .tenement {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.name { .name {
@ -33,4 +30,5 @@
margin: 50rpx 40rpx; margin: 50rpx 40rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-top: 10vh;
} }

View File

@ -65,9 +65,8 @@ Page({
}, },
onChangeYear(e) { onChangeYear(e) {
const { years, codeId } = this.data; const { codeId } = this.data;
const currentYear = e const currentYear = e
console.log('e', e, 'currentYear', currentYear, 'years', years)
this.setData({ this.setData({
year: currentYear, year: currentYear,
type: "", type: "",

View File

@ -1,66 +1,118 @@
// pages/updateInvoice/index.js import { getInvoiceInfo, updateInvoiceInfo } from "../../service/invoice"
Page({ import { getUserInfo } from "../../service/user";
import { alertInfo, alertSuccess } from "../../utils/index";
import request from '../../utils/request'
const { OK } = request
// pages/invoiceList/components/info/index.js
Component({
/** /**
* 页面的初始数据 * 组件的属性列表
*/
properties: {
},
lifetimes: {
attached() {
this.getDetail();
this.getUser();
}
},
/**
* 组件的初始数据
*/ */
data: { data: {
detail: { },
formData: {headerType: 0, name: wx.getStorageSync('tenement')?.name},
editType: "detail"
}, },
/** /**
* 生命周期函数--监听页面加载 * 组件的方法列表
*/ */
onLoad(options) { methods: {
async getDetail() {
}, const { code, message, data } = await getInvoiceInfo()
if (code !== OK) {
/** alertInfo(message)
* 生命周期函数--监听页面初次渲染完成 return;
*/ }
onReady() { this.setData({ detail: {...data,name: wx.getStorageSync('tenement')?.name, },editType: 'detail', })
},
}, async getUser() {
const { code, message, data } = await getUserInfo()
/** this.setData({ user: data });
* 生命周期函数--监听页面显示 },
*/ changeEditType() {
onShow() { this.setData({ editType: 'edit', formData: {...this.data.detail, tenement: wx.getStorageSync('tenement')?.id} })
},
}, cancelEdit() {
this.setData({ editType: 'detail', formData: {} })
/** },
* 生命周期函数--监听页面隐藏 onChangeType(e) {
*/ const { formData } = this.data;
onHide() { this.setData({ formData: {...formData, type: e.detail} })
},
}, onChangeHeaderType(e) {
const { formData } = this.data;
/** this.setData({ formData: {...formData, headerType: e.detail} })
* 生命周期函数--监听页面卸载 },
*/ onChangeText(e) {
onUnload() { const { name } = e.currentTarget.dataset;
const { formData } = this.data;
}, this.setData({ formData: {...formData, [name]: e.detail} })
},
/** async submit() {
* 页面相关事件处理函数--监听用户下拉动作 const { formData } = this.data;
*/ const { tin, address, phone, bank, account, email, type, headerType, name } = formData;
onPullDownRefresh() { if (type !== 0 && type !== 1) {
alertInfo("请选择发票类型");
}, return;
}
/** if (headerType !== 0 && headerType !== 1) {
* 页面上拉触底事件的处理函数 alertInfo("请选择抬头类型");
*/ return;
onReachBottom() { }
if (headerType === 1) {
}, if (!name) {
alertInfo("请输入发票抬头")
/** return
* 用户点击右上角分享 }
*/ }
onShareAppMessage() { if (!email || !/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(email)) {
alertInfo("邮箱格式不正确")
return;
}
if (headerType === 0) {
if (!tin) {
alertInfo("请输入发票税号")
return;
}
// if (!address) {
// alertInfo("请输入地址")
// return;
// }
if (!phone) {
alertInfo("请输入电话")
return;
}
if (!bank) {
alertInfo("请输入开户行")
return;
}
if (!account) {
alertInfo("请输入银行账号")
return;
}
}
const { code, message } = await updateInvoiceInfo(formData)
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("编辑成功")
this.getDetail()
}
} }
}) })

View File

@ -1,7 +1,13 @@
{ {
"usingComponents": { "usingComponents": {
"navigator": "/components/navigator/index", "navigator": "/components/navigator/index",
"info": "/pages/invoiceList/components/info/index" "info": "/pages/invoiceList/components/info/index",
"card": "/components/card/index",
"van-icon": "@vant/weapp/icon/index",
"van-field": "@vant/weapp/field/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-button": "@vant/weapp/button/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }

View File

@ -1,3 +1,298 @@
<!--pages/updateInvoice/index.wxml--> <!--pages/updateInvoice/index.wxml-->
<navigator title="发票抬头" canBack="{{true}}" /> <navigator title="发票抬头" canBack="{{true}}" />
<info /> <view class="cardWrapper">
<card title="发票详情">
<view
slot="operate"
class="cardOperate"
wx:if="{{editType === 'detail' && user.isAdmin}}"
bind:tap="changeEditType"
>
<van-icon name="edit" />
<view class="editContent">修改</view>
</view>
<view slot="content">
<van-field
label="发票类型"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}">
<van-radio-group direction="horizontal" value="{{formData.type}}" bind:change="onChangeType">
<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-group>
</view>
<view wx:else slot="input" style="margin-top: -10rpx;">
<view wx:if="{{detail.type === 0}}"> 普通电子发票 </view>
<view wx:elif="{{detail.type === 1}}"> 增值税专用电子发票 </view>
<view wx:else>-</view>
</view>
</van-field>
<van-field
label="抬头类型"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
custom-style="padding-left: 0; padding-right: 0;"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
>
<view slot="input" style="margin-top: 16rpx;" wx:if="{{editType === 'edit'}}">
<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="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio>
</van-radio-group>
</view>
<view
wx:else
slot="input"
style="margin-top: -10rpx;"
>
<view wx:if="{{detail.headerType === 0}}"> 企业单位 </view>
<view wx:elif="{{detail.headerType === 1}}"> 个人/非企业单位 </view>
<view wx:else>-</view>
</view>
</van-field>
<van-field
wx:if="{{editType === 'detail'}}"
value="{{detail.name || '--'}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ false }}"
/>
<van-field
wx:elif="{{editType === 'edit' }}"
value="{{detail.name || '--'}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{true}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ false }}"
/>
<van-field
wx:else
value="{{formData.name}}"
label="发票抬头"
custom-style="padding-left: 0; padding-right: 0;"
disabled="{{formData.headerType !== 1}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
bind:change="onChangeText"
data-name="name"
bind:change="onChangeText"
border="{{ true }}"
/>
<van-field
value="{{detail.tin|| '--'}}"
label="发票税号"
wx:if="{{editType === 'detail' && detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field
value="{{formData.tin }}"
label="发票税号"
wx:if="{{editType === 'edit' && formData.headerType === 0}}"
placeholder="{{editType === 'edit' ? '请输入发票税号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
bind:change="onChangeText"
data-name="tin"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field
value="{{detail.bank || '--'}}"
label="开户行"
wx:if="{{editType === 'detail' && detail.headerType === 0}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
/>
<van-field
value="{{formData.bank}}"
label="开户行"
wx:if="{{editType === 'edit' && formData.headerType === 0}}"
placeholder="{{'请输入开户行'}}"
custom-style="padding-left: 0; padding-right: 0;"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="bank"
/>
<van-field
value="{{detail.account || '--'}}"
label="银行账号"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="account"
/>
<van-field
value="{{formData.account}}"
label="银行账号"
wx:if="{{(editType === 'edit' && formData.headerType === 0) }}"
placeholder="{{editType === 'edit' ? '请输入银行账号' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="account"
/>
<van-field
value="{{detail.address || '--'}}"
label="地址"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="address"
/>
<van-field
value="{{formData.address}}"
label="地址"
wx:if="{{(editType === 'edit' && formData.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入地址' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="address"
/>
<van-field
value="{{detail.phone || '--'}}"
label="电话"
wx:if="{{(editType === 'detail' && detail.headerType === 0)}}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
/>
<van-field
value="{{formData.phone }}"
label="电话"
wx:if="{{(editType === 'edit' && formData.headerType === 0) }}"
placeholder="{{editType === 'edit' ? '请输入电话' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="phone"
/>
<van-field
value="{{detail.remark || '--'}}"
label="备注"
wx:if="{{editType === 'detail' }}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="remark"
/>
<van-field
value="{{formData.remark}}"
label="备注"
wx:else
placeholder="{{editType === 'edit' ? '请输入备注' : ''}}"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="remark"
/>
</view>
</card>
</view>
<view class="cardWrapper" style="margin-bottom: 40rpx;">
<card title="接收信息">
<view slot="content">
<van-field
value="{{detail.email || '--'}}"
wx:if="{{editType === 'detail'}}"
label="电子邮箱"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="email"
/>
<van-field
value="{{formData.email}}"
wx:else
label="电子邮箱"
custom-style="padding-left: 0; padding-right: 0;"
readonly="{{editType === 'detail'}}"
autosize="{{true}}"
type="textarea"
title-width="132rpx"
border="{{ editType === 'detail' ? false : true }}"
bind:change="onChangeText"
data-name="email"
/>
</view>
</card>
</view>
<view class="submit" wx:if="{{editType === 'edit'}}">
<van-button block class="cancelEdit" bind:click="cancelEdit">取消编辑</van-button>
<van-button type="info" block class="save" bind:click="submit">保存</van-button>
</view>

View File

@ -1 +1,34 @@
/* pages/updateInvoice/index.wxss */ /* pages/updateInvoice/index.wxss *//* pages/invoiceList/components/info/index.wxss */
.cardOperate {
display: flex;
align-items: center;
font-size: 32rpx;
}
.cardWrapper {
margin-top: 30rpx;
}
.editContent {
margin-left: 20rpx;
}
.van-cell {
padding-left: 0rpx !important;
padding-right: 0rpx !important;
}
.submit {
margin: 32rpx;
margin-bottom: 50rpx;
display: flex;
align-items: center;
}
.cancelEdit, .save {
flex: 1;
}
.cancelEdit {
margin-right: 40rpx;
}

View File

@ -1,4 +1,5 @@
import apis from '../utils/request'; import apis from '../utils/request';
import { getConfigByEnv } from "../utils/index"
const { GET, POST, PUT, DELETE } = apis const { GET, POST, PUT, DELETE } = apis
// 获取电费账单列表 // 获取电费账单列表
@ -22,4 +23,22 @@ export const getMeterReadingList = async function(meter) {
export const getAccountingList = async function(meter) { export const getAccountingList = async function(meter) {
const tenement = wx.getStorageSync('tenement')?.id || "" const tenement = wx.getStorageSync('tenement')?.id || ""
return await GET(`/wx/getAccountingList?tenement=${tenement}&meter=${meter}`); return await GET(`/wx/getAccountingList?tenement=${tenement}&meter=${meter}`);
}
// 导出电量查询
export const exportElectricityList = async function({ meter, type, time }) {
const tenement = wx.getStorageSync('tenement')?.id || ""
const { api } = getConfigByEnv();
return new Promise(resolve => {
wx.downloadFile({
url: `${api}/wx/getElectricityList/export?tenement=${tenement}&meter=${meter}&type=${type}&time=${time}`,
success(res) {
console.log('请求成功结果', res)
resolve(res)
},
fail(err) {
console.log('err', err)
}
})
})
} }

View File

@ -220,3 +220,16 @@ export const wxModal = (data) => {
}) })
} }
export const getPixelRatio = () => {
let pixelRatio = 0
wx.getSystemInfo({
success: function (res) {
pixelRatio = res.pixelRatio
},
fail: function () {
pixelRatio = 0
}
})
return pixelRatio
}