修改上报数据
parent
7197f9a120
commit
04724f087f
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view>
|
||||
<CuNavbar :isBack="isBack || false" title="数据上报"></CuNavbar>
|
||||
|
||||
|
||||
<view
|
||||
:class="[
|
||||
checkPermission(['store']) && form.allow_rereport
|
||||
|
|
@ -90,7 +90,9 @@
|
|||
type="digit"
|
||||
:border="`none`"
|
||||
v-model="form.expenditure"
|
||||
:placeholder="`请输入总账${store?.is_lottery_store ? '兑奖' : '支出'}金额`"
|
||||
:placeholder="`请输入总账${
|
||||
store?.is_lottery_store ? '兑奖' : '支出'
|
||||
}金额`"
|
||||
></uv-input>
|
||||
</uv-form-item>
|
||||
<uv-line color="#f5f5f5"></uv-line>
|
||||
|
|
@ -150,7 +152,6 @@
|
|||
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="isRule"
|
||||
|
|
@ -201,15 +202,19 @@ 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 ,sub} from '@/utils/index'
|
||||
import { add, sub } from '@/utils/index'
|
||||
import checkPermission from '@/utils/permission'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
|
||||
const props = defineProps({
|
||||
isBack: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
default: false,
|
||||
},
|
||||
dete: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
})
|
||||
|
||||
const calendars = ref(null)
|
||||
|
|
@ -219,8 +224,12 @@ 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(()=>{
|
||||
|
||||
const endDate = timeFormat(
|
||||
props.dete ? new Date(props.dete) : new Date(),
|
||||
'yyyy-mm-dd'
|
||||
)
|
||||
const isRule = computed(() => {
|
||||
return !form.allow_rereport || !checkPermission(['store'])
|
||||
})
|
||||
|
||||
|
|
@ -250,7 +259,7 @@ const rules = reactive({
|
|||
},
|
||||
expenditure: {
|
||||
required: true,
|
||||
message:`请输入总账${store.value?.is_lottery_store?'兑奖':'支出'}金额`,
|
||||
message: `请输入总账${store.value?.is_lottery_store ? '兑奖' : '支出'}金额`,
|
||||
},
|
||||
new_customers: {
|
||||
required: true,
|
||||
|
|
@ -263,7 +272,6 @@ const rules = reactive({
|
|||
},
|
||||
})
|
||||
|
||||
|
||||
const style = computed(() => {
|
||||
const style = {}
|
||||
style.bottom = addUnit(sys().windowBottom, 'px')
|
||||
|
|
@ -279,40 +287,36 @@ const submit = () => {
|
|||
formRef.value.validate().then((res) => {
|
||||
modalRef.value.open()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
function filterLotteryData(datas) {
|
||||
return datas.filter((item) => {
|
||||
if (empty(item.sales) && empty(item.expenditure)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return datas.filter(item => {
|
||||
|
||||
if (empty(item.sales) && empty(item.expenditure)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function removeEmptyValues(datas) {
|
||||
return datas.map(item => {
|
||||
// 过滤出空值的属性
|
||||
const filteredItem = Object.entries(item)
|
||||
.filter(([key, value]) => !empty(value))
|
||||
.reduce((acc, [key, value]) => {
|
||||
acc[key] = value;
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
return filteredItem;
|
||||
}).filter(item => Object.keys(item).length !== 0); // 移除所有属性都为空的对象
|
||||
return datas
|
||||
.map((item) => {
|
||||
// 过滤出空值的属性
|
||||
const filteredItem = Object.entries(item)
|
||||
.filter(([key, value]) => !empty(value))
|
||||
.reduce((acc, [key, value]) => {
|
||||
acc[key] = value
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
return filteredItem
|
||||
})
|
||||
.filter((item) => Object.keys(item).length !== 0) // 移除所有属性都为空的对象
|
||||
}
|
||||
const onSubmit = async () => {
|
||||
let valid = false
|
||||
filterLotteryData(form.items).forEach(item => {
|
||||
filterLotteryData(form.items).forEach((item) => {
|
||||
if (!item.sales) {
|
||||
valid = true
|
||||
return uni.showToast({
|
||||
|
|
@ -320,7 +324,7 @@ const onSubmit = async () => {
|
|||
icon: 'none',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (!item.expenditure) {
|
||||
valid = true
|
||||
return uni.showToast({
|
||||
|
|
@ -459,8 +463,8 @@ const salesChange = async () => {
|
|||
await nextTick()
|
||||
const val = form?.items || []
|
||||
const sales = val.reduce((a, b) => {
|
||||
if(b.operator=='-') return sub(a, b?.sales ?? 0)
|
||||
else if(b.operator=='+') return add(a, b?.sales ?? 0)
|
||||
if (b.operator == '-') return sub(a, b?.sales ?? 0)
|
||||
else if (b.operator == '+') return add(a, b?.sales ?? 0)
|
||||
return a
|
||||
}, 0)
|
||||
|
||||
|
|
@ -471,8 +475,8 @@ const expenditureChange = async () => {
|
|||
await nextTick()
|
||||
const val = form?.items || []
|
||||
const expenditure = val.reduce((a, b) => {
|
||||
if(b.operator=='-') return sub(a, b?.expenditure ?? 0)
|
||||
else if(b.operator=='+') return add(a, b?.expenditure ?? 0)
|
||||
if (b.operator == '-') return sub(a, b?.expenditure ?? 0)
|
||||
else if (b.operator == '+') return add(a, b?.expenditure ?? 0)
|
||||
return a
|
||||
}, 0)
|
||||
form.expenditure = expenditure || 0
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ const baseColums = [
|
|||
title: '未通过原因',
|
||||
dataIndex: 'taskable.workflow_check.check_remarks',
|
||||
labelPosition: 'top',
|
||||
isShow: (row) => row?.taskable?.workflow_check.check_status == 4
|
||||
isShow: (row) => {
|
||||
return row?.taskable?.status == 4
|
||||
}
|
||||
},
|
||||
]
|
||||
const id = ref(null)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
v-for="item in list"
|
||||
:key="item.id"
|
||||
:title="item.name"
|
||||
:status-text="item.taskable.status_text"
|
||||
:status-text="statusFun(item.taskable.status, 'task_hygienes' ,'name')"
|
||||
:status-color="statusFun(item.taskable.status, 'task_hygienes' ,'color')"
|
||||
:body="[
|
||||
{label: '任务时间: ', value: item.start_format + '-' + item.end_format}
|
||||
|
|
@ -49,11 +49,11 @@
|
|||
<ListItem
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
:title="item.check.subject.task.name"
|
||||
:title="item?.check?.subject?.task?.name"
|
||||
:status-text="statusFun(item.check_status,'statusExpense2','name')"
|
||||
:status-color="statusFun(item.check_status,'statusExpense2','color')"
|
||||
:body="[
|
||||
{label: '任务时间: ', value: item.check.subject.task.start_format + '-' + item.check.subject.task.end_format}
|
||||
{label: '任务时间: ', value: item?.check?.subject?.task?.start_format + '-' + item?.check?.subject?.task?.end_format}
|
||||
]"
|
||||
@click.stop="checkClick(item)"
|
||||
/>
|
||||
|
|
@ -113,7 +113,7 @@ const applyClick = (item) => {
|
|||
const status = item.taskable.status
|
||||
let url
|
||||
if (status === 2 || status == 4) {
|
||||
url = `/pages/task/${type}_submit?id=${item.id}`
|
||||
url = `/pages/task/${type}_submit?id=${item.id}&date=${item.taskable.date}`
|
||||
} else {
|
||||
url = `/pages/task/detail?id=${item.id}`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,16 @@
|
|||
<template>
|
||||
<view>
|
||||
<RevertPage :isBack="true"></RevertPage>
|
||||
<RevertPage :isBack="true" :dete="date"></RevertPage>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import RevertPage from "@/pages/revert/index";
|
||||
import { ref } from "vue";
|
||||
|
||||
const date = ref("")
|
||||
|
||||
onLoad((opt) => {
|
||||
date.value = opt.date
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue