提交 64da53d7 authored 作者: lidongxu's avatar lidongxu

Merge branch 'ldx' into dev

......@@ -31,3 +31,20 @@ export const PROMOTION_ACTIVITY_MODE_LIST = [
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 计划信息对象
......@@ -11,3 +12,15 @@ export const checkPlanExpire = (row) => {
// 2. 计划状态已经开始了,不可编辑/删除
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'
const route = useRoute();
const router = useRouter();
const employeeNo = userStore().empInfo.empNo; // 员工工号
const form = ref({
storePicture: [], // 店铺门头照
temNum: null, // 促销员数量
......@@ -231,7 +233,7 @@ const decreaseCount = async () => {
temNum: form.value.temNum - 1,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
form.value.temNum--;
}
......@@ -243,7 +245,7 @@ const increaseCount = async () => {
temNum: form.value.temNum + 1,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
form.value.temNum++;
};
......@@ -302,14 +304,14 @@ const storePictureRead = async (file) => {
const date = new Date()
const month = date.getMonth() + 1
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({
id: form.value.id,
storePicture: pictureUrl,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
// 删除店铺门头照
......@@ -319,7 +321,7 @@ const deleteStorePicture = async () => {
storePicture: '',
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -331,7 +333,7 @@ const planStatusChange = async (val) => {
planStatus: form.value.planStatus,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -342,7 +344,7 @@ const changeStoreDd = async () => {
storeDd: form.value.storeDd,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -357,7 +359,7 @@ const changeTemOnWork = async () => {
temOnWork: form.value.temOnWork,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
const changeTemOnWorkTimeRange = () => {
......@@ -378,7 +380,7 @@ const changeTemHs = async () => {
temHs: form.value.temHs,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
const changeTemWl = async () => {
......@@ -387,7 +389,7 @@ const changeTemWl = async () => {
temWl: form.value.temWl,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
const changeTemZz = async () => {
......@@ -396,7 +398,7 @@ const changeTemZz = async () => {
temZz: form.value.temZz,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -406,7 +408,7 @@ const temWorkPhotosRead = async (file) => {
const date = new Date()
const month = date.getMonth() + 1
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 则是组件上传的,替换当前元素的对象
const index = form.value.temWorkPhotos.findIndex(o => o.objectUrl)
form.value.temWorkPhotos[index] = {
......@@ -418,7 +420,7 @@ const temWorkPhotosRead = async (file) => {
temWorkPhotos: form.value.temWorkPhotos.map(o => o.url),
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -429,7 +431,7 @@ const deleteTemWorkPhotos = async () => {
temWorkPhotos: form.value.temWorkPhotos.map(o => o.url),
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -439,14 +441,14 @@ const storeTcPhotoRead = async (file) => {
const date = new Date()
const month = date.getMonth() + 1
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({
id: form.value.id,
storeTcPhoto: pictureUrl,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -457,7 +459,7 @@ const deleteStoreTcPhoto = async () => {
storeTcPhoto: '',
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -467,14 +469,14 @@ const temOnWorkPictureRead = async (file) => {
const date = new Date()
const month = date.getMonth() + 1
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({
id: form.value.id,
storeZhjPhoto: pictureUrl,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
// 删除主货架照片
......@@ -484,7 +486,7 @@ const deleteStoreZhjPhoto = async () => {
storeZhjPhoto: '',
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -494,7 +496,7 @@ const posPhotosRead = async (file) => {
const date = new Date()
const month = date.getMonth() + 1
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
const index = form.value.posPhotos.findIndex(o => o.objectUrl)
form.value.posPhotos[index] = {
......@@ -506,7 +508,7 @@ const posPhotosRead = async (file) => {
posPhotos: form.value.posPhotos.map(o => o.url),
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
// 删除 POS 照片
......@@ -516,7 +518,7 @@ const deletePosPhotos = async () => {
posPhotos: form.value.posPhotos.map(o => o.url),
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......@@ -527,7 +529,7 @@ const posRmbChange = async () => {
posRmb: form.value.posRmb || 0,
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: employeeNo, // 稽查人工号
})
}
......
......@@ -205,7 +205,7 @@ const clickExamine = async () => {
planStatus: planDetail.value.planStatus === 0 ? '否' : '是',
employeeId: userStore().userInfo.userId, // 稽查人id
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: userStore().employeeNo, // 稽查人工号
employeeNo: userStore().userInfo.userName, // 稽查人工号
})
if (!result.data) {
return proxy.$modal.msgError('创建稽查任务失败')
......
......@@ -169,7 +169,6 @@ import PickerBelong from '../components/PickerBelong'
const myForm = ref({})
const { proxy } = getCurrentInstance();
const employeeNo = computed(() => userStore().employeeNo)
const empInfo = userStore().empInfo
const isCityManager = ref(userStore().promotionIdentity)
const form = reactive({})
......
......@@ -97,8 +97,7 @@ import PickerBelong from '../components/PickerBelong'
const { proxy } = getCurrentInstance();
const router = useRouter()
const route = useRoute()
const promotionIdentity = computed(() => userStore().promotionIdentity)
const employeeNo = computed(() => userStore().employeeNo)
const isCityManager = userStore().promotionIdentity
const empInfo = userStore().empInfo
// 搜索弹窗
......@@ -153,7 +152,7 @@ const getPlanList = async () => {
activityStartDate: parseTime(query.activityStartDate, "{y}-{m}-{d}"),
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,
employeeId: isCityManager ? allEmpolyeeList.value.find(o => o.employeeNo === empInfo.empNo)?.value : query.employeeId,
storeNameLike: query.storeNameLike,
statusType: query.isDeleted
},
......@@ -211,7 +210,7 @@ const deletePlan = (row) => {
proxy.$modal.confirm(`确认删除计划吗?`).then(async () => {
await deletePlanAPI({
planIds: [row.id],
employeeNo: employeeNo.value
employeeNo: empInfo.empNo
})
proxy.$modal.msgSuccess('删除成功')
// 重新获取列表
......@@ -248,7 +247,7 @@ const clickDelSome = () => {
}
await deletePlanAPI({
planIds: ids,
employeeNo: employeeNo.value
employeeNo: empInfo.empNo
})
proxy.$modal.msgSuccess('删除成功')
showSelect.value = false
......
......@@ -156,8 +156,8 @@ const showEmployee = ref(false)
// 如果是城市经理,设置默认归属人
watch(() => props.allEmpolyeeList, (newVal) => {
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
props.query.employeeName = newVal.find(o => o.employeeNo === userStore().userInfo.userName)?.text
props.query.employeeId = newVal.find(o => o.employeeNo === userStore().userInfo.userName)?.value
}
})
......
......@@ -110,10 +110,6 @@ export default defineStore(
empNo: state.userInfo.userName, // 员工工号
empName: state.userInfo.nickName, // 员工昵称名字
}
},
// 获取员工工号
employeeNo(state) {
return state.userInfo.userName
}
}
})
......
......@@ -36,18 +36,8 @@
<script setup>
import { getLiveCate, uploadLiveCate } from '@/api'
import { ElMessage } from 'element-plus'
const tableData = ref([])
const queryParams = ref({
zbjQdType: ''
})
const getCate = async () => {
const res = await getLiveCate(queryParams.value)
tableData.value = res.data
}
getCate()
const { proxy } = getCurrentInstance()
// 覆盖上传直播间分类表格
const uploadExcel = () => {
......@@ -62,16 +52,23 @@ const uploadExcel = () => {
const formData = new FormData();
formData.append('file', file);
const res = await uploadLiveCate(formData)
ElMessage.success(res.data)
proxy.$modal.msgSuccess(res.data)
}
});
document.body.appendChild(fileInput);
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 '@
import LineChart from './LineChart.vue';
import gsap from 'gsap'
import { useDatePickerOptions } from '@/hooks'
import { ElMessage } from 'element-plus';
const { proxy } = getCurrentInstance();
const dict = proxy.useDict("sale_platform")
......@@ -584,7 +583,7 @@ const submitUploadDemandFn = async () => {
fd.append('file', uploadDemand.file)
fd.append('year', uploadDemand.year.getFullYear())
const res = await uploadDemandImportAPI(fd)
ElMessage.success(res.msg)
proxy.$modal.msgSuccess(res.msg)
uploadDemandImportVisible.value = false
}
......
......@@ -43,7 +43,6 @@
</template>
<script setup>
import { ElMessage } from 'element-plus'
import { enterOtherReportAPI, getReportFolderListAPI } from '@/api'
const { proxy } = getCurrentInstance();
......@@ -84,7 +83,7 @@ const handleSubmit = async () => {
if (valid) {
// 表单验证通过,进行提交操作
await enterOtherReportAPI(form.value)
ElMessage.success('提交成功')
proxy.$modal.msgSuccess('提交成功')
// 清空表单
form.value = {
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
......@@ -32,48 +32,8 @@
</el-form-item>
</el-row>
<!-- 省市 -->
<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>
<SelectProvinceCity :queryParams="queryParams"
@change="getPlanList" />
<el-row>
<el-form-item label="经销商"
prop="dealerId">
......@@ -142,11 +102,12 @@
</template>
<script setup>
import { getProCityAPI, getDealerListAPI, getWarZoneListAPI, getChargeListAPI } from '@/api'
import { getDealerListAPI, getWarZoneListAPI, getChargeListAPI } from '@/api'
import { parseTime } from '@/utils'
import userStore from '@/store/modules/user'
import { useDatePickerOptions } from '@/hooks'
import { PROMOTION_STATUS } from '@/dicts'
import SelectProvinceCity from '../components/SelectProvinceCity'
import EffectivePlan from './effectivePlan.vue'
import InvalidPlan from './invalidPlan.vue'
......@@ -178,51 +139,6 @@ const selActivityDate = () => {
/************* 选择状态 *************/
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 getDealerList = async () => {
......@@ -286,3 +202,10 @@ const getPlanList = () => {
proxy.$refs.invalidPlan.getPlanList('resetPage')
}
</script>
<style scoped
lang="scss">
::v-deep(.el-form-item) {
width: 350px !important;
}
</style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论