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

Merge branch 'dev'

...@@ -31,3 +31,20 @@ export const PROMOTION_ACTIVITY_MODE_LIST = [ ...@@ -31,3 +31,20 @@ export const PROMOTION_ACTIVITY_MODE_LIST = [
value: '校园活动' value: '校园活动'
} }
] ]
// 促销任务状态
export const PROMOTION_TASK_STATUS_LIST = [
{
label: '未审批',
value: 'SUBMITTED'
},
{
label: '已审批',
value: 'APPROVED'
},
{
label: '全部数据',
value: ''
}
]
\ No newline at end of file
import { parseTime } from '@/utils'
/** /**
* 判断计划是否可编辑/删除 * 判断计划是否可编辑/删除
* @param {*} row 计划信息对象 * @param {*} row 计划信息对象
...@@ -11,3 +12,15 @@ export const checkPlanExpire = (row) => { ...@@ -11,3 +12,15 @@ export const checkPlanExpire = (row) => {
// 2. 计划状态已经开始了,不可编辑/删除 // 2. 计划状态已经开始了,不可编辑/删除
return !(rowDate < date || row.planStatus === 1) return !(rowDate < date || row.planStatus === 1)
} }
/**
* 判断任务是否可删除
* @param {*} row 计划信息对象
* @returns boolean true 展示删除按钮,false 不展示删除按钮
*/
export const checkTaskExpire = (row) => {
// 上报日期不是当月则隐藏按钮
const date = parseTime(row.createDate, '{y}-{m}')
const currentDate = parseTime(new Date(), '{y}-{m}')
return date === currentDate
}
\ No newline at end of file
...@@ -186,6 +186,8 @@ import { parseTime } from '@/utils' ...@@ -186,6 +186,8 @@ import { parseTime } from '@/utils'
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const employeeNo = userStore().empInfo.empNo; // 员工工号
const form = ref({ const form = ref({
storePicture: [], // 店铺门头照 storePicture: [], // 店铺门头照
temNum: null, // 促销员数量 temNum: null, // 促销员数量
...@@ -231,7 +233,7 @@ const decreaseCount = async () => { ...@@ -231,7 +233,7 @@ const decreaseCount = async () => {
temNum: form.value.temNum - 1, temNum: form.value.temNum - 1,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
form.value.temNum--; form.value.temNum--;
} }
...@@ -243,7 +245,7 @@ const increaseCount = async () => { ...@@ -243,7 +245,7 @@ const increaseCount = async () => {
temNum: form.value.temNum + 1, temNum: form.value.temNum + 1,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
form.value.temNum++; form.value.temNum++;
}; };
...@@ -302,14 +304,14 @@ const storePictureRead = async (file) => { ...@@ -302,14 +304,14 @@ const storePictureRead = async (file) => {
const date = new Date() const date = new Date()
const month = date.getMonth() + 1 const month = date.getMonth() + 1
const theDate = date.getDate() const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${userStore().employeeNo}/${uuidv4()}.png`, file.file) const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
await createExamine({ await createExamine({
id: form.value.id, id: form.value.id,
storePicture: pictureUrl, storePicture: pictureUrl,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
// 删除店铺门头照 // 删除店铺门头照
...@@ -319,7 +321,7 @@ const deleteStorePicture = async () => { ...@@ -319,7 +321,7 @@ const deleteStorePicture = async () => {
storePicture: '', storePicture: '',
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -331,7 +333,7 @@ const planStatusChange = async (val) => { ...@@ -331,7 +333,7 @@ const planStatusChange = async (val) => {
planStatus: form.value.planStatus, planStatus: form.value.planStatus,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -342,7 +344,7 @@ const changeStoreDd = async () => { ...@@ -342,7 +344,7 @@ const changeStoreDd = async () => {
storeDd: form.value.storeDd, storeDd: form.value.storeDd,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -357,7 +359,7 @@ const changeTemOnWork = async () => { ...@@ -357,7 +359,7 @@ const changeTemOnWork = async () => {
temOnWork: form.value.temOnWork, temOnWork: form.value.temOnWork,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
const changeTemOnWorkTimeRange = () => { const changeTemOnWorkTimeRange = () => {
...@@ -378,7 +380,7 @@ const changeTemHs = async () => { ...@@ -378,7 +380,7 @@ const changeTemHs = async () => {
temHs: form.value.temHs, temHs: form.value.temHs,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
const changeTemWl = async () => { const changeTemWl = async () => {
...@@ -387,7 +389,7 @@ const changeTemWl = async () => { ...@@ -387,7 +389,7 @@ const changeTemWl = async () => {
temWl: form.value.temWl, temWl: form.value.temWl,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
const changeTemZz = async () => { const changeTemZz = async () => {
...@@ -396,7 +398,7 @@ const changeTemZz = async () => { ...@@ -396,7 +398,7 @@ const changeTemZz = async () => {
temZz: form.value.temZz, temZz: form.value.temZz,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -406,7 +408,7 @@ const temWorkPhotosRead = async (file) => { ...@@ -406,7 +408,7 @@ const temWorkPhotosRead = async (file) => {
const date = new Date() const date = new Date()
const month = date.getMonth() + 1 const month = date.getMonth() + 1
const theDate = date.getDate() const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${userStore().employeeNo}/${uuidv4()}.png`, file.file) const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
// 如果当前对象包含 objectUrl 则是组件上传的,替换当前元素的对象 // 如果当前对象包含 objectUrl 则是组件上传的,替换当前元素的对象
const index = form.value.temWorkPhotos.findIndex(o => o.objectUrl) const index = form.value.temWorkPhotos.findIndex(o => o.objectUrl)
form.value.temWorkPhotos[index] = { form.value.temWorkPhotos[index] = {
...@@ -418,7 +420,7 @@ const temWorkPhotosRead = async (file) => { ...@@ -418,7 +420,7 @@ const temWorkPhotosRead = async (file) => {
temWorkPhotos: form.value.temWorkPhotos.map(o => o.url), temWorkPhotos: form.value.temWorkPhotos.map(o => o.url),
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -429,7 +431,7 @@ const deleteTemWorkPhotos = async () => { ...@@ -429,7 +431,7 @@ const deleteTemWorkPhotos = async () => {
temWorkPhotos: form.value.temWorkPhotos.map(o => o.url), temWorkPhotos: form.value.temWorkPhotos.map(o => o.url),
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -439,14 +441,14 @@ const storeTcPhotoRead = async (file) => { ...@@ -439,14 +441,14 @@ const storeTcPhotoRead = async (file) => {
const date = new Date() const date = new Date()
const month = date.getMonth() + 1 const month = date.getMonth() + 1
const theDate = date.getDate() const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${userStore().employeeNo}/${uuidv4()}.png`, file.file) const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
await createExamine({ await createExamine({
id: form.value.id, id: form.value.id,
storeTcPhoto: pictureUrl, storeTcPhoto: pictureUrl,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -457,7 +459,7 @@ const deleteStoreTcPhoto = async () => { ...@@ -457,7 +459,7 @@ const deleteStoreTcPhoto = async () => {
storeTcPhoto: '', storeTcPhoto: '',
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -467,14 +469,14 @@ const temOnWorkPictureRead = async (file) => { ...@@ -467,14 +469,14 @@ const temOnWorkPictureRead = async (file) => {
const date = new Date() const date = new Date()
const month = date.getMonth() + 1 const month = date.getMonth() + 1
const theDate = date.getDate() const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${userStore().employeeNo}/${uuidv4()}.png`, file.file) const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
await createExamine({ await createExamine({
id: form.value.id, id: form.value.id,
storeZhjPhoto: pictureUrl, storeZhjPhoto: pictureUrl,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
// 删除主货架照片 // 删除主货架照片
...@@ -484,7 +486,7 @@ const deleteStoreZhjPhoto = async () => { ...@@ -484,7 +486,7 @@ const deleteStoreZhjPhoto = async () => {
storeZhjPhoto: '', storeZhjPhoto: '',
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -494,7 +496,7 @@ const posPhotosRead = async (file) => { ...@@ -494,7 +496,7 @@ const posPhotosRead = async (file) => {
const date = new Date() const date = new Date()
const month = date.getMonth() + 1 const month = date.getMonth() + 1
const theDate = date.getDate() const theDate = date.getDate()
const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${userStore().employeeNo}/${uuidv4()}.png`, file.file) const pictureUrl = await uploadFileToOSSAPI(`examine/${date.getFullYear()}-${month}/${theDate}/${planId.value}/${employeeNo}/${uuidv4()}.png`, file.file)
// 判断 objectUrl // 判断 objectUrl
const index = form.value.posPhotos.findIndex(o => o.objectUrl) const index = form.value.posPhotos.findIndex(o => o.objectUrl)
form.value.posPhotos[index] = { form.value.posPhotos[index] = {
...@@ -506,7 +508,7 @@ const posPhotosRead = async (file) => { ...@@ -506,7 +508,7 @@ const posPhotosRead = async (file) => {
posPhotos: form.value.posPhotos.map(o => o.url), posPhotos: form.value.posPhotos.map(o => o.url),
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
// 删除 POS 照片 // 删除 POS 照片
...@@ -516,7 +518,7 @@ const deletePosPhotos = async () => { ...@@ -516,7 +518,7 @@ const deletePosPhotos = async () => {
posPhotos: form.value.posPhotos.map(o => o.url), posPhotos: form.value.posPhotos.map(o => o.url),
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
...@@ -527,7 +529,7 @@ const posRmbChange = async () => { ...@@ -527,7 +529,7 @@ const posRmbChange = async () => {
posRmb: form.value.posRmb || 0, posRmb: form.value.posRmb || 0,
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: employeeNo, // 稽查人工号
}) })
} }
......
...@@ -205,7 +205,7 @@ const clickExamine = async () => { ...@@ -205,7 +205,7 @@ const clickExamine = async () => {
planStatus: planDetail.value.planStatus === 0 ? '否' : '是', planStatus: planDetail.value.planStatus === 0 ? '否' : '是',
employeeId: userStore().userInfo.userId, // 稽查人id employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字 employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号 employeeNo: userStore().userInfo.userName, // 稽查人工号
}) })
if (!result.data) { if (!result.data) {
return proxy.$modal.msgError('创建稽查任务失败') return proxy.$modal.msgError('创建稽查任务失败')
......
...@@ -169,7 +169,6 @@ import PickerBelong from '../components/PickerBelong' ...@@ -169,7 +169,6 @@ import PickerBelong from '../components/PickerBelong'
const myForm = ref({}) const myForm = ref({})
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const employeeNo = computed(() => userStore().employeeNo)
const empInfo = userStore().empInfo const empInfo = userStore().empInfo
const isCityManager = ref(userStore().promotionIdentity) const isCityManager = ref(userStore().promotionIdentity)
const form = reactive({}) const form = reactive({})
......
...@@ -97,8 +97,7 @@ import PickerBelong from '../components/PickerBelong' ...@@ -97,8 +97,7 @@ import PickerBelong from '../components/PickerBelong'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const promotionIdentity = computed(() => userStore().promotionIdentity) const isCityManager = userStore().promotionIdentity
const employeeNo = computed(() => userStore().employeeNo)
const empInfo = userStore().empInfo const empInfo = userStore().empInfo
// 搜索弹窗 // 搜索弹窗
...@@ -153,7 +152,7 @@ const getPlanList = async () => { ...@@ -153,7 +152,7 @@ const getPlanList = async () => {
activityStartDate: parseTime(query.activityStartDate, "{y}-{m}-{d}"), activityStartDate: parseTime(query.activityStartDate, "{y}-{m}-{d}"),
activityEndDate: parseTime(query.activityEndDate, "{y}-{m}-{d}"), activityEndDate: parseTime(query.activityEndDate, "{y}-{m}-{d}"),
planStatus: planColumns.find(item => item.text === query.planStatus)?.value, planStatus: planColumns.find(item => item.text === query.planStatus)?.value,
employeeId: promotionIdentity.value ? allEmpolyeeList.value.find(o => o.employeeNo === employeeNo.value)?.value : query.employeeId, employeeId: isCityManager ? allEmpolyeeList.value.find(o => o.employeeNo === empInfo.empNo)?.value : query.employeeId,
storeNameLike: query.storeNameLike, storeNameLike: query.storeNameLike,
statusType: query.isDeleted statusType: query.isDeleted
}, },
...@@ -211,7 +210,7 @@ const deletePlan = (row) => { ...@@ -211,7 +210,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: employeeNo.value employeeNo: empInfo.empNo
}) })
proxy.$modal.msgSuccess('删除成功') proxy.$modal.msgSuccess('删除成功')
// 重新获取列表 // 重新获取列表
...@@ -248,7 +247,7 @@ const clickDelSome = () => { ...@@ -248,7 +247,7 @@ const clickDelSome = () => {
} }
await deletePlanAPI({ await deletePlanAPI({
planIds: ids, planIds: ids,
employeeNo: employeeNo.value employeeNo: empInfo.empNo
}) })
proxy.$modal.msgSuccess('删除成功') proxy.$modal.msgSuccess('删除成功')
showSelect.value = false showSelect.value = false
......
...@@ -156,8 +156,8 @@ const showEmployee = ref(false) ...@@ -156,8 +156,8 @@ const showEmployee = ref(false)
// 如果是城市经理,设置默认归属人 // 如果是城市经理,设置默认归属人
watch(() => props.allEmpolyeeList, (newVal) => { 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.employeeName = newVal.find(o => o.employeeNo === userStore().userInfo.userName)?.text
props.query.employeeId = newVal.find(o => o.employeeNo === userStore().employeeNo)?.value props.query.employeeId = newVal.find(o => o.employeeNo === userStore().userInfo.userName)?.value
} }
}) })
......
...@@ -110,10 +110,6 @@ export default defineStore( ...@@ -110,10 +110,6 @@ export default defineStore(
empNo: state.userInfo.userName, // 员工工号 empNo: state.userInfo.userName, // 员工工号
empName: state.userInfo.nickName, // 员工昵称名字 empName: state.userInfo.nickName, // 员工昵称名字
} }
},
// 获取员工工号
employeeNo(state) {
return state.userInfo.userName
} }
} }
}) })
......
...@@ -36,18 +36,8 @@ ...@@ -36,18 +36,8 @@
<script setup> <script setup>
import { getLiveCate, uploadLiveCate } from '@/api' import { getLiveCate, uploadLiveCate } from '@/api'
import { ElMessage } from 'element-plus'
const tableData = ref([]) const { proxy } = getCurrentInstance()
const queryParams = ref({
zbjQdType: ''
})
const getCate = async () => {
const res = await getLiveCate(queryParams.value)
tableData.value = res.data
}
getCate()
// 覆盖上传直播间分类表格 // 覆盖上传直播间分类表格
const uploadExcel = () => { const uploadExcel = () => {
...@@ -62,16 +52,23 @@ const uploadExcel = () => { ...@@ -62,16 +52,23 @@ const uploadExcel = () => {
const formData = new FormData(); const formData = new FormData();
formData.append('file', file); formData.append('file', file);
const res = await uploadLiveCate(formData) const res = await uploadLiveCate(formData)
ElMessage.success(res.data) proxy.$modal.msgSuccess(res.data)
} }
}); });
document.body.appendChild(fileInput); document.body.appendChild(fileInput);
fileInput.click() fileInput.click()
} }
</script>
<style scoped /************ 直播间分类列表 *******************/
lang="sass"> const tableData = ref([])
const queryParams = reactive({
zbjQdType: ''
})
const getCate = async () => {
const res = await getLiveCate(queryParams)
tableData.value = res.data
}
getCate()
</style>
\ No newline at end of file </script>
...@@ -303,7 +303,6 @@ import { getObjValueByPath, formatNumberWithUnit, deepClone, parseTime } from '@ ...@@ -303,7 +303,6 @@ import { getObjValueByPath, formatNumberWithUnit, deepClone, parseTime } from '@
import LineChart from './LineChart.vue'; import LineChart from './LineChart.vue';
import gsap from 'gsap' import gsap from 'gsap'
import { useDatePickerOptions } from '@/hooks' import { useDatePickerOptions } from '@/hooks'
import { ElMessage } from 'element-plus';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const dict = proxy.useDict("sale_platform") const dict = proxy.useDict("sale_platform")
...@@ -584,7 +583,7 @@ const submitUploadDemandFn = async () => { ...@@ -584,7 +583,7 @@ const submitUploadDemandFn = async () => {
fd.append('file', uploadDemand.file) fd.append('file', uploadDemand.file)
fd.append('year', uploadDemand.year.getFullYear()) fd.append('year', uploadDemand.year.getFullYear())
const res = await uploadDemandImportAPI(fd) const res = await uploadDemandImportAPI(fd)
ElMessage.success(res.msg) proxy.$modal.msgSuccess(res.msg)
uploadDemandImportVisible.value = false uploadDemandImportVisible.value = false
} }
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
</template> </template>
<script setup> <script setup>
import { ElMessage } from 'element-plus'
import { enterOtherReportAPI, getReportFolderListAPI } from '@/api' import { enterOtherReportAPI, getReportFolderListAPI } from '@/api'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
...@@ -84,7 +83,7 @@ const handleSubmit = async () => { ...@@ -84,7 +83,7 @@ const handleSubmit = async () => {
if (valid) { if (valid) {
// 表单验证通过,进行提交操作 // 表单验证通过,进行提交操作
await enterOtherReportAPI(form.value) await enterOtherReportAPI(form.value)
ElMessage.success('提交成功') proxy.$modal.msgSuccess('提交成功')
// 清空表单 // 清空表单
form.value = { form.value = {
id: '', id: '',
......
<template>
<el-row>
<el-form-item label="区域查询"
prop="region">
<el-radio-group v-model="queryParams.region"
@change="changeRegion">
<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="provinceId"
v-show="queryParams.region !== '全国'">
<el-select v-model="queryParams.provinceId"
placeholder="请选择省"
@change="selProvince"
filterable
clearable>
<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="cityId"
v-show="queryParams.region === '省-市'">
<el-select v-model="queryParams.cityId"
placeholder="请选择市"
@change="selCity"
filterable
clearable>
<el-option v-for="item in cityList"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-row>
</template>
<script setup>
import { getProCityAPI } from '@/api'
const props = defineProps({
queryParams: {
type: Object,
default: () => ({})
}
})
const emits = defineEmits(["change"])
const provinceList = ref([])
const cityList = ref([])
const getProCityList = async () => {
const { data } = await getProCityAPI(props.queryParams)
const list = data.map(item => ({
label: item.name,
value: item.num
}))
props.queryParams.provinceId ? (cityList.value = list) : (provinceList.value = list)
}
getProCityList()
// 切换省市范围
const changeRegion = async () => {
if (props.queryParams.region === '全国') {
props.queryParams.provinceId = ''
props.queryParams.provinceName = ''
props.queryParams.cityId = ''
props.queryParams.cityName = ''
} else if (props.queryParams.region === '省') {
props.queryParams.cityId = ''
props.queryParams.cityName = ''
}
emits('change')
}
// 选择省
const selProvince = async () => {
// 设置省名
props.queryParams.provinceName = provinceList.value.find(item => item.value === props.queryParams.provinceId)?.label
// 重置城市
props.queryParams.cityId = ''
props.queryParams.cityName = ''
cityList.value = []
// 重新获取城市列表以及查询列表
getProCityList()
emits('change')
}
// 选择市
const selCity = async () => {
// 设置市名
props.queryParams.cityName = cityList.value.find(item => item.value === props.queryParams.cityId)?.label
// 重新获取查询列表
emits('change')
}
</script>
\ No newline at end of file
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<div class="container"> <div class="container">
<!-- 数据表格 --> <!-- 数据表格 -->
<el-table :data="tableList" <el-table :data="tableList"
:cell-style="{ 'word-wrap': 'break-word', 'white-space': 'normal' }"
border border
style="width: 100%"> style="width: 100%">
<el-table-column v-for="item in columns" <el-table-column v-for="item in columns"
...@@ -19,38 +18,33 @@ ...@@ -19,38 +18,33 @@
<el-image :preview-src-list="[scope.row[item.prop]]" <el-image :preview-src-list="[scope.row[item.prop]]"
preview-teleported preview-teleported
:src="scope.row[item.prop]" :src="scope.row[item.prop]"
alt="图片" alt="图片" />
style="width: 100px; height: 100px;" />
</template> </template>
<template v-else-if="item.prop === 'temWorkPhotos'"> <template v-else-if="item.prop === 'temWorkPhotos'">
<el-image :preview-src-list="[item]" <el-image :preview-src-list="[item]"
preview-teleported preview-teleported
v-for="item in JSON.parse(scope.row[item.prop])" v-for="item in JSON.parse(scope.row[item.prop])"
:src="item" :src="item"
alt="图片" alt="图片" />
style="width: 100px; height: 100px; margin-right: 10px;" />
</template> </template>
<template v-else-if="item.prop === 'storeTcPhoto'"> <template v-else-if="item.prop === 'storeTcPhoto'">
<el-image :preview-src-list="[scope.row[item.prop]]" <el-image :preview-src-list="[scope.row[item.prop]]"
preview-teleported preview-teleported
:src="scope.row[item.prop]" :src="scope.row[item.prop]"
alt="图片" alt="图片" />
style="width: 100px; height: 100px;" />
</template> </template>
<template v-else-if="item.prop === 'storeZhjPhoto'"> <template v-else-if="item.prop === 'storeZhjPhoto'">
<el-image :preview-src-list="[scope.row[item.prop]]" <el-image :preview-src-list="[scope.row[item.prop]]"
preview-teleported preview-teleported
:src="scope.row[item.prop]" :src="scope.row[item.prop]"
alt="图片" alt="图片" />
style="width: 100px; height: 100px;" />
</template> </template>
<template v-else-if="item.prop === 'posPhotos'"> <template v-else-if="item.prop === 'posPhotos'">
<el-image :preview-src-list="[item]" <el-image :preview-src-list="[item]"
preview-teleported preview-teleported
v-for="item in JSON.parse(scope.row[item.prop])" v-for="item in JSON.parse(scope.row[item.prop])"
:src="item" :src="item"
alt="图片" alt="图片" />
style="width: 100px; height: 100px; margin-right: 10px;" />
</template> </template>
<template v-else> <template v-else>
<!-- 其他字段显示原始值 --> <!-- 其他字段显示原始值 -->
...@@ -75,129 +69,22 @@ ...@@ -75,129 +69,22 @@
v-model:page="queryParams.page" v-model:page="queryParams.page"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getTaskList" /> @pagination="getTaskList" />
<!-- 照片查看弹窗 -->
<el-dialog :title="photoLookInfoObj.storeName"
v-model="photoDialogVisible"
width="60%">
<p>活动记录 ID :{{ photoLookInfoObj.id }}</p>
<p>活动时间 :{{ photoLookInfoObj.createDate }}</p>
<el-card v-for="obj in photoDialogList"
shadow="never">
<template #header>{{ obj.title }}</template>
<div class="content">
<el-result :title="item.time"
:sub-title="item.title"
v-for="item in obj.list">
<template #icon>
<el-image :src="item.photoUrl"
:preview-src-list="[...obj.list.map(o => o.photoUrl)]" />
</template>
</el-result>
</div>
</el-card>
</el-dialog>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue'
import { useDatePickerOptions } from '@/hooks'
import { getWarZoneListAPI, getChargeListAPI, getTaskListAPI, getProCityAPI, deletePromotionSystemAPI, getPromotionSystemAPI, getPromotionActivityAPI, getExamineList } from '@/api' import { getWarZoneListAPI, getChargeListAPI, getTaskListAPI, getProCityAPI, deletePromotionSystemAPI, getPromotionSystemAPI, getPromotionActivityAPI, getExamineList } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import store from '@/store'
import { ElMessage, ElMessageBox } from 'element-plus';
const { recentPickerOptions: pickerOptions, last7Date, todayDate } = useDatePickerOptions(0) const { proxy } = getCurrentInstance()
/******************** 任务列表 ********************/
const queryParams = reactive({ const queryParams = reactive({
taskStatus: '全部',
region: '全国',
provinceId: undefined,
cityId: undefined,
zoneId: undefined,
managerId: undefined,
storeName: undefined,
page: 1, page: 1,
pageSize: 10, pageSize: 10
date: []
}) })
const photoDialogVisible = ref(false)
const photoDialogList = ref([])
const photoLookInfoObj = ref({})
const total = ref(0) const total = ref(0)
// 城市经理状态为 true
const cityManagerPrivilege = computed(() => {
return store.state?.value?.user?.userInfo?.privilegeId == 1
})
// 任务状态
const taskStatusList = ref([
{
label: '是',
value: '是'
},
{
label: '否',
value: '否'
},
{
label: '全部',
value: '全部'
}
])
// 区域查询
const provinceList = ref([])
const cityList = ref([])
const getProCity = async () => {
const { data } = await getProCityAPI(queryParams)
if (queryParams.provinceId) {
queryParams.cityId = undefined
cityList.value = data.map(item => ({
label: item.name,
value: item.num
}))
} else {
provinceList.value = data.map(item => ({
label: item.name,
value: item.num
}))
}
getTaskList()
}
getProCity()
// 战区列表
const zoneList = ref([])
const getZoneList = async () => {
const { data } = await getWarZoneListAPI()
zoneList.value = data.map(item => {
return {
label: item.orgName,
value: item.qcId
}
})
}
getZoneList()
// 负责人列表
const managerList = ref([])
const getManagerList = async () => {
const { data } = await getChargeListAPI()
managerList.value = data.map(item => {
return {
label: item.name,
value: item.id,
employeeNo: item.employeeNo,
deptQcName: item.deptQcName,
deptQcId: item.deptQcId
}
})
}
getManagerList()
// 任务列表
const tableList = ref([]) const tableList = ref([])
const columns = ref([ const columns = ref([
{ {
...@@ -353,19 +240,6 @@ const columns = ref([ ...@@ -353,19 +240,6 @@ const columns = ref([
} }
]) ])
// 删除任务列表
const deleteView = async (row) => {
await ElMessageBox.confirm('确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
await deletePromotionSystemAPI(row.id)
// 提示删除成功
getTaskList()
ElMessage.success('删除成功')
}
// 获取稽核任务列表 // 获取稽核任务列表
const getTaskList = async () => { const getTaskList = async () => {
const { data: { records, totalRecord } } = await getExamineList(queryParams) const { data: { records, totalRecord } } = await getExamineList(queryParams)
...@@ -375,167 +249,28 @@ const getTaskList = async () => { ...@@ -375,167 +249,28 @@ const getTaskList = async () => {
getTaskList() getTaskList()
const formatter = (row, columns, value) => { const formatter = (row, columns, value) => {
// 判断有值再转换 // 判断有值再转换
if (columns.property === 'planDate' || columns.property === 'createDate' || columns.property === 'createTime' || columns.property === 'mobifyTime') { if (columns.property === 'planDate' || columns.property === 'createDate' || columns.property === 'createTime' || columns.property === 'mobifyTime') {
return parseTime(value, '{y}-{m}-{d}') return parseTime(value, '{y}-{m}-{d}')
} else { } else {
return value return value
} }
}
// 区域查询切换
const regionChange = (val) => {
if (val === '全国') {
queryParams.provinceId = undefined
queryParams.cityId = undefined
} else if (val === '省') {
queryParams.cityId = undefined
} else if (val === '省-市') {
cityList.value = []
getProCity()
}
getTaskList()
}
// 查看照片
const lookPhoto = async (row) => {
photoDialogVisible.value = true
photoLookInfoObj.value = row
const result = await getPromotionActivityAPI(row.id)
const { tgcjPhotoInfos: tgcjPhotoInfosList, tghdPhotoInfos: tghdPhotoInfosList, tgscPhotoInfos: tgscPhotoInfosList } = result.data
if (tgscPhotoInfosList) {
var tgscPhotoInfos = [...tgscPhotoInfosList?.map(item => ({
time: parseTime(item.createTime, '{h}:{i}'),
photoUrl: item.photoUrl
}))]
}
if (tghdPhotoInfosList) {
var tghdPhotoInfos = [...tghdPhotoInfosList?.map(item => ({
time: parseTime(item.createTime, '{h}:{i}'),
photoUrl: item.photoUrl
}))]
}
if (tgcjPhotoInfosList) {
var tgcjPhotoInfos = [...tgcjPhotoInfosList?.map(item => ({
time: parseTime(item.createTime, '{h}:{i}'),
photoUrl: item.photoUrl
}))]
}
const res = await getPromotionSystemAPI(row.clockDto.id)
// 判断上班卡,午休下班卡,午休上班卡,下班卡是否有值,有则添加到数组中
// 数组是二维数组,第一到三是推广数据,第四个是打卡数据
const { clockInTime, noonClockOutTime, noonClockInTime, clockOutTime } = res.data
const clockList = []
if (clockInTime) {
clockList.push({
time: parseTime(clockInTime, '{h}:{i}'),
title: '上班卡',
photoUrl: res.data.clockInPhoto
})
}
if (noonClockOutTime) {
clockList.push({
time: parseTime(noonClockOutTime, '{h}:{i}'),
title: '午休下班卡',
photoUrl: res.data.noonClockOutPhoto
})
}
if (noonClockInTime) {
clockList.push({
time: parseTime(noonClockInTime, '{h}:{i}'),
title: '午休上班卡',
photoUrl: res.data.noonClockInPhoto
})
}
if (clockOutTime) {
clockList.push({
time: parseTime(clockOutTime, '{h}:{i}'),
title: '下班卡',
photoUrl: res.data.clockOutPhoto
})
}
// 组装数据
photoDialogList.value = [{
title: '推广试吃照片',
list: tgscPhotoInfos
}, {
title: '推广互动照片',
list: tghdPhotoInfos
}, {
title: '推广成交照片',
list: tgcjPhotoInfos
}, {
title: '考勤打卡照片',
list: clockList
}]
} }
// 分页
const currentChange = (page) => { const currentChange = (page) => {
queryParams.page = page queryParams.page = page
getTaskList() getTaskList()
} }
</script> </script>
<style scoped <style scoped
lang="scss"> lang="scss">
::v-deep(.el-form-item) { ::v-deep(.el-image) {
width: 350px !important; img {
} width: 80px !important;
height: 50px !important;
.el-card {
margin-top: 20px;
}
/* 单元格支持 \n 换行 */
.container .el-table ::v-deep(.cell) {
/* white-space: pre-line; */
/* 强制显示 2 行,超出的省略号 */
/* overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical; */
}
::v-deep(.el-overlay) {
.el-card__body {
.content {
/* display: flex; */
overflow-y: hidden;
overflow-x: scroll;
white-space: nowrap;
/* 阻止内容换行 */
&::-webkit-scrollbar-track {
background: transparent;
/* 滚动条轨道背景透明 */
} }
.el-result {
width: 250px;
height: 350px;
display: inline-block;
.el-result__icon {
width: 100%;
height: 100%;
} }
.el-image {
width: 100%;
height: 100%;
}
}
}
}
}
</style> </style>
...@@ -32,48 +32,8 @@ ...@@ -32,48 +32,8 @@
</el-form-item> </el-form-item>
</el-row> </el-row>
<!-- 省市 --> <!-- 省市 -->
<el-row> <SelectProvinceCity :queryParams="queryParams"
<el-form-item label="区域查询" @change="getPlanList" />
prop="region">
<el-radio-group v-model="queryParams.region"
@change="changeRegion">
<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="provinceId"
v-show="queryParams.region !== '全国'">
<el-select v-model="queryParams.provinceId"
placeholder="请选择省"
@change="selProvince"
filterable
clearable>
<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="cityId"
v-show="queryParams.region === '省-市'">
<el-select v-model="queryParams.cityId"
placeholder="请选择市"
@change="selCity"
filterable
clearable>
<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-row>
<el-form-item label="经销商" <el-form-item label="经销商"
prop="dealerId"> prop="dealerId">
...@@ -142,11 +102,12 @@ ...@@ -142,11 +102,12 @@
</template> </template>
<script setup> <script setup>
import { getProCityAPI, getDealerListAPI, getWarZoneListAPI, getChargeListAPI } from '@/api' import { getDealerListAPI, getWarZoneListAPI, getChargeListAPI } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import userStore from '@/store/modules/user' import userStore from '@/store/modules/user'
import { useDatePickerOptions } from '@/hooks' import { useDatePickerOptions } from '@/hooks'
import { PROMOTION_STATUS } from '@/dicts' import { PROMOTION_STATUS } from '@/dicts'
import SelectProvinceCity from '../components/SelectProvinceCity'
import EffectivePlan from './effectivePlan.vue' import EffectivePlan from './effectivePlan.vue'
import InvalidPlan from './invalidPlan.vue' import InvalidPlan from './invalidPlan.vue'
...@@ -178,51 +139,6 @@ const selActivityDate = () => { ...@@ -178,51 +139,6 @@ const selActivityDate = () => {
/************* 选择状态 *************/ /************* 选择状态 *************/
const taskStatusList = ref(Object.values(PROMOTION_STATUS)) const taskStatusList = ref(Object.values(PROMOTION_STATUS))
/************* 区域查询 *************/
const provinceList = ref([])
const cityList = ref([])
const getProCityList = async () => {
const { data } = await getProCityAPI(queryParams)
const list = data.map(item => ({
label: item.name,
value: item.num
}))
queryParams.provinceId ? (cityList.value = list) : (provinceList.value = list)
}
getProCityList()
// 切换省市范围
const changeRegion = async () => {
if (queryParams.region === '全国') {
queryParams.provinceId = ''
queryParams.provinceName = ''
queryParams.cityId = ''
queryParams.cityName = ''
} else if (queryParams.region === '省') {
queryParams.cityId = ''
queryParams.cityName = ''
}
getPlanList()
}
// 选择省
const selProvince = async () => {
// 设置省名
queryParams.provinceName = provinceList.value.find(item => item.value === queryParams.provinceId)?.label
// 重置城市
queryParams.cityId = ''
queryParams.cityName = ''
cityList.value = []
// 重新获取城市列表以及查询列表
getProCityList()
getPlanList()
}
// 选择市
const selCity = async () => {
// 设置市名
queryParams.cityName = cityList.value.find(item => item.value === queryParams.cityId)?.label
// 重新获取查询列表
getPlanList()
}
/*************** 经销商 ***************/ /*************** 经销商 ***************/
const dealerList = ref([]) const dealerList = ref([])
const getDealerList = async () => { const getDealerList = async () => {
...@@ -286,3 +202,10 @@ const getPlanList = () => { ...@@ -286,3 +202,10 @@ const getPlanList = () => {
proxy.$refs.invalidPlan.getPlanList('resetPage') proxy.$refs.invalidPlan.getPlanList('resetPage')
} }
</script> </script>
<style scoped
lang="scss">
::v-deep(.el-form-item) {
width: 350px !important;
}
</style>
\ No newline at end of file
...@@ -27,43 +27,8 @@ ...@@ -27,43 +27,8 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 省市 --> <!-- 省市 -->
<el-row> <SelectProvinceCity :queryParams="queryParams"
<el-form-item label="区域查询" @change="getTaskList" />
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-row>
<el-form-item label="战区" <el-form-item label="战区"
prop="zone"> prop="zone">
...@@ -71,7 +36,7 @@ ...@@ -71,7 +36,7 @@
placeholder="请选择战区" placeholder="请选择战区"
clearable clearable
filterable filterable
:disabled="cityManagerPrivilege" :disabled="isCityManager"
@change="getTaskList"> @change="getTaskList">
<el-option v-for="item in zoneList" <el-option v-for="item in zoneList"
:key="item.value" :key="item.value"
...@@ -83,7 +48,7 @@ ...@@ -83,7 +48,7 @@
prop="manager"> prop="manager">
<el-select v-model="queryParams.managerId" <el-select v-model="queryParams.managerId"
placeholder="请选择负责人" placeholder="请选择负责人"
:disabled="cityManagerPrivilege" :disabled="isCityManager"
clearable clearable
filterable filterable
@change="getTaskList"> @change="getTaskList">
...@@ -104,7 +69,6 @@ ...@@ -104,7 +69,6 @@
</el-form> </el-form>
<!-- 数据表格 --> <!-- 数据表格 -->
<el-table :data="tableList" <el-table :data="tableList"
:cell-style="{ 'word-wrap': 'break-word', 'white-space': 'normal' }"
border border
style="width: 100%" style="width: 100%"
show-overflow-tooltip> show-overflow-tooltip>
...@@ -125,7 +89,7 @@ ...@@ -125,7 +89,7 @@
查看照片 查看照片
</el-button> </el-button>
<el-button type="danger" <el-button type="danger"
v-if="showDelete(scope.row)" v-if="checkTaskExpire(scope.row)"
@click="deleteView(scope.row)" @click="deleteView(scope.row)"
text> text>
删除 删除
...@@ -144,7 +108,8 @@ ...@@ -144,7 +108,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"
...@@ -163,73 +128,21 @@ ...@@ -163,73 +128,21 @@
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue' import { useDatePickerOptions, checkTaskExpire } from '@/hooks'
import { useDatePickerOptions } from '@/hooks' import { getWarZoneListAPI, getChargeListAPI, getTaskListAPI, deletePromotionSystemAPI, getPromotionSystemAPI, getPromotionActivityAPI } from '@/api'
import { getWarZoneListAPI, getChargeListAPI, getTaskListAPI, getProCityAPI, deletePromotionSystemAPI, getPromotionSystemAPI, getPromotionActivityAPI } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import store from '@/store' import { PROMOTION_TASK_STATUS_LIST } from '@/dicts'
import { ElMessage, ElMessageBox } from 'element-plus'; import userStore from '@/store/modules/user'
import SelectProvinceCity from '../components/SelectProvinceCity'
const { recentPickerOptions: pickerOptions, last7Date, todayDate } = useDatePickerOptions(0) const { recentPickerOptions: pickerOptions, todayDate } = useDatePickerOptions(0)
const queryParams = reactive({
taskStatus: '',
region: '全国',
provinceId: undefined,
cityId: undefined,
zoneId: undefined,
managerId: undefined,
storeName: undefined,
page: 1,
pageSize: 10,
date: todayDate
})
const photoDialogVisible = ref(false)
const photoDialogList = ref([])
const photoLookInfoObj = ref({})
const total = ref(0)
// 城市经理状态为 true // 城市经理状态为 true
const cityManagerPrivilege = computed(() => { const isCityManager = userStore().promotionIdentity
return store.state?.value?.user?.userInfo?.privilegeId == 1 const empInfo = userStore().empInfo
})
// 任务状态
const taskStatusList = ref([
{
label: '未审批',
value: 'SUBMITTED'
},
{
label: '已审批',
value: 'APPROVED'
},
{
label: '全部数据',
value: ''
}
])
// 区域查询
const provinceList = ref([])
const cityList = ref([])
const getProCity = async () => {
const { data } = await getProCityAPI(queryParams)
if (queryParams.provinceId) {
queryParams.cityId = undefined
cityList.value = data.map(item => ({
label: item.name,
value: item.num
}))
} else {
provinceList.value = data.map(item => ({
label: item.name,
value: item.num
}))
}
getTaskList()
}
getProCity()
/****************** 搜索参数 ******************/
const taskStatusList = ref(PROMOTION_TASK_STATUS_LIST) // 任务状态
// 战区列表 // 战区列表
const zoneList = ref([]) const zoneList = ref([])
const getZoneList = async () => { const getZoneList = async () => {
...@@ -240,8 +153,9 @@ const getZoneList = async () => { ...@@ -240,8 +153,9 @@ const getZoneList = async () => {
value: item.qcId value: item.qcId
} }
}) })
// 如果是城市经理,默认设置战区为当前登录的城市经理
isCityManager && (queryParams.zoneId = managerList.value.find(item => item.employeeNo === empInfo.empNo)?.deptQcId)
} }
getZoneList()
// 负责人列表 // 负责人列表
const managerList = ref([]) const managerList = ref([])
...@@ -256,10 +170,25 @@ const getManagerList = async () => { ...@@ -256,10 +170,25 @@ const getManagerList = async () => {
deptQcId: item.deptQcId deptQcId: item.deptQcId
} }
}) })
// 如果是城市经理,默认设置负责人为当前登录的城市经理
isCityManager && (queryParams.managerId = managerList.value.find(item => item.employeeNo === empInfo.empNo)?.value)
} }
getManagerList()
// 任务列表 /****************** 任务列表 ******************/
const queryParams = reactive({
taskStatus: '',
region: '全国',
provinceId: undefined,
cityId: undefined,
zoneId: undefined,
managerId: undefined,
storeName: undefined,
page: 1,
pageSize: 10,
date: todayDate
})
const total = ref(0)
const tableList = ref([]) const tableList = ref([])
const columns = ref([ const columns = ref([
{ {
...@@ -345,41 +274,17 @@ const columns = ref([ ...@@ -345,41 +274,17 @@ const columns = ref([
prop: 'manageName', prop: 'manageName',
width: 120 width: 120
} }
]) ]) // 任务列表
// 删除任务列表
const deleteView = async (row) => {
await ElMessageBox.confirm('确认删除该记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
await deletePromotionSystemAPI(row.id)
// 提示删除成功
getTaskList()
ElMessage.success('删除成功')
}
// 获取任务列表 // 获取任务列表
const getTaskList = async () => { const getTaskList = async () => {
const { data: { records, totalRecord } } = await getTaskListAPI({
// 后台省市不要 id,自己查个名字给后台 ...queryParams,
queryParams.province = provinceList.value.find(item => item.value === queryParams.provinceId)?.label province: queryParams.provinceName,
queryParams.city = cityList.value.find(item => item.value === queryParams.cityId)?.label city: queryParams.cityName
// 城市经理查自己,职能角色查所有(需要的是促销系统 id) })
if (cityManagerPrivilege.value) {
// 城市经理
await getManagerList()
queryParams.managerId = managerList.value.find(item => item.employeeNo === store.state.value.user.userInfo.userName)?.value
// 先从归属人查询当前登录用户的战区 ID
queryParams.zoneId = managerList.value.find(item => item.employeeNo === store.state.value.user.userInfo.userName)?.deptQcId
}
const { data: { records, totalRecord } } = await getTaskListAPI(queryParams)
tableList.value = records tableList.value = records
total.value = totalRecord total.value = totalRecord
} }
getTaskList()
const formatter = (row, columns, value) => { const formatter = (row, columns, value) => {
// 判断有值再转换 // 判断有值再转换
if (columns.property === 'clockDto.clockInTime' && value) { if (columns.property === 'clockDto.clockInTime' && value) {
...@@ -393,31 +298,35 @@ const formatter = (row, columns, value) => { ...@@ -393,31 +298,35 @@ const formatter = (row, columns, value) => {
} else if (columns.property === 'week') { } else if (columns.property === 'week') {
return parseTime(row['createDate'], '周{a}') return parseTime(row['createDate'], '周{a}')
} else if (columns.property === 'approveStatus' && value) { } else if (columns.property === 'approveStatus' && value) {
const obj = { return taskStatusList.value.find(item => item.value === value)?.label
SUBMITTED: '未审批',
APPROVED: '已审批'
}
return obj[value]
} }
return value return value
} }
// 区域查询切换 // 删除任务
const regionChange = (val) => { const deleteView = async (row) => {
if (val === '全国') { await proxy.$modal.confirm('确认删除该记录吗?', '提示', {
queryParams.provinceId = undefined confirmButtonText: '确定',
queryParams.cityId = undefined cancelButtonText: '取消',
} else if (val === '省') { type: 'warning'
queryParams.cityId = undefined })
} else if (val === '省-市') { await deletePromotionSystemAPI(row.id)
cityList.value = []
getProCity()
}
getTaskList() getTaskList()
proxy.$modal.msgSuccess('删除成功')
} }
// 查看照片 onMounted(async () => {
const lookPhoto = async (row) => { await getManagerList()
await getZoneList()
getTaskList()
})
/***************** 查看图片弹窗 *****************/
const photoDialogVisible = ref(false)
const photoDialogList = ref([]) // 图片数据集合
const photoLookInfoObj = ref({})
const lookPhoto = async (row) => { // 查看照片
photoDialogVisible.value = true photoDialogVisible.value = true
photoLookInfoObj.value = row photoLookInfoObj.value = row
const result = await getPromotionActivityAPI(row.id) const result = await getPromotionActivityAPI(row.id)
...@@ -491,18 +400,7 @@ const lookPhoto = async (row) => { ...@@ -491,18 +400,7 @@ const lookPhoto = async (row) => {
}] }]
} }
const currentChange = (page) => {
queryParams.page = page
getTaskList()
}
// 是否展示删除按钮
const showDelete = (row) => {
// 上报日期不是当月则隐藏按钮
const date = parseTime(row.createDate, '{y}-{m}')
const currentDate = parseTime(new Date(), '{y}-{m}')
return date === currentDate
}
</script> </script>
...@@ -511,7 +409,8 @@ const showDelete = (row) => { ...@@ -511,7 +409,8 @@ const showDelete = (row) => {
::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;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论