提交 81e46947 authored 作者: lidongxu's avatar lidongxu

refactor(promotion): 修改:促销计划中新增修改计划上传时如果没有错误信息,则不显示错误信息列

上级 337dcd0c
...@@ -34,7 +34,6 @@ export const checkPlanExpire = (row) => { ...@@ -34,7 +34,6 @@ export const checkPlanExpire = (row) => {
export const checkPlanChangeExpire = (row) => { export const checkPlanChangeExpire = (row) => {
const date = new Date() const date = new Date()
const rowDate = new Date(row.date) const rowDate = new Date(row.date)
console.log('今日', !(rowDate <= date))
return !(rowDate <= date) return !(rowDate <= date)
} }
......
...@@ -103,7 +103,8 @@ ...@@ -103,7 +103,8 @@
v-model="uploadPlanDialogVisible" v-model="uploadPlanDialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
draggable overflow> draggable
overflow>
<div> <div>
<!-- 计划表格 --> <!-- 计划表格 -->
<el-table :data="planTableList" <el-table :data="planTableList"
...@@ -111,6 +112,10 @@ ...@@ -111,6 +112,10 @@
style="width: 100%" style="width: 100%"
show-overflow-tooltip show-overflow-tooltip
:row-class-name="tableRowClassName"> :row-class-name="tableRowClassName">
<el-table-column prop="errorMsg"
label="错误信息"
width="450"
v-if="isHaveErrPlan" />
<el-table-column v-for="item in confirmTableColumns" <el-table-column v-for="item in confirmTableColumns"
:key="item.label" :key="item.label"
:prop="item.prop" :prop="item.prop"
...@@ -136,7 +141,8 @@ ...@@ -136,7 +141,8 @@
:title="(addOrEditPlanForm.id ? '修改' : '新增') + '计划'" :title="(addOrEditPlanForm.id ? '修改' : '新增') + '计划'"
v-model="addOrEditPlanVisible" v-model="addOrEditPlanVisible"
width="60%" width="60%"
draggable overflow> draggable
overflow>
<!-- 表单 --> <!-- 表单 -->
<el-form :model="addOrEditPlanForm" <el-form :model="addOrEditPlanForm"
label-width="150px" label-width="150px"
...@@ -280,7 +286,8 @@ ...@@ -280,7 +286,8 @@
<el-dialog title="修改计划归属人" <el-dialog title="修改计划归属人"
v-model="editPlanEmpVisible" v-model="editPlanEmpVisible"
width="60%" width="60%"
draggable overflow> draggable
overflow>
<!-- 表单 --> <!-- 表单 -->
<el-form :model="editPlanEmpForm" <el-form :model="editPlanEmpForm"
label-width="150px" label-width="150px"
...@@ -362,6 +369,7 @@ const deletePlane = (row) => { ...@@ -362,6 +369,7 @@ const deletePlane = (row) => {
} }
/*************** 新增计划 ***************/ /*************** 新增计划 ***************/
const isHaveErrPlan = ref(false) // 上传表格计划中有无错误
// 批量 // 批量
const uploadPlanFile = async (file) => { // 上传计划表格 const uploadPlanFile = async (file) => { // 上传计划表格
proxy.$modal.loading("正在上传数据,请稍后..."); proxy.$modal.loading("正在上传数据,请稍后...");
...@@ -373,6 +381,7 @@ const uploadPlanFile = async (file) => { // 上传计划表格 ...@@ -373,6 +381,7 @@ const uploadPlanFile = async (file) => { // 上传计划表格
"employeeNo": empInfo.empNo "employeeNo": empInfo.empNo
}) })
planTableList.value = res.data.table planTableList.value = res.data.table
isHaveErrPlan.value = !!res.data.table[0].errorMsg
confirmExcelUUID.value = res.data.uuid confirmExcelUUID.value = res.data.uuid
uploadPlanDialogVisible.value = true uploadPlanDialogVisible.value = true
} finally { } finally {
...@@ -400,6 +409,7 @@ const uploadChangeFile = async (file) => { ...@@ -400,6 +409,7 @@ const uploadChangeFile = async (file) => {
"employeeNo": empInfo.empNo "employeeNo": empInfo.empNo
}) })
planTableList.value = res.data.table planTableList.value = res.data.table
isHaveErrPlan.value = !!res.data.table[0].errorMsg
confirmExcelUUID.value = res.data.uuid confirmExcelUUID.value = res.data.uuid
uploadPlanDialogVisible.value = true uploadPlanDialogVisible.value = true
} finally { } finally {
...@@ -873,12 +883,7 @@ getBelongPerList() ...@@ -873,12 +883,7 @@ getBelongPerList()
const uploadPlanDialogVisible = ref(false) const uploadPlanDialogVisible = ref(false)
const planTableList = ref([]) const planTableList = ref([])
const confirmExcelUUID = ref('') const confirmExcelUUID = ref('')
const confirmTableColumns = [ const confirmTableColumns = ref([
{
label: '错误消息',
prop: 'errorMsg',
width: 450
},
{ {
label: '归属人', label: '归属人',
prop: 'employeeName', prop: 'employeeName',
...@@ -991,7 +996,7 @@ const confirmTableColumns = [ ...@@ -991,7 +996,7 @@ const confirmTableColumns = [
prop: 'modifyTime', prop: 'modifyTime',
width: 250 width: 250
} }
] ])
const tableRowClassName = ({ row }) => { const tableRowClassName = ({ row }) => {
if (row.errorMsg) { if (row.errorMsg) {
return 'error-row' return 'error-row'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论