修改上报

main
ihzero 2024-05-12 21:45:12 +08:00
parent bbe1de135e
commit af49453786
2 changed files with 35 additions and 3 deletions

View File

@ -22,10 +22,37 @@ export default {
},
onShow: function () {
console.log('App Show')
this.isHaveNetwork()
},
onHide: function () {
console.log('App Hide')
},
methods: {
isHaveNetwork() {
uni.getNetworkType({
success: (res) => {
if (res.networkType == 'none') {
uni.showModal({
title: '网络不给力~',
content: '是否重新连接',
showCancel: true,
confirmText: '是',
cancelText: '不了',
success: (res) => {
if (res.confirm) {
setTimeout(() => {
this.isHaveNetwork() //
}, 200)
}
},
})
}
},
fail: (err) => console.error('调用失败'),
complete: () => {},
})
},
},
}
</script>

View File

@ -150,9 +150,10 @@
class="fixed z-10 bottom-0 left-0 right-0 h-120rpx bg-white flex-center box-border px-base"
:style="style"
>
<view class="w-full">
<uv-button
:disabled="!form.allow_rereport || !checkPermission(['store'])"
:disabled="isRule"
type="primary"
shape="circle"
block
@ -200,7 +201,7 @@ import {
import { useUserStore } from '@/store/modules/user'
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
import { empty } from '@climblee/uv-ui/libs/function/test'
import { add } from '@/utils/index'
import { add ,sub} from '@/utils/index'
import checkPermission from '@/utils/permission'
import { onShow } from '@dcloudio/uni-app'
@ -219,7 +220,9 @@ const userStore = useUserStore()
const userInfo = computed(() => userStore.userInfo || {})
const store = computed(() => userInfo.value.store)
const endDate = timeFormat(new Date(), 'yyyy-mm-dd')
const isRule = computed(()=>{
return !form.allow_rereport || !checkPermission(['store'])
})
const form = reactive({
date: endDate,
@ -451,6 +454,7 @@ const salesChange = async () => {
await nextTick()
const val = form?.items || []
const sales = val.reduce((a, b) => {
if(b.operator=='-') return sub(a, b?.expenditure ?? 0)
return add(a, b?.sales ?? 0)
}, 0)
@ -461,6 +465,7 @@ const expenditureChange = async () => {
await nextTick()
const val = form?.items || []
const expenditure = val.reduce((a, b) => {
if(b.operator=='-') return sub(a, b?.expenditure ?? 0)
return add(a, b?.expenditure ?? 0)
}, 0)
form.expenditure = expenditure || 0