Commit 44d24efc authored by 刘文虎's avatar 刘文虎

收据样式,记账统计,备注模板,移除左滑删除/编辑

parent cd26b144
Pipeline #3431 canceled with stages
;(function() { ;(function() {
let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'test' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null let ENV_VAR = null
let VERSION = 'v1.0.15' let VERSION = 'v1.0.15'
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
......
import request from "@/utils/request.js"
export function getList(data) {
return request({
url: `/rest/repair/getRemarkTemplate`,
method: 'GET',
data,
noLoading:true
})
}
export function deleteById(data) {
return request({
url: `/remarkTemplate`,
method: 'DELETE',
data
})
}
export function update(data) {
return request({
url: `/rest/repair/RemarkTemplate`,
method: 'POST',
data,
noLoading:true
})
}
\ No newline at end of file
...@@ -40,6 +40,16 @@ export async function repair(data) { ...@@ -40,6 +40,16 @@ export async function repair(data) {
}) })
} }
// 维修账单统计
export async function repairStatistical(data) {
return request({
url: `/rest/repair/statistical`,
method: 'GET',
data,
noLoading: true
})
}
// 导出账单 // 导出账单
export async function repairExport(data) { export async function repairExport(data) {
return request({ return request({
......
<template> <template>
<view style="position: fixed; right: 200%"> <view style="position: fixed; right: 200%">
<l-painter <l-painter isCanvasToTempFilePath @success="success" custom-style="position: fixed; right: 200%">
isCanvasToTempFilePath <l-painter-qrcode :text="url" :css="style"></l-painter-qrcode>
@success="complete" </l-painter>
custom-style="position: fixed; right: 200%" </view>
>
<l-painter-qrcode :text="url" :css="style" />
</l-painter>
</view>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
url: { url: {
type: String, type: String,
default: '', default: ''
}, },
size: { size: {
type: [String, Number], type: [String, Number],
default: 400, default: 400
}, }
}, },
data() { data() {
return {} return {};
}, },
computed: { computed: {
style() { style() {
return `width: ${this.size}rpx;height: ${this.size}rpx` return `width: ${this.size}rpx;height: ${this.size}rpx`;
}, }
}, },
created() { created() {},
}, methods: {
methods: { success(url) {
complete(url) { this.$emit('canvas', url);
this.$emit('canvas', url) }
}, }
}, };
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
...@@ -334,6 +334,15 @@ ...@@ -334,6 +334,15 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}
,{
"path" : "choose-remark/choose-remark",
"style" :
{
"navigationBarTitleText": "备注模板",
"enablePullDownRefresh": false
}
} }
] ]
}, },
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<view class="bill-style"> <view class="bill-style">
<view class="bill-style-title">请选择收据样式</view> <view class="bill-style-title">请选择收据样式</view>
<view class="card-item" :class="{ active: item.type === type }" v-for="(item, index) in cardList" :key="index" @click="handleClick(item)"> <view class="card-item" :class="{ active: item.type === type }" v-for="(item, index) in cardList" :key="index" @click="handleClick(item)">
<view class="card-item-icon" @click.stop="preview(item,index)"><image :src="item.icon" mode=""></image></view> <view class="card-item-icon" @click.stop="preview(item, index)"><image :src="item.icon" mode=""></image></view>
<view class="card-item-right"> <view class="card-item-right">
<view class="card-item-right-title"> <view class="card-item-right-title">
<view class="card-item-right-title-name">{{ item.title }}</view> <view class="card-item-right-title-name">{{ item.title }}</view>
<view class="card-item-right-title-preview" @click.stop="preview(item,index)"> <view class="card-item-right-title-preview" @click.stop="preview(item, index)">
<view class="card-item-right-title-preview-icon"><image :src="previewIcon" mode=""></image></view> <view class="card-item-right-title-preview-icon"><image :src="previewIcon" mode=""></image></view>
<view class="card-item-right-title-preview-text">预览</view> <view class="card-item-right-title-preview-text">预览</view>
</view> </view>
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<script> <script>
import SubmitButton from '@/components/submit-button/index.vue'; import SubmitButton from '@/components/submit-button/index.vue';
import { billBaseUrl } from '@/utils/config.js'; import { billBaseUrl } from '@/utils/config.js';
import { setMaintainBillType, getMaintainBillType } from '@/utils/common.js';
export default { export default {
components: { components: {
SubmitButton SubmitButton
...@@ -30,45 +31,50 @@ export default { ...@@ -30,45 +31,50 @@ export default {
previewIcon: billBaseUrl + 'yulanicon@3x.png', previewIcon: billBaseUrl + 'yulanicon@3x.png',
cardList: [ cardList: [
{ {
type: '1', type: 'receipt',
icon: billBaseUrl + 'fuwuxiaopiaosuolue@3x.png', icon: billBaseUrl + 'fuwuxiaopiaosuolue@3x.png',
image: billBaseUrl + 'weixiuzhangdan-1.png', image: billBaseUrl + 'weixiuzhangdan-1.png',
title: '服务小票', title: '服务小票',
desc: '适用个人用户的常规生活服务场景' desc: '适用个人用户的常规生活服务场景'
}, },
{ {
type: '2', type: 'voucher',
icon: billBaseUrl + 'sgoujupinzhengsuolue@3x.png', icon: billBaseUrl + 'sgoujupinzhengsuolue@3x.png',
image: billBaseUrl + 'dianzipinzheng-1.png', image: billBaseUrl + 'dianzipinzheng-1.png',
title: '收据凭证', title: '收据凭证',
desc: '适用企业用户的服务、售货、报销等场景' desc: '适用企业用户的服务、售货、报销等场景'
} }
], ],
previewImages:[billBaseUrl + 'weixiuzhangdan-1.png',billBaseUrl + 'dianzipinzheng-1.png'], previewImages: [billBaseUrl + 'weixiuzhangdan-1.png', billBaseUrl + 'dianzipinzheng-1.png'],
type: '1' type: 'receipt'
}; };
}, },
onReady() {
this.type = getMaintainBillType() || 'receipt';
},
methods: { methods: {
handleClick(item) { handleClick(item) {
this.type = item.type; this.type = item.type;
}, },
preview(item,index) { preview(item, index) {
// 预览图片 // 预览图片
uni.previewImage({ uni.previewImage({
urls: this.previewImages, urls: this.previewImages,
current:index, current: index,
longPressActions: { longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'], success: function(data) {},
success: function(data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
},
fail: function(err) { fail: function(err) {
console.log(err.errMsg); console.log(err.errMsg);
} }
} }
}); });
}, },
submit() {} submit() {
setMaintainBillType(this.type)
uni.navigateTo({
url: `/pages/maintain-bill/create?type=${this.type}`
});
}
} }
}; };
</script> </script>
......
<template>
<!-- 收支设置 -->
<view class="column-administer">
<view class="content-view">
<!-- 拖动 -->
<view class="drap-view">
<NoData v-if="noData" :text="noDataText" customStyle="margin-top: 0rpx;" :imageName="noDataImage" />
<drap-view v-else ref="drap-view" :list="list" @choose="choose" @onEdit="onEdit" @onDelete="onDelete" ></drap-view>
</view>
<view class="submit"><ab-button content="创建模板" :customStyle="customStyle" left-icon="plus" @click="toAdd"></ab-button></view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import NavbarNormal from '@/components/navbar-normal';
import DrapView from './components/drap-view.vue';
import AbButton from '@/components/common/ab-button.vue';
import NoData from '@/components/no-data';
import { getList, update } from '@/api/maintain/choose-remark.js';
export default {
name: 'column-administer',
components: {
NavbarNormal,
DrapView,
AbButton,
NoData
},
data() {
return {
noDataText: '当前暂无内容',
noDataImage: 'bill/wuzhangdanneirong@3x.png',
customStyle: {
height: '104rpx',
'font-size': '32rpx'
},
list: [],
editType: 'create-remark',
chooseType:'maintain-bill-choose-remark'
};
},
computed: {
noData() {
return (this.list || []).length == 0 && this.loaded;
}
},
onLoad(options) {
this.getList();
},
onReady() {},
onUnload() {
uni.$off(`input-sure-${this.editType}`);
uni.$off(this.chooseType);
},
methods: {
choose(item){
uni.$emit(this.chooseType,item);
this.$u.route({
type: 'back'
});
},
toAdd() {
this.$u.route({
url: '/pages/mine/input/input',
params: {
type: this.editType,
value: '',
whiteSpace:true,
}
});
uni.$once(`input-sure-${this.editType}`, res => {
this.onEdit({label:res.content});
});
},
async getList() {
this.loaded = false;
try {
let { data } = await getList();
data.forEach(item => {
item.label = item.remark;
});
this.list = data || [];
} catch (e) {
//TODO handle the exception
}
this.loaded = true;
},
async onDelete(row) {
try {
let params = {
id: row.id,
sortValue:0,
deleteFlag: true
};
let res = await update(params);
await this.getList();
} catch (e) {
this.getList();
//TODO handle the exception
}
},
async onEdit(row) {
try {
let { label, id } = row;
let params = {
remark: label,
sortValue:0,
deleteFlag: false
};
if (id) {
params = {
...params,
id: id
};
}
let res = await update(params);
await this.getList();
} catch (e) {
this.getList();
//TODO handle the exception
}
}
}
};
</script>
<style scoped lang="scss">
.column-administer {
background: #f6f7fa;
padding: 24rpx;
height: 100vh;
width: 100%;
display: flex;
flex-direction: column;
.content-view {
flex: 1;
width: 100%;
display: flex;
flex-direction: column;
.drap-view {
flex: 1;
width: 100%;
position: relative;
// height: 500rpx;
}
.button-view {
display: flex;
align-items: center;
width: 360upx;
// height: 72upx;
background: #ffffff;
border-radius: 12upx;
border: 4upx solid #ffffff;
margin-bottom: 24upx;
&-item {
width: 176upx;
height: 64upx;
font-size: 28upx;
color: #8d8d8d;
display: flex;
align-items: center;
justify-content: center;
}
&-active {
background: #02a074;
border-radius: 12upx;
color: #ffffff;
font-weight: bold;
}
}
}
.submit {
margin: 36upx 0;
}
}
</style>
<template>
<!-- 拖动 -->
<view class="edit-box" :style="{ top: 0 }">
<view class="zhuti">
<scroll-view :scroll-y="pageInfo.scrollY" class="product-section">
<view class="list">
<view class="swipe-action-outside" v-for="(item, index) in optionLists" :key="item.id">
<view
class="row list-row"
:data-index="index"
:class="{ 'ready-place': pageInfo.readyPlaceIndex === index }"
:id="`item-view-${item.id}`"
:style="'height: ' + pageInfo.rowHeight + 'px;'"
>
<view class="item-view" @click="choose(item, index)">
<view class="left-view">
<view class="name-view ellipsis-2">{{ item.label }}</view>
</view>
<view class="right-view" @click.stop="clickCell(item, index)"><u-icon name="edit-pen"></u-icon></view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<PopInput title="删除提醒" type="text" sureText="确定" content="确认删除该类别?" :visible.sync="showConfirm" @click="handleConfirm" @cancel="handleCancel" />
</view>
</template>
<script>
import PopInput from '@/components/pop-input-view';
import { billBaseUrl } from '@/utils/config.js';
import { mapGetters } from 'vuex';
export default {
name: 'dragEdit',
props: ['list'],
components: {
PopInput
},
data() {
return {
billBaseUrl,
showConfirm: false,
readyDeleteItem: null,
optionLists: [],
pageInfo: {
scrollY: true, // 当为true时拖动单条,整个大盒子不会滚动
rowHeight: 66, // 单条行高
scrollHeight: 100, // 拖动时行高,百分比
startIndex: null, // 当前拖动第几条
startY: 0, // 定位拖动时的位置,需要减去上方空白部分
readyPlaceIndex: null, // 拖动预放置位置,拖动时有阴影的部分
selectedIndex: null, // 放置的位置
beginMove: false
},
top: 0,
editType: 'create-remark',
deleteType: 'remark-sure-delete'
};
},
watch: {
list: {
handler(val) {
this.optionLists = [...val];
},
immediate: true,
deep: true
}
},
computed: {
...mapGetters(['platform', 'systemInfo'])
},
mounted() {
this.optionLists = [...this.list];
},
beforeDestroy() {
uni.$off(`input-sure-${this.editType}`);
uni.$off(this.deleteType);
},
methods: {
clickCell(item) {
this.toEdit(item);
},
choose(item){
this.$emit('choose', item);
},
toEdit(item) {
let value = item.label;
this.$u.route({
url: '/pages/mine/input/input',
params: {
type: this.editType,
deleteType: this.deleteType,
whiteSpace:true,
value: encodeURIComponent(value),
id: item.id
}
});
uni.$once(`input-sure-${this.editType}`, res => {
this.optionLists.map(el => {
if (el.id === item.id) {
el.label = res.content;
}
});
this.$emit('onEdit', item);
});
uni.$once(this.deleteType, res => {
this.optionLists.map(el => {
if (el.id === item.id) {
this.beforeDelete(el);
}
});
});
},
handleConfirm() {
this.$emit('onDelete', this.readyDeleteItem);
},
handleCancel() {},
beforeDelete(item) {
this.readyDeleteItem = item;
this.showConfirm = true;
}
}
};
</script>
<style lang="scss" scoped>
/* 模块编辑 */
.edit-box {
width: 100%;
position: absolute;
bottom: 0;
left: 0;
overflow: hidden;
margin-bottom: 20rpx;
}
.marginL6 {
margin-left: 12rpx;
}
.product-section {
width: 100%;
height: 100%;
}
.list {
width: 100%;
.swipe-action-outside {
width: 100%;
background-color: #f6f7fa;
margin-bottom: 24upx;
}
.swipe-action-inner {
width: 100%;
// padding: 0 25upx;
}
}
.zhuti {
width: 100%;
height: 100%;
position: absolute;
top: 0;
bottom: 0;
left: 0;
overflow: scroll;
}
.row {
height: 66px;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.title-row {
border-bottom: 1px solid #888888;
color: #888888;
}
.list-row {
// padding: 0 24rpx;
box-sizing: border-box;
// margin-bottom: 12px;
border-radius: 8rpx;
background-color: #fff;
width: 100%;
}
.movable-area {
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
visibility: hidden;
height: 0;
}
.movable-area-active {
visibility: unset;
display: inline-block;
height: 100%;
// display: block;
}
.movable-row {
// visibility: hidden;
height: 0;
.item-view {
}
}
.movable-row-active {
box-shadow: #d9d9d9 0 0 20px;
// visibility: unset;
height: 66px;
}
.ready-place {
background: rgba(238, 240, 254, 0.6);
}
.item-view {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
padding: 0 32rpx;
background-color: #fff;
border-radius: 16upx;
.left-view {
display: flex;
align-items: center;
width: 80%;
height: 100%;
.name-view {
font-size: 24rpx;
line-height: 32rpx;
}
}
.right-view {
height: 100%;
display: flex;
align-items: center;
margin-left: 40rpx;
font-size: 36rpx;
}
}
</style>
<template> <template>
<view class="bill-count"> <view class="bill-count">
<view class="bill-count-item" v-for="(item, index) in list" :key="index"> <view class="bill-count-item" v-for="(item, index) in list" :key="index">
<view class="bill-count-item-value ellipsis " :class="{red:detail[item.value]>0}">{{ detail[item.value] }}</view> <view class="bill-count-item-value " >
<text class="red" v-if="item.value === 'arearAmount'">{{ arearAmount }}</text>
<text v-else>{{ keepWFull(detail[item.value]) }}</text>
</view>
<view class="bill-count-item-label">{{ item.label }}</view> <view class="bill-count-item-label">{{ item.label }}</view>
<view class="bill-count-item-line" v-if="index !== list.length - 1"></view> <view class="bill-count-item-line" v-if="index !== list.length - 1"></view>
</view> </view>
...@@ -10,17 +13,24 @@ ...@@ -10,17 +13,24 @@
<script> <script>
import { billCountOptions } from '@/utils/options/maintain-bill/index.js'; import { billCountOptions } from '@/utils/options/maintain-bill/index.js';
import { keepWFull } from '@/utils/common.js';
export default { export default {
props:{ props: {
detail:{ detail: {
type:Object, type: Object,
default:()=>{} default: () => {}
}
},
computed: {
arearAmount() {
let { receivableAmount, actualAmount } = this.detail;
return keepWFull(parseFloat(receivableAmount)-parseFloat(actualAmount))
} }
}, },
data() { data() {
return { return {
list: billCountOptions, keepWFull,
list: billCountOptions
}; };
} }
}; };
...@@ -29,17 +39,23 @@ export default { ...@@ -29,17 +39,23 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.bill-count { .bill-count {
// height: 160upx; // height: 160upx;
width: 100%;
display: flex; display: flex;
align-items: center;
padding-top: 32rpx; padding-top: 32rpx;
&-item { &-item {
width: 25%; width: 25%;
height: 100%; height: 100%;
padding: 0 12upx; padding: 0 6upx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
overflow: hidden;
&:first-child{
// width: 16%;
}
&-value { &-value {
width: 100%; width: 100%;
text-align: center; text-align: center;
...@@ -48,21 +64,21 @@ export default { ...@@ -48,21 +64,21 @@ export default {
font-size: 28upx; font-size: 28upx;
font-weight: bold; font-weight: bold;
} }
.red{ .red {
color: #FC524D; color: #fc524d;
} }
&-label { &-label {
font-size: 24upx; font-size: 24upx;
color: #8d8d8d; color: #8d8d8d;
} }
&-line{ &-line {
position: absolute; position: absolute;
right: 0; right: 0;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
width: 2upx; width: 2upx;
height: 32upx; height: 32upx;
background: #F6F7FA; background: #f6f7fa;
} }
} }
} }
......
<template> <template>
<uni-popup v-model="show" ref="uniPopup" border-radius="24" :custom-style="customStyle" type="center" height="70%"> <uni-popup v-model="show" ref="uniPopup" border-radius="24" :custom-style="customStyle" type="center" height="70%">
<view class="receipt-preview"> <view class="receipt-preview" :class="{ type1: type === 'receipt' }">
<view class="head-background"><!-- 背景 --></view> <view class="head-background"><!-- 背景 --></view>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<scroll-view scroll-y="true" show-scrollbar class="scroll-Y"> <scroll-view scroll-y="true" show-scrollbar class="scroll-Y">
...@@ -44,12 +44,14 @@ export default { ...@@ -44,12 +44,14 @@ export default {
components: { components: {
UniPopup UniPopup
}, },
props: ['type'],
data() { data() {
return { return {
show: true, show: true,
arrowUrl: billBaseUrl + 'baojiashunxu@3x.png', arrowUrl: billBaseUrl + 'baojiashunxu@3x.png',
steps: quotedPriceSteps, steps: quotedPriceSteps,
previewImage: billBaseUrl + 'weixiuzhangdan-1.png', previewImage1: billBaseUrl + 'weixiuzhangdan-1.png',
previewImage2: billBaseUrl + 'sgoujupinzhengsuolue@3x.png',
closeIcon: billBaseUrl + 'guanbitanchuang@3x.png', closeIcon: billBaseUrl + 'guanbitanchuang@3x.png',
customStyle: { customStyle: {
// 'margin-top': '90rpx', // 'margin-top': '90rpx',
...@@ -57,6 +59,11 @@ export default { ...@@ -57,6 +59,11 @@ export default {
} }
}; };
}, },
computed: {
previewImage() {
return this.type === 'receipt' ? this.previewImage1 : this.previewImage2;
}
},
methods: { methods: {
open() { open() {
this.show = true; this.show = true;
...@@ -65,6 +72,18 @@ export default { ...@@ -65,6 +72,18 @@ export default {
close() { close() {
this.show = false; this.show = false;
this.$refs.uniPopup.close(); this.$refs.uniPopup.close();
},
preview(item, index) {
// 预览图片
uni.previewImage({
urls: [this.previewImage],
longPressActions: {
success: function(data) {},
fail: function(err) {
console.log(err.errMsg);
}
}
});
} }
} }
}; };
...@@ -76,7 +95,7 @@ export default { ...@@ -76,7 +95,7 @@ export default {
background-color: #ffffff; background-color: #ffffff;
color: #333333; color: #333333;
// height: 100%; // height: 100%;
height: 1100rpx; height: 720rpx;
width: 622rpx; width: 622rpx;
padding: 24rpx 16rpx 24rpx 24rpx; padding: 24rpx 16rpx 24rpx 24rpx;
// display: flex; // display: flex;
...@@ -167,7 +186,7 @@ export default { ...@@ -167,7 +186,7 @@ export default {
.preview { .preview {
width: 100%; width: 100%;
min-height: 1800rpx; // min-height: 1800rpx;
&-image { &-image {
width: 100%; width: 100%;
} }
...@@ -208,4 +227,7 @@ export default { ...@@ -208,4 +227,7 @@ export default {
} }
} }
} }
.type1 {
height: 1100rpx;
}
</style> </style>
This diff is collapsed.
...@@ -108,7 +108,12 @@ ...@@ -108,7 +108,12 @@
</view> </view>
<view class="line-view"></view> <view class="line-view"></view>
<view class="item-view" style="display: block"> <view class="item-view" style="display: block">
<view class="lable-view">备注信息</view> <view class="lable-view remark-view">
<text>备注信息</text>
<view class="remark-view-add" hover-class="u-hover-class" @click="chooseRemark">
选模板
</view>
</view>
<view class="value-view area-view"> <view class="value-view area-view">
<u-input <u-input
type="textarea" type="textarea"
...@@ -141,7 +146,7 @@ ...@@ -141,7 +146,7 @@
</view> </view>
<view class="loading-view" v-if="loading"><u-loading mode="flower"></u-loading></view> <view class="loading-view" v-if="loading"><u-loading mode="flower"></u-loading></view>
<u-picker confirm-color="#02A074" mode="time" v-model="showTimePicker" :default-time="form.repairTime" :params="pickerParams" safe-area-inset-bottom @confirm="handleComfirmTime"></u-picker> <u-picker confirm-color="#02A074" mode="time" v-model="showTimePicker" :default-time="form.repairTime" :params="pickerParams" safe-area-inset-bottom @confirm="handleComfirmTime"></u-picker>
<receipt-preview ref="receipt-preview"></receipt-preview> <receipt-preview :type="form.type" ref="receipt-preview"></receipt-preview>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
</template> </template>
...@@ -180,7 +185,8 @@ export default { ...@@ -180,7 +185,8 @@ export default {
latitude: '', latitude: '',
longitude: '', longitude: '',
remark: '', remark: '',
attach: [] attach: [],
type:'', // 收据样式
}, },
showDatePicker: false, showDatePicker: false,
showTimePicker: false, showTimePicker: false,
...@@ -299,6 +305,9 @@ export default { ...@@ -299,6 +305,9 @@ export default {
if (options && options.billId) { if (options && options.billId) {
this.billId = options.billId; this.billId = options.billId;
} }
if (options && options.type) {
this.form.type = options.type;
}
this.freshing = false; this.freshing = false;
if (this.billId) { if (this.billId) {
...@@ -314,6 +323,7 @@ export default { ...@@ -314,6 +323,7 @@ export default {
}, },
onUnload() { onUnload() {
uni.$off('maintain-bill-detail') uni.$off('maintain-bill-detail')
uni.$off('maintain-bill-choose-remark')
}, },
onShow() {}, onShow() {},
methods: { methods: {
...@@ -323,6 +333,14 @@ export default { ...@@ -323,6 +333,14 @@ export default {
preview() { preview() {
this.$refs['receipt-preview'].open(); this.$refs['receipt-preview'].open();
}, },
chooseRemark(){
uni.$on('maintain-bill-choose-remark',res=>{
this.form.remark=res.remark
})
uni.navigateTo({
url:'/pages/maintain-bill/choose-remark/choose-remark'
})
},
async getAddress() { async getAddress() {
if (this.platform !== '4') { if (this.platform !== '4') {
getSetting('scope.userLocation', '检测到您没打开获取位置权限,该信息将用于获取所在位置,是否去设置打开?', res => { getSetting('scope.userLocation', '检测到您没打开获取位置权限,该信息将用于获取所在位置,是否去设置打开?', res => {
...@@ -377,6 +395,7 @@ export default { ...@@ -377,6 +395,7 @@ export default {
longitude: data.longitude, longitude: data.longitude,
remark: data.remark, remark: data.remark,
attach: data.attach, attach: data.attach,
type: data.type, // 收据样式
// 编辑情况下,下一页的数据 // 编辑情况下,下一页的数据
expenseDetails: data.expenseDetails, expenseDetails: data.expenseDetails,
...@@ -617,6 +636,23 @@ export default { ...@@ -617,6 +636,23 @@ export default {
} }
} }
} }
.remark-view{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.remark-view-add {
font-size: 20rpx;
color: #FFFFFF;
line-height: 40rpx;
text-align: center;
width: 92rpx;
height: 40rpx;
background: $default-color;
border-radius: 8rpx;
}
}
.area-view { .area-view {
margin: 24rpx 0; margin: 24rpx 0;
......
...@@ -81,7 +81,7 @@ import FabView from '@/components/fab-view'; ...@@ -81,7 +81,7 @@ import FabView from '@/components/fab-view';
import NoData from '@/components/no-data'; import NoData from '@/components/no-data';
import PopExport from '@/components/pop-export-bill'; import PopExport from '@/components/pop-export-bill';
import BillCount from './components/bill-count.vue'; import BillCount from './components/bill-count.vue';
import { repair } from '@/api/maintain/index.js'; import { repair,repairStatistical } from '@/api/maintain/index.js';
export default { export default {
components: { components: {
...@@ -109,9 +109,9 @@ export default { ...@@ -109,9 +109,9 @@ export default {
current: 1, current: 1,
size: 10, size: 10,
statistics:{ statistics:{
income:0, number:0,
expense:0, actualAmount:0,
surplus:0, receivableAmount:0
} }
}; };
}, },
...@@ -186,6 +186,7 @@ export default { ...@@ -186,6 +186,7 @@ export default {
this.current = 1; this.current = 1;
this.loadStatus = 'loading'; this.loadStatus = 'loading';
this.getMyDynamic(); this.getMyDynamic();
this.getBillStatistical()
}, },
getMyDynamic() { getMyDynamic() {
if (this.current == 1) { if (this.current == 1) {
...@@ -226,6 +227,22 @@ export default { ...@@ -226,6 +227,22 @@ export default {
console.log(err); console.log(err);
}); });
}, },
getBillStatistical() {
repairStatistical({
start: this.start,
end: this.end,
keyword: this.keyword,
onlyDebt: this.onlyDebt,
customerId:this.customerId
})
.then(res => {
let data = res.data;
this.statistics=data
})
.catch(err => {
console.log(err);
});
},
onRefresh() { onRefresh() {
if (this.freshing) return; if (this.freshing) return;
this.freshing = true; this.freshing = true;
...@@ -265,7 +282,7 @@ export default { ...@@ -265,7 +282,7 @@ export default {
}, },
handleClickFab() { handleClickFab() {
this.$u.route({ this.$u.route({
url: 'pages/maintain-bill/create', url: 'pages/maintain-bill/bill-style',
params: {} params: {}
}); });
}, },
......
This diff is collapsed.
...@@ -16,9 +16,10 @@ ...@@ -16,9 +16,10 @@
@input="handleInput" @input="handleInput"
/> />
<view v-if="!disabled" class="tip-view">{{ tipText }}</view> <view v-if="!disabled" class="tip-view">{{ tipText }}</view>
</view> <view class="bottom-view">
<view class="bottom-view"> <u-button :customStyle="buttonStyle" @click="handleClick"><view class="button-text">确定</view></u-button>
<u-button :customStyle="buttonStyle" @click="handleClick"><view class="button-text">确定</view></u-button> <u-button :customStyle="deleteStyle" @click="handleDelete" v-if="id"><view class="button-text delete-button">删除</view></u-button>
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -33,7 +34,23 @@ export default { ...@@ -33,7 +34,23 @@ export default {
return { return {
value: '', value: '',
type: '', type: '',
disabled: false deleteType: '',
disabled: false,
deleteStyle: {
marginTop: '24rpx',
'background-color': '#FFFFFF',
height: '104rpx',
'border-radius': '16rpx'
},
id: null,
whiteSpace: false,
inputStyle: {
'border-radius': '8rpx',
'background-color': '#F6F7FA',
padding: '24rpx',
'font-size': '28rpx',
color: '#333333'
}
}; };
}, },
computed: { computed: {
...@@ -49,17 +66,9 @@ export default { ...@@ -49,17 +66,9 @@ export default {
}; };
}, },
placeholderStyle() { placeholderStyle() {
return 'color: #cccccc;font-size: 28rpx;font-weight: bold;' return 'color: #cccccc;font-size: 28rpx;font-weight: bold;';
},
inputStyle() {
return {
'border-radius': '8rpx',
'background-color': '#F6F7FA',
padding: '24rpx',
'font-size': '28rpx',
color: '#333333'
};
}, },
tipText() { tipText() {
return `${this.value.length || 0}/${this.info.maxlength}`; return `${this.value.length || 0}/${this.info.maxlength}`;
}, },
...@@ -90,6 +99,14 @@ export default { ...@@ -90,6 +99,14 @@ export default {
maxlength: 20, maxlength: 20,
height: 240 height: 240
}; };
case 'lister':
return {
title: '制表人',
type: 'textarea',
placeholder: '请输入制表人',
maxlength: 20,
height: 240
};
case 'payments-setting': case 'payments-setting':
return { return {
title: '类型名称', title: '类型名称',
...@@ -106,12 +123,12 @@ export default { ...@@ -106,12 +123,12 @@ export default {
maxlength: 10, maxlength: 10,
height: 240 height: 240
}; };
case 'menu-introduce': case 'create-remark':
return { return {
title: '频道介绍', title: '备注模板',
type: 'textarea', type: 'textarea',
placeholder: '请输入频道介绍(200个字以内)', placeholder: '请输入备注模板(200个字以内)',
maxlength: 200, maxlength: 100,
height: 240 height: 240
}; };
case 'camp-introduce': case 'camp-introduce':
...@@ -153,12 +170,22 @@ export default { ...@@ -153,12 +170,22 @@ export default {
if (options && options.type) { if (options && options.type) {
this.type = options.type; this.type = options.type;
} }
if (options && options.deleteType) {
this.deleteType = options.deleteType;
}
if (options && options.value && options.value != 'null') { if (options && options.value && options.value != 'null') {
this.value = decodeURIComponent(decodeURIComponent(options.value)); this.value = decodeURIComponent(decodeURIComponent(options.value));
} }
if (options && options.disabled) { if (options && options.disabled) {
this.disabled = options.disabled; this.disabled = options.disabled;
} }
if (options && options.id) {
this.id = options.id;
}
if (options && options.whiteSpace) {
this.whiteSpace = options.whiteSpace;
this.inputStyle.whiteSpace='pre-wrap'
}
}, },
onUnload() { onUnload() {
let notification = `input-sure-${this.type}`; let notification = `input-sure-${this.type}`;
...@@ -175,17 +202,27 @@ export default { ...@@ -175,17 +202,27 @@ export default {
}, },
handleClick() { handleClick() {
if (!this.disabled) { if (!this.disabled) {
if(!this.value.trim()){ if (!this.value.trim()) {
this.$u.toast("内容不能为空") this.$u.toast('内容不能为空');
return false return false;
} }
let notification = `input-sure-${this.type}`; let notification = `input-sure-${this.type}`;
let str= this.value.replace(/[\r\n]/g,"") let str = this.value.replace(/[\r\n]/g, '');
uni.$emit(notification, { uni.$emit(notification, {
content: str content: str
}); });
} }
this.$u.route({
type: 'back'
});
},
handleDelete() {
if (this.id) {
uni.$emit(this.deleteType, {
id: this.id
});
}
this.$u.route({ this.$u.route({
type: 'back' type: 'back'
}); });
...@@ -214,7 +251,7 @@ export default { ...@@ -214,7 +251,7 @@ export default {
} }
.bottom-view { .bottom-view {
margin: 24rpx 32rpx 44rpx 32rpx; margin: 24rpx 0;
height: 104rpx; height: 104rpx;
.button-text { .button-text {
...@@ -224,6 +261,10 @@ export default { ...@@ -224,6 +261,10 @@ export default {
font-weight: bold; font-weight: bold;
font-size: 32rpx; font-size: 32rpx;
} }
.delete-button {
text-align: center;
color: #fc524d;
}
} }
} }
</style> </style>
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
<view class="zhuti"> <view class="zhuti">
<scroll-view :scroll-y="pageInfo.scrollY" class="product-section"> <scroll-view :scroll-y="pageInfo.scrollY" class="product-section">
<view class="list"> <view class="list">
<uni-swipe-action ref="swipeAction" > <!-- <uni-swipe-action ref="swipeAction" > -->
<view class="swipe-action-outside" v-for="(item, index) in optionLists" :key="item.id"> <view class="swipe-action-outside" v-for="(item, index) in optionLists" :key="item.id">
<uni-swipe-action-item <!-- <uni-swipe-action-item
:right-options="options" :right-options="options"
bg-color="#f6f7fa" bg-color="#f6f7fa"
:index="item.id" :index="item.id"
:auto-close="true" :auto-close="true"
@click.stop="onClick($event, item, index)" @click.stop="onClick($event, item, index)"
@change="swipeChange($event, index)" @change="swipeChange($event, index)"
> > -->
<view <view
class="row list-row" class="row list-row"
:data-index="index" :data-index="index"
...@@ -30,11 +30,14 @@ ...@@ -30,11 +30,14 @@
<view class="image-view"><image :src="billBaseUrl + item.icon" v-if="item.icon"></image></view> <view class="image-view"><image :src="billBaseUrl + item.icon" v-if="item.icon"></image></view>
<view class="name-view">{{ item.label }}</view> <view class="name-view">{{ item.label }}</view>
</view> </view>
<!-- <view class="right-view">
<u-icon name="edit-pen"></u-icon>
</view> -->
</view> </view>
</view> </view>
</uni-swipe-action-item> <!-- </uni-swipe-action-item> -->
</view> </view>
</uni-swipe-action> <!-- </uni-swipe-action> -->
</view> </view>
</scroll-view> </scroll-view>
<movable-area class="movable-area" :class="{ 'movable-area-active': pageInfo.beginMove }"> <movable-area class="movable-area" :class="{ 'movable-area-active': pageInfo.beginMove }">
...@@ -101,7 +104,7 @@ export default { ...@@ -101,7 +104,7 @@ export default {
optionLists: [], optionLists: [],
pageInfo: { pageInfo: {
scrollY: true, // 当为true时拖动单条,整个大盒子不会滚动 scrollY: true, // 当为true时拖动单条,整个大盒子不会滚动
rowHeight: 66, // 单条行高 rowHeight: 44, // 单条行高
scrollHeight: 100, // 拖动时行高,百分比 scrollHeight: 100, // 拖动时行高,百分比
startIndex: null, // 当前拖动第几条 startIndex: null, // 当前拖动第几条
startY: 0, // 定位拖动时的位置,需要减去上方空白部分 startY: 0, // 定位拖动时的位置,需要减去上方空白部分
...@@ -111,7 +114,9 @@ export default { ...@@ -111,7 +114,9 @@ export default {
}, },
beginMove: false, beginMove: false,
top: 0, top: 0,
systemInfo: {} systemInfo: {},
editType:'payments-setting',
deleteType:'payments-setting-delete',
}; };
}, },
watch: { watch: {
...@@ -135,6 +140,10 @@ export default { ...@@ -135,6 +140,10 @@ export default {
this.systemInfo = uni.getSystemInfoSync(); this.systemInfo = uni.getSystemInfoSync();
this.optionLists = [...this.list]; this.optionLists = [...this.list];
}, },
beforeDestroy(){
uni.$off(`input-sure-${this.editType}`);
uni.$off(this.deleteType);
},
methods: { methods: {
resize(){ resize(){
if (this.platform === '4') { if (this.platform === '4') {
...@@ -151,11 +160,11 @@ export default { ...@@ -151,11 +160,11 @@ export default {
}, },
clickCell(item) { clickCell(item) {
let flag = true; let flag = true;
this.optionLists.map(el => { // this.optionLists.map(el => {
if (el.show) { // if (el.show) {
flag = false; // flag = false;
} // }
}); // });
if (flag) { if (flag) {
this.toEdit(item); this.toEdit(item);
} }
...@@ -181,11 +190,13 @@ export default { ...@@ -181,11 +190,13 @@ export default {
this.$u.route({ this.$u.route({
url: '/pages/mine/input/input', url: '/pages/mine/input/input',
params: { params: {
type: 'payments-setting', type: this.editType,
value: encodeURIComponent(value) deleteType:this.deleteType,
value: encodeURIComponent(value),
id:item.id
} }
}); });
uni.$once(`input-sure-payments-setting`, res => { uni.$once(`input-sure-${this.editType}`, res => {
this.optionLists.map(el => { this.optionLists.map(el => {
if (el.id === item.id) { if (el.id === item.id) {
el.label = res.content; el.label = res.content;
...@@ -193,6 +204,13 @@ export default { ...@@ -193,6 +204,13 @@ export default {
}); });
this.$emit('onEdit', item); this.$emit('onEdit', item);
}); });
uni.$once(this.deleteType, res => {
this.optionLists.map(el => {
if (el.id === item.id) {
this.beforeDelete(el);
}
});
});
}, },
handleConfirm() { handleConfirm() {
// this.optionLists.map(item => { // this.optionLists.map(item => {
...@@ -390,7 +408,7 @@ export default { ...@@ -390,7 +408,7 @@ export default {
overflow: scroll; overflow: scroll;
} }
.row { .row {
height: 66px; height: 44px;
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -434,7 +452,7 @@ export default { ...@@ -434,7 +452,7 @@ export default {
.movable-row-active { .movable-row-active {
box-shadow: #d9d9d9 0 0 20px; box-shadow: #d9d9d9 0 0 20px;
// visibility: unset; // visibility: unset;
height: 66px; height: 44px;
} }
.ready-place { .ready-place {
...@@ -456,8 +474,8 @@ export default { ...@@ -456,8 +474,8 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
.image-view { .image-view {
width: 72rpx; width: 48rpx;
height: 72rpx; height: 48rpx;
margin-right: 40rpx; margin-right: 40rpx;
} }
...@@ -472,6 +490,9 @@ export default { ...@@ -472,6 +490,9 @@ export default {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
width: 80rpx;
font-size: 36rpx;
} }
} }
</style> </style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="content-view"> <view class="content-view">
<view class="content-view-tips"> <view class="content-view-tips">
<view class="content-view-tips-icon"><image :src="tipsUrl" mode="" class="content-view-tips-icon-image"></image></view> <view class="content-view-tips-icon"><image :src="tipsUrl" mode="" class="content-view-tips-icon-image"></image></view>
<view class="content-view-tips-content"><view>操作提示:1、长按可移动排序;2、左滑可编辑删除。</view></view> <view class="content-view-tips-content"><view>操作提示:1、长按可移动排序;2、点击可编辑删除。</view></view>
</view> </view>
<view class="button-view"> <view class="button-view">
<view class="button-view-item" :class="{ 'button-view-active': form.type === item.value }" v-for="(item, index) in buttons" :key="index" @click="tabChange(item)"> <view class="button-view-item" :class="{ 'button-view-active': form.type === item.value }" v-for="(item, index) in buttons" :key="index" @click="tabChange(item)">
......
...@@ -72,7 +72,8 @@ ...@@ -72,7 +72,8 @@
</view> </view>
</u-popup> </u-popup>
<!-- :disabled="disabled" --> <!-- :disabled="disabled" -->
<view class="submit" v-loading="loading"><ab-button :customStyle="customStyle" @click="submit"></ab-button></view> <view class="submit" v-loading="loading"><ab-button :customStyle="customStyleButton" @click="submit"></ab-button></view>
<view class="submit" v-if="form.id"><ab-button content="删除" :customStyle="deleteButton" @click="handleDelete"></ab-button></view>
<u-picker confirm-color="#02A074" v-model="timeShow" mode="time" :default-time="defaultTime" :params="timeParams" @confirm="timePickerConfirm"></u-picker> <u-picker confirm-color="#02A074" v-model="timeShow" mode="time" :default-time="defaultTime" :params="timeParams" @confirm="timePickerConfirm"></u-picker>
</view> </view>
</template> </template>
...@@ -91,7 +92,7 @@ export default { ...@@ -91,7 +92,7 @@ export default {
components: { CheckboxGroups, AbButton, WeekCheckboxGroups }, components: { CheckboxGroups, AbButton, WeekCheckboxGroups },
data() { data() {
return { return {
customStyle: { customStyleButton: {
fontSize: '32rpx' fontSize: '32rpx'
}, },
checkboxCustomStyle: { checkboxCustomStyle: {
...@@ -103,6 +104,13 @@ export default { ...@@ -103,6 +104,13 @@ export default {
textAlign: 'right', textAlign: 'right',
fontWeight: 'bold' fontWeight: 'bold'
}, },
deleteButton:{
marginTop:'24rpx',
fontSize: '32rpx',
color: '#fc524d',
background:'#FFFFFF',
border: "2rpx solid #7dcfb8",
},
checkboxCustomStyle1: { checkboxCustomStyle1: {
width: '156rpx', width: '156rpx',
height: '78rpx' height: '78rpx'
...@@ -298,6 +306,16 @@ export default { ...@@ -298,6 +306,16 @@ export default {
} }
this.loading = false; this.loading = false;
}, },
handleDelete() {
if (this.form.id) {
uni.$emit('timed-sure-delete', {
id: this.form.id
});
}
this.$u.route({
type: 'back'
});
},
navigateTo() { navigateTo() {
this.$u.route({ this.$u.route({
type: 'back' type: 'back'
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<view class="list"> <view class="list">
<NoData v-if="noData" :text="noDataText" customStyle="margin-top: 0rpx;" :imageName="noDataImage" /> <NoData v-if="noData" :text="noDataText" customStyle="margin-top: 0rpx;" :imageName="noDataImage" />
<block v-else> <block v-else>
<uni-swipe-action> <!-- <uni-swipe-action> -->
<view class="swipe-action-outside" v-for="(item, index) in list" :key="item.id"> <view class="swipe-action-outside" v-for="(item, index) in list" :key="item.id">
<uni-swipe-action-item :right-options="options" @click="onClick($event,item)" @change="swipeChange($event, index)"> <!-- <uni-swipe-action-item :right-options="options" @click="onClick($event,item)" @change="swipeChange($event, index)"> -->
<view class="list-row" @click.stop="clickCell(item)"> <view class="list-row" @click.stop="clickCell(item)">
<view class="list-row-view list-row-left"> <view class="list-row-view list-row-left">
<view class="list-row-view-top"> <view class="list-row-view-top">
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
</view> </view>
</view> </view>
</view> </view>
</uni-swipe-action-item> <!-- </uni-swipe-action-item> -->
</view> </view>
</uni-swipe-action> <!-- </uni-swipe-action> -->
</block> </block>
<PopInput title="删除提醒" type="text" sureText="确定" content="确认删除该定时计划?" :visible.sync="showConfirm" @click="handleConfirm" @cancel="handleCancel" /> <PopInput title="删除提醒" type="text" sureText="确定" content="确认删除该定时计划?" :visible.sync="showConfirm" @click="handleConfirm" @cancel="handleCancel" />
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<script> <script>
import UniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue'; import UniSwipeAction from '@/components/uni-swipe-action/uni-swipe-action.vue';
import UniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue'; import UniSwipeActionItem from '@/components/uni-swipe-action-item/uni-swipe-action-item.vue';
import NoData from '@/components/no-data';
import PopInput from '@/components/pop-input-view'; import PopInput from '@/components/pop-input-view';
import SubmitButton from '@/components/submit-button/index.vue'; import SubmitButton from '@/components/submit-button/index.vue';
import { billBaseUrl } from '@/utils/config.js'; import { billBaseUrl } from '@/utils/config.js';
...@@ -63,6 +63,7 @@ export default { ...@@ -63,6 +63,7 @@ export default {
components: { components: {
UniSwipeAction, UniSwipeAction,
UniSwipeActionItem, UniSwipeActionItem,
NoData,
PopInput, PopInput,
SubmitButton SubmitButton
}, },
...@@ -100,6 +101,9 @@ export default { ...@@ -100,6 +101,9 @@ export default {
return (this.list || []).length == 0 && this.loaded; return (this.list || []).length == 0 && this.loaded;
} }
}, },
onUnload() {
uni.$off("timed-sure-delete");
},
methods: { methods: {
onClick(e,item) { onClick(e,item) {
console.log(e); console.log(e);
...@@ -150,6 +154,16 @@ export default { ...@@ -150,6 +154,16 @@ export default {
uni.$once(`refreshList`, res => { uni.$once(`refreshList`, res => {
this.getList(); this.getList();
}); });
if(id){
uni.$once(`timed-sure-delete`, res => {
this.list.map(el => {
if (el.id === res.id) {
this.beforeDelete(el);
}
});
});
}
}, },
clickCell(item) { clickCell(item) {
let flag = true; let flag = true;
......
...@@ -73,6 +73,11 @@ const router = createRouter({ ...@@ -73,6 +73,11 @@ const router = createRouter({
runtimeQuit(); runtimeQuit();
} }
// #endif // #endif
if(type===2){
setTimeout(()=>{
router.$lockStatus=false;
},6000)
}
}, },
routes: [ routes: [
...ROUTES, ...ROUTES,
......
...@@ -119,6 +119,13 @@ export function getEyeFill() { ...@@ -119,6 +119,13 @@ export function getEyeFill() {
export function removeEyeFill() { export function removeEyeFill() {
uni.removeStorageSync("EYEFILL"); uni.removeStorageSync("EYEFILL");
} }
export function setMaintainBillType(data) {
uni.setStorageSync("MAINTAIN-BILL", data);
}
export function getMaintainBillType() {
return uni.getStorageSync("MAINTAIN-BILL") || ""
}
export function checkLoginAndVip(callback) { export function checkLoginAndVip(callback) {
if (checkToken()) { if (checkToken()) {
...@@ -141,7 +148,7 @@ export function checkLoginAndVip(callback) { ...@@ -141,7 +148,7 @@ export function checkLoginAndVip(callback) {
success() { success() {
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
animationType:'pop-in', animationType: 'pop-in',
url: '/pages/login/login' url: '/pages/login/login'
}) })
}, 1500) }, 1500)
...@@ -225,8 +232,8 @@ export function checkCodeTimetamp() { ...@@ -225,8 +232,8 @@ export function checkCodeTimetamp() {
} }
// 查询权限 // 查询权限
export function getSetting(scope, text, block, errBlock = () => {}) { export function getSetting(scope, text, block, errBlock = () => {}) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform === "ios") { if (uni.getSystemInfoSync().platform === "ios") {
var result = permision.judgeIosPermission(scope) var result = permision.judgeIosPermission(scope)
if (result) { if (result) {
block() block()
...@@ -245,16 +252,16 @@ export function getSetting(scope, text, block, errBlock = () => {}) { ...@@ -245,16 +252,16 @@ export function getSetting(scope, text, block, errBlock = () => {}) {
}, },
}) })
} }
} else { } else {
permision.requestAndroidPermission(scope).then(result=>{ permision.requestAndroidPermission(scope).then(result => {
console.log("result",result) console.log("result", result)
// result == 1 "已获得授权" // result == 1 "已获得授权"
// result == 0 "未获得授权" // result == 0 "未获得授权"
if (result == 1) { if (result == 1) {
block() block()
}else if(result == 0) { } else if (result == 0) {
errBlock(result) errBlock(result)
}else { } else {
uni.showModal({ uni.showModal({
content: text, content: text,
confirmText: '去设置', confirmText: '去设置',
...@@ -269,14 +276,14 @@ export function getSetting(scope, text, block, errBlock = () => {}) { ...@@ -269,14 +276,14 @@ export function getSetting(scope, text, block, errBlock = () => {}) {
}, },
}) })
} }
}).catch((e)=>{ }).catch((e) => {
console.log("requestAndroidPermission:error",e) console.log("requestAndroidPermission:error", e)
}) })
}
// #endif }
// #ifdef MP
// #endif
// #ifdef MP
uni.authorize({ uni.authorize({
scope: scope, scope: scope,
success: () => { success: () => {
...@@ -312,7 +319,7 @@ export function getSetting(scope, text, block, errBlock = () => {}) { ...@@ -312,7 +319,7 @@ export function getSetting(scope, text, block, errBlock = () => {}) {
}) })
}, },
}) })
// #endif // #endif
} }
// 自定义filter // 自定义filter
...@@ -597,3 +604,117 @@ export function formatCount(count) { ...@@ -597,3 +604,117 @@ export function formatCount(count) {
} }
return string return string
} }
// js将数字转换成万 并且保留两位小数
export function keepWFull(num) {
let s_x = 0;
// num=parseFloat(num)
if (num > 10000) {
let result = num / 10000;
result = Math.floor(result * 100) / 100;
s_x = result.toString(); //将数字转换为字符串
let pos_decimal = s_x.indexOf("."); //小数点的索引值
// 当整数时,pos_decimal=-1 自动补0
if (pos_decimal < 0) {
pos_decimal = s_x.length;
s_x += ".";
}
// 当数字的长度< 小数点索引+2时,补0
while (s_x.length <= pos_decimal + 2) {
s_x += "0";
}
s_x += "万";
} else {
if (!isNaN(parseInt(num))) {
s_x = num;
}
}
return s_x;
}
export const convertCurrency = (money) => {
//汉字的数字
var cnNums = new Array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
//基本单位
var cnIntRadice = new Array('', '拾', '佰', '仟');
//对应整数部分扩展单位
var cnIntUnits = new Array('', '万', '亿', '兆');
//对应小数部分单位
var cnDecUnits = new Array('角', '分', '毫', '厘');
//整数金额时后面跟的字符
var cnInteger = '整';
//整型完以后的单位
var cnIntLast = '元';
//最大处理的数字
var maxNum = 999999999999999.9999;
//金额整数部分
var integerNum;
//金额小数部分
var decimalNum;
//输出的中文金额字符串
var chineseStr = '';
//分离金额后用的数组,预定义
var parts;
if (money == '') {
return '';
}
money = parseFloat(money);
if (money >= maxNum) {
//超出最大处理数字
return '';
}
if (money == 0) {
chineseStr = cnNums[0] + cnIntLast + cnInteger;
return chineseStr;
}
//转换为字符串
money = money.toString();
if (money.indexOf('.') == -1) {
integerNum = money;
decimalNum = '';
} else {
parts = money.split('.');
integerNum = parts[0];
decimalNum = parts[1].substr(0, 4);
}
//获取整型部分转换
if (parseInt(integerNum, 10) > 0) {
var zeroCount = 0;
var IntLen = integerNum.length;
for (var i = 0; i < IntLen; i++) {
var n = integerNum.substr(i, 1);
var p = IntLen - i - 1;
var q = p / 4;
var m = p % 4;
if (n == '0') {
zeroCount++;
} else {
if (zeroCount > 0) {
chineseStr += cnNums[0];
}
//归零
zeroCount = 0;
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
}
if (m == 0 && zeroCount < 4) {
chineseStr += cnIntUnits[q];
}
}
chineseStr += cnIntLast;
}
//小数部分
if (decimalNum != '') {
var decLen = decimalNum.length;
for (var i = 0; i < decLen; i++) {
var n = decimalNum.substr(i, 1);
if (n != '0') {
chineseStr += cnNums[Number(n)] + cnDecUnits[i];
}
}
}
if (chineseStr == '') {
chineseStr += cnNums[0] + cnIntLast + cnInteger;
} else if (decimalNum == '') {
chineseStr += cnInteger;
}
return chineseStr;
}
...@@ -9,7 +9,7 @@ export const minPopupOptions = [{ ...@@ -9,7 +9,7 @@ export const minPopupOptions = [{
}, },
{ {
label: '开收据', label: '开收据',
path: '/pages/maintain-bill/create', path: '/pages/maintain-bill/bill-style',
icon: 'weixiuzhangfapiao@3x.png', icon: 'weixiuzhangfapiao@3x.png',
type: '2', type: '2',
}, },
......
...@@ -71,19 +71,156 @@ export const tableOptions = [{ ...@@ -71,19 +71,156 @@ export const tableOptions = [{
export const billCountOptions = [{ export const billCountOptions = [{
value: "income", value: "number",
label: "账单", label: "账单",
}, },
{ {
value: "expense", value: "receivableAmount",
label: "应收", label: "应收",
}, },
{ {
value: "surplus", value: "actualAmount",
label: "实收", label: "实收",
}, },
{ {
value: "surplus", value: "arearAmount",
label: "欠款", label: "欠款",
}, },
]
export const voucherHeadOptions = [{
value: "number",
label: "单号",
},
{
value: "repairTime",
label: "时间",
},
{
value: "customer",
childrenValue:'name',
label: "客户",
},
{
value: "customer",
childrenValue:'phone',
label: "电话",
},
{
value: "address",
label: "客户地址",
},
]
export const voucherFooterOptions = [{
value: "stopInfo",
childrenValue:'lister',
label: "制表人",
},
{
value: "receivableAmount",
label: "应收金额",
currencySign:'¥',
},
{
value: "actualAmount",
label: "实收金额",
currencySign:'¥',
},
{
value: "arearAmount",
label: "欠款",
currencySign:'¥',
},
{
value: "stopInfo",
childrenValue:'phone',
label: "电话",
},
{
value: "stopInfo",
childrenValue:'address',
label: "地址",
},
]
export const tableCellOptions = [{
value: "index",
label: "序号",
width:"44rpx",
},
{
value: "name",
label: "商品/服务名称",
width:"154rpx",
},
{
value: "unit",
label: "单位",
width:"60rpx",
},
{
value: "number",
label: "数量",
width:"60rpx",
},
{
value: "unitPrice",
label: "单价",
width:"100rpx",
currencySign:'¥',
},
{
value: "total",
label: "金额",
width:"100rpx",
currencySign:'¥',
},
]
export const canvasTableCellOptions = [{
value: "index",
label: "序号",
width:"48rpx",
},
{
value: "name",
label: "商品/服务名称",
width:"142rpx",
},
{
value: "unit",
label: "单位",
width:"64rpx",
},
{
value: "number",
label: "数量",
width:"64rpx",
},
{
value: "unitPrice",
label: "单价",
width:"102rpx",
currencySign:'¥',
},
{
value: "total",
label: "金额",
width:"102rpx",
currencySign:'¥',
},
]
export const tableFooterOptions = [{
value: "upperCase",
label: "大写金额:",
width:"70%",
},
{
value: "lowerCase",
label: "(小写)",
width:"30%",
},
] ]
\ No newline at end of file
...@@ -78,5 +78,10 @@ export const shopSettingOptions = [{ ...@@ -78,5 +78,10 @@ export const shopSettingOptions = [{
label: '联系电话', label: '联系电话',
value: 'phone', value: 'phone',
path: "/pages/mine/shop-setting/shop-phone/shop-phone" path: "/pages/mine/shop-setting/shop-phone/shop-phone"
},
{
label: '制表人',
value: 'lister',
path: "/pages/mine/shop-setting/shop-lister/shop-lister"
} }
] ]
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