提交 5db883d5 authored 作者: lidongxu's avatar lidongxu

Merge branch 'ldx' into dev

......@@ -14,4 +14,8 @@ VITE_APP_PROMOTION = '/promotion-api' # 促销
# 飞书服务回调地址(本地测试已经通过并上线,后台飞书登录接口重定向地址已经不是 localhost 了所以本地开发无需使用飞书登录,线上已经可用)
VITE_APP_REDIRECT_URL = 'http://localhost:8085'
# 积木报表服务地址
VITE_APP_REPORT_URL = 'https://sfa-qa.wxl66.cn'
\ No newline at end of file
VITE_APP_REPORT_URL = 'https://sfa-qa.wxl66.cn'
# 模板表格
VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF3.0.xlsx'
\ No newline at end of file
......@@ -12,4 +12,10 @@ VITE_APP_PROMOTION = 'https://promotion.wxl66.cn' # 促销
# 飞书服务回调地址
VITE_APP_REDIRECT_URL = 'https://sfa.wxl66.cn/link/'
# 积木报表服务地址
VITE_APP_REPORT_URL = 'https://sfa.wxl66.cn'
\ No newline at end of file
VITE_APP_REPORT_URL = 'https://sfa.wxl66.cn'
# 模板表格
VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF3.0.xlsx'
\ No newline at end of file
......@@ -12,4 +12,10 @@ VITE_APP_PROMOTION = '/promotion-api' # 促销
# 飞书服务回调地址
VITE_APP_REDIRECT_URL = 'https://sfa-qa.wxl66.cn/'
# 积木报表服务地址
VITE_APP_REPORT_URL = 'https://sfa-qa.wxl66.cn'
\ No newline at end of file
VITE_APP_REPORT_URL = 'https://sfa-qa.wxl66.cn'
# 模板表格
VITE_APP_PLAN_TEMPLATE_EXCEL = 'https://link-promotion.oss-cn-shanghai.aliyuncs.com/file/%E6%96%B0%E5%A2%9E%E6%88%96%E4%BF%AE%E6%94%B9%E8%AE%A1%E5%88%92-%E6%A8%A1%E6%9D%BF3.0.xlsx'
\ No newline at end of file
......@@ -15,3 +15,19 @@ export const PROMOTION_STATUS = {
export const getPromotionActiveStatus = (statusNum) => {
return PROMOTION_STATUS[statusNum] || { label: '未知状态', value: '' }
}
// 促销活动模式
export const PROMOTION_ACTIVITY_MODE_LIST = [
{
label: '单点CP',
value: '单点CP'
},
{
label: '常规MINI秀',
value: '常规MINI秀'
},
{
label: '校园活动',
value: '校园活动'
}
]
\ No newline at end of file
......@@ -26,8 +26,7 @@ export const useDatePickerOptions = () => {
text: '最近 7 日',
value() {
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
start.setHours(0, 0, 0, 0);
start.setDate((new Date().getDate() - (7 - 1)))
const end = new Date();
end.setHours(23, 59, 59, 59);
return [start, end]
......@@ -36,7 +35,7 @@ export const useDatePickerOptions = () => {
text: '最近 30 日',
value() {
const start = new Date();
start.setDate((new Date().getDate() - 30))
start.setDate((new Date().getDate() - (30 - 1)))
start.setHours(0, 0, 0, 0);
const end = new Date();
end.setHours(23, 59, 59, 59);
......
......@@ -88,7 +88,7 @@ defineOptions({
import userStore from '@/store/modules/user'
import { parseTime } from '@/utils'
import { checkPlanExpire } from '@/hooks'
import { getPromotionActiveStatus } from '@/dicts'
import { PROMOTION_STATUS,getPromotionActiveStatus } from '@/dicts'
import { getPlanListAPI, deletePlanAPI, batchUpdatePlanAPI, getChargeListAPI } from '@/api'
import PlanSearch from './planSearch.vue'
import PickerBelong from '../components/PickerBelong'
......@@ -120,16 +120,12 @@ const loading = ref(false)
const finished = ref(false)
// 活动状态
const planColumns = [
{
text: '未执行',
value: 'NOT_EXECUTION'
},
{
text: '执行',
value: 'EXECUTION'
const planColumns = Object.values(PROMOTION_STATUS).map(item => {
return {
text: item.label,
value: item.value
}
]
})
// 归属人
const allEmpolyeeList = ref([])
......@@ -157,7 +153,8 @@ const getPlanList = async () => {
activityEndDate: parseTime(query.activityEndDate, "{y}-{m}-{d}"),
planStatus: planColumns.find(item => item.text === query.planStatus)?.value,
employeeId: promotionIdentity.value ? allEmpolyeeList.value.find(o => o.employeeNo === employeeNo.value)?.value : query.employeeId,
storeNameLike: query.storeNameLike
storeNameLike: query.storeNameLike,
statusType: query.isDeleted
},
})
......
......@@ -60,6 +60,17 @@
placeholder="请输入店铺名"
@update:model-value="searchByStoreName"
clearable />
<!-- 查看有效/已删除计划 -->
<van-field label="计划状态">
<template #input>
<van-radio-group v-model="query.isDeleted" @change="selIsDeleted">
<van-radio :name="undefined">有效</van-radio>
<van-radio name="INVALID">已删除</van-radio>
</van-radio-group>
</template>
</van-field>
<!-- 重置按钮 -->
<van-button icon="replay"
class="reset-btn"
......@@ -144,10 +155,10 @@ const confirmPlan = (val) => {
const showEmployee = ref(false)
// 如果是城市经理,设置默认归属人
watch(() => props.allEmpolyeeList, (newVal) => {
if (newVal.length > 0 && promotionIdentity.value) {
if (newVal.length > 0 && promotionIdentity.value) {
props.query.employeeName = newVal.find(o => o.employeeNo === userStore().employeeNo)?.text
props.query.employeeId = newVal.find(o => o.employeeNo === userStore().employeeNo)?.value
}
}
})
// 确定归属人
......@@ -160,7 +171,12 @@ const onEmployeeConfirm = (val) => {
// 店铺名
const searchByStoreName = (val) => {
props.query.storeNameLike = val
// props.query.storeNameLike = val
emits('query')
}
// 计划状态
const selIsDeleted = () => {
emits('query')
}
......@@ -172,9 +188,10 @@ const resetFn = () => {
props.query.planStatus = undefined
if (!promotionIdentity.value) {
props.query.employeeName = undefined
props.query.employeeId = undefined
props.query.employeeId = undefined
}
props.query.storeNameLike = undefined
props.query.isDeleted = undefined
emits('query')
}
......
......@@ -103,6 +103,17 @@ export default defineStore(
promotionIdentity(state) {
return state.userInfo.privilegeId === 1
},
// 员工关键信息
empInfo(state) {
return {
empId: state.userInfo.userId, // 员工 id
empNo: state.userInfo.userName, // 员工工号
empName: state.userInfo.nickName, // 员工昵称名字
}
},
// 操作人员工工号,姓名,id
employeeInfo(state) {
return {
......
差异被折叠。
<template>
<!-- 表格列表 -->
<el-table :data="tableList"
border
style="width: 100%"
show-overflow-tooltip
:row-class-name="tableRowTimeOutClassName">
<!-- <el-table-column type="selection"
width="55"
:selectable="selectableFn">
</el-table-column> -->
<el-table-column v-for="item in columns"
:key="item.label"
:prop="item.prop"
:label="item.label"
:width="item.width"
:formatter="formatter"
:fixed="item.fixed"
:show-overflow-tooltip="true" />
<!-- <el-table-column label="操作"
width="150"
fixed="right">
<template #default="scope">
<el-button type="success"
link
:disabled="!selectableFn(scope.row)"
@click="editFn(scope.row)">
编辑
</el-button>
<el-button type="danger"
link
:disabled="!selectableFn(scope.row)"
@click="deletePlane(scope.row)">
删除
</el-button>
</template>
</el-table-column> -->
</el-table>
<!-- 分页 -->
<pagination :total="total"
v-model:page="pageNum"
v-model:limit="pageSize"
@pagination="getPlanList" />
</template>
<script setup>
import { getPlanListAPI } from '@/api'
import { getPromotionActiveStatus } from '@/dicts'
import { parseTime } from '@/utils'
const { proxy } = getCurrentInstance();
const props = defineProps({
queryParams: {
type: Object,
}
})
/*************** 计划表格 ***************/
const tableList = ref([])
const columns = ref([
{
label: '归属人',
prop: 'employeeName',
width: 150,
fixed: true
},
{
label: '战区',
prop: 'orgName',
width: 120
},
{
label: '店铺名称',
prop: 'storeName',
width: 240
},
{
label: '活动日期',
prop: 'date',
width: 120
},
{
label: '星期',
prop: 'week',
width: 80
},
{
label: '活动状态',
prop: 'planStatus',
width: 100
},
{
label: '活动模式',
prop: 'pattern',
width: 100
},
{
label: '系统名称',
prop: 'lineName',
width: 150
},
{
label: '店铺编码',
prop: 'storeCode',
width: 160
},
{
label: '经销商',
prop: 'dealerName',
width: 220
},
{
label: '经销商 ID',
prop: 'dealerId',
width: 120
},
{
label: '省份',
prop: 'province',
width: 100
},
{
label: '地址',
prop: 'addr',
width: 200
},
{
label: '上班时间',
prop: 'clockInTime',
width: 180
},
{
label: '下班时间',
prop: 'clockOutTime',
width: 180
},
{
label: '促销员薪资',
prop: 'salary',
width: 100
},
{
label: '杂费',
prop: 'incidentals',
width: 100
},
{
label: '创建人',
prop: 'createBy',
width: 120
},
{
label: '最近修改人',
prop: 'modifyBy',
width: 100
},
{
label: '最后修改时间',
prop: 'modifyTime',
width: 180
},
{
label: '活动 ID',
prop: 'id',
width: 90
}
])
// 格式化计划列表单元格内容
const formatter = (row, col, value) => {
if (col.property === 'planStatus') {
return getPromotionActiveStatus(value)?.label
} else if (col.property === 'date') { // 活动日期
return parseTime(value, '{y}-{m}-{d}')
} else if (col.property === 'week') {
return parseTime(row['date'], '周{a}')
} else if (col.property === 'modifyTime') {
return parseTime(value, '{y}-{m}-{d} {h}:{i}:{s}')
} else if (col.property === 'clockInTime' || col.property === 'clockOutTime') {
return parseTime(value)
} else if (col.property === 'employeeName') {
// 判断归属人名字小于 4 个字,少于几个就加几个空格
if (value.length === 2) {
return value + '  ' + '(' + row.employeeNo + ')'
} else if (value.length === 3) {
return value + ' ' + '(' + row.employeeNo + ')'
} else {
return value + '(' + row.employeeNo + ')'
}
} else if (col.property === 'salary' || col.property === 'incidentals') {
return '¥ ' + value + ' 元'
} else {
return value
}
}
// 计算当前行类名
const tableRowTimeOutClassName = () => {
// 检查计划是否能操作
return 'timeout-row'
}
/*************** 数据和分页 ***************/
const total = ref(0)
const pageNum = ref(1)
const pageSize = ref(10)
// 任务列表
const getPlanList = async (arg) => {
if (arg === 'resetPage') pageNum.value = 1
const res = await getPlanListAPI({
pageNum: pageNum.value,
pageSize: pageSize.value,
queryParams: {
activityStartDate: props.queryParams.activityDate && props.queryParams.activityDate[0],
activityEndDate: props.queryParams.activityDate && props.queryParams.activityDate[1],
planStatus: props.queryParams.planStatus,
region: props.queryParams.region,
province: props.queryParams.provinceName,
city: props.queryParams.cityName,
dealerId: props.queryParams.dealerId,
orgQcId: props.queryParams.warZoneId,
employeeId: props.queryParams.employeeId,
storeNameLike: props.queryParams.storeName,
statusType: 'INVALID' // 查询已删除的计划
}
})
tableList.value = res.data.records
total.value = res.data.totalRecord
}
getPlanList()
defineExpose({
getPlanList
})
onMounted(() => {
// 删除任务时,重新请求已删除列表
proxy.eventBus.on('refreshPlanList', getPlanList)
})
onUnmounted(() => {
proxy.eventBus.off('refreshPlanList', getPlanList)
})
</script>
<style scoped
lang="scss">
.el-table {
/* 灰色过期行颜色 */
::v-deep(.timeout-row) {
--el-table-tr-bg-color: var(--el-timeout-row);
}
}
</style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论