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

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

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