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

feat(plan): 超过当日 10 点的无法删除计划

同上
上级 db5f6437
......@@ -16,3 +16,5 @@ VITE_APP_PUBLIC_PATH = '/'
# 第三方服务回调地址
VITE_APP_REDIRECT_URL = 'http://localhost:8080/'
# 积木报表网页资源地址
VITE_APP_REPORT_URL = 'http://192.168.100.39:8080'
\ No newline at end of file
......@@ -13,3 +13,5 @@ VITE_APP_PUBLIC_PATH = './'
# 第三方服务回调地址
VITE_APP_REDIRECT_URL = 'http://111.198.15.68:86/link/'
# 积木报表网页资源地址
VITE_APP_REPORT_URL = 'http://111.198.15.68:8080/'
\ No newline at end of file
......@@ -12,4 +12,6 @@ VITE_APP_ENV = 'staging'
VITE_APP_PUBLIC_PATH = './'
# 第三方服务回调地址
VITE_APP_REDIRECT_URL = 'http://111.198.15.68:85/link/'
\ No newline at end of file
VITE_APP_REDIRECT_URL = 'http://111.198.15.68:85/link/'
# 积木报表网页资源地址
VITE_APP_REPORT_URL = 'http://111.198.15.68:8080/'
\ No newline at end of file
......@@ -50,13 +50,11 @@ export function savePlanAPI(uuid) {
// 删除活动计划
export function deletePlanAPI(ids) {
export function deletePlanAPI(data) {
return request({
baseURL: VITE_APP_PROMOTION,
url: `/plan/v2/core/delete`,
method: 'DELETE',
data: {
planIds: ids
}
data
})
}
\ No newline at end of file
<template>
<i-frame :src="openUrl"
id="jimuReportFrame"
ref="myIframe"
@load="load"></i-frame>
id="jimuReportFrame"></i-frame>
</template>
<script>
// 报表设计器
......@@ -14,25 +12,8 @@ export default {
data() {
return {
// 这里写暴露的统一的网关地址
openUrl: "http://192.168.100.39:8080/report/jmreport/list?token=" + getToken(),
openUrl: `${import.meta.env.VITE_APP_REPORT_URL}/report/jmreport/list?token=` + getToken(),
};
},
mounted: function () {
},
methods: {
load() {
setTimeout(() => {
const iframe = this.$refs.myIframe;
console.log(iframe.contentDocument)
const iframeBody = iframe.body;
console.log(iframeBody)
}, 5000)
// 现在你可以操作 iframeBody 中的标签了
// const h1Element = iframeBody.querySelector('h1');
// console.log(h1Element.textContent); // 输出 h1 标签的文本内容
}
}
};
</script>
......@@ -40,8 +21,8 @@ export default {
<style lang="scss">
#jimuReportFrame {
width: 100%;
// 为了隐藏积木报表顶部的广告栏
min-height: calc(100vh - 50px) !important;
// height: calc(100vh + 50px) !important;
margin-top: -50px;
}
</style>
\ No newline at end of file
......@@ -45,9 +45,11 @@
border
style="width: 100%"
show-overflow-tooltip
@selection-change="handleSelectionChange">
@selection-change="handleSelectionChange"
:row-class-name="tableRowTimeOutClassName">
<el-table-column type="selection"
width="55">
width="55"
:selectable="selectableFn">
</el-table-column>
<el-table-column v-for="item in columns"
:key="item.label"
......@@ -60,6 +62,7 @@
<template #default="scope">
<el-button type="danger"
link
:disabled="!selectableFn(scope.row)"
@click="deletePlane(scope.row)">
删除
</el-button>
......@@ -144,11 +147,22 @@ const columns = ref([
fixed: true
},
{
label: '负责人',
label: '归属人',
prop: 'employeeName',
width: 90,
fixed: true
},
{
label: '归属人工号',
prop: 'employeeNo',
width: 140,
fixed: true
},
{
label: '经销商 ID',
prop: 'dealerId',
width: 120
},
{
label: '经销商',
prop: 'dealerName',
......@@ -159,11 +173,21 @@ const columns = ref([
prop: 'lineName',
width: 100
},
{
label: '店铺编码',
prop: 'storeCode',
width: 160
},
{
label: '店铺名称',
prop: 'storeName',
width: 200
},
{
label: '活动日期',
prop: 'date',
width: 180
},
{
label: '活动状态',
prop: 'planStatus',
......@@ -180,10 +204,40 @@ const columns = ref([
width: 100
},
{
label: '城市',
prop: 'city',
label: '地址',
prop: 'addr',
width: 200
},
{
label: '上班时间',
prop: 'clockInTime',
width: 180
},
{
label: '下班时间',
prop: 'clockOutTime',
width: 180
},
{
label: '促销员薪资',
prop: 'salary',
width: 100
},
{
label: '杂费',
prop: 'incidentals',
width: 100
},
{
label: '战区',
prop: 'orgName',
width: 150
},
// {
// label: '城市',
// prop: 'city',
// width: 100
// },
{
label: '最后修改时间',
prop: 'modifyTime',
......@@ -204,12 +258,36 @@ getPlanList()
const formatter = (row, col, value) => {
if (col.property === 'planStatus') {
return value == 0 ? '执行中' : '取消'
} else if (col.property === 'modifyTime') {
} else if (col.property === 'modifyTime' || col.property === 'date' || col.property === 'clockInTime' || col.property === 'clockOutTime') {
return parseTime(value)
} else {
return value
}
}
// 判断计划是否过期
const checkPlanExpire = (row) => {
const date = new Date()
const targetDate = new Date(`${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} 10:00:00`)
const rowDate = new Date(row.date)
if (rowDate < targetDate) {
return false
} else {
return true
}
}
// 计划是否可选
const selectableFn = (row) => {
return checkPlanExpire(row)
}
// 计划是否已经过期,不可以操作
const tableRowTimeOutClassName = ({ row }) => {
const isExpire = checkPlanExpire(row)
if (!isExpire) {
return 'timeout-row'
} else {
return ''
}
}
// 上传计划
const uploadFile = async (file) => {
......@@ -314,7 +392,10 @@ const deletePlane = (row) => {
handleDelete()
}
const handleDelete = async () => {
await deletePlanAPI(deleteList.value.map(o => o.id))
await deletePlanAPI({
ids: deleteList.value.map(o => o.id),
employeeNo: store.state.value.user.userInfo.userName
})
ElMessage.success('删除成功')
getPlanList()
}
......@@ -326,15 +407,10 @@ const handleDelete = async () => {
::v-deep(.error-row) {
--el-table-tr-bg-color: var(--el-color-error-light-9);
}
/* 灰色过期行颜色 */
::v-deep(.timeout-row) {
--el-table-tr-bg-color: #e2e2e29e;
}
}
/* .el-table .warning-row {
--el-table-tr-bg-color: var(--el-color-warning-light-9);
}
.el-table .success-row {
--el-table-tr-bg-color: var(--el-color-success-light-9);
}
.el-table .error-row {
} */
</style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论