|
@@ -0,0 +1,1012 @@
|
|
|
+<script>
|
|
|
+import { defineComponent } from 'vue'
|
|
|
+export default defineComponent({
|
|
|
+ //进入前是否清除参数
|
|
|
+ beforeRouteEnter(to, from, next) {
|
|
|
+ if (from.path != "/customDetail") {
|
|
|
+ sessionStorage.removeItem("incrementBack");
|
|
|
+ }
|
|
|
+ next()
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+<script setup>
|
|
|
+import { equityTableColums } from "./configdata.js";
|
|
|
+import { dataMainInterface, customInterence } from "@/api/api.js";
|
|
|
+import mPage from "@/components/mPage.vue";
|
|
|
+import moment from "moment";
|
|
|
+import renewalListDia from "./components/renewalListDia.vue";
|
|
|
+import addRemark from "./components/noRenewalReasonDia/addRemark.vue";
|
|
|
+import viewRemark from "./components/noRenewalReasonDia/viewRemark.vue";
|
|
|
+import confirmedNoRenewal from "./components/noRenewalReasonDia/confirmedNoRenewal.vue";
|
|
|
+import PreviousDetail from "./components/previousDetail.vue";
|
|
|
+import RenewalRateDetail from "./components/renewalRateDetail.vue";
|
|
|
+import { computed, reactive,onMounted } from 'vue'
|
|
|
+import { onBeforeRouteLeave, useRouter } from "vue-router";
|
|
|
+import { Search, InfoFilled } from '@element-plus/icons-vue'
|
|
|
+import { formatTime } from '@/utils/date'
|
|
|
+
|
|
|
+const router = useRouter()
|
|
|
+
|
|
|
+onBeforeRouteLeave((to, form, next) => {
|
|
|
+ let backData = {
|
|
|
+ page_no: pageState.page_no,
|
|
|
+ end_date: pageState.end_date,
|
|
|
+ start_date: pageState.start_date,
|
|
|
+ filterObj: pageState.filterObj,
|
|
|
+ };
|
|
|
+ sessionStorage.setItem("incrementBack", JSON.stringify(backData));
|
|
|
+ next();
|
|
|
+})
|
|
|
+
|
|
|
+const pageState = reactive({
|
|
|
+ searchVal: sessionStorage.getItem("incrementBack") ? JSON.parse(sessionStorage.getItem("incrementBack")).searchVal : "",
|
|
|
+ tableData: [],
|
|
|
+ isShowloadding: false,
|
|
|
+ start_date: "",
|
|
|
+ end_date: "",
|
|
|
+ /* 筛选条件 */
|
|
|
+ filterObj: {
|
|
|
+ month: "近1个月",
|
|
|
+ date: [],
|
|
|
+ sale: "",
|
|
|
+ data_type: "新签客户",
|
|
|
+ },
|
|
|
+ monthLabel: [
|
|
|
+ {
|
|
|
+ label: "近1个月",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "近2个月",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "近3个月",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ salesArr: [], //销售列表
|
|
|
+ defaultSalesProps: {
|
|
|
+ multiple: true,
|
|
|
+ label: "RealName",
|
|
|
+ children: "ChildrenList",
|
|
|
+ value: "AdminId",
|
|
|
+ }, //销售级联配置
|
|
|
+ pageSize: 10,
|
|
|
+ page_no: sessionStorage.getItem("incrementBack") ? JSON.parse(sessionStorage.getItem("incrementBack")).page_no : 1,
|
|
|
+ total: 0,
|
|
|
+ data_typeArr: [
|
|
|
+ {
|
|
|
+ label: "新签客户",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "续约客户",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "未续约客户",
|
|
|
+ },
|
|
|
+ ], //数据类型
|
|
|
+ NewCompanyTotal: 0, //新签客户数
|
|
|
+ NotRenewalCompanyTotal: 0, //未续约客户数
|
|
|
+ RenewalCompanyTotal: 0, //续约客户数
|
|
|
+ NotRenewalCompanyToBeConfirmTotal: 0,
|
|
|
+ isRenewalShow: false, //未续约说明列表弹框是否显示
|
|
|
+ rowInfo: null, // 未续约说明更多行信息
|
|
|
+ tabsList: [
|
|
|
+ { name: "试用", value: "试用" },
|
|
|
+ { name: "冻结/流失", value: "非试用" },
|
|
|
+ ],
|
|
|
+ tabsActiveName: "",
|
|
|
+ NotRenewalNotTryOut: 0, //冻结流失的人数
|
|
|
+ NotRenewalTryOut: 0, //试用的人数
|
|
|
+ isNotRenewedConfirm: 1, //未续约的是否已确认
|
|
|
+ noRenewalReasonList: [],
|
|
|
+ noRenewalReasonId: "",
|
|
|
+ selectItemRow: {}, // 当前选中的row
|
|
|
+ // 添加备注
|
|
|
+ isAddRemarkShow: false,
|
|
|
+ //历史备注
|
|
|
+ isViewRemarkShow: false,
|
|
|
+ historyRemarkList: [],
|
|
|
+ //确认不续约
|
|
|
+ isConfirmNoRenewalShow: false,
|
|
|
+ confirmNoRenewalForm: {
|
|
|
+ reason: "",
|
|
|
+ detailReason: "",
|
|
|
+ },
|
|
|
+ incrementTableColums: [],
|
|
|
+ PackageDifference: "",
|
|
|
+ previousDetailDlg: false,
|
|
|
+ packageTypeList: ["增加套餐", "减少套餐", "维持套餐"],
|
|
|
+ yearValue: "",
|
|
|
+ showRenewalRateDetailDlg: false,
|
|
|
+ renewalRateDetailForm: {},
|
|
|
+ RenewalDataForm: {},
|
|
|
+})
|
|
|
+
|
|
|
+const exportExcel = computed(() => {
|
|
|
+ let baseUrl = import.meta.env.VITE_APP_API_ROOT + "/statistic_report/merge_company_list";
|
|
|
+ let token = localStorage.getItem("auth") || "";
|
|
|
+ let paramStr = "";
|
|
|
+ // 处理销售筛选
|
|
|
+ let salesArr = [];
|
|
|
+ if (pageState.filterObj.sale.length) {
|
|
|
+ salesArr = pageState.filterObj.sale.map((item) => {
|
|
|
+ return item[item.length - 1];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ AdminId: salesArr.join(","),
|
|
|
+ EndDate: pageState.end_date,
|
|
|
+ StartDate: pageState.start_date,
|
|
|
+ DataType: pageState.filterObj.data_type == "新增试用客户" ? "新增试用" : pageState.filterObj.data_type,
|
|
|
+ Keyword: pageState.searchVal,
|
|
|
+ IsExport: true,
|
|
|
+ IsConfirm: pageState.filterObj.data_type == "未续约客户" ? pageState.isNotRenewedConfirm : -1,
|
|
|
+ CompanyAscribeId: pageState.noRenewalReasonId,
|
|
|
+ };
|
|
|
+ for (let key in obj) {
|
|
|
+ paramStr = `${paramStr}&${key}=${obj[key]}`;
|
|
|
+ }
|
|
|
+ return `${baseUrl}?${token}${paramStr}`;
|
|
|
+})
|
|
|
+const Role = computed(() => {
|
|
|
+ let role = localStorage.getItem("Role") || "";
|
|
|
+ return role;
|
|
|
+})
|
|
|
+//管理权限
|
|
|
+const ManageType = computed(() => {
|
|
|
+ return localStorage.getItem("ManageType") || "";
|
|
|
+})
|
|
|
+//确认未续约权限
|
|
|
+const canConfirmNotRenewed = computed(() => {
|
|
|
+ return ["admin", "rai_admin"].includes(pageState.Role);
|
|
|
+})
|
|
|
+
|
|
|
+
|
|
|
+// 搜索
|
|
|
+function handleSearch() {
|
|
|
+ if (!pageState.searchVal) {
|
|
|
+ pageState.page_no = 1;
|
|
|
+ pageState.filterObj = {
|
|
|
+ month: "近1个月",
|
|
|
+ date: [],
|
|
|
+ sale: "",
|
|
|
+ data_type: pageState.filterObj.data_type,
|
|
|
+ };
|
|
|
+ let date_before = moment().subtract(1, "M").format("YYYY-MM-DD");
|
|
|
+ let date_now = moment().format("YYYY-MM-DD");
|
|
|
+ let date = [date_before, date_now];
|
|
|
+ pageState.start_date = date_before;
|
|
|
+ pageState.end_date = date_now;
|
|
|
+ pageState.filterObj.date = date;
|
|
|
+ getTableData();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ pageState.page_no = 1;
|
|
|
+ pageState.filterObj = {
|
|
|
+ month: "",
|
|
|
+ date: [],
|
|
|
+ sale: "",
|
|
|
+ data_type: pageState.filterObj.data_type,
|
|
|
+ };
|
|
|
+ pageState.start_date = "";
|
|
|
+ pageState.end_date = "";
|
|
|
+ getTableData();
|
|
|
+}
|
|
|
+
|
|
|
+function notRenewedConfirmChange() {
|
|
|
+ pageState.tabsActiveName = "";
|
|
|
+ pageState.noRenewalReasonId = "";
|
|
|
+ pageState.page_no = 1;
|
|
|
+ getTableData();
|
|
|
+}
|
|
|
+function notPackageDifferenceChange(type) {
|
|
|
+ if (pageState.PackageDifference == type) {
|
|
|
+ pageState.PackageDifference = "";
|
|
|
+ } else {
|
|
|
+ pageState.PackageDifference = type;
|
|
|
+ }
|
|
|
+ pageState.page_no = 1;
|
|
|
+ getTableData();
|
|
|
+}
|
|
|
+/* 获取表格 */
|
|
|
+function getTableData() {
|
|
|
+ pageState.isShowloadding = true;
|
|
|
+ // 处理销售筛选
|
|
|
+ let salesArr = [];
|
|
|
+ if (pageState.filterObj.sale.length) {
|
|
|
+ salesArr = pageState.filterObj.sale.map((item) => {
|
|
|
+ return item[item.length - 1];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ Keyword: pageState.searchVal,
|
|
|
+ PageSize: pageState.pageSize,
|
|
|
+ CurrentIndex: pageState.page_no,
|
|
|
+ AdminId: salesArr.join(","),
|
|
|
+ EndDate: pageState.end_date,
|
|
|
+ StartDate: pageState.start_date,
|
|
|
+ DataType: pageState.filterObj.data_type == "新增试用客户" ? "新增试用" : pageState.filterObj.data_type,
|
|
|
+ TryOutType: pageState.filterObj.data_type == "未续约客户" && pageState.isNotRenewedConfirm == 1 ? pageState.tabsActiveName : "",
|
|
|
+ IsConfirm: pageState.filterObj.data_type == "未续约客户" ? pageState.isNotRenewedConfirm : -1,
|
|
|
+ CompanyAscribeId: pageState.noRenewalReasonId,
|
|
|
+ PackageDifference: pageState.PackageDifference,
|
|
|
+ };
|
|
|
+ dataMainInterface.incrementalEquityList(params).then((res) => {
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ pageState.tableData = res.Data.List || [];
|
|
|
+ pageState.total = res.Data.Paging.Totals;
|
|
|
+ pageState.NewCompanyTotal = res.Data.NewCompanyTotal;
|
|
|
+ pageState.RenewalCompanyTotal = res.Data.RenewalCompanyTotal;
|
|
|
+ pageState.NotRenewalCompanyTotal = res.Data.NotRenewalCompanyTotal;
|
|
|
+ pageState.NotRenewalCompanyToBeConfirmTotal = res.Data.NotRenewalCompanyToBeConfirmTotal;
|
|
|
+ pageState.NotRenewalTryOut = res.Data.NotRenewalTryOut;
|
|
|
+ pageState.NotRenewalNotTryOut = res.Data.NotRenewalNotTryOut;
|
|
|
+ pageState.isShowloadding = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+/* 获取销售 */
|
|
|
+function getSale() {
|
|
|
+ customInterence.getSalesRaiData().then((res) => {
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ pageState.salesArr = res.Data.List;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+/* 切换月份 */
|
|
|
+function toggleMonth(label) {
|
|
|
+ pageState.filterObj.month = label;
|
|
|
+ let days = label == "近1个月" ? 1 : label == "近2个月" ? 2 : label == "近3个月" ? 3 : 0;
|
|
|
+ filterDate(days);
|
|
|
+}
|
|
|
+/* 选择服务日期 */
|
|
|
+function dateChange(e) {
|
|
|
+ if (e[0]) {
|
|
|
+ pageState.start_date = e[0];
|
|
|
+ pageState.end_date = e[1];
|
|
|
+ } else {
|
|
|
+ pageState.start_date = "";
|
|
|
+ pageState.end_date = "";
|
|
|
+ }
|
|
|
+ pageState.filterObj.month = "";
|
|
|
+ pageState.page_no = 1;
|
|
|
+ pageState.searchVal = "";
|
|
|
+ getTableData();
|
|
|
+}
|
|
|
+/* 切换数据类型 */
|
|
|
+function toggleType(label) {
|
|
|
+ pageState.filterObj.data_type = label;
|
|
|
+ pageState.incrementTableColums = equityTableColums(pageState.filterObj.data_type);
|
|
|
+ pageState.noRenewalReasonId = "";
|
|
|
+ if (label == "未续约客户") {
|
|
|
+ getNORenewalReasonList();
|
|
|
+ }
|
|
|
+ pageState.tabsActiveName = "";
|
|
|
+ pageState.page_no = 1;
|
|
|
+ getTableData();
|
|
|
+}
|
|
|
+/* 筛选改变时 */
|
|
|
+function changeFilter() {
|
|
|
+ pageState.page_no = 1;
|
|
|
+ pageState.searchVal = "";
|
|
|
+ getTableData();
|
|
|
+ if (pageState.yearValue.length > 0) {
|
|
|
+ getIncrementalCompanyContractPercentageList();
|
|
|
+ }
|
|
|
+}
|
|
|
+/* 切换页码 */
|
|
|
+function handleCurrentChange(page) {
|
|
|
+ pageState.page_no = page;
|
|
|
+ getTableData();
|
|
|
+}
|
|
|
+/* 获取近几个月的日期范围 */
|
|
|
+function filterDate(month) {
|
|
|
+ if (month) {
|
|
|
+ let date_before = moment().subtract(month, "M").format("YYYY-MM-DD");
|
|
|
+ let date_now = moment().format("YYYY-MM-DD");
|
|
|
+ let date = [date_before, date_now];
|
|
|
+ pageState.start_date = date_before;
|
|
|
+ pageState.end_date = date_now;
|
|
|
+ pageState.filterObj.date = date;
|
|
|
+ pageState.page_no = 1;
|
|
|
+ pageState.searchVal = "";
|
|
|
+ getTableData();
|
|
|
+ }
|
|
|
+}
|
|
|
+/* 跳转 */
|
|
|
+function jumpHandle(row, item) {
|
|
|
+ if (item.link) {
|
|
|
+ let { href } = router.resolve({
|
|
|
+ path: "/customDetail",
|
|
|
+ query: {
|
|
|
+ id: row.CompanyId,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ window.open(href, "_blank");
|
|
|
+ }
|
|
|
+}
|
|
|
+function getNORenewalReasonList() {
|
|
|
+ dataMainInterface.getAscribList().then((res) => {
|
|
|
+ if (res.Ret == 200) {
|
|
|
+ pageState.noRenewalReasonList = res.Data.List || [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+// 未续约说明更多按钮
|
|
|
+function renewalReasonMore(row) {
|
|
|
+ pageState.rowInfo = {
|
|
|
+ CompanyId: row.CompanyId,
|
|
|
+ ProductId: row.ProductId,
|
|
|
+ };
|
|
|
+ pageState.isRenewalShow = true;
|
|
|
+}
|
|
|
+// 添加备注
|
|
|
+function addRemarkFun(row) {
|
|
|
+ pageState.selectItemRow = row;
|
|
|
+ pageState.isAddRemarkShow = true;
|
|
|
+}
|
|
|
+// 添加备注 保存
|
|
|
+function saveRemark(remark) {
|
|
|
+ // console.log(remark);
|
|
|
+ let params = {
|
|
|
+ CompanyId: pageState.selectItemRow.CompanyId,
|
|
|
+ ProductId: pageState.selectItemRow.ProductId,
|
|
|
+ Content: remark,
|
|
|
+ };
|
|
|
+ dataMainInterface.addNotRenewedRemark(params).then((res) => {
|
|
|
+ if (res.Ret == 200) {
|
|
|
+ ElMessage.success("添加成功");
|
|
|
+ getTableData();
|
|
|
+ pageState.isAddRemarkShow = false;
|
|
|
+ pageState.selectItemRow = {};
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+// 查看历史备注
|
|
|
+function viewHistoryRemarkFun(row) {
|
|
|
+ dataMainInterface.getNotRenewedRemarkList({ CompanyId: row.CompanyId, ProductId: row.ProductId }).then((res) => {
|
|
|
+ if (res.Ret == 200) {
|
|
|
+ pageState.historyRemarkList = res.Data.List || [];
|
|
|
+ pageState.isViewRemarkShow = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+function confirmedNoRenewalFun(row) {
|
|
|
+ pageState.confirmNoRenewalForm.reason = "";
|
|
|
+ pageState.confirmNoRenewalForm.detailReason = "";
|
|
|
+ pageState.selectItemRow = row;
|
|
|
+ pageState.isConfirmNoRenewalShow = true;
|
|
|
+}
|
|
|
+function editReasonLabel(row) {
|
|
|
+ dataMainInterface.contractInfoNoRenewedAscribe({ CompanyContractId: row.CompanyContractId }).then((res) => {
|
|
|
+ if (res.Ret == 200) {
|
|
|
+ pageState.confirmNoRenewalForm.reason = res.Data.Detail ? res.Data.Detail.CompanyAscribeId || "" : "";
|
|
|
+ pageState.confirmNoRenewalForm.detailReason = res.Data.Detail ? res.Data.Detail.Content || "" : "";
|
|
|
+ pageState.selectItemRow = row;
|
|
|
+ pageState.isConfirmNoRenewalShow = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+function saveLabel(item) {
|
|
|
+ let params = {
|
|
|
+ CompanyContractId: pageState.selectItemRow.CompanyContractId,
|
|
|
+ CompanyAscribeId: item.CompanyAscribeId,
|
|
|
+ Content: item.Content,
|
|
|
+ };
|
|
|
+ dataMainInterface.addAscribContract(params).then((res) => {
|
|
|
+ if (res.Ret == 200) {
|
|
|
+ ElMessage.success("确认成功");
|
|
|
+ pageState.isConfirmNoRenewalShow = false;
|
|
|
+ pageState.selectItemRow = {};
|
|
|
+ getTableData();
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+function previousDetailHadler(row) {
|
|
|
+ pageState.rowInfo = row;
|
|
|
+ pageState.previousDetailDlg = true;
|
|
|
+}
|
|
|
+function lableTextDisplay(text) {
|
|
|
+ let str = text == "新签客户" ? "新签合同" : text == "续约客户" ? "续约合同" : "未续约客户";
|
|
|
+ return str;
|
|
|
+}
|
|
|
+// 年度续约的标签点击事件
|
|
|
+function annualSelectHandler(item) {
|
|
|
+ pageState.annualSelectActivue = item.name;
|
|
|
+ getIncrementalCompanyContractPercentageList();
|
|
|
+}
|
|
|
+// 点击了续约率
|
|
|
+function renewalRateLableHandler() {
|
|
|
+ pageState.showRenewalRateDetailDlg = true;
|
|
|
+ pageState.renewalRateDetailForm = initCompanyContractPercentageList();
|
|
|
+}
|
|
|
+// 获取年度续约的数据
|
|
|
+async function getIncrementalCompanyContractPercentageList() {
|
|
|
+ let params = initCompanyContractPercentageList();
|
|
|
+ const res = await dataMainInterface.incrementalCompanyContractPercentageListV2(params);
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ pageState.RenewalDataForm = res.Data;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 处理年度续约的数据
|
|
|
+function initCompanyContractPercentageList() {
|
|
|
+ let salesArr = [];
|
|
|
+ if (pageState.filterObj.sale.length) {
|
|
|
+ salesArr = pageState.filterObj.sale.map((item) => {
|
|
|
+ return item[item.length - 1];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ EndDate: pageState.yearValue.length > 0 ? pageState.yearValue[1] : "",
|
|
|
+ StartDate: pageState.yearValue.length > 0 ? pageState.yearValue[0] : "",
|
|
|
+ AdminId: salesArr.join(","),
|
|
|
+ };
|
|
|
+ return params;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ pageState.incrementTableColums = equityTableColums(pageState.filterObj.data_type);
|
|
|
+ getSale();
|
|
|
+ if (sessionStorage.getItem("incrementBack")) {
|
|
|
+ let backData = JSON.parse(sessionStorage.getItem("incrementBack"));
|
|
|
+ pageState.page_no = backData.page_no;
|
|
|
+ pageState.end_date = backData.end_date;
|
|
|
+ pageState.start_date = backData.start_date;
|
|
|
+ pageState.filterObj = backData.filterObj;
|
|
|
+ pageState.searchVal = backData.searchVal;
|
|
|
+ }
|
|
|
+ /* 默认选中近1个月 */
|
|
|
+ filterDate(pageState.filterObj.month === "近1个月" ? 1 : pageState.filterObj.month === "近2个月" ? 2 : pageState.filterObj.month === "近3个月" ? 3 : 0);
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div class="dataReport-container" id="dataReport-container">
|
|
|
+ <div class="dataReport-top">
|
|
|
+ <a :href="exportExcel" download>
|
|
|
+ <button class="button-sty act">导出EXCEL</button>
|
|
|
+ </a>
|
|
|
+ <button
|
|
|
+ :class="[
|
|
|
+ 'button-sty',
|
|
|
+ { act: pageState.filterObj.month === item.label },
|
|
|
+ ]"
|
|
|
+ v-for="item in pageState.monthLabel"
|
|
|
+ @click="toggleMonth(item.label)"
|
|
|
+ :key="item.label"
|
|
|
+ >
|
|
|
+ {{ item.label }}
|
|
|
+ </button>
|
|
|
+ <date-picker
|
|
|
+ v-model="pageState.filterObj.date"
|
|
|
+ type="daterange"
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="自定义时间段"
|
|
|
+ :clearable="false"
|
|
|
+ :editable="false"
|
|
|
+ @change="dateChange"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入客户名称"
|
|
|
+ v-model="pageState.searchVal"
|
|
|
+ style="width: 400px; margin-left: auto"
|
|
|
+ @input="handleSearch"
|
|
|
+ clearable
|
|
|
+ :prefix-icon="Search"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <div class="dataReport-main">
|
|
|
+ <div class="main-top">
|
|
|
+ <el-cascader
|
|
|
+ v-if="
|
|
|
+ Role == 'finance' ||
|
|
|
+ Role == 'admin' ||
|
|
|
+ Role == 'ficc_admin' ||
|
|
|
+ Role == 'rai_admin' ||
|
|
|
+ ManageType != 0
|
|
|
+ "
|
|
|
+ v-model="pageState.filterObj.sale"
|
|
|
+ placeholder="请选择销售"
|
|
|
+ style="min-width: 250px; margin-right: 10px; margin-bottom: 8px"
|
|
|
+ :options="pageState.salesArr"
|
|
|
+ :props="pageState.defaultSalesProps"
|
|
|
+ :show-all-levels="false"
|
|
|
+ collapse-tags
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ @change="changeFilter"
|
|
|
+ >
|
|
|
+ </el-cascader>
|
|
|
+ </div>
|
|
|
+ <div class="main-section">
|
|
|
+ <div v-for="item in pageState.data_typeArr" :key="item.label">
|
|
|
+ <el-card
|
|
|
+ style="margin-right: 50px"
|
|
|
+ :class="[
|
|
|
+ 'base-card',
|
|
|
+ { 'main-card': pageState.filterObj.data_type === item.label },
|
|
|
+ ]"
|
|
|
+ shadow="hover"
|
|
|
+ @click="toggleType(item.label)"
|
|
|
+ >
|
|
|
+ <template #header>
|
|
|
+ <div class="clearfix">
|
|
|
+ <span>
|
|
|
+ {{ lableTextDisplay(item.label) }}数
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ :content="
|
|
|
+ item.label === '新签客户'
|
|
|
+ ? '<br />'
|
|
|
+ : item.label === '续约客户'
|
|
|
+ ? '起始时间在所选时间段内的续约合同'
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <template #content>
|
|
|
+ <div v-if="item.label === '新签客户'">
|
|
|
+ <p>起始时间在所选时间段内的新签合同</p>
|
|
|
+ <p>
|
|
|
+ (第一份合同起始时间一年内的再次签约仍属于新签合同)
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.label === '续约客户'">
|
|
|
+ <p>起始时间在所选时间段内的续约合同</p>
|
|
|
+ <p>
|
|
|
+ (第一份合同起始时间一年以后的再次签约均属于续约合同)
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <p v-else>
|
|
|
+ 合同截止时间在所选时间段内的非正式、非永续客户
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ <el-icon><InfoFilled /></el-icon>
|
|
|
+ </el-tooltip>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="card-cont">
|
|
|
+ {{
|
|
|
+ item.label === "新签客户"
|
|
|
+ ? pageState.NewCompanyTotal
|
|
|
+ : item.label === "续约客户"
|
|
|
+ ? pageState.RenewalCompanyTotal
|
|
|
+ : item.label === "未续约客户"
|
|
|
+ ? pageState.NotRenewalCompanyTotal +
|
|
|
+ " / " +
|
|
|
+ pageState.NotRenewalCompanyToBeConfirmTotal
|
|
|
+ : ""
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ <div class="annual-select-content">
|
|
|
+ <div class="select-content">
|
|
|
+ <div class="lable-text">
|
|
|
+ 不续约率
|
|
|
+ <el-tooltip
|
|
|
+ style="margin-right: 16px"
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="所选年度的续约合同/所选年度的到期合同"
|
|
|
+ placement="top-start"
|
|
|
+ >
|
|
|
+ <template #content>
|
|
|
+ <div>
|
|
|
+ <p>
|
|
|
+ 所选时间段的已确认不续约的合同金额/所选时间段的到期的合同金额
|
|
|
+ </p>
|
|
|
+ <p>(剔除非业务不续约的金额)</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <el-icon><InfoFilled /></el-icon>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="pageState.yearValue"
|
|
|
+ type="daterange"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ :clearable="false"
|
|
|
+ @change="getIncrementalCompanyContractPercentageList"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ <div class="select-content">
|
|
|
+ <span
|
|
|
+ class="editsty"
|
|
|
+ v-if="pageState.RenewalDataForm.RenewalRateMoney"
|
|
|
+ @click="renewalRateLableHandler"
|
|
|
+ > {{
|
|
|
+ pageState.RenewalDataForm.RenewalRateMoney
|
|
|
+ }} </span
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ pageState.RenewalDataForm.RenewalRateTotalContent
|
|
|
+ ? `(${pageState.RenewalDataForm.RenewalRateTotalContent})`
|
|
|
+ : " - -"
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="tabs-box" v-if="pageState.filterObj.data_type == '续约客户'">
|
|
|
+ <div class="tabs-box-confirm">
|
|
|
+ <div
|
|
|
+ style="margin-bottom: 0px"
|
|
|
+ class="tabs-box-confirm"
|
|
|
+ v-for="(item, index) in pageState.packageTypeList"
|
|
|
+ :key="item"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ :class="[
|
|
|
+ 'confirm-box-li',
|
|
|
+ pageState.PackageDifference == item && 'active',
|
|
|
+ ]"
|
|
|
+ @click="notPackageDifferenceChange(item)"
|
|
|
+ >
|
|
|
+ {{ item }}
|
|
|
+ </div>
|
|
|
+ <div v-if="index != 2" class="center-line"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="tabs-box"
|
|
|
+ v-if="pageState.filterObj.data_type == '未续约客户'"
|
|
|
+ >
|
|
|
+ <el-radio-group
|
|
|
+ v-model="pageState.isNotRenewedConfirm"
|
|
|
+ class="tabs-box-confirm"
|
|
|
+ @change="notRenewedConfirmChange"
|
|
|
+ >
|
|
|
+ <el-radio-button :label="1">已确认</el-radio-button>
|
|
|
+ <div class="center-line"></div>
|
|
|
+ <el-radio-button :label="0">待确认</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ <div class="tabs-box-status" v-show="pageState.isNotRenewedConfirm">
|
|
|
+ <el-select
|
|
|
+ v-model="pageState.noRenewalReasonId"
|
|
|
+ placeholder="请选择不续约归因"
|
|
|
+ clearable
|
|
|
+ @change="getTableData"
|
|
|
+ style="width: 240px; margin-right: 50px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ :label="item.AscribeContent"
|
|
|
+ :value="item.CompanyAscribeId"
|
|
|
+ v-for="item in pageState.noRenewalReasonList"
|
|
|
+ :key="item.reasonId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select
|
|
|
+ v-model="pageState.tabsActiveName"
|
|
|
+ placeholder="当前状态"
|
|
|
+ clearable
|
|
|
+ @change="getTableData"
|
|
|
+ style="width: 240px; margin-right: 50px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.value"
|
|
|
+ v-for="item in pageState.tabsList"
|
|
|
+ :key="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="pageState.tableData"
|
|
|
+ border
|
|
|
+ style="margin-top: 20px; min-height: 400px"
|
|
|
+ v-loading="pageState.isShowloadding"
|
|
|
+ element-loading-text="数据加载中..."
|
|
|
+ >
|
|
|
+ <template v-for="item in pageState.incrementTableColums">
|
|
|
+ <el-table-column
|
|
|
+ :key="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ :width="item.widthsty"
|
|
|
+ align="center"
|
|
|
+ v-if="item.key != 'AscribeContent'"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <span
|
|
|
+ :style="item.textsty"
|
|
|
+ @click="jumpHandle(scope.row, item)"
|
|
|
+ v-if="item.key === 'CreateTime'"
|
|
|
+ >
|
|
|
+ {{ formatTime(scope.row[item.key]) }}
|
|
|
+ </span>
|
|
|
+ <span v-else-if="item.label == '未续约说明'">
|
|
|
+ <span style="display: block" v-if="scope.row[item.key]"
|
|
|
+ >最新情况:{{ scope.row[item.key] }}</span
|
|
|
+ >
|
|
|
+ <span v-if="scope.row.RenewalTodo"
|
|
|
+ >To Do 事项:{{ scope.row.RenewalTodo }}</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-if="scope.row[item.key] || scope.row.RenewalTodo"
|
|
|
+ style="color: #409eff; cursor: pointer"
|
|
|
+ @click="renewalReasonMore(scope.row)"
|
|
|
+ > 更多>></span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <div v-else-if="item.key == 'CompanyName'" style="padding: 4px 0">
|
|
|
+ <span
|
|
|
+ :style="item.textsty"
|
|
|
+ @click="jumpHandle(scope.row, item)"
|
|
|
+ >
|
|
|
+ {{ scope.row[item.key] }}
|
|
|
+ </span>
|
|
|
+ <div
|
|
|
+ class="package-difference"
|
|
|
+ v-if="
|
|
|
+ scope.row.PackageDifference &&
|
|
|
+ pageState.filterObj.data_type == '续约客户'
|
|
|
+ "
|
|
|
+ @click="previousDetailHadler(scope.row)"
|
|
|
+ >
|
|
|
+ {{ scope.row.PackageDifference }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.key === 'Remark'" class="remark-row">
|
|
|
+ <span
|
|
|
+ class="remark-text"
|
|
|
+ @click="viewHistoryRemarkFun(scope.row)"
|
|
|
+ v-if="scope.row.IsShowNoRenewedNote"
|
|
|
+ >...</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="operation-button"
|
|
|
+ v-show="
|
|
|
+ pageState.canConfirmNotRenewed &&
|
|
|
+ !pageState.isNotRenewedConfirm
|
|
|
+ "
|
|
|
+ style="margin-right: 0"
|
|
|
+ @click="addRemarkFun(scope.row)"
|
|
|
+ >添加</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.key == 'AscribeContent'">
|
|
|
+ <span
|
|
|
+ style="color: #409eff; cursor: pointer"
|
|
|
+ @click="editReasonLabel(scope.row)"
|
|
|
+ >
|
|
|
+ {{ scope.row[item.key] }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.key == 'PermissionName'">
|
|
|
+ <template v-if="scope.row.PermissionName.length">
|
|
|
+ <el-tag
|
|
|
+ size="mini"
|
|
|
+ style="margin: 0 10px 10px 0"
|
|
|
+ v-for="key in scope.row.PermissionName.split(',')"
|
|
|
+ :key="key"
|
|
|
+ >{{ key }}</el-tag
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.key == 'StartDate'">
|
|
|
+ <span>
|
|
|
+ {{ scope.row[item.key] }} ~ {{ scope.row.EndDate }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <span
|
|
|
+ v-else
|
|
|
+ :style="item.textsty"
|
|
|
+ @click="jumpHandle(scope.row, item)"
|
|
|
+ >
|
|
|
+ {{ scope.row[item.key] }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :key="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ :width="item.widthsty"
|
|
|
+ align="center"
|
|
|
+ v-else-if="
|
|
|
+ item.key == 'AscribeContent' && pageState.isNotRenewedConfirm == 1
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <span
|
|
|
+ style="color: #409eff; cursor: pointer"
|
|
|
+ @click="editReasonLabel(scope.row)"
|
|
|
+ >
|
|
|
+ {{ scope.row[item.key] }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ width="180px"
|
|
|
+ align="center"
|
|
|
+ v-if="
|
|
|
+ pageState.canConfirmNotRenewed &&
|
|
|
+ !pageState.isNotRenewedConfirm &&
|
|
|
+ pageState.filterObj.data_type == '未续约客户'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="operation-row">
|
|
|
+ <span
|
|
|
+ class="operation-button"
|
|
|
+ @click="confirmedNoRenewalFun(scope.row)"
|
|
|
+ >确认不续约</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <template #empty>
|
|
|
+ <div style="line-height: 44px; margin: 60px 0; color: #999">
|
|
|
+ <img
|
|
|
+ src="~@/assets/img/cus_m/nodata.png"
|
|
|
+ alt=""
|
|
|
+ style="display: block; width: 160px; height: 128px; margin: auto"
|
|
|
+ />
|
|
|
+ <span>暂无数据</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ <el-col :span="24" class="toolbar" v-if="pageState.total">
|
|
|
+ <m-page
|
|
|
+ :total="pageState.total"
|
|
|
+ :page_no="pageState.page_no"
|
|
|
+ @handleCurrentChange="handleCurrentChange"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ <!-- 未续约说明列表弹窗 -->
|
|
|
+ <renewalListDia
|
|
|
+ v-model:isShow="pageState.isRenewalShow"
|
|
|
+ :rowInfo="pageState.rowInfo"
|
|
|
+ />
|
|
|
+ <!-- 添加备注弹窗 -->
|
|
|
+ <addRemark
|
|
|
+ v-model:isShow="pageState.isAddRemarkShow"
|
|
|
+ @saveRemark="saveRemark"
|
|
|
+ />
|
|
|
+ <!-- 历史备注弹窗 -->
|
|
|
+ <viewRemark
|
|
|
+ v-model:isShow="pageState.isViewRemarkShow"
|
|
|
+ :tableData="pageState.historyRemarkList"
|
|
|
+ />
|
|
|
+ <!-- 确认不续约弹窗 -->
|
|
|
+ <confirmedNoRenewal
|
|
|
+ v-model:isShow="isConfirmNoRenewalShow"
|
|
|
+ :dataForm="pageState.confirmNoRenewalForm"
|
|
|
+ :noRenewalReasonList="pageState.noRenewalReasonList"
|
|
|
+ @refreshReasonList="getNORenewalReasonList"
|
|
|
+ @saveLabel="saveLabel"
|
|
|
+ equityType="权益客户统计"
|
|
|
+ />
|
|
|
+ <previous-detail
|
|
|
+ v-model:previousDetailDlg="pageState.previousDetailDlg"
|
|
|
+ :rowInfo="pageState.rowInfo"
|
|
|
+ />
|
|
|
+ <RenewalRateDetail
|
|
|
+ v-model:showRenewalRateDetailDlg="pageState.showRenewalRateDetailDlg"
|
|
|
+ v-model:renewalRateDetailForm="pageState.renewalRateDetailForm"
|
|
|
+ :noRenewalReasonListSon="pageState.noRenewalReasonList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "./index.scss";
|
|
|
+.tabs-box {
|
|
|
+ flex-direction: column;
|
|
|
+ .tabs-box-confirm {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ .center-line {
|
|
|
+ width: 1px;
|
|
|
+ height: 21px;
|
|
|
+ background-color: #333333;
|
|
|
+ margin: 0 20px;
|
|
|
+ }
|
|
|
+ .confirm-box-li {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 120px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ background-color: #409eff;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.operation-button {
|
|
|
+ color: #409eff;
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 14px;
|
|
|
+ margin-right: 10px;
|
|
|
+}
|
|
|
+.remark-row {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ .remark-text {
|
|
|
+ width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ margin-right: 8px;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #409eff;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+}
|
|
|
+.operation-row {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .operation-button {
|
|
|
+ &:last-child {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.package-difference {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.annual-select-content {
|
|
|
+ .select-content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ .lable-text {
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+ .select-lable {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-left: 10px;
|
|
|
+ width: 92px;
|
|
|
+ height: 40px;
|
|
|
+ color: #409eff;
|
|
|
+ background-color: #ecf5ff;
|
|
|
+ border: 1px solid #b3d8ff;
|
|
|
+ border-radius: 4px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .act-select-lable {
|
|
|
+ color: #fff;
|
|
|
+ background-color: #409eff;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+#dataReport-container {
|
|
|
+ .tabs-box {
|
|
|
+ .el-radio-button {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ .el-radio-button .el-radio-button__inner {
|
|
|
+ border: none;
|
|
|
+ width: 120px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|