Commit 277e963d authored by 刘文虎's avatar 刘文虎

1账单回收站, 2修复收据账单金额过长时图片大写金额无法显示BUG

parent 91ad6dc5
...@@ -3,7 +3,7 @@ import request from "@/utils/request.js" ...@@ -3,7 +3,7 @@ import request from "@/utils/request.js"
// 天气 // 天气
export async function getWeather(data) { export async function getWeather(data) {
return request({ return request({
url: `/rest/anno/weather/getWeather`, url: `/rest/anno/weather/v2/getWeather`,
method: 'GET', method: 'GET',
data, data,
noLoading: true noLoading: true
......
import request from "@/utils/request.js"
export async function getList(data) {
return request({
url: `/rest/user/getRecyclingStationList`,
method: 'GET',
data
})
}
export async function deleteById(data) {
return request({
url: `/rest/user/backRecyclingStation`,
method: 'GET',
data
})
}
\ No newline at end of file
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"name" : "扳手记账", "name" : "扳手记账",
"appid" : "__UNI__EDB8C7C", "appid" : "__UNI__EDB8C7C",
"description" : "", "description" : "",
"versionName" : "1.2.3", "versionName" : "1.2.4",
"versionCode" : 123, "versionCode" : 124,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
], ],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], "abiFilters" : [ "arm64-v8a" ],
"autoSdkPermissions" : false, "autoSdkPermissions" : false,
"permissionExternalStorage" : { "permissionExternalStorage" : {
"request" : "none", "request" : "none",
......
...@@ -377,6 +377,15 @@ ...@@ -377,6 +377,15 @@
} }
} }
,{
"path" : "recyled/recyled",
"style" :
{
"navigationBarTitleText": "账单回收站",
"enablePullDownRefresh": false
}
}
] ]
}, },
{ {
......
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
current: 0, // tabs组件的current值,表示当前活动的tab选项 current: 0, // tabs组件的current值,表示当前活动的tab选项
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的 swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
tabs: debitNoteTabs, tabs: debitNoteTabs,
pages: debitNotePages, pages: JSON.parse(JSON.stringify(debitNotePages)),
activeItemStyle: { activeItemStyle: {
color: '#ff286d' color: '#ff286d'
}, },
...@@ -171,6 +171,7 @@ export default { ...@@ -171,6 +171,7 @@ export default {
this.swiperCurrent = current; this.swiperCurrent = current;
this.current = current; this.current = current;
console.log('-------animationfinish------'); console.log('-------animationfinish------');
console.log(this.currentPage);
if (this.currentPage.pageNumber === 1) { if (this.currentPage.pageNumber === 1) {
this.onRefresh(); this.onRefresh();
} }
......
...@@ -19,15 +19,15 @@ ...@@ -19,15 +19,15 @@
<view class="title-view">扳手记账</view> <view class="title-view">扳手记账</view>
</view> </view>
<view class="right-view" @click="$u.throttle(getWeather, 1000)"> <view class="right-view" @click="$u.throttle(getWeather, 1000)">
<view class="location-view"> <view class="location-view" v-if="!weather.text">
<view class="location-icon-view"><image :src="dingweidizhiImage"></image></view> <view class="location-icon-view"><image :src="dingweidizhiImage"></image></view>
<view>{{ weather.city || '查天气' }}</view> <view>查天气</view>
</view> </view>
<view class="weather-view" v-if="weather.weather"> <view class="weather-view" v-if="weather.text">
<!-- <view class="weather-icon-view"> <!-- <view class="weather-icon-view">
<image :src="weather.icon"></image> <image :src="weather.icon"></image>
</view> --> </view> -->
<view class="weather-text">{{ weather.weather }}</view> <view class="weather-text">{{ weather.text }}</view>
<view>{{ weather.temp }}℃</view> <view>{{ weather.temp }}℃</view>
</view> </view>
</view> </view>
...@@ -658,7 +658,7 @@ export default { ...@@ -658,7 +658,7 @@ export default {
color: #333333; color: #333333;
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 24rpx; // margin-left: 24rpx;
.weather-icon-view { .weather-icon-view {
margin-right: 8rpx; margin-right: 8rpx;
width: 28rpx; width: 28rpx;
......
<template>
<view class="debit-detail">
<view class="debit-detail-icon" v-if="detail.icon">
<image :src="detail.icon" mode=""></image>
</view>
<view class="content">
<view class="content-title">
<view class="content-title-text ellipsis">
<text>{{detail.name}}</text>
</view>
<view class="amount ellipsis" v-if="detail.amount">{{detail.amount}}</view>
</view>
<view class="content-item">
<text class="content-item-label">创建时间</text>
<text class="content-item-value">{{detail.createTime || ''}}</text>
</view>
<view class="content-item">
<text class="content-item-label">删除时间</text>
<text class="content-item-value">{{detail.deleteTime || ''}}</text>
</view>
</view>
<view class="debit-detail-right" hover-class="u-hover-class" @click="toRecyled">
恢复
</view>
</view>
</template>
<script>
export default {
props: {
detail: {
type: Object,
default: () => {}
},
current: {
type: Number,
default: 0
},
},
computed:{
showDebtAmount(){
let debtAmount=this.detail.debtAmount
if(!debtAmount){
return false
}
return parseFloat(debtAmount)>0
}
},
data() {
return {};
},
methods:{
toBill(){
this.$u.route({
url: '/pages/maintain-bill/index',
type: 'navigateTo',
params: {
customerId:this.detail.customerId,
onlyDebt:1,
}
});
},
toRecyled(){
this.$emit("handleClick",this.detail)
}
}
};
</script>
<style lang="scss" scoped>
.debit-detail {
// height: 152upx;
background: #FFFFFF;
border-radius: 16upx;
padding: 24upx;
padding-right: 0;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24upx;
.content {
flex: 1;
// width: 420upx;
position: relative;
overflow: hidden;
&-title{
font-size: 28upx;
// line-height: 40upx;
// min-height: 40upx;
margin-bottom: 12upx;
font-weight: bold;
&-text{
display: inline-block;
margin-right: 24rpx;
max-width: 422rpx;
}
.amount{
display: inline-block;
// max-width: 108rpx;
}
}
&-item {
font-size: 24upx;
line-height: 40upx;
min-height: 40upx;
&-label {
color: #8D8D8D;
}
&-value {
// font-weight: bold;
margin-left: 24rpx;
color: #8D8D8D;
}
}
}
&-icon{
width: 72rpx;
height: 72rpx;
margin-right: 24rpx;
}
&-right {
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
margin-left: 24rpx;
width: 100rpx;
height: 100%;
color: #3383FE;
}
}
</style>
<template>
<!-- 查欠账 -->
<view class="debit-note">
<!-- <view class="search-wrap">
<u-search v-model="form.keyword" height="80" bg-color="#ffffff" :show-action="false" placeholder="搜索客户姓名/手机"
@search="changeSearch"></u-search>
</view> -->
<view class="tabs-box">
<u-tabs-swiper ref="uTabs" bg-color="#f6f7fa" font-size="28" bar-width="32" bar-height="4" height="60"
inactive-color="#8D8D8D" active-color="#02A074" name="title" :list="tabs" :current="current"
@change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view>
<view class="swiper-box">
<swiper duration="200" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"
style="height:100%">
<swiper-item class="swiper-item" v-for="(listData, index) in list" :key="index">
<scroll-view scroll-y scroll-anchoring style="height: 100%;width: 100%;"
@scrolltolower="onreachBottom" @refresherrefresh="refresherrefresh"
@refresherrestore="onRestore" enable-back-to-top refresher-enabled
:refresher-triggered="getCurrentPage(index).triggered" :refresher-threshold="100">
<view class="scroll-view">
<NoData v-if="noData(index)" :text="noDataText" customStyle="margin-top: 0rpx;" />
<template v-else>
<view class="container"><debit-detail v-for="item in listData" :key="item.id"
:detail="item" :current="current" @handleClick="handleClick"></debit-detail>
</view>
<view class="loading-view"
v-if="!getCurrentPage(index).loaded && getCurrentPage(index).freshing"><u-loading
mode="flower"></u-loading></view>
<view
v-show="(getCurrentPage(index).pageNumber === 1 && getCurrentPage(index).loaded) || getCurrentPage(index).pageNumber > 1">
<u-loadmore :status="getCurrentPage(index).loadStatus" />
</view>
</template>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
<PopInput title="提醒" type="text" sureText="恢复" :content="popContent" :visible.sync="showConfirm"
@click="handleConfirm" />
</view>
</template>
<script>
import NoData from '@/components/no-data';
import PopInput from '@/components/pop-input-view';
import DebitDetail from './components/debit-detail.vue';
import {
billBaseUrl
} from '@/utils/config.js';
import {
debitNotePages
} from '@/utils/options/bill/index.js';
import {
tabsOptions
} from '@/utils/options/mine/recyled.js';
import {
getList,
deleteById
} from '@/api/mine/recyled.js';
export default {
components: {
NoData,
DebitDetail,
PopInput
},
data() {
return {
form: {
keyword: ''
},
// list: [[], [], []],
list: {
'0': [],
'1': [],
'2': []
},
current: 0, // tabs组件的current值,表示当前活动的tab选项
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
tabs: tabsOptions,
pages: JSON.parse(JSON.stringify(debitNotePages)),
activeItemStyle: {
color: '#ff286d'
},
noDataText: '当前暂无账单信息',
currentItem: null,
showConfirm: false, // 删除弹框
};
},
computed: {
currentTab() {
return this.tabs[this.current];
},
currentPage() {
return this.pages[this.current];
},
popContent() {
return this.current === 2 ? "确定恢复此记录吗?" : "确定恢复此账单吗?"
}
},
onLoad(options) {
this.init();
uni.$on('debit-bill-list', res => {
this.init();
});
},
onUnload() {
uni.$off('debit-bill-list');
},
methods: {
handleClick(info) {
this.currentItem = info
this.showConfirm = true
},
handleConfirm() {
this.handleDelete();
},
async handleDelete() {
if (!this.currentItem.id) {
this.showToast(this.current === 2 ? "记录不存在" : "账单不存在");
return false;
}
try {
await deleteById({id:this.currentItem.id,type:this.currentItem.type.code});
this.showToast('删除成功', true);
this.onRefresh();
} catch (e) {
//TODO handle the exception
}
},
changeSearch() {
this.onRefresh();
},
noData(index) {
return this.list[index].length == 0 && this.getCurrentPage(index).loaded;
},
getCurrentPage(index) {
return this.pages[index];
},
init() {
this.onRefresh();
},
async getData() {
if (this.currentPage.pageNumber === 1) {
this.currentPage.loaded = false;
}
var postData = {
// keyword: this.form.keyword,
type: this.currentTab.name,
size: this.currentPage.size,
current: this.currentPage.pageNumber
};
try {
let res = await getList(postData);
let records = res.data;
if (this.currentPage.pageNumber === 1) {
// 下拉刷新或切换到新tab,清空对应数组
this.list[this.current] = [];
}
if (records && records.length) {
this.list[this.current].push(...records);
// 更新底部加载状态
}
// 更新底部加载状态
this.currentPage.loadStatus ='nomore';
} catch (e) {
console.log('error', e);
}
this.currentPage.loaded = true;
this.$nextTick(() => {
this.currentPage.triggered = false;
this.currentPage.freshing = false;
});
},
// tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
console.log('-------tabsChange------');
// this.getWalletRecord(); // 与swiper change重复,tab变化无需再次请求数据
},
// swiper-item左右移动,通知tabs的滑块跟随移动
transition(e) {
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
// swiper滑动结束,分别设置tabs和swiper的状态
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
console.log('-------animationfinish------');
console.log(this.currentPage);
if (this.currentPage.pageNumber === 1) {
this.onRefresh();
}
},
onRefresh() {
if (this.currentPage.freshing) return;
this.currentPage.freshing = true;
this.currentPage.pageNumber = 1;
this.getData();
},
refresherrefresh() {
this.currentPage.triggered = true;
this.onRefresh()
},
onRestore() {
// this.currentPage.triggered = 'restore'; // 需要重置
},
onreachBottom(e) {
//上拉触底函数
if (this.currentPage.loadStatus === 'loadmore') {
//此处判断,上锁,防止重复请求
this.currentPage.loadStatus == 'loading';
this.currentPage.pageNumber += 1;
this.getData();
}
}
}
};
</script>
<style lang="scss" scoped>
.debit-note {
padding: 24upx;
height: 100vh;
display: flex;
flex-direction: column;
.search-wrap {
width: 100%;
}
.tabs-box {
margin: 32upx 0;
}
.swiper-box {
flex: 1;
width: 100%;
}
.swiper-item {
height: 100%;
}
.container {
padding: 20upx 0;
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
top: 50%;
left: 0;
position: fixed;
}
.scroll-view {
width: 100%;
height: 100%;
}
}
</style>
\ No newline at end of file
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
current: 1, current: 1,
size: 20, size: 20,
employees: [], employees: [],
// showMember: false, showMember: false,
platform: '', platform: '',
focus: false, focus: false,
currentPopInfo: {} currentPopInfo: {}
......
This diff is collapsed.
...@@ -244,12 +244,12 @@ export const canvasTableCellOptions = [{ ...@@ -244,12 +244,12 @@ export const canvasTableCellOptions = [{
export const tableFooterOptions = [{ export const tableFooterOptions = [{
value: "upperCase", value: "upperCase",
label: "大写金额:", label: "大写金额:",
width: "70%", width: "140px",
}, },
{ {
value: "lowerCase", value: "lowerCase",
label: "(小写)", label: "(小写)",
width: "30%", width: "55px",
}, },
] ]
......
...@@ -49,6 +49,12 @@ export const packageOptions = [ ...@@ -49,6 +49,12 @@ export const packageOptions = [
icon: 'file-text', icon: 'file-text',
path: "/pages/mine/import-export/import-export" path: "/pages/mine/import-export/import-export"
}, },
{
id: 5,
title: '账单回收站',
icon: 'file-text',
path: "/pages/mine/recyled/recyled"
},
{ {
id: 1, id: 1,
title: '关于', title: '关于',
......
export const tabsOptions = [{
title: '日常记账',
name: "DAILY"
},
{
title: '收据记账',
name: "REPAIR"
},
{
title: '记工时',
name: 'PROJECT'
},
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment