提交 6def82e0 authored 作者: lidongxu's avatar lidongxu

Merge branch 'ldx' into dev

...@@ -5,11 +5,11 @@ import { parseTime } from '@/utils' ...@@ -5,11 +5,11 @@ import { parseTime } from '@/utils'
* @returns boolean true 可编辑/删除,false 不可编辑/删除 * @returns boolean true 可编辑/删除,false 不可编辑/删除
*/ */
export const checkPlanExpire = (row) => { export const checkPlanExpire = (row) => {
// 1. 计划日期已经 1 小时后,不可编辑/删除 // 1. 计划已经开始,不可编辑/删除
// 2. 计划未开始,但是上班时间已经 1 小时后,不可编辑/删除
const date = new Date() const date = new Date()
const rowDate = new Date(row.clockInTime) const rowDate = new Date(row.clockInTime)
rowDate.setHours(rowDate.getHours() + 1) rowDate.setHours(rowDate.getHours() + 1)
// 2. 计划状态已经开始了,不可编辑/删除
return !(rowDate < date || row.planStatus === 1) return !(rowDate < date || row.planStatus === 1)
} }
......
...@@ -22,6 +22,7 @@ import elementIcons from '@/components/SvgIcon/svgicon' ...@@ -22,6 +22,7 @@ import elementIcons from '@/components/SvgIcon/svgicon'
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels, isMobile } from '@/utils' import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels, isMobile } from '@/utils'
import { download } from '@/utils/request' import { download } from '@/utils/request'
import { useDict } from '@/utils/dict' import { useDict } from '@/utils/dict'
import { checkPermi } from '@/utils/permission'
import eventBus from '@/utils/eventBus' import eventBus from '@/utils/eventBus'
/****************** 移动端 ******************/ /****************** 移动端 ******************/
...@@ -75,6 +76,7 @@ app.config.globalProperties.addDateRange = addDateRange ...@@ -75,6 +76,7 @@ app.config.globalProperties.addDateRange = addDateRange
app.config.globalProperties.selectDictLabel = selectDictLabel app.config.globalProperties.selectDictLabel = selectDictLabel
app.config.globalProperties.selectDictLabels = selectDictLabels app.config.globalProperties.selectDictLabels = selectDictLabels
app.config.globalProperties.isMobile = isMobile app.config.globalProperties.isMobile = isMobile
app.config.globalProperties.checkPermi = checkPermi
app.config.globalProperties.eventBus = eventBus app.config.globalProperties.eventBus = eventBus
// 全局组件 // 全局组件
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
v-model="item.checked" v-model="item.checked"
shape="square" /> shape="square" />
<van-cell :title="item.storeName" <van-cell :title="item.storeName"
:class="{'plan-deleted': query.isDeleted}" :class="{ 'plan-deleted': query.isDeleted }"
@click="clickDetail(item)"> @click="clickDetail(item)">
<template #label> <template #label>
<p class="employee">{{ item.employeeName }}</p> <p class="employee">{{ item.employeeName }}</p>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
@query="querySearch" /> @query="querySearch" />
<!-- 新增组件(浮动气泡) --> <!-- 新增组件(浮动气泡) -->
<van-floating-bubble icon="plus" <van-floating-bubble icon="plus"
@click="$router.push('/m/promotion_plan_editing')" /> @click="addNewPlan" />
<!-- 底部-长按操作栏 --> <!-- 底部-长按操作栏 -->
<van-action-bar v-show="showSelect"> <van-action-bar v-show="showSelect">
<van-action-bar-button type="default" <van-action-bar-button type="default"
...@@ -89,7 +89,7 @@ defineOptions({ ...@@ -89,7 +89,7 @@ defineOptions({
import userStore from '@/store/modules/user' import userStore from '@/store/modules/user'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { checkPlanExpire } from '@/hooks' import { checkPlanExpire } from '@/hooks'
import { PROMOTION_STATUS,getPromotionActiveStatus } from '@/dicts' import { PROMOTION_STATUS, getPromotionActiveStatus } from '@/dicts'
import { getPlanListAPI, deletePlanAPI, batchUpdatePlanAPI, getChargeListAPI } from '@/api' import { getPlanListAPI, deletePlanAPI, batchUpdatePlanAPI, getChargeListAPI } from '@/api'
import PlanSearch from './planSearch.vue' import PlanSearch from './planSearch.vue'
import PickerBelong from '../components/PickerBelong' import PickerBelong from '../components/PickerBelong'
...@@ -182,7 +182,7 @@ const onRefresh = () => { ...@@ -182,7 +182,7 @@ const onRefresh = () => {
} }
const clickDetail = (row) => { const clickDetail = (row) => {
// 当前处于长按状态 / 查看已删除列表,点击详情不做任何操作 // 当前处于长按状态 / 查看已删除列表,点击详情不做任何操作
if (showSelect.value || query.isDeleted) return if (showSelect.value || query.isDeleted) return
router.push(`/m/promotion_plan_detail/${row.id}?isDeleted=${query.isDeleted}`) router.push(`/m/promotion_plan_detail/${row.id}?isDeleted=${query.isDeleted}`)
} }
...@@ -312,6 +312,15 @@ onUnmounted(() => { ...@@ -312,6 +312,15 @@ onUnmounted(() => {
// 取消订阅事件 // 取消订阅事件
proxy.eventBus.off('delPromotionTaskEvent'); proxy.eventBus.off('delPromotionTaskEvent');
}) })
// 新增计划判断
const addNewPlan = () => {
if (proxy.checkPermi(['promotion:plan:create'])) {
router.push('/m/promotion_plan_editing')
} else {
proxy.$modal.msgWarning('规定日期内_无法新增计划')
}
}
</script> </script>
<style scoped <style scoped
...@@ -351,8 +360,8 @@ onUnmounted(() => { ...@@ -351,8 +360,8 @@ onUnmounted(() => {
} }
.van-cell { .van-cell {
&.plan-deleted{ &.plan-deleted {
background-color: rgb(235,235,235); background-color: rgb(235, 235, 235);
} }
.van-cell__label { .van-cell__label {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论