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

feat(examine/index): 完成稽核 CP 列表的展示

同上
上级 245c93c7
...@@ -20,10 +20,15 @@ export function createExamine(data) { ...@@ -20,10 +20,15 @@ export function createExamine(data) {
} }
// 获取稽核任务列表 // 获取稽核任务列表
export function getExamineList() { export function getExamineList(data) {
return request({ return request({
baseURL: VITE_APP_PROMOTION, baseURL: VITE_APP_PROMOTION,
url: `/exa/query/page`, url: `/exa/query/page`,
method: 'post', method: 'post',
data: {
pageNum: data.page,
pageSize: data.pageSize,
queryParams: {}
}
}) })
} }
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="container"> <div class="container">
<!-- 查询表单 -->
<el-form :model="queryParams"
inline
label-width="68px">
<el-form-item label="活动日期"
prop="date">
<el-date-picker v-model="queryParams.date"
type="daterange"
clearable
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:shortcuts="pickerOptions"
@change="getTaskList" />
</el-form-item>
<el-form-item label="任务执行"
prop="taskStatus">
<el-radio-group v-model="queryParams.taskStatus"
@change="getTaskList">
<el-radio-button v-for="item in taskStatusList"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-radio-group>
</el-form-item>
<!-- 省市 -->
<el-row>
<el-form-item label="区域查询"
prop="region">
<el-radio-group v-model="queryParams.region"
@change="regionChange">
<el-radio-button label="全国"
value="全国" />
<el-radio-button label="省"
value="省" />
<el-radio-button label="省-市"
value="省-市" />
</el-radio-group>
</el-form-item>
<el-form-item label="省份"
prop="province"
v-show="queryParams.region !== '全国'">
<el-select v-model="queryParams.provinceId"
placeholder="请选择省"
@change="getProCity">
<el-option v-for="item in provinceList"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="城市"
prop="city"
v-show="queryParams.region === '省-市'">
<el-select v-model="queryParams.cityId"
placeholder="请选择市">
<el-option v-for="item in cityList"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="战区"
prop="zone">
<el-select v-model="queryParams.zoneId"
placeholder="请选择战区"
clearable
:disabled="cityManagerPrivilege"
@change="getTaskList">
<el-option v-for="item in zoneList"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="负责人"
prop="manager">
<el-select v-model="queryParams.managerId"
placeholder="请选择负责人"
:disabled="cityManagerPrivilege"
clearable
@change="getTaskList">
<el-option v-for="item in managerList"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="门店"
prop="store">
<el-input v-model="queryParams.storeName"
clearable
@input="getTaskList"
placeholder="请输入门店名称" />
</el-form-item>
</el-row>
</el-form>
<!-- 数据表格 --> <!-- 数据表格 -->
<el-table :data="tableList" <el-table :data="tableList"
:cell-style="{ 'word-wrap': 'break-word', 'white-space': 'normal' }" :cell-style="{ 'word-wrap': 'break-word', 'white-space': 'normal' }"
border border
style="width: 100%" style="width: 100%">
show-overflow-tooltip>
<el-table-column v-for="item in columns" <el-table-column v-for="item in columns"
:key="item.label" :key="item.label"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:width="item.width" :width="item.width"
:formatter="formatter" :fixed="item.fixed"
:fixed="item.fixed" /> show-overflow-tooltip>
<template #default="scope">
<template v-if="item.prop === 'storePicture'">
<!-- 如果是门头照字段,渲染图片 -->
<el-image :preview-src-list="[scope.row[item.prop]]"
preview-teleported
:src="scope.row[item.prop]"
alt="图片"
style="width: 100px; height: 100px;" />
</template>
<template v-else-if="item.prop === 'temWorkPhotos'">
<el-image :preview-src-list="[item]"
preview-teleported
v-for="item in JSON.parse(scope.row[item.prop])"
:src="item"
alt="图片"
style="width: 100px; height: 100px; margin-right: 10px;" />
</template>
<template v-else-if="item.prop === 'storeTcPhoto'">
<el-image :preview-src-list="[scope.row[item.prop]]"
preview-teleported
:src="scope.row[item.prop]"
alt="图片"
style="width: 100px; height: 100px;" />
</template>
<template v-else-if="item.prop === 'storeZhjPhoto'">
<el-image :preview-src-list="[scope.row[item.prop]]"
preview-teleported
:src="scope.row[item.prop]"
alt="图片"
style="width: 100px; height: 100px;" />
</template>
<template v-else-if="item.prop === 'posPhotos'">
<el-image :preview-src-list="[item]"
preview-teleported
v-for="item in JSON.parse(scope.row[item.prop])"
:src="item"
alt="图片"
style="width: 100px; height: 100px; margin-right: 10px;" />
</template>
<template v-else>
<!-- 其他字段显示原始值 -->
{{ formatter(scope.row, scope.column, scope.row[item.prop]) }}
</template>
</template>
</el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
width="200" width="200"
fixed="right"> fixed="right">
...@@ -141,7 +86,8 @@ ...@@ -141,7 +86,8 @@
width="60%"> width="60%">
<p>活动记录 ID :{{ photoLookInfoObj.id }}</p> <p>活动记录 ID :{{ photoLookInfoObj.id }}</p>
<p>活动时间 :{{ photoLookInfoObj.createDate }}</p> <p>活动时间 :{{ photoLookInfoObj.createDate }}</p>
<el-card v-for="obj in photoDialogList" shadow="never"> <el-card v-for="obj in photoDialogList"
shadow="never">
<template #header>{{ obj.title }}</template> <template #header>{{ obj.title }}</template>
<div class="content"> <div class="content">
<el-result :title="item.time" <el-result :title="item.time"
...@@ -262,152 +208,152 @@ const columns = ref([ ...@@ -262,152 +208,152 @@ const columns = ref([
{ {
label: '稽核标识', label: '稽核标识',
prop: 'id', prop: 'id',
width: 90, width: 80,
}, },
{ {
label: '稽核人', label: '稽核人',
prop: 'temporaryName', prop: 'createBy',
width: 90, width: 90,
}, },
{ {
label: '稽核人工号', label: '稽核人工号',
prop: 'createDate', prop: 'employeeNo',
width: 120, width: 100,
}, },
{ {
label: 'CP 活动 ID', label: 'cp活动 ID',
prop: 'week', prop: 'planId',
width: 120 width: 100
}, },
{ {
label: '是否执行', label: '是否执行',
prop: 'province', prop: 'planStatus',
width: 100 width: 100
}, },
{ {
label: '战区', label: '战区',
prop: 'city', prop: 'deptQcOrgName',
width: 100 width: 100
}, },
{ {
label: '城市经理', label: '城市经理',
prop: 'dealerName', prop: 'manageName',
width: 120 width: 120
}, },
{ {
label: '城市', label: '城市',
prop: 'storeName', prop: 'city',
width: 120 width: 100
}, },
{ {
label: '活动日期', label: '活动日期',
prop: 'activityPattern', prop: 'planDate',
width: 150 width: 150
}, },
{ {
label: '系统名称', label: '系统名称',
prop: 'approveStatus', prop: 'lineName',
width: 150 width: 150
}, },
{ {
label: '门店', label: '门店',
prop: 'clockDto.clockInTime', prop: 'storeName',
width: 150 width: 210
}, },
{ {
label: '经销商', label: '经销商',
prop: 'clockDto.noonClockOutTime', // 拼接地址 noonClockOutAddress, 经纬度 noonClockOutCoordinates prop: 'dealerName',
width: 300 width: 200
}, },
{ {
label: '活动模式', label: '活动模式',
prop: 'clockDto.noonClockInTime', // 拼接地址 noonClockInAddress, 经纬度 noonClockInCoordinates prop: 'pattern',
width: 300 width: 100
}, },
{ {
label: '稽核日期', label: '稽核日期',
prop: 'clockDto.clockOutTime', // 拼接地址 clockOutAddress, 经纬度 clockOutCoordinates prop: 'createDate',
width: 300 width: 120
}, },
{ {
label: '门头照', label: '门头照',
prop: 'deptQcOrgName', prop: 'storePicture',
width: 150 width: 150
}, },
{ {
label: '促销员人数', label: '促销员人数',
prop: 'manageName', prop: 'temNum',
width: 120 width: 100
}, },
{ {
label: '地堆', label: '地堆',
prop: 'manageName', prop: 'storeDd',
width: 120 width: 80
}, },
{ {
label: '促销员是否在岗', label: '促销员是否在岗',
prop: 'manageName', prop: 'temOnWork',
width: 120 width: 120
}, },
{ {
label: '话术', label: '话术',
prop: 'manageName', prop: 'temHs',
width: 120 width: 80
}, },
{ {
label: '物料', label: '物料',
prop: 'manageName', prop: 'temWl',
width: 120 width: 80
}, },
{ {
label: '着装', label: '着装',
prop: 'manageName', prop: 'temZz',
width: 120 width: 80
}, },
{ {
label: '工作取证照片', label: '工作取证照片',
prop: 'manageName', prop: 'temWorkPhotos',
width: 120 width: 250
}, },
{ {
label: '特陈照', label: '特陈照',
prop: 'manageName', prop: 'storeTcPhoto',
width: 120 width: 150
}, },
{ {
label: '主货架照', label: '主货架照',
prop: 'manageName', prop: 'storeZhjPhoto',
width: 120 width: 150
}, },
{ {
label: 'POS 金额', label: 'POS 金额',
prop: 'manageName', prop: 'posRmb',
width: 120 width: 120
}, },
{ {
label: 'POS 照片', label: 'POS 照片',
prop: 'manageName', prop: 'posPhotos',
width: 120 width: 250
}, },
{ {
label: '创建人', label: '创建人',
prop: 'manageName', prop: 'createBy',
width: 120 width: 120
}, },
{ {
label: '创建时间', label: '创建时间',
prop: 'manageName', prop: 'createTime',
width: 120 width: 120
}, },
{ {
label: '修改人', label: '修改人',
prop: 'manageName', prop: 'modifyBy',
width: 120 width: 120
}, },
{ {
label: '修改时间', label: '修改时间',
prop: 'manageName', prop: 'mobifyTime',
width: 120 width: 120
} }
]) ])
...@@ -427,30 +373,20 @@ const deleteView = async (row) => { ...@@ -427,30 +373,20 @@ const deleteView = async (row) => {
// 获取稽核任务列表 // 获取稽核任务列表
const getTaskList = async () => { const getTaskList = async () => {
const { data } = await getExamineList(queryParams) const { data: { records } } = await getExamineList(queryParams)
console.log(data) tableList.value = records
} }
getTaskList() getTaskList()
const formatter = (row, columns, value) => { const formatter = (row, columns, value) => {
// 判断有值再转换 // 判断有值再转换
if (columns.property === 'clockDto.clockInTime' && value) { if (columns.property === 'planDate' || columns.property === 'createDate' || columns.property === 'createTime' || columns.property === 'mobifyTime') {
return parseTime(value, '{h}:{i}') + '\n' + row['clockDto']['clockInAddress'] return parseTime(value, '{y}-{m}-{d}')
} else if (columns.property === 'clockDto.noonClockOutTime' && value) { } else {
return parseTime(value, '{h}:{i}') + '\n' + row['clockDto']['noonClockOutAddress']
} else if (columns.property === 'clockDto.noonClockInTime' && value) {
return parseTime(value, '{h}:{i}') + '\n' + row['clockDto']['noonClockInAddress']
} else if (columns.property === 'clockDto.clockOutTime' && value) {
return parseTime(value, '{h}:{i}') + '\n' + row['clockDto']['clockOutAddress']
} else if (columns.property === 'week') {
return parseTime(row['createDate'], '周{a}')
} else if (columns.property === 'approveStatus' && value) {
const obj = {
SUBMITTED: '未审批',
APPROVED: '已审批'
}
return obj[value]
}
return value return value
}
} }
// 区域查询切换 // 区域查询切换
...@@ -554,13 +490,14 @@ const currentChange = (page) => { ...@@ -554,13 +490,14 @@ const currentChange = (page) => {
::v-deep(.el-form-item) { ::v-deep(.el-form-item) {
width: 350px !important; width: 350px !important;
} }
.el-card{
.el-card {
margin-top: 20px; margin-top: 20px;
} }
/* 单元格支持 \n 换行 */ /* 单元格支持 \n 换行 */
.container .el-table ::v-deep(.cell) { .container .el-table ::v-deep(.cell) {
white-space: pre-line; /* white-space: pre-line; */
/* 强制显示 2 行,超出的省略号 */ /* 强制显示 2 行,超出的省略号 */
/* overflow: hidden; /* overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -604,4 +541,5 @@ const currentChange = (page) => { ...@@ -604,4 +541,5 @@ const currentChange = (page) => {
} }
} }
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论