提交 9bff4700 authored 作者: lidongxu's avatar lidongxu

feat(examine): 稽核任务

同上
上级 9ce234cc
import request from '@/utils/request'
const VITE_APP_PROMOTION = import.meta.env.VITE_APP_PROMOTION
// 获取稽核任务详情
export function getExamineDetail(id) {
return request({
baseURL: VITE_APP_PROMOTION,
url: `/exa/query/${id}`
})
}
// 创建稽核任务
export function createExamine(data) {
return request({
baseURL: VITE_APP_PROMOTION,
url: `/exa/core/save`,
method: 'post',
data: data
})
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ export * from './common/menu' ...@@ -3,6 +3,7 @@ export * from './common/menu'
export * from './common/openQuery' export * from './common/openQuery'
export * from './common/region' export * from './common/region'
export * from './common/upload' export * from './common/upload'
export * from './examine/index'
export * from './bi/competitor' export * from './bi/competitor'
export * from './bi/finance' export * from './bi/finance'
export * from './bi/livecate' export * from './bi/livecate'
......
差异被折叠。
<template> <template>
<div class="mobile-container"> <div class="mobile-container">
<van-nav-bar left-text="返回" <van-nav-bar left-text="返回"
:right-text="(examined ? '已' : '未') + '稽查'"
left-arrow left-arrow
@click-left="clickBack()" /> @click-left="clickBack()"
@click-right="clickExamine()"
fixed
placeholder />
<van-cell-group> <van-cell-group>
<van-cell> <van-cell>
<template #title> <template #title>
...@@ -41,7 +45,7 @@ ...@@ -41,7 +45,7 @@
finished-text="没有更多了" finished-text="没有更多了"
@load="onLoad"> @load="onLoad">
<van-cell-group inset <van-cell-group inset
v-if="planList.length > 0"> v-if="planList?.length > 0">
<van-cell v-for="item in planList" <van-cell v-for="item in planList"
:key="item.id" :key="item.id"
label-class="image-cell"> label-class="image-cell">
...@@ -81,19 +85,23 @@ ...@@ -81,19 +85,23 @@
</template> </template>
<script setup> <script setup>
import { getPlanDetailAPI } from '@/api' import { getPlanDetailAPI, createExamine } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
// 获取路由路径上的 id 参数 // 获取路由路径上的 id 参数
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const id = route.params.id;
// 稽查
const examined = ref(0) // 获取默认的
const newExamined = ref(0) // 没有默认创建的新的
// 获取计划详情 // 获取计划详情
const planDetail = ref({}) const planDetail = ref({})
const planList = ref([]) const planList = ref([])
const getPlanDetail = async () => { const getPlanDetail = async () => {
const res = await getPlanDetailAPI(id) const res = await getPlanDetailAPI(route.params.id)
planDetail.value = res.data.planInfo planDetail.value = res.data.planInfo
examined.value = res.data.examine?.id
// 循环多人打卡记录 // 循环多人打卡记录
planList.value = res.data.reporteds?.map(o => { planList.value = res.data.reporteds?.map(o => {
...@@ -185,6 +193,20 @@ const getPlanDetail = async () => { ...@@ -185,6 +193,20 @@ const getPlanDetail = async () => {
} }
getPlanDetail() getPlanDetail()
// 点击稽查按钮
const clickExamine = async () => {
// 如果稽查 ID 是空则创建一个
if (!examined.value) {
const result = await createExamine({
...planDetail.value,
id: '',
planId: planDetail.value.id
})
newExamined.value = result.data.id
}
router.push({ path: `/examine/${examined?.value || newExamined.value}` })
}
const refreshLoading = ref(false) const refreshLoading = ref(false)
const onRefresh = () => { const onRefresh = () => {
refreshLoading.value = true refreshLoading.value = true
...@@ -219,6 +241,8 @@ const previewImage = (list, ind) => { ...@@ -219,6 +241,8 @@ const previewImage = (list, ind) => {
const onChange = (ind) => { const onChange = (ind) => {
index.value = ind index.value = ind
} }
</script> </script>
<style scoped> <style scoped>
...@@ -242,12 +266,12 @@ p { ...@@ -242,12 +266,12 @@ p {
margin-top: 20px; margin-top: 20px;
min-height: 100vh; min-height: 100vh;
::v-deep(.van-cell:nth-child(n+2)){ ::v-deep(.van-cell:nth-child(n+2)) {
margin-top: 20px; margin-top: 20px;
} }
::v-deep(.van-cell) { ::v-deep(.van-cell) {
.item{ .item {
margin-top: 20px; margin-top: 20px;
} }
} }
...@@ -305,11 +329,11 @@ p { ...@@ -305,11 +329,11 @@ p {
} }
.gray_title{ .gray_title {
color: gray; color: gray;
} }
.black_title{ .black_title {
color: black; color: black;
} }
</style> </style>
\ No newline at end of file
...@@ -105,6 +105,12 @@ export const constantMobileRoutes = [ ...@@ -105,6 +105,12 @@ export const constantMobileRoutes = [
component: () => import('@/mobile_views/promotion/detail'), component: () => import('@/mobile_views/promotion/detail'),
name: 'Detail', name: 'Detail',
hidden: true, hidden: true,
},
{
path: '/examine/:examineId',
component: () => import('@/mobile_views/examine'),
name: 'Examine',
hidden: true,
} }
] ]
......
...@@ -598,7 +598,7 @@ const columns = ref([ ...@@ -598,7 +598,7 @@ const columns = ref([
{ {
label: '店铺名称', label: '店铺名称',
prop: 'storeName', prop: 'storeName',
width: 150 width: 240
}, },
{ {
label: '活动日期', label: '活动日期',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论