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

fix(mobile/plan): 修复城市经理只能默认看到自己,添加和查询自己的需求

同上
上级 6ae9746a
......@@ -60,7 +60,7 @@
defineOptions({
name: 'm_promotion_plan'
})
import userStore from '@/store/modules/user'
import { parseTime } from '@/utils'
import { checkPlanExpire } from '@/hooks'
import { getPromotionActiveStatus } from '@/dicts'
......@@ -69,6 +69,8 @@ import PlanSearch from './plan-search.vue'
const { proxy } = getCurrentInstance();
const router = useRouter()
const promotionIdentity = computed(() => userStore().promotionIdentity)
const employeeNo = computed(() => userStore().employeeNo)
// 搜索弹窗
const showSearch = ref(false)
......@@ -108,20 +110,19 @@ const getEmployeeList = async () => {
}
})
}
getEmployeeList()
const getPlanList = async ({activityStartDate, activityEndDate, planStatus, employeeId, storeNameLike} = {}) => {
const getPlanList = async ({ activityStartDate, activityEndDate, planStatus, employeeId, storeNameLike } = {}) => {
const res = await getPlanListAPI({
...query,
queryParams: {
activityStartDate: parseTime(activityStartDate, "{y}-{m}-{d}"),
activityEndDate: parseTime(activityEndDate, "{y}-{m}-{d}"),
planStatus: planColumns.find(item => item.text === planStatus)?.value,
employeeId,
employeeId: promotionIdentity.value ? allEmpolyeeList.value.find(o => o.employeeNo === employeeNo.value)?.value : employeeId,
storeNameLike
},
})
if (loading.value) {
planList.value = [...planList.value, ...res.data.records]
finished.value = res.data.records.length === 0
......@@ -130,7 +131,7 @@ const getPlanList = async ({activityStartDate, activityEndDate, planStatus, empl
planList.value = res.data.records
}
}
getPlanList()
const onLoad = () => {
loading.value = true
......@@ -164,7 +165,7 @@ const deletePlan = (row) => {
proxy.$modal.confirm(`确认删除计划吗?`).then(async () => {
await deletePlanAPI({
planIds: [row.id],
employeeNo: useuserStore().employeeNo
employeeNo: employeeNo.value
})
proxy.$modal.msgSuccess('删除成功')
// 找到 row 在数组里第几条删除
......@@ -173,6 +174,11 @@ const deletePlan = (row) => {
})
}
const init = async () => {
await getEmployeeList()
getPlanList()
}
init()
</script>
<style scoped
......@@ -190,13 +196,11 @@ const deletePlan = (row) => {
.van-cell {
margin-top: 10px;
::v-deep(.van-cell__label) {
.van-cell__label {
font-size: 14px !important;
}
::v-deep(.employee) {
.employee {
margin-bottom: 5px !important;
}
......@@ -209,7 +213,7 @@ const deletePlan = (row) => {
}
}
::v-deep(.van-swipe-cell__right) {
.van-swipe-cell__right {
display: flex;
button {
......
......@@ -161,6 +161,7 @@ watch(() => props.allEmpolyeeList, (newValue) => {
query.employeeId = obj.value
}
})
// 搜索归属人
const searchEmployee = (searchName) => {
showEmployeeList.value = props.allEmpolyeeList.filter(item => {
return item.text.includes(searchName)
......@@ -182,7 +183,7 @@ const resetFn = () => {
query.activityStartDate = ''
query.activityEndDate = ''
query.planStatus = ''
query.employeeId = ''
!promotionIdentity.value && (query.employeeId = '')
query.storeNameLike = ''
}
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论