0410-海宁预警转发+北仑客群优化+海宁aum报表导出下载

This commit is contained in:
2026-04-10 17:40:38 +08:00
parent 803dbf2aa5
commit dd4c2fc1df
36 changed files with 1632 additions and 250 deletions

View File

@@ -22,4 +22,12 @@ export function getCustLevelList() {
url: '/grid/cmpm/custManager/custLevel/list',
method: 'get'
})
}
}
export function exportCustManagerReport(data) {
return request({
url: '/grid/cmpm/custManager/export',
method: 'post',
data
})
}

View File

@@ -204,12 +204,22 @@ export function warningworkRecordList(query) {
params: query
})
}
//更新预警工作清单
export function warningworkRecordSubmit(data) {
// 查询预警转发元数据
export function getAlterForwardMeta(query) {
return request({
url: `/work/record/alter/edit`,
url: `/work/record/alter/forward/meta`,
method: 'get',
params: query
})
}
// 预警转发
export function forwardAlter(data) {
return request({
url: `/work/record/alter/forward`,
method: 'post',
data: data,
data
})
}
@@ -265,4 +275,4 @@ export function getAlterTypes() {
url: '/work/record/alter/types',
method: 'get'
})
}
}

View File

@@ -15,7 +15,14 @@
<div class="right-menu">
<template v-if="device !== 'mobile'">
<el-badge v-if="downloadUnreadCount > 0" :value="downloadUnreadCount" class="item download-item">
<i
class="el-icon-download right-menu-item notice"
@click="openDownload"
/>
</el-badge>
<i
v-else
class="el-icon-download right-menu-item notice"
@click="openDownload"
/>
@@ -168,11 +175,14 @@ export default {
notReadCount: 0,
noticeCenterList: [],
open2: false,
downCenterList: []
downCenterList: [],
downloadUnreadCount: 0,
downloadPollingTimer: null,
downloadStatusMap: {}
};
},
computed: {
...mapGetters(['sidebar', 'avatar', 'device', 'nickName']),
...mapGetters(['sidebar', 'avatar', 'device', 'nickName', 'userName']),
setting: {
get() {
return this.$store.state.settings.showSettings;
@@ -192,10 +202,14 @@ export default {
},
created() {
this.getCenterList();
this.refreshDownloadCenterList();
window.addEventListener('notice-center-refresh', this.getCenterList);
window.addEventListener('download-center-refresh', this.handleDownloadCenterRefresh);
},
beforeDestroy() {
window.removeEventListener('notice-center-refresh', this.getCenterList);
window.removeEventListener('download-center-refresh', this.handleDownloadCenterRefresh);
this.stopDownloadPolling();
},
methods: {
openModal() {
@@ -203,8 +217,9 @@ export default {
this.open = true;
},
openDownload() {
this.getDownCenterList();
this.open2 = true;
this.refreshDownloadCenterList(false, true).finally(() => {
this.open2 = true;
});
},
// 消息已读
handleHasRead(uuid) {
@@ -237,10 +252,115 @@ export default {
});
},
handleDownloadCenterRefresh() {
this.refreshDownloadCenterList(false, false, true);
},
startDownloadPolling() {
if (this.downloadPollingTimer) {
return;
}
this.downloadPollingTimer = setInterval(() => {
this.refreshDownloadCenterList(true);
}, 10000);
},
stopDownloadPolling() {
if (this.downloadPollingTimer) {
clearInterval(this.downloadPollingTimer);
this.downloadPollingTimer = null;
}
},
getDownloadReadStorageKey() {
return `download-center-read-${this.userName || 'default'}`;
},
getReadTaskIds() {
try {
const cache = localStorage.getItem(this.getDownloadReadStorageKey());
const ids = cache ? JSON.parse(cache) : [];
return Array.isArray(ids) ? ids : [];
} catch (e) {
return [];
}
},
setReadTaskIds(ids) {
localStorage.setItem(this.getDownloadReadStorageKey(), JSON.stringify(ids));
},
getDownloadInitStorageKey() {
return `download-center-init-${this.userName || 'default'}`;
},
hasInitializedDownloadReadState() {
return localStorage.getItem(this.getDownloadInitStorageKey()) === '1';
},
markDownloadReadStateInitialized() {
localStorage.setItem(this.getDownloadInitStorageKey(), '1');
},
updateDownloadUnreadCount(taskList = []) {
const readSet = new Set(this.getReadTaskIds());
this.downloadUnreadCount = taskList.filter(item => item.status !== '0' && !readSet.has(item.id)).length;
},
markDownloadTasksAsRead(taskList = []) {
const readSet = new Set(this.getReadTaskIds());
taskList.filter(item => item.status !== '0').forEach(item => readSet.add(item.id));
this.setReadTaskIds(Array.from(readSet));
this.updateDownloadUnreadCount(taskList);
},
refreshDownloadCenterList(showStatusMessage = false, markAsRead = false, allowPolling = false) {
return getDownCenterList({}).then((res) => {
if (res.code == 200) {
const rows = res.rows || [];
const hasPendingTask = rows.some(item => item.status === '0');
if (!this.hasInitializedDownloadReadState()) {
const initialReadIds = rows.filter(item => item.status !== '0').map(item => item.id);
this.setReadTaskIds(initialReadIds);
this.markDownloadReadStateInitialized();
}
if (showStatusMessage) {
rows.forEach(item => {
const prevStatus = this.downloadStatusMap[item.id];
if (prevStatus === '0' && item.status === '1') {
Message.success(`${item.fileName}导出成功,请前往下载中心下载`);
} else if (prevStatus === '0' && item.status === '2') {
Message.warning(`${item.fileName}导出失败,请前往下载中心查看`);
}
});
}
this.downloadStatusMap = rows.reduce((acc, item) => {
acc[item.id] = item.status;
return acc;
}, {});
this.downCenterList = rows;
if (markAsRead) {
this.markDownloadTasksAsRead(rows);
} else {
this.updateDownloadUnreadCount(rows);
}
if (allowPolling && hasPendingTask) {
this.startDownloadPolling();
} else {
this.stopDownloadPolling();
}
}
});
},
// 消息列表下载文件
downLoadFile(item) {
const {fileUrl, fileName, status} = item
if (!fileUrl) return;
if (status === '0') {
Message.warning('正在导出,请稍后下载');
return
@@ -249,9 +369,11 @@ export default {
Message.warning('导出失败,无法下载');
return
}
if (!fileUrl) return;
downCenterDownload({ fileUrl }).then((res) => {
downloadFiles(res, `${fileName}.xlsx`);
Message.success('下载成功');
this.markDownloadTasksAsRead(this.downCenterList);
});
},
@@ -382,6 +504,12 @@ export default {
padding-top: 0;
}
}
.download-item {
::v-deep .el-badge__content.is-fixed {
top: 18px;
right: 18px;
}
}
}
}
.page-common-wrap {

View File

@@ -90,6 +90,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
@@ -150,7 +151,7 @@
</template>
<script>
import { gridCmpmCustManagerList, gridCmpmCustManagerResult, getCustLevelList } from '@/api/gridSearch/accountManageReport/index'
import { gridCmpmCustManagerList, gridCmpmCustManagerResult, getCustLevelList, exportCustManagerReport } from '@/api/gridSearch/accountManageReport/index'
export default {
data() {
return {
@@ -209,6 +210,19 @@ import { gridCmpmCustManagerList, gridCmpmCustManagerResult, getCustLevelList }
this.queryParams.statusType = null
this.handleQuery()
},
handleExport() {
exportCustManagerReport({
custLevel: this.queryParams.custLevel,
statusType: this.queryParams.statusType
}).then(res => {
if (res.code === 200) {
this.$message.success(res.msg)
window.dispatchEvent(new Event('download-center-refresh'))
}
}).catch(err => {
this.$message.error(err?.msg || '导出失败')
})
},
getData() {
this.loading = true;
gridCmpmCustManagerList(this.queryParams).then(res => {
@@ -354,4 +368,4 @@ import { gridCmpmCustManagerList, gridCmpmCustManagerResult, getCustLevelList }
letter-spacing: 0.5px;
}
}
</style>
</style>

View File

@@ -329,6 +329,14 @@ export default {
visible(val) {
if (val) {
this.init()
if (this.shareEnabled && this.deptOptions.length === 0) {
this.loadDeptOptions()
}
}
},
shareEnabled(val) {
if (val && this.deptOptions.length === 0) {
this.loadDeptOptions()
}
},
groupData: {
@@ -370,7 +378,6 @@ export default {
}
},
created() {
this.loadDeptOptions()
this.loadAllTags()
},
beforeDestroy() {

View File

@@ -101,6 +101,7 @@
<script>
import { listCustGroupMembers, removeMembers } from '@/api/group/custGroup'
import { mapGetters } from 'vuex'
export default {
name: 'CustGroupDetail',
@@ -119,9 +120,28 @@ export default {
}
}
},
watch: {
'$route.query.groupId'(newGroupId) {
if (newGroupId && newGroupId !== this.groupId) {
this.groupId = newGroupId
this.viewType = this.resolveViewType(this.$route.query.viewType)
this.queryParams.pageNum = 1
this.getList()
}
}
},
computed: {
...mapGetters(['roles']),
isHeadCustGroupAdmin() {
return ['headAdmin', 'headPublic', 'headPrivate', 'headOps'].some(role => this.roles.includes(role))
},
isMineView() {
return this.viewType === 'mine'
}
},
created() {
this.groupId = this.$route.query.groupId
this.viewType = this.$route.query.viewType || 'mine'
this.viewType = this.resolveViewType(this.$route.query.viewType)
if (this.groupId) {
this.getList()
} else {
@@ -129,22 +149,14 @@ export default {
this.goBack()
}
},
watch: {
'$route.query.groupId'(newGroupId) {
if (newGroupId && newGroupId !== this.groupId) {
this.groupId = newGroupId
this.viewType = this.$route.query.viewType || 'mine'
this.queryParams.pageNum = 1
this.getList()
}
}
},
computed: {
isMineView() {
return this.viewType === 'mine'
}
},
methods: {
resolveViewType(viewType) {
if (!this.isHeadCustGroupAdmin) {
return 'sharedToMe'
}
return viewType === 'sharedToMe' ? 'sharedToMe' : 'mine'
},
/** 查询客户列表 */
getList(param) {
if (param) {
@@ -189,17 +201,20 @@ export default {
goBack() {
const fromPerformance = this.$route.query.fromPerformance
if (fromPerformance === '1') {
// 从网格业绩统计页进入,返回网格业绩统计页的客群报表
this.$router.push({
path: '/center/performance/list',
query: { isActive: '8' }
})
return
}
// 返回上一级客群列表;没有历史记录时兜底跳客群列表
if (window.history.length > 1) {
this.$router.back()
} else {
// 从客群列表进入,返回客群列表
this.$router.push({
path: '/group/custGroup',
query: {
tab: this.viewType,
tab: this.resolveViewType(this.viewType),
refresh: Date.now()
}
})

View File

@@ -2,8 +2,20 @@
<div class="customer-wrap">
<div class="nav_box">
<el-radio-group v-model="activeTab" class="header-radio" @input="handleTabChange">
<el-radio-button label="mine">我创建的</el-radio-button>
<el-radio-button label="sharedToMe">下发给我的</el-radio-button>
<el-radio-button
label="mine"
:disabled="!isHeadCustGroupAdmin"
:class="{ 'btn-disabled': !isHeadCustGroupAdmin }"
>
我创建的
</el-radio-button>
<el-radio-button
label="sharedToMe"
:disabled="isHeadCustGroupAdmin"
:class="{ 'btn-disabled': isHeadCustGroupAdmin }"
>
下发给我的
</el-radio-button>
</el-radio-group>
</div>
@@ -190,6 +202,7 @@
<script>
import { listCustGroup, getCustGroup, deleteCustGroup, getAllGroupTags } from '@/api/group/custGroup'
import { mapGetters } from 'vuex'
import CreateDialog from './components/create-dialog'
export default {
@@ -223,26 +236,43 @@ export default {
}
},
computed: {
...mapGetters(['roles']),
isHeadCustGroupAdmin() {
return ['headAdmin', 'headPublic', 'headPrivate', 'headOps'].some(role => this.roles.includes(role))
},
isMineTab() {
return this.activeTab === 'mine'
}
},
created() {
this.activeTab = this.$route.query.tab || 'mine'
this.activeTab = this.resolveTab(this.$route.query.tab)
this.getList()
this.loadAllTags()
},
watch: {
'$route.query.refresh'() {
this.activeTab = this.$route.query.tab || 'mine'
this.activeTab = this.resolveTab(this.$route.query.tab)
this.queryParams.pageNum = 1
this.getList()
},
roles() {
const nextTab = this.resolveTab(this.activeTab)
if (nextTab !== this.activeTab) {
this.activeTab = nextTab
}
}
},
beforeDestroy() {
this.clearRefreshTimer()
},
methods: {
resolveTab(tab) {
if (!this.isHeadCustGroupAdmin) {
return 'sharedToMe'
}
return tab === 'sharedToMe' ? 'sharedToMe' : 'mine'
},
clearRefreshTimer() {
if (this.refreshTimer) {
clearTimeout(this.refreshTimer)
@@ -264,6 +294,7 @@ export default {
getList() {
this.loading = true
this.activeTab = this.resolveTab(this.activeTab)
this.queryParams.viewType = this.activeTab
listCustGroup(this.queryParams).then(response => {
this.groupList = response.rows
@@ -284,6 +315,7 @@ export default {
},
handleTabChange() {
this.activeTab = this.resolveTab(this.activeTab)
this.ids = []
this.single = true
this.multiple = true
@@ -336,7 +368,7 @@ export default {
handleView(row) {
this.$router.push({
path: '/group/custGroup/detail',
query: { groupId: row.id, viewType: this.activeTab }
query: { groupId: row.id, viewType: this.resolveTab(this.activeTab) }
})
},
@@ -397,6 +429,14 @@ export default {
justify-content: space-between;
border-bottom: 1px solid #ebebeb;
.btn-disabled {
::v-deep .el-radio-button__inner {
background-color: #e7e7e7;
color: #999999;
cursor: not-allowed;
}
}
.el-radio-button {
flex: 1;

View File

@@ -64,13 +64,37 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="有无管户" prop="forwardFlag">
<el-select
v-model="searchArray.forwardFlag"
placeholder="请选择"
clearable
style="width:100%"
>
<el-option
v-for="item in forwardFlagOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="searchFn">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetFn">重置</el-button>
<el-button
v-if="canForwardByRole"
type="warning"
icon="el-icon-share"
size="mini"
:disabled="!canBatchForward"
@click="openForwardDialog()"
>批量转发</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableData">
<el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
<template>
<el-table-column v-if="canForwardByRole" type="selection" width="55" :selectable="canSelectForwardRow" />
<el-table-column label="序号" prop="xh" width="80">
<template slot-scope="scope">
<span>{{ scope.$index+1 }}</span>
@@ -80,6 +104,7 @@
<el-table-column label="客户号" width="230" prop="custId" min-width="140" show-overflow-tooltip />
<el-table-column label="客户内码" width="200" prop="custIsn" min-width="140" show-overflow-tooltip />
<el-table-column label="客户经理" width="200" prop="userInfo" min-width="140" show-overflow-tooltip />
<el-table-column label="承接网点" width="180" prop="deptName" min-width="120" show-overflow-tooltip />
<el-table-column label="预警类型" width="250" prop="alterType" min-width="100" show-overflow-tooltip />
<el-table-column label="预警详情" prop="alterDetail" min-width="100" show-overflow-tooltip />
<el-table-column label="是否已读" prop="isReed" min-width="100" show-overflow-tooltip>
@@ -94,11 +119,18 @@
<span>{{ scope.row.status | formatFilter('status',statusList) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" width="160">
<el-table-column v-if="canForwardByRole" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="editFn(scope.row)">处理</el-button>
<el-button
v-if="scope.row.canForward"
size="mini"
type="text"
icon="el-icon-share"
@click="openForwardDialog(scope.row)"
>转发</el-button>
<span v-else>-</span>
</template>
</el-table-column> -->
</el-table-column>
</template>
</el-table>
<el-pagination
@@ -112,92 +144,65 @@
></el-pagination>
<el-dialog
:title="dialogTitle"
:visible.sync="visibleFlag"
width="800px"
title="转发预警"
:visible.sync="forwardVisible"
width="520px"
append-to-body
v-if="visibleFlag"
v-if="forwardVisible"
>
<el-form ref="dialogFormRef" :model="dialogForm" :rules="dialogFormRules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="客户姓名" prop="custName">
<el-input
v-model="dialogForm.custName"
placeholder="请输入客户姓名"
clearable
style="width:100%"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="客户号" prop="custId">
<el-input
v-model="dialogForm.custId"
placeholder="请输入客户号"
clearable
style="width:100%"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="预警类型" prop="alterType">
<el-input
v-model="dialogForm.alterType"
placeholder="请输入预警类型"
clearable
style="width:100%"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="预警详情" prop="alterDetail">
<el-input
v-model="dialogForm.alterDetail"
placeholder="请输入预警详情"
clearable
style="width:100%"
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态" prop="status">
<el-select
v-model="dialogForm.status"
placeholder="请选择状态"
clearable
style="width:100%"
>
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dialogForm.remark"
placeholder="请输入备注"
clearable
style="width:100%"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-form ref="forwardFormRef" :model="forwardForm" :rules="forwardRules" label-width="100px">
<el-form-item v-if="forwardMeta.historyOnly" label="转发方式">
<span>按历史推荐转发</span>
</el-form-item>
<el-form-item v-if="isBranchAdmin" label="转发类型" prop="targetType">
<template v-if="!forwardMeta.historyOnly">
<el-radio-group v-model="forwardForm.targetType">
<el-radio label="dept">转给网点</el-radio>
<el-radio label="user">转给客户经理</el-radio>
</el-radio-group>
</template>
</el-form-item>
<el-form-item v-if="!forwardMeta.historyOnly && forwardForm.targetType === 'dept'" label="目标网点" prop="deptId">
<el-select v-model="forwardForm.deptId" placeholder="请选择网点" style="width:100%">
<el-option
v-for="item in forwardMeta.deptOptions"
:key="item.targetCode"
:label="item.targetName"
:value="Number(item.targetCode)"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="!forwardMeta.historyOnly" label="客户经理" prop="userName">
<el-select
v-model="forwardForm.userName"
placeholder="请选择客户经理"
filterable
style="width:100%"
>
<el-option
v-for="item in forwardMeta.userOptions"
:key="item.targetCode"
:label="item.targetName"
:value="item.targetCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="forwardMeta.recommendedTargetCode && !isBatchForward && !forwardMeta.historyOnly"
label="历史推荐"
>
<div class="recommend-row">
<span>{{ recommendLabel }}</span>
<el-button type="text" @click="applyRecommend">使用历史推荐</el-button>
</div>
</el-form-item>
<el-form-item v-if="forwardMeta.historyOnly && isBatchForward" label="提示">
<span>本次多选中包含有历史分配记录的客户将按各自历史推荐自动转发没有历史记录的预警将保留不动</span>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="dialogOkfn"> </el-button>
<el-button @click="dialogCancelfn"> </el-button>
<el-button type="primary" :loading="forwardSubmitting" @click="submitForward"> </el-button>
<el-button @click="closeForwardDialog"> </el-button>
</div>
</el-dialog>
</div>
@@ -206,9 +211,10 @@
<script>
import {
warningworkRecordList,
warningworkRecordSubmit,
warningCardNum,
getAlterTypes
getAlterTypes,
getAlterForwardMeta,
forwardAlter
} from "@/api/system/home";
import _ from "lodash";
import dayjs from "dayjs";
@@ -232,6 +238,24 @@ export default {
} else {
return false;
}
},
isBranchAdmin() {
return this.roles.includes("branchAdmin");
},
isOutletAdmin() {
return this.roles.includes("outletAdmin");
},
canForwardByRole() {
return this.isBranchAdmin || this.isOutletAdmin;
},
canBatchForward() {
return this.selectedRows.length > 0 && this.selectedRows.every(item => item.canForward);
},
recommendLabel() {
if (!this.forwardMeta.recommendedTargetCode) {
return "";
}
return `${this.forwardMeta.recommendedTargetType === "dept" ? "网点" : "客户经理"}${this.forwardMeta.recommendedTargetName}`;
}
},
data() {
@@ -253,35 +277,45 @@ export default {
],
alterTypeOptions: [],
forwardFlagOptions: [
{ label: "有管户", value: "0" },
{ label: "无管户", value: "1" }
],
searchArray: {
status: "",
alterType: ""
alterType: "",
forwardFlag: ""
},
pageNum: 1,
pageSize: 10,
tableData: [],
selectedRows: [],
total: 0,
loading: false,
dialogTitle: '',
dialogForm: {
custName: '',
custId: '',
alterType: '',
alterDetail: '',
status: ''
forwardVisible: false,
forwardSubmitting: false,
isBatchForward: false,
forwardMeta: {
deptOptions: [],
userOptions: [],
recommendedTargetType: "",
recommendedTargetCode: "",
recommendedTargetName: "",
historyOnly: false,
hasHistoryRecommend: false
},
visibleFlag: false,
dialogFormRules: {
status: [{ required: true, message: "不能为空", trigger: "blur" }],
custName: [{ required: true, message: "不能为空", trigger: "blur" }],
custId: [{ required: true, message: "不能为空", trigger: "blur" }],
alterType: [
{ required: true, message: "不能为空", trigger: "blur" }
],
alterDetail: [
{ required: true, message: "不能为空", trigger: "blur" }
]
forwardForm: {
ids: [],
targetType: "user",
deptId: "",
userName: "",
useHistory: false
},
forwardRules: {
targetType: [{ required: true, message: "请选择转发类型", trigger: "change" }],
deptId: [{ required: true, message: "请选择目标网点", trigger: "change" }],
userName: [{ required: true, message: "请选择客户经理", trigger: "change" }]
}
};
},
@@ -314,7 +348,8 @@ export default {
resetFn() {
this.searchArray = {
status: "",
alterType: ""
alterType: "",
forwardFlag: ""
};
this.searchFn();
},
@@ -335,6 +370,7 @@ export default {
this.loading = false;
if (response.code == 200) {
this.tableData = response.rows || [];
this.selectedRows = [];
this.total = response.total || 0;
} else {
this.$message.error(response.msg || "操作失败");
@@ -349,33 +385,95 @@ export default {
this.pageSize = val;
this.queryListFn();
},
editFn(row) {
this.dialogTitle = "修改";
this.dialogForm = row;
this.visibleFlag = true;
// this.$nextTick(() => {
// this.$refs.dialogFormRef.resetFields();
// });
handleSelectionChange(rows) {
this.selectedRows = rows || [];
},
dialogOkfn() {
this.$refs["dialogFormRef"].validate(valid => {
if (valid) {
warningworkRecordSubmit(this.dialogForm).then(response => {
if (response.code == "200") {
let msg = "修改成功";
this.$message.success(msg);
this.visibleFlag = false;
this.resetFn();
} else {
this.$message.error(response.msg || "操作失败");
}
});
canSelectForwardRow(row) {
return !!row.canForward;
},
openForwardDialog(row) {
const rows = row ? [row] : this.selectedRows.filter(item => item.canForward);
if (!rows.length) {
this.$message.warning("请先选择可转发的预警信息");
return;
}
this.isBatchForward = rows.length > 1;
this.forwardVisible = true;
this.forwardSubmitting = false;
this.forwardForm = {
ids: rows.map(item => item.id),
targetType: this.isBranchAdmin ? "dept" : "user",
deptId: "",
userName: "",
useHistory: false
};
this.forwardMeta = {
deptOptions: [],
userOptions: [],
recommendedTargetType: "",
recommendedTargetCode: "",
recommendedTargetName: "",
historyOnly: false,
hasHistoryRecommend: false
};
this.$nextTick(() => {
this.$refs.forwardFormRef && this.$refs.forwardFormRef.clearValidate();
});
getAlterForwardMeta({ ids: rows.map(item => item.id).join(",") }).then(res => {
if (res.code !== 200) {
this.$message.error(res.msg || "获取转发信息失败");
return;
}
this.forwardMeta = res.data || this.forwardMeta;
this.forwardForm.useHistory = !!this.forwardMeta.historyOnly;
});
},
dialogCancelfn() {
this.visibleFlag = false;
applyRecommend() {
if (!this.forwardMeta.recommendedTargetCode) {
return;
}
if (this.forwardMeta.recommendedTargetType === "dept" && this.isOutletAdmin) {
return;
}
this.forwardForm.targetType = this.forwardMeta.recommendedTargetType || this.forwardForm.targetType;
if (this.forwardForm.targetType === "dept") {
this.forwardForm.deptId = Number(this.forwardMeta.recommendedTargetCode);
this.forwardForm.userName = "";
} else {
this.forwardForm.userName = this.forwardMeta.recommendedTargetCode;
this.forwardForm.deptId = "";
}
},
submitForward() {
if (this.forwardMeta.historyOnly) {
this.forwardForm.useHistory = true;
}
if (!this.forwardMeta.historyOnly && this.forwardForm.targetType === "dept" && !this.forwardForm.deptId) {
this.$message.warning("请选择目标网点");
return;
}
if (!this.forwardMeta.historyOnly && this.forwardForm.targetType === "user" && !this.forwardForm.userName) {
this.$message.warning("请选择客户经理");
return;
}
this.forwardSubmitting = true;
forwardAlter(this.forwardForm).then(response => {
this.forwardSubmitting = false;
if (response.code == 200) {
this.$message.success(response.msg || "转发完成");
this.closeForwardDialog();
this.queryListFn();
this.initCardList();
} else {
this.$message.error(response.msg || "操作失败");
}
}).catch(() => {
this.forwardSubmitting = false;
})
},
closeForwardDialog() {
this.forwardVisible = false;
}
}
};
</script>
@@ -509,4 +607,11 @@ export default {
}
}
}
</style>
.recommend-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
</style>