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

refactor(mobile/examine): 修改:勤策移动端页面促销稽核核查页面增加修改删除给顶部通知提示效果,修改为 vant 组件提示框

上级 25513e7f
......@@ -31,14 +31,6 @@
<div class="title-divider"></div>
</h2>
<div class="section">
<div class="form-item">
<label>是否执行:</label>
<van-radio-group v-model="form.planStatus"
@change="planStatusChange">
<van-radio name="是"></van-radio>
<van-radio name="否"></van-radio>
</van-radio-group>
</div>
<div class="form-item"
style="display: flex; align-items: center; margin-top: 20px;">
<label>促销员人数:</label>
......@@ -48,6 +40,15 @@
<button @click="increaseCount">+</button>
</div>
</div>
<div class="form-item">
<label>是否执行:</label>
<van-radio-group v-model="form.planStatus"
@change="planStatusChange">
<van-radio name="是"></van-radio>
<van-radio name="否"></van-radio>
</van-radio-group>
</div>
<div class="form-item">
<label>地堆:</label>
<van-radio-group v-model="form.storeDd"
......@@ -184,15 +185,6 @@
</van-uploader>
</div>
<div class="form-item">
<label>POS金额:</label>
<van-field v-model="form.posRmb"
type="number"
:controls="true"
placeholder="请输入POS金额"
style="margin-top: 10px;"
@input="posRmbChange" />
</div>
<div class="form-item">
<label>POS照片(两张):</label>
</div>
......@@ -206,6 +198,16 @@
</van-uploader>
</div>
<div class="form-item">
<label>POS金额:</label>
<van-field v-model="form.posRmb"
type="number"
:controls="true"
placeholder="请输入POS金额"
style="margin-top: 10px;"
@change="posRmbChange" />
</div>
<!-- 促销员工资 -->
<div class="form-item">
<label>促销员工资:</label>
......@@ -242,19 +244,20 @@ const route = useRoute();
const router = useRouter();
const employeeNo = userStore().empInfo.empNo; // 员工工号
// 添加初始化标志位
const isInitializing = ref(true);
const form = ref({
storePicture: [], // 店铺门头照
temNum: null, // 促销员数量
storeDd: '', // 是否有地堆
planStatus: '', // 是否执行
temOnWork: '岗', // 是否在岗
temHs: '达标', // 话述
temWl: '缺少', // 物料
temZz: '达标', // 着装
temWlScp: '缺少', // 试吃品
temWlSct: '', // 试吃台
temWlSctp: '', // 试吃托盘
storeDd: '', // 是否有地堆
planStatus: '', // 是否执行
temOnWork: '岗', // 是否在岗
temHs: '达标', // 话述
temWl: '齐全', // 物料
temZz: '达标', // 着装
temWlScp: '齐全', // 试吃品
temWlSct: '', // 试吃台
temWlSctp: '', // 试吃托盘
temSalary: 0, // 促销员工资
remark: '', // 备注
temWorkPhotos: [], // 在/离岗取证照片
......@@ -296,6 +299,7 @@ const decreaseCount = async () => {
employeeNo: employeeNo, // 稽查人工号
})
form.value.temNum--;
showNotify({ type: 'success', message: '促销员数量减少成功' })
}
};
......@@ -308,6 +312,7 @@ const increaseCount = async () => {
employeeNo: employeeNo, // 稽查人工号
})
form.value.temNum++;
showNotify({ type: 'success', message: '促销员数量增加成功' })
};
// 获取考核详情/创建稽核任务
......@@ -363,6 +368,10 @@ const getDetail = async () => {
}
})) : []
form.value.posRmb = res.data.posRmb || 0
nextTick(() => {
isInitializing.value = false
})
}
getDetail()
......@@ -381,6 +390,7 @@ const storePictureRead = async (file) => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '门头照上传成功' })
}
// 删除店铺门头照
const deleteStorePicture = async () => {
......@@ -391,10 +401,13 @@ const deleteStorePicture = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '门头照删除成功' })
}
// 执行状态改变
const planStatusChange = async (val) => {
if (isInitializing.value) return
form.value.planStatus = val
await createExamine({
id: form.value.id,
......@@ -403,10 +416,12 @@ const planStatusChange = async (val) => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '执行状态改变成功' })
}
// 改变地堆状态
const changeStoreDd = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
storeDd: form.value.storeDd,
......@@ -414,10 +429,12 @@ const changeStoreDd = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '地堆状态改变成功' })
}
// 改变在岗状态
const changeTemOnWork = async () => {
if (isInitializing.value) return
if (form.value.temOnWork === '离岗') {
changeTemOnWorkTimeRange()
}
......@@ -429,6 +446,8 @@ const changeTemOnWork = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '在岗状态改变成功' })
}
const changeTemOnWorkTimeRange = () => {
// temOnWorkTimeRange
......@@ -443,6 +462,7 @@ changeTemOnWorkTimeRange()
// 改变话术物料和着装时把参数传给后台
const changeTemHs = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
temHs: form.value.temHs,
......@@ -450,8 +470,11 @@ const changeTemHs = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '话术物料和着装改变成功' })
}
// 物料是否齐全
const changeTemWl = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
temWl: form.value.temWl,
......@@ -459,8 +482,11 @@ const changeTemWl = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '物料是否齐全改变成功' })
}
// 着装是否达标
const changeTemZz = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
temZz: form.value.temZz,
......@@ -468,10 +494,12 @@ const changeTemZz = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '着装是否达标改变成功' })
}
// 选项值改变调用接口
// 促销员工资/备注改变
const changeForm = async (arg) => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
[arg]: form.value[arg],
......@@ -480,10 +508,21 @@ const changeForm = async (arg) => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
const messageObj = {
temHsRemark: '话术未达标备注',
temWlScp: '试吃品是否齐全',
temWlSct: '是否有试吃台',
temWlSctp: '是否有试吃托盘',
temSalary: '促销员工资',
remark: '备注'
}
showNotify({ type: 'success', message: `${messageObj[arg]}改变成功` })
}
// 在/离岗照片上传
const temWorkPhotosRead = async (file) => {
if (isInitializing.value) return
// 处理上传的文件
const date = new Date()
const month = date.getMonth() + 1
......@@ -502,10 +541,13 @@ const temWorkPhotosRead = async (file) => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '在/离岗照片上传成功' })
}
// 删除在/离岗照片
const deleteTemWorkPhotos = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
temWorkPhotos: form.value.temWorkPhotos.map(o => o.url),
......@@ -513,10 +555,14 @@ const deleteTemWorkPhotos = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '在/离岗照片删除成功' })
}
// 特陈照片上传
const storeTcPhotoRead = async (file) => {
if (isInitializing.value) return
// 处理上传的文件
const date = new Date()
const month = date.getMonth() + 1
......@@ -530,10 +576,15 @@ const storeTcPhotoRead = async (file) => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '特陈照片上传成功' })
}
// 删除特陈照片
const deleteStoreTcPhoto = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
storeTcPhoto: '',
......@@ -541,10 +592,15 @@ const deleteStoreTcPhoto = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '特陈照片删除成功' })
}
// 主货架照片
const temOnWorkPictureRead = async (file) => {
if (isInitializing.value) return
// 处理上传的文件
const date = new Date()
const month = date.getMonth() + 1
......@@ -558,9 +614,11 @@ const temOnWorkPictureRead = async (file) => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '主货架照片上传成功' })
}
// 删除主货架照片
const deleteStoreZhjPhoto = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
storeZhjPhoto: '',
......@@ -568,10 +626,14 @@ const deleteStoreZhjPhoto = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: '主货架照片删除成功' })
}
// POS 两张照片
const posPhotosRead = async (file) => {
if (isInitializing.value) return
// 处理上传的文件
const date = new Date()
const month = date.getMonth() + 1
......@@ -590,9 +652,11 @@ const posPhotosRead = async (file) => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: 'POS 照片上传成功' })
}
// 删除 POS 照片
const deletePosPhotos = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
posPhotos: form.value.posPhotos.map(o => o.url),
......@@ -600,10 +664,14 @@ const deletePosPhotos = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: 'POS 照片删除成功' })
}
// POS 金额修改
const posRmbChange = async () => {
if (isInitializing.value) return
await createExamine({
id: form.value.id,
posRmb: form.value.posRmb || 0,
......@@ -611,6 +679,8 @@ const posRmbChange = async () => {
employeeName: userStore().userInfo.nickName, // 稽查人名字
employeeNo: employeeNo, // 稽查人工号
})
showNotify({ type: 'success', message: 'POS 金额修改成功' })
}
</script>
......
......@@ -22,7 +22,6 @@
<script setup>
const router = useRouter();
const { proxy } = getCurrentInstance();
const modules = [
{
title: 'CP 活动',
......@@ -39,12 +38,7 @@ const modules = [
]
const handleIconClick = (icon) => {
// 如果是促销稽核,则提示本板块在开发中
if (icon.name === '促销稽核') {
proxy.$modal.msgWarning('本板块在开发中');
} else {
router.push(icon.to)
}
router.push(icon.to)
};
</script>
......
......@@ -230,7 +230,7 @@ const clickExamine = async () => {
employeeNo: userStore().userInfo.userName, // 稽查人工号
})
if (!result.data) {
return proxy.$modal.msgError('创建稽查任务失败')
return showNotify({ type: 'error', message: '创建稽查任务失败' })
}
newExamined.value = result.data.id
}
......
......@@ -103,10 +103,13 @@ const showDelete = (row) => {
// 点击删除
const deleteView = (item, index) => {
// 确认是否删除
proxy.$modal.confirm('确认删除该记录吗?').then(async () => {
showConfirmDialog({
title: '系统提示',
message: '确认删除该记录吗?'
}).then(async () => {
// 删除
await deletePromotionSystemAPI(item.id)
proxy.$modal.msgSuccess('删除成功')
showNotify({ type: 'success', message: '删除成功' })
props.planList.splice(index, 1)
emits('refresh')
proxy.eventBus.emit('delPromotionTaskEvent')
......
......@@ -353,10 +353,10 @@ const onSubmit = async () => {
if (planId) {
const res = await updatePlanByWebAPI(obj)
proxy.$modal.msgSuccess(res.msg)
showNotify({ type: 'success', message: res.msg })
} else {
const res = await addPlanByWebAPI(obj)
proxy.$modal.msgSuccess(res.msg)
showNotify({ type: 'success', message: res.msg })
}
clickBack()
......
......@@ -197,11 +197,11 @@ const querySearch = () => {
// 变更计划
const editPlan = (row) => {
if (!checkPlanExpire(row)) {
return proxy.$modal.msgWarning('无法变更,已执行或之前计划')
return showNotify({ type: 'warning', message: '无法变更,已执行或之前计划' })
}
// 日期小于等于今日,无法变更
if (!checkPlanChangeExpire(row)) {
return proxy.$modal.msgWarning('无法变更,日期小于等于今日')
return showNotify({ type: 'warning', message: '无法变更,日期小于等于今日' })
}
router.push(`/m/promotion_plan_editing/${row.id}`)
}
......@@ -209,14 +209,18 @@ const editPlan = (row) => {
// 删除计划
const deletePlan = (row) => {
if (!checkPlanExpire(row)) {
return proxy.$modal.msgWarning('无法删除,已执行或之前计划')
return showNotify({ type: 'warning', message: '无法删除,已执行或之前计划' });
}
proxy.$modal.confirm(`确认删除计划吗?`).then(async () => {
showConfirmDialog({
title: '系统提示',
message:
'确认删除计划吗?'
}).then(async () => {
await deletePlanAPI({
planIds: [row.id],
employeeNo: empInfo.empNo
})
proxy.$modal.msgSuccess('删除成功')
showNotify({ type: 'success', message: '删除成功' })
// 重新获取列表
onRefresh()
})
......@@ -239,21 +243,24 @@ const onLongPress = () => {
const clickDelSome = () => {
const ids = planList.value.filter(item => item.checked).map(item => item.id)
if (ids.length === 0) {
return proxy.$modal.msgWarning('请选择要删除的计划')
return showNotify({ type: 'warning', message: '请选择要删除的计划' })
}
proxy.$modal.confirm(`确认删除${ids.length}条计划吗?`).then(async () => {
showConfirmDialog({
title: '系统提示',
message: `确认删除${ids.length}条计划吗?`
}).then(async () => {
// 循环判断计划是否含有以前和执行中的
for (let i = 0; i < ids.length; i++) {
const item = planList.value.find(o => o.id === ids[i])
if (!checkPlanExpire(item)) {
return proxy.$modal.msgWarning('无法删除,已执行或之前计划')
return showNotify({ type: 'warning', message: '无法删除,已执行或之前计划' })
}
}
await deletePlanAPI({
planIds: ids,
employeeNo: empInfo.empNo
})
proxy.$modal.msgSuccess('删除成功')
showNotify({ type: 'success', message: '删除成功' })
showSelect.value = false
onRefresh()
})
......@@ -264,12 +271,12 @@ const showPickerBelong = ref(false)
const clickChangeBelong = () => {
const ids = planList.value.filter(item => item.checked).map(item => item.id)
if (ids.length === 0) {
return proxy.$modal.msgWarning('请选择要修改归属人的计划')
return showNotify({ type: 'warning', message: '请选择要修改归属人的计划' })
}
for (let i = 0; i < ids.length; i++) {
const item = planList.value.find(o => o.id === ids[i])
if (!checkPlanExpire(item)) {
return proxy.$modal.msgWarning('无法修改,已执行或之前计划')
return showNotify({ type: 'warning', message: '无法修改,已执行或之前计划' })
}
}
showPickerBelong.value = true
......@@ -284,8 +291,7 @@ const confirmPickerBelong = async (val) => {
operName: empInfo.empName,
planIds: planList.value.filter(item => item.checked).map(item => item.id)
})
proxy.$modal.msgSuccess('修改成功')
showNotify({ type: 'success', message: '修改成功' })
onRefresh()
}
......@@ -323,7 +329,7 @@ const addNewPlan = () => {
if (proxy.checkPermi(['promotion:plan:create'])) {
router.push('/m/promotion_plan_editing')
} else {
proxy.$modal.msgWarning('规定日期内_无法新增计划')
showNotify({ type: 'warning', message: '规定日期内_无法新增计划' })
}
}
</script>
......@@ -336,7 +342,9 @@ const addNewPlan = () => {
/* 头部返回按钮 */
::v-deep(.van-nav-bar) {
.van-icon, .van-nav-bar__text {
.van-icon,
.van-nav-bar__text {
color: var(--main-color);
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论