提交 c87e9789 authored 作者: lidongxu's avatar lidongxu

feat(audit_activity): 新增:售点稽查_稽核记录列表查询功能完成

上级 f7f3d217
...@@ -33,3 +33,11 @@ export function createInspectionTaskDetailAPI(data) { ...@@ -33,3 +33,11 @@ export function createInspectionTaskDetailAPI(data) {
data data
}) })
} }
// 售点稽查-任务列表
export function getInspectionTaskListAPI(params) {
return request({
url: '/operation/risk/query/i_store/page',
params
})
}
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</template> </template>
<template #label> <template #label>
<div class="item-company">{{ item.dealersName }}</div> <div class="item-company">{{ item.dealersName }}</div>
<div class="item-address">{{ item.storeAddr }}</div> <div class="item-address">{{ item.address }}</div>
</template> </template>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
<script setup> <script setup>
import { getTerminalStoreListAPI } from '@/api' import { getTerminalStoreListAPI } from '@/api'
defineOptions({
name: 'Sales_point_inspection'
})
const router = useRouter(); const router = useRouter();
...@@ -177,42 +180,42 @@ const addNewTerminal = () => { ...@@ -177,42 +180,42 @@ const addNewTerminal = () => {
} }
.van-pull-refresh {
min-height: 100vh;
.result-list {
.result-list {
background-color: transparent;
padding: 0 20px;
margin-top: 10px;
.van-cell-group {
margin: 0;
background-color: transparent; background-color: transparent;
padding: 0 20px;
.result-item { margin-top: 10px;
background-color: white;
margin-bottom: 10px; .van-cell-group {
margin: 0;
.item-title { background-color: transparent;
font-weight: 600;
color: #333; .result-item {
margin-bottom: 4px; background-color: white;
} margin-bottom: 10px;
.item-company { .item-title {
font-size: 14px; font-weight: 600;
color: #a6a4a4; color: #333;
margin-bottom: 2px; margin-bottom: 4px;
} }
.item-address { .item-company {
font-size: 13px; font-size: 14px;
color: #a6a4a4; color: #a6a4a4;
line-height: 1.4; margin-bottom: 2px;
}
.item-address {
font-size: 13px;
color: #a6a4a4;
line-height: 1.4;
}
} }
} }
} }
} }
.empty-tip { .empty-tip {
......
...@@ -3,88 +3,141 @@ ...@@ -3,88 +3,141 @@
<!-- 任务列表 --> <!-- 任务列表 -->
<van-nav-bar left-arrow <van-nav-bar left-arrow
@click-left="router.back()"> @click-left="router.back()">
<template #right>
<span class="search-text"
@click="showSearch = true">搜索</span>
</template>
</van-nav-bar> </van-nav-bar>
<van-list v-model:loading="loading" <van-pull-refresh v-model="refreshLoading"
:finished="finished" :pull-distance="100"
finished-text="没有更多结果了" success-text="刷新成功"
class="result-list"> @refresh="onRefresh">
<van-cell-group inset> <van-list v-model:loading="loading"
<van-cell v-for="(item, index) in resultList" :finished="finished"
:key="index" finished-text="没有更多结果了"
class="result-item" class="result-list"
@click="handleClickStore(item)"> @load="onLoadMore">
<template #title> <van-cell-group inset>
<div class="item-title"> <van-cell v-for="(item, index) in resultList"
<span>{{ item.name }}</span> :key="index"
<span>{{ item.code }}</span> class="result-item"
</div> @click="handleClickStore(item)">
</template> <template #title>
<template #label> <div class="item-title">
<div class="item-company">{{ item.company }}</div> <span>{{ item.storeName }}</span>
<div class="item-address">{{ item.address }}</div> <span>{{ parseTime(item.createTime, '{y}-{m}-{d}') }}</span>
</template> </div>
</van-cell> </template>
</van-cell-group> <template #label>
</van-list> <div class="item-company">{{ item.storeCode }}</div>
<div class="item-address">{{ item.address }}</div>
</template>
</van-cell>
</van-cell-group>
</van-list>
</van-pull-refresh>
<!-- 搜索 -->
<van-popup v-model:show="showSearch"
position="right"
class="wrap">
<van-nav-bar title="筛选条件" />
<van-field type="text"
label="任务名称"
label-align="left"
label-width="1.5rem"
placeholder="请输入">
<template #input>
<van-search v-model="query.storeName"
placeholder="请输入勤策终端编码/名称"
@update:model-value="getInspectionTaskListFn"
class="search-bar" />
</template>
</van-field>
<!-- 日期区间 -->
<van-field type="text"
label="任务日期"
label-align="left"
label-width="1.5rem"
placeholder="请输入">
<template #input>
<el-date-picker v-model="query.operDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择日期"
@change="getInspectionTaskListFn" />
</template>
</van-field>
<!-- 重置按钮 -->
<van-button icon="replay"
class="reset-btn"
block
@click="resetFn">重置</van-button>
</van-popup>
</div> </div>
</template> </template>
<script setup> <script setup>
import { getInspectionTaskListAPI } from '@/api'
import { parseTime } from '@/utils'
defineOptions({
name: 'Sales_point_inspection'
})
const router = useRouter(); const router = useRouter();
const resultList = ref([
{ // 搜索
name: '门店1', const showSearch = ref(false)
code: '123456',
company: '公司1', // 获取列表
address: '地址1' const query = reactive({
}, pageNum: 1,
{ pageSize: 10
name: '门店2', })
code: '123457', const resultList = ref([])
company: '公司2',
address: '地址2'
},
{
name: '门店3',
code: '123458',
company: '公司3',
address: '地址3'
},
])
const loading = ref(false); const loading = ref(false);
const finished = ref(true); const finished = ref(true);
const showEmpty = ref(false); const refreshLoading = ref(false)
// 搜索处理 const getInspectionTaskListFn = async () => {
const handleSearch = () => { const res = await getInspectionTaskListAPI(query)
if (!searchVal.value.trim()) { resultList.value = [...resultList.value, ...res.data.rows]
resultList.value = mockData; finished.value = res.data.total <= resultList.value.length
showEmpty.value = false; }
return; getInspectionTaskListFn()
}
// 模拟加载状态
loading.value = true;
// 模拟接口请求延迟 // 刷新
setTimeout(() => { const onRefresh = async () => {
const filtered = mockData.filter(item => { refreshLoading.value = true
const matchStr = `${item.name}${item.code}${item.company}${item.address}`; query.pageNum = 1
return matchStr.includes(searchVal.value); resultList.value = []
}); await getInspectionTaskListFn()
refreshLoading.value = false
}
// 更多
const onLoadMore = async () => {
query.pageNum++
await getInspectionTaskListFn()
loading.value = false
}
resultList.value = filtered; // 搜索中重置
loading.value = false; const resetFn = () => {
finished.value = true; query.pageNum = 1
}, 500); query.storeName = ''
}; query.operDate = ''
resultList.value = []
getInspectionTaskListFn()
}
// 门店点击 // 门店点击
const handleClickStore = (item) => { const handleClickStore = (item) => {
router.push({ router.push({
path: '/inspectionTask', path: '/inspectionTask',
query: { query: {
storeName: item.name, storeName: item.storeName,
storeCode: item.code storeCode: item.storeCode,
storePicture: item.storePictures?.split(",")[0]
} }
}) })
} }
...@@ -101,39 +154,74 @@ const handleClickStore = (item) => { ...@@ -101,39 +154,74 @@ const handleClickStore = (item) => {
background-color: #f5f5f5; background-color: #f5f5f5;
min-height: 100vh; min-height: 100vh;
.result-list { .search-text {
background-color: transparent; color: var(--main-color);
padding: 0 20px; }
margin-top: 10px;
.van-pull-refresh {
min-height: 100vh;
.van-cell-group { .result-list {
margin: 0;
background-color: transparent; background-color: transparent;
padding: 0 20px;
margin-top: 10px;
.result-item { .van-cell-group {
background-color: white; margin: 0;
margin-bottom: 10px; background-color: transparent;
.item-title { .result-item {
font-weight: 600; background-color: white;
color: #333; margin-bottom: 10px;
margin-bottom: 4px;
display: flex;
justify-content: space-between;
}
.item-company { .item-title {
font-size: 14px; font-weight: 600;
color: #a6a4a4; color: #333;
margin-bottom: 2px; margin-bottom: 4px;
} display: flex;
justify-content: space-between;
span:last-child {
width: 100px;
text-align: right;
display: inline-block;
}
}
.item-address { .item-company {
font-size: 13px; font-size: 14px;
color: #a6a4a4; color: #a6a4a4;
line-height: 1.4; margin-bottom: 2px;
}
.item-address {
font-size: 13px;
color: #a6a4a4;
line-height: 1.4;
}
} }
} }
}
}
/* 搜索 */
.wrap {
--van-field-label-width: 80px;
height: 100vh;
width: 85% !important;
.van-cell {
align-items: center;
.search-bar {
padding: 0;
}
::v-deep(.el-input) {
width: 100%;
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论